From b4c4d6f242566b17e52ed2012d42942f4444a8b7 Mon Sep 17 00:00:00 2001 From: yuiseki Date: Sun, 17 Dec 2023 08:26:02 +0000 Subject: [PATCH] deploy: 39ac35bbce956521c6ccf96244e7f7ed671de8e6 --- .nojekyll | 0 assets/index-1xxH6DAM.css | 1 + assets/index-qqCuPnjh.js | 625 ++++++++++++++++++++++++++++++++++++++ index.html | 14 + style.json | 461 ++++++++++++++++++++++++++++ vite.svg | 1 + 6 files changed, 1102 insertions(+) create mode 100644 .nojekyll create mode 100644 assets/index-1xxH6DAM.css create mode 100644 assets/index-qqCuPnjh.js create mode 100644 index.html create mode 100644 style.json create mode 100644 vite.svg diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/assets/index-1xxH6DAM.css b/assets/index-1xxH6DAM.css new file mode 100644 index 0000000..92a3d5d --- /dev/null +++ b/assets/index-1xxH6DAM.css @@ -0,0 +1 @@ +.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.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;-moz-user-select:none;-webkit-user-select:none;-ms-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 #0000001a}@media (-ms-high-contrast: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 (-ms-high-contrast: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:#0000000d}.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 13h-9z'/%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.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast: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 13h-9z'/%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.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.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 13h-9z'/%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.5z'/%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-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%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-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast: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-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%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-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.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-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%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-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%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 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast: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 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.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 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast: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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%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-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}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.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 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.4.314.319.566.676.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.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.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.76 4.76 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.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 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.528 0 .343-.02.694-.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.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 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.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 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.703 4.703 0 0 1-1.782 1.884 4.767 4.767 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.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 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.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 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.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 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-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.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.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.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.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 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.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%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 (-ms-high-contrast: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.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 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.4.314.319.566.676.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.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.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.76 4.76 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.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 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.528 0 .343-.02.694-.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.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 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.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 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.703 4.703 0 0 1-1.782 1.884 4.767 4.767 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.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 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.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 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.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 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-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.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.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.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.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 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.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){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.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 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.4.314.319.566.676.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.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.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.76 4.76 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.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 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.528 0 .343-.02.694-.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.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 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.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 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.703 4.703 0 0 1-1.782 1.884 4.767 4.767 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.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 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.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 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.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 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-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.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.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.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.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 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.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;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:#ffffff80;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:#0000000d}.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 (-ms-high-contrast: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 (-ms-high-contrast:black-on-white){.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:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;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:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;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;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;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 #00000059;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:#0006;color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left: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}body{margin:0;padding:0} diff --git a/assets/index-qqCuPnjh.js b/assets/index-qqCuPnjh.js new file mode 100644 index 0000000..a77dc71 --- /dev/null +++ b/assets/index-qqCuPnjh.js @@ -0,0 +1,625 @@ +function vb(i,r){for(var l=0;lp[_]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))p(_);new MutationObserver(_=>{for(const w of _)if(w.type==="childList")for(const I of w.addedNodes)I.tagName==="LINK"&&I.rel==="modulepreload"&&p(I)}).observe(document,{childList:!0,subtree:!0});function l(_){const w={};return _.integrity&&(w.integrity=_.integrity),_.referrerPolicy&&(w.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?w.credentials="include":_.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function p(_){if(_.ep)return;_.ep=!0;const w=l(_);fetch(_.href,w)}})();var xb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xv(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Kv={exports:{}},tp={},Yv={exports:{}},Pt={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vc=Symbol.for("react.element"),wb=Symbol.for("react.portal"),bb=Symbol.for("react.fragment"),Sb=Symbol.for("react.strict_mode"),Tb=Symbol.for("react.profiler"),kb=Symbol.for("react.provider"),Eb=Symbol.for("react.context"),Ib=Symbol.for("react.forward_ref"),Cb=Symbol.for("react.suspense"),Pb=Symbol.for("react.memo"),Mb=Symbol.for("react.lazy"),I_=Symbol.iterator;function zb(i){return i===null||typeof i!="object"?null:(i=I_&&i[I_]||i["@@iterator"],typeof i=="function"?i:null)}var Qv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Jv=Object.assign,e0={};function Zl(i,r,l){this.props=i,this.context=r,this.refs=e0,this.updater=l||Qv}Zl.prototype.isReactComponent={};Zl.prototype.setState=function(i,r){if(typeof i!="object"&&typeof i!="function"&&i!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,i,r,"setState")};Zl.prototype.forceUpdate=function(i){this.updater.enqueueForceUpdate(this,i,"forceUpdate")};function t0(){}t0.prototype=Zl.prototype;function Ym(i,r,l){this.props=i,this.context=r,this.refs=e0,this.updater=l||Qv}var Qm=Ym.prototype=new t0;Qm.constructor=Ym;Jv(Qm,Zl.prototype);Qm.isPureReactComponent=!0;var C_=Array.isArray,i0=Object.prototype.hasOwnProperty,Jm={current:null},n0={key:!0,ref:!0,__self:!0,__source:!0};function r0(i,r,l){var p,_={},w=null,I=null;if(r!=null)for(p in r.ref!==void 0&&(I=r.ref),r.key!==void 0&&(w=""+r.key),r)i0.call(r,p)&&!n0.hasOwnProperty(p)&&(_[p]=r[p]);var u=arguments.length-2;if(u===1)_.children=l;else if(1>>1,kt=Ne[Lt];if(0<_(kt,ct))Ne[Lt]=ct,Ne[ft]=kt,ft=Lt;else break e}}function l(Ne){return Ne.length===0?null:Ne[0]}function p(Ne){if(Ne.length===0)return null;var ct=Ne[0],ft=Ne.pop();if(ft!==ct){Ne[0]=ft;e:for(var Lt=0,kt=Ne.length,It=kt>>>1;Lt_(nn,ft))Oi_(rn,nn)?(Ne[Lt]=rn,Ne[Oi]=ft,Lt=Oi):(Ne[Lt]=nn,Ne[jt]=ft,Lt=jt);else if(Oi_(rn,ft))Ne[Lt]=rn,Ne[Oi]=ft,Lt=Oi;else break e}}return ct}function _(Ne,ct){var ft=Ne.sortIndex-ct.sortIndex;return ft!==0?ft:Ne.id-ct.id}if(typeof performance=="object"&&typeof performance.now=="function"){var w=performance;i.unstable_now=function(){return w.now()}}else{var I=Date,u=I.now();i.unstable_now=function(){return I.now()-u}}var N=[],L=[],ne=1,le=null,te=3,ke=!1,Ie=!1,De=!1,ut=typeof setTimeout=="function"?setTimeout:null,se=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function de(Ne){for(var ct=l(L);ct!==null;){if(ct.callback===null)p(L);else if(ct.startTime<=Ne)p(L),ct.sortIndex=ct.expirationTime,r(N,ct);else break;ct=l(L)}}function Se(Ne){if(De=!1,de(Ne),!Ie)if(l(N)!==null)Ie=!0,Bi(Oe);else{var ct=l(L);ct!==null&&Ii(Se,ct.startTime-Ne)}}function Oe(Ne,ct){Ie=!1,De&&(De=!1,se($e),$e=-1),ke=!0;var ft=te;try{for(de(ct),le=l(N);le!==null&&(!(le.expirationTime>ct)||Ne&&!fi());){var Lt=le.callback;if(typeof Lt=="function"){le.callback=null,te=le.priorityLevel;var kt=Lt(le.expirationTime<=ct);ct=i.unstable_now(),typeof kt=="function"?le.callback=kt:le===l(N)&&p(N),de(ct)}else p(N);le=l(N)}if(le!==null)var It=!0;else{var jt=l(L);jt!==null&&Ii(Se,jt.startTime-ct),It=!1}return It}finally{le=null,te=ft,ke=!1}}var He=!1,Je=null,$e=-1,Ft=5,Ge=-1;function fi(){return!(i.unstable_now()-GeNe||125Lt?(Ne.sortIndex=ft,r(L,Ne),l(N)===null&&Ne===l(L)&&(De?(se($e),$e=-1):De=!0,Ii(Se,ft-Lt))):(Ne.sortIndex=kt,r(N,Ne),Ie||ke||(Ie=!0,Bi(Oe))),Ne},i.unstable_shouldYield=fi,i.unstable_wrapCallback=function(Ne){var ct=te;return function(){var ft=te;te=ct;try{return Ne.apply(this,arguments)}finally{te=ft}}}})(l0);a0.exports=l0;var $b=a0.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var u0=at,gr=$b;function Ae(i){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+i,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),im=Object.prototype.hasOwnProperty,Zb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,M_={},z_={};function qb(i){return im.call(z_,i)?!0:im.call(M_,i)?!1:Zb.test(i)?z_[i]=!0:(M_[i]=!0,!1)}function Gb(i,r,l,p){if(l!==null&&l.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return p?!1:l!==null?!l.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function Hb(i,r,l,p){if(r===null||typeof r>"u"||Gb(i,r,l,p))return!0;if(p)return!1;if(l!==null)switch(l.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function Zn(i,r,l,p,_,w,I){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=p,this.attributeNamespace=_,this.mustUseProperty=l,this.propertyName=i,this.type=r,this.sanitizeURL=w,this.removeEmptyString=I}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){mn[i]=new Zn(i,0,!1,i,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var r=i[0];mn[r]=new Zn(r,1,!1,i[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(i){mn[i]=new Zn(i,2,!1,i.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){mn[i]=new Zn(i,2,!1,i,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){mn[i]=new Zn(i,3,!1,i.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(i){mn[i]=new Zn(i,3,!0,i,null,!1,!1)});["capture","download"].forEach(function(i){mn[i]=new Zn(i,4,!1,i,null,!1,!1)});["cols","rows","size","span"].forEach(function(i){mn[i]=new Zn(i,6,!1,i,null,!1,!1)});["rowSpan","start"].forEach(function(i){mn[i]=new Zn(i,5,!1,i.toLowerCase(),null,!1,!1)});var tg=/[\-:]([a-z])/g;function ig(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var r=i.replace(tg,ig);mn[r]=new Zn(r,1,!1,i,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var r=i.replace(tg,ig);mn[r]=new Zn(r,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(i){var r=i.replace(tg,ig);mn[r]=new Zn(r,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(i){mn[i]=new Zn(i,1,!1,i.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(i){mn[i]=new Zn(i,1,!1,i.toLowerCase(),null,!0,!0)});function ng(i,r,l,p){var _=mn.hasOwnProperty(r)?mn[r]:null;(_!==null?_.type!==0:p||!(2u||_[I]!==w[u]){var N=` +`+_[I].replace(" at new "," at ");return i.displayName&&N.includes("")&&(N=N.replace("",i.displayName)),N}while(1<=I&&0<=u);break}}}finally{Cf=!1,Error.prepareStackTrace=l}return(i=i?i.displayName||i.name:"")?uc(i):""}function Wb(i){switch(i.tag){case 5:return uc(i.type);case 16:return uc("Lazy");case 13:return uc("Suspense");case 19:return uc("SuspenseList");case 0:case 2:case 15:return i=Pf(i.type,!1),i;case 11:return i=Pf(i.type.render,!1),i;case 1:return i=Pf(i.type,!0),i;default:return""}}function om(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case yl:return"Fragment";case gl:return"Portal";case nm:return"Profiler";case rg:return"StrictMode";case rm:return"Suspense";case sm:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case d0:return(i.displayName||"Context")+".Consumer";case h0:return(i._context.displayName||"Context")+".Provider";case sg:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case og:return r=i.displayName||null,r!==null?r:om(i.type)||"Memo";case Eo:r=i._payload,i=i._init;try{return om(i(r))}catch{}}return null}function Xb(i){var r=i.type;switch(i.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=r.render,i=i.displayName||i.name||"",r.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return om(r);case 8:return r===rg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function Vo(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function f0(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Kb(i){var r=f0(i)?"checked":"value",l=Object.getOwnPropertyDescriptor(i.constructor.prototype,r),p=""+i[r];if(!i.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var _=l.get,w=l.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return _.call(this)},set:function(I){p=""+I,w.call(this,I)}}),Object.defineProperty(i,r,{enumerable:l.enumerable}),{getValue:function(){return p},setValue:function(I){p=""+I},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function id(i){i._valueTracker||(i._valueTracker=Kb(i))}function m0(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),p="";return i&&(p=f0(i)?i.checked?"true":"false":i.value),i=p,i!==l?(r.setValue(i),!0):!1}function Md(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function am(i,r){var l=r.checked;return wi({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??i._wrapperState.initialChecked})}function D_(i,r){var l=r.defaultValue==null?"":r.defaultValue,p=r.checked!=null?r.checked:r.defaultChecked;l=Vo(r.value!=null?r.value:l),i._wrapperState={initialChecked:p,initialValue:l,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function g0(i,r){r=r.checked,r!=null&&ng(i,"checked",r,!1)}function lm(i,r){g0(i,r);var l=Vo(r.value),p=r.type;if(l!=null)p==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+l):i.value!==""+l&&(i.value=""+l);else if(p==="submit"||p==="reset"){i.removeAttribute("value");return}r.hasOwnProperty("value")?um(i,r.type,l):r.hasOwnProperty("defaultValue")&&um(i,r.type,Vo(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(i.defaultChecked=!!r.defaultChecked)}function L_(i,r,l){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var p=r.type;if(!(p!=="submit"&&p!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+i._wrapperState.initialValue,l||r===i.value||(i.value=r),i.defaultValue=r}l=i.name,l!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,l!==""&&(i.name=l)}function um(i,r,l){(r!=="number"||Md(i.ownerDocument)!==i)&&(l==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+l&&(i.defaultValue=""+l))}var cc=Array.isArray;function Ml(i,r,l,p){if(i=i.options,r){r={};for(var _=0;_"+r.valueOf().toString()+"",r=nd.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;r.firstChild;)i.appendChild(r.firstChild)}});function Tc(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var pc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yb=["Webkit","ms","Moz","O"];Object.keys(pc).forEach(function(i){Yb.forEach(function(r){r=r+i.charAt(0).toUpperCase()+i.substring(1),pc[r]=pc[i]})});function x0(i,r,l){return r==null||typeof r=="boolean"||r===""?"":l||typeof r!="number"||r===0||pc.hasOwnProperty(i)&&pc[i]?(""+r).trim():r+"px"}function w0(i,r){i=i.style;for(var l in r)if(r.hasOwnProperty(l)){var p=l.indexOf("--")===0,_=x0(l,r[l],p);l==="float"&&(l="cssFloat"),p?i.setProperty(l,_):i[l]=_}}var Qb=wi({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function dm(i,r){if(r){if(Qb[i]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(Ae(137,i));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(Ae(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(Ae(61))}if(r.style!=null&&typeof r.style!="object")throw Error(Ae(62))}}function pm(i,r){if(i.indexOf("-")===-1)return typeof r.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fm=null;function ag(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var mm=null,zl=null,Al=null;function B_(i){if(i=$c(i)){if(typeof mm!="function")throw Error(Ae(280));var r=i.stateNode;r&&(r=op(r),mm(i.stateNode,i.type,r))}}function b0(i){zl?Al?Al.push(i):Al=[i]:zl=i}function S0(){if(zl){var i=zl,r=Al;if(Al=zl=null,B_(i),r)for(i=0;i>>=0,i===0?32:31-(u2(i)/c2|0)|0}var rd=64,sd=4194304;function hc(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Ld(i,r){var l=i.pendingLanes;if(l===0)return 0;var p=0,_=i.suspendedLanes,w=i.pingedLanes,I=l&268435455;if(I!==0){var u=I&~_;u!==0?p=hc(u):(w&=I,w!==0&&(p=hc(w)))}else I=l&~_,I!==0?p=hc(I):w!==0&&(p=hc(w));if(p===0)return 0;if(r!==0&&r!==p&&!(r&_)&&(_=p&-p,w=r&-r,_>=w||_===16&&(w&4194240)!==0))return r;if(p&4&&(p|=l&16),r=i.entangledLanes,r!==0)for(i=i.entanglements,r&=p;0l;l++)r.push(i);return r}function Uc(i,r,l){i.pendingLanes|=r,r!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,r=31-is(r),i[r]=l}function f2(i,r){var l=i.pendingLanes&~r;i.pendingLanes=r,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=r,i.mutableReadLanes&=r,i.entangledLanes&=r,r=i.entanglements;var p=i.eventTimes;for(i=i.expirationTimes;0=mc),G_=" ",H_=!1;function $0(i,r){switch(i){case"keyup":return j2.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var _l=!1;function Z2(i,r){switch(i){case"compositionend":return Z0(r);case"keypress":return r.which!==32?null:(H_=!0,G_);case"textInput":return i=r.data,i===G_&&H_?null:i;default:return null}}function q2(i,r){if(_l)return i==="compositionend"||!mg&&$0(i,r)?(i=U0(),xd=dg=Mo=null,_l=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:l,offset:r-i};i=p}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Y_(l)}}function W0(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?W0(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function X0(){for(var i=window,r=Md();r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=Md(i.document)}return r}function gg(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}function eS(i){var r=X0(),l=i.focusedElem,p=i.selectionRange;if(r!==l&&l&&l.ownerDocument&&W0(l.ownerDocument.documentElement,l)){if(p!==null&&gg(l)){if(r=p.start,i=p.end,i===void 0&&(i=r),"selectionStart"in l)l.selectionStart=r,l.selectionEnd=Math.min(i,l.value.length);else if(i=(r=l.ownerDocument||document)&&r.defaultView||window,i.getSelection){i=i.getSelection();var _=l.textContent.length,w=Math.min(p.start,_);p=p.end===void 0?w:Math.min(p.end,_),!i.extend&&w>p&&(_=p,p=w,w=_),_=Q_(l,w);var I=Q_(l,p);_&&I&&(i.rangeCount!==1||i.anchorNode!==_.node||i.anchorOffset!==_.offset||i.focusNode!==I.node||i.focusOffset!==I.offset)&&(r=r.createRange(),r.setStart(_.node,_.offset),i.removeAllRanges(),w>p?(i.addRange(r),i.extend(I.node,I.offset)):(r.setEnd(I.node,I.offset),i.addRange(r)))}}for(r=[],i=l;i=i.parentNode;)i.nodeType===1&&r.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,vl=null,wm=null,yc=null,bm=!1;function J_(i,r,l){var p=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;bm||vl==null||vl!==Md(p)||(p=vl,"selectionStart"in p&&gg(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),yc&&Mc(yc,p)||(yc=p,p=Bd(wm,"onSelect"),0bl||(i.current=Cm[bl],Cm[bl]=null,bl--)}function ii(i,r){bl++,Cm[bl]=i.current,i.current=r}var Uo={},Cn=$o(Uo),ir=$o(!1),xa=Uo;function Bl(i,r){var l=i.type.contextTypes;if(!l)return Uo;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===r)return p.__reactInternalMemoizedMaskedChildContext;var _={},w;for(w in l)_[w]=r[w];return p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=r,i.__reactInternalMemoizedMaskedChildContext=_),_}function nr(i){return i=i.childContextTypes,i!=null}function Nd(){li(ir),li(Cn)}function ov(i,r,l){if(Cn.current!==Uo)throw Error(Ae(168));ii(Cn,r),ii(ir,l)}function rx(i,r,l){var p=i.stateNode;if(r=r.childContextTypes,typeof p.getChildContext!="function")return l;p=p.getChildContext();for(var _ in p)if(!(_ in r))throw Error(Ae(108,Xb(i)||"Unknown",_));return wi({},l,p)}function Vd(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Uo,xa=Cn.current,ii(Cn,i),ii(ir,ir.current),!0}function av(i,r,l){var p=i.stateNode;if(!p)throw Error(Ae(169));l?(i=rx(i,r,xa),p.__reactInternalMemoizedMergedChildContext=i,li(ir),li(Cn),ii(Cn,i)):li(ir),ii(ir,l)}var qs=null,ap=!1,$f=!1;function sx(i){qs===null?qs=[i]:qs.push(i)}function dS(i){ap=!0,sx(i)}function Zo(){if(!$f&&qs!==null){$f=!0;var i=0,r=Gt;try{var l=qs;for(Gt=1;i>=I,_-=I,Hs=1<<32-is(r)+_|l<<_|p,Ws=w+i}else Hs=1<$e?(Ft=Je,Je=null):Ft=Je.sibling;var Ge=te(se,Je,de[$e],Se);if(Ge===null){Je===null&&(Je=Ft);break}i&&Je&&Ge.alternate===null&&r(se,Je),J=w(Ge,J,$e),He===null?Oe=Ge:He.sibling=Ge,He=Ge,Je=Ft}if($e===de.length)return l(se,Je),pi&&pa(se,$e),Oe;if(Je===null){for(;$e$e?(Ft=Je,Je=null):Ft=Je.sibling;var fi=te(se,Je,Ge.value,Se);if(fi===null){Je===null&&(Je=Ft);break}i&&Je&&fi.alternate===null&&r(se,Je),J=w(fi,J,$e),He===null?Oe=fi:He.sibling=fi,He=fi,Je=Ft}if(Ge.done)return l(se,Je),pi&&pa(se,$e),Oe;if(Je===null){for(;!Ge.done;$e++,Ge=de.next())Ge=le(se,Ge.value,Se),Ge!==null&&(J=w(Ge,J,$e),He===null?Oe=Ge:He.sibling=Ge,He=Ge);return pi&&pa(se,$e),Oe}for(Je=p(se,Je);!Ge.done;$e++,Ge=de.next())Ge=ke(Je,se,$e,Ge.value,Se),Ge!==null&&(i&&Ge.alternate!==null&&Je.delete(Ge.key===null?$e:Ge.key),J=w(Ge,J,$e),He===null?Oe=Ge:He.sibling=Ge,He=Ge);return i&&Je.forEach(function(Ei){return r(se,Ei)}),pi&&pa(se,$e),Oe}function ut(se,J,de,Se){if(typeof de=="object"&&de!==null&&de.type===yl&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case td:e:{for(var Oe=de.key,He=J;He!==null;){if(He.key===Oe){if(Oe=de.type,Oe===yl){if(He.tag===7){l(se,He.sibling),J=_(He,de.props.children),J.return=se,se=J;break e}}else if(He.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===Eo&&fv(Oe)===He.type){l(se,He.sibling),J=_(He,de.props),J.ref=rc(se,He,de),J.return=se,se=J;break e}l(se,He);break}else r(se,He);He=He.sibling}de.type===yl?(J=va(de.props.children,se.mode,Se,de.key),J.return=se,se=J):(Se=Cd(de.type,de.key,de.props,null,se.mode,Se),Se.ref=rc(se,J,de),Se.return=se,se=Se)}return I(se);case gl:e:{for(He=de.key;J!==null;){if(J.key===He)if(J.tag===4&&J.stateNode.containerInfo===de.containerInfo&&J.stateNode.implementation===de.implementation){l(se,J.sibling),J=_(J,de.children||[]),J.return=se,se=J;break e}else{l(se,J);break}else r(se,J);J=J.sibling}J=Yf(de,se.mode,Se),J.return=se,se=J}return I(se);case Eo:return He=de._init,ut(se,J,He(de._payload),Se)}if(cc(de))return Ie(se,J,de,Se);if(Ju(de))return De(se,J,de,Se);dd(se,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,J!==null&&J.tag===6?(l(se,J.sibling),J=_(J,de),J.return=se,se=J):(l(se,J),J=Kf(de,se.mode,Se),J.return=se,se=J),I(se)):l(se,J)}return ut}var Nl=px(!0),fx=px(!1),Zc={},bs=$o(Zc),Lc=$o(Zc),Rc=$o(Zc);function ya(i){if(i===Zc)throw Error(Ae(174));return i}function kg(i,r){switch(ii(Rc,r),ii(Lc,i),ii(bs,Zc),i=r.nodeType,i){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:hm(null,"");break;default:i=i===8?r.parentNode:r,r=i.namespaceURI||null,i=i.tagName,r=hm(r,i)}li(bs),ii(bs,r)}function Vl(){li(bs),li(Lc),li(Rc)}function mx(i){ya(Rc.current);var r=ya(bs.current),l=hm(r,i.type);r!==l&&(ii(Lc,i),ii(bs,l))}function Eg(i){Lc.current===i&&(li(bs),li(Lc))}var vi=$o(0);function Gd(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Zf=[];function Ig(){for(var i=0;il?l:4,i(!0);var p=qf.transition;qf.transition={};try{i(!1),r()}finally{Gt=l,qf.transition=p}}function zx(){return Rr().memoizedState}function gS(i,r,l){var p=Oo(i);if(l={lane:p,action:l,hasEagerState:!1,eagerState:null,next:null},Ax(i))Dx(r,l);else if(l=ux(i,r,l,p),l!==null){var _=jn();ns(l,i,p,_),Lx(l,r,p)}}function yS(i,r,l){var p=Oo(i),_={lane:p,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ax(i))Dx(r,_);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=r.lastRenderedReducer,w!==null))try{var I=r.lastRenderedState,u=w(I,l);if(_.hasEagerState=!0,_.eagerState=u,rs(u,I)){var N=r.interleaved;N===null?(_.next=_,Sg(r)):(_.next=N.next,N.next=_),r.interleaved=_;return}}catch{}finally{}l=ux(i,r,_,p),l!==null&&(_=jn(),ns(l,i,p,_),Lx(l,r,p))}}function Ax(i){var r=i.alternate;return i===xi||r!==null&&r===xi}function Dx(i,r){_c=Hd=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function Lx(i,r,l){if(l&4194240){var p=r.lanes;p&=i.pendingLanes,l|=p,r.lanes=l,ug(i,l)}}var Wd={readContext:Lr,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useInsertionEffect:kn,useLayoutEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useMutableSource:kn,useSyncExternalStore:kn,useId:kn,unstable_isNewReconciler:!1},_S={readContext:Lr,useCallback:function(i,r){return vs().memoizedState=[i,r===void 0?null:r],i},useContext:Lr,useEffect:gv,useImperativeHandle:function(i,r,l){return l=l!=null?l.concat([i]):null,Td(4194308,4,Ex.bind(null,r,i),l)},useLayoutEffect:function(i,r){return Td(4194308,4,i,r)},useInsertionEffect:function(i,r){return Td(4,2,i,r)},useMemo:function(i,r){var l=vs();return r=r===void 0?null:r,i=i(),l.memoizedState=[i,r],i},useReducer:function(i,r,l){var p=vs();return r=l!==void 0?l(r):r,p.memoizedState=p.baseState=r,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:r},p.queue=i,i=i.dispatch=gS.bind(null,xi,i),[p.memoizedState,i]},useRef:function(i){var r=vs();return i={current:i},r.memoizedState=i},useState:mv,useDebugValue:Ag,useDeferredValue:function(i){return vs().memoizedState=i},useTransition:function(){var i=mv(!1),r=i[0];return i=mS.bind(null,i[1]),vs().memoizedState=i,[r,i]},useMutableSource:function(){},useSyncExternalStore:function(i,r,l){var p=xi,_=vs();if(pi){if(l===void 0)throw Error(Ae(407));l=l()}else{if(l=r(),tn===null)throw Error(Ae(349));ba&30||_x(p,r,l)}_.memoizedState=l;var w={value:l,getSnapshot:r};return _.queue=w,gv(xx.bind(null,p,w,i),[i]),p.flags|=2048,Oc(9,vx.bind(null,p,w,l,r),void 0,null),l},useId:function(){var i=vs(),r=tn.identifierPrefix;if(pi){var l=Ws,p=Hs;l=(p&~(1<<32-is(p)-1)).toString(32)+l,r=":"+r+"R"+l,l=Fc++,0<\/script>",i=i.removeChild(i.firstChild)):typeof p.is=="string"?i=I.createElement(l,{is:p.is}):(i=I.createElement(l),l==="select"&&(I=i,p.multiple?I.multiple=!0:p.size&&(I.size=p.size))):i=I.createElementNS(i,l),i[xs]=r,i[Dc]=p,$x(i,r,!1,!1),r.stateNode=i;e:{switch(I=pm(l,p),l){case"dialog":ai("cancel",i),ai("close",i),_=p;break;case"iframe":case"object":case"embed":ai("load",i),_=p;break;case"video":case"audio":for(_=0;_jl&&(r.flags|=128,p=!0,sc(w,!1),r.lanes=4194304)}else{if(!p)if(i=Gd(I),i!==null){if(r.flags|=128,p=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),sc(w,!0),w.tail===null&&w.tailMode==="hidden"&&!I.alternate&&!pi)return En(r),null}else 2*Fi()-w.renderingStartTime>jl&&l!==1073741824&&(r.flags|=128,p=!0,sc(w,!1),r.lanes=4194304);w.isBackwards?(I.sibling=r.child,r.child=I):(l=w.last,l!==null?l.sibling=I:r.child=I,w.last=I)}return w.tail!==null?(r=w.tail,w.rendering=r,w.tail=r.sibling,w.renderingStartTime=Fi(),r.sibling=null,l=vi.current,ii(vi,p?l&1|2:l&1),r):(En(r),null);case 22:case 23:return Og(),p=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==p&&(r.flags|=8192),p&&r.mode&1?hr&1073741824&&(En(r),r.subtreeFlags&6&&(r.flags|=8192)):En(r),null;case 24:return null;case 25:return null}throw Error(Ae(156,r.tag))}function ES(i,r){switch(_g(r),r.tag){case 1:return nr(r.type)&&Nd(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Vl(),li(ir),li(Cn),Ig(),i=r.flags,i&65536&&!(i&128)?(r.flags=i&-65537|128,r):null;case 5:return Eg(r),null;case 13:if(li(vi),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(Ae(340));Ol()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return li(vi),null;case 4:return Vl(),null;case 10:return bg(r.type._context),null;case 22:case 23:return Og(),null;case 24:return null;default:return null}}var fd=!1,In=!1,IS=typeof WeakSet=="function"?WeakSet:Set,tt=null;function El(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(p){ki(i,r,p)}else l.current=null}function Vm(i,r,l){try{l()}catch(p){ki(i,r,p)}}var kv=!1;function CS(i,r){if(Sm=Rd,i=X0(),gg(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var p=l.getSelection&&l.getSelection();if(p&&p.rangeCount!==0){l=p.anchorNode;var _=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{l.nodeType,w.nodeType}catch{l=null;break e}var I=0,u=-1,N=-1,L=0,ne=0,le=i,te=null;t:for(;;){for(var ke;le!==l||_!==0&&le.nodeType!==3||(u=I+_),le!==w||p!==0&&le.nodeType!==3||(N=I+p),le.nodeType===3&&(I+=le.nodeValue.length),(ke=le.firstChild)!==null;)te=le,le=ke;for(;;){if(le===i)break t;if(te===l&&++L===_&&(u=I),te===w&&++ne===p&&(N=I),(ke=le.nextSibling)!==null)break;le=te,te=le.parentNode}le=ke}l=u===-1||N===-1?null:{start:u,end:N}}else l=null}l=l||{start:0,end:0}}else l=null;for(Tm={focusedElem:i,selectionRange:l},Rd=!1,tt=r;tt!==null;)if(r=tt,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,tt=i;else for(;tt!==null;){r=tt;try{var Ie=r.alternate;if(r.flags&1024)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var De=Ie.memoizedProps,ut=Ie.memoizedState,se=r.stateNode,J=se.getSnapshotBeforeUpdate(r.elementType===r.type?De:Jr(r.type,De),ut);se.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var de=r.stateNode.containerInfo;de.nodeType===1?de.textContent="":de.nodeType===9&&de.documentElement&&de.removeChild(de.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ae(163))}}catch(Se){ki(r,r.return,Se)}if(i=r.sibling,i!==null){i.return=r.return,tt=i;break}tt=r.return}return Ie=kv,kv=!1,Ie}function vc(i,r,l){var p=r.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var _=p=p.next;do{if((_.tag&i)===i){var w=_.destroy;_.destroy=void 0,w!==void 0&&Vm(r,l,w)}_=_.next}while(_!==p)}}function cp(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var p=l.create;l.destroy=p()}l=l.next}while(l!==r)}}function Um(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function Gx(i){var r=i.alternate;r!==null&&(i.alternate=null,Gx(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[xs],delete r[Dc],delete r[Im],delete r[cS],delete r[hS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Hx(i){return i.tag===5||i.tag===3||i.tag===4}function Ev(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Hx(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function jm(i,r,l){var p=i.tag;if(p===5||p===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Od));else if(p!==4&&(i=i.child,i!==null))for(jm(i,r,l),i=i.sibling;i!==null;)jm(i,r,l),i=i.sibling}function $m(i,r,l){var p=i.tag;if(p===5||p===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(p!==4&&(i=i.child,i!==null))for($m(i,r,l),i=i.sibling;i!==null;)$m(i,r,l),i=i.sibling}var pn=null,es=!1;function ko(i,r,l){for(l=l.child;l!==null;)Wx(i,r,l),l=l.sibling}function Wx(i,r,l){if(ws&&typeof ws.onCommitFiberUnmount=="function")try{ws.onCommitFiberUnmount(ip,l)}catch{}switch(l.tag){case 5:In||El(l,r);case 6:var p=pn,_=es;pn=null,ko(i,r,l),pn=p,es=_,pn!==null&&(es?(i=pn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):pn.removeChild(l.stateNode));break;case 18:pn!==null&&(es?(i=pn,l=l.stateNode,i.nodeType===8?jf(i.parentNode,l):i.nodeType===1&&jf(i,l),Cc(i)):jf(pn,l.stateNode));break;case 4:p=pn,_=es,pn=l.stateNode.containerInfo,es=!0,ko(i,r,l),pn=p,es=_;break;case 0:case 11:case 14:case 15:if(!In&&(p=l.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){_=p=p.next;do{var w=_,I=w.destroy;w=w.tag,I!==void 0&&(w&2||w&4)&&Vm(l,r,I),_=_.next}while(_!==p)}ko(i,r,l);break;case 1:if(!In&&(El(l,r),p=l.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=l.memoizedProps,p.state=l.memoizedState,p.componentWillUnmount()}catch(u){ki(l,r,u)}ko(i,r,l);break;case 21:ko(i,r,l);break;case 22:l.mode&1?(In=(p=In)||l.memoizedState!==null,ko(i,r,l),In=p):ko(i,r,l);break;default:ko(i,r,l)}}function Iv(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new IS),r.forEach(function(p){var _=BS.bind(null,i,p);l.has(p)||(l.add(p),p.then(_,_))})}}function Kr(i,r){var l=r.deletions;if(l!==null)for(var p=0;p_&&(_=I),p&=~w}if(p=_,p=Fi()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*MS(p/1960))-p,10i?16:i,zo===null)var p=!1;else{if(i=zo,zo=null,Yd=0,Rt&6)throw Error(Ae(331));var _=Rt;for(Rt|=4,tt=i.current;tt!==null;){var w=tt,I=w.child;if(tt.flags&16){var u=w.deletions;if(u!==null){for(var N=0;NFi()-Fg?_a(i,0):Rg|=l),rr(i,r)}function i1(i,r){r===0&&(i.mode&1?(r=sd,sd<<=1,!(sd&130023424)&&(sd=4194304)):r=1);var l=jn();i=Qs(i,r),i!==null&&(Uc(i,r,l),rr(i,l))}function FS(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),i1(i,l)}function BS(i,r){var l=0;switch(i.tag){case 13:var p=i.stateNode,_=i.memoizedState;_!==null&&(l=_.retryLane);break;case 19:p=i.stateNode;break;default:throw Error(Ae(314))}p!==null&&p.delete(r),i1(i,l)}var n1;n1=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||ir.current)tr=!0;else{if(!(i.lanes&l)&&!(r.flags&128))return tr=!1,TS(i,r,l);tr=!!(i.flags&131072)}else tr=!1,pi&&r.flags&1048576&&ox(r,jd,r.index);switch(r.lanes=0,r.tag){case 2:var p=r.type;kd(i,r),i=r.pendingProps;var _=Bl(r,Cn.current);Ll(r,l),_=Pg(null,r,p,i,_,l);var w=Mg();return r.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,nr(p)?(w=!0,Vd(r)):w=!1,r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Tg(r),_.updater=lp,r.stateNode=_,_._reactInternals=r,Dm(r,p,i,l),r=Fm(null,r,p,!0,w,l)):(r.tag=0,pi&&w&&yg(r),Vn(null,r,_,l),r=r.child),r;case 16:p=r.elementType;e:{switch(kd(i,r),i=r.pendingProps,_=p._init,p=_(p._payload),r.type=p,_=r.tag=NS(p),i=Jr(p,i),_){case 0:r=Rm(null,r,p,i,l);break e;case 1:r=bv(null,r,p,i,l);break e;case 11:r=xv(null,r,p,i,l);break e;case 14:r=wv(null,r,p,Jr(p.type,i),l);break e}throw Error(Ae(306,p,""))}return r;case 0:return p=r.type,_=r.pendingProps,_=r.elementType===p?_:Jr(p,_),Rm(i,r,p,_,l);case 1:return p=r.type,_=r.pendingProps,_=r.elementType===p?_:Jr(p,_),bv(i,r,p,_,l);case 3:e:{if(Vx(r),i===null)throw Error(Ae(387));p=r.pendingProps,w=r.memoizedState,_=w.element,cx(i,r),qd(r,p,null,l);var I=r.memoizedState;if(p=I.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},r.updateQueue.baseState=w,r.memoizedState=w,r.flags&256){_=Ul(Error(Ae(423)),r),r=Sv(i,r,p,l,_);break e}else if(p!==_){_=Ul(Error(Ae(424)),r),r=Sv(i,r,p,l,_);break e}else for(fr=Ro(r.stateNode.containerInfo.firstChild),mr=r,pi=!0,ts=null,l=fx(r,null,p,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ol(),p===_){r=Js(i,r,l);break e}Vn(i,r,p,l)}r=r.child}return r;case 5:return mx(r),i===null&&Mm(r),p=r.type,_=r.pendingProps,w=i!==null?i.memoizedProps:null,I=_.children,km(p,_)?I=null:w!==null&&km(p,w)&&(r.flags|=32),Nx(i,r),Vn(i,r,I,l),r.child;case 6:return i===null&&Mm(r),null;case 13:return Ux(i,r,l);case 4:return kg(r,r.stateNode.containerInfo),p=r.pendingProps,i===null?r.child=Nl(r,null,p,l):Vn(i,r,p,l),r.child;case 11:return p=r.type,_=r.pendingProps,_=r.elementType===p?_:Jr(p,_),xv(i,r,p,_,l);case 7:return Vn(i,r,r.pendingProps,l),r.child;case 8:return Vn(i,r,r.pendingProps.children,l),r.child;case 12:return Vn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(p=r.type._context,_=r.pendingProps,w=r.memoizedProps,I=_.value,ii($d,p._currentValue),p._currentValue=I,w!==null)if(rs(w.value,I)){if(w.children===_.children&&!ir.current){r=Js(i,r,l);break e}}else for(w=r.child,w!==null&&(w.return=r);w!==null;){var u=w.dependencies;if(u!==null){I=w.child;for(var N=u.firstContext;N!==null;){if(N.context===p){if(w.tag===1){N=Xs(-1,l&-l),N.tag=2;var L=w.updateQueue;if(L!==null){L=L.shared;var ne=L.pending;ne===null?N.next=N:(N.next=ne.next,ne.next=N),L.pending=N}}w.lanes|=l,N=w.alternate,N!==null&&(N.lanes|=l),zm(w.return,l,r),u.lanes|=l;break}N=N.next}}else if(w.tag===10)I=w.type===r.type?null:w.child;else if(w.tag===18){if(I=w.return,I===null)throw Error(Ae(341));I.lanes|=l,u=I.alternate,u!==null&&(u.lanes|=l),zm(I,l,r),I=w.sibling}else I=w.child;if(I!==null)I.return=w;else for(I=w;I!==null;){if(I===r){I=null;break}if(w=I.sibling,w!==null){w.return=I.return,I=w;break}I=I.return}w=I}Vn(i,r,_.children,l),r=r.child}return r;case 9:return _=r.type,p=r.pendingProps.children,Ll(r,l),_=Lr(_),p=p(_),r.flags|=1,Vn(i,r,p,l),r.child;case 14:return p=r.type,_=Jr(p,r.pendingProps),_=Jr(p.type,_),wv(i,r,p,_,l);case 15:return Bx(i,r,r.type,r.pendingProps,l);case 17:return p=r.type,_=r.pendingProps,_=r.elementType===p?_:Jr(p,_),kd(i,r),r.tag=1,nr(p)?(i=!0,Vd(r)):i=!1,Ll(r,l),dx(r,p,_),Dm(r,p,_,l),Fm(null,r,p,!0,i,l);case 19:return jx(i,r,l);case 22:return Ox(i,r,l)}throw Error(Ae(156,r.tag))};function r1(i,r){return M0(i,r)}function OS(i,r,l,p){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ar(i,r,l,p){return new OS(i,r,l,p)}function Vg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function NS(i){if(typeof i=="function")return Vg(i)?1:0;if(i!=null){if(i=i.$$typeof,i===sg)return 11;if(i===og)return 14}return 2}function No(i,r){var l=i.alternate;return l===null?(l=Ar(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function Cd(i,r,l,p,_,w){var I=2;if(p=i,typeof i=="function")Vg(i)&&(I=1);else if(typeof i=="string")I=5;else e:switch(i){case yl:return va(l.children,_,w,r);case rg:I=8,_|=8;break;case nm:return i=Ar(12,l,r,_|2),i.elementType=nm,i.lanes=w,i;case rm:return i=Ar(13,l,r,_),i.elementType=rm,i.lanes=w,i;case sm:return i=Ar(19,l,r,_),i.elementType=sm,i.lanes=w,i;case p0:return dp(l,_,w,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case h0:I=10;break e;case d0:I=9;break e;case sg:I=11;break e;case og:I=14;break e;case Eo:I=16,p=null;break e}throw Error(Ae(130,i==null?i:typeof i,""))}return r=Ar(I,l,r,_),r.elementType=i,r.type=p,r.lanes=w,r}function va(i,r,l,p){return i=Ar(7,i,p,r),i.lanes=l,i}function dp(i,r,l,p){return i=Ar(22,i,p,r),i.elementType=p0,i.lanes=l,i.stateNode={isHidden:!1},i}function Kf(i,r,l){return i=Ar(6,i,null,r),i.lanes=l,i}function Yf(i,r,l){return r=Ar(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function VS(i,r,l,p,_){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zf(0),this.expirationTimes=zf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zf(0),this.identifierPrefix=p,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function Ug(i,r,l,p,_,w,I,u,N){return i=new VS(i,r,l,u,N),r===1?(r=1,w===!0&&(r|=8)):r=0,w=Ar(3,null,null,r),i.current=w,w.stateNode=i,w.memoizedState={element:p,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tg(w),i}function US(i,r,l){var p=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l1)}catch(i){console.error(i)}}l1(),o0.exports=yr;var qg=o0.exports,Rv=qg;tm.createRoot=Rv.createRoot,tm.hydrateRoot=Rv.hydrateRoot;var u1={exports:{}};(function(i,r){(function(l,p){i.exports=p()})(xb,function(){var l,p,_;function w(u,N){if(!l)l=N;else if(!p)p=N;else{var L="var sharedChunk = {}; ("+l+")(sharedChunk); ("+p+")(sharedChunk);",ne={};l(ne),_=N(ne),typeof window<"u"&&(_.workerUrl=window.URL.createObjectURL(new Blob([L],{type:"text/javascript"})))}}w(["exports"],function(u){function N(n,e,s,a){return new(s||(s=Promise))(function(h,m){function y(k){try{S(a.next(k))}catch(C){m(C)}}function v(k){try{S(a.throw(k))}catch(C){m(C)}}function S(k){var C;k.done?h(k.value):(C=k.value,C instanceof s?C:new s(function(z){z(C)})).then(y,v)}S((a=a.apply(n,e||[])).next())})}function L(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}typeof SuppressedError=="function"&&SuppressedError;var ne=le;function le(n,e){this.x=n,this.y=e}le.prototype={clone:function(){return new le(this.x,this.y)},add:function(n){return this.clone()._add(n)},sub:function(n){return this.clone()._sub(n)},multByPoint:function(n){return this.clone()._multByPoint(n)},divByPoint:function(n){return this.clone()._divByPoint(n)},mult:function(n){return this.clone()._mult(n)},div:function(n){return this.clone()._div(n)},rotate:function(n){return this.clone()._rotate(n)},rotateAround:function(n,e){return this.clone()._rotateAround(n,e)},matMult:function(n){return this.clone()._matMult(n)},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(n){return this.x===n.x&&this.y===n.y},dist:function(n){return Math.sqrt(this.distSqr(n))},distSqr:function(n){var e=n.x-this.x,s=n.y-this.y;return e*e+s*s},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(n){return Math.atan2(this.y-n.y,this.x-n.x)},angleWith:function(n){return this.angleWithSep(n.x,n.y)},angleWithSep:function(n,e){return Math.atan2(this.x*e-this.y*n,this.x*n+this.y*e)},_matMult:function(n){var e=n[2]*this.x+n[3]*this.y;return this.x=n[0]*this.x+n[1]*this.y,this.y=e,this},_add:function(n){return this.x+=n.x,this.y+=n.y,this},_sub:function(n){return this.x-=n.x,this.y-=n.y,this},_mult:function(n){return this.x*=n,this.y*=n,this},_div:function(n){return this.x/=n,this.y/=n,this},_multByPoint:function(n){return this.x*=n.x,this.y*=n.y,this},_divByPoint:function(n){return this.x/=n.x,this.y/=n.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var n=this.y;return this.y=this.x,this.x=-n,this},_rotate:function(n){var e=Math.cos(n),s=Math.sin(n),a=s*this.x+e*this.y;return this.x=e*this.x-s*this.y,this.y=a,this},_rotateAround:function(n,e){var s=Math.cos(n),a=Math.sin(n),h=e.y+a*(this.x-e.x)+s*(this.y-e.y);return this.x=e.x+s*(this.x-e.x)-a*(this.y-e.y),this.y=h,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},le.convert=function(n){return n instanceof le?n:Array.isArray(n)?new le(n[0],n[1]):n};var te=L(ne),ke=Ie;function Ie(n,e,s,a){this.cx=3*n,this.bx=3*(s-n)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=n,this.p1y=e,this.p2x=s,this.p2y=a}Ie.prototype={sampleCurveX:function(n){return((this.ax*n+this.bx)*n+this.cx)*n},sampleCurveY:function(n){return((this.ay*n+this.by)*n+this.cy)*n},sampleCurveDerivativeX:function(n){return(3*this.ax*n+2*this.bx)*n+this.cx},solveCurveX:function(n,e){if(e===void 0&&(e=1e-6),n<0)return 0;if(n>1)return 1;for(var s=n,a=0;a<8;a++){var h=this.sampleCurveX(s)-n;if(Math.abs(h)h?y=s:v=s,s=.5*(v-y)+y;return s},solve:function(n,e){return this.sampleCurveY(this.solveCurveX(n,e))}};var De=L(ke);let ut,se;function J(){return ut==null&&(ut=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ut}function de(){if(se==null&&(se=!1,J())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<5*5;a++){const h=4*a;e.fillStyle=`rgb(${h},${h+1},${h+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const s=e.getImageData(0,0,5,5).data;for(let a=0;a<5*5*4;a++)if(a%4!=3&&s[a]!==a){se=!0;break}}}return se||!1}function Se(n,e,s,a){const h=new De(n,e,s,a);return function(m){return h.solve(m)}}const Oe=Se(.25,.1,.25,1);function He(n,e,s){return Math.min(s,Math.max(e,n))}function Je(n,e,s){const a=s-e,h=((n-e)%a+a)%a+e;return h===e?s:h}function $e(n,...e){for(const s of e)for(const a in s)n[a]=s[a];return n}let Ft=1;function Ge(n,e,s){const a={};for(const h in n)a[h]=e.call(s||this,n[h],h,n);return a}function fi(n,e,s){const a={};for(const h in n)e.call(s||this,n[h],h,n)&&(a[h]=n[h]);return a}function Ei(n){return Array.isArray(n)?n.map(Ei):typeof n=="object"&&n?Ge(n,Ei):n}const Hi={};function mi(n){Hi[n]||(typeof console<"u"&&console.warn(n),Hi[n]=!0)}function ui(n,e,s){return(s.y-n.y)*(e.x-n.x)>(e.y-n.y)*(s.x-n.x)}function Bi(n){let e=0;for(let s,a,h=0,m=n.length,y=m-1;h"u")throw new Error("VideoFrame not supported");const m=new VideoFrame(n,{timestamp:0});try{const y=m==null?void 0:m.format;if(!y||!y.startsWith("BGR")&&!y.startsWith("RGB"))throw new Error(`Unrecognized format ${y}`);const v=y.startsWith("BGR"),S=new Uint8ClampedArray(a*h*4);if(yield m.copyTo(S,function(k,C,z,D,B){const O=4*Math.max(-C,0),j=(Math.max(0,z)-z)*D*4+O,W=4*D,Y=Math.max(0,C),ue=Math.max(0,z);return{rect:{x:Y,y:ue,width:Math.min(k.width,C+D)-Y,height:Math.min(k.height,z+B)-ue},layout:[{offset:j,stride:W}]}}(n,e,s,a,h)),v)for(let k=0;kcancelAnimationFrame(e)}},getImageData(n,e=0){return this.getImageCanvasContext(n).getImageData(-e,-e,n.width+2*e,n.height+2*e)},getImageCanvasContext(n){const e=window.document.createElement("canvas"),s=e.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return e.width=n.width,e.height=n.height,s.drawImage(n,0,0,n.width,n.height),s},resolveURL:n=>(jt||(jt=document.createElement("a")),jt.href=n,jt.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(nn==null&&(nn=matchMedia("(prefers-reduced-motion: reduce)")),nn.matches)}},rn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class sr extends Error{constructor(e,s,a,h){super(`AJAXError: ${s} (${e}): ${a}`),this.status=e,this.statusText=s,this.url=a,this.body=h}}const Pn=Ii()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,sn=n=>rn.REGISTERED_PROTOCOLS[n.substring(0,n.indexOf("://"))];function ss(n,e){const s=new AbortController,a=new Request(n.url,{method:n.method||"GET",body:n.body,credentials:n.credentials,headers:n.headers,cache:n.cache,referrer:Pn(),signal:s.signal});let h=!1,m=!1;return n.type==="json"&&a.headers.set("Accept","application/json"),m||fetch(a).then(y=>y.ok?(v=>{(n.type==="arrayBuffer"||n.type==="image"?v.arrayBuffer():n.type==="json"?v.json():v.text()).then(S=>{m||(h=!0,e(null,S,v.headers.get("Cache-Control"),v.headers.get("Expires")))}).catch(S=>{m||e(new Error(S.message))})})(y):y.blob().then(v=>e(new sr(y.status,y.statusText,n.url,v)))).catch(y=>{y.code!==20&&e(new Error(y.message))}),{cancel:()=>{m=!0,h||s.abort()}}}const or=function(n,e){if(/:\/\//.test(n.url)&&!/^https?:|^file:/.test(n.url)){if(Ii()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",n,e);if(!Ii())return(sn(n.url)||ss)(n,e)}if(!(/^file:/.test(s=n.url)||/^file:/.test(Pn())&&!/^\w+:/.test(s))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ss(n,e);if(Ii()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",n,e,void 0,!0)}var s;return function(a,h){const m=new XMLHttpRequest;m.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(m.responseType="arraybuffer");for(const y in a.headers)m.setRequestHeader(y,a.headers[y]);return a.type==="json"&&(m.responseType="text",m.setRequestHeader("Accept","application/json")),m.withCredentials=a.credentials==="include",m.onerror=()=>{h(new Error(m.statusText))},m.onload=()=>{if((m.status>=200&&m.status<300||m.status===0)&&m.response!==null){let y=m.response;if(a.type==="json")try{y=JSON.parse(m.response)}catch(v){return h(v)}h(null,y,m.getResponseHeader("Cache-Control"),m.getResponseHeader("Expires"))}else{const y=new Blob([m.response],{type:m.getResponseHeader("Content-Type")});h(new sr(m.status,m.statusText,a.url,y))}},m.send(a.body),{cancel:()=>m.abort()}}(n,e)},qo=function(n,e){return or($e(n,{type:"arrayBuffer"}),e)};function Fr(n){if(!n||n.indexOf("://")<=0||n.indexOf("data:image/")===0||n.indexOf("blob:")===0)return!0;const e=new URL(n),s=window.location;return e.protocol===s.protocol&&e.host===s.host}function to(n,e,s){s[n]&&s[n].indexOf(e)!==-1||(s[n]=s[n]||[],s[n].push(e))}function Ss(n,e,s){if(s&&s[n]){const a=s[n].indexOf(e);a!==-1&&s[n].splice(a,1)}}class os{constructor(e,s={}){$e(this,s),this.type=e}}class as extends os{constructor(e,s={}){super("error",$e({error:e},s))}}class Ts{on(e,s){return this._listeners=this._listeners||{},to(e,s,this._listeners),this}off(e,s){return Ss(e,s,this._listeners),Ss(e,s,this._oneTimeListeners),this}once(e,s){return s?(this._oneTimeListeners=this._oneTimeListeners||{},to(e,s,this._oneTimeListeners),this):new Promise(a=>this.once(e,a))}fire(e,s){typeof e=="string"&&(e=new os(e,s||{}));const a=e.type;if(this.listens(a)){e.target=this;const h=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const v of h)v.call(this,e);const m=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const v of m)Ss(a,v,this._oneTimeListeners),v.call(this,e);const y=this._eventedParent;y&&($e(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),y.fire(e))}else e instanceof as&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,s){return this._eventedParent=e,this._eventedParentData=s,this}}var ye={$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"},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":{},within:{}}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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"}}};const gn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function qn(n,e){const s={};for(const a in n)a!=="ref"&&(s[a]=n[a]);return gn.forEach(a=>{a in e&&(s[a]=e[a])}),s}function $t(n,e){if(Array.isArray(n)){if(!Array.isArray(e)||n.length!==e.length)return!1;for(let s=0;s`:n.itemType.kind==="value"?"array":`array<${e}>`}return n.kind}const ce=[Or,Re,gt,ht,on,q,wr,H(pt),A,R,V];function ie(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!ie(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const s of ce)if(!ie(s,e))return null}}return`Expected ${X(n)} but found ${X(e)} instead.`}function Q(n,e){return e.some(s=>s.kind===n.kind)}function ae(n,e){return e.some(s=>s==="null"?n===null:s==="array"?Array.isArray(n):s==="object"?n&&!Array.isArray(n)&&typeof n=="object":s===typeof n)}function _e(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const ve=.96422,be=.82521,it=4/29,lt=6/29,We=3*lt*lt,rt=lt*lt*lt,dt=Math.PI/180,Dt=180/Math.PI;function Nt(n){return(n%=360)<0&&(n+=360),n}function Et([n,e,s,a]){let h,m;const y=Wi((.2225045*(n=Tt(n))+.7168786*(e=Tt(e))+.0606169*(s=Tt(s)))/1);n===e&&e===s?h=m=y:(h=Wi((.4360747*n+.3850649*e+.1430804*s)/ve),m=Wi((.0139322*n+.0971045*e+.7141733*s)/be));const v=116*y-16;return[v<0?0:v,500*(h-y),200*(y-m),a]}function Tt(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Wi(n){return n>rt?Math.pow(n,1/3):n/We+it}function Zt([n,e,s,a]){let h=(n+16)/116,m=isNaN(e)?h:h+e/500,y=isNaN(s)?h:h-s/200;return h=1*Vi(h),m=ve*Vi(m),y=be*Vi(y),[bi(3.1338561*m-1.6168667*h-.4906146*y),bi(-.9787684*m+1.9161415*h+.033454*y),bi(.0719453*m-.2289914*h+1.4052427*y),a]}function bi(n){return(n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055)<0?0:n>1?1:n}function Vi(n){return n>lt?n*n*n:We*(n-it)}function Gn(n){return parseInt(n.padEnd(2,n),16)/255}function Hc(n,e){return ro(e?n/100:n,0,1)}function ro(n,e,s){return Math.min(Math.max(e,n),s)}function so(n){return!n.some(Number.isNaN)}const _p={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 Bt{constructor(e,s,a,h=1,m=!0){this.r=e,this.g=s,this.b=a,this.a=h,m||(this.r*=h,this.g*=h,this.b*=h,h||this.overwriteGetter("rgb",[e,s,a,h]))}static parse(e){if(e instanceof Bt)return e;if(typeof e!="string")return;const s=function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const h=_p[a];if(h){const[y,v,S]=h;return[y/255,v/255,S/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const y=a.length<6?1:2;let v=1;return[Gn(a.slice(v,v+=y)),Gn(a.slice(v,v+=y)),Gn(a.slice(v,v+=y)),Gn(a.slice(v,v+y)||"ff")]}if(a.startsWith("rgb")){const y=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(y){const[v,S,k,C,z,D,B,O,j,W,Y,ue]=y,ee=[C||" ",B||" ",W].join("");if(ee===" "||ee===" /"||ee===",,"||ee===",,,"){const he=[k,D,j].join(""),fe=he==="%%%"?100:he===""?255:0;if(fe){const we=[ro(+S/fe,0,1),ro(+z/fe,0,1),ro(+O/fe,0,1),Y?Hc(+Y,ue):1];if(so(we))return we}}return}}const m=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(m){const[y,v,S,k,C,z,D,B,O]=m,j=[S||" ",C||" ",D].join("");if(j===" "||j===" /"||j===",,"||j===",,,"){const W=[+v,ro(+k,0,100),ro(+z,0,100),B?Hc(+B,O):1];if(so(W))return function([Y,ue,ee,he]){function fe(we){const je=(we+Y/30)%12,Ke=ue*Math.min(ee,1-ee);return ee-Ke*Math.max(-1,Math.min(je-3,9-je,1))}return Y=Nt(Y),ue/=100,ee/=100,[fe(0),fe(8),fe(4),he]}(W)}}}(e);return s?new Bt(...s,!1):void 0}get rgb(){const{r:e,g:s,b:a,a:h}=this,m=h||1/0;return this.overwriteGetter("rgb",[e/m,s/m,a/m,h])}get hcl(){return this.overwriteGetter("hcl",function(e){const[s,a,h,m]=Et(e),y=Math.sqrt(a*a+h*h);return[Math.round(1e4*y)?Nt(Math.atan2(h,a)*Dt):NaN,y,s,m]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Et(this.rgb))}overwriteGetter(e,s){return Object.defineProperty(this,e,{value:s}),s}toString(){const[e,s,a,h]=this.rgb;return`rgba(${[e,s,a].map(m=>Math.round(255*m)).join(",")},${h})`}}Bt.black=new Bt(0,0,0,1),Bt.white=new Bt(1,1,1,1),Bt.transparent=new Bt(0,0,0,0),Bt.red=new Bt(1,0,0,1);class Hl{constructor(e,s,a){this.sensitivity=e?s?"variant":"case":s?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,s){return this.collator.compare(e,s)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pa{constructor(e,s,a,h,m){this.text=e,this.image=s,this.scale=a,this.fontStack=h,this.textColor=m}}class Xi{constructor(e){this.sections=e}static fromString(e){return new Xi([new Pa(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Xi?e:Xi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class Mn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Mn)return e;if(typeof e=="number")return new Mn([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const s of e)if(typeof s!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Mn(e)}}toString(){return JSON.stringify(this.values)}}const vp=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Hn{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Hn)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let s=0;s=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof s=="number"&&s>=0&&s<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[n,e,s,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[n,e,s,a]:[n,e,s]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function oo(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof Bt||n instanceof Hl||n instanceof Xi||n instanceof Mn||n instanceof Hn||n instanceof Ui)return!0;if(Array.isArray(n)){for(const e of n)if(!oo(e))return!1;return!0}if(typeof n=="object"){for(const e in n)if(!oo(n[e]))return!1;return!0}return!1}function Qt(n){if(n===null)return Or;if(typeof n=="string")return gt;if(typeof n=="boolean")return ht;if(typeof n=="number")return Re;if(n instanceof Bt)return on;if(n instanceof Hl)return Nr;if(n instanceof Xi)return q;if(n instanceof Mn)return A;if(n instanceof Hn)return V;if(n instanceof Ui)return R;if(Array.isArray(n)){const e=n.length;let s;for(const a of n){const h=Qt(a);if(s){if(s===h)continue;s=pt;break}s=h}return H(s||pt,e)}return wr}function Mt(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof Bt||n instanceof Xi||n instanceof Mn||n instanceof Hn||n instanceof Ui?n.toString():JSON.stringify(n)}class Is{constructor(e,s){this.type=e,this.value=s}static parse(e,s){if(e.length!==2)return s.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!oo(e[1]))return s.error("invalid value");const a=e[1];let h=Qt(a);const m=s.expectedType;return h.kind!=="array"||h.N!==0||!m||m.kind!=="array"||typeof m.N=="number"&&m.N!==0||(h=m),new Is(h,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ri{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const za={string:gt,number:Re,boolean:ht,object:wr};class Wn{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let a,h=1;const m=e[0];if(m==="array"){let v,S;if(e.length>2){const k=e[1];if(typeof k!="string"||!(k in za)||k==="object")return s.error('The item type argument of "array" must be one of string, number, boolean',1);v=za[k],h++}else v=pt;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return s.error('The length argument to "array" must be a positive integer literal',2);S=e[2],h++}a=H(v,S)}else{if(!za[m])throw new Error(`Types doesn't contain name = ${m}`);a=za[m]}const y=[];for(;he.outputDefined())}}const Wl={"to-boolean":ht,"to-color":on,"to-number":Re,"to-string":gt};class us{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");const a=e[0];if(!Wl[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if((a==="to-boolean"||a==="to-string")&&e.length!==2)return s.error("Expected one argument.");const h=Wl[a],m=[];for(let y=1;y4?`Invalid rbga value ${JSON.stringify(s)}: expected an array containing either three or four numeric values.`:Ma(s[0],s[1],s[2],s[3]),!a))return new Bt(s[0]/255,s[1]/255,s[2]/255,s[3])}throw new ri(a||`Could not parse color from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"padding":{let s;for(const a of this.args){s=a.evaluate(e);const h=Mn.parse(s);if(h)return h}throw new ri(`Could not parse padding from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"variableAnchorOffsetCollection":{let s;for(const a of this.args){s=a.evaluate(e);const h=Hn.parse(s);if(h)return h}throw new ri(`Could not parse variableAnchorOffsetCollection from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"number":{let s=null;for(const a of this.args){if(s=a.evaluate(e),s===null)return 0;const h=Number(s);if(!isNaN(h))return h}throw new ri(`Could not convert ${JSON.stringify(s)} to number.`)}case"formatted":return Xi.fromString(Mt(this.args[0].evaluate(e)));case"resolvedImage":return Ui.fromString(Mt(this.args[0].evaluate(e)));default:return Mt(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Wc=["Unknown","Point","LineString","Polygon"];class Xl{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"?Wc[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(e){let s=this._parseColorCache[e];return s||(s=this._parseColorCache[e]=Bt.parse(e)),s}}class Aa{constructor(e,s,a=[],h,m=new Es,y=[]){this.registry=e,this.path=a,this.key=a.map(v=>`[${v}]`).join(""),this.scope=m,this.errors=y,this.expectedType=h,this._isConstant=s}parse(e,s,a,h,m={}){return s?this.concat(s,a,h)._parse(e,m):this._parse(e,m)}_parse(e,s){function a(h,m,y){return y==="assert"?new Wn(m,[h]):y==="coerce"?new us(m,[h]):h}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const h=e[0];if(typeof h!="string")return this.error(`Expression name must be a string, but found ${typeof h} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const m=this.registry[h];if(m){let y=m.parse(e,this);if(!y)return null;if(this.expectedType){const v=this.expectedType,S=y.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||S.kind!=="value")if(v.kind!=="color"&&v.kind!=="formatted"&&v.kind!=="resolvedImage"||S.kind!=="value"&&S.kind!=="string")if(v.kind!=="padding"||S.kind!=="value"&&S.kind!=="number"&&S.kind!=="array")if(v.kind!=="variableAnchorOffsetCollection"||S.kind!=="value"&&S.kind!=="array"){if(this.checkSubtype(v,S))return null}else y=a(y,v,s.typeAnnotation||"coerce");else y=a(y,v,s.typeAnnotation||"coerce");else y=a(y,v,s.typeAnnotation||"coerce");else y=a(y,v,s.typeAnnotation||"assert")}if(!(y instanceof Is)&&y.type.kind!=="resolvedImage"&&this._isConstant(y)){const v=new Xl;try{y=new Is(y.type,y.evaluate(v))}catch(S){return this.error(S.message),null}}return y}return this.error(`Unknown expression "${h}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,s,a){const h=typeof e=="number"?this.path.concat(e):this.path,m=a?this.scope.concat(a):this.scope;return new Aa(this.registry,this._isConstant,h,s||null,m,this.errors)}error(e,...s){const a=`${this.key}${s.map(h=>`[${h}]`).join("")}`;this.errors.push(new ni(a,e))}checkSubtype(e,s){const a=ie(e,s);return a&&this.error(a),a}}class Da{constructor(e,s,a){this.type=Nr,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=s}static parse(e,s){if(e.length!==2)return s.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return s.error("Collator options argument must be an object.");const h=s.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,ht);if(!h)return null;const m=s.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,ht);if(!m)return null;let y=null;return a.locale&&(y=s.parse(a.locale,1,gt),!y)?null:new Da(h,m,y)}evaluate(e){return new Hl(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const cs=8192;function Kl(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function Go(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function Xc(n,e){const s=(180+n[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n[1]*Math.PI/360)))/360,h=Math.pow(2,e.z);return[Math.round(s*h*cs),Math.round(a*h*cs)]}function xp(n,e,s){const a=n[0]-e[0],h=n[1]-e[1],m=n[0]-s[0],y=n[1]-s[1];return a*y-m*h==0&&a*m<=0&&h*y<=0}function Yl(n,e){let s=!1;for(let y=0,v=e.length;y(a=n)[1]!=(m=S[k+1])[1]>a[1]&&a[0]<(m[0]-h[0])*(a[1]-h[1])/(m[1]-h[1])+h[0]&&(s=!s)}}var a,h,m;return s}function Ql(n,e){for(let s=0;s0&&v<0||y<0&&v>0}function wp(n,e,s){for(const k of s)for(let C=0;Cs[2]){const h=.5*a;let m=n[0]-s[0]>h?-a:s[0]-n[0]>h?a:0;m===0&&(m=n[0]-s[2]>h?-a:s[2]-n[0]>h?a:0),n[0]+=m}Kl(e,n)}function Jl(n,e,s,a){const h=Math.pow(2,a.z)*cs,m=[a.x*cs,a.y*cs],y=[];for(const v of n)for(const S of v){const k=[S.x+m[0],S.y+m[1]];eh(k,e,s,h),y.push(k)}return y}function eu(n,e,s,a){const h=Math.pow(2,a.z)*cs,m=[a.x*cs,a.y*cs],y=[];for(const S of n){const k=[];for(const C of S){const z=[C.x+m[0],C.y+m[1]];Kl(e,z),k.push(z)}y.push(k)}if(e[2]-e[0]<=h/2){(v=e)[0]=v[1]=1/0,v[2]=v[3]=-1/0;for(const S of y)for(const k of S)eh(k,e,s,h)}var v;return y}class Cs{constructor(e,s){this.type=ht,this.geojson=e,this.geometries=s}static parse(e,s){if(e.length!==2)return s.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(oo(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let h=0;h!Array.isArray(k)||k.length===e.length-1);let S=null;for(const[k,C]of v){S=new Aa(s.registry,Fa,s.path,null,s.scope);const z=[];let D=!1;for(let B=1;B{return D=z,Array.isArray(D)?`(${D.map(X).join(", ")})`:`(${X(D.type)}...)`;var D}).join(" | "),C=[];for(let z=1;z{s=e?s&&Fa(a):s&&a instanceof Is}),!!s&&Ba(n)&&Oa(n,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ba(n){if(n instanceof Xn&&(n.name==="get"&&n.args.length===1||n.name==="feature-state"||n.name==="has"&&n.args.length===1||n.name==="properties"||n.name==="geometry-type"||n.name==="id"||/^filter-/.test(n.name))||n instanceof Cs)return!1;let e=!0;return n.eachChild(s=>{e&&!Ba(s)&&(e=!1)}),e}function Ho(n){if(n instanceof Xn&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(s=>{e&&!Ho(s)&&(e=!1)}),e}function Oa(n,e){if(n instanceof Xn&&e.indexOf(n.name)>=0)return!1;let s=!0;return n.eachChild(a=>{s&&!Oa(a,e)&&(s=!1)}),s}function ao(n,e){const s=n.length-1;let a,h,m=0,y=s,v=0;for(;m<=y;)if(v=Math.floor((m+y)/2),a=n[v],h=n[v+1],a<=e){if(v===s||ee))throw new ri("Input is not a number.");y=v-1}return 0}class hs{constructor(e,s,a){this.type=e,this.input=s,this.labels=[],this.outputs=[];for(const[h,m]of a)this.labels.push(h),this.outputs.push(m)}static parse(e,s){if(e.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return s.error("Expected an even number of arguments.");const a=s.parse(e[1],1,Re);if(!a)return null;const h=[];let m=null;s.expectedType&&s.expectedType.kind!=="value"&&(m=s.expectedType);for(let y=1;y=v)return s.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',k);const z=s.parse(S,C,m);if(!z)return null;m=m||z.type,h.push([v,z])}return new hs(m,a,h)}evaluate(e){const s=this.labels,a=this.outputs;if(s.length===1)return a[0].evaluate(e);const h=this.input.evaluate(e);if(h<=s[0])return a[0].evaluate(e);const m=s.length;return h>=s[m-1]?a[m-1].evaluate(e):a[ao(s,h)].evaluate(e)}eachChild(e){e(this.input);for(const s of this.outputs)e(s)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function bt(n,e,s){return n+s*(e-n)}function Na(n,e,s){return n.map((a,h)=>bt(a,e[h],s))}const zn={number:bt,color:function(n,e,s,a="rgb"){switch(a){case"rgb":{const[h,m,y,v]=Na(n.rgb,e.rgb,s);return new Bt(h,m,y,v,!1)}case"hcl":{const[h,m,y,v]=n.hcl,[S,k,C,z]=e.hcl;let D,B;if(isNaN(h)||isNaN(S))isNaN(h)?isNaN(S)?D=NaN:(D=S,y!==1&&y!==0||(B=k)):(D=h,C!==1&&C!==0||(B=m));else{let ue=S-h;S>h&&ue>180?ue-=360:S180&&(ue+=360),D=h+s*ue}const[O,j,W,Y]=function([ue,ee,he,fe]){return ue=isNaN(ue)?0:ue*dt,Zt([he,Math.cos(ue)*ee,Math.sin(ue)*ee,fe])}([D,B??bt(m,k,s),bt(y,C,s),bt(v,z,s)]);return new Bt(O,j,W,Y,!1)}case"lab":{const[h,m,y,v]=Zt(Na(n.lab,e.lab,s));return new Bt(h,m,y,v,!1)}}},array:Na,padding:function(n,e,s){return new Mn(Na(n.values,e.values,s))},variableAnchorOffsetCollection:function(n,e,s){const a=n.values,h=e.values;if(a.length!==h.length)throw new ri(`Cannot interpolate values of different length. from: ${n.toString()}, to: ${e.toString()}`);const m=[];for(let y=0;ytypeof C!="number"||C<0||C>1))return s.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);h={name:"cubic-bezier",controlPoints:k}}}if(e.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return s.error("Expected an even number of arguments.");if(m=s.parse(m,2,Re),!m)return null;const v=[];let S=null;a==="interpolate-hcl"||a==="interpolate-lab"?S=on:s.expectedType&&s.expectedType.kind!=="value"&&(S=s.expectedType);for(let k=0;k=C)return s.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',D);const O=s.parse(z,B,S);if(!O)return null;S=S||O.type,v.push([C,O])}return _e(S,Re)||_e(S,on)||_e(S,A)||_e(S,V)||_e(S,H(Re))?new An(S,a,h,m,v):s.error(`Type ${X(S)} is not interpolatable.`)}evaluate(e){const s=this.labels,a=this.outputs;if(s.length===1)return a[0].evaluate(e);const h=this.input.evaluate(e);if(h<=s[0])return a[0].evaluate(e);const m=s.length;if(h>=s[m-1])return a[m-1].evaluate(e);const y=ao(s,h),v=An.interpolationFactor(this.interpolation,h,s[y],s[y+1]),S=a[y].evaluate(e),k=a[y+1].evaluate(e);switch(this.operator){case"interpolate":return zn[this.type.kind](S,k,v);case"interpolate-hcl":return zn.color(S,k,v,"hcl");case"interpolate-lab":return zn.color(S,k,v,"lab")}}eachChild(e){e(this.input);for(const s of this.outputs)e(s)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function tu(n,e,s,a){const h=a-s,m=n-s;return h===0?0:e===1?m/h:(Math.pow(e,m)-1)/(Math.pow(e,h)-1)}class Va{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expectected at least one argument.");let a=null;const h=s.expectedType;h&&h.kind!=="value"&&(a=h);const m=[];for(const v of e.slice(1)){const S=s.parse(v,1+m.length,a,void 0,{typeAnnotation:"omit"});if(!S)return null;a=a||S.type,m.push(S)}if(!a)throw new Error("No output type");const y=h&&m.some(v=>ie(h,v.type));return new Va(y?pt:a,m)}evaluate(e){let s,a=null,h=0;for(const m of this.args)if(h++,a=m.evaluate(e),a&&a instanceof Ui&&!a.available&&(s||(s=a.name),a=null,h===this.args.length&&(a=s)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Ua{constructor(e,s){this.type=s.type,this.bindings=[].concat(e),this.result=s}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const s of this.bindings)e(s[1]);e(this.result)}static parse(e,s){if(e.length<4)return s.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let m=1;m=a.length)throw new ri(`Array index out of bounds: ${s} > ${a.length-1}.`);if(s!==Math.floor(s))throw new ri(`Array index must be an integer, but found ${s} instead.`);return a[s]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class nu{constructor(e,s){this.type=ht,this.needle=e,this.haystack=s}static parse(e,s){if(e.length!==3)return s.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=s.parse(e[1],1,pt),h=s.parse(e[2],2,pt);return a&&h?Q(a.type,[ht,gt,Re,Or,pt])?new nu(a,h):s.error(`Expected first argument to be of type boolean, string, number or null, but found ${X(a.type)} instead`):null}evaluate(e){const s=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!ae(s,["boolean","string","number","null"]))throw new ri(`Expected first argument to be of type boolean, string, number or null, but found ${X(Qt(s))} instead.`);if(!ae(a,["string","array"]))throw new ri(`Expected second argument to be of type array or string, but found ${X(Qt(a))} instead.`);return a.indexOf(s)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class ja{constructor(e,s,a){this.type=Re,this.needle=e,this.haystack=s,this.fromIndex=a}static parse(e,s){if(e.length<=2||e.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=s.parse(e[1],1,pt),h=s.parse(e[2],2,pt);if(!a||!h)return null;if(!Q(a.type,[ht,gt,Re,Or,pt]))return s.error(`Expected first argument to be of type boolean, string, number or null, but found ${X(a.type)} instead`);if(e.length===4){const m=s.parse(e[3],3,Re);return m?new ja(a,h,m):null}return new ja(a,h)}evaluate(e){const s=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!ae(s,["boolean","string","number","null"]))throw new ri(`Expected first argument to be of type boolean, string, number or null, but found ${X(Qt(s))} instead.`);if(!ae(a,["string","array"]))throw new ri(`Expected second argument to be of type array or string, but found ${X(Qt(a))} instead.`);if(this.fromIndex){const h=this.fromIndex.evaluate(e);return a.indexOf(s,h)}return a.indexOf(s)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class ru{constructor(e,s,a,h,m,y){this.inputType=e,this.type=s,this.input=a,this.cases=h,this.outputs=m,this.otherwise=y}static parse(e,s){if(e.length<5)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return s.error("Expected an even number of arguments.");let a,h;s.expectedType&&s.expectedType.kind!=="value"&&(h=s.expectedType);const m={},y=[];for(let k=2;kNumber.MAX_SAFE_INTEGER)return D.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof O=="number"&&Math.floor(O)!==O)return D.error("Numeric branch labels must be integer values.");if(a){if(D.checkSubtype(a,Qt(O)))return null}else a=Qt(O);if(m[String(O)]!==void 0)return D.error("Branch labels must be unique.");m[String(O)]=y.length}const B=s.parse(z,k,h);if(!B)return null;h=h||B.type,y.push(B)}const v=s.parse(e[1],1,pt);if(!v)return null;const S=s.parse(e[e.length-1],e.length-1,h);return S?v.type.kind!=="value"&&s.concat(1).checkSubtype(a,v.type)?null:new ru(a,h,v,m,y,S):null}evaluate(e){const s=this.input.evaluate(e);return(Qt(s)===this.inputType&&this.outputs[this.cases[s]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class su{constructor(e,s,a){this.type=e,this.branches=s,this.otherwise=a}static parse(e,s){if(e.length<4)return s.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return s.error("Expected an odd number of arguments.");let a;s.expectedType&&s.expectedType.kind!=="value"&&(a=s.expectedType);const h=[];for(let y=1;ys.outputDefined())&&this.otherwise.outputDefined()}}class $a{constructor(e,s,a,h){this.type=e,this.input=s,this.beginIndex=a,this.endIndex=h}static parse(e,s){if(e.length<=2||e.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=s.parse(e[1],1,pt),h=s.parse(e[2],2,Re);if(!a||!h)return null;if(!Q(a.type,[H(pt),gt,pt]))return s.error(`Expected first argument to be of type array or string, but found ${X(a.type)} instead`);if(e.length===4){const m=s.parse(e[3],3,Re);return m?new $a(a.type,a,h,m):null}return new $a(a.type,a,h)}evaluate(e){const s=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!ae(s,["string","array"]))throw new ri(`Expected first argument to be of type array or string, but found ${X(Qt(s))} instead.`);if(this.endIndex){const h=this.endIndex.evaluate(e);return s.slice(a,h)}return s.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function th(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function ih(n,e,s,a){return a.compare(e,s)===0}function lo(n,e,s){const a=n!=="=="&&n!=="!=";return class c1{constructor(m,y,v){this.type=ht,this.lhs=m,this.rhs=y,this.collator=v,this.hasUntypedArgument=m.type.kind==="value"||y.type.kind==="value"}static parse(m,y){if(m.length!==3&&m.length!==4)return y.error("Expected two or three arguments.");const v=m[0];let S=y.parse(m[1],1,pt);if(!S)return null;if(!th(v,S.type))return y.concat(1).error(`"${v}" comparisons are not supported for type '${X(S.type)}'.`);let k=y.parse(m[2],2,pt);if(!k)return null;if(!th(v,k.type))return y.concat(2).error(`"${v}" comparisons are not supported for type '${X(k.type)}'.`);if(S.type.kind!==k.type.kind&&S.type.kind!=="value"&&k.type.kind!=="value")return y.error(`Cannot compare types '${X(S.type)}' and '${X(k.type)}'.`);a&&(S.type.kind==="value"&&k.type.kind!=="value"?S=new Wn(k.type,[S]):S.type.kind!=="value"&&k.type.kind==="value"&&(k=new Wn(S.type,[k])));let C=null;if(m.length===4){if(S.type.kind!=="string"&&k.type.kind!=="string"&&S.type.kind!=="value"&&k.type.kind!=="value")return y.error("Cannot use collator to compare non-string types.");if(C=y.parse(m[3],3,Nr),!C)return null}return new c1(S,k,C)}evaluate(m){const y=this.lhs.evaluate(m),v=this.rhs.evaluate(m);if(a&&this.hasUntypedArgument){const S=Qt(y),k=Qt(v);if(S.kind!==k.kind||S.kind!=="string"&&S.kind!=="number")throw new ri(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${S.kind}, ${k.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const S=Qt(y),k=Qt(v);if(S.kind!=="string"||k.kind!=="string")return e(m,y,v)}return this.collator?s(m,y,v,this.collator.evaluate(m)):e(m,y,v)}eachChild(m){m(this.lhs),m(this.rhs),this.collator&&m(this.collator)}outputDefined(){return!0}}}const bp=lo("==",function(n,e,s){return e===s},ih),Sp=lo("!=",function(n,e,s){return e!==s},function(n,e,s,a){return!ih(0,e,s,a)}),Tp=lo("<",function(n,e,s){return e",function(n,e,s){return e>s},function(n,e,s,a){return a.compare(e,s)>0}),Ep=lo("<=",function(n,e,s){return e<=s},function(n,e,s,a){return a.compare(e,s)<=0}),Ip=lo(">=",function(n,e,s){return e>=s},function(n,e,s,a){return a.compare(e,s)>=0});class ou{constructor(e,s,a,h,m){this.type=gt,this.number=e,this.locale=s,this.currency=a,this.minFractionDigits=h,this.maxFractionDigits=m}static parse(e,s){if(e.length!==3)return s.error("Expected two arguments.");const a=s.parse(e[1],1,Re);if(!a)return null;const h=e[2];if(typeof h!="object"||Array.isArray(h))return s.error("NumberFormat options argument must be an object.");let m=null;if(h.locale&&(m=s.parse(h.locale,1,gt),!m))return null;let y=null;if(h.currency&&(y=s.parse(h.currency,1,gt),!y))return null;let v=null;if(h["min-fraction-digits"]&&(v=s.parse(h["min-fraction-digits"],1,Re),!v))return null;let S=null;return h["max-fraction-digits"]&&(S=s.parse(h["max-fraction-digits"],1,Re),!S)?null:new ou(a,m,y,v,S)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Za{constructor(e){this.type=q,this.sections=e}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return s.error("First argument must be an image or text section.");const h=[];let m=!1;for(let y=1;y<=e.length-1;++y){const v=e[y];if(m&&typeof v=="object"&&!Array.isArray(v)){m=!1;let S=null;if(v["font-scale"]&&(S=s.parse(v["font-scale"],1,Re),!S))return null;let k=null;if(v["text-font"]&&(k=s.parse(v["text-font"],1,H(gt)),!k))return null;let C=null;if(v["text-color"]&&(C=s.parse(v["text-color"],1,on),!C))return null;const z=h[h.length-1];z.scale=S,z.font=k,z.textColor=C}else{const S=s.parse(e[y],1,pt);if(!S)return null;const k=S.type.kind;if(k!=="string"&&k!=="value"&&k!=="null"&&k!=="resolvedImage")return s.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");m=!0,h.push({content:S,scale:null,font:null,textColor:null})}}return new Za(h)}evaluate(e){return new Xi(this.sections.map(s=>{const a=s.content.evaluate(e);return Qt(a)===R?new Pa("",a,null,null,null):new Pa(Mt(a),null,s.scale?s.scale.evaluate(e):null,s.font?s.font.evaluate(e).join(","):null,s.textColor?s.textColor.evaluate(e):null)}))}eachChild(e){for(const s of this.sections)e(s.content),s.scale&&e(s.scale),s.font&&e(s.font),s.textColor&&e(s.textColor)}outputDefined(){return!1}}class au{constructor(e){this.type=R,this.input=e}static parse(e,s){if(e.length!==2)return s.error("Expected two arguments.");const a=s.parse(e[1],1,gt);return a?new au(a):s.error("No image name provided.")}evaluate(e){const s=this.input.evaluate(e),a=Ui.fromString(s);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(s)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class lu{constructor(e){this.type=Re,this.input=e}static parse(e,s){if(e.length!==2)return s.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=s.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?s.error(`Expected argument of type string or array, but found ${X(a.type)} instead.`):new lu(a):null}evaluate(e){const s=this.input.evaluate(e);if(typeof s=="string"||Array.isArray(s))return s.length;throw new ri(`Expected value to be of type string or array, but found ${X(Qt(s))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const uo={"==":bp,"!=":Sp,">":kp,"<":Tp,">=":Ip,"<=":Ep,array:Wn,at:iu,boolean:Wn,case:su,coalesce:Va,collator:Da,format:Za,image:au,in:nu,"index-of":ja,interpolate:An,"interpolate-hcl":An,"interpolate-lab":An,length:lu,let:Ua,literal:Is,match:ru,number:Wn,"number-format":ou,object:Wn,slice:$a,step:hs,string:Wn,"to-boolean":us,"to-color":us,"to-number":us,"to-string":us,var:Ra,within:Cs};function nh(n,[e,s,a,h]){e=e.evaluate(n),s=s.evaluate(n),a=a.evaluate(n);const m=h?h.evaluate(n):1,y=Ma(e,s,a,m);if(y)throw new ri(y);return new Bt(e/255,s/255,a/255,m,!1)}function rh(n,e){return n in e}function uu(n,e){const s=e[n];return s===void 0?null:s}function Ps(n){return{type:n}}function sh(n){return{result:"success",value:n}}function ds(n){return{result:"error",value:n}}function co(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function oh(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function cu(n){return!!n.expression&&n.expression.interpolated}function zt(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function Jt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Cp(n){return n}function St(n,e){const s=e.type==="color",a=n.stops&&typeof n.stops[0][0]=="object",h=a||!(a||n.property!==void 0),m=n.type||(cu(e)?"exponential":"interval");if(s||e.type==="padding"){const C=s?Bt.parse:Mn.parse;(n=xr({},n)).stops&&(n.stops=n.stops.map(z=>[z[0],C(z[1])])),n.default=C(n.default?n.default:e.default)}if(n.colorSpace&&(y=n.colorSpace)!=="rgb"&&y!=="hcl"&&y!=="lab")throw new Error(`Unknown color space: "${n.colorSpace}"`);var y;let v,S,k;if(m==="exponential")v=Wo;else if(m==="interval")v=Kt;else if(m==="categorical"){v=ei,S=Object.create(null);for(const C of n.stops)S[C[0]]=C[1];k=typeof n.stops[0][0]}else{if(m!=="identity")throw new Error(`Unknown function type "${m}"`);v=ah}if(a){const C={},z=[];for(let O=0;OO[0]),evaluate:({zoom:O},j)=>Wo({stops:D,base:n.base},e,O).evaluate(O,j)}}if(h){const C=m==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:C,interpolationFactor:An.interpolationFactor.bind(void 0,C),zoomStops:n.stops.map(z=>z[0]),evaluate:({zoom:z})=>v(n,e,z,S,k)}}return{kind:"source",evaluate(C,z){const D=z&&z.properties?z.properties[n.property]:void 0;return D===void 0?Ms(n.default,e.default):v(n,e,D,S,k)}}}function Ms(n,e,s){return n!==void 0?n:e!==void 0?e:s!==void 0?s:void 0}function ei(n,e,s,a,h){return Ms(typeof s===h?a[s]:void 0,n.default,e.default)}function Kt(n,e,s){if(zt(s)!=="number")return Ms(n.default,e.default);const a=n.stops.length;if(a===1||s<=n.stops[0][0])return n.stops[0][1];if(s>=n.stops[a-1][0])return n.stops[a-1][1];const h=ao(n.stops.map(m=>m[0]),s);return n.stops[h][1]}function Wo(n,e,s){const a=n.base!==void 0?n.base:1;if(zt(s)!=="number")return Ms(n.default,e.default);const h=n.stops.length;if(h===1||s<=n.stops[0][0])return n.stops[0][1];if(s>=n.stops[h-1][0])return n.stops[h-1][1];const m=ao(n.stops.map(C=>C[0]),s),y=function(C,z,D,B){const O=B-D,j=C-D;return O===0?0:z===1?j/O:(Math.pow(z,j)-1)/(Math.pow(z,O)-1)}(s,a,n.stops[m][0],n.stops[m+1][0]),v=n.stops[m][1],S=n.stops[m+1][1],k=zn[e.type]||Cp;return typeof v.evaluate=="function"?{evaluate(...C){const z=v.evaluate.apply(void 0,C),D=S.evaluate.apply(void 0,C);if(z!==void 0&&D!==void 0)return k(z,D,y,n.colorSpace)}}:k(v,S,y,n.colorSpace)}function ah(n,e,s){switch(e.type){case"color":s=Bt.parse(s);break;case"formatted":s=Xi.fromString(s.toString());break;case"resolvedImage":s=Ui.fromString(s.toString());break;case"padding":s=Mn.parse(s);break;default:zt(s)===e.type||e.type==="enum"&&e.values[s]||(s=void 0)}return Ms(s,n.default,e.default)}Xn.register(uo,{error:[{kind:"error"},[gt],(n,[e])=>{throw new ri(e.evaluate(n))}],typeof:[gt,[pt],(n,[e])=>X(Qt(e.evaluate(n)))],"to-rgba":[H(Re,4),[on],(n,[e])=>{const[s,a,h,m]=e.evaluate(n).rgb;return[255*s,255*a,255*h,m]}],rgb:[on,[Re,Re,Re],nh],rgba:[on,[Re,Re,Re,Re],nh],has:{type:ht,overloads:[[[gt],(n,[e])=>rh(e.evaluate(n),n.properties())],[[gt,wr],(n,[e,s])=>rh(e.evaluate(n),s.evaluate(n))]]},get:{type:pt,overloads:[[[gt],(n,[e])=>uu(e.evaluate(n),n.properties())],[[gt,wr],(n,[e,s])=>uu(e.evaluate(n),s.evaluate(n))]]},"feature-state":[pt,[gt],(n,[e])=>uu(e.evaluate(n),n.featureState||{})],properties:[wr,[],n=>n.properties()],"geometry-type":[gt,[],n=>n.geometryType()],id:[pt,[],n=>n.id()],zoom:[Re,[],n=>n.globals.zoom],"heatmap-density":[Re,[],n=>n.globals.heatmapDensity||0],"line-progress":[Re,[],n=>n.globals.lineProgress||0],accumulated:[pt,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[Re,Ps(Re),(n,e)=>{let s=0;for(const a of e)s+=a.evaluate(n);return s}],"*":[Re,Ps(Re),(n,e)=>{let s=1;for(const a of e)s*=a.evaluate(n);return s}],"-":{type:Re,overloads:[[[Re,Re],(n,[e,s])=>e.evaluate(n)-s.evaluate(n)],[[Re],(n,[e])=>-e.evaluate(n)]]},"/":[Re,[Re,Re],(n,[e,s])=>e.evaluate(n)/s.evaluate(n)],"%":[Re,[Re,Re],(n,[e,s])=>e.evaluate(n)%s.evaluate(n)],ln2:[Re,[],()=>Math.LN2],pi:[Re,[],()=>Math.PI],e:[Re,[],()=>Math.E],"^":[Re,[Re,Re],(n,[e,s])=>Math.pow(e.evaluate(n),s.evaluate(n))],sqrt:[Re,[Re],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[Re,[Re],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[Re,[Re],(n,[e])=>Math.log(e.evaluate(n))],log2:[Re,[Re],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[Re,[Re],(n,[e])=>Math.sin(e.evaluate(n))],cos:[Re,[Re],(n,[e])=>Math.cos(e.evaluate(n))],tan:[Re,[Re],(n,[e])=>Math.tan(e.evaluate(n))],asin:[Re,[Re],(n,[e])=>Math.asin(e.evaluate(n))],acos:[Re,[Re],(n,[e])=>Math.acos(e.evaluate(n))],atan:[Re,[Re],(n,[e])=>Math.atan(e.evaluate(n))],min:[Re,Ps(Re),(n,e)=>Math.min(...e.map(s=>s.evaluate(n)))],max:[Re,Ps(Re),(n,e)=>Math.max(...e.map(s=>s.evaluate(n)))],abs:[Re,[Re],(n,[e])=>Math.abs(e.evaluate(n))],round:[Re,[Re],(n,[e])=>{const s=e.evaluate(n);return s<0?-Math.round(-s):Math.round(s)}],floor:[Re,[Re],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[Re,[Re],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[ht,[gt,pt],(n,[e,s])=>n.properties()[e.value]===s.value],"filter-id-==":[ht,[pt],(n,[e])=>n.id()===e.value],"filter-type-==":[ht,[gt],(n,[e])=>n.geometryType()===e.value],"filter-<":[ht,[gt,pt],(n,[e,s])=>{const a=n.properties()[e.value],h=s.value;return typeof a==typeof h&&a{const s=n.id(),a=e.value;return typeof s==typeof a&&s":[ht,[gt,pt],(n,[e,s])=>{const a=n.properties()[e.value],h=s.value;return typeof a==typeof h&&a>h}],"filter-id->":[ht,[pt],(n,[e])=>{const s=n.id(),a=e.value;return typeof s==typeof a&&s>a}],"filter-<=":[ht,[gt,pt],(n,[e,s])=>{const a=n.properties()[e.value],h=s.value;return typeof a==typeof h&&a<=h}],"filter-id-<=":[ht,[pt],(n,[e])=>{const s=n.id(),a=e.value;return typeof s==typeof a&&s<=a}],"filter->=":[ht,[gt,pt],(n,[e,s])=>{const a=n.properties()[e.value],h=s.value;return typeof a==typeof h&&a>=h}],"filter-id->=":[ht,[pt],(n,[e])=>{const s=n.id(),a=e.value;return typeof s==typeof a&&s>=a}],"filter-has":[ht,[pt],(n,[e])=>e.value in n.properties()],"filter-has-id":[ht,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[ht,[H(gt)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[ht,[H(pt)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[ht,[gt,H(pt)],(n,[e,s])=>s.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[ht,[gt,H(pt)],(n,[e,s])=>function(a,h,m,y){for(;m<=y;){const v=m+y>>1;if(h[v]===a)return!0;h[v]>a?y=v-1:m=v+1}return!1}(n.properties()[e.value],s.value,0,s.value.length-1)],all:{type:ht,overloads:[[[ht,ht],(n,[e,s])=>e.evaluate(n)&&s.evaluate(n)],[Ps(ht),(n,e)=>{for(const s of e)if(!s.evaluate(n))return!1;return!0}]]},any:{type:ht,overloads:[[[ht,ht],(n,[e,s])=>e.evaluate(n)||s.evaluate(n)],[Ps(ht),(n,e)=>{for(const s of e)if(s.evaluate(n))return!0;return!1}]]},"!":[ht,[ht],(n,[e])=>!e.evaluate(n)],"is-supported-script":[ht,[gt],(n,[e])=>{const s=n.globals&&n.globals.isSupportedScript;return!s||s(e.evaluate(n))}],upcase:[gt,[gt],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[gt,[gt],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[gt,Ps(pt),(n,e)=>e.map(s=>Mt(s.evaluate(n))).join("")],"resolved-locale":[gt,[Nr],(n,[e])=>e.evaluate(n).resolvedLocale()]});class hu{constructor(e,s){var a;this.expression=e,this._warningHistory={},this._evaluator=new Xl,this._defaultValue=s?(a=s).type==="color"&&Jt(a.default)?new Bt(0,0,0,0):a.type==="color"?Bt.parse(a.default)||null:a.type==="padding"?Mn.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?Hn.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=s&&s.type==="enum"?s.values:null}evaluateWithoutErrorHandling(e,s,a,h,m,y){return this._evaluator.globals=e,this._evaluator.feature=s,this._evaluator.featureState=a,this._evaluator.canonical=h,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=y,this.expression.evaluate(this._evaluator)}evaluate(e,s,a,h,m,y){this._evaluator.globals=e,this._evaluator.feature=s||null,this._evaluator.featureState=a||null,this._evaluator.canonical=h,this._evaluator.availableImages=m||null,this._evaluator.formattedSection=y||null;try{const v=this.expression.evaluate(this._evaluator);if(v==null||typeof v=="number"&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new ri(`Expected value to be one of ${Object.keys(this._enumValues).map(S=>JSON.stringify(S)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}}}function qa(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in uo}function Ga(n,e){const s=new Aa(uo,Fa,[],e?function(h){const m={color:on,string:gt,number:Re,enum:gt,boolean:ht,formatted:q,padding:A,resolvedImage:R,variableAnchorOffsetCollection:V};return h.type==="array"?H(m[h.value]||pt,h.length):m[h.type]}(e):void 0),a=s.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?sh(new hu(a,e)):ds(s.errors)}class du{constructor(e,s){this.kind=e,this._styleExpression=s,this.isStateDependent=e!=="constant"&&!Ho(s.expression)}evaluateWithoutErrorHandling(e,s,a,h,m,y){return this._styleExpression.evaluateWithoutErrorHandling(e,s,a,h,m,y)}evaluate(e,s,a,h,m,y){return this._styleExpression.evaluate(e,s,a,h,m,y)}}class Ha{constructor(e,s,a,h){this.kind=e,this.zoomStops=a,this._styleExpression=s,this.isStateDependent=e!=="camera"&&!Ho(s.expression),this.interpolationType=h}evaluateWithoutErrorHandling(e,s,a,h,m,y){return this._styleExpression.evaluateWithoutErrorHandling(e,s,a,h,m,y)}evaluate(e,s,a,h,m,y){return this._styleExpression.evaluate(e,s,a,h,m,y)}interpolationFactor(e,s,a){return this.interpolationType?An.interpolationFactor(this.interpolationType,e,s,a):0}}function pu(n,e){const s=Ga(n,e);if(s.result==="error")return s;const a=s.value.expression,h=Ba(a);if(!h&&!co(e))return ds([new ni("","data expressions not supported")]);const m=Oa(a,["zoom"]);if(!m&&!oh(e))return ds([new ni("","zoom expressions not supported")]);const y=Ko(a);return y||m?y instanceof ni?ds([y]):y instanceof An&&!cu(e)?ds([new ni("",'"interpolate" expressions cannot be used with this property')]):sh(y?new Ha(h?"camera":"composite",s.value,y.labels,y instanceof An?y.interpolation:void 0):new du(h?"constant":"source",s.value)):ds([new ni("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Xo{constructor(e,s){this._parameters=e,this._specification=s,xr(this,St(this._parameters,this._specification))}static deserialize(e){return new Xo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ko(n){let e=null;if(n instanceof Ua)e=Ko(n.result);else if(n instanceof Va){for(const s of n.args)if(e=Ko(s),e)break}else(n instanceof hs||n instanceof An)&&n.input instanceof Xn&&n.input.name==="zoom"&&(e=n);return e instanceof ni||n.eachChild(s=>{const a=Ko(s);a instanceof ni?e=a:!e&&a?e=new ni("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new ni("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Yo(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!Yo(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Pp={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function fu(n){if(n==null)return{filter:()=>!0,needGeometry:!1};Yo(n)||(n=Wa(n));const e=Ga(n,Pp);if(e.result==="error")throw new Error(e.value.map(s=>`${s.key}: ${s.message}`).join(", "));return{filter:(s,a,h)=>e.value.evaluate(s,a,{},h),needGeometry:lh(n)}}function Mp(n,e){return ne?1:0}function lh(n){if(!Array.isArray(n))return!1;if(n[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?mu(n[1],n[2],e):e==="any"?(s=n.slice(1),["any"].concat(s.map(Wa))):e==="all"?["all"].concat(n.slice(1).map(Wa)):e==="none"?["all"].concat(n.slice(1).map(Wa).map(Qo)):e==="in"?uh(n[1],n.slice(2)):e==="!in"?Qo(uh(n[1],n.slice(2))):e==="has"?ch(n[1]):e==="!has"?Qo(ch(n[1])):e!=="within"||n;var s}function mu(n,e,s){switch(n){case"$type":return[`filter-type-${s}`,e];case"$id":return[`filter-id-${s}`,e];default:return[`filter-${s}`,n,e]}}function uh(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(s=>typeof s!=typeof e[0])?["filter-in-large",n,["literal",e.sort(Mp)]]:["filter-in-small",n,["literal",e]]}}function ch(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function Qo(n){return["!",n]}function Xa(n){const e=typeof n;if(e==="number"||e==="boolean"||e==="string"||n==null)return JSON.stringify(n);if(Array.isArray(n)){let h="[";for(const m of n)h+=`${Xa(m)},`;return`${h}]`}const s=Object.keys(n).sort();let a="{";for(let h=0;ha.maximum?[new ze(e,s,`${s} is greater than the maximum value ${a.maximum}`)]:[]}function Ya(n){const e=n.valueSpec,s=si(n.value.type);let a,h,m,y={};const v=s!=="categorical"&&n.value.property===void 0,S=!v,k=zt(n.value.stops)==="array"&&zt(n.value.stops[0])==="array"&&zt(n.value.stops[0][0])==="object",C=yn({key:n.key,value:n.value,valueSpec:n.styleSpec.function,validateSpec:n.validateSpec,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:function(B){if(s==="identity")return[new ze(B.key,B.value,'identity function may not have a "stops" property')];let O=[];const j=B.value;return O=O.concat(ho({key:B.key,value:j,valueSpec:B.valueSpec,validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec,arrayElementValidator:z})),zt(j)==="array"&&j.length===0&&O.push(new ze(B.key,j,"array must have at least one stop")),O},default:function(B){return B.validateSpec({key:B.key,value:B.value,valueSpec:e,validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec})}}});return s==="identity"&&v&&C.push(new ze(n.key,n.value,'missing required property "property"')),s==="identity"||n.value.stops||C.push(new ze(n.key,n.value,'missing required property "stops"')),s==="exponential"&&n.valueSpec.expression&&!cu(n.valueSpec)&&C.push(new ze(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(S&&!co(n.valueSpec)?C.push(new ze(n.key,n.value,"property functions not supported")):v&&!oh(n.valueSpec)&&C.push(new ze(n.key,n.value,"zoom functions not supported"))),s!=="categorical"&&!k||n.value.property!==void 0||C.push(new ze(n.key,n.value,'"property" property is required')),C;function z(B){let O=[];const j=B.value,W=B.key;if(zt(j)!=="array")return[new ze(W,j,`array expected, ${zt(j)} found`)];if(j.length!==2)return[new ze(W,j,`array length 2 expected, length ${j.length} found`)];if(k){if(zt(j[0])!=="object")return[new ze(W,j,`object expected, ${zt(j[0])} found`)];if(j[0].zoom===void 0)return[new ze(W,j,"object stop key must have zoom")];if(j[0].value===void 0)return[new ze(W,j,"object stop key must have value")];if(m&&m>si(j[0].zoom))return[new ze(W,j[0].zoom,"stop zoom values must appear in ascending order")];si(j[0].zoom)!==m&&(m=si(j[0].zoom),h=void 0,y={}),O=O.concat(yn({key:`${W}[0]`,value:j[0],valueSpec:{zoom:{}},validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec,objectElementValidators:{zoom:Jo,value:D}}))}else O=O.concat(D({key:`${W}[0]`,value:j[0],valueSpec:{},validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec},j));return qa(zs(j[1]))?O.concat([new ze(`${W}[1]`,j[1],"expressions are not allowed in function stops.")]):O.concat(B.validateSpec({key:`${W}[1]`,value:j[1],valueSpec:e,validateSpec:B.validateSpec,style:B.style,styleSpec:B.styleSpec}))}function D(B,O){const j=zt(B.value),W=si(B.value),Y=B.value!==null?B.value:O;if(a){if(j!==a)return[new ze(B.key,Y,`${j} stop domain type must match previous stop domain type ${a}`)]}else a=j;if(j!=="number"&&j!=="string"&&j!=="boolean")return[new ze(B.key,Y,"stop domain value must be a number, string, or boolean")];if(j!=="number"&&s!=="categorical"){let ue=`number expected, ${j} found`;return co(e)&&s===void 0&&(ue+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze(B.key,Y,ue)]}return s!=="categorical"||j!=="number"||isFinite(W)&&Math.floor(W)===W?s!=="categorical"&&j==="number"&&h!==void 0&&Wnew ze(`${n.key}${a.key}`,n.value,a.message));const s=e.value.expression||e.value._styleExpression.expression;if(n.expressionContext==="property"&&n.propertyKey==="text-font"&&!s.outputDefined())return[new ze(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if(n.expressionContext==="property"&&n.propertyType==="layout"&&!Ho(s))return[new ze(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if(n.expressionContext==="filter"&&!Ho(s))return[new ze(n.key,n.value,'"feature-state" data expressions are not supported with filters.')];if(n.expressionContext&&n.expressionContext.indexOf("cluster")===0){if(!Oa(s,["zoom","feature-state"]))return[new ze(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(n.expressionContext==="cluster-initial"&&!Ba(s))return[new ze(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ea(n){const e=n.key,s=n.value,a=n.valueSpec,h=[];return Array.isArray(a.values)?a.values.indexOf(si(s))===-1&&h.push(new ze(e,s,`expected one of [${a.values.join(", ")}], ${JSON.stringify(s)} found`)):Object.keys(a.values).indexOf(si(s))===-1&&h.push(new ze(e,s,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(s)} found`)),h}function po(n){return Yo(zs(n.value))?As(xr({},n,{expressionContext:"filter",valueSpec:{value:"boolean"}})):dh(n)}function dh(n){const e=n.value,s=n.key;if(zt(e)!=="array")return[new ze(s,e,`array expected, ${zt(e)} found`)];const a=n.styleSpec;let h,m=[];if(e.length<1)return[new ze(s,e,"filter array must have at least 1 element")];switch(m=m.concat(ea({key:`${s}[0]`,value:e[0],valueSpec:a.filter_operator,style:n.style,styleSpec:n.styleSpec})),si(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&si(e[1])==="$type"&&m.push(new ze(s,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&m.push(new ze(s,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(h=zt(e[1]),h!=="string"&&m.push(new ze(`${s}[1]`,e[1],`string expected, ${h} found`)));for(let y=2;y{k in s&&e.push(new ze(a,s[k],`"${k}" is prohibited for ref layers`))}),h.layers.forEach(k=>{si(k.id)===v&&(S=k)}),S?S.ref?e.push(new ze(a,s.ref,"ref cannot reference another ref layer")):y=si(S.type):e.push(new ze(a,s.ref,`ref layer "${v}" not found`))}else if(y!=="background")if(s.source){const S=h.sources&&h.sources[s.source],k=S&&si(S.type);S?k==="vector"&&y==="raster"?e.push(new ze(a,s.source,`layer "${s.id}" requires a raster source`)):k!=="raster-dem"&&y==="hillshade"?e.push(new ze(a,s.source,`layer "${s.id}" requires a raster-dem source`)):k==="raster"&&y!=="raster"?e.push(new ze(a,s.source,`layer "${s.id}" requires a vector source`)):k!=="vector"||s["source-layer"]?k==="raster-dem"&&y!=="hillshade"?e.push(new ze(a,s.source,"raster-dem source can only be used with layer type 'hillshade'.")):y!=="line"||!s.paint||!s.paint["line-gradient"]||k==="geojson"&&S.lineMetrics||e.push(new ze(a,s,`layer "${s.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new ze(a,s,`layer "${s.id}" must specify a "source-layer"`)):e.push(new ze(a,s.source,`source "${s.source}" not found`))}else e.push(new ze(a,s,'missing required property "source"'));return e=e.concat(yn({key:a,value:s,valueSpec:m.layer,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,objectElementValidators:{"*":()=>[],type:()=>n.validateSpec({key:`${a}.type`,value:s.type,valueSpec:m.layer.type,style:n.style,styleSpec:n.styleSpec,validateSpec:n.validateSpec,object:s,objectKey:"type"}),filter:po,layout:S=>yn({layer:s,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":k=>mh(xr({layerType:y},k))}}),paint:S=>yn({layer:s,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":k=>fh(xr({layerType:y},k))}})}})),e}function br(n){const e=n.value,s=n.key,a=zt(e);return a!=="string"?[new ze(s,e,`string expected, ${a} found`)]:[]}const ta={promoteId:function({key:n,value:e}){if(zt(e)==="string")return br({key:n,value:e});{const s=[];for(const a in e)s.push(...br({key:`${n}.${a}`,value:e[a]}));return s}}};function Dn(n){const e=n.value,s=n.key,a=n.styleSpec,h=n.style,m=n.validateSpec;if(!e.type)return[new ze(s,e,'"type" is required')];const y=si(e.type);let v;switch(y){case"vector":case"raster":return v=yn({key:s,value:e,valueSpec:a[`source_${y.replace("-","_")}`],style:n.style,styleSpec:a,objectElementValidators:ta,validateSpec:m}),v;case"raster-dem":return v=function(S){var k;const C=(k=S.sourceName)!==null&&k!==void 0?k:"",z=S.value,D=S.styleSpec,B=D.source_raster_dem,O=S.style;let j=[];const W=zt(z);if(z===void 0)return j;if(W!=="object")return j.push(new ze("source_raster_dem",z,`object expected, ${W} found`)),j;const Y=si(z.encoding)==="custom",ue=["redFactor","greenFactor","blueFactor","baseShift"],ee=S.value.encoding?`"${S.value.encoding}"`:"Default";for(const he in z)!Y&&ue.includes(he)?j.push(new ze(he,z[he],`In "${C}": "${he}" is only valid when "encoding" is set to "custom". ${ee} encoding found`)):B[he]?j=j.concat(S.validateSpec({key:he,value:z[he],valueSpec:B[he],validateSpec:S.validateSpec,style:O,styleSpec:D})):j.push(new ze(he,z[he],`unknown property "${he}"`));return j}({sourceName:s,value:e,style:n.style,styleSpec:a,validateSpec:m}),v;case"geojson":if(v=yn({key:s,value:e,valueSpec:a.source_geojson,style:h,styleSpec:a,validateSpec:m,objectElementValidators:ta}),e.cluster)for(const S in e.clusterProperties){const[k,C]=e.clusterProperties[S],z=typeof k=="string"?[k,["accumulated"],["get",S]]:k;v.push(...As({key:`${s}.${S}.map`,value:C,validateSpec:m,expressionContext:"cluster-map"})),v.push(...As({key:`${s}.${S}.reduce`,value:z,validateSpec:m,expressionContext:"cluster-reduce"}))}return v;case"video":return yn({key:s,value:e,valueSpec:a.source_video,style:h,validateSpec:m,styleSpec:a});case"image":return yn({key:s,value:e,valueSpec:a.source_image,style:h,validateSpec:m,styleSpec:a});case"canvas":return[new ze(s,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ea({key:`${s}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:h,validateSpec:m,styleSpec:a})}}function ia(n){const e=n.value,s=n.styleSpec,a=s.light,h=n.style;let m=[];const y=zt(e);if(e===void 0)return m;if(y!=="object")return m=m.concat([new ze("light",e,`object expected, ${y} found`)]),m;for(const v in e){const S=v.match(/^(.*)-transition$/);m=m.concat(S&&a[S[1]]&&a[S[1]].transition?n.validateSpec({key:v,value:e[v],valueSpec:s.transition,validateSpec:n.validateSpec,style:h,styleSpec:s}):a[v]?n.validateSpec({key:v,value:e[v],valueSpec:a[v],validateSpec:n.validateSpec,style:h,styleSpec:s}):[new ze(v,e[v],`unknown property "${v}"`)])}return m}function yh(n){const e=n.value,s=n.styleSpec,a=s.terrain,h=n.style;let m=[];const y=zt(e);if(e===void 0)return m;if(y!=="object")return m=m.concat([new ze("terrain",e,`object expected, ${y} found`)]),m;for(const v in e)m=m.concat(a[v]?n.validateSpec({key:v,value:e[v],valueSpec:a[v],validateSpec:n.validateSpec,style:h,styleSpec:s}):[new ze(v,e[v],`unknown property "${v}"`)]);return m}function _h(n){let e=[];const s=n.value,a=n.key;if(Array.isArray(s)){const h=[],m=[];for(const y in s)s[y].id&&h.includes(s[y].id)&&e.push(new ze(a,s,`all the sprites' ids must be unique, but ${s[y].id} is duplicated`)),h.push(s[y].id),s[y].url&&m.includes(s[y].url)&&e.push(new ze(a,s,`all the sprites' URLs must be unique, but ${s[y].url} is duplicated`)),m.push(s[y].url),e=e.concat(yn({key:`${a}[${y}]`,value:s[y],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:n.validateSpec}));return e}return br({key:a,value:s})}const vh={"*":()=>[],array:ho,boolean:function(n){const e=n.value,s=n.key,a=zt(e);return a!=="boolean"?[new ze(s,e,`boolean expected, ${a} found`)]:[]},number:Jo,color:function(n){const e=n.key,s=n.value,a=zt(s);return a!=="string"?[new ze(e,s,`color expected, ${a} found`)]:Bt.parse(String(s))?[]:[new ze(e,s,`color expected, "${s}" found`)]},constants:hh,enum:ea,filter:po,function:Ya,layer:gh,object:yn,source:Dn,light:ia,terrain:yh,string:br,formatted:function(n){return br(n).length===0?[]:As(n)},resolvedImage:function(n){return br(n).length===0?[]:As(n)},padding:function(n){const e=n.key,s=n.value;if(zt(s)==="array"){if(s.length<1||s.length>4)return[new ze(e,s,`padding requires 1 to 4 values; ${s.length} values found`)];const a={type:"number"};let h=[];for(let m=0;m[]}})),n.constants&&(s=s.concat(hh({key:"constants",value:n.constants,style:n,styleSpec:e,validateSpec:Vr}))),Qa(s)}function Ur(n){return function(e){return n({...e,validateSpec:Vr})}}function Qa(n){return[].concat(n).sort((e,s)=>e.line-s.line)}function jr(n){return function(...e){return Qa(n.apply(this,e))}}Kn.source=jr(Ur(Dn)),Kn.sprite=jr(Ur(_h)),Kn.glyphs=jr(Ur(xh)),Kn.light=jr(Ur(ia)),Kn.terrain=jr(Ur(yh)),Kn.layer=jr(Ur(gh)),Kn.filter=jr(Ur(po)),Kn.paintProperty=jr(Ur(fh)),Kn.layoutProperty=jr(Ur(mh));const $r=Kn,zp=$r.light,gu=$r.paintProperty,wh=$r.layoutProperty;function Ja(n,e){let s=!1;if(e&&e.length)for(const a of e)n.fire(new as(new Error(a.message))),s=!0;return s}class fo{constructor(e,s,a){const h=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const y=new Int32Array(this.arrayBuffer);e=y[0],this.d=(s=y[1])+2*(a=y[2]);for(let S=0;S=z[O+0]&&h>=z[O+1])?(v[B]=!0,y.push(C[B])):v[B]=!1}}}}_forEachCell(e,s,a,h,m,y,v,S){const k=this._convertToCellCoord(e),C=this._convertToCellCoord(s),z=this._convertToCellCoord(a),D=this._convertToCellCoord(h);for(let B=k;B<=z;B++)for(let O=C;O<=D;O++){const j=this.d*O+B;if((!S||S(this._convertFromCellCoord(B),this._convertFromCellCoord(O),this._convertFromCellCoord(B+1),this._convertFromCellCoord(O+1)))&&m.call(this,e,s,a,h,j,y,v,S))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,s=3+this.cells.length+1+1;let a=0;for(let y=0;y=0)continue;const y=n[m];h[m]=Zr[a].shallow.indexOf(m)>=0?y:ps(y,e)}n instanceof Error&&(h.message=n.message)}if(h.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(h.$name=a),h}throw new Error("can't serialize object of type "+typeof n)}function mo(n){if(n==null||typeof n=="boolean"||typeof n=="number"||typeof n=="string"||n instanceof Boolean||n instanceof Number||n instanceof String||n instanceof Date||n instanceof RegExp||n instanceof Blob||el(n)||ct(n)||ArrayBuffer.isView(n)||n instanceof ImageData)return n;if(Array.isArray(n))return n.map(mo);if(typeof n=="object"){const e=n.$name||"Object";if(!Zr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:s}=Zr[e];if(!s)throw new Error(`can't deserialize unregistered class ${e}`);if(s.deserialize)return s.deserialize(n);const a=Object.create(s.prototype);for(const h of Object.keys(n)){if(h==="$name")continue;const m=n[h];a[h]=Zr[e].shallow.indexOf(h)>=0?m:mo(m)}return a}throw new Error("can't deserialize object of type "+typeof n)}class bh{constructor(){this.first=!0}update(e,s){const a=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=s):this.lastFloorZoomn>=128&&n<=255,Arabic:n=>n>=1536&&n<=1791,"Arabic Supplement":n=>n>=1872&&n<=1919,"Arabic Extended-A":n=>n>=2208&&n<=2303,"Hangul Jamo":n=>n>=4352&&n<=4607,"Unified Canadian Aboriginal Syllabics":n=>n>=5120&&n<=5759,Khmer:n=>n>=6016&&n<=6143,"Unified Canadian Aboriginal Syllabics Extended":n=>n>=6320&&n<=6399,"General Punctuation":n=>n>=8192&&n<=8303,"Letterlike Symbols":n=>n>=8448&&n<=8527,"Number Forms":n=>n>=8528&&n<=8591,"Miscellaneous Technical":n=>n>=8960&&n<=9215,"Control Pictures":n=>n>=9216&&n<=9279,"Optical Character Recognition":n=>n>=9280&&n<=9311,"Enclosed Alphanumerics":n=>n>=9312&&n<=9471,"Geometric Shapes":n=>n>=9632&&n<=9727,"Miscellaneous Symbols":n=>n>=9728&&n<=9983,"Miscellaneous Symbols and Arrows":n=>n>=11008&&n<=11263,"CJK Radicals Supplement":n=>n>=11904&&n<=12031,"Kangxi Radicals":n=>n>=12032&&n<=12255,"Ideographic Description Characters":n=>n>=12272&&n<=12287,"CJK Symbols and Punctuation":n=>n>=12288&&n<=12351,Hiragana:n=>n>=12352&&n<=12447,Katakana:n=>n>=12448&&n<=12543,Bopomofo:n=>n>=12544&&n<=12591,"Hangul Compatibility Jamo":n=>n>=12592&&n<=12687,Kanbun:n=>n>=12688&&n<=12703,"Bopomofo Extended":n=>n>=12704&&n<=12735,"CJK Strokes":n=>n>=12736&&n<=12783,"Katakana Phonetic Extensions":n=>n>=12784&&n<=12799,"Enclosed CJK Letters and Months":n=>n>=12800&&n<=13055,"CJK Compatibility":n=>n>=13056&&n<=13311,"CJK Unified Ideographs Extension A":n=>n>=13312&&n<=19903,"Yijing Hexagram Symbols":n=>n>=19904&&n<=19967,"CJK Unified Ideographs":n=>n>=19968&&n<=40959,"Yi Syllables":n=>n>=40960&&n<=42127,"Yi Radicals":n=>n>=42128&&n<=42191,"Hangul Jamo Extended-A":n=>n>=43360&&n<=43391,"Hangul Syllables":n=>n>=44032&&n<=55215,"Hangul Jamo Extended-B":n=>n>=55216&&n<=55295,"Private Use Area":n=>n>=57344&&n<=63743,"CJK Compatibility Ideographs":n=>n>=63744&&n<=64255,"Arabic Presentation Forms-A":n=>n>=64336&&n<=65023,"Vertical Forms":n=>n>=65040&&n<=65055,"CJK Compatibility Forms":n=>n>=65072&&n<=65103,"Small Form Variants":n=>n>=65104&&n<=65135,"Arabic Presentation Forms-B":n=>n>=65136&&n<=65279,"Halfwidth and Fullwidth Forms":n=>n>=65280&&n<=65519};function yu(n){for(const e of n)if(vu(e.charCodeAt(0)))return!0;return!1}function _u(n){for(const e of n)if(!Ap(e.charCodeAt(0)))return!1;return!0}function Ap(n){return!(Ue.Arabic(n)||Ue["Arabic Supplement"](n)||Ue["Arabic Extended-A"](n)||Ue["Arabic Presentation Forms-A"](n)||Ue["Arabic Presentation Forms-B"](n))}function vu(n){return!(n!==746&&n!==747&&(n<4352||!(Ue["Bopomofo Extended"](n)||Ue.Bopomofo(n)||Ue["CJK Compatibility Forms"](n)&&!(n>=65097&&n<=65103)||Ue["CJK Compatibility Ideographs"](n)||Ue["CJK Compatibility"](n)||Ue["CJK Radicals Supplement"](n)||Ue["CJK Strokes"](n)||!(!Ue["CJK Symbols and Punctuation"](n)||n>=12296&&n<=12305||n>=12308&&n<=12319||n===12336)||Ue["CJK Unified Ideographs Extension A"](n)||Ue["CJK Unified Ideographs"](n)||Ue["Enclosed CJK Letters and Months"](n)||Ue["Hangul Compatibility Jamo"](n)||Ue["Hangul Jamo Extended-A"](n)||Ue["Hangul Jamo Extended-B"](n)||Ue["Hangul Jamo"](n)||Ue["Hangul Syllables"](n)||Ue.Hiragana(n)||Ue["Ideographic Description Characters"](n)||Ue.Kanbun(n)||Ue["Kangxi Radicals"](n)||Ue["Katakana Phonetic Extensions"](n)||Ue.Katakana(n)&&n!==12540||!(!Ue["Halfwidth and Fullwidth Forms"](n)||n===65288||n===65289||n===65293||n>=65306&&n<=65310||n===65339||n===65341||n===65343||n>=65371&&n<=65503||n===65507||n>=65512&&n<=65519)||!(!Ue["Small Form Variants"](n)||n>=65112&&n<=65118||n>=65123&&n<=65126)||Ue["Unified Canadian Aboriginal Syllabics"](n)||Ue["Unified Canadian Aboriginal Syllabics Extended"](n)||Ue["Vertical Forms"](n)||Ue["Yijing Hexagram Symbols"](n)||Ue["Yi Syllables"](n)||Ue["Yi Radicals"](n))))}function Sh(n){return!(vu(n)||function(e){return!!(Ue["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Ue["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Ue["Letterlike Symbols"](e)||Ue["Number Forms"](e)||Ue["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Ue["Control Pictures"](e)&&e!==9251||Ue["Optical Character Recognition"](e)||Ue["Enclosed Alphanumerics"](e)||Ue["Geometric Shapes"](e)||Ue["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Ue["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Ue["CJK Symbols and Punctuation"](e)||Ue.Katakana(e)||Ue["Private Use Area"](e)||Ue["CJK Compatibility Forms"](e)||Ue["Small Form Variants"](e)||Ue["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(n))}function Th(n){return n>=1424&&n<=2303||Ue["Arabic Presentation Forms-A"](n)||Ue["Arabic Presentation Forms-B"](n)}function kh(n,e){return!(!e&&Th(n)||n>=2304&&n<=3583||n>=3840&&n<=4255||Ue.Khmer(n))}function Dp(n){for(const e of n)if(Th(e.charCodeAt(0)))return!0;return!1}const xu="deferred",wu="loading",bu="loaded";let Su=null,_n="unavailable",fs=null;const na=function(n){n&&typeof n=="string"&&n.indexOf("NetworkError")>-1&&(_n="error"),Su&&Su(n)};function Tu(){ra.fire(new os("pluginStateChange",{pluginStatus:_n,pluginURL:fs}))}const ra=new Ts,ku=function(){return _n},Eh=function(){if(_n!==xu||!fs)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");_n=wu,Tu(),fs&&qo({url:fs},n=>{n?na(n):(_n=bu,Tu())})},Ln={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>_n===bu||Ln.applyArabicShaping!=null,isLoading:()=>_n===wu,setState(n){if(!Ii())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");_n=n.pluginStatus,fs=n.pluginURL},isParsed(){if(!Ii())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Ln.applyArabicShaping!=null&&Ln.processBidirectionalText!=null&&Ln.processStyledBidirectionalText!=null},getPluginURL(){if(!Ii())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return fs}};class Ht{constructor(e,s){this.zoom=e,s?(this.now=s.now,this.fadeDuration=s.fadeDuration,this.zoomHistory=s.zoomHistory,this.transition=s.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new bh,this.transition={})}isSupportedScript(e){return function(s,a){for(const h of s)if(!kh(h.charCodeAt(0),a))return!1;return!0}(e,Ln.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,s=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:s+(1-s)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*s}}}class tl{constructor(e,s){this.property=e,this.value=s,this.expression=function(a,h){if(Jt(a))return new Xo(a,h);if(qa(a)){const m=pu(a,h);if(m.result==="error")throw new Error(m.value.map(y=>`${y.key}: ${y.message}`).join(", "));return m.value}{let m=a;return h.type==="color"&&typeof a=="string"?m=Bt.parse(a):h.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?h.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(m=Hn.parse(a)):m=Mn.parse(a),{kind:"constant",evaluate:()=>m}}}(s===void 0?e.specification.default:s,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,s,a){return this.property.possiblyEvaluate(this,e,s,a)}}class Eu{constructor(e){this.property=e,this.value=new tl(e,void 0)}transitioned(e,s){return new Ch(this.property,this.value,s,$e({},e.transition,this.transition),e.now)}untransitioned(){return new Ch(this.property,this.value,null,{},0)}}class Ih{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Ei(this._values[e].value.value)}setValue(e,s){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Eu(this._values[e].property)),this._values[e].value=new tl(this._values[e].property,s===null?void 0:Ei(s))}getTransition(e){return Ei(this._values[e].transition)}setTransition(e,s){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Eu(this._values[e].property)),this._values[e].transition=Ei(s)||void 0}serialize(){const e={};for(const s of Object.keys(this._values)){const a=this.getValue(s);a!==void 0&&(e[s]=a);const h=this.getTransition(s);h!==void 0&&(e[`${s}-transition`]=h)}return e}transitioned(e,s){const a=new Ph(this._properties);for(const h of Object.keys(this._values))a._values[h]=this._values[h].transitioned(e,s._values[h]);return a}untransitioned(){const e=new Ph(this._properties);for(const s of Object.keys(this._values))e._values[s]=this._values[s].untransitioned();return e}}class Ch{constructor(e,s,a,h,m){this.property=e,this.value=s,this.begin=m+h.delay||0,this.end=this.begin+h.duration||0,e.specification.transition&&(h.delay||h.duration)&&(this.prior=a)}possiblyEvaluate(e,s,a){const h=e.now||0,m=this.value.possiblyEvaluate(e,s,a),y=this.prior;if(y){if(h>this.end)return this.prior=null,m;if(this.value.isDataDriven())return this.prior=null,m;if(h=1)return 1;const k=S*S,C=k*S;return 4*(S<.5?C:3*(S-k)+C-.75)}(v))}}return m}}class Ph{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,s,a){const h=new il(this._properties);for(const m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(e,s,a);return h}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Lp{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return Ei(this._values[e].value)}setValue(e,s){this._values[e]=new tl(this._values[e].property,s===null?void 0:Ei(s))}serialize(){const e={};for(const s of Object.keys(this._values)){const a=this.getValue(s);a!==void 0&&(e[s]=a)}return e}possiblyEvaluate(e,s,a){const h=new il(this._properties);for(const m of Object.keys(this._values))h._values[m]=this._values[m].possiblyEvaluate(e,s,a);return h}}class an{constructor(e,s,a){this.property=e,this.value=s,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,s,a,h){return this.property.evaluate(this.value,this.parameters,e,s,a,h)}}class il{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class et{constructor(e){this.specification=e}possiblyEvaluate(e,s){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(s)}interpolate(e,s,a){const h=zn[this.specification.type];return h?h(e,s,a):e}}class st{constructor(e,s){this.specification=e,this.overrides=s}possiblyEvaluate(e,s,a,h){return new an(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(s,null,{},a,h)}:e.expression,s)}interpolate(e,s,a){if(e.value.kind!=="constant"||s.value.kind!=="constant")return e;if(e.value.value===void 0||s.value.value===void 0)return new an(this,{kind:"constant",value:void 0},e.parameters);const h=zn[this.specification.type];if(h){const m=h(e.value.value,s.value.value,a);return new an(this,{kind:"constant",value:m},e.parameters)}return e}evaluate(e,s,a,h,m,y){return e.kind==="constant"?e.value:e.evaluate(s,a,h,m,y)}}class sa extends st{possiblyEvaluate(e,s,a,h){if(e.value===void 0)return new an(this,{kind:"constant",value:void 0},s);if(e.expression.kind==="constant"){const m=e.expression.evaluate(s,null,{},a,h),y=e.property.specification.type==="resolvedImage"&&typeof m!="string"?m.name:m,v=this._calculate(y,y,y,s);return new an(this,{kind:"constant",value:v},s)}if(e.expression.kind==="camera"){const m=this._calculate(e.expression.evaluate({zoom:s.zoom-1}),e.expression.evaluate({zoom:s.zoom}),e.expression.evaluate({zoom:s.zoom+1}),s);return new an(this,{kind:"constant",value:m},s)}return new an(this,e.expression,s)}evaluate(e,s,a,h,m,y){if(e.kind==="source"){const v=e.evaluate(s,a,h,m,y);return this._calculate(v,v,v,s)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(s.zoom)-1},a,h),e.evaluate({zoom:Math.floor(s.zoom)},a,h),e.evaluate({zoom:Math.floor(s.zoom)+1},a,h),s):e.value}_calculate(e,s,a,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:s}:{from:a,to:s}}interpolate(e){return e}}class Iu{constructor(e){this.specification=e}possiblyEvaluate(e,s,a,h){if(e.value!==void 0){if(e.expression.kind==="constant"){const m=e.expression.evaluate(s,null,{},a,h);return this._calculate(m,m,m,s)}return this._calculate(e.expression.evaluate(new Ht(Math.floor(s.zoom-1),s)),e.expression.evaluate(new Ht(Math.floor(s.zoom),s)),e.expression.evaluate(new Ht(Math.floor(s.zoom+1),s)),s)}}_calculate(e,s,a,h){return h.zoom>h.zoomHistory.lastIntegerZoom?{from:e,to:s}:{from:a,to:s}}interpolate(e){return e}}class Cu{constructor(e){this.specification=e}possiblyEvaluate(e,s,a,h){return!!e.expression.evaluate(s,null,{},a,h)}interpolate(){return!1}}class gi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const s in e){const a=e[s];a.specification.overridable&&this.overridableProperties.push(s);const h=this.defaultPropertyValues[s]=new tl(a,void 0),m=this.defaultTransitionablePropertyValues[s]=new Eu(a);this.defaultTransitioningPropertyValues[s]=m.untransitioned(),this.defaultPossiblyEvaluatedValues[s]=h.possiblyEvaluate({})}}}Ze("DataDrivenProperty",st),Ze("DataConstantProperty",et),Ze("CrossFadedDataDrivenProperty",sa),Ze("CrossFadedProperty",Iu),Ze("ColorRampProperty",Cu);const Pu="-transition";class Yn extends Ts{constructor(e,s){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),s.layout&&(this._unevaluatedLayout=new Lp(s.layout)),s.paint)){this._transitionablePaint=new Ih(s.paint);for(const a in e.paint)this.setPaintProperty(a,e.paint[a],{validate:!1});for(const a in e.layout)this.setLayoutProperty(a,e.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new il(s.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,s,a={}){s!=null&&this._validate(wh,`layers.${this.id}.layout.${e}`,e,s,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,s):this.visibility=s)}getPaintProperty(e){return e.endsWith(Pu)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,s,a={}){if(s!=null&&this._validate(gu,`layers.${this.id}.paint.${e}`,e,s,a))return!1;if(e.endsWith(Pu))return this._transitionablePaint.setTransition(e.slice(0,-11),s||void 0),!1;{const h=this._transitionablePaint._values[e],m=h.property.specification["property-type"]==="cross-faded-data-driven",y=h.value.isDataDriven(),v=h.value;this._transitionablePaint.setValue(e,s),this._handleSpecialPaintPropertyUpdate(e);const S=this._transitionablePaint._values[e].value;return S.isDataDriven()||y||m||this._handleOverridablePaintPropertyUpdate(e,v,S)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,s,a){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,s){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,s)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,s)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),fi(e,(s,a)=>!(s===void 0||a==="layout"&&!Object.keys(s).length||a==="paint"&&!Object.keys(s).length))}_validate(e,s,a,h,m={}){return(!m||m.validate!==!1)&&Ja(this,e.call($r,{key:s,layerType:this.type,objectKey:a,value:h,styleSpec:ye,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const s=this.paint.get(e);if(s instanceof an&&co(s.property.specification)&&(s.value.kind==="source"||s.value.kind==="composite")&&s.value.isStateDependent)return!0}return!1}}const Mh={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ds{constructor(e,s){this._structArray=e,this._pos1=s*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class oi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,s){return e._trim(),s&&(e.isTransferred=!0,s.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const s=Object.create(this.prototype);return s.arrayBuffer=e.arrayBuffer,s.length=e.length,s.capacity=e.arrayBuffer.byteLength/s.bytesPerElement,s._refreshViews(),s}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const s=this.uint8;this._refreshViews(),s&&this.uint8.set(s)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ti(n,e=1){let s=0,a=0;return{members:n.map(h=>{const m=Mh[h.type].BYTES_PER_ELEMENT,y=s=go(s,Math.max(e,m)),v=h.components||1;return a=Math.max(a,m),s+=m*v,{name:h.name,type:h.type,components:v,offset:y}}),size:go(s,Math.max(a,e)),alignment:e}}function go(n,e){return Math.ceil(n/e)*e}class oa extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,s)}emplace(e,s,a){const h=2*e;return this.int16[h+0]=s,this.int16[h+1]=a,e}}oa.prototype.bytesPerElement=4,Ze("StructArrayLayout2i4",oa);class aa extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,s,a)}emplace(e,s,a,h){const m=3*e;return this.int16[m+0]=s,this.int16[m+1]=a,this.int16[m+2]=h,e}}aa.prototype.bytesPerElement=6,Ze("StructArrayLayout3i6",aa);class Ls extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,s,a,h)}emplace(e,s,a,h,m){const y=4*e;return this.int16[y+0]=s,this.int16[y+1]=a,this.int16[y+2]=h,this.int16[y+3]=m,e}}Ls.prototype.bytesPerElement=8,Ze("StructArrayLayout4i8",Ls);class Mu extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,a,h,m,y){const v=this.length;return this.resize(v+1),this.emplace(v,e,s,a,h,m,y)}emplace(e,s,a,h,m,y,v){const S=6*e;return this.int16[S+0]=s,this.int16[S+1]=a,this.int16[S+2]=h,this.int16[S+3]=m,this.int16[S+4]=y,this.int16[S+5]=v,e}}Mu.prototype.bytesPerElement=12,Ze("StructArrayLayout2i4i12",Mu);class zu extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,a,h,m,y){const v=this.length;return this.resize(v+1),this.emplace(v,e,s,a,h,m,y)}emplace(e,s,a,h,m,y,v){const S=4*e,k=8*e;return this.int16[S+0]=s,this.int16[S+1]=a,this.uint8[k+4]=h,this.uint8[k+5]=m,this.uint8[k+6]=y,this.uint8[k+7]=v,e}}zu.prototype.bytesPerElement=8,Ze("StructArrayLayout2i4ub8",zu);class yo extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,s)}emplace(e,s,a){const h=2*e;return this.float32[h+0]=s,this.float32[h+1]=a,e}}yo.prototype.bytesPerElement=8,Ze("StructArrayLayout2f8",yo);class Au extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,a,h,m,y,v,S,k,C){const z=this.length;return this.resize(z+1),this.emplace(z,e,s,a,h,m,y,v,S,k,C)}emplace(e,s,a,h,m,y,v,S,k,C,z){const D=10*e;return this.uint16[D+0]=s,this.uint16[D+1]=a,this.uint16[D+2]=h,this.uint16[D+3]=m,this.uint16[D+4]=y,this.uint16[D+5]=v,this.uint16[D+6]=S,this.uint16[D+7]=k,this.uint16[D+8]=C,this.uint16[D+9]=z,e}}Au.prototype.bytesPerElement=20,Ze("StructArrayLayout10ui20",Au);class Du extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,a,h,m,y,v,S,k,C,z,D){const B=this.length;return this.resize(B+1),this.emplace(B,e,s,a,h,m,y,v,S,k,C,z,D)}emplace(e,s,a,h,m,y,v,S,k,C,z,D,B){const O=12*e;return this.int16[O+0]=s,this.int16[O+1]=a,this.int16[O+2]=h,this.int16[O+3]=m,this.uint16[O+4]=y,this.uint16[O+5]=v,this.uint16[O+6]=S,this.uint16[O+7]=k,this.int16[O+8]=C,this.int16[O+9]=z,this.int16[O+10]=D,this.int16[O+11]=B,e}}Du.prototype.bytesPerElement=24,Ze("StructArrayLayout4i4ui4i24",Du);class At extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,s,a)}emplace(e,s,a,h){const m=3*e;return this.float32[m+0]=s,this.float32[m+1]=a,this.float32[m+2]=h,e}}At.prototype.bytesPerElement=12,Ze("StructArrayLayout3f12",At);class f extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.uint32[1*e+0]=s,e}}f.prototype.bytesPerElement=4,Ze("StructArrayLayout1ul4",f);class t extends oi{_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(e,s,a,h,m,y,v,S,k){const C=this.length;return this.resize(C+1),this.emplace(C,e,s,a,h,m,y,v,S,k)}emplace(e,s,a,h,m,y,v,S,k,C){const z=10*e,D=5*e;return this.int16[z+0]=s,this.int16[z+1]=a,this.int16[z+2]=h,this.int16[z+3]=m,this.int16[z+4]=y,this.int16[z+5]=v,this.uint32[D+3]=S,this.uint16[z+8]=k,this.uint16[z+9]=C,e}}t.prototype.bytesPerElement=20,Ze("StructArrayLayout6i1ul2ui20",t);class o extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,a,h,m,y){const v=this.length;return this.resize(v+1),this.emplace(v,e,s,a,h,m,y)}emplace(e,s,a,h,m,y,v){const S=6*e;return this.int16[S+0]=s,this.int16[S+1]=a,this.int16[S+2]=h,this.int16[S+3]=m,this.int16[S+4]=y,this.int16[S+5]=v,e}}o.prototype.bytesPerElement=12,Ze("StructArrayLayout2i2i2i12",o);class c extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,a,h,m){const y=this.length;return this.resize(y+1),this.emplace(y,e,s,a,h,m)}emplace(e,s,a,h,m,y){const v=4*e,S=8*e;return this.float32[v+0]=s,this.float32[v+1]=a,this.float32[v+2]=h,this.int16[S+6]=m,this.int16[S+7]=y,e}}c.prototype.bytesPerElement=16,Ze("StructArrayLayout2f1f2i16",c);class d extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,s,a,h)}emplace(e,s,a,h,m){const y=12*e,v=3*e;return this.uint8[y+0]=s,this.uint8[y+1]=a,this.float32[v+1]=h,this.float32[v+2]=m,e}}d.prototype.bytesPerElement=12,Ze("StructArrayLayout2ub2f12",d);class g extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,s,a)}emplace(e,s,a,h){const m=3*e;return this.uint16[m+0]=s,this.uint16[m+1]=a,this.uint16[m+2]=h,e}}g.prototype.bytesPerElement=6,Ze("StructArrayLayout3ui6",g);class x extends oi{_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(e,s,a,h,m,y,v,S,k,C,z,D,B,O,j,W,Y){const ue=this.length;return this.resize(ue+1),this.emplace(ue,e,s,a,h,m,y,v,S,k,C,z,D,B,O,j,W,Y)}emplace(e,s,a,h,m,y,v,S,k,C,z,D,B,O,j,W,Y,ue){const ee=24*e,he=12*e,fe=48*e;return this.int16[ee+0]=s,this.int16[ee+1]=a,this.uint16[ee+2]=h,this.uint16[ee+3]=m,this.uint32[he+2]=y,this.uint32[he+3]=v,this.uint32[he+4]=S,this.uint16[ee+10]=k,this.uint16[ee+11]=C,this.uint16[ee+12]=z,this.float32[he+7]=D,this.float32[he+8]=B,this.uint8[fe+36]=O,this.uint8[fe+37]=j,this.uint8[fe+38]=W,this.uint32[he+10]=Y,this.int16[ee+22]=ue,e}}x.prototype.bytesPerElement=48,Ze("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",x);class b extends oi{_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(e,s,a,h,m,y,v,S,k,C,z,D,B,O,j,W,Y,ue,ee,he,fe,we,je,Ke,Ve,Be,Me,qe){const Le=this.length;return this.resize(Le+1),this.emplace(Le,e,s,a,h,m,y,v,S,k,C,z,D,B,O,j,W,Y,ue,ee,he,fe,we,je,Ke,Ve,Be,Me,qe)}emplace(e,s,a,h,m,y,v,S,k,C,z,D,B,O,j,W,Y,ue,ee,he,fe,we,je,Ke,Ve,Be,Me,qe,Le){const Ce=32*e,nt=16*e;return this.int16[Ce+0]=s,this.int16[Ce+1]=a,this.int16[Ce+2]=h,this.int16[Ce+3]=m,this.int16[Ce+4]=y,this.int16[Ce+5]=v,this.int16[Ce+6]=S,this.int16[Ce+7]=k,this.uint16[Ce+8]=C,this.uint16[Ce+9]=z,this.uint16[Ce+10]=D,this.uint16[Ce+11]=B,this.uint16[Ce+12]=O,this.uint16[Ce+13]=j,this.uint16[Ce+14]=W,this.uint16[Ce+15]=Y,this.uint16[Ce+16]=ue,this.uint16[Ce+17]=ee,this.uint16[Ce+18]=he,this.uint16[Ce+19]=fe,this.uint16[Ce+20]=we,this.uint16[Ce+21]=je,this.uint16[Ce+22]=Ke,this.uint32[nt+12]=Ve,this.float32[nt+13]=Be,this.float32[nt+14]=Me,this.uint16[Ce+30]=qe,this.uint16[Ce+31]=Le,e}}b.prototype.bytesPerElement=64,Ze("StructArrayLayout8i15ui1ul2f2ui64",b);class T extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.float32[1*e+0]=s,e}}T.prototype.bytesPerElement=4,Ze("StructArrayLayout1f4",T);class E extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,s,a)}emplace(e,s,a,h){const m=3*e;return this.uint16[6*e+0]=s,this.float32[m+1]=a,this.float32[m+2]=h,e}}E.prototype.bytesPerElement=12,Ze("StructArrayLayout1ui2f12",E);class P extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,a){const h=this.length;return this.resize(h+1),this.emplace(h,e,s,a)}emplace(e,s,a,h){const m=4*e;return this.uint32[2*e+0]=s,this.uint16[m+2]=a,this.uint16[m+3]=h,e}}P.prototype.bytesPerElement=8,Ze("StructArrayLayout1ul2ui8",P);class M extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,s)}emplace(e,s,a){const h=2*e;return this.uint16[h+0]=s,this.uint16[h+1]=a,e}}M.prototype.bytesPerElement=4,Ze("StructArrayLayout2ui4",M);class F extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.uint16[1*e+0]=s,e}}F.prototype.bytesPerElement=2,Ze("StructArrayLayout1ui2",F);class Z extends oi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,a,h){const m=this.length;return this.resize(m+1),this.emplace(m,e,s,a,h)}emplace(e,s,a,h,m){const y=4*e;return this.float32[y+0]=s,this.float32[y+1]=a,this.float32[y+2]=h,this.float32[y+3]=m,e}}Z.prototype.bytesPerElement=16,Ze("StructArrayLayout4f16",Z);class $ extends Ds{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 te(this.anchorPointX,this.anchorPointY)}}$.prototype.size=20;class G extends t{get(e){return new $(this,e)}}Ze("CollisionBoxArray",G);class U extends Ds{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}U.prototype.size=48;class re extends x{get(e){return new U(this,e)}}Ze("PlacedSymbolArray",re);class pe extends Ds{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(e){this._structArray.uint32[this._pos4+12]=e}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]}}pe.prototype.size=64;class K extends b{get(e){return new pe(this,e)}}Ze("SymbolInstanceArray",K);class oe extends T{getoffsetX(e){return this.float32[1*e+0]}}Ze("GlyphOffsetArray",oe);class me extends aa{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ze("SymbolLineVertexArray",me);class ge extends Ds{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]}}ge.prototype.size=12;class xe extends E{get(e){return new ge(this,e)}}Ze("TextAnchorOffsetArray",xe);class Ee extends Ds{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]}}Ee.prototype.size=8;class Te extends P{get(e){return new Ee(this,e)}}Ze("FeatureIndexArray",Te);class Pe extends oa{}class Xe extends oa{}class vt extends oa{}class Fe extends Mu{}class ot extends zu{}class Ye extends yo{}class Ot extends Au{}class _t extends Du{}class mt extends At{}class xt extends f{}class ci extends o{}class qt extends d{}class ji extends g{}class Ci extends M{}const yi=ti([{name:"a_pos",components:2,type:"Int16"}],4),{members:Rn}=yi;class Wt{constructor(e=[]){this.segments=e}prepareSegment(e,s,a,h){let m=this.segments[this.segments.length-1];return e>Wt.MAX_VERTEX_ARRAY_LENGTH&&mi(`Max vertices per segment is ${Wt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!m||m.vertexLength+e>Wt.MAX_VERTEX_ARRAY_LENGTH||m.sortKey!==h)&&(m={vertexOffset:s.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},h!==void 0&&(m.sortKey=h),this.segments.push(m)),m}get(){return this.segments}destroy(){for(const e of this.segments)for(const s in e.vaos)e.vaos[s].destroy()}static simpleSegment(e,s,a,h){return new Wt([{vertexOffset:e,primitiveOffset:s,vertexLength:a,primitiveLength:h,vaos:{},sortKey:0}])}}function Sr(n,e){return 256*(n=He(Math.floor(n),0,255))+He(Math.floor(e),0,255)}Wt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ze("SegmentVector",Wt);const Tr=ti([{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 ms={exports:{}},Rs={exports:{}};Rs.exports=function(n,e){var s,a,h,m,y,v,S,k;for(a=n.length-(s=3&n.length),h=e,y=3432918353,v=461845907,k=0;k>>16)*y&65535)<<16)&4294967295)<<15|S>>>17))*v+(((S>>>16)*v&65535)<<16)&4294967295)<<13|h>>>19))+((5*(h>>>16)&65535)<<16)&4294967295))+((58964+(m>>>16)&65535)<<16);switch(S=0,s){case 3:S^=(255&n.charCodeAt(k+2))<<16;case 2:S^=(255&n.charCodeAt(k+1))<<8;case 1:h^=S=(65535&(S=(S=(65535&(S^=255&n.charCodeAt(k)))*y+(((S>>>16)*y&65535)<<16)&4294967295)<<15|S>>>17))*v+(((S>>>16)*v&65535)<<16)&4294967295}return h^=n.length,h=2246822507*(65535&(h^=h>>>16))+((2246822507*(h>>>16)&65535)<<16)&4294967295,h=3266489909*(65535&(h^=h>>>13))+((3266489909*(h>>>16)&65535)<<16)&4294967295,(h^=h>>>16)>>>0};var _o=Rs.exports,Ki={exports:{}};Ki.exports=function(n,e){for(var s,a=n.length,h=e^a,m=0;a>=4;)s=1540483477*(65535&(s=255&n.charCodeAt(m)|(255&n.charCodeAt(++m))<<8|(255&n.charCodeAt(++m))<<16|(255&n.charCodeAt(++m))<<24))+((1540483477*(s>>>16)&65535)<<16),h=1540483477*(65535&h)+((1540483477*(h>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),a-=4,++m;switch(a){case 3:h^=(255&n.charCodeAt(m+2))<<16;case 2:h^=(255&n.charCodeAt(m+1))<<8;case 1:h=1540483477*(65535&(h^=255&n.charCodeAt(m)))+((1540483477*(h>>>16)&65535)<<16)}return h=1540483477*(65535&(h^=h>>>13))+((1540483477*(h>>>16)&65535)<<16),(h^=h>>>15)>>>0};var $i=_o,ln=Ki.exports;ms.exports=$i,ms.exports.murmur3=$i,ms.exports.murmur2=ln;var Fs=L(ms.exports);class hi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,s,a,h){this.ids.push(Pi(e)),this.positions.push(s,a,h)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const s=Pi(e);let a=0,h=this.ids.length-1;for(;a>1;this.ids[y]>=s?h=y:a=y+1}const m=[];for(;this.ids[a]===s;)m.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return m}static serialize(e,s){const a=new Float64Array(e.ids),h=new Uint32Array(e.positions);return vn(a,h,0,a.length-1),s&&s.push(a.buffer,h.buffer),{ids:a,positions:h}}static deserialize(e){const s=new hi;return s.ids=e.ids,s.positions=e.positions,s.indexed=!0,s}}function Pi(n){const e=+n;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Fs(String(n))}function vn(n,e,s,a){for(;s>1];let m=s-1,y=a+1;for(;;){do m++;while(n[m]h);if(m>=y)break;di(n,m,y),di(e,3*m,3*y),di(e,3*m+1,3*y+1),di(e,3*m+2,3*y+2)}y-s`u_${h}`),this.type=a}setUniform(e,s,a){e.set(a.constantOr(this.value))}getBinding(e,s,a){return this.type==="color"?new Ah(e,s):new nl(e,s)}}class Os{constructor(e,s){this.uniformNames=s.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,s){this.pixelRatioFrom=s.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=s.tlbr,this.patternTo=e.tlbr}setUniform(e,s,a,h){const m=h==="u_pattern_to"?this.patternTo:h==="u_pattern_from"?this.patternFrom:h==="u_pixel_ratio_to"?this.pixelRatioTo:h==="u_pixel_ratio_from"?this.pixelRatioFrom:null;m&&e.set(m)}getBinding(e,s,a){return a.substr(0,9)==="u_pattern"?new zh(e,s):new nl(e,s)}}class Er{constructor(e,s,a,h){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=s.map(m=>({name:`a_${m}`,type:"Float32",components:a==="color"?2:1,offset:0})),this.paintVertexArray=new h}populatePaintArray(e,s,a,h,m){const y=this.paintVertexArray.length,v=this.expression.evaluate(new Ht(0),s,{},h,[],m);this.paintVertexArray.resize(e),this._setPaintValue(y,e,v)}updatePaintArray(e,s,a,h){const m=this.expression.evaluate({zoom:0},a,h);this._setPaintValue(e,s,m)}_setPaintValue(e,s,a){if(this.type==="color"){const h=Lu(a);for(let m=e;m`u_${v}_t`),this.type=a,this.useIntegerZoom=h,this.zoom=m,this.maxValue=0,this.paintVertexAttributes=s.map(v=>({name:`a_${v}`,type:"Float32",components:a==="color"?4:2,offset:0})),this.paintVertexArray=new y}populatePaintArray(e,s,a,h,m){const y=this.expression.evaluate(new Ht(this.zoom),s,{},h,[],m),v=this.expression.evaluate(new Ht(this.zoom+1),s,{},h,[],m),S=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(S,e,y,v)}updatePaintArray(e,s,a,h){const m=this.expression.evaluate({zoom:this.zoom},a,h),y=this.expression.evaluate({zoom:this.zoom+1},a,h);this._setPaintValue(e,s,m,y)}_setPaintValue(e,s,a,h){if(this.type==="color"){const m=Lu(a),y=Lu(h);for(let v=e;v`#define HAS_UNIFORM_${h}`))}return e}getBinderAttributes(){const e=[];for(const s in this.binders){const a=this.binders[s];if(a instanceof Er||a instanceof Qn)for(let h=0;h!0){this.programConfigurations={};for(const h of e)this.programConfigurations[h.id]=new Ru(h,s,a);this.needsUpload=!1,this._featureMap=new hi,this._bufferOffset=0}populatePaintArrays(e,s,a,h,m,y){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(e,s,h,m,y);s.id!==void 0&&this._featureMap.add(s.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,s,a,h){for(const m of a)this.needsUpload=this.programConfigurations[m.id].updatePaintArrays(e,this._featureMap,s,m,h)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const s in this.programConfigurations)this.programConfigurations[s].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function k1(n,e){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"]}[n]||[n.replace(`${e}-`,"").replace(/-/g,"_")]}function Hg(n,e,s){const a={color:{source:yo,composite:Z},number:{source:T,composite:yo}},h=function(m){return{"line-pattern":{source:Ot,composite:Ot},"fill-pattern":{source:Ot,composite:Ot},"fill-extrusion-pattern":{source:Ot,composite:Ot}}[m]}(n);return h&&h[s]||a[e][s]}Ze("ConstantBinder",kr),Ze("CrossFadedConstantBinder",Os),Ze("SourceExpressionBinder",Er),Ze("CrossFadedCompositeBinder",Ir),Ze("CompositeExpressionBinder",Qn),Ze("ProgramConfiguration",Ru,{omit:["_buffers"]}),Ze("ProgramConfigurationSet",qr);const Si=8192,Fp=Math.pow(2,14)-1,Wg=-Fp-1;function la(n){const e=Si/n.extent,s=n.loadGeometry();for(let a=0;ay.x+1||Sy.y+1)&&mi("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return s}function ua(n,e){return{type:n.type,id:n.id,properties:n.properties,geometry:e?la(n):[]}}function Dh(n,e,s,a,h){n.emplaceBack(2*e+(a+1)/2,2*s+(h+1)/2)}class Bp{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Xe,this.indexArray=new ji,this.segments=new Wt,this.programConfigurations=new qr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,a){const h=this.layers[0],m=[];let y=null,v=!1;h.type==="circle"&&(y=h.layout.get("circle-sort-key"),v=!y.isConstant());for(const{feature:S,id:k,index:C,sourceLayerIndex:z}of e){const D=this.layers[0]._featureFilter.needGeometry,B=ua(S,D);if(!this.layers[0]._featureFilter.filter(new Ht(this.zoom),B,a))continue;const O=v?y.evaluate(B,{},a):void 0,j={id:k,properties:S.properties,type:S.type,sourceLayerIndex:z,index:C,geometry:D?B.geometry:la(S),patterns:{},sortKey:O};m.push(j)}v&&m.sort((S,k)=>S.sortKey-k.sortKey);for(const S of m){const{geometry:k,index:C,sourceLayerIndex:z}=S,D=e[C].feature;this.addFeature(S,k,C,a),s.featureIndex.insert(D,k,C,z,this.index)}}update(e,s,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Rn),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,s,a,h){for(const m of s)for(const y of m){const v=y.x,S=y.y;if(v<0||v>=Si||S<0||S>=Si)continue;const k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=k.vertexLength;Dh(this.layoutVertexArray,v,S,-1,-1),Dh(this.layoutVertexArray,v,S,1,-1),Dh(this.layoutVertexArray,v,S,1,1),Dh(this.layoutVertexArray,v,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),k.vertexLength+=4,k.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},h)}}function Xg(n,e){for(let s=0;s1){if(Op(n,e))return!0;for(let a=0;a1?s:s.sub(e)._mult(h)._add(e))}function Qg(n,e){let s,a,h,m=!1;for(let y=0;ye.y!=h.y>e.y&&e.x<(h.x-a.x)*(e.y-a.y)/(h.y-a.y)+a.x&&(m=!m)}return m}function rl(n,e){let s=!1;for(let a=0,h=n.length-1;ae.y!=y.y>e.y&&e.x<(y.x-m.x)*(e.y-m.y)/(y.y-m.y)+m.x&&(s=!s)}return s}function P1(n,e,s){const a=s[0],h=s[2];if(n.xh.x&&e.x>h.x||n.yh.y&&e.y>h.y)return!1;const m=ui(n,e,s[0]);return m!==ui(n,e,s[1])||m!==ui(n,e,s[2])||m!==ui(n,e,s[3])}function Fu(n,e,s){const a=e.paint.get(n).value;return a.kind==="constant"?a.value:s.programConfigurations.get(e.id).getMaxValue(n)}function Lh(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function Rh(n,e,s,a,h){if(!e[0]&&!e[1])return n;const m=te.convert(e)._mult(h);s==="viewport"&&m._rotate(-a);const y=[];for(let v=0;viy(W,j))}(k,S),B=z?C*v:C;for(const O of h)for(const j of O){const W=z?j:iy(j,S);let Y=B;const ue=Fh([],[j.x,j.y,0,1],S);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Y*=ue[3]/y.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Y*=y.cameraToCenterDistance/ue[3]),E1(D,W,Y))return!0}return!1}}function iy(n,e){const s=Fh([],[n.x,n.y,0,1],e);return new te(s[0]/s[3],s[1]/s[3])}class ny extends Bp{}let ry;Ze("HeatmapBucket",ny,{omit:["layers"]});var D1={get paint(){return ry=ry||new gi({"heatmap-radius":new st(ye.paint_heatmap["heatmap-radius"]),"heatmap-weight":new st(ye.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new et(ye.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Cu(ye.paint_heatmap["heatmap-color"]),"heatmap-opacity":new et(ye.paint_heatmap["heatmap-opacity"])})}};function Up(n,{width:e,height:s},a,h){if(h){if(h instanceof Uint8ClampedArray)h=new Uint8Array(h.buffer);else if(h.length!==e*s*a)throw new RangeError(`mismatched image size. expected: ${h.length} but got: ${e*s*a}`)}else h=new Uint8Array(e*s*a);return n.width=e,n.height=s,n.data=h,n}function sy(n,{width:e,height:s},a){if(e===n.width&&s===n.height)return;const h=Up({},{width:e,height:s},a);jp(n,h,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,e),height:Math.min(n.height,s)},a),n.width=e,n.height=s,n.data=h.data}function jp(n,e,s,a,h,m){if(h.width===0||h.height===0)return e;if(h.width>n.width||h.height>n.height||s.x>n.width-h.width||s.y>n.height-h.height)throw new RangeError("out of range source coordinates for image copy");if(h.width>e.width||h.height>e.height||a.x>e.width-h.width||a.y>e.height-h.height)throw new RangeError("out of range destination coordinates for image copy");const y=n.data,v=e.data;if(y===v)throw new Error("srcData equals dstData, so image is already copied");for(let S=0;S{e[n.evaluationKey]=S;const k=n.expression.evaluate(e);h.data[y+v+0]=Math.floor(255*k.r/k.a),h.data[y+v+1]=Math.floor(255*k.g/k.a),h.data[y+v+2]=Math.floor(255*k.b/k.a),h.data[y+v+3]=Math.floor(255*k.a)};if(n.clips)for(let y=0,v=0;y80*s){a=m=n[0],h=y=n[1];for(var O=s;Om&&(m=v),S>y&&(y=S);k=(k=Math.max(m-a,y-h))!==0?32767/k:0}return Nu(D,B,s,a,h,k,0),B}function ly(n,e,s,a,h){var m,y;if(h===Gp(n,e,s,a)>0)for(m=e;m=e;m-=a)y=hy(m,n[m],n[m+1],y);return y&&Oh(y,y.next)&&(Uu(y),y=y.next),y}function ca(n,e){if(!n)return n;e||(e=n);var s,a=n;do if(s=!1,a.steiner||!Oh(a,a.next)&&_i(a.prev,a,a.next)!==0)a=a.next;else{if(Uu(a),(a=e=a.prev)===a.next)break;s=!0}while(s||a!==e);return e}function Nu(n,e,s,a,h,m,y){if(n){!y&&m&&function(C,z,D,B){var O=C;do O.z===0&&(O.z=Zp(O.x,O.y,z,D,B)),O.prevZ=O.prev,O.nextZ=O.next,O=O.next;while(O!==C);O.prevZ.nextZ=null,O.prevZ=null,function(j){var W,Y,ue,ee,he,fe,we,je,Ke=1;do{for(Y=j,j=null,he=null,fe=0;Y;){for(fe++,ue=Y,we=0,W=0;W0||je>0&&ue;)we!==0&&(je===0||!ue||Y.z<=ue.z)?(ee=Y,Y=Y.nextZ,we--):(ee=ue,ue=ue.nextZ,je--),he?he.nextZ=ee:j=ee,ee.prevZ=he,he=ee;Y=ue}he.nextZ=null,Ke*=2}while(fe>1)}(O)}(n,a,h,m);for(var v,S,k=n;n.prev!==n.next;)if(v=n.prev,S=n.next,m?V1(n,a,h,m):N1(n))e.push(v.i/s|0),e.push(n.i/s|0),e.push(S.i/s|0),Uu(n),n=S.next,k=S.next;else if((n=S)===k){y?y===1?Nu(n=U1(ca(n),e,s),e,s,a,h,m,2):y===2&&j1(n,e,s,a,h,m):Nu(ca(n),e,s,a,h,m,1);break}}}function N1(n){var e=n.prev,s=n,a=n.next;if(_i(e,s,a)>=0)return!1;for(var h=e.x,m=s.x,y=a.x,v=e.y,S=s.y,k=a.y,C=hm?h>y?h:y:m>y?m:y,B=v>S?v>k?v:k:S>k?S:k,O=a.next;O!==e;){if(O.x>=C&&O.x<=D&&O.y>=z&&O.y<=B&&ol(h,v,m,S,y,k,O.x,O.y)&&_i(O.prev,O,O.next)>=0)return!1;O=O.next}return!0}function V1(n,e,s,a){var h=n.prev,m=n,y=n.next;if(_i(h,m,y)>=0)return!1;for(var v=h.x,S=m.x,k=y.x,C=h.y,z=m.y,D=y.y,B=vS?v>k?v:k:S>k?S:k,W=C>z?C>D?C:D:z>D?z:D,Y=Zp(B,O,e,s,a),ue=Zp(j,W,e,s,a),ee=n.prevZ,he=n.nextZ;ee&&ee.z>=Y&&he&&he.z<=ue;){if(ee.x>=B&&ee.x<=j&&ee.y>=O&&ee.y<=W&&ee!==h&&ee!==y&&ol(v,C,S,z,k,D,ee.x,ee.y)&&_i(ee.prev,ee,ee.next)>=0||(ee=ee.prevZ,he.x>=B&&he.x<=j&&he.y>=O&&he.y<=W&&he!==h&&he!==y&&ol(v,C,S,z,k,D,he.x,he.y)&&_i(he.prev,he,he.next)>=0))return!1;he=he.nextZ}for(;ee&&ee.z>=Y;){if(ee.x>=B&&ee.x<=j&&ee.y>=O&&ee.y<=W&&ee!==h&&ee!==y&&ol(v,C,S,z,k,D,ee.x,ee.y)&&_i(ee.prev,ee,ee.next)>=0)return!1;ee=ee.prevZ}for(;he&&he.z<=ue;){if(he.x>=B&&he.x<=j&&he.y>=O&&he.y<=W&&he!==h&&he!==y&&ol(v,C,S,z,k,D,he.x,he.y)&&_i(he.prev,he,he.next)>=0)return!1;he=he.nextZ}return!0}function U1(n,e,s){var a=n;do{var h=a.prev,m=a.next.next;!Oh(h,m)&&uy(h,a,a.next,m)&&Vu(h,m)&&Vu(m,h)&&(e.push(h.i/s|0),e.push(a.i/s|0),e.push(m.i/s|0),Uu(a),Uu(a.next),a=n=m),a=a.next}while(a!==n);return ca(a)}function j1(n,e,s,a,h,m){var y=n;do{for(var v=y.next.next;v!==y.prev;){if(y.i!==v.i&&H1(y,v)){var S=cy(y,v);return y=ca(y,y.next),S=ca(S,S.next),Nu(y,e,s,a,h,m,0),void Nu(S,e,s,a,h,m,0)}v=v.next}y=y.next}while(y!==n)}function $1(n,e){return n.x-e.x}function Z1(n,e){var s=function(h,m){var y,v=m,S=h.x,k=h.y,C=-1/0;do{if(k<=v.y&&k>=v.next.y&&v.next.y!==v.y){var z=v.x+(k-v.y)*(v.next.x-v.x)/(v.next.y-v.y);if(z<=S&&z>C&&(C=z,y=v.x=v.x&&v.x>=O&&S!==v.x&&ol(ky.x||v.x===y.x&&q1(y,v)))&&(y=v,W=D)),v=v.next;while(v!==B);return y}(n,e);if(!s)return e;var a=cy(s,n);return ca(a,a.next),ca(s,s.next)}function q1(n,e){return _i(n.prev,n,e.prev)<0&&_i(e.next,n,n.next)<0}function Zp(n,e,s,a,h){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-s)*h|0)|n<<8))|n<<4))|n<<2))|n<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*h|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function G1(n){var e=n,s=n;do(e.x=(n-y)*(m-v)&&(n-y)*(a-v)>=(s-y)*(e-v)&&(s-y)*(m-v)>=(h-y)*(a-v)}function H1(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!function(s,a){var h=s;do{if(h.i!==s.i&&h.next.i!==s.i&&h.i!==a.i&&h.next.i!==a.i&&uy(h,h.next,s,a))return!0;h=h.next}while(h!==s);return!1}(n,e)&&(Vu(n,e)&&Vu(e,n)&&function(s,a){var h=s,m=!1,y=(s.x+a.x)/2,v=(s.y+a.y)/2;do h.y>v!=h.next.y>v&&h.next.y!==h.y&&y<(h.next.x-h.x)*(v-h.y)/(h.next.y-h.y)+h.x&&(m=!m),h=h.next;while(h!==s);return m}(n,e)&&(_i(n.prev,n,e.prev)||_i(n,e.prev,e))||Oh(n,e)&&_i(n.prev,n,n.next)>0&&_i(e.prev,e,e.next)>0)}function _i(n,e,s){return(e.y-n.y)*(s.x-e.x)-(e.x-n.x)*(s.y-e.y)}function Oh(n,e){return n.x===e.x&&n.y===e.y}function uy(n,e,s,a){var h=Vh(_i(n,e,s)),m=Vh(_i(n,e,a)),y=Vh(_i(s,a,n)),v=Vh(_i(s,a,e));return h!==m&&y!==v||!(h!==0||!Nh(n,s,e))||!(m!==0||!Nh(n,a,e))||!(y!==0||!Nh(s,n,a))||!(v!==0||!Nh(s,e,a))}function Nh(n,e,s){return e.x<=Math.max(n.x,s.x)&&e.x>=Math.min(n.x,s.x)&&e.y<=Math.max(n.y,s.y)&&e.y>=Math.min(n.y,s.y)}function Vh(n){return n>0?1:n<0?-1:0}function Vu(n,e){return _i(n.prev,n,n.next)<0?_i(n,e,n.next)>=0&&_i(n,n.prev,e)>=0:_i(n,e,n.prev)<0||_i(n,n.next,e)<0}function cy(n,e){var s=new qp(n.i,n.x,n.y),a=new qp(e.i,e.x,e.y),h=n.next,m=e.prev;return n.next=e,e.prev=n,s.next=h,h.prev=s,a.next=s,s.prev=a,m.next=a,a.prev=m,a}function hy(n,e,s,a){var h=new qp(n,e,s);return a?(h.next=a.next,h.prev=a,a.next.prev=h,a.next=h):(h.prev=h,h.next=h),h}function Uu(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function qp(n,e,s){this.i=n,this.x=e,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Gp(n,e,s,a){for(var h=0,m=e,y=s-a;m0&&s.holes.push(a+=n[h-1].length)}return s};var dy=L($p.exports);function W1(n,e,s,a,h){py(n,e,s||0,a||n.length-1,h||X1)}function py(n,e,s,a,h){for(;a>s;){if(a-s>600){var m=a-s+1,y=e-s+1,v=Math.log(m),S=.5*Math.exp(2*v/3),k=.5*Math.sqrt(v*S*(m-S)/m)*(y-m/2<0?-1:1);py(n,e,Math.max(s,Math.floor(e-y*S/m+k)),Math.min(a,Math.floor(e+(m-y)*S/m+k)),h)}var C=n[e],z=s,D=a;for(ju(n,s,e),h(n[a],C)>0&&ju(n,s,a);z0;)D--}h(n[s],C)===0?ju(n,s,D):ju(n,++D,a),D<=e&&(s=D+1),e<=D&&(a=D-1)}}function ju(n,e,s){var a=n[e];n[e]=n[s],n[s]=a}function X1(n,e){return ne?1:0}function Hp(n,e){const s=n.length;if(s<=1)return[n];const a=[];let h,m;for(let y=0;y1)for(let y=0;ys.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new vt,this.indexArray=new ji,this.indexArray2=new Ci,this.programConfigurations=new qr(e.layers,e.zoom),this.segments=new Wt,this.segments2=new Wt,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,a){this.hasPattern=Wp("fill",this.layers,s);const h=this.layers[0].layout.get("fill-sort-key"),m=!h.isConstant(),y=[];for(const{feature:v,id:S,index:k,sourceLayerIndex:C}of e){const z=this.layers[0]._featureFilter.needGeometry,D=ua(v,z);if(!this.layers[0]._featureFilter.filter(new Ht(this.zoom),D,a))continue;const B=m?h.evaluate(D,{},a,s.availableImages):void 0,O={id:S,properties:v.properties,type:v.type,sourceLayerIndex:C,index:k,geometry:z?D.geometry:la(v),patterns:{},sortKey:B};y.push(O)}m&&y.sort((v,S)=>v.sortKey-S.sortKey);for(const v of y){const{geometry:S,index:k,sourceLayerIndex:C}=v;if(this.hasPattern){const z=Xp("fill",this.layers,v,this.zoom,s);this.patternFeatures.push(z)}else this.addFeature(v,S,k,a,{});s.featureIndex.insert(e[k].feature,S,k,C,this.index)}}update(e,s,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,a)}addFeatures(e,s,a){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,s,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,O1),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,s,a,h,m){for(const y of Hp(s,500)){let v=0;for(const B of y)v+=B.length;const S=this.segments.prepareSegment(v,this.layoutVertexArray,this.indexArray),k=S.vertexLength,C=[],z=[];for(const B of y){if(B.length===0)continue;B!==y[0]&&z.push(C.length/2);const O=this.segments2.prepareSegment(B.length,this.layoutVertexArray,this.indexArray2),j=O.vertexLength;this.layoutVertexArray.emplaceBack(B[0].x,B[0].y),this.indexArray2.emplaceBack(j+B.length-1,j),C.push(B[0].x),C.push(B[0].y);for(let W=1;W>3}if(h--,a===1||a===2)m+=n.readSVarint(),y+=n.readSVarint(),a===1&&(e&&v.push(e),e=[]),e.push(new iw(m,y));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&v.push(e),v},al.prototype.bbox=function(){var n=this._pbf;n.pos=this._geometry;for(var e=n.readVarint()+n.pos,s=1,a=0,h=0,m=0,y=1/0,v=-1/0,S=1/0,k=-1/0;n.pos>3}if(a--,s===1||s===2)(h+=n.readSVarint())v&&(v=h),(m+=n.readSVarint())k&&(k=m);else if(s!==7)throw new Error("unknown command "+s)}return[y,S,v,k]},al.prototype.toGeoJSON=function(n,e,s){var a,h,m=this.extent*Math.pow(2,s),y=this.extent*n,v=this.extent*e,S=this.loadGeometry(),k=al.types[this.type];function C(B){for(var O=0;O>3;h=y===1?a.readString():y===2?a.readFloat():y===3?a.readDouble():y===4?a.readVarint64():y===5?a.readVarint():y===6?a.readSVarint():y===7?a.readBoolean():null}return h}(s))}_y.prototype.feature=function(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];var e=this._pbf.readVarint()+this._pbf.pos;return new sw(this._pbf,e,this.extent,this._keys,this._values)};var aw=yy;function lw(n,e,s){if(n===3){var a=new aw(s,s.readVarint()+s.pos);a.length&&(e[a.name]=a)}}vo.VectorTile=function(n,e){this.layers=n.readFields(lw,{},e)},vo.VectorTileFeature=gy,vo.VectorTileLayer=yy;const uw=vo.VectorTileFeature.types,Yp=Math.pow(2,13);function $u(n,e,s,a,h,m,y,v){n.emplaceBack(e,s,2*Math.floor(a*Yp)+y,h*Yp*2,m*Yp*2,Math.round(v))}class Qp{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Fe,this.centroidVertexArray=new Pe,this.indexArray=new ji,this.programConfigurations=new qr(e.layers,e.zoom),this.segments=new Wt,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,a){this.features=[],this.hasPattern=Wp("fill-extrusion",this.layers,s);for(const{feature:h,id:m,index:y,sourceLayerIndex:v}of e){const S=this.layers[0]._featureFilter.needGeometry,k=ua(h,S);if(!this.layers[0]._featureFilter.filter(new Ht(this.zoom),k,a))continue;const C={id:m,sourceLayerIndex:v,index:y,geometry:S?k.geometry:la(h),properties:h.properties,type:h.type,patterns:{}};this.hasPattern?this.features.push(Xp("fill-extrusion",this.layers,C,this.zoom,s)):this.addFeature(C,C.geometry,y,a,{}),s.featureIndex.insert(h,C.geometry,y,v,this.index,!0)}}addFeatures(e,s,a){for(const h of this.features){const{geometry:m}=h;this.addFeature(h,m,h.index,s,a)}}update(e,s,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,a)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,tw),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,ew.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,s,a,h,m){const y={x:0,y:0,vertexCount:0};for(const v of Hp(s,500)){let S=0;for(const O of v)S+=O.length;let k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const O of v){if(O.length===0||hw(O))continue;let j=0;for(let W=0;W=1){const ue=O[W-1];if(!cw(Y,ue)){k.vertexLength+4>Wt.MAX_VERTEX_ARRAY_LENGTH&&(k=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ee=Y.sub(ue)._perp()._unit(),he=ue.dist(Y);j+he>32768&&(j=0),$u(this.layoutVertexArray,Y.x,Y.y,ee.x,ee.y,0,0,j),$u(this.layoutVertexArray,Y.x,Y.y,ee.x,ee.y,0,1,j),y.x+=2*Y.x,y.y+=2*Y.y,y.vertexCount+=2,j+=he,$u(this.layoutVertexArray,ue.x,ue.y,ee.x,ee.y,0,0,j),$u(this.layoutVertexArray,ue.x,ue.y,ee.x,ee.y,0,1,j),y.x+=2*ue.x,y.y+=2*ue.y,y.vertexCount+=2;const fe=k.vertexLength;this.indexArray.emplaceBack(fe,fe+2,fe+1),this.indexArray.emplaceBack(fe+1,fe+2,fe+3),k.vertexLength+=4,k.primitiveLength+=2}}}}if(k.vertexLength+S>Wt.MAX_VERTEX_ARRAY_LENGTH&&(k=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray)),uw[e.type]!=="Polygon")continue;const C=[],z=[],D=k.vertexLength;for(const O of v)if(O.length!==0){O!==v[0]&&z.push(C.length/2);for(let j=0;jSi)||n.y===e.y&&(n.y<0||n.y>Si)}function hw(n){return n.every(e=>e.x<0)||n.every(e=>e.x>Si)||n.every(e=>e.y<0)||n.every(e=>e.y>Si)}let vy;Ze("FillExtrusionBucket",Qp,{omit:["layers","features"]});var dw={get paint(){return vy=vy||new gi({"fill-extrusion-opacity":new et(ye["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new st(ye["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new et(ye["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new et(ye["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new sa(ye["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new st(ye["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new st(ye["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new et(ye["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class pw extends Yn{constructor(e){super(e,dw)}createBucket(e){return new Qp(e)}queryRadius(){return Lh(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,s,a,h,m,y,v,S){const k=Rh(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),y.angle,v),C=this.paint.get("fill-extrusion-height").evaluate(s,a),z=this.paint.get("fill-extrusion-base").evaluate(s,a),D=function(O,j,W,Y){const ue=[];for(const ee of O){const he=[ee.x,ee.y,0,1];Fh(he,he,j),ue.push(new te(he[0]/he[3],he[1]/he[3]))}return ue}(k,S),B=function(O,j,W,Y){const ue=[],ee=[],he=Y[8]*j,fe=Y[9]*j,we=Y[10]*j,je=Y[11]*j,Ke=Y[8]*W,Ve=Y[9]*W,Be=Y[10]*W,Me=Y[11]*W;for(const qe of O){const Le=[],Ce=[];for(const nt of qe){const Qe=nt.x,yt=nt.y,Xt=Y[0]*Qe+Y[4]*yt+Y[12],Yt=Y[1]*Qe+Y[5]*yt+Y[13],zi=Y[2]*Qe+Y[6]*yt+Y[14],Jn=Y[3]*Qe+Y[7]*yt+Y[15],wn=zi+we,Ti=Jn+je,Zi=Xt+Ke,Qi=Yt+Ve,bn=zi+Be,Sn=Jn+Me,Ai=new te((Xt+he)/Ti,(Yt+fe)/Ti);Ai.z=wn/Ti,Le.push(Ai);const Di=new te(Zi/Sn,Qi/Sn);Di.z=bn/Sn,Ce.push(Di)}ue.push(Le),ee.push(Ce)}return[ue,ee]}(h,z,C,S);return function(O,j,W){let Y=1/0;Kg(W,j)&&(Y=xy(W,j[0]));for(let ue=0;ues.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(s=>{this.gradients[s.id]={}}),this.layoutVertexArray=new ot,this.layoutVertexArray2=new Ye,this.indexArray=new ji,this.programConfigurations=new qr(e.layers,e.zoom),this.segments=new Wt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,a){this.hasPattern=Wp("line",this.layers,s);const h=this.layers[0].layout.get("line-sort-key"),m=!h.isConstant(),y=[];for(const{feature:v,id:S,index:k,sourceLayerIndex:C}of e){const z=this.layers[0]._featureFilter.needGeometry,D=ua(v,z);if(!this.layers[0]._featureFilter.filter(new Ht(this.zoom),D,a))continue;const B=m?h.evaluate(D,{},a):void 0,O={id:S,properties:v.properties,type:v.type,sourceLayerIndex:C,index:k,geometry:z?D.geometry:la(v),patterns:{},sortKey:B};y.push(O)}m&&y.sort((v,S)=>v.sortKey-S.sortKey);for(const v of y){const{geometry:S,index:k,sourceLayerIndex:C}=v;if(this.hasPattern){const z=Xp("line",this.layers,v,this.zoom,s);this.patternFeatures.push(z)}else this.addFeature(v,S,k,a,{});s.featureIndex.insert(e[k].feature,S,k,C,this.index)}}update(e,s,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,a)}addFeatures(e,s,a){for(const h of this.patternFeatures)this.addFeature(h,h.geometry,h.index,s,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,yw)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,mw),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,s,a,h,m){const y=this.layers[0].layout,v=y.get("line-join").evaluate(e,{}),S=y.get("line-cap"),k=y.get("line-miter-limit"),C=y.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const z of s)this.addLine(z,e,v,S,k,C);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,m,h)}addLine(e,s,a,h,m,y){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Y=0;Y=2&&e[S-1].equals(e[S-2]);)S--;let k=0;for(;k0;if(je&&Y>k){const Me=D.dist(B);if(Me>2*C){const qe=D.sub(D.sub(B)._mult(C/Me)._round());this.updateDistance(B,qe),this.addCurrentVertex(qe,j,0,0,z),B=qe}}const Ve=B&&O;let Be=Ve?a:v?"butt":h;if(Ve&&Be==="round"&&(fem&&(Be="bevel"),Be==="bevel"&&(fe>2&&(Be="flipbevel"),fe100)ue=W.mult(-1);else{const Me=fe*j.add(W).mag()/j.sub(W).mag();ue._perp()._mult(Me*(Ke?-1:1))}this.addCurrentVertex(D,ue,0,0,z),this.addCurrentVertex(D,ue.mult(-1),0,0,z)}else if(Be==="bevel"||Be==="fakeround"){const Me=-Math.sqrt(fe*fe-1),qe=Ke?Me:0,Le=Ke?0:Me;if(B&&this.addCurrentVertex(D,j,qe,Le,z),Be==="fakeround"){const Ce=Math.round(180*we/Math.PI/20);for(let nt=1;nt2*C){const qe=D.add(O.sub(D)._mult(C/Me)._round());this.updateDistance(D,qe),this.addCurrentVertex(qe,W,0,0,z),D=qe}}}}addCurrentVertex(e,s,a,h,m,y=!1){const v=s.y*h-s.x,S=-s.y-s.x*h;this.addHalfVertex(e,s.x+s.y*a,s.y-s.x*a,y,!1,a,m),this.addHalfVertex(e,v,S,y,!0,-h,m),this.distance>wy/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,s,a,h,m,y))}addHalfVertex({x:e,y:s},a,h,m,y,v,S){const k=.5*(this.lineClips?this.scaledDistance*(wy-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(m?1:0),(s<<1)+(y?1:0),Math.round(63*a)+128,Math.round(63*h)+128,1+(v===0?0:v<0?-1:1)|(63&k)<<2,k>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const C=S.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,C),S.primitiveLength++),y?this.e2=C:this.e1=C}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,s){this.distance+=e.dist(s),this.updateScaledDistance()}}let by,Sy;Ze("LineBucket",Jp,{omit:["layers","patternFeatures"]});var Ty={get paint(){return Sy=Sy||new gi({"line-opacity":new st(ye.paint_line["line-opacity"]),"line-color":new st(ye.paint_line["line-color"]),"line-translate":new et(ye.paint_line["line-translate"]),"line-translate-anchor":new et(ye.paint_line["line-translate-anchor"]),"line-width":new st(ye.paint_line["line-width"]),"line-gap-width":new st(ye.paint_line["line-gap-width"]),"line-offset":new st(ye.paint_line["line-offset"]),"line-blur":new st(ye.paint_line["line-blur"]),"line-dasharray":new Iu(ye.paint_line["line-dasharray"]),"line-pattern":new sa(ye.paint_line["line-pattern"]),"line-gradient":new Cu(ye.paint_line["line-gradient"])})},get layout(){return by=by||new gi({"line-cap":new et(ye.layout_line["line-cap"]),"line-join":new st(ye.layout_line["line-join"]),"line-miter-limit":new et(ye.layout_line["line-miter-limit"]),"line-round-limit":new et(ye.layout_line["line-round-limit"]),"line-sort-key":new st(ye.layout_line["line-sort-key"])})}};class xw extends st{possiblyEvaluate(e,s){return s=new Ht(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(e,s)}evaluate(e,s,a,h){return s=$e({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(e,s,a,h)}}let Uh;class ww extends Yn{constructor(e){super(e,Ty),this.gradientVersion=0,Uh||(Uh=new xw(Ty.paint.properties["line-width"].specification),Uh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const s=this.gradientExpression();this.stepInterpolant=!!function(a){return a._styleExpression!==void 0}(s)&&s._styleExpression.expression instanceof hs,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,s){super.recalculate(e,s),this.paint._values["line-floorwidth"]=Uh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Jp(e)}queryRadius(e){const s=e,a=ky(Fu("line-width",this,s),Fu("line-gap-width",this,s)),h=Fu("line-offset",this,s);return a/2+Math.abs(h)+Lh(this.paint.get("line-translate"))}queryIntersectsFeature(e,s,a,h,m,y,v){const S=Rh(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),y.angle,v),k=v/2*ky(this.paint.get("line-width").evaluate(s,a),this.paint.get("line-gap-width").evaluate(s,a)),C=this.paint.get("line-offset").evaluate(s,a);return C&&(h=function(z,D){const B=[];for(let O=0;O=3){for(let W=0;W0?e+2*n:n}const bw=ti([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Sw=ti([{name:"a_projected_pos",components:3,type:"Float32"}],4);ti([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Tw=ti([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ti([{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"}]);const Ey=ti([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),kw=ti([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ew(n,e,s){return n.sections.forEach(a=>{a.text=function(h,m,y){const v=m.layout.get("text-transform").evaluate(y,{});return v==="uppercase"?h=h.toLocaleUpperCase():v==="lowercase"&&(h=h.toLocaleLowerCase()),Ln.applyArabicShaping&&(h=Ln.applyArabicShaping(h)),h}(a.text,e,s)}),n}ti([{name:"triangle",components:3,type:"Uint16"}]),ti([{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"}]),ti([{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"}]),ti([{type:"Float32",name:"offsetX"}]),ti([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ti([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const qu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Mi=24,Iy=Vt,Cy=function(n,e,s,a,h){var m,y,v=8*h-a-1,S=(1<>1,C=-7,z=s?h-1:0,D=s?-1:1,B=n[e+z];for(z+=D,m=B&(1<<-C)-1,B>>=-C,C+=v;C>0;m=256*m+n[e+z],z+=D,C-=8);for(y=m&(1<<-C)-1,m>>=-C,C+=a;C>0;y=256*y+n[e+z],z+=D,C-=8);if(m===0)m=1-k;else{if(m===S)return y?NaN:1/0*(B?-1:1);y+=Math.pow(2,a),m-=k}return(B?-1:1)*y*Math.pow(2,m-a)},Py=function(n,e,s,a,h,m){var y,v,S,k=8*m-h-1,C=(1<>1,D=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=a?0:m-1,O=a?1:-1,j=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(v=isNaN(e)?1:0,y=C):(y=Math.floor(Math.log(e)/Math.LN2),e*(S=Math.pow(2,-y))<1&&(y--,S*=2),(e+=y+z>=1?D/S:D*Math.pow(2,1-z))*S>=2&&(y++,S/=2),y+z>=C?(v=0,y=C):y+z>=1?(v=(e*S-1)*Math.pow(2,h),y+=z):(v=e*Math.pow(2,z-1)*Math.pow(2,h),y=0));h>=8;n[s+B]=255&v,B+=O,v/=256,h-=8);for(y=y<0;n[s+B]=255&y,B+=O,y/=256,k-=8);n[s+B-O]|=128*j};function Vt(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}Vt.Varint=0,Vt.Fixed64=1,Vt.Bytes=2,Vt.Fixed32=5;var ef=4294967296,My=1/ef,zy=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ns(n){return n.type===Vt.Bytes?n.readVarint()+n.pos:n.pos+1}function ll(n,e,s){return s?4294967296*e+(n>>>0):4294967296*(e>>>0)+(n>>>0)}function Ay(n,e,s){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));s.realloc(a);for(var h=s.pos-1;h>=n;h--)s.buf[h+a]=s.buf[h]}function Iw(n,e){for(var s=0;s>>8,n[s+2]=e>>>16,n[s+3]=e>>>24}function Dy(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}Vt.prototype={destroy:function(){this.buf=null},readFields:function(n,e,s){for(s=s||this.length;this.pos>3,m=this.pos;this.type=7&a,n(h,e,this),this.pos===m&&this.skip(a)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=jh(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=Dy(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=jh(this.buf,this.pos)+jh(this.buf,this.pos+4)*ef;return this.pos+=8,n},readSFixed64:function(){var n=jh(this.buf,this.pos)+Dy(this.buf,this.pos+4)*ef;return this.pos+=8,n},readFloat:function(){var n=Cy(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=Cy(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e,s,a=this.buf;return e=127&(s=a[this.pos++]),s<128?e:(e|=(127&(s=a[this.pos++]))<<7,s<128?e:(e|=(127&(s=a[this.pos++]))<<14,s<128?e:(e|=(127&(s=a[this.pos++]))<<21,s<128?e:function(h,m,y){var v,S,k=y.buf;if(v=(112&(S=k[y.pos++]))>>4,S<128||(v|=(127&(S=k[y.pos++]))<<3,S<128)||(v|=(127&(S=k[y.pos++]))<<10,S<128)||(v|=(127&(S=k[y.pos++]))<<17,S<128)||(v|=(127&(S=k[y.pos++]))<<24,S<128)||(v|=(1&(S=k[y.pos++]))<<31,S<128))return ll(h,v,m);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(s=a[this.pos]))<<28,n,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2==1?(n+1)/-2:n/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=12&&zy?function(s,a,h){return zy.decode(s.subarray(a,h))}(this.buf,e,n):function(s,a,h){for(var m="",y=a;y239?4:C>223?3:C>191?2:1;if(y+D>h)break;D===1?C<128&&(z=C):D===2?(192&(v=s[y+1]))==128&&(z=(31&C)<<6|63&v)<=127&&(z=null):D===3?(S=s[y+2],(192&(v=s[y+1]))==128&&(192&S)==128&&((z=(15&C)<<12|(63&v)<<6|63&S)<=2047||z>=55296&&z<=57343)&&(z=null)):D===4&&(S=s[y+2],k=s[y+3],(192&(v=s[y+1]))==128&&(192&S)==128&&(192&k)==128&&((z=(15&C)<<18|(63&v)<<12|(63&S)<<6|63&k)<=65535||z>=1114112)&&(z=null)),z===null?(z=65533,D=1):z>65535&&(z-=65536,m+=String.fromCharCode(z>>>10&1023|55296),z=56320|1023&z),m+=String.fromCharCode(z),y+=D}return m}(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==Vt.Bytes)return n.push(this.readVarint(e));var s=Ns(this);for(n=n||[];this.pos127;);else if(e===Vt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Vt.Fixed32)this.pos+=4;else{if(e!==Vt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e268435455||n<0?function(e,s){var a,h;if(e>=0?(a=e%4294967296|0,h=e/4294967296|0):(h=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,h=h+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");s.realloc(10),function(m,y,v){v.buf[v.pos++]=127&m|128,m>>>=7,v.buf[v.pos++]=127&m|128,m>>>=7,v.buf[v.pos++]=127&m|128,m>>>=7,v.buf[v.pos++]=127&m|128,v.buf[v.pos]=127&(m>>>=7)}(a,0,s),function(m,y){var v=(7&m)<<4;y.buf[y.pos++]|=v|((m>>>=3)?128:0),m&&(y.buf[y.pos++]=127&m|((m>>>=7)?128:0),m&&(y.buf[y.pos++]=127&m|((m>>>=7)?128:0),m&&(y.buf[y.pos++]=127&m|((m>>>=7)?128:0),m&&(y.buf[y.pos++]=127&m|((m>>>=7)?128:0),m&&(y.buf[y.pos++]=127&m)))))}(h,s)}(n,this):(this.realloc(4),this.buf[this.pos++]=127&n|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=n>>>7&127))))},writeSVarint:function(n){this.writeVarint(n<0?2*-n-1:2*n)},writeBoolean:function(n){this.writeVarint(!!n)},writeString:function(n){n=String(n),this.realloc(4*n.length),this.pos++;var e=this.pos;this.pos=function(a,h,m){for(var y,v,S=0;S55295&&y<57344){if(!v){y>56319||S+1===h.length?(a[m++]=239,a[m++]=191,a[m++]=189):v=y;continue}if(y<56320){a[m++]=239,a[m++]=191,a[m++]=189,v=y;continue}y=v-55296<<10|y-56320|65536,v=null}else v&&(a[m++]=239,a[m++]=191,a[m++]=189,v=null);y<128?a[m++]=y:(y<2048?a[m++]=y>>6|192:(y<65536?a[m++]=y>>12|224:(a[m++]=y>>18|240,a[m++]=y>>12&63|128),a[m++]=y>>6&63|128),a[m++]=63&y|128)}return m}(this.buf,n,this.pos);var s=this.pos-e;s>=128&&Ay(e,s,this),this.pos=e-1,this.writeVarint(s),this.pos+=s},writeFloat:function(n){this.realloc(4),Py(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),Py(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var s=0;s=128&&Ay(s,a,this),this.pos=s-1,this.writeVarint(a),this.pos+=a},writeMessage:function(n,e,s){this.writeTag(n,Vt.Bytes),this.writeRawMessage(e,s)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,Iw,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,Cw,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,zw,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,Pw,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,Mw,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,Aw,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,Dw,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,Lw,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,Rw,e)},writeBytesField:function(n,e){this.writeTag(n,Vt.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,Vt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,Vt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,Vt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,Vt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,Vt.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,Vt.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,Vt.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,Vt.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,Vt.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,!!e)}};var tf=L(Iy);const nf=3;function Fw(n,e,s){n===1&&s.readMessage(Bw,e)}function Bw(n,e,s){if(n===3){const{id:a,bitmap:h,width:m,height:y,left:v,top:S,advance:k}=s.readMessage(Ow,{});e.push({id:a,bitmap:new Ou({width:m+2*nf,height:y+2*nf},h),metrics:{width:m,height:y,left:v,top:S,advance:k}})}}function Ow(n,e,s){n===1?e.id=s.readVarint():n===2?e.bitmap=s.readBytes():n===3?e.width=s.readVarint():n===4?e.height=s.readVarint():n===5?e.left=s.readSVarint():n===6?e.top=s.readSVarint():n===7&&(e.advance=s.readVarint())}const Ly=nf;function Ry(n){let e=0,s=0;for(const y of n)e+=y.w*y.h,s=Math.max(s,y.w);n.sort((y,v)=>v.h-y.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),s),h:1/0}];let h=0,m=0;for(const y of n)for(let v=a.length-1;v>=0;v--){const S=a[v];if(!(y.w>S.w||y.h>S.h)){if(y.x=S.x,y.y=S.y,m=Math.max(m,y.y+y.h),h=Math.max(h,y.x+y.w),y.w===S.w&&y.h===S.h){const k=a.pop();v=0&&a>=e&&Zh[this.text.charCodeAt(a)];a--)s--;this.text=this.text.substring(e,s),this.sectionIndex=this.sectionIndex.slice(e,s)}substring(e,s){const a=new cl;return a.text=this.text.substring(e,s),a.sectionIndex=this.sectionIndex.slice(e,s),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,s)=>Math.max(e,this.sections[s].scale),0)}addTextSection(e,s){this.text+=e.text,this.sections.push(Hu.forText(e.scale,e.fontStack||s));const a=this.sections.length-1;for(let h=0;h=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function $h(n,e,s,a,h,m,y,v,S,k,C,z,D,B,O,j){const W=cl.fromFeature(n,h);let Y;z===u.ai.vertical&&W.verticalizePunctuation();const{processBidirectionalText:ue,processStyledBidirectionalText:ee}=Ln;if(ue&&W.sections.length===1){Y=[];const we=ue(W.toString(),sf(W,k,m,e,a,B,O));for(const je of we){const Ke=new cl;Ke.text=je,Ke.sections=W.sections;for(let Ve=0;Ve0&&Us>Bn&&(Bn=Us)}else{const ur=Ke[wt.fontStack],Nn=ur&&ur[Ji];if(Nn&&Nn.rect)Gr=Nn.rect,Cr=Nn.metrics;else{const Us=je[wt.fontStack],Qu=Us&&Us[Ji];if(!Qu)continue;Cr=Qu.metrics}Ri=(Di-wt.scale)*Mi}Pr?(we.verticalizable=!0,cn.push({glyph:Ji,imageName:Hr,x:Xt,y:Yt+Ri,vertical:Pr,scale:wt.scale,fontStack:wt.fontStack,sectionIndex:hn,metrics:Cr,rect:Gr}),Xt+=Vs*wt.scale+nt):(cn.push({glyph:Ji,imageName:Hr,x:Xt,y:Yt+Ri,vertical:Pr,scale:wt.scale,fontStack:wt.fontStack,sectionIndex:hn,metrics:Cr,rect:Gr}),Xt+=Cr.advance*wt.scale+nt)}cn.length!==0&&(zi=Math.max(Xt-nt,zi),Uw(cn,0,cn.length-1,wn,Bn)),Xt=0;const On=Me*Di+Bn;Tn.lineOffset=Math.max(Bn,un),Yt+=On,Jn=Math.max(On,Jn),++Ti}var Zi;const Qi=Yt-Gu,{horizontalAlign:bn,verticalAlign:Sn}=of(qe);(function(Ai,Di,un,Tn,cn,Bn,On,Li,wt){const hn=(Di-un)*cn;let Ji=0;Ji=Bn!==On?-Li*Tn-Gu:(-Tn*wt+.5)*On;for(const Ri of Ai)for(const Cr of Ri.positionedGlyphs)Cr.x+=hn,Cr.y+=Ji})(we.positionedLines,wn,bn,Sn,zi,Jn,Me,Qi,Be.length),we.top+=-Sn*Qi,we.bottom=we.top+Qi,we.left+=-bn*zi,we.right=we.left+zi}(fe,e,s,a,Y,y,v,S,z,k,D,j),!function(we){for(const je of we)if(je.positionedGlyphs.length!==0)return!1;return!0}(he)&&fe}const Zh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Nw={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function By(n,e,s,a,h,m){if(e.imageName){const y=a[e.imageName];return y?y.displaySize[0]*e.scale*Mi/m+h:0}{const y=s[e.fontStack],v=y&&y[n];return v?v.metrics.advance*e.scale+h:0}}function Oy(n,e,s,a){const h=Math.pow(n-e,2);return a?n=0;let C=0;for(let D=0;Dy.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Vp([]),this.placementViewportMatrix=Vp([]);const s=this.layers[0]._unevaluatedLayout._values;this.textSizeData=jy(this.zoom,s["text-size"]),this.iconSizeData=jy(this.zoom,s["icon-size"]);const a=this.layers[0].layout,h=a.get("symbol-sort-key"),m=a.get("symbol-z-order");this.canOverlap=af(a,"text-overlap","text-allow-overlap")!=="never"||af(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=m!=="viewport-y"&&!h.isConstant(),this.sortFeaturesByY=(m==="viewport-y"||m==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map(y=>u.ai[y])),this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.sourceID=e.sourceID}createArrays(){this.text=new uf(new qr(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new uf(new qr(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new oe,this.lineVertexArray=new me,this.symbolInstances=new K,this.textAnchorOffsets=new xe}calculateGlyphDependencies(e,s,a,h,m){for(let y=0;y0)&&(y.value.kind!=="constant"||y.value.value.length>0),C=S.value.kind!=="constant"||!!S.value.value||Object.keys(S.parameters).length>0,z=m.get("symbol-sort-key");if(this.features=[],!k&&!C)return;const D=s.iconDependencies,B=s.glyphDependencies,O=s.availableImages,j=new Ht(this.zoom);for(const{feature:W,id:Y,index:ue,sourceLayerIndex:ee}of e){const he=h._featureFilter.needGeometry,fe=ua(W,he);if(!h._featureFilter.filter(j,fe,a))continue;let we,je;if(he||(fe.geometry=la(W)),k){const Ve=h.getValueAndResolveTokens("text-field",fe,a,O),Be=Xi.factory(Ve);qw(Be)&&(this.hasRTLText=!0),(!this.hasRTLText||ku()==="unavailable"||this.hasRTLText&&Ln.isParsed())&&(we=Ew(Be,h,fe))}if(C){const Ve=h.getValueAndResolveTokens("icon-image",fe,a,O);je=Ve instanceof Ui?Ve:Ui.fromString(Ve)}if(!we&&!je)continue;const Ke=this.sortFeaturesByKey?z.evaluate(fe,{},a):void 0;if(this.features.push({id:Y,text:we,icon:je,index:ue,sourceLayerIndex:ee,geometry:fe.geometry,properties:W.properties,type:$w[W.type],sortKey:Ke}),je&&(D[je.name]=!0),we){const Ve=y.evaluate(fe,{},a).join(","),Be=m.get("text-rotation-alignment")!=="viewport"&&m.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(u.ai.vertical)>=0;for(const Me of we.sections)if(Me.image)D[Me.image.name]=!0;else{const qe=yu(we.toString()),Le=Me.fontStack||Ve,Ce=B[Le]=B[Le]||{};this.calculateGlyphDependencies(Me.text,Ce,Be,this.allowVerticalPlacement,qe)}}}m.get("symbol-placement")==="line"&&(this.features=function(W){const Y={},ue={},ee=[];let he=0;function fe(Ve){ee.push(W[Ve]),he++}function we(Ve,Be,Me){const qe=ue[Ve];return delete ue[Ve],ue[Be]=qe,ee[qe].geometry[0].pop(),ee[qe].geometry[0]=ee[qe].geometry[0].concat(Me[0]),qe}function je(Ve,Be,Me){const qe=Y[Be];return delete Y[Be],Y[Ve]=qe,ee[qe].geometry[0].shift(),ee[qe].geometry[0]=Me[0].concat(ee[qe].geometry[0]),qe}function Ke(Ve,Be,Me){const qe=Me?Be[0][Be[0].length-1]:Be[0][0];return`${Ve}:${qe.x}:${qe.y}`}for(let Ve=0;VeVe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((W,Y)=>W.sortKey-Y.sortKey)}update(e,s,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,s,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,s,this.layers,a))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,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(e,s){const a=this.lineVertexArray.length;if(e.segment!==void 0){let h=e.dist(s[e.segment+1]),m=e.dist(s[e.segment]);const y={};for(let v=e.segment+1;v=0;v--)y[v]={x:s[v].x,y:s[v].y,tileUnitDistanceFromAnchor:m},v>0&&(m+=s[v-1].dist(s[v]));for(let v=0;v0}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(e,s){const a=e.placedSymbolArray.get(s),h=a.vertexStartIndex+4*a.numGlyphs;for(let m=a.vertexStartIndex;mh[v]-h[S]||m[S]-m[v]),y}addToSortKeyRanges(e,s){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===s?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:s,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const s of this.symbolInstanceIndexes){const a=this.symbolInstances.get(s);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((h,m,y)=>{h>=0&&y.indexOf(h)===m&&this.addIndicesForPlacedSymbol(this.text,h)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let $y,Zy;Ze("SymbolBucket",hl,{omit:["layers","collisionBoxArray","features","compareText"]}),hl.MAX_GLYPHS=65535,hl.addDynamicAttributes=lf;var hf={get paint(){return Zy=Zy||new gi({"icon-opacity":new st(ye.paint_symbol["icon-opacity"]),"icon-color":new st(ye.paint_symbol["icon-color"]),"icon-halo-color":new st(ye.paint_symbol["icon-halo-color"]),"icon-halo-width":new st(ye.paint_symbol["icon-halo-width"]),"icon-halo-blur":new st(ye.paint_symbol["icon-halo-blur"]),"icon-translate":new et(ye.paint_symbol["icon-translate"]),"icon-translate-anchor":new et(ye.paint_symbol["icon-translate-anchor"]),"text-opacity":new st(ye.paint_symbol["text-opacity"]),"text-color":new st(ye.paint_symbol["text-color"],{runtimeType:on,getOverride:n=>n.textColor,hasOverride:n=>!!n.textColor}),"text-halo-color":new st(ye.paint_symbol["text-halo-color"]),"text-halo-width":new st(ye.paint_symbol["text-halo-width"]),"text-halo-blur":new st(ye.paint_symbol["text-halo-blur"]),"text-translate":new et(ye.paint_symbol["text-translate"]),"text-translate-anchor":new et(ye.paint_symbol["text-translate-anchor"])})},get layout(){return $y=$y||new gi({"symbol-placement":new et(ye.layout_symbol["symbol-placement"]),"symbol-spacing":new et(ye.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new et(ye.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new st(ye.layout_symbol["symbol-sort-key"]),"symbol-z-order":new et(ye.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new et(ye.layout_symbol["icon-allow-overlap"]),"icon-overlap":new et(ye.layout_symbol["icon-overlap"]),"icon-ignore-placement":new et(ye.layout_symbol["icon-ignore-placement"]),"icon-optional":new et(ye.layout_symbol["icon-optional"]),"icon-rotation-alignment":new et(ye.layout_symbol["icon-rotation-alignment"]),"icon-size":new st(ye.layout_symbol["icon-size"]),"icon-text-fit":new et(ye.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new et(ye.layout_symbol["icon-text-fit-padding"]),"icon-image":new st(ye.layout_symbol["icon-image"]),"icon-rotate":new st(ye.layout_symbol["icon-rotate"]),"icon-padding":new st(ye.layout_symbol["icon-padding"]),"icon-keep-upright":new et(ye.layout_symbol["icon-keep-upright"]),"icon-offset":new st(ye.layout_symbol["icon-offset"]),"icon-anchor":new st(ye.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new et(ye.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new et(ye.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new et(ye.layout_symbol["text-rotation-alignment"]),"text-field":new st(ye.layout_symbol["text-field"]),"text-font":new st(ye.layout_symbol["text-font"]),"text-size":new st(ye.layout_symbol["text-size"]),"text-max-width":new st(ye.layout_symbol["text-max-width"]),"text-line-height":new et(ye.layout_symbol["text-line-height"]),"text-letter-spacing":new st(ye.layout_symbol["text-letter-spacing"]),"text-justify":new st(ye.layout_symbol["text-justify"]),"text-radial-offset":new st(ye.layout_symbol["text-radial-offset"]),"text-variable-anchor":new et(ye.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new st(ye.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new st(ye.layout_symbol["text-anchor"]),"text-max-angle":new et(ye.layout_symbol["text-max-angle"]),"text-writing-mode":new et(ye.layout_symbol["text-writing-mode"]),"text-rotate":new st(ye.layout_symbol["text-rotate"]),"text-padding":new et(ye.layout_symbol["text-padding"]),"text-keep-upright":new et(ye.layout_symbol["text-keep-upright"]),"text-transform":new st(ye.layout_symbol["text-transform"]),"text-offset":new st(ye.layout_symbol["text-offset"]),"text-allow-overlap":new et(ye.layout_symbol["text-allow-overlap"]),"text-overlap":new et(ye.layout_symbol["text-overlap"]),"text-ignore-placement":new et(ye.layout_symbol["text-ignore-placement"]),"text-optional":new et(ye.layout_symbol["text-optional"])})}};class qy{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Or,this.defaultValue=e}evaluate(e){if(e.formattedSection){const s=this.defaultValue.property.overrides;if(s&&s.hasOverride(e.formattedSection))return s.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ze("FormatSectionOverride",qy,{omit:["defaultValue"]});class Gh extends Yn{constructor(e){super(e,hf)}recalculate(e,s){if(super.recalculate(e,s),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"){const a=this.layout.get("text-writing-mode");if(a){const h=[];for(const m of a)h.indexOf(m)<0&&h.push(m);this.layout._values["text-writing-mode"]=h}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,s,a,h){const m=this.layout.get(e).evaluate(s,{},a,h),y=this._unevaluatedLayout._values[e];return y.isDataDriven()||qa(y.value)||!m?m:function(v,S){return S.replace(/{([^{}]+)}/g,(k,C)=>v&&C in v?String(v[C]):"")}(s.properties,m)}createBucket(e){return new hl(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of hf.paint.overridableProperties){if(!Gh.hasPaintOverride(this.layout,e))continue;const s=this.paint.get(e),a=new qy(s),h=new hu(a,s.property.specification);let m=null;m=s.value.kind==="constant"||s.value.kind==="source"?new du("source",h):new Ha("composite",h,s.value.zoomStops),this.paint._values[e]=new an(s.property,m,s.parameters)}}_handleOverridablePaintPropertyUpdate(e,s,a){return!(!this.layout||s.isDataDriven()||a.isDataDriven())&&Gh.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,s){const a=e.get("text-field"),h=hf.paint.properties[s];let m=!1;const y=v=>{for(const S of v)if(h.overrides&&h.overrides.hasOverride(S))return void(m=!0)};if(a.value.kind==="constant"&&a.value.value instanceof Xi)y(a.value.value.sections);else if(a.value.kind==="source"){const v=k=>{m||(k instanceof Is&&Qt(k.value)===q?y(k.value.sections):k instanceof Za?y(k.sections):k.eachChild(v))},S=a.value;S._styleExpression&&v(S._styleExpression.expression)}return m}}let Gy;var Gw={get paint(){return Gy=Gy||new gi({"background-color":new et(ye.paint_background["background-color"]),"background-pattern":new Iu(ye.paint_background["background-pattern"]),"background-opacity":new et(ye.paint_background["background-opacity"])})}};class Hw extends Yn{constructor(e){super(e,Gw)}}let Hy;var Ww={get paint(){return Hy=Hy||new gi({"raster-opacity":new et(ye.paint_raster["raster-opacity"]),"raster-hue-rotate":new et(ye.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new et(ye.paint_raster["raster-brightness-min"]),"raster-brightness-max":new et(ye.paint_raster["raster-brightness-max"]),"raster-saturation":new et(ye.paint_raster["raster-saturation"]),"raster-contrast":new et(ye.paint_raster["raster-contrast"]),"raster-resampling":new et(ye.paint_raster["raster-resampling"]),"raster-fade-duration":new et(ye.paint_raster["raster-fade-duration"])})}};class Xw extends Yn{constructor(e){super(e,Ww)}}class Kw extends Yn{constructor(e){super(e,{}),this.onAdd=s=>{this.implementation.onAdd&&this.implementation.onAdd(s,s.painter.context.gl)},this.onRemove=s=>{this.implementation.onRemove&&this.implementation.onRemove(s,s.painter.context.gl)},this.implementation=e}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 Yw{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const df=63710088e-1;class bo{constructor(e,s){if(isNaN(e)||isNaN(s))throw new Error(`Invalid LngLat object: (${e}, ${s})`);if(this.lng=+e,this.lat=+s,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new bo(Je(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const s=Math.PI/180,a=this.lat*s,h=e.lat*s,m=Math.sin(a)*Math.sin(h)+Math.cos(a)*Math.cos(h)*Math.cos((e.lng-this.lng)*s);return df*Math.acos(Math.min(m,1))}static convert(e){if(e instanceof bo)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new bo(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new bo(Number("lng"in e?e.lng:e.lon),Number(e.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 [, ]")}}const Wy=2*Math.PI*df;function Xy(n){return Wy*Math.cos(n*Math.PI/180)}function Ky(n){return(180+n)/360}function Yy(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function Qy(n,e){return n/Xy(e)}function Jy(n){return 360*n-180}function pf(n){return 360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90}class Hh{constructor(e,s,a=0){this.x=+e,this.y=+s,this.z=+a}static fromLngLat(e,s=0){const a=bo.convert(e);return new Hh(Ky(a.lng),Yy(a.lat),Qy(s,a.lat))}toLngLat(){return new bo(Jy(this.x),pf(this.y))}toAltitude(){return this.z*Xy(pf(this.y))}meterInMercatorCoordinateUnits(){return 1/Wy*(e=pf(this.y),1/Math.cos(e*Math.PI/180));var e}}function e_(n,e,s){var a=2*Math.PI*6378137/256/Math.pow(2,s);return[n*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class ff{constructor(e,s,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||s<0||s>=Math.pow(2,e))throw new Error(`x=${s}, y=${a}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=s,this.y=a,this.key=Xu(0,e,e,s,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,s,a){const h=(y=this.y,v=this.z,S=e_(256*(m=this.x),256*(y=Math.pow(2,v)-y-1),v),k=e_(256*(m+1),256*(y+1),v),S[0]+","+S[1]+","+k[0]+","+k[1]);var m,y,v,S,k;const C=function(z,D,B){let O,j="";for(let W=z;W>0;W--)O=1<1?"@2x":"").replace(/{quadkey}/g,C).replace(/{bbox-epsg-3857}/g,h)}isChildOf(e){const s=this.z-e.z;return s>0&&e.x===this.x>>s&&e.y===this.y>>s}getTilePoint(e){const s=Math.pow(2,this.z);return new te((e.x*s-this.x)*Si,(e.y*s-this.y)*Si)}toString(){return`${this.z}/${this.x}/${this.y}`}}class t_{constructor(e,s){this.wrap=e,this.canonical=s,this.key=Xu(e,s.z,s.z,s.x,s.y)}}class lr{constructor(e,s,a,h,m){if(e= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=s,this.canonical=new ff(a,+h,+m),this.key=Xu(s,e,a,h,m)}clone(){return new lr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?new lr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new lr(e,this.wrap,e,this.canonical.x>>s,this.canonical.y>>s)}calculateScaledKey(e,s){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-e;return e>this.canonical.z?Xu(this.wrap*+s,e,this.canonical.z,this.canonical.x,this.canonical.y):Xu(this.wrap*+s,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const s=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>s&&e.canonical.y===this.canonical.y>>s}children(e){if(this.overscaledZ>=e)return[new lr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const s=this.canonical.z+1,a=2*this.canonical.x,h=2*this.canonical.y;return[new lr(s,this.wrap,s,a,h),new lr(s,this.wrap,s,a+1,h),new lr(s,this.wrap,s,a,h+1),new lr(s,this.wrap,s,a+1,h+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=z),z=this.dim+1||s<-1||s>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(s+1)*this.stride+(e+1)}unpack(e,s,a){return e*this.redFactor+s*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new ar({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,s,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let h=s*this.dim,m=s*this.dim+this.dim,y=a*this.dim,v=a*this.dim+this.dim;switch(s){case-1:h=m-1;break;case 1:m=h+1}switch(a){case-1:y=v-1;break;case 1:v=y+1}const S=-s*this.dim,k=-a*this.dim;for(let C=y;C=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class r_{constructor(e,s,a,h,m){this.type="Feature",this._vectorTileFeature=e,e._z=s,e._x=a,e._y=h,this.properties=e.properties,this.id=m}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(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const s in this)s!=="_geometry"&&s!=="_vectorTileFeature"&&(e[s]=this[s]);return e}}class s_{constructor(e,s){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new fo(Si,16,0),this.grid3D=new fo(Si,16,0),this.featureIndexArray=new Te,this.promoteId=s}insert(e,s,a,h,m,y){const v=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,h,m);const S=y?this.grid3D:this.grid;for(let k=0;k=0&&z[3]>=0&&S.insert(v,z[0],z[1],z[2],z[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new vo.VectorTile(new tf(this.rawTileData)).layers,this.sourceLayerCoder=new n_(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,s,a,h){this.loadVTLayers();const m=e.params||{},y=Si/e.tileSize/e.scale,v=fu(m.filter),S=e.queryGeometry,k=e.queryPadding*y,C=a_(S),z=this.grid.query(C.minX-k,C.minY-k,C.maxX+k,C.maxY+k),D=a_(e.cameraQueryGeometry),B=this.grid3D.query(D.minX-k,D.minY-k,D.maxX+k,D.maxY+k,(W,Y,ue,ee)=>function(he,fe,we,je,Ke){for(const Be of he)if(fe<=Be.x&&we<=Be.y&&je>=Be.x&&Ke>=Be.y)return!0;const Ve=[new te(fe,we),new te(fe,Ke),new te(je,Ke),new te(je,we)];if(he.length>2){for(const Be of Ve)if(rl(he,Be))return!0}for(let Be=0;Be(ee||(ee=la(he)),fe.queryIntersectsFeature(S,he,we,ee,this.z,e.transform,y,e.pixelPosMatrix)))}return O}loadMatchingFeature(e,s,a,h,m,y,v,S,k,C,z){const D=this.bucketLayerIDs[s];if(y&&!function(W,Y){for(let ue=0;ue=0)return!0;return!1}(y,D))return;const B=this.sourceLayerCoder.decode(a),O=this.vtLayers[B].feature(h);if(m.needGeometry){const W=ua(O,!0);if(!m.filter(new Ht(this.tileID.overscaledZ),W,this.tileID.canonical))return}else if(!m.filter(new Ht(this.tileID.overscaledZ),O))return;const j=this.getId(O,B);for(let W=0;W{const v=e instanceof il?e.get(y):null;return v&&v.evaluate?v.evaluate(s,a,h):v})}function a_(n){let e=1/0,s=1/0,a=-1/0,h=-1/0;for(const m of n)e=Math.min(e,m.x),s=Math.min(s,m.y),a=Math.max(a,m.x),h=Math.max(h,m.y);return{minX:e,minY:s,maxX:a,maxY:h}}function Qw(n,e){return e-n}function l_(n,e,s,a,h){const m=[];for(let y=0;y=a&&z.x>=a||(C.x>=a?C=new te(a,C.y+(a-C.x)/(z.x-C.x)*(z.y-C.y))._round():z.x>=a&&(z=new te(a,C.y+(a-C.x)/(z.x-C.x)*(z.y-C.y))._round()),C.y>=h&&z.y>=h||(C.y>=h?C=new te(C.x+(h-C.y)/(z.y-C.y)*(z.x-C.x),h)._round():z.y>=h&&(z=new te(C.x+(h-C.y)/(z.y-C.y)*(z.x-C.x),h)._round()),S&&C.equals(S[S.length-1])||(S=[C],m.push(S)),S.push(z)))))}}return m}Ze("FeatureIndex",s_,{omit:["rawTileData","sourceLayerCoder"]});class So extends te{constructor(e,s,a,h){super(e,s),this.angle=a,h!==void 0&&(this.segment=h)}clone(){return new So(this.x,this.y,this.angle,this.segment)}}function u_(n,e,s,a,h){if(e.segment===void 0||s===0)return!0;let m=e,y=e.segment+1,v=0;for(;v>-s/2;){if(y--,y<0)return!1;v-=n[y].dist(m),m=n[y]}v+=n[y].dist(n[y+1]),y++;const S=[];let k=0;for(;va;)k-=S.shift().angleDelta;if(k>h)return!1;y++,v+=C.dist(z)}return!0}function c_(n){let e=0;for(let s=0;sk){const O=(k-S)/B,j=zn.number(z.x,D.x,O),W=zn.number(z.y,D.y,O),Y=new So(j,W,D.angleTo(z),C);return Y._round(),!y||u_(n,Y,v,y,e)?Y:void 0}S+=B}}function eb(n,e,s,a,h,m,y,v,S){const k=h_(a,m,y),C=d_(a,h),z=C*y,D=n[0].x===0||n[0].x===S||n[0].y===0||n[0].y===S;return e-z=0&&he=0&&fe=0&&D+k<=C){const we=new So(he,fe,ue,O);we._round(),a&&!u_(n,we,m,a,h)||B.push(we)}}z+=Y}return v||B.length||y||(B=p_(n,z/2,s,a,h,m,y,!0,S)),B}Ze("Anchor",So);const dl=Fn;function f_(n,e,s,a){const h=[],m=n.image,y=m.pixelRatio,v=m.paddedRect.w-2*dl,S=m.paddedRect.h-2*dl,k=n.right-n.left,C=n.bottom-n.top,z=m.stretchX||[[0,v]],D=m.stretchY||[[0,S]],B=(Me,qe)=>Me+qe[1]-qe[0],O=z.reduce(B,0),j=D.reduce(B,0),W=v-O,Y=S-j;let ue=0,ee=O,he=0,fe=j,we=0,je=W,Ke=0,Ve=Y;if(m.content&&a){const Me=m.content;ue=Wh(z,0,Me[0]),he=Wh(D,0,Me[1]),ee=Wh(z,Me[0],Me[2]),fe=Wh(D,Me[1],Me[3]),we=Me[0]-ue,Ke=Me[1]-he,je=Me[2]-Me[0]-ee,Ve=Me[3]-Me[1]-fe}const Be=(Me,qe,Le,Ce)=>{const nt=Xh(Me.stretch-ue,ee,k,n.left),Qe=Kh(Me.fixed-we,je,Me.stretch,O),yt=Xh(qe.stretch-he,fe,C,n.top),Xt=Kh(qe.fixed-Ke,Ve,qe.stretch,j),Yt=Xh(Le.stretch-ue,ee,k,n.left),zi=Kh(Le.fixed-we,je,Le.stretch,O),Jn=Xh(Ce.stretch-he,fe,C,n.top),wn=Kh(Ce.fixed-Ke,Ve,Ce.stretch,j),Ti=new te(nt,yt),Zi=new te(Yt,yt),Qi=new te(Yt,Jn),bn=new te(nt,Jn),Sn=new te(Qe/y,Xt/y),Ai=new te(zi/y,wn/y),Di=e*Math.PI/180;if(Di){const cn=Math.sin(Di),Bn=Math.cos(Di),On=[Bn,-cn,cn,Bn];Ti._matMult(On),Zi._matMult(On),bn._matMult(On),Qi._matMult(On)}const un=Me.stretch+Me.fixed,Tn=qe.stretch+qe.fixed;return{tl:Ti,tr:Zi,bl:bn,br:Qi,tex:{x:m.paddedRect.x+dl+un,y:m.paddedRect.y+dl+Tn,w:Le.stretch+Le.fixed-un,h:Ce.stretch+Ce.fixed-Tn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Sn,pixelOffsetBR:Ai,minFontScaleX:je/y/k,minFontScaleY:Ve/y/C,isSDF:s}};if(a&&(m.stretchX||m.stretchY)){const Me=m_(z,W,O),qe=m_(D,Y,j);for(let Le=0;Le0&&(O=Math.max(10,O),this.circleDiameter=O)}else{let z=y.top*v-S[0],D=y.bottom*v+S[2],B=y.left*v-S[3],O=y.right*v+S[1];const j=y.collisionPadding;if(j&&(B-=j[0]*v,z-=j[1]*v,O+=j[2]*v,D+=j[3]*v),C){const W=new te(B,z),Y=new te(O,z),ue=new te(B,D),ee=new te(O,D),he=C*Math.PI/180;W._rotate(he),Y._rotate(he),ue._rotate(he),ee._rotate(he),B=Math.min(W.x,Y.x,ue.x,ee.x),O=Math.max(W.x,Y.x,ue.x,ee.x),z=Math.min(W.y,Y.y,ue.y,ee.y),D=Math.max(W.y,Y.y,ue.y,ee.y)}e.emplaceBack(s.x,s.y,B,z,O,D,a,h,m)}this.boxEndIndex=e.length}}class tb{constructor(e=[],s=ib){if(this.data=e,this.length=this.data.length,this.compare=s,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:s,compare:a}=this,h=s[e];for(;e>0;){const m=e-1>>1,y=s[m];if(a(h,y)>=0)break;s[e]=y,e=m}s[e]=h}_down(e){const{data:s,compare:a}=this,h=this.length>>1,m=s[e];for(;e=0)break;s[e]=v,e=y}s[e]=m}}function ib(n,e){return ne?1:0}function nb(n,e=1,s=!1){let a=1/0,h=1/0,m=-1/0,y=-1/0;const v=n[0];for(let B=0;Bm)&&(m=O.x),(!B||O.y>y)&&(y=O.y)}const S=Math.min(m-a,y-h);let k=S/2;const C=new tb([],rb);if(S===0)return new te(a,h);for(let B=a;Bz.d||!z.d)&&(z=B,s&&console.log("found best %d after %d probes",Math.round(1e4*B.d)/1e4,D)),B.max-z.d<=e||(k=B.h/2,C.push(new pl(B.p.x-k,B.p.y-k,k,n)),C.push(new pl(B.p.x+k,B.p.y-k,k,n)),C.push(new pl(B.p.x-k,B.p.y+k,k,n)),C.push(new pl(B.p.x+k,B.p.y+k,k,n)),D+=4)}return s&&(console.log(`num probes: ${D}`),console.log(`best distance: ${z.d}`)),z.p}function rb(n,e){return e.max-n.max}function pl(n,e,s,a){this.p=new te(n,e),this.h=s,this.d=function(h,m){let y=!1,v=1/0;for(let S=0;Sh.y!=O.y>h.y&&h.x<(O.x-B.x)*(h.y-B.y)/(O.y-B.y)+B.x&&(y=!y),v=Math.min(v,Yg(h,B,O))}}return(y?1:-1)*Math.sqrt(v)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var Yi;u.aq=void 0,(Yi=u.aq||(u.aq={}))[Yi.center=1]="center",Yi[Yi.left=2]="left",Yi[Yi.right=3]="right",Yi[Yi.top=4]="top",Yi[Yi.bottom=5]="bottom",Yi[Yi["top-left"]=6]="top-left",Yi[Yi["top-right"]=7]="top-right",Yi[Yi["bottom-left"]=8]="bottom-left",Yi[Yi["bottom-right"]=9]="bottom-right";const To=7,mf=Number.POSITIVE_INFINITY;function g_(n,e){return e[1]!==mf?function(s,a,h){let m=0,y=0;switch(a=Math.abs(a),h=Math.abs(h),s){case"top-right":case"top-left":case"top":y=h-To;break;case"bottom-right":case"bottom-left":case"bottom":y=-h+To}switch(s){case"top-right":case"bottom-right":case"right":m=-a;break;case"top-left":case"bottom-left":case"left":m=a}return[m,y]}(n,e[0],e[1]):function(s,a){let h=0,m=0;a<0&&(a=0);const y=a/Math.SQRT2;switch(s){case"top-right":case"top-left":m=y-To;break;case"bottom-right":case"bottom-left":m=-y+To;break;case"bottom":m=-a+To;break;case"top":m=a-To}switch(s){case"top-right":case"bottom-right":h=-y;break;case"top-left":case"bottom-left":h=y;break;case"left":h=a;break;case"right":h=-a}return[h,m]}(n,e[0])}function y_(n,e,s){var a;const h=n.layout,m=(a=h.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},s);if(m){const v=m.values,S=[];for(let k=0;kD*Mi);C.startsWith("top")?z[1]-=To:C.startsWith("bottom")&&(z[1]+=To),S[k+1]=z}return new Hn(S)}const y=h.get("text-variable-anchor");if(y){let v;v=n._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[h.get("text-radial-offset").evaluate(e,{},s)*Mi,mf]:h.get("text-offset").evaluate(e,{},s).map(k=>k*Mi);const S=[];for(const k of y)S.push(k,g_(k,v));return new Hn(S)}return null}function gf(n){switch(n){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sb(n,e,s,a,h,m,y,v,S,k,C){let z=m.textMaxSize.evaluate(e,{});z===void 0&&(z=y);const D=n.layers[0].layout,B=D.get("icon-offset").evaluate(e,{},C),O=v_(s.horizontal),j=y/24,W=n.tilePixelRatio*j,Y=n.tilePixelRatio*z/24,ue=n.tilePixelRatio*v,ee=n.tilePixelRatio*D.get("symbol-spacing"),he=D.get("text-padding")*n.tilePixelRatio,fe=function(Ce,nt,Qe,yt=1){const Xt=Ce.get("icon-padding").evaluate(nt,{},Qe),Yt=Xt&&Xt.values;return[Yt[0]*yt,Yt[1]*yt,Yt[2]*yt,Yt[3]*yt]}(D,e,C,n.tilePixelRatio),we=D.get("text-max-angle")/180*Math.PI,je=D.get("text-rotation-alignment")!=="viewport"&&D.get("symbol-placement")!=="point",Ke=D.get("icon-rotation-alignment")==="map"&&D.get("symbol-placement")!=="point",Ve=D.get("symbol-placement"),Be=ee/2,Me=D.get("icon-text-fit");let qe;a&&Me!=="none"&&(n.allowVerticalPlacement&&s.vertical&&(qe=Uy(a,s.vertical,Me,D.get("icon-text-fit-padding"),B,j)),O&&(a=Uy(a,O,Me,D.get("icon-text-fit-padding"),B,j)));const Le=(Ce,nt)=>{nt.x<0||nt.x>=Si||nt.y<0||nt.y>=Si||function(Qe,yt,Xt,Yt,zi,Jn,wn,Ti,Zi,Qi,bn,Sn,Ai,Di,un,Tn,cn,Bn,On,Li,wt,hn,Ji,Ri,Cr){const Gr=Qe.addToLineVertexArray(yt,Xt);let Hr,Vs,Pr,ur,Nn=0,Us=0,Qu=0,S_=0,Tf=-1,kf=-1;const js={};let T_=Fs("");if(Qe.allowVerticalPlacement&&Yt.vertical){const dn=Ti.layout.get("text-rotate").evaluate(wt,{},Ri)+90;Pr=new Yh(Zi,yt,Qi,bn,Sn,Yt.vertical,Ai,Di,un,dn),wn&&(ur=new Yh(Zi,yt,Qi,bn,Sn,wn,cn,Bn,un,dn))}if(zi){const dn=Ti.layout.get("icon-rotate").evaluate(wt,{}),cr=Ti.layout.get("icon-text-fit")!=="none",ha=f_(zi,dn,Ji,cr),Xr=wn?f_(wn,dn,Ji,cr):void 0;Vs=new Yh(Zi,yt,Qi,bn,Sn,zi,cn,Bn,!1,dn),Nn=4*ha.length;const da=Qe.iconSizeData;let ys=null;da.kind==="source"?(ys=[gs*Ti.layout.get("icon-size").evaluate(wt,{})],ys[0]>wo&&mi(`${Qe.layerIds[0]}: Value for "icon-size" is >= ${Wu}. Reduce your "icon-size".`)):da.kind==="composite"&&(ys=[gs*hn.compositeIconSizes[0].evaluate(wt,{},Ri),gs*hn.compositeIconSizes[1].evaluate(wt,{},Ri)],(ys[0]>wo||ys[1]>wo)&&mi(`${Qe.layerIds[0]}: Value for "icon-size" is >= ${Wu}. Reduce your "icon-size".`)),Qe.addSymbols(Qe.icon,ha,ys,Li,On,wt,u.ai.none,yt,Gr.lineStartIndex,Gr.lineLength,-1,Ri),Tf=Qe.icon.placedSymbolArray.length-1,Xr&&(Us=4*Xr.length,Qe.addSymbols(Qe.icon,Xr,ys,Li,On,wt,u.ai.vertical,yt,Gr.lineStartIndex,Gr.lineLength,-1,Ri),kf=Qe.icon.placedSymbolArray.length-1)}const k_=Object.keys(Yt.horizontal);for(const dn of k_){const cr=Yt.horizontal[dn];if(!Hr){T_=Fs(cr.text);const Xr=Ti.layout.get("text-rotate").evaluate(wt,{},Ri);Hr=new Yh(Zi,yt,Qi,bn,Sn,cr,Ai,Di,un,Xr)}const ha=cr.positionedLines.length===1;if(Qu+=__(Qe,yt,cr,Jn,Ti,un,wt,Tn,Gr,Yt.vertical?u.ai.horizontal:u.ai.horizontalOnly,ha?k_:[dn],js,Tf,hn,Ri),ha)break}Yt.vertical&&(S_+=__(Qe,yt,Yt.vertical,Jn,Ti,un,wt,Tn,Gr,u.ai.vertical,["vertical"],js,kf,hn,Ri));const lb=Hr?Hr.boxStartIndex:Qe.collisionBoxArray.length,ub=Hr?Hr.boxEndIndex:Qe.collisionBoxArray.length,cb=Pr?Pr.boxStartIndex:Qe.collisionBoxArray.length,hb=Pr?Pr.boxEndIndex:Qe.collisionBoxArray.length,db=Vs?Vs.boxStartIndex:Qe.collisionBoxArray.length,pb=Vs?Vs.boxEndIndex:Qe.collisionBoxArray.length,fb=ur?ur.boxStartIndex:Qe.collisionBoxArray.length,mb=ur?ur.boxEndIndex:Qe.collisionBoxArray.length;let Wr=-1;const Jh=(dn,cr)=>dn&&dn.circleDiameter?Math.max(dn.circleDiameter,cr):cr;Wr=Jh(Hr,Wr),Wr=Jh(Pr,Wr),Wr=Jh(Vs,Wr),Wr=Jh(ur,Wr);const E_=Wr>-1?1:0;E_&&(Wr*=Cr/Mi),Qe.glyphOffsetArray.length>=hl.MAX_GLYPHS&&mi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),wt.sortKey!==void 0&&Qe.addToSortKeyRanges(Qe.symbolInstances.length,wt.sortKey);const gb=y_(Ti,wt,Ri),[yb,_b]=function(dn,cr){const ha=dn.length,Xr=cr==null?void 0:cr.values;if((Xr==null?void 0:Xr.length)>0)for(let da=0;da=0?js.right:-1,js.center>=0?js.center:-1,js.left>=0?js.left:-1,js.vertical||-1,Tf,kf,T_,lb,ub,cb,hb,db,pb,fb,mb,Qi,Qu,S_,Nn,Us,E_,0,Ai,Wr,yb,_b)}(n,nt,Ce,s,a,h,qe,n.layers[0],n.collisionBoxArray,e.index,e.sourceLayerIndex,n.index,W,[he,he,he,he],je,S,ue,fe,Ke,B,e,m,k,C,y)};if(Ve==="line")for(const Ce of l_(e.geometry,0,0,Si,Si)){const nt=eb(Ce,ee,we,s.vertical||O,a,24,Y,n.overscaling,Si);for(const Qe of nt)O&&ob(n,O.text,Be,Qe)||Le(Ce,Qe)}else if(Ve==="line-center"){for(const Ce of e.geometry)if(Ce.length>1){const nt=Jw(Ce,we,s.vertical||O,a,24,Y);nt&&Le(Ce,nt)}}else if(e.type==="Polygon")for(const Ce of Hp(e.geometry,0)){const nt=nb(Ce,16);Le(Ce[0],new So(nt.x,nt.y,0))}else if(e.type==="LineString")for(const Ce of e.geometry)Le(Ce,new So(Ce[0].x,Ce[0].y,0));else if(e.type==="Point")for(const Ce of e.geometry)for(const nt of Ce)Le([nt],new So(nt.x,nt.y,0))}function __(n,e,s,a,h,m,y,v,S,k,C,z,D,B,O){const j=function(ue,ee,he,fe,we,je,Ke,Ve){const Be=fe.layout.get("text-rotate").evaluate(je,{})*Math.PI/180,Me=[];for(const qe of ee.positionedLines)for(const Le of qe.positionedGlyphs){if(!Le.rect)continue;const Ce=Le.rect||{};let nt=Ly+1,Qe=!0,yt=1,Xt=0;const Yt=(we||Ve)&&Le.vertical,zi=Le.metrics.advance*Le.scale/2;if(Ve&&ee.verticalizable&&(Xt=qe.lineOffset/2-(Le.imageName?-(Mi-Le.metrics.width*Le.scale)/2:(Le.scale-1)*Mi)),Le.imageName){const Li=Ke[Le.imageName];Qe=Li.sdf,yt=Li.pixelRatio,nt=Fn/yt}const Jn=we?[Le.x+zi,Le.y]:[0,0];let wn=we?[0,0]:[Le.x+zi+he[0],Le.y+he[1]-Xt],Ti=[0,0];Yt&&(Ti=wn,wn=[0,0]);const Zi=Le.metrics.isDoubleResolution?2:1,Qi=(Le.metrics.left-nt)*Le.scale-zi+wn[0],bn=(-Le.metrics.top-nt)*Le.scale+wn[1],Sn=Qi+Ce.w/Zi*Le.scale/yt,Ai=bn+Ce.h/Zi*Le.scale/yt,Di=new te(Qi,bn),un=new te(Sn,bn),Tn=new te(Qi,Ai),cn=new te(Sn,Ai);if(Yt){const Li=new te(-zi,zi-Gu),wt=-Math.PI/2,hn=Mi/2-zi,Ji=new te(5-Gu-hn,-(Le.imageName?hn:0)),Ri=new te(...Ti);Di._rotateAround(wt,Li)._add(Ji)._add(Ri),un._rotateAround(wt,Li)._add(Ji)._add(Ri),Tn._rotateAround(wt,Li)._add(Ji)._add(Ri),cn._rotateAround(wt,Li)._add(Ji)._add(Ri)}if(Be){const Li=Math.sin(Be),wt=Math.cos(Be),hn=[wt,-Li,Li,wt];Di._matMult(hn),un._matMult(hn),Tn._matMult(hn),cn._matMult(hn)}const Bn=new te(0,0),On=new te(0,0);Me.push({tl:Di,tr:un,bl:Tn,br:cn,tex:Ce,writingMode:ee.writingMode,glyphOffset:Jn,sectionIndex:Le.sectionIndex,isSDF:Qe,pixelOffsetTL:Bn,pixelOffsetBR:On,minFontScaleX:0,minFontScaleY:0})}return Me}(0,s,v,h,m,y,a,n.allowVerticalPlacement),W=n.textSizeData;let Y=null;W.kind==="source"?(Y=[gs*h.layout.get("text-size").evaluate(y,{})],Y[0]>wo&&mi(`${n.layerIds[0]}: Value for "text-size" is >= ${Wu}. Reduce your "text-size".`)):W.kind==="composite"&&(Y=[gs*B.compositeTextSizes[0].evaluate(y,{},O),gs*B.compositeTextSizes[1].evaluate(y,{},O)],(Y[0]>wo||Y[1]>wo)&&mi(`${n.layerIds[0]}: Value for "text-size" is >= ${Wu}. Reduce your "text-size".`)),n.addSymbols(n.text,j,Y,v,m,y,k,e,S.lineStartIndex,S.lineLength,D,O);for(const ue of C)z[ue]=n.text.placedSymbolArray.length-1;return 4*j.length}function v_(n){for(const e in n)return n[e];return null}function ob(n,e,s,a){const h=n.compareText;if(e in h){const m=h[e];for(let y=m.length-1;y>=0;y--)if(a.dist(m[y])>4;if(h!==1)throw new Error(`Got v${h} data when expected v1.`);const m=x_[15&a];if(!m)throw new Error("Unrecognized array type.");const[y]=new Uint16Array(e,2,1),[v]=new Uint32Array(e,4,1);return new yf(v,y,m,e)}constructor(e,s=64,a=Float64Array,h){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+s,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const m=x_.indexOf(this.ArrayType),y=2*e*this.ArrayType.BYTES_PER_ELEMENT,v=e*this.IndexArrayType.BYTES_PER_ELEMENT,S=(8-v%8)%8;if(m<0)throw new Error(`Unexpected typed array class: ${a}.`);h&&h instanceof ArrayBuffer?(this.data=h,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+v+S,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+y+v+S),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+v+S,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+m]),new Uint16Array(this.data,2,1)[0]=s,new Uint32Array(this.data,4,1)[0]=e)}add(e,s){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=s,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return _f(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,s,a,h){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:y,nodeSize:v}=this,S=[0,m.length-1,0],k=[];for(;S.length;){const C=S.pop()||0,z=S.pop()||0,D=S.pop()||0;if(z-D<=v){for(let W=D;W<=z;W++){const Y=y[2*W],ue=y[2*W+1];Y>=e&&Y<=a&&ue>=s&&ue<=h&&k.push(m[W])}continue}const B=D+z>>1,O=y[2*B],j=y[2*B+1];O>=e&&O<=a&&j>=s&&j<=h&&k.push(m[B]),(C===0?e<=O:s<=j)&&(S.push(D),S.push(B-1),S.push(1-C)),(C===0?a>=O:h>=j)&&(S.push(B+1),S.push(z),S.push(1-C))}return k}within(e,s,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:h,coords:m,nodeSize:y}=this,v=[0,h.length-1,0],S=[],k=a*a;for(;v.length;){const C=v.pop()||0,z=v.pop()||0,D=v.pop()||0;if(z-D<=y){for(let W=D;W<=z;W++)b_(m[2*W],m[2*W+1],e,s)<=k&&S.push(h[W]);continue}const B=D+z>>1,O=m[2*B],j=m[2*B+1];b_(O,j,e,s)<=k&&S.push(h[B]),(C===0?e-a<=O:s-a<=j)&&(v.push(D),v.push(B-1),v.push(1-C)),(C===0?e+a>=O:s+a>=j)&&(v.push(B+1),v.push(z),v.push(1-C))}return S}}function _f(n,e,s,a,h,m){if(h-a<=s)return;const y=a+h>>1;w_(n,e,y,a,h,m),_f(n,e,s,a,y-1,1-m),_f(n,e,s,y+1,h,1-m)}function w_(n,e,s,a,h,m){for(;h>a;){if(h-a>600){const k=h-a+1,C=s-a+1,z=Math.log(k),D=.5*Math.exp(2*z/3),B=.5*Math.sqrt(z*D*(k-D)/k)*(C-k/2<0?-1:1);w_(n,e,s,Math.max(a,Math.floor(s-C*D/k+B)),Math.min(h,Math.floor(s+(k-C)*D/k+B)),m)}const y=e[2*s+m];let v=a,S=h;for(Ku(n,e,a,s),e[2*h+m]>y&&Ku(n,e,a,h);vy;)S--}e[2*a+m]===y?Ku(n,e,a,S):(S++,Ku(n,e,S,h)),S<=s&&(a=S+1),s<=S&&(h=S-1)}}function Ku(n,e,s,a){vf(n,s,a),vf(e,2*s,2*a),vf(e,2*s+1,2*a+1)}function vf(n,e,s){const a=n[e];n[e]=n[s],n[s]=a}function b_(n,e,s,a){const h=n-s,m=e-a;return h*h+m*m}var xf;u.bh=void 0,(xf=u.bh||(u.bh={})).create="create",xf.load="load",xf.fullLoad="fullLoad";let Qh=null,Yu=[];const wf=1e3/60,bf="loadTime",Sf="fullLoadTime",ab={mark(n){performance.mark(n)},frame(n){const e=n;Qh!=null&&Yu.push(e-Qh),Qh=e},clearMetrics(){Qh=null,Yu=[],performance.clearMeasures(bf),performance.clearMeasures(Sf);for(const n in u.bh)performance.clearMarks(u.bh[n])},getPerformanceMetrics(){performance.measure(bf,u.bh.create,u.bh.load),performance.measure(Sf,u.bh.create,u.bh.fullLoad);const n=performance.getEntriesByName(bf)[0].duration,e=performance.getEntriesByName(Sf)[0].duration,s=Yu.length,a=1/(Yu.reduce((m,y)=>m+y,0)/s/1e3),h=Yu.filter(m=>m>wf).reduce((m,y)=>m+(y-wf)/wf,0);return{loadTime:n,fullLoadTime:e,fps:a,percentDroppedFrames:h/(s+h)*100,totalFrames:s}}};u.$=function(n,e,s){var a,h,m,y,v,S,k,C,z,D,B,O,j=s[0],W=s[1],Y=s[2];return e===n?(n[12]=e[0]*j+e[4]*W+e[8]*Y+e[12],n[13]=e[1]*j+e[5]*W+e[9]*Y+e[13],n[14]=e[2]*j+e[6]*W+e[10]*Y+e[14],n[15]=e[3]*j+e[7]*W+e[11]*Y+e[15]):(h=e[1],m=e[2],y=e[3],v=e[4],S=e[5],k=e[6],C=e[7],z=e[8],D=e[9],B=e[10],O=e[11],n[0]=a=e[0],n[1]=h,n[2]=m,n[3]=y,n[4]=v,n[5]=S,n[6]=k,n[7]=C,n[8]=z,n[9]=D,n[10]=B,n[11]=O,n[12]=a*j+v*W+z*Y+e[12],n[13]=h*j+S*W+D*Y+e[13],n[14]=m*j+k*W+B*Y+e[14],n[15]=y*j+C*W+O*Y+e[15]),n},u.A=sl,u.B=zn,u.C=class{constructor(n,e,s){this.receive=a=>{const h=a.data,m=h.id;if(m&&(!h.targetMapId||this.mapId===h.targetMapId))if(h.type===""){delete this.tasks[m];const y=this.cancelCallbacks[m];delete this.cancelCallbacks[m],y&&y()}else Ii()||h.mustQueue?(this.tasks[m]=h,this.taskQueue.push(m),this.invoker.trigger()):this.processTask(m,h)},this.process=()=>{if(!this.taskQueue.length)return;const a=this.taskQueue.shift(),h=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),h&&this.processTask(a,h)},this.target=n,this.parent=e,this.mapId=s,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Yw(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ii()?n:window}send(n,e,s,a,h=!1){const m=Math.round(1e18*Math.random()).toString(36).substring(0,10);s&&(this.callbacks[m]=s);const y=[],v={id:m,type:n,hasCallback:!!s,targetMapId:a,mustQueue:h,sourceMapId:this.mapId,data:ps(e,y)};return this.target.postMessage(v,{transfer:y}),{cancel:()=>{s&&delete this.callbacks[m],this.target.postMessage({id:m,type:"",targetMapId:a,sourceMapId:this.mapId})}}}processTask(n,e){if(e.type===""){const s=this.callbacks[n];delete this.callbacks[n],s&&(e.error?s(mo(e.error)):s(null,mo(e.data)))}else{let s=!1;const a=[],h=e.hasCallback?(v,S)=>{s=!0,delete this.cancelCallbacks[n];const k={id:n,type:"",sourceMapId:this.mapId,error:v?ps(v):null,data:ps(S,a)};this.target.postMessage(k,{transfer:a})}:v=>{s=!0};let m=null;const y=mo(e.data);if(this.parent[e.type])m=this.parent[e.type](e.sourceMapId,y,h);else if("getWorkerSource"in this.parent){const v=e.type.split(".");m=this.parent.getWorkerSource(e.sourceMapId,v[0],y.source)[v[1]](y,h)}else h(new Error(`Could not find function ${e.type}`));!s&&m&&m.cancel&&(this.cancelCallbacks[n]=m.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},u.D=et,u.E=Ts,u.F=function(n,e){const s={};for(let a=0;a{}}},u.Y=ze,u.Z=function(){var n=new sl(16);return sl!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n},u._=N,u.a=ct,u.a$=class extends F{},u.a0=function(n,e,s){var a=s[0],h=s[1],m=s[2];return n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n[3]=e[3]*a,n[4]=e[4]*h,n[5]=e[5]*h,n[6]=e[6]*h,n[7]=e[7]*h,n[8]=e[8]*m,n[9]=e[9]*m,n[10]=e[10]*m,n[11]=e[11]*m,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},u.a1=ty,u.a2=function(){return Ft++},u.a3=G,u.a4=hl,u.a5=function(){Ln.isLoading()||Ln.isLoaded()||ku()!=="deferred"||Eh()},u.a6=fu,u.a7=ua,u.a8=Ht,u.a9=r_,u.aA=na,u.aB=function(n){n=n.slice();const e=Object.create(null);for(let s=0;s{a[y.source]?s.push({command:Ct.removeLayer,args:[y.id]}):m.push(y)}),s=s.concat(h),function(y,v,S){v=v||[];const k=(y=y||[]).map(ls),C=v.map(ls),z=y.reduce(ks,{}),D=v.reduce(ks,{}),B=k.slice(),O=Object.create(null);let j,W,Y,ue,ee,he,fe;for(j=0,W=0;j@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(s,a,h,m)=>{const y=h||m;return e[a]=!y||y.toLowerCase(),""}),e["max-age"]){const s=parseInt(e["max-age"],10);isNaN(s)?delete e["max-age"]:e["max-age"]=s}return e},u.ab=function(n,e){const s=[];for(const a in n)a in e||s.push(a);return s},u.ac=function(n){if(Ne==null){const e=n.navigator?n.navigator.userAgent:null;Ne=!!n.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Ne},u.ad=He,u.ae=function(n,e,s){var a=Math.sin(s),h=Math.cos(s),m=e[0],y=e[1],v=e[2],S=e[3],k=e[4],C=e[5],z=e[6],D=e[7];return e!==n&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=m*h+k*a,n[1]=y*h+C*a,n[2]=v*h+z*a,n[3]=S*h+D*a,n[4]=k*h-m*a,n[5]=C*h-y*a,n[6]=z*h-v*a,n[7]=D*h-S*a,n},u.af=function(n){var e=new sl(16);return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],e},u.ag=Fh,u.ah=function(n,e){let s=0,a=0;if(n.kind==="constant")a=n.layoutSize;else if(n.kind!=="source"){const{interpolationType:h,minZoom:m,maxZoom:y}=n,v=h?He(An.interpolationFactor(h,e,m,y),0,1):0;n.kind==="camera"?a=zn.number(n.minSize,n.maxSize,v):s=v}return{uSizeT:s,uSize:a}},u.aj=function(n,{uSize:e,uSizeT:s},{lowerSize:a,upperSize:h}){return n.kind==="source"?a/gs:n.kind==="composite"?zn.number(a/gs,h/gs,s):e},u.ak=lf,u.al=function(n,e,s,a){const h=e.y-n.y,m=e.x-n.x,y=a.y-s.y,v=a.x-s.x,S=y*m-v*h;if(S===0)return null;const k=(v*(n.y-s.y)-y*(n.x-s.x))/S;return new te(n.x+k*m,n.y+k*h)},u.am=l_,u.an=Xg,u.ao=Vp,u.ap=Mi,u.ar=af,u.as=function(n,e){var s=e[0],a=e[1],h=e[2],m=e[3],y=e[4],v=e[5],S=e[6],k=e[7],C=e[8],z=e[9],D=e[10],B=e[11],O=e[12],j=e[13],W=e[14],Y=e[15],ue=s*v-a*y,ee=s*S-h*y,he=s*k-m*y,fe=a*S-h*v,we=a*k-m*v,je=h*k-m*S,Ke=C*j-z*O,Ve=C*W-D*O,Be=C*Y-B*O,Me=z*W-D*j,qe=z*Y-B*j,Le=D*Y-B*W,Ce=ue*Le-ee*qe+he*Me+fe*Be-we*Ve+je*Ke;return Ce?(n[0]=(v*Le-S*qe+k*Me)*(Ce=1/Ce),n[1]=(h*qe-a*Le-m*Me)*Ce,n[2]=(j*je-W*we+Y*fe)*Ce,n[3]=(D*we-z*je-B*fe)*Ce,n[4]=(S*Be-y*Le-k*Ve)*Ce,n[5]=(s*Le-h*Be+m*Ve)*Ce,n[6]=(W*he-O*je-Y*ee)*Ce,n[7]=(C*je-D*he+B*ee)*Ce,n[8]=(y*qe-v*Be+k*Ke)*Ce,n[9]=(a*Be-s*qe-m*Ke)*Ce,n[10]=(O*we-j*he+Y*ue)*Ce,n[11]=(z*he-C*we-B*ue)*Ce,n[12]=(v*Ve-y*Me-S*Ke)*Ce,n[13]=(s*Me-a*Ve+h*Ke)*Ce,n[14]=(j*ee-O*fe-W*ue)*Ce,n[15]=(C*fe-z*ee+D*ue)*Ce,n):null},u.at=gf,u.au=of,u.av=yf,u.aw=function(){const n={},e=ye.$version;for(const s in ye.$root){const a=ye.$root[s];if(a.required){let h=null;h=s==="version"?e:a.type==="array"?[]:{},h!=null&&(n[s]=h)}}return n},u.ax=Ct,u.ay=bh,u.az=Pn,u.b=function(n,e){const s=new Blob([new Uint8Array(n)],{type:"image/png"});createImageBitmap(s).then(a=>{e(null,a)}).catch(a=>{e(new Error(`Could not load image because of ${a.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},u.b0=ji,u.b1=function(n,e){var s=n[0],a=n[1],h=n[2],m=n[3],y=n[4],v=n[5],S=n[6],k=n[7],C=n[8],z=n[9],D=n[10],B=n[11],O=n[12],j=n[13],W=n[14],Y=n[15],ue=e[0],ee=e[1],he=e[2],fe=e[3],we=e[4],je=e[5],Ke=e[6],Ve=e[7],Be=e[8],Me=e[9],qe=e[10],Le=e[11],Ce=e[12],nt=e[13],Qe=e[14],yt=e[15];return Math.abs(s-ue)<=xn*Math.max(1,Math.abs(s),Math.abs(ue))&&Math.abs(a-ee)<=xn*Math.max(1,Math.abs(a),Math.abs(ee))&&Math.abs(h-he)<=xn*Math.max(1,Math.abs(h),Math.abs(he))&&Math.abs(m-fe)<=xn*Math.max(1,Math.abs(m),Math.abs(fe))&&Math.abs(y-we)<=xn*Math.max(1,Math.abs(y),Math.abs(we))&&Math.abs(v-je)<=xn*Math.max(1,Math.abs(v),Math.abs(je))&&Math.abs(S-Ke)<=xn*Math.max(1,Math.abs(S),Math.abs(Ke))&&Math.abs(k-Ve)<=xn*Math.max(1,Math.abs(k),Math.abs(Ve))&&Math.abs(C-Be)<=xn*Math.max(1,Math.abs(C),Math.abs(Be))&&Math.abs(z-Me)<=xn*Math.max(1,Math.abs(z),Math.abs(Me))&&Math.abs(D-qe)<=xn*Math.max(1,Math.abs(D),Math.abs(qe))&&Math.abs(B-Le)<=xn*Math.max(1,Math.abs(B),Math.abs(Le))&&Math.abs(O-Ce)<=xn*Math.max(1,Math.abs(O),Math.abs(Ce))&&Math.abs(j-nt)<=xn*Math.max(1,Math.abs(j),Math.abs(nt))&&Math.abs(W-Qe)<=xn*Math.max(1,Math.abs(W),Math.abs(Qe))&&Math.abs(Y-yt)<=xn*Math.max(1,Math.abs(Y),Math.abs(yt))},u.b2=function(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},u.b3=function(n,e,s){return n[0]=e[0]*s[0],n[1]=e[1]*s[1],n[2]=e[2]*s[2],n[3]=e[3]*s[3],n},u.b4=function(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]*e[3]},u.b5=Je,u.b6=t_,u.b7=Qy,u.b8=function(n,e,s,a,h){var m,y=1/Math.tan(e/2);return n[0]=y/s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,h!=null&&h!==1/0?(n[10]=(h+a)*(m=1/(a-h)),n[14]=2*h*a*m):(n[10]=-1,n[14]=-2*a),n},u.b9=function(n,e,s){var a=Math.sin(s),h=Math.cos(s),m=e[4],y=e[5],v=e[6],S=e[7],k=e[8],C=e[9],z=e[10],D=e[11];return e!==n&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=m*h+k*a,n[5]=y*h+C*a,n[6]=v*h+z*a,n[7]=S*h+D*a,n[8]=k*h-m*a,n[9]=C*h-y*a,n[10]=z*h-v*a,n[11]=D*h-S*a,n},u.bA=ne,u.bB=Iy,u.bC=Ga,u.bD=Ln,u.ba=Se,u.bb=Oe,u.bc=function(n,e){return n[0]=e[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=e[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=e[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n},u.bd=class extends aa{},u.be=df,u.bf=Jy,u.bg=ab,u.bi=sr,u.bj=function(n,e,s=!1){if(_n===xu||_n===wu||_n===bu)throw new Error("setRTLTextPlugin cannot be called multiple times.");fs=Oi.resolveURL(n),_n=xu,Su=e,Tu(),s||Eh()},u.bk=ku,u.bl=function(n,e){const s={};for(let h=0;hCe*Mi)}let Ve=y?"center":s.get("text-justify").evaluate(k,{},n.canonical);const Be=s.get("symbol-placement"),Me=Be==="point"?s.get("text-max-width").evaluate(k,{},n.canonical)*Mi:0,qe=()=>{n.bucket.allowVerticalPlacement&&yu(he)&&(O.vertical=$h(j,n.glyphMap,n.glyphPositions,n.imagePositions,C,Me,m,je,"left",we,Y,u.ai.vertical,!0,Be,D,z))};if(!y&&Ke){const Le=new Set;if(Ve==="auto")for(let nt=0;nt{e(null,s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=ft})},s.onerror=()=>e(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."));const a=new Blob([new Uint8Array(n)],{type:"image/png"});s.src=n.byteLength?URL.createObjectURL(a):ft},u.e=$e,u.f=function(n,e){return or($e(n,{type:"json"}),e)},u.g=sn,u.h=Oi,u.i=Ii,u.j=as,u.k=os,u.l=qo,u.m=or,u.n=function(n){return new tf(n).readFields(Fw,[])},u.o=function(n,e,s){if(!n.length)return s(null,[]);let a=n.length;const h=new Array(n.length);let m=null;n.forEach((y,v)=>{e(y,(S,k)=>{S&&(m=S),h[v]=k,--a==0&&s(m,h)})})},u.p=Ry,u.q=Ou,u.r=gi,u.s=Fr,u.t=zp,u.u=Ue,u.v=ye,u.w=mi,u.x=Ja,u.y=$r,u.z=function([n,e,s]){return e+=90,e*=Math.PI/180,s*=Math.PI/180,{x:n*Math.cos(e)*Math.sin(s),y:n*Math.sin(e)*Math.sin(s),z:n*Math.cos(s)}}}),w(["./shared"],function(u){class N{constructor(A){this.keyCache={},A&&this.replace(A)}replace(A){this._layerConfigs={},this._layers={},this.update(A,[])}update(A,R){for(const H of A){this._layerConfigs[H.id]=H;const X=this._layers[H.id]=u.aC(H);X._featureFilter=u.a6(X.filter),this.keyCache[H.id]&&delete this.keyCache[H.id]}for(const H of R)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};const V=u.bl(Object.values(this._layerConfigs),this.keyCache);for(const H of V){const X=H.map(ve=>this._layers[ve.id]),ce=X[0];if(ce.visibility==="none")continue;const ie=ce.source||"";let Q=this.familiesBySource[ie];Q||(Q=this.familiesBySource[ie]={});const ae=ce.sourceLayer||"_geojsonTileLayer";let _e=Q[ae];_e||(_e=Q[ae]=[]),_e.push(X)}}}class L{constructor(A){const R={},V=[];for(const ie in A){const Q=A[ie],ae=R[ie]={};for(const _e in Q){const ve=Q[+_e];if(!ve||ve.bitmap.width===0||ve.bitmap.height===0)continue;const be={x:0,y:0,w:ve.bitmap.width+2,h:ve.bitmap.height+2};V.push(be),ae[_e]={rect:be,metrics:ve.metrics}}}const{w:H,h:X}=u.p(V),ce=new u.q({width:H||1,height:X||1});for(const ie in A){const Q=A[ie];for(const ae in Q){const _e=Q[+ae];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;const ve=R[ie][ae].rect;u.q.copy(_e.bitmap,ce,{x:0,y:0},{x:ve.x+1,y:ve.y+1},_e.bitmap)}}this.image=ce,this.positions=R}}u.bm("GlyphAtlas",L);class ne{constructor(A){this.tileID=new u.O(A.tileID.overscaledZ,A.tileID.wrap,A.tileID.canonical.z,A.tileID.canonical.x,A.tileID.canonical.y),this.uid=A.uid,this.zoom=A.zoom,this.pixelRatio=A.pixelRatio,this.tileSize=A.tileSize,this.source=A.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=A.showCollisionBoxes,this.collectResourceTiming=!!A.collectResourceTiming,this.returnDependencies=!!A.returnDependencies,this.promoteId=A.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(A,R,V,H,X){this.status="parsing",this.data=A,this.collisionBoxArray=new u.a3;const ce=new u.bn(Object.keys(A.layers).sort()),ie=new u.bo(this.tileID,this.promoteId);ie.bucketLayerIDs=[];const Q={},ae={featureIndex:ie,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:V},_e=R.familiesBySource[this.source];for(const Et in _e){const Tt=A.layers[Et];if(!Tt)continue;Tt.version===1&&u.w(`Vector tile source "${this.source}" layer "${Et}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Wi=ce.encode(Et),Zt=[];for(let bi=0;bi=Vi.maxzoom||Vi.visibility!=="none"&&(le(bi,this.zoom,V),(Q[Vi.id]=Vi.createBucket({index:ie.bucketLayerIDs.length,layers:bi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wi,sourceID:this.source})).populate(Zt,ae,this.tileID.canonical),ie.bucketLayerIDs.push(bi.map(Gn=>Gn.id)))}}let ve,be,it,lt;const We=u.aH(ae.glyphDependencies,Et=>Object.keys(Et).map(Number));this.inFlightDependencies.forEach(Et=>Et==null?void 0:Et.cancel()),this.inFlightDependencies=[];const rt=++this.dependencySentinel;Object.keys(We).length?this.inFlightDependencies.push(H.send("getGlyphs",{uid:this.uid,stacks:We,source:this.source,tileID:this.tileID,type:"glyphs"},(Et,Tt)=>{rt===this.dependencySentinel&&(ve||(ve=Et,be=Tt,Nt.call(this)))})):be={};const dt=Object.keys(ae.iconDependencies);dt.length?this.inFlightDependencies.push(H.send("getImages",{icons:dt,source:this.source,tileID:this.tileID,type:"icons"},(Et,Tt)=>{rt===this.dependencySentinel&&(ve||(ve=Et,it=Tt,Nt.call(this)))})):it={};const Dt=Object.keys(ae.patternDependencies);function Nt(){if(ve)return X(ve);if(be&&it&<){const Et=new L(be),Tt=new u.bp(it,lt);for(const Wi in Q){const Zt=Q[Wi];Zt instanceof u.a4?(le(Zt.layers,this.zoom,V),u.bq({bucket:Zt,glyphMap:be,glyphPositions:Et.positions,imageMap:it,imagePositions:Tt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Zt.hasPattern&&(Zt instanceof u.br||Zt instanceof u.bs||Zt instanceof u.bt)&&(le(Zt.layers,this.zoom,V),Zt.addFeatures(ae,this.tileID.canonical,Tt.patternPositions))}this.status="done",X(null,{buckets:Object.values(Q).filter(Wi=>!Wi.isEmpty()),featureIndex:ie,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Et.image,imageAtlas:Tt,glyphMap:this.returnDependencies?be:null,iconMap:this.returnDependencies?it:null,glyphPositions:this.returnDependencies?Et.positions:null})}}Dt.length?this.inFlightDependencies.push(H.send("getImages",{icons:Dt,source:this.source,tileID:this.tileID,type:"patterns"},(Et,Tt)=>{rt===this.dependencySentinel&&(ve||(ve=Et,lt=Tt,Nt.call(this)))})):lt={},Nt.call(this)}}function le(q,A,R){const V=new u.a8(A);for(const H of q)H.recalculate(V,R)}function te(q,A){const R=u.l(q.request,(V,H,X,ce)=>{if(V)A(V);else if(H)try{const ie=new u.bw.VectorTile(new u.bv(H));A(null,{vectorTile:ie,rawData:H,cacheControl:X,expires:ce})}catch(ie){const Q=new Uint8Array(H);let ae=`Unable to parse the tile at ${q.request.url}, `;ae+=Q[0]===31&&Q[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ie.messge}`,A(new Error(ae))}});return()=>{R.cancel(),A()}}class ke{constructor(A,R,V,H){this.actor=A,this.layerIndex=R,this.availableImages=V,this.loadVectorData=H||te,this.fetching={},this.loading={},this.loaded={}}loadTile(A,R){const V=A.uid;this.loading||(this.loading={});const H=!!(A&&A.request&&A.request.collectResourceTiming)&&new u.bu(A.request),X=this.loading[V]=new ne(A);X.abort=this.loadVectorData(A,(ce,ie)=>{if(delete this.loading[V],ce||!ie)return X.status="done",this.loaded[V]=X,R(ce);const Q=ie.rawData,ae={};ie.expires&&(ae.expires=ie.expires),ie.cacheControl&&(ae.cacheControl=ie.cacheControl);const _e={};if(H){const ve=H.finish();ve&&(_e.resourceTiming=JSON.parse(JSON.stringify(ve)))}X.vectorTile=ie.vectorTile,X.parse(ie.vectorTile,this.layerIndex,this.availableImages,this.actor,(ve,be)=>{if(delete this.fetching[V],ve||!be)return R(ve);R(null,u.e({rawTileData:Q.slice(0)},be,ae,_e))}),this.loaded=this.loaded||{},this.loaded[V]=X,this.fetching[V]={rawTileData:Q,cacheControl:ae,resourceTiming:_e}})}reloadTile(A,R){const V=this.loaded,H=A.uid;if(V&&V[H]){const X=V[H];X.showCollisionBoxes=A.showCollisionBoxes,X.status==="parsing"?X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor,(ce,ie)=>{if(ce||!ie)return R(ce,ie);let Q;if(this.fetching[H]){const{rawTileData:ae,cacheControl:_e,resourceTiming:ve}=this.fetching[H];delete this.fetching[H],Q=u.e({rawTileData:ae.slice(0)},ie,_e,ve)}else Q=ie;R(null,Q)}):X.status==="done"&&(X.vectorTile?X.parse(X.vectorTile,this.layerIndex,this.availableImages,this.actor,R):R())}}abortTile(A,R){const V=this.loading,H=A.uid;V&&V[H]&&V[H].abort&&(V[H].abort(),delete V[H]),R()}removeTile(A,R){const V=this.loaded,H=A.uid;V&&V[H]&&delete V[H],R()}}class Ie{constructor(){this.loaded={}}loadTile(A,R){return u._(this,void 0,void 0,function*(){const{uid:V,encoding:H,rawImageData:X,redFactor:ce,greenFactor:ie,blueFactor:Q,baseShift:ae}=A,_e=X.width+2,ve=X.height+2,be=u.a(X)?new u.R({width:_e,height:ve},yield u.bx(X,-1,-1,_e,ve)):X,it=new u.by(V,be,H,ce,ie,Q,ae);this.loaded=this.loaded||{},this.loaded[V]=it,R(null,it)})}removeTile(A){const R=this.loaded,V=A.uid;R&&R[V]&&delete R[V]}}function De(q,A){if(q.length!==0){ut(q[0],A);for(var R=1;R=Math.abs(ie)?R-Q+ie:ie-Q+R,R=Q}R+V>=0!=!!A&&q.reverse()}var se=u.bz(function q(A,R){var V,H=A&&A.type;if(H==="FeatureCollection")for(V=0;V>31}function Ii(q,A){for(var R=q.loadGeometry(),V=q.type,H=0,X=0,ce=R.length,ie=0;ieq},Lt=Math.fround||(kt=new Float32Array(1),q=>(kt[0]=+q,kt[0]));var kt;const It=3,jt=5,nn=6;class Oi{constructor(A){this.options=Object.assign(Object.create(ft),A),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(A){const{log:R,minZoom:V,maxZoom:H}=this.options;R&&console.time("total time");const X=`prepare ${A.length} points`;R&&console.time(X),this.points=A;const ce=[];for(let Q=0;Q=V;Q--){const ae=+Date.now();ie=this.trees[Q]=this._createTree(this._cluster(ie,Q)),R&&console.log("z%d: %d clusters in %dms",Q,ie.numItems,+Date.now()-ae)}return R&&console.timeEnd("total time"),this}getClusters(A,R){let V=((A[0]+180)%360+360)%360-180;const H=Math.max(-90,Math.min(90,A[1]));let X=A[2]===180?180:((A[2]+180)%360+360)%360-180;const ce=Math.max(-90,Math.min(90,A[3]));if(A[2]-A[0]>=360)V=-180,X=180;else if(V>X){const ve=this.getClusters([V,H,180,ce],R),be=this.getClusters([-180,H,X,ce],R);return ve.concat(be)}const ie=this.trees[this._limitZoom(R)],Q=ie.range(Pn(V),sn(ce),Pn(X),sn(H)),ae=ie.data,_e=[];for(const ve of Q){const be=this.stride*ve;_e.push(ae[be+jt]>1?rn(ae,be,this.clusterProps):this.points[ae[be+It]])}return _e}getChildren(A){const R=this._getOriginId(A),V=this._getOriginZoom(A),H="No cluster with the specified id.",X=this.trees[V];if(!X)throw new Error(H);const ce=X.data;if(R*this.stride>=ce.length)throw new Error(H);const ie=this.options.radius/(this.options.extent*Math.pow(2,V-1)),Q=X.within(ce[R*this.stride],ce[R*this.stride+1],ie),ae=[];for(const _e of Q){const ve=_e*this.stride;ce[ve+4]===A&&ae.push(ce[ve+jt]>1?rn(ce,ve,this.clusterProps):this.points[ce[ve+It]])}if(ae.length===0)throw new Error(H);return ae}getLeaves(A,R,V){const H=[];return this._appendLeaves(H,A,R=R||10,V=V||0,0),H}getTile(A,R,V){const H=this.trees[this._limitZoom(A)],X=Math.pow(2,A),{extent:ce,radius:ie}=this.options,Q=ie/ce,ae=(V-Q)/X,_e=(V+1+Q)/X,ve={features:[]};return this._addTileFeatures(H.range((R-Q)/X,ae,(R+1+Q)/X,_e),H.data,R,V,X,ve),R===0&&this._addTileFeatures(H.range(1-Q/X,ae,1,_e),H.data,X,V,X,ve),R===X-1&&this._addTileFeatures(H.range(0,ae,Q/X,_e),H.data,-1,V,X,ve),ve.features.length?ve:null}getClusterExpansionZoom(A){let R=this._getOriginZoom(A)-1;for(;R<=this.options.maxZoom;){const V=this.getChildren(A);if(R++,V.length!==1)break;A=V[0].properties.cluster_id}return R}_appendLeaves(A,R,V,H,X){const ce=this.getChildren(R);for(const ie of ce){const Q=ie.properties;if(Q&&Q.cluster?X+Q.point_count<=H?X+=Q.point_count:X=this._appendLeaves(A,Q.cluster_id,V,H,X):X1;let _e,ve,be;if(ae)_e=sr(R,Q,this.clusterProps),ve=R[Q],be=R[Q+1];else{const We=this.points[R[Q+It]];_e=We.properties;const[rt,dt]=We.geometry.coordinates;ve=Pn(rt),be=sn(dt)}const it={type:1,geometry:[[Math.round(this.options.extent*(ve*X-V)),Math.round(this.options.extent*(be*X-H))]],tags:_e};let lt;lt=ae||this.options.generateId?R[Q+It]:this.points[R[Q+It]].id,lt!==void 0&&(it.id=lt),ce.features.push(it)}}_limitZoom(A){return Math.max(this.options.minZoom,Math.min(Math.floor(+A),this.options.maxZoom+1))}_cluster(A,R){const{radius:V,extent:H,reduce:X,minPoints:ce}=this.options,ie=V/(H*Math.pow(2,R)),Q=A.data,ae=[],_e=this.stride;for(let ve=0;veR&&(rt+=Q[Dt+jt])}if(rt>We&&rt>=ce){let dt,Dt=be*We,Nt=it*We,Et=-1;const Tt=((ve/_e|0)<<5)+(R+1)+this.points.length;for(const Wi of lt){const Zt=Wi*_e;if(Q[Zt+2]<=R)continue;Q[Zt+2]=R;const bi=Q[Zt+jt];Dt+=Q[Zt]*bi,Nt+=Q[Zt+1]*bi,Q[Zt+4]=Tt,X&&(dt||(dt=this._map(Q,ve,!0),Et=this.clusterProps.length,this.clusterProps.push(dt)),X(dt,this._map(Q,Zt)))}Q[ve+4]=Tt,ae.push(Dt/rt,Nt/rt,1/0,Tt,-1,rt),X&&ae.push(Et)}else{for(let dt=0;dt<_e;dt++)ae.push(Q[ve+dt]);if(rt>1)for(const dt of lt){const Dt=dt*_e;if(!(Q[Dt+2]<=R)){Q[Dt+2]=R;for(let Nt=0;Nt<_e;Nt++)ae.push(Q[Dt+Nt])}}}}return ae}_getOriginId(A){return A-this.points.length>>5}_getOriginZoom(A){return(A-this.points.length)%32}_map(A,R,V){if(A[R+jt]>1){const ce=this.clusterProps[A[R+nn]];return V?Object.assign({},ce):ce}const H=this.points[A[R+It]].properties,X=this.options.map(H);return V&&X===H?Object.assign({},X):X}}function rn(q,A,R){return{type:"Feature",id:q[A+It],properties:sr(q,A,R),geometry:{type:"Point",coordinates:[(V=q[A],360*(V-.5)),ss(q[A+1])]}};var V}function sr(q,A,R){const V=q[A+jt],H=V>=1e4?`${Math.round(V/1e3)}k`:V>=1e3?Math.round(V/100)/10+"k":V,X=q[A+nn],ce=X===-1?{}:Object.assign({},R[X]);return Object.assign(ce,{cluster:!0,cluster_id:q[A+It],point_count:V,point_count_abbreviated:H})}function Pn(q){return q/360+.5}function sn(q){const A=Math.sin(q*Math.PI/180),R=.5-.25*Math.log((1+A)/(1-A))/Math.PI;return R<0?0:R>1?1:R}function ss(q){const A=(180-360*q)*Math.PI/180;return 360*Math.atan(Math.exp(A))/Math.PI-90}function or(q,A,R,V){for(var H,X=V,ce=R-A>>1,ie=R-A,Q=q[A],ae=q[A+1],_e=q[R],ve=q[R+1],be=A+3;beX)H=be,X=it;else if(it===X){var lt=Math.abs(be-ce);ltV&&(H-A>3&&or(q,A,H,V),q[H+2]=X,R-H>3&&or(q,H,R,V))}function qo(q,A,R,V,H,X){var ce=H-R,ie=X-V;if(ce!==0||ie!==0){var Q=((q-R)*ce+(A-V)*ie)/(ce*ce+ie*ie);Q>1?(R=H,V=X):Q>0&&(R+=ce*Q,V+=ie*Q)}return(ce=q-R)*ce+(ie=A-V)*ie}function Fr(q,A,R,V){var H={id:q===void 0?null:q,type:A,geometry:R,tags:V,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(X){var ce=X.geometry,ie=X.type;if(ie==="Point"||ie==="MultiPoint"||ie==="LineString")to(X,ce);else if(ie==="Polygon"||ie==="MultiLineString")for(var Q=0;Q0&&(ce+=V?(H*ae-Q*X)/2:Math.sqrt(Math.pow(Q-H,2)+Math.pow(ae-X,2))),H=Q,X=ae}var _e=A.length-3;A[2]=1,or(A,0,_e,R),A[_e+2]=1,A.size=Math.abs(ce),A.start=0,A.end=A.size}function Ts(q,A,R,V){for(var H=0;H1?1:R}function qn(q,A,R,V,H,X,ce,ie){if(V/=A,X>=(R/=A)&&ce=V)return null;for(var Q=[],ae=0;ae=R&<=V)){var We=[];if(be==="Point"||be==="MultiPoint")$t(ve,We,R,V,H);else if(be==="LineString")Ct(ve,We,R,V,H,!1,ie.lineMetrics);else if(be==="MultiLineString")io(ve,We,R,V,H,!1);else if(be==="Polygon")io(ve,We,R,V,H,!0);else if(be==="MultiPolygon")for(var rt=0;rt=R&&ce<=V&&(A.push(q[X]),A.push(q[X+1]),A.push(q[X+2]))}}function Ct(q,A,R,V,H,X,ce){for(var ie,Q,ae=vr(q),_e=H===0?Ca:no,ve=q.start,be=0;beR&&(Q=_e(ae,it,lt,rt,dt,R),ce&&(ae.start=ve+ie*Q)):Dt>V?Nt=R&&(Q=_e(ae,it,lt,rt,dt,R),Et=!0),Nt>V&&Dt<=V&&(Q=_e(ae,it,lt,rt,dt,V),Et=!0),!X&&Et&&(ce&&(ae.end=ve+ie*Q),A.push(ae),ae=vr(q)),ce&&(ve+=ie)}var Tt=q.length-3;it=q[Tt],lt=q[Tt+1],We=q[Tt+2],(Dt=H===0?it:lt)>=R&&Dt<=V&&Br(ae,it,lt,We),Tt=ae.length-3,X&&Tt>=3&&(ae[Tt]!==ae[0]||ae[Tt+1]!==ae[1])&&Br(ae,ae[0],ae[1],ae[2]),ae.length&&A.push(ae)}function vr(q){var A=[];return A.size=q.size,A.start=q.start,A.end=q.end,A}function io(q,A,R,V,H,X){for(var ce=0;cece.maxX&&(ce.maxX=_e),ve>ce.maxY&&(ce.maxY=ve)}return ce}function Es(q,A,R,V){var H=A.geometry,X=A.type,ce=[];if(X==="Point"||X==="MultiPoint")for(var ie=0;ie0&&A.size<(H?ce:V))R.numPoints+=A.length/3;else{for(var ie=[],Q=0;Qce)&&(R.numSimplified++,ie.push(A[Q]),ie.push(A[Q+1])),R.numPoints++;H&&function(ae,_e){for(var ve=0,be=0,it=ae.length,lt=it-2;be0===_e)for(be=0,it=ae.length;be24)throw new Error("maxZoom should be in the 0-24 range");if(A.promoteId&&A.generateId)throw new Error("promoteId and generateId cannot be used together.");var V=function(H,X){var ce=[];if(H.type==="FeatureCollection")for(var ie=0;ie1&&console.time("creation"),be=this.tiles[ve]=ni(q,A,R,V,Q),this.tileCoords.push({z:A,x:R,y:V}),ae)){ae>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",A,R,V,be.numFeatures,be.numPoints,be.numSimplified),console.timeEnd("creation"));var it="z"+A;this.stats[it]=(this.stats[it]||0)+1,this.total++}if(be.source=q,H){if(A===Q.maxZoom||A===H)continue;var lt=1<1&&console.time("clipping");var We,rt,dt,Dt,Nt,Et,Tt=.5*Q.buffer/Q.extent,Wi=.5-Tt,Zt=.5+Tt,bi=1+Tt;We=rt=dt=Dt=null,Nt=qn(q,_e,R-Tt,R+Zt,0,be.minX,be.maxX,Q),Et=qn(q,_e,R+Wi,R+bi,0,be.minX,be.maxX,Q),q=null,Nt&&(We=qn(Nt,_e,V-Tt,V+Zt,1,be.minY,be.maxY,Q),rt=qn(Nt,_e,V+Wi,V+bi,1,be.minY,be.maxY,Q),Nt=null),Et&&(dt=qn(Et,_e,V-Tt,V+Zt,1,be.minY,be.maxY,Q),Dt=qn(Et,_e,V+Wi,V+bi,1,be.minY,be.maxY,Q),Et=null),ae>1&&console.timeEnd("clipping"),ie.push(We||[],A+1,2*R,2*V),ie.push(rt||[],A+1,2*R,2*V+1),ie.push(dt||[],A+1,2*R+1,2*V),ie.push(Dt||[],A+1,2*R+1,2*V+1)}}},Re.prototype.getTile=function(q,A,R){var V=this.options,H=V.extent,X=V.debug;if(q<0||q>24)return null;var ce=1<1&&console.log("drilling down to z%d-%d-%d",q,A,R);for(var Q,ae=q,_e=A,ve=R;!Q&&ae>0;)ae--,_e=Math.floor(_e/2),ve=Math.floor(ve/2),Q=this.tiles[gt(ae,_e,ve)];return Q&&Q.source?(X>1&&console.log("found parent tile z%d-%d-%d",ae,_e,ve),X>1&&console.time("drilling down"),this.splitTile(Q.source,ae,_e,ve,q,A,R),X>1&&console.timeEnd("drilling down"),this.tiles[ie]?ze(this.tiles[ie],H):null):null};class pt extends ke{constructor(A,R,V,H){super(A,R,V),this._dataUpdateable=new Map,this.loadGeoJSON=(X,ce)=>{const{promoteId:ie}=X;if(X.request)return u.f(X.request,(Q,ae,_e,ve)=>{this._dataUpdateable=on(ae,ie)?wr(ae,ie):void 0,ce(Q,ae,_e,ve)});if(typeof X.data=="string")try{const Q=JSON.parse(X.data);this._dataUpdateable=on(Q,ie)?wr(Q,ie):void 0,ce(null,Q)}catch{ce(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`))}else X.dataDiff?this._dataUpdateable?(function(Q,ae,_e){var ve,be,it,lt;if(ae.removeAll&&Q.clear(),ae.remove)for(const We of ae.remove)Q.delete(We);if(ae.add)for(const We of ae.add){const rt=ht(We,_e);rt!=null&&Q.set(rt,We)}if(ae.update)for(const We of ae.update){let rt=Q.get(We.id);if(rt==null)continue;const dt=!We.removeAllProperties&&(((ve=We.removeProperties)===null||ve===void 0?void 0:ve.length)>0||((be=We.addOrUpdateProperties)===null||be===void 0?void 0:be.length)>0);if((We.newGeometry||We.removeAllProperties||dt)&&(rt=Object.assign({},rt),Q.set(We.id,rt),dt&&(rt.properties=Object.assign({},rt.properties))),We.newGeometry&&(rt.geometry=We.newGeometry),We.removeAllProperties)rt.properties={};else if(((it=We.removeProperties)===null||it===void 0?void 0:it.length)>0)for(const Dt of We.removeProperties)Object.prototype.hasOwnProperty.call(rt.properties,Dt)&&delete rt.properties[Dt];if(((lt=We.addOrUpdateProperties)===null||lt===void 0?void 0:lt.length)>0)for(const{key:Dt,value:Nt}of We.addOrUpdateProperties)rt.properties[Dt]=Nt}}(this._dataUpdateable,X.dataDiff,ie),ce(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ce(new Error(`Cannot update existing geojson data in ${X.source}`)):ce(new Error(`Input data given to '${X.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,H&&(this.loadGeoJSON=H)}loadGeoJSONTile(A,R){const V=A.tileID.canonical;if(!this._geoJSONIndex)return R(null,null);const H=this._geoJSONIndex.getTile(V.z,V.x,V.y);if(!H)return R(null,null);const X=new class{constructor(ie){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u.N,this.length=ie.length,this._features=ie}feature(ie){return new class{constructor(Q){this._feature=Q,this.extent=u.N,this.type=Q.type,this.properties=Q.tags,"id"in Q&&!isNaN(Q.id)&&(this.id=parseInt(Q.id,10))}loadGeometry(){if(this._feature.type===1){const Q=[];for(const ae of this._feature.geometry)Q.push([new u.P(ae[0],ae[1])]);return Q}{const Q=[];for(const ae of this._feature.geometry){const _e=[];for(const ve of ae)_e.push(new u.P(ve[0],ve[1]));Q.push(_e)}return Q}}toGeoJSON(Q,ae,_e){return J.call(this,Q,ae,_e)}}(this._features[ie])}}(H.features);let ce=ct(X);ce.byteOffset===0&&ce.byteLength===ce.buffer.byteLength||(ce=new Uint8Array(ce)),R(null,{vectorTile:X,rawData:ce.buffer})}loadData(A,R){var V;(V=this._pendingRequest)===null||V===void 0||V.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const H=!!(A&&A.request&&A.request.collectResourceTiming)&&new u.bu(A.request);this._pendingCallback=R,this._pendingRequest=this.loadGeoJSON(A,(X,ce)=>{if(delete this._pendingCallback,delete this._pendingRequest,X||!ce)return R(X);if(typeof ce!="object")return R(new Error(`Input data given to '${A.source}' is not a valid GeoJSON object.`));{se(ce,!0);try{if(A.filter){const Q=u.bC(A.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Q.result==="error")throw new Error(Q.value.map(_e=>`${_e.key}: ${_e.message}`).join(", "));ce={type:"FeatureCollection",features:ce.features.filter(_e=>Q.value.evaluate({zoom:0},_e))}}this._geoJSONIndex=A.cluster?new Oi(function({superclusterOptions:Q,clusterProperties:ae}){if(!ae||!Q)return Q;const _e={},ve={},be={accumulated:null,zoom:0},it={properties:null},lt=Object.keys(ae);for(const We of lt){const[rt,dt]=ae[We],Dt=u.bC(dt),Nt=u.bC(typeof rt=="string"?[rt,["accumulated"],["get",We]]:rt);_e[We]=Dt.value,ve[We]=Nt.value}return Q.map=We=>{it.properties=We;const rt={};for(const dt of lt)rt[dt]=_e[dt].evaluate(be,it);return rt},Q.reduce=(We,rt)=>{it.properties=rt;for(const dt of lt)be.accumulated=We[dt],We[dt]=ve[dt].evaluate(be,it)},Q}(A)).load(ce.features):function(Q,ae){return new Re(Q,ae)}(ce,A.geojsonVtOptions)}catch(Q){return R(Q)}this.loaded={};const ie={};if(H){const Q=H.finish();Q&&(ie.resourceTiming={},ie.resourceTiming[A.source]=JSON.parse(JSON.stringify(Q)))}R(null,ie)}})}reloadTile(A,R){const V=this.loaded;return V&&V[A.uid]?super.reloadTile(A,R):this.loadTile(A,R)}removeSource(A,R){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),R()}getClusterExpansionZoom(A,R){try{R(null,this._geoJSONIndex.getClusterExpansionZoom(A.clusterId))}catch(V){R(V)}}getClusterChildren(A,R){try{R(null,this._geoJSONIndex.getChildren(A.clusterId))}catch(V){R(V)}}getClusterLeaves(A,R){try{R(null,this._geoJSONIndex.getLeaves(A.clusterId,A.limit,A.offset))}catch(V){R(V)}}}class Nr{constructor(A){this.self=A,this.actor=new u.C(A,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:ke,geojson:pt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(R,V)=>{if(this.workerSourceTypes[R])throw new Error(`Worker source with name "${R}" already registered.`);this.workerSourceTypes[R]=V},this.self.registerRTLTextPlugin=R=>{if(u.bD.isParsed())throw new Error("RTL text plugin already registered.");u.bD.applyArabicShaping=R.applyArabicShaping,u.bD.processBidirectionalText=R.processBidirectionalText,u.bD.processStyledBidirectionalText=R.processStyledBidirectionalText}}setReferrer(A,R){this.referrer=R}setImages(A,R,V){this.availableImages[A]=R;for(const H in this.workerSources[A]){const X=this.workerSources[A][H];for(const ce in X)X[ce].availableImages=R}V()}setLayers(A,R,V){this.getLayerIndex(A).replace(R),V()}updateLayers(A,R,V){this.getLayerIndex(A).update(R.layers,R.removedIds),V()}loadTile(A,R,V){this.getWorkerSource(A,R.type,R.source).loadTile(R,V)}loadDEMTile(A,R,V){this.getDEMWorkerSource(A,R.source).loadTile(R,V)}reloadTile(A,R,V){this.getWorkerSource(A,R.type,R.source).reloadTile(R,V)}abortTile(A,R,V){this.getWorkerSource(A,R.type,R.source).abortTile(R,V)}removeTile(A,R,V){this.getWorkerSource(A,R.type,R.source).removeTile(R,V)}removeDEMTile(A,R){this.getDEMWorkerSource(A,R.source).removeTile(R)}removeSource(A,R,V){if(!this.workerSources[A]||!this.workerSources[A][R.type]||!this.workerSources[A][R.type][R.source])return;const H=this.workerSources[A][R.type][R.source];delete this.workerSources[A][R.type][R.source],H.removeSource!==void 0?H.removeSource(R,V):V()}loadWorkerSource(A,R,V){try{this.self.importScripts(R.url),V()}catch(H){V(H.toString())}}syncRTLPluginState(A,R,V){try{u.bD.setState(R);const H=u.bD.getPluginURL();if(u.bD.isLoaded()&&!u.bD.isParsed()&&H!=null){this.self.importScripts(H);const X=u.bD.isParsed();V(X?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),X)}}catch(H){V(H.toString())}}getAvailableImages(A){let R=this.availableImages[A];return R||(R=[]),R}getLayerIndex(A){let R=this.layerIndexes[A];return R||(R=this.layerIndexes[A]=new N),R}getWorkerSource(A,R,V){return this.workerSources[A]||(this.workerSources[A]={}),this.workerSources[A][R]||(this.workerSources[A][R]={}),this.workerSources[A][R][V]||(this.workerSources[A][R][V]=new this.workerSourceTypes[R]({send:(H,X,ce)=>{this.actor.send(H,X,ce,A)}},this.getLayerIndex(A),this.getAvailableImages(A))),this.workerSources[A][R][V]}getDEMWorkerSource(A,R){return this.demWorkerSources[A]||(this.demWorkerSources[A]={}),this.demWorkerSources[A][R]||(this.demWorkerSources[A][R]=new Ie),this.demWorkerSources[A][R]}}return u.i()&&(self.worker=new Nr(self)),Nr}),w(["./shared"],function(u){var N="3.6.2";class L{static testProp(t){if(!L.docStyle)return t[0];for(let o=0;o{window.removeEventListener("click",L.suppressClickInternal,!0)},0)}static mousePos(t,o){const c=t.getBoundingClientRect();return new u.P(o.clientX-c.left-t.clientLeft,o.clientY-c.top-t.clientTop)}static touchPos(t,o){const c=t.getBoundingClientRect(),d=[];for(let g=0;g{t=[],o=0,c=0,d={}},f.addThrottleControl=E=>{const P=c++;return d[P]=E,P},f.removeThrottleControl=E=>{delete d[E],b()},f.getImage=(E,P,M=!0)=>{ne.supported&&(E.headers||(E.headers={}),E.headers.accept="image/webp,*/*");const F={requestParameters:E,supportImageRefresh:M,callback:P,cancelled:!1,completed:!1,cancel:()=>{F.completed||F.cancelled||(F.cancelled=!0,F.innerRequest&&(F.innerRequest.cancel(),o--),b())}};return t.push(F),b(),F};const g=E=>{const{requestParameters:P,supportImageRefresh:M,callback:F}=E;return u.e(P,{type:"image"}),(M!==!1||u.i()||u.g(P.url)||P.headers&&!Object.keys(P.headers).reduce((Z,$)=>Z&&$==="accept",!0)?u.m:T)(P,(Z,$,G,U)=>{x(E,F,Z,$,G,U)})},x=(E,P,M,F,Z,$)=>{M?P(M):F instanceof HTMLImageElement||u.a(F)?P(null,F):F&&((G,U)=>{typeof createImageBitmap=="function"?u.b(G,U):u.d(G,U)})(F,(G,U)=>{G!=null?P(G):U!=null&&P(null,U,{cacheControl:Z,expires:$})}),E.cancelled||(E.completed=!0,o--,b())},b=()=>{const E=(()=>{const P=Object.keys(d);let M=!1;if(P.length>0){for(const F of P)if(M=d[F](),M)break}return M})()?u.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:u.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let P=o;P0;P++){const M=t.shift();if(M.cancelled){P--;continue}const F=g(M);o++,M.innerRequest=F}},T=(E,P)=>{const M=new Image,F=E.url;let Z=!1;const $=E.credentials;return $&&$==="include"?M.crossOrigin="use-credentials":($&&$==="same-origin"||!u.s(F))&&(M.crossOrigin="anonymous"),M.fetchPriority="high",M.onload=()=>{P(null,M),M.onerror=M.onload=null},M.onerror=()=>{Z||P(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.")),M.onerror=M.onload=null},M.src=F,{cancel:()=>{Z=!0,M.src=""}}}}(ut||(ut={})),ut.resetRequestQueue(),function(f){f.Glyphs="Glyphs",f.Image="Image",f.Source="Source",f.SpriteImage="SpriteImage",f.SpriteJSON="SpriteJSON",f.Style="Style",f.Tile="Tile",f.Unknown="Unknown"}(se||(se={}));class J{constructor(t){this._transformRequestFn=t}transformRequest(t,o){return this._transformRequestFn&&this._transformRequestFn(t,o)||{url:t}}normalizeSpriteURL(t,o,c){const d=function(g){const x=g.match(de);if(!x)throw new Error(`Unable to parse URL "${g}"`);return{protocol:x[1],authority:x[2],path:x[3]||"/",params:x[4]?x[4].split("&"):[]}}(t);return d.path+=`${o}${c}`,function(g){const x=g.params.length?`?${g.params.join("&")}`:"";return`${g.protocol}://${g.authority}${g.path}${x}`}(d)}setTransformRequest(t){this._transformRequestFn=t}}const de=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Se(f){var t=new u.A(3);return t[0]=f[0],t[1]=f[1],t[2]=f[2],t}var Oe,He=function(f,t,o){return f[0]=t[0]-o[0],f[1]=t[1]-o[1],f[2]=t[2]-o[2],f};Oe=new u.A(3),u.A!=Float32Array&&(Oe[0]=0,Oe[1]=0,Oe[2]=0);var Je=function(f){var t=f[0],o=f[1];return t*t+o*o};function $e(f){const t=[];if(typeof f=="string")t.push({id:"default",url:f});else if(f&&f.length>0){const o=[];for(const{id:c,url:d}of f){const g=`${c}${d}`;o.indexOf(g)===-1&&(o.push(g),t.push({id:c,url:d}))}}return t}function Ft(f,t,o,c,d){if(c)return void f(c);if(d!==Object.values(t).length||d!==Object.values(o).length)return;const g={};for(const x in t){g[x]={};const b=u.h.getImageCanvasContext(o[x]),T=t[x];for(const E in T){const{width:P,height:M,x:F,y:Z,sdf:$,pixelRatio:G,stretchX:U,stretchY:re,content:pe}=T[E];g[x][E]={data:null,pixelRatio:G,sdf:$,stretchX:U,stretchY:re,content:pe,spriteData:{width:P,height:M,x:F,y:Z,context:b}}}}f(null,g)}(function(){var f=new u.A(2);u.A!=Float32Array&&(f[0]=0,f[1]=0)})();class Ge{constructor(t,o,c,d){this.context=t,this.format=c,this.texture=t.gl.createTexture(),this.update(o,d)}update(t,o,c){const{width:d,height:g}=t,x=!(this.size&&this.size[0]===d&&this.size[1]===g||c),{context:b}=this,{gl:T}=b;if(this.useMipmap=!!(o&&o.useMipmap),T.bindTexture(T.TEXTURE_2D,this.texture),b.pixelStoreUnpackFlipY.set(!1),b.pixelStoreUnpack.set(1),b.pixelStoreUnpackPremultiplyAlpha.set(this.format===T.RGBA&&(!o||o.premultiply!==!1)),x)this.size=[d,g],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||u.a(t)?T.texImage2D(T.TEXTURE_2D,0,this.format,this.format,T.UNSIGNED_BYTE,t):T.texImage2D(T.TEXTURE_2D,0,this.format,d,g,0,this.format,T.UNSIGNED_BYTE,t.data);else{const{x:E,y:P}=c||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||u.a(t)?T.texSubImage2D(T.TEXTURE_2D,0,E,P,T.RGBA,T.UNSIGNED_BYTE,t):T.texSubImage2D(T.TEXTURE_2D,0,E,P,d,g,T.RGBA,T.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&T.generateMipmap(T.TEXTURE_2D)}bind(t,o,c){const{context:d}=this,{gl:g}=d;g.bindTexture(g.TEXTURE_2D,this.texture),c!==g.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(c=g.LINEAR),t!==this.filter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,t),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,c||t),this.filter=t),o!==this.wrap&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,o),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,o),this.wrap=o)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function fi(f){const{userImage:t}=f;return!!(t&&t.render&&t.render())&&(f.data.replace(new Uint8Array(t.data.buffer)),!0)}class Ei extends u.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new u.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:o,callback:c}of this.requestors)this._notify(o,c);this.requestors=[]}}getImage(t){const o=this.images[t];if(o&&!o.data&&o.spriteData){const c=o.spriteData;o.data=new u.R({width:c.width,height:c.height},c.context.getImageData(c.x,c.y,c.width,c.height).data),o.spriteData=null}return o}addImage(t,o){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,o)&&(this.images[t]=o)}_validate(t,o){let c=!0;const d=o.data||o.spriteData;return this._validateStretch(o.stretchX,d&&d.width)||(this.fire(new u.j(new Error(`Image "${t}" has invalid "stretchX" value`))),c=!1),this._validateStretch(o.stretchY,d&&d.height)||(this.fire(new u.j(new Error(`Image "${t}" has invalid "stretchY" value`))),c=!1),this._validateContent(o.content,o)||(this.fire(new u.j(new Error(`Image "${t}" has invalid "content" value`))),c=!1),c}_validateStretch(t,o){if(!t)return!0;let c=0;for(const d of t){if(d[0]-1);T++,g[T]=b,x[T]=E,x[T+1]=Hi}for(let b=0,T=0;b{let b=this.entries[d];b||(b=this.entries[d]={glyphs:{},requests:{},ranges:{}});let T=b.glyphs[g];if(T!==void 0)return void x(null,{stack:d,id:g,glyph:T});if(T=this._tinySDF(b,d,g),T)return b.glyphs[g]=T,void x(null,{stack:d,id:g,glyph:T});const E=Math.floor(g/256);if(256*E>65535)return void x(new Error("glyphs > 65535 not supported"));if(b.ranges[E])return void x(null,{stack:d,id:g,glyph:T});if(!this.url)return void x(new Error("glyphsUrl is not set"));let P=b.requests[E];P||(P=b.requests[E]=[],Bi.loadGlyphRange(d,E,this.url,this.requestManager,(M,F)=>{if(F){for(const Z in F)this._doesCharSupportLocalGlyph(+Z)||(b.glyphs[+Z]=F[+Z]);b.ranges[E]=!0}for(const Z of P)Z(M,F);delete b.requests[E]})),P.push((M,F)=>{M?x(M):F&&x(null,{stack:d,id:g,glyph:F[g]||null})})},(d,g)=>{if(d)o(d);else if(g){const x={};for(const{stack:b,id:T,glyph:E}of g)(x[b]||(x[b]={}))[T]=E&&{id:E.id,bitmap:E.bitmap.clone(),metrics:E.metrics};o(null,x)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(u.u["CJK Unified Ideographs"](t)||u.u["Hangul Syllables"](t)||u.u.Hiragana(t)||u.u.Katakana(t))}_tinySDF(t,o,c){const d=this.localIdeographFontFamily;if(!d||!this._doesCharSupportLocalGlyph(c))return;let g=t.tinySDF;if(!g){let b="400";/bold/i.test(o)?b="900":/medium/i.test(o)?b="500":/light/i.test(o)&&(b="200"),g=t.tinySDF=new Bi.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:d,fontWeight:b})}const x=g.draw(String.fromCharCode(c));return{id:c,bitmap:new u.q({width:x.width||60,height:x.height||60},x.data),metrics:{width:x.glyphWidth/2||24,height:x.glyphHeight/2||24,left:x.glyphLeft/2+.5||0,top:x.glyphTop/2-27.5||-8,advance:x.glyphAdvance/2||24,isDoubleResolution:!0}}}}Bi.loadGlyphRange=function(f,t,o,c,d){const g=256*t,x=g+255,b=c.transformRequest(o.replace("{fontstack}",f).replace("{range}",`${g}-${x}`),se.Glyphs);u.l(b,(T,E)=>{if(T)d(T);else if(E){const P={};for(const M of u.n(E))P[M.id]=M;d(null,P)}})},Bi.TinySDF=class{constructor({fontSize:f=24,buffer:t=3,radius:o=8,cutoff:c=.25,fontFamily:d="sans-serif",fontWeight:g="normal",fontStyle:x="normal"}={}){this.buffer=t,this.cutoff=c,this.radius=o;const b=this.size=f+4*t,T=this._createCanvas(b),E=this.ctx=T.getContext("2d",{willReadFrequently:!0});E.font=`${x} ${g} ${f}px ${d}`,E.textBaseline="alphabetic",E.textAlign="left",E.fillStyle="black",this.gridOuter=new Float64Array(b*b),this.gridInner=new Float64Array(b*b),this.f=new Float64Array(b),this.z=new Float64Array(b+1),this.v=new Uint16Array(b)}_createCanvas(f){const t=document.createElement("canvas");return t.width=t.height=f,t}draw(f){const{width:t,actualBoundingBoxAscent:o,actualBoundingBoxDescent:c,actualBoundingBoxLeft:d,actualBoundingBoxRight:g}=this.ctx.measureText(f),x=Math.ceil(o),b=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(g-d))),T=Math.min(this.size-this.buffer,x+Math.ceil(c)),E=b+2*this.buffer,P=T+2*this.buffer,M=Math.max(E*P,0),F=new Uint8ClampedArray(M),Z={data:F,width:E,height:P,glyphWidth:b,glyphHeight:T,glyphTop:x,glyphLeft:0,glyphAdvance:t};if(b===0||T===0)return Z;const{ctx:$,buffer:G,gridInner:U,gridOuter:re}=this;$.clearRect(G,G,b,T),$.fillText(f,G,G+x);const pe=$.getImageData(G,G,b,T);re.fill(Hi,0,M),U.fill(0,0,M);for(let K=0;K0?xe*xe:0,U[ge]=xe<0?xe*xe:0}}mi(re,0,0,E,P,E,this.f,this.v,this.z),mi(U,G,G,b,T,E,this.f,this.v,this.z);for(let K=0;K1&&(T=t[++b]);const P=Math.abs(E-T.left),M=Math.abs(E-T.right),F=Math.min(P,M);let Z;const $=g/c*(d+1);if(T.isDash){const G=d-Math.abs($);Z=Math.sqrt(F*F+G*G)}else Z=d-Math.sqrt(F*F+$*$);this.data[x+E]=Math.max(0,Math.min(255,Z+128))}}}addRegularDash(t){for(let b=t.length-1;b>=0;--b){const T=t[b],E=t[b+1];T.zeroLength?t.splice(b,1):E&&E.isDash===T.isDash&&(E.left=T.left,t.splice(b,1))}const o=t[0],c=t[t.length-1];o.isDash===c.isDash&&(o.left=c.left-this.width,c.right=o.right+this.width);const d=this.width*this.nextRow;let g=0,x=t[g];for(let b=0;b1&&(x=t[++g]);const T=Math.abs(b-x.left),E=Math.abs(b-x.right),P=Math.min(T,E);this.data[d+b]=Math.max(0,Math.min(255,(x.isDash?P:-P)+128))}}addDash(t,o){const c=o?7:0,d=2*c+1;if(this.nextRow+d>this.height)return u.w("LineAtlas out of space"),null;let g=0;for(let b=0;b{d.send(t,o,g)},c=c||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(o=>{o.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function kt(f,t,o){const c=function(d,g){if(d)return o(d);if(g){const x=u.F(u.e(g,f),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);g.vector_layers&&(x.vectorLayers=g.vector_layers,x.vectorLayerIds=x.vectorLayers.map(b=>b.id)),o(null,x)}};return f.url?u.f(t.transformRequest(f.url,se.Source),c):u.h.frame(()=>c(null,f))}class It{constructor(t,o){t&&(o?this.setSouthWest(t).setNorthEast(o):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof u.L?new u.L(t.lng,t.lat):u.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof u.L?new u.L(t.lng,t.lat):u.L.convert(t),this}extend(t){const o=this._sw,c=this._ne;let d,g;if(t instanceof u.L)d=t,g=t;else{if(!(t instanceof It))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(It.convert(t)):this.extend(u.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(u.L.convert(t)):this;if(d=t._sw,g=t._ne,!d||!g)return this}return o||c?(o.lng=Math.min(d.lng,o.lng),o.lat=Math.min(d.lat,o.lat),c.lng=Math.max(g.lng,c.lng),c.lat=Math.max(g.lat,c.lat)):(this._sw=new u.L(d.lng,d.lat),this._ne=new u.L(g.lng,g.lat)),this}getCenter(){return new u.L((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 u.L(this.getWest(),this.getNorth())}getSouthEast(){return new u.L(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(t){const{lng:o,lat:c}=u.L.convert(t);let d=this._sw.lng<=o&&o<=this._ne.lng;return this._sw.lng>this._ne.lng&&(d=this._sw.lng>=o&&o>=this._ne.lng),this._sw.lat<=c&&c<=this._ne.lat&&d}static convert(t){return t instanceof It?t:t&&new It(t)}static fromLngLat(t,o=0){const c=360*o/40075017,d=c/Math.cos(Math.PI/180*t.lat);return new It(new u.L(t.lng-d,t.lat-c),new u.L(t.lng+d,t.lat+c))}}class jt{constructor(t,o,c){this.bounds=It.convert(this.validateBounds(t)),this.minzoom=o||0,this.maxzoom=c||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const o=Math.pow(2,t.z),c=Math.floor(u.G(this.bounds.getWest())*o),d=Math.floor(u.H(this.bounds.getNorth())*o),g=Math.ceil(u.G(this.bounds.getEast())*o),x=Math.ceil(u.H(this.bounds.getSouth())*o);return t.x>=c&&t.x=d&&t.y{this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this._tileJSONRequest=kt(this._options,this.map._requestManager,(g,x)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),g?this.fire(new u.j(g)):x&&(u.e(this,x),x.bounds&&(this.tileBounds=new jt(x.bounds,this.minzoom,this.maxzoom)),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>u.e({},this._options),this.id=t,this.dispatcher=c,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,u.e(this,u.F(o,["url","scheme","tileSize","promoteId"])),this._options=u.e({type:"vector"},o),this._collectResourceTiming=o.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(d)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,o){const c=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d={request:this.map._requestManager.transformRequest(c,se.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function g(x,b){return delete t.request,t.aborted?o(null):x&&x.status!==404?o(x):(b&&b.resourceTiming&&(t.resourceTiming=b.resourceTiming),this.map._refreshExpiredTiles&&b&&t.setExpiryData(b),t.loadVectorData(b,this.map.painter),o(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}d.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=o:t.request=t.actor.send("reloadTile",d,g.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",d,g.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Oi extends u.E{constructor(t,o,c,d){super(),this.id=t,this.dispatcher=c,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=u.e({type:"raster"},o),u.e(this,u.F(o,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this._tileJSONRequest=kt(this._options,this.map._requestManager,(t,o)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new u.j(t)):o&&(u.e(this,o),o.bounds&&(this.tileBounds=new jt(o.bounds,this.minzoom,this.maxzoom)),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return u.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,o){const c=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=ut.getImage(this.map._requestManager.transformRequest(c,se.Tile),(d,g,x)=>{if(delete t.request,t.aborted)t.state="unloaded",o(null);else if(d)t.state="errored",o(d);else if(g){this.map._refreshExpiredTiles&&x&&t.setExpiryData(x);const b=this.map.painter.context,T=b.gl;t.texture=this.map.painter.getTileTexture(g.width),t.texture?t.texture.update(g,{useMipmap:!0}):(t.texture=new Ge(b,g,T.RGBA,{useMipmap:!0}),t.texture.bind(T.LINEAR,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST),b.extTextureFilterAnisotropic&&T.texParameterf(T.TEXTURE_2D,b.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b.extTextureFilterAnisotropicMax)),t.state="loaded",o(null)}},this.map._refreshExpiredTiles)}abortTile(t,o){t.request&&(t.request.cancel(),delete t.request),o()}unloadTile(t,o){t.texture&&this.map.painter.saveTileTexture(t.texture),o()}hasTransition(){return!1}}class rn extends Oi{constructor(t,o,c,d){super(t,o,c,d),this.type="raster-dem",this.maxzoom=22,this._options=u.e({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox",this.redFactor=o.redFactor,this.greenFactor=o.greenFactor,this.blueFactor=o.blueFactor,this.baseShift=o.baseShift}loadTile(t,o){const c=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),d=this.map._requestManager.transformRequest(c,se.Tile);function g(x,b){x&&(t.state="errored",o(x)),b&&(t.dem=b,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",o(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=ut.getImage(d,(x,b,T)=>u._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",o(null);else if(x)t.state="errored",o(x);else if(b){this.map._refreshExpiredTiles&&t.setExpiryData(T);const E=u.a(b)&&u.J()?b:yield function(M){return u._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&u.K()){const F=M.width+2,Z=M.height+2;try{return new u.R({width:F,height:Z},yield u.M(M,-1,-1,F,Z))}catch{}}return u.h.getImageData(M,1)})}(b),P={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",P,g))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const o=t.canonical,c=Math.pow(2,o.z),d=(o.x-1+c)%c,g=o.x===0?t.wrap-1:t.wrap,x=(o.x+1+c)%c,b=o.x+1===c?t.wrap+1:t.wrap,T={};return T[new u.O(t.overscaledZ,g,o.z,d,o.y).key]={backfilled:!1},T[new u.O(t.overscaledZ,b,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(T[new u.O(t.overscaledZ,g,o.z,d,o.y-1).key]={backfilled:!1},T[new u.O(t.overscaledZ,t.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},T[new u.O(t.overscaledZ,b,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1{this._updateWorkerData()},this.serialize=()=>u.e({},this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=c.getActor(),this.setEventedParent(d),this._data=o.data,this._options=u.e({},o),this._collectResourceTiming=o.collectResourceTiming,o.maxzoom!==void 0&&(this.maxzoom=o.maxzoom),o.type&&(this.type=o.type),o.attribution&&(this.attribution=o.attribution),this.promoteId=o.promoteId;const g=u.N/this.tileSize;this.workerOptions=u.e({source:this.id,cluster:o.cluster||!1,geojsonVtOptions:{buffer:(o.buffer!==void 0?o.buffer:128)*g,tolerance:(o.tolerance!==void 0?o.tolerance:.375)*g,extent:u.N,maxZoom:this.maxzoom,lineMetrics:o.lineMetrics||!1,generateId:o.generateId||!1},superclusterOptions:{maxZoom:o.clusterMaxZoom!==void 0?o.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,o.clusterMinPoints||2),extent:u.N,radius:(o.clusterRadius||50)*g,log:!1,generateId:o.generateId||!1},clusterProperties:o.clusterProperties,filter:o.filter},o.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,o){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},o),this}getClusterChildren(t,o){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},o),this}getClusterLeaves(t,o,c,d){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:o,offset:c},d),this}_updateWorkerData(t){const o=u.e({},this.workerOptions);t?o.dataDiff=t:typeof this._data=="string"?(o.request=this.map._requestManager.transformRequest(u.h.resolveURL(this._data),se.Source),o.request.collectResourceTiming=this._collectResourceTiming):o.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new u.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,o,(c,d)=>{if(this._pendingLoads--,this._removed||d&&d.abandoned)return void this.fire(new u.k("dataabort",{dataType:"source"}));let g=null;if(d&&d.resourceTiming&&d.resourceTiming[this.id]&&(g=d.resourceTiming[this.id].slice(0)),c)return void this.fire(new u.j(c));const x={dataType:"source"};this._collectResourceTiming&&g&&g.length>0&&u.e(x,{resourceTiming:g}),this.fire(new u.k("data",Object.assign(Object.assign({},x),{sourceDataType:"metadata"}))),this.fire(new u.k("data",Object.assign(Object.assign({},x),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,o){const c=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const d={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(c,d,(g,x)=>(delete t.request,t.unloadVectorData(),t.aborted?o(null):g?o(g):(t.loadVectorData(x,this.map.painter,c==="reloadTile"),o(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var Pn=u.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class sn extends u.E{constructor(t,o,c,d){super(),this.load=(g,x)=>{this._loaded=!1,this.fire(new u.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ut.getImage(this.map._requestManager.transformRequest(this.url,se.Image),(b,T)=>{this._request=null,this._loaded=!0,b?this.fire(new u.j(b)):T&&(this.image=T,g&&(this.coordinates=g),x&&x(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const g=this.map.painter.context,x=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,Pn.members)),this.boundsSegments||(this.boundsSegments=u.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Ge(g,this.image,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE));let b=!1;for(const T in this.tiles){const E=this.tiles[T];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,b=!0)}b&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=c,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=o}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new u.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const o=t.map(u.U.fromLngLat);this.tileID=function(d){let g=1/0,x=1/0,b=-1/0,T=-1/0;for(const F of d)g=Math.min(g,F.x),x=Math.min(x,F.y),b=Math.max(b,F.x),T=Math.max(T,F.y);const E=Math.max(b-g,T-x),P=Math.max(0,Math.floor(-Math.log(E)/Math.LN2)),M=Math.pow(2,P);return new u.W(P,Math.floor((g+b)/2*M),Math.floor((x+T)/2*M))}(o),this.minzoom=this.maxzoom=this.tileID.z;const c=o.map(d=>this.tileID.getTilePoint(d)._round());return this._boundsArray=new u.V,this._boundsArray.emplaceBack(c[0].x,c[0].y,0,0),this._boundsArray.emplaceBack(c[1].x,c[1].y,u.N,0),this._boundsArray.emplaceBack(c[3].x,c[3].y,0,u.N),this._boundsArray.emplaceBack(c[2].x,c[2].y,u.N,u.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new u.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,o){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},o(null)):(t.state="errored",o(null))}hasTransition(){return!1}}class ss extends sn{constructor(t,o,c,d){super(t,o,c,d),this.load=()=>{this._loaded=!1;const g=this.options;this.urls=[];for(const x of g.urls)this.urls.push(this.map._requestManager.transformRequest(x,se.Source).url);u.X(this.urls,(x,b)=>{this._loaded=!0,x?this.fire(new u.j(x)):b&&(this.video=b,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const g=this.map.painter.context,x=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,Pn.members)),this.boundsSegments||(this.boundsSegments=u.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE),x.texSubImage2D(x.TEXTURE_2D,0,0,0,x.RGBA,x.UNSIGNED_BYTE,this.video)):(this.texture=new Ge(g,this.video,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE));let b=!1;for(const T in this.tiles){const E=this.tiles[T];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,b=!0)}b&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=o}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const o=this.video.seekable;to.end(0)?this.fire(new u.j(new u.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class or extends sn{constructor(t,o,c,d){super(t,o,c,d),this.load=()=>{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 u.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())},this.prepare=()=>{let g=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,g=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,g=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const x=this.map.painter.context,b=x.gl;this.boundsBuffer||(this.boundsBuffer=x.createVertexBuffer(this._boundsArray,Pn.members)),this.boundsSegments||(this.boundsSegments=u.S.simpleSegment(0,0,4,2)),this.texture?(g||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ge(x,this.canvas,b.RGBA,{premultiply:!0});let T=!1;for(const E in this.tiles){const P=this.tiles[E];P.state!=="loaded"&&(P.state="loaded",P.texture=this.texture,T=!0)}T&&this.fire(new u.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(g=>!Array.isArray(g)||g.length!==2||g.some(x=>typeof x!="number"))||this.fire(new u.j(new u.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new u.j(new u.Y(`sources.${t}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new u.j(new u.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof HTMLCanvasElement||this.fire(new u.j(new u.Y(`sources.${t}`,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 u.j(new u.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const qo={},Fr=f=>{switch(f){case"geojson":return sr;case"image":return sn;case"raster":return Oi;case"raster-dem":return rn;case"vector":return nn;case"video":return ss;case"canvas":return or}return qo[f]};function to(f,t){const o=u.Z();return u.$(o,o,[1,1,0]),u.a0(o,o,[.5*f.width,.5*f.height,1]),u.a1(o,o,f.calculatePosMatrix(t.toUnwrapped()))}function Ss(f,t,o,c,d,g){const x=function(M,F,Z){if(M)for(const $ of M){const G=F[$];if(G&&G.source===Z&&G.type==="fill-extrusion")return!0}else for(const $ in F){const G=F[$];if(G.source===Z&&G.type==="fill-extrusion")return!0}return!1}(d&&d.layers,t,f.id),b=g.maxPitchScaleFactor(),T=f.tilesIn(c,b,x);T.sort(os);const E=[];for(const M of T)E.push({wrappedTileID:M.tileID.wrapped().key,queryResults:M.tile.queryRenderedFeatures(t,o,f._state,M.queryGeometry,M.cameraQueryGeometry,M.scale,d,g,b,to(f.transform,M.tileID))});const P=function(M){const F={},Z={};for(const $ of M){const G=$.queryResults,U=$.wrappedTileID,re=Z[U]=Z[U]||{};for(const pe in G){const K=G[pe],oe=re[pe]=re[pe]||{},me=F[pe]=F[pe]||[];for(const ge of K)oe[ge.featureIndex]||(oe[ge.featureIndex]=!0,me.push(ge))}}return F}(E);for(const M in P)P[M].forEach(F=>{const Z=F.feature,$=f.getFeatureState(Z.layer["source-layer"],Z.id);Z.source=Z.layer.source,Z.layer["source-layer"]&&(Z.sourceLayer=Z.layer["source-layer"]),Z.state=$});return P}function os(f,t){const o=f.tileID,c=t.tileID;return o.overscaledZ-c.overscaledZ||o.canonical.y-c.canonical.y||o.wrap-c.wrap||o.canonical.x-c.canonical.x}class as{constructor(t,o){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=u.a2(),this.uses=0,this.tileSize=o,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(t){const o=t+this.timeAdded;og.getLayer(E)).filter(Boolean);if(T.length!==0){b.layers=T,b.stateDependentLayerIds&&(b.stateDependentLayers=b.stateDependentLayerIds.map(E=>T.filter(P=>P.id===E)[0]));for(const E of T)x[E.id]=b}}return x}(t.buckets,o.style),this.hasSymbolBuckets=!1;for(const d in this.buckets){const g=this.buckets[d];if(g instanceof u.a4){if(this.hasSymbolBuckets=!0,!c)break;g.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const d in this.buckets){const g=this.buckets[d];if(g instanceof u.a4&&g.hasRTLText){this.hasRTLText=!0,u.a5();break}}this.queryPadding=0;for(const d in this.buckets){const g=this.buckets[d];this.queryPadding=Math.max(this.queryPadding,o.style.getLayer(d).queryRadius(g))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new u.a3}unloadVectorData(){for(const t in this.buckets)this.buckets[t].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(t){return this.buckets[t.id]}upload(t){for(const c in this.buckets){const d=this.buckets[c];d.uploadPending()&&d.upload(t)}const o=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ge(t,this.imageAtlas.image,o.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ge(t,this.glyphAtlasImage,o.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,o,c,d,g,x,b,T,E,P){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:d,cameraQueryGeometry:g,scale:x,tileSize:this.tileSize,pixelPosMatrix:P,transform:T,params:b,queryPadding:this.queryPadding*E},t,o,c):{}}querySourceFeatures(t,o){const c=this.latestFeatureIndex;if(!c||!c.rawTileData)return;const d=c.loadVTLayers(),g=o&&o.sourceLayer?o.sourceLayer:"",x=d._geojsonTileLayer||d[g];if(!x)return;const b=u.a6(o&&o.filter),{z:T,x:E,y:P}=this.tileID.canonical,M={z:T,x:E,y:P};for(let F=0;Fc)d=!1;else if(o)if(this.expirationTime{this.remove(t,g)},c)),this.data[d].push(g),this.order.push(d),this.order.length>this.max){const x=this._getAndRemoveByKey(this.order[0]);x&&this.onRemove(x)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const o=this.data[t].shift();return o.timeout&&clearTimeout(o.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),o.value}getByKey(t){const o=this.data[t];return o?o[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,o){if(!this.has(t))return this;const c=t.wrapped().key,d=o===void 0?0:this.data[c].indexOf(o),g=this.data[c][d];return this.data[c].splice(d,1),g.timeout&&clearTimeout(g.timeout),this.data[c].length===0&&delete this.data[c],this.onRemove(g.value),this.order.splice(this.order.indexOf(c),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this}filter(t){const o=[];for(const c in this.data)for(const d of this.data[c])t(d.value)||o.push(d);for(const c of o)this.remove(c.value.tileID,c)}}class ye{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,o,c){const d=String(o);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][d]=this.stateChanges[t][d]||{},u.e(this.stateChanges[t][d],c),this.deletedStates[t]===null){this.deletedStates[t]={};for(const g in this.state[t])g!==d&&(this.deletedStates[t][g]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][d]===null){this.deletedStates[t][d]={};for(const g in this.state[t][d])c[g]||(this.deletedStates[t][d][g]=null)}else for(const g in c)this.deletedStates[t]&&this.deletedStates[t][d]&&this.deletedStates[t][d][g]===null&&delete this.deletedStates[t][d][g]}removeFeatureState(t,o,c){if(this.deletedStates[t]===null)return;const d=String(o);if(this.deletedStates[t]=this.deletedStates[t]||{},c&&o!==void 0)this.deletedStates[t][d]!==null&&(this.deletedStates[t][d]=this.deletedStates[t][d]||{},this.deletedStates[t][d][c]=null);else if(o!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][d])for(c in this.deletedStates[t][d]={},this.stateChanges[t][d])this.deletedStates[t][d][c]=null;else this.deletedStates[t][d]=null;else this.deletedStates[t]=null}getState(t,o){const c=String(o),d=u.e({},(this.state[t]||{})[c],(this.stateChanges[t]||{})[c]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const g=this.deletedStates[t][o];if(g===null)return{};for(const x in g)delete d[x]}return d}initializeTileState(t,o){t.setFeatureState(this.state,o)}coalesceChanges(t,o){const c={};for(const d in this.stateChanges){this.state[d]=this.state[d]||{};const g={};for(const x in this.stateChanges[d])this.state[d][x]||(this.state[d][x]={}),u.e(this.state[d][x],this.stateChanges[d][x]),g[x]=this.state[d][x];c[d]=g}for(const d in this.deletedStates){this.state[d]=this.state[d]||{};const g={};if(this.deletedStates[d]===null)for(const x in this.state[d])g[x]={},this.state[d][x]={};else for(const x in this.deletedStates[d]){if(this.deletedStates[d][x]===null)this.state[d][x]={};else for(const b of Object.keys(this.deletedStates[d][x]))delete this.state[d][x][b];g[x]=this.state[d][x]}c[d]=c[d]||{},u.e(c[d],g)}if(this.stateChanges={},this.deletedStates={},Object.keys(c).length!==0)for(const d in t)t[d].setFeatureState(c,o)}}class gn extends u.E{constructor(t,o,c){super(),this.id=t,this.dispatcher=c,this.on("data",d=>{d.dataType==="source"&&d.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&d.dataType==="source"&&d.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((d,g,x,b)=>{const T=new(Fr(g.type))(d,g,x,b);if(T.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${T.id}`);return T})(t,o,c,this),this._tiles={},this._cache=new Ts(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ye,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}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(const t in this._tiles){const o=this._tiles[t];if(o.state!=="loaded"&&o.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,o){return this._source.loadTile(t,o)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new u.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const o in this._tiles){const c=this._tiles[o];c.upload(t),c.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(qn).map(t=>t.key)}getRenderableIds(t){const o=[];for(const c in this._tiles)this._isIdRenderable(c,t)&&o.push(this._tiles[c]);return t?o.sort((c,d)=>{const g=c.tileID,x=d.tileID,b=new u.P(g.canonical.x,g.canonical.y)._rotate(this.transform.angle),T=new u.P(x.canonical.x,x.canonical.y)._rotate(this.transform.angle);return g.overscaledZ-x.overscaledZ||T.y-b.y||T.x-b.x}).map(c=>c.tileID.key):o.map(c=>c.tileID).sort(qn).map(c=>c.key)}hasRenderableParent(t){const o=this.findLoadedParent(t,0);return!!o&&this._isIdRenderable(o.tileID.key)}_isIdRenderable(t,o){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(o||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,o){const c=this._tiles[t];c&&(c.state!=="loading"&&(c.state=o),this._loadTile(c,this._tileLoaded.bind(this,c,t,o)))}_tileLoaded(t,o,c,d){if(d)return t.state="errored",void(d.status!==404?this._source.fire(new u.j(d,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=u.h.now(),c==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(o,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new u.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const o=this.getRenderableIds();for(let d=0;d1||(Math.abs(x)>1&&(Math.abs(x+T)===1?x+=T:Math.abs(x-T)===1&&(x-=T)),g.dem&&d.dem&&(d.dem.backfillBorder(g.dem,x,b),d.neighboringTiles&&d.neighboringTiles[E]&&(d.neighboringTiles[E].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,o,c,d){for(const g in this._tiles){let x=this._tiles[g];if(d[g]||!x.hasData()||x.tileID.overscaledZ<=o||x.tileID.overscaledZ>c)continue;let b=x.tileID;for(;x&&x.tileID.overscaledZ>o+1;){const E=x.tileID.scaledTo(x.tileID.overscaledZ-1);x=this._tiles[E.key],x&&x.hasData()&&(b=E)}let T=b;for(;T.overscaledZ>o;)if(T=T.scaledTo(T.overscaledZ-1),t[T.key]){d[b.key]=b;break}}}findLoadedParent(t,o){if(t.key in this._loadedParentTiles){const c=this._loadedParentTiles[t.key];return c&&c.tileID.overscaledZ>=o?c:null}for(let c=t.overscaledZ-1;c>=o;c--){const d=t.scaledTo(c),g=this._getLoadedTile(d);if(g)return g}}_getLoadedTile(t){const o=this._tiles[t.key];return o&&o.hasData()?o:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const o=Math.ceil(t.width/this._source.tileSize)+1,c=Math.ceil(t.height/this._source.tileSize)+1,d=Math.floor(o*c*(this._maxTileCacheZoomLevels===null?u.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),g=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,d):d;this._cache.setMaxSize(g)}handleWrapJump(t){const o=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,o){const c={};for(const d in this._tiles){const g=this._tiles[d];g.tileID=g.tileID.unwrapTo(g.tileID.wrap+o),c[g.tileID.key]=g}this._tiles=c;for(const d in this._timers)clearTimeout(this._timers[d]),delete this._timers[d];for(const d in this._tiles)this._setTileReloadTimer(d,this._tiles[d])}}update(t,o){if(this.transform=t,this.terrain=o,!this._sourceLoaded||this._paused)return;let c;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?c=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(P=>new u.O(P.canonical.z,P.wrap,P.canonical.z,P.canonical.x,P.canonical.y)):(c=t.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:o}),this._source.hasTile&&(c=c.filter(P=>this._source.hasTile(P)))):c=[];const d=t.coveringZoomLevel(this._source),g=Math.max(d-gn.maxOverzooming,this._source.minzoom),x=Math.max(d+gn.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const P={};for(const M of c)if(M.canonical.z>this._source.minzoom){const F=M.scaledTo(M.canonical.z-1);P[F.key]=F;const Z=M.scaledTo(Math.max(this._source.minzoom,Math.min(M.canonical.z,5)));P[Z.key]=Z}c=c.concat(Object.values(P))}const b=c.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,b&&this.fire(new u.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const T=this._updateRetainedTiles(c,d);if($t(this._source.type)){const P={},M={},F=Object.keys(T),Z=u.h.now();for(const $ of F){const G=T[$],U=this._tiles[$];if(!U||U.fadeEndTime!==0&&U.fadeEndTime<=Z)continue;const re=this.findLoadedParent(G,g);re&&(this._addTile(re.tileID),P[re.tileID.key]=re.tileID),M[$]=G}this._retainLoadedChildren(M,d,x,T);for(const $ in P)T[$]||(this._coveredTiles[$]=!0,T[$]=P[$]);if(o){const $={},G={};for(const U of c)this._tiles[U.key].hasData()?$[U.key]=U:G[U.key]=U;for(const U in G){const re=G[U].children(this._source.maxzoom);this._tiles[re[0].key]&&this._tiles[re[1].key]&&this._tiles[re[2].key]&&this._tiles[re[3].key]&&($[re[0].key]=T[re[0].key]=re[0],$[re[1].key]=T[re[1].key]=re[1],$[re[2].key]=T[re[2].key]=re[2],$[re[3].key]=T[re[3].key]=re[3],delete G[U])}for(const U in G){const re=this.findLoadedParent(G[U],this._source.minzoom);if(re){$[re.tileID.key]=T[re.tileID.key]=re.tileID;for(const pe in $)$[pe].isChildOf(re.tileID)&&delete $[pe]}}for(const U in this._tiles)$[U]||(this._coveredTiles[U]=!0)}}for(const P in T)this._tiles[P].clearFadeHold();const E=u.ab(this._tiles,T);for(const P of E){const M=this._tiles[P];M.hasSymbolBuckets&&!M.holdingForFade()?M.setHoldDuration(this.map._fadeDuration):M.hasSymbolBuckets&&!M.symbolFadeFinished()||this._removeTile(P)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,o){const c={},d={},g=Math.max(o-gn.maxOverzooming,this._source.minzoom),x=Math.max(o+gn.maxUnderzooming,this._source.minzoom),b={};for(const T of t){const E=this._addTile(T);c[T.key]=T,E.hasData()||othis._source.maxzoom){const M=T.children(this._source.maxzoom)[0],F=this.getTile(M);if(F&&F.hasData()){c[M.key]=M;continue}}else{const M=T.children(this._source.maxzoom);if(c[M[0].key]&&c[M[1].key]&&c[M[2].key]&&c[M[3].key])continue}let P=E.wasRequested();for(let M=T.overscaledZ-1;M>=g;--M){const F=T.scaledTo(M);if(d[F.key])break;if(d[F.key]=!0,E=this.getTile(F),!E&&P&&(E=this._addTile(F)),E){const Z=E.hasData();if((P||Z)&&(c[F.key]=F),P=E.wasRequested(),Z)break}}}return c}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const o=[];let c,d=this._tiles[t].tileID;for(;d.overscaledZ>0;){if(d.key in this._loadedParentTiles){c=this._loadedParentTiles[d.key];break}o.push(d.key);const g=d.scaledTo(d.overscaledZ-1);if(c=this._getLoadedTile(g),c)break;d=g}for(const g of o)this._loadedParentTiles[g]=c}}_addTile(t){let o=this._tiles[t.key];if(o)return o;o=this._cache.getAndRemove(t),o&&(this._setTileReloadTimer(t.key,o),o.tileID=t,this._state.initializeTileState(o,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,o)));const c=o;return o||(o=new as(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(o,this._tileLoaded.bind(this,o,t.key,o.state))),o.uses++,this._tiles[t.key]=o,c||this._source.fire(new u.k("dataloading",{tile:o,coord:o.tileID,dataType:"source"})),o}_setTileReloadTimer(t,o){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const c=o.getExpiryTimeout();c&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},c))}_removeTile(t){const o=this._tiles[t];o&&(o.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),o.uses>0||(o.hasData()&&o.state!=="reloading"?this._cache.add(o.tileID,o,o.getExpiryTimeout()):(o.aborted=!0,this._abortTile(o),this._unloadTile(o))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,o,c){const d=[],g=this.transform;if(!g)return d;const x=c?g.getCameraQueryGeometry(t):t,b=t.map($=>g.pointCoordinate($,this.terrain)),T=x.map($=>g.pointCoordinate($,this.terrain)),E=this.getIds();let P=1/0,M=1/0,F=-1/0,Z=-1/0;for(const $ of T)P=Math.min(P,$.x),M=Math.min(M,$.y),F=Math.max(F,$.x),Z=Math.max(Z,$.y);for(let $=0;$=0&&K[1].y+pe>=0){const oe=b.map(ge=>U.getTilePoint(ge)),me=T.map(ge=>U.getTilePoint(ge));d.push({tile:G,tileID:U,queryGeometry:oe,cameraQueryGeometry:me,scale:re})}}return d}getVisibleCoordinates(t){const o=this.getRenderableIds(t).map(c=>this._tiles[c].tileID);for(const c of o)c.posMatrix=this.transform.calculatePosMatrix(c.toUnwrapped());return o}hasTransition(){if(this._source.hasTransition())return!0;if($t(this._source.type)){const t=u.h.now();for(const o in this._tiles)if(this._tiles[o].fadeEndTime>=t)return!0}return!1}setFeatureState(t,o,c){this._state.updateState(t=t||"_geojsonTileLayer",o,c)}removeFeatureState(t,o,c){this._state.removeFeatureState(t=t||"_geojsonTileLayer",o,c)}getFeatureState(t,o){return this._state.getState(t=t||"_geojsonTileLayer",o)}setDependencies(t,o,c){const d=this._tiles[t];d&&d.setDependencies(o,c)}reloadTilesForDependencies(t,o){for(const c in this._tiles)this._tiles[c].hasDependency(t,o)&&this._reloadTile(c,"reloading");this._cache.filter(c=>!c.hasDependency(t,o))}}function qn(f,t){const o=Math.abs(2*f.wrap)-+(f.wrap<0),c=Math.abs(2*t.wrap)-+(t.wrap<0);return f.overscaledZ-t.overscaledZ||c-o||t.canonical.y-f.canonical.y||t.canonical.x-f.canonical.x}function $t(f){return f==="raster"||f==="image"||f==="video"}gn.maxOverzooming=10,gn.maxUnderzooming=3;const Ct="mapboxgl_preloaded_worker_pool";class vr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ct]}numActive(){return Object.keys(this.active).length}}const io=Math.floor(u.h.hardwareConcurrency/2);let Br;function Ca(){return Br||(Br=new vr),Br}vr.workerCount=u.ac(globalThis)?Math.max(Math.min(io,3),1):1;class no{constructor(t,o){this.reset(t,o)}reset(t,o){this.points=t||[],this._distances=[0];for(let c=1;c0?(d-x)/b:0;return this.points[g].mult(1-T).add(this.points[o].mult(T))}}function ls(f,t){let o=!0;return f==="always"||f!=="never"&&t!=="never"||(o=!1),o}class ks{constructor(t,o,c){const d=this.boxCells=[],g=this.circleCells=[];this.xCellCount=Math.ceil(t/c),this.yCellCount=Math.ceil(o/c);for(let x=0;xthis.width||d<0||o>this.height)return[];const T=[];if(t<=0&&o<=0&&this.width<=c&&this.height<=d){if(g)return[{key:null,x1:t,y1:o,x2:c,y2:d}];for(let E=0;E0}hitTestCircle(t,o,c,d,g){const x=t-c,b=t+c,T=o-c,E=o+c;if(b<0||x>this.width||E<0||T>this.height)return!1;const P=[];return this._forEachCell(x,T,b,E,this._queryCellCircle,P,{hitTest:!0,overlapMode:d,circle:{x:t,y:o,radius:c},seenUids:{box:{},circle:{}}},g),P.length>0}_queryCell(t,o,c,d,g,x,b,T){const{seenUids:E,hitTest:P,overlapMode:M}=b,F=this.boxCells[g];if(F!==null){const $=this.bboxes;for(const G of F)if(!E.box[G]){E.box[G]=!0;const U=4*G,re=this.boxKeys[G];if(t<=$[U+2]&&o<=$[U+3]&&c>=$[U+0]&&d>=$[U+1]&&(!T||T(re))&&(!P||!ls(M,re.overlapMode))&&(x.push({key:re,x1:$[U],y1:$[U+1],x2:$[U+2],y2:$[U+3]}),P))return!0}}const Z=this.circleCells[g];if(Z!==null){const $=this.circles;for(const G of Z)if(!E.circle[G]){E.circle[G]=!0;const U=3*G,re=this.circleKeys[G];if(this._circleAndRectCollide($[U],$[U+1],$[U+2],t,o,c,d)&&(!T||T(re))&&(!P||!ls(M,re.overlapMode))){const pe=$[U],K=$[U+1],oe=$[U+2];if(x.push({key:re,x1:pe-oe,y1:K-oe,x2:pe+oe,y2:K+oe}),P)return!0}}}return!1}_queryCellCircle(t,o,c,d,g,x,b,T){const{circle:E,seenUids:P,overlapMode:M}=b,F=this.boxCells[g];if(F!==null){const $=this.bboxes;for(const G of F)if(!P.box[G]){P.box[G]=!0;const U=4*G,re=this.boxKeys[G];if(this._circleAndRectCollide(E.x,E.y,E.radius,$[U+0],$[U+1],$[U+2],$[U+3])&&(!T||T(re))&&!ls(M,re.overlapMode))return x.push(!0),!0}}const Z=this.circleCells[g];if(Z!==null){const $=this.circles;for(const G of Z)if(!P.circle[G]){P.circle[G]=!0;const U=3*G,re=this.circleKeys[G];if(this._circlesCollide($[U],$[U+1],$[U+2],E.x,E.y,E.radius)&&(!T||T(re))&&!ls(M,re.overlapMode))return x.push(!0),!0}}}_forEachCell(t,o,c,d,g,x,b,T){const E=this._convertToXCellCoord(t),P=this._convertToYCellCoord(o),M=this._convertToXCellCoord(c),F=this._convertToYCellCoord(d);for(let Z=E;Z<=M;Z++)for(let $=P;$<=F;$++)if(g.call(this,t,o,c,d,this.xCellCount*$+Z,x,b,T))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,o,c,d,g,x){const b=d-t,T=g-o,E=c+x;return E*E>b*b+T*T}_circleAndRectCollide(t,o,c,d,g,x,b){const T=(x-d)/2,E=Math.abs(t-(d+T));if(E>T+c)return!1;const P=(b-g)/2,M=Math.abs(o-(g+P));if(M>P+c)return!1;if(E<=T||M<=P)return!0;const F=E-T,Z=M-P;return F*F+Z*Z<=c*c}}function ze(f,t,o,c,d){const g=u.Z();return t?(u.a0(g,g,[1/d,1/d,1]),o||u.ae(g,g,c.angle)):u.a1(g,c.labelPlaneMatrix,f),g}function xr(f,t,o,c,d){if(t){const g=u.af(f);return u.a0(g,g,[d,d,1]),o||u.ae(g,g,-c.angle),g}return c.glCoordMatrix}function ni(f,t,o){let c;o?(c=[f.x,f.y,o(f.x,f.y),1],u.ag(c,c,t)):(c=[f.x,f.y,0,1],H(c,c,t));const d=c[3];return{point:new u.P(c[0]/d,c[1]/d),signedDistanceFromCamera:d}}function Es(f,t){return .5+f/t*.5}function Or(f,t){const o=f[0]/f[3],c=f[1]/f[3];return o>=-t[0]&&o<=t[0]&&c>=-t[1]&&c<=t[1]}function Re(f,t,o,c,d,g,x,b,T,E){const P=c?f.textSizeData:f.iconSizeData,M=u.ah(P,o.transform.zoom),F=[256/o.width*2+1,256/o.height*2+1],Z=c?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;Z.clear();const $=f.lineVertexArray,G=c?f.text.placedSymbolArray:f.icon.placedSymbolArray,U=o.transform.width/o.transform.height;let re=!1;for(let pe=0;peMath.abs(o.x-t.x)*c?{useVertical:!0}:(f===u.ai.vertical?t.yo.x)?{needsFlipping:!0}:null}function on(f,t,o,c,d,g,x,b,T,E,P,M,F,Z,$,G){const U=t/24,re=f.lineOffsetX*U,pe=f.lineOffsetY*U;let K;if(f.numGlyphs>1){const oe=f.glyphStartIndex+f.numGlyphs,me=f.lineStartIndex,ge=f.lineStartIndex+f.lineLength,xe=gt(U,b,re,pe,o,P,M,f,T,g,F,$,G);if(!xe)return{notEnoughRoom:!0};const Ee=ni(xe.first.point,x,G).point,Te=ni(xe.last.point,x,G).point;if(c&&!o){const Pe=ht(f.writingMode,Ee,Te,Z);if(Pe)return Pe}K=[xe.first];for(let Pe=f.glyphStartIndex+1;Pe0?Ee.point:wr(M,xe,me,1,d,G),Pe=ht(f.writingMode,me,Te,Z);if(Pe)return Pe}const oe=A(U*b.getoffsetX(f.glyphStartIndex),re,pe,o,P,M,f.segment,f.lineStartIndex,f.lineStartIndex+f.lineLength,T,g,F,$,G);if(!oe)return{notEnoughRoom:!0};K=[oe]}for(const oe of K)u.ak(E,oe.point,oe.angle);return{}}function wr(f,t,o,c,d,g){const x=ni(f.add(f.sub(t)._unit()),d,g).point,b=o.sub(x);return o.add(b._mult(c/b.mag()))}function pt(f,t){const{projectionCache:o,lineVertexArray:c,labelPlaneMatrix:d,tileAnchorPoint:g,distanceFromAnchor:x,getElevation:b,previousVertex:T,direction:E,absOffsetX:P}=t;if(o.projections[f])return o.projections[f];const M=new u.P(c.getx(f),c.gety(f)),F=ni(M,d,b);if(F.signedDistanceFromCamera>0)return o.projections[f]=F.point,F.point;const Z=f-E;return wr(x===0?g:new u.P(c.getx(Z),c.gety(Z)),M,T,P-x+1,d,b)}function Nr(f,t,o){return f._unit()._perp()._mult(t*o)}function q(f,t,o,c,d,g,x,b){const{projectionCache:T,direction:E}=b;if(T.offsets[f])return T.offsets[f];const P=o.add(t);if(f+E=d)return T.offsets[f]=P,P;const M=pt(f+E,b),F=Nr(M.sub(o),x,E),Z=o.add(F),$=M.add(F);return T.offsets[f]=u.al(g,P,Z,$)||P,T.offsets[f]}function A(f,t,o,c,d,g,x,b,T,E,P,M,F,Z){const $=c?f-t:f+t;let G=$>0?1:-1,U=0;c&&(G*=-1,U=Math.PI),G<0&&(U+=Math.PI);let re,pe,K=G>0?b+x:b+x+1,oe=d,me=d,ge=0,xe=0;const Ee=Math.abs($),Te=[];let Pe;for(;ge+xe<=Ee;){if(K+=G,K=T)return null;ge+=xe,me=oe,pe=re;const Fe={projectionCache:M,lineVertexArray:E,labelPlaneMatrix:P,tileAnchorPoint:g,distanceFromAnchor:ge,getElevation:Z,previousVertex:me,direction:G,absOffsetX:Ee};if(oe=pt(K,Fe),o===0)Te.push(me),Pe=oe.sub(me);else{let ot;const Ye=oe.sub(me);ot=Ye.mag()===0?Nr(pt(K+G,Fe).sub(oe),o,G):Nr(Ye,o,G),pe||(pe=me.add(ot)),re=q(K,ot,oe,b,T,pe,o,Fe),Te.push(pe),Pe=re.sub(pe)}xe=Pe.mag()}const Xe=Pe._mult((Ee-ge)/xe)._add(pe||me),vt=U+Math.atan2(oe.y-me.y,oe.x-me.x);return Te.push(Xe),{point:Xe,angle:F?vt:0,path:Te}}const R=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function V(f,t){for(let o=0;o=1;mt--)Ye.push(Fe.path[mt]);for(let mt=1;mtni(xt,T,$));Ye=mt.some(xt=>xt.signedDistanceFromCamera<=0)?[]:mt.map(xt=>xt.point)}let _t=[];if(Ye.length>0){const mt=Ye[0].clone(),xt=Ye[0].clone();for(let ci=1;ci=Pe.x&&xt.x<=Xe.x&&mt.y>=Pe.y&&xt.y<=Xe.y?[Ye]:xt.xXe.x||xt.yXe.y?[]:u.am([Ye],Pe.x,Pe.y,Xe.x,Xe.y)}for(const mt of _t){vt.reset(mt,.25*Te);let xt=0;xt=vt.length<=.5*Te?1:Math.ceil(vt.paddedLength/Ot)+1;for(let ci=0;ci=this.screenRightBoundary||dthis.screenBottomBoundary}isInsideGrid(t,o,c,d){return c>=0&&t=0&&oc.collisionGroupID===o}}return this.collisionGroups[t]}}function lt(f,t,o,c,d){const{horizontalAlign:g,verticalAlign:x}=u.au(f);return new u.P(-(g-.5)*t+c[0]*d,-(x-.5)*o+c[1]*d)}function We(f,t,o,c,d,g){const{x1:x,x2:b,y1:T,y2:E,anchorPointX:P,anchorPointY:M}=f,F=new u.P(t,o);return c&&F._rotate(d?g:-g),{x1:x+F.x,y1:T+F.y,x2:b+F.x,y2:E+F.y,anchorPointX:P,anchorPointY:M}}class rt{constructor(t,o,c,d,g){this.transform=t.clone(),this.terrain=o,this.collisionIndex=new ce(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new it(d),this.collisionCircleArrays={},this.prevPlacement=g,g&&(g.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,o,c,d){const g=c.getBucket(o),x=c.latestFeatureIndex;if(!g||!x||o.id!==g.layerIds[0])return;const b=c.collisionBoxArray,T=g.layers[0].layout,E=Math.pow(2,this.transform.zoom-c.tileID.overscaledZ),P=c.tileSize/u.N,M=this.transform.calculatePosMatrix(c.tileID.toUnwrapped()),F=T.get("text-pitch-alignment")==="map",Z=T.get("text-rotation-alignment")==="map",$=ie(c,1,this.transform.zoom),G=ze(M,F,Z,this.transform,$);let U=null;if(F){const pe=xr(M,F,Z,this.transform,$);U=u.a1([],this.transform.labelPlaneMatrix,pe)}this.retainedQueryData[g.bucketInstanceId]=new be(g.bucketInstanceId,x,g.sourceLayerIndex,g.index,c.tileID);const re={bucket:g,layout:T,posMatrix:M,textLabelPlaneMatrix:G,labelToScreenMatrix:U,scale:E,textPixelRatio:P,holdingForFade:c.holdingForFade(),collisionBoxArray:b,partiallyEvaluatedTextSize:u.ah(g.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(g.sourceID)};if(d)for(const pe of g.sortKeyRanges){const{sortKey:K,symbolInstanceStart:oe,symbolInstanceEnd:me}=pe;t.push({sortKey:K,symbolInstanceStart:oe,symbolInstanceEnd:me,parameters:re})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:g.symbolInstances.length,parameters:re})}attemptAnchorPlacement(t,o,c,d,g,x,b,T,E,P,M,F,Z,$,G,U){const re=u.aq[t.textAnchor],pe=[t.textOffset0,t.textOffset1],K=lt(re,c,d,pe,g),oe=this.collisionIndex.placeCollisionBox(We(o,K.x,K.y,x,b,this.transform.angle),M,T,E,P.predicate,U);if((!G||this.collisionIndex.placeCollisionBox(We(G,K.x,K.y,x,b,this.transform.angle),M,T,E,P.predicate,U).box.length!==0)&&oe.box.length>0){let me;if(this.prevPlacement&&this.prevPlacement.variableOffsets[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID]&&this.prevPlacement.placements[F.crossTileID].text&&(me=this.prevPlacement.variableOffsets[F.crossTileID].anchor),F.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[F.crossTileID]={textOffset:pe,width:c,height:d,anchor:re,textBoxScale:g,prevAnchor:me},this.markUsedJustification(Z,re,F,$),Z.allowVerticalPlacement&&(this.markUsedOrientation(Z,$,F),this.placedOrientations[F.crossTileID]=$),{shift:K,placedGlyphBoxes:oe}}}placeLayerBucketPart(t,o,c){const{bucket:d,layout:g,posMatrix:x,textLabelPlaneMatrix:b,labelToScreenMatrix:T,textPixelRatio:E,holdingForFade:P,collisionBoxArray:M,partiallyEvaluatedTextSize:F,collisionGroup:Z}=t.parameters,$=g.get("text-optional"),G=g.get("icon-optional"),U=u.ar(g,"text-overlap","text-allow-overlap"),re=U==="always",pe=u.ar(g,"icon-overlap","icon-allow-overlap"),K=pe==="always",oe=g.get("text-rotation-alignment")==="map",me=g.get("text-pitch-alignment")==="map",ge=g.get("icon-text-fit")!=="none",xe=g.get("symbol-z-order")==="viewport-y",Ee=re&&(K||!d.hasIconData()||G),Te=K&&(re||!d.hasTextData()||$);!d.collisionArrays&&M&&d.deserializeCollisionBoxes(M);const Pe=this.retainedQueryData[d.bucketInstanceId].tileID,Xe=this.terrain?(Fe,ot)=>this.terrain.getElevation(Pe,Fe,ot):null,vt=(Fe,ot)=>{var Ye,Ot;if(o[Fe.crossTileID])return;if(P)return void(this.placements[Fe.crossTileID]=new _e(!1,!1,!1));let _t=!1,mt=!1,xt=!0,ci=null,qt={box:null,offscreen:null},ji={box:null,offscreen:null},Ci=null,yi=null,Rn=null,Wt=0,Sr=0,Tr=0;ot.textFeatureIndex?Wt=ot.textFeatureIndex:Fe.useRuntimeCollisionCircles&&(Wt=Fe.featureIndex),ot.verticalTextFeatureIndex&&(Sr=ot.verticalTextFeatureIndex);const ms=ot.textBox;if(ms){const Ki=hi=>{let Pi=u.ai.horizontal;if(d.allowVerticalPlacement&&!hi&&this.prevPlacement){const vn=this.prevPlacement.placedOrientations[Fe.crossTileID];vn&&(this.placedOrientations[Fe.crossTileID]=vn,Pi=vn,this.markUsedOrientation(d,Pi,Fe))}return Pi},$i=(hi,Pi)=>{if(d.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&ot.verticalTextBox){for(const vn of d.writingModes)if(vn===u.ai.vertical?(qt=Pi(),ji=qt):qt=hi(),qt&&qt.box&&qt.box.length)break}else qt=hi()},ln=Fe.textAnchorOffsetStartIndex,Fs=Fe.textAnchorOffsetEndIndex;if(Fs===ln){const hi=(Pi,vn)=>{const di=this.collisionIndex.placeCollisionBox(Pi,U,E,x,Z.predicate,Xe);return di&&di.box&&di.box.length&&(this.markUsedOrientation(d,vn,Fe),this.placedOrientations[Fe.crossTileID]=vn),di};$i(()=>hi(ms,u.ai.horizontal),()=>{const Pi=ot.verticalTextBox;return d.allowVerticalPlacement&&Fe.numVerticalGlyphVertices>0&&Pi?hi(Pi,u.ai.vertical):{box:null,offscreen:null}}),Ki(qt&&qt.box&&qt.box.length)}else{let hi=u.aq[(Ot=(Ye=this.prevPlacement)===null||Ye===void 0?void 0:Ye.variableOffsets[Fe.crossTileID])===null||Ot===void 0?void 0:Ot.anchor];const Pi=(di,Bs,nl)=>{const zh=di.x2-di.x1,Ah=di.y2-di.y1,Rp=Fe.textBoxScale,Lu=ge&&pe==="never"?Bs:null;let kr={box:[],offscreen:!1},Os=U==="never"?1:2,Er="never";hi&&Os++;for(let Qn=0;QnPi(ms,ot.iconBox,u.ai.horizontal),()=>{const di=ot.verticalTextBox;return d.allowVerticalPlacement&&!(qt&&qt.box&&qt.box.length)&&Fe.numVerticalGlyphVertices>0&&di?Pi(di,ot.verticalIconBox,u.ai.vertical):{box:null,offscreen:null}}),qt&&(_t=qt.box,xt=qt.offscreen);const vn=Ki(qt&&qt.box);if(!_t&&this.prevPlacement){const di=this.prevPlacement.variableOffsets[Fe.crossTileID];di&&(this.variableOffsets[Fe.crossTileID]=di,this.markUsedJustification(d,di.anchor,Fe,vn))}}}if(Ci=qt,_t=Ci&&Ci.box&&Ci.box.length>0,xt=Ci&&Ci.offscreen,Fe.useRuntimeCollisionCircles){const Ki=d.text.placedSymbolArray.get(Fe.centerJustifiedTextSymbolIndex),$i=u.aj(d.textSizeData,F,Ki),ln=g.get("text-padding");yi=this.collisionIndex.placeCollisionCircles(U,Ki,d.lineVertexArray,d.glyphOffsetArray,$i,x,b,T,c,me,Z.predicate,Fe.collisionCircleDiameter,ln,Xe),yi.circles.length&&yi.collisionDetected&&!c&&u.w("Collisions detected, but collision boxes are not shown"),_t=re||yi.circles.length>0&&!yi.collisionDetected,xt=xt&&yi.offscreen}if(ot.iconFeatureIndex&&(Tr=ot.iconFeatureIndex),ot.iconBox){const Ki=$i=>{const ln=ge&&ci?We($i,ci.x,ci.y,oe,me,this.transform.angle):$i;return this.collisionIndex.placeCollisionBox(ln,pe,E,x,Z.predicate,Xe)};ji&&ji.box&&ji.box.length&&ot.verticalIconBox?(Rn=Ki(ot.verticalIconBox),mt=Rn.box.length>0):(Rn=Ki(ot.iconBox),mt=Rn.box.length>0),xt=xt&&Rn.offscreen}const Rs=$||Fe.numHorizontalGlyphVertices===0&&Fe.numVerticalGlyphVertices===0,_o=G||Fe.numIconVertices===0;if(Rs||_o?_o?Rs||(mt=mt&&_t):_t=mt&&_t:mt=_t=mt&&_t,_t&&Ci&&Ci.box&&this.collisionIndex.insertCollisionBox(Ci.box,U,g.get("text-ignore-placement"),d.bucketInstanceId,ji&&ji.box&&Sr?Sr:Wt,Z.ID),mt&&Rn&&this.collisionIndex.insertCollisionBox(Rn.box,pe,g.get("icon-ignore-placement"),d.bucketInstanceId,Tr,Z.ID),yi&&(_t&&this.collisionIndex.insertCollisionCircles(yi.circles,U,g.get("text-ignore-placement"),d.bucketInstanceId,Wt,Z.ID),c)){const Ki=d.bucketInstanceId;let $i=this.collisionCircleArrays[Ki];$i===void 0&&($i=this.collisionCircleArrays[Ki]=new ve);for(let ln=0;ln=0;--ot){const Ye=Fe[ot];vt(d.symbolInstances.get(Ye),d.collisionArrays[Ye])}}else for(let Fe=t.symbolInstanceStart;Fe=0&&(t.text.placedSymbolArray.get(b).crossTileID=g>=0&&b!==g?0:c.crossTileID)}markUsedOrientation(t,o,c){const d=o===u.ai.horizontal||o===u.ai.horizontalOnly?o:0,g=o===u.ai.vertical?o:0,x=[c.leftJustifiedTextSymbolIndex,c.centerJustifiedTextSymbolIndex,c.rightJustifiedTextSymbolIndex];for(const b of x)t.text.placedSymbolArray.get(b).placedOrientation=d;c.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(c.verticalPlacedTextSymbolIndex).placedOrientation=g)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let c=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const d=o?o.symbolFadeChange(t):1,g=o?o.opacities:{},x=o?o.variableOffsets:{},b=o?o.placedOrientations:{};for(const T in this.placements){const E=this.placements[T],P=g[T];P?(this.opacities[T]=new ae(P,d,E.text,E.icon),c=c||E.text!==P.text.placed||E.icon!==P.icon.placed):(this.opacities[T]=new ae(null,d,E.text,E.icon,E.skipFade),c=c||E.text||E.icon)}for(const T in g){const E=g[T];if(!this.opacities[T]){const P=new ae(E,d,!1,!1);P.isHidden()||(this.opacities[T]=P,c=c||E.text.placed||E.icon.placed)}}for(const T in x)this.variableOffsets[T]||!this.opacities[T]||this.opacities[T].isHidden()||(this.variableOffsets[T]=x[T]);for(const T in b)this.placedOrientations[T]||!this.opacities[T]||this.opacities[T].isHidden()||(this.placedOrientations[T]=b[T]);if(o&&o.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");c?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:t)}updateLayerOpacities(t,o){const c={};for(const d of o){const g=d.getBucket(t);g&&d.latestFeatureIndex&&t.id===g.layerIds[0]&&this.updateBucketOpacities(g,c,d.collisionBoxArray)}}updateBucketOpacities(t,o,c){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const d=t.layers[0],g=d.layout,x=new ae(null,0,!1,!1,!0),b=g.get("text-allow-overlap"),T=g.get("icon-allow-overlap"),E=d._unevaluatedLayout.hasValue("text-variable-anchor")||d._unevaluatedLayout.hasValue("text-variable-anchor-offset"),P=g.get("text-rotation-alignment")==="map",M=g.get("text-pitch-alignment")==="map",F=g.get("icon-text-fit")!=="none",Z=new ae(null,0,b&&(T||!t.hasIconData()||g.get("icon-optional")),T&&(b||!t.hasTextData()||g.get("text-optional")),!0);!t.collisionArrays&&c&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(c);const $=(G,U,re)=>{for(let pe=0;pe0,ge=this.placedOrientations[U.crossTileID],xe=ge===u.ai.vertical,Ee=ge===u.ai.horizontal||ge===u.ai.horizontalOnly;if(re>0||pe>0){const Te=Vi(oe.text);$(t.text,re,xe?Gn:Te),$(t.text,pe,Ee?Gn:Te);const Pe=oe.text.isHidden();[U.rightJustifiedTextSymbolIndex,U.centerJustifiedTextSymbolIndex,U.leftJustifiedTextSymbolIndex].forEach(Fe=>{Fe>=0&&(t.text.placedSymbolArray.get(Fe).hidden=Pe||xe?1:0)}),U.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(U.verticalPlacedTextSymbolIndex).hidden=Pe||Ee?1:0);const Xe=this.variableOffsets[U.crossTileID];Xe&&this.markUsedJustification(t,Xe.anchor,U,ge);const vt=this.placedOrientations[U.crossTileID];vt&&(this.markUsedJustification(t,"left",U,vt),this.markUsedOrientation(t,vt,U))}if(me){const Te=Vi(oe.icon),Pe=!(F&&U.verticalPlacedIconSymbolIndex&&xe);U.placedIconSymbolIndex>=0&&($(t.icon,U.numIconVertices,Pe?Te:Gn),t.icon.placedSymbolArray.get(U.placedIconSymbolIndex).hidden=oe.icon.isHidden()),U.verticalPlacedIconSymbolIndex>=0&&($(t.icon,U.numVerticalIconVertices,Pe?Gn:Te),t.icon.placedSymbolArray.get(U.verticalPlacedIconSymbolIndex).hidden=oe.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Te=t.collisionArrays[G];if(Te){let Pe=new u.P(0,0);if(Te.textBox||Te.verticalTextBox){let vt=!0;if(E){const Fe=this.variableOffsets[K];Fe?(Pe=lt(Fe.anchor,Fe.width,Fe.height,Fe.textOffset,Fe.textBoxScale),P&&Pe._rotate(M?this.transform.angle:-this.transform.angle)):vt=!1}Te.textBox&&dt(t.textCollisionBox.collisionVertexArray,oe.text.placed,!vt||xe,Pe.x,Pe.y),Te.verticalTextBox&&dt(t.textCollisionBox.collisionVertexArray,oe.text.placed,!vt||Ee,Pe.x,Pe.y)}const Xe=!!(!Ee&&Te.verticalIconBox);Te.iconBox&&dt(t.iconCollisionBox.collisionVertexArray,oe.icon.placed,Xe,F?Pe.x:0,F?Pe.y:0),Te.verticalIconBox&&dt(t.iconCollisionBox.collisionVertexArray,oe.icon.placed,!Xe,F?Pe.x:0,F?Pe.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const G=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=G.invProjMatrix,t.placementViewportMatrix=G.viewportMatrix,t.collisionCircleArray=G.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function dt(f,t,o,c,d){f.emplaceBack(t?1:0,o?1:0,c||0,d||0),f.emplaceBack(t?1:0,o?1:0,c||0,d||0),f.emplaceBack(t?1:0,o?1:0,c||0,d||0),f.emplaceBack(t?1:0,o?1:0,c||0,d||0)}const Dt=Math.pow(2,25),Nt=Math.pow(2,24),Et=Math.pow(2,17),Tt=Math.pow(2,16),Wi=Math.pow(2,9),Zt=Math.pow(2,8),bi=Math.pow(2,1);function Vi(f){if(f.opacity===0&&!f.placed)return 0;if(f.opacity===1&&f.placed)return 4294967295;const t=f.placed?1:0,o=Math.floor(127*f.opacity);return o*Dt+t*Nt+o*Et+t*Tt+o*Wi+t*Zt+o*bi+t}const Gn=0;class Hc{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,o,c,d,g){const x=this._bucketParts;for(;this._currentTileIndexb.sortKey-T.sortKey));this._currentPartIndex!this._forceFullPlacement&&u.h.now()-d>2;for(;this._currentPlacementIndex>=0;){const x=o[t[this._currentPlacementIndex]],b=this.placement.collisionIndex.transform.zoom;if(x.type==="symbol"&&(!x.minzoom||x.minzoom<=b)&&(!x.maxzoom||x.maxzoom>b)){if(this._inProgressLayer||(this._inProgressLayer=new Hc(x)),this._inProgressLayer.continuePlacement(c[x.source],this.placement,this._showCollisionBoxes,x,g))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const so=512/u.N/2;class _p{constructor(t,o,c){this.tileID=t,this.bucketInstanceId=c,this._symbolsByKey={};const d=new Map;for(let g=0;g({x:Math.floor(T.anchorX*so),y:Math.floor(T.anchorY*so)})),crossTileIDs:x.map(T=>T.crossTileID)};if(b.positions.length>128){const T=new u.av(b.positions.length,16,Uint16Array);for(const{x:E,y:P}of b.positions)T.add(E,P);T.finish(),delete b.positions,b.index=T}this._symbolsByKey[g]=b}}getScaledCoordinates(t,o){const{x:c,y:d,z:g}=this.tileID.canonical,{x,y:b,z:T}=o.canonical,E=so/Math.pow(2,T-g),P=(b*u.N+t.anchorY)*E,M=d*u.N*so;return{x:Math.floor((x*u.N+t.anchorX)*E-c*u.N*so),y:Math.floor(P-M)}}findMatches(t,o,c){const d=this.tileID.canonical.zt)}}class Bt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Hl{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const o=Math.round((t-this.lng)/360);if(o!==0)for(const c in this.indexes){const d=this.indexes[c],g={};for(const x in d){const b=d[x];b.tileID=b.tileID.unwrapTo(b.tileID.wrap+o),g[b.tileID.key]=b}this.indexes[c]=g}this.lng=t}addBucket(t,o,c){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let g=0;gt.overscaledZ)for(const b in x){const T=x[b];T.tileID.isChildOf(t)&&T.findMatches(o.symbolInstances,t,d)}else{const b=x[t.scaledTo(Number(g)).key];b&&b.findMatches(o.symbolInstances,t,d)}}for(let g=0;g{o[c]=!0});for(const c in this.layerIndexes)o[c]||delete this.layerIndexes[c]}}const Xi=(f,t)=>u.x(f,t&&t.filter(o=>o.identifier!=="source.canvas")),Mn=u.F(u.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),vp=u.F(u.ax,["setCenter","setZoom","setBearing","setPitch"]),Hn=u.aw();class Ui extends u.E{constructor(t,o={}){super(),this.map=t,this.dispatcher=new Lt(Ca(),this,t._getMapId()),this.imageManager=new Ei,this.imageManager.setEventedParent(this),this.glyphManager=new Bi(t._requestManager,o.localIdeographFontFamily),this.lineAtlas=new ft(256,512),this.crossTileSymbolIndex=new Pa,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new u.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",u.az());const c=this;this._rtlTextPluginCallback=Ui.registerForPluginStateChange(d=>{c.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:d.pluginStatus,pluginURL:d.pluginURL},(g,x)=>{if(u.aA(g),x&&x.every(b=>b))for(const b in c.sourceCaches){const T=c.sourceCaches[b].getSource().type;T!=="vector"&&T!=="geojson"||c.sourceCaches[b].reload()}})}),this.on("data",d=>{if(d.dataType!=="source"||d.sourceDataType!=="metadata")return;const g=this.sourceCaches[d.sourceId];if(!g)return;const x=g.getSource();if(x&&x.vectorLayerIds)for(const b in this._layers){const T=this._layers[b];T.source===x.id&&this._validateLayer(T)}})}loadURL(t,o={},c){this.fire(new u.k("dataloading",{dataType:"style"})),o.validate=typeof o.validate!="boolean"||o.validate;const d=this.map._requestManager.transformRequest(t,se.Style);this._request=u.f(d,(g,x)=>{this._request=null,g?this.fire(new u.j(g)):x&&this._load(x,o,c)})}loadJSON(t,o={},c){this.fire(new u.k("dataloading",{dataType:"style"})),this._request=u.h.frame(()=>{this._request=null,o.validate=o.validate!==!1,this._load(t,o,c)})}loadEmpty(){this.fire(new u.k("dataloading",{dataType:"style"})),this._load(Hn,{validate:!1})}_load(t,o,c){var d;const g=o.transformStyle?o.transformStyle(c,t):t;if(!o.validate||!Xi(this,u.y(g))){this._loaded=!0,this.stylesheet=g;for(const x in g.sources)this.addSource(x,g.sources[x],{validate:!1});g.sprite?this._loadSprite(g.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(g.glyphs),this._createLayers(),this.light=new ct(this.stylesheet.light),this.map.setTerrain((d=this.stylesheet.terrain)!==null&&d!==void 0?d:null),this.fire(new u.k("data",{dataType:"style"})),this.fire(new u.k("style.load"))}}_createLayers(){const t=u.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(o=>o.id),this._layers={},this._serializedLayers=null;for(const o of t){const c=u.aC(o);c.setEventedParent(this,{layer:{id:o.id}}),this._layers[o.id]=c}}_loadSprite(t,o=!1,c=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(d,g,x,b){const T=$e(d),E=T.length,P=x>1?"@2x":"",M={},F={},Z={};for(const{id:$,url:G}of T){const U=g.transformRequest(g.normalizeSpriteURL(G,P,".json"),se.SpriteJSON),re=`${$}_${U.url}`;M[re]=u.f(U,(oe,me)=>{delete M[re],F[$]=me,Ft(b,F,Z,oe,E)});const pe=g.transformRequest(g.normalizeSpriteURL(G,P,".png"),se.SpriteImage),K=`${$}_${pe.url}`;M[K]=ut.getImage(pe,(oe,me)=>{delete M[K],Z[$]=me,Ft(b,F,Z,oe,E)})}return{cancel(){for(const $ of Object.values(M))$.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(d,g)=>{if(this._spriteRequest=null,d)this.fire(new u.j(d));else if(g)for(const x in g){this._spritesImagesIds[x]=[];const b=this._spritesImagesIds[x]?this._spritesImagesIds[x].filter(T=>!(T in g)):[];for(const T of b)this.imageManager.removeImage(T),this._changedImages[T]=!0;for(const T in g[x]){const E=x==="default"?T:`${x}:${T}`;this._spritesImagesIds[x].push(E),E in this.imageManager.images?this.imageManager.updateImage(E,g[x][T],!1):this.imageManager.addImage(E,g[x][T]),o&&(this._changedImages[E]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),o&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"})),c&&c(d)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}_validateLayer(t){const o=this.sourceCaches[t.source];if(!o)return;const c=t.sourceLayer;if(!c)return;const d=o.getSource();(d.type==="geojson"||d.vectorLayerIds&&d.vectorLayerIds.indexOf(c)===-1)&&this.fire(new u.j(new Error(`Source layer "${c}" does not exist on source "${d.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const o=this._serializedAllLayers();if(!t||t.length===0)return Object.values(o);const c=[];for(const d of t)o[d]&&c.push(o[d]);return c}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const o=Object.keys(this._layers);for(const c of o){const d=this._layers[c];d.type!=="custom"&&(t[c]=d.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const o=this._changed;if(this._changed){const d=Object.keys(this._updatedLayers),g=Object.keys(this._removedLayers);(d.length||g.length)&&this._updateWorkerLayers(d,g);for(const x in this._updatedSources){const b=this._updatedSources[x];if(b==="reload")this._reloadSource(x);else{if(b!=="clear")throw new Error(`Invalid action ${b}`);this._clearSource(x)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const x in this._updatedPaintProps)this._layers[x].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const c={};for(const d in this.sourceCaches){const g=this.sourceCaches[d];c[d]=g.used,g.used=!1}for(const d of this._order){const g=this._layers[d];g.recalculate(t,this._availableImages),!g.isHidden(t.zoom)&&g.source&&(this.sourceCaches[g.source].used=!0)}for(const d in c){const g=this.sourceCaches[d];c[d]!==g.used&&g.fire(new u.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:d}))}this.light.recalculate(t),this.z=t.zoom,o&&this.fire(new u.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const o in this.sourceCaches)this.sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,o={}){this._checkLoaded();const c=this.serialize();if(t=o.transformStyle?o.transformStyle(c,t):t,Xi(this,u.y(t)))return!1;(t=u.aD(t)).layers=u.aB(t.layers);const d=u.aE(c,t).filter(x=>!(x.command in vp));if(d.length===0)return!1;const g=d.filter(x=>!(x.command in Mn));if(g.length>0)throw new Error(`Unimplemented: ${g.map(x=>x.command).join(", ")}.`);for(const x of d)x.command!=="setTransition"&&this[x.command].apply(this,x.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,o){if(this.getImage(t))return this.fire(new u.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,o),this._afterImageUpdated(t)}updateImage(t,o){this.imageManager.updateImage(t,o)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new u.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,o,c={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(u.y.source,`sources.${t}`,o,null,c))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const d=this.sourceCaches[t]=new gn(t,o,this.dispatcher);d.style=this,d.setEventedParent(this,()=>({isSourceLoaded:d.loaded(),source:d.serialize(),sourceId:t})),d.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const c in this._layers)if(this._layers[c].source===t)return this.fire(new u.j(new Error(`Source "${t}" cannot be removed while layer "${c}" is using it.`)));const o=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],o.fire(new u.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),o.setEventedParent(null),o.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,o){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const c=this.sourceCaches[t].getSource();if(c.type!=="geojson")throw new Error(`geojsonSource.type is ${c.type}, which is !== 'geojson`);c.setData(o),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,o,c={}){this._checkLoaded();const d=t.id;if(this.getLayer(d))return void this.fire(new u.j(new Error(`Layer "${d}" already exists on this map.`)));let g;if(t.type==="custom"){if(Xi(this,u.aF(t)))return;g=u.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(d,t.source),t=u.aD(t),t=u.e(t,{source:d})),this._validate(u.y.layer,`layers.${d}`,t,{arrayIndex:-1},c))return;g=u.aC(t),this._validateLayer(g),g.setEventedParent(this,{layer:{id:d}})}const x=o?this._order.indexOf(o):this._order.length;if(o&&x===-1)this.fire(new u.j(new Error(`Cannot add layer "${d}" before non-existing layer "${o}".`)));else{if(this._order.splice(x,0,d),this._layerOrderChanged=!0,this._layers[d]=g,this._removedLayers[d]&&g.source&&g.type!=="custom"){const b=this._removedLayers[d];delete this._removedLayers[d],b.type!==g.type?this._updatedSources[g.source]="clear":(this._updatedSources[g.source]="reload",this.sourceCaches[g.source].pause())}this._updateLayer(g),g.onAdd&&g.onAdd(this.map)}}moveLayer(t,o){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new u.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===o)return;const c=this._order.indexOf(t);this._order.splice(c,1);const d=o?this._order.indexOf(o):this._order.length;o&&d===-1?this.fire(new u.j(new Error(`Cannot move layer "${t}" before non-existing layer "${o}".`))):(this._order.splice(d,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const o=this._layers[t];if(!o)return void this.fire(new u.j(new Error(`Cannot remove non-existing layer "${t}".`)));o.setEventedParent(null);const c=this._order.indexOf(t);this._order.splice(c,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=o,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],o.onRemove&&o.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,o,c){this._checkLoaded();const d=this.getLayer(t);d?d.minzoom===o&&d.maxzoom===c||(o!=null&&(d.minzoom=o),c!=null&&(d.maxzoom=c),this._updateLayer(d)):this.fire(new u.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,o,c={}){this._checkLoaded();const d=this.getLayer(t);if(d){if(!u.aG(d.filter,o))return o==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(u.y.filter,`layers.${d.id}.filter`,o,null,c)||(d.filter=u.aD(o),this._updateLayer(d)))}else this.fire(new u.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return u.aD(this.getLayer(t).filter)}setLayoutProperty(t,o,c,d={}){this._checkLoaded();const g=this.getLayer(t);g?u.aG(g.getLayoutProperty(o),c)||(g.setLayoutProperty(o,c,d),this._updateLayer(g)):this.fire(new u.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,o){const c=this.getLayer(t);if(c)return c.getLayoutProperty(o);this.fire(new u.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,o,c,d={}){this._checkLoaded();const g=this.getLayer(t);g?u.aG(g.getPaintProperty(o),c)||(g.setPaintProperty(o,c,d)&&this._updateLayer(g),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new u.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,o){return this.getLayer(t).getPaintProperty(o)}setFeatureState(t,o){this._checkLoaded();const c=t.source,d=t.sourceLayer,g=this.sourceCaches[c];if(g===void 0)return void this.fire(new u.j(new Error(`The source '${c}' does not exist in the map's style.`)));const x=g.getSource().type;x==="geojson"&&d?this.fire(new u.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):x!=="vector"||d?(t.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),g.setFeatureState(d,t.id,o)):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,o){this._checkLoaded();const c=t.source,d=this.sourceCaches[c];if(d===void 0)return void this.fire(new u.j(new Error(`The source '${c}' does not exist in the map's style.`)));const g=d.getSource().type,x=g==="vector"?t.sourceLayer:void 0;g!=="vector"||x?o&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new u.j(new Error("A feature id is required to remove its specific state property."))):d.removeFeatureState(x,t.id,o):this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const o=t.source,c=t.sourceLayer,d=this.sourceCaches[o];if(d!==void 0)return d.getSource().type!=="vector"||c?(t.id===void 0&&this.fire(new u.j(new Error("The feature id parameter must be provided."))),d.getFeatureState(c,t.id)):void this.fire(new u.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new u.j(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return u.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=u.aH(this.sourceCaches,g=>g.serialize()),o=this._serializeByIds(this._order),c=this.map.getTerrain()||void 0,d=this.stylesheet;return u.aI({version:d.version,name:d.name,metadata:d.metadata,light:d.light,center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,sprite:d.sprite,glyphs:d.glyphs,transition:d.transition,sources:t,layers:o,terrain:c},g=>g!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const o=x=>this._layers[x].type==="fill-extrusion",c={},d=[];for(let x=this._order.length-1;x>=0;x--){const b=this._order[x];if(o(b)){c[b]=x;for(const T of t){const E=T[b];if(E)for(const P of E)d.push(P)}}}d.sort((x,b)=>b.intersectionZ-x.intersectionZ);const g=[];for(let x=this._order.length-1;x>=0;x--){const b=this._order[x];if(o(b))for(let T=d.length-1;T>=0;T--){const E=d[T].feature;if(c[E.layer.id]{const Ee=re.featureSortOrder;if(Ee){const Te=Ee.indexOf(ge.featureIndex);return Ee.indexOf(xe.featureIndex)-Te}return xe.featureIndex-ge.featureIndex});for(const ge of me)oe.push(ge)}}for(const re in $)$[re].forEach(pe=>{const K=pe.feature,oe=E[b[re].source].getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=oe});return $}(this._layers,x,this.sourceCaches,t,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(g)}querySourceFeatures(t,o){o&&o.filter&&this._validate(u.y.filter,"querySourceFeatures.filter",o.filter,null,o);const c=this.sourceCaches[t];return c?function(d,g){const x=d.getRenderableIds().map(E=>d.getTileByID(E)),b=[],T={};for(let E=0;E{qo[d]=g})(t,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:o.workerSourceURL},c):c(null,null))}getLight(){return this.light.getLight()}setLight(t,o={}){this._checkLoaded();const c=this.light.getLight();let d=!1;for(const x in t)if(!u.aG(t[x],c[x])){d=!0;break}if(!d)return;const g={now:u.h.now(),transition:u.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,o),this.light.updateTransitions(g)}_validate(t,o,c,d,g={}){return(!g||g.validate!==!1)&&Xi(this,t.call(u.y,u.e({key:o,style:this.serialize(),value:c,styleSpec:u.v},d)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),u.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this.sourceCaches){const c=this.sourceCaches[o];c.setEventedParent(null),c.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const o in this.sourceCaches)this.sourceCaches[o].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,o,c,d,g=!1){let x=!1,b=!1;const T={};for(const E of this._order){const P=this._layers[E];if(P.type!=="symbol")continue;if(!T[P.source]){const F=this.sourceCaches[P.source];T[P.source]=F.getRenderableIds(!0).map(Z=>F.getTileByID(Z)).sort((Z,$)=>$.tileID.overscaledZ-Z.tileID.overscaledZ||(Z.tileID.isLessThan($.tileID)?-1:1))}const M=this.crossTileSymbolIndex.addLayer(P,T[P.source],t.center.lng);x=x||M}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((g=g||this._layerOrderChanged||c===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.h.now(),t.zoom))&&(this.pauseablePlacement=new ro(t,this.map.terrain,this._order,g,o,c,d,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,T),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.h.now()),b=!0),x&&this.pauseablePlacement.placement.setStale()),b||x)for(const E of this._order){const P=this._layers[E];P.type==="symbol"&&this.placement.updateLayerOpacities(P,T[P.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,o,c){this.imageManager.getImages(o.icons,c),this._updateTilesForChangedImages();const d=this.sourceCaches[o.source];d&&d.setDependencies(o.tileID.key,o.type,o.icons)}getGlyphs(t,o,c){this.glyphManager.getGlyphs(o.stacks,c);const d=this.sourceCaches[o.source];d&&d.setDependencies(o.tileID.key,o.type,[""])}getResource(t,o,c){return u.m(o,c)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,o={}){this._checkLoaded(),t&&this._validate(u.y.glyphs,"glyphs",t,null,o)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,o,c={},d){this._checkLoaded();const g=[{id:t,url:o}],x=[...$e(this.stylesheet.sprite),...g];this._validate(u.y.sprite,"sprite",x,null,c)||(this.stylesheet.sprite=x,this._loadSprite(g,!0,d))}removeSprite(t){this._checkLoaded();const o=$e(this.stylesheet.sprite);if(o.find(c=>c.id===t)){if(this._spritesImagesIds[t])for(const c of this._spritesImagesIds[t])this.imageManager.removeImage(c),this._changedImages[c]=!0;o.splice(o.findIndex(c=>c.id===t),1),this.stylesheet.sprite=o.length>0?o:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new u.k("data",{dataType:"style"}))}else this.fire(new u.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return $e(this.stylesheet.sprite)}setSprite(t,o={},c){this._checkLoaded(),t&&this._validate(u.y.sprite,"sprite",t,null,o)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,c):(this._unloadSprite(),c&&c(null)))}}Ui.registerForPluginStateChange=u.aK;var Ma=u.Q([{name:"a_pos",type:"Int16",components:2}]),oo="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Qt={prelude:Mt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:Mt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Mt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Mt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Mt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Mt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Mt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Mt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Mt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Mt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Mt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Mt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Mt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Mt(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Mt(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+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_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Mt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 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;}`),hillshadePrepare:Mt(`#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 +}`,"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;}"),hillshade:Mt(`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 +}`,"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;}"),line:Mt(`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 +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Mt(`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() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Mt(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Mt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Mt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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;}"),symbolIcon:Mt(`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 +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;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),z,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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Mt(`#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 +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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);vec2 a_pxoffset=a_pixeloffset.xy;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;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=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Mt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;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:Mt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",oo),terrainDepth:Mt("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);}",oo),terrainCoords:Mt("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);}",oo)};function Mt(f,t){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,c=t.match(/attribute ([\w]+) ([\w]+)/g),d=f.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),x=g?g.concat(d):d,b={};return{fragmentSource:f=f.replace(o,(T,E,P,M,F)=>(b[F]=!0,E==="define"?` +#ifndef HAS_UNIFORM_u_${F} +varying ${P} ${M} ${F}; +#else +uniform ${P} ${M} u_${F}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${F} + ${P} ${M} ${F} = u_${F}; +#endif +`)),vertexSource:t=t.replace(o,(T,E,P,M,F)=>{const Z=M==="float"?"vec2":"vec4",$=F.match(/color/)?"color":Z;return b[F]?E==="define"?` +#ifndef HAS_UNIFORM_u_${F} +uniform lowp float u_${F}_t; +attribute ${P} ${Z} a_${F}; +varying ${P} ${M} ${F}; +#else +uniform ${P} ${M} u_${F}; +#endif +`:$==="vec4"?` +#ifndef HAS_UNIFORM_u_${F} + ${F} = a_${F}; +#else + ${P} ${M} ${F} = u_${F}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${F} + ${F} = unpack_mix_${$}(a_${F}, u_${F}_t); +#else + ${P} ${M} ${F} = u_${F}; +#endif +`:E==="define"?` +#ifndef HAS_UNIFORM_u_${F} +uniform lowp float u_${F}_t; +attribute ${P} ${Z} a_${F}; +#else +uniform ${P} ${M} u_${F}; +#endif +`:$==="vec4"?` +#ifndef HAS_UNIFORM_u_${F} + ${P} ${M} ${F} = a_${F}; +#else + ${P} ${M} ${F} = u_${F}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${F} + ${P} ${M} ${F} = unpack_mix_${$}(a_${F}, u_${F}_t); +#else + ${P} ${M} ${F} = u_${F}; +#endif +`}),staticAttributes:c,staticUniforms:x}}class Is{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,o,c,d,g,x,b,T,E){this.context=t;let P=this.boundPaintVertexBuffers.length!==d.length;for(let M=0;!P&&M({u_depth:new u.aL(ge,xe.u_depth),u_terrain:new u.aL(ge,xe.u_terrain),u_terrain_dim:new u.aM(ge,xe.u_terrain_dim),u_terrain_matrix:new u.aN(ge,xe.u_terrain_matrix),u_terrain_unpack:new u.aO(ge,xe.u_terrain_unpack),u_terrain_exaggeration:new u.aM(ge,xe.u_terrain_exaggeration)}))(t,me),this.binderUniforms=c?c.getUniforms(t,me):[]}draw(t,o,c,d,g,x,b,T,E,P,M,F,Z,$,G,U,re,pe){const K=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(c),t.setStencilMode(d),t.setColorMode(g),t.setCullFace(x),T){t.activeTexture.set(K.TEXTURE2),K.bindTexture(K.TEXTURE_2D,T.depthTexture),t.activeTexture.set(K.TEXTURE3),K.bindTexture(K.TEXTURE_2D,T.texture);for(const me in this.terrainUniforms)this.terrainUniforms[me].set(T[me])}for(const me in this.fixedUniforms)this.fixedUniforms[me].set(b[me]);G&&G.setUniforms(t,this.binderUniforms,Z,{zoom:$});let oe=0;switch(o){case K.LINES:oe=2;break;case K.TRIANGLES:oe=3;break;case K.LINE_STRIP:oe=1}for(const me of F.get()){const ge=me.vaos||(me.vaos={});(ge[E]||(ge[E]=new Is)).bind(t,this,P,G?G.getPaintVertexBuffers():[],M,me.vertexOffset,U,re,pe),K.drawElements(o,me.primitiveLength*oe,K.UNSIGNED_SHORT,me.primitiveOffset*oe*2)}}}function Wn(f,t,o){const c=1/ie(o,1,t.transform.tileZoom),d=Math.pow(2,o.tileID.overscaledZ),g=o.tileSize*Math.pow(2,t.transform.tileZoom)/d,x=g*(o.tileID.canonical.x+o.tileID.wrap*d),b=g*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_scale:[c,f.fromScale,f.toScale],u_fade:f.t,u_pixel_coord_upper:[x>>16,b>>16],u_pixel_coord_lower:[65535&x,65535&b]}}const Wl=(f,t,o,c)=>{const d=t.style.light,g=d.properties.get("position"),x=[g.x,g.y,g.z],b=function(){var E=new u.A(9);return u.A!=Float32Array&&(E[1]=0,E[2]=0,E[3]=0,E[5]=0,E[6]=0,E[7]=0),E[0]=1,E[4]=1,E[8]=1,E}();d.properties.get("anchor")==="viewport"&&function(E,P){var M=Math.sin(P),F=Math.cos(P);E[0]=F,E[1]=M,E[2]=0,E[3]=-M,E[4]=F,E[5]=0,E[6]=0,E[7]=0,E[8]=1}(b,-t.transform.angle),function(E,P,M){var F=P[0],Z=P[1],$=P[2];E[0]=F*M[0]+Z*M[3]+$*M[6],E[1]=F*M[1]+Z*M[4]+$*M[7],E[2]=F*M[2]+Z*M[5]+$*M[8]}(x,x,b);const T=d.properties.get("color");return{u_matrix:f,u_lightpos:x,u_lightintensity:d.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+o,u_opacity:c}},us=(f,t,o,c,d,g,x)=>u.e(Wl(f,t,o,c),Wn(g,t,x),{u_height_factor:-Math.pow(2,d.overscaledZ)/x.tileSize/8}),Wc=f=>({u_matrix:f}),Xl=(f,t,o,c)=>u.e(Wc(f),Wn(o,t,c)),Aa=(f,t)=>({u_matrix:f,u_world:t}),Da=(f,t,o,c,d)=>u.e(Xl(f,t,o,c),{u_world:d}),cs=(f,t,o,c)=>{const d=f.transform;let g,x;if(c.paint.get("circle-pitch-alignment")==="map"){const b=ie(o,1,d.zoom);g=!0,x=[b,b]}else g=!1,x=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(c.paint.get("circle-pitch-scale")==="map"),u_matrix:f.translatePosMatrix(t.posMatrix,o,c.paint.get("circle-translate"),c.paint.get("circle-translate-anchor")),u_pitch_with_map:+g,u_device_pixel_ratio:f.pixelRatio,u_extrude_scale:x}},Kl=(f,t,o)=>{const c=ie(o,1,t.zoom),d=Math.pow(2,t.zoom-o.tileID.overscaledZ),g=o.tileID.overscaleFactor();return{u_matrix:f,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:c,u_extrude_scale:[t.pixelsToGLUnits[0]/(c*d),t.pixelsToGLUnits[1]/(c*d)],u_overscale_factor:g}},Go=(f,t,o=1)=>({u_matrix:f,u_color:t,u_overlay:0,u_overlay_scale:o}),Xc=f=>({u_matrix:f}),xp=(f,t,o,c)=>({u_matrix:f,u_extrude_scale:ie(t,1,o),u_intensity:c});function Yl(f,t){const o=Math.pow(2,t.canonical.z),c=t.canonical.y;return[new u.U(0,c/o).toLngLat().lat,new u.U(0,(c+1)/o).toLngLat().lat]}const Ql=(f,t,o,c)=>{const d=f.transform;return{u_matrix:La(f,t,o,c),u_ratio:1/ie(t,1,d.zoom),u_device_pixel_ratio:f.pixelRatio,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},Kc=(f,t,o,c,d)=>u.e(Ql(f,t,o,d),{u_image:0,u_image_height:c}),wp=(f,t,o,c,d)=>{const g=f.transform,x=Qc(t,g);return{u_matrix:La(f,t,o,d),u_texsize:t.imageAtlasTexture.size,u_ratio:1/ie(t,1,g.zoom),u_device_pixel_ratio:f.pixelRatio,u_image:0,u_scale:[x,c.fromScale,c.toScale],u_fade:c.t,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},Yc=(f,t,o,c,d,g)=>{const x=f.lineAtlas,b=Qc(t,f.transform),T=o.layout.get("line-cap")==="round",E=x.getDash(c.from,T),P=x.getDash(c.to,T),M=E.width*d.fromScale,F=P.width*d.toScale;return u.e(Ql(f,t,o,g),{u_patternscale_a:[b/M,-E.height/2],u_patternscale_b:[b/F,-P.height/2],u_sdfgamma:x.width/(256*Math.min(M,F)*f.pixelRatio)/2,u_image:0,u_tex_y_a:E.y,u_tex_y_b:P.y,u_mix:d.t})};function Qc(f,t){return 1/ie(f,1,t.tileZoom)}function La(f,t,o,c){return f.translatePosMatrix(c?c.posMatrix:t.tileID.posMatrix,t,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}const Jc=(f,t,o,c,d)=>{return{u_matrix:f,u_tl_parent:t,u_scale_parent:o,u_buffer_scale:1,u_fade_t:c.mix,u_opacity:c.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(x=d.paint.get("raster-saturation"),x>0?1-1/(1.001-x):-x),u_contrast_factor:(g=d.paint.get("raster-contrast"),g>0?1/(1-g):1+g),u_spin_weights:eh(d.paint.get("raster-hue-rotate"))};var g,x};function eh(f){f*=Math.PI/180;const t=Math.sin(f),o=Math.cos(f);return[(2*o+1)/3,(-Math.sqrt(3)*t-o+1)/3,(Math.sqrt(3)*t-o+1)/3]}const Jl=(f,t,o,c,d,g,x,b,T,E)=>{const P=d.transform;return{u_is_size_zoom_constant:+(f==="constant"||f==="source"),u_is_size_feature_constant:+(f==="constant"||f==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:P.cameraToCenterDistance,u_pitch:P.pitch/360*2*Math.PI,u_rotate_symbol:+o,u_aspect_ratio:P.width/P.height,u_fade_change:d.options.fadeDuration?d.symbolFadeChange:1,u_matrix:g,u_label_plane_matrix:x,u_coord_matrix:b,u_is_text:+T,u_pitch_with_map:+c,u_texsize:E,u_texture:0}},eu=(f,t,o,c,d,g,x,b,T,E,P)=>{const M=d.transform;return u.e(Jl(f,t,o,c,d,g,x,b,T,E),{u_gamma_scale:c?Math.cos(M._pitch)*M.cameraToCenterDistance:1,u_device_pixel_ratio:d.pixelRatio,u_is_halo:+P})},Cs=(f,t,o,c,d,g,x,b,T,E)=>u.e(eu(f,t,o,c,d,g,x,b,!0,T,!0),{u_texsize_icon:E,u_texture_icon:1}),Ra=(f,t,o)=>({u_matrix:f,u_opacity:t,u_color:o}),Xn=(f,t,o,c,d,g)=>u.e(function(x,b,T,E){const P=T.imageManager.getPattern(x.from.toString()),M=T.imageManager.getPattern(x.to.toString()),{width:F,height:Z}=T.imageManager.getPixelSize(),$=Math.pow(2,E.tileID.overscaledZ),G=E.tileSize*Math.pow(2,T.transform.tileZoom)/$,U=G*(E.tileID.canonical.x+E.tileID.wrap*$),re=G*E.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:P.tl,u_pattern_br_a:P.br,u_pattern_tl_b:M.tl,u_pattern_br_b:M.br,u_texsize:[F,Z],u_mix:b.t,u_pattern_size_a:P.displaySize,u_pattern_size_b:M.displaySize,u_scale_a:b.fromScale,u_scale_b:b.toScale,u_tile_units_to_pixels:1/ie(E,1,T.transform.tileZoom),u_pixel_coord_upper:[U>>16,re>>16],u_pixel_coord_lower:[65535&U,65535&re]}}(c,g,o,d),{u_matrix:f,u_opacity:t}),Fa={fillExtrusion:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_lightpos:new u.aP(f,t.u_lightpos),u_lightintensity:new u.aM(f,t.u_lightintensity),u_lightcolor:new u.aP(f,t.u_lightcolor),u_vertical_gradient:new u.aM(f,t.u_vertical_gradient),u_opacity:new u.aM(f,t.u_opacity)}),fillExtrusionPattern:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_lightpos:new u.aP(f,t.u_lightpos),u_lightintensity:new u.aM(f,t.u_lightintensity),u_lightcolor:new u.aP(f,t.u_lightcolor),u_vertical_gradient:new u.aM(f,t.u_vertical_gradient),u_height_factor:new u.aM(f,t.u_height_factor),u_image:new u.aL(f,t.u_image),u_texsize:new u.aQ(f,t.u_texsize),u_pixel_coord_upper:new u.aQ(f,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(f,t.u_pixel_coord_lower),u_scale:new u.aP(f,t.u_scale),u_fade:new u.aM(f,t.u_fade),u_opacity:new u.aM(f,t.u_opacity)}),fill:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix)}),fillPattern:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_image:new u.aL(f,t.u_image),u_texsize:new u.aQ(f,t.u_texsize),u_pixel_coord_upper:new u.aQ(f,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(f,t.u_pixel_coord_lower),u_scale:new u.aP(f,t.u_scale),u_fade:new u.aM(f,t.u_fade)}),fillOutline:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_world:new u.aQ(f,t.u_world)}),fillOutlinePattern:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_world:new u.aQ(f,t.u_world),u_image:new u.aL(f,t.u_image),u_texsize:new u.aQ(f,t.u_texsize),u_pixel_coord_upper:new u.aQ(f,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(f,t.u_pixel_coord_lower),u_scale:new u.aP(f,t.u_scale),u_fade:new u.aM(f,t.u_fade)}),circle:(f,t)=>({u_camera_to_center_distance:new u.aM(f,t.u_camera_to_center_distance),u_scale_with_map:new u.aL(f,t.u_scale_with_map),u_pitch_with_map:new u.aL(f,t.u_pitch_with_map),u_extrude_scale:new u.aQ(f,t.u_extrude_scale),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_matrix:new u.aN(f,t.u_matrix)}),collisionBox:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_camera_to_center_distance:new u.aM(f,t.u_camera_to_center_distance),u_pixels_to_tile_units:new u.aM(f,t.u_pixels_to_tile_units),u_extrude_scale:new u.aQ(f,t.u_extrude_scale),u_overscale_factor:new u.aM(f,t.u_overscale_factor)}),collisionCircle:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_inv_matrix:new u.aN(f,t.u_inv_matrix),u_camera_to_center_distance:new u.aM(f,t.u_camera_to_center_distance),u_viewport_size:new u.aQ(f,t.u_viewport_size)}),debug:(f,t)=>({u_color:new u.aR(f,t.u_color),u_matrix:new u.aN(f,t.u_matrix),u_overlay:new u.aL(f,t.u_overlay),u_overlay_scale:new u.aM(f,t.u_overlay_scale)}),clippingMask:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix)}),heatmap:(f,t)=>({u_extrude_scale:new u.aM(f,t.u_extrude_scale),u_intensity:new u.aM(f,t.u_intensity),u_matrix:new u.aN(f,t.u_matrix)}),heatmapTexture:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_world:new u.aQ(f,t.u_world),u_image:new u.aL(f,t.u_image),u_color_ramp:new u.aL(f,t.u_color_ramp),u_opacity:new u.aM(f,t.u_opacity)}),hillshade:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_image:new u.aL(f,t.u_image),u_latrange:new u.aQ(f,t.u_latrange),u_light:new u.aQ(f,t.u_light),u_shadow:new u.aR(f,t.u_shadow),u_highlight:new u.aR(f,t.u_highlight),u_accent:new u.aR(f,t.u_accent)}),hillshadePrepare:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_image:new u.aL(f,t.u_image),u_dimension:new u.aQ(f,t.u_dimension),u_zoom:new u.aM(f,t.u_zoom),u_unpack:new u.aO(f,t.u_unpack)}),line:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_ratio:new u.aM(f,t.u_ratio),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_units_to_pixels:new u.aQ(f,t.u_units_to_pixels)}),lineGradient:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_ratio:new u.aM(f,t.u_ratio),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_units_to_pixels:new u.aQ(f,t.u_units_to_pixels),u_image:new u.aL(f,t.u_image),u_image_height:new u.aM(f,t.u_image_height)}),linePattern:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_texsize:new u.aQ(f,t.u_texsize),u_ratio:new u.aM(f,t.u_ratio),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_image:new u.aL(f,t.u_image),u_units_to_pixels:new u.aQ(f,t.u_units_to_pixels),u_scale:new u.aP(f,t.u_scale),u_fade:new u.aM(f,t.u_fade)}),lineSDF:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_ratio:new u.aM(f,t.u_ratio),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_units_to_pixels:new u.aQ(f,t.u_units_to_pixels),u_patternscale_a:new u.aQ(f,t.u_patternscale_a),u_patternscale_b:new u.aQ(f,t.u_patternscale_b),u_sdfgamma:new u.aM(f,t.u_sdfgamma),u_image:new u.aL(f,t.u_image),u_tex_y_a:new u.aM(f,t.u_tex_y_a),u_tex_y_b:new u.aM(f,t.u_tex_y_b),u_mix:new u.aM(f,t.u_mix)}),raster:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_tl_parent:new u.aQ(f,t.u_tl_parent),u_scale_parent:new u.aM(f,t.u_scale_parent),u_buffer_scale:new u.aM(f,t.u_buffer_scale),u_fade_t:new u.aM(f,t.u_fade_t),u_opacity:new u.aM(f,t.u_opacity),u_image0:new u.aL(f,t.u_image0),u_image1:new u.aL(f,t.u_image1),u_brightness_low:new u.aM(f,t.u_brightness_low),u_brightness_high:new u.aM(f,t.u_brightness_high),u_saturation_factor:new u.aM(f,t.u_saturation_factor),u_contrast_factor:new u.aM(f,t.u_contrast_factor),u_spin_weights:new u.aP(f,t.u_spin_weights)}),symbolIcon:(f,t)=>({u_is_size_zoom_constant:new u.aL(f,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aL(f,t.u_is_size_feature_constant),u_size_t:new u.aM(f,t.u_size_t),u_size:new u.aM(f,t.u_size),u_camera_to_center_distance:new u.aM(f,t.u_camera_to_center_distance),u_pitch:new u.aM(f,t.u_pitch),u_rotate_symbol:new u.aL(f,t.u_rotate_symbol),u_aspect_ratio:new u.aM(f,t.u_aspect_ratio),u_fade_change:new u.aM(f,t.u_fade_change),u_matrix:new u.aN(f,t.u_matrix),u_label_plane_matrix:new u.aN(f,t.u_label_plane_matrix),u_coord_matrix:new u.aN(f,t.u_coord_matrix),u_is_text:new u.aL(f,t.u_is_text),u_pitch_with_map:new u.aL(f,t.u_pitch_with_map),u_texsize:new u.aQ(f,t.u_texsize),u_texture:new u.aL(f,t.u_texture)}),symbolSDF:(f,t)=>({u_is_size_zoom_constant:new u.aL(f,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aL(f,t.u_is_size_feature_constant),u_size_t:new u.aM(f,t.u_size_t),u_size:new u.aM(f,t.u_size),u_camera_to_center_distance:new u.aM(f,t.u_camera_to_center_distance),u_pitch:new u.aM(f,t.u_pitch),u_rotate_symbol:new u.aL(f,t.u_rotate_symbol),u_aspect_ratio:new u.aM(f,t.u_aspect_ratio),u_fade_change:new u.aM(f,t.u_fade_change),u_matrix:new u.aN(f,t.u_matrix),u_label_plane_matrix:new u.aN(f,t.u_label_plane_matrix),u_coord_matrix:new u.aN(f,t.u_coord_matrix),u_is_text:new u.aL(f,t.u_is_text),u_pitch_with_map:new u.aL(f,t.u_pitch_with_map),u_texsize:new u.aQ(f,t.u_texsize),u_texture:new u.aL(f,t.u_texture),u_gamma_scale:new u.aM(f,t.u_gamma_scale),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_is_halo:new u.aL(f,t.u_is_halo)}),symbolTextAndIcon:(f,t)=>({u_is_size_zoom_constant:new u.aL(f,t.u_is_size_zoom_constant),u_is_size_feature_constant:new u.aL(f,t.u_is_size_feature_constant),u_size_t:new u.aM(f,t.u_size_t),u_size:new u.aM(f,t.u_size),u_camera_to_center_distance:new u.aM(f,t.u_camera_to_center_distance),u_pitch:new u.aM(f,t.u_pitch),u_rotate_symbol:new u.aL(f,t.u_rotate_symbol),u_aspect_ratio:new u.aM(f,t.u_aspect_ratio),u_fade_change:new u.aM(f,t.u_fade_change),u_matrix:new u.aN(f,t.u_matrix),u_label_plane_matrix:new u.aN(f,t.u_label_plane_matrix),u_coord_matrix:new u.aN(f,t.u_coord_matrix),u_is_text:new u.aL(f,t.u_is_text),u_pitch_with_map:new u.aL(f,t.u_pitch_with_map),u_texsize:new u.aQ(f,t.u_texsize),u_texsize_icon:new u.aQ(f,t.u_texsize_icon),u_texture:new u.aL(f,t.u_texture),u_texture_icon:new u.aL(f,t.u_texture_icon),u_gamma_scale:new u.aM(f,t.u_gamma_scale),u_device_pixel_ratio:new u.aM(f,t.u_device_pixel_ratio),u_is_halo:new u.aL(f,t.u_is_halo)}),background:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_opacity:new u.aM(f,t.u_opacity),u_color:new u.aR(f,t.u_color)}),backgroundPattern:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_opacity:new u.aM(f,t.u_opacity),u_image:new u.aL(f,t.u_image),u_pattern_tl_a:new u.aQ(f,t.u_pattern_tl_a),u_pattern_br_a:new u.aQ(f,t.u_pattern_br_a),u_pattern_tl_b:new u.aQ(f,t.u_pattern_tl_b),u_pattern_br_b:new u.aQ(f,t.u_pattern_br_b),u_texsize:new u.aQ(f,t.u_texsize),u_mix:new u.aM(f,t.u_mix),u_pattern_size_a:new u.aQ(f,t.u_pattern_size_a),u_pattern_size_b:new u.aQ(f,t.u_pattern_size_b),u_scale_a:new u.aM(f,t.u_scale_a),u_scale_b:new u.aM(f,t.u_scale_b),u_pixel_coord_upper:new u.aQ(f,t.u_pixel_coord_upper),u_pixel_coord_lower:new u.aQ(f,t.u_pixel_coord_lower),u_tile_units_to_pixels:new u.aM(f,t.u_tile_units_to_pixels)}),terrain:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_texture:new u.aL(f,t.u_texture),u_ele_delta:new u.aM(f,t.u_ele_delta)}),terrainDepth:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_ele_delta:new u.aM(f,t.u_ele_delta)}),terrainCoords:(f,t)=>({u_matrix:new u.aN(f,t.u_matrix),u_texture:new u.aL(f,t.u_texture),u_terrain_coords_id:new u.aM(f,t.u_terrain_coords_id),u_ele_delta:new u.aM(f,t.u_ele_delta)})};class Ba{constructor(t,o,c){this.context=t;const d=t.gl;this.buffer=d.createBuffer(),this.dynamicDraw=!!c,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const o=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ho={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Oa{constructor(t,o,c,d){this.length=o.length,this.attributes=c,this.itemSize=o.bytesPerElement,this.dynamicDraw=d,this.context=t;const g=t.gl;this.buffer=g.createBuffer(),t.bindVertexBuffer.set(this.buffer),g.bufferData(g.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,o){for(let c=0;c0){const Pe=u.Z(),Xe=xe;u.aU(Pe,ge.placementInvProjMatrix,f.transform.glCoordMatrix),u.aU(Pe,Pe,ge.placementViewportMatrix),P.push({circleArray:Te,circleOffset:F,transform:Xe,invTransform:Pe,coord:oe}),M+=Te.length/4,F=M}Ee&&E.draw(b,T.LINES,St.disabled,ei.disabled,f.colorModeForRenderPass(),Kt.disabled,Kl(xe,f.transform,me),f.style.map.terrain&&f.style.map.terrain.getTerrainData(oe),o.id,Ee.layoutVertexBuffer,Ee.indexBuffer,Ee.segments,null,f.transform.zoom,null,null,Ee.collisionVertexBuffer)}if(!x||!P.length)return;const Z=f.useProgram("collisionCircle"),$=new u.aV;$.resize(4*M),$._trim();let G=0;for(const K of P)for(let oe=0;oe=0&&($[U.associatedIconIndex]={shiftedAnchor:vt,angle:Fe})}else V(U.numGlyphs,F)}if(E){Z.clear();const G=f.icon.placedSymbolArray;for(let U=0;Uf.style.map.terrain.getElevation(Ee,vn,di):null,Pi=o.layout.get("text-rotation-alignment")==="map";Re(Pe,Ee.posMatrix,f,d,Wt,Sr,U,E,Pi,hi)}const Rs=f.translatePosMatrix(Ee.posMatrix,Te,g,x),_o=re||d&&ge||ms?hu:Wt,Ki=f.translatePosMatrix(Sr,Te,g,x,!0),$i=Fe&&o.paint.get(d?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let ln;ln=Fe?Pe.iconsInText?Cs(ot.kind,_t,pe,U,f,Rs,_o,Ki,xt,Ci):eu(ot.kind,_t,pe,U,f,Rs,_o,Ki,d,xt,!0):Jl(ot.kind,_t,pe,U,f,Rs,_o,Ki,d,xt);const Fs={program:Ot,buffers:Xe,uniformValues:ln,atlasTexture:ci,atlasTextureIcon:yi,atlasInterpolation:qt,atlasInterpolationIcon:ji,isSDF:Fe,hasHalo:$i};if(K&&Pe.canOverlap){oe=!0;const hi=Xe.segments.get();for(const Pi of hi)xe.push({segments:new u.S([Pi]),sortKey:Pi.sortKey,state:Fs,terrainData:mt})}else xe.push({segments:Xe.segments,sortKey:0,state:Fs,terrainData:mt})}oe&&xe.sort((Ee,Te)=>Ee.sortKey-Te.sortKey);for(const Ee of xe){const Te=Ee.state;if(F.activeTexture.set(Z.TEXTURE0),Te.atlasTexture.bind(Te.atlasInterpolation,Z.CLAMP_TO_EDGE),Te.atlasTextureIcon&&(F.activeTexture.set(Z.TEXTURE1),Te.atlasTextureIcon&&Te.atlasTextureIcon.bind(Te.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),Te.isSDF){const Pe=Te.uniformValues;Te.hasHalo&&(Pe.u_is_halo=1,pu(Te.buffers,Ee.segments,o,f,Te.program,me,P,M,Pe,Ee.terrainData)),Pe.u_is_halo=0}pu(Te.buffers,Ee.segments,o,f,Te.program,me,P,M,Te.uniformValues,Ee.terrainData)}}function pu(f,t,o,c,d,g,x,b,T,E){const P=c.context;d.draw(P,P.gl.TRIANGLES,g,x,b,Kt.disabled,T,E,o.id,f.layoutVertexBuffer,f.indexBuffer,t,o.paint,c.transform.zoom,f.programConfigurations.get(o.id),f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer)}function Xo(f,t,o,c,d){if(!o||!c||!c.imageAtlas)return;const g=c.imageAtlas.patternPositions;let x=g[o.to.toString()],b=g[o.from.toString()];if(!x&&b&&(x=b),!b&&x&&(b=x),!x||!b){const T=d.getPaintProperty(t);x=g[T],b=g[T]}x&&b&&f.setConstantPatternPositions(x,b)}function Ko(f,t,o,c,d,g,x){const b=f.context.gl,T="fill-pattern",E=o.paint.get(T),P=E&&E.constantOr(1),M=o.getCrossfadeParameters();let F,Z,$,G,U;x?(Z=P&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",F=b.LINES):(Z=P?"fillPattern":"fill",F=b.TRIANGLES);const re=E.constantOr(null);for(const pe of c){const K=t.getTile(pe);if(P&&!K.patternsLoaded())continue;const oe=K.getBucket(o);if(!oe)continue;const me=oe.programConfigurations.get(o.id),ge=f.useProgram(Z,me),xe=f.style.map.terrain&&f.style.map.terrain.getTerrainData(pe);P&&(f.context.activeTexture.set(b.TEXTURE0),K.imageAtlasTexture.bind(b.LINEAR,b.CLAMP_TO_EDGE),me.updatePaintBuffers(M)),Xo(me,T,re,K,o);const Ee=xe?pe:null,Te=f.translatePosMatrix(Ee?Ee.posMatrix:pe.posMatrix,K,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(x){G=oe.indexBuffer2,U=oe.segments2;const Pe=[b.drawingBufferWidth,b.drawingBufferHeight];$=Z==="fillOutlinePattern"&&P?Da(Te,f,M,K,Pe):Aa(Te,Pe)}else G=oe.indexBuffer,U=oe.segments,$=P?Xl(Te,f,M,K):Wc(Te);ge.draw(f.context,F,d,f.stencilModeForClipping(pe),g,Kt.disabled,$,xe,o.id,oe.layoutVertexBuffer,G,U,o.paint,f.transform.zoom,me)}}function Yo(f,t,o,c,d,g,x){const b=f.context,T=b.gl,E="fill-extrusion-pattern",P=o.paint.get(E),M=P.constantOr(1),F=o.getCrossfadeParameters(),Z=o.paint.get("fill-extrusion-opacity"),$=P.constantOr(null);for(const G of c){const U=t.getTile(G),re=U.getBucket(o);if(!re)continue;const pe=f.style.map.terrain&&f.style.map.terrain.getTerrainData(G),K=re.programConfigurations.get(o.id),oe=f.useProgram(M?"fillExtrusionPattern":"fillExtrusion",K);M&&(f.context.activeTexture.set(T.TEXTURE0),U.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),K.updatePaintBuffers(F)),Xo(K,E,$,U,o);const me=f.translatePosMatrix(G.posMatrix,U,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),ge=o.paint.get("fill-extrusion-vertical-gradient"),xe=M?us(me,f,ge,Z,G,F,U):Wl(me,f,ge,Z);oe.draw(b,b.gl.TRIANGLES,d,g,x,Kt.backCCW,xe,pe,o.id,re.layoutVertexBuffer,re.indexBuffer,re.segments,o.paint,f.transform.zoom,K,f.style.map.terrain&&re.centroidVertexBuffer)}}function Pp(f,t,o,c,d,g,x){const b=f.context,T=b.gl,E=o.fbo;if(!E)return;const P=f.useProgram("hillshade"),M=f.style.map.terrain&&f.style.map.terrain.getTerrainData(t);b.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,E.colorAttachment.get()),P.draw(b,T.TRIANGLES,d,g,x,Kt.disabled,((F,Z,$,G)=>{const U=$.paint.get("hillshade-shadow-color"),re=$.paint.get("hillshade-highlight-color"),pe=$.paint.get("hillshade-accent-color");let K=$.paint.get("hillshade-illumination-direction")*(Math.PI/180);$.paint.get("hillshade-illumination-anchor")==="viewport"&&(K-=F.transform.angle);const oe=!F.options.moving;return{u_matrix:G?G.posMatrix:F.transform.calculatePosMatrix(Z.tileID.toUnwrapped(),oe),u_image:0,u_latrange:Yl(0,Z.tileID),u_light:[$.paint.get("hillshade-exaggeration"),K],u_shadow:U,u_highlight:re,u_accent:pe}})(f,o,c,M?t:null),M,c.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments)}function fu(f,t,o,c,d,g){const x=f.context,b=x.gl,T=t.dem;if(T&&T.data){const E=T.dim,P=T.stride,M=T.getPixels();if(x.activeTexture.set(b.TEXTURE1),x.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||f.getTileTexture(P),t.demTexture){const Z=t.demTexture;Z.update(M,{premultiply:!1}),Z.bind(b.NEAREST,b.CLAMP_TO_EDGE)}else t.demTexture=new Ge(x,M,b.RGBA,{premultiply:!1}),t.demTexture.bind(b.NEAREST,b.CLAMP_TO_EDGE);x.activeTexture.set(b.TEXTURE0);let F=t.fbo;if(!F){const Z=new Ge(x,{width:E,height:E,data:null},b.RGBA);Z.bind(b.LINEAR,b.CLAMP_TO_EDGE),F=t.fbo=x.createFramebuffer(E,E,!0,!1),F.colorAttachment.set(Z.texture)}x.bindFramebuffer.set(F.framebuffer),x.viewport.set([0,0,E,E]),f.useProgram("hillshadePrepare").draw(x,b.TRIANGLES,c,d,g,Kt.disabled,((Z,$)=>{const G=$.stride,U=u.Z();return u.aS(U,0,u.N,-u.N,0,0,1),u.$(U,U,[0,-u.N,0]),{u_matrix:U,u_image:1,u_dimension:[G,G],u_zoom:Z.overscaledZ,u_unpack:$.getUnpackVector()}})(t.tileID,T),null,o.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Mp(f,t,o,c,d,g){const x=c.paint.get("raster-fade-duration");if(!g&&x>0){const b=u.h.now(),T=(b-f.timeAdded)/x,E=t?(b-t.timeAdded)/x:-1,P=o.getSource(),M=d.coveringZoomLevel({tileSize:P.tileSize,roundZoom:P.roundZoom}),F=!t||Math.abs(t.tileID.overscaledZ-M)>Math.abs(f.tileID.overscaledZ-M),Z=F&&f.refreshedUponExpiration?1:u.ad(F?T:1-E,0,1);return f.refreshedUponExpiration&&T>=1&&(f.refreshedUponExpiration=!1),t?{opacity:1,mix:1-Z}:{opacity:Z,mix:0}}return{opacity:1,mix:0}}const lh=new u.aT(1,0,0,1),Wa=new u.aT(0,1,0,1),mu=new u.aT(0,0,1,1),uh=new u.aT(1,0,1,1),ch=new u.aT(0,1,1,1);function Qo(f,t,o,c){Ka(f,0,t+o/2,f.transform.width,o,c)}function Xa(f,t,o,c){Ka(f,t-o/2,0,o,f.transform.height,c)}function Ka(f,t,o,c,d,g){const x=f.context,b=x.gl;b.enable(b.SCISSOR_TEST),b.scissor(t*f.pixelRatio,o*f.pixelRatio,c*f.pixelRatio,d*f.pixelRatio),x.clear({color:g}),b.disable(b.SCISSOR_TEST)}function hh(f,t,o){const c=f.context,d=c.gl,g=o.posMatrix,x=f.useProgram("debug"),b=St.disabled,T=ei.disabled,E=f.colorModeForRenderPass(),P="$debug",M=f.style.map.terrain&&f.style.map.terrain.getTerrainData(o);c.activeTexture.set(d.TEXTURE0);const F=t.getTileByID(o.key).latestRawTileData,Z=Math.floor((F&&F.byteLength||0)/1024),$=t.getTile(o).tileSize,G=512/Math.min($,512)*(o.overscaledZ/f.transform.zoom)*.5;let U=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(U+=` => ${o.overscaledZ}`),function(re,pe){re.initDebugOverlayCanvas();const K=re.debugOverlayCanvas,oe=re.context.gl,me=re.debugOverlayCanvas.getContext("2d");me.clearRect(0,0,K.width,K.height),me.shadowColor="white",me.shadowBlur=2,me.lineWidth=1.5,me.strokeStyle="white",me.textBaseline="top",me.font="bold 36px Open Sans, sans-serif",me.fillText(pe,5,5),me.strokeText(pe,5,5),re.debugOverlayTexture.update(K),re.debugOverlayTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE)}(f,`${U} ${Z}kB`),x.draw(c,d.TRIANGLES,b,T,Jt.alphaBlended,Kt.disabled,Go(g,u.aT.transparent,G),null,P,f.debugBuffer,f.quadTriangleIndexBuffer,f.debugSegments),x.draw(c,d.LINE_STRIP,b,T,E,Kt.disabled,Go(g,u.aT.red),M,P,f.debugBuffer,f.tileBorderIndexBuffer,f.debugSegments)}function si(f,t,o){const c=f.context,d=c.gl,g=f.colorModeForRenderPass(),x=new St(d.LEQUAL,St.ReadWrite,f.depthRangeFor3D),b=f.useProgram("terrain"),T=t.getTerrainMesh();c.bindFramebuffer.set(null),c.viewport.set([0,0,f.width,f.height]);for(const E of o){const P=f.renderToTexture.getTexture(E),M=t.getTerrainData(E.tileID);c.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,P.texture);const F={u_matrix:f.transform.calculatePosMatrix(E.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(f.transform.zoom)};b.draw(c,d.TRIANGLES,x,ei.disabled,g,Kt.backCCW,F,M,"terrain",T.vertexBuffer,T.indexBuffer,T.segments)}}class zs{constructor(t,o){this.context=new Cp(t),this.transform=o,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:u.Z(),renderTime:0},this.setup(),this.numSublayers=gn.maxUnderzooming+gn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Pa}resize(t,o,c){if(this.width=Math.floor(t*c),this.height=Math.floor(o*c),this.pixelRatio=c,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const d of this.style._order)this.style._layers[d].resize()}setup(){const t=this.context,o=new u.a_;o.emplaceBack(0,0),o.emplaceBack(u.N,0),o.emplaceBack(0,u.N),o.emplaceBack(u.N,u.N),this.tileExtentBuffer=t.createVertexBuffer(o,Ma.members),this.tileExtentSegments=u.S.simpleSegment(0,0,4,2);const c=new u.a_;c.emplaceBack(0,0),c.emplaceBack(u.N,0),c.emplaceBack(0,u.N),c.emplaceBack(u.N,u.N),this.debugBuffer=t.createVertexBuffer(c,Ma.members),this.debugSegments=u.S.simpleSegment(0,0,4,5);const d=new u.V;d.emplaceBack(0,0,0,0),d.emplaceBack(u.N,0,u.N,0),d.emplaceBack(0,u.N,0,u.N),d.emplaceBack(u.N,u.N,u.N,u.N),this.rasterBoundsBuffer=t.createVertexBuffer(d,Pn.members),this.rasterBoundsSegments=u.S.simpleSegment(0,0,4,2);const g=new u.a_;g.emplaceBack(0,0),g.emplaceBack(1,0),g.emplaceBack(0,1),g.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(g,Ma.members),this.viewportSegments=u.S.simpleSegment(0,0,4,2);const x=new u.a$;x.emplaceBack(0),x.emplaceBack(1),x.emplaceBack(3),x.emplaceBack(2),x.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(x);const b=new u.b0;b.emplaceBack(0,1,2),b.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(b);const T=this.context.gl;this.stencilClearMode=new ei({func:T.ALWAYS,mask:0},0,255,T.ZERO,T.ZERO,T.ZERO)}clearStencil(){const t=this.context,o=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const c=u.Z();u.aS(c,0,this.width,this.height,0,0,1),u.a0(c,c,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,o.TRIANGLES,St.disabled,this.stencilClearMode,Jt.disabled,Kt.disabled,Xc(c),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,o){if(this.currentStencilSource===t.source||!t.isTileClipped()||!o||!o.length)return;this.currentStencilSource=t.source;const c=this.context,d=c.gl;this.nextStencilID+o.length>256&&this.clearStencil(),c.setColorMode(Jt.disabled),c.setDepthMode(St.disabled);const g=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const x of o){const b=this._tileClippingMaskIDs[x.key]=this.nextStencilID++,T=this.style.map.terrain&&this.style.map.terrain.getTerrainData(x);g.draw(c,d.TRIANGLES,St.disabled,new ei({func:d.ALWAYS,mask:0},b,255,d.KEEP,d.KEEP,d.REPLACE),Jt.disabled,Kt.disabled,Xc(x.posMatrix),T,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,o=this.context.gl;return new ei({func:o.NOTEQUAL,mask:255},t,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(t){const o=this.context.gl;return new ei({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(t){const o=this.context.gl,c=t.sort((x,b)=>b.overscaledZ-x.overscaledZ),d=c[c.length-1].overscaledZ,g=c[0].overscaledZ-d+1;if(g>1){this.currentStencilSource=void 0,this.nextStencilID+g>256&&this.clearStencil();const x={};for(let b=0;b=0;this.currentLayer--){const T=this.style._layers[c[this.currentLayer]],E=d[T.source],P=g[T.source];this._renderTileClippingMasks(T,P),this.renderLayer(this,E,T,P)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerU.source&&!U.isHidden(P)?[E.sourceCaches[U.source]]:[]),Z=F.filter(U=>U.getSource().type==="vector"),$=F.filter(U=>U.getSource().type!=="vector"),G=U=>{(!M||M.getSource().maxzoomG(U)),M||$.forEach(U=>G(U)),M}(this.style,this.transform.zoom);T&&function(E,P,M){for(let F=0;FZ.style.map.terrain.getElevation(ge,ot,Ye):null)}}}(T,g,b,x,b.layout.get("text-rotation-alignment"),b.layout.get("text-pitch-alignment"),E),b.paint.get("icon-opacity").constantOr(1)!==0&&Ha(g,x,b,T,!1,b.paint.get("icon-translate"),b.paint.get("icon-translate-anchor"),b.layout.get("icon-rotation-alignment"),b.layout.get("icon-pitch-alignment"),b.layout.get("icon-keep-upright"),P,M),b.paint.get("text-opacity").constantOr(1)!==0&&Ha(g,x,b,T,!0,b.paint.get("text-translate"),b.paint.get("text-translate-anchor"),b.layout.get("text-rotation-alignment"),b.layout.get("text-pitch-alignment"),b.layout.get("text-keep-upright"),P,M),x.map.showCollisionBoxes&&(ah(g,x,b,T,b.paint.get("text-translate"),b.paint.get("text-translate-anchor"),!0),ah(g,x,b,T,b.paint.get("icon-translate"),b.paint.get("icon-translate-anchor"),!1))})(t,o,c,d,this.style.placement.variableOffsets);break;case"circle":(function(g,x,b,T){if(g.renderPass!=="translucent")return;const E=b.paint.get("circle-opacity"),P=b.paint.get("circle-stroke-width"),M=b.paint.get("circle-stroke-opacity"),F=!b.layout.get("circle-sort-key").isConstant();if(E.constantOr(1)===0&&(P.constantOr(1)===0||M.constantOr(1)===0))return;const Z=g.context,$=Z.gl,G=g.depthModeForSublayer(0,St.ReadOnly),U=ei.disabled,re=g.colorModeForRenderPass(),pe=[];for(let K=0;KK.sortKey-oe.sortKey);for(const K of pe){const{programConfiguration:oe,program:me,layoutVertexBuffer:ge,indexBuffer:xe,uniformValues:Ee,terrainData:Te}=K.state;me.draw(Z,$.TRIANGLES,G,U,re,Kt.disabled,Ee,Te,b.id,ge,xe,K.segments,b.paint,g.transform.zoom,oe)}})(t,o,c,d);break;case"heatmap":(function(g,x,b,T){if(b.paint.get("heatmap-opacity")!==0)if(g.renderPass==="offscreen"){const E=g.context,P=E.gl,M=ei.disabled,F=new Jt([P.ONE,P.ONE],u.aT.transparent,[!0,!0,!0,!0]);(function(Z,$,G){const U=Z.gl;Z.activeTexture.set(U.TEXTURE1),Z.viewport.set([0,0,$.width/4,$.height/4]);let re=G.heatmapFbo;if(re)U.bindTexture(U.TEXTURE_2D,re.colorAttachment.get()),Z.bindFramebuffer.set(re.framebuffer);else{const pe=U.createTexture();U.bindTexture(U.TEXTURE_2D,pe),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_S,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_T,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MIN_FILTER,U.LINEAR),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MAG_FILTER,U.LINEAR),re=G.heatmapFbo=Z.createFramebuffer($.width/4,$.height/4,!1,!1),function(K,oe,me,ge){var xe,Ee;const Te=K.gl,Pe=(xe=K.HALF_FLOAT)!==null&&xe!==void 0?xe:Te.UNSIGNED_BYTE,Xe=(Ee=K.RGBA16F)!==null&&Ee!==void 0?Ee:Te.RGBA;Te.texImage2D(Te.TEXTURE_2D,0,Xe,oe.width/4,oe.height/4,0,Te.RGBA,Pe,null),ge.colorAttachment.set(me)}(Z,$,pe,re)}})(E,g,b),E.clear({color:u.aT.transparent});for(let Z=0;Z{const K=u.Z();u.aS(K,0,G.width,G.height,0,0,1);const oe=G.context.gl;return{u_matrix:K,u_world:[oe.drawingBufferWidth,oe.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:U.paint.get("heatmap-opacity")}})(E,P),null,P.id,E.viewportBuffer,E.quadTriangleIndexBuffer,E.viewportSegments,P.paint,E.transform.zoom)}(g,b))})(t,o,c,d);break;case"line":(function(g,x,b,T){if(g.renderPass!=="translucent")return;const E=b.paint.get("line-opacity"),P=b.paint.get("line-width");if(E.constantOr(1)===0||P.constantOr(1)===0)return;const M=g.depthModeForSublayer(0,St.ReadOnly),F=g.colorModeForRenderPass(),Z=b.paint.get("line-dasharray"),$=b.paint.get("line-pattern"),G=$.constantOr(1),U=b.paint.get("line-gradient"),re=b.getCrossfadeParameters(),pe=G?"linePattern":Z?"lineSDF":U?"lineGradient":"line",K=g.context,oe=K.gl;let me=!0;for(const ge of T){const xe=x.getTile(ge);if(G&&!xe.patternsLoaded())continue;const Ee=xe.getBucket(b);if(!Ee)continue;const Te=Ee.programConfigurations.get(b.id),Pe=g.context.program.get(),Xe=g.useProgram(pe,Te),vt=me||Xe.program!==Pe,Fe=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ge),ot=$.constantOr(null);if(ot&&xe.imageAtlas){const _t=xe.imageAtlas,mt=_t.patternPositions[ot.to.toString()],xt=_t.patternPositions[ot.from.toString()];mt&&xt&&Te.setConstantPatternPositions(mt,xt)}const Ye=Fe?ge:null,Ot=G?wp(g,xe,b,re,Ye):Z?Yc(g,xe,b,Z,re,Ye):U?Kc(g,xe,b,Ee.lineClipsArray.length,Ye):Ql(g,xe,b,Ye);if(G)K.activeTexture.set(oe.TEXTURE0),xe.imageAtlasTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE),Te.updatePaintBuffers(re);else if(Z&&(vt||g.lineAtlas.dirty))K.activeTexture.set(oe.TEXTURE0),g.lineAtlas.bind(K);else if(U){const _t=Ee.gradients[b.id];let mt=_t.texture;if(b.gradientVersion!==_t.version){let xt=256;if(b.stepInterpolant){const ci=x.getSource().maxzoom,qt=ge.canonical.z===ci?Math.ceil(1<0?o.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const o=this.imageManager.getPattern(t.from.toString()),c=this.imageManager.getPattern(t.to.toString());return!o||!c}useProgram(t,o){this.cache=this.cache||{};const c=t+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[c]||(this.cache[c]=new za(this.context,Qt[t],o,Fa[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[c]}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(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ge(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:o}=this.context.gl;return this.width!==t||this.height!==o}}class yn{constructor(t,o){this.points=t,this.planes=o}static fromInvProjectionMatrix(t,o,c){const d=Math.pow(2,c),g=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(b=>{const T=1/(b=u.ag([],b,t))[3]/o*d;return u.b3(b,b,[T,T,1/b[3],T])}),x=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(b=>{const T=function(F,Z){var $=Z[0],G=Z[1],U=Z[2],re=$*$+G*G+U*U;return re>0&&(re=1/Math.sqrt(re)),F[0]=Z[0]*re,F[1]=Z[1]*re,F[2]=Z[2]*re,F}([],function(F,Z,$){var G=Z[0],U=Z[1],re=Z[2],pe=$[0],K=$[1],oe=$[2];return F[0]=U*oe-re*K,F[1]=re*pe-G*oe,F[2]=G*K-U*pe,F}([],He([],g[b[0]],g[b[1]]),He([],g[b[2]],g[b[1]]))),E=-((P=T)[0]*(M=g[b[1]])[0]+P[1]*M[1]+P[2]*M[2]);var P,M;return T.concat(E)});return new yn(g,x)}}class ho{constructor(t,o){this.min=t,this.max=o,this.center=function(c,d,g){return c[0]=.5*d[0],c[1]=.5*d[1],c[2]=.5*d[2],c}([],function(c,d,g){return c[0]=d[0]+g[0],c[1]=d[1]+g[1],c[2]=d[2]+g[2],c}([],this.min,this.max))}quadrant(t){const o=[t%2==0,t<2],c=Se(this.min),d=Se(this.max);for(let g=0;g=0&&x++;if(x===0)return 0;x!==o.length&&(c=!1)}if(c)return 2;for(let d=0;d<3;d++){let g=Number.MAX_VALUE,x=-Number.MAX_VALUE;for(let b=0;bthis.max[d]-this.min[d])return 0}return 1}}class Jo{constructor(t=0,o=0,c=0,d=0){if(isNaN(t)||t<0||isNaN(o)||o<0||isNaN(c)||c<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=o,this.left=c,this.right=d}interpolate(t,o,c){return o.top!=null&&t.top!=null&&(this.top=u.B.number(t.top,o.top,c)),o.bottom!=null&&t.bottom!=null&&(this.bottom=u.B.number(t.bottom,o.bottom,c)),o.left!=null&&t.left!=null&&(this.left=u.B.number(t.left,o.left,c)),o.right!=null&&t.right!=null&&(this.right=u.B.number(t.right,o.right,c)),this}getCenter(t,o){const c=u.ad((this.left+t-this.right)/2,0,t),d=u.ad((this.top+o-this.bottom)/2,0,o);return new u.P(c,d)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Jo(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ya{constructor(t,o,c,d,g){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=g===void 0||!!g,this._minZoom=t||0,this._maxZoom=o||22,this._minPitch=c??0,this._maxPitch=d??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Jo,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new Ya(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new u.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const o=-u.b5(t,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=function(){var c=new u.A(4);return u.A!=Float32Array&&(c[1]=0,c[2]=0),c[0]=1,c[3]=1,c}(),function(c,d,g){var x=d[0],b=d[1],T=d[2],E=d[3],P=Math.sin(g),M=Math.cos(g);c[0]=x*M+T*P,c[1]=b*M+E*P,c[2]=x*-P+T*M,c[3]=b*-P+E*M}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const o=u.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const o=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.tileZoom=Math.max(0,Math.floor(o)),this.scale=this.zoomScale(o),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,o,c){this._unmodified=!1,this._edgeInsets.interpolate(t,o,c),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const o=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,o)}getVisibleUnwrappedCoordinates(t){const o=[new u.b6(0,t)];if(this._renderWorldCopies){const c=this.pointCoordinate(new u.P(0,0)),d=this.pointCoordinate(new u.P(this.width,0)),g=this.pointCoordinate(new u.P(this.width,this.height)),x=this.pointCoordinate(new u.P(0,this.height)),b=Math.floor(Math.min(c.x,d.x,g.x,x.x)),T=Math.floor(Math.max(c.x,d.x,g.x,x.x)),E=1;for(let P=b-E;P<=T+E;P++)P!==0&&o.push(new u.b6(P,t))}return o}coveringTiles(t){var o,c;let d=this.coveringZoomLevel(t);const g=d;if(t.minzoom!==void 0&&dt.maxzoom&&(d=t.maxzoom);const x=this.pointCoordinate(this.getCameraPoint()),b=u.U.fromLngLat(this.center),T=Math.pow(2,d),E=[T*x.x,T*x.y,0],P=[T*b.x,T*b.y,0],M=yn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,d);let F=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(F=d);const Z=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,$=K=>({aabb:new ho([K*T,0,0],[(K+1)*T,T,0]),zoom:0,x:0,y:0,wrap:K,fullyVisible:!1}),G=[],U=[],re=d,pe=t.reparseOverscaled?g:d;if(this._renderWorldCopies)for(let K=1;K<=3;K++)G.push($(-K)),G.push($(K));for(G.push($(0));G.length>0;){const K=G.pop(),oe=K.x,me=K.y;let ge=K.fullyVisible;if(!ge){const Xe=K.aabb.intersects(M);if(Xe===0)continue;ge=Xe===2}const xe=t.terrain?E:P,Ee=K.aabb.distanceX(xe),Te=K.aabb.distanceY(xe),Pe=Math.max(Math.abs(Ee),Math.abs(Te));if(K.zoom===re||Pe>Z+(1<=F){const Xe=re-K.zoom,vt=E[0]-.5-(oe<>1),ot=K.zoom+1;let Ye=K.aabb.quadrant(Xe);if(t.terrain){const Ot=new u.O(ot,K.wrap,ot,vt,Fe),_t=t.terrain.getMinMaxElevation(Ot),mt=(o=_t.minElevation)!==null&&o!==void 0?o:this.elevation,xt=(c=_t.maxElevation)!==null&&c!==void 0?c:this.elevation;Ye=new ho([Ye.min[0],Ye.min[1],mt],[Ye.max[0],Ye.max[1],xt])}G.push({aabb:Ye,zoom:ot,x:vt,y:Fe,wrap:K.wrap,fullyVisible:ge})}}return U.sort((K,oe)=>K.distanceSq-oe.distanceSq).map(K=>K.tileID)}resize(t,o){this.width=t,this.height=o,this.pixelsToGLUnits=[2/t,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const o=u.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.P(u.G(t.lng)*this.worldSize,u.H(o)*this.worldSize)}unproject(t){return new u.U(t.x/this.worldSize,t.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(t){const o=this.pointLocation(this.centerPoint,t),c=t.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-c))return;const d=this.getCameraPosition(),g=u.U.fromLngLat(d.lngLat,d.altitude),x=u.U.fromLngLat(o,c),b=g.x-x.x,T=g.y-x.y,E=g.z-x.z,P=Math.sqrt(b*b+T*T+E*E),M=this.scaleZoom(this.cameraToCenterDistance/P/this.tileSize);this._elevation=c,this._center=o,this.zoom=M}setLocationAtPoint(t,o){const c=this.pointCoordinate(o),d=this.pointCoordinate(this.centerPoint),g=this.locationCoordinate(t),x=new u.U(g.x-(c.x-d.x),g.y-(c.y-d.y));this.center=this.coordinateLocation(x),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,o){return o?this.coordinatePoint(this.locationCoordinate(t),o.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,o){return this.coordinateLocation(this.pointCoordinate(t,o))}locationCoordinate(t){return u.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,o){if(o){const F=o.pointCoordinate(t);if(F!=null)return F}const c=[t.x,t.y,0,1],d=[t.x,t.y,1,1];u.ag(c,c,this.pixelMatrixInverse),u.ag(d,d,this.pixelMatrixInverse);const g=c[3],x=d[3],b=c[1]/g,T=d[1]/x,E=c[2]/g,P=d[2]/x,M=E===P?0:(0-E)/(P-E);return new u.U(u.B.number(c[0]/g,d[0]/x,M)/this.worldSize,u.B.number(b,T,M)/this.worldSize)}coordinatePoint(t,o=0,c=this.pixelMatrix){const d=[t.x*this.worldSize,t.y*this.worldSize,o,1];return u.ag(d,d,c),new u.P(d[0]/d[3],d[1]/d[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new It().extend(this.pointLocation(new u.P(0,t))).extend(this.pointLocation(new u.P(this.width,t))).extend(this.pointLocation(new u.P(this.width,this.height))).extend(this.pointLocation(new u.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new It([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(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,o=!1){const c=t.key,d=o?this._alignedPosMatrixCache:this._posMatrixCache;if(d[c])return d[c];const g=t.canonical,x=this.worldSize/this.zoomScale(g.z),b=g.x+Math.pow(2,g.z)*t.wrap,T=u.ao(new Float64Array(16));return u.$(T,T,[b*x,g.y*x,0]),u.a0(T,T,[x/u.N,x/u.N,1]),u.a1(T,o?this.alignedProjMatrix:this.projMatrix,T),d[c]=new Float32Array(T),d[c]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,o,c,d,g=-90,x=90,b=-180,T=180;const E=this.size,P=this._unmodified;if(this.latRange){const Z=this.latRange;g=u.H(Z[1])*this.worldSize,x=u.H(Z[0])*this.worldSize,t=x-gx&&(d=x-$)}if(this.lngRange){const Z=(b+T)/2,$=u.b5(M.x,Z-this.worldSize/2,Z+this.worldSize/2),G=E.x/2;$-GT&&(c=T-G)}c===void 0&&d===void 0||(this.center=this.unproject(new u.P(c!==void 0?c:M.x,d!==void 0?d:M.y)).wrap()),this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,o=this.point.x,c=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=u.b7(1,this.center.lat)*this.worldSize;let d=u.ao(new Float64Array(16));u.a0(d,d,[this.width/2,-this.height/2,1]),u.$(d,d,[1,-1,0]),this.labelPlaneMatrix=d,d=u.ao(new Float64Array(16)),u.a0(d,d,[1,-1,1]),u.$(d,d,[-1,-1,0]),u.a0(d,d,[2/this.width,2/this.height,1]),this.glCoordMatrix=d;const g=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),x=Math.min(this.elevation,this._minEleveationForCurrentTile),b=g-x*this._pixelPerMeter/Math.cos(this._pitch),T=x<0?b:g,E=Math.PI/2+this._pitch,P=this._fov*(.5+t.y/this.height),M=Math.sin(P)*T/Math.sin(u.ad(Math.PI-E-P,.01,Math.PI-.01)),F=this.getHorizon(),Z=2*Math.atan(F/this.cameraToCenterDistance)*(.5+t.y/(2*F)),$=Math.sin(Z)*T/Math.sin(u.ad(Math.PI-E-Z,.01,Math.PI-.01)),G=Math.min(M,$),U=1.01*(Math.cos(Math.PI/2-this._pitch)*G+T),re=this.height/50;d=new Float64Array(16),u.b8(d,this._fov,this.width/this.height,re,U),d[8]=2*-t.x/this.width,d[9]=2*t.y/this.height,u.a0(d,d,[1,-1,1]),u.$(d,d,[0,0,-this.cameraToCenterDistance]),u.b9(d,d,this._pitch),u.ae(d,d,this.angle),u.$(d,d,[-o,-c,0]),this.mercatorMatrix=u.a0([],d,[this.worldSize,this.worldSize,this.worldSize]),u.a0(d,d,[1,1,this._pixelPerMeter]),this.pixelMatrix=u.a1(new Float64Array(16),this.labelPlaneMatrix,d),u.$(d,d,[0,0,-this.elevation]),this.projMatrix=d,this.invProjMatrix=u.as([],d),this.pixelMatrix3D=u.a1(new Float64Array(16),this.labelPlaneMatrix,d);const pe=this.width%2/2,K=this.height%2/2,oe=Math.cos(this.angle),me=Math.sin(this.angle),ge=o-Math.round(o)+oe*pe+me*K,xe=c-Math.round(c)+oe*K+me*pe,Ee=new Float64Array(d);if(u.$(Ee,Ee,[ge>.5?ge-1:ge,xe>.5?xe-1:xe,0]),this.alignedProjMatrix=Ee,d=u.as(new Float64Array(16),this.pixelMatrix),!d)throw new Error("failed to invert matrix");this.pixelMatrixInverse=d,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new u.P(0,0)),o=[t.x*this.worldSize,t.y*this.worldSize,0,1];return u.ag(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.P(0,t))}getCameraQueryGeometry(t){const o=this.getCameraPoint();if(t.length===1)return[t[0],o];{let c=o.x,d=o.y,g=o.x,x=o.y;for(const b of t)c=Math.min(c,b.x),d=Math.min(d,b.y),g=Math.max(g,b.x),x=Math.max(x,b.y);return[new u.P(c,d),new u.P(g,d),new u.P(g,x),new u.P(c,x),new u.P(c,d)]}}}function As(f,t){let o,c=!1,d=null,g=null;const x=()=>{d=null,c&&(f.apply(g,o),d=setTimeout(x,t),c=!1)};return(...b)=>(c=!0,g=this,o=b,d||x(),d)}class ea{constructor(t){this._getCurrentHash=()=>{const o=window.location.hash.replace("#","");if(this._hashName){let c;return o.split("&").map(d=>d.split("=")).forEach(d=>{d[0]===this._hashName&&(c=d)}),(c&&c[1]||"").split("/")}return o.split("/")},this._onHashChange=()=>{const o=this._getCurrentHash();if(o.length>=3&&!o.some(c=>isNaN(c))){const c=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(o[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:c,pitch:+(o[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const o=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,o)}catch{}},this._updateHash=As(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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()),delete this._map,this}getHashString(t){const o=this._map.getCenter(),c=Math.round(100*this._map.getZoom())/100,d=Math.ceil((c*Math.LN2+Math.log(512/360/.5))/Math.LN10),g=Math.pow(10,d),x=Math.round(o.lng*g)/g,b=Math.round(o.lat*g)/g,T=this._map.getBearing(),E=this._map.getPitch();let P="";if(P+=t?`/${x}/${b}/${c}`:`${c}/${b}/${x}`,(T||E)&&(P+="/"+Math.round(10*T)/10),E&&(P+=`/${Math.round(E)}`),this._hashName){const M=this._hashName;let F=!1;const Z=window.location.hash.slice(1).split("&").map($=>{const G=$.split("=")[0];return G===M?(F=!0,`${G}=${P}`):$}).filter($=>$);return F||Z.push(`${M}=${P}`),`#${Z.join("&")}`}return`#${P}`}}const po={linearity:.3,easing:u.ba(0,0,.3,1)},dh=u.e({deceleration:2500,maxSpeed:1400},po),ph=u.e({deceleration:20,maxSpeed:1400},po),fh=u.e({deceleration:1e3,maxSpeed:360},po),mh=u.e({deceleration:1e3,maxSpeed:90},po);class gh{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,o=u.h.now();for(;t.length>0&&o-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const o={zoom:0,bearing:0,pitch:0,pan:new u.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:g}of this._inertiaBuffer)o.zoom+=g.zoomDelta||0,o.bearing+=g.bearingDelta||0,o.pitch+=g.pitchDelta||0,g.panDelta&&o.pan._add(g.panDelta),g.around&&(o.around=g.around),g.pinchAround&&(o.pinchAround=g.pinchAround);const c=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(o.pan.mag()){const g=ta(o.pan.mag(),c,u.e({},dh,t||{}));d.offset=o.pan.mult(g.amount/o.pan.mag()),d.center=this._map.transform.center,br(d,g)}if(o.zoom){const g=ta(o.zoom,c,ph);d.zoom=this._map.transform.zoom+g.amount,br(d,g)}if(o.bearing){const g=ta(o.bearing,c,fh);d.bearing=this._map.transform.bearing+u.ad(g.amount,-179,179),br(d,g)}if(o.pitch){const g=ta(o.pitch,c,mh);d.pitch=this._map.transform.pitch+g.amount,br(d,g)}if(d.zoom||d.bearing){const g=o.pinchAround===void 0?o.around:o.pinchAround;d.around=g?this._map.unproject(g):this._map.getCenter()}return this.clear(),u.e(d,{noMoveStart:!0})}}function br(f,t){(!f.duration||f.durationo.unproject(T)),b=g.reduce((T,E,P,M)=>T.add(E.div(M.length)),new u.P(0,0));super(t,{points:g,point:b,lngLats:x,lngLat:o.unproject(b),originalEvent:c}),this._defaultPrevented=!1}}class yh extends u.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,o,c){super(t,{originalEvent:c}),this._defaultPrevented=!1}}class _h{constructor(t,o){this._map=t,this._clickTolerance=o.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new yh(t.type,this._map,t))}mousedown(t,o){return this._mousedownPos=o,this._firePreventable(new Dn(t.type,this._map,t))}mouseup(t){this._map.fire(new Dn(t.type,this._map,t))}click(t,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new Dn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Dn(t.type,this._map,t))}mouseover(t){this._map.fire(new Dn(t.type,this._map,t))}mouseout(t){this._map.fire(new Dn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ia(t.type,this._map,t))}touchmove(t){this._map.fire(new ia(t.type,this._map,t))}touchend(t){this._map.fire(new ia(t.type,this._map,t))}touchcancel(t){this._map.fire(new ia(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vh{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Dn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Dn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Vr{constructor(t){this._map=t}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(t){return this.transform.pointLocation(u.P.convert(t),this._map.terrain)}}class xh{constructor(t,o){this._map=t,this._tr=new Vr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,o){this.isEnabled()&&t.shiftKey&&t.button===0&&(L.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(t,o){if(!this._active)return;const c=o;if(this._lastPos.equals(c)||!this._box&&c.dist(this._startPos)g.fitScreenCoordinates(c,d,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(L.remove(this._box),this._box=null),L.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,o){return this._map.fire(new u.k(t,{originalEvent:o}))}}function Kn(f,t){if(f.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${f.length}, points ${t.length}`);const o={};for(let c=0;cthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),c.length===this.numTouches&&(this.centroid=function(d){const g=new u.P(0,0);for(const x of d)g._add(x);return g.div(d.length)}(o),this.touches=Kn(c,o)))}touchmove(t,o,c){if(this.aborted||!this.centroid)return;const d=Kn(c,o);for(const g in this.touches){const x=d[g];(!x||x.dist(this.touches[g])>30)&&(this.aborted=!0)}}touchend(t,o,c){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),c.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class Qa{constructor(t){this.singleTap=new Ur(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,o,c){this.singleTap.touchstart(t,o,c)}touchmove(t,o,c){this.singleTap.touchmove(t,o,c)}touchend(t,o,c){const d=this.singleTap.touchend(t,o,c);if(d){const g=t.timeStamp-this.lastTime<500,x=!this.lastTap||this.lastTap.dist(d)<30;if(g&&x||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class jr{constructor(t){this._tr=new Vr(t),this._zoomIn=new Qa({numTouches:1,numTaps:2}),this._zoomOut=new Qa({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,o,c){this._zoomIn.touchstart(t,o,c),this._zoomOut.touchstart(t,o,c)}touchmove(t,o,c){this._zoomIn.touchmove(t,o,c),this._zoomOut.touchmove(t,o,c)}touchend(t,o,c){const d=this._zoomIn.touchend(t,o,c),g=this._zoomOut.touchend(t,o,c),x=this._tr;return d?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:b=>b.easeTo({duration:300,zoom:x.zoom+1,around:x.unproject(d)},{originalEvent:t})}):g?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:b=>b.easeTo({duration:300,zoom:x.zoom-1,around:x.unproject(g)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $r{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const o=this._moveFunction(...t);if(o.bearingDelta||o.pitchDelta||o.around||o.panDelta)return this._active=!0,o}dragStart(t,o){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=o.length?o[0]:o,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,o){if(!this.isEnabled())return;const c=this._lastPoint;if(!c)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const d=o.length?o[0]:o;return!this._moved&&d.dist(c){f.mousedown=f.dragStart,f.mousemoveWindow=f.dragMove,f.mouseup=f.dragEnd,f.contextmenu=function(t){t.preventDefault()}},fo=({enable:f,clickTolerance:t,bearingDegreesPerPixelMoved:o=.8})=>{const c=new gu({checkCorrectEvent:d=>L.mouseButton(d)===0&&d.ctrlKey||L.mouseButton(d)===2});return new $r({clickTolerance:t,move:(d,g)=>({bearingDelta:(g.x-d.x)*o}),moveStateManager:c,enable:f,assignEvents:Ja})},Zr=({enable:f,clickTolerance:t,pitchDegreesPerPixelMoved:o=-.5})=>{const c=new gu({checkCorrectEvent:d=>L.mouseButton(d)===0&&d.ctrlKey||L.mouseButton(d)===2});return new $r({clickTolerance:t,move:(d,g)=>({pitchDelta:(g.y-d.y)*o}),moveStateManager:c,enable:f,assignEvents:Ja})};class Ze{constructor(t,o){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=o,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,o,c){return this._calculateTransform(t,o,c)}touchmove(t,o,c){if(this._map._cooperativeGestures&&(this._minTouches===2&&c.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,c.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(c.length0&&(this._active=!0);const d=Kn(c,o),g=new u.P(0,0),x=new u.P(0,0);let b=0;for(const E in d){const P=d[E],M=this._touches[E];M&&(g._add(P),x._add(P.sub(M)),b++,d[E]=P)}if(this._touches=d,bMath.abs(f.x)}class Ap extends el{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,o,c){super.touchstart(t,o,c),this._currentTouchCount=c.length}_start(t){this._lastPoints=t,_u(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,o,c){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const d=t[0].sub(this._lastPoints[0]),g=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(d,g,c.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(d.y+g.y)/2*-.5}):void 0}gestureBeginsVertically(t,o,c){if(this._valid!==void 0)return this._valid;const d=t.mag()>=2,g=o.mag()>=2;if(!d&&!g)return;if(!d||!g)return this._firstMove===void 0&&(this._firstMove=c),c-this._firstMove<100&&void 0;const x=t.y>0==o.y>0;return _u(t)&&_u(o)&&x}}const vu={panStep:100,bearingStep:15,pitchStep:10};class Sh{constructor(t){this._tr=new Vr(t);const o=vu;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let o=0,c=0,d=0,g=0,x=0;switch(t.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:t.shiftKey?c=-1:(t.preventDefault(),g=-1);break;case 39:t.shiftKey?c=1:(t.preventDefault(),g=1);break;case 38:t.shiftKey?d=1:(t.preventDefault(),x=-1);break;case 40:t.shiftKey?d=-1:(t.preventDefault(),x=1);break;default:return}return this._rotationDisabled&&(c=0,d=0),{cameraAnimation:b=>{const T=this._tr;b.easeTo({duration:300,easeId:"keyboardHandler",easing:Th,zoom:o?Math.round(T.zoom)+o*(t.shiftKey?2:1):T.zoom,bearing:T.bearing+c*this._bearingStep,pitch:T.pitch+d*this._pitchStep,offset:[-g*this._panStep,-x*this._panStep],center:T.center},{originalEvent:t})}}}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 Th(f){return f*(2-f)}const kh=4.000244140625;class Dp{constructor(t,o){this._onTimeout=c=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(c)},this._map=t,this._tr=new Vr(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let o=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const c=u.h.now(),d=c-(this._lastWheelEventTime||0);this._lastWheelEventTime=c,o!==0&&o%kh==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(d*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),t.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=t,this._delta-=o,this._active||this._start(t)),t.preventDefault()}_start(t){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);const o=L.mousePos(this._el,t),c=this._tr;this._around=u.L.convert(this._aroundCenter?c.center:c.unproject(o)),this._aroundPoint=c.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const b=this._type==="wheel"&&Math.abs(this._delta)>kh?this._wheelZoomRate:this._defaultZoomRate;let T=2/(1+Math.exp(-Math.abs(this._delta*b)));this._delta<0&&T!==0&&(T=1/T);const E=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(E*T))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const o=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,c=this._startZoom,d=this._easing;let g,x=!1;if(this._type==="wheel"&&c&&d){const b=Math.min((u.h.now()-this._lastWheelEventTime)/200,1),T=d(b);g=u.B.number(c,o,T),b<1?this._frameId||(this._frameId=!0):x=!0}else g=o,x=!0;return this._active=!0,x&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!x,zoomDelta:g-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let o=u.bb;if(this._prevEase){const c=this._prevEase,d=(u.h.now()-c.start)/c.duration,g=c.easing(d+.01)-c.easing(d),x=.27/Math.sqrt(g*g+1e-4)*.01,b=Math.sqrt(.0729-x*x);o=u.ba(x,b,.25,1)}return this._prevEase={start:u.h.now(),duration:t,easing:o},o}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class xu{constructor(t,o){this._clickZoom=t,this._tapZoom=o}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 wu{constructor(t){this._tr=new Vr(t),this.reset()}reset(){this._active=!1}dblclick(t,o){return t.preventDefault(),{cameraAnimation:c=>{c.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(o)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class bu{constructor(){this._tap=new Qa({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(t,o,c){if(!this._swipePoint)if(this._tapTime){const d=o[0],g=t.timeStamp-this._tapTime<500,x=this._tapPoint.dist(d)<30;g&&x?c.length>0&&(this._swipePoint=d,this._swipeTouch=c[0].identifier):this.reset()}else this._tap.touchstart(t,o,c)}touchmove(t,o,c){if(this._tapTime){if(this._swipePoint){if(c[0].identifier!==this._swipeTouch)return;const d=o[0],g=d.y-this._swipePoint.y;return this._swipePoint=d,t.preventDefault(),this._active=!0,{zoomDelta:g/128}}}else this._tap.touchmove(t,o,c)}touchend(t,o,c){if(this._tapTime)this._swipePoint&&c.length===0&&this.reset();else{const d=this._tap.touchend(t,o,c);d&&(this._tapTime=t.timeStamp,this._tapPoint=d)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Su{constructor(t,o,c){this._el=t,this._mousePan=o,this._touchPan=c}enable(t){this._inertiaOptions=t||{},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 _n{constructor(t,o,c){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=o,this._mousePitch=c}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 fs{constructor(t,o,c,d){this._el=t,this._touchZoom=o,this._touchRotate=c,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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()}}const na=f=>f.zoom||f.drag||f.pitch||f.rotate;class Tu extends u.k{}function ra(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class ku{constructor(t,o){this.handleWindowEvent=d=>{this.handleEvent(d,`${d.type}Window`)},this.handleEvent=(d,g)=>{if(d.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const x=d.type==="renderFrame"?void 0:d,b={needsRenderFrame:!1},T={},E={},P=d.touches,M=P?this._getMapTouches(P):void 0,F=M?L.touchPos(this._el,M):L.mousePos(this._el,d);for(const{handlerName:G,handler:U,allowed:re}of this._handlers){if(!U.isEnabled())continue;let pe;this._blockedByActive(E,re,G)?U.reset():U[g||d.type]&&(pe=U[g||d.type](d,F,M),this.mergeHandlerResult(b,T,pe,G,x),pe&&pe.needsRenderFrame&&this._triggerRenderFrame()),(pe||U.isActive())&&(E[G]=U)}const Z={};for(const G in this._previousActiveHandlers)E[G]||(Z[G]=x);this._previousActiveHandlers=E,(Object.keys(Z).length||ra(b))&&(this._changes.push([b,T,Z]),this._triggerRenderFrame()),(Object.keys(E).length||ra(b))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:$}=b;$&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],$(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new gh(t),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o);const c=this._el;this._listeners=[[c,"touchstart",{passive:!0}],[c,"touchmove",{passive:!1}],[c,"touchend",void 0],[c,"touchcancel",void 0],[c,"mousedown",void 0],[c,"mousemove",void 0],[c,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[c,"mouseover",void 0],[c,"mouseout",void 0],[c,"dblclick",void 0],[c,"click",void 0],[c,"keydown",{capture:!1}],[c,"keyup",void 0],[c,"wheel",{passive:!1}],[c,"contextmenu",void 0],[window,"blur",void 0]];for(const[d,g,x]of this._listeners)L.addEventListener(d,g,d===document?this.handleWindowEvent:this.handleEvent,x)}destroy(){for(const[t,o,c]of this._listeners)L.removeEventListener(t,o,t===document?this.handleWindowEvent:this.handleEvent,c)}_addDefaultHandlers(t){const o=this._map,c=o.getCanvasContainer();this._add("mapEvent",new _h(o,t));const d=o.boxZoom=new xh(o,t);this._add("boxZoom",d),t.interactive&&t.boxZoom&&d.enable();const g=new jr(o),x=new wu(o);o.doubleClickZoom=new xu(x,g),this._add("tapZoom",g),this._add("clickZoom",x),t.interactive&&t.doubleClickZoom&&o.doubleClickZoom.enable();const b=new bu;this._add("tapDragZoom",b);const T=o.touchPitch=new Ap(o);this._add("touchPitch",T),t.interactive&&t.touchPitch&&o.touchPitch.enable(t.touchPitch);const E=fo(t),P=Zr(t);o.dragRotate=new _n(t,E,P),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",P,["mouseRotate"]),t.interactive&&t.dragRotate&&o.dragRotate.enable();const M=(({enable:re,clickTolerance:pe})=>{const K=new gu({checkCorrectEvent:oe=>L.mouseButton(oe)===0&&!oe.ctrlKey});return new $r({clickTolerance:pe,move:(oe,me)=>({around:me,panDelta:me.sub(oe)}),activateOnStart:!0,moveStateManager:K,enable:re,assignEvents:Ja})})(t),F=new Ze(t,o);o.dragPan=new Su(c,M,F),this._add("mousePan",M),this._add("touchPan",F,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&o.dragPan.enable(t.dragPan);const Z=new yu,$=new bh;o.touchZoomRotate=new fs(c,$,Z,b),this._add("touchRotate",Z,["touchPan","touchZoom"]),this._add("touchZoom",$,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&o.touchZoomRotate.enable(t.touchZoomRotate);const G=o.scrollZoom=new Dp(o,()=>this._triggerRenderFrame());this._add("scrollZoom",G,["mousePan"]),t.interactive&&t.scrollZoom&&o.scrollZoom.enable(t.scrollZoom);const U=o.keyboard=new Sh(o);this._add("keyboard",U),t.interactive&&t.keyboard&&o.keyboard.enable(),this._add("blockableMapEvent",new vh(o))}_add(t,o,c){this._handlers.push({handlerName:t,handler:o,allowed:c}),this._handlersById[t]=o}stop(t){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!na(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,o,c){for(const d in t)if(d!==c&&(!o||o.indexOf(d)<0))return!0;return!1}_getMapTouches(t){const o=[];for(const c of t)this._el.contains(c.target)&&o.push(c);return o}mergeHandlerResult(t,o,c,d,g){if(!c)return;u.e(t,c);const x={handlerName:d,originalEvent:c.originalEvent||g};c.zoomDelta!==void 0&&(o.zoom=x),c.panDelta!==void 0&&(o.drag=x),c.pitchDelta!==void 0&&(o.pitch=x),c.bearingDelta!==void 0&&(o.rotate=x)}_applyChanges(){const t={},o={},c={};for(const[d,g,x]of this._changes)d.panDelta&&(t.panDelta=(t.panDelta||new u.P(0,0))._add(d.panDelta)),d.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(t.around=d.around),d.pinchAround!==void 0&&(t.pinchAround=d.pinchAround),d.noInertia&&(t.noInertia=d.noInertia),u.e(o,g),u.e(c,x);this._updateMapTransform(t,o,c),this._changes=[]}_updateMapTransform(t,o,c){const d=this._map,g=d._getTransformForUpdate(),x=d.terrain;if(!(ra(t)||x&&this._terrainMovement))return this._fireEvents(o,c,!0);let{panDelta:b,zoomDelta:T,bearingDelta:E,pitchDelta:P,around:M,pinchAround:F}=t;F!==void 0&&(M=F),d._stop(!0),M=M||d.transform.centerPoint;const Z=g.pointLocation(b?M.sub(b):M);E&&(g.bearing+=E),P&&(g.pitch+=P),T&&(g.zoom+=T),x?this._terrainMovement||!o.drag&&!o.zoom?o.drag&&this._terrainMovement?g.center=g.pointLocation(g.centerPoint.sub(b)):g.setLocationAtPoint(Z,M):(this._terrainMovement=!0,this._map._elevationFreeze=!0,g.setLocationAtPoint(Z,M),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,g.recalculateZoom(d.terrain)})):g.setLocationAtPoint(Z,M),d._applyUpdatedTransform(g),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(o,c,!0)}_fireEvents(t,o,c){const d=na(this._eventsInProgress),g=na(t),x={};for(const P in t){const{originalEvent:M}=t[P];this._eventsInProgress[P]||(x[`${P}start`]=M),this._eventsInProgress[P]=t[P]}!d&&g&&this._fireEvent("movestart",g.originalEvent);for(const P in x)this._fireEvent(P,x[P]);g&&this._fireEvent("move",g.originalEvent);for(const P in t){const{originalEvent:M}=t[P];this._fireEvent(P,M)}const b={};let T;for(const P in this._eventsInProgress){const{handlerName:M,originalEvent:F}=this._eventsInProgress[P];this._handlersById[M].isActive()||(delete this._eventsInProgress[P],T=o[M]||F,b[`${P}end`]=T)}for(const P in b)this._fireEvent(P,b[P]);const E=na(this._eventsInProgress);if(c&&(d||g)&&!E){this._updatingCamera=!0;const P=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),M=F=>F!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Tu("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Eh extends u.E{constructor(t,o){super(),this._renderFrameCallback=()=>{const c=Math.min((u.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(c)),c<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=o.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new u.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,o){return this.jumpTo({center:t},o)}panBy(t,o,c){return t=u.P.convert(t).mult(-1),this.panTo(this.transform.center,u.e({offset:t},o),c)}panTo(t,o,c){return this.easeTo(u.e({center:t},o),c)}getZoom(){return this.transform.zoom}setZoom(t,o){return this.jumpTo({zoom:t},o),this}zoomTo(t,o,c){return this.easeTo(u.e({zoom:t},o),c)}zoomIn(t,o){return this.zoomTo(this.getZoom()+1,t,o),this}zoomOut(t,o){return this.zoomTo(this.getZoom()-1,t,o),this}getBearing(){return this.transform.bearing}setBearing(t,o){return this.jumpTo({bearing:t},o),this}getPadding(){return this.transform.padding}setPadding(t,o){return this.jumpTo({padding:t},o),this}rotateTo(t,o,c){return this.easeTo(u.e({bearing:t},o),c)}resetNorth(t,o){return this.rotateTo(0,u.e({duration:1e3},t),o),this}resetNorthPitch(t,o){return this.easeTo(u.e({bearing:0,pitch:0,duration:1e3},t),o),this}snapToNorth(t,o){return Math.abs(this.getBearing()){if(this._zooming&&(c.zoom=u.B.number(d,T,ge)),this._rotating&&(c.bearing=u.B.number(g,E,ge)),this._pitching&&(c.pitch=u.B.number(x,P,ge)),this._padding&&(c.interpolatePadding(b,M,ge),Z=c.centerPoint.add(F)),this.terrain&&!t.freezeElevation&&this._updateElevation(ge),K)c.setLocationAtPoint(K,oe);else{const xe=c.zoomScale(c.zoom-d),Ee=T>d?Math.min(2,pe):Math.max(.5,pe),Te=Math.pow(Ee,1-ge),Pe=c.unproject(U.add(re.mult(ge*Te)).mult(xe));c.setLocationAtPoint(c.renderWorldCopies?Pe.wrap():Pe,Z)}this._applyUpdatedTransform(c),this._fireMoveEvents(o)},ge=>{this.terrain&&this._finalizeElevation(),this._afterEase(o,ge)},t),this}_prepareEase(t,o,c={}){this._moving=!0,o||c.moving||this.fire(new u.k("movestart",t)),this._zooming&&!c.zooming&&this.fire(new u.k("zoomstart",t)),this._rotating&&!c.rotating&&this.fire(new u.k("rotatestart",t)),this._pitching&&!c.pitching&&this.fire(new u.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const o=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&o!==this._elevationTarget){const c=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(c-(o-(c*t+this._elevationStart))/(1-t)),this._elevationTarget=o}this.transform.elevation=u.B.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const o=t.clone(),{center:c,zoom:d,pitch:g,bearing:x,elevation:b}=this.transformCameraUpdate(o);c&&(o.center=c),d!==void 0&&(o.zoom=d),g!==void 0&&(o.pitch=g),x!==void 0&&(o.bearing=x),b!==void 0&&(o.elevation=b),this.transform.apply(o)}_fireMoveEvents(t){this.fire(new u.k("move",t)),this._zooming&&this.fire(new u.k("zoom",t)),this._rotating&&this.fire(new u.k("rotate",t)),this._pitching&&this.fire(new u.k("pitch",t))}_afterEase(t,o){if(this._easeId&&o&&this._easeId===o)return;delete this._easeId;const c=this._zooming,d=this._rotating,g=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,c&&this.fire(new u.k("zoomend",t)),d&&this.fire(new u.k("rotateend",t)),g&&this.fire(new u.k("pitchend",t)),this.fire(new u.k("moveend",t))}flyTo(t,o){if(!t.essential&&u.h.prefersReducedMotion){const Ye=u.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ye,o)}this.stop(),t=u.e({offset:[0,0],speed:1.2,curve:1.42,easing:u.bb},t);const c=this._getTransformForUpdate(),d=this.getZoom(),g=this.getBearing(),x=this.getPitch(),b=this.getPadding(),T="zoom"in t?u.ad(+t.zoom,c.minZoom,c.maxZoom):d,E="bearing"in t?this._normalizeBearing(t.bearing,g):g,P="pitch"in t?+t.pitch:x,M="padding"in t?t.padding:c.padding,F=c.zoomScale(T-d),Z=u.P.convert(t.offset);let $=c.centerPoint.add(Z);const G=c.pointLocation($),U=u.L.convert(t.center||G);this._normalizeCenter(U);const re=c.project(G),pe=c.project(U).sub(re);let K=t.curve;const oe=Math.max(c.width,c.height),me=oe/F,ge=pe.mag();if("minZoom"in t){const Ye=u.ad(Math.min(t.minZoom,d,T),c.minZoom,c.maxZoom),Ot=oe/c.zoomScale(Ye-d);K=Math.sqrt(Ot/ge*2)}const xe=K*K;function Ee(Ye){const Ot=(me*me-oe*oe+(Ye?-1:1)*xe*xe*ge*ge)/(2*(Ye?me:oe)*xe*ge);return Math.log(Math.sqrt(Ot*Ot+1)-Ot)}function Te(Ye){return(Math.exp(Ye)-Math.exp(-Ye))/2}function Pe(Ye){return(Math.exp(Ye)+Math.exp(-Ye))/2}const Xe=Ee(!1);let vt=function(Ye){return Pe(Xe)/Pe(Xe+K*Ye)},Fe=function(Ye){return oe*((Pe(Xe)*(Te(Ot=Xe+K*Ye)/Pe(Ot))-Te(Xe))/xe)/ge;var Ot},ot=(Ee(!0)-Xe)/K;if(Math.abs(ge)<1e-6||!isFinite(ot)){if(Math.abs(oe-me)<1e-6)return this.easeTo(t,o);const Ye=met.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=g!==E,this._pitching=P!==x,this._padding=!c.isPaddingEqual(M),this._prepareEase(o,!1),this.terrain&&this._prepareElevation(U),this._ease(Ye=>{const Ot=Ye*ot,_t=1/vt(Ot);c.zoom=Ye===1?T:d+c.scaleZoom(_t),this._rotating&&(c.bearing=u.B.number(g,E,Ye)),this._pitching&&(c.pitch=u.B.number(x,P,Ye)),this._padding&&(c.interpolatePadding(b,M,Ye),$=c.centerPoint.add(Z)),this.terrain&&!t.freezeElevation&&this._updateElevation(Ye);const mt=Ye===1?U:c.unproject(re.add(pe.mult(Fe(Ot))).mult(_t));c.setLocationAtPoint(c.renderWorldCopies?mt.wrap():mt,$),this._applyUpdatedTransform(c),this._fireMoveEvents(o)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(o)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const c=this._onEaseEnd;delete this._onEaseEnd,c.call(this,o)}if(!t){const c=this.handlers;c&&c.stop(!1)}return this}_ease(t,o,c){c.animate===!1||c.duration===0?(t(1),o()):(this._easeStart=u.h.now(),this._easeOptions=c,this._onEaseFrame=t,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,o){t=u.b5(t,-180,180);const c=Math.abs(t-o);return Math.abs(t-360-o)180?-360:c<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(u.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Ln{constructor(t={}){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=o=>{!o||o.sourceDataType!=="metadata"&&o.sourceDataType!=="visibility"&&o.dataType!=="style"&&o.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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=L.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=L.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=L.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(){L.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(t,o){const c=this._map._getUIString(`AttributionControl.${o}`);t.title=c,t.setAttribute("aria-label",c)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(d=>typeof d!="string"?"":d)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}const o=this._map.style.sourceCaches;for(const d in o){const g=o[d];if(g.used||g.usedForTerrain){const x=g.getSource();x.attribution&&t.indexOf(x.attribution)<0&&t.push(x.attribution)}}t=t.filter(d=>String(d).trim()),t.sort((d,g)=>d.length-g.length),t=t.filter((d,g)=>{for(let x=g+1;x=0)return!1;return!0});const c=t.join(" | ");c!==this._attribHTML&&(this._attribHTML=c,t.length?(this._innerContainer.innerHTML=c,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ht{constructor(t={}){this._updateCompact=()=>{const o=this._container.children;if(o.length){const c=o[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&c.classList.add("maplibregl-compact"):c.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=L.create("div","maplibregl-ctrl");const o=L.create("a","maplibregl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://maplibre.org/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){L.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class tl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const o=++this._id;return this._queue.push({callback:t,id:o,cancelled:!1}),o}remove(t){const o=this._currentlyRunning,c=o?this._queue.concat(o):this._queue;for(const d of c)if(d.id===t)return void(d.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const o=this._currentlyRunning=this._queue;this._queue=[];for(const c of o)if(!c.cancelled&&(c.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Eu={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var Ih=u.Q([{name:"a_pos3d",type:"Int16",components:3}]);class Ch extends u.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,o){this.sourceCache.update(t,o),this._renderableTilesKeys=[];const c={};for(const d of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:o}))c[d.key]=!0,this._renderableTilesKeys.push(d.key),this._tiles[d.key]||(d.posMatrix=new Float64Array(16),u.aS(d.posMatrix,0,u.N,0,u.N,0,1),this._tiles[d.key]=new as(d,this.tileSize));for(const d in this._tiles)c[d]||delete this._tiles[d]}freeRtt(t){for(const o in this._tiles){const c=this._tiles[o];(!t||c.tileID.equals(t)||c.tileID.isChildOf(t)||t.isChildOf(c.tileID))&&(c.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const o={};for(const c of this._renderableTilesKeys){const d=this._tiles[c].tileID;if(d.canonical.equals(t.canonical)){const g=t.clone();g.posMatrix=new Float64Array(16),u.aS(g.posMatrix,0,u.N,0,u.N,0,1),o[c]=g}else if(d.canonical.isChildOf(t.canonical)){const g=t.clone();g.posMatrix=new Float64Array(16);const x=d.canonical.z-t.canonical.z,b=d.canonical.x-(d.canonical.x>>x<>x<>x;u.aS(g.posMatrix,0,E,0,E,0,1),u.$(g.posMatrix,g.posMatrix,[-b*E,-T*E,0]),o[c]=g}else if(t.canonical.isChildOf(d.canonical)){const g=t.clone();g.posMatrix=new Float64Array(16);const x=t.canonical.z-d.canonical.z,b=t.canonical.x-(t.canonical.x>>x<>x<>x;u.aS(g.posMatrix,0,u.N,0,u.N,0,1),u.$(g.posMatrix,g.posMatrix,[b*E,T*E,0]),u.a0(g.posMatrix,g.posMatrix,[1/2**x,1/2**x,0]),o[c]=g}}return o}getSourceTile(t,o){const c=this.sourceCache._source;let d=t.overscaledZ-this.deltaZoom;if(d>c.maxzoom&&(d=c.maxzoom),d=c.minzoom&&(!g||!g.dem);)g=this.sourceCache.getTileByID(t.scaledTo(d--).key);return g}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(o=>o.timeAdded>=t)}}class Ph{constructor(t,o,c){this.painter=t,this.sourceCache=new Ch(o),this.options=c,this.exaggeration=typeof c.exaggeration=="number"?c.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,o,c,d=u.N){var g;if(!(o>=0&&o=0&&ct.canonical.z&&(t.canonical.z>=d?g=t.canonical.z-d:u.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const x=t.canonical.x-(t.canonical.x>>g<>g<>8<<4|g>>8,o[x+3]=0;const c=new u.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(o.buffer)),d=new Ge(t,c,t.gl.RGBA,{premultiply:!1});return d.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=d,d}pointCoordinate(t){const o=new Uint8Array(4),c=this.painter.context,d=c.gl;c.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),d.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,d.RGBA,d.UNSIGNED_BYTE,o),c.bindFramebuffer.set(null);const g=o[0]+(o[2]>>4<<8),x=o[1]+((15&o[2])<<8),b=this.coordsIndex[255-o[3]],T=b&&this.sourceCache.getTileByID(b);if(!T)return null;const E=this._coordsTextureSize,P=(1<0&&Math.sign(g)<0||!c&&Math.sign(d)<0&&Math.sign(g)>0?(d=360*Math.sign(g)+d,u.G(d)):o}}class Lp{constructor(t,o,c){this._context=t,this._size=o,this._tileSize=c,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const o=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),c=new Ge(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return c.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),o.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),o.colorAttachment.set(c.texture),{id:t,fbo:o,texture:c,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(o=>t.id!==o),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const o of this._recentlyUsed)if(!this._objects[o].inUse)return this._objects[o];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}const an={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class il{constructor(t,o){this.painter=t,this.terrain=o,this.pool=new Lp(t.context,30,o.sourceCache.tileSize*o.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,o){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(c=>!t._layers[c].isHidden(o)),this._coordsDescendingInv={};for(const c in t.sourceCaches){this._coordsDescendingInv[c]={};const d=t.sourceCaches[c].getVisibleCoordinates();for(const g of d){const x=this.terrain.sourceCache.getTerrainCoords(g);for(const b in x)this._coordsDescendingInv[c][b]||(this._coordsDescendingInv[c][b]=[]),this._coordsDescendingInv[c][b].push(x[b])}}this._coordsDescendingInvStr={};for(const c of t._order){const d=t._layers[c],g=d.source;if(an[d.type]&&!this._coordsDescendingInvStr[g]){this._coordsDescendingInvStr[g]={};for(const x in this._coordsDescendingInv[g])this._coordsDescendingInvStr[g][x]=this._coordsDescendingInv[g][x].map(b=>b.key).sort().join()}}for(const c of this._renderableTiles)for(const d in this._coordsDescendingInvStr){const g=this._coordsDescendingInvStr[d][c.tileID.key];g&&g!==c.rttCoords[d]&&(c.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const o=t.type,c=this.painter,d=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(an[o]&&(this._prevType&&an[this._prevType]||this._stacks.push([]),this._prevType=o,this._stacks[this._stacks.length-1].push(t.id),!d))return!0;if(an[this._prevType]||an[o]&&d){this._prevType=o;const g=this._stacks.length-1,x=this._stacks[g]||[];for(const b of this._renderableTiles){if(this.pool.isFull()&&(si(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(b),b.rtt[g]){const E=this.pool.getObjectForId(b.rtt[g].id);if(E.stamp===b.rtt[g].stamp){this.pool.useObject(E);continue}}const T=this.pool.getOrCreateFreeObject();this.pool.useObject(T),this.pool.stampObject(T),b.rtt[g]={id:T.id,stamp:T.stamp},c.context.bindFramebuffer.set(T.fbo.framebuffer),c.context.clear({color:u.aT.transparent,stencil:0}),c.currentStencilSource=void 0;for(let E=0;E{f.touchstart=f.dragStart,f.touchmoveWindow=f.dragMove,f.touchend=f.dragEnd},Iu={showCompass:!0,showZoom:!0,visualizePitch:!1};class Cu{constructor(t,o,c=!1){this.mousedown=x=>{this.startMouse(u.e({},x,{ctrlKey:!0,preventDefault:()=>x.preventDefault()}),L.mousePos(this.element,x)),L.addEventListener(window,"mousemove",this.mousemove),L.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=x=>{this.moveMouse(x,L.mousePos(this.element,x))},this.mouseup=x=>{this.mouseRotate.dragEnd(x),this.mousePitch&&this.mousePitch.dragEnd(x),this.offTemp()},this.touchstart=x=>{x.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=L.touchPos(this.element,x.targetTouches)[0],this.startTouch(x,this._startPos),L.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),L.addEventListener(window,"touchend",this.touchend))},this.touchmove=x=>{x.targetTouches.length!==1?this.reset():(this._lastPos=L.touchPos(this.element,x.targetTouches)[0],this.moveTouch(x,this._lastPos))},this.touchend=x=>{x.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;const d=t.dragRotate._mouseRotate.getClickTolerance(),g=t.dragRotate._mousePitch.getClickTolerance();this.element=o,this.mouseRotate=fo({clickTolerance:d,enable:!0}),this.touchRotate=(({enable:x,clickTolerance:b,bearingDegreesPerPixelMoved:T=.8})=>{const E=new wh;return new $r({clickTolerance:b,move:(P,M)=>({bearingDelta:(M.x-P.x)*T}),moveStateManager:E,enable:x,assignEvents:sa})})({clickTolerance:d,enable:!0}),this.map=t,c&&(this.mousePitch=Zr({clickTolerance:g,enable:!0}),this.touchPitch=(({enable:x,clickTolerance:b,pitchDegreesPerPixelMoved:T=-.5})=>{const E=new wh;return new $r({clickTolerance:b,move:(P,M)=>({pitchDelta:(M.y-P.y)*T}),moveStateManager:E,enable:x,assignEvents:sa})})({clickTolerance:g,enable:!0})),L.addEventListener(o,"mousedown",this.mousedown),L.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),L.addEventListener(o,"touchcancel",this.reset)}startMouse(t,o){this.mouseRotate.dragStart(t,o),this.mousePitch&&this.mousePitch.dragStart(t,o),L.disableDrag()}startTouch(t,o){this.touchRotate.dragStart(t,o),this.touchPitch&&this.touchPitch.dragStart(t,o),L.disableDrag()}moveMouse(t,o){const c=this.map,{bearingDelta:d}=this.mouseRotate.dragMove(t,o)||{};if(d&&c.setBearing(c.getBearing()+d),this.mousePitch){const{pitchDelta:g}=this.mousePitch.dragMove(t,o)||{};g&&c.setPitch(c.getPitch()+g)}}moveTouch(t,o){const c=this.map,{bearingDelta:d}=this.touchRotate.dragMove(t,o)||{};if(d&&c.setBearing(c.getBearing()+d),this.touchPitch){const{pitchDelta:g}=this.touchPitch.dragMove(t,o)||{};g&&c.setPitch(c.getPitch()+g)}}off(){const t=this.element;L.removeEventListener(t,"mousedown",this.mousedown),L.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),L.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),L.removeEventListener(window,"touchend",this.touchend),L.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){L.enableDrag(),L.removeEventListener(window,"mousemove",this.mousemove),L.removeEventListener(window,"mouseup",this.mouseup),L.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),L.removeEventListener(window,"touchend",this.touchend)}}let gi;function Pu(f,t,o){if(f=new u.L(f.lng,f.lat),t){const c=new u.L(f.lng-360,f.lat),d=new u.L(f.lng+360,f.lat),g=o.locationPoint(f).distSqr(t);o.locationPoint(c).distSqr(t)180;){const c=o.locationPoint(f);if(c.x>=0&&c.y>=0&&c.x<=o.width&&c.y<=o.height)break;f.lng>o.center.lng?f.lng-=360:f.lng+=360}return f}const Yn={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 Mh(f,t,o){const c=f.classList;for(const d in Yn)c.remove(`maplibregl-${o}-anchor-${d}`);c.add(`maplibregl-${o}-anchor-${t}`)}class Ds extends u.E{constructor(t){if(super(),this._onKeyPress=o=>{const c=o.code,d=o.charCode||o.keyCode;c!=="Space"&&c!=="Enter"&&d!==32&&d!==13||this.togglePopup()},this._onMapClick=o=>{const c=o.originalEvent.target,d=this._element;this._popup&&(c===d||d.contains(c))&&this.togglePopup()},this._update=o=>{if(!this._map)return;const c=this._map.loaded()&&!this._map.isMoving();((o==null?void 0:o.type)==="terrain"||(o==null?void 0:o.type)==="render"&&!c)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Pu(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let d="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?d=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(d=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let g="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?g="rotateX(0deg)":this._pitchAlignment==="map"&&(g=`rotateX(${this._map.getPitch()}deg)`),o&&o.type!=="moveend"||(this._pos=this._pos.round()),L.setTransform(this._element,`${Yn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${g} ${d}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const x=this._map.unproject(this._pos),b=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=x.distanceTo(this._lngLat)>20*b?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=o=>{if(!this._isDragging){const c=this._clickTolerance||this._map._clickTolerance;this._isDragging=o.point.dist(this._pointerdownPos)>=c}this._isDragging&&(this._pos=o.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 u.k("dragstart"))),this.fire(new u.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 u.k("dragend")),this._state="inactive"},this._addDragHandler=o=>{this._element.contains(o.originalEvent.target)&&(o.preventDefault(),this._positionDelta=o.point.sub(this._pos).add(this._offset),this._pointerdownPos=o.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=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=u.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=L.create("div"),this._element.setAttribute("aria-label","Map marker");const o=L.createNS("http://www.w3.org/2000/svg","svg"),c=41,d=27;o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height",`${c}px`),o.setAttributeNS(null,"width",`${d}px`),o.setAttributeNS(null,"viewBox",`0 0 ${d} ${c}`);const g=L.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"stroke","none"),g.setAttributeNS(null,"stroke-width","1"),g.setAttributeNS(null,"fill","none"),g.setAttributeNS(null,"fill-rule","evenodd");const x=L.createNS("http://www.w3.org/2000/svg","g");x.setAttributeNS(null,"fill-rule","nonzero");const b=L.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"transform","translate(3.0, 29.0)"),b.setAttributeNS(null,"fill","#000000");const T=[{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(const re of T){const pe=L.createNS("http://www.w3.org/2000/svg","ellipse");pe.setAttributeNS(null,"opacity","0.04"),pe.setAttributeNS(null,"cx","10.5"),pe.setAttributeNS(null,"cy","5.80029008"),pe.setAttributeNS(null,"rx",re.rx),pe.setAttributeNS(null,"ry",re.ry),b.appendChild(pe)}const E=L.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill",this._color);const P=L.createNS("http://www.w3.org/2000/svg","path");P.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"),E.appendChild(P);const M=L.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"opacity","0.25"),M.setAttributeNS(null,"fill","#000000");const F=L.createNS("http://www.w3.org/2000/svg","path");F.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"),M.appendChild(F);const Z=L.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const $=L.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(8.0, 8.0)");const G=L.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#000000"),G.setAttributeNS(null,"opacity","0.25"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962");const U=L.createNS("http://www.w3.org/2000/svg","circle");U.setAttributeNS(null,"fill","#FFFFFF"),U.setAttributeNS(null,"cx","5.5"),U.setAttributeNS(null,"cy","5.5"),U.setAttributeNS(null,"r","5.4999962"),$.appendChild(G),$.appendChild(U),x.appendChild(b),x.appendChild(E),x.appendChild(M),x.appendChild(Z),x.appendChild($),o.appendChild(x),o.setAttributeNS(null,"height",c*this._scale+"px"),o.setAttributeNS(null,"width",d*this._scale+"px"),this._element.appendChild(o),this._offset=u.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",o=>{o.preventDefault()}),this._element.addEventListener("mousedown",o=>{o.preventDefault()}),Mh(this._element,this._anchor,"marker"),t&&t.className)for(const o of t.className.split(" "))this._element.classList.add(o);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.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("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),L.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=u.L.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const d=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=u.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(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(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const oi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ti=0,go=!1;const oa={maxWidth:100,unit:"metric"};function aa(f,t,o){const c=o&&o.maxWidth||100,d=f._container.clientHeight/2,g=f.unproject([0,d]),x=f.unproject([c,d]),b=g.distanceTo(x);if(o&&o.unit==="imperial"){const T=3.2808*b;T>5280?Ls(t,c,T/5280,f._getUIString("ScaleControl.Miles")):Ls(t,c,T,f._getUIString("ScaleControl.Feet"))}else o&&o.unit==="nautical"?Ls(t,c,b/1852,f._getUIString("ScaleControl.NauticalMiles")):b>=1e3?Ls(t,c,b/1e3,f._getUIString("ScaleControl.Kilometers")):Ls(t,c,b,f._getUIString("ScaleControl.Meters"))}function Ls(f,t,o,c){const d=function(g){const x=Math.pow(10,`${Math.floor(g)}`.length-1);let b=g/x;return b=b>=10?10:b>=5?5:b>=3?3:b>=2?2:b>=1?1:function(T){const E=Math.pow(10,Math.ceil(-Math.log(T)/Math.LN10));return Math.round(T*E)/E}(b),x*b}(o);f.style.width=t*(d/o)+"px",f.innerHTML=`${d} ${c}`}const Mu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},zu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function yo(f){if(f){if(typeof f=="number"){const t=Math.round(Math.abs(f)/Math.SQRT2);return{center:new u.P(0,0),top:new u.P(0,f),"top-left":new u.P(t,t),"top-right":new u.P(-t,t),bottom:new u.P(0,-f),"bottom-left":new u.P(t,-t),"bottom-right":new u.P(-t,-t),left:new u.P(f,0),right:new u.P(-f,0)}}if(f instanceof u.P||Array.isArray(f)){const t=u.P.convert(f);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:u.P.convert(f.center||[0,0]),top:u.P.convert(f.top||[0,0]),"top-left":u.P.convert(f["top-left"]||[0,0]),"top-right":u.P.convert(f["top-right"]||[0,0]),bottom:u.P.convert(f.bottom||[0,0]),"bottom-left":u.P.convert(f["bottom-left"]||[0,0]),"bottom-right":u.P.convert(f["bottom-right"]||[0,0]),left:u.P.convert(f.left||[0,0]),right:u.P.convert(f.right||[0,0])}}return yo(new u.P(0,0))}const Au={extend:(f,...t)=>u.e(f,...t),run(f){f()},logToElement(f,t=!1,o="log"){const c=window.document.getElementById(o);c&&(t&&(c.innerHTML=""),c.innerHTML+=`
${f}`)}},Du=N;class At{static get version(){return Du}static get workerCount(){return vr.workerCount}static set workerCount(t){vr.workerCount=t}static get maxParallelImageRequests(){return u.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){u.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return u.c.WORKER_URL}static set workerUrl(t){u.c.WORKER_URL=t}static addProtocol(t,o){u.c.REGISTERED_PROTOCOLS[t]=o}static removeProtocol(t){delete u.c.REGISTERED_PROTOCOLS[t]}}return At.Map=class extends Eh{constructor(f){if(u.bg.mark(u.bh.create),(f=u.e({},st,f)).minZoom!=null&&f.maxZoom!=null&&f.minZoom>f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(f.minPitch!=null&&f.maxPitch!=null&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(f.minPitch!=null&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(f.maxPitch!=null&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ya(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies),{bearingSnap:f.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new u.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=f.interactive,this._cooperativeGestures=f.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=f.maxTileCacheSize,this._maxTileCacheZoomLevels=f.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._crossSourceCollisions=f.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=f.collectResourceTiming,this._renderTaskQueue=new tl,this._controls=[],this._mapId=u.a2(),this._locale=u.e({},Eu,f.locale),this._clickTolerance=f.clickTolerance,this._overridePixelRatio=f.pixelRatio,this._maxCanvasSize=f.maxCanvasSize,this.transformCameraUpdate=f.transformCameraUpdate,this._imageQueueHandle=ut.addThrottleControl(()=>this.isMoving()),this._requestManager=new J(f.transformRequest),typeof f.container=="string"){if(this._container=document.getElementById(f.container),!this._container)throw new Error(`Container '${f.container}' not found.`)}else{if(!(f.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(f.maxBounds&&this.setMaxBounds(f.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const o=As(c=>{this._trackResize&&!this._removed&&this.resize(c)._update()},50);this._resizeObserver=new ResizeObserver(c=>{t?o(c):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ku(this,f),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=f.hash&&new ea(typeof f.hash=="string"&&f.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch}),f.bounds&&(this.resize(),this.fitBounds(f.bounds,u.e({},f.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=f.localIdeographFontFamily,this._validateStyle=f.validateStyle,f.style&&this.setStyle(f.style,{localIdeographFontFamily:f.localIdeographFontFamily}),f.attributionControl&&this.addControl(new Ln({customAttribution:f.customAttribution})),f.maplibreLogo&&this.addControl(new Ht,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new u.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new u.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new u.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(f,t){if(t===void 0&&(t=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new u.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=f.onAdd(this);this._controls.push(f);const c=this._controlPositions[t];return t.indexOf("bottom")!==-1?c.insertBefore(o,c.firstChild):c.appendChild(o),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new u.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(f);return t>-1&&this._controls.splice(t,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}calculateCameraOptionsFromTo(f,t,o,c){return c==null&&this.terrain&&(c=this.terrain.getElevationForLngLatZoom(o,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(f,t,o,c)}resize(f){var t;const o=this._containerDimensions(),c=o[0],d=o[1],g=this._getClampedPixelRatio(c,d);if(this._resizeCanvas(c,d,g),this.painter.resize(c,d,g),this.painter.overLimit()){const b=this.painter.context.gl;this._maxCanvasSize=[b.drawingBufferWidth,b.drawingBufferHeight];const T=this._getClampedPixelRatio(c,d);this._resizeCanvas(c,d,T),this.painter.resize(c,d,T)}this.transform.resize(c,d),(t=this._requestedCameraState)===null||t===void 0||t.resize(c,d);const x=!this._moving;return x&&(this.stop(),this.fire(new u.k("movestart",f)).fire(new u.k("move",f))),this.fire(new u.k("resize",f)),x&&this.fire(new u.k("moveend",f)),this}_getClampedPixelRatio(f,t){const{0:o,1:c}=this._maxCanvasSize,d=this.getPixelRatio(),g=f*d,x=t*d;return Math.min(g>o?o/g:1,x>c?c/x:1)*d}getPixelRatio(){var f;return(f=this._overridePixelRatio)!==null&&f!==void 0?f:devicePixelRatio}setPixelRatio(f){this._overridePixelRatio=f,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(f){return this.transform.setMaxBounds(It.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f&&this.setZoom(f),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f&&this.setPitch(f),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(f){return this._cooperativeGestures=f,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(f){return this.transform.locationPoint(u.L.convert(f),this.style&&this.terrain)}unproject(f){return this.transform.pointLocation(u.P.convert(f),this.terrain)}isMoving(){var f;return this._moving||((f=this.handlers)===null||f===void 0?void 0:f.isMoving())}isZooming(){var f;return this._zooming||((f=this.handlers)===null||f===void 0?void 0:f.isZooming())}isRotating(){var f;return this._rotating||((f=this.handlers)===null||f===void 0?void 0:f.isRotating())}_createDelegatedListener(f,t,o){if(f==="mouseenter"||f==="mouseover"){let c=!1;return{layer:t,listener:o,delegates:{mousemove:g=>{const x=this.getLayer(t)?this.queryRenderedFeatures(g.point,{layers:[t]}):[];x.length?c||(c=!0,o.call(this,new Dn(f,this,g.originalEvent,{features:x}))):c=!1},mouseout:()=>{c=!1}}}}if(f==="mouseleave"||f==="mouseout"){let c=!1;return{layer:t,listener:o,delegates:{mousemove:x=>{(this.getLayer(t)?this.queryRenderedFeatures(x.point,{layers:[t]}):[]).length?c=!0:c&&(c=!1,o.call(this,new Dn(f,this,x.originalEvent)))},mouseout:x=>{c&&(c=!1,o.call(this,new Dn(f,this,x.originalEvent)))}}}}{const c=d=>{const g=this.getLayer(t)?this.queryRenderedFeatures(d.point,{layers:[t]}):[];g.length&&(d.features=g,o.call(this,d),delete d.features)};return{layer:t,listener:o,delegates:{[f]:c}}}}on(f,t,o){if(o===void 0)return super.on(f,t);const c=this._createDelegatedListener(f,t,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(c);for(const d in c.delegates)this.on(d,c.delegates[d]);return this}once(f,t,o){if(o===void 0)return super.once(f,t);const c=this._createDelegatedListener(f,t,o);for(const d in c.delegates)this.once(d,c.delegates[d]);return this}off(f,t,o){return o===void 0?super.off(f,t):(this._delegatedListeners&&this._delegatedListeners[f]&&(c=>{const d=this._delegatedListeners[f];for(let g=0;gthis._updateStyle(f,t));const o=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!f)),f?(this.style=new Ui(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof f=="string"?this.style.loadURL(f,t,o):this.style.loadJSON(f,t,o),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(f,t){if(typeof f=="string"){const o=this._requestManager.transformRequest(f,se.Style);u.f(o,(c,d)=>{c?this.fire(new u.j(c)):d&&this._updateDiff(d,t)})}else typeof f=="object"&&this._updateDiff(f,t)}_updateDiff(f,t){try{this.style.setState(f,t)&&this._update(!0)}catch(o){u.w(`Unable to perform style diff: ${o.message||o.error||o}. Rebuilding the style from scratch.`),this._updateStyle(f,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():u.w("There is no style added to the map.")}addSource(f,t){return this._lazyInitEmptyStyle(),this.style.addSource(f,t),this._update(!0)}isSourceLoaded(f){const t=this.style&&this.style.sourceCaches[f];if(t!==void 0)return t.loaded();this.fire(new u.j(new Error(`There is no source with ID '${f}'`)))}setTerrain(f){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),f){const t=this.style.sourceCaches[f.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${f.source}`);for(const o in this.style._layers){const c=this.style._layers[o];c.type==="hillshade"&&c.source===f.source&&u.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 Ph(this.painter,t,f),this.painter.renderToTexture=new il(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=o=>{o.dataType==="style"?this.terrain.sourceCache.freeRtt():o.dataType==="source"&&o.tile&&(o.sourceId!==f.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=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(o.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._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new u.k("terrain",{terrain:f})),this}getTerrain(){var f,t;return(t=(f=this.terrain)===null||f===void 0?void 0:f.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const f=this.style&&this.style.sourceCaches;for(const t in f){const o=f[t]._tiles;for(const c in o){const d=o[c];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}addSourceType(f,t,o){return this._lazyInitEmptyStyle(),this.style.addSourceType(f,t,o)}removeSource(f){return this.style.removeSource(f),this._update(!0)}getSource(f){return this.style.getSource(f)}addImage(f,t,o={}){const{pixelRatio:c=1,sdf:d=!1,stretchX:g,stretchY:x,content:b}=o;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||u.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new u.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`")));{const{width:T,height:E,data:P}=t,M=t;return this.style.addImage(f,{data:new u.R({width:T,height:E},new Uint8Array(P)),pixelRatio:c,stretchX:g,stretchY:x,content:b,sdf:d,version:0,userImage:M}),M.onAdd&&M.onAdd(this,f),this}}{const{width:T,height:E,data:P}=u.h.getImageData(t);this.style.addImage(f,{data:new u.R({width:T,height:E},P),pixelRatio:c,stretchX:g,stretchY:x,content:b,sdf:d,version:0})}}updateImage(f,t){const o=this.style.getImage(f);if(!o)return this.fire(new u.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const c=t instanceof HTMLImageElement||u.a(t)?u.h.getImageData(t):t,{width:d,height:g,data:x}=c;if(d===void 0||g===void 0)return this.fire(new u.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(d!==o.data.width||g!==o.data.height)return this.fire(new u.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const b=!(t instanceof HTMLImageElement||u.a(t));return o.data.replace(x,b),this.style.updateImage(f,o),this}getImage(f){return this.style.getImage(f)}hasImage(f){return f?!!this.style.getImage(f):(this.fire(new u.j(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,t){ut.getImage(this._requestManager.transformRequest(f,se.Image),t)}listImages(){return this.style.listImages()}addLayer(f,t){return this._lazyInitEmptyStyle(),this.style.addLayer(f,t),this._update(!0)}moveLayer(f,t){return this.style.moveLayer(f,t),this._update(!0)}removeLayer(f){return this.style.removeLayer(f),this._update(!0)}getLayer(f){return this.style.getLayer(f)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(f,t,o){return this.style.setLayerZoomRange(f,t,o),this._update(!0)}setFilter(f,t,o={}){return this.style.setFilter(f,t,o),this._update(!0)}getFilter(f){return this.style.getFilter(f)}setPaintProperty(f,t,o,c={}){return this.style.setPaintProperty(f,t,o,c),this._update(!0)}getPaintProperty(f,t){return this.style.getPaintProperty(f,t)}setLayoutProperty(f,t,o,c={}){return this.style.setLayoutProperty(f,t,o,c),this._update(!0)}getLayoutProperty(f,t){return this.style.getLayoutProperty(f,t)}setGlyphs(f,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(f,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(f,t,o={}){return this._lazyInitEmptyStyle(),this.style.addSprite(f,t,o,c=>{c||this._update(!0)}),this}removeSprite(f){return this._lazyInitEmptyStyle(),this.style.removeSprite(f),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(f,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(f,t,o=>{o||this._update(!0)}),this}setLight(f,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(f,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(f,t){return this.style.setFeatureState(f,t),this._update()}removeFeatureState(f,t){return this.style.removeFeatureState(f,t),this._update()}getFeatureState(f){return this.style.getFeatureState(f)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let f=0,t=0;return this._container&&(f=this._container.clientWidth||400,t=this._container.clientHeight||300),[f,t]}_setupContainer(){const f=this._container;f.classList.add("maplibregl-map");const t=this._canvasContainer=L.create("div","maplibregl-canvas-container",f);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=L.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");const o=this._containerDimensions(),c=this._getClampedPixelRatio(o[0],o[1]);this._resizeCanvas(o[0],o[1],c);const d=this._controlContainer=L.create("div","maplibregl-control-container",f),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(x=>{g[x]=L.create("div",`maplibregl-ctrl-${x} `,d)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=L.create("div","maplibregl-cooperative-gesture-screen",this._container);let f=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(f=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` +
${f}
+
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
+ `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){L.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(f,t,o){this._canvas.width=Math.floor(o*f),this._canvas.height=Math.floor(o*t),this._canvas.style.width=`${f}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const f={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",c=>{t={requestedAttributes:f},c&&(t.statusMessage=c.statusMessage,t.type=c.type)},{once:!0});const o=this._canvas.getContext("webgl2",f)||this._canvas.getContext("webgl",f);if(!o){const c="Failed to initialize WebGL";throw t?(t.message=c,new Error(JSON.stringify(t))):new Error(c)}this.painter=new zs(o,this.transform),ne.testSupport(o)}_onCooperativeGesture(f,t,o){return!t&&o<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(f){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_render(f){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(f),this._removed)return;let o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const d=this.transform.zoom,g=u.h.now();this.style.zoomHistory.update(d,g);const x=new u.a8(d,{now:g,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),b=x.crossFadingFactor();b===1&&b===this._crossFadingFactor||(o=!0,this._crossFadingFactor=b),this.style.update(x)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=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._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new u.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.bg.mark(u.bh.load),this.fire(new u.k("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const c=this._sourcesDirty||this._styleDirty||this._placementDirty;return c||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.k("idle")),!this._loaded||this._fullyLoaded||c||(this._fullyLoaded=!0,u.bg.mark(u.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var f;this._hash&&this._hash.remove();for(const o of this._controls)o.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),ut.removeThrottleControl(this._imageQueueHandle),(f=this._resizeObserver)===null||f===void 0||f.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),L.remove(this._canvasContainer),L.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),u.bg.clearMetrics(),this._removed=!0,this.fire(new u.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=u.h.frame(f=>{u.bg.frame(f),this._frame=null,this._render(f)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}get version(){return et}getCameraTargetElevation(){return this.transform.elevation}},At.NavigationControl=class{constructor(f){this._updateZoomButtons=()=>{const t=this._map.getZoom(),o=t===this._map.getMaxZoom(),c=t===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=c,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",c.toString())},this._rotateCompassArrow=()=>{const t=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=t},this._setButtonTitle=(t,o)=>{const c=this._map._getUIString(`NavigationControl.${o}`);t.title=c,t.setAttribute("aria-label",c)},this.options=u.e({},Iu,f),this._container=L.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),L.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),L.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=L.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(f){return this._map=f,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 Cu(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){L.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(f,t){const o=L.create("button",f,this._container);return o.type="button",o.addEventListener("click",t),o}},At.GeolocateControl=class extends u.E{constructor(f){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new u.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,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(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new u.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const o=new u.L(t.coords.longitude,t.coords.latitude),c=t.coords.accuracy,d=this._map.getBearing(),g=u.e({bearing:d},this.options.fitBoundsOptions),x=It.fromLngLat(o,c);this._map.fitBounds(x,g,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const o=new u.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=t.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=t=>{if(this._map){if(this.options.trackUserLocation)if(t.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;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&go)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new u.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=L.create("button","maplibregl-ctrl-geolocate",this._container),L.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){u.w("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=L.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ds({element:this._dotElement}),this._circleElement=L.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ds({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.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 u.k("trackuserlocationend")))})}},this.options=u.e({},oi,f)}onAdd(f){return this._map=f,this._container=L.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,o=!1){gi===void 0||o?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(c=>{gi=c.state!=="denied",t(gi)}).catch(()=>{gi=!!window.navigator.geolocation,t(gi)}):(gi=!!window.navigator.geolocation,t(gi)):t(gi)}(this._setupUI),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(),L.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ti=0,go=!1}_isOutOfMapMaxBounds(f){const t=this._map.getMaxBounds(),o=f.coords;return t&&(o.longitudet.getEast()||o.latitudet.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(){const f=this._map.getBounds(),t=f.getSouthEast(),o=f.getNorthEast(),c=t.distanceTo(o),d=Math.ceil(this._accuracy/(c/this._map._container.clientHeight)*2);this._circleElement.style.width=`${d}px`,this._circleElement.style.height=`${d}px`}trigger(){if(!this._setup)return u.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 u.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ti--,go=!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 u.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 u.k("trackuserlocationstart"));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 f;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ti++,ti>1?(f={maximumAge:6e5,timeout:0},go=!0):(f=this.options.positionOptions,go=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,f)}}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)}},At.AttributionControl=Ln,At.LogoControl=Ht,At.ScaleControl=class{constructor(f){this._onMove=()=>{aa(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,aa(this._map,this._container,this.options)},this.options=u.e({},oa,f)}getDefaultPosition(){return"bottom-left"}onAdd(f){return this._map=f,this._container=L.create("div","maplibregl-ctrl maplibregl-ctrl-scale",f.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){L.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},At.FullscreenControl=class extends u.E{constructor(f={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,f&&f.container&&(f.container instanceof HTMLElement?this._container=f.container:u.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(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=L.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){L.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const f=this._fullscreenButton=L.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);L.create("span","maplibregl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.title=f}_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 u.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new u.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_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()}},At.TerrainControl=class{constructor(f){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.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=f}onAdd(f){return this._map=f,this._container=L.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=L.create("button","maplibregl-ctrl-terrain",this._container),L.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(){L.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},At.Popup=class extends u.E{constructor(f){super(),this.remove=()=>(this._content&&L.remove(this._content),this._container&&(L.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 u.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=L.create("div","maplibregl-popup",this._map.getContainer()),this._tip=L.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const x of this.options.className.split(" "))this._container.classList.add(x);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._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Pu(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const o=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let c=this.options.anchor;const d=yo(this.options.offset);if(!c){const x=this._container.offsetWidth,b=this._container.offsetHeight;let T;T=o.y+d.bottom.ythis._map.transform.height-b?["bottom"]:[],o.xthis._map.transform.width-x/2&&T.push("right"),c=T.length===0?"bottom":T.join("-")}const g=o.add(d[c]).round();L.setTransform(this._container,`${Yn[c]} translate(${g.x}px,${g.y}px)`),Mh(this._container,c,"popup")},this._onClose=()=>{this.remove()},this.options=u.e(Object.create(Mu),f)}addTo(f){return this._map&&this.remove(),this._map=f,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 u.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(f){return this._lngLat=u.L.convert(f),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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(document.createTextNode(f))}setHTML(f){const t=document.createDocumentFragment(),o=document.createElement("body");let c;for(o.innerHTML=f;c=o.firstChild,c;)t.appendChild(c);return this.setDOMContent(t)}getMaxWidth(){var f;return(f=this._container)===null||f===void 0?void 0:f.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=L.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(f),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(f){this._container&&this._container.classList.add(f)}removeClassName(f){this._container&&this._container.classList.remove(f)}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){if(this._container)return this._container.classList.toggle(f)}_createCloseButton(){this.options.closeButton&&(this._closeButton=L.create("button","maplibregl-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))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const f=this._container.querySelector(zu);f&&f.focus()}},At.Marker=Ds,At.Style=Ui,At.LngLat=u.L,At.LngLatBounds=It,At.Point=u.P,At.MercatorCoordinate=u.U,At.Evented=u.E,At.AJAXError=u.bi,At.config=u.c,At.CanvasSource=or,At.GeoJSONSource=sr,At.ImageSource=sn,At.RasterDEMTileSource=rn,At.RasterTileSource=Oi,At.VectorTileSource=nn,At.VideoSource=ss,At.setRTLTextPlugin=u.bj,At.getRTLTextPluginStatus=u.bk,At.prewarm=function(){Ca().acquire(Ct)},At.clearPrewarmedResources=function(){const f=Br;f&&(f.isPreloaded()&&f.numActive()===1?(f.release(Ct),Br=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()"))},Au.extend(At,{isSafari:u.ac,getPerformanceMetrics:u.bg.getPerformanceMetrics}),At});var I=_;return I})})(u1);var h1=u1.exports;const Wm=Xv(h1),GS=vb({__proto__:null,default:Wm},[h1]),HS="modulepreload",WS=function(i){return"/"+i},Fv={},XS=function(r,l,p){let _=Promise.resolve();if(l&&l.length>0){const w=document.getElementsByTagName("link");_=Promise.all(l.map(I=>{if(I=WS(I),I in Fv)return;Fv[I]=!0;const u=I.endsWith(".css"),N=u?'[rel="stylesheet"]':"";if(!!p)for(let le=w.length-1;le>=0;le--){const te=w[le];if(te.href===I&&(!u||te.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${I}"]${N}`))return;const ne=document.createElement("link");if(ne.rel=u?"stylesheet":HS,u||(ne.as="script",ne.crossOrigin=""),ne.href=I,document.head.appendChild(ne),u)return new Promise((le,te)=>{ne.addEventListener("load",le),ne.addEventListener("error",()=>te(new Error(`Unable to preload CSS for ${I}`)))})}))}return _.then(()=>r()).catch(w=>{const I=new Event("vite:preloadError",{cancelable:!0});if(I.payload=w,window.dispatchEvent(I),!I.defaultPrevented)throw w})},KS=at.createContext(null);function YS(i,r){const l=Array.isArray(i)?i[0]:i?i.x:0,p=Array.isArray(i)?i[1]:i?i.y:0,_=Array.isArray(r)?r[0]:r?r.x:0,w=Array.isArray(r)?r[1]:r?r.y:0;return l===_&&p===w}function Gs(i,r){if(i===r)return!0;if(!i||!r)return!1;if(Array.isArray(i)){if(!Array.isArray(r)||i.length!==r.length)return!1;for(let l=0;l{let _=null;"interactive"in p&&(_=Object.assign({},p),delete _.interactive);const w=r[p.ref];if(w){_=_||Object.assign({},p),delete _.ref;for(const I of JS)I in w&&(_[I]=w[I])}return _||p});return{...i,layers:l}}var Uv={};const jv={version:8,sources:{},layers:[]},$v={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},Qf={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Zv={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},eT=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],tT=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class $l{constructor(r,l,p){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=_=>{const w=this.props[Zv[_.type]];w?w(_):_.type==="error"&&console.error(_.error)},this._onPointerEvent=_=>{(_.type==="mousemove"||_.type==="mouseout")&&this._updateHover(_);const w=this.props[$v[_.type]];w&&(this.props.interactiveLayerIds&&_.type!=="mouseover"&&_.type!=="mouseout"&&(_.features=this._hoveredFeatures||this._queryRenderedFeatures(_.point)),w(_),delete _.features)},this._onCameraEvent=_=>{if(!this._internalUpdate){const w=this.props[Qf[_.type]];w&&w(_)}_.type in this._deferredEvents&&(this._deferredEvents[_.type]=!1)},this._MapClass=r,this.props=l,this._initialize(p)}get map(){return this._map}get transform(){return this._renderTransform}setProps(r){const l=this.props;this.props=r;const p=this._updateSettings(r,l);p&&this._createShadowTransform(this._map);const _=this._updateSize(r),w=this._updateViewState(r,!0);this._updateStyle(r,l),this._updateStyleComponents(r,l),this._updateHandlers(r,l),(p||_||w&&!this._map.isMoving())&&this.redraw()}static reuse(r,l){const p=$l.savedMaps.pop();if(!p)return null;const _=p.map,w=_.getContainer();for(l.className=w.className;w.childNodes.length>0;)l.appendChild(w.childNodes[0]);_._container=l;const I=_._resizeObserver;I&&(I.disconnect(),I.observe(l)),p.setProps({...r,styleDiffing:!1}),_.resize();const{initialViewState:u}=r;return u&&(u.bounds?_.fitBounds(u.bounds,{...u.fitBoundsOptions,duration:0}):p._updateViewState(u,!1)),_.isStyleLoaded()?_.fire("load"):_.once("styledata",()=>_.fire("load")),_._update(),p}_initialize(r){const{props:l}=this,{mapStyle:p=jv}=l,_={...l,...l.initialViewState,accessToken:l.mapboxAccessToken||iT()||null,container:r,style:Vv(p)},w=_.initialViewState||_.viewState||_;if(Object.assign(_,{center:[w.longitude||0,w.latitude||0],zoom:w.zoom||0,pitch:w.pitch||0,bearing:w.bearing||0}),l.gl){const ne=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=ne,l.gl)}const I=new this._MapClass(_);w.padding&&I.setPadding(w.padding),l.cursor&&(I.getCanvas().style.cursor=l.cursor),this._createShadowTransform(I);const u=I._render;I._render=ne=>{this._inRender=!0,u.call(I,ne),this._inRender=!1};const N=I._renderTaskQueue.run;I._renderTaskQueue.run=ne=>{N.call(I._renderTaskQueue,ne),this._onBeforeRepaint()},I.on("render",()=>this._onAfterRepaint());const L=I.fire;I.fire=this._fireEvent.bind(this,L),I.on("resize",()=>{this._renderTransform.resize(I.transform.width,I.transform.height)}),I.on("styledata",()=>{this._updateStyleComponents(this.props,{}),Bv(I.transform,this._renderTransform)}),I.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const ne in $v)I.on(ne,this._onPointerEvent);for(const ne in Qf)I.on(ne,this._onCameraEvent);for(const ne in Zv)I.on(ne,this._onEvent);this._map=I}recycle(){const l=this.map.getContainer().querySelector("[mapboxgl-children]");l==null||l.remove(),$l.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const r=this._map;!this._inRender&&r.style&&(r._frame&&(r._frame.cancel(),r._frame=null),r._render())}_createShadowTransform(r){const l=QS(r.transform);r.painter.transform=l,this._renderTransform=l}_updateSize(r){const{viewState:l}=r;if(l){const p=this._map;if(l.width!==p.transform.width||l.height!==p.transform.height)return p.resize(),!0}return!1}_updateViewState(r,l){if(this._internalUpdate)return!1;const p=this._map,_=this._renderTransform,{zoom:w,pitch:I,bearing:u}=_,N=p.isMoving();N&&(_.cameraElevationReference="sea");const L=Nv(_,{...Ov(p.transform),...r});if(N&&(_.cameraElevationReference="ground"),L&&l){const ne=this._deferredEvents;ne.move=!0,ne.zoom||(ne.zoom=w!==_.zoom),ne.rotate||(ne.rotate=u!==_.bearing),ne.pitch||(ne.pitch=I!==_.pitch)}return N||Nv(p.transform,r),L}_updateSettings(r,l){const p=this._map;let _=!1;for(const w of eT)if(w in r&&!Gs(r[w],l[w])){_=!0;const I=p[`set${w[0].toUpperCase()}${w.slice(1)}`];I==null||I.call(p,r[w])}return _}_updateStyle(r,l){if(r.cursor!==l.cursor&&(this._map.getCanvas().style.cursor=r.cursor||""),r.mapStyle!==l.mapStyle){const{mapStyle:p=jv,styleDiffing:_=!0}=r,w={diff:_};return"localIdeographFontFamily"in r&&(w.localIdeographFontFamily=r.localIdeographFontFamily),this._map.setStyle(Vv(p),w),!0}return!1}_updateStyleComponents(r,l){const p=this._map;let _=!1;return p.isStyleLoaded()&&("light"in r&&p.setLight&&!Gs(r.light,l.light)&&(_=!0,p.setLight(r.light)),"fog"in r&&p.setFog&&!Gs(r.fog,l.fog)&&(_=!0,p.setFog(r.fog)),"terrain"in r&&p.setTerrain&&!Gs(r.terrain,l.terrain)&&(!r.terrain||p.getSource(r.terrain.source))&&(_=!0,p.setTerrain(r.terrain))),_}_updateHandlers(r,l){var p,_;const w=this._map;let I=!1;for(const u of tT){const N=(p=r[u])!==null&&p!==void 0?p:!0,L=(_=l[u])!==null&&_!==void 0?_:!0;Gs(N,L)||(I=!0,N?w[u].enable(N):w[u].disable())}return I}_queryRenderedFeatures(r){const l=this._map,p=l.transform,{interactiveLayerIds:_=[]}=this.props;try{return l.transform=this._renderTransform,l.queryRenderedFeatures(r,{layers:_.filter(l.getLayer.bind(l))})}catch{return[]}finally{l.transform=p}}_updateHover(r){var l;const{props:p}=this;if(p.interactiveLayerIds&&(p.onMouseMove||p.onMouseEnter||p.onMouseLeave)){const w=r.type,I=((l=this._hoveredFeatures)===null||l===void 0?void 0:l.length)>0,u=this._queryRenderedFeatures(r.point),N=u.length>0;!N&&I&&(r.type="mouseleave",this._onPointerEvent(r)),this._hoveredFeatures=u,N&&!I&&(r.type="mouseenter",this._onPointerEvent(r)),r.type=w}else this._hoveredFeatures=null}_fireEvent(r,l,p){const _=this._map,w=_.transform,I=typeof l=="string"?l:l.type;return I==="move"&&this._updateViewState(this.props,!1),I in Qf&&(typeof l=="object"&&(l.viewState=Ov(w)),this._map.isMoving())?(_.transform=this._renderTransform,r.call(_,l,p),_.transform=w,_):(r.call(_,l,p),_)}_onBeforeRepaint(){const r=this._map;this._internalUpdate=!0;for(const p in this._deferredEvents)this._deferredEvents[p]&&r.fire(p);this._internalUpdate=!1;const l=this._map.transform;r.transform=this._renderTransform,this._onAfterRepaint=()=>{Bv(this._renderTransform,l),r.transform=l}}}$l.savedMaps=[];function iT(){let i=null;if(typeof location<"u"){const r=/access_token=([^&\/]*)/.exec(location.search);i=r&&r[1]}try{i=i||Uv.MapboxAccessToken}catch{}try{i=i||Uv.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return i}const nT=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function rT(i){if(!i)return null;const r=i.map,l={getMap:()=>r,getCenter:()=>i.transform.center,getZoom:()=>i.transform.zoom,getBearing:()=>i.transform.bearing,getPitch:()=>i.transform.pitch,getPadding:()=>i.transform.padding,getBounds:()=>i.transform.getBounds(),project:p=>{const _=r.transform;r.transform=i.transform;const w=r.project(p);return r.transform=_,w},unproject:p=>{const _=r.transform;r.transform=i.transform;const w=r.unproject(p);return r.transform=_,w},queryTerrainElevation:(p,_)=>{const w=r.transform;r.transform=i.transform;const I=r.queryTerrainElevation(p,_);return r.transform=w,I},queryRenderedFeatures:(p,_)=>{const w=r.transform;r.transform=i.transform;const I=r.queryRenderedFeatures(p,_);return r.transform=w,I}};for(const p of sT(r))!(p in l)&&!nT.includes(p)&&(l[p]=r[p].bind(r));return l}function sT(i){const r=new Set;let l=i;for(;l;){for(const p of Object.getOwnPropertyNames(l))p[0]!=="_"&&typeof i[p]=="function"&&p!=="fire"&&p!=="setEventedParent"&&r.add(p);l=Object.getPrototypeOf(l)}return Array.from(r)}const oT=typeof document<"u"?at.useLayoutEffect:at.useEffect,aT=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function lT(i,r){for(const p of aT)p in r&&(i[p]=r[p]);const{RTLTextPlugin:l="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=r;l&&i.getRTLTextPluginStatus&&i.getRTLTextPluginStatus()==="unavailable"&&i.setRTLTextPlugin(l,p=>{p&&console.error(p)},!1)}const yp=at.createContext(null);function uT(i,r,l){const p=at.useContext(KS),[_,w]=at.useState(null),I=at.useRef(),{current:u}=at.useRef({mapLib:null,map:null});at.useEffect(()=>{const ne=i.mapLib;let le=!0,te;return Promise.resolve(ne||l).then(ke=>{if(!le)return;if(!ke)throw new Error("Invalid mapLib");const Ie="Map"in ke?ke:ke.default;if(!Ie.Map)throw new Error("Invalid mapLib");if(lT(Ie,i),!Ie.supported||Ie.supported(i))i.reuseMaps&&(te=$l.reuse(i,I.current)),te||(te=new $l(Ie.Map,i,I.current)),u.map=rT(te),u.mapLib=Ie,w(te),p==null||p.onMapMount(u.map,i.id);else throw new Error("Map is not supported by this browser")}).catch(ke=>{const{onError:Ie}=i;Ie?Ie({type:"error",target:null,originalEvent:null,error:ke}):console.error(ke)}),()=>{le=!1,te&&(p==null||p.onMapUnmount(i.id),i.reuseMaps?te.recycle():te.destroy())}},[]),oT(()=>{_&&_.setProps(i)}),at.useImperativeHandle(r,()=>u.map,[_]);const N=at.useMemo(()=>({position:"relative",width:"100%",height:"100%",...i.style}),[i.style]),L={height:"100%"};return at.createElement("div",{id:i.id,ref:I,style:N},_&&at.createElement(yp.Provider,{value:u},at.createElement("div",{"mapboxgl-children":"",style:L},i.children)))}const cT=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function Ia(i,r){if(!i||!r)return;const l=i.style;for(const p in r){const _=r[p];Number.isFinite(_)&&!cT.test(p)?l[p]=`${_}px`:l[p]=_}}function hT(i,r){const{map:l,mapLib:p}=at.useContext(yp),_=at.useRef({props:i});_.current.props=i;const w=at.useMemo(()=>{let De=!1;at.Children.forEach(i.children,J=>{J&&(De=!0)});const ut={...i,element:De?document.createElement("div"):null},se=new p.Marker(ut);return se.setLngLat([i.longitude,i.latitude]),se.getElement().addEventListener("click",J=>{var de,Se;(Se=(de=_.current.props).onClick)===null||Se===void 0||Se.call(de,{type:"click",target:se,originalEvent:J})}),se.on("dragstart",J=>{var de,Se;const Oe=J;Oe.lngLat=w.getLngLat(),(Se=(de=_.current.props).onDragStart)===null||Se===void 0||Se.call(de,Oe)}),se.on("drag",J=>{var de,Se;const Oe=J;Oe.lngLat=w.getLngLat(),(Se=(de=_.current.props).onDrag)===null||Se===void 0||Se.call(de,Oe)}),se.on("dragend",J=>{var de,Se;const Oe=J;Oe.lngLat=w.getLngLat(),(Se=(de=_.current.props).onDragEnd)===null||Se===void 0||Se.call(de,Oe)}),se},[]);at.useEffect(()=>(w.addTo(l.getMap()),()=>{w.remove()}),[]);const{longitude:I,latitude:u,offset:N,style:L,draggable:ne=!1,popup:le=null,rotation:te=0,rotationAlignment:ke="auto",pitchAlignment:Ie="auto"}=i;return at.useEffect(()=>{Ia(w.getElement(),L)},[L]),at.useImperativeHandle(r,()=>w,[]),(w.getLngLat().lng!==I||w.getLngLat().lat!==u)&&w.setLngLat([I,u]),N&&!YS(w.getOffset(),N)&&w.setOffset(N),w.isDraggable()!==ne&&w.setDraggable(ne),w.getRotation()!==te&&w.setRotation(te),w.getRotationAlignment()!==ke&&w.setRotationAlignment(ke),w.getPitchAlignment()!==Ie&&w.setPitchAlignment(Ie),w.getPopup()!==le&&w.setPopup(le),qg.createPortal(i.children,w.getElement())}at.memo(at.forwardRef(hT));function qv(i){return new Set(i?i.trim().split(/\s+/):[])}function dT(i,r){const{map:l,mapLib:p}=at.useContext(yp),_=at.useMemo(()=>document.createElement("div"),[]),w=at.useRef({props:i});w.current.props=i;const I=at.useMemo(()=>{const u={...i},N=new p.Popup(u);return N.setLngLat([i.longitude,i.latitude]),N.once("open",L=>{var ne,le;(le=(ne=w.current.props).onOpen)===null||le===void 0||le.call(ne,L)}),N},[]);if(at.useEffect(()=>{const u=N=>{var L,ne;(ne=(L=w.current.props).onClose)===null||ne===void 0||ne.call(L,N)};return I.on("close",u),I.setDOMContent(_).addTo(l.getMap()),()=>{I.off("close",u),I.isOpen()&&I.remove()}},[]),at.useEffect(()=>{Ia(I.getElement(),i.style)},[i.style]),at.useImperativeHandle(r,()=>I,[]),I.isOpen()&&((I.getLngLat().lng!==i.longitude||I.getLngLat().lat!==i.latitude)&&I.setLngLat([i.longitude,i.latitude]),i.offset&&!Gs(I.options.offset,i.offset)&&I.setOffset(i.offset),(I.options.anchor!==i.anchor||I.options.maxWidth!==i.maxWidth)&&(I.options.anchor=i.anchor,I.setMaxWidth(i.maxWidth)),I.options.className!==i.className)){const u=qv(I.options.className),N=qv(i.className);for(const L of u)N.has(L)||I.removeClassName(L);for(const L of N)u.has(L)||I.addClassName(L);I.options.className=i.className}return qg.createPortal(i.children,_)}at.memo(at.forwardRef(dT));function qc(i,r,l,p){const _=at.useContext(yp),w=at.useMemo(()=>i(_),[]);return at.useEffect(()=>{const I=p||l||r,u=typeof r=="function"&&typeof l=="function"?r:null,N=typeof l=="function"?l:typeof r=="function"?r:null,{map:L}=_;return L.hasControl(w)||(L.addControl(w,I==null?void 0:I.position),u&&u(_)),()=>{N&&N(_),L.hasControl(w)&&L.removeControl(w)}},[]),w}function pT(i){const r=qc(({mapLib:l})=>new l.AttributionControl(i),{position:i.position});return at.useEffect(()=>{Ia(r._container,i.style)},[i.style]),null}at.memo(pT);function fT(i){const r=qc(({mapLib:l})=>new l.FullscreenControl({container:i.containerId&&document.getElementById(i.containerId)}),{position:i.position});return at.useEffect(()=>{Ia(r._controlContainer,i.style)},[i.style]),null}at.memo(fT);function mT(i,r){const l=at.useRef({props:i}),p=qc(({mapLib:_})=>{const w=new _.GeolocateControl(i),I=w._setupUI;return w._setupUI=u=>{w._container.hasChildNodes()||I(u)},w.on("geolocate",u=>{var N,L;(L=(N=l.current.props).onGeolocate)===null||L===void 0||L.call(N,u)}),w.on("error",u=>{var N,L;(L=(N=l.current.props).onError)===null||L===void 0||L.call(N,u)}),w.on("outofmaxbounds",u=>{var N,L;(L=(N=l.current.props).onOutOfMaxBounds)===null||L===void 0||L.call(N,u)}),w.on("trackuserlocationstart",u=>{var N,L;(L=(N=l.current.props).onTrackUserLocationStart)===null||L===void 0||L.call(N,u)}),w.on("trackuserlocationend",u=>{var N,L;(L=(N=l.current.props).onTrackUserLocationEnd)===null||L===void 0||L.call(N,u)}),w},{position:i.position});return l.current.props=i,at.useImperativeHandle(r,()=>p,[]),at.useEffect(()=>{Ia(p._container,i.style)},[i.style]),null}at.memo(at.forwardRef(mT));function gT(i){const r=qc(({mapLib:l})=>new l.NavigationControl(i),{position:i.position});return at.useEffect(()=>{Ia(r._container,i.style)},[i.style]),null}at.memo(gT);function yT(i){const r=qc(({mapLib:w})=>new w.ScaleControl(i),{position:i.position}),l=at.useRef(i),p=l.current;l.current=i;const{style:_}=i;return i.maxWidth!==void 0&&i.maxWidth!==p.maxWidth&&(r.options.maxWidth=i.maxWidth),i.unit!==void 0&&i.unit!==p.unit&&r.setUnit(i.unit),at.useEffect(()=>{Ia(r._container,_)},[_]),null}at.memo(yT);const _T=XS(()=>Promise.resolve().then(()=>GS),void 0),vT=at.forwardRef(function(r,l){return uT(r,l,_T)});var Un=(i,r,l)=>new Promise((p,_)=>{var w=N=>{try{u(l.next(N))}catch(L){_(L)}},I=N=>{try{u(l.throw(N))}catch(L){_(L)}},u=N=>N.done?p(N.value):Promise.resolve(N.value).then(w,I);u((l=l.apply(i,r)).next())}),pr=Uint8Array,Cl=Uint16Array,xT=Int32Array,d1=new pr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),p1=new pr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),wT=new pr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f1=function(i,r){for(var l=new Cl(31),p=0;p<31;++p)l[p]=r+=1<>1|(Ut&21845)<<1,$s=($s&52428)>>2|($s&13107)<<2,$s=($s&61680)>>4|($s&3855)<<4,Xm[Ut]=(($s&65280)>>8|($s&255)<<8)>>1;var $s,Ut,bc=function(i,r,l){for(var p=i.length,_=0,w=new Cl(r);_>N]=L}else for(u=new Cl(p),_=0;_>15-i[_]);return u},Gc=new pr(288);for(Ut=0;Ut<144;++Ut)Gc[Ut]=8;var Ut;for(Ut=144;Ut<256;++Ut)Gc[Ut]=9;var Ut;for(Ut=256;Ut<280;++Ut)Gc[Ut]=7;var Ut;for(Ut=280;Ut<288;++Ut)Gc[Ut]=8;var Ut,y1=new pr(32);for(Ut=0;Ut<32;++Ut)y1[Ut]=5;var Ut,kT=bc(Gc,9,1),ET=bc(y1,5,1),Jf=function(i){for(var r=i[0],l=1;lr&&(r=i[l]);return r},Yr=function(i,r,l){var p=r/8|0;return(i[p]|i[p+1]<<8)>>(r&7)&l},em=function(i,r){var l=r/8|0;return(i[l]|i[l+1]<<8|i[l+2]<<16)>>(r&7)},IT=function(i){return(i+7)/8|0},CT=function(i,r,l){(r==null||r<0)&&(r=0),(l==null||l>i.length)&&(l=i.length);var p=new pr(l-r);return p.set(i.subarray(r,l)),p},PT=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],dr=function(i,r,l){var p=new Error(r||PT[i]);if(p.code=i,Error.captureStackTrace&&Error.captureStackTrace(p,dr),!l)throw p;return p},Gg=function(i,r,l,p){var _=i.length,w=p?p.length:0;if(!_||r.f&&!r.l)return l||new pr(0);var I=!l||r.i!=2,u=r.i;l||(l=new pr(_*3));var N=function(sn){var ss=l.length;if(sn>ss){var or=new pr(Math.max(ss*2,sn));or.set(l),l=or}},L=r.f||0,ne=r.p||0,le=r.b||0,te=r.l,ke=r.d,Ie=r.m,De=r.n,ut=_*8;do{if(!te){L=Yr(i,ne,1);var se=Yr(i,ne+1,3);if(ne+=3,se)if(se==1)te=kT,ke=ET,Ie=9,De=5;else if(se==2){var Oe=Yr(i,ne,31)+257,He=Yr(i,ne+10,15)+4,Je=Oe+Yr(i,ne+5,31)+1;ne+=14;for(var $e=new pr(Je),Ft=new pr(19),Ge=0;Ge>4;if(J<16)$e[Ge++]=J;else{var ui=0,Bi=0;for(J==16?(Bi=3+Yr(i,ne,3),ne+=2,ui=$e[Ge-1]):J==17?(Bi=3+Yr(i,ne,7),ne+=3):J==18&&(Bi=11+Yr(i,ne,127),ne+=7);Bi--;)$e[Ge++]=ui}}var Ii=$e.subarray(0,Oe),Ne=$e.subarray(Oe);Ie=Jf(Ii),De=Jf(Ne),te=bc(Ii,Ie,1),ke=bc(Ne,De,1)}else dr(1);else{var J=IT(ne)+4,de=i[J-4]|i[J-3]<<8,Se=J+de;if(Se>_){u&&dr(0);break}I&&N(le+de),l.set(i.subarray(J,Se),le),r.b=le+=de,r.p=ne=Se*8,r.f=L;continue}if(ne>ut){u&&dr(0);break}}I&&N(le+131072);for(var ct=(1<>4;if(ne+=ui&15,ne>ut){u&&dr(0);break}if(ui||dr(2),kt<256)l[le++]=kt;else if(kt==256){Lt=ne,te=null;break}else{var It=kt-254;if(kt>264){var Ge=kt-257,jt=d1[Ge];It=Yr(i,ne,(1<>4;nn||dr(3),ne+=nn&15;var Ne=TT[Oi];if(Oi>3){var jt=p1[Oi];Ne+=em(i,ne)&(1<ut){u&&dr(0);break}I&&N(le+131072);var rn=le+It;if(le>3&1)+(r>>4&1);p>0;p-=!i[l++]);return l+(r&2)},AT=function(i){var r=i.length;return(i[r-4]|i[r-3]<<8|i[r-2]<<16|i[r-1]<<24)>>>0},DT=function(i,r){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&dr(6,"invalid zlib data"),(i[1]>>5&1)==+!r&&dr(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function LT(i,r){return Gg(i,{i:2},r&&r.out,r&&r.dictionary)}function RT(i,r){var l=zT(i);return l+8>i.length&&dr(6,"invalid gzip data"),Gg(i.subarray(l,-8),{i:2},r&&r.out||new pr(AT(i)),r&&r.dictionary)}function FT(i,r){return Gg(i.subarray(DT(i,r&&r.dictionary),-4),{i:2},r&&r.out,r&&r.dictionary)}function Km(i,r){return i[0]==31&&i[1]==139&&i[2]==8?RT(i,r):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?LT(i,r):FT(i,r)}var BT=typeof TextDecoder<"u"&&new TextDecoder,OT=0;try{BT.decode(MT,{stream:!0}),OT=1}catch{}var _1=(i,r)=>i*Math.pow(2,r),ac=(i,r)=>Math.floor(i/Math.pow(2,r)),ep=(i,r)=>_1(i.getUint16(r+1,!0),8)+i.getUint8(r),v1=(i,r)=>_1(i.getUint32(r+2,!0),16)+i.getUint16(r,!0),NT=(i,r,l,p,_)=>{if(i!=p.getUint8(_))return i-p.getUint8(_);const w=ep(p,_+1);if(r!=w)return r-w;const I=ep(p,_+4);return l!=I?l-I:0},VT=(i,r,l,p)=>{const _=x1(i,r|128,l,p);return _?{z:r,x:l,y:p,offset:_[0],length:_[1],is_dir:!0}:null},Gv=(i,r,l,p)=>{const _=x1(i,r,l,p);return _?{z:r,x:l,y:p,offset:_[0],length:_[1],is_dir:!1}:null},x1=(i,r,l,p)=>{let _=0,w=i.byteLength/17-1;for(;_<=w;){const I=w+_>>1,u=NT(r,l,p,i,I*17);if(u>0)_=I+1;else if(u<0)w=I-1;else return[v1(i,I*17+7),i.getUint32(I*17+13,!0)]}return null},UT=(i,r)=>i.is_dir&&!r.is_dir?1:!i.is_dir&&r.is_dir?-1:i.z!==r.z?i.z-r.z:i.x!==r.x?i.x-r.x:i.y-r.y,w1=(i,r)=>{const l=i.getUint8(r*17);return{z:l&127,x:ep(i,r*17+1),y:ep(i,r*17+4),offset:v1(i,r*17+7),length:i.getUint32(r*17+13,!0),is_dir:l>>7===1}},Hv=i=>{const r=[],l=new DataView(i);for(let p=0;p{i.sort(UT);const r=new ArrayBuffer(17*i.length),l=new Uint8Array(r);for(let p=0;p>8&255,l[p*17+3]=_.x>>16&255,l[p*17+4]=_.y&255,l[p*17+5]=_.y>>8&255,l[p*17+6]=_.y>>16&255,l[p*17+7]=_.offset&255,l[p*17+8]=ac(_.offset,8)&255,l[p*17+9]=ac(_.offset,16)&255,l[p*17+10]=ac(_.offset,24)&255,l[p*17+11]=ac(_.offset,32)&255,l[p*17+12]=ac(_.offset,48)&255,l[p*17+13]=_.length&255,l[p*17+14]=_.length>>8&255,l[p*17+15]=_.length>>16&255,l[p*17+16]=_.length>>24&255}return r},$T=(i,r)=>{if(i.byteLength<17)return null;const l=i.byteLength/17,p=w1(i,l-1);if(p.is_dir){const _=p.z,w=r.z-_,I=Math.trunc(r.x/(1<{if(i.type=="json"){const l=i.url.substr(10);let p=this.tiles.get(l);return p||(p=new Wv(l),this.tiles.set(l,p)),p.getHeader().then(_=>{const w={tiles:[i.url+"/{z}/{x}/{y}"],minzoom:_.minZoom,maxzoom:_.maxZoom,bounds:[_.minLon,_.minLat,_.maxLon,_.maxLat]};r(null,w,null,null)}).catch(_=>{r(_,null,null,null)}),{cancel:()=>{}}}else{const l=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),p=i.url.match(l);if(!p)throw new Error("Invalid PMTiles protocol URL");const _=p[1];let w=this.tiles.get(_);w||(w=new Wv(_),this.tiles.set(_,w));const I=p[2],u=p[3],N=p[4],L=new AbortController,ne=L.signal;let le=()=>{L.abort()};return w.getHeader().then(te=>{w.getZxy(+I,+u,+N,ne).then(ke=>{ke?r(null,new Uint8Array(ke.data),ke.cacheControl,ke.expires):te.tileType==1?r(null,new Uint8Array,null,null):r(null,null,null,null)}).catch(ke=>{ke.name!=="AbortError"&&r(ke,null,null,null)})}),{cancel:le}}},this.tiles=new Map}add(i){this.tiles.set(i.source.getKey(),i)}get(i){return this.tiles.get(i)}};function ml(i,r){return(r>>>0)*4294967296+(i>>>0)}function HT(i,r){const l=r.buf;let p,_;if(_=l[r.pos++],p=(_&112)>>4,_<128||(_=l[r.pos++],p|=(_&127)<<3,_<128)||(_=l[r.pos++],p|=(_&127)<<10,_<128)||(_=l[r.pos++],p|=(_&127)<<17,_<128)||(_=l[r.pos++],p|=(_&127)<<24,_<128)||(_=l[r.pos++],p|=(_&1)<<31,_<128))return ml(i,p);throw new Error("Expected varint not more than 10 bytes")}function lc(i){const r=i.buf;let l,p;return p=r[i.pos++],l=p&127,p<128||(p=r[i.pos++],l|=(p&127)<<7,p<128)||(p=r[i.pos++],l|=(p&127)<<14,p<128)||(p=r[i.pos++],l|=(p&127)<<21,p<128)?l:(p=r[i.pos],l|=(p&15)<<28,HT(l,i))}function WT(i,r,l,p){if(p==0){l==1&&(r[0]=i-1-r[0],r[1]=i-1-r[1]);const _=r[0];r[0]=r[1],r[1]=_}}var XT=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function KT(i,r,l){if(i>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(r>Math.pow(2,i)-1||l>Math.pow(2,i)-1)throw Error("tile x/y outside zoom level bounds");const p=XT[i],_=Math.pow(2,i);let w=0,I=0,u=0;const N=[r,l];let L=_/2;for(;L>0;)w=(N[0]&L)>0?1:0,I=(N[1]&L)>0?1:0,u+=L*L*(3*w^I),WT(L,N,w,I),L=L/2;return p+u}function S1(i,r){return Un(this,null,function*(){if(r===1||r===0)return i;if(r===2){if(typeof globalThis.DecompressionStream>"u")return Km(new Uint8Array(i));{let p=new Response(i).body.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(p).arrayBuffer()}}else throw Error("Compression method not supported")})}var YT=127;function QT(i,r){let l=0,p=i.length-1;for(;l<=p;){const _=p+l>>1,w=r-i[_].tileId;if(w>0)l=_+1;else if(w<0)p=_-1;else return i[_]}return p>=0&&(i[p].runLength===0||r-i[p].tileId=300)throw Error("Bad response code: "+w.status);const I=w.headers.get("Content-Length");if(w.status===200&&(!I||+I>r))throw p&&p.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield w.arrayBuffer(),etag:w.headers.get("ETag")||void 0,cacheControl:w.headers.get("Cache-Control")||void 0,expires:w.headers.get("Expires")||void 0}})}};function Qr(i,r){const l=i.getUint32(r+4,!0),p=i.getUint32(r+0,!0);return l*Math.pow(2,32)+p}function ek(i,r){const l=new DataView(i),p=l.getUint8(7);if(p>3)throw Error(`Archive is spec version ${p} but this library supports up to spec version 3`);return{specVersion:p,rootDirectoryOffset:Qr(l,8),rootDirectoryLength:Qr(l,16),jsonMetadataOffset:Qr(l,24),jsonMetadataLength:Qr(l,32),leafDirectoryOffset:Qr(l,40),leafDirectoryLength:Qr(l,48),tileDataOffset:Qr(l,56),tileDataLength:Qr(l,64),numAddressedTiles:Qr(l,72),numTileEntries:Qr(l,80),numTileContents:Qr(l,88),clustered:l.getUint8(96)===1,internalCompression:l.getUint8(97),tileCompression:l.getUint8(98),tileType:l.getUint8(99),minZoom:l.getUint8(100),maxZoom:l.getUint8(101),minLon:l.getInt32(102,!0)/1e7,minLat:l.getInt32(106,!0)/1e7,maxLon:l.getInt32(110,!0)/1e7,maxLat:l.getInt32(114,!0)/1e7,centerZoom:l.getUint8(118),centerLon:l.getInt32(119,!0)/1e7,centerLat:l.getInt32(123,!0)/1e7,etag:r}}function T1(i){const r={buf:new Uint8Array(i),pos:0},l=lc(r),p=[];let _=0;for(let w=0;w0?p[w].offset=p[w-1].offset+p[w-1].length:p[w].offset=I-1}return p}function tk(i){const r=new DataView(i);return r.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):r.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var Pl=class extends Error{};function ik(i,r,l,p){return Un(this,null,function*(){const _=yield i.getBytes(0,16384);if(new DataView(_.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(tk(_.data)<3)return[yield b1.getHeader(i)];const I=_.data.slice(0,YT);let u=_.etag;p&&_.etag!=p&&(console.warn("ETag conflict detected; your HTTP server might not support content-based ETag headers. ETags disabled for "+i.getKey()),u=void 0);const N=ek(I,u);if(l){const L=_.data.slice(N.rootDirectoryOffset,N.rootDirectoryOffset+N.rootDirectoryLength),ne=i.getKey()+"|"+(N.etag||"")+"|"+N.rootDirectoryOffset+"|"+N.rootDirectoryLength,le=T1(yield r(L,N.internalCompression));return[N,[ne,le.length,le]]}return[N,void 0]})}function nk(i,r,l,p,_){return Un(this,null,function*(){const w=yield i.getBytes(l,p);if(_.etag&&_.etag!==w.etag)throw new Pl(w.etag);const I=yield r(w.data,_.internalCompression),u=T1(I);if(u.length===0)throw new Error("Empty directory is invalid");return u})}var rk=class{constructor(i=100,r=!0,l=S1){this.cache=new Map,this.maxCacheEntries=i,this.counter=1,this.prefetch=r,this.decompress=l}getHeader(i,r){return Un(this,null,function*(){const l=i.getKey();if(this.cache.has(l))return this.cache.get(l).lastUsed=this.counter++,yield this.cache.get(l).data;const p=new Promise((_,w)=>{ik(i,this.decompress,this.prefetch,r).then(I=>{I[1]&&this.cache.set(I[1][0],{lastUsed:this.counter++,data:Promise.resolve(I[1][2])}),_(I[0]),this.prune()}).catch(I=>{w(I)})});return this.cache.set(l,{lastUsed:this.counter++,data:p}),p})}getDirectory(i,r,l,p){return Un(this,null,function*(){const _=i.getKey()+"|"+(p.etag||"")+"|"+r+"|"+l;if(this.cache.has(_))return this.cache.get(_).lastUsed=this.counter++,yield this.cache.get(_).data;const w=new Promise((I,u)=>{nk(i,this.decompress,r,l,p).then(N=>{I(N),this.prune()}).catch(N=>{u(N)})});return this.cache.set(_,{lastUsed:this.counter++,data:w}),w})}getArrayBuffer(i,r,l,p){return Un(this,null,function*(){const _=i.getKey()+"|"+(p.etag||"")+"|"+r+"|"+l;if(this.cache.has(_))return this.cache.get(_).lastUsed=this.counter++,yield this.cache.get(_).data;const w=new Promise((I,u)=>{i.getBytes(r,l).then(N=>{if(p.etag&&p.etag!==N.etag)throw new Pl(N.etag);I(N.data),this.cache.has(_),this.prune()}).catch(N=>{u(N)})});return this.cache.set(_,{lastUsed:this.counter++,data:w}),w})}prune(){if(this.cache.size>=this.maxCacheEntries){let i=1/0,r;this.cache.forEach((l,p)=>{l.lastUsedw.maxZoom)return;let I=w.rootDirectoryOffset,u=w.rootDirectoryLength;for(let N=0;N<=3;N++){const L=yield this.cache.getDirectory(this.source,I,u,w),ne=QT(L,_);if(ne)if(ne.runLength>0){const le=yield this.source.getBytes(w.tileDataOffset+ne.offset,ne.length,p);if(w.etag&&w.etag!==le.etag)throw new Pl(le.etag);return{data:yield this.decompress(le.data,w.tileCompression),cacheControl:le.cacheControl,expires:le.expires}}else I=w.leafDirectoryOffset+ne.offset,u=ne.length;else return}throw Error("Maximum directory depth exceeded")})}getZxy(i,r,l,p){return Un(this,null,function*(){try{return yield this.getZxyAttempt(i,r,l,p)}catch(_){if(_ instanceof Pl)return this.cache.invalidate(this.source,_.message),yield this.getZxyAttempt(i,r,l,p);throw _}})}getMetadataAttempt(){return Un(this,null,function*(){const i=yield this.cache.getHeader(this.source),r=yield this.source.getBytes(i.jsonMetadataOffset,i.jsonMetadataLength);if(i.etag&&i.etag!==r.etag)throw new Pl(r.etag);const l=yield this.decompress(r.data,i.internalCompression),p=new TextDecoder("utf-8");return JSON.parse(p.decode(l))})}getMetadata(){return Un(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(i){if(i instanceof Pl)return this.cache.invalidate(this.source,i.message),yield this.getMetadataAttempt();throw i}})}};function sk(){const[i,r]=at.useState();return at.useEffect(()=>{const l=setInterval(()=>{fetch("./style.json").then(p=>p.json()).then(p=>{JSON.stringify(i)!==JSON.stringify(p)&&r(p)})},1e3);return()=>clearInterval(l)},[i]),at.useEffect(()=>{const l=new GT;return Wm.addProtocol("pmtiles",l.tile),()=>{Wm.removeProtocol("pmtiles")}},[]),Pd.jsx("div",{style:{width:"100vw",height:"100vh"},children:Pd.jsx(vT,{initialViewState:{longitude:139.7673068,latitude:35.6809591,zoom:6},style:{position:"absolute",width:"100%",height:"100%"},hash:!0,mapStyle:i})})}tm.createRoot(document.getElementById("root")).render(Pd.jsx(Fb.StrictMode,{children:Pd.jsx(sk,{})})); +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..425cd90 --- /dev/null +++ b/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite + React + TS + + + + +
+ + diff --git a/style.json b/style.json new file mode 100644 index 0000000..6b980c5 --- /dev/null +++ b/style.json @@ -0,0 +1,461 @@ +{ + "version": 8, + "name": "Charites AI Style", + "metadata": {}, + "sources": { + "openmaptiles": { + "type": "vector", + "url": "pmtiles://https://tile.openstreetmap.jp/static/planet.pmtiles" + } + }, + "sprite": "https://openmaptiles.github.io/osm-bright-gl-style/sprite", + "glyphs": "https://tile.openstreetmap.jp/fonts/{fontstack}/{range}.pbf", + "layers": [ + { + "id": "background", + "type": "background", + "paint": { + "background-color": "#D3D3C9" + } + }, + { + "id": "water", + "type": "fill", + "metadata": { + "mapbox:group": "1444849382550.77" + }, + "source": "openmaptiles", + "source-layer": "water", + "filter": [ + "all", + [ + "!=", + "intermittent", + 1 + ], + [ + "!=", + "brunnel", + "tunnel" + ] + ], + "layout": { + "visibility": "visible" + }, + "paint": { + "fill-color": "hsl(210, 67%, 85%)" + } + }, + { + "id": "landcover-park-green", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landcover", + "filter": [ + "any", + [ + "==", + "class", + "park" + ], + [ + "==", + "class", + "grass" + ] + ], + "paint": { + "fill-color": "#d8e8c8", + "fill-opacity": 0.8 + } + }, + { + "id": "landuse-hospital", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "hospital" + ], + "paint": { + "fill-color": "#fdd" + } + }, + { + "id": "landuse-school", + "type": "fill", + "metadata": { + "mapbox:group": "1444849388993.3071" + }, + "source": "openmaptiles", + "source-layer": "landuse", + "filter": [ + "==", + "class", + "school" + ], + "paint": { + "fill-color": "#f0e8f8" + } + }, + { + "id": "highway", + "type": "line", + "minzoom": 10, + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "!in", + "brunnel", + "bridge", + "tunnel", + "ramp" + ], + [ + "in", + "class", + "primary", + "secondary" + ] + ], + "paint": { + "line-color": "#fea", + "line-opacity": 0.5, + "line-width": { + "base": 1.2, + "stops": [ + [ + 8.5, + 1.2 + ], + [ + 9, + 0.5 + ], + [ + 20, + 18 + ] + ] + } + } + }, + { + "id": "railway", + "type": "line", + "minzoom": 10, + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "==", + "class", + "rail" + ] + ], + "paint": { + "line-color": "#0000aa", + "line-opacity": 0.6, + "line-width": { + "base": 1.4, + "stops": [ + [ + 10, + 0.5 + ], + [ + 11, + 1 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "road-major", + "type": "line", + "minzoom": 10, + "metadata": { + "mapbox:group": "1444849345966.4436" + }, + "source": "openmaptiles", + "source-layer": "transportation", + "filter": [ + "all", + [ + "==", + "$type", + "LineString" + ], + [ + "in", + "class", + "motorway", + "trunk", + "primary" + ] + ], + "paint": { + "line-color": "#888", + "line-width": { + "base": 1.4, + "stops": [ + [ + 10, + 0.75 + ], + [ + 11, + 1.5 + ], + [ + 20, + 2 + ] + ] + } + } + }, + { + "id": "building", + "type": "fill", + "metadata": { + "mapbox:group": "1444849364238.8171" + }, + "source": "openmaptiles", + "source-layer": "building", + "paint": { + "fill-antialias": true, + "fill-color": "#f2eae2" + } + }, + { + "id": "boundary-land-level-4", + "type": "line", + "source": "openmaptiles", + "source-layer": "boundary", + "minzoom": 5, + "filter": [ + "all", + [ + ">=", + "admin_level", + 3 + ], + [ + "<=", + "admin_level", + 8 + ], + [ + "!=", + "maritime", + 1 + ] + ], + "layout": { + "line-join": "round", + "visibility": "visible" + }, + "paint": { + "line-color": "#9e9cab", + "line-dasharray": [ + 3, + 1, + 1, + 1 + ], + "line-width": { + "base": 1.4, + "stops": [ + [ + 4, + 0.4 + ], + [ + 5, + 1 + ], + [ + 12, + 3 + ] + ] + } + } + }, + { + "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", + "visibility": "visible" + }, + "paint": { + "line-color": "#000000", + "line-width": { + "base": 1, + "stops": [ + [ + 0, + 0.6 + ], + [ + 4, + 1.4 + ], + [ + 5, + 2 + ], + [ + 12, + 8 + ] + ] + } + } + }, + { + "id": "place-settlement", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "in", + "class", + "city", + "town", + "village" + ] + ], + "layout": { + "text-field": "{name:latin}\n{name:nonlatin}", + "text-font": [ + "Open Sans Regular" + ], + "text-max-width": 8, + "text-size": { + "base": 1.2, + "stops": [ + [ + 7, + 14 + ], + [ + 11, + 24 + ] + ] + }, + "visibility": "visible" + }, + "paint": { + "text-color": "#333", + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 1.2 + } + }, + { + "id": "place-country-2", + "type": "symbol", + "metadata": { + "mapbox:group": "1444849242106.713" + }, + "source": "openmaptiles", + "source-layer": "place", + "filter": [ + "all", + [ + "==", + "class", + "country" + ] + ], + "layout": { + "text-field": "{name:latin}", + "text-font": [ + "Open Sans Regular" + ], + "text-max-width": 6.25, + "text-size": { + "stops": [ + [ + 1, + 11 + ], + [ + 4, + 17 + ] + ] + }, + "text-transform": "uppercase", + "visibility": "visible" + }, + "paint": { + "text-color": "#333333", + "text-halo-blur": 1, + "text-halo-color": "rgba(255,255,255,0.8)", + "text-halo-width": 2 + } + } + ] +} \ No newline at end of file diff --git a/vite.svg b/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file