From 437349cd2bce26ce110256c17904dca996bcfdeb Mon Sep 17 00:00:00 2001 From: isUnknown Date: Wed, 28 Jan 2026 16:16:19 +0100 Subject: [PATCH] feat: add Phase 2 features to map-editor plugin (rich marker content) Implement marker editing modal with comprehensive content management: - MarkerEditor.vue modal with custom overlay (replaces k-dialog) - Edit marker on double-click or via edit button in list - Required fields: title (validated), optional description - Editable position (lat/lon) and custom icon support - Content blocks system: add/remove/reorder text and image blocks - French translations for all UI elements - Click marker in list to center map on it with smooth animation - Fix marker anchor to bottom (pin tip) for accurate positioning - Auto-save with isDirty flag to detect any form changes Modal features: - Title field (required) - Description textarea (optional) - Position inputs (latitude/longitude) - Icon selector (default or custom via UUID/filename) - Content builder with text and image blocks - Block reordering (up/down) and deletion - Validation: save button enabled only when title filled and form modified Co-Authored-By: Claude Sonnet 4.5 --- public/site/plugins/map-editor/index.css | 2 +- public/site/plugins/map-editor/index.js | 170 ++++---- .../src/components/field/MapEditor.vue | 67 +++- .../src/components/map/MapPreview.vue | 23 +- .../src/components/map/MarkerEditor.vue | 364 ++++++++++++++++++ 5 files changed, 532 insertions(+), 94 deletions(-) create mode 100644 public/site/plugins/map-editor/src/components/map/MarkerEditor.vue diff --git a/public/site/plugins/map-editor/index.css b/public/site/plugins/map-editor/index.css index 74da46a..d1fc34c 100644 --- a/public/site/plugins/map-editor/index.css +++ b/public/site/plugins/map-editor/index.css @@ -1 +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),(max-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}.map-preview{position:relative;width:100%;height:100%}.map-container{width:100%;height:100%}.map-loading{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#ffffffe6;z-index:1000}.spinner{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #3498db;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.custom-marker{width:40px;height:40px;cursor:grab;display:flex;align-items:center;justify-content:center;position:relative}.custom-marker:active{cursor:grabbing}.custom-marker:before{content:"";position:absolute;width:40px;height:40px;background:#e74c3c;border:3px solid white;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 8px #0000004d;transition:all .2s}.custom-marker:hover:before{background:#c0392b;transform:rotate(-45deg) scale(1.1)}.custom-marker.selected:before{background:#3498db;border-color:#2980b9;box-shadow:0 4px 12px #3498db99}.marker-number{position:relative;z-index:1;color:#fff;font-weight:700;font-size:14px;line-height:1;transform:translateY(-4px);text-shadow:0 1px 2px rgba(0,0,0,.3);pointer-events:none}.maplibregl-ctrl-group{box-shadow:0 2px 4px #0000001a}.maplibregl-ctrl-group button{width:30px;height:30px}.maplibregl-ctrl-attrib{font-size:11px;background:#fffc}.maplibregl-canvas-container,.maplibregl-canvas-container.maplibregl-interactive{cursor:crosshair}.k-map-editor-field{--marker-list-width: 250px}.map-editor-container{border:1px solid var(--color-border);border-radius:var(--rounded);overflow:hidden;background:var(--color-white)}.map-content{display:flex;height:600px;background:var(--color-white)}.marker-list-sidebar{width:var(--marker-list-width);flex-shrink:0;border-right:1px solid var(--color-border);display:flex;flex-direction:column;background:var(--color-background)}.marker-list-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem 1rem;border-bottom:1px solid var(--color-border);background:var(--color-white)}.marker-list-header h3{margin:0;font-size:.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-light);flex:1}.marker-list-header .k-button-icon{width:2rem;height:2rem;min-width:2rem;padding:0;display:flex;align-items:center;justify-content:center;color:var(--color-black)}.marker-list-header .k-button-icon .k-icon{color:var(--color-black)}.marker-list-header .k-button-icon:hover{background:var(--color-background)}.marker-list-header .k-button-icon:disabled{opacity:.4;cursor:not-allowed}.marker-list-items{flex:1;overflow-y:auto;padding:.5rem}.marker-item{display:flex;align-items:center;justify-content:space-between;padding:.75rem;margin-bottom:.5rem;background:var(--color-white);border:1px solid var(--color-border);border-radius:var(--rounded-sm);cursor:pointer;transition:all .2s;color:#000}.marker-item:hover{background:var(--color-background);border-color:var(--color-focus);color:#fff}.marker-item.active{background:var(--color-focus-outline);border-color:var(--color-focus)}.marker-item-content{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.marker-number{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:var(--color-gray-400);color:var(--color-white);border-radius:50%;font-size:.75rem;font-weight:600;flex-shrink:0}.marker-item.active .marker-number{background:var(--color-focus)}.marker-title{font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.marker-item-actions{display:flex;gap:.25rem;flex-shrink:0}.k-button-small{padding:.25rem .5rem;min-height:auto}.marker-list-empty{padding:2rem 1rem;text-align:center;color:var(--color-text-light);font-size:.875rem}.map-preview-container{flex:1;position:relative;background:#f0f0f0;min-width:0} +.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),(max-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}.map-preview{position:relative;width:100%;height:100%}.map-container{width:100%;height:100%}.map-loading{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;background:#ffffffe6;z-index:1000}.spinner{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #3498db;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.custom-marker{width:40px;height:40px;cursor:grab;display:flex;align-items:center;justify-content:center;position:relative}.custom-marker:active{cursor:grabbing}.custom-marker:before{content:"";position:absolute;width:40px;height:40px;background:#e74c3c;border:3px solid white;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 8px #0000004d;transition:all .2s}.custom-marker:hover:before{background:#c0392b;transform:rotate(-45deg) scale(1.1)}.custom-marker.selected:before{background:#3498db;border-color:#2980b9;box-shadow:0 4px 12px #3498db99}.marker-number{position:relative;z-index:1;color:#fff;font-weight:700;font-size:14px;line-height:1;transform:translateY(-4px);text-shadow:0 1px 2px rgba(0,0,0,.3);pointer-events:none}.maplibregl-ctrl-group{box-shadow:0 2px 4px #0000001a}.maplibregl-ctrl-group button{width:30px;height:30px}.maplibregl-ctrl-attrib{font-size:11px;background:#fffc}.maplibregl-canvas-container,.maplibregl-canvas-container.maplibregl-interactive{cursor:crosshair}.marker-editor-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:10000;padding:2rem}.marker-editor-modal{background:var(--color-white);border-radius:var(--rounded);box-shadow:0 8px 32px #0000004d;width:100%;max-width:600px;max-height:90vh;display:flex;flex-direction:column}.marker-editor-modal .editor-header,.marker-editor-modal textarea,.marker-editor-modal label{color:#000}.editor-header{display:flex;align-items:center;justify-content:space-between;width:100%;padding:1rem 1.5rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.editor-header h2{margin:0;font-size:1.25rem;font-weight:600}.marker-editor-content{padding:1.5rem;overflow-y:auto;flex:1;min-height:0}.field{margin-bottom:1.5rem}.field-label{display:block;margin-bottom:.5rem;font-size:.875rem;font-weight:600}.required{color:var(--color-negative)}.k-input,.k-textarea{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:var(--rounded-sm);font-size:.875rem;font-family:inherit}.k-textarea{resize:vertical;min-height:100px}.field-group{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1.5rem}.icon-selector{display:flex;gap:1rem;margin-bottom:1rem}.radio-option{display:flex;align-items:center;gap:.5rem;cursor:pointer}.radio-option input[type=radio]{cursor:pointer}.custom-icon-upload{display:flex;flex-direction:column;gap:.5rem}.field-help{display:block;margin-top:.25rem;font-size:.75rem;color:var(--color-text-light)}.dialog-footer{display:flex;justify-content:flex-end;gap:.5rem;padding:1rem 1.5rem;border-top:1px solid var(--color-border);flex-shrink:0;background:var(--color-background)}.k-map-editor-field{--marker-list-width: 250px}.map-editor-container{border:1px solid var(--color-border);border-radius:var(--rounded);overflow:hidden;background:var(--color-white)}.map-content{display:flex;height:600px;background:var(--color-white)}.marker-list-sidebar{width:var(--marker-list-width);flex-shrink:0;border-right:1px solid var(--color-border);display:flex;flex-direction:column;background:var(--color-background)}.marker-list-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem 1rem;border-bottom:1px solid var(--color-border);background:var(--color-white)}.marker-list-header h3{margin:0;font-size:.875rem;font-weight:600;text-transform:uppercase;color:var(--color-text-light);flex:1}.marker-list-header .k-button-icon{width:2rem;height:2rem;min-width:2rem;padding:0;display:flex;align-items:center;justify-content:center;color:var(--color-black)}.marker-list-header .k-button-icon .k-icon{color:var(--color-black)}.marker-list-header .k-button-icon:hover{background:var(--color-background)}.marker-list-header .k-button-icon:disabled{opacity:.4;cursor:not-allowed}.marker-list-items{flex:1;overflow-y:auto;padding:.5rem}.marker-item{display:flex;align-items:center;justify-content:space-between;padding:.75rem;margin-bottom:.5rem;background:var(--color-white);border:1px solid var(--color-border);border-radius:var(--rounded-sm);cursor:pointer;transition:all .2s;color:#000}.marker-item:hover{background:var(--color-background);border-color:var(--color-focus);color:#fff}.marker-item.active{background:var(--color-focus-outline);border-color:var(--color-focus)}.marker-item-content{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.marker-number{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:var(--color-gray-400);color:var(--color-white);border-radius:50%;font-size:.75rem;font-weight:600;flex-shrink:0}.marker-item.active .marker-number{background:var(--color-focus)}.marker-title{font-size:.875rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.marker-item-actions{display:flex;gap:.25rem;flex-shrink:0}.k-button-small{padding:.25rem .5rem;min-height:auto}.marker-list-empty{padding:2rem 1rem;text-align:center;color:var(--color-text-light);font-size:.875rem}.map-preview-container{flex:1;position:relative;background:#f0f0f0;min-width:0} diff --git a/public/site/plugins/map-editor/index.js b/public/site/plugins/map-editor/index.js index 48b10a7..7f40817 100644 --- a/public/site/plugins/map-editor/index.js +++ b/public/site/plugins/map-editor/index.js @@ -1,5 +1,5 @@ -(function(){"use strict";function sd(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var Bo={exports:{}},od=Bo.exports,yu;function ld(){return yu||(yu=1,(function(d,A){(function(D,V){d.exports=V()})(od,(function(){var D,V,F;function te(l,ue){if(!D)D=ue;else if(!V)V=ue;else{var X="var sharedChunk = {}; ("+D+")(sharedChunk); ("+V+")(sharedChunk);",Le={};D(Le),F=ue(Le),typeof window<"u"&&(F.workerUrl=window.URL.createObjectURL(new Blob([X],{type:"text/javascript"})))}}te(["exports"],(function(l){function ue(i,e,r,a){return new(r||(r=Promise))((function(o,p){function f(v){try{y(a.next(v))}catch(w){p(w)}}function m(v){try{y(a.throw(v))}catch(w){p(w)}}function y(v){var w;v.done?o(v.value):(w=v.value,w instanceof r?w:new r((function(I){I(w)}))).then(f,m)}y((a=a.apply(i,e||[])).next())}))}function X(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Le=we;function we(i,e){this.x=i,this.y=e}we.prototype={clone:function(){return new we(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},we.convert=function(i){return i instanceof we?i:Array.isArray(i)?new we(i[0],i[1]):i};var he=X(Le),Fe=Ke;function Ke(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-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=i,this.p1y=e,this.p2x=r,this.p2y=a}Ke.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)o?f=r:m=r,r=.5*(m-f)+f;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var ot=X(Fe);let Qe,lt;function $e(){return Qe==null&&(Qe=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Qe}function qt(){if(lt==null&&(lt=!1,$e())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<25;a++){const o=4*a;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<100;a++)if(a%4!=3&&r[a]!==a){lt=!0;break}}}return lt||!1}function Er(i,e,r,a){const o=new ot(i,e,r,a);return function(p){return o.solve(p)}}const Ji=Er(.25,.1,.25,1);function gr(i,e,r){return Math.min(r,Math.max(e,i))}function sa(i,e,r){const a=r-e,o=((i-e)%a+a)%a+e;return o===e?r:o}function oi(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let Ba=1;function zt(i,e,r){const a={};for(const o in i)a[o]=e.call(r||this,i[o],o,i);return a}function Dn(i,e,r){const a={};for(const o in i)e.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function ur(i){return Array.isArray(i)?i.map(ur):typeof i=="object"&&i?zt(i,ur):i}const Zr={};function vi(i){Zr[i]||(typeof console<"u"&&console.warn(i),Zr[i]=!0)}function Vi(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Mr(i){let e=0;for(let r,a,o=0,p=i.length,f=p-1;o"u")throw new Error("VideoFrame not supported");const p=new VideoFrame(i,{timestamp:0});try{const f=p==null?void 0:p.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);const m=f.startsWith("BGR"),y=new Uint8ClampedArray(a*o*4);if(yield p.copyTo(y,(function(v,w,I,k,P){const z=4*Math.max(-w,0),B=(Math.max(0,I)-I)*k*4+z,q=4*k,H=Math.max(0,w),re=Math.max(0,I);return{rect:{x:H,y:re,width:Math.min(v.width,w+k)-H,height:Math.min(v.height,I+P)-re},layout:[{offset:B,stride:q}]}})(i,e,r,a,o)),m)for(let v=0;vcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(Ei||(Ei=document.createElement("a")),Ei.href=i,Ei.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(un==null&&(un=matchMedia("(prefers-reduced-motion: reduce)")),un.matches)}},Fn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Gr extends Error{constructor(e,r,a,o){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=o}}const hr=Qi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,er=i=>Fn.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function ca(i,e){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:hr(),signal:r.signal});let o=!1,p=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),p||fetch(a).then((f=>f.ok?(m=>{(i.type==="arrayBuffer"||i.type==="image"?m.arrayBuffer():i.type==="json"?m.json():m.text()).then((y=>{p||(o=!0,e(null,y,m.headers.get("Cache-Control"),m.headers.get("Expires")))})).catch((y=>{p||e(new Error(y.message))}))})(f):f.blob().then((m=>e(new Gr(f.status,f.statusText,i.url,m)))))).catch((f=>{f.code!==20&&e(new Error(f.message))})),{cancel:()=>{p=!0,o||r.abort()}}}const Hr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Qi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Qi())return(er(i.url)||ca)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(hr())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ca(i,e);if(Qi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return(function(a,o){const p=new XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(p.responseType="arraybuffer");for(const f in a.headers)p.setRequestHeader(f,a.headers[f]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{o(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let f=p.response;if(a.type==="json")try{f=JSON.parse(p.response)}catch(m){return o(m)}o(null,f,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else{const f=new Blob([p.response],{type:p.getResponseHeader("Content-Type")});o(new Gr(p.status,p.statusText,a.url,f))}},p.send(a.body),{cancel:()=>p.abort()}})(i,e)},ua=function(i,e){return Hr(oi(i,{type:"arrayBuffer"}),e)};function Pr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function Rn(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function hn(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class Wr{constructor(e,r={}){oi(this,r),this.type=e}}class Xr extends Wr{constructor(e,r={}){super("error",oi({error:e},r))}}class pn{on(e,r){return this._listeners=this._listeners||{},Rn(e,r,this._listeners),this}off(e,r){return hn(e,r,this._listeners),hn(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Rn(e,r,this._oneTimeListeners),this):new Promise((a=>this.once(e,a)))}fire(e,r){typeof e=="string"&&(e=new Wr(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const m of o)m.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const m of p)hn(a,m,this._oneTimeListeners),m.call(this,e);const f=this._eventedParent;f&&(oi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(e))}else e instanceof Xr&&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,r){return this._eventedParent=e,this._eventedParentData=r,this}}var pe={$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 Mi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tr(i,e){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return Mi.forEach((a=>{a in e&&(r[a]=e[a])})),r}function St(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const ne=[Dr,Ae,it,Ye,bi,U,vr,j(et),C,E,L];function J(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!J(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of ne)if(!J(r,e))return null}}return`Expected ${Z(i)} but found ${Z(e)} instead.`}function W(i,e){return e.some((r=>r.kind===i.kind))}function ie(i,e){return e.some((r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i))}function de(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const fe=.96422,_e=.82521,je=4/29,Xe=6/29,Re=3*Xe*Xe,Ze=Xe*Xe*Xe,Je=Math.PI/180,yt=180/Math.PI;function bt(i){return(i%=360)<0&&(i+=360),i}function dt([i,e,r,a]){let o,p;const f=di((.2225045*(i=pt(i))+.7168786*(e=pt(e))+.0606169*(r=pt(r)))/1);i===e&&e===r?o=p=f:(o=di((.4360747*i+.3850649*e+.1430804*r)/fe),p=di((.0139322*i+.0971045*e+.7141733*r)/_e));const m=116*f-16;return[m<0?0:m,500*(o-f),200*(f-p),a]}function pt(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function di(i){return i>Ze?Math.pow(i,1/3):i/Re+je}function Tt([i,e,r,a]){let o=(i+16)/116,p=isNaN(e)?o:o+e/500,f=isNaN(r)?o:o-r/200;return o=1*li(o),p=fe*li(p),f=_e*li(f),[Wt(3.1338561*p-1.6168667*o-.4906146*f),Wt(-.9787684*p+1.9161415*o+.033454*f),Wt(.0719453*p-.2289914*o+1.4052427*f),a]}function Wt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function li(i){return i>Xe?i*i*i:Re*(i-je)}function ir(i){return parseInt(i.padEnd(2,i),16)/255}function qo(i,e){return Nn(e?i/100:i,0,1)}function Nn(i,e,r){return Math.min(Math.max(e,i),r)}function Vn(i){return!i.some(Number.isNaN)}const hc={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 xt{constructor(e,r,a,o=1,p=!0){this.r=e,this.g=r,this.b=a,this.a=o,p||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,a,o]))}static parse(e){if(e instanceof xt)return e;if(typeof e!="string")return;const r=(function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=hc[a];if(o){const[f,m,y]=o;return[f/255,m/255,y/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const f=a.length<6?1:2;let m=1;return[ir(a.slice(m,m+=f)),ir(a.slice(m,m+=f)),ir(a.slice(m,m+=f)),ir(a.slice(m,m+f)||"ff")]}if(a.startsWith("rgb")){const f=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){const[m,y,v,w,I,k,P,z,B,q,H,re]=f,K=[w||" ",P||" ",q].join("");if(K===" "||K===" /"||K===",,"||K===",,,"){const ae=[v,k,B].join(""),oe=ae==="%%%"?100:ae===""?255:0;if(oe){const ge=[Nn(+y/oe,0,1),Nn(+I/oe,0,1),Nn(+z/oe,0,1),H?qo(+H,re):1];if(Vn(ge))return ge}}return}}const p=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,m,y,v,w,I,k,P,z]=p,B=[y||" ",w||" ",k].join("");if(B===" "||B===" /"||B===",,"||B===",,,"){const q=[+m,Nn(+v,0,100),Nn(+I,0,100),P?qo(+P,z):1];if(Vn(q))return(function([H,re,K,ae]){function oe(ge){const Pe=(ge+H/30)%12,Oe=re*Math.min(K,1-K);return K-Oe*Math.max(-1,Math.min(Pe-3,9-Pe,1))}return H=bt(H),re/=100,K/=100,[oe(0),oe(8),oe(4),ae]})(q)}}})(e);return r?new xt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:o}=this,p=o||1/0;return this.overwriteGetter("rgb",[e/p,r/p,a/p,o])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[r,a,o,p]=dt(e),f=Math.sqrt(a*a+o*o);return[Math.round(1e4*f)?bt(Math.atan2(o,a)*yt):NaN,f,r,p]})(this.rgb))}get lab(){return this.overwriteGetter("lab",dt(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,o]=this.rgb;return`rgba(${[e,r,a].map((p=>Math.round(255*p))).join(",")},${o})`}}xt.black=new xt(0,0,0,1),xt.white=new xt(1,1,1,1),xt.transparent=new xt(0,0,0,0),xt.red=new xt(1,0,0,1);class Ms{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Va{constructor(e,r,a,o,p){this.text=e,this.image=r,this.scale=a,this.fontStack=o,this.textColor=p}}class fi{constructor(e){this.sections=e}static fromString(e){return new fi([new Va(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 fi?e:fi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class Ui{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ui)return e;if(typeof e=="number")return new Ui([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="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 Ui(e)}}toString(){return JSON.stringify(this.values)}}const pc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class rr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof rr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Un(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof xt||i instanceof Ms||i instanceof fi||i instanceof Ui||i instanceof rr||i instanceof ci)return!0;if(Array.isArray(i)){for(const e of i)if(!Un(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!Un(i[e]))return!1;return!0}return!1}function Dt(i){if(i===null)return Dr;if(typeof i=="string")return it;if(typeof i=="boolean")return Ye;if(typeof i=="number")return Ae;if(i instanceof xt)return bi;if(i instanceof Ms)return Lr;if(i instanceof fi)return U;if(i instanceof Ui)return C;if(i instanceof rr)return L;if(i instanceof ci)return E;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const o=Dt(a);if(r){if(r===o)continue;r=et;break}r=o}return j(r||et,e)}return vr}function mt(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof xt||i instanceof fi||i instanceof Ui||i instanceof rr||i instanceof ci?i.toString():JSON.stringify(i)}class mn{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Un(e[1]))return r.error("invalid value");const a=e[1];let o=Dt(a);const p=r.expectedType;return o.kind!=="array"||o.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(o=p),new mn(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ot{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const $a={string:it,number:Ae,boolean:Ye,object:vr};class nr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,o=1;const p=e[0];if(p==="array"){let m,y;if(e.length>2){const v=e[1];if(typeof v!="string"||!(v in $a)||v==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=$a[v],o++}else m=et;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);y=e[2],o++}a=j(m,y)}else{if(!$a[p])throw new Error(`Types doesn't contain name = ${p}`);a=$a[p]}const f=[];for(;oe.outputDefined()))}}const Ps={"to-boolean":Ye,"to-color":bi,"to-number":Ae,"to-string":it};class Yr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!Ps[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 r.error("Expected one argument.");const o=Ps[a],p=[];for(let f=1;f4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Ua(r[0],r[1],r[2],r[3]),!a))return new xt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Ot(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const o=Ui.parse(r);if(o)return o}throw new Ot(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(e);const o=rr.parse(r);if(o)return o}throw new Ot(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const o=Number(r);if(!isNaN(o))return o}throw new Ot(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return fi.fromString(mt(this.args[0].evaluate(e)));case"resolvedImage":return ci.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 Zo=["Unknown","Point","LineString","Polygon"];class zs{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"?Zo[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 r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=xt.parse(e)),r}}class ja{constructor(e,r,a=[],o,p=new fn,f=[]){this.registry=e,this.path=a,this.key=a.map((m=>`[${m}]`)).join(""),this.scope=p,this.errors=f,this.expectedType=o,this._isConstant=r}parse(e,r,a,o,p={}){return r?this.concat(r,a,o)._parse(e,p):this._parse(e,p)}_parse(e,r){function a(o,p,f){return f==="assert"?new nr(p,[o]):f==="coerce"?new Yr(p,[o]):o}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 o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[o];if(p){let f=p.parse(e,this);if(!f)return null;if(this.expectedType){const m=this.expectedType,y=f.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||y.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||y.kind!=="value"&&y.kind!=="string")if(m.kind!=="padding"||y.kind!=="value"&&y.kind!=="number"&&y.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||y.kind!=="value"&&y.kind!=="array"){if(this.checkSubtype(m,y))return null}else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"assert")}if(!(f instanceof mn)&&f.type.kind!=="resolvedImage"&&this._isConstant(f)){const m=new zs;try{f=new mn(f.type,f.evaluate(m))}catch(y){return this.error(y.message),null}}return f}return this.error(`Unknown expression "${o}". 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,r,a){const o=typeof e=="number"?this.path.concat(e):this.path,p=a?this.scope.concat(a):this.scope;return new ja(this.registry,this._isConstant,o,r||null,p,this.errors)}error(e,...r){const a=`${this.key}${r.map((o=>`[${o}]`)).join("")}`;this.errors.push(new Bt(a,e))}checkSubtype(e,r){const a=J(e,r);return a&&this.error(a),a}}class qa{constructor(e,r,a){this.type=Lr,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ye);if(!o)return null;const p=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ye);if(!p)return null;let f=null;return a.locale&&(f=r.parse(a.locale,1,it),!f)?null:new qa(o,p,f)}evaluate(e){return new Ms(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 Jr=8192;function Ds(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function ha(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Go(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*Jr),Math.round(a*o*Jr)]}function dc(i,e,r){const a=i[0]-e[0],o=i[1]-e[1],p=i[0]-r[0],f=i[1]-r[1];return a*f-p*o==0&&a*p<=0&&o*f<=0}function Ls(i,e){let r=!1;for(let f=0,m=e.length;f(a=i)[1]!=(p=y[v+1])[1]>a[1]&&a[0]<(p[0]-o[0])*(a[1]-o[1])/(p[1]-o[1])+o[0]&&(r=!r)}}var a,o,p;return r}function Fs(i,e){for(let r=0;r0&&m<0||f<0&&m>0}function fc(i,e,r){for(const v of r)for(let w=0;wr[2]){const o=.5*a;let p=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;p===0&&(p=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=p}Ds(e,i)}function Rs(i,e,r,a){const o=Math.pow(2,a.z)*Jr,p=[a.x*Jr,a.y*Jr],f=[];for(const m of i)for(const y of m){const v=[y.x+p[0],y.y+p[1]];Yo(v,e,r,o),f.push(v)}return f}function Bs(i,e,r,a){const o=Math.pow(2,a.z)*Jr,p=[a.x*Jr,a.y*Jr],f=[];for(const y of i){const v=[];for(const w of y){const I=[w.x+p[0],w.y+p[1]];Ds(e,I),v.push(I)}f.push(v)}if(e[2]-e[0]<=o/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const y of f)for(const v of y)Yo(v,e,r,o)}var m;return f}class gn{constructor(e,r){this.type=Ye,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Un(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let o=0;o!Array.isArray(v)||v.length===e.length-1));let y=null;for(const[v,w]of m){y=new ja(r.registry,Ha,r.path,null,r.scope);const I=[];let k=!1;for(let P=1;P{return k=I,Array.isArray(k)?`(${k.map(Z).join(", ")})`:`(${Z(k.type)}...)`;var k})).join(" | "),w=[];for(let I=1;I{r=e?r&&Ha(a):r&&a instanceof mn})),!!r&&Wa(i)&&Xa(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Wa(i){if(i instanceof ar&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof gn)return!1;let e=!0;return i.eachChild((r=>{e&&!Wa(r)&&(e=!1)})),e}function pa(i){if(i instanceof ar&&i.name==="feature-state")return!1;let e=!0;return i.eachChild((r=>{e&&!pa(r)&&(e=!1)})),e}function Xa(i,e){if(i instanceof ar&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild((a=>{r&&!Xa(a,e)&&(r=!1)})),r}function $n(i,e){const r=i.length-1;let a,o,p=0,f=r,m=0;for(;p<=f;)if(m=Math.floor((p+f)/2),a=i[m],o=i[m+1],a<=e){if(m===r||ee))throw new Ot("Input is not a number.");f=m-1}return 0}class Qr{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[o,p]of a)this.labels.push(o),this.outputs.push(p)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,Ae);if(!a)return null;const o=[];let p=null;r.expectedType&&r.expectedType.kind!=="value"&&(p=r.expectedType);for(let f=1;f=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',v);const I=r.parse(y,w,p);if(!I)return null;p=p||I.type,o.push([m,I])}return new Qr(p,a,o)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const p=r.length;return o>=r[p-1]?a[p-1].evaluate(e):a[$n(r,o)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function ut(i,e,r){return i+r*(e-i)}function Ka(i,e,r){return i.map(((a,o)=>ut(a,e[o],r)))}const $i={number:ut,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{const[o,p,f,m]=Ka(i.rgb,e.rgb,r);return new xt(o,p,f,m,!1)}case"hcl":{const[o,p,f,m]=i.hcl,[y,v,w,I]=e.hcl;let k,P;if(isNaN(o)||isNaN(y))isNaN(o)?isNaN(y)?k=NaN:(k=y,f!==1&&f!==0||(P=v)):(k=o,w!==1&&w!==0||(P=p));else{let re=y-o;y>o&&re>180?re-=360:y180&&(re+=360),k=o+r*re}const[z,B,q,H]=(function([re,K,ae,oe]){return re=isNaN(re)?0:re*Je,Tt([ae,Math.cos(re)*K,Math.sin(re)*K,oe])})([k,P??ut(p,v,r),ut(f,w,r),ut(m,I,r)]);return new xt(z,B,q,H,!1)}case"lab":{const[o,p,f,m]=Tt(Ka(i.lab,e.lab,r));return new xt(o,p,f,m,!1)}}},array:Ka,padding:function(i,e,r){return new Ui(Ka(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const a=i.values,o=e.values;if(a.length!==o.length)throw new Ot(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const p=[];for(let f=0;ftypeof w!="number"||w<0||w>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:v}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(p=r.parse(p,2,Ae),!p)return null;const m=[];let y=null;a==="interpolate-hcl"||a==="interpolate-lab"?y=bi:r.expectedType&&r.expectedType.kind!=="value"&&(y=r.expectedType);for(let v=0;v=w)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);const z=r.parse(I,P,y);if(!z)return null;y=y||z.type,m.push([w,z])}return de(y,Ae)||de(y,bi)||de(y,C)||de(y,L)||de(y,j(Ae))?new ji(y,a,o,p,m):r.error(`Type ${Z(y)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const p=r.length;if(o>=r[p-1])return a[p-1].evaluate(e);const f=$n(r,o),m=ji.interpolationFactor(this.interpolation,o,r[f],r[f+1]),y=a[f].evaluate(e),v=a[f+1].evaluate(e);switch(this.operator){case"interpolate":return $i[this.type.kind](y,v,m);case"interpolate-hcl":return $i.color(y,v,m,"hcl");case"interpolate-lab":return $i.color(y,v,m,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Os(i,e,r,a){const o=a-r,p=i-r;return o===0?0:e===1?p/o:(Math.pow(e,p)-1)/(Math.pow(e,o)-1)}class Ya{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let a=null;const o=r.expectedType;o&&o.kind!=="value"&&(a=o);const p=[];for(const m of e.slice(1)){const y=r.parse(m,1+p.length,a,void 0,{typeAnnotation:"omit"});if(!y)return null;a=a||y.type,p.push(y)}if(!a)throw new Error("No output type");const f=o&&p.some((m=>J(o,m.type)));return new Ya(f?et:a,p)}evaluate(e){let r,a=null,o=0;for(const p of this.args)if(o++,a=p.evaluate(e),a&&a instanceof ci&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}class Ja{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Ot(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Ot(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Vs{constructor(e,r){this.type=Ye,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,et),o=r.parse(e[2],2,et);return a&&o?W(a.type,[Ye,it,Ae,Dr,et])?new Vs(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Z(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!ie(r,["boolean","string","number","null"]))throw new Ot(`Expected first argument to be of type boolean, string, number or null, but found ${Z(Dt(r))} instead.`);if(!ie(a,["string","array"]))throw new Ot(`Expected second argument to be of type array or string, but found ${Z(Dt(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Qa{constructor(e,r,a){this.type=Ae,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,et),o=r.parse(e[2],2,et);if(!a||!o)return null;if(!W(a.type,[Ye,it,Ae,Dr,et]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Z(a.type)} instead`);if(e.length===4){const p=r.parse(e[3],3,Ae);return p?new Qa(a,o,p):null}return new Qa(a,o)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!ie(r,["boolean","string","number","null"]))throw new Ot(`Expected first argument to be of type boolean, string, number or null, but found ${Z(Dt(r))} instead.`);if(!ie(a,["string","array"]))throw new Ot(`Expected second argument to be of type array or string, but found ${Z(Dt(a))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(e);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Us{constructor(e,r,a,o,p,f){this.inputType=e,this.type=r,this.input=a,this.cases=o,this.outputs=p,this.otherwise=f}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const p={},f=[];for(let v=2;vNumber.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof z=="number"&&Math.floor(z)!==z)return k.error("Numeric branch labels must be integer values.");if(a){if(k.checkSubtype(a,Dt(z)))return null}else a=Dt(z);if(p[String(z)]!==void 0)return k.error("Branch labels must be unique.");p[String(z)]=f.length}const P=r.parse(I,v,o);if(!P)return null;o=o||P.type,f.push(P)}const m=r.parse(e[1],1,et);if(!m)return null;const y=r.parse(e[e.length-1],e.length-1,o);return y?m.type.kind!=="value"&&r.concat(1).checkSubtype(a,m.type)?null:new Us(a,o,m,p,f,y):null}evaluate(e){const r=this.input.evaluate(e);return(Dt(r)===this.inputType&&this.outputs[this.cases[r]]||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 $s{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const o=[];for(let f=1;fr.outputDefined()))&&this.otherwise.outputDefined()}}class es{constructor(e,r,a,o){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,et),o=r.parse(e[2],2,Ae);if(!a||!o)return null;if(!W(a.type,[j(et),it,et]))return r.error(`Expected first argument to be of type array or string, but found ${Z(a.type)} instead`);if(e.length===4){const p=r.parse(e[3],3,Ae);return p?new es(a.type,a,o,p):null}return new es(a.type,a,o)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!ie(r,["string","array"]))throw new Ot(`Expected first argument to be of type array or string, but found ${Z(Dt(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(e);return r.slice(a,o)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Jo(i,e){return i==="=="||i==="!="?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 Qo(i,e,r,a){return a.compare(e,r)===0}function jn(i,e,r){const a=i!=="=="&&i!=="!=";return class ad{constructor(p,f,m){this.type=Ye,this.lhs=p,this.rhs=f,this.collator=m,this.hasUntypedArgument=p.type.kind==="value"||f.type.kind==="value"}static parse(p,f){if(p.length!==3&&p.length!==4)return f.error("Expected two or three arguments.");const m=p[0];let y=f.parse(p[1],1,et);if(!y)return null;if(!Jo(m,y.type))return f.concat(1).error(`"${m}" comparisons are not supported for type '${Z(y.type)}'.`);let v=f.parse(p[2],2,et);if(!v)return null;if(!Jo(m,v.type))return f.concat(2).error(`"${m}" comparisons are not supported for type '${Z(v.type)}'.`);if(y.type.kind!==v.type.kind&&y.type.kind!=="value"&&v.type.kind!=="value")return f.error(`Cannot compare types '${Z(y.type)}' and '${Z(v.type)}'.`);a&&(y.type.kind==="value"&&v.type.kind!=="value"?y=new nr(v.type,[y]):y.type.kind!=="value"&&v.type.kind==="value"&&(v=new nr(y.type,[v])));let w=null;if(p.length===4){if(y.type.kind!=="string"&&v.type.kind!=="string"&&y.type.kind!=="value"&&v.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(w=f.parse(p[3],3,Lr),!w)return null}return new ad(y,v,w)}evaluate(p){const f=this.lhs.evaluate(p),m=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const y=Dt(f),v=Dt(m);if(y.kind!==v.kind||y.kind!=="string"&&y.kind!=="number")throw new Ot(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${y.kind}, ${v.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const y=Dt(f),v=Dt(m);if(y.kind!=="string"||v.kind!=="string")return e(p,f,m)}return this.collator?r(p,f,m,this.collator.evaluate(p)):e(p,f,m)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}}}const mc=jn("==",(function(i,e,r){return e===r}),Qo),gc=jn("!=",(function(i,e,r){return e!==r}),(function(i,e,r,a){return!Qo(0,e,r,a)})),_c=jn("<",(function(i,e,r){return e",(function(i,e,r){return e>r}),(function(i,e,r,a){return a.compare(e,r)>0})),xc=jn("<=",(function(i,e,r){return e<=r}),(function(i,e,r,a){return a.compare(e,r)<=0})),vc=jn(">=",(function(i,e,r){return e>=r}),(function(i,e,r,a){return a.compare(e,r)>=0}));class js{constructor(e,r,a,o,p){this.type=it,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=p}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Ae);if(!a)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let p=null;if(o.locale&&(p=r.parse(o.locale,1,it),!p))return null;let f=null;if(o.currency&&(f=r.parse(o.currency,1,it),!f))return null;let m=null;if(o["min-fraction-digits"]&&(m=r.parse(o["min-fraction-digits"],1,Ae),!m))return null;let y=null;return o["max-fraction-digits"]&&(y=r.parse(o["max-fraction-digits"],1,Ae),!y)?null:new js(a,p,f,m,y)}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 ts{constructor(e){this.type=U,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const o=[];let p=!1;for(let f=1;f<=e.length-1;++f){const m=e[f];if(p&&typeof m=="object"&&!Array.isArray(m)){p=!1;let y=null;if(m["font-scale"]&&(y=r.parse(m["font-scale"],1,Ae),!y))return null;let v=null;if(m["text-font"]&&(v=r.parse(m["text-font"],1,j(it)),!v))return null;let w=null;if(m["text-color"]&&(w=r.parse(m["text-color"],1,bi),!w))return null;const I=o[o.length-1];I.scale=y,I.font=v,I.textColor=w}else{const y=r.parse(e[f],1,et);if(!y)return null;const v=y.type.kind;if(v!=="string"&&v!=="value"&&v!=="null"&&v!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,o.push({content:y,scale:null,font:null,textColor:null})}}return new ts(o)}evaluate(e){return new fi(this.sections.map((r=>{const a=r.content.evaluate(e);return Dt(a)===E?new Va("",a,null,null,null):new Va(mt(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)})))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class qs{constructor(e){this.type=E,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,it);return a?new qs(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=ci.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class Zs{constructor(e){this.type=Ae,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${Z(a.type)} instead.`):new Zs(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Ot(`Expected value to be of type string or array, but found ${Z(Dt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const qn={"==":mc,"!=":gc,">":yc,"<":_c,">=":vc,"<=":xc,array:nr,at:Ns,boolean:nr,case:$s,coalesce:Ya,collator:qa,format:ts,image:qs,in:Vs,"index-of":Qa,interpolate:ji,"interpolate-hcl":ji,"interpolate-lab":ji,length:Zs,let:Ja,literal:mn,match:Us,number:nr,"number-format":js,object:nr,slice:es,step:Qr,string:nr,"to-boolean":Yr,"to-color":Yr,"to-number":Yr,"to-string":Yr,var:Ga,within:gn};function el(i,[e,r,a,o]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const p=o?o.evaluate(i):1,f=Ua(e,r,a,p);if(f)throw new Ot(f);return new xt(e/255,r/255,a/255,p,!1)}function tl(i,e){return i in e}function Gs(i,e){const r=e[i];return r===void 0?null:r}function _n(i){return{type:i}}function il(i){return{result:"success",value:i}}function en(i){return{result:"error",value:i}}function Zn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function rl(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Hs(i){return!!i.expression&&i.expression.interpolated}function gt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Lt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function bc(i){return i}function ht(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),p=i.type||(Hs(e)?"exponential":"interval");if(r||e.type==="padding"){const w=r?xt.parse:Ui.parse;(i=xr({},i)).stops&&(i.stops=i.stops.map((I=>[I[0],w(I[1])]))),i.default=w(i.default?i.default:e.default)}if(i.colorSpace&&(f=i.colorSpace)!=="rgb"&&f!=="hcl"&&f!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var f;let m,y,v;if(p==="exponential")m=da;else if(p==="interval")m=Mt;else if(p==="categorical"){m=Ft,y=Object.create(null);for(const w of i.stops)y[w[0]]=w[1];v=typeof i.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);m=nl}if(a){const w={},I=[];for(let z=0;zz[0])),evaluate:({zoom:z},B)=>da({stops:k,base:i.base},e,z).evaluate(z,B)}}if(o){const w=p==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:ji.interpolationFactor.bind(void 0,w),zoomStops:i.stops.map((I=>I[0])),evaluate:({zoom:I})=>m(i,e,I,y,v)}}return{kind:"source",evaluate(w,I){const k=I&&I.properties?I.properties[i.property]:void 0;return k===void 0?yn(i.default,e.default):m(i,e,k,y,v)}}}function yn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Ft(i,e,r,a,o){return yn(typeof r===o?a[r]:void 0,i.default,e.default)}function Mt(i,e,r){if(gt(r)!=="number")return yn(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const o=$n(i.stops.map((p=>p[0])),r);return i.stops[o][1]}function da(i,e,r){const a=i.base!==void 0?i.base:1;if(gt(r)!=="number")return yn(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const p=$n(i.stops.map((w=>w[0])),r),f=(function(w,I,k,P){const z=P-k,B=w-k;return z===0?0:I===1?B/z:(Math.pow(I,B)-1)/(Math.pow(I,z)-1)})(r,a,i.stops[p][0],i.stops[p+1][0]),m=i.stops[p][1],y=i.stops[p+1][1],v=$i[e.type]||bc;return typeof m.evaluate=="function"?{evaluate(...w){const I=m.evaluate.apply(void 0,w),k=y.evaluate.apply(void 0,w);if(I!==void 0&&k!==void 0)return v(I,k,f,i.colorSpace)}}:v(m,y,f,i.colorSpace)}function nl(i,e,r){switch(e.type){case"color":r=xt.parse(r);break;case"formatted":r=fi.fromString(r.toString());break;case"resolvedImage":r=ci.fromString(r.toString());break;case"padding":r=Ui.parse(r);break;default:gt(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return yn(r,i.default,e.default)}ar.register(qn,{error:[{kind:"error"},[it],(i,[e])=>{throw new Ot(e.evaluate(i))}],typeof:[it,[et],(i,[e])=>Z(Dt(e.evaluate(i)))],"to-rgba":[j(Ae,4),[bi],(i,[e])=>{const[r,a,o,p]=e.evaluate(i).rgb;return[255*r,255*a,255*o,p]}],rgb:[bi,[Ae,Ae,Ae],el],rgba:[bi,[Ae,Ae,Ae,Ae],el],has:{type:Ye,overloads:[[[it],(i,[e])=>tl(e.evaluate(i),i.properties())],[[it,vr],(i,[e,r])=>tl(e.evaluate(i),r.evaluate(i))]]},get:{type:et,overloads:[[[it],(i,[e])=>Gs(e.evaluate(i),i.properties())],[[it,vr],(i,[e,r])=>Gs(e.evaluate(i),r.evaluate(i))]]},"feature-state":[et,[it],(i,[e])=>Gs(e.evaluate(i),i.featureState||{})],properties:[vr,[],i=>i.properties()],"geometry-type":[it,[],i=>i.geometryType()],id:[et,[],i=>i.id()],zoom:[Ae,[],i=>i.globals.zoom],"heatmap-density":[Ae,[],i=>i.globals.heatmapDensity||0],"line-progress":[Ae,[],i=>i.globals.lineProgress||0],accumulated:[et,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Ae,_n(Ae),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[Ae,_n(Ae),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:Ae,overloads:[[[Ae,Ae],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Ae],(i,[e])=>-e.evaluate(i)]]},"/":[Ae,[Ae,Ae],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Ae,[Ae,Ae],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Ae,[],()=>Math.LN2],pi:[Ae,[],()=>Math.PI],e:[Ae,[],()=>Math.E],"^":[Ae,[Ae,Ae],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Ae,[Ae],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Ae,[Ae],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Ae,[Ae],(i,[e])=>Math.log(e.evaluate(i))],log2:[Ae,[Ae],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Ae,[Ae],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Ae,[Ae],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Ae,[Ae],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Ae,[Ae],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Ae,[Ae],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Ae,[Ae],(i,[e])=>Math.atan(e.evaluate(i))],min:[Ae,_n(Ae),(i,e)=>Math.min(...e.map((r=>r.evaluate(i))))],max:[Ae,_n(Ae),(i,e)=>Math.max(...e.map((r=>r.evaluate(i))))],abs:[Ae,[Ae],(i,[e])=>Math.abs(e.evaluate(i))],round:[Ae,[Ae],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ae,[Ae],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Ae,[Ae],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ye,[it,et],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ye,[et],(i,[e])=>i.id()===e.value],"filter-type-==":[Ye,[it],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ye,[it,et],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a{const r=i.id(),a=e.value;return typeof r==typeof a&&r":[Ye,[it,et],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[Ye,[et],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Ye,[it,et],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Ye,[et],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Ye,[it,et],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Ye,[et],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Ye,[et],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ye,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ye,[j(it)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ye,[j(et)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ye,[it,j(et)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ye,[it,j(et)],(i,[e,r])=>(function(a,o,p,f){for(;p<=f;){const m=p+f>>1;if(o[m]===a)return!0;o[m]>a?f=m-1:p=m+1}return!1})(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[_n(Ye),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[_n(Ye),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ye,[Ye],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ye,[it],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[it,[it],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[it,[it],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[it,_n(et),(i,e)=>e.map((r=>mt(r.evaluate(i)))).join("")],"resolved-locale":[it,[Lr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Ws{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new zs,this._defaultValue=r?(a=r).type==="color"&&Lt(a.default)?new xt(0,0,0,0):a.type==="color"?xt.parse(a.default)||null:a.type==="padding"?Ui.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?rr.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,o,p,f){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,o,p,f){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Ot(`Expected value to be one of ${Object.keys(this._enumValues).map((y=>JSON.stringify(y))).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function is(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in qn}function rs(i,e){const r=new ja(qn,Ha,[],e?(function(o){const p={color:bi,string:it,number:Ae,enum:it,boolean:Ye,formatted:U,padding:C,resolvedImage:E,variableAnchorOffsetCollection:L};return o.type==="array"?j(p[o.value]||et,o.length):p[o.type]})(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?il(new Ws(a,e)):en(r.errors)}class Xs{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!pa(r.expression)}evaluateWithoutErrorHandling(e,r,a,o,p,f){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,p,f)}evaluate(e,r,a,o,p,f){return this._styleExpression.evaluate(e,r,a,o,p,f)}}class ns{constructor(e,r,a,o){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!pa(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,a,o,p,f){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,p,f)}evaluate(e,r,a,o,p,f){return this._styleExpression.evaluate(e,r,a,o,p,f)}interpolationFactor(e,r,a){return this.interpolationType?ji.interpolationFactor(this.interpolationType,e,r,a):0}}function Ks(i,e){const r=rs(i,e);if(r.result==="error")return r;const a=r.value.expression,o=Wa(a);if(!o&&!Zn(e))return en([new Bt("","data expressions not supported")]);const p=Xa(a,["zoom"]);if(!p&&!rl(e))return en([new Bt("","zoom expressions not supported")]);const f=ma(a);return f||p?f instanceof Bt?en([f]):f instanceof ji&&!Hs(e)?en([new Bt("",'"interpolate" expressions cannot be used with this property')]):il(f?new ns(o?"camera":"composite",r.value,f.labels,f instanceof ji?f.interpolation:void 0):new Xs(o?"constant":"source",r.value)):en([new Bt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class fa{constructor(e,r){this._parameters=e,this._specification=r,xr(this,ht(this._parameters,this._specification))}static deserialize(e){return new fa(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ma(i){let e=null;if(i instanceof Ja)e=ma(i.result);else if(i instanceof Ya){for(const r of i.args)if(e=ma(r),e)break}else(i instanceof Qr||i instanceof ji)&&i.input instanceof ar&&i.input.name==="zoom"&&(e=i);return e instanceof Bt||i.eachChild((r=>{const a=ma(r);a instanceof Bt?e=a:!e&&a?e=new Bt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new Bt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function ga(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!ga(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const wc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ys(i){if(i==null)return{filter:()=>!0,needGeometry:!1};ga(i)||(i=as(i));const e=rs(i,wc);if(e.result==="error")throw new Error(e.value.map((r=>`${r.key}: ${r.message}`)).join(", "));return{filter:(r,a,o)=>e.value.evaluate(r,a,{},o),needGeometry:al(i)}}function Sc(i,e){return ie?1:0}function al(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Js(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(as))):e==="all"?["all"].concat(i.slice(1).map(as)):e==="none"?["all"].concat(i.slice(1).map(as).map(_a)):e==="in"?sl(i[1],i.slice(2)):e==="!in"?_a(sl(i[1],i.slice(2))):e==="has"?ol(i[1]):e==="!has"?_a(ol(i[1])):e!=="within"||i;var r}function Js(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function sl(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((r=>typeof r!=typeof e[0]))?["filter-in-large",i,["literal",e.sort(Sc)]]:["filter-in-small",i,["literal",e]]}}function ol(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function _a(i){return["!",i]}function ss(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const p of i)o+=`${ss(p)},`;return`${o}]`}const r=Object.keys(i).sort();let a="{";for(let o=0;oa.maximum?[new Te(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function ls(i){const e=i.valueSpec,r=Nt(i.value.type);let a,o,p,f={};const m=r!=="categorical"&&i.value.property===void 0,y=!m,v=gt(i.value.stops)==="array"&>(i.value.stops[0])==="array"&>(i.value.stops[0][0])==="object",w=Pi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(P){if(r==="identity")return[new Te(P.key,P.value,'identity function may not have a "stops" property')];let z=[];const B=P.value;return z=z.concat(Gn({key:P.key,value:B,valueSpec:P.valueSpec,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec,arrayElementValidator:I})),gt(B)==="array"&&B.length===0&&z.push(new Te(P.key,B,"array must have at least one stop")),z},default:function(P){return P.validateSpec({key:P.key,value:P.value,valueSpec:e,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec})}}});return r==="identity"&&m&&w.push(new Te(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||w.push(new Te(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Hs(i.valueSpec)&&w.push(new Te(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(y&&!Zn(i.valueSpec)?w.push(new Te(i.key,i.value,"property functions not supported")):m&&!rl(i.valueSpec)&&w.push(new Te(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!v||i.value.property!==void 0||w.push(new Te(i.key,i.value,'"property" property is required')),w;function I(P){let z=[];const B=P.value,q=P.key;if(gt(B)!=="array")return[new Te(q,B,`array expected, ${gt(B)} found`)];if(B.length!==2)return[new Te(q,B,`array length 2 expected, length ${B.length} found`)];if(v){if(gt(B[0])!=="object")return[new Te(q,B,`object expected, ${gt(B[0])} found`)];if(B[0].zoom===void 0)return[new Te(q,B,"object stop key must have zoom")];if(B[0].value===void 0)return[new Te(q,B,"object stop key must have value")];if(p&&p>Nt(B[0].zoom))return[new Te(q,B[0].zoom,"stop zoom values must appear in ascending order")];Nt(B[0].zoom)!==p&&(p=Nt(B[0].zoom),o=void 0,f={}),z=z.concat(Pi({key:`${q}[0]`,value:B[0],valueSpec:{zoom:{}},validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec,objectElementValidators:{zoom:ya,value:k}}))}else z=z.concat(k({key:`${q}[0]`,value:B[0],validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec},B));return is(xn(B[1]))?z.concat([new Te(`${q}[1]`,B[1],"expressions are not allowed in function stops.")]):z.concat(P.validateSpec({key:`${q}[1]`,value:B[1],valueSpec:e,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec}))}function k(P,z){const B=gt(P.value),q=Nt(P.value),H=P.value!==null?P.value:z;if(a){if(B!==a)return[new Te(P.key,H,`${B} stop domain type must match previous stop domain type ${a}`)]}else a=B;if(B!=="number"&&B!=="string"&&B!=="boolean")return[new Te(P.key,H,"stop domain value must be a number, string, or boolean")];if(B!=="number"&&r!=="categorical"){let re=`number expected, ${B} found`;return Zn(e)&&r===void 0&&(re+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Te(P.key,H,re)]}return r!=="categorical"||B!=="number"||isFinite(q)&&Math.floor(q)===q?r!=="categorical"&&B==="number"&&o!==void 0&&qnew Te(`${i.key}${a.key}`,i.value,a.message)));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new Te(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!pa(r))return[new Te(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!pa(r))return[new Te(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Xa(r,["zoom","feature-state"]))return[new Te(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Wa(r))return[new Te(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function xa(i){const e=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf(Nt(r))===-1&&o.push(new Te(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf(Nt(r))===-1&&o.push(new Te(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function Hn(i){return ga(xn(i.value))?vn(xr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):cl(i)}function cl(i){const e=i.value,r=i.key;if(gt(e)!=="array")return[new Te(r,e,`array expected, ${gt(e)} found`)];const a=i.styleSpec;let o,p=[];if(e.length<1)return[new Te(r,e,"filter array must have at least 1 element")];switch(p=p.concat(xa({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),Nt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Nt(e[1])==="$type"&&p.push(new Te(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&p.push(new Te(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=gt(e[1]),o!=="string"&&p.push(new Te(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let f=2;f{v in r&&e.push(new Te(a,r[v],`"${v}" is prohibited for ref layers`))})),o.layers.forEach((v=>{Nt(v.id)===m&&(y=v)})),y?y.ref?e.push(new Te(a,r.ref,"ref cannot reference another ref layer")):f=Nt(y.type):e.push(new Te(a,r.ref,`ref layer "${m}" not found`))}else if(f!=="background")if(r.source){const y=o.sources&&o.sources[r.source],v=y&&Nt(y.type);y?v==="vector"&&f==="raster"?e.push(new Te(a,r.source,`layer "${r.id}" requires a raster source`)):v!=="raster-dem"&&f==="hillshade"?e.push(new Te(a,r.source,`layer "${r.id}" requires a raster-dem source`)):v==="raster"&&f!=="raster"?e.push(new Te(a,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&f!=="hillshade"?e.push(new Te(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):f!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&y.lineMetrics||e.push(new Te(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Te(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Te(a,r.source,`source "${r.source}" not found`))}else e.push(new Te(a,r,'missing required property "source"'));return e=e.concat(Pi({key:a,value:r,valueSpec:p.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:p.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Hn,layout:y=>Pi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>pl(xr({layerType:f},v))}}),paint:y=>Pi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>hl(xr({layerType:f},v))}})}})),e}function br(i){const e=i.value,r=i.key,a=gt(e);return a!=="string"?[new Te(r,e,`string expected, ${a} found`)]:[]}const va={promoteId:function({key:i,value:e}){if(gt(e)==="string")return br({key:i,value:e});{const r=[];for(const a in e)r.push(...br({key:`${i}.${a}`,value:e[a]}));return r}}};function qi(i){const e=i.value,r=i.key,a=i.styleSpec,o=i.style,p=i.validateSpec;if(!e.type)return[new Te(r,e,'"type" is required')];const f=Nt(e.type);let m;switch(f){case"vector":case"raster":return m=Pi({key:r,value:e,valueSpec:a[`source_${f.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:va,validateSpec:p}),m;case"raster-dem":return m=(function(y){var v;const w=(v=y.sourceName)!==null&&v!==void 0?v:"",I=y.value,k=y.styleSpec,P=k.source_raster_dem,z=y.style;let B=[];const q=gt(I);if(I===void 0)return B;if(q!=="object")return B.push(new Te("source_raster_dem",I,`object expected, ${q} found`)),B;const H=Nt(I.encoding)==="custom",re=["redFactor","greenFactor","blueFactor","baseShift"],K=y.value.encoding?`"${y.value.encoding}"`:"Default";for(const ae in I)!H&&re.includes(ae)?B.push(new Te(ae,I[ae],`In "${w}": "${ae}" is only valid when "encoding" is set to "custom". ${K} encoding found`)):P[ae]?B=B.concat(y.validateSpec({key:ae,value:I[ae],valueSpec:P[ae],validateSpec:y.validateSpec,style:z,styleSpec:k})):B.push(new Te(ae,I[ae],`unknown property "${ae}"`));return B})({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:p}),m;case"geojson":if(m=Pi({key:r,value:e,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:p,objectElementValidators:va}),e.cluster)for(const y in e.clusterProperties){const[v,w]=e.clusterProperties[y],I=typeof v=="string"?[v,["accumulated"],["get",y]]:v;m.push(...vn({key:`${r}.${y}.map`,value:w,expressionContext:"cluster-map"})),m.push(...vn({key:`${r}.${y}.reduce`,value:I,expressionContext:"cluster-reduce"}))}return m;case"video":return Pi({key:r,value:e,valueSpec:a.source_video,style:o,validateSpec:p,styleSpec:a});case"image":return Pi({key:r,value:e,valueSpec:a.source_image,style:o,validateSpec:p,styleSpec:a});case"canvas":return[new Te(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return xa({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function ba(i){const e=i.value,r=i.styleSpec,a=r.light,o=i.style;let p=[];const f=gt(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new Te("light",e,`object expected, ${f} found`)]),p;for(const m in e){const y=m.match(/^(.*)-transition$/);p=p.concat(y&&a[y[1]]&&a[y[1]].transition?i.validateSpec({key:m,value:e[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):a[m]?i.validateSpec({key:m,value:e[m],valueSpec:a[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new Te(m,e[m],`unknown property "${m}"`)])}return p}function fl(i){const e=i.value,r=i.styleSpec,a=r.terrain,o=i.style;let p=[];const f=gt(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new Te("terrain",e,`object expected, ${f} found`)]),p;for(const m in e)p=p.concat(a[m]?i.validateSpec({key:m,value:e[m],valueSpec:a[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new Te(m,e[m],`unknown property "${m}"`)]);return p}function ml(i){let e=[];const r=i.value,a=i.key;if(Array.isArray(r)){const o=[],p=[];for(const f in r)r[f].id&&o.includes(r[f].id)&&e.push(new Te(a,r,`all the sprites' ids must be unique, but ${r[f].id} is duplicated`)),o.push(r[f].id),r[f].url&&p.includes(r[f].url)&&e.push(new Te(a,r,`all the sprites' URLs must be unique, but ${r[f].url} is duplicated`)),p.push(r[f].url),e=e.concat(Pi({key:`${a}[${f}]`,value:r[f],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return br({key:a,value:r})}const gl={"*":()=>[],array:Gn,boolean:function(i){const e=i.value,r=i.key,a=gt(e);return a!=="boolean"?[new Te(r,e,`boolean expected, ${a} found`)]:[]},number:ya,color:function(i){const e=i.key,r=i.value,a=gt(r);return a!=="string"?[new Te(e,r,`color expected, ${a} found`)]:xt.parse(String(r))?[]:[new Te(e,r,`color expected, "${r}" found`)]},constants:ll,enum:xa,filter:Hn,function:ls,layer:dl,object:Pi,source:qi,light:ba,terrain:fl,string:br,formatted:function(i){return br(i).length===0?[]:vn(i)},resolvedImage:function(i){return br(i).length===0?[]:vn(i)},padding:function(i){const e=i.key,r=i.value;if(gt(r)==="array"){if(r.length<1||r.length>4)return[new Te(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let o=[];for(let p=0;p[]}})),i.constants&&(r=r.concat(ll({key:"constants",value:i.constants}))),cs(r)}function Fr(i){return function(e){return i({...e,validateSpec:tn})}}function cs(i){return[].concat(i).sort(((e,r)=>e.line-r.line))}function Rr(i){return function(...e){return cs(i.apply(this,e))}}sr.source=Rr(Fr(qi)),sr.sprite=Rr(Fr(ml)),sr.glyphs=Rr(Fr(_l)),sr.light=Rr(Fr(ba)),sr.terrain=Rr(Fr(fl)),sr.layer=Rr(Fr(dl)),sr.filter=Rr(Fr(Hn)),sr.paintProperty=Rr(Fr(hl)),sr.layoutProperty=Rr(Fr(pl));const Br=sr,Tc=Br.light,Qs=Br.paintProperty,yl=Br.layoutProperty;function us(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new Xr(new Error(a.message))),r=!0;return r}class Wn{constructor(e,r,a){const o=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const f=new Int32Array(this.arrayBuffer);e=f[0],this.d=(r=f[1])+2*(a=f[2]);for(let y=0;y=I[z+0]&&o>=I[z+1])?(m[P]=!0,f.push(w[P])):m[P]=!1}}}}_forEachCell(e,r,a,o,p,f,m,y){const v=this._convertToCellCoord(e),w=this._convertToCellCoord(r),I=this._convertToCellCoord(a),k=this._convertToCellCoord(o);for(let P=v;P<=I;P++)for(let z=w;z<=k;z++){const B=this.d*z+P;if((!y||y(this._convertFromCellCoord(P),this._convertFromCellCoord(z),this._convertFromCellCoord(P+1),this._convertFromCellCoord(z+1)))&&p.call(this,e,r,a,o,B,f,m,y))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,r=3+this.cells.length+1+1;let a=0;for(let f=0;f=0)continue;const f=i[p];o[p]=Or[a].shallow.indexOf(p)>=0?f:rn(f,e)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(o.$name=a),o}throw new Error("can't serialize object of type "+typeof i)}function Xn(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||hs(i)||oa(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Xn);if(typeof i=="object"){const e=i.$name||"Object";if(!Or[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Or[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const o of Object.keys(i)){if(o==="$name")continue;const p=i[o];a[o]=Or[e].shallow.indexOf(o)>=0?p:Xn(p)}return a}throw new Error("can't deserialize object of type "+typeof i)}class xl{constructor(){this.first=!0}update(e,r){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=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function eo(i){for(const e of i)if(io(e.charCodeAt(0)))return!0;return!1}function to(i){for(const e of i)if(!Ic(e.charCodeAt(0)))return!1;return!0}function Ic(i){return!(Me.Arabic(i)||Me["Arabic Supplement"](i)||Me["Arabic Extended-A"](i)||Me["Arabic Presentation Forms-A"](i)||Me["Arabic Presentation Forms-B"](i))}function io(i){return!(i!==746&&i!==747&&(i<4352||!(Me["Bopomofo Extended"](i)||Me.Bopomofo(i)||Me["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Me["CJK Compatibility Ideographs"](i)||Me["CJK Compatibility"](i)||Me["CJK Radicals Supplement"](i)||Me["CJK Strokes"](i)||!(!Me["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Me["CJK Unified Ideographs Extension A"](i)||Me["CJK Unified Ideographs"](i)||Me["Enclosed CJK Letters and Months"](i)||Me["Hangul Compatibility Jamo"](i)||Me["Hangul Jamo Extended-A"](i)||Me["Hangul Jamo Extended-B"](i)||Me["Hangul Jamo"](i)||Me["Hangul Syllables"](i)||Me.Hiragana(i)||Me["Ideographic Description Characters"](i)||Me.Kanbun(i)||Me["Kangxi Radicals"](i)||Me["Katakana Phonetic Extensions"](i)||Me.Katakana(i)&&i!==12540||!(!Me["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Me["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Me["Unified Canadian Aboriginal Syllabics"](i)||Me["Unified Canadian Aboriginal Syllabics Extended"](i)||Me["Vertical Forms"](i)||Me["Yijing Hexagram Symbols"](i)||Me["Yi Syllables"](i)||Me["Yi Radicals"](i))))}function vl(i){return!(io(i)||(function(e){return!!(Me["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Me["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)||Me["Letterlike Symbols"](e)||Me["Number Forms"](e)||Me["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)||Me["Control Pictures"](e)&&e!==9251||Me["Optical Character Recognition"](e)||Me["Enclosed Alphanumerics"](e)||Me["Geometric Shapes"](e)||Me["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Me["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Me["CJK Symbols and Punctuation"](e)||Me.Katakana(e)||Me["Private Use Area"](e)||Me["CJK Compatibility Forms"](e)||Me["Small Form Variants"](e)||Me["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)})(i))}function bl(i){return i>=1424&&i<=2303||Me["Arabic Presentation Forms-A"](i)||Me["Arabic Presentation Forms-B"](i)}function wl(i,e){return!(!e&&bl(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Me.Khmer(i))}function Ac(i){for(const e of i)if(bl(e.charCodeAt(0)))return!0;return!1}const ro="deferred",no="loading",ao="loaded";let so=null,zi="unavailable",nn=null;const wa=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(zi="error"),so&&so(i)};function oo(){Sa.fire(new Wr("pluginStateChange",{pluginStatus:zi,pluginURL:nn}))}const Sa=new pn,lo=function(){return zi},Sl=function(){if(zi!==ro||!nn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");zi=no,oo(),nn&&ua({url:nn},(i=>{i?wa(i):(zi=ao,oo())}))},Zi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>zi===ao||Zi.applyArabicShaping!=null,isLoading:()=>zi===no,setState(i){if(!Qi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");zi=i.pluginStatus,nn=i.pluginURL},isParsed(){if(!Qi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Zi.applyArabicShaping!=null&&Zi.processBidirectionalText!=null&&Zi.processStyledBidirectionalText!=null},getPluginURL(){if(!Qi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return nn}};class Ct{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new xl,this.transition={})}isSupportedScript(e){return(function(r,a){for(const o of r)if(!wl(o.charCodeAt(0),a))return!1;return!0})(e,Zi.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class ps{constructor(e,r){this.property=e,this.value=r,this.expression=(function(a,o){if(Lt(a))return new fa(a,o);if(is(a)){const p=Ks(a,o);if(p.result==="error")throw new Error(p.value.map((f=>`${f.key}: ${f.message}`)).join(", "));return p.value}{let p=a;return o.type==="color"&&typeof a=="string"?p=xt.parse(a):o.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(p=rr.parse(a)):p=Ui.parse(a),{kind:"constant",evaluate:()=>p}}})(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class co{constructor(e){this.property=e,this.value=new ps(e,void 0)}transitioned(e,r){return new Il(this.property,this.value,r,oi({},e.transition,this.transition),e.now)}untransitioned(){return new Il(this.property,this.value,null,{},0)}}class Tl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return ur(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new co(this._values[e].property)),this._values[e].value=new ps(this._values[e].property,r===null?void 0:ur(r))}getTransition(e){return ur(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new co(this._values[e].property)),this._values[e].transition=ur(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const o=this.getTransition(r);o!==void 0&&(e[`${r}-transition`]=o)}return e}transitioned(e,r){const a=new Al(this._properties);for(const o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(e,r._values[o]);return a}untransitioned(){const e=new Al(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Il{constructor(e,r,a,o,p){this.property=e,this.value=r,this.begin=p+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const o=e.now||0,p=this.value.possiblyEvaluate(e,r,a),f=this.prior;if(f){if(o>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(o=1)return 1;const v=y*y,w=v*y;return 4*(y<.5?w:3*(y-v)+w-.75)})(m))}}return p}}class Al{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const o=new ds(this._properties);for(const p of Object.keys(this._values))o._values[p]=this._values[p].possiblyEvaluate(e,r,a);return o}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Cc{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return ur(this._values[e].value)}setValue(e,r){this._values[e]=new ps(this._values[e].property,r===null?void 0:ur(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const o=new ds(this._properties);for(const p of Object.keys(this._values))o._values[p]=this._values[p].possiblyEvaluate(e,r,a);return o}}class wi{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,o){return this.property.evaluate(this.value,this.parameters,e,r,a,o)}}class ds{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ue{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){const o=$i[this.specification.type];return o?o(e,r,a):e}}class Ge{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,o){return new wi(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,o)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new wi(this,{kind:"constant",value:void 0},e.parameters);const o=$i[this.specification.type];if(o){const p=o(e.value.value,r.value.value,a);return new wi(this,{kind:"constant",value:p},e.parameters)}return e}evaluate(e,r,a,o,p,f){return e.kind==="constant"?e.value:e.evaluate(r,a,o,p,f)}}class Ta extends Ge{possiblyEvaluate(e,r,a,o){if(e.value===void 0)return new wi(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const p=e.expression.evaluate(r,null,{},a,o),f=e.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,m=this._calculate(f,f,f,r);return new wi(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){const p=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new wi(this,{kind:"constant",value:p},r)}return new wi(this,e.expression,r)}evaluate(e,r,a,o,p,f){if(e.kind==="source"){const m=e.evaluate(r,a,o,p,f);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,o),e.evaluate({zoom:Math.floor(r.zoom)},a,o),e.evaluate({zoom:Math.floor(r.zoom)+1},a,o),r):e.value}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class uo{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){if(e.value!==void 0){if(e.expression.kind==="constant"){const p=e.expression.evaluate(r,null,{},a,o);return this._calculate(p,p,p,r)}return this._calculate(e.expression.evaluate(new Ct(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Ct(Math.floor(r.zoom),r)),e.expression.evaluate(new Ct(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class ho{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){return!!e.expression.evaluate(r,null,{},a,o)}interpolate(){return!1}}class Zt{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const o=this.defaultPropertyValues[r]=new ps(a,void 0),p=this.defaultTransitionablePropertyValues[r]=new co(a);this.defaultTransitioningPropertyValues[r]=p.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}ze("DataDrivenProperty",Ge),ze("DataConstantProperty",Ue),ze("CrossFadedDataDrivenProperty",Ta),ze("CrossFadedProperty",uo),ze("ColorRampProperty",ho);const po="-transition";class or extends pn{constructor(e,r){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),r.layout&&(this._unevaluatedLayout=new Cc(r.layout)),r.paint)){this._transitionablePaint=new Tl(r.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 ds(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}){r!=null&&this._validate(yl,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(po)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate(Qs,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(po))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const o=this._transitionablePaint._values[e],p=o.property.specification["property-type"]==="cross-faded-data-driven",f=o.value.isDataDriven(),m=o.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const y=this._transitionablePaint._values[e].value;return y.isDataDriven()||f||p||this._handleOverridablePaintPropertyUpdate(e,m,y)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,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,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}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),Dn(e,((r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length)))}_validate(e,r,a,o,p={}){return(!p||p.validate!==!1)&&us(this,e.call(Br,{key:r,layerType:this.type,objectKey:a,value:o,styleSpec:pe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof wi&&Zn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Cl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class bn{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Vt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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 r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Rt(i,e=1){let r=0,a=0;return{members:i.map((o=>{const p=Cl[o.type].BYTES_PER_ELEMENT,f=r=Kn(r,Math.max(e,p)),m=o.components||1;return a=Math.max(a,p),r+=p*m,{name:o.name,type:o.type,components:m,offset:f}})),size:Kn(r,Math.max(a,e)),alignment:e}}function Kn(i,e){return Math.ceil(i/e)*e}class Ia extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.int16[o+0]=r,this.int16[o+1]=a,e}}Ia.prototype.bytesPerElement=4,ze("StructArrayLayout2i4",Ia);class Aa extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.int16[p+0]=r,this.int16[p+1]=a,this.int16[p+2]=o,e}}Aa.prototype.bytesPerElement=6,ze("StructArrayLayout3i6",Aa);class wn extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o)}emplace(e,r,a,o,p){const f=4*e;return this.int16[f+0]=r,this.int16[f+1]=a,this.int16[f+2]=o,this.int16[f+3]=p,e}}wn.prototype.bytesPerElement=8,ze("StructArrayLayout4i8",wn);class fo extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,p,f)}emplace(e,r,a,o,p,f,m){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=a,this.int16[y+2]=o,this.int16[y+3]=p,this.int16[y+4]=f,this.int16[y+5]=m,e}}fo.prototype.bytesPerElement=12,ze("StructArrayLayout2i4i12",fo);class mo extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,p,f)}emplace(e,r,a,o,p,f,m){const y=4*e,v=8*e;return this.int16[y+0]=r,this.int16[y+1]=a,this.uint8[v+4]=o,this.uint8[v+5]=p,this.uint8[v+6]=f,this.uint8[v+7]=m,e}}mo.prototype.bytesPerElement=8,ze("StructArrayLayout2i4ub8",mo);class Yn extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.float32[o+0]=r,this.float32[o+1]=a,e}}Yn.prototype.bytesPerElement=8,ze("StructArrayLayout2f8",Yn);class go extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f,m,y,v,w){const I=this.length;return this.resize(I+1),this.emplace(I,e,r,a,o,p,f,m,y,v,w)}emplace(e,r,a,o,p,f,m,y,v,w,I){const k=10*e;return this.uint16[k+0]=r,this.uint16[k+1]=a,this.uint16[k+2]=o,this.uint16[k+3]=p,this.uint16[k+4]=f,this.uint16[k+5]=m,this.uint16[k+6]=y,this.uint16[k+7]=v,this.uint16[k+8]=w,this.uint16[k+9]=I,e}}go.prototype.bytesPerElement=20,ze("StructArrayLayout10ui20",go);class _o extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f,m,y,v,w,I,k){const P=this.length;return this.resize(P+1),this.emplace(P,e,r,a,o,p,f,m,y,v,w,I,k)}emplace(e,r,a,o,p,f,m,y,v,w,I,k,P){const z=12*e;return this.int16[z+0]=r,this.int16[z+1]=a,this.int16[z+2]=o,this.int16[z+3]=p,this.uint16[z+4]=f,this.uint16[z+5]=m,this.uint16[z+6]=y,this.uint16[z+7]=v,this.int16[z+8]=w,this.int16[z+9]=I,this.int16[z+10]=k,this.int16[z+11]=P,e}}_o.prototype.bytesPerElement=24,ze("StructArrayLayout4i4ui4i24",_o);class _t extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.float32[p+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,e}}_t.prototype.bytesPerElement=12,ze("StructArrayLayout3f12",_t);class u extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}u.prototype.bytesPerElement=4,ze("StructArrayLayout1ul4",u);class t extends Vt{_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,r,a,o,p,f,m,y,v){const w=this.length;return this.resize(w+1),this.emplace(w,e,r,a,o,p,f,m,y,v)}emplace(e,r,a,o,p,f,m,y,v,w){const I=10*e,k=5*e;return this.int16[I+0]=r,this.int16[I+1]=a,this.int16[I+2]=o,this.int16[I+3]=p,this.int16[I+4]=f,this.int16[I+5]=m,this.uint32[k+3]=y,this.uint16[I+8]=v,this.uint16[I+9]=w,e}}t.prototype.bytesPerElement=20,ze("StructArrayLayout6i1ul2ui20",t);class n extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,p,f)}emplace(e,r,a,o,p,f,m){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=a,this.int16[y+2]=o,this.int16[y+3]=p,this.int16[y+4]=f,this.int16[y+5]=m,e}}n.prototype.bytesPerElement=12,ze("StructArrayLayout2i2i2i12",n);class s extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,p)}emplace(e,r,a,o,p,f){const m=4*e,y=8*e;return this.float32[m+0]=r,this.float32[m+1]=a,this.float32[m+2]=o,this.int16[y+6]=p,this.int16[y+7]=f,e}}s.prototype.bytesPerElement=16,ze("StructArrayLayout2f1f2i16",s);class c extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o)}emplace(e,r,a,o,p){const f=12*e,m=3*e;return this.uint8[f+0]=r,this.uint8[f+1]=a,this.float32[m+1]=o,this.float32[m+2]=p,e}}c.prototype.bytesPerElement=12,ze("StructArrayLayout2ub2f12",c);class h extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.uint16[p+0]=r,this.uint16[p+1]=a,this.uint16[p+2]=o,e}}h.prototype.bytesPerElement=6,ze("StructArrayLayout3ui6",h);class g extends Vt{_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,r,a,o,p,f,m,y,v,w,I,k,P,z,B,q,H){const re=this.length;return this.resize(re+1),this.emplace(re,e,r,a,o,p,f,m,y,v,w,I,k,P,z,B,q,H)}emplace(e,r,a,o,p,f,m,y,v,w,I,k,P,z,B,q,H,re){const K=24*e,ae=12*e,oe=48*e;return this.int16[K+0]=r,this.int16[K+1]=a,this.uint16[K+2]=o,this.uint16[K+3]=p,this.uint32[ae+2]=f,this.uint32[ae+3]=m,this.uint32[ae+4]=y,this.uint16[K+10]=v,this.uint16[K+11]=w,this.uint16[K+12]=I,this.float32[ae+7]=k,this.float32[ae+8]=P,this.uint8[oe+36]=z,this.uint8[oe+37]=B,this.uint8[oe+38]=q,this.uint32[ae+10]=H,this.int16[K+22]=re,e}}g.prototype.bytesPerElement=48,ze("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",g);class _ extends Vt{_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,r,a,o,p,f,m,y,v,w,I,k,P,z,B,q,H,re,K,ae,oe,ge,Pe,Oe,Ee,ke,Se,De){const Ie=this.length;return this.resize(Ie+1),this.emplace(Ie,e,r,a,o,p,f,m,y,v,w,I,k,P,z,B,q,H,re,K,ae,oe,ge,Pe,Oe,Ee,ke,Se,De)}emplace(e,r,a,o,p,f,m,y,v,w,I,k,P,z,B,q,H,re,K,ae,oe,ge,Pe,Oe,Ee,ke,Se,De,Ie){const ve=32*e,qe=16*e;return this.int16[ve+0]=r,this.int16[ve+1]=a,this.int16[ve+2]=o,this.int16[ve+3]=p,this.int16[ve+4]=f,this.int16[ve+5]=m,this.int16[ve+6]=y,this.int16[ve+7]=v,this.uint16[ve+8]=w,this.uint16[ve+9]=I,this.uint16[ve+10]=k,this.uint16[ve+11]=P,this.uint16[ve+12]=z,this.uint16[ve+13]=B,this.uint16[ve+14]=q,this.uint16[ve+15]=H,this.uint16[ve+16]=re,this.uint16[ve+17]=K,this.uint16[ve+18]=ae,this.uint16[ve+19]=oe,this.uint16[ve+20]=ge,this.uint16[ve+21]=Pe,this.uint16[ve+22]=Oe,this.uint32[qe+12]=Ee,this.float32[qe+13]=ke,this.float32[qe+14]=Se,this.uint16[ve+30]=De,this.uint16[ve+31]=Ie,e}}_.prototype.bytesPerElement=64,ze("StructArrayLayout8i15ui1ul2f2ui64",_);class x extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}x.prototype.bytesPerElement=4,ze("StructArrayLayout1f4",x);class b extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.uint16[6*e+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,e}}b.prototype.bytesPerElement=12,ze("StructArrayLayout1ui2f12",b);class S extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=4*e;return this.uint32[2*e+0]=r,this.uint16[p+2]=a,this.uint16[p+3]=o,e}}S.prototype.bytesPerElement=8,ze("StructArrayLayout1ul2ui8",S);class T extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.uint16[o+0]=r,this.uint16[o+1]=a,e}}T.prototype.bytesPerElement=4,ze("StructArrayLayout2ui4",T);class M extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}M.prototype.bytesPerElement=2,ze("StructArrayLayout1ui2",M);class N extends Vt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o)}emplace(e,r,a,o,p){const f=4*e;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=o,this.float32[f+3]=p,e}}N.prototype.bytesPerElement=16,ze("StructArrayLayout4f16",N);class O extends bn{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 he(this.anchorPointX,this.anchorPointY)}}O.prototype.size=20;class $ extends t{get(e){return new O(this,e)}}ze("CollisionBoxArray",$);class R extends bn{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]}}R.prototype.size=48;class Q extends g{get(e){return new R(this,e)}}ze("PlacedSymbolArray",Q);class se extends bn{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]}}se.prototype.size=64;class G extends _{get(e){return new se(this,e)}}ze("SymbolInstanceArray",G);class ee extends x{getoffsetX(e){return this.float32[1*e+0]}}ze("GlyphOffsetArray",ee);class le 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",le);class ce extends bn{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]}}ce.prototype.size=12;class me extends b{get(e){return new ce(this,e)}}ze("TextAnchorOffsetArray",me);class xe extends bn{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]}}xe.prototype.size=8;class ye extends S{get(e){return new xe(this,e)}}ze("FeatureIndexArray",ye);class be extends Ia{}class Be extends Ia{}class at extends Ia{}class Ce extends fo{}class He extends mo{}class Ne extends Yn{}class vt extends go{}class nt extends _o{}class tt extends _t{}class st extends u{}class Ut extends n{}class It extends c{}class ui extends h{}class Yt extends T{}const Gt=Rt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Gi}=Gt;class kt{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,o){let p=this.segments[this.segments.length-1];return e>kt.MAX_VERTEX_ARRAY_LENGTH&&vi(`Max vertices per segment is ${kt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!p||p.vertexLength+e>kt.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==o)&&(p={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},o!==void 0&&(p.sortKey=o),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,o){return new kt([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function wr(i,e){return 256*(i=gr(Math.floor(i),0,255))+gr(Math.floor(e),0,255)}kt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ze("SegmentVector",kt);const Sr=Rt([{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 an={exports:{}},Sn={exports:{}};Sn.exports=function(i,e){var r,a,o,p,f,m,y,v;for(a=i.length-(r=3&i.length),o=e,f=3432918353,m=461845907,v=0;v>>16)*f&65535)<<16)&4294967295)<<15|y>>>17))*m+(((y>>>16)*m&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(y=0,r){case 3:y^=(255&i.charCodeAt(v+2))<<16;case 2:y^=(255&i.charCodeAt(v+1))<<8;case 1:o^=y=(65535&(y=(y=(65535&(y^=255&i.charCodeAt(v)))*f+(((y>>>16)*f&65535)<<16)&4294967295)<<15|y>>>17))*m+(((y>>>16)*m&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var Jn=Sn.exports,mi={exports:{}};mi.exports=function(i,e){for(var r,a=i.length,o=e^a,p=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(p)|(255&i.charCodeAt(++p))<<8|(255&i.charCodeAt(++p))<<16|(255&i.charCodeAt(++p))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:o^=(255&i.charCodeAt(p+2))<<16;case 2:o^=(255&i.charCodeAt(p+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(p)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var hi=Jn,Si=mi.exports;an.exports=hi,an.exports.murmur3=hi,an.exports.murmur2=Si;var Tn=X(an.exports);class $t{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,o){this.ids.push(Jt(e)),this.positions.push(r,a,o)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Jt(e);let a=0,o=this.ids.length-1;for(;a>1;this.ids[f]>=r?o=f:a=f+1}const p=[];for(;this.ids[a]===r;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(e,r){const a=new Float64Array(e.ids),o=new Uint32Array(e.positions);return Di(a,o,0,a.length-1),r&&r.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(e){const r=new $t;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function Jt(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Tn(String(i))}function Di(i,e,r,a){for(;r>1];let p=r-1,f=a+1;for(;;){do p++;while(i[p]o);if(p>=f)break;jt(i,p,f),jt(e,3*p,3*f),jt(e,3*p+1,3*f+1),jt(e,3*p+2,3*f+2)}f-r`u_${o}`)),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new El(e,r):new fs(e,r)}}class An{constructor(e,r){this.uniformNames=r.map((a=>`u_${a}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,a,o){const p=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="u_pixel_ratio_from"?this.pixelRatioFrom:null;p&&e.set(p)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new kl(e,r):new fs(e,r)}}class Ir{constructor(e,r,a,o){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map((p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,r,a,o,p){const f=this.paintVertexArray.length,m=this.expression.evaluate(new Ct(0),r,{},o,[],p);this.paintVertexArray.resize(e),this._setPaintValue(f,e,m)}updatePaintArray(e,r,a,o){const p=this.expression.evaluate({zoom:0},a,o);this._setPaintValue(e,r,p)}_setPaintValue(e,r,a){if(this.type==="color"){const o=yo(a);for(let p=e;p`u_${m}_t`)),this.type=a,this.useIntegerZoom=o,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=r.map((m=>({name:`a_${m}`,type:"Float32",components:a==="color"?4:2,offset:0}))),this.paintVertexArray=new f}populatePaintArray(e,r,a,o,p){const f=this.expression.evaluate(new Ct(this.zoom),r,{},o,[],p),m=this.expression.evaluate(new Ct(this.zoom+1),r,{},o,[],p),y=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(y,e,f,m)}updatePaintArray(e,r,a,o){const p=this.expression.evaluate({zoom:this.zoom},a,o),f=this.expression.evaluate({zoom:this.zoom+1},a,o);this._setPaintValue(e,r,p,f)}_setPaintValue(e,r,a,o){if(this.type==="color"){const p=yo(a),f=yo(o);for(let m=e;m`#define HAS_UNIFORM_${o}`)))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof Ir||a instanceof lr)for(let o=0;o!0)){this.programConfigurations={};for(const o of e)this.programConfigurations[o.id]=new xo(o,r,a);this.needsUpload=!1,this._featureMap=new $t,this._bufferOffset=0}populatePaintArrays(e,r,a,o,p,f){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,o,p,f);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,o){for(const p of a)this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(e,this._featureMap,r,p,o)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Vm(i,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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Ih(i,e,r){const a={color:{source:Yn,composite:N},number:{source:x,composite:Yn}},o=(function(p){return{"line-pattern":{source:vt,composite:vt},"fill-pattern":{source:vt,composite:vt},"fill-extrusion-pattern":{source:vt,composite:vt}}[p]})(i);return o&&o[r]||a[e][r]}ze("ConstantBinder",Tr),ze("CrossFadedConstantBinder",An),ze("SourceExpressionBinder",Ir),ze("CrossFadedCompositeBinder",Ar),ze("CompositeExpressionBinder",lr),ze("ProgramConfiguration",xo,{omit:["_buffers"]}),ze("ProgramConfigurationSet",Nr);const Xt=8192,Ec=Math.pow(2,14)-1,Ah=-Ec-1;function Ca(i){const e=Xt/i.extent,r=i.loadGeometry();for(let a=0;af.x+1||yf.y+1)&&vi("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ka(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Ca(i):[]}}function Ml(i,e,r,a,o){i.emplaceBack(2*e+(a+1)/2,2*r+(o+1)/2)}class Mc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Be,this.indexArray=new ui,this.segments=new kt,this.programConfigurations=new Nr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){const o=this.layers[0],p=[];let f=null,m=!1;o.type==="circle"&&(f=o.layout.get("circle-sort-key"),m=!f.isConstant());for(const{feature:y,id:v,index:w,sourceLayerIndex:I}of e){const k=this.layers[0]._featureFilter.needGeometry,P=ka(y,k);if(!this.layers[0]._featureFilter.filter(new Ct(this.zoom),P,a))continue;const z=m?f.evaluate(P,{},a):void 0,B={id:v,properties:y.properties,type:y.type,sourceLayerIndex:I,index:w,geometry:k?P.geometry:Ca(y),patterns:{},sortKey:z};p.push(B)}m&&p.sort(((y,v)=>y.sortKey-v.sortKey));for(const y of p){const{geometry:v,index:w,sourceLayerIndex:I}=y,k=e[w].feature;this.addFeature(y,v,w,a),r.featureIndex.insert(k,v,w,I,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,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,Gi),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,r,a,o){for(const p of r)for(const f of p){const m=f.x,y=f.y;if(m<0||m>=Xt||y<0||y>=Xt)continue;const v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=v.vertexLength;Ml(this.layoutVertexArray,m,y,-1,-1),Ml(this.layoutVertexArray,m,y,1,-1),Ml(this.layoutVertexArray,m,y,1,1),Ml(this.layoutVertexArray,m,y,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+3,w+2),v.vertexLength+=4,v.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},o)}}function Ch(i,e){for(let r=0;r1){if(Pc(i,e))return!0;for(let a=0;a1?r:r.sub(e)._mult(o)._add(e))}function Mh(i,e){let r,a,o,p=!1;for(let f=0;fe.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(p=!p)}return p}function ms(i,e){let r=!1;for(let a=0,o=i.length-1;ae.y!=f.y>e.y&&e.x<(f.x-p.x)*(e.y-p.y)/(f.y-p.y)+p.x&&(r=!r)}return r}function qm(i,e,r){const a=r[0],o=r[2];if(i.xo.x&&e.x>o.x||i.yo.y&&e.y>o.y)return!1;const p=Vi(i,e,r[0]);return p!==Vi(i,e,r[1])||p!==Vi(i,e,r[2])||p!==Vi(i,e,r[3])}function vo(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Pl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function zl(i,e,r,a,o){if(!e[0]&&!e[1])return i;const p=he.convert(e)._mult(o);r==="viewport"&&p._rotate(-a);const f=[];for(let m=0;mLh(q,B)))})(v,y),P=I?w*m:w;for(const z of o)for(const B of z){const q=I?B:Lh(B,y);let H=P;const re=Dl([],[B.x,B.y,0,1],y);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?H*=re[3]/f.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(H*=f.cameraToCenterDistance/re[3]),Um(k,q,H))return!0}return!1}}function Lh(i,e){const r=Dl([],[i.x,i.y,0,1],e);return new he(r[0]/r[3],r[1]/r[3])}class Fh extends Mc{}let Rh;ze("HeatmapBucket",Fh,{omit:["layers"]});var Wm={get paint(){return Rh=Rh||new Zt({"heatmap-radius":new Ge(pe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ge(pe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ue(pe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ho(pe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ue(pe.paint_heatmap["heatmap-opacity"])})}};function Lc(i,{width:e,height:r},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${e*r*a}`)}else o=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=o,i}function Bh(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;const o=Lc({},{width:e,height:r},a);Fc(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=o.data}function Fc(i,e,r,a,o,p){if(o.width===0||o.height===0)return e;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||a.x>e.width-o.width||a.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const f=i.data,m=e.data;if(f===m)throw new Error("srcData equals dstData, so image is already copied");for(let y=0;y{e[i.evaluationKey]=y;const v=i.expression.evaluate(e);o.data[f+m+0]=Math.floor(255*v.r/v.a),o.data[f+m+1]=Math.floor(255*v.g/v.a),o.data[f+m+2]=Math.floor(255*v.b/v.a),o.data[f+m+3]=Math.floor(255*v.a)};if(i.clips)for(let f=0,m=0;f80*r){a=p=i[0],o=f=i[1];for(var z=r;zp&&(p=m),y>f&&(f=y);v=(v=Math.max(p-a,f-o))!==0?32767/v:0}return So(k,P,r,a,o,v,0),P}function Vh(i,e,r,a,o){var p,f;if(o===Nc(i,e,r,a)>0)for(p=e;p=e;p-=a)f=jh(p,i[p],i[p+1],f);return f&&Fl(f,f.next)&&(Io(f),f=f.next),f}function Ea(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!Fl(a,a.next)&&Ht(a.prev,a,a.next)!==0)a=a.next;else{if(Io(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function So(i,e,r,a,o,p,f){if(i){!f&&p&&(function(w,I,k,P){var z=w;do z.z===0&&(z.z=Bc(z.x,z.y,I,k,P)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==w);z.prevZ.nextZ=null,z.prevZ=null,(function(B){var q,H,re,K,ae,oe,ge,Pe,Oe=1;do{for(H=B,B=null,ae=null,oe=0;H;){for(oe++,re=H,ge=0,q=0;q0||Pe>0&&re;)ge!==0&&(Pe===0||!re||H.z<=re.z)?(K=H,H=H.nextZ,ge--):(K=re,re=re.nextZ,Pe--),ae?ae.nextZ=K:B=K,K.prevZ=ae,ae=K;H=re}ae.nextZ=null,Oe*=2}while(oe>1)})(z)})(i,a,o,p);for(var m,y,v=i;i.prev!==i.next;)if(m=i.prev,y=i.next,p?tg(i,a,o,p):eg(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(y.i/r|0),Io(i),i=y.next,v=y.next;else if((i=y)===v){f?f===1?So(i=ig(Ea(i),e,r),e,r,a,o,p,2):f===2&&rg(i,e,r,a,o,p):So(Ea(i),e,r,a,o,p,1);break}}}function eg(i){var e=i.prev,r=i,a=i.next;if(Ht(e,r,a)>=0)return!1;for(var o=e.x,p=r.x,f=a.x,m=e.y,y=r.y,v=a.y,w=op?o>f?o:f:p>f?p:f,P=m>y?m>v?m:v:y>v?y:v,z=a.next;z!==e;){if(z.x>=w&&z.x<=k&&z.y>=I&&z.y<=P&&_s(o,m,p,y,f,v,z.x,z.y)&&Ht(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function tg(i,e,r,a){var o=i.prev,p=i,f=i.next;if(Ht(o,p,f)>=0)return!1;for(var m=o.x,y=p.x,v=f.x,w=o.y,I=p.y,k=f.y,P=my?m>v?m:v:y>v?y:v,q=w>I?w>k?w:k:I>k?I:k,H=Bc(P,z,e,r,a),re=Bc(B,q,e,r,a),K=i.prevZ,ae=i.nextZ;K&&K.z>=H&&ae&&ae.z<=re;){if(K.x>=P&&K.x<=B&&K.y>=z&&K.y<=q&&K!==o&&K!==f&&_s(m,w,y,I,v,k,K.x,K.y)&&Ht(K.prev,K,K.next)>=0||(K=K.prevZ,ae.x>=P&&ae.x<=B&&ae.y>=z&&ae.y<=q&&ae!==o&&ae!==f&&_s(m,w,y,I,v,k,ae.x,ae.y)&&Ht(ae.prev,ae,ae.next)>=0))return!1;ae=ae.nextZ}for(;K&&K.z>=H;){if(K.x>=P&&K.x<=B&&K.y>=z&&K.y<=q&&K!==o&&K!==f&&_s(m,w,y,I,v,k,K.x,K.y)&&Ht(K.prev,K,K.next)>=0)return!1;K=K.prevZ}for(;ae&&ae.z<=re;){if(ae.x>=P&&ae.x<=B&&ae.y>=z&&ae.y<=q&&ae!==o&&ae!==f&&_s(m,w,y,I,v,k,ae.x,ae.y)&&Ht(ae.prev,ae,ae.next)>=0)return!1;ae=ae.nextZ}return!0}function ig(i,e,r){var a=i;do{var o=a.prev,p=a.next.next;!Fl(o,p)&&Uh(o,a,a.next,p)&&To(o,p)&&To(p,o)&&(e.push(o.i/r|0),e.push(a.i/r|0),e.push(p.i/r|0),Io(a),Io(a.next),a=i=p),a=a.next}while(a!==i);return Ea(a)}function rg(i,e,r,a,o,p){var f=i;do{for(var m=f.next.next;m!==f.prev;){if(f.i!==m.i&&lg(f,m)){var y=$h(f,m);return f=Ea(f,f.next),y=Ea(y,y.next),So(f,e,r,a,o,p,0),void So(y,e,r,a,o,p,0)}m=m.next}f=f.next}while(f!==i)}function ng(i,e){return i.x-e.x}function ag(i,e){var r=(function(o,p){var f,m=p,y=o.x,v=o.y,w=-1/0;do{if(v<=m.y&&v>=m.next.y&&m.next.y!==m.y){var I=m.x+(v-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(I<=y&&I>w&&(w=I,f=m.x=m.x&&m.x>=z&&y!==m.x&&_s(vf.x||m.x===f.x&&sg(f,m)))&&(f=m,q=k)),m=m.next;while(m!==P);return f})(i,e);if(!r)return e;var a=$h(r,i);return Ea(a,a.next),Ea(r,r.next)}function sg(i,e){return Ht(i.prev,i,e.prev)<0&&Ht(e.next,i,i.next)<0}function Bc(i,e,r,a,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function og(i){var e=i,r=i;do(e.x=(i-f)*(p-m)&&(i-f)*(a-m)>=(r-f)*(e-m)&&(r-f)*(p-m)>=(o-f)*(a-m)}function lg(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!(function(r,a){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==a.i&&o.next.i!==a.i&&Uh(o,o.next,r,a))return!0;o=o.next}while(o!==r);return!1})(i,e)&&(To(i,e)&&To(e,i)&&(function(r,a){var o=r,p=!1,f=(r.x+a.x)/2,m=(r.y+a.y)/2;do o.y>m!=o.next.y>m&&o.next.y!==o.y&&f<(o.next.x-o.x)*(m-o.y)/(o.next.y-o.y)+o.x&&(p=!p),o=o.next;while(o!==r);return p})(i,e)&&(Ht(i.prev,i,e.prev)||Ht(i,e.prev,e))||Fl(i,e)&&Ht(i.prev,i,i.next)>0&&Ht(e.prev,e,e.next)>0)}function Ht(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function Fl(i,e){return i.x===e.x&&i.y===e.y}function Uh(i,e,r,a){var o=Bl(Ht(i,e,r)),p=Bl(Ht(i,e,a)),f=Bl(Ht(r,a,i)),m=Bl(Ht(r,a,e));return o!==p&&f!==m||!(o!==0||!Rl(i,r,e))||!(p!==0||!Rl(i,a,e))||!(f!==0||!Rl(r,i,a))||!(m!==0||!Rl(r,e,a))}function Rl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Bl(i){return i>0?1:i<0?-1:0}function To(i,e){return Ht(i.prev,i,i.next)<0?Ht(i,e,i.next)>=0&&Ht(i,i.prev,e)>=0:Ht(i,e,i.prev)<0||Ht(i,i.next,e)<0}function $h(i,e){var r=new Oc(i.i,i.x,i.y),a=new Oc(e.i,e.x,e.y),o=i.next,p=e.prev;return i.next=e,e.prev=i,r.next=o,o.prev=r,a.next=r,r.prev=a,p.next=a,a.prev=p,a}function jh(i,e,r,a){var o=new Oc(i,e,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function Io(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Oc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Nc(i,e,r,a){for(var o=0,p=e,f=r-a;p0&&r.holes.push(a+=i[o-1].length)}return r};var qh=X(Rc.exports);function cg(i,e,r,a,o){Zh(i,e,r,a||i.length-1,o||ug)}function Zh(i,e,r,a,o){for(;a>r;){if(a-r>600){var p=a-r+1,f=e-r+1,m=Math.log(p),y=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*y*(p-y)/p)*(f-p/2<0?-1:1);Zh(i,e,Math.max(r,Math.floor(e-f*y/p+v)),Math.min(a,Math.floor(e+(p-f)*y/p+v)),o)}var w=i[e],I=r,k=a;for(Ao(i,r,e),o(i[a],w)>0&&Ao(i,r,a);I0;)k--}o(i[r],w)===0?Ao(i,r,k):Ao(i,++k,a),k<=e&&(r=k+1),e<=k&&(a=k-1)}}function Ao(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function ug(i,e){return ie?1:0}function Vc(i,e){const r=i.length;if(r<=1)return[i];const a=[];let o,p;for(let f=0;f1)for(let f=0;fr.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new at,this.indexArray=new ui,this.indexArray2=new Yt,this.programConfigurations=new Nr(e.layers,e.zoom),this.segments=new kt,this.segments2=new kt,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.hasPattern=Uc("fill",this.layers,r);const o=this.layers[0].layout.get("fill-sort-key"),p=!o.isConstant(),f=[];for(const{feature:m,id:y,index:v,sourceLayerIndex:w}of e){const I=this.layers[0]._featureFilter.needGeometry,k=ka(m,I);if(!this.layers[0]._featureFilter.filter(new Ct(this.zoom),k,a))continue;const P=p?o.evaluate(k,{},a,r.availableImages):void 0,z={id:y,properties:m.properties,type:m.type,sourceLayerIndex:w,index:v,geometry:I?k.geometry:Ca(m),patterns:{},sortKey:P};f.push(z)}p&&f.sort(((m,y)=>m.sortKey-y.sortKey));for(const m of f){const{geometry:y,index:v,sourceLayerIndex:w}=m;if(this.hasPattern){const I=$c("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(I)}else this.addFeature(m,y,v,a,{});r.featureIndex.insert(e[v].feature,y,v,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qm),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,r,a,o,p){for(const f of Vc(r,500)){let m=0;for(const P of f)m+=P.length;const y=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),v=y.vertexLength,w=[],I=[];for(const P of f){if(P.length===0)continue;P!==f[0]&&I.push(w.length/2);const z=this.segments2.prepareSegment(P.length,this.layoutVertexArray,this.indexArray2),B=z.vertexLength;this.layoutVertexArray.emplaceBack(P[0].x,P[0].y),this.indexArray2.emplaceBack(B+P.length-1,B),w.push(P[0].x),w.push(P[0].y);for(let q=1;q>3}if(o--,a===1||a===2)p+=i.readSVarint(),f+=i.readSVarint(),a===1&&(e&&m.push(e),e=[]),e.push(new _g(p,f));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&m.push(e),m},ys.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,o=0,p=0,f=1/0,m=-1/0,y=1/0,v=-1/0;i.pos>3}if(a--,r===1||r===2)(o+=i.readSVarint())m&&(m=o),(p+=i.readSVarint())v&&(v=p);else if(r!==7)throw new Error("unknown command "+r)}return[f,y,m,v]},ys.prototype.toGeoJSON=function(i,e,r){var a,o,p=this.extent*Math.pow(2,r),f=this.extent*i,m=this.extent*e,y=this.loadGeometry(),v=ys.types[this.type];function w(P){for(var z=0;z>3;o=f===1?a.readString():f===2?a.readFloat():f===3?a.readDouble():f===4?a.readVarint64():f===5?a.readVarint():f===6?a.readSVarint():f===7?a.readBoolean():null}return o})(r))}Kh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new vg(this._pbf,e,this.extent,this._keys,this._values)};var wg=Xh;function Sg(i,e,r){if(i===3){var a=new wg(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}Qn.VectorTile=function(i,e){this.layers=i.readFields(Sg,{},e)},Qn.VectorTileFeature=Wh,Qn.VectorTileLayer=Xh;const Tg=Qn.VectorTileFeature.types,qc=Math.pow(2,13);function Co(i,e,r,a,o,p,f,m){i.emplaceBack(e,r,2*Math.floor(a*qc)+f,o*qc*2,p*qc*2,Math.round(m))}class Zc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ce,this.centroidVertexArray=new be,this.indexArray=new ui,this.programConfigurations=new Nr(e.layers,e.zoom),this.segments=new kt,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.features=[],this.hasPattern=Uc("fill-extrusion",this.layers,r);for(const{feature:o,id:p,index:f,sourceLayerIndex:m}of e){const y=this.layers[0]._featureFilter.needGeometry,v=ka(o,y);if(!this.layers[0]._featureFilter.filter(new Ct(this.zoom),v,a))continue;const w={id:p,sourceLayerIndex:m,index:f,geometry:y?v.geometry:Ca(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push($c("fill-extrusion",this.layers,w,this.zoom,r)):this.addFeature(w,w.geometry,f,a,{}),r.featureIndex.insert(o,w.geometry,f,m,this.index,!0)}}addFeatures(e,r,a){for(const o of this.features){const{geometry:p}=o;this.addFeature(o,p,o.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,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,gg),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,mg.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,r,a,o,p){const f={x:0,y:0,vertexCount:0};for(const m of Vc(r,500)){let y=0;for(const z of m)y+=z.length;let v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const z of m){if(z.length===0||Ag(z))continue;let B=0;for(let q=0;q=1){const re=z[q-1];if(!Ig(H,re)){v.vertexLength+4>kt.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const K=H.sub(re)._perp()._unit(),ae=re.dist(H);B+ae>32768&&(B=0),Co(this.layoutVertexArray,H.x,H.y,K.x,K.y,0,0,B),Co(this.layoutVertexArray,H.x,H.y,K.x,K.y,0,1,B),f.x+=2*H.x,f.y+=2*H.y,f.vertexCount+=2,B+=ae,Co(this.layoutVertexArray,re.x,re.y,K.x,K.y,0,0,B),Co(this.layoutVertexArray,re.x,re.y,K.x,K.y,0,1,B),f.x+=2*re.x,f.y+=2*re.y,f.vertexCount+=2;const oe=v.vertexLength;this.indexArray.emplaceBack(oe,oe+2,oe+1),this.indexArray.emplaceBack(oe+1,oe+2,oe+3),v.vertexLength+=4,v.primitiveLength+=2}}}}if(v.vertexLength+y>kt.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(y,this.layoutVertexArray,this.indexArray)),Tg[e.type]!=="Polygon")continue;const w=[],I=[],k=v.vertexLength;for(const z of m)if(z.length!==0){z!==m[0]&&I.push(w.length/2);for(let B=0;BXt)||i.y===e.y&&(i.y<0||i.y>Xt)}function Ag(i){return i.every((e=>e.x<0))||i.every((e=>e.x>Xt))||i.every((e=>e.y<0))||i.every((e=>e.y>Xt))}let Yh;ze("FillExtrusionBucket",Zc,{omit:["layers","features"]});var Cg={get paint(){return Yh=Yh||new Zt({"fill-extrusion-opacity":new Ue(pe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ge(pe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ue(pe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ue(pe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ta(pe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ge(pe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ge(pe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ue(pe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class kg extends or{constructor(e){super(e,Cg)}createBucket(e){return new Zc(e)}queryRadius(){return Pl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,a,o,p,f,m,y){const v=zl(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),f.angle,m),w=this.paint.get("fill-extrusion-height").evaluate(r,a),I=this.paint.get("fill-extrusion-base").evaluate(r,a),k=(function(z,B,q,H){const re=[];for(const K of z){const ae=[K.x,K.y,0,1];Dl(ae,ae,B),re.push(new he(ae[0]/ae[3],ae[1]/ae[3]))}return re})(v,y),P=(function(z,B,q,H){const re=[],K=[],ae=H[8]*B,oe=H[9]*B,ge=H[10]*B,Pe=H[11]*B,Oe=H[8]*q,Ee=H[9]*q,ke=H[10]*q,Se=H[11]*q;for(const De of z){const Ie=[],ve=[];for(const qe of De){const Ve=qe.x,rt=qe.y,Et=H[0]*Ve+H[4]*rt+H[12],Pt=H[1]*Ve+H[5]*rt+H[13],ei=H[2]*Ve+H[6]*rt+H[14],cr=H[3]*Ve+H[7]*rt+H[15],Fi=ei+ge,Kt=cr+Pe,pi=Et+Oe,_i=Pt+Ee,Ri=ei+ke,Bi=cr+Se,ti=new he((Et+ae)/Kt,(Pt+oe)/Kt);ti.z=Fi/Kt,Ie.push(ti);const ii=new he(pi/Bi,_i/Bi);ii.z=Ri/Bi,ve.push(ii)}re.push(Ie),K.push(ve)}return[re,K]})(o,I,w,y);return(function(z,B,q){let H=1/0;kh(q,B)&&(H=Jh(q,B[0]));for(let re=0;rer.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((r=>{this.gradients[r.id]={}})),this.layoutVertexArray=new He,this.layoutVertexArray2=new Ne,this.indexArray=new ui,this.programConfigurations=new Nr(e.layers,e.zoom),this.segments=new kt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.hasPattern=Uc("line",this.layers,r);const o=this.layers[0].layout.get("line-sort-key"),p=!o.isConstant(),f=[];for(const{feature:m,id:y,index:v,sourceLayerIndex:w}of e){const I=this.layers[0]._featureFilter.needGeometry,k=ka(m,I);if(!this.layers[0]._featureFilter.filter(new Ct(this.zoom),k,a))continue;const P=p?o.evaluate(k,{},a):void 0,z={id:y,properties:m.properties,type:m.type,sourceLayerIndex:w,index:v,geometry:I?k.geometry:Ca(m),patterns:{},sortKey:P};f.push(z)}p&&f.sort(((m,y)=>m.sortKey-y.sortKey));for(const m of f){const{geometry:y,index:v,sourceLayerIndex:w}=m;if(this.hasPattern){const I=$c("line",this.layers,m,this.zoom,r);this.patternFeatures.push(I)}else this.addFeature(m,y,v,a,{});r.featureIndex.insert(e[v].feature,y,v,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,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,zg)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Mg),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,r,a,o,p){const f=this.layers[0].layout,m=f.get("line-join").evaluate(e,{}),y=f.get("line-cap"),v=f.get("line-miter-limit"),w=f.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const I of r)this.addLine(I,e,m,y,v,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,p,o)}addLine(e,r,a,o,p,f){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let H=0;H=2&&e[y-1].equals(e[y-2]);)y--;let v=0;for(;v0;if(Pe&&H>v){const Se=k.dist(P);if(Se>2*w){const De=k.sub(k.sub(P)._mult(w/Se)._round());this.updateDistance(P,De),this.addCurrentVertex(De,B,0,0,I),P=De}}const Ee=P&&z;let ke=Ee?a:m?"butt":o;if(Ee&&ke==="round"&&(oep&&(ke="bevel"),ke==="bevel"&&(oe>2&&(ke="flipbevel"),oe100)re=q.mult(-1);else{const Se=oe*B.add(q).mag()/B.sub(q).mag();re._perp()._mult(Se*(Oe?-1:1))}this.addCurrentVertex(k,re,0,0,I),this.addCurrentVertex(k,re.mult(-1),0,0,I)}else if(ke==="bevel"||ke==="fakeround"){const Se=-Math.sqrt(oe*oe-1),De=Oe?Se:0,Ie=Oe?0:Se;if(P&&this.addCurrentVertex(k,B,De,Ie,I),ke==="fakeround"){const ve=Math.round(180*ge/Math.PI/20);for(let qe=1;qe2*w){const De=k.add(z.sub(k)._mult(w/Se)._round());this.updateDistance(k,De),this.addCurrentVertex(De,q,0,0,I),k=De}}}}addCurrentVertex(e,r,a,o,p,f=!1){const m=r.y*o-r.x,y=-r.y-r.x*o;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,f,!1,a,p),this.addHalfVertex(e,m,y,f,!0,-o,p),this.distance>Qh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,o,p,f))}addHalfVertex({x:e,y:r},a,o,p,f,m,y){const v=.5*(this.lineClips?this.scaledDistance*(Qh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(r<<1)+(f?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(m===0?0:m<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const w=y.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,w),y.primitiveLength++),f?this.e2=w:this.e1=w}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let ep,tp;ze("LineBucket",Gc,{omit:["layers","patternFeatures"]});var ip={get paint(){return tp=tp||new Zt({"line-opacity":new Ge(pe.paint_line["line-opacity"]),"line-color":new Ge(pe.paint_line["line-color"]),"line-translate":new Ue(pe.paint_line["line-translate"]),"line-translate-anchor":new Ue(pe.paint_line["line-translate-anchor"]),"line-width":new Ge(pe.paint_line["line-width"]),"line-gap-width":new Ge(pe.paint_line["line-gap-width"]),"line-offset":new Ge(pe.paint_line["line-offset"]),"line-blur":new Ge(pe.paint_line["line-blur"]),"line-dasharray":new uo(pe.paint_line["line-dasharray"]),"line-pattern":new Ta(pe.paint_line["line-pattern"]),"line-gradient":new ho(pe.paint_line["line-gradient"])})},get layout(){return ep=ep||new Zt({"line-cap":new Ue(pe.layout_line["line-cap"]),"line-join":new Ge(pe.layout_line["line-join"]),"line-miter-limit":new Ue(pe.layout_line["line-miter-limit"]),"line-round-limit":new Ue(pe.layout_line["line-round-limit"]),"line-sort-key":new Ge(pe.layout_line["line-sort-key"])})}};class Fg extends Ge{possiblyEvaluate(e,r){return r=new Ct(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,o){return r=oi({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,o)}}let Ol;class Rg extends or{constructor(e){super(e,ip),this.gradientVersion=0,Ol||(Ol=new Fg(ip.paint.properties["line-width"].specification),Ol.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!(function(a){return a._styleExpression!==void 0})(r)&&r._styleExpression.expression instanceof Qr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Ol.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Gc(e)}queryRadius(e){const r=e,a=rp(vo("line-width",this,r),vo("line-gap-width",this,r)),o=vo("line-offset",this,r);return a/2+Math.abs(o)+Pl(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,a,o,p,f,m){const y=zl(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),f.angle,m),v=m/2*rp(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),w=this.paint.get("line-offset").evaluate(r,a);return w&&(o=(function(I,k){const P=[];for(let z=0;z=3){for(let q=0;q0?e+2*i:i}const Bg=Rt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Og=Rt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Rt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ng=Rt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Rt([{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 np=Rt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Vg=Rt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ug(i,e,r){return i.sections.forEach((a=>{a.text=(function(o,p,f){const m=p.layout.get("text-transform").evaluate(f,{});return m==="uppercase"?o=o.toLocaleUpperCase():m==="lowercase"&&(o=o.toLocaleLowerCase()),Zi.applyArabicShaping&&(o=Zi.applyArabicShaping(o)),o})(a.text,e,r)})),i}Rt([{name:"triangle",components:3,type:"Uint16"}]),Rt([{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"}]),Rt([{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"}]),Rt([{type:"Float32",name:"offsetX"}]),Rt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Rt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Eo={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Qt=24,ap=wt,sp=function(i,e,r,a,o){var p,f,m=8*o-a-1,y=(1<>1,w=-7,I=o-1,k=-1,P=i[e+I];for(I+=k,p=P&(1<<-w)-1,P>>=-w,w+=m;w>0;p=256*p+i[e+I],I+=k,w-=8);for(f=p&(1<<-w)-1,p>>=-w,w+=a;w>0;f=256*f+i[e+I],I+=k,w-=8);if(p===0)p=1-v;else{if(p===y)return f?NaN:1/0*(P?-1:1);f+=Math.pow(2,a),p-=v}return(P?-1:1)*f*Math.pow(2,p-a)},op=function(i,e,r,a,o,p){var f,m,y,v=8*p-o-1,w=(1<>1,k=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=0,z=1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,f=w):(f=Math.floor(Math.log(e)/Math.LN2),e*(y=Math.pow(2,-f))<1&&(f--,y*=2),(e+=f+I>=1?k/y:k*Math.pow(2,1-I))*y>=2&&(f++,y/=2),f+I>=w?(m=0,f=w):f+I>=1?(m=(e*y-1)*Math.pow(2,o),f+=I):(m=e*Math.pow(2,I-1)*Math.pow(2,o),f=0));o>=8;i[r+P]=255&m,P+=z,m/=256,o-=8);for(f=f<0;i[r+P]=255&f,P+=z,f/=256,v-=8);i[r+P-z]|=128*B};function wt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}wt.Varint=0,wt.Fixed64=1,wt.Bytes=2,wt.Fixed32=5;var Hc=4294967296,lp=1/Hc,cp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Cn(i){return i.type===wt.Bytes?i.readVarint()+i.pos:i.pos+1}function xs(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function up(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var o=r.pos-1;o>=i;o--)r.buf[o+a]=r.buf[o]}function $g(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function hp(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}wt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,p=this.pos;this.type=7&a,i(o,e,this),this.pos===p&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Nl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=hp(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Nl(this.buf,this.pos)+Nl(this.buf,this.pos+4)*Hc;return this.pos+=8,i},readSFixed64:function(){var i=Nl(this.buf,this.pos)+hp(this.buf,this.pos+4)*Hc;return this.pos+=8,i},readFloat:function(){var i=sp(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=sp(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:(function(o,p,f){var m,y,v=f.buf;if(m=(112&(y=v[f.pos++]))>>4,y<128||(m|=(127&(y=v[f.pos++]))<<3,y<128)||(m|=(127&(y=v[f.pos++]))<<10,y<128)||(m|=(127&(y=v[f.pos++]))<<17,y<128)||(m|=(127&(y=v[f.pos++]))<<24,y<128)||(m|=(1&(y=v[f.pos++]))<<31,y<128))return xs(o,m,p);throw new Error("Expected varint not more than 10 bytes")})(e|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&cp?(function(r,a,o){return cp.decode(r.subarray(a,o))})(this.buf,e,i):(function(r,a,o){for(var p="",f=a;f239?4:w>223?3:w>191?2:1;if(f+k>o)break;k===1?w<128&&(I=w):k===2?(192&(m=r[f+1]))==128&&(I=(31&w)<<6|63&m)<=127&&(I=null):k===3?(y=r[f+2],(192&(m=r[f+1]))==128&&(192&y)==128&&((I=(15&w)<<12|(63&m)<<6|63&y)<=2047||I>=55296&&I<=57343)&&(I=null)):k===4&&(y=r[f+2],v=r[f+3],(192&(m=r[f+1]))==128&&(192&y)==128&&(192&v)==128&&((I=(15&w)<<18|(63&m)<<12|(63&y)<<6|63&v)<=65535||I>=1114112)&&(I=null)),I===null?(I=65533,k=1):I>65535&&(I-=65536,p+=String.fromCharCode(I>>>10&1023|55296),I=56320|1023&I),p+=String.fromCharCode(I),f+=k}return p})(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==wt.Bytes)return i.push(this.readVarint(e));var r=Cn(this);for(i=i||[];this.pos127;);else if(e===wt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===wt.Fixed32)this.pos+=4;else{if(e!==wt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?(function(e,r){var a,o;if(e>=0?(a=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,o=o+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(p,f,m){m.buf[m.pos++]=127&p|128,p>>>=7,m.buf[m.pos++]=127&p|128,p>>>=7,m.buf[m.pos++]=127&p|128,p>>>=7,m.buf[m.pos++]=127&p|128,m.buf[m.pos]=127&(p>>>=7)})(a,0,r),(function(p,f){var m=(7&p)<<4;f.buf[f.pos++]|=m|((p>>>=3)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p)))))})(o,r)})(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=(function(a,o,p){for(var f,m,y=0;y55295&&f<57344){if(!m){f>56319||y+1===o.length?(a[p++]=239,a[p++]=191,a[p++]=189):m=f;continue}if(f<56320){a[p++]=239,a[p++]=191,a[p++]=189,m=f;continue}f=m-55296<<10|f-56320|65536,m=null}else m&&(a[p++]=239,a[p++]=191,a[p++]=189,m=null);f<128?a[p++]=f:(f<2048?a[p++]=f>>6|192:(f<65536?a[p++]=f>>12|224:(a[p++]=f>>18|240,a[p++]=f>>12&63|128),a[p++]=f>>6&63|128),a[p++]=63&f|128)}return p})(this.buf,i,this.pos);var r=this.pos-e;r>=128&&up(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),op(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),op(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&up(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,wt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,$g,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,jg,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Gg,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,qg,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Zg,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Hg,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Wg,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,Xg,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,Kg,e)},writeBytesField:function(i,e){this.writeTag(i,wt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,wt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,wt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,wt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,wt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,wt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,wt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,wt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,wt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,wt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Wc=X(ap);const Xc=3;function Yg(i,e,r){i===1&&r.readMessage(Jg,e)}function Jg(i,e,r){if(i===3){const{id:a,bitmap:o,width:p,height:f,left:m,top:y,advance:v}=r.readMessage(Qg,{});e.push({id:a,bitmap:new wo({width:p+2*Xc,height:f+2*Xc},o),metrics:{width:p,height:f,left:m,top:y,advance:v}})}}function Qg(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const pp=Xc;function dp(i){let e=0,r=0;for(const f of i)e+=f.w*f.h,r=Math.max(r,f.w);i.sort(((f,m)=>m.h-f.h));const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let o=0,p=0;for(const f of i)for(let m=a.length-1;m>=0;m--){const y=a[m];if(!(f.w>y.w||f.h>y.h)){if(f.x=y.x,f.y=y.y,p=Math.max(p,f.y+f.h),o=Math.max(o,f.x+f.w),f.w===y.w&&f.h===y.h){const v=a.pop();m=0&&a>=e&&Ul[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const a=new bs;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,r)=>Math.max(e,this.sections[r].scale)),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Po.forText(e.scale,e.fontStack||r));const a=this.sections.length-1;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Vl(i,e,r,a,o,p,f,m,y,v,w,I,k,P,z,B){const q=bs.fromFeature(i,o);let H;I===l.ai.vertical&&q.verticalizePunctuation();const{processBidirectionalText:re,processStyledBidirectionalText:K}=Zi;if(re&&q.sections.length===1){H=[];const ge=re(q.toString(),Yc(q,v,p,e,a,P,z));for(const Pe of ge){const Oe=new bs;Oe.text=Pe,Oe.sections=q.sections;for(let Ee=0;Ee0&&En>Wi&&(Wi=En)}else{const fr=Oe[ct.fontStack],Ki=fr&&fr[yi];if(Ki&&Ki.rect)Vr=Ki.rect,Cr=Ki.metrics;else{const En=Pe[ct.fontStack],Ro=En&&En[yi];if(!Ro)continue;Cr=Ro.metrics}ni=(ii-ct.scale)*Qt}kr?(ge.verticalizable=!0,Ii.push({glyph:yi,imageName:Ur,x:Et,y:Pt+ni,vertical:kr,scale:ct.scale,fontStack:ct.fontStack,sectionIndex:Ai,metrics:Cr,rect:Vr}),Et+=kn*ct.scale+qe):(Ii.push({glyph:yi,imageName:Ur,x:Et,y:Pt+ni,vertical:kr,scale:ct.scale,fontStack:ct.fontStack,sectionIndex:Ai,metrics:Cr,rect:Vr}),Et+=Cr.advance*ct.scale+qe)}Ii.length!==0&&(ei=Math.max(Et-qe,ei),i_(Ii,0,Ii.length-1,Fi,Wi)),Et=0;const Xi=Se*ii+Wi;Oi.lineOffset=Math.max(Wi,Ti),Pt+=Xi,cr=Math.max(Xi,cr),++Kt}var pi;const _i=Pt-Mo,{horizontalAlign:Ri,verticalAlign:Bi}=Jc(De);(function(ti,ii,Ti,Oi,Ii,Wi,Xi,ri,ct){const Ai=(ii-Ti)*Ii;let yi=0;yi=Wi!==Xi?-ri*Oi-Mo:(-Oi*ct+.5)*Xi;for(const ni of ti)for(const Cr of ni.positionedGlyphs)Cr.x+=Ai,Cr.y+=yi})(ge.positionedLines,Fi,Ri,Bi,ei,cr,Se,_i,ke.length),ge.top+=-Bi*_i,ge.bottom=ge.top+_i,ge.left+=-Ri*ei,ge.right=ge.left+ei})(oe,e,r,a,H,f,m,y,I,v,k,B),!(function(ge){for(const Pe of ge)if(Pe.positionedGlyphs.length!==0)return!1;return!0})(ae)&&oe}const Ul={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},e_={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 mp(i,e,r,a,o,p){if(e.imageName){const f=a[e.imageName];return f?f.displaySize[0]*e.scale*Qt/p+o:0}{const f=r[e.fontStack],m=f&&f[i];return m?m.metrics.advance*e.scale+o:0}}function gp(i,e,r,a){const o=Math.pow(i-e,2);return a?i=0;let w=0;for(let k=0;kf.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=Dc([]),this.placementViewportMatrix=Dc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=vp(this.zoom,r["text-size"]),this.iconSizeData=vp(this.zoom,r["icon-size"]);const a=this.layers[0].layout,o=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=Qc(a,"text-overlap","text-allow-overlap")!=="never"||Qc(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map((f=>l.ai[f]))),this.stateDependentLayerIds=this.layers.filter((f=>f.isStateDependent())).map((f=>f.id)),this.sourceID=e.sourceID}createArrays(){this.text=new tu(new Nr(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new tu(new Nr(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new ee,this.lineVertexArray=new le,this.symbolInstances=new G,this.textAnchorOffsets=new me}calculateGlyphDependencies(e,r,a,o,p){for(let f=0;f0)&&(f.value.kind!=="constant"||f.value.value.length>0),w=y.value.kind!=="constant"||!!y.value.value||Object.keys(y.parameters).length>0,I=p.get("symbol-sort-key");if(this.features=[],!v&&!w)return;const k=r.iconDependencies,P=r.glyphDependencies,z=r.availableImages,B=new Ct(this.zoom);for(const{feature:q,id:H,index:re,sourceLayerIndex:K}of e){const ae=o._featureFilter.needGeometry,oe=ka(q,ae);if(!o._featureFilter.filter(B,oe,a))continue;let ge,Pe;if(ae||(oe.geometry=Ca(q)),v){const Ee=o.getValueAndResolveTokens("text-field",oe,a,z),ke=fi.factory(Ee);s_(ke)&&(this.hasRTLText=!0),(!this.hasRTLText||lo()==="unavailable"||this.hasRTLText&&Zi.isParsed())&&(ge=Ug(ke,o,oe))}if(w){const Ee=o.getValueAndResolveTokens("icon-image",oe,a,z);Pe=Ee instanceof ci?Ee:ci.fromString(Ee)}if(!ge&&!Pe)continue;const Oe=this.sortFeaturesByKey?I.evaluate(oe,{},a):void 0;if(this.features.push({id:H,text:ge,icon:Pe,index:re,sourceLayerIndex:K,geometry:oe.geometry,properties:q.properties,type:n_[q.type],sortKey:Oe}),Pe&&(k[Pe.name]=!0),ge){const Ee=f.evaluate(oe,{},a).join(","),ke=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(l.ai.vertical)>=0;for(const Se of ge.sections)if(Se.image)k[Se.image.name]=!0;else{const De=eo(ge.toString()),Ie=Se.fontStack||Ee,ve=P[Ie]=P[Ie]||{};this.calculateGlyphDependencies(Se.text,ve,ke,this.allowVerticalPlacement,De)}}}p.get("symbol-placement")==="line"&&(this.features=(function(q){const H={},re={},K=[];let ae=0;function oe(Ee){K.push(q[Ee]),ae++}function ge(Ee,ke,Se){const De=re[Ee];return delete re[Ee],re[ke]=De,K[De].geometry[0].pop(),K[De].geometry[0]=K[De].geometry[0].concat(Se[0]),De}function Pe(Ee,ke,Se){const De=H[ke];return delete H[ke],H[Ee]=De,K[De].geometry[0].shift(),K[De].geometry[0]=Se[0].concat(K[De].geometry[0]),De}function Oe(Ee,ke,Se){const De=Se?ke[0][ke[0].length-1]:ke[0][0];return`${Ee}:${De.x}:${De.y}`}for(let Ee=0;EeEe.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((q,H)=>q.sortKey-H.sortKey))}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,r,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,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let o=e.dist(r[e.segment+1]),p=e.dist(r[e.segment]);const f={};for(let m=e.segment+1;m=0;m--)f[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:p},m>0&&(p+=r[m-1].dist(r[m]));for(let m=0;m0}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,r){const a=e.placedSymbolArray.get(r),o=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;po[m]-o[y]||p[y]-p[m])),f}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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 r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(((o,p,f)=>{o>=0&&f.indexOf(o)===p&&this.addIndicesForPlacedSymbol(this.text,o)})),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 bp,wp;ze("SymbolBucket",ws,{omit:["layers","collisionBoxArray","features","compareText"]}),ws.MAX_GLYPHS=65535,ws.addDynamicAttributes=eu;var ru={get paint(){return wp=wp||new Zt({"icon-opacity":new Ge(pe.paint_symbol["icon-opacity"]),"icon-color":new Ge(pe.paint_symbol["icon-color"]),"icon-halo-color":new Ge(pe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ge(pe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ge(pe.paint_symbol["icon-halo-blur"]),"icon-translate":new Ue(pe.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ue(pe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ge(pe.paint_symbol["text-opacity"]),"text-color":new Ge(pe.paint_symbol["text-color"],{runtimeType:bi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Ge(pe.paint_symbol["text-halo-color"]),"text-halo-width":new Ge(pe.paint_symbol["text-halo-width"]),"text-halo-blur":new Ge(pe.paint_symbol["text-halo-blur"]),"text-translate":new Ue(pe.paint_symbol["text-translate"]),"text-translate-anchor":new Ue(pe.paint_symbol["text-translate-anchor"])})},get layout(){return bp=bp||new Zt({"symbol-placement":new Ue(pe.layout_symbol["symbol-placement"]),"symbol-spacing":new Ue(pe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ue(pe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ge(pe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ue(pe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ue(pe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ue(pe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ue(pe.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ue(pe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ue(pe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ge(pe.layout_symbol["icon-size"]),"icon-text-fit":new Ue(pe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ue(pe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ge(pe.layout_symbol["icon-image"]),"icon-rotate":new Ge(pe.layout_symbol["icon-rotate"]),"icon-padding":new Ge(pe.layout_symbol["icon-padding"]),"icon-keep-upright":new Ue(pe.layout_symbol["icon-keep-upright"]),"icon-offset":new Ge(pe.layout_symbol["icon-offset"]),"icon-anchor":new Ge(pe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ue(pe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ue(pe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ue(pe.layout_symbol["text-rotation-alignment"]),"text-field":new Ge(pe.layout_symbol["text-field"]),"text-font":new Ge(pe.layout_symbol["text-font"]),"text-size":new Ge(pe.layout_symbol["text-size"]),"text-max-width":new Ge(pe.layout_symbol["text-max-width"]),"text-line-height":new Ue(pe.layout_symbol["text-line-height"]),"text-letter-spacing":new Ge(pe.layout_symbol["text-letter-spacing"]),"text-justify":new Ge(pe.layout_symbol["text-justify"]),"text-radial-offset":new Ge(pe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ue(pe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ge(pe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ge(pe.layout_symbol["text-anchor"]),"text-max-angle":new Ue(pe.layout_symbol["text-max-angle"]),"text-writing-mode":new Ue(pe.layout_symbol["text-writing-mode"]),"text-rotate":new Ge(pe.layout_symbol["text-rotate"]),"text-padding":new Ue(pe.layout_symbol["text-padding"]),"text-keep-upright":new Ue(pe.layout_symbol["text-keep-upright"]),"text-transform":new Ge(pe.layout_symbol["text-transform"]),"text-offset":new Ge(pe.layout_symbol["text-offset"]),"text-allow-overlap":new Ue(pe.layout_symbol["text-allow-overlap"]),"text-overlap":new Ue(pe.layout_symbol["text-overlap"]),"text-ignore-placement":new Ue(pe.layout_symbol["text-ignore-placement"]),"text-optional":new Ue(pe.layout_symbol["text-optional"])})}};class Sp{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:Dr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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",Sp,{omit:["defaultValue"]});class jl extends or{constructor(e){super(e,ru)}recalculate(e,r){if(super.recalculate(e,r),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 o=[];for(const p of a)o.indexOf(p)<0&&o.push(p);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,o){const p=this.layout.get(e).evaluate(r,{},a,o),f=this._unevaluatedLayout._values[e];return f.isDataDriven()||is(f.value)||!p?p:(function(m,y){return y.replace(/{([^{}]+)}/g,((v,w)=>m&&w in m?String(m[w]):""))})(r.properties,p)}createBucket(e){return new ws(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of ru.paint.overridableProperties){if(!jl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new Sp(r),o=new Ws(a,r.property.specification);let p=null;p=r.value.kind==="constant"||r.value.kind==="source"?new Xs("source",o):new ns("composite",o,r.value.zoomStops),this.paint._values[e]=new wi(r.property,p,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&jl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),o=ru.paint.properties[r];let p=!1;const f=m=>{for(const y of m)if(o.overrides&&o.overrides.hasOverride(y))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof fi)f(a.value.value.sections);else if(a.value.kind==="source"){const m=v=>{p||(v instanceof mn&&Dt(v.value)===U?f(v.value.sections):v instanceof ts?f(v.sections):v.eachChild(m))},y=a.value;y._styleExpression&&m(y._styleExpression.expression)}return p}}let Tp;var o_={get paint(){return Tp=Tp||new Zt({"background-color":new Ue(pe.paint_background["background-color"]),"background-pattern":new uo(pe.paint_background["background-pattern"]),"background-opacity":new Ue(pe.paint_background["background-opacity"])})}};class l_ extends or{constructor(e){super(e,o_)}}let Ip;var c_={get paint(){return Ip=Ip||new Zt({"raster-opacity":new Ue(pe.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ue(pe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ue(pe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ue(pe.paint_raster["raster-brightness-max"]),"raster-saturation":new Ue(pe.paint_raster["raster-saturation"]),"raster-contrast":new Ue(pe.paint_raster["raster-contrast"]),"raster-resampling":new Ue(pe.paint_raster["raster-resampling"]),"raster-fade-duration":new Ue(pe.paint_raster["raster-fade-duration"])})}};class u_ extends or{constructor(e){super(e,c_)}}class h_ extends or{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.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 p_{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 nu=63710088e-1;class ia{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ia(sa(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,o=e.lat*r,p=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((e.lng-this.lng)*r);return nu*Math.acos(Math.min(p,1))}static convert(e){if(e instanceof ia)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new ia(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new ia(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 Ap=2*Math.PI*nu;function Cp(i){return Ap*Math.cos(i*Math.PI/180)}function kp(i){return(180+i)/360}function Ep(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Mp(i,e){return i/Cp(e)}function Pp(i){return 360*i-180}function au(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class ql{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=ia.convert(e);return new ql(kp(a.lng),Ep(a.lat),Mp(r,a.lat))}toLngLat(){return new ia(Pp(this.x),au(this.y))}toAltitude(){return this.z*Cp(au(this.y))}meterInMercatorCoordinateUnits(){return 1/Ap*(e=au(this.y),1/Math.cos(e*Math.PI/180));var e}}function zp(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class su{constructor(e,r,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, 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=r,this.y=a,this.key=Do(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const o=(f=this.y,m=this.z,y=zp(256*(p=this.x),256*(f=Math.pow(2,m)-f-1),m),v=zp(256*(p+1),256*(f+1),m),y[0]+","+y[1]+","+v[0]+","+v[1]);var p,f,m,y,v;const w=(function(I,k,P){let z,B="";for(let q=I;q>0;q--)z=1<1?"@2x":"").replace(/{quadkey}/g,w).replace(/{bbox-epsg-3857}/g,o)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new he((e.x*r-this.x)*Xt,(e.y*r-this.y)*Xt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Dp{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Do(e,r.z,r.z,r.x,r.y)}}class dr{constructor(e,r,a,o,p){if(e= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new su(a,+o,+p),this.key=Do(r,e,a,o,p)}clone(){return new dr(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 r=this.canonical.z-e;return e>this.canonical.z?new dr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new dr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){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?Do(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Do(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new dr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new dr(r,this.wrap,r,a,o),new dr(r,this.wrap,r,a+1,o),new dr(r,this.wrap,r,a,o+1),new dr(r,this.wrap,r,a+1,o+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=I),I=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new pr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,p=r*this.dim+this.dim,f=a*this.dim,m=a*this.dim+this.dim;switch(r){case-1:o=p-1;break;case 1:p=o+1}switch(a){case-1:f=m-1;break;case 1:m=f+1}const y=-r*this.dim,v=-a*this.dim;for(let w=f;w=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 Rp{constructor(e,r,a,o,p){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=a,e._y=o,this.properties=e.properties,this.id=p}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 r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Bp{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Wn(Xt,16,0),this.grid3D=new Wn(Xt,16,0),this.featureIndexArray=new ye,this.promoteId=r}insert(e,r,a,o,p,f){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,p);const y=f?this.grid3D:this.grid;for(let v=0;v=0&&I[3]>=0&&y.insert(m,I[0],I[1],I[2],I[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Qn.VectorTile(new Wc(this.rawTileData)).layers,this.sourceLayerCoder=new Fp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,o){this.loadVTLayers();const p=e.params||{},f=Xt/e.tileSize/e.scale,m=Ys(p.filter),y=e.queryGeometry,v=e.queryPadding*f,w=Np(y),I=this.grid.query(w.minX-v,w.minY-v,w.maxX+v,w.maxY+v),k=Np(e.cameraQueryGeometry),P=this.grid3D.query(k.minX-v,k.minY-v,k.maxX+v,k.maxY+v,((q,H,re,K)=>(function(ae,oe,ge,Pe,Oe){for(const ke of ae)if(oe<=ke.x&&ge<=ke.y&&Pe>=ke.x&&Oe>=ke.y)return!0;const Ee=[new he(oe,ge),new he(oe,Oe),new he(Pe,Oe),new he(Pe,ge)];if(ae.length>2){for(const ke of Ee)if(ms(ae,ke))return!0}for(let ke=0;ke(K||(K=Ca(ae)),oe.queryIntersectsFeature(y,ae,ge,K,this.z,e.transform,f,e.pixelPosMatrix))))}return z}loadMatchingFeature(e,r,a,o,p,f,m,y,v,w,I){const k=this.bucketLayerIDs[r];if(f&&!(function(q,H){for(let re=0;re=0)return!0;return!1})(f,k))return;const P=this.sourceLayerCoder.decode(a),z=this.vtLayers[P].feature(o);if(p.needGeometry){const q=ka(z,!0);if(!p.filter(new Ct(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!p.filter(new Ct(this.tileID.overscaledZ),z))return;const B=this.getId(z,P);for(let q=0;q{const m=e instanceof ds?e.get(f):null;return m&&m.evaluate?m.evaluate(r,a,o):m}))}function Np(i){let e=1/0,r=1/0,a=-1/0,o=-1/0;for(const p of i)e=Math.min(e,p.x),r=Math.min(r,p.y),a=Math.max(a,p.x),o=Math.max(o,p.y);return{minX:e,minY:r,maxX:a,maxY:o}}function d_(i,e){return e-i}function Vp(i,e,r,a,o){const p=[];for(let f=0;f=a&&I.x>=a||(w.x>=a?w=new he(a,w.y+(a-w.x)/(I.x-w.x)*(I.y-w.y))._round():I.x>=a&&(I=new he(a,w.y+(a-w.x)/(I.x-w.x)*(I.y-w.y))._round()),w.y>=o&&I.y>=o||(w.y>=o?w=new he(w.x+(o-w.y)/(I.y-w.y)*(I.x-w.x),o)._round():I.y>=o&&(I=new he(w.x+(o-w.y)/(I.y-w.y)*(I.x-w.x),o)._round()),y&&w.equals(y[y.length-1])||(y=[w],p.push(y)),y.push(I)))))}}return p}ze("FeatureIndex",Bp,{omit:["rawTileData","sourceLayerCoder"]});class ra extends he{constructor(e,r,a,o){super(e,r),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new ra(this.x,this.y,this.angle,this.segment)}}function Up(i,e,r,a,o){if(e.segment===void 0||r===0)return!0;let p=e,f=e.segment+1,m=0;for(;m>-r/2;){if(f--,f<0)return!1;m-=i[f].dist(p),p=i[f]}m+=i[f].dist(i[f+1]),f++;const y=[];let v=0;for(;ma;)v-=y.shift().angleDelta;if(v>o)return!1;f++,m+=w.dist(I)}return!0}function $p(i){let e=0;for(let r=0;rv){const z=(v-y)/P,B=$i.number(I.x,k.x,z),q=$i.number(I.y,k.y,z),H=new ra(B,q,k.angleTo(I),w);return H._round(),!f||Up(i,H,m,f,e)?H:void 0}y+=P}}function m_(i,e,r,a,o,p,f,m,y){const v=jp(a,p,f),w=qp(a,o),I=w*f,k=i[0].x===0||i[0].x===y||i[0].y===0||i[0].y===y;return e-I=0&&ae=0&&oe=0&&k+v<=w){const ge=new ra(ae,oe,re,z);ge._round(),a&&!Up(i,ge,p,a,o)||P.push(ge)}}I+=H}return m||P.length||f||(P=Zp(i,I/2,r,a,o,p,f,!0,y)),P}ze("Anchor",ra);const Ss=Hi;function Gp(i,e,r,a){const o=[],p=i.image,f=p.pixelRatio,m=p.paddedRect.w-2*Ss,y=p.paddedRect.h-2*Ss,v=i.right-i.left,w=i.bottom-i.top,I=p.stretchX||[[0,m]],k=p.stretchY||[[0,y]],P=(Se,De)=>Se+De[1]-De[0],z=I.reduce(P,0),B=k.reduce(P,0),q=m-z,H=y-B;let re=0,K=z,ae=0,oe=B,ge=0,Pe=q,Oe=0,Ee=H;if(p.content&&a){const Se=p.content;re=Zl(I,0,Se[0]),ae=Zl(k,0,Se[1]),K=Zl(I,Se[0],Se[2]),oe=Zl(k,Se[1],Se[3]),ge=Se[0]-re,Oe=Se[1]-ae,Pe=Se[2]-Se[0]-K,Ee=Se[3]-Se[1]-oe}const ke=(Se,De,Ie,ve)=>{const qe=Gl(Se.stretch-re,K,v,i.left),Ve=Hl(Se.fixed-ge,Pe,Se.stretch,z),rt=Gl(De.stretch-ae,oe,w,i.top),Et=Hl(De.fixed-Oe,Ee,De.stretch,B),Pt=Gl(Ie.stretch-re,K,v,i.left),ei=Hl(Ie.fixed-ge,Pe,Ie.stretch,z),cr=Gl(ve.stretch-ae,oe,w,i.top),Fi=Hl(ve.fixed-Oe,Ee,ve.stretch,B),Kt=new he(qe,rt),pi=new he(Pt,rt),_i=new he(Pt,cr),Ri=new he(qe,cr),Bi=new he(Ve/f,Et/f),ti=new he(ei/f,Fi/f),ii=e*Math.PI/180;if(ii){const Ii=Math.sin(ii),Wi=Math.cos(ii),Xi=[Wi,-Ii,Ii,Wi];Kt._matMult(Xi),pi._matMult(Xi),Ri._matMult(Xi),_i._matMult(Xi)}const Ti=Se.stretch+Se.fixed,Oi=De.stretch+De.fixed;return{tl:Kt,tr:pi,bl:Ri,br:_i,tex:{x:p.paddedRect.x+Ss+Ti,y:p.paddedRect.y+Ss+Oi,w:Ie.stretch+Ie.fixed-Ti,h:ve.stretch+ve.fixed-Oi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Bi,pixelOffsetBR:ti,minFontScaleX:Pe/f/v,minFontScaleY:Ee/f/w,isSDF:r}};if(a&&(p.stretchX||p.stretchY)){const Se=Hp(I,q,z),De=Hp(k,H,B);for(let Ie=0;Ie0&&(z=Math.max(10,z),this.circleDiameter=z)}else{let I=f.top*m-y[0],k=f.bottom*m+y[2],P=f.left*m-y[3],z=f.right*m+y[1];const B=f.collisionPadding;if(B&&(P-=B[0]*m,I-=B[1]*m,z+=B[2]*m,k+=B[3]*m),w){const q=new he(P,I),H=new he(z,I),re=new he(P,k),K=new he(z,k),ae=w*Math.PI/180;q._rotate(ae),H._rotate(ae),re._rotate(ae),K._rotate(ae),P=Math.min(q.x,H.x,re.x,K.x),z=Math.max(q.x,H.x,re.x,K.x),I=Math.min(q.y,H.y,re.y,K.y),k=Math.max(q.y,H.y,re.y,K.y)}e.emplaceBack(r.x,r.y,P,I,z,k,a,o,p)}this.boxEndIndex=e.length}}class g_{constructor(e=[],r=__){if(this.data=e,this.length=this.data.length,this.compare=r,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],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,o=r[e];for(;e>0;){const p=e-1>>1,f=r[p];if(a(o,f)>=0)break;r[e]=f,e=p}r[e]=o}_down(e){const{data:r,compare:a}=this,o=this.length>>1,p=r[e];for(;e=0)break;r[e]=m,e=f}r[e]=p}}function __(i,e){return ie?1:0}function y_(i,e=1,r=!1){let a=1/0,o=1/0,p=-1/0,f=-1/0;const m=i[0];for(let P=0;Pp)&&(p=z.x),(!P||z.y>f)&&(f=z.y)}const y=Math.min(p-a,f-o);let v=y/2;const w=new g_([],x_);if(y===0)return new he(a,o);for(let P=a;PI.d||!I.d)&&(I=P,r&&console.log("found best %d after %d probes",Math.round(1e4*P.d)/1e4,k)),P.max-I.d<=e||(v=P.h/2,w.push(new Ts(P.p.x-v,P.p.y-v,v,i)),w.push(new Ts(P.p.x+v,P.p.y-v,v,i)),w.push(new Ts(P.p.x-v,P.p.y+v,v,i)),w.push(new Ts(P.p.x+v,P.p.y+v,v,i)),k+=4)}return r&&(console.log(`num probes: ${k}`),console.log(`best distance: ${I.d}`)),I.p}function x_(i,e){return e.max-i.max}function Ts(i,e,r,a){this.p=new he(i,e),this.h=r,this.d=(function(o,p){let f=!1,m=1/0;for(let y=0;yo.y!=z.y>o.y&&o.x<(z.x-P.x)*(o.y-P.y)/(z.y-P.y)+P.x&&(f=!f),m=Math.min(m,Eh(o,P,z))}}return(f?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}var gi;l.aq=void 0,(gi=l.aq||(l.aq={}))[gi.center=1]="center",gi[gi.left=2]="left",gi[gi.right=3]="right",gi[gi.top=4]="top",gi[gi.bottom=5]="bottom",gi[gi["top-left"]=6]="top-left",gi[gi["top-right"]=7]="top-right",gi[gi["bottom-left"]=8]="bottom-left",gi[gi["bottom-right"]=9]="bottom-right";const na=7,ou=Number.POSITIVE_INFINITY;function Wp(i,e){return e[1]!==ou?(function(r,a,o){let p=0,f=0;switch(a=Math.abs(a),o=Math.abs(o),r){case"top-right":case"top-left":case"top":f=o-na;break;case"bottom-right":case"bottom-left":case"bottom":f=-o+na}switch(r){case"top-right":case"bottom-right":case"right":p=-a;break;case"top-left":case"bottom-left":case"left":p=a}return[p,f]})(i,e[0],e[1]):(function(r,a){let o=0,p=0;a<0&&(a=0);const f=a/Math.SQRT2;switch(r){case"top-right":case"top-left":p=f-na;break;case"bottom-right":case"bottom-left":p=-f+na;break;case"bottom":p=-a+na;break;case"top":p=a-na}switch(r){case"top-right":case"bottom-right":o=-f;break;case"top-left":case"bottom-left":o=f;break;case"left":o=a;break;case"right":o=-a}return[o,p]})(i,e[0])}function Xp(i,e,r){var a;const o=i.layout,p=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(p){const m=p.values,y=[];for(let v=0;vk*Qt));w.startsWith("top")?I[1]-=na:w.startsWith("bottom")&&(I[1]+=na),y[v+1]=I}return new rr(y)}const f=o.get("text-variable-anchor");if(f){let m;m=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(e,{},r)*Qt,ou]:o.get("text-offset").evaluate(e,{},r).map((v=>v*Qt));const y=[];for(const v of f)y.push(v,Wp(v,m));return new rr(y)}return null}function lu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function v_(i,e,r,a,o,p,f,m,y,v,w){let I=p.textMaxSize.evaluate(e,{});I===void 0&&(I=f);const k=i.layers[0].layout,P=k.get("icon-offset").evaluate(e,{},w),z=Yp(r.horizontal),B=f/24,q=i.tilePixelRatio*B,H=i.tilePixelRatio*I/24,re=i.tilePixelRatio*m,K=i.tilePixelRatio*k.get("symbol-spacing"),ae=k.get("text-padding")*i.tilePixelRatio,oe=(function(ve,qe,Ve,rt=1){const Et=ve.get("icon-padding").evaluate(qe,{},Ve),Pt=Et&&Et.values;return[Pt[0]*rt,Pt[1]*rt,Pt[2]*rt,Pt[3]*rt]})(k,e,w,i.tilePixelRatio),ge=k.get("text-max-angle")/180*Math.PI,Pe=k.get("text-rotation-alignment")!=="viewport"&&k.get("symbol-placement")!=="point",Oe=k.get("icon-rotation-alignment")==="map"&&k.get("symbol-placement")!=="point",Ee=k.get("symbol-placement"),ke=K/2,Se=k.get("icon-text-fit");let De;a&&Se!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(De=xp(a,r.vertical,Se,k.get("icon-text-fit-padding"),P,B)),z&&(a=xp(a,z,Se,k.get("icon-text-fit-padding"),P,B)));const Ie=(ve,qe)=>{qe.x<0||qe.x>=Xt||qe.y<0||qe.y>=Xt||(function(Ve,rt,Et,Pt,ei,cr,Fi,Kt,pi,_i,Ri,Bi,ti,ii,Ti,Oi,Ii,Wi,Xi,ri,ct,Ai,yi,ni,Cr){const Vr=Ve.addToLineVertexArray(rt,Et);let Ur,kn,kr,fr,Ki=0,En=0,Ro=0,td=0,gu=-1,_u=-1;const Mn={};let id=Tn("");if(Ve.allowVerticalPlacement&&Pt.vertical){const Ci=Kt.layout.get("text-rotate").evaluate(ct,{},ni)+90;kr=new Wl(pi,rt,_i,Ri,Bi,Pt.vertical,ti,ii,Ti,Ci),Fi&&(fr=new Wl(pi,rt,_i,Ri,Bi,Fi,Ii,Wi,Ti,Ci))}if(ei){const Ci=Kt.layout.get("icon-rotate").evaluate(ct,{}),mr=Kt.layout.get("icon-text-fit")!=="none",Ma=Gp(ei,Ci,yi,mr),jr=Fi?Gp(Fi,Ci,yi,mr):void 0;kn=new Wl(pi,rt,_i,Ri,Bi,ei,Ii,Wi,!1,Ci),Ki=4*Ma.length;const Pa=Ve.iconSizeData;let on=null;Pa.kind==="source"?(on=[sn*Kt.layout.get("icon-size").evaluate(ct,{})],on[0]>ta&&vi(`${Ve.layerIds[0]}: Value for "icon-size" is >= ${zo}. Reduce your "icon-size".`)):Pa.kind==="composite"&&(on=[sn*Ai.compositeIconSizes[0].evaluate(ct,{},ni),sn*Ai.compositeIconSizes[1].evaluate(ct,{},ni)],(on[0]>ta||on[1]>ta)&&vi(`${Ve.layerIds[0]}: Value for "icon-size" is >= ${zo}. Reduce your "icon-size".`)),Ve.addSymbols(Ve.icon,Ma,on,ri,Xi,ct,l.ai.none,rt,Vr.lineStartIndex,Vr.lineLength,-1,ni),gu=Ve.icon.placedSymbolArray.length-1,jr&&(En=4*jr.length,Ve.addSymbols(Ve.icon,jr,on,ri,Xi,ct,l.ai.vertical,rt,Vr.lineStartIndex,Vr.lineLength,-1,ni),_u=Ve.icon.placedSymbolArray.length-1)}const rd=Object.keys(Pt.horizontal);for(const Ci of rd){const mr=Pt.horizontal[Ci];if(!Ur){id=Tn(mr.text);const jr=Kt.layout.get("text-rotate").evaluate(ct,{},ni);Ur=new Wl(pi,rt,_i,Ri,Bi,mr,ti,ii,Ti,jr)}const Ma=mr.positionedLines.length===1;if(Ro+=Kp(Ve,rt,mr,cr,Kt,Ti,ct,Oi,Vr,Pt.vertical?l.ai.horizontal:l.ai.horizontalOnly,Ma?rd:[Ci],Mn,gu,Ai,ni),Ma)break}Pt.vertical&&(td+=Kp(Ve,rt,Pt.vertical,cr,Kt,Ti,ct,Oi,Vr,l.ai.vertical,["vertical"],Mn,_u,Ai,ni));const S_=Ur?Ur.boxStartIndex:Ve.collisionBoxArray.length,T_=Ur?Ur.boxEndIndex:Ve.collisionBoxArray.length,I_=kr?kr.boxStartIndex:Ve.collisionBoxArray.length,A_=kr?kr.boxEndIndex:Ve.collisionBoxArray.length,C_=kn?kn.boxStartIndex:Ve.collisionBoxArray.length,k_=kn?kn.boxEndIndex:Ve.collisionBoxArray.length,E_=fr?fr.boxStartIndex:Ve.collisionBoxArray.length,M_=fr?fr.boxEndIndex:Ve.collisionBoxArray.length;let $r=-1;const Kl=(Ci,mr)=>Ci&&Ci.circleDiameter?Math.max(Ci.circleDiameter,mr):mr;$r=Kl(Ur,$r),$r=Kl(kr,$r),$r=Kl(kn,$r),$r=Kl(fr,$r);const nd=$r>-1?1:0;nd&&($r*=Cr/Qt),Ve.glyphOffsetArray.length>=ws.MAX_GLYPHS&&vi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ct.sortKey!==void 0&&Ve.addToSortKeyRanges(Ve.symbolInstances.length,ct.sortKey);const P_=Xp(Kt,ct,ni),[z_,D_]=(function(Ci,mr){const Ma=Ci.length,jr=mr==null?void 0:mr.values;if((jr==null?void 0:jr.length)>0)for(let Pa=0;Pa=0?Mn.right:-1,Mn.center>=0?Mn.center:-1,Mn.left>=0?Mn.left:-1,Mn.vertical||-1,gu,_u,id,S_,T_,I_,A_,C_,k_,E_,M_,_i,Ro,td,Ki,En,nd,0,ti,$r,z_,D_)})(i,qe,ve,r,a,o,De,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,q,[ae,ae,ae,ae],Pe,y,re,oe,Oe,P,e,p,v,w,f)};if(Ee==="line")for(const ve of Vp(e.geometry,0,0,Xt,Xt)){const qe=m_(ve,K,ge,r.vertical||z,a,24,H,i.overscaling,Xt);for(const Ve of qe)z&&b_(i,z.text,ke,Ve)||Ie(ve,Ve)}else if(Ee==="line-center"){for(const ve of e.geometry)if(ve.length>1){const qe=f_(ve,ge,r.vertical||z,a,24,H);qe&&Ie(ve,qe)}}else if(e.type==="Polygon")for(const ve of Vc(e.geometry,0)){const qe=y_(ve,16);Ie(ve[0],new ra(qe.x,qe.y,0))}else if(e.type==="LineString")for(const ve of e.geometry)Ie(ve,new ra(ve[0].x,ve[0].y,0));else if(e.type==="Point")for(const ve of e.geometry)for(const qe of ve)Ie([qe],new ra(qe.x,qe.y,0))}function Kp(i,e,r,a,o,p,f,m,y,v,w,I,k,P,z){const B=(function(re,K,ae,oe,ge,Pe,Oe,Ee){const ke=oe.layout.get("text-rotate").evaluate(Pe,{})*Math.PI/180,Se=[];for(const De of K.positionedLines)for(const Ie of De.positionedGlyphs){if(!Ie.rect)continue;const ve=Ie.rect||{};let qe=pp+1,Ve=!0,rt=1,Et=0;const Pt=(ge||Ee)&&Ie.vertical,ei=Ie.metrics.advance*Ie.scale/2;if(Ee&&K.verticalizable&&(Et=De.lineOffset/2-(Ie.imageName?-(Qt-Ie.metrics.width*Ie.scale)/2:(Ie.scale-1)*Qt)),Ie.imageName){const ri=Oe[Ie.imageName];Ve=ri.sdf,rt=ri.pixelRatio,qe=Hi/rt}const cr=ge?[Ie.x+ei,Ie.y]:[0,0];let Fi=ge?[0,0]:[Ie.x+ei+ae[0],Ie.y+ae[1]-Et],Kt=[0,0];Pt&&(Kt=Fi,Fi=[0,0]);const pi=Ie.metrics.isDoubleResolution?2:1,_i=(Ie.metrics.left-qe)*Ie.scale-ei+Fi[0],Ri=(-Ie.metrics.top-qe)*Ie.scale+Fi[1],Bi=_i+ve.w/pi*Ie.scale/rt,ti=Ri+ve.h/pi*Ie.scale/rt,ii=new he(_i,Ri),Ti=new he(Bi,Ri),Oi=new he(_i,ti),Ii=new he(Bi,ti);if(Pt){const ri=new he(-ei,ei-Mo),ct=-Math.PI/2,Ai=Qt/2-ei,yi=new he(5-Mo-Ai,-(Ie.imageName?Ai:0)),ni=new he(...Kt);ii._rotateAround(ct,ri)._add(yi)._add(ni),Ti._rotateAround(ct,ri)._add(yi)._add(ni),Oi._rotateAround(ct,ri)._add(yi)._add(ni),Ii._rotateAround(ct,ri)._add(yi)._add(ni)}if(ke){const ri=Math.sin(ke),ct=Math.cos(ke),Ai=[ct,-ri,ri,ct];ii._matMult(Ai),Ti._matMult(Ai),Oi._matMult(Ai),Ii._matMult(Ai)}const Wi=new he(0,0),Xi=new he(0,0);Se.push({tl:ii,tr:Ti,bl:Oi,br:Ii,tex:ve,writingMode:K.writingMode,glyphOffset:cr,sectionIndex:Ie.sectionIndex,isSDF:Ve,pixelOffsetTL:Wi,pixelOffsetBR:Xi,minFontScaleX:0,minFontScaleY:0})}return Se})(0,r,m,o,p,f,a,i.allowVerticalPlacement),q=i.textSizeData;let H=null;q.kind==="source"?(H=[sn*o.layout.get("text-size").evaluate(f,{})],H[0]>ta&&vi(`${i.layerIds[0]}: Value for "text-size" is >= ${zo}. Reduce your "text-size".`)):q.kind==="composite"&&(H=[sn*P.compositeTextSizes[0].evaluate(f,{},z),sn*P.compositeTextSizes[1].evaluate(f,{},z)],(H[0]>ta||H[1]>ta)&&vi(`${i.layerIds[0]}: Value for "text-size" is >= ${zo}. Reduce your "text-size".`)),i.addSymbols(i.text,B,H,m,p,f,v,e,y.lineStartIndex,y.lineLength,k,z);for(const re of w)I[re]=i.text.placedSymbolArray.length-1;return 4*B.length}function Yp(i){for(const e in i)return i[e];return null}function b_(i,e,r,a){const o=i.compareText;if(e in o){const p=o[e];for(let f=p.length-1;f>=0;f--)if(a.dist(p[f])>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);const p=Jp[15&a];if(!p)throw new Error("Unrecognized array type.");const[f]=new Uint16Array(e,2,1),[m]=new Uint32Array(e,4,1);return new cu(m,f,p,e)}constructor(e,r=64,a=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=Jp.indexOf(this.ArrayType),f=2*e*this.ArrayType.BYTES_PER_ELEMENT,m=e*this.IndexArrayType.BYTES_PER_ELEMENT,y=(8-m%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+y,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+f+m+y),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+y,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return uu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:f,nodeSize:m}=this,y=[0,p.length-1,0],v=[];for(;y.length;){const w=y.pop()||0,I=y.pop()||0,k=y.pop()||0;if(I-k<=m){for(let q=k;q<=I;q++){const H=f[2*q],re=f[2*q+1];H>=e&&H<=a&&re>=r&&re<=o&&v.push(p[q])}continue}const P=k+I>>1,z=f[2*P],B=f[2*P+1];z>=e&&z<=a&&B>=r&&B<=o&&v.push(p[P]),(w===0?e<=z:r<=B)&&(y.push(k),y.push(P-1),y.push(1-w)),(w===0?a>=z:o>=B)&&(y.push(P+1),y.push(I),y.push(1-w))}return v}within(e,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:p,nodeSize:f}=this,m=[0,o.length-1,0],y=[],v=a*a;for(;m.length;){const w=m.pop()||0,I=m.pop()||0,k=m.pop()||0;if(I-k<=f){for(let q=k;q<=I;q++)ed(p[2*q],p[2*q+1],e,r)<=v&&y.push(o[q]);continue}const P=k+I>>1,z=p[2*P],B=p[2*P+1];ed(z,B,e,r)<=v&&y.push(o[P]),(w===0?e-a<=z:r-a<=B)&&(m.push(k),m.push(P-1),m.push(1-w)),(w===0?e+a>=z:r+a>=B)&&(m.push(P+1),m.push(I),m.push(1-w))}return y}}function uu(i,e,r,a,o,p){if(o-a<=r)return;const f=a+o>>1;Qp(i,e,f,a,o,p),uu(i,e,r,a,f-1,1-p),uu(i,e,r,f+1,o,1-p)}function Qp(i,e,r,a,o,p){for(;o>a;){if(o-a>600){const v=o-a+1,w=r-a+1,I=Math.log(v),k=.5*Math.exp(2*I/3),P=.5*Math.sqrt(I*k*(v-k)/v)*(w-v/2<0?-1:1);Qp(i,e,r,Math.max(a,Math.floor(r-w*k/v+P)),Math.min(o,Math.floor(r+(v-w)*k/v+P)),p)}const f=e[2*r+p];let m=a,y=o;for(Lo(i,e,a,r),e[2*o+p]>f&&Lo(i,e,a,o);mf;)y--}e[2*a+p]===f?Lo(i,e,a,y):(y++,Lo(i,e,y,o)),y<=r&&(a=y+1),r<=y&&(o=y-1)}}function Lo(i,e,r,a){hu(i,r,a),hu(e,2*r,2*a),hu(e,2*r+1,2*a+1)}function hu(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function ed(i,e,r,a){const o=i-r,p=e-a;return o*o+p*p}var pu;l.bh=void 0,(pu=l.bh||(l.bh={})).create="create",pu.load="load",pu.fullLoad="fullLoad";let Xl=null,Fo=[];const du=1e3/60,fu="loadTime",mu="fullLoadTime",w_={mark(i){performance.mark(i)},frame(i){const e=i;Xl!=null&&Fo.push(e-Xl),Xl=e},clearMetrics(){Xl=null,Fo=[],performance.clearMeasures(fu),performance.clearMeasures(mu);for(const i in l.bh)performance.clearMarks(l.bh[i])},getPerformanceMetrics(){performance.measure(fu,l.bh.create,l.bh.load),performance.measure(mu,l.bh.create,l.bh.fullLoad);const i=performance.getEntriesByName(fu)[0].duration,e=performance.getEntriesByName(mu)[0].duration,r=Fo.length,a=1/(Fo.reduce(((p,f)=>p+f),0)/r/1e3),o=Fo.filter((p=>p>du)).reduce(((p,f)=>p+(f-du)/du),0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};l.$=function(i,e,r){var a,o,p,f,m,y,v,w,I,k,P,z,B=r[0],q=r[1],H=r[2];return e===i?(i[12]=e[0]*B+e[4]*q+e[8]*H+e[12],i[13]=e[1]*B+e[5]*q+e[9]*H+e[13],i[14]=e[2]*B+e[6]*q+e[10]*H+e[14],i[15]=e[3]*B+e[7]*q+e[11]*H+e[15]):(o=e[1],p=e[2],f=e[3],m=e[4],y=e[5],v=e[6],w=e[7],I=e[8],k=e[9],P=e[10],z=e[11],i[0]=a=e[0],i[1]=o,i[2]=p,i[3]=f,i[4]=m,i[5]=y,i[6]=v,i[7]=w,i[8]=I,i[9]=k,i[10]=P,i[11]=z,i[12]=a*B+m*q+I*H+e[12],i[13]=o*B+y*q+k*H+e[13],i[14]=p*B+v*q+P*H+e[14],i[15]=f*B+w*q+z*H+e[15]),i},l.A=gs,l.B=$i,l.C=class{constructor(i,e,r){this.receive=a=>{const o=a.data,p=o.id;if(p&&(!o.targetMapId||this.mapId===o.targetMapId))if(o.type===""){delete this.tasks[p];const f=this.cancelCallbacks[p];delete this.cancelCallbacks[p],f&&f()}else Qi()||o.mustQueue?(this.tasks[p]=o,this.taskQueue.push(p),this.invoker.trigger()):this.processTask(p,o)},this.process=()=>{if(!this.taskQueue.length)return;const a=this.taskQueue.shift(),o=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(a,o)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new p_(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Qi()?i:window}send(i,e,r,a,o=!1){const p=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[p]=r);const f=[],m={id:p,type:i,hasCallback:!!r,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:rn(e,f)};return this.target.postMessage(m,{transfer:f}),{cancel:()=>{r&&delete this.callbacks[p],this.target.postMessage({id:p,type:"",targetMapId:a,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Xn(e.error)):r(null,Xn(e.data)))}else{let r=!1;const a=[],o=e.hasCallback?(m,y)=>{r=!0,delete this.cancelCallbacks[i];const v={id:i,type:"",sourceMapId:this.mapId,error:m?rn(m):null,data:rn(y,a)};this.target.postMessage(v,{transfer:a})}:m=>{r=!0};let p=null;const f=Xn(e.data);if(this.parent[e.type])p=this.parent[e.type](e.sourceMapId,f,o);else if("getWorkerSource"in this.parent){const m=e.type.split(".");p=this.parent.getWorkerSource(e.sourceMapId,m[0],f.source)[m[1]](f,o)}else o(new Error(`Could not find function ${e.type}`));!r&&p&&p.cancel&&(this.cancelCallbacks[i]=p.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},l.D=Ue,l.E=pn,l.F=function(i,e){const r={};for(let a=0;a{}}},l.Y=Te,l.Z=function(){var i=new gs(16);return gs!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},l._=ue,l.a=oa,l.a$=class extends M{},l.a0=function(i,e,r){var a=r[0],o=r[1],p=r[2];return i[0]=e[0]*a,i[1]=e[1]*a,i[2]=e[2]*a,i[3]=e[3]*a,i[4]=e[4]*o,i[5]=e[5]*o,i[6]=e[6]*o,i[7]=e[7]*o,i[8]=e[8]*p,i[9]=e[9]*p,i[10]=e[10]*p,i[11]=e[11]*p,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},l.a1=Dh,l.a2=function(){return Ba++},l.a3=$,l.a4=ws,l.a5=function(){Zi.isLoading()||Zi.isLoaded()||lo()!=="deferred"||Sl()},l.a6=Ys,l.a7=ka,l.a8=Ct,l.a9=Rp,l.aA=wa,l.aB=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r{a[f.source]?r.push({command:ft.removeLayer,args:[f.id]}):p.push(f)})),r=r.concat(o),(function(f,m,y){m=m||[];const v=(f=f||[]).map(Kr),w=m.map(Kr),I=f.reduce(dn,{}),k=m.reduce(dn,{}),P=v.slice(),z=Object.create(null);let B,q,H,re,K,ae,oe;for(B=0,q=0;B@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((r,a,o,p)=>{const f=o||p;return e[a]=!f||f.toLowerCase(),""})),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},l.ab=function(i,e){const r=[];for(const a in i)a in e||r.push(a);return r},l.ac=function(i){if(cn==null){const e=i.navigator?i.navigator.userAgent:null;cn=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return cn},l.ad=gr,l.ae=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),p=e[0],f=e[1],m=e[2],y=e[3],v=e[4],w=e[5],I=e[6],k=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=p*o+v*a,i[1]=f*o+w*a,i[2]=m*o+I*a,i[3]=y*o+k*a,i[4]=v*o-p*a,i[5]=w*o-f*a,i[6]=I*o-m*a,i[7]=k*o-y*a,i},l.af=function(i){var e=new gs(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},l.ag=Dl,l.ah=function(i,e){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:o,minZoom:p,maxZoom:f}=i,m=o?gr(ji.interpolationFactor(o,e,p,f),0,1):0;i.kind==="camera"?a=$i.number(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:a}},l.aj=function(i,{uSize:e,uSizeT:r},{lowerSize:a,upperSize:o}){return i.kind==="source"?a/sn:i.kind==="composite"?$i.number(a/sn,o/sn,r):e},l.ak=eu,l.al=function(i,e,r,a){const o=e.y-i.y,p=e.x-i.x,f=a.y-r.y,m=a.x-r.x,y=f*p-m*o;if(y===0)return null;const v=(m*(i.y-r.y)-f*(i.x-r.x))/y;return new he(i.x+v*p,i.y+v*o)},l.am=Vp,l.an=Ch,l.ao=Dc,l.ap=Qt,l.ar=Qc,l.as=function(i,e){var r=e[0],a=e[1],o=e[2],p=e[3],f=e[4],m=e[5],y=e[6],v=e[7],w=e[8],I=e[9],k=e[10],P=e[11],z=e[12],B=e[13],q=e[14],H=e[15],re=r*m-a*f,K=r*y-o*f,ae=r*v-p*f,oe=a*y-o*m,ge=a*v-p*m,Pe=o*v-p*y,Oe=w*B-I*z,Ee=w*q-k*z,ke=w*H-P*z,Se=I*q-k*B,De=I*H-P*B,Ie=k*H-P*q,ve=re*Ie-K*De+ae*Se+oe*ke-ge*Ee+Pe*Oe;return ve?(i[0]=(m*Ie-y*De+v*Se)*(ve=1/ve),i[1]=(o*De-a*Ie-p*Se)*ve,i[2]=(B*Pe-q*ge+H*oe)*ve,i[3]=(k*ge-I*Pe-P*oe)*ve,i[4]=(y*ke-f*Ie-v*Ee)*ve,i[5]=(r*Ie-o*ke+p*Ee)*ve,i[6]=(q*ae-z*Pe-H*K)*ve,i[7]=(w*Pe-k*ae+P*K)*ve,i[8]=(f*De-m*ke+v*Oe)*ve,i[9]=(a*ke-r*De-p*Oe)*ve,i[10]=(z*ge-B*ae+H*re)*ve,i[11]=(I*ae-w*ge-P*re)*ve,i[12]=(m*Ee-f*Se-y*Oe)*ve,i[13]=(r*Se-a*Ee+o*Oe)*ve,i[14]=(B*K-z*oe-q*re)*ve,i[15]=(w*oe-I*K+k*re)*ve,i):null},l.at=lu,l.au=Jc,l.av=cu,l.aw=function(){const i={},e=pe.$version;for(const r in pe.$root){const a=pe.$root[r];if(a.required){let o=null;o=r==="version"?e:a.type==="array"?[]:{},o!=null&&(i[r]=o)}}return i},l.ax=ft,l.ay=xl,l.az=hr,l.b=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).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.`))}))},l.b0=ui,l.b1=function(i,e){var r=i[0],a=i[1],o=i[2],p=i[3],f=i[4],m=i[5],y=i[6],v=i[7],w=i[8],I=i[9],k=i[10],P=i[11],z=i[12],B=i[13],q=i[14],H=i[15],re=e[0],K=e[1],ae=e[2],oe=e[3],ge=e[4],Pe=e[5],Oe=e[6],Ee=e[7],ke=e[8],Se=e[9],De=e[10],Ie=e[11],ve=e[12],qe=e[13],Ve=e[14],rt=e[15];return Math.abs(r-re)<=Li*Math.max(1,Math.abs(r),Math.abs(re))&&Math.abs(a-K)<=Li*Math.max(1,Math.abs(a),Math.abs(K))&&Math.abs(o-ae)<=Li*Math.max(1,Math.abs(o),Math.abs(ae))&&Math.abs(p-oe)<=Li*Math.max(1,Math.abs(p),Math.abs(oe))&&Math.abs(f-ge)<=Li*Math.max(1,Math.abs(f),Math.abs(ge))&&Math.abs(m-Pe)<=Li*Math.max(1,Math.abs(m),Math.abs(Pe))&&Math.abs(y-Oe)<=Li*Math.max(1,Math.abs(y),Math.abs(Oe))&&Math.abs(v-Ee)<=Li*Math.max(1,Math.abs(v),Math.abs(Ee))&&Math.abs(w-ke)<=Li*Math.max(1,Math.abs(w),Math.abs(ke))&&Math.abs(I-Se)<=Li*Math.max(1,Math.abs(I),Math.abs(Se))&&Math.abs(k-De)<=Li*Math.max(1,Math.abs(k),Math.abs(De))&&Math.abs(P-Ie)<=Li*Math.max(1,Math.abs(P),Math.abs(Ie))&&Math.abs(z-ve)<=Li*Math.max(1,Math.abs(z),Math.abs(ve))&&Math.abs(B-qe)<=Li*Math.max(1,Math.abs(B),Math.abs(qe))&&Math.abs(q-Ve)<=Li*Math.max(1,Math.abs(q),Math.abs(Ve))&&Math.abs(H-rt)<=Li*Math.max(1,Math.abs(H),Math.abs(rt))},l.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},l.b3=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},l.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},l.b5=sa,l.b6=Dp,l.b7=Mp,l.b8=function(i,e,r,a,o){var p,f=1/Math.tan(e/2);return i[0]=f/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,o!=null&&o!==1/0?(i[10]=(o+a)*(p=1/(a-o)),i[14]=2*o*a*p):(i[10]=-1,i[14]=-2*a),i},l.b9=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),p=e[4],f=e[5],m=e[6],y=e[7],v=e[8],w=e[9],I=e[10],k=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=p*o+v*a,i[5]=f*o+w*a,i[6]=m*o+I*a,i[7]=y*o+k*a,i[8]=v*o-p*a,i[9]=w*o-f*a,i[10]=I*o-m*a,i[11]=k*o-y*a,i},l.bA=Le,l.bB=ap,l.bC=rs,l.bD=Zi,l.ba=Er,l.bb=Ji,l.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},l.bd=class extends Aa{},l.be=nu,l.bf=Pp,l.bg=w_,l.bi=Gr,l.bj=function(i,e,r=!1){if(zi===ro||zi===no||zi===ao)throw new Error("setRTLTextPlugin cannot be called multiple times.");nn=Ln.resolveURL(i),zi=ro,so=e,oo(),r||Sl()},l.bk=lo,l.bl=function(i,e){const r={};for(let o=0;ove*Qt))}let Ee=f?"center":r.get("text-justify").evaluate(v,{},i.canonical);const ke=r.get("symbol-placement"),Se=ke==="point"?r.get("text-max-width").evaluate(v,{},i.canonical)*Qt:0,De=()=>{i.bucket.allowVerticalPlacement&&eo(ae)&&(z.vertical=Vl(B,i.glyphMap,i.glyphPositions,i.imagePositions,w,Se,p,Pe,"left",ge,H,l.ai.vertical,!0,ke,k,I))};if(!f&&Oe){const Ie=new Set;if(Ee==="auto")for(let qe=0;qe{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>{r.src=Oa}))},r.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(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(a):Oa},l.e=oi,l.f=function(i,e){return Hr(oi(i,{type:"json"}),e)},l.g=er,l.h=Ln,l.i=Qi,l.j=Xr,l.k=Wr,l.l=ua,l.m=Hr,l.n=function(i){return new Wc(i).readFields(Yg,[])},l.o=function(i,e,r){if(!i.length)return r(null,[]);let a=i.length;const o=new Array(i.length);let p=null;i.forEach(((f,m)=>{e(f,((y,v)=>{y&&(p=y),o[m]=v,--a==0&&r(p,o)}))}))},l.p=dp,l.q=wo,l.r=Zt,l.s=Pr,l.t=Tc,l.u=Me,l.v=pe,l.w=vi,l.x=us,l.y=Br,l.z=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}}})),te(["./shared"],(function(l){class ue{constructor(C){this.keyCache={},C&&this.replace(C)}replace(C){this._layerConfigs={},this._layers={},this.update(C,[])}update(C,E){for(const j of C){this._layerConfigs[j.id]=j;const Z=this._layers[j.id]=l.aC(j);Z._featureFilter=l.a6(Z.filter),this.keyCache[j.id]&&delete this.keyCache[j.id]}for(const j of E)delete this.keyCache[j],delete this._layerConfigs[j],delete this._layers[j];this.familiesBySource={};const L=l.bl(Object.values(this._layerConfigs),this.keyCache);for(const j of L){const Z=j.map((fe=>this._layers[fe.id])),ne=Z[0];if(ne.visibility==="none")continue;const J=ne.source||"";let W=this.familiesBySource[J];W||(W=this.familiesBySource[J]={});const ie=ne.sourceLayer||"_geojsonTileLayer";let de=W[ie];de||(de=W[ie]=[]),de.push(Z)}}}class X{constructor(C){const E={},L=[];for(const J in C){const W=C[J],ie=E[J]={};for(const de in W){const fe=W[+de];if(!fe||fe.bitmap.width===0||fe.bitmap.height===0)continue;const _e={x:0,y:0,w:fe.bitmap.width+2,h:fe.bitmap.height+2};L.push(_e),ie[de]={rect:_e,metrics:fe.metrics}}}const{w:j,h:Z}=l.p(L),ne=new l.q({width:j||1,height:Z||1});for(const J in C){const W=C[J];for(const ie in W){const de=W[+ie];if(!de||de.bitmap.width===0||de.bitmap.height===0)continue;const fe=E[J][ie].rect;l.q.copy(de.bitmap,ne,{x:0,y:0},{x:fe.x+1,y:fe.y+1},de.bitmap)}}this.image=ne,this.positions=E}}l.bm("GlyphAtlas",X);class Le{constructor(C){this.tileID=new l.O(C.tileID.overscaledZ,C.tileID.wrap,C.tileID.canonical.z,C.tileID.canonical.x,C.tileID.canonical.y),this.uid=C.uid,this.zoom=C.zoom,this.pixelRatio=C.pixelRatio,this.tileSize=C.tileSize,this.source=C.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=C.showCollisionBoxes,this.collectResourceTiming=!!C.collectResourceTiming,this.returnDependencies=!!C.returnDependencies,this.promoteId=C.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(C,E,L,j,Z){this.status="parsing",this.data=C,this.collisionBoxArray=new l.a3;const ne=new l.bn(Object.keys(C.layers).sort()),J=new l.bo(this.tileID,this.promoteId);J.bucketLayerIDs=[];const W={},ie={featureIndex:J,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:L},de=E.familiesBySource[this.source];for(const dt in de){const pt=C.layers[dt];if(!pt)continue;pt.version===1&&l.w(`Vector tile source "${this.source}" layer "${dt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const di=ne.encode(dt),Tt=[];for(let Wt=0;Wt=li.maxzoom||li.visibility!=="none"&&(we(Wt,this.zoom,L),(W[li.id]=li.createBucket({index:J.bucketLayerIDs.length,layers:Wt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:di,sourceID:this.source})).populate(Tt,ie,this.tileID.canonical),J.bucketLayerIDs.push(Wt.map((ir=>ir.id))))}}let fe,_e,je,Xe;const Re=l.aH(ie.glyphDependencies,(dt=>Object.keys(dt).map(Number)));this.inFlightDependencies.forEach((dt=>dt==null?void 0:dt.cancel())),this.inFlightDependencies=[];const Ze=++this.dependencySentinel;Object.keys(Re).length?this.inFlightDependencies.push(j.send("getGlyphs",{uid:this.uid,stacks:Re,source:this.source,tileID:this.tileID,type:"glyphs"},((dt,pt)=>{Ze===this.dependencySentinel&&(fe||(fe=dt,_e=pt,bt.call(this)))}))):_e={};const Je=Object.keys(ie.iconDependencies);Je.length?this.inFlightDependencies.push(j.send("getImages",{icons:Je,source:this.source,tileID:this.tileID,type:"icons"},((dt,pt)=>{Ze===this.dependencySentinel&&(fe||(fe=dt,je=pt,bt.call(this)))}))):je={};const yt=Object.keys(ie.patternDependencies);function bt(){if(fe)return Z(fe);if(_e&&je&&Xe){const dt=new X(_e),pt=new l.bp(je,Xe);for(const di in W){const Tt=W[di];Tt instanceof l.a4?(we(Tt.layers,this.zoom,L),l.bq({bucket:Tt,glyphMap:_e,glyphPositions:dt.positions,imageMap:je,imagePositions:pt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Tt.hasPattern&&(Tt instanceof l.br||Tt instanceof l.bs||Tt instanceof l.bt)&&(we(Tt.layers,this.zoom,L),Tt.addFeatures(ie,this.tileID.canonical,pt.patternPositions))}this.status="done",Z(null,{buckets:Object.values(W).filter((di=>!di.isEmpty())),featureIndex:J,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:dt.image,imageAtlas:pt,glyphMap:this.returnDependencies?_e:null,iconMap:this.returnDependencies?je:null,glyphPositions:this.returnDependencies?dt.positions:null})}}yt.length?this.inFlightDependencies.push(j.send("getImages",{icons:yt,source:this.source,tileID:this.tileID,type:"patterns"},((dt,pt)=>{Ze===this.dependencySentinel&&(fe||(fe=dt,Xe=pt,bt.call(this)))}))):Xe={},bt.call(this)}}function we(U,C,E){const L=new l.a8(C);for(const j of U)j.recalculate(L,E)}function he(U,C){const E=l.l(U.request,((L,j,Z,ne)=>{if(L)C(L);else if(j)try{const J=new l.bw.VectorTile(new l.bv(j));C(null,{vectorTile:J,rawData:j,cacheControl:Z,expires:ne})}catch(J){const W=new Uint8Array(j);let ie=`Unable to parse the tile at ${U.request.url}, `;ie+=W[0]===31&&W[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${J.messge}`,C(new Error(ie))}}));return()=>{E.cancel(),C()}}class Fe{constructor(C,E,L,j){this.actor=C,this.layerIndex=E,this.availableImages=L,this.loadVectorData=j||he,this.fetching={},this.loading={},this.loaded={}}loadTile(C,E){const L=C.uid;this.loading||(this.loading={});const j=!!(C&&C.request&&C.request.collectResourceTiming)&&new l.bu(C.request),Z=this.loading[L]=new Le(C);Z.abort=this.loadVectorData(C,((ne,J)=>{if(delete this.loading[L],ne||!J)return Z.status="done",this.loaded[L]=Z,E(ne);const W=J.rawData,ie={};J.expires&&(ie.expires=J.expires),J.cacheControl&&(ie.cacheControl=J.cacheControl);const de={};if(j){const fe=j.finish();fe&&(de.resourceTiming=JSON.parse(JSON.stringify(fe)))}Z.vectorTile=J.vectorTile,Z.parse(J.vectorTile,this.layerIndex,this.availableImages,this.actor,((fe,_e)=>{if(delete this.fetching[L],fe||!_e)return E(fe);E(null,l.e({rawTileData:W.slice(0)},_e,ie,de))})),this.loaded=this.loaded||{},this.loaded[L]=Z,this.fetching[L]={rawTileData:W,cacheControl:ie,resourceTiming:de}}))}reloadTile(C,E){const L=this.loaded,j=C.uid;if(L&&L[j]){const Z=L[j];Z.showCollisionBoxes=C.showCollisionBoxes,Z.status==="parsing"?Z.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,((ne,J)=>{if(ne||!J)return E(ne,J);let W;if(this.fetching[j]){const{rawTileData:ie,cacheControl:de,resourceTiming:fe}=this.fetching[j];delete this.fetching[j],W=l.e({rawTileData:ie.slice(0)},J,de,fe)}else W=J;E(null,W)})):Z.status==="done"&&(Z.vectorTile?Z.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,E):E())}}abortTile(C,E){const L=this.loading,j=C.uid;L&&L[j]&&L[j].abort&&(L[j].abort(),delete L[j]),E()}removeTile(C,E){const L=this.loaded,j=C.uid;L&&L[j]&&delete L[j],E()}}class Ke{constructor(){this.loaded={}}loadTile(C,E){return l._(this,void 0,void 0,(function*(){const{uid:L,encoding:j,rawImageData:Z,redFactor:ne,greenFactor:J,blueFactor:W,baseShift:ie}=C,de=Z.width+2,fe=Z.height+2,_e=l.a(Z)?new l.R({width:de,height:fe},yield l.bx(Z,-1,-1,de,fe)):Z,je=new l.by(L,_e,j,ne,J,W,ie);this.loaded=this.loaded||{},this.loaded[L]=je,E(null,je)}))}removeTile(C){const E=this.loaded,L=C.uid;E&&E[L]&&delete E[L]}}function ot(U,C){if(U.length!==0){Qe(U[0],C);for(var E=1;E=Math.abs(J)?E-W+J:J-W+E,E=W}E+L>=0!=!!C&&U.reverse()}var lt=l.bz((function U(C,E){var L,j=C&&C.type;if(j==="FeatureCollection")for(L=0;L>31}function Qi(U,C){for(var E=U.loadGeometry(),L=U.type,j=0,Z=0,ne=E.length,J=0;JU},la=Math.fround||(_r=new Float32Array(1),U=>(_r[0]=+U,_r[0]));var _r;const At=3,Ei=5,un=6;class Ln{constructor(C){this.options=Object.assign(Object.create(Oa),C),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(C){const{log:E,minZoom:L,maxZoom:j}=this.options;E&&console.time("total time");const Z=`prepare ${C.length} points`;E&&console.time(Z),this.points=C;const ne=[];for(let W=0;W=L;W--){const ie=+Date.now();J=this.trees[W]=this._createTree(this._cluster(J,W)),E&&console.log("z%d: %d clusters in %dms",W,J.numItems,+Date.now()-ie)}return E&&console.timeEnd("total time"),this}getClusters(C,E){let L=((C[0]+180)%360+360)%360-180;const j=Math.max(-90,Math.min(90,C[1]));let Z=C[2]===180?180:((C[2]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,C[3]));if(C[2]-C[0]>=360)L=-180,Z=180;else if(L>Z){const fe=this.getClusters([L,j,180,ne],E),_e=this.getClusters([-180,j,Z,ne],E);return fe.concat(_e)}const J=this.trees[this._limitZoom(E)],W=J.range(hr(L),er(ne),hr(Z),er(j)),ie=J.data,de=[];for(const fe of W){const _e=this.stride*fe;de.push(ie[_e+Ei]>1?Fn(ie,_e,this.clusterProps):this.points[ie[_e+At]])}return de}getChildren(C){const E=this._getOriginId(C),L=this._getOriginZoom(C),j="No cluster with the specified id.",Z=this.trees[L];if(!Z)throw new Error(j);const ne=Z.data;if(E*this.stride>=ne.length)throw new Error(j);const J=this.options.radius/(this.options.extent*Math.pow(2,L-1)),W=Z.within(ne[E*this.stride],ne[E*this.stride+1],J),ie=[];for(const de of W){const fe=de*this.stride;ne[fe+4]===C&&ie.push(ne[fe+Ei]>1?Fn(ne,fe,this.clusterProps):this.points[ne[fe+At]])}if(ie.length===0)throw new Error(j);return ie}getLeaves(C,E,L){const j=[];return this._appendLeaves(j,C,E=E||10,L=L||0,0),j}getTile(C,E,L){const j=this.trees[this._limitZoom(C)],Z=Math.pow(2,C),{extent:ne,radius:J}=this.options,W=J/ne,ie=(L-W)/Z,de=(L+1+W)/Z,fe={features:[]};return this._addTileFeatures(j.range((E-W)/Z,ie,(E+1+W)/Z,de),j.data,E,L,Z,fe),E===0&&this._addTileFeatures(j.range(1-W/Z,ie,1,de),j.data,Z,L,Z,fe),E===Z-1&&this._addTileFeatures(j.range(0,ie,W/Z,de),j.data,-1,L,Z,fe),fe.features.length?fe:null}getClusterExpansionZoom(C){let E=this._getOriginZoom(C)-1;for(;E<=this.options.maxZoom;){const L=this.getChildren(C);if(E++,L.length!==1)break;C=L[0].properties.cluster_id}return E}_appendLeaves(C,E,L,j,Z){const ne=this.getChildren(E);for(const J of ne){const W=J.properties;if(W&&W.cluster?Z+W.point_count<=j?Z+=W.point_count:Z=this._appendLeaves(C,W.cluster_id,L,j,Z):Z1;let de,fe,_e;if(ie)de=Gr(E,W,this.clusterProps),fe=E[W],_e=E[W+1];else{const Re=this.points[E[W+At]];de=Re.properties;const[Ze,Je]=Re.geometry.coordinates;fe=hr(Ze),_e=er(Je)}const je={type:1,geometry:[[Math.round(this.options.extent*(fe*Z-L)),Math.round(this.options.extent*(_e*Z-j))]],tags:de};let Xe;Xe=ie||this.options.generateId?E[W+At]:this.points[E[W+At]].id,Xe!==void 0&&(je.id=Xe),ne.features.push(je)}}_limitZoom(C){return Math.max(this.options.minZoom,Math.min(Math.floor(+C),this.options.maxZoom+1))}_cluster(C,E){const{radius:L,extent:j,reduce:Z,minPoints:ne}=this.options,J=L/(j*Math.pow(2,E)),W=C.data,ie=[],de=this.stride;for(let fe=0;feE&&(Ze+=W[yt+Ei])}if(Ze>Re&&Ze>=ne){let Je,yt=_e*Re,bt=je*Re,dt=-1;const pt=((fe/de|0)<<5)+(E+1)+this.points.length;for(const di of Xe){const Tt=di*de;if(W[Tt+2]<=E)continue;W[Tt+2]=E;const Wt=W[Tt+Ei];yt+=W[Tt]*Wt,bt+=W[Tt+1]*Wt,W[Tt+4]=pt,Z&&(Je||(Je=this._map(W,fe,!0),dt=this.clusterProps.length,this.clusterProps.push(Je)),Z(Je,this._map(W,Tt)))}W[fe+4]=pt,ie.push(yt/Ze,bt/Ze,1/0,pt,-1,Ze),Z&&ie.push(dt)}else{for(let Je=0;Je1)for(const Je of Xe){const yt=Je*de;if(!(W[yt+2]<=E)){W[yt+2]=E;for(let bt=0;bt>5}_getOriginZoom(C){return(C-this.points.length)%32}_map(C,E,L){if(C[E+Ei]>1){const ne=this.clusterProps[C[E+un]];return L?Object.assign({},ne):ne}const j=this.points[C[E+At]].properties,Z=this.options.map(j);return L&&Z===j?Object.assign({},Z):Z}}function Fn(U,C,E){return{type:"Feature",id:U[C+At],properties:Gr(U,C,E),geometry:{type:"Point",coordinates:[(L=U[C],360*(L-.5)),ca(U[C+1])]}};var L}function Gr(U,C,E){const L=U[C+Ei],j=L>=1e4?`${Math.round(L/1e3)}k`:L>=1e3?Math.round(L/100)/10+"k":L,Z=U[C+un],ne=Z===-1?{}:Object.assign({},E[Z]);return Object.assign(ne,{cluster:!0,cluster_id:U[C+At],point_count:L,point_count_abbreviated:j})}function hr(U){return U/360+.5}function er(U){const C=Math.sin(U*Math.PI/180),E=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return E<0?0:E>1?1:E}function ca(U){const C=(180-360*U)*Math.PI/180;return 360*Math.atan(Math.exp(C))/Math.PI-90}function Hr(U,C,E,L){for(var j,Z=L,ne=E-C>>1,J=E-C,W=U[C],ie=U[C+1],de=U[E],fe=U[E+1],_e=C+3;_eZ)j=_e,Z=je;else if(je===Z){var Xe=Math.abs(_e-ne);XeL&&(j-C>3&&Hr(U,C,j,L),U[j+2]=Z,E-j>3&&Hr(U,j,E,L))}function ua(U,C,E,L,j,Z){var ne=j-E,J=Z-L;if(ne!==0||J!==0){var W=((U-E)*ne+(C-L)*J)/(ne*ne+J*J);W>1?(E=j,L=Z):W>0&&(E+=ne*W,L+=J*W)}return(ne=U-E)*ne+(J=C-L)*J}function Pr(U,C,E,L){var j={id:U===void 0?null:U,type:C,geometry:E,tags:L,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(Z){var ne=Z.geometry,J=Z.type;if(J==="Point"||J==="MultiPoint"||J==="LineString")Rn(Z,ne);else if(J==="Polygon"||J==="MultiLineString")for(var W=0;W0&&(ne+=L?(j*ie-W*Z)/2:Math.sqrt(Math.pow(W-j,2)+Math.pow(ie-Z,2))),j=W,Z=ie}var de=C.length-3;C[2]=1,Hr(C,0,de,E),C[de+2]=1,C.size=Math.abs(ne),C.start=0,C.end=C.size}function pn(U,C,E,L){for(var j=0;j1?1:E}function tr(U,C,E,L,j,Z,ne,J){if(L/=C,Z>=(E/=C)&&ne=L)return null;for(var W=[],ie=0;ie=E&&Xe=L)){var Re=[];if(_e==="Point"||_e==="MultiPoint")St(fe,Re,E,L,j);else if(_e==="LineString")ft(fe,Re,E,L,j,!1,J.lineMetrics);else if(_e==="MultiLineString")Bn(fe,Re,E,L,j,!1);else if(_e==="Polygon")Bn(fe,Re,E,L,j,!0);else if(_e==="MultiPolygon")for(var Ze=0;Ze=E&&ne<=L&&(C.push(U[Z]),C.push(U[Z+1]),C.push(U[Z+2]))}}function ft(U,C,E,L,j,Z,ne){for(var J,W,ie=yr(U),de=j===0?Na:On,fe=U.start,_e=0;_eE&&(W=de(ie,je,Xe,Ze,Je,E),ne&&(ie.start=fe+J*W)):yt>L?bt=E&&(W=de(ie,je,Xe,Ze,Je,E),dt=!0),bt>L&&yt<=L&&(W=de(ie,je,Xe,Ze,Je,L),dt=!0),!Z&&dt&&(ne&&(ie.end=fe+J*W),C.push(ie),ie=yr(U)),ne&&(fe+=J)}var pt=U.length-3;je=U[pt],Xe=U[pt+1],Re=U[pt+2],(yt=j===0?je:Xe)>=E&&yt<=L&&zr(ie,je,Xe,Re),pt=ie.length-3,Z&&pt>=3&&(ie[pt]!==ie[0]||ie[pt+1]!==ie[1])&&zr(ie,ie[0],ie[1],ie[2]),ie.length&&C.push(ie)}function yr(U){var C=[];return C.size=U.size,C.start=U.start,C.end=U.end,C}function Bn(U,C,E,L,j,Z){for(var ne=0;nene.maxX&&(ne.maxX=de),fe>ne.maxY&&(ne.maxY=fe)}return ne}function fn(U,C,E,L){var j=C.geometry,Z=C.type,ne=[];if(Z==="Point"||Z==="MultiPoint")for(var J=0;J0&&C.size<(j?ne:L))E.numPoints+=C.length/3;else{for(var J=[],W=0;Wne)&&(E.numSimplified++,J.push(C[W]),J.push(C[W+1])),E.numPoints++;j&&(function(ie,de){for(var fe=0,_e=0,je=ie.length,Xe=je-2;_e0===de)for(_e=0,je=ie.length;_e24)throw new Error("maxZoom should be in the 0-24 range");if(C.promoteId&&C.generateId)throw new Error("promoteId and generateId cannot be used together.");var L=(function(j,Z){var ne=[];if(j.type==="FeatureCollection")for(var J=0;J1&&console.time("creation"),_e=this.tiles[fe]=Bt(U,C,E,L,W),this.tileCoords.push({z:C,x:E,y:L}),ie)){ie>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",C,E,L,_e.numFeatures,_e.numPoints,_e.numSimplified),console.timeEnd("creation"));var je="z"+C;this.stats[je]=(this.stats[je]||0)+1,this.total++}if(_e.source=U,j){if(C===W.maxZoom||C===j)continue;var Xe=1<1&&console.time("clipping");var Re,Ze,Je,yt,bt,dt,pt=.5*W.buffer/W.extent,di=.5-pt,Tt=.5+pt,Wt=1+pt;Re=Ze=Je=yt=null,bt=tr(U,de,E-pt,E+Tt,0,_e.minX,_e.maxX,W),dt=tr(U,de,E+di,E+Wt,0,_e.minX,_e.maxX,W),U=null,bt&&(Re=tr(bt,de,L-pt,L+Tt,1,_e.minY,_e.maxY,W),Ze=tr(bt,de,L+di,L+Wt,1,_e.minY,_e.maxY,W),bt=null),dt&&(Je=tr(dt,de,L-pt,L+Tt,1,_e.minY,_e.maxY,W),yt=tr(dt,de,L+di,L+Wt,1,_e.minY,_e.maxY,W),dt=null),ie>1&&console.timeEnd("clipping"),J.push(Re||[],C+1,2*E,2*L),J.push(Ze||[],C+1,2*E,2*L+1),J.push(Je||[],C+1,2*E+1,2*L),J.push(yt||[],C+1,2*E+1,2*L+1)}}},Ae.prototype.getTile=function(U,C,E){var L=this.options,j=L.extent,Z=L.debug;if(U<0||U>24)return null;var ne=1<1&&console.log("drilling down to z%d-%d-%d",U,C,E);for(var W,ie=U,de=C,fe=E;!W&&ie>0;)ie--,de=Math.floor(de/2),fe=Math.floor(fe/2),W=this.tiles[it(ie,de,fe)];return W&&W.source?(Z>1&&console.log("found parent tile z%d-%d-%d",ie,de,fe),Z>1&&console.time("drilling down"),this.splitTile(W.source,ie,de,fe,U,C,E),Z>1&&console.timeEnd("drilling down"),this.tiles[J]?Te(this.tiles[J],j):null):null};class et extends Fe{constructor(C,E,L,j){super(C,E,L),this._dataUpdateable=new Map,this.loadGeoJSON=(Z,ne)=>{const{promoteId:J}=Z;if(Z.request)return l.f(Z.request,((W,ie,de,fe)=>{this._dataUpdateable=bi(ie,J)?vr(ie,J):void 0,ne(W,ie,de,fe)}));if(typeof Z.data=="string")try{const W=JSON.parse(Z.data);this._dataUpdateable=bi(W,J)?vr(W,J):void 0,ne(null,W)}catch{ne(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`))}else Z.dataDiff?this._dataUpdateable?((function(W,ie,de){var fe,_e,je,Xe;if(ie.removeAll&&W.clear(),ie.remove)for(const Re of ie.remove)W.delete(Re);if(ie.add)for(const Re of ie.add){const Ze=Ye(Re,de);Ze!=null&&W.set(Ze,Re)}if(ie.update)for(const Re of ie.update){let Ze=W.get(Re.id);if(Ze==null)continue;const Je=!Re.removeAllProperties&&(((fe=Re.removeProperties)===null||fe===void 0?void 0:fe.length)>0||((_e=Re.addOrUpdateProperties)===null||_e===void 0?void 0:_e.length)>0);if((Re.newGeometry||Re.removeAllProperties||Je)&&(Ze=Object.assign({},Ze),W.set(Re.id,Ze),Je&&(Ze.properties=Object.assign({},Ze.properties))),Re.newGeometry&&(Ze.geometry=Re.newGeometry),Re.removeAllProperties)Ze.properties={};else if(((je=Re.removeProperties)===null||je===void 0?void 0:je.length)>0)for(const yt of Re.removeProperties)Object.prototype.hasOwnProperty.call(Ze.properties,yt)&&delete Ze.properties[yt];if(((Xe=Re.addOrUpdateProperties)===null||Xe===void 0?void 0:Xe.length)>0)for(const{key:yt,value:bt}of Re.addOrUpdateProperties)Ze.properties[yt]=bt}})(this._dataUpdateable,Z.dataDiff,J),ne(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ne(new Error(`Cannot update existing geojson data in ${Z.source}`)):ne(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,j&&(this.loadGeoJSON=j)}loadGeoJSONTile(C,E){const L=C.tileID.canonical;if(!this._geoJSONIndex)return E(null,null);const j=this._geoJSONIndex.getTile(L.z,L.x,L.y);if(!j)return E(null,null);const Z=new class{constructor(J){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.N,this.length=J.length,this._features=J}feature(J){return new class{constructor(W){this._feature=W,this.extent=l.N,this.type=W.type,this.properties=W.tags,"id"in W&&!isNaN(W.id)&&(this.id=parseInt(W.id,10))}loadGeometry(){if(this._feature.type===1){const W=[];for(const ie of this._feature.geometry)W.push([new l.P(ie[0],ie[1])]);return W}{const W=[];for(const ie of this._feature.geometry){const de=[];for(const fe of ie)de.push(new l.P(fe[0],fe[1]));W.push(de)}return W}}toGeoJSON(W,ie,de){return $e.call(this,W,ie,de)}}(this._features[J])}}(j.features);let ne=oa(Z);ne.byteOffset===0&&ne.byteLength===ne.buffer.byteLength||(ne=new Uint8Array(ne)),E(null,{vectorTile:Z,rawData:ne.buffer})}loadData(C,E){var L;(L=this._pendingRequest)===null||L===void 0||L.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const j=!!(C&&C.request&&C.request.collectResourceTiming)&&new l.bu(C.request);this._pendingCallback=E,this._pendingRequest=this.loadGeoJSON(C,((Z,ne)=>{if(delete this._pendingCallback,delete this._pendingRequest,Z||!ne)return E(Z);if(typeof ne!="object")return E(new Error(`Input data given to '${C.source}' is not a valid GeoJSON object.`));{lt(ne,!0);try{if(C.filter){const W=l.bC(C.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(W.result==="error")throw new Error(W.value.map((de=>`${de.key}: ${de.message}`)).join(", "));ne={type:"FeatureCollection",features:ne.features.filter((de=>W.value.evaluate({zoom:0},de)))}}this._geoJSONIndex=C.cluster?new Ln((function({superclusterOptions:W,clusterProperties:ie}){if(!ie||!W)return W;const de={},fe={},_e={accumulated:null,zoom:0},je={properties:null},Xe=Object.keys(ie);for(const Re of Xe){const[Ze,Je]=ie[Re],yt=l.bC(Je),bt=l.bC(typeof Ze=="string"?[Ze,["accumulated"],["get",Re]]:Ze);de[Re]=yt.value,fe[Re]=bt.value}return W.map=Re=>{je.properties=Re;const Ze={};for(const Je of Xe)Ze[Je]=de[Je].evaluate(_e,je);return Ze},W.reduce=(Re,Ze)=>{je.properties=Ze;for(const Je of Xe)_e.accumulated=Re[Je],Re[Je]=fe[Je].evaluate(_e,je)},W})(C)).load(ne.features):(function(W,ie){return new Ae(W,ie)})(ne,C.geojsonVtOptions)}catch(W){return E(W)}this.loaded={};const J={};if(j){const W=j.finish();W&&(J.resourceTiming={},J.resourceTiming[C.source]=JSON.parse(JSON.stringify(W)))}E(null,J)}}))}reloadTile(C,E){const L=this.loaded;return L&&L[C.uid]?super.reloadTile(C,E):this.loadTile(C,E)}removeSource(C,E){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),E()}getClusterExpansionZoom(C,E){try{E(null,this._geoJSONIndex.getClusterExpansionZoom(C.clusterId))}catch(L){E(L)}}getClusterChildren(C,E){try{E(null,this._geoJSONIndex.getChildren(C.clusterId))}catch(L){E(L)}}getClusterLeaves(C,E){try{E(null,this._geoJSONIndex.getLeaves(C.clusterId,C.limit,C.offset))}catch(L){E(L)}}}class Lr{constructor(C){this.self=C,this.actor=new l.C(C,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Fe,geojson:et},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(E,L)=>{if(this.workerSourceTypes[E])throw new Error(`Worker source with name "${E}" already registered.`);this.workerSourceTypes[E]=L},this.self.registerRTLTextPlugin=E=>{if(l.bD.isParsed())throw new Error("RTL text plugin already registered.");l.bD.applyArabicShaping=E.applyArabicShaping,l.bD.processBidirectionalText=E.processBidirectionalText,l.bD.processStyledBidirectionalText=E.processStyledBidirectionalText}}setReferrer(C,E){this.referrer=E}setImages(C,E,L){this.availableImages[C]=E;for(const j in this.workerSources[C]){const Z=this.workerSources[C][j];for(const ne in Z)Z[ne].availableImages=E}L()}setLayers(C,E,L){this.getLayerIndex(C).replace(E),L()}updateLayers(C,E,L){this.getLayerIndex(C).update(E.layers,E.removedIds),L()}loadTile(C,E,L){this.getWorkerSource(C,E.type,E.source).loadTile(E,L)}loadDEMTile(C,E,L){this.getDEMWorkerSource(C,E.source).loadTile(E,L)}reloadTile(C,E,L){this.getWorkerSource(C,E.type,E.source).reloadTile(E,L)}abortTile(C,E,L){this.getWorkerSource(C,E.type,E.source).abortTile(E,L)}removeTile(C,E,L){this.getWorkerSource(C,E.type,E.source).removeTile(E,L)}removeDEMTile(C,E){this.getDEMWorkerSource(C,E.source).removeTile(E)}removeSource(C,E,L){if(!this.workerSources[C]||!this.workerSources[C][E.type]||!this.workerSources[C][E.type][E.source])return;const j=this.workerSources[C][E.type][E.source];delete this.workerSources[C][E.type][E.source],j.removeSource!==void 0?j.removeSource(E,L):L()}loadWorkerSource(C,E,L){try{this.self.importScripts(E.url),L()}catch(j){L(j.toString())}}syncRTLPluginState(C,E,L){try{l.bD.setState(E);const j=l.bD.getPluginURL();if(l.bD.isLoaded()&&!l.bD.isParsed()&&j!=null){this.self.importScripts(j);const Z=l.bD.isParsed();L(Z?void 0:new Error(`RTL Text Plugin failed to import scripts from ${j}`),Z)}}catch(j){L(j.toString())}}getAvailableImages(C){let E=this.availableImages[C];return E||(E=[]),E}getLayerIndex(C){let E=this.layerIndexes[C];return E||(E=this.layerIndexes[C]=new ue),E}getWorkerSource(C,E,L){return this.workerSources[C]||(this.workerSources[C]={}),this.workerSources[C][E]||(this.workerSources[C][E]={}),this.workerSources[C][E][L]||(this.workerSources[C][E][L]=new this.workerSourceTypes[E]({send:(j,Z,ne)=>{this.actor.send(j,Z,ne,C)}},this.getLayerIndex(C),this.getAvailableImages(C))),this.workerSources[C][E][L]}getDEMWorkerSource(C,E){return this.demWorkerSources[C]||(this.demWorkerSources[C]={}),this.demWorkerSources[C][E]||(this.demWorkerSources[C][E]=new Ke),this.demWorkerSources[C][E]}}return l.i()&&(self.worker=new Lr(self)),Lr})),te(["./shared"],(function(l){var ue="3.6.2";class X{static testProp(t){if(!X.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",X.suppressClickInternal,!0)}),0)}static mousePos(t,n){const s=t.getBoundingClientRect();return new l.P(n.clientX-s.left-t.clientLeft,n.clientY-s.top-t.clientTop)}static touchPos(t,n){const s=t.getBoundingClientRect(),c=[];for(let h=0;h{t=[],n=0,s=0,c={}},u.addThrottleControl=b=>{const S=s++;return c[S]=b,S},u.removeThrottleControl=b=>{delete c[b],_()},u.getImage=(b,S,T=!0)=>{Le.supported&&(b.headers||(b.headers={}),b.headers.accept="image/webp,*/*");const M={requestParameters:b,supportImageRefresh:T,callback:S,cancelled:!1,completed:!1,cancel:()=>{M.completed||M.cancelled||(M.cancelled=!0,M.innerRequest&&(M.innerRequest.cancel(),n--),_())}};return t.push(M),_(),M};const h=b=>{const{requestParameters:S,supportImageRefresh:T,callback:M}=b;return l.e(S,{type:"image"}),(T!==!1||l.i()||l.g(S.url)||S.headers&&!Object.keys(S.headers).reduce(((N,O)=>N&&O==="accept"),!0)?l.m:x)(S,((N,O,$,R)=>{g(b,M,N,O,$,R)}))},g=(b,S,T,M,N,O)=>{T?S(T):M instanceof HTMLImageElement||l.a(M)?S(null,M):M&&(($,R)=>{typeof createImageBitmap=="function"?l.b($,R):l.d($,R)})(M,(($,R)=>{$!=null?S($):R!=null&&S(null,R,{cacheControl:N,expires:O})})),b.cancelled||(b.completed=!0,n--,_())},_=()=>{const b=(()=>{const S=Object.keys(c);let T=!1;if(S.length>0){for(const M of S)if(T=c[M](),T)break}return T})()?l.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:l.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let S=n;S0;S++){const T=t.shift();if(T.cancelled){S--;continue}const M=h(T);n++,T.innerRequest=M}},x=(b,S)=>{const T=new Image,M=b.url;let N=!1;const O=b.credentials;return O&&O==="include"?T.crossOrigin="use-credentials":(O&&O==="same-origin"||!l.s(M))&&(T.crossOrigin="anonymous"),T.fetchPriority="high",T.onload=()=>{S(null,T),T.onerror=T.onload=null},T.onerror=()=>{N||S(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.")),T.onerror=T.onload=null},T.src=M,{cancel:()=>{N=!0,T.src=""}}}})(Qe||(Qe={})),Qe.resetRequestQueue(),(function(u){u.Glyphs="Glyphs",u.Image="Image",u.Source="Source",u.SpriteImage="SpriteImage",u.SpriteJSON="SpriteJSON",u.Style="Style",u.Tile="Tile",u.Unknown="Unknown"})(lt||(lt={}));class $e{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){const c=(function(h){const g=h.match(qt);if(!g)throw new Error(`Unable to parse URL "${h}"`);return{protocol:g[1],authority:g[2],path:g[3]||"/",params:g[4]?g[4].split("&"):[]}})(t);return c.path+=`${n}${s}`,(function(h){const g=h.params.length?`?${h.params.join("&")}`:"";return`${h.protocol}://${h.authority}${h.path}${g}`})(c)}setTransformRequest(t){this._transformRequestFn=t}}const qt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Er(u){var t=new l.A(3);return t[0]=u[0],t[1]=u[1],t[2]=u[2],t}var Ji,gr=function(u,t,n){return u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2],u};Ji=new l.A(3),l.A!=Float32Array&&(Ji[0]=0,Ji[1]=0,Ji[2]=0);var sa=function(u){var t=u[0],n=u[1];return t*t+n*n};function oi(u){const t=[];if(typeof u=="string")t.push({id:"default",url:u});else if(u&&u.length>0){const n=[];for(const{id:s,url:c}of u){const h=`${s}${c}`;n.indexOf(h)===-1&&(n.push(h),t.push({id:s,url:c}))}}return t}function Ba(u,t,n,s,c){if(s)return void u(s);if(c!==Object.values(t).length||c!==Object.values(n).length)return;const h={};for(const g in t){h[g]={};const _=l.h.getImageCanvasContext(n[g]),x=t[g];for(const b in x){const{width:S,height:T,x:M,y:N,sdf:O,pixelRatio:$,stretchX:R,stretchY:Q,content:se}=x[b];h[g][b]={data:null,pixelRatio:$,sdf:O,stretchX:R,stretchY:Q,content:se,spriteData:{width:S,height:T,x:M,y:N,context:_}}}}u(null,h)}(function(){var u=new l.A(2);l.A!=Float32Array&&(u[0]=0,u[1]=0)})();class zt{constructor(t,n,s,c){this.context=t,this.format=s,this.texture=t.gl.createTexture(),this.update(n,c)}update(t,n,s){const{width:c,height:h}=t,g=!(this.size&&this.size[0]===c&&this.size[1]===h||s),{context:_}=this,{gl:x}=_;if(this.useMipmap=!!(n&&n.useMipmap),x.bindTexture(x.TEXTURE_2D,this.texture),_.pixelStoreUnpackFlipY.set(!1),_.pixelStoreUnpack.set(1),_.pixelStoreUnpackPremultiplyAlpha.set(this.format===x.RGBA&&(!n||n.premultiply!==!1)),g)this.size=[c,h],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.a(t)?x.texImage2D(x.TEXTURE_2D,0,this.format,this.format,x.UNSIGNED_BYTE,t):x.texImage2D(x.TEXTURE_2D,0,this.format,c,h,0,this.format,x.UNSIGNED_BYTE,t.data);else{const{x:b,y:S}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.a(t)?x.texSubImage2D(x.TEXTURE_2D,0,b,S,x.RGBA,x.UNSIGNED_BYTE,t):x.texSubImage2D(x.TEXTURE_2D,0,b,S,c,h,x.RGBA,x.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&x.generateMipmap(x.TEXTURE_2D)}bind(t,n,s){const{context:c}=this,{gl:h}=c;h.bindTexture(h.TEXTURE_2D,this.texture),s!==h.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=h.LINEAR),t!==this.filter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,n),this.wrap=n)}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 Dn(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class ur extends l.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.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:n,callback:s}of this.requestors)this._notify(n,s);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const s=n.spriteData;n.data=new l.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let s=!0;const c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,n){if(!t)return!0;let s=0;for(const c of t){if(c[0]-1);x++,h[x]=_,g[x]=b,g[x+1]=Zr}for(let _=0,x=0;_{let _=this.entries[c];_||(_=this.entries[c]={glyphs:{},requests:{},ranges:{}});let x=_.glyphs[h];if(x!==void 0)return void g(null,{stack:c,id:h,glyph:x});if(x=this._tinySDF(_,c,h),x)return _.glyphs[h]=x,void g(null,{stack:c,id:h,glyph:x});const b=Math.floor(h/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(_.ranges[b])return void g(null,{stack:c,id:h,glyph:x});if(!this.url)return void g(new Error("glyphsUrl is not set"));let S=_.requests[b];S||(S=_.requests[b]=[],Mr.loadGlyphRange(c,b,this.url,this.requestManager,((T,M)=>{if(M){for(const N in M)this._doesCharSupportLocalGlyph(+N)||(_.glyphs[+N]=M[+N]);_.ranges[b]=!0}for(const N of S)N(T,M);delete _.requests[b]}))),S.push(((T,M)=>{T?g(T):M&&g(null,{stack:c,id:h,glyph:M[h]||null})}))}),((c,h)=>{if(c)n(c);else if(h){const g={};for(const{stack:_,id:x,glyph:b}of h)(g[_]||(g[_]={}))[x]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics};n(null,g)}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(l.u["CJK Unified Ideographs"](t)||l.u["Hangul Syllables"](t)||l.u.Hiragana(t)||l.u.Katakana(t))}_tinySDF(t,n,s){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(s))return;let h=t.tinySDF;if(!h){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),h=t.tinySDF=new Mr.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:c,fontWeight:_})}const g=h.draw(String.fromCharCode(s));return{id:s,bitmap:new l.q({width:g.width||60,height:g.height||60},g.data),metrics:{width:g.glyphWidth/2||24,height:g.glyphHeight/2||24,left:g.glyphLeft/2+.5||0,top:g.glyphTop/2-27.5||-8,advance:g.glyphAdvance/2||24,isDoubleResolution:!0}}}}Mr.loadGlyphRange=function(u,t,n,s,c){const h=256*t,g=h+255,_=s.transformRequest(n.replace("{fontstack}",u).replace("{range}",`${h}-${g}`),lt.Glyphs);l.l(_,((x,b)=>{if(x)c(x);else if(b){const S={};for(const T of l.n(b))S[T.id]=T;c(null,S)}}))},Mr.TinySDF=class{constructor({fontSize:u=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:c="sans-serif",fontWeight:h="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;const _=this.size=u+4*t,x=this._createCanvas(_),b=this.ctx=x.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${h} ${u}px ${c}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(u){const t=document.createElement("canvas");return t.width=t.height=u,t}draw(u){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:c,actualBoundingBoxRight:h}=this.ctx.measureText(u),g=Math.ceil(n),_=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(h-c))),x=Math.min(this.size-this.buffer,g+Math.ceil(s)),b=_+2*this.buffer,S=x+2*this.buffer,T=Math.max(b*S,0),M=new Uint8ClampedArray(T),N={data:M,width:b,height:S,glyphWidth:_,glyphHeight:x,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(_===0||x===0)return N;const{ctx:O,buffer:$,gridInner:R,gridOuter:Q}=this;O.clearRect($,$,_,x),O.fillText(u,$,$+g);const se=O.getImageData($,$,_,x);Q.fill(Zr,0,T),R.fill(0,0,T);for(let G=0;G0?me*me:0,R[ce]=me<0?me*me:0}}vi(Q,0,0,b,S,b,this.f,this.v,this.z),vi(R,$,$,_,x,b,this.f,this.v,this.z);for(let G=0;G1&&(x=t[++_]);const S=Math.abs(b-x.left),T=Math.abs(b-x.right),M=Math.min(S,T);let N;const O=h/s*(c+1);if(x.isDash){const $=c-Math.abs(O);N=Math.sqrt(M*M+$*$)}else N=c-Math.sqrt(M*M+O*O);this.data[g+b]=Math.max(0,Math.min(255,N+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){const x=t[_],b=t[_+1];x.zeroLength?t.splice(_,1):b&&b.isDash===x.isDash&&(b.left=x.left,t.splice(_,1))}const n=t[0],s=t[t.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const c=this.width*this.nextRow;let h=0,g=t[h];for(let _=0;_1&&(g=t[++h]);const x=Math.abs(_-g.left),b=Math.abs(_-g.right),S=Math.min(x,b);this.data[c+_]=Math.max(0,Math.min(255,(g.isDash?S:-S)+128))}}addDash(t,n){const s=n?7:0,c=2*s+1;if(this.nextRow+c>this.height)return l.w("LineAtlas out of space"),null;let h=0;for(let _=0;_{c.send(t,n,h)}),s=s||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach((n=>{n.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}}function _r(u,t,n){const s=function(c,h){if(c)return n(c);if(h){const g=l.F(l.e(h,u),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);h.vector_layers&&(g.vectorLayers=h.vector_layers,g.vectorLayerIds=g.vectorLayers.map((_=>_.id))),n(null,g)}};return u.url?l.f(t.transformRequest(u.url,lt.Source),s):l.h.frame((()=>s(null,u)))}class At{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):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 l.L?new l.L(t.lng,t.lat):l.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof l.L?new l.L(t.lng,t.lat):l.L.convert(t),this}extend(t){const n=this._sw,s=this._ne;let c,h;if(t instanceof l.L)c=t,h=t;else{if(!(t instanceof At))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(At.convert(t)):this.extend(l.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(l.L.convert(t)):this;if(c=t._sw,h=t._ne,!c||!h)return this}return n||s?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),s.lng=Math.max(h.lng,s.lng),s.lat=Math.max(h.lat,s.lat)):(this._sw=new l.L(c.lng,c.lat),this._ne=new l.L(h.lng,h.lat)),this}getCenter(){return new l.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 l.L(this.getWest(),this.getNorth())}getSouthEast(){return new l.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:n,lat:s}=l.L.convert(t);let c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&c}static convert(t){return t instanceof At?t:t&&new At(t)}static fromLngLat(t,n=0){const s=360*n/40075017,c=s/Math.cos(Math.PI/180*t.lat);return new At(new l.L(t.lng-c,t.lat-s),new l.L(t.lng+c,t.lat+s))}}class Ei{constructor(t,n,s){this.bounds=At.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=s||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 n=Math.pow(2,t.z),s=Math.floor(l.G(this.bounds.getWest())*n),c=Math.floor(l.H(this.bounds.getNorth())*n),h=Math.ceil(l.G(this.bounds.getEast())*n),g=Math.ceil(l.H(this.bounds.getSouth())*n);return t.x>=s&&t.x=c&&t.y{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=_r(this._options,this.map._requestManager,((h,g)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),h?this.fire(new l.j(h)):g&&(l.e(this,g),g.bounds&&(this.tileBounds=new Ei(g.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})))}))},this.serialize=()=>l.e({},this._options),this.id=t,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.e(this,l.F(n,["url","scheme","tileSize","promoteId"])),this._options=l.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(c)}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,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(s,lt.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 h(g,_){return delete t.request,t.aborted?n(null):g&&g.status!==404?n(g):(_&&_.resourceTiming&&(t.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&t.setExpiryData(_),t.loadVectorData(_,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,h.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,h.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 Ln extends l.E{constructor(t,n,s,c){super(),this.id=t,this.dispatcher=s,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.e({type:"raster"},n),l.e(this,l.F(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=_r(this._options,this.map._requestManager,((t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new l.j(t)):n&&(l.e(this,n),n.bounds&&(this.tileBounds=new Ei(n.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.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 l.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=Qe.getImage(this.map._requestManager.transformRequest(s,lt.Tile),((c,h,g)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(h){this.map._refreshExpiredTiles&&g&&t.setExpiryData(g);const _=this.map.painter.context,x=_.gl;t.texture=this.map.painter.getTileTexture(h.width),t.texture?t.texture.update(h,{useMipmap:!0}):(t.texture=new zt(_,h,x.RGBA,{useMipmap:!0}),t.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE,x.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&x.texParameterf(x.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}}),this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Fn extends Ln{constructor(t,n,s,c){super(t,n,s,c),this.type="raster-dem",this.maxzoom=22,this._options=l.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c=this.map._requestManager.transformRequest(s,lt.Tile);function h(g,_){g&&(t.state="errored",n(g)),_&&(t.dem=_,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=Qe.getImage(c,((g,_,x)=>l._(this,void 0,void 0,(function*(){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(g)t.state="errored",n(g);else if(_){this.map._refreshExpiredTiles&&t.setExpiryData(x);const b=l.a(_)&&l.J()?_:yield(function(T){return l._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&l.K()){const M=T.width+2,N=T.height+2;try{return new l.R({width:M,height:N},yield l.M(T,-1,-1,M,N))}catch{}}return l.h.getImageData(T,1)}))})(_),S={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:b,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",S,h))}}))),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const n=t.canonical,s=Math.pow(2,n.z),c=(n.x-1+s)%s,h=n.x===0?t.wrap-1:t.wrap,g=(n.x+1+s)%s,_=n.x+1===s?t.wrap+1:t.wrap,x={};return x[new l.O(t.overscaledZ,h,n.z,c,n.y).key]={backfilled:!1},x[new l.O(t.overscaledZ,_,n.z,g,n.y).key]={backfilled:!1},n.y>0&&(x[new l.O(t.overscaledZ,h,n.z,c,n.y-1).key]={backfilled:!1},x[new l.O(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},x[new l.O(t.overscaledZ,_,n.z,g,n.y-1).key]={backfilled:!1}),n.y+1{this._updateWorkerData()},this.serialize=()=>l.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=s.getActor(),this.setEventedParent(c),this._data=n.data,this._options=l.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const h=l.N/this.tileSize;this.workerOptions=l.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*h,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*h,extent:l.N,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom!==void 0?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:l.N,radius:(n.clusterRadius||50)*h,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.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,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,s,c){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:s},c),this}_updateWorkerData(t){const n=l.e({},this.workerOptions);t?n.dataDiff=t:typeof this._data=="string"?(n.request=this.map._requestManager.transformRequest(l.h.resolveURL(this._data),lt.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new l.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,((s,c)=>{if(this._pendingLoads--,this._removed||c&&c.abandoned)return void this.fire(new l.k("dataabort",{dataType:"source"}));let h=null;if(c&&c.resourceTiming&&c.resourceTiming[this.id]&&(h=c.resourceTiming[this.id].slice(0)),s)return void this.fire(new l.j(s));const g={dataType:"source"};this._collectResourceTiming&&h&&h.length>0&&l.e(g,{resourceTiming:h}),this.fire(new l.k("data",Object.assign(Object.assign({},g),{sourceDataType:"metadata"}))),this.fire(new l.k("data",Object.assign(Object.assign({},g),{sourceDataType:"content"})))}))}loaded(){return this._pendingLoads===0}loadTile(t,n){const s=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={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(s,c,((h,g)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):h?n(h):(t.loadVectorData(g,this.map.painter,s==="reloadTile"),n(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 hr=l.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class er extends l.E{constructor(t,n,s,c){super(),this.load=(h,g)=>{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Qe.getImage(this.map._requestManager.transformRequest(this.url,lt.Image),((_,x)=>{this._request=null,this._loaded=!0,_?this.fire(new l.j(_)):x&&(this.image=x,h&&(this.coordinates=h),g&&g(),this._finishLoading())}))},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const h=this.map.painter.context,g=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new zt(h,this.image,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let _=!1;for(const x in this.tiles){const b=this.tiles[x];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,_=!0)}_&&this.fire(new l.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=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}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 l.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 n=t.map(l.U.fromLngLat);this.tileID=(function(c){let h=1/0,g=1/0,_=-1/0,x=-1/0;for(const M of c)h=Math.min(h,M.x),g=Math.min(g,M.y),_=Math.max(_,M.x),x=Math.max(x,M.y);const b=Math.max(_-h,x-g),S=Math.max(0,Math.floor(-Math.log(b)/Math.LN2)),T=Math.pow(2,S);return new l.W(S,Math.floor((h+_)/2*T),Math.floor((g+x)/2*T))})(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map((c=>this.tileID.getTilePoint(c)._round()));return this._boundsArray=new l.V,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,l.N,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,l.N),this._boundsArray.emplaceBack(s[2].x,s[2].y,l.N,l.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}hasTransition(){return!1}}class ca extends er{constructor(t,n,s,c){super(t,n,s,c),this.load=()=>{this._loaded=!1;const h=this.options;this.urls=[];for(const g of h.urls)this.urls.push(this.map._requestManager.transformRequest(g,lt.Source).url);l.X(this.urls,((g,_)=>{this._loaded=!0,g?this.fire(new l.j(g)):_&&(this.video=_,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 h=this.map.painter.context,g=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new zt(h,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let _=!1;for(const x in this.tiles){const b=this.tiles[x];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,_=!0)}_&&this.fire(new l.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=n}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new l.j(new l.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.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 Hr extends er{constructor(t,n,s,c){super(t,n,s,c),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 l.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 h=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,h=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,h=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const g=this.map.painter.context,_=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?(h||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new zt(g,this.canvas,_.RGBA,{premultiply:!0});let x=!1;for(const b in this.tiles){const S=this.tiles[b];S.state!=="loaded"&&(S.state="loaded",S.texture=this.texture,x=!0)}x&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some((h=>!Array.isArray(h)||h.length!==2||h.some((g=>typeof g!="number"))))||this.fire(new l.j(new l.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.j(new l.Y(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new l.j(new l.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new l.j(new l.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 l.j(new l.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.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 ua={},Pr=u=>{switch(u){case"geojson":return Gr;case"image":return er;case"raster":return Ln;case"raster-dem":return Fn;case"vector":return un;case"video":return ca;case"canvas":return Hr}return ua[u]};function Rn(u,t){const n=l.Z();return l.$(n,n,[1,1,0]),l.a0(n,n,[.5*u.width,.5*u.height,1]),l.a1(n,n,u.calculatePosMatrix(t.toUnwrapped()))}function hn(u,t,n,s,c,h){const g=(function(T,M,N){if(T)for(const O of T){const $=M[O];if($&&$.source===N&&$.type==="fill-extrusion")return!0}else for(const O in M){const $=M[O];if($.source===N&&$.type==="fill-extrusion")return!0}return!1})(c&&c.layers,t,u.id),_=h.maxPitchScaleFactor(),x=u.tilesIn(s,_,g);x.sort(Wr);const b=[];for(const T of x)b.push({wrappedTileID:T.tileID.wrapped().key,queryResults:T.tile.queryRenderedFeatures(t,n,u._state,T.queryGeometry,T.cameraQueryGeometry,T.scale,c,h,_,Rn(u.transform,T.tileID))});const S=(function(T){const M={},N={};for(const O of T){const $=O.queryResults,R=O.wrappedTileID,Q=N[R]=N[R]||{};for(const se in $){const G=$[se],ee=Q[se]=Q[se]||{},le=M[se]=M[se]||[];for(const ce of G)ee[ce.featureIndex]||(ee[ce.featureIndex]=!0,le.push(ce))}}return M})(b);for(const T in S)S[T].forEach((M=>{const N=M.feature,O=u.getFeatureState(N.layer["source-layer"],N.id);N.source=N.layer.source,N.layer["source-layer"]&&(N.sourceLayer=N.layer["source-layer"]),N.state=O}));return S}function Wr(u,t){const n=u.tileID,s=t.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}class Xr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=l.a2(),this.uses=0,this.tileSize=n,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 n=t+this.timeAdded;nh.getLayer(b))).filter(Boolean);if(x.length!==0){_.layers=x,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map((b=>x.filter((S=>S.id===b))[0])));for(const b of x)g[b.id]=_}}return g})(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const h=this.buckets[c];if(h instanceof l.a4){if(this.hasSymbolBuckets=!0,!s)break;h.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const h=this.buckets[c];if(h instanceof l.a4&&h.hasRTLText){this.hasRTLText=!0,l.a5();break}}this.queryPadding=0;for(const c in this.buckets){const h=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(h))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new l.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 s in this.buckets){const c=this.buckets[s];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new zt(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new zt(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,c,h,g,_,x,b,S){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:h,scale:g,tileSize:this.tileSize,pixelPosMatrix:S,transform:x,params:_,queryPadding:this.queryPadding*b},t,n,s):{}}querySourceFeatures(t,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const c=s.loadVTLayers(),h=n&&n.sourceLayer?n.sourceLayer:"",g=c._geojsonTileLayer||c[h];if(!g)return;const _=l.a6(n&&n.filter),{z:x,x:b,y:S}=this.tileID.canonical,T={z:x,x:b,y:S};for(let M=0;Ms)c=!1;else if(n)if(this.expirationTime{this.remove(t,h)}),s)),this.data[c].push(h),this.order.push(c),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const s=t.wrapped().key,c=n===void 0?0:this.data[s].indexOf(n),h=this.data[s][c];return this.data[s].splice(c,1),h.timeout&&clearTimeout(h.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(h.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const s in this.data)for(const c of this.data[s])t(c.value)||n.push(c);for(const s of n)this.remove(s.value.tileID,s)}}class pe{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,s){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},l.e(this.stateChanges[t][c],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(const h in this.state[t])h!==c&&(this.deletedStates[t][h]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const h in this.state[t][c])s[h]||(this.deletedStates[t][c][h]=null)}else for(const h in s)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][h]===null&&delete this.deletedStates[t][c][h]}removeFeatureState(t,n,s){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},s&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][s]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(s in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][s]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const s=String(n),c=l.e({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const h=this.deletedStates[t][n];if(h===null)return{};for(const g in h)delete c[g]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const s={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const h={};for(const g in this.stateChanges[c])this.state[c][g]||(this.state[c][g]={}),l.e(this.state[c][g],this.stateChanges[c][g]),h[g]=this.state[c][g];s[c]=h}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const h={};if(this.deletedStates[c]===null)for(const g in this.state[c])h[g]={},this.state[c][g]={};else for(const g in this.deletedStates[c]){if(this.deletedStates[c][g]===null)this.state[c][g]={};else for(const _ of Object.keys(this.deletedStates[c][g]))delete this.state[c][g][_];h[g]=this.state[c][g]}s[c]=s[c]||{},l.e(s[c],h)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const c in t)t[c].setFeatureState(s,n)}}class Mi extends l.E{constructor(t,n,s){super(),this.id=t,this.dispatcher=s,this.on("data",(c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.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=((c,h,g,_)=>{const x=new(Pr(h.type))(c,h,g,_);if(x.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${x.id}`);return x})(t,n,s,this),this._tiles={},this._cache=new pn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new pe,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 n=this._tiles[t];if(n.state!=="loaded"&&n.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,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,(()=>{})),this._source.fire(new l.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 n in this._tiles){const s=this._tiles[n];s.upload(t),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(tr).map((t=>t.key))}getRenderableIds(t){const n=[];for(const s in this._tiles)this._isIdRenderable(s,t)&&n.push(this._tiles[s]);return t?n.sort(((s,c)=>{const h=s.tileID,g=c.tileID,_=new l.P(h.canonical.x,h.canonical.y)._rotate(this.transform.angle),x=new l.P(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return h.overscaledZ-g.overscaledZ||x.y-_.y||x.x-_.x})).map((s=>s.tileID.key)):n.map((s=>s.tileID)).sort(tr).map((s=>s.key))}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!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,n){const s=this._tiles[t];s&&(s.state!=="loading"&&(s.state=n),this._loadTile(s,this._tileLoaded.bind(this,s,t,n)))}_tileLoaded(t,n,s,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new l.j(c,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=l.h.now(),s==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,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 l.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(g)>1&&(Math.abs(g+x)===1?g+=x:Math.abs(g-x)===1&&(g-=x)),h.dem&&c.dem&&(c.dem.backfillBorder(h.dem,g,_),c.neighboringTiles&&c.neighboringTiles[b]&&(c.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,s,c){for(const h in this._tiles){let g=this._tiles[h];if(c[h]||!g.hasData()||g.tileID.overscaledZ<=n||g.tileID.overscaledZ>s)continue;let _=g.tileID;for(;g&&g.tileID.overscaledZ>n+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(_=b)}let x=_;for(;x.overscaledZ>n;)if(x=x.scaledTo(x.overscaledZ-1),t[x.key]){c[_.key]=_;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const s=this._loadedParentTiles[t.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=t.overscaledZ-1;s>=n;s--){const c=t.scaledTo(s),h=this._getLoadedTile(c);if(h)return h}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*s*(this._maxTileCacheZoomLevels===null?l.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),h=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(h)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const s={};for(const c in this._tiles){const h=this._tiles[c];h.tileID=h.tileID.unwrapTo(h.tileID.wrap+n),s[h.tileID.key]=h}this._tiles=s;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let s;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((S=>new l.O(S.canonical.z,S.wrap,S.canonical.z,S.canonical.x,S.canonical.y))):(s=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:n}),this._source.hasTile&&(s=s.filter((S=>this._source.hasTile(S))))):s=[];const c=t.coveringZoomLevel(this._source),h=Math.max(c-Mi.maxOverzooming,this._source.minzoom),g=Math.max(c+Mi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const S={};for(const T of s)if(T.canonical.z>this._source.minzoom){const M=T.scaledTo(T.canonical.z-1);S[M.key]=M;const N=T.scaledTo(Math.max(this._source.minzoom,Math.min(T.canonical.z,5)));S[N.key]=N}s=s.concat(Object.values(S))}const _=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,_&&this.fire(new l.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const x=this._updateRetainedTiles(s,c);if(St(this._source.type)){const S={},T={},M=Object.keys(x),N=l.h.now();for(const O of M){const $=x[O],R=this._tiles[O];if(!R||R.fadeEndTime!==0&&R.fadeEndTime<=N)continue;const Q=this.findLoadedParent($,h);Q&&(this._addTile(Q.tileID),S[Q.tileID.key]=Q.tileID),T[O]=$}this._retainLoadedChildren(T,c,g,x);for(const O in S)x[O]||(this._coveredTiles[O]=!0,x[O]=S[O]);if(n){const O={},$={};for(const R of s)this._tiles[R.key].hasData()?O[R.key]=R:$[R.key]=R;for(const R in $){const Q=$[R].children(this._source.maxzoom);this._tiles[Q[0].key]&&this._tiles[Q[1].key]&&this._tiles[Q[2].key]&&this._tiles[Q[3].key]&&(O[Q[0].key]=x[Q[0].key]=Q[0],O[Q[1].key]=x[Q[1].key]=Q[1],O[Q[2].key]=x[Q[2].key]=Q[2],O[Q[3].key]=x[Q[3].key]=Q[3],delete $[R])}for(const R in $){const Q=this.findLoadedParent($[R],this._source.minzoom);if(Q){O[Q.tileID.key]=x[Q.tileID.key]=Q.tileID;for(const se in O)O[se].isChildOf(Q.tileID)&&delete O[se]}}for(const R in this._tiles)O[R]||(this._coveredTiles[R]=!0)}}for(const S in x)this._tiles[S].clearFadeHold();const b=l.ab(this._tiles,x);for(const S of b){const T=this._tiles[S];T.hasSymbolBuckets&&!T.holdingForFade()?T.setHoldDuration(this.map._fadeDuration):T.hasSymbolBuckets&&!T.symbolFadeFinished()||this._removeTile(S)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const s={},c={},h=Math.max(n-Mi.maxOverzooming,this._source.minzoom),g=Math.max(n+Mi.maxUnderzooming,this._source.minzoom),_={};for(const x of t){const b=this._addTile(x);s[x.key]=x,b.hasData()||nthis._source.maxzoom){const T=x.children(this._source.maxzoom)[0],M=this.getTile(T);if(M&&M.hasData()){s[T.key]=T;continue}}else{const T=x.children(this._source.maxzoom);if(s[T[0].key]&&s[T[1].key]&&s[T[2].key]&&s[T[3].key])continue}let S=b.wasRequested();for(let T=x.overscaledZ-1;T>=h;--T){const M=x.scaledTo(T);if(c[M.key])break;if(c[M.key]=!0,b=this.getTile(M),!b&&S&&(b=this._addTile(M)),b){const N=b.hasData();if((S||N)&&(s[M.key]=M),S=b.wasRequested(),N)break}}}return s}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let s,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){s=this._loadedParentTiles[c.key];break}n.push(c.key);const h=c.scaledTo(c.overscaledZ-1);if(s=this._getLoadedTile(h),s)break;c=h}for(const h of n)this._loadedParentTiles[h]=s}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const s=n;return n||(n=new Xr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,s||this._source.fire(new l.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const s=n.getExpiryTimeout();s&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),s))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,s){const c=[],h=this.transform;if(!h)return c;const g=s?h.getCameraQueryGeometry(t):t,_=t.map((O=>h.pointCoordinate(O,this.terrain))),x=g.map((O=>h.pointCoordinate(O,this.terrain))),b=this.getIds();let S=1/0,T=1/0,M=-1/0,N=-1/0;for(const O of x)S=Math.min(S,O.x),T=Math.min(T,O.y),M=Math.max(M,O.x),N=Math.max(N,O.y);for(let O=0;O=0&&G[1].y+se>=0){const ee=_.map((ce=>R.getTilePoint(ce))),le=x.map((ce=>R.getTilePoint(ce)));c.push({tile:$,tileID:R,queryGeometry:ee,cameraQueryGeometry:le,scale:Q})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map((s=>this._tiles[s].tileID));for(const s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(St(this._source.type)){const t=l.h.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,s){this._state.updateState(t=t||"_geojsonTileLayer",n,s)}removeFeatureState(t,n,s){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,s)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,s){const c=this._tiles[t];c&&c.setDependencies(n,s)}reloadTilesForDependencies(t,n){for(const s in this._tiles)this._tiles[s].hasDependency(t,n)&&this._reloadTile(s,"reloading");this._cache.filter((s=>!s.hasDependency(t,n)))}}function tr(u,t){const n=Math.abs(2*u.wrap)-+(u.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||s-n||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function St(u){return u==="raster"||u==="image"||u==="video"}Mi.maxOverzooming=10,Mi.maxUnderzooming=3;const ft="mapboxgl_preloaded_worker_pool";class yr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[ft]}numActive(){return Object.keys(this.active).length}}const Bn=Math.floor(l.h.hardwareConcurrency/2);let zr;function Na(){return zr||(zr=new yr),zr}yr.workerCount=l.ac(globalThis)?Math.max(Math.min(Bn,3),1):1;class On{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let s=1;s0?(c-g)/_:0;return this.points[h].mult(1-x).add(this.points[n].mult(x))}}function Kr(u,t){let n=!0;return u==="always"||u!=="never"&&t!=="never"||(n=!1),n}class dn{constructor(t,n,s){const c=this.boxCells=[],h=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(n/s);for(let g=0;gthis.width||c<0||n>this.height)return[];const x=[];if(t<=0&&n<=0&&this.width<=s&&this.height<=c){if(h)return[{key:null,x1:t,y1:n,x2:s,y2:c}];for(let b=0;b0}hitTestCircle(t,n,s,c,h){const g=t-s,_=t+s,x=n-s,b=n+s;if(_<0||g>this.width||b<0||x>this.height)return!1;const S=[];return this._forEachCell(g,x,_,b,this._queryCellCircle,S,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},h),S.length>0}_queryCell(t,n,s,c,h,g,_,x){const{seenUids:b,hitTest:S,overlapMode:T}=_,M=this.boxCells[h];if(M!==null){const O=this.bboxes;for(const $ of M)if(!b.box[$]){b.box[$]=!0;const R=4*$,Q=this.boxKeys[$];if(t<=O[R+2]&&n<=O[R+3]&&s>=O[R+0]&&c>=O[R+1]&&(!x||x(Q))&&(!S||!Kr(T,Q.overlapMode))&&(g.push({key:Q,x1:O[R],y1:O[R+1],x2:O[R+2],y2:O[R+3]}),S))return!0}}const N=this.circleCells[h];if(N!==null){const O=this.circles;for(const $ of N)if(!b.circle[$]){b.circle[$]=!0;const R=3*$,Q=this.circleKeys[$];if(this._circleAndRectCollide(O[R],O[R+1],O[R+2],t,n,s,c)&&(!x||x(Q))&&(!S||!Kr(T,Q.overlapMode))){const se=O[R],G=O[R+1],ee=O[R+2];if(g.push({key:Q,x1:se-ee,y1:G-ee,x2:se+ee,y2:G+ee}),S)return!0}}}return!1}_queryCellCircle(t,n,s,c,h,g,_,x){const{circle:b,seenUids:S,overlapMode:T}=_,M=this.boxCells[h];if(M!==null){const O=this.bboxes;for(const $ of M)if(!S.box[$]){S.box[$]=!0;const R=4*$,Q=this.boxKeys[$];if(this._circleAndRectCollide(b.x,b.y,b.radius,O[R+0],O[R+1],O[R+2],O[R+3])&&(!x||x(Q))&&!Kr(T,Q.overlapMode))return g.push(!0),!0}}const N=this.circleCells[h];if(N!==null){const O=this.circles;for(const $ of N)if(!S.circle[$]){S.circle[$]=!0;const R=3*$,Q=this.circleKeys[$];if(this._circlesCollide(O[R],O[R+1],O[R+2],b.x,b.y,b.radius)&&(!x||x(Q))&&!Kr(T,Q.overlapMode))return g.push(!0),!0}}}_forEachCell(t,n,s,c,h,g,_,x){const b=this._convertToXCellCoord(t),S=this._convertToYCellCoord(n),T=this._convertToXCellCoord(s),M=this._convertToYCellCoord(c);for(let N=b;N<=T;N++)for(let O=S;O<=M;O++)if(h.call(this,t,n,s,c,this.xCellCount*O+N,g,_,x))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,n,s,c,h,g){const _=c-t,x=h-n,b=s+g;return b*b>_*_+x*x}_circleAndRectCollide(t,n,s,c,h,g,_){const x=(g-c)/2,b=Math.abs(t-(c+x));if(b>x+s)return!1;const S=(_-h)/2,T=Math.abs(n-(h+S));if(T>S+s)return!1;if(b<=x||T<=S)return!0;const M=b-x,N=T-S;return M*M+N*N<=s*s}}function Te(u,t,n,s,c){const h=l.Z();return t?(l.a0(h,h,[1/c,1/c,1]),n||l.ae(h,h,s.angle)):l.a1(h,s.labelPlaneMatrix,u),h}function xr(u,t,n,s,c){if(t){const h=l.af(u);return l.a0(h,h,[c,c,1]),n||l.ae(h,h,-s.angle),h}return s.glCoordMatrix}function Bt(u,t,n){let s;n?(s=[u.x,u.y,n(u.x,u.y),1],l.ag(s,s,t)):(s=[u.x,u.y,0,1],j(s,s,t));const c=s[3];return{point:new l.P(s[0]/c,s[1]/c),signedDistanceFromCamera:c}}function fn(u,t){return .5+u/t*.5}function Dr(u,t){const n=u[0]/u[3],s=u[1]/u[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function Ae(u,t,n,s,c,h,g,_,x,b){const S=s?u.textSizeData:u.iconSizeData,T=l.ah(S,n.transform.zoom),M=[256/n.width*2+1,256/n.height*2+1],N=s?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;N.clear();const O=u.lineVertexArray,$=s?u.text.placedSymbolArray:u.icon.placedSymbolArray,R=n.transform.width/n.transform.height;let Q=!1;for(let se=0;se<$.length;se++){const G=$.get(se);if(G.hidden||G.writingMode===l.ai.vertical&&!Q){L(G.numGlyphs,N);continue}let ee;if(Q=!1,b?(ee=[G.anchorX,G.anchorY,b(G.anchorX,G.anchorY),1],l.ag(ee,ee,t)):(ee=[G.anchorX,G.anchorY,0,1],j(ee,ee,t)),!Dr(ee,M)){L(G.numGlyphs,N);continue}const le=fn(n.transform.cameraToCenterDistance,ee[3]),ce=l.aj(S,T,G),me=g?ce/le:ce*le,xe=new l.P(G.anchorX,G.anchorY),ye=Bt(xe,c,b).point,be={projections:{},offsets:{}},Be=bi(G,me,!1,_,t,c,h,u.glyphOffsetArray,O,N,ye,xe,be,R,x,b);Q=Be.useVertical,(Be.notEnoughRoom||Q||Be.needsFlipping&&bi(G,me,!0,_,t,c,h,u.glyphOffsetArray,O,N,ye,xe,be,R,x,b).notEnoughRoom)&&L(G.numGlyphs,N)}s?u.text.dynamicLayoutVertexBuffer.updateData(N):u.icon.dynamicLayoutVertexBuffer.updateData(N)}function it(u,t,n,s,c,h,g,_,x,b,S,T,M){const N=_.glyphStartIndex+_.numGlyphs,O=_.lineStartIndex,$=_.lineStartIndex+_.lineLength,R=t.getoffsetX(_.glyphStartIndex),Q=t.getoffsetX(N-1),se=C(u*R,n,s,c,h,g,_.segment,O,$,x,b,S,T,M);if(!se)return null;const G=C(u*Q,n,s,c,h,g,_.segment,O,$,x,b,S,T,M);return G?{first:se,last:G}:null}function Ye(u,t,n,s){return u===l.ai.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*s?{useVertical:!0}:(u===l.ai.vertical?t.yn.x)?{needsFlipping:!0}:null}function bi(u,t,n,s,c,h,g,_,x,b,S,T,M,N,O,$){const R=t/24,Q=u.lineOffsetX*R,se=u.lineOffsetY*R;let G;if(u.numGlyphs>1){const ee=u.glyphStartIndex+u.numGlyphs,le=u.lineStartIndex,ce=u.lineStartIndex+u.lineLength,me=it(R,_,Q,se,n,S,T,u,x,h,M,O,$);if(!me)return{notEnoughRoom:!0};const xe=Bt(me.first.point,g,$).point,ye=Bt(me.last.point,g,$).point;if(s&&!n){const be=Ye(u.writingMode,xe,ye,N);if(be)return be}G=[me.first];for(let be=u.glyphStartIndex+1;be0?xe.point:vr(T,me,le,1,c,$),be=Ye(u.writingMode,le,ye,N);if(be)return be}const ee=C(R*_.getoffsetX(u.glyphStartIndex),Q,se,n,S,T,u.segment,u.lineStartIndex,u.lineStartIndex+u.lineLength,x,h,M,O,$);if(!ee)return{notEnoughRoom:!0};G=[ee]}for(const ee of G)l.ak(b,ee.point,ee.angle);return{}}function vr(u,t,n,s,c,h){const g=Bt(u.add(u.sub(t)._unit()),c,h).point,_=n.sub(g);return n.add(_._mult(s/_.mag()))}function et(u,t){const{projectionCache:n,lineVertexArray:s,labelPlaneMatrix:c,tileAnchorPoint:h,distanceFromAnchor:g,getElevation:_,previousVertex:x,direction:b,absOffsetX:S}=t;if(n.projections[u])return n.projections[u];const T=new l.P(s.getx(u),s.gety(u)),M=Bt(T,c,_);if(M.signedDistanceFromCamera>0)return n.projections[u]=M.point,M.point;const N=u-b;return vr(g===0?h:new l.P(s.getx(N),s.gety(N)),T,x,S-g+1,c,_)}function Lr(u,t,n){return u._unit()._perp()._mult(t*n)}function U(u,t,n,s,c,h,g,_){const{projectionCache:x,direction:b}=_;if(x.offsets[u])return x.offsets[u];const S=n.add(t);if(u+b=c)return x.offsets[u]=S,S;const T=et(u+b,_),M=Lr(T.sub(n),g,b),N=n.add(M),O=T.add(M);return x.offsets[u]=l.al(h,S,N,O)||S,x.offsets[u]}function C(u,t,n,s,c,h,g,_,x,b,S,T,M,N){const O=s?u-t:u+t;let $=O>0?1:-1,R=0;s&&($*=-1,R=Math.PI),$<0&&(R+=Math.PI);let Q,se,G=$>0?_+g:_+g+1,ee=c,le=c,ce=0,me=0;const xe=Math.abs(O),ye=[];let be;for(;ce+me<=xe;){if(G+=$,G<_||G>=x)return null;ce+=me,le=ee,se=Q;const Ce={projectionCache:T,lineVertexArray:b,labelPlaneMatrix:S,tileAnchorPoint:h,distanceFromAnchor:ce,getElevation:N,previousVertex:le,direction:$,absOffsetX:xe};if(ee=et(G,Ce),n===0)ye.push(le),be=ee.sub(le);else{let He;const Ne=ee.sub(le);He=Ne.mag()===0?Lr(et(G+$,Ce).sub(ee),n,$):Lr(Ne,n,$),se||(se=le.add(He)),Q=U(G,He,ee,_,x,se,n,Ce),ye.push(se),be=Q.sub(se)}me=be.mag()}const Be=be._mult((xe-ce)/me)._add(se||le),at=R+Math.atan2(ee.y-le.y,ee.x-le.x);return ye.push(Be),{point:Be,angle:M?at:0,path:ye}}const E=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function L(u,t){for(let n=0;n=1;tt--)Ne.push(Ce.path[tt]);for(let tt=1;ttBt(st,x,O)));Ne=tt.some((st=>st.signedDistanceFromCamera<=0))?[]:tt.map((st=>st.point))}let nt=[];if(Ne.length>0){const tt=Ne[0].clone(),st=Ne[0].clone();for(let Ut=1;Ut=be.x&&st.x<=Be.x&&tt.y>=be.y&&st.y<=Be.y?[Ne]:st.xBe.x||st.yBe.y?[]:l.am([Ne],be.x,be.y,Be.x,Be.y)}for(const tt of nt){at.reset(tt,.25*ye);let st=0;st=at.length<=.5*ye?1:Math.ceil(at.paddedLength/vt)+1;for(let Ut=0;Ut=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,s,c){return s>=0&&t=0&&ns.collisionGroupID===n}}return this.collisionGroups[t]}}function Xe(u,t,n,s,c){const{horizontalAlign:h,verticalAlign:g}=l.au(u);return new l.P(-(h-.5)*t+s[0]*c,-(g-.5)*n+s[1]*c)}function Re(u,t,n,s,c,h){const{x1:g,x2:_,y1:x,y2:b,anchorPointX:S,anchorPointY:T}=u,M=new l.P(t,n);return s&&M._rotate(c?h:-h),{x1:g+M.x,y1:x+M.y,x2:_+M.x,y2:b+M.y,anchorPointX:S,anchorPointY:T}}class Ze{constructor(t,n,s,c,h){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new ne(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new je(c),this.collisionCircleArrays={},this.prevPlacement=h,h&&(h.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,c){const h=s.getBucket(n),g=s.latestFeatureIndex;if(!h||!g||n.id!==h.layerIds[0])return;const _=s.collisionBoxArray,x=h.layers[0].layout,b=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),S=s.tileSize/l.N,T=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),M=x.get("text-pitch-alignment")==="map",N=x.get("text-rotation-alignment")==="map",O=J(s,1,this.transform.zoom),$=Te(T,M,N,this.transform,O);let R=null;if(M){const se=xr(T,M,N,this.transform,O);R=l.a1([],this.transform.labelPlaneMatrix,se)}this.retainedQueryData[h.bucketInstanceId]=new _e(h.bucketInstanceId,g,h.sourceLayerIndex,h.index,s.tileID);const Q={bucket:h,layout:x,posMatrix:T,textLabelPlaneMatrix:$,labelToScreenMatrix:R,scale:b,textPixelRatio:S,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:l.ah(h.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(h.sourceID)};if(c)for(const se of h.sortKeyRanges){const{sortKey:G,symbolInstanceStart:ee,symbolInstanceEnd:le}=se;t.push({sortKey:G,symbolInstanceStart:ee,symbolInstanceEnd:le,parameters:Q})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:h.symbolInstances.length,parameters:Q})}attemptAnchorPlacement(t,n,s,c,h,g,_,x,b,S,T,M,N,O,$,R){const Q=l.aq[t.textAnchor],se=[t.textOffset0,t.textOffset1],G=Xe(Q,s,c,se,h),ee=this.collisionIndex.placeCollisionBox(Re(n,G.x,G.y,g,_,this.transform.angle),T,x,b,S.predicate,R);if((!$||this.collisionIndex.placeCollisionBox(Re($,G.x,G.y,g,_,this.transform.angle),T,x,b,S.predicate,R).box.length!==0)&&ee.box.length>0){let le;if(this.prevPlacement&&this.prevPlacement.variableOffsets[M.crossTileID]&&this.prevPlacement.placements[M.crossTileID]&&this.prevPlacement.placements[M.crossTileID].text&&(le=this.prevPlacement.variableOffsets[M.crossTileID].anchor),M.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[M.crossTileID]={textOffset:se,width:s,height:c,anchor:Q,textBoxScale:h,prevAnchor:le},this.markUsedJustification(N,Q,M,O),N.allowVerticalPlacement&&(this.markUsedOrientation(N,O,M),this.placedOrientations[M.crossTileID]=O),{shift:G,placedGlyphBoxes:ee}}}placeLayerBucketPart(t,n,s){const{bucket:c,layout:h,posMatrix:g,textLabelPlaneMatrix:_,labelToScreenMatrix:x,textPixelRatio:b,holdingForFade:S,collisionBoxArray:T,partiallyEvaluatedTextSize:M,collisionGroup:N}=t.parameters,O=h.get("text-optional"),$=h.get("icon-optional"),R=l.ar(h,"text-overlap","text-allow-overlap"),Q=R==="always",se=l.ar(h,"icon-overlap","icon-allow-overlap"),G=se==="always",ee=h.get("text-rotation-alignment")==="map",le=h.get("text-pitch-alignment")==="map",ce=h.get("icon-text-fit")!=="none",me=h.get("symbol-z-order")==="viewport-y",xe=Q&&(G||!c.hasIconData()||$),ye=G&&(Q||!c.hasTextData()||O);!c.collisionArrays&&T&&c.deserializeCollisionBoxes(T);const be=this.retainedQueryData[c.bucketInstanceId].tileID,Be=this.terrain?(Ce,He)=>this.terrain.getElevation(be,Ce,He):null,at=(Ce,He)=>{var Ne,vt;if(n[Ce.crossTileID])return;if(S)return void(this.placements[Ce.crossTileID]=new de(!1,!1,!1));let nt=!1,tt=!1,st=!0,Ut=null,It={box:null,offscreen:null},ui={box:null},Yt=null,Gt=null,Gi=null,kt=0,wr=0,Sr=0;He.textFeatureIndex?kt=He.textFeatureIndex:Ce.useRuntimeCollisionCircles&&(kt=Ce.featureIndex),He.verticalTextFeatureIndex&&(wr=He.verticalTextFeatureIndex);const an=He.textBox;if(an){const mi=$t=>{let Jt=l.ai.horizontal;if(c.allowVerticalPlacement&&!$t&&this.prevPlacement){const Di=this.prevPlacement.placedOrientations[Ce.crossTileID];Di&&(this.placedOrientations[Ce.crossTileID]=Di,Jt=Di,this.markUsedOrientation(c,Jt,Ce))}return Jt},hi=($t,Jt)=>{if(c.allowVerticalPlacement&&Ce.numVerticalGlyphVertices>0&&He.verticalTextBox){for(const Di of c.writingModes)if(Di===l.ai.vertical?(It=Jt(),ui=It):It=$t(),It&&It.box&&It.box.length)break}else It=$t()},Si=Ce.textAnchorOffsetStartIndex,Tn=Ce.textAnchorOffsetEndIndex;if(Tn===Si){const $t=(Jt,Di)=>{const jt=this.collisionIndex.placeCollisionBox(Jt,R,b,g,N.predicate,Be);return jt&&jt.box&&jt.box.length&&(this.markUsedOrientation(c,Di,Ce),this.placedOrientations[Ce.crossTileID]=Di),jt};hi((()=>$t(an,l.ai.horizontal)),(()=>{const Jt=He.verticalTextBox;return c.allowVerticalPlacement&&Ce.numVerticalGlyphVertices>0&&Jt?$t(Jt,l.ai.vertical):{box:null,offscreen:null}})),mi(It&&It.box&&It.box.length)}else{let $t=l.aq[(vt=(Ne=this.prevPlacement)===null||Ne===void 0?void 0:Ne.variableOffsets[Ce.crossTileID])===null||vt===void 0?void 0:vt.anchor];const Jt=(jt,In,fs)=>{const kl=jt.x2-jt.x1,El=jt.y2-jt.y1,kc=Ce.textBoxScale,yo=ce&&se==="never"?In:null;let Tr={box:[],offscreen:!1},An=R==="never"?1:2,Ir="never";$t&&An++;for(let lr=0;lrJt(an,He.iconBox,l.ai.horizontal)),(()=>{const jt=He.verticalTextBox;return c.allowVerticalPlacement&&!(It&&It.box&&It.box.length)&&Ce.numVerticalGlyphVertices>0&&jt?Jt(jt,He.verticalIconBox,l.ai.vertical):{box:null,offscreen:null}})),It&&(nt=It.box,st=It.offscreen);const Di=mi(It&&It.box);if(!nt&&this.prevPlacement){const jt=this.prevPlacement.variableOffsets[Ce.crossTileID];jt&&(this.variableOffsets[Ce.crossTileID]=jt,this.markUsedJustification(c,jt.anchor,Ce,Di))}}}if(Yt=It,nt=Yt&&Yt.box&&Yt.box.length>0,st=Yt&&Yt.offscreen,Ce.useRuntimeCollisionCircles){const mi=c.text.placedSymbolArray.get(Ce.centerJustifiedTextSymbolIndex),hi=l.aj(c.textSizeData,M,mi),Si=h.get("text-padding");Gt=this.collisionIndex.placeCollisionCircles(R,mi,c.lineVertexArray,c.glyphOffsetArray,hi,g,_,x,s,le,N.predicate,Ce.collisionCircleDiameter,Si,Be),Gt.circles.length&&Gt.collisionDetected&&!s&&l.w("Collisions detected, but collision boxes are not shown"),nt=Q||Gt.circles.length>0&&!Gt.collisionDetected,st=st&&Gt.offscreen}if(He.iconFeatureIndex&&(Sr=He.iconFeatureIndex),He.iconBox){const mi=hi=>{const Si=ce&&Ut?Re(hi,Ut.x,Ut.y,ee,le,this.transform.angle):hi;return this.collisionIndex.placeCollisionBox(Si,se,b,g,N.predicate,Be)};ui&&ui.box&&ui.box.length&&He.verticalIconBox?(Gi=mi(He.verticalIconBox),tt=Gi.box.length>0):(Gi=mi(He.iconBox),tt=Gi.box.length>0),st=st&&Gi.offscreen}const Sn=O||Ce.numHorizontalGlyphVertices===0&&Ce.numVerticalGlyphVertices===0,Jn=$||Ce.numIconVertices===0;if(Sn||Jn?Jn?Sn||(tt=tt&&nt):nt=tt&&nt:tt=nt=tt&&nt,nt&&Yt&&Yt.box&&this.collisionIndex.insertCollisionBox(Yt.box,R,h.get("text-ignore-placement"),c.bucketInstanceId,ui&&ui.box&&wr?wr:kt,N.ID),tt&&Gi&&this.collisionIndex.insertCollisionBox(Gi.box,se,h.get("icon-ignore-placement"),c.bucketInstanceId,Sr,N.ID),Gt&&(nt&&this.collisionIndex.insertCollisionCircles(Gt.circles,R,h.get("text-ignore-placement"),c.bucketInstanceId,kt,N.ID),s)){const mi=c.bucketInstanceId;let hi=this.collisionCircleArrays[mi];hi===void 0&&(hi=this.collisionCircleArrays[mi]=new fe);for(let Si=0;Si=0;--He){const Ne=Ce[He];at(c.symbolInstances.get(Ne),c.collisionArrays[Ne])}}else for(let Ce=t.symbolInstanceStart;Ce=0&&(t.text.placedSymbolArray.get(_).crossTileID=h>=0&&_!==h?0:s.crossTileID)}markUsedOrientation(t,n,s){const c=n===l.ai.horizontal||n===l.ai.horizontalOnly?n:0,h=n===l.ai.vertical?n:0,g=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const _ of g)t.text.placedSymbolArray.get(_).placedOrientation=c;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=h)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,h=n?n.opacities:{},g=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const x in this.placements){const b=this.placements[x],S=h[x];S?(this.opacities[x]=new ie(S,c,b.text,b.icon),s=s||b.text!==S.text.placed||b.icon!==S.icon.placed):(this.opacities[x]=new ie(null,c,b.text,b.icon,b.skipFade),s=s||b.text||b.icon)}for(const x in h){const b=h[x];if(!this.opacities[x]){const S=new ie(b,c,!1,!1);S.isHidden()||(this.opacities[x]=S,s=s||b.text.placed||b.icon.placed)}}for(const x in g)this.variableOffsets[x]||!this.opacities[x]||this.opacities[x].isHidden()||(this.variableOffsets[x]=g[x]);for(const x in _)this.placedOrientations[x]||!this.opacities[x]||this.opacities[x].isHidden()||(this.placedOrientations[x]=_[x]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const s={};for(const c of n){const h=c.getBucket(t);h&&c.latestFeatureIndex&&t.id===h.layerIds[0]&&this.updateBucketOpacities(h,s,c.collisionBoxArray)}}updateBucketOpacities(t,n,s){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 c=t.layers[0],h=c.layout,g=new ie(null,0,!1,!1,!0),_=h.get("text-allow-overlap"),x=h.get("icon-allow-overlap"),b=c._unevaluatedLayout.hasValue("text-variable-anchor")||c._unevaluatedLayout.hasValue("text-variable-anchor-offset"),S=h.get("text-rotation-alignment")==="map",T=h.get("text-pitch-alignment")==="map",M=h.get("icon-text-fit")!=="none",N=new ie(null,0,_&&(x||!t.hasIconData()||h.get("icon-optional")),x&&(_||!t.hasTextData()||h.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const O=($,R,Q)=>{for(let se=0;se0,ce=this.placedOrientations[R.crossTileID],me=ce===l.ai.vertical,xe=ce===l.ai.horizontal||ce===l.ai.horizontalOnly;if(Q>0||se>0){const ye=li(ee.text);O(t.text,Q,me?ir:ye),O(t.text,se,xe?ir:ye);const be=ee.text.isHidden();[R.rightJustifiedTextSymbolIndex,R.centerJustifiedTextSymbolIndex,R.leftJustifiedTextSymbolIndex].forEach((Ce=>{Ce>=0&&(t.text.placedSymbolArray.get(Ce).hidden=be||me?1:0)})),R.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(R.verticalPlacedTextSymbolIndex).hidden=be||xe?1:0);const Be=this.variableOffsets[R.crossTileID];Be&&this.markUsedJustification(t,Be.anchor,R,ce);const at=this.placedOrientations[R.crossTileID];at&&(this.markUsedJustification(t,"left",R,at),this.markUsedOrientation(t,at,R))}if(le){const ye=li(ee.icon),be=!(M&&R.verticalPlacedIconSymbolIndex&&me);R.placedIconSymbolIndex>=0&&(O(t.icon,R.numIconVertices,be?ye:ir),t.icon.placedSymbolArray.get(R.placedIconSymbolIndex).hidden=ee.icon.isHidden()),R.verticalPlacedIconSymbolIndex>=0&&(O(t.icon,R.numVerticalIconVertices,be?ir:ye),t.icon.placedSymbolArray.get(R.verticalPlacedIconSymbolIndex).hidden=ee.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const ye=t.collisionArrays[$];if(ye){let be=new l.P(0,0);if(ye.textBox||ye.verticalTextBox){let at=!0;if(b){const Ce=this.variableOffsets[G];Ce?(be=Xe(Ce.anchor,Ce.width,Ce.height,Ce.textOffset,Ce.textBoxScale),S&&be._rotate(T?this.transform.angle:-this.transform.angle)):at=!1}ye.textBox&&Je(t.textCollisionBox.collisionVertexArray,ee.text.placed,!at||me,be.x,be.y),ye.verticalTextBox&&Je(t.textCollisionBox.collisionVertexArray,ee.text.placed,!at||xe,be.x,be.y)}const Be=!!(!xe&&ye.verticalIconBox);ye.iconBox&&Je(t.iconCollisionBox.collisionVertexArray,ee.icon.placed,Be,M?be.x:0,M?be.y:0),ye.verticalIconBox&&Je(t.iconCollisionBox.collisionVertexArray,ee.icon.placed,!Be,M?be.x:0,M?be.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 $=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=$.invProjMatrix,t.placementViewportMatrix=$.viewportMatrix,t.collisionCircleArray=$.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 Je(u,t,n,s,c){u.emplaceBack(t?1:0,n?1:0,s||0,c||0),u.emplaceBack(t?1:0,n?1:0,s||0,c||0),u.emplaceBack(t?1:0,n?1:0,s||0,c||0),u.emplaceBack(t?1:0,n?1:0,s||0,c||0)}const yt=Math.pow(2,25),bt=Math.pow(2,24),dt=Math.pow(2,17),pt=Math.pow(2,16),di=Math.pow(2,9),Tt=Math.pow(2,8),Wt=Math.pow(2,1);function li(u){if(u.opacity===0&&!u.placed)return 0;if(u.opacity===1&&u.placed)return 4294967295;const t=u.placed?1:0,n=Math.floor(127*u.opacity);return n*yt+t*bt+n*dt+t*pt+n*di+t*Tt+n*Wt+t}const ir=0;class qo{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,n,s,c,h){const g=this._bucketParts;for(;this._currentTileIndex_.sortKey-x.sortKey)));this._currentPartIndex!this._forceFullPlacement&&l.h.now()-c>2;for(;this._currentPlacementIndex>=0;){const g=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=_)&&(!g.maxzoom||g.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new qo(g)),this._inProgressLayer.continuePlacement(s[g.source],this.placement,this._showCollisionBoxes,g,h))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Vn=512/l.N/2;class hc{constructor(t,n,s){this.tileID=t,this.bucketInstanceId=s,this._symbolsByKey={};const c=new Map;for(let h=0;h({x:Math.floor(x.anchorX*Vn),y:Math.floor(x.anchorY*Vn)}))),crossTileIDs:g.map((x=>x.crossTileID))};if(_.positions.length>128){const x=new l.av(_.positions.length,16,Uint16Array);for(const{x:b,y:S}of _.positions)x.add(b,S);x.finish(),delete _.positions,_.index=x}this._symbolsByKey[h]=_}}getScaledCoordinates(t,n){const{x:s,y:c,z:h}=this.tileID.canonical,{x:g,y:_,z:x}=n.canonical,b=Vn/Math.pow(2,x-h),S=(_*l.N+t.anchorY)*b,T=c*l.N*Vn;return{x:Math.floor((g*l.N+t.anchorX)*b-s*l.N*Vn),y:Math.floor(S-T)}}findMatches(t,n,s){const c=this.tileID.canonical.zt))}}class xt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ms{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const s in this.indexes){const c=this.indexes[s],h={};for(const g in c){const _=c[g];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),h[_.tileID.key]=_}this.indexes[s]=h}this.lng=t}addBucket(t,n,s){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let h=0;ht.overscaledZ)for(const _ in g){const x=g[_];x.tileID.isChildOf(t)&&x.findMatches(n.symbolInstances,t,c)}else{const _=g[t.scaledTo(Number(h)).key];_&&_.findMatches(n.symbolInstances,t,c)}}for(let h=0;h{n[s]=!0}));for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}const fi=(u,t)=>l.x(u,t&&t.filter((n=>n.identifier!=="source.canvas"))),Ui=l.F(l.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),pc=l.F(l.ax,["setCenter","setZoom","setBearing","setPitch"]),rr=l.aw();class ci extends l.E{constructor(t,n={}){super(),this.map=t,this.dispatcher=new la(Na(),this,t._getMapId()),this.imageManager=new ur,this.imageManager.setEventedParent(this),this.glyphManager=new Mr(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new Oa(256,512),this.crossTileSymbolIndex=new Va,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.az());const s=this;this._rtlTextPluginCallback=ci.registerForPluginStateChange((c=>{s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},((h,g)=>{if(l.aA(h),g&&g.every((_=>_)))for(const _ in s.sourceCaches){const x=s.sourceCaches[_].getSource().type;x!=="vector"&&x!=="geojson"||s.sourceCaches[_].reload()}}))})),this.on("data",(c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const h=this.sourceCaches[c.sourceId];if(!h)return;const g=h.getSource();if(g&&g.vectorLayerIds)for(const _ in this._layers){const x=this._layers[_];x.source===g.id&&this._validateLayer(x)}}))}loadURL(t,n={},s){this.fire(new l.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const c=this.map._requestManager.transformRequest(t,lt.Style);this._request=l.f(c,((h,g)=>{this._request=null,h?this.fire(new l.j(h)):g&&this._load(g,n,s)}))}loadJSON(t,n={},s){this.fire(new l.k("dataloading",{dataType:"style"})),this._request=l.h.frame((()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,s)}))}loadEmpty(){this.fire(new l.k("dataloading",{dataType:"style"})),this._load(rr,{validate:!1})}_load(t,n,s){var c;const h=n.transformStyle?n.transformStyle(s,t):t;if(!n.validate||!fi(this,l.y(h))){this._loaded=!0,this.stylesheet=h;for(const g in h.sources)this.addSource(g,h.sources[g],{validate:!1});h.sprite?this._loadSprite(h.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(h.glyphs),this._createLayers(),this.light=new oa(this.stylesheet.light),this.map.setTerrain((c=this.stylesheet.terrain)!==null&&c!==void 0?c:null),this.fire(new l.k("data",{dataType:"style"})),this.fire(new l.k("style.load"))}}_createLayers(){const t=l.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map((n=>n.id)),this._layers={},this._serializedLayers=null;for(const n of t){const s=l.aC(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(t,n=!1,s=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=(function(c,h,g,_){const x=oi(c),b=x.length,S=g>1?"@2x":"",T={},M={},N={};for(const{id:O,url:$}of x){const R=h.transformRequest(h.normalizeSpriteURL($,S,".json"),lt.SpriteJSON),Q=`${O}_${R.url}`;T[Q]=l.f(R,((ee,le)=>{delete T[Q],M[O]=le,Ba(_,M,N,ee,b)}));const se=h.transformRequest(h.normalizeSpriteURL($,S,".png"),lt.SpriteImage),G=`${O}_${se.url}`;T[G]=Qe.getImage(se,((ee,le)=>{delete T[G],N[O]=le,Ba(_,M,N,ee,b)}))}return{cancel(){for(const O of Object.values(T))O.cancel()}}})(t,this.map._requestManager,this.map.getPixelRatio(),((c,h)=>{if(this._spriteRequest=null,c)this.fire(new l.j(c));else if(h)for(const g in h){this._spritesImagesIds[g]=[];const _=this._spritesImagesIds[g]?this._spritesImagesIds[g].filter((x=>!(x in h))):[];for(const x of _)this.imageManager.removeImage(x),this._changedImages[x]=!0;for(const x in h[g]){const b=g==="default"?x:`${g}:${x}`;this._spritesImagesIds[g].push(b),b in this.imageManager.images?this.imageManager.updateImage(b,h[g][x],!1):this.imageManager.addImage(b,h[g][x]),n&&(this._changedImages[b]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"})),s&&s(c)}))}_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 l.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const s=t.sourceLayer;if(!s)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(s)===-1)&&this.fire(new l.j(new Error(`Source layer "${s}" does not exist on source "${c.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 n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const s=[];for(const c of t)n[c]&&s.push(n[c]);return s}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const c=this._layers[s];c.type!=="custom"&&(t[s]=c.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 n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),h=Object.keys(this._removedLayers);(c.length||h.length)&&this._updateWorkerLayers(c,h);for(const g in this._updatedSources){const _=this._updatedSources[g];if(_==="reload")this._reloadSource(g);else{if(_!=="clear")throw new Error(`Invalid action ${_}`);this._clearSource(g)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const s={};for(const c in this.sourceCaches){const h=this.sourceCaches[c];s[c]=h.used,h.used=!1}for(const c of this._order){const h=this._layers[c];h.recalculate(t,this._availableImages),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}for(const c in s){const h=this.sourceCaches[c];s[c]!==h.used&&h.fire(new l.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new l.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].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,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const s=this.serialize();if(t=n.transformStyle?n.transformStyle(s,t):t,fi(this,l.y(t)))return!1;(t=l.aD(t)).layers=l.aB(t.layers);const c=l.aE(s,t).filter((g=>!(g.command in pc)));if(c.length===0)return!1;const h=c.filter((g=>!(g.command in Ui)));if(h.length>0)throw new Error(`Unimplemented: ${h.map((g=>g.command)).join(", ")}.`);for(const g of c)g.command!=="setTransition"&&this[g.command].apply(this,g.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,n){if(this.getImage(t))return this.fire(new l.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new l.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 l.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,s={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(l.y.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new Mi(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,(()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t}))),c.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 s in this._layers)if(this._layers[s].source===t)return this.fire(new l.j(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new l.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const s=this.sourceCaches[t].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,s={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new l.j(new Error(`Layer "${c}" already exists on this map.`)));let h;if(t.type==="custom"){if(fi(this,l.aF(t)))return;h=l.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(c,t.source),t=l.aD(t),t=l.e(t,{source:c})),this._validate(l.y.layer,`layers.${c}`,t,{arrayIndex:-1},s))return;h=l.aC(t),this._validateLayer(h),h.setEventedParent(this,{layer:{id:c}})}const g=n?this._order.indexOf(n):this._order.length;if(n&&g===-1)this.fire(new l.j(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(g,0,c),this._layerOrderChanged=!0,this._layers[c]=h,this._removedLayers[c]&&h.source&&h.type!=="custom"){const _=this._removedLayers[c];delete this._removedLayers[c],_.type!==h.type?this._updatedSources[h.source]="clear":(this._updatedSources[h.source]="reload",this.sourceCaches[h.source].pause())}this._updateLayer(h),h.onAdd&&h.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new l.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const s=this._order.indexOf(t);this._order.splice(s,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new l.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new l.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,s){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===s||(n!=null&&(c.minzoom=n),s!=null&&(c.maxzoom=s),this._updateLayer(c)):this.fire(new l.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,s={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!l.aG(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(l.y.filter,`layers.${c.id}.filter`,n,null,s)||(c.filter=l.aD(n),this._updateLayer(c)))}else this.fire(new l.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return l.aD(this.getLayer(t).filter)}setLayoutProperty(t,n,s,c={}){this._checkLoaded();const h=this.getLayer(t);h?l.aG(h.getLayoutProperty(n),s)||(h.setLayoutProperty(n,s,c),this._updateLayer(h)):this.fire(new l.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const s=this.getLayer(t);if(s)return s.getLayoutProperty(n);this.fire(new l.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,c={}){this._checkLoaded();const h=this.getLayer(t);h?l.aG(h.getPaintProperty(n),s)||(h.setPaintProperty(n,s,c)&&this._updateLayer(h),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new l.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const s=t.source,c=t.sourceLayer,h=this.sourceCaches[s];if(h===void 0)return void this.fire(new l.j(new Error(`The source '${s}' does not exist in the map's style.`)));const g=h.getSource().type;g==="geojson"&&c?this.fire(new l.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||c?(t.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),h.setFeatureState(c,t.id,n)):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const s=t.source,c=this.sourceCaches[s];if(c===void 0)return void this.fire(new l.j(new Error(`The source '${s}' does not exist in the map's style.`)));const h=c.getSource().type,g=h==="vector"?t.sourceLayer:void 0;h!=="vector"||g?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new l.j(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(g,t.id,n):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,s=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||s?(t.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),c.getFeatureState(s,t.id)):void this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new l.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return l.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=l.aH(this.sourceCaches,(h=>h.serialize())),n=this._serializeByIds(this._order),s=this.map.getTerrain()||void 0,c=this.stylesheet;return l.aI({version:c.version,name:c.name,metadata:c.metadata,light:c.light,center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,sprite:c.sprite,glyphs:c.glyphs,transition:c.transition,sources:t,layers:n,terrain:s},(h=>h!==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 n=g=>this._layers[g].type==="fill-extrusion",s={},c=[];for(let g=this._order.length-1;g>=0;g--){const _=this._order[g];if(n(_)){s[_]=g;for(const x of t){const b=x[_];if(b)for(const S of b)c.push(S)}}}c.sort(((g,_)=>_.intersectionZ-g.intersectionZ));const h=[];for(let g=this._order.length-1;g>=0;g--){const _=this._order[g];if(n(_))for(let x=c.length-1;x>=0;x--){const b=c[x].feature;if(s[b.layer.id]{const xe=Q.featureSortOrder;if(xe){const ye=xe.indexOf(ce.featureIndex);return xe.indexOf(me.featureIndex)-ye}return me.featureIndex-ce.featureIndex}));for(const ce of le)ee.push(ce)}}for(const Q in O)O[Q].forEach((se=>{const G=se.feature,ee=b[_[Q].source].getFeatureState(G.layer["source-layer"],G.id);G.source=G.layer.source,G.layer["source-layer"]&&(G.sourceLayer=G.layer["source-layer"]),G.state=ee}));return O})(this._layers,g,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(h)}querySourceFeatures(t,n){n&&n.filter&&this._validate(l.y.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[t];return s?(function(c,h){const g=c.getRenderableIds().map((b=>c.getTileByID(b))),_=[],x={};for(let b=0;b{ua[c]=h})(t,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},s):s(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const s=this.light.getLight();let c=!1;for(const g in t)if(!l.aG(t[g],s[g])){c=!0;break}if(!c)return;const h={now:l.h.now(),transition:l.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(h)}_validate(t,n,s,c,h={}){return(!h||h.validate!==!1)&&fi(this,t.call(l.y,l.e({key:n,style:this.serialize(),value:s,styleSpec:l.v},c)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const s=this.sourceCaches[n];s.setEventedParent(null),s.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 n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,s,c,h=!1){let g=!1,_=!1;const x={};for(const b of this._order){const S=this._layers[b];if(S.type!=="symbol")continue;if(!x[S.source]){const M=this.sourceCaches[S.source];x[S.source]=M.getRenderableIds(!0).map((N=>M.getTileByID(N))).sort(((N,O)=>O.tileID.overscaledZ-N.tileID.overscaledZ||(N.tileID.isLessThan(O.tileID)?-1:1)))}const T=this.crossTileSymbolIndex.addLayer(S,x[S.source],t.center.lng);g=g||T}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((h=h||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.h.now(),t.zoom))&&(this.pauseablePlacement=new Nn(t,this.map.terrain,this._order,h,n,s,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,x),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.h.now()),_=!0),g&&this.pauseablePlacement.placement.setStale()),_||g)for(const b of this._order){const S=this._layers[b];S.type==="symbol"&&this.placement.updateLayerOpacities(S,x[S.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,s){this.imageManager.getImages(n.icons,s),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,s){this.glyphManager.getGlyphs(n.stacks,s);const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,s){return l.m(n,s)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(l.y.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,s={},c){this._checkLoaded();const h=[{id:t,url:n}],g=[...oi(this.stylesheet.sprite),...h];this._validate(l.y.sprite,"sprite",g,null,s)||(this.stylesheet.sprite=g,this._loadSprite(h,!0,c))}removeSprite(t){this._checkLoaded();const n=oi(this.stylesheet.sprite);if(n.find((s=>s.id===t))){if(this._spritesImagesIds[t])for(const s of this._spritesImagesIds[t])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex((s=>s.id===t)),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}else this.fire(new l.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return oi(this.stylesheet.sprite)}setSprite(t,n={},s){this._checkLoaded(),t&&this._validate(l.y.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,s):(this._unloadSprite(),s&&s(null)))}}ci.registerForPluginStateChange=l.aK;var Ua=l.Q([{name:"a_pos",type:"Int16",components:2}]),Un="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 Dt={prelude:mt(`#ifdef GL_ES +(function(){"use strict";function sd(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var Bo={exports:{}},od=Bo.exports,xu;function ld(){return xu||(xu=1,(function(d,S){(function(M,L){d.exports=L()})(od,(function(){var M,L,R;function ee(l,ue){if(!M)M=ue;else if(!L)L=ue;else{var X="var sharedChunk = {}; ("+M+")(sharedChunk); ("+L+")(sharedChunk);",Fe={};M(Fe),R=ue(Fe),typeof window<"u"&&(R.workerUrl=window.URL.createObjectURL(new Blob([X],{type:"text/javascript"})))}}ee(["exports"],(function(l){function ue(i,e,r,a){return new(r||(r=Promise))((function(o,p){function f(v){try{y(a.next(v))}catch(w){p(w)}}function m(v){try{y(a.throw(v))}catch(w){p(w)}}function y(v){var w;v.done?o(v.value):(w=v.value,w instanceof r?w:new r((function(A){A(w)}))).then(f,m)}y((a=a.apply(i,e||[])).next())}))}function X(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Fe=be;function be(i,e){this.x=i,this.y=e}be.prototype={clone:function(){return new be(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},be.convert=function(i){return i instanceof be?i:Array.isArray(i)?new be(i[0],i[1]):i};var ye=X(Fe),we=Re;function Re(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-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=i,this.p1y=e,this.p2x=r,this.p2y=a}Re.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)o?f=r:m=r,r=.5*(m-f)+f;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var We=X(we);let nt,st;function tt(){return nt==null&&(nt=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),nt}function gr(){if(st==null&&(st=!1,tt())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let a=0;a<25;a++){const o=4*a;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(a%5,Math.floor(a/5),1,1)}const r=e.getImageData(0,0,5,5).data;for(let a=0;a<100;a++)if(a%4!=3&&r[a]!==a){st=!0;break}}}return st||!1}function un(i,e,r,a){const o=new We(i,e,r,a);return function(p){return o.solve(p)}}const Zr=un(.25,.1,.25,1);function it(i,e,r){return Math.min(r,Math.max(e,i))}function It(i,e,r){const a=r-e,o=((i-e)%a+a)%a+e;return o===e?r:o}function vt(i,...e){for(const r of e)for(const a in r)i[a]=r[a];return i}let _r=1;function Ft(i,e,r){const a={};for(const o in i)a[o]=e.call(r||this,i[o],o,i);return a}function Fn(i,e,r){const a={};for(const o in i)e.call(r||this,i[o],o,i)&&(a[o]=i[o]);return a}function ur(i){return Array.isArray(i)?i.map(ur):typeof i=="object"&&i?Ft(i,ur):i}const Gr={};function bi(i){Gr[i]||(typeof console<"u"&&console.warn(i),Gr[i]=!0)}function Ui(i,e,r){return(r.y-i.y)*(e.x-i.x)>(e.y-i.y)*(r.x-i.x)}function Er(i){let e=0;for(let r,a,o=0,p=i.length,f=p-1;o"u")throw new Error("VideoFrame not supported");const p=new VideoFrame(i,{timestamp:0});try{const f=p==null?void 0:p.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);const m=f.startsWith("BGR"),y=new Uint8ClampedArray(a*o*4);if(yield p.copyTo(y,(function(v,w,A,k,z){const D=4*Math.max(-w,0),O=(Math.max(0,A)-A)*k*4+D,q=4*k,H=Math.max(0,w),re=Math.max(0,A);return{rect:{x:H,y:re,width:Math.min(v.width,w+k)-H,height:Math.min(v.height,A+z)-re},layout:[{offset:O,stride:q}]}})(i,e,r,a,o)),m)for(let v=0;vcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),r=e.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,r.drawImage(i,0,0,i.width,i.height),r},resolveURL:i=>(Ei||(Ei=document.createElement("a")),Ei.href=i,Ei.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(pn==null&&(pn=matchMedia("(prefers-reduced-motion: reduce)")),pn.matches)}},Bn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class Hr extends Error{constructor(e,r,a,o){super(`AJAXError: ${r} (${e}): ${a}`),this.status=e,this.statusText=r,this.url=a,this.body=o}}const hr=Qi()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,er=i=>Bn.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function ua(i,e){const r=new AbortController,a=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:hr(),signal:r.signal});let o=!1,p=!1;return i.type==="json"&&a.headers.set("Accept","application/json"),p||fetch(a).then((f=>f.ok?(m=>{(i.type==="arrayBuffer"||i.type==="image"?m.arrayBuffer():i.type==="json"?m.json():m.text()).then((y=>{p||(o=!0,e(null,y,m.headers.get("Cache-Control"),m.headers.get("Expires")))})).catch((y=>{p||e(new Error(y.message))}))})(f):f.blob().then((m=>e(new Hr(f.status,f.statusText,i.url,m)))))).catch((f=>{f.code!==20&&e(new Error(f.message))})),{cancel:()=>{p=!0,o||r.abort()}}}const Wr=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Qi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Qi())return(er(i.url)||ua)(i,e)}if(!(/^file:/.test(r=i.url)||/^file:/.test(hr())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ua(i,e);if(Qi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var r;return(function(a,o){const p=new XMLHttpRequest;p.open(a.method||"GET",a.url,!0),a.type!=="arrayBuffer"&&a.type!=="image"||(p.responseType="arraybuffer");for(const f in a.headers)p.setRequestHeader(f,a.headers[f]);return a.type==="json"&&(p.responseType="text",p.setRequestHeader("Accept","application/json")),p.withCredentials=a.credentials==="include",p.onerror=()=>{o(new Error(p.statusText))},p.onload=()=>{if((p.status>=200&&p.status<300||p.status===0)&&p.response!==null){let f=p.response;if(a.type==="json")try{f=JSON.parse(p.response)}catch(m){return o(m)}o(null,f,p.getResponseHeader("Cache-Control"),p.getResponseHeader("Expires"))}else{const f=new Blob([p.response],{type:p.getResponseHeader("Content-Type")});o(new Hr(p.status,p.statusText,a.url,f))}},p.send(a.body),{cancel:()=>p.abort()}})(i,e)},ha=function(i,e){return Wr(vt(i,{type:"arrayBuffer"}),e)};function Pr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),r=window.location;return e.protocol===r.protocol&&e.host===r.host}function On(i,e,r){r[i]&&r[i].indexOf(e)!==-1||(r[i]=r[i]||[],r[i].push(e))}function dn(i,e,r){if(r&&r[i]){const a=r[i].indexOf(e);a!==-1&&r[i].splice(a,1)}}class Xr{constructor(e,r={}){vt(this,r),this.type=e}}class Kr extends Xr{constructor(e,r={}){super("error",vt({error:e},r))}}class fn{on(e,r){return this._listeners=this._listeners||{},On(e,r,this._listeners),this}off(e,r){return dn(e,r,this._listeners),dn(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},On(e,r,this._oneTimeListeners),this):new Promise((a=>this.once(e,a)))}fire(e,r){typeof e=="string"&&(e=new Xr(e,r||{}));const a=e.type;if(this.listens(a)){e.target=this;const o=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const m of o)m.call(this,e);const p=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const m of p)dn(a,m,this._oneTimeListeners),m.call(this,e);const f=this._eventedParent;f&&(vt(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),f.fire(e))}else e instanceof Kr&&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,r){return this._eventedParent=e,this._eventedParentData=r,this}}var he={$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 Pi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function tr(i,e){const r={};for(const a in i)a!=="ref"&&(r[a]=i[a]);return Pi.forEach((a=>{a in e&&(r[a]=e[a])})),r}function At(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let r=0;r`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const ne=[Dr,Ce,rt,Ye,wi,U,br,j(Qe),C,E,F];function J(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!J(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const r of ne)if(!J(r,e))return null}}return`Expected ${Z(i)} but found ${Z(e)} instead.`}function W(i,e){return e.some((r=>r.kind===i.kind))}function ie(i,e){return e.some((r=>r==="null"?i===null:r==="array"?Array.isArray(i):r==="object"?i&&!Array.isArray(i)&&typeof i=="object":r===typeof i))}function pe(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const de=.96422,ge=.82521,je=4/29,Ke=6/29,Be=3*Ke*Ke,Ze=Ke*Ke*Ke,Je=Math.PI/180,xt=180/Math.PI;function St(i){return(i%=360)<0&&(i+=360),i}function ft([i,e,r,a]){let o,p;const f=fi((.2225045*(i=dt(i))+.7168786*(e=dt(e))+.0606169*(r=dt(r)))/1);i===e&&e===r?o=p=f:(o=fi((.4360747*i+.3850649*e+.1430804*r)/de),p=fi((.0139322*i+.0971045*e+.7141733*r)/ge));const m=116*f-16;return[m<0?0:m,500*(o-f),200*(f-p),a]}function dt(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function fi(i){return i>Ze?Math.pow(i,1/3):i/Be+je}function Ct([i,e,r,a]){let o=(i+16)/116,p=isNaN(e)?o:o+e/500,f=isNaN(r)?o:o-r/200;return o=1*ci(o),p=de*ci(p),f=ge*ci(f),[Kt(3.1338561*p-1.6168667*o-.4906146*f),Kt(-.9787684*p+1.9161415*o+.033454*f),Kt(.0719453*p-.2289914*o+1.4052427*f),a]}function Kt(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function ci(i){return i>Ke?i*i*i:Be*(i-je)}function ir(i){return parseInt(i.padEnd(2,i),16)/255}function qo(i,e){return Un(e?i/100:i,0,1)}function Un(i,e,r){return Math.min(Math.max(e,i),r)}function $n(i){return!i.some(Number.isNaN)}const pc={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,r,a,o=1,p=!0){this.r=e,this.g=r,this.b=a,this.a=o,p||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,r,a,o]))}static parse(e){if(e instanceof bt)return e;if(typeof e!="string")return;const r=(function(a){if((a=a.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=pc[a];if(o){const[f,m,y]=o;return[f/255,m/255,y/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const f=a.length<6?1:2;let m=1;return[ir(a.slice(m,m+=f)),ir(a.slice(m,m+=f)),ir(a.slice(m,m+=f)),ir(a.slice(m,m+f)||"ff")]}if(a.startsWith("rgb")){const f=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){const[m,y,v,w,A,k,z,D,O,q,H,re]=f,Y=[w||" ",z||" ",q].join("");if(Y===" "||Y===" /"||Y===",,"||Y===",,,"){const ae=[v,k,O].join(""),oe=ae==="%%%"?100:ae===""?255:0;if(oe){const me=[Un(+y/oe,0,1),Un(+A/oe,0,1),Un(+D/oe,0,1),H?qo(+H,re):1];if($n(me))return me}}return}}const p=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(p){const[f,m,y,v,w,A,k,z,D]=p,O=[y||" ",w||" ",k].join("");if(O===" "||O===" /"||O===",,"||O===",,,"){const q=[+m,Un(+v,0,100),Un(+A,0,100),z?qo(+z,D):1];if($n(q))return(function([H,re,Y,ae]){function oe(me){const ze=(me+H/30)%12,Ne=re*Math.min(Y,1-Y);return Y-Ne*Math.max(-1,Math.min(ze-3,9-ze,1))}return H=St(H),re/=100,Y/=100,[oe(0),oe(8),oe(4),ae]})(q)}}})(e);return r?new bt(...r,!1):void 0}get rgb(){const{r:e,g:r,b:a,a:o}=this,p=o||1/0;return this.overwriteGetter("rgb",[e/p,r/p,a/p,o])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[r,a,o,p]=ft(e),f=Math.sqrt(a*a+o*o);return[Math.round(1e4*f)?St(Math.atan2(o,a)*xt):NaN,f,r,p]})(this.rgb))}get lab(){return this.overwriteGetter("lab",ft(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){const[e,r,a,o]=this.rgb;return`rgba(${[e,r,a].map((p=>Math.round(255*p))).join(",")},${o})`}}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 Es{constructor(e,r,a){this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Va{constructor(e,r,a,o,p){this.text=e,this.image=r,this.scale=a,this.fontStack=o,this.textColor=p}}class mi{constructor(e){this.sections=e}static fromString(e){return new mi([new Va(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 mi?e:mi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class $i{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof $i)return e;if(typeof e=="number")return new $i([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const r of e)if(typeof r!="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 $i(e)}}toString(){return JSON.stringify(this.values)}}const dc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class rr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof rr)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let r=0;r=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:`Invalid rgba value [${[i,e,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof a=="number"?[i,e,r,a]:[i,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function jn(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof bt||i instanceof Es||i instanceof mi||i instanceof $i||i instanceof rr||i instanceof ui)return!0;if(Array.isArray(i)){for(const e of i)if(!jn(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!jn(i[e]))return!1;return!0}return!1}function Rt(i){if(i===null)return Dr;if(typeof i=="string")return rt;if(typeof i=="boolean")return Ye;if(typeof i=="number")return Ce;if(i instanceof bt)return wi;if(i instanceof Es)return Lr;if(i instanceof mi)return U;if(i instanceof $i)return C;if(i instanceof rr)return F;if(i instanceof ui)return E;if(Array.isArray(i)){const e=i.length;let r;for(const a of i){const o=Rt(a);if(r){if(r===o)continue;r=Qe;break}r=o}return j(r||Qe,e)}return br}function gt(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof bt||i instanceof mi||i instanceof $i||i instanceof rr||i instanceof ui?i.toString():JSON.stringify(i)}class _n{constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!jn(e[1]))return r.error("invalid value");const a=e[1];let o=Rt(a);const p=r.expectedType;return o.kind!=="array"||o.N!==0||!p||p.kind!=="array"||typeof p.N=="number"&&p.N!==0||(o=p),new _n(o,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ut{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const $a={string:rt,number:Ce,boolean:Ye,object:br};class nr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let a,o=1;const p=e[0];if(p==="array"){let m,y;if(e.length>2){const v=e[1];if(typeof v!="string"||!(v in $a)||v==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=$a[v],o++}else m=Qe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);y=e[2],o++}a=j(m,y)}else{if(!$a[p])throw new Error(`Types doesn't contain name = ${p}`);a=$a[p]}const f=[];for(;oe.outputDefined()))}}const Ps={"to-boolean":Ye,"to-color":wi,"to-number":Ce,"to-string":rt};class Jr{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[0];if(!Ps[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 r.error("Expected one argument.");const o=Ps[a],p=[];for(let f=1;f4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:Ua(r[0],r[1],r[2],r[3]),!a))return new bt(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Ut(a||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(e);const o=$i.parse(r);if(o)return o}throw new Ut(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(e);const o=rr.parse(r);if(o)return o}throw new Ut(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(e),r===null)return 0;const o=Number(r);if(!isNaN(o))return o}throw new Ut(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return mi.fromString(gt(this.args[0].evaluate(e)));case"resolvedImage":return ui.fromString(gt(this.args[0].evaluate(e)));default:return gt(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const Zo=["Unknown","Point","LineString","Polygon"];class zs{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"?Zo[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 r=this._parseColorCache[e];return r||(r=this._parseColorCache[e]=bt.parse(e)),r}}class ja{constructor(e,r,a=[],o,p=new gn,f=[]){this.registry=e,this.path=a,this.key=a.map((m=>`[${m}]`)).join(""),this.scope=p,this.errors=f,this.expectedType=o,this._isConstant=r}parse(e,r,a,o,p={}){return r?this.concat(r,a,o)._parse(e,p):this._parse(e,p)}_parse(e,r){function a(o,p,f){return f==="assert"?new nr(p,[o]):f==="coerce"?new Jr(p,[o]):o}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 o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const p=this.registry[o];if(p){let f=p.parse(e,this);if(!f)return null;if(this.expectedType){const m=this.expectedType,y=f.type;if(m.kind!=="string"&&m.kind!=="number"&&m.kind!=="boolean"&&m.kind!=="object"&&m.kind!=="array"||y.kind!=="value")if(m.kind!=="color"&&m.kind!=="formatted"&&m.kind!=="resolvedImage"||y.kind!=="value"&&y.kind!=="string")if(m.kind!=="padding"||y.kind!=="value"&&y.kind!=="number"&&y.kind!=="array")if(m.kind!=="variableAnchorOffsetCollection"||y.kind!=="value"&&y.kind!=="array"){if(this.checkSubtype(m,y))return null}else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"assert")}if(!(f instanceof _n)&&f.type.kind!=="resolvedImage"&&this._isConstant(f)){const m=new zs;try{f=new _n(f.type,f.evaluate(m))}catch(y){return this.error(y.message),null}}return f}return this.error(`Unknown expression "${o}". 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,r,a){const o=typeof e=="number"?this.path.concat(e):this.path,p=a?this.scope.concat(a):this.scope;return new ja(this.registry,this._isConstant,o,r||null,p,this.errors)}error(e,...r){const a=`${this.key}${r.map((o=>`[${o}]`)).join("")}`;this.errors.push(new Vt(a,e))}checkSubtype(e,r){const a=J(e,r);return a&&this.error(a),a}}class qa{constructor(e,r,a){this.type=Lr,this.locale=a,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");const a=e[1];if(typeof a!="object"||Array.isArray(a))return r.error("Collator options argument must be an object.");const o=r.parse(a["case-sensitive"]!==void 0&&a["case-sensitive"],1,Ye);if(!o)return null;const p=r.parse(a["diacritic-sensitive"]!==void 0&&a["diacritic-sensitive"],1,Ye);if(!p)return null;let f=null;return a.locale&&(f=r.parse(a.locale,1,rt),!f)?null:new qa(o,p,f)}evaluate(e){return new Es(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 Qr=8192;function Ds(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function pa(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Go(i,e){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(r*o*Qr),Math.round(a*o*Qr)]}function fc(i,e,r){const a=i[0]-e[0],o=i[1]-e[1],p=i[0]-r[0],f=i[1]-r[1];return a*f-p*o==0&&a*p<=0&&o*f<=0}function Ls(i,e){let r=!1;for(let f=0,m=e.length;f(a=i)[1]!=(p=y[v+1])[1]>a[1]&&a[0]<(p[0]-o[0])*(a[1]-o[1])/(p[1]-o[1])+o[0]&&(r=!r)}}var a,o,p;return r}function Fs(i,e){for(let r=0;r0&&m<0||f<0&&m>0}function mc(i,e,r){for(const v of r)for(let w=0;wr[2]){const o=.5*a;let p=i[0]-r[0]>o?-a:r[0]-i[0]>o?a:0;p===0&&(p=i[0]-r[2]>o?-a:r[2]-i[0]>o?a:0),i[0]+=p}Ds(e,i)}function Rs(i,e,r,a){const o=Math.pow(2,a.z)*Qr,p=[a.x*Qr,a.y*Qr],f=[];for(const m of i)for(const y of m){const v=[y.x+p[0],y.y+p[1]];Yo(v,e,r,o),f.push(v)}return f}function Bs(i,e,r,a){const o=Math.pow(2,a.z)*Qr,p=[a.x*Qr,a.y*Qr],f=[];for(const y of i){const v=[];for(const w of y){const A=[w.x+p[0],w.y+p[1]];Ds(e,A),v.push(A)}f.push(v)}if(e[2]-e[0]<=o/2){(m=e)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const y of f)for(const v of y)Yo(v,e,r,o)}var m;return f}class yn{constructor(e,r){this.type=Ye,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(jn(e[1])){const a=e[1];if(a.type==="FeatureCollection")for(let o=0;o!Array.isArray(v)||v.length===e.length-1));let y=null;for(const[v,w]of m){y=new ja(r.registry,Ha,r.path,null,r.scope);const A=[];let k=!1;for(let z=1;z{return k=A,Array.isArray(k)?`(${k.map(Z).join(", ")})`:`(${Z(k.type)}...)`;var k})).join(" | "),w=[];for(let A=1;A{r=e?r&&Ha(a):r&&a instanceof _n})),!!r&&Wa(i)&&Xa(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Wa(i){if(i instanceof ar&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof yn)return!1;let e=!0;return i.eachChild((r=>{e&&!Wa(r)&&(e=!1)})),e}function da(i){if(i instanceof ar&&i.name==="feature-state")return!1;let e=!0;return i.eachChild((r=>{e&&!da(r)&&(e=!1)})),e}function Xa(i,e){if(i instanceof ar&&e.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild((a=>{r&&!Xa(a,e)&&(r=!1)})),r}function qn(i,e){const r=i.length-1;let a,o,p=0,f=r,m=0;for(;p<=f;)if(m=Math.floor((p+f)/2),a=i[m],o=i[m+1],a<=e){if(m===r||ee))throw new Ut("Input is not a number.");f=m-1}return 0}class en{constructor(e,r,a){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[o,p]of a)this.labels.push(o),this.outputs.push(p)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(e[1],1,Ce);if(!a)return null;const o=[];let p=null;r.expectedType&&r.expectedType.kind!=="value"&&(p=r.expectedType);for(let f=1;f=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',v);const A=r.parse(y,w,p);if(!A)return null;p=p||A.type,o.push([m,A])}return new en(p,a,o)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const p=r.length;return o>=r[p-1]?a[p-1].evaluate(e):a[qn(r,o)].evaluate(e)}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function ht(i,e,r){return i+r*(e-i)}function Ka(i,e,r){return i.map(((a,o)=>ht(a,e[o],r)))}const ji={number:ht,color:function(i,e,r,a="rgb"){switch(a){case"rgb":{const[o,p,f,m]=Ka(i.rgb,e.rgb,r);return new bt(o,p,f,m,!1)}case"hcl":{const[o,p,f,m]=i.hcl,[y,v,w,A]=e.hcl;let k,z;if(isNaN(o)||isNaN(y))isNaN(o)?isNaN(y)?k=NaN:(k=y,f!==1&&f!==0||(z=v)):(k=o,w!==1&&w!==0||(z=p));else{let re=y-o;y>o&&re>180?re-=360:y180&&(re+=360),k=o+r*re}const[D,O,q,H]=(function([re,Y,ae,oe]){return re=isNaN(re)?0:re*Je,Ct([ae,Math.cos(re)*Y,Math.sin(re)*Y,oe])})([k,z??ht(p,v,r),ht(f,w,r),ht(m,A,r)]);return new bt(D,O,q,H,!1)}case"lab":{const[o,p,f,m]=Ct(Ka(i.lab,e.lab,r));return new bt(o,p,f,m,!1)}}},array:Ka,padding:function(i,e,r){return new $i(Ka(i.values,e.values,r))},variableAnchorOffsetCollection:function(i,e,r){const a=i.values,o=e.values;if(a.length!==o.length)throw new Ut(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const p=[];for(let f=0;ftypeof w!="number"||w<0||w>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:v}}}if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(p=r.parse(p,2,Ce),!p)return null;const m=[];let y=null;a==="interpolate-hcl"||a==="interpolate-lab"?y=wi:r.expectedType&&r.expectedType.kind!=="value"&&(y=r.expectedType);for(let v=0;v=w)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',k);const D=r.parse(A,z,y);if(!D)return null;y=y||D.type,m.push([w,D])}return pe(y,Ce)||pe(y,wi)||pe(y,C)||pe(y,F)||pe(y,j(Ce))?new qi(y,a,o,p,m):r.error(`Type ${Z(y)} is not interpolatable.`)}evaluate(e){const r=this.labels,a=this.outputs;if(r.length===1)return a[0].evaluate(e);const o=this.input.evaluate(e);if(o<=r[0])return a[0].evaluate(e);const p=r.length;if(o>=r[p-1])return a[p-1].evaluate(e);const f=qn(r,o),m=qi.interpolationFactor(this.interpolation,o,r[f],r[f+1]),y=a[f].evaluate(e),v=a[f+1].evaluate(e);switch(this.operator){case"interpolate":return ji[this.type.kind](y,v,m);case"interpolate-hcl":return ji.color(y,v,m,"hcl");case"interpolate-lab":return ji.color(y,v,m,"lab")}}eachChild(e){e(this.input);for(const r of this.outputs)e(r)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Os(i,e,r,a){const o=a-r,p=i-r;return o===0?0:e===1?p/o:(Math.pow(e,p)-1)/(Math.pow(e,o)-1)}class Ya{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let a=null;const o=r.expectedType;o&&o.kind!=="value"&&(a=o);const p=[];for(const m of e.slice(1)){const y=r.parse(m,1+p.length,a,void 0,{typeAnnotation:"omit"});if(!y)return null;a=a||y.type,p.push(y)}if(!a)throw new Error("No output type");const f=o&&p.some((m=>J(o,m.type)));return new Ya(f?Qe:a,p)}evaluate(e){let r,a=null,o=0;for(const p of this.args)if(o++,a=p.evaluate(e),a&&a instanceof ui&&!a.available&&(r||(r=a.name),a=null,o===this.args.length&&(a=r)),a!==null)break;return a}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}class Ja{constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const a=[];for(let p=1;p=a.length)throw new Ut(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Ut(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Vs{constructor(e,r){this.type=Ye,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Qe),o=r.parse(e[2],2,Qe);return a&&o?W(a.type,[Ye,rt,Ce,Dr,Qe])?new Vs(a,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Z(a.type)} instead`):null}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!a)return!1;if(!ie(r,["boolean","string","number","null"]))throw new Ut(`Expected first argument to be of type boolean, string, number or null, but found ${Z(Rt(r))} instead.`);if(!ie(a,["string","array"]))throw new Ut(`Expected second argument to be of type array or string, but found ${Z(Rt(a))} instead.`);return a.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Qa{constructor(e,r,a){this.type=Ce,this.needle=e,this.haystack=r,this.fromIndex=a}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Qe),o=r.parse(e[2],2,Qe);if(!a||!o)return null;if(!W(a.type,[Ye,rt,Ce,Dr,Qe]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${Z(a.type)} instead`);if(e.length===4){const p=r.parse(e[3],3,Ce);return p?new Qa(a,o,p):null}return new Qa(a,o)}evaluate(e){const r=this.needle.evaluate(e),a=this.haystack.evaluate(e);if(!ie(r,["boolean","string","number","null"]))throw new Ut(`Expected first argument to be of type boolean, string, number or null, but found ${Z(Rt(r))} instead.`);if(!ie(a,["string","array"]))throw new Ut(`Expected second argument to be of type array or string, but found ${Z(Rt(a))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(e);return a.indexOf(r,o)}return a.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Us{constructor(e,r,a,o,p,f){this.inputType=e,this.type=r,this.input=a,this.cases=o,this.outputs=p,this.otherwise=f}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return r.error("Expected an even number of arguments.");let a,o;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);const p={},f=[];for(let v=2;vNumber.MAX_SAFE_INTEGER)return k.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof D=="number"&&Math.floor(D)!==D)return k.error("Numeric branch labels must be integer values.");if(a){if(k.checkSubtype(a,Rt(D)))return null}else a=Rt(D);if(p[String(D)]!==void 0)return k.error("Branch labels must be unique.");p[String(D)]=f.length}const z=r.parse(A,v,o);if(!z)return null;o=o||z.type,f.push(z)}const m=r.parse(e[1],1,Qe);if(!m)return null;const y=r.parse(e[e.length-1],e.length-1,o);return y?m.type.kind!=="value"&&r.concat(1).checkSubtype(a,m.type)?null:new Us(a,o,m,p,f,y):null}evaluate(e){const r=this.input.evaluate(e);return(Rt(r)===this.inputType&&this.outputs[this.cases[r]]||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 $s{constructor(e,r,a){this.type=e,this.branches=r,this.otherwise=a}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&r.expectedType.kind!=="value"&&(a=r.expectedType);const o=[];for(let f=1;fr.outputDefined()))&&this.otherwise.outputDefined()}}class es{constructor(e,r,a,o){this.type=e,this.input=r,this.beginIndex=a,this.endIndex=o}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const a=r.parse(e[1],1,Qe),o=r.parse(e[2],2,Ce);if(!a||!o)return null;if(!W(a.type,[j(Qe),rt,Qe]))return r.error(`Expected first argument to be of type array or string, but found ${Z(a.type)} instead`);if(e.length===4){const p=r.parse(e[3],3,Ce);return p?new es(a.type,a,o,p):null}return new es(a.type,a,o)}evaluate(e){const r=this.input.evaluate(e),a=this.beginIndex.evaluate(e);if(!ie(r,["string","array"]))throw new Ut(`Expected first argument to be of type array or string, but found ${Z(Rt(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(e);return r.slice(a,o)}return r.slice(a)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Jo(i,e){return i==="=="||i==="!="?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 Qo(i,e,r,a){return a.compare(e,r)===0}function Zn(i,e,r){const a=i!=="=="&&i!=="!=";return class ad{constructor(p,f,m){this.type=Ye,this.lhs=p,this.rhs=f,this.collator=m,this.hasUntypedArgument=p.type.kind==="value"||f.type.kind==="value"}static parse(p,f){if(p.length!==3&&p.length!==4)return f.error("Expected two or three arguments.");const m=p[0];let y=f.parse(p[1],1,Qe);if(!y)return null;if(!Jo(m,y.type))return f.concat(1).error(`"${m}" comparisons are not supported for type '${Z(y.type)}'.`);let v=f.parse(p[2],2,Qe);if(!v)return null;if(!Jo(m,v.type))return f.concat(2).error(`"${m}" comparisons are not supported for type '${Z(v.type)}'.`);if(y.type.kind!==v.type.kind&&y.type.kind!=="value"&&v.type.kind!=="value")return f.error(`Cannot compare types '${Z(y.type)}' and '${Z(v.type)}'.`);a&&(y.type.kind==="value"&&v.type.kind!=="value"?y=new nr(v.type,[y]):y.type.kind!=="value"&&v.type.kind==="value"&&(v=new nr(y.type,[v])));let w=null;if(p.length===4){if(y.type.kind!=="string"&&v.type.kind!=="string"&&y.type.kind!=="value"&&v.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(w=f.parse(p[3],3,Lr),!w)return null}return new ad(y,v,w)}evaluate(p){const f=this.lhs.evaluate(p),m=this.rhs.evaluate(p);if(a&&this.hasUntypedArgument){const y=Rt(f),v=Rt(m);if(y.kind!==v.kind||y.kind!=="string"&&y.kind!=="number")throw new Ut(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${y.kind}, ${v.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const y=Rt(f),v=Rt(m);if(y.kind!=="string"||v.kind!=="string")return e(p,f,m)}return this.collator?r(p,f,m,this.collator.evaluate(p)):e(p,f,m)}eachChild(p){p(this.lhs),p(this.rhs),this.collator&&p(this.collator)}outputDefined(){return!0}}}const gc=Zn("==",(function(i,e,r){return e===r}),Qo),_c=Zn("!=",(function(i,e,r){return e!==r}),(function(i,e,r,a){return!Qo(0,e,r,a)})),yc=Zn("<",(function(i,e,r){return e",(function(i,e,r){return e>r}),(function(i,e,r,a){return a.compare(e,r)>0})),vc=Zn("<=",(function(i,e,r){return e<=r}),(function(i,e,r,a){return a.compare(e,r)<=0})),bc=Zn(">=",(function(i,e,r){return e>=r}),(function(i,e,r,a){return a.compare(e,r)>=0}));class js{constructor(e,r,a,o,p){this.type=rt,this.number=e,this.locale=r,this.currency=a,this.minFractionDigits=o,this.maxFractionDigits=p}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");const a=r.parse(e[1],1,Ce);if(!a)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let p=null;if(o.locale&&(p=r.parse(o.locale,1,rt),!p))return null;let f=null;if(o.currency&&(f=r.parse(o.currency,1,rt),!f))return null;let m=null;if(o["min-fraction-digits"]&&(m=r.parse(o["min-fraction-digits"],1,Ce),!m))return null;let y=null;return o["max-fraction-digits"]&&(y=r.parse(o["max-fraction-digits"],1,Ce),!y)?null:new js(a,p,f,m,y)}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 ts{constructor(e){this.type=U,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");const a=e[1];if(!Array.isArray(a)&&typeof a=="object")return r.error("First argument must be an image or text section.");const o=[];let p=!1;for(let f=1;f<=e.length-1;++f){const m=e[f];if(p&&typeof m=="object"&&!Array.isArray(m)){p=!1;let y=null;if(m["font-scale"]&&(y=r.parse(m["font-scale"],1,Ce),!y))return null;let v=null;if(m["text-font"]&&(v=r.parse(m["text-font"],1,j(rt)),!v))return null;let w=null;if(m["text-color"]&&(w=r.parse(m["text-color"],1,wi),!w))return null;const A=o[o.length-1];A.scale=y,A.font=v,A.textColor=w}else{const y=r.parse(e[f],1,Qe);if(!y)return null;const v=y.type.kind;if(v!=="string"&&v!=="value"&&v!=="null"&&v!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");p=!0,o.push({content:y,scale:null,font:null,textColor:null})}}return new ts(o)}evaluate(e){return new mi(this.sections.map((r=>{const a=r.content.evaluate(e);return Rt(a)===E?new Va("",a,null,null,null):new Va(gt(a),null,r.scale?r.scale.evaluate(e):null,r.font?r.font.evaluate(e).join(","):null,r.textColor?r.textColor.evaluate(e):null)})))}eachChild(e){for(const r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}outputDefined(){return!1}}class qs{constructor(e){this.type=E,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");const a=r.parse(e[1],1,rt);return a?new qs(a):r.error("No image name provided.")}evaluate(e){const r=this.input.evaluate(e),a=ui.fromString(r);return a&&e.availableImages&&(a.available=e.availableImages.indexOf(r)>-1),a}eachChild(e){e(this.input)}outputDefined(){return!1}}class Zs{constructor(e){this.type=Ce,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);const a=r.parse(e[1],1);return a?a.type.kind!=="array"&&a.type.kind!=="string"&&a.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${Z(a.type)} instead.`):new Zs(a):null}evaluate(e){const r=this.input.evaluate(e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Ut(`Expected value to be of type string or array, but found ${Z(Rt(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Gn={"==":gc,"!=":_c,">":xc,"<":yc,">=":bc,"<=":vc,array:nr,at:Ns,boolean:nr,case:$s,coalesce:Ya,collator:qa,format:ts,image:qs,in:Vs,"index-of":Qa,interpolate:qi,"interpolate-hcl":qi,"interpolate-lab":qi,length:Zs,let:Ja,literal:_n,match:Us,number:nr,"number-format":js,object:nr,slice:es,step:en,string:nr,"to-boolean":Jr,"to-color":Jr,"to-number":Jr,"to-string":Jr,var:Ga,within:yn};function el(i,[e,r,a,o]){e=e.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const p=o?o.evaluate(i):1,f=Ua(e,r,a,p);if(f)throw new Ut(f);return new bt(e/255,r/255,a/255,p,!1)}function tl(i,e){return i in e}function Gs(i,e){const r=e[i];return r===void 0?null:r}function xn(i){return{type:i}}function il(i){return{result:"success",value:i}}function tn(i){return{result:"error",value:i}}function Hn(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function rl(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Hs(i){return!!i.expression&&i.expression.interpolated}function _t(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function Bt(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function wc(i){return i}function pt(i,e){const r=e.type==="color",a=i.stops&&typeof i.stops[0][0]=="object",o=a||!(a||i.property!==void 0),p=i.type||(Hs(e)?"exponential":"interval");if(r||e.type==="padding"){const w=r?bt.parse:$i.parse;(i=vr({},i)).stops&&(i.stops=i.stops.map((A=>[A[0],w(A[1])]))),i.default=w(i.default?i.default:e.default)}if(i.colorSpace&&(f=i.colorSpace)!=="rgb"&&f!=="hcl"&&f!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var f;let m,y,v;if(p==="exponential")m=fa;else if(p==="interval")m=Dt;else if(p==="categorical"){m=Ot,y=Object.create(null);for(const w of i.stops)y[w[0]]=w[1];v=typeof i.stops[0][0]}else{if(p!=="identity")throw new Error(`Unknown function type "${p}"`);m=nl}if(a){const w={},A=[];for(let D=0;DD[0])),evaluate:({zoom:D},O)=>fa({stops:k,base:i.base},e,D).evaluate(D,O)}}if(o){const w=p==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:qi.interpolationFactor.bind(void 0,w),zoomStops:i.stops.map((A=>A[0])),evaluate:({zoom:A})=>m(i,e,A,y,v)}}return{kind:"source",evaluate(w,A){const k=A&&A.properties?A.properties[i.property]:void 0;return k===void 0?vn(i.default,e.default):m(i,e,k,y,v)}}}function vn(i,e,r){return i!==void 0?i:e!==void 0?e:r!==void 0?r:void 0}function Ot(i,e,r,a,o){return vn(typeof r===o?a[r]:void 0,i.default,e.default)}function Dt(i,e,r){if(_t(r)!=="number")return vn(i.default,e.default);const a=i.stops.length;if(a===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const o=qn(i.stops.map((p=>p[0])),r);return i.stops[o][1]}function fa(i,e,r){const a=i.base!==void 0?i.base:1;if(_t(r)!=="number")return vn(i.default,e.default);const o=i.stops.length;if(o===1||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[o-1][0])return i.stops[o-1][1];const p=qn(i.stops.map((w=>w[0])),r),f=(function(w,A,k,z){const D=z-k,O=w-k;return D===0?0:A===1?O/D:(Math.pow(A,O)-1)/(Math.pow(A,D)-1)})(r,a,i.stops[p][0],i.stops[p+1][0]),m=i.stops[p][1],y=i.stops[p+1][1],v=ji[e.type]||wc;return typeof m.evaluate=="function"?{evaluate(...w){const A=m.evaluate.apply(void 0,w),k=y.evaluate.apply(void 0,w);if(A!==void 0&&k!==void 0)return v(A,k,f,i.colorSpace)}}:v(m,y,f,i.colorSpace)}function nl(i,e,r){switch(e.type){case"color":r=bt.parse(r);break;case"formatted":r=mi.fromString(r.toString());break;case"resolvedImage":r=ui.fromString(r.toString());break;case"padding":r=$i.parse(r);break;default:_t(r)===e.type||e.type==="enum"&&e.values[r]||(r=void 0)}return vn(r,i.default,e.default)}ar.register(Gn,{error:[{kind:"error"},[rt],(i,[e])=>{throw new Ut(e.evaluate(i))}],typeof:[rt,[Qe],(i,[e])=>Z(Rt(e.evaluate(i)))],"to-rgba":[j(Ce,4),[wi],(i,[e])=>{const[r,a,o,p]=e.evaluate(i).rgb;return[255*r,255*a,255*o,p]}],rgb:[wi,[Ce,Ce,Ce],el],rgba:[wi,[Ce,Ce,Ce,Ce],el],has:{type:Ye,overloads:[[[rt],(i,[e])=>tl(e.evaluate(i),i.properties())],[[rt,br],(i,[e,r])=>tl(e.evaluate(i),r.evaluate(i))]]},get:{type:Qe,overloads:[[[rt],(i,[e])=>Gs(e.evaluate(i),i.properties())],[[rt,br],(i,[e,r])=>Gs(e.evaluate(i),r.evaluate(i))]]},"feature-state":[Qe,[rt],(i,[e])=>Gs(e.evaluate(i),i.featureState||{})],properties:[br,[],i=>i.properties()],"geometry-type":[rt,[],i=>i.geometryType()],id:[Qe,[],i=>i.id()],zoom:[Ce,[],i=>i.globals.zoom],"heatmap-density":[Ce,[],i=>i.globals.heatmapDensity||0],"line-progress":[Ce,[],i=>i.globals.lineProgress||0],accumulated:[Qe,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Ce,xn(Ce),(i,e)=>{let r=0;for(const a of e)r+=a.evaluate(i);return r}],"*":[Ce,xn(Ce),(i,e)=>{let r=1;for(const a of e)r*=a.evaluate(i);return r}],"-":{type:Ce,overloads:[[[Ce,Ce],(i,[e,r])=>e.evaluate(i)-r.evaluate(i)],[[Ce],(i,[e])=>-e.evaluate(i)]]},"/":[Ce,[Ce,Ce],(i,[e,r])=>e.evaluate(i)/r.evaluate(i)],"%":[Ce,[Ce,Ce],(i,[e,r])=>e.evaluate(i)%r.evaluate(i)],ln2:[Ce,[],()=>Math.LN2],pi:[Ce,[],()=>Math.PI],e:[Ce,[],()=>Math.E],"^":[Ce,[Ce,Ce],(i,[e,r])=>Math.pow(e.evaluate(i),r.evaluate(i))],sqrt:[Ce,[Ce],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Ce,[Ce],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Ce,[Ce],(i,[e])=>Math.log(e.evaluate(i))],log2:[Ce,[Ce],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Ce,[Ce],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Ce,[Ce],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Ce,[Ce],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Ce,[Ce],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Ce,[Ce],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Ce,[Ce],(i,[e])=>Math.atan(e.evaluate(i))],min:[Ce,xn(Ce),(i,e)=>Math.min(...e.map((r=>r.evaluate(i))))],max:[Ce,xn(Ce),(i,e)=>Math.max(...e.map((r=>r.evaluate(i))))],abs:[Ce,[Ce],(i,[e])=>Math.abs(e.evaluate(i))],round:[Ce,[Ce],(i,[e])=>{const r=e.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ce,[Ce],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Ce,[Ce],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[Ye,[rt,Qe],(i,[e,r])=>i.properties()[e.value]===r.value],"filter-id-==":[Ye,[Qe],(i,[e])=>i.id()===e.value],"filter-type-==":[Ye,[rt],(i,[e])=>i.geometryType()===e.value],"filter-<":[Ye,[rt,Qe],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a{const r=i.id(),a=e.value;return typeof r==typeof a&&r":[Ye,[rt,Qe],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>o}],"filter-id->":[Ye,[Qe],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>a}],"filter-<=":[Ye,[rt,Qe],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a<=o}],"filter-id-<=":[Ye,[Qe],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r<=a}],"filter->=":[Ye,[rt,Qe],(i,[e,r])=>{const a=i.properties()[e.value],o=r.value;return typeof a==typeof o&&a>=o}],"filter-id->=":[Ye,[Qe],(i,[e])=>{const r=i.id(),a=e.value;return typeof r==typeof a&&r>=a}],"filter-has":[Ye,[Qe],(i,[e])=>e.value in i.properties()],"filter-has-id":[Ye,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[Ye,[j(rt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ye,[j(Qe)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[Ye,[rt,j(Qe)],(i,[e,r])=>r.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[Ye,[rt,j(Qe)],(i,[e,r])=>(function(a,o,p,f){for(;p<=f;){const m=p+f>>1;if(o[m]===a)return!0;o[m]>a?f=m-1:p=m+1}return!1})(i.properties()[e.value],r.value,0,r.value.length-1)],all:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)&&r.evaluate(i)],[xn(Ye),(i,e)=>{for(const r of e)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ye,overloads:[[[Ye,Ye],(i,[e,r])=>e.evaluate(i)||r.evaluate(i)],[xn(Ye),(i,e)=>{for(const r of e)if(r.evaluate(i))return!0;return!1}]]},"!":[Ye,[Ye],(i,[e])=>!e.evaluate(i)],"is-supported-script":[Ye,[rt],(i,[e])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(e.evaluate(i))}],upcase:[rt,[rt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[rt,[rt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[rt,xn(Qe),(i,e)=>e.map((r=>gt(r.evaluate(i)))).join("")],"resolved-locale":[rt,[Lr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Ws{constructor(e,r){var a;this.expression=e,this._warningHistory={},this._evaluator=new zs,this._defaultValue=r?(a=r).type==="color"&&Bt(a.default)?new bt(0,0,0,0):a.type==="color"?bt.parse(a.default)||null:a.type==="padding"?$i.parse(a.default)||null:a.type==="variableAnchorOffsetCollection"?rr.parse(a.default)||null:a.default===void 0?null:a.default:null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,a,o,p,f){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=o,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(e,r,a,o,p,f){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=o,this._evaluator.availableImages=p||null,this._evaluator.formattedSection=f||null;try{const m=this.expression.evaluate(this._evaluator);if(m==null||typeof m=="number"&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Ut(`Expected value to be one of ${Object.keys(this._enumValues).map((y=>JSON.stringify(y))).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function is(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Gn}function rs(i,e){const r=new ja(Gn,Ha,[],e?(function(o){const p={color:wi,string:rt,number:Ce,enum:rt,boolean:Ye,formatted:U,padding:C,resolvedImage:E,variableAnchorOffsetCollection:F};return o.type==="array"?j(p[o.value]||Qe,o.length):p[o.type]})(e):void 0),a=r.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?il(new Ws(a,e)):tn(r.errors)}class Xs{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!da(r.expression)}evaluateWithoutErrorHandling(e,r,a,o,p,f){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,p,f)}evaluate(e,r,a,o,p,f){return this._styleExpression.evaluate(e,r,a,o,p,f)}}class ns{constructor(e,r,a,o){this.kind=e,this.zoomStops=a,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!da(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(e,r,a,o,p,f){return this._styleExpression.evaluateWithoutErrorHandling(e,r,a,o,p,f)}evaluate(e,r,a,o,p,f){return this._styleExpression.evaluate(e,r,a,o,p,f)}interpolationFactor(e,r,a){return this.interpolationType?qi.interpolationFactor(this.interpolationType,e,r,a):0}}function Ks(i,e){const r=rs(i,e);if(r.result==="error")return r;const a=r.value.expression,o=Wa(a);if(!o&&!Hn(e))return tn([new Vt("","data expressions not supported")]);const p=Xa(a,["zoom"]);if(!p&&!rl(e))return tn([new Vt("","zoom expressions not supported")]);const f=ga(a);return f||p?f instanceof Vt?tn([f]):f instanceof qi&&!Hs(e)?tn([new Vt("",'"interpolate" expressions cannot be used with this property')]):il(f?new ns(o?"camera":"composite",r.value,f.labels,f instanceof qi?f.interpolation:void 0):new Xs(o?"constant":"source",r.value)):tn([new Vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ma{constructor(e,r){this._parameters=e,this._specification=r,vr(this,pt(this._parameters,this._specification))}static deserialize(e){return new ma(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function ga(i){let e=null;if(i instanceof Ja)e=ga(i.result);else if(i instanceof Ya){for(const r of i.args)if(e=ga(r),e)break}else(i instanceof en||i instanceof qi)&&i.input instanceof ar&&i.input.name==="zoom"&&(e=i);return e instanceof Vt||i.eachChild((r=>{const a=ga(r);a instanceof Vt?e=a:!e&&a?e=new Vt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&a&&e!==a&&(e=new Vt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function _a(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!_a(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Sc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ys(i){if(i==null)return{filter:()=>!0,needGeometry:!1};_a(i)||(i=as(i));const e=rs(i,Sc);if(e.result==="error")throw new Error(e.value.map((r=>`${r.key}: ${r.message}`)).join(", "));return{filter:(r,a,o)=>e.value.evaluate(r,a,{},o),needGeometry:al(i)}}function Tc(i,e){return ie?1:0}function al(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Js(i[1],i[2],e):e==="any"?(r=i.slice(1),["any"].concat(r.map(as))):e==="all"?["all"].concat(i.slice(1).map(as)):e==="none"?["all"].concat(i.slice(1).map(as).map(ya)):e==="in"?sl(i[1],i.slice(2)):e==="!in"?ya(sl(i[1],i.slice(2))):e==="has"?ol(i[1]):e==="!has"?ya(ol(i[1])):e!=="within"||i;var r}function Js(i,e,r){switch(i){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,i,e]}}function sl(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((r=>typeof r!=typeof e[0]))?["filter-in-large",i,["literal",e.sort(Tc)]]:["filter-in-small",i,["literal",e]]}}function ol(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function ya(i){return["!",i]}function ss(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let o="[";for(const p of i)o+=`${ss(p)},`;return`${o}]`}const r=Object.keys(i).sort();let a="{";for(let o=0;oa.maximum?[new Ie(e,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function ls(i){const e=i.valueSpec,r=$t(i.value.type);let a,o,p,f={};const m=r!=="categorical"&&i.value.property===void 0,y=!m,v=_t(i.value.stops)==="array"&&_t(i.value.stops[0])==="array"&&_t(i.value.stops[0][0])==="object",w=zi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(z){if(r==="identity")return[new Ie(z.key,z.value,'identity function may not have a "stops" property')];let D=[];const O=z.value;return D=D.concat(Wn({key:z.key,value:O,valueSpec:z.valueSpec,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:A})),_t(O)==="array"&&O.length===0&&D.push(new Ie(z.key,O,"array must have at least one stop")),D},default:function(z){return z.validateSpec({key:z.key,value:z.value,valueSpec:e,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec})}}});return r==="identity"&&m&&w.push(new Ie(i.key,i.value,'missing required property "property"')),r==="identity"||i.value.stops||w.push(new Ie(i.key,i.value,'missing required property "stops"')),r==="exponential"&&i.valueSpec.expression&&!Hs(i.valueSpec)&&w.push(new Ie(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(y&&!Hn(i.valueSpec)?w.push(new Ie(i.key,i.value,"property functions not supported")):m&&!rl(i.valueSpec)&&w.push(new Ie(i.key,i.value,"zoom functions not supported"))),r!=="categorical"&&!v||i.value.property!==void 0||w.push(new Ie(i.key,i.value,'"property" property is required')),w;function A(z){let D=[];const O=z.value,q=z.key;if(_t(O)!=="array")return[new Ie(q,O,`array expected, ${_t(O)} found`)];if(O.length!==2)return[new Ie(q,O,`array length 2 expected, length ${O.length} found`)];if(v){if(_t(O[0])!=="object")return[new Ie(q,O,`object expected, ${_t(O[0])} found`)];if(O[0].zoom===void 0)return[new Ie(q,O,"object stop key must have zoom")];if(O[0].value===void 0)return[new Ie(q,O,"object stop key must have value")];if(p&&p>$t(O[0].zoom))return[new Ie(q,O[0].zoom,"stop zoom values must appear in ascending order")];$t(O[0].zoom)!==p&&(p=$t(O[0].zoom),o=void 0,f={}),D=D.concat(zi({key:`${q}[0]`,value:O[0],valueSpec:{zoom:{}},validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:xa,value:k}}))}else D=D.concat(k({key:`${q}[0]`,value:O[0],validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec},O));return is(bn(O[1]))?D.concat([new Ie(`${q}[1]`,O[1],"expressions are not allowed in function stops.")]):D.concat(z.validateSpec({key:`${q}[1]`,value:O[1],valueSpec:e,validateSpec:z.validateSpec,style:z.style,styleSpec:z.styleSpec}))}function k(z,D){const O=_t(z.value),q=$t(z.value),H=z.value!==null?z.value:D;if(a){if(O!==a)return[new Ie(z.key,H,`${O} stop domain type must match previous stop domain type ${a}`)]}else a=O;if(O!=="number"&&O!=="string"&&O!=="boolean")return[new Ie(z.key,H,"stop domain value must be a number, string, or boolean")];if(O!=="number"&&r!=="categorical"){let re=`number expected, ${O} found`;return Hn(e)&&r===void 0&&(re+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ie(z.key,H,re)]}return r!=="categorical"||O!=="number"||isFinite(q)&&Math.floor(q)===q?r!=="categorical"&&O==="number"&&o!==void 0&&qnew Ie(`${i.key}${a.key}`,i.value,a.message)));const r=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!r.outputDefined())return[new Ie(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!da(r))return[new Ie(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!da(r))return[new Ie(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!Xa(r,["zoom","feature-state"]))return[new Ie(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Wa(r))return[new Ie(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function va(i){const e=i.key,r=i.value,a=i.valueSpec,o=[];return Array.isArray(a.values)?a.values.indexOf($t(r))===-1&&o.push(new Ie(e,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(a.values).indexOf($t(r))===-1&&o.push(new Ie(e,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function Xn(i){return _a(bn(i.value))?wn(vr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):cl(i)}function cl(i){const e=i.value,r=i.key;if(_t(e)!=="array")return[new Ie(r,e,`array expected, ${_t(e)} found`)];const a=i.styleSpec;let o,p=[];if(e.length<1)return[new Ie(r,e,"filter array must have at least 1 element")];switch(p=p.concat(va({key:`${r}[0]`,value:e[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),$t(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&$t(e[1])==="$type"&&p.push(new Ie(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&p.push(new Ie(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=_t(e[1]),o!=="string"&&p.push(new Ie(`${r}[1]`,e[1],`string expected, ${o} found`)));for(let f=2;f{v in r&&e.push(new Ie(a,r[v],`"${v}" is prohibited for ref layers`))})),o.layers.forEach((v=>{$t(v.id)===m&&(y=v)})),y?y.ref?e.push(new Ie(a,r.ref,"ref cannot reference another ref layer")):f=$t(y.type):e.push(new Ie(a,r.ref,`ref layer "${m}" not found`))}else if(f!=="background")if(r.source){const y=o.sources&&o.sources[r.source],v=y&&$t(y.type);y?v==="vector"&&f==="raster"?e.push(new Ie(a,r.source,`layer "${r.id}" requires a raster source`)):v!=="raster-dem"&&f==="hillshade"?e.push(new Ie(a,r.source,`layer "${r.id}" requires a raster-dem source`)):v==="raster"&&f!=="raster"?e.push(new Ie(a,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&f!=="hillshade"?e.push(new Ie(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):f!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&y.lineMetrics||e.push(new Ie(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ie(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Ie(a,r.source,`source "${r.source}" not found`))}else e.push(new Ie(a,r,'missing required property "source"'));return e=e.concat(zi({key:a,value:r,valueSpec:p.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:p.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Xn,layout:y=>zi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>pl(vr({layerType:f},v))}}),paint:y=>zi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>hl(vr({layerType:f},v))}})}})),e}function wr(i){const e=i.value,r=i.key,a=_t(e);return a!=="string"?[new Ie(r,e,`string expected, ${a} found`)]:[]}const ba={promoteId:function({key:i,value:e}){if(_t(e)==="string")return wr({key:i,value:e});{const r=[];for(const a in e)r.push(...wr({key:`${i}.${a}`,value:e[a]}));return r}}};function Zi(i){const e=i.value,r=i.key,a=i.styleSpec,o=i.style,p=i.validateSpec;if(!e.type)return[new Ie(r,e,'"type" is required')];const f=$t(e.type);let m;switch(f){case"vector":case"raster":return m=zi({key:r,value:e,valueSpec:a[`source_${f.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:ba,validateSpec:p}),m;case"raster-dem":return m=(function(y){var v;const w=(v=y.sourceName)!==null&&v!==void 0?v:"",A=y.value,k=y.styleSpec,z=k.source_raster_dem,D=y.style;let O=[];const q=_t(A);if(A===void 0)return O;if(q!=="object")return O.push(new Ie("source_raster_dem",A,`object expected, ${q} found`)),O;const H=$t(A.encoding)==="custom",re=["redFactor","greenFactor","blueFactor","baseShift"],Y=y.value.encoding?`"${y.value.encoding}"`:"Default";for(const ae in A)!H&&re.includes(ae)?O.push(new Ie(ae,A[ae],`In "${w}": "${ae}" is only valid when "encoding" is set to "custom". ${Y} encoding found`)):z[ae]?O=O.concat(y.validateSpec({key:ae,value:A[ae],valueSpec:z[ae],validateSpec:y.validateSpec,style:D,styleSpec:k})):O.push(new Ie(ae,A[ae],`unknown property "${ae}"`));return O})({sourceName:r,value:e,style:i.style,styleSpec:a,validateSpec:p}),m;case"geojson":if(m=zi({key:r,value:e,valueSpec:a.source_geojson,style:o,styleSpec:a,validateSpec:p,objectElementValidators:ba}),e.cluster)for(const y in e.clusterProperties){const[v,w]=e.clusterProperties[y],A=typeof v=="string"?[v,["accumulated"],["get",y]]:v;m.push(...wn({key:`${r}.${y}.map`,value:w,expressionContext:"cluster-map"})),m.push(...wn({key:`${r}.${y}.reduce`,value:A,expressionContext:"cluster-reduce"}))}return m;case"video":return zi({key:r,value:e,valueSpec:a.source_video,style:o,validateSpec:p,styleSpec:a});case"image":return zi({key:r,value:e,valueSpec:a.source_image,style:o,validateSpec:p,styleSpec:a});case"canvas":return[new Ie(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return va({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function wa(i){const e=i.value,r=i.styleSpec,a=r.light,o=i.style;let p=[];const f=_t(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new Ie("light",e,`object expected, ${f} found`)]),p;for(const m in e){const y=m.match(/^(.*)-transition$/);p=p.concat(y&&a[y[1]]&&a[y[1]].transition?i.validateSpec({key:m,value:e[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:o,styleSpec:r}):a[m]?i.validateSpec({key:m,value:e[m],valueSpec:a[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new Ie(m,e[m],`unknown property "${m}"`)])}return p}function fl(i){const e=i.value,r=i.styleSpec,a=r.terrain,o=i.style;let p=[];const f=_t(e);if(e===void 0)return p;if(f!=="object")return p=p.concat([new Ie("terrain",e,`object expected, ${f} found`)]),p;for(const m in e)p=p.concat(a[m]?i.validateSpec({key:m,value:e[m],valueSpec:a[m],validateSpec:i.validateSpec,style:o,styleSpec:r}):[new Ie(m,e[m],`unknown property "${m}"`)]);return p}function ml(i){let e=[];const r=i.value,a=i.key;if(Array.isArray(r)){const o=[],p=[];for(const f in r)r[f].id&&o.includes(r[f].id)&&e.push(new Ie(a,r,`all the sprites' ids must be unique, but ${r[f].id} is duplicated`)),o.push(r[f].id),r[f].url&&p.includes(r[f].url)&&e.push(new Ie(a,r,`all the sprites' URLs must be unique, but ${r[f].url} is duplicated`)),p.push(r[f].url),e=e.concat(zi({key:`${a}[${f}]`,value:r[f],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return wr({key:a,value:r})}const gl={"*":()=>[],array:Wn,boolean:function(i){const e=i.value,r=i.key,a=_t(e);return a!=="boolean"?[new Ie(r,e,`boolean expected, ${a} found`)]:[]},number:xa,color:function(i){const e=i.key,r=i.value,a=_t(r);return a!=="string"?[new Ie(e,r,`color expected, ${a} found`)]:bt.parse(String(r))?[]:[new Ie(e,r,`color expected, "${r}" found`)]},constants:ll,enum:va,filter:Xn,function:ls,layer:dl,object:zi,source:Zi,light:wa,terrain:fl,string:wr,formatted:function(i){return wr(i).length===0?[]:wn(i)},resolvedImage:function(i){return wr(i).length===0?[]:wn(i)},padding:function(i){const e=i.key,r=i.value;if(_t(r)==="array"){if(r.length<1||r.length>4)return[new Ie(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let o=[];for(let p=0;p[]}})),i.constants&&(r=r.concat(ll({key:"constants",value:i.constants}))),cs(r)}function Fr(i){return function(e){return i({...e,validateSpec:rn})}}function cs(i){return[].concat(i).sort(((e,r)=>e.line-r.line))}function Rr(i){return function(...e){return cs(i.apply(this,e))}}sr.source=Rr(Fr(Zi)),sr.sprite=Rr(Fr(ml)),sr.glyphs=Rr(Fr(_l)),sr.light=Rr(Fr(wa)),sr.terrain=Rr(Fr(fl)),sr.layer=Rr(Fr(dl)),sr.filter=Rr(Fr(Xn)),sr.paintProperty=Rr(Fr(hl)),sr.layoutProperty=Rr(Fr(pl));const Br=sr,Ic=Br.light,Qs=Br.paintProperty,yl=Br.layoutProperty;function us(i,e){let r=!1;if(e&&e.length)for(const a of e)i.fire(new Kr(new Error(a.message))),r=!0;return r}class Kn{constructor(e,r,a){const o=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const f=new Int32Array(this.arrayBuffer);e=f[0],this.d=(r=f[1])+2*(a=f[2]);for(let y=0;y=A[D+0]&&o>=A[D+1])?(m[z]=!0,f.push(w[z])):m[z]=!1}}}}_forEachCell(e,r,a,o,p,f,m,y){const v=this._convertToCellCoord(e),w=this._convertToCellCoord(r),A=this._convertToCellCoord(a),k=this._convertToCellCoord(o);for(let z=v;z<=A;z++)for(let D=w;D<=k;D++){const O=this.d*D+z;if((!y||y(this._convertFromCellCoord(z),this._convertFromCellCoord(D),this._convertFromCellCoord(z+1),this._convertFromCellCoord(D+1)))&&p.call(this,e,r,a,o,O,f,m,y))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,r=3+this.cells.length+1+1;let a=0;for(let f=0;f=0)continue;const f=i[p];o[p]=Or[a].shallow.indexOf(p)>=0?f:nn(f,e)}i instanceof Error&&(o.message=i.message)}if(o.$name)throw new Error("$name property is reserved for worker serialization logic.");return a!=="Object"&&(o.$name=a),o}throw new Error("can't serialize object of type "+typeof i)}function Yn(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||hs(i)||la(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Yn);if(typeof i=="object"){const e=i.$name||"Object";if(!Or[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=Or[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const o of Object.keys(i)){if(o==="$name")continue;const p=i[o];a[o]=Or[e].shallow.indexOf(o)>=0?p:Yn(p)}return a}throw new Error("can't deserialize object of type "+typeof i)}class xl{constructor(){this.first=!0}update(e,r){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=r):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function eo(i){for(const e of i)if(io(e.charCodeAt(0)))return!0;return!1}function to(i){for(const e of i)if(!Ac(e.charCodeAt(0)))return!1;return!0}function Ac(i){return!(Pe.Arabic(i)||Pe["Arabic Supplement"](i)||Pe["Arabic Extended-A"](i)||Pe["Arabic Presentation Forms-A"](i)||Pe["Arabic Presentation Forms-B"](i))}function io(i){return!(i!==746&&i!==747&&(i<4352||!(Pe["Bopomofo Extended"](i)||Pe.Bopomofo(i)||Pe["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Pe["CJK Compatibility Ideographs"](i)||Pe["CJK Compatibility"](i)||Pe["CJK Radicals Supplement"](i)||Pe["CJK Strokes"](i)||!(!Pe["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Pe["CJK Unified Ideographs Extension A"](i)||Pe["CJK Unified Ideographs"](i)||Pe["Enclosed CJK Letters and Months"](i)||Pe["Hangul Compatibility Jamo"](i)||Pe["Hangul Jamo Extended-A"](i)||Pe["Hangul Jamo Extended-B"](i)||Pe["Hangul Jamo"](i)||Pe["Hangul Syllables"](i)||Pe.Hiragana(i)||Pe["Ideographic Description Characters"](i)||Pe.Kanbun(i)||Pe["Kangxi Radicals"](i)||Pe["Katakana Phonetic Extensions"](i)||Pe.Katakana(i)&&i!==12540||!(!Pe["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Pe["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Pe["Unified Canadian Aboriginal Syllabics"](i)||Pe["Unified Canadian Aboriginal Syllabics Extended"](i)||Pe["Vertical Forms"](i)||Pe["Yijing Hexagram Symbols"](i)||Pe["Yi Syllables"](i)||Pe["Yi Radicals"](i))))}function vl(i){return!(io(i)||(function(e){return!!(Pe["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Pe["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)||Pe["Letterlike Symbols"](e)||Pe["Number Forms"](e)||Pe["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)||Pe["Control Pictures"](e)&&e!==9251||Pe["Optical Character Recognition"](e)||Pe["Enclosed Alphanumerics"](e)||Pe["Geometric Shapes"](e)||Pe["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Pe["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Pe["CJK Symbols and Punctuation"](e)||Pe.Katakana(e)||Pe["Private Use Area"](e)||Pe["CJK Compatibility Forms"](e)||Pe["Small Form Variants"](e)||Pe["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)})(i))}function bl(i){return i>=1424&&i<=2303||Pe["Arabic Presentation Forms-A"](i)||Pe["Arabic Presentation Forms-B"](i)}function wl(i,e){return!(!e&&bl(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Pe.Khmer(i))}function Cc(i){for(const e of i)if(bl(e.charCodeAt(0)))return!0;return!1}const ro="deferred",no="loading",ao="loaded";let so=null,Di="unavailable",an=null;const Sa=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(Di="error"),so&&so(i)};function oo(){Ta.fire(new Xr("pluginStateChange",{pluginStatus:Di,pluginURL:an}))}const Ta=new fn,lo=function(){return Di},Sl=function(){if(Di!==ro||!an)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Di=no,oo(),an&&ha({url:an},(i=>{i?Sa(i):(Di=ao,oo())}))},Gi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Di===ao||Gi.applyArabicShaping!=null,isLoading:()=>Di===no,setState(i){if(!Qi())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Di=i.pluginStatus,an=i.pluginURL},isParsed(){if(!Qi())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Gi.applyArabicShaping!=null&&Gi.processBidirectionalText!=null&&Gi.processStyledBidirectionalText!=null},getPluginURL(){if(!Qi())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return an}};class Et{constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new xl,this.transition={})}isSupportedScript(e){return(function(r,a){for(const o of r)if(!wl(o.charCodeAt(0),a))return!1;return!0})(e,Gi.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,r=e-Math.floor(e),a=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class ps{constructor(e,r){this.property=e,this.value=r,this.expression=(function(a,o){if(Bt(a))return new ma(a,o);if(is(a)){const p=Ks(a,o);if(p.result==="error")throw new Error(p.value.map((f=>`${f.key}: ${f.message}`)).join(", "));return p.value}{let p=a;return o.type==="color"&&typeof a=="string"?p=bt.parse(a):o.type!=="padding"||typeof a!="number"&&!Array.isArray(a)?o.type==="variableAnchorOffsetCollection"&&Array.isArray(a)&&(p=rr.parse(a)):p=$i.parse(a),{kind:"constant",evaluate:()=>p}}})(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,a){return this.property.possiblyEvaluate(this,e,r,a)}}class co{constructor(e){this.property=e,this.value=new ps(e,void 0)}transitioned(e,r){return new Il(this.property,this.value,r,vt({},e.transition,this.transition),e.now)}untransitioned(){return new Il(this.property,this.value,null,{},0)}}class Tl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return ur(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new co(this._values[e].property)),this._values[e].value=new ps(this._values[e].property,r===null?void 0:ur(r))}getTransition(e){return ur(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new co(this._values[e].property)),this._values[e].transition=ur(r)||void 0}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a);const o=this.getTransition(r);o!==void 0&&(e[`${r}-transition`]=o)}return e}transitioned(e,r){const a=new Al(this._properties);for(const o of Object.keys(this._values))a._values[o]=this._values[o].transitioned(e,r._values[o]);return a}untransitioned(){const e=new Al(this._properties);for(const r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}}class Il{constructor(e,r,a,o,p){this.property=e,this.value=r,this.begin=p+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=a)}possiblyEvaluate(e,r,a){const o=e.now||0,p=this.value.possiblyEvaluate(e,r,a),f=this.prior;if(f){if(o>this.end)return this.prior=null,p;if(this.value.isDataDriven())return this.prior=null,p;if(o=1)return 1;const v=y*y,w=v*y;return 4*(y<.5?w:3*(y-v)+w-.75)})(m))}}return p}}class Al{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,a){const o=new ds(this._properties);for(const p of Object.keys(this._values))o._values[p]=this._values[p].possiblyEvaluate(e,r,a);return o}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class kc{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return ur(this._values[e].value)}setValue(e,r){this._values[e]=new ps(this._values[e].property,r===null?void 0:ur(r))}serialize(){const e={};for(const r of Object.keys(this._values)){const a=this.getValue(r);a!==void 0&&(e[r]=a)}return e}possiblyEvaluate(e,r,a){const o=new ds(this._properties);for(const p of Object.keys(this._values))o._values[p]=this._values[p].possiblyEvaluate(e,r,a);return o}}class Si{constructor(e,r,a){this.property=e,this.value=r,this.parameters=a}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,a,o){return this.property.evaluate(this.value,this.parameters,e,r,a,o)}}class ds{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class $e{constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,a){const o=ji[this.specification.type];return o?o(e,r,a):e}}class Ge{constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,a,o){return new Si(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(r,null,{},a,o)}:e.expression,r)}interpolate(e,r,a){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new Si(this,{kind:"constant",value:void 0},e.parameters);const o=ji[this.specification.type];if(o){const p=o(e.value.value,r.value.value,a);return new Si(this,{kind:"constant",value:p},e.parameters)}return e}evaluate(e,r,a,o,p,f){return e.kind==="constant"?e.value:e.evaluate(r,a,o,p,f)}}class Ia extends Ge{possiblyEvaluate(e,r,a,o){if(e.value===void 0)return new Si(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){const p=e.expression.evaluate(r,null,{},a,o),f=e.property.specification.type==="resolvedImage"&&typeof p!="string"?p.name:p,m=this._calculate(f,f,f,r);return new Si(this,{kind:"constant",value:m},r)}if(e.expression.kind==="camera"){const p=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new Si(this,{kind:"constant",value:p},r)}return new Si(this,e.expression,r)}evaluate(e,r,a,o,p,f){if(e.kind==="source"){const m=e.evaluate(r,a,o,p,f);return this._calculate(m,m,m,r)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},a,o),e.evaluate({zoom:Math.floor(r.zoom)},a,o),e.evaluate({zoom:Math.floor(r.zoom)+1},a,o),r):e.value}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class uo{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){if(e.value!==void 0){if(e.expression.kind==="constant"){const p=e.expression.evaluate(r,null,{},a,o);return this._calculate(p,p,p,r)}return this._calculate(e.expression.evaluate(new Et(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Et(Math.floor(r.zoom),r)),e.expression.evaluate(new Et(Math.floor(r.zoom+1),r)),r)}}_calculate(e,r,a,o){return o.zoom>o.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:a,to:r}}interpolate(e){return e}}class ho{constructor(e){this.specification=e}possiblyEvaluate(e,r,a,o){return!!e.expression.evaluate(r,null,{},a,o)}interpolate(){return!1}}class Ht{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in e){const a=e[r];a.specification.overridable&&this.overridableProperties.push(r);const o=this.defaultPropertyValues[r]=new ps(a,void 0),p=this.defaultTransitionablePropertyValues[r]=new co(a);this.defaultTransitioningPropertyValues[r]=p.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=o.possiblyEvaluate({})}}}De("DataDrivenProperty",Ge),De("DataConstantProperty",$e),De("CrossFadedDataDrivenProperty",Ia),De("CrossFadedProperty",uo),De("ColorRampProperty",ho);const po="-transition";class or extends fn{constructor(e,r){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),r.layout&&(this._unevaluatedLayout=new kc(r.layout)),r.paint)){this._transitionablePaint=new Tl(r.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 ds(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,a={}){r!=null&&this._validate(yl,`layers.${this.id}.layout.${e}`,e,r,a)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,r):this.visibility=r)}getPaintProperty(e){return e.endsWith(po)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,a={}){if(r!=null&&this._validate(Qs,`layers.${this.id}.paint.${e}`,e,r,a))return!1;if(e.endsWith(po))return this._transitionablePaint.setTransition(e.slice(0,-11),r||void 0),!1;{const o=this._transitionablePaint._values[e],p=o.property.specification["property-type"]==="cross-faded-data-driven",f=o.value.isDataDriven(),m=o.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);const y=this._transitionablePaint._values[e].value;return y.isDataDriven()||f||p||this._handleOverridablePaintPropertyUpdate(e,m,y)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,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,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}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),Fn(e,((r,a)=>!(r===void 0||a==="layout"&&!Object.keys(r).length||a==="paint"&&!Object.keys(r).length)))}_validate(e,r,a,o,p={}){return(!p||p.validate!==!1)&&us(this,e.call(Br,{key:r,layerType:this.type,objectKey:a,value:o,styleSpec:he,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const r=this.paint.get(e);if(r instanceof Si&&Hn(r.property.specification)&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}}const Cl={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Sn{constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class jt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_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 r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Nt(i,e=1){let r=0,a=0;return{members:i.map((o=>{const p=Cl[o.type].BYTES_PER_ELEMENT,f=r=Jn(r,Math.max(e,p)),m=o.components||1;return a=Math.max(a,p),r+=p*m,{name:o.name,type:o.type,components:m,offset:f}})),size:Jn(r,Math.max(a,e)),alignment:e}}function Jn(i,e){return Math.ceil(i/e)*e}class Aa extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.int16[o+0]=r,this.int16[o+1]=a,e}}Aa.prototype.bytesPerElement=4,De("StructArrayLayout2i4",Aa);class Ca extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.int16[p+0]=r,this.int16[p+1]=a,this.int16[p+2]=o,e}}Ca.prototype.bytesPerElement=6,De("StructArrayLayout3i6",Ca);class Tn extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o)}emplace(e,r,a,o,p){const f=4*e;return this.int16[f+0]=r,this.int16[f+1]=a,this.int16[f+2]=o,this.int16[f+3]=p,e}}Tn.prototype.bytesPerElement=8,De("StructArrayLayout4i8",Tn);class fo extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,p,f)}emplace(e,r,a,o,p,f,m){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=a,this.int16[y+2]=o,this.int16[y+3]=p,this.int16[y+4]=f,this.int16[y+5]=m,e}}fo.prototype.bytesPerElement=12,De("StructArrayLayout2i4i12",fo);class mo extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,p,f)}emplace(e,r,a,o,p,f,m){const y=4*e,v=8*e;return this.int16[y+0]=r,this.int16[y+1]=a,this.uint8[v+4]=o,this.uint8[v+5]=p,this.uint8[v+6]=f,this.uint8[v+7]=m,e}}mo.prototype.bytesPerElement=8,De("StructArrayLayout2i4ub8",mo);class Qn extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.float32[o+0]=r,this.float32[o+1]=a,e}}Qn.prototype.bytesPerElement=8,De("StructArrayLayout2f8",Qn);class go extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f,m,y,v,w){const A=this.length;return this.resize(A+1),this.emplace(A,e,r,a,o,p,f,m,y,v,w)}emplace(e,r,a,o,p,f,m,y,v,w,A){const k=10*e;return this.uint16[k+0]=r,this.uint16[k+1]=a,this.uint16[k+2]=o,this.uint16[k+3]=p,this.uint16[k+4]=f,this.uint16[k+5]=m,this.uint16[k+6]=y,this.uint16[k+7]=v,this.uint16[k+8]=w,this.uint16[k+9]=A,e}}go.prototype.bytesPerElement=20,De("StructArrayLayout10ui20",go);class _o extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f,m,y,v,w,A,k){const z=this.length;return this.resize(z+1),this.emplace(z,e,r,a,o,p,f,m,y,v,w,A,k)}emplace(e,r,a,o,p,f,m,y,v,w,A,k,z){const D=12*e;return this.int16[D+0]=r,this.int16[D+1]=a,this.int16[D+2]=o,this.int16[D+3]=p,this.uint16[D+4]=f,this.uint16[D+5]=m,this.uint16[D+6]=y,this.uint16[D+7]=v,this.int16[D+8]=w,this.int16[D+9]=A,this.int16[D+10]=k,this.int16[D+11]=z,e}}_o.prototype.bytesPerElement=24,De("StructArrayLayout4i4ui4i24",_o);class yt extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.float32[p+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,e}}yt.prototype.bytesPerElement=12,De("StructArrayLayout3f12",yt);class u extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint32[1*e+0]=r,e}}u.prototype.bytesPerElement=4,De("StructArrayLayout1ul4",u);class t extends jt{_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,r,a,o,p,f,m,y,v){const w=this.length;return this.resize(w+1),this.emplace(w,e,r,a,o,p,f,m,y,v)}emplace(e,r,a,o,p,f,m,y,v,w){const A=10*e,k=5*e;return this.int16[A+0]=r,this.int16[A+1]=a,this.int16[A+2]=o,this.int16[A+3]=p,this.int16[A+4]=f,this.int16[A+5]=m,this.uint32[k+3]=y,this.uint16[A+8]=v,this.uint16[A+9]=w,e}}t.prototype.bytesPerElement=20,De("StructArrayLayout6i1ul2ui20",t);class n extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p,f){const m=this.length;return this.resize(m+1),this.emplace(m,e,r,a,o,p,f)}emplace(e,r,a,o,p,f,m){const y=6*e;return this.int16[y+0]=r,this.int16[y+1]=a,this.int16[y+2]=o,this.int16[y+3]=p,this.int16[y+4]=f,this.int16[y+5]=m,e}}n.prototype.bytesPerElement=12,De("StructArrayLayout2i2i2i12",n);class s extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,a,o,p){const f=this.length;return this.resize(f+1),this.emplace(f,e,r,a,o,p)}emplace(e,r,a,o,p,f){const m=4*e,y=8*e;return this.float32[m+0]=r,this.float32[m+1]=a,this.float32[m+2]=o,this.int16[y+6]=p,this.int16[y+7]=f,e}}s.prototype.bytesPerElement=16,De("StructArrayLayout2f1f2i16",s);class c extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o)}emplace(e,r,a,o,p){const f=12*e,m=3*e;return this.uint8[f+0]=r,this.uint8[f+1]=a,this.float32[m+1]=o,this.float32[m+2]=p,e}}c.prototype.bytesPerElement=12,De("StructArrayLayout2ub2f12",c);class h extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.uint16[p+0]=r,this.uint16[p+1]=a,this.uint16[p+2]=o,e}}h.prototype.bytesPerElement=6,De("StructArrayLayout3ui6",h);class g extends jt{_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,r,a,o,p,f,m,y,v,w,A,k,z,D,O,q,H){const re=this.length;return this.resize(re+1),this.emplace(re,e,r,a,o,p,f,m,y,v,w,A,k,z,D,O,q,H)}emplace(e,r,a,o,p,f,m,y,v,w,A,k,z,D,O,q,H,re){const Y=24*e,ae=12*e,oe=48*e;return this.int16[Y+0]=r,this.int16[Y+1]=a,this.uint16[Y+2]=o,this.uint16[Y+3]=p,this.uint32[ae+2]=f,this.uint32[ae+3]=m,this.uint32[ae+4]=y,this.uint16[Y+10]=v,this.uint16[Y+11]=w,this.uint16[Y+12]=A,this.float32[ae+7]=k,this.float32[ae+8]=z,this.uint8[oe+36]=D,this.uint8[oe+37]=O,this.uint8[oe+38]=q,this.uint32[ae+10]=H,this.int16[Y+22]=re,e}}g.prototype.bytesPerElement=48,De("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",g);class _ extends jt{_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,r,a,o,p,f,m,y,v,w,A,k,z,D,O,q,H,re,Y,ae,oe,me,ze,Ne,Ee,Me,Te,Le){const Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,e,r,a,o,p,f,m,y,v,w,A,k,z,D,O,q,H,re,Y,ae,oe,me,ze,Ne,Ee,Me,Te,Le)}emplace(e,r,a,o,p,f,m,y,v,w,A,k,z,D,O,q,H,re,Y,ae,oe,me,ze,Ne,Ee,Me,Te,Le,Ae){const ve=32*e,qe=16*e;return this.int16[ve+0]=r,this.int16[ve+1]=a,this.int16[ve+2]=o,this.int16[ve+3]=p,this.int16[ve+4]=f,this.int16[ve+5]=m,this.int16[ve+6]=y,this.int16[ve+7]=v,this.uint16[ve+8]=w,this.uint16[ve+9]=A,this.uint16[ve+10]=k,this.uint16[ve+11]=z,this.uint16[ve+12]=D,this.uint16[ve+13]=O,this.uint16[ve+14]=q,this.uint16[ve+15]=H,this.uint16[ve+16]=re,this.uint16[ve+17]=Y,this.uint16[ve+18]=ae,this.uint16[ve+19]=oe,this.uint16[ve+20]=me,this.uint16[ve+21]=ze,this.uint16[ve+22]=Ne,this.uint32[qe+12]=Ee,this.float32[qe+13]=Me,this.float32[qe+14]=Te,this.uint16[ve+30]=Le,this.uint16[ve+31]=Ae,e}}_.prototype.bytesPerElement=64,De("StructArrayLayout8i15ui1ul2f2ui64",_);class x extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.float32[1*e+0]=r,e}}x.prototype.bytesPerElement=4,De("StructArrayLayout1f4",x);class b extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=3*e;return this.uint16[6*e+0]=r,this.float32[p+1]=a,this.float32[p+2]=o,e}}b.prototype.bytesPerElement=12,De("StructArrayLayout1ui2f12",b);class T extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,r,a)}emplace(e,r,a,o){const p=4*e;return this.uint32[2*e+0]=r,this.uint16[p+2]=a,this.uint16[p+3]=o,e}}T.prototype.bytesPerElement=8,De("StructArrayLayout1ul2ui8",T);class I extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){const a=this.length;return this.resize(a+1),this.emplace(a,e,r)}emplace(e,r,a){const o=2*e;return this.uint16[o+0]=r,this.uint16[o+1]=a,e}}I.prototype.bytesPerElement=4,De("StructArrayLayout2ui4",I);class P extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){return this.uint16[1*e+0]=r,e}}P.prototype.bytesPerElement=2,De("StructArrayLayout1ui2",P);class V extends jt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,a,o){const p=this.length;return this.resize(p+1),this.emplace(p,e,r,a,o)}emplace(e,r,a,o,p){const f=4*e;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=o,this.float32[f+3]=p,e}}V.prototype.bytesPerElement=16,De("StructArrayLayout4f16",V);class N extends Sn{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 ye(this.anchorPointX,this.anchorPointY)}}N.prototype.size=20;class $ extends t{get(e){return new N(this,e)}}De("CollisionBoxArray",$);class B extends Sn{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]}}B.prototype.size=48;class Q extends g{get(e){return new B(this,e)}}De("PlacedSymbolArray",Q);class se extends Sn{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]}}se.prototype.size=64;class G extends _{get(e){return new se(this,e)}}De("SymbolInstanceArray",G);class te extends x{getoffsetX(e){return this.float32[1*e+0]}}De("GlyphOffsetArray",te);class le extends Ca{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}De("SymbolLineVertexArray",le);class ce extends Sn{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]}}ce.prototype.size=12;class fe extends b{get(e){return new ce(this,e)}}De("TextAnchorOffsetArray",fe);class xe extends Sn{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]}}xe.prototype.size=8;class _e extends T{get(e){return new xe(this,e)}}De("FeatureIndexArray",_e);class Se extends Aa{}class Oe extends Aa{}class lt extends Aa{}class ke extends fo{}class He extends mo{}class Ve extends Qn{}class wt extends go{}class ot extends _o{}class et extends yt{}class ct extends u{}class qt extends n{}class kt extends c{}class hi extends h{}class Qt extends I{}const Wt=Nt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hi}=Wt;class Pt{constructor(e=[]){this.segments=e}prepareSegment(e,r,a,o){let p=this.segments[this.segments.length-1];return e>Pt.MAX_VERTEX_ARRAY_LENGTH&&bi(`Max vertices per segment is ${Pt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!p||p.vertexLength+e>Pt.MAX_VERTEX_ARRAY_LENGTH||p.sortKey!==o)&&(p={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},o!==void 0&&(p.sortKey=o),this.segments.push(p)),p}get(){return this.segments}destroy(){for(const e of this.segments)for(const r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,a,o){return new Pt([{vertexOffset:e,primitiveOffset:r,vertexLength:a,primitiveLength:o,vaos:{},sortKey:0}])}}function Sr(i,e){return 256*(i=it(Math.floor(i),0,255))+it(Math.floor(e),0,255)}Pt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,De("SegmentVector",Pt);const Tr=Nt([{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 sn={exports:{}},In={exports:{}};In.exports=function(i,e){var r,a,o,p,f,m,y,v;for(a=i.length-(r=3&i.length),o=e,f=3432918353,m=461845907,v=0;v>>16)*f&65535)<<16)&4294967295)<<15|y>>>17))*m+(((y>>>16)*m&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(p>>>16)&65535)<<16);switch(y=0,r){case 3:y^=(255&i.charCodeAt(v+2))<<16;case 2:y^=(255&i.charCodeAt(v+1))<<8;case 1:o^=y=(65535&(y=(y=(65535&(y^=255&i.charCodeAt(v)))*f+(((y>>>16)*f&65535)<<16)&4294967295)<<15|y>>>17))*m+(((y>>>16)*m&65535)<<16)&4294967295}return o^=i.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};var ea=In.exports,gi={exports:{}};gi.exports=function(i,e){for(var r,a=i.length,o=e^a,p=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(p)|(255&i.charCodeAt(++p))<<8|(255&i.charCodeAt(++p))<<16|(255&i.charCodeAt(++p))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++p;switch(a){case 3:o^=(255&i.charCodeAt(p+2))<<16;case 2:o^=(255&i.charCodeAt(p+1))<<8;case 1:o=1540483477*(65535&(o^=255&i.charCodeAt(p)))+((1540483477*(o>>>16)&65535)<<16)}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};var pi=ea,Ti=gi.exports;sn.exports=pi,sn.exports.murmur3=pi,sn.exports.murmur2=Ti;var An=X(sn.exports);class Zt{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,a,o){this.ids.push(ei(e)),this.positions.push(r,a,o)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=ei(e);let a=0,o=this.ids.length-1;for(;a>1;this.ids[f]>=r?o=f:a=f+1}const p=[];for(;this.ids[a]===r;)p.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return p}static serialize(e,r){const a=new Float64Array(e.ids),o=new Uint32Array(e.positions);return Li(a,o,0,a.length-1),r&&r.push(a.buffer,o.buffer),{ids:a,positions:o}}static deserialize(e){const r=new Zt;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}}function ei(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:An(String(i))}function Li(i,e,r,a){for(;r>1];let p=r-1,f=a+1;for(;;){do p++;while(i[p]o);if(p>=f)break;Gt(i,p,f),Gt(e,3*p,3*f),Gt(e,3*p+1,3*f+1),Gt(e,3*p+2,3*f+2)}f-r`u_${o}`)),this.type=a}setUniform(e,r,a){e.set(a.constantOr(this.value))}getBinding(e,r,a){return this.type==="color"?new Ml(e,r):new fs(e,r)}}class kn{constructor(e,r){this.uniformNames=r.map((a=>`u_${a}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,a,o){const p=o==="u_pattern_to"?this.patternTo:o==="u_pattern_from"?this.patternFrom:o==="u_pixel_ratio_to"?this.pixelRatioTo:o==="u_pixel_ratio_from"?this.pixelRatioFrom:null;p&&e.set(p)}getBinding(e,r,a){return a.substr(0,9)==="u_pattern"?new kl(e,r):new fs(e,r)}}class Ar{constructor(e,r,a,o){this.expression=e,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map((p=>({name:`a_${p}`,type:"Float32",components:a==="color"?2:1,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,r,a,o,p){const f=this.paintVertexArray.length,m=this.expression.evaluate(new Et(0),r,{},o,[],p);this.paintVertexArray.resize(e),this._setPaintValue(f,e,m)}updatePaintArray(e,r,a,o){const p=this.expression.evaluate({zoom:0},a,o);this._setPaintValue(e,r,p)}_setPaintValue(e,r,a){if(this.type==="color"){const o=yo(a);for(let p=e;p`u_${m}_t`)),this.type=a,this.useIntegerZoom=o,this.zoom=p,this.maxValue=0,this.paintVertexAttributes=r.map((m=>({name:`a_${m}`,type:"Float32",components:a==="color"?4:2,offset:0}))),this.paintVertexArray=new f}populatePaintArray(e,r,a,o,p){const f=this.expression.evaluate(new Et(this.zoom),r,{},o,[],p),m=this.expression.evaluate(new Et(this.zoom+1),r,{},o,[],p),y=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(y,e,f,m)}updatePaintArray(e,r,a,o){const p=this.expression.evaluate({zoom:this.zoom},a,o),f=this.expression.evaluate({zoom:this.zoom+1},a,o);this._setPaintValue(e,r,p,f)}_setPaintValue(e,r,a,o){if(this.type==="color"){const p=yo(a),f=yo(o);for(let m=e;m`#define HAS_UNIFORM_${o}`)))}return e}getBinderAttributes(){const e=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof Ar||a instanceof lr)for(let o=0;o!0)){this.programConfigurations={};for(const o of e)this.programConfigurations[o.id]=new xo(o,r,a);this.needsUpload=!1,this._featureMap=new Zt,this._bufferOffset=0}populatePaintArrays(e,r,a,o,p,f){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(e,r,o,p,f);r.id!==void 0&&this._featureMap.add(r.id,a,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,a,o){for(const p of a)this.needsUpload=this.programConfigurations[p.id].updatePaintArrays(e,this._featureMap,r,p,o)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Zm(i,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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Ih(i,e,r){const a={color:{source:Qn,composite:V},number:{source:x,composite:Qn}},o=(function(p){return{"line-pattern":{source:wt,composite:wt},"fill-pattern":{source:wt,composite:wt},"fill-extrusion-pattern":{source:wt,composite:wt}}[p]})(i);return o&&o[r]||a[e][r]}De("ConstantBinder",Ir),De("CrossFadedConstantBinder",kn),De("SourceExpressionBinder",Ar),De("CrossFadedCompositeBinder",Cr),De("CompositeExpressionBinder",lr),De("ProgramConfiguration",xo,{omit:["_buffers"]}),De("ProgramConfigurationSet",Nr);const Yt=8192,Ec=Math.pow(2,14)-1,Ah=-Ec-1;function ka(i){const e=Yt/i.extent,r=i.loadGeometry();for(let a=0;af.x+1||yf.y+1)&&bi("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Ma(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?ka(i):[]}}function El(i,e,r,a,o){i.emplaceBack(2*e+(a+1)/2,2*r+(o+1)/2)}class Pc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Oe,this.indexArray=new hi,this.segments=new Pt,this.programConfigurations=new Nr(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){const o=this.layers[0],p=[];let f=null,m=!1;o.type==="circle"&&(f=o.layout.get("circle-sort-key"),m=!f.isConstant());for(const{feature:y,id:v,index:w,sourceLayerIndex:A}of e){const k=this.layers[0]._featureFilter.needGeometry,z=Ma(y,k);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),z,a))continue;const D=m?f.evaluate(z,{},a):void 0,O={id:v,properties:y.properties,type:y.type,sourceLayerIndex:A,index:w,geometry:k?z.geometry:ka(y),patterns:{},sortKey:D};p.push(O)}m&&p.sort(((y,v)=>y.sortKey-v.sortKey));for(const y of p){const{geometry:v,index:w,sourceLayerIndex:A}=y,k=e[w].feature;this.addFeature(y,v,w,a),r.featureIndex.insert(k,v,w,A,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,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,Hi),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,r,a,o){for(const p of r)for(const f of p){const m=f.x,y=f.y;if(m<0||m>=Yt||y<0||y>=Yt)continue;const v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),w=v.vertexLength;El(this.layoutVertexArray,m,y,-1,-1),El(this.layoutVertexArray,m,y,1,-1),El(this.layoutVertexArray,m,y,1,1),El(this.layoutVertexArray,m,y,-1,1),this.indexArray.emplaceBack(w,w+1,w+2),this.indexArray.emplaceBack(w,w+3,w+2),v.vertexLength+=4,v.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,{},o)}}function Ch(i,e){for(let r=0;r1){if(zc(i,e))return!0;for(let a=0;a1?r:r.sub(e)._mult(o)._add(e))}function Eh(i,e){let r,a,o,p=!1;for(let f=0;fe.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(p=!p)}return p}function ms(i,e){let r=!1;for(let a=0,o=i.length-1;ae.y!=f.y>e.y&&e.x<(f.x-p.x)*(e.y-p.y)/(f.y-p.y)+p.x&&(r=!r)}return r}function Xm(i,e,r){const a=r[0],o=r[2];if(i.xo.x&&e.x>o.x||i.yo.y&&e.y>o.y)return!1;const p=Ui(i,e,r[0]);return p!==Ui(i,e,r[1])||p!==Ui(i,e,r[2])||p!==Ui(i,e,r[3])}function vo(i,e,r){const a=e.paint.get(i).value;return a.kind==="constant"?a.value:r.programConfigurations.get(e.id).getMaxValue(i)}function Pl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function zl(i,e,r,a,o){if(!e[0]&&!e[1])return i;const p=ye.convert(e)._mult(o);r==="viewport"&&p._rotate(-a);const f=[];for(let m=0;mLh(q,O)))})(v,y),z=A?w*m:w;for(const D of o)for(const O of D){const q=A?O:Lh(O,y);let H=z;const re=Dl([],[O.x,O.y,0,1],y);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?H*=re[3]/f.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(H*=f.cameraToCenterDistance/re[3]),Gm(k,q,H))return!0}return!1}}function Lh(i,e){const r=Dl([],[i.x,i.y,0,1],e);return new ye(r[0]/r[3],r[1]/r[3])}class Fh extends Pc{}let Rh;De("HeatmapBucket",Fh,{omit:["layers"]});var Qm={get paint(){return Rh=Rh||new Ht({"heatmap-radius":new Ge(he.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ge(he.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new $e(he.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ho(he.paint_heatmap["heatmap-color"]),"heatmap-opacity":new $e(he.paint_heatmap["heatmap-opacity"])})}};function Fc(i,{width:e,height:r},a,o){if(o){if(o instanceof Uint8ClampedArray)o=new Uint8Array(o.buffer);else if(o.length!==e*r*a)throw new RangeError(`mismatched image size. expected: ${o.length} but got: ${e*r*a}`)}else o=new Uint8Array(e*r*a);return i.width=e,i.height=r,i.data=o,i}function Bh(i,{width:e,height:r},a){if(e===i.width&&r===i.height)return;const o=Fc({},{width:e,height:r},a);Rc(i,o,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,r)},a),i.width=e,i.height=r,i.data=o.data}function Rc(i,e,r,a,o,p){if(o.width===0||o.height===0)return e;if(o.width>i.width||o.height>i.height||r.x>i.width-o.width||r.y>i.height-o.height)throw new RangeError("out of range source coordinates for image copy");if(o.width>e.width||o.height>e.height||a.x>e.width-o.width||a.y>e.height-o.height)throw new RangeError("out of range destination coordinates for image copy");const f=i.data,m=e.data;if(f===m)throw new Error("srcData equals dstData, so image is already copied");for(let y=0;y{e[i.evaluationKey]=y;const v=i.expression.evaluate(e);o.data[f+m+0]=Math.floor(255*v.r/v.a),o.data[f+m+1]=Math.floor(255*v.g/v.a),o.data[f+m+2]=Math.floor(255*v.b/v.a),o.data[f+m+3]=Math.floor(255*v.a)};if(i.clips)for(let f=0,m=0;f80*r){a=p=i[0],o=f=i[1];for(var D=r;Dp&&(p=m),y>f&&(f=y);v=(v=Math.max(p-a,f-o))!==0?32767/v:0}return So(k,z,r,a,o,v,0),z}function Vh(i,e,r,a,o){var p,f;if(o===Vc(i,e,r,a)>0)for(p=e;p=e;p-=a)f=jh(p,i[p],i[p+1],f);return f&&Fl(f,f.next)&&(Io(f),f=f.next),f}function Ea(i,e){if(!i)return i;e||(e=i);var r,a=i;do if(r=!1,a.steiner||!Fl(a,a.next)&&Xt(a.prev,a,a.next)!==0)a=a.next;else{if(Io(a),(a=e=a.prev)===a.next)break;r=!0}while(r||a!==e);return e}function So(i,e,r,a,o,p,f){if(i){!f&&p&&(function(w,A,k,z){var D=w;do D.z===0&&(D.z=Oc(D.x,D.y,A,k,z)),D.prevZ=D.prev,D.nextZ=D.next,D=D.next;while(D!==w);D.prevZ.nextZ=null,D.prevZ=null,(function(O){var q,H,re,Y,ae,oe,me,ze,Ne=1;do{for(H=O,O=null,ae=null,oe=0;H;){for(oe++,re=H,me=0,q=0;q0||ze>0&&re;)me!==0&&(ze===0||!re||H.z<=re.z)?(Y=H,H=H.nextZ,me--):(Y=re,re=re.nextZ,ze--),ae?ae.nextZ=Y:O=Y,Y.prevZ=ae,ae=Y;H=re}ae.nextZ=null,Ne*=2}while(oe>1)})(D)})(i,a,o,p);for(var m,y,v=i;i.prev!==i.next;)if(m=i.prev,y=i.next,p?sg(i,a,o,p):ag(i))e.push(m.i/r|0),e.push(i.i/r|0),e.push(y.i/r|0),Io(i),i=y.next,v=y.next;else if((i=y)===v){f?f===1?So(i=og(Ea(i),e,r),e,r,a,o,p,2):f===2&&lg(i,e,r,a,o,p):So(Ea(i),e,r,a,o,p,1);break}}}function ag(i){var e=i.prev,r=i,a=i.next;if(Xt(e,r,a)>=0)return!1;for(var o=e.x,p=r.x,f=a.x,m=e.y,y=r.y,v=a.y,w=op?o>f?o:f:p>f?p:f,z=m>y?m>v?m:v:y>v?y:v,D=a.next;D!==e;){if(D.x>=w&&D.x<=k&&D.y>=A&&D.y<=z&&_s(o,m,p,y,f,v,D.x,D.y)&&Xt(D.prev,D,D.next)>=0)return!1;D=D.next}return!0}function sg(i,e,r,a){var o=i.prev,p=i,f=i.next;if(Xt(o,p,f)>=0)return!1;for(var m=o.x,y=p.x,v=f.x,w=o.y,A=p.y,k=f.y,z=my?m>v?m:v:y>v?y:v,q=w>A?w>k?w:k:A>k?A:k,H=Oc(z,D,e,r,a),re=Oc(O,q,e,r,a),Y=i.prevZ,ae=i.nextZ;Y&&Y.z>=H&&ae&&ae.z<=re;){if(Y.x>=z&&Y.x<=O&&Y.y>=D&&Y.y<=q&&Y!==o&&Y!==f&&_s(m,w,y,A,v,k,Y.x,Y.y)&&Xt(Y.prev,Y,Y.next)>=0||(Y=Y.prevZ,ae.x>=z&&ae.x<=O&&ae.y>=D&&ae.y<=q&&ae!==o&&ae!==f&&_s(m,w,y,A,v,k,ae.x,ae.y)&&Xt(ae.prev,ae,ae.next)>=0))return!1;ae=ae.nextZ}for(;Y&&Y.z>=H;){if(Y.x>=z&&Y.x<=O&&Y.y>=D&&Y.y<=q&&Y!==o&&Y!==f&&_s(m,w,y,A,v,k,Y.x,Y.y)&&Xt(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}for(;ae&&ae.z<=re;){if(ae.x>=z&&ae.x<=O&&ae.y>=D&&ae.y<=q&&ae!==o&&ae!==f&&_s(m,w,y,A,v,k,ae.x,ae.y)&&Xt(ae.prev,ae,ae.next)>=0)return!1;ae=ae.nextZ}return!0}function og(i,e,r){var a=i;do{var o=a.prev,p=a.next.next;!Fl(o,p)&&Uh(o,a,a.next,p)&&To(o,p)&&To(p,o)&&(e.push(o.i/r|0),e.push(a.i/r|0),e.push(p.i/r|0),Io(a),Io(a.next),a=i=p),a=a.next}while(a!==i);return Ea(a)}function lg(i,e,r,a,o,p){var f=i;do{for(var m=f.next.next;m!==f.prev;){if(f.i!==m.i&&dg(f,m)){var y=$h(f,m);return f=Ea(f,f.next),y=Ea(y,y.next),So(f,e,r,a,o,p,0),void So(y,e,r,a,o,p,0)}m=m.next}f=f.next}while(f!==i)}function cg(i,e){return i.x-e.x}function ug(i,e){var r=(function(o,p){var f,m=p,y=o.x,v=o.y,w=-1/0;do{if(v<=m.y&&v>=m.next.y&&m.next.y!==m.y){var A=m.x+(v-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(A<=y&&A>w&&(w=A,f=m.x=m.x&&m.x>=D&&y!==m.x&&_s(vf.x||m.x===f.x&&hg(f,m)))&&(f=m,q=k)),m=m.next;while(m!==z);return f})(i,e);if(!r)return e;var a=$h(r,i);return Ea(a,a.next),Ea(r,r.next)}function hg(i,e){return Xt(i.prev,i,e.prev)<0&&Xt(e.next,i,i.next)<0}function Oc(i,e,r,a,o){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*o|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-a)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function pg(i){var e=i,r=i;do(e.x=(i-f)*(p-m)&&(i-f)*(a-m)>=(r-f)*(e-m)&&(r-f)*(p-m)>=(o-f)*(a-m)}function dg(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!(function(r,a){var o=r;do{if(o.i!==r.i&&o.next.i!==r.i&&o.i!==a.i&&o.next.i!==a.i&&Uh(o,o.next,r,a))return!0;o=o.next}while(o!==r);return!1})(i,e)&&(To(i,e)&&To(e,i)&&(function(r,a){var o=r,p=!1,f=(r.x+a.x)/2,m=(r.y+a.y)/2;do o.y>m!=o.next.y>m&&o.next.y!==o.y&&f<(o.next.x-o.x)*(m-o.y)/(o.next.y-o.y)+o.x&&(p=!p),o=o.next;while(o!==r);return p})(i,e)&&(Xt(i.prev,i,e.prev)||Xt(i,e.prev,e))||Fl(i,e)&&Xt(i.prev,i,i.next)>0&&Xt(e.prev,e,e.next)>0)}function Xt(i,e,r){return(e.y-i.y)*(r.x-e.x)-(e.x-i.x)*(r.y-e.y)}function Fl(i,e){return i.x===e.x&&i.y===e.y}function Uh(i,e,r,a){var o=Bl(Xt(i,e,r)),p=Bl(Xt(i,e,a)),f=Bl(Xt(r,a,i)),m=Bl(Xt(r,a,e));return o!==p&&f!==m||!(o!==0||!Rl(i,r,e))||!(p!==0||!Rl(i,a,e))||!(f!==0||!Rl(r,i,a))||!(m!==0||!Rl(r,e,a))}function Rl(i,e,r){return e.x<=Math.max(i.x,r.x)&&e.x>=Math.min(i.x,r.x)&&e.y<=Math.max(i.y,r.y)&&e.y>=Math.min(i.y,r.y)}function Bl(i){return i>0?1:i<0?-1:0}function To(i,e){return Xt(i.prev,i,i.next)<0?Xt(i,e,i.next)>=0&&Xt(i,i.prev,e)>=0:Xt(i,e,i.prev)<0||Xt(i,i.next,e)<0}function $h(i,e){var r=new Nc(i.i,i.x,i.y),a=new Nc(e.i,e.x,e.y),o=i.next,p=e.prev;return i.next=e,e.prev=i,r.next=o,o.prev=r,a.next=r,r.prev=a,p.next=a,a.prev=p,a}function jh(i,e,r,a){var o=new Nc(i,e,r);return a?(o.next=a.next,o.prev=a,a.next.prev=o,a.next=o):(o.prev=o,o.next=o),o}function Io(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Nc(i,e,r){this.i=i,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Vc(i,e,r,a){for(var o=0,p=e,f=r-a;p0&&r.holes.push(a+=i[o-1].length)}return r};var qh=X(Bc.exports);function fg(i,e,r,a,o){Zh(i,e,r,a||i.length-1,o||mg)}function Zh(i,e,r,a,o){for(;a>r;){if(a-r>600){var p=a-r+1,f=e-r+1,m=Math.log(p),y=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*y*(p-y)/p)*(f-p/2<0?-1:1);Zh(i,e,Math.max(r,Math.floor(e-f*y/p+v)),Math.min(a,Math.floor(e+(p-f)*y/p+v)),o)}var w=i[e],A=r,k=a;for(Ao(i,r,e),o(i[a],w)>0&&Ao(i,r,a);A0;)k--}o(i[r],w)===0?Ao(i,r,k):Ao(i,++k,a),k<=e&&(r=k+1),e<=k&&(a=k-1)}}function Ao(i,e,r){var a=i[e];i[e]=i[r],i[r]=a}function mg(i,e){return ie?1:0}function Uc(i,e){const r=i.length;if(r<=1)return[i];const a=[];let o,p;for(let f=0;f1)for(let f=0;fr.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new lt,this.indexArray=new hi,this.indexArray2=new Qt,this.programConfigurations=new Nr(e.layers,e.zoom),this.segments=new Pt,this.segments2=new Pt,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.hasPattern=$c("fill",this.layers,r);const o=this.layers[0].layout.get("fill-sort-key"),p=!o.isConstant(),f=[];for(const{feature:m,id:y,index:v,sourceLayerIndex:w}of e){const A=this.layers[0]._featureFilter.needGeometry,k=Ma(m,A);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),k,a))continue;const z=p?o.evaluate(k,{},a,r.availableImages):void 0,D={id:y,properties:m.properties,type:m.type,sourceLayerIndex:w,index:v,geometry:A?k.geometry:ka(m),patterns:{},sortKey:z};f.push(D)}p&&f.sort(((m,y)=>m.sortKey-y.sortKey));for(const m of f){const{geometry:y,index:v,sourceLayerIndex:w}=m;if(this.hasPattern){const A=jc("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(A)}else this.addFeature(m,y,v,a,{});r.featureIndex.insert(e[v].feature,y,v,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,a)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ng),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,r,a,o,p){for(const f of Uc(r,500)){let m=0;for(const z of f)m+=z.length;const y=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),v=y.vertexLength,w=[],A=[];for(const z of f){if(z.length===0)continue;z!==f[0]&&A.push(w.length/2);const D=this.segments2.prepareSegment(z.length,this.layoutVertexArray,this.indexArray2),O=D.vertexLength;this.layoutVertexArray.emplaceBack(z[0].x,z[0].y),this.indexArray2.emplaceBack(O+z.length-1,O),w.push(z[0].x),w.push(z[0].y);for(let q=1;q>3}if(o--,a===1||a===2)p+=i.readSVarint(),f+=i.readSVarint(),a===1&&(e&&m.push(e),e=[]),e.push(new wg(p,f));else{if(a!==7)throw new Error("unknown command "+a);e&&e.push(e[0].clone())}}return e&&m.push(e),m},ys.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,r=1,a=0,o=0,p=0,f=1/0,m=-1/0,y=1/0,v=-1/0;i.pos>3}if(a--,r===1||r===2)(o+=i.readSVarint())m&&(m=o),(p+=i.readSVarint())v&&(v=p);else if(r!==7)throw new Error("unknown command "+r)}return[f,y,m,v]},ys.prototype.toGeoJSON=function(i,e,r){var a,o,p=this.extent*Math.pow(2,r),f=this.extent*i,m=this.extent*e,y=this.loadGeometry(),v=ys.types[this.type];function w(z){for(var D=0;D>3;o=f===1?a.readString():f===2?a.readFloat():f===3?a.readDouble():f===4?a.readVarint64():f===5?a.readVarint():f===6?a.readSVarint():f===7?a.readBoolean():null}return o})(r))}Kh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Ig(this._pbf,e,this.extent,this._keys,this._values)};var Cg=Xh;function kg(i,e,r){if(i===3){var a=new Cg(r,r.readVarint()+r.pos);a.length&&(e[a.name]=a)}}ta.VectorTile=function(i,e){this.layers=i.readFields(kg,{},e)},ta.VectorTileFeature=Wh,ta.VectorTileLayer=Xh;const Mg=ta.VectorTileFeature.types,Zc=Math.pow(2,13);function Co(i,e,r,a,o,p,f,m){i.emplaceBack(e,r,2*Math.floor(a*Zc)+f,o*Zc*2,p*Zc*2,Math.round(m))}class Gc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((r=>r.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ke,this.centroidVertexArray=new Se,this.indexArray=new hi,this.programConfigurations=new Nr(e.layers,e.zoom),this.segments=new Pt,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.features=[],this.hasPattern=$c("fill-extrusion",this.layers,r);for(const{feature:o,id:p,index:f,sourceLayerIndex:m}of e){const y=this.layers[0]._featureFilter.needGeometry,v=Ma(o,y);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),v,a))continue;const w={id:p,sourceLayerIndex:m,index:f,geometry:y?v.geometry:ka(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(jc("fill-extrusion",this.layers,w,this.zoom,r)):this.addFeature(w,w.geometry,f,a,{}),r.featureIndex.insert(o,w.geometry,f,m,this.index,!0)}}addFeatures(e,r,a){for(const o of this.features){const{geometry:p}=o;this.addFeature(o,p,o.index,r,a)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,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,bg),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,vg.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,r,a,o,p){const f={x:0,y:0,vertexCount:0};for(const m of Uc(r,500)){let y=0;for(const D of m)y+=D.length;let v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const D of m){if(D.length===0||Pg(D))continue;let O=0;for(let q=0;q=1){const re=D[q-1];if(!Eg(H,re)){v.vertexLength+4>Pt.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Y=H.sub(re)._perp()._unit(),ae=re.dist(H);O+ae>32768&&(O=0),Co(this.layoutVertexArray,H.x,H.y,Y.x,Y.y,0,0,O),Co(this.layoutVertexArray,H.x,H.y,Y.x,Y.y,0,1,O),f.x+=2*H.x,f.y+=2*H.y,f.vertexCount+=2,O+=ae,Co(this.layoutVertexArray,re.x,re.y,Y.x,Y.y,0,0,O),Co(this.layoutVertexArray,re.x,re.y,Y.x,Y.y,0,1,O),f.x+=2*re.x,f.y+=2*re.y,f.vertexCount+=2;const oe=v.vertexLength;this.indexArray.emplaceBack(oe,oe+2,oe+1),this.indexArray.emplaceBack(oe+1,oe+2,oe+3),v.vertexLength+=4,v.primitiveLength+=2}}}}if(v.vertexLength+y>Pt.MAX_VERTEX_ARRAY_LENGTH&&(v=this.segments.prepareSegment(y,this.layoutVertexArray,this.indexArray)),Mg[e.type]!=="Polygon")continue;const w=[],A=[],k=v.vertexLength;for(const D of m)if(D.length!==0){D!==m[0]&&A.push(w.length/2);for(let O=0;OYt)||i.y===e.y&&(i.y<0||i.y>Yt)}function Pg(i){return i.every((e=>e.x<0))||i.every((e=>e.x>Yt))||i.every((e=>e.y<0))||i.every((e=>e.y>Yt))}let Yh;De("FillExtrusionBucket",Gc,{omit:["layers","features"]});var zg={get paint(){return Yh=Yh||new Ht({"fill-extrusion-opacity":new $e(he["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ge(he["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new $e(he["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new $e(he["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ia(he["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ge(he["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ge(he["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new $e(he["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Dg extends or{constructor(e){super(e,zg)}createBucket(e){return new Gc(e)}queryRadius(){return Pl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,a,o,p,f,m,y){const v=zl(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),f.angle,m),w=this.paint.get("fill-extrusion-height").evaluate(r,a),A=this.paint.get("fill-extrusion-base").evaluate(r,a),k=(function(D,O,q,H){const re=[];for(const Y of D){const ae=[Y.x,Y.y,0,1];Dl(ae,ae,O),re.push(new ye(ae[0]/ae[3],ae[1]/ae[3]))}return re})(v,y),z=(function(D,O,q,H){const re=[],Y=[],ae=H[8]*O,oe=H[9]*O,me=H[10]*O,ze=H[11]*O,Ne=H[8]*q,Ee=H[9]*q,Me=H[10]*q,Te=H[11]*q;for(const Le of D){const Ae=[],ve=[];for(const qe of Le){const Ue=qe.x,at=qe.y,zt=H[0]*Ue+H[4]*at+H[12],Lt=H[1]*Ue+H[5]*at+H[13],ii=H[2]*Ue+H[6]*at+H[14],cr=H[3]*Ue+H[7]*at+H[15],Ri=ii+me,Jt=cr+ze,di=zt+Ne,yi=Lt+Ee,Bi=ii+Me,Oi=cr+Te,ri=new ye((zt+ae)/Jt,(Lt+oe)/Jt);ri.z=Ri/Jt,Ae.push(ri);const ni=new ye(di/Oi,yi/Oi);ni.z=Bi/Oi,ve.push(ni)}re.push(Ae),Y.push(ve)}return[re,Y]})(o,A,w,y);return(function(D,O,q){let H=1/0;kh(q,O)&&(H=Jh(q,O[0]));for(let re=0;rer.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((r=>{this.gradients[r.id]={}})),this.layoutVertexArray=new He,this.layoutVertexArray2=new Ve,this.indexArray=new hi,this.programConfigurations=new Nr(e.layers,e.zoom),this.segments=new Pt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((r=>r.isStateDependent())).map((r=>r.id))}populate(e,r,a){this.hasPattern=$c("line",this.layers,r);const o=this.layers[0].layout.get("line-sort-key"),p=!o.isConstant(),f=[];for(const{feature:m,id:y,index:v,sourceLayerIndex:w}of e){const A=this.layers[0]._featureFilter.needGeometry,k=Ma(m,A);if(!this.layers[0]._featureFilter.filter(new Et(this.zoom),k,a))continue;const z=p?o.evaluate(k,{},a):void 0,D={id:y,properties:m.properties,type:m.type,sourceLayerIndex:w,index:v,geometry:A?k.geometry:ka(m),patterns:{},sortKey:z};f.push(D)}p&&f.sort(((m,y)=>m.sortKey-y.sortKey));for(const m of f){const{geometry:y,index:v,sourceLayerIndex:w}=m;if(this.hasPattern){const A=jc("line",this.layers,m,this.zoom,r);this.patternFeatures.push(A)}else this.addFeature(m,y,v,a,{});r.featureIndex.insert(e[v].feature,y,v,w,this.index)}}update(e,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,a)}addFeatures(e,r,a){for(const o of this.patternFeatures)this.addFeature(o,o.geometry,o.index,r,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,Bg)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Fg),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,r,a,o,p){const f=this.layers[0].layout,m=f.get("line-join").evaluate(e,{}),y=f.get("line-cap"),v=f.get("line-miter-limit"),w=f.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const A of r)this.addLine(A,e,m,y,v,w);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,p,o)}addLine(e,r,a,o,p,f){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let H=0;H=2&&e[y-1].equals(e[y-2]);)y--;let v=0;for(;v0;if(ze&&H>v){const Te=k.dist(z);if(Te>2*w){const Le=k.sub(k.sub(z)._mult(w/Te)._round());this.updateDistance(z,Le),this.addCurrentVertex(Le,O,0,0,A),z=Le}}const Ee=z&&D;let Me=Ee?a:m?"butt":o;if(Ee&&Me==="round"&&(oep&&(Me="bevel"),Me==="bevel"&&(oe>2&&(Me="flipbevel"),oe100)re=q.mult(-1);else{const Te=oe*O.add(q).mag()/O.sub(q).mag();re._perp()._mult(Te*(Ne?-1:1))}this.addCurrentVertex(k,re,0,0,A),this.addCurrentVertex(k,re.mult(-1),0,0,A)}else if(Me==="bevel"||Me==="fakeround"){const Te=-Math.sqrt(oe*oe-1),Le=Ne?Te:0,Ae=Ne?0:Te;if(z&&this.addCurrentVertex(k,O,Le,Ae,A),Me==="fakeround"){const ve=Math.round(180*me/Math.PI/20);for(let qe=1;qe2*w){const Le=k.add(D.sub(k)._mult(w/Te)._round());this.updateDistance(k,Le),this.addCurrentVertex(Le,q,0,0,A),k=Le}}}}addCurrentVertex(e,r,a,o,p,f=!1){const m=r.y*o-r.x,y=-r.y-r.x*o;this.addHalfVertex(e,r.x+r.y*a,r.y-r.x*a,f,!1,a,p),this.addHalfVertex(e,m,y,f,!0,-o,p),this.distance>Qh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,a,o,p,f))}addHalfVertex({x:e,y:r},a,o,p,f,m,y){const v=.5*(this.lineClips?this.scaledDistance*(Qh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(p?1:0),(r<<1)+(f?1:0),Math.round(63*a)+128,Math.round(63*o)+128,1+(m===0?0:m<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const w=y.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,w),y.primitiveLength++),f?this.e2=w:this.e1=w}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}}let ep,tp;De("LineBucket",Hc,{omit:["layers","patternFeatures"]});var ip={get paint(){return tp=tp||new Ht({"line-opacity":new Ge(he.paint_line["line-opacity"]),"line-color":new Ge(he.paint_line["line-color"]),"line-translate":new $e(he.paint_line["line-translate"]),"line-translate-anchor":new $e(he.paint_line["line-translate-anchor"]),"line-width":new Ge(he.paint_line["line-width"]),"line-gap-width":new Ge(he.paint_line["line-gap-width"]),"line-offset":new Ge(he.paint_line["line-offset"]),"line-blur":new Ge(he.paint_line["line-blur"]),"line-dasharray":new uo(he.paint_line["line-dasharray"]),"line-pattern":new Ia(he.paint_line["line-pattern"]),"line-gradient":new ho(he.paint_line["line-gradient"])})},get layout(){return ep=ep||new Ht({"line-cap":new $e(he.layout_line["line-cap"]),"line-join":new Ge(he.layout_line["line-join"]),"line-miter-limit":new $e(he.layout_line["line-miter-limit"]),"line-round-limit":new $e(he.layout_line["line-round-limit"]),"line-sort-key":new Ge(he.layout_line["line-sort-key"])})}};class Vg extends Ge{possiblyEvaluate(e,r){return r=new Et(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,a,o){return r=vt({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,a,o)}}let Ol;class Ug extends or{constructor(e){super(e,ip),this.gradientVersion=0,Ol||(Ol=new Vg(ip.paint.properties["line-width"].specification),Ol.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const r=this.gradientExpression();this.stepInterpolant=!!(function(a){return a._styleExpression!==void 0})(r)&&r._styleExpression.expression instanceof en,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=Ol.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Hc(e)}queryRadius(e){const r=e,a=rp(vo("line-width",this,r),vo("line-gap-width",this,r)),o=vo("line-offset",this,r);return a/2+Math.abs(o)+Pl(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,a,o,p,f,m){const y=zl(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),f.angle,m),v=m/2*rp(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),w=this.paint.get("line-offset").evaluate(r,a);return w&&(o=(function(A,k){const z=[];for(let D=0;D=3){for(let q=0;q0?e+2*i:i}const $g=Nt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),jg=Nt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Nt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const qg=Nt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Nt([{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 np=Nt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Zg=Nt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Gg(i,e,r){return i.sections.forEach((a=>{a.text=(function(o,p,f){const m=p.layout.get("text-transform").evaluate(f,{});return m==="uppercase"?o=o.toLocaleUpperCase():m==="lowercase"&&(o=o.toLocaleLowerCase()),Gi.applyArabicShaping&&(o=Gi.applyArabicShaping(o)),o})(a.text,e,r)})),i}Nt([{name:"triangle",components:3,type:"Uint16"}]),Nt([{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"}]),Nt([{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"}]),Nt([{type:"Float32",name:"offsetX"}]),Nt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Nt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Mo={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ti=24,ap=Tt,sp=function(i,e,r,a,o){var p,f,m=8*o-a-1,y=(1<>1,w=-7,A=o-1,k=-1,z=i[e+A];for(A+=k,p=z&(1<<-w)-1,z>>=-w,w+=m;w>0;p=256*p+i[e+A],A+=k,w-=8);for(f=p&(1<<-w)-1,p>>=-w,w+=a;w>0;f=256*f+i[e+A],A+=k,w-=8);if(p===0)p=1-v;else{if(p===y)return f?NaN:1/0*(z?-1:1);f+=Math.pow(2,a),p-=v}return(z?-1:1)*f*Math.pow(2,p-a)},op=function(i,e,r,a,o,p){var f,m,y,v=8*p-o-1,w=(1<>1,k=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,D=1,O=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(m=isNaN(e)?1:0,f=w):(f=Math.floor(Math.log(e)/Math.LN2),e*(y=Math.pow(2,-f))<1&&(f--,y*=2),(e+=f+A>=1?k/y:k*Math.pow(2,1-A))*y>=2&&(f++,y/=2),f+A>=w?(m=0,f=w):f+A>=1?(m=(e*y-1)*Math.pow(2,o),f+=A):(m=e*Math.pow(2,A-1)*Math.pow(2,o),f=0));o>=8;i[r+z]=255&m,z+=D,m/=256,o-=8);for(f=f<0;i[r+z]=255&f,z+=D,f/=256,v-=8);i[r+z-D]|=128*O};function Tt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Tt.Varint=0,Tt.Fixed64=1,Tt.Bytes=2,Tt.Fixed32=5;var Wc=4294967296,lp=1/Wc,cp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Mn(i){return i.type===Tt.Bytes?i.readVarint()+i.pos:i.pos+1}function xs(i,e,r){return r?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function up(i,e,r){var a=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(a);for(var o=r.pos-1;o>=i;o--)r.buf[o+a]=r.buf[o]}function Hg(i,e){for(var r=0;r>>8,i[r+2]=e>>>16,i[r+3]=e>>>24}function hp(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Tt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,r){for(r=r||this.length;this.pos>3,p=this.pos;this.type=7&a,i(o,e,this),this.pos===p&&this.skip(a)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Nl(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=hp(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Nl(this.buf,this.pos)+Nl(this.buf,this.pos+4)*Wc;return this.pos+=8,i},readSFixed64:function(){var i=Nl(this.buf,this.pos)+hp(this.buf,this.pos+4)*Wc;return this.pos+=8,i},readFloat:function(){var i=sp(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=sp(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,r,a=this.buf;return e=127&(r=a[this.pos++]),r<128?e:(e|=(127&(r=a[this.pos++]))<<7,r<128?e:(e|=(127&(r=a[this.pos++]))<<14,r<128?e:(e|=(127&(r=a[this.pos++]))<<21,r<128?e:(function(o,p,f){var m,y,v=f.buf;if(m=(112&(y=v[f.pos++]))>>4,y<128||(m|=(127&(y=v[f.pos++]))<<3,y<128)||(m|=(127&(y=v[f.pos++]))<<10,y<128)||(m|=(127&(y=v[f.pos++]))<<17,y<128)||(m|=(127&(y=v[f.pos++]))<<24,y<128)||(m|=(1&(y=v[f.pos++]))<<31,y<128))return xs(o,m,p);throw new Error("Expected varint not more than 10 bytes")})(e|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&cp?(function(r,a,o){return cp.decode(r.subarray(a,o))})(this.buf,e,i):(function(r,a,o){for(var p="",f=a;f239?4:w>223?3:w>191?2:1;if(f+k>o)break;k===1?w<128&&(A=w):k===2?(192&(m=r[f+1]))==128&&(A=(31&w)<<6|63&m)<=127&&(A=null):k===3?(y=r[f+2],(192&(m=r[f+1]))==128&&(192&y)==128&&((A=(15&w)<<12|(63&m)<<6|63&y)<=2047||A>=55296&&A<=57343)&&(A=null)):k===4&&(y=r[f+2],v=r[f+3],(192&(m=r[f+1]))==128&&(192&y)==128&&(192&v)==128&&((A=(15&w)<<18|(63&m)<<12|(63&y)<<6|63&v)<=65535||A>=1114112)&&(A=null)),A===null?(A=65533,k=1):A>65535&&(A-=65536,p+=String.fromCharCode(A>>>10&1023|55296),A=56320|1023&A),p+=String.fromCharCode(A),f+=k}return p})(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Tt.Bytes)return i.push(this.readVarint(e));var r=Mn(this);for(i=i||[];this.pos127;);else if(e===Tt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Tt.Fixed32)this.pos+=4;else{if(e!==Tt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?(function(e,r){var a,o;if(e>=0?(a=e%4294967296|0,o=e/4294967296|0):(o=~(-e/4294967296),4294967295^(a=~(-e%4294967296))?a=a+1|0:(a=0,o=o+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),(function(p,f,m){m.buf[m.pos++]=127&p|128,p>>>=7,m.buf[m.pos++]=127&p|128,p>>>=7,m.buf[m.pos++]=127&p|128,p>>>=7,m.buf[m.pos++]=127&p|128,m.buf[m.pos]=127&(p>>>=7)})(a,0,r),(function(p,f){var m=(7&p)<<4;f.buf[f.pos++]|=m|((p>>>=3)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p|((p>>>=7)?128:0),p&&(f.buf[f.pos++]=127&p)))))})(o,r)})(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=(function(a,o,p){for(var f,m,y=0;y55295&&f<57344){if(!m){f>56319||y+1===o.length?(a[p++]=239,a[p++]=191,a[p++]=189):m=f;continue}if(f<56320){a[p++]=239,a[p++]=191,a[p++]=189,m=f;continue}f=m-55296<<10|f-56320|65536,m=null}else m&&(a[p++]=239,a[p++]=191,a[p++]=189,m=null);f<128?a[p++]=f:(f<2048?a[p++]=f>>6|192:(f<65536?a[p++]=f>>12|224:(a[p++]=f>>18|240,a[p++]=f>>12&63|128),a[p++]=f>>6&63|128),a[p++]=63&f|128)}return p})(this.buf,i,this.pos);var r=this.pos-e;r>=128&&up(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),op(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),op(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&up(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,e,r){this.writeTag(i,Tt.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Hg,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Wg,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Yg,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Xg,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Kg,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,Jg,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,Qg,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,e_,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,t_,e)},writeBytesField:function(i,e){this.writeTag(i,Tt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Tt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Tt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Tt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Tt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Tt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Tt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Tt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Tt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Tt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var Xc=X(ap);const Kc=3;function i_(i,e,r){i===1&&r.readMessage(r_,e)}function r_(i,e,r){if(i===3){const{id:a,bitmap:o,width:p,height:f,left:m,top:y,advance:v}=r.readMessage(n_,{});e.push({id:a,bitmap:new wo({width:p+2*Kc,height:f+2*Kc},o),metrics:{width:p,height:f,left:m,top:y,advance:v}})}}function n_(i,e,r){i===1?e.id=r.readVarint():i===2?e.bitmap=r.readBytes():i===3?e.width=r.readVarint():i===4?e.height=r.readVarint():i===5?e.left=r.readSVarint():i===6?e.top=r.readSVarint():i===7&&(e.advance=r.readVarint())}const pp=Kc;function dp(i){let e=0,r=0;for(const f of i)e+=f.w*f.h,r=Math.max(r,f.w);i.sort(((f,m)=>m.h-f.h));const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let o=0,p=0;for(const f of i)for(let m=a.length-1;m>=0;m--){const y=a[m];if(!(f.w>y.w||f.h>y.h)){if(f.x=y.x,f.y=y.y,p=Math.max(p,f.y+f.h),o=Math.max(o,f.x+f.w),f.w===y.w&&f.h===y.h){const v=a.pop();m=0&&a>=e&&Ul[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){const a=new bs;return a.text=this.text.substring(e,r),a.sectionIndex=this.sectionIndex.slice(e,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,r)=>Math.max(e,this.sections[r].scale)),0)}addTextSection(e,r){this.text+=e.text,this.sections.push(Po.forText(e.scale,e.fontStack||r));const a=this.sections.length-1;for(let o=0;o=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Vl(i,e,r,a,o,p,f,m,y,v,w,A,k,z,D,O){const q=bs.fromFeature(i,o);let H;A===l.ai.vertical&&q.verticalizePunctuation();const{processBidirectionalText:re,processStyledBidirectionalText:Y}=Gi;if(re&&q.sections.length===1){H=[];const me=re(q.toString(),Jc(q,v,p,e,a,z,D));for(const ze of me){const Ne=new bs;Ne.text=ze,Ne.sections=q.sections;for(let Ee=0;Ee0&&Pn>Xi&&(Xi=Pn)}else{const fr=Ne[ut.fontStack],Yi=fr&&fr[xi];if(Yi&&Yi.rect)Vr=Yi.rect,kr=Yi.metrics;else{const Pn=ze[ut.fontStack],Ro=Pn&&Pn[xi];if(!Ro)continue;kr=Ro.metrics}si=(ni-ut.scale)*ti}Mr?(me.verticalizable=!0,Ai.push({glyph:xi,imageName:Ur,x:zt,y:Lt+si,vertical:Mr,scale:ut.scale,fontStack:ut.fontStack,sectionIndex:Ci,metrics:kr,rect:Vr}),zt+=En*ut.scale+qe):(Ai.push({glyph:xi,imageName:Ur,x:zt,y:Lt+si,vertical:Mr,scale:ut.scale,fontStack:ut.fontStack,sectionIndex:Ci,metrics:kr,rect:Vr}),zt+=kr.advance*ut.scale+qe)}Ai.length!==0&&(ii=Math.max(zt-qe,ii),o_(Ai,0,Ai.length-1,Ri,Xi)),zt=0;const Ki=Te*ni+Xi;Ni.lineOffset=Math.max(Xi,Ii),Lt+=Ki,cr=Math.max(Ki,cr),++Jt}var di;const yi=Lt-Eo,{horizontalAlign:Bi,verticalAlign:Oi}=Qc(Le);(function(ri,ni,Ii,Ni,Ai,Xi,Ki,ai,ut){const Ci=(ni-Ii)*Ai;let xi=0;xi=Xi!==Ki?-ai*Ni-Eo:(-Ni*ut+.5)*Ki;for(const si of ri)for(const kr of si.positionedGlyphs)kr.x+=Ci,kr.y+=xi})(me.positionedLines,Ri,Bi,Oi,ii,cr,Te,yi,Me.length),me.top+=-Oi*yi,me.bottom=me.top+yi,me.left+=-Bi*ii,me.right=me.left+ii})(oe,e,r,a,H,f,m,y,A,v,k,O),!(function(me){for(const ze of me)if(ze.positionedGlyphs.length!==0)return!1;return!0})(ae)&&oe}const Ul={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},a_={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 mp(i,e,r,a,o,p){if(e.imageName){const f=a[e.imageName];return f?f.displaySize[0]*e.scale*ti/p+o:0}{const f=r[e.fontStack],m=f&&f[i];return m?m.metrics.advance*e.scale+o:0}}function gp(i,e,r,a){const o=Math.pow(i-e,2);return a?i=0;let w=0;for(let k=0;kf.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=Lc([]),this.placementViewportMatrix=Lc([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=vp(this.zoom,r["text-size"]),this.iconSizeData=vp(this.zoom,r["icon-size"]);const a=this.layers[0].layout,o=a.get("symbol-sort-key"),p=a.get("symbol-z-order");this.canOverlap=eu(a,"text-overlap","text-allow-overlap")!=="never"||eu(a,"icon-overlap","icon-allow-overlap")!=="never"||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey=p!=="viewport-y"&&!o.isConstant(),this.sortFeaturesByY=(p==="viewport-y"||p==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,a.get("symbol-placement")==="point"&&(this.writingModes=a.get("text-writing-mode").map((f=>l.ai[f]))),this.stateDependentLayerIds=this.layers.filter((f=>f.isStateDependent())).map((f=>f.id)),this.sourceID=e.sourceID}createArrays(){this.text=new iu(new Nr(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new iu(new Nr(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new te,this.lineVertexArray=new le,this.symbolInstances=new G,this.textAnchorOffsets=new fe}calculateGlyphDependencies(e,r,a,o,p){for(let f=0;f0)&&(f.value.kind!=="constant"||f.value.value.length>0),w=y.value.kind!=="constant"||!!y.value.value||Object.keys(y.parameters).length>0,A=p.get("symbol-sort-key");if(this.features=[],!v&&!w)return;const k=r.iconDependencies,z=r.glyphDependencies,D=r.availableImages,O=new Et(this.zoom);for(const{feature:q,id:H,index:re,sourceLayerIndex:Y}of e){const ae=o._featureFilter.needGeometry,oe=Ma(q,ae);if(!o._featureFilter.filter(O,oe,a))continue;let me,ze;if(ae||(oe.geometry=ka(q)),v){const Ee=o.getValueAndResolveTokens("text-field",oe,a,D),Me=mi.factory(Ee);h_(Me)&&(this.hasRTLText=!0),(!this.hasRTLText||lo()==="unavailable"||this.hasRTLText&&Gi.isParsed())&&(me=Gg(Me,o,oe))}if(w){const Ee=o.getValueAndResolveTokens("icon-image",oe,a,D);ze=Ee instanceof ui?Ee:ui.fromString(Ee)}if(!me&&!ze)continue;const Ne=this.sortFeaturesByKey?A.evaluate(oe,{},a):void 0;if(this.features.push({id:H,text:me,icon:ze,index:re,sourceLayerIndex:Y,geometry:oe.geometry,properties:q.properties,type:c_[q.type],sortKey:Ne}),ze&&(k[ze.name]=!0),me){const Ee=f.evaluate(oe,{},a).join(","),Me=p.get("text-rotation-alignment")!=="viewport"&&p.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(l.ai.vertical)>=0;for(const Te of me.sections)if(Te.image)k[Te.image.name]=!0;else{const Le=eo(me.toString()),Ae=Te.fontStack||Ee,ve=z[Ae]=z[Ae]||{};this.calculateGlyphDependencies(Te.text,ve,Me,this.allowVerticalPlacement,Le)}}}p.get("symbol-placement")==="line"&&(this.features=(function(q){const H={},re={},Y=[];let ae=0;function oe(Ee){Y.push(q[Ee]),ae++}function me(Ee,Me,Te){const Le=re[Ee];return delete re[Ee],re[Me]=Le,Y[Le].geometry[0].pop(),Y[Le].geometry[0]=Y[Le].geometry[0].concat(Te[0]),Le}function ze(Ee,Me,Te){const Le=H[Me];return delete H[Me],H[Ee]=Le,Y[Le].geometry[0].shift(),Y[Le].geometry[0]=Te[0].concat(Y[Le].geometry[0]),Le}function Ne(Ee,Me,Te){const Le=Te?Me[0][Me[0].length-1]:Me[0][0];return`${Ee}:${Le.x}:${Le.y}`}for(let Ee=0;EeEe.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((q,H)=>q.sortKey-H.sortKey))}update(e,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(e,r,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,r){const a=this.lineVertexArray.length;if(e.segment!==void 0){let o=e.dist(r[e.segment+1]),p=e.dist(r[e.segment]);const f={};for(let m=e.segment+1;m=0;m--)f[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:p},m>0&&(p+=r[m-1].dist(r[m]));for(let m=0;m0}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,r){const a=e.placedSymbolArray.get(r),o=a.vertexStartIndex+4*a.numGlyphs;for(let p=a.vertexStartIndex;po[m]-o[y]||p[y]-p[m])),f}addToSortKeyRanges(e,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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 r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach(((o,p,f)=>{o>=0&&f.indexOf(o)===p&&this.addIndicesForPlacedSymbol(this.text,o)})),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 bp,wp;De("SymbolBucket",ws,{omit:["layers","collisionBoxArray","features","compareText"]}),ws.MAX_GLYPHS=65535,ws.addDynamicAttributes=tu;var nu={get paint(){return wp=wp||new Ht({"icon-opacity":new Ge(he.paint_symbol["icon-opacity"]),"icon-color":new Ge(he.paint_symbol["icon-color"]),"icon-halo-color":new Ge(he.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ge(he.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ge(he.paint_symbol["icon-halo-blur"]),"icon-translate":new $e(he.paint_symbol["icon-translate"]),"icon-translate-anchor":new $e(he.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ge(he.paint_symbol["text-opacity"]),"text-color":new Ge(he.paint_symbol["text-color"],{runtimeType:wi,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Ge(he.paint_symbol["text-halo-color"]),"text-halo-width":new Ge(he.paint_symbol["text-halo-width"]),"text-halo-blur":new Ge(he.paint_symbol["text-halo-blur"]),"text-translate":new $e(he.paint_symbol["text-translate"]),"text-translate-anchor":new $e(he.paint_symbol["text-translate-anchor"])})},get layout(){return bp=bp||new Ht({"symbol-placement":new $e(he.layout_symbol["symbol-placement"]),"symbol-spacing":new $e(he.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new $e(he.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ge(he.layout_symbol["symbol-sort-key"]),"symbol-z-order":new $e(he.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new $e(he.layout_symbol["icon-allow-overlap"]),"icon-overlap":new $e(he.layout_symbol["icon-overlap"]),"icon-ignore-placement":new $e(he.layout_symbol["icon-ignore-placement"]),"icon-optional":new $e(he.layout_symbol["icon-optional"]),"icon-rotation-alignment":new $e(he.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ge(he.layout_symbol["icon-size"]),"icon-text-fit":new $e(he.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new $e(he.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ge(he.layout_symbol["icon-image"]),"icon-rotate":new Ge(he.layout_symbol["icon-rotate"]),"icon-padding":new Ge(he.layout_symbol["icon-padding"]),"icon-keep-upright":new $e(he.layout_symbol["icon-keep-upright"]),"icon-offset":new Ge(he.layout_symbol["icon-offset"]),"icon-anchor":new Ge(he.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new $e(he.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new $e(he.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new $e(he.layout_symbol["text-rotation-alignment"]),"text-field":new Ge(he.layout_symbol["text-field"]),"text-font":new Ge(he.layout_symbol["text-font"]),"text-size":new Ge(he.layout_symbol["text-size"]),"text-max-width":new Ge(he.layout_symbol["text-max-width"]),"text-line-height":new $e(he.layout_symbol["text-line-height"]),"text-letter-spacing":new Ge(he.layout_symbol["text-letter-spacing"]),"text-justify":new Ge(he.layout_symbol["text-justify"]),"text-radial-offset":new Ge(he.layout_symbol["text-radial-offset"]),"text-variable-anchor":new $e(he.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ge(he.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ge(he.layout_symbol["text-anchor"]),"text-max-angle":new $e(he.layout_symbol["text-max-angle"]),"text-writing-mode":new $e(he.layout_symbol["text-writing-mode"]),"text-rotate":new Ge(he.layout_symbol["text-rotate"]),"text-padding":new $e(he.layout_symbol["text-padding"]),"text-keep-upright":new $e(he.layout_symbol["text-keep-upright"]),"text-transform":new Ge(he.layout_symbol["text-transform"]),"text-offset":new Ge(he.layout_symbol["text-offset"]),"text-allow-overlap":new $e(he.layout_symbol["text-allow-overlap"]),"text-overlap":new $e(he.layout_symbol["text-overlap"]),"text-ignore-placement":new $e(he.layout_symbol["text-ignore-placement"]),"text-optional":new $e(he.layout_symbol["text-optional"])})}};class Sp{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:Dr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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}}De("FormatSectionOverride",Sp,{omit:["defaultValue"]});class jl extends or{constructor(e){super(e,nu)}recalculate(e,r){if(super.recalculate(e,r),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 o=[];for(const p of a)o.indexOf(p)<0&&o.push(p);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,a,o){const p=this.layout.get(e).evaluate(r,{},a,o),f=this._unevaluatedLayout._values[e];return f.isDataDriven()||is(f.value)||!p?p:(function(m,y){return y.replace(/{([^{}]+)}/g,((v,w)=>m&&w in m?String(m[w]):""))})(r.properties,p)}createBucket(e){return new ws(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of nu.paint.overridableProperties){if(!jl.hasPaintOverride(this.layout,e))continue;const r=this.paint.get(e),a=new Sp(r),o=new Ws(a,r.property.specification);let p=null;p=r.value.kind==="constant"||r.value.kind==="source"?new Xs("source",o):new ns("composite",o,r.value.zoomStops),this.paint._values[e]=new Si(r.property,p,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&jl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){const a=e.get("text-field"),o=nu.paint.properties[r];let p=!1;const f=m=>{for(const y of m)if(o.overrides&&o.overrides.hasOverride(y))return void(p=!0)};if(a.value.kind==="constant"&&a.value.value instanceof mi)f(a.value.value.sections);else if(a.value.kind==="source"){const m=v=>{p||(v instanceof _n&&Rt(v.value)===U?f(v.value.sections):v instanceof ts?f(v.sections):v.eachChild(m))},y=a.value;y._styleExpression&&m(y._styleExpression.expression)}return p}}let Tp;var p_={get paint(){return Tp=Tp||new Ht({"background-color":new $e(he.paint_background["background-color"]),"background-pattern":new uo(he.paint_background["background-pattern"]),"background-opacity":new $e(he.paint_background["background-opacity"])})}};class d_ extends or{constructor(e){super(e,p_)}}let Ip;var f_={get paint(){return Ip=Ip||new Ht({"raster-opacity":new $e(he.paint_raster["raster-opacity"]),"raster-hue-rotate":new $e(he.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new $e(he.paint_raster["raster-brightness-min"]),"raster-brightness-max":new $e(he.paint_raster["raster-brightness-max"]),"raster-saturation":new $e(he.paint_raster["raster-saturation"]),"raster-contrast":new $e(he.paint_raster["raster-contrast"]),"raster-resampling":new $e(he.paint_raster["raster-resampling"]),"raster-fade-duration":new $e(he.paint_raster["raster-fade-duration"])})}};class m_ extends or{constructor(e){super(e,f_)}}class g_ extends or{constructor(e){super(e,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.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 __{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 au=63710088e-1;class na{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new na(It(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const r=Math.PI/180,a=this.lat*r,o=e.lat*r,p=Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos((e.lng-this.lng)*r);return au*Math.acos(Math.min(p,1))}static convert(e){if(e instanceof na)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new na(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new na(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 Ap=2*Math.PI*au;function Cp(i){return Ap*Math.cos(i*Math.PI/180)}function kp(i){return(180+i)/360}function Mp(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function Ep(i,e){return i/Cp(e)}function Pp(i){return 360*i-180}function su(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class ql{constructor(e,r,a=0){this.x=+e,this.y=+r,this.z=+a}static fromLngLat(e,r=0){const a=na.convert(e);return new ql(kp(a.lng),Mp(a.lat),Ep(r,a.lat))}toLngLat(){return new na(Pp(this.x),su(this.y))}toAltitude(){return this.z*Cp(su(this.y))}meterInMercatorCoordinateUnits(){return 1/Ap*(e=su(this.y),1/Math.cos(e*Math.PI/180));var e}}function zp(i,e,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,e*a-2*Math.PI*6378137/2]}class ou{constructor(e,r,a){if(e<0||e>25||a<0||a>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, 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=r,this.y=a,this.key=Do(0,e,e,r,a)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,a){const o=(f=this.y,m=this.z,y=zp(256*(p=this.x),256*(f=Math.pow(2,m)-f-1),m),v=zp(256*(p+1),256*(f+1),m),y[0]+","+y[1]+","+v[0]+","+v[1]);var p,f,m,y,v;const w=(function(A,k,z){let D,O="";for(let q=A;q>0;q--)D=1<1?"@2x":"").replace(/{quadkey}/g,w).replace(/{bbox-epsg-3857}/g,o)}isChildOf(e){const r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){const r=Math.pow(2,this.z);return new ye((e.x*r-this.x)*Yt,(e.y*r-this.y)*Yt)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Dp{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Do(e,r.z,r.z,r.x,r.y)}}class dr{constructor(e,r,a,o,p){if(e= z; overscaledZ = ${e}; z = ${a}`);this.overscaledZ=e,this.wrap=r,this.canonical=new ou(a,+o,+p),this.key=Do(r,e,a,o,p)}clone(){return new dr(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 r=this.canonical.z-e;return e>this.canonical.z?new dr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new dr(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){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?Do(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Do(this.wrap*+r,e,e,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new dr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,o=2*this.canonical.y;return[new dr(r,this.wrap,r,a,o),new dr(r,this.wrap,r,a+1,o),new dr(r,this.wrap,r,a,o+1),new dr(r,this.wrap,r,a+1,o+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=A),A=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,a){return e*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new pr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,a){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let o=r*this.dim,p=r*this.dim+this.dim,f=a*this.dim,m=a*this.dim+this.dim;switch(r){case-1:o=p-1;break;case 1:p=o+1}switch(a){case-1:f=m-1;break;case 1:m=f+1}const y=-r*this.dim,v=-a*this.dim;for(let w=f;w=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 Rp{constructor(e,r,a,o,p){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=a,e._y=o,this.properties=e.properties,this.id=p}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 r in this)r!=="_geometry"&&r!=="_vectorTileFeature"&&(e[r]=this[r]);return e}}class Bp{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Kn(Yt,16,0),this.grid3D=new Kn(Yt,16,0),this.featureIndexArray=new _e,this.promoteId=r}insert(e,r,a,o,p,f){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,o,p);const y=f?this.grid3D:this.grid;for(let v=0;v=0&&A[3]>=0&&y.insert(m,A[0],A[1],A[2],A[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ta.VectorTile(new Xc(this.rawTileData)).layers,this.sourceLayerCoder=new Fp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,a,o){this.loadVTLayers();const p=e.params||{},f=Yt/e.tileSize/e.scale,m=Ys(p.filter),y=e.queryGeometry,v=e.queryPadding*f,w=Np(y),A=this.grid.query(w.minX-v,w.minY-v,w.maxX+v,w.maxY+v),k=Np(e.cameraQueryGeometry),z=this.grid3D.query(k.minX-v,k.minY-v,k.maxX+v,k.maxY+v,((q,H,re,Y)=>(function(ae,oe,me,ze,Ne){for(const Me of ae)if(oe<=Me.x&&me<=Me.y&&ze>=Me.x&&Ne>=Me.y)return!0;const Ee=[new ye(oe,me),new ye(oe,Ne),new ye(ze,Ne),new ye(ze,me)];if(ae.length>2){for(const Me of Ee)if(ms(ae,Me))return!0}for(let Me=0;Me(Y||(Y=ka(ae)),oe.queryIntersectsFeature(y,ae,me,Y,this.z,e.transform,f,e.pixelPosMatrix))))}return D}loadMatchingFeature(e,r,a,o,p,f,m,y,v,w,A){const k=this.bucketLayerIDs[r];if(f&&!(function(q,H){for(let re=0;re=0)return!0;return!1})(f,k))return;const z=this.sourceLayerCoder.decode(a),D=this.vtLayers[z].feature(o);if(p.needGeometry){const q=Ma(D,!0);if(!p.filter(new Et(this.tileID.overscaledZ),q,this.tileID.canonical))return}else if(!p.filter(new Et(this.tileID.overscaledZ),D))return;const O=this.getId(D,z);for(let q=0;q{const m=e instanceof ds?e.get(f):null;return m&&m.evaluate?m.evaluate(r,a,o):m}))}function Np(i){let e=1/0,r=1/0,a=-1/0,o=-1/0;for(const p of i)e=Math.min(e,p.x),r=Math.min(r,p.y),a=Math.max(a,p.x),o=Math.max(o,p.y);return{minX:e,minY:r,maxX:a,maxY:o}}function y_(i,e){return e-i}function Vp(i,e,r,a,o){const p=[];for(let f=0;f=a&&A.x>=a||(w.x>=a?w=new ye(a,w.y+(a-w.x)/(A.x-w.x)*(A.y-w.y))._round():A.x>=a&&(A=new ye(a,w.y+(a-w.x)/(A.x-w.x)*(A.y-w.y))._round()),w.y>=o&&A.y>=o||(w.y>=o?w=new ye(w.x+(o-w.y)/(A.y-w.y)*(A.x-w.x),o)._round():A.y>=o&&(A=new ye(w.x+(o-w.y)/(A.y-w.y)*(A.x-w.x),o)._round()),y&&w.equals(y[y.length-1])||(y=[w],p.push(y)),y.push(A)))))}}return p}De("FeatureIndex",Bp,{omit:["rawTileData","sourceLayerCoder"]});class aa extends ye{constructor(e,r,a,o){super(e,r),this.angle=a,o!==void 0&&(this.segment=o)}clone(){return new aa(this.x,this.y,this.angle,this.segment)}}function Up(i,e,r,a,o){if(e.segment===void 0||r===0)return!0;let p=e,f=e.segment+1,m=0;for(;m>-r/2;){if(f--,f<0)return!1;m-=i[f].dist(p),p=i[f]}m+=i[f].dist(i[f+1]),f++;const y=[];let v=0;for(;ma;)v-=y.shift().angleDelta;if(v>o)return!1;f++,m+=w.dist(A)}return!0}function $p(i){let e=0;for(let r=0;rv){const D=(v-y)/z,O=ji.number(A.x,k.x,D),q=ji.number(A.y,k.y,D),H=new aa(O,q,k.angleTo(A),w);return H._round(),!f||Up(i,H,m,f,e)?H:void 0}y+=z}}function v_(i,e,r,a,o,p,f,m,y){const v=jp(a,p,f),w=qp(a,o),A=w*f,k=i[0].x===0||i[0].x===y||i[0].y===0||i[0].y===y;return e-A=0&&ae=0&&oe=0&&k+v<=w){const me=new aa(ae,oe,re,D);me._round(),a&&!Up(i,me,p,a,o)||z.push(me)}}A+=H}return m||z.length||f||(z=Zp(i,A/2,r,a,o,p,f,!0,y)),z}De("Anchor",aa);const Ss=Wi;function Gp(i,e,r,a){const o=[],p=i.image,f=p.pixelRatio,m=p.paddedRect.w-2*Ss,y=p.paddedRect.h-2*Ss,v=i.right-i.left,w=i.bottom-i.top,A=p.stretchX||[[0,m]],k=p.stretchY||[[0,y]],z=(Te,Le)=>Te+Le[1]-Le[0],D=A.reduce(z,0),O=k.reduce(z,0),q=m-D,H=y-O;let re=0,Y=D,ae=0,oe=O,me=0,ze=q,Ne=0,Ee=H;if(p.content&&a){const Te=p.content;re=Zl(A,0,Te[0]),ae=Zl(k,0,Te[1]),Y=Zl(A,Te[0],Te[2]),oe=Zl(k,Te[1],Te[3]),me=Te[0]-re,Ne=Te[1]-ae,ze=Te[2]-Te[0]-Y,Ee=Te[3]-Te[1]-oe}const Me=(Te,Le,Ae,ve)=>{const qe=Gl(Te.stretch-re,Y,v,i.left),Ue=Hl(Te.fixed-me,ze,Te.stretch,D),at=Gl(Le.stretch-ae,oe,w,i.top),zt=Hl(Le.fixed-Ne,Ee,Le.stretch,O),Lt=Gl(Ae.stretch-re,Y,v,i.left),ii=Hl(Ae.fixed-me,ze,Ae.stretch,D),cr=Gl(ve.stretch-ae,oe,w,i.top),Ri=Hl(ve.fixed-Ne,Ee,ve.stretch,O),Jt=new ye(qe,at),di=new ye(Lt,at),yi=new ye(Lt,cr),Bi=new ye(qe,cr),Oi=new ye(Ue/f,zt/f),ri=new ye(ii/f,Ri/f),ni=e*Math.PI/180;if(ni){const Ai=Math.sin(ni),Xi=Math.cos(ni),Ki=[Xi,-Ai,Ai,Xi];Jt._matMult(Ki),di._matMult(Ki),Bi._matMult(Ki),yi._matMult(Ki)}const Ii=Te.stretch+Te.fixed,Ni=Le.stretch+Le.fixed;return{tl:Jt,tr:di,bl:Bi,br:yi,tex:{x:p.paddedRect.x+Ss+Ii,y:p.paddedRect.y+Ss+Ni,w:Ae.stretch+Ae.fixed-Ii,h:ve.stretch+ve.fixed-Ni},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Oi,pixelOffsetBR:ri,minFontScaleX:ze/f/v,minFontScaleY:Ee/f/w,isSDF:r}};if(a&&(p.stretchX||p.stretchY)){const Te=Hp(A,q,D),Le=Hp(k,H,O);for(let Ae=0;Ae0&&(D=Math.max(10,D),this.circleDiameter=D)}else{let A=f.top*m-y[0],k=f.bottom*m+y[2],z=f.left*m-y[3],D=f.right*m+y[1];const O=f.collisionPadding;if(O&&(z-=O[0]*m,A-=O[1]*m,D+=O[2]*m,k+=O[3]*m),w){const q=new ye(z,A),H=new ye(D,A),re=new ye(z,k),Y=new ye(D,k),ae=w*Math.PI/180;q._rotate(ae),H._rotate(ae),re._rotate(ae),Y._rotate(ae),z=Math.min(q.x,H.x,re.x,Y.x),D=Math.max(q.x,H.x,re.x,Y.x),A=Math.min(q.y,H.y,re.y,Y.y),k=Math.max(q.y,H.y,re.y,Y.y)}e.emplaceBack(r.x,r.y,z,A,D,k,a,o,p)}this.boxEndIndex=e.length}}class b_{constructor(e=[],r=w_){if(this.data=e,this.length=this.data.length,this.compare=r,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],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:r,compare:a}=this,o=r[e];for(;e>0;){const p=e-1>>1,f=r[p];if(a(o,f)>=0)break;r[e]=f,e=p}r[e]=o}_down(e){const{data:r,compare:a}=this,o=this.length>>1,p=r[e];for(;e=0)break;r[e]=m,e=f}r[e]=p}}function w_(i,e){return ie?1:0}function S_(i,e=1,r=!1){let a=1/0,o=1/0,p=-1/0,f=-1/0;const m=i[0];for(let z=0;zp)&&(p=D.x),(!z||D.y>f)&&(f=D.y)}const y=Math.min(p-a,f-o);let v=y/2;const w=new b_([],T_);if(y===0)return new ye(a,o);for(let z=a;zA.d||!A.d)&&(A=z,r&&console.log("found best %d after %d probes",Math.round(1e4*z.d)/1e4,k)),z.max-A.d<=e||(v=z.h/2,w.push(new Ts(z.p.x-v,z.p.y-v,v,i)),w.push(new Ts(z.p.x+v,z.p.y-v,v,i)),w.push(new Ts(z.p.x-v,z.p.y+v,v,i)),w.push(new Ts(z.p.x+v,z.p.y+v,v,i)),k+=4)}return r&&(console.log(`num probes: ${k}`),console.log(`best distance: ${A.d}`)),A.p}function T_(i,e){return e.max-i.max}function Ts(i,e,r,a){this.p=new ye(i,e),this.h=r,this.d=(function(o,p){let f=!1,m=1/0;for(let y=0;yo.y!=D.y>o.y&&o.x<(D.x-z.x)*(o.y-z.y)/(D.y-z.y)+z.x&&(f=!f),m=Math.min(m,Mh(o,z,D))}}return(f?1:-1)*Math.sqrt(m)})(this.p,a),this.max=this.d+this.h*Math.SQRT2}var _i;l.aq=void 0,(_i=l.aq||(l.aq={}))[_i.center=1]="center",_i[_i.left=2]="left",_i[_i.right=3]="right",_i[_i.top=4]="top",_i[_i.bottom=5]="bottom",_i[_i["top-left"]=6]="top-left",_i[_i["top-right"]=7]="top-right",_i[_i["bottom-left"]=8]="bottom-left",_i[_i["bottom-right"]=9]="bottom-right";const sa=7,lu=Number.POSITIVE_INFINITY;function Wp(i,e){return e[1]!==lu?(function(r,a,o){let p=0,f=0;switch(a=Math.abs(a),o=Math.abs(o),r){case"top-right":case"top-left":case"top":f=o-sa;break;case"bottom-right":case"bottom-left":case"bottom":f=-o+sa}switch(r){case"top-right":case"bottom-right":case"right":p=-a;break;case"top-left":case"bottom-left":case"left":p=a}return[p,f]})(i,e[0],e[1]):(function(r,a){let o=0,p=0;a<0&&(a=0);const f=a/Math.SQRT2;switch(r){case"top-right":case"top-left":p=f-sa;break;case"bottom-right":case"bottom-left":p=-f+sa;break;case"bottom":p=-a+sa;break;case"top":p=a-sa}switch(r){case"top-right":case"bottom-right":o=-f;break;case"top-left":case"bottom-left":o=f;break;case"left":o=a;break;case"right":o=-a}return[o,p]})(i,e[0])}function Xp(i,e,r){var a;const o=i.layout,p=(a=o.get("text-variable-anchor-offset"))===null||a===void 0?void 0:a.evaluate(e,{},r);if(p){const m=p.values,y=[];for(let v=0;vk*ti));w.startsWith("top")?A[1]-=sa:w.startsWith("bottom")&&(A[1]+=sa),y[v+1]=A}return new rr(y)}const f=o.get("text-variable-anchor");if(f){let m;m=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[o.get("text-radial-offset").evaluate(e,{},r)*ti,lu]:o.get("text-offset").evaluate(e,{},r).map((v=>v*ti));const y=[];for(const v of f)y.push(v,Wp(v,m));return new rr(y)}return null}function cu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function I_(i,e,r,a,o,p,f,m,y,v,w){let A=p.textMaxSize.evaluate(e,{});A===void 0&&(A=f);const k=i.layers[0].layout,z=k.get("icon-offset").evaluate(e,{},w),D=Yp(r.horizontal),O=f/24,q=i.tilePixelRatio*O,H=i.tilePixelRatio*A/24,re=i.tilePixelRatio*m,Y=i.tilePixelRatio*k.get("symbol-spacing"),ae=k.get("text-padding")*i.tilePixelRatio,oe=(function(ve,qe,Ue,at=1){const zt=ve.get("icon-padding").evaluate(qe,{},Ue),Lt=zt&&zt.values;return[Lt[0]*at,Lt[1]*at,Lt[2]*at,Lt[3]*at]})(k,e,w,i.tilePixelRatio),me=k.get("text-max-angle")/180*Math.PI,ze=k.get("text-rotation-alignment")!=="viewport"&&k.get("symbol-placement")!=="point",Ne=k.get("icon-rotation-alignment")==="map"&&k.get("symbol-placement")!=="point",Ee=k.get("symbol-placement"),Me=Y/2,Te=k.get("icon-text-fit");let Le;a&&Te!=="none"&&(i.allowVerticalPlacement&&r.vertical&&(Le=xp(a,r.vertical,Te,k.get("icon-text-fit-padding"),z,O)),D&&(a=xp(a,D,Te,k.get("icon-text-fit-padding"),z,O)));const Ae=(ve,qe)=>{qe.x<0||qe.x>=Yt||qe.y<0||qe.y>=Yt||(function(Ue,at,zt,Lt,ii,cr,Ri,Jt,di,yi,Bi,Oi,ri,ni,Ii,Ni,Ai,Xi,Ki,ai,ut,Ci,xi,si,kr){const Vr=Ue.addToLineVertexArray(at,zt);let Ur,En,Mr,fr,Yi=0,Pn=0,Ro=0,td=0,_u=-1,yu=-1;const zn={};let id=An("");if(Ue.allowVerticalPlacement&&Lt.vertical){const ki=Jt.layout.get("text-rotate").evaluate(ut,{},si)+90;Mr=new Wl(di,at,yi,Bi,Oi,Lt.vertical,ri,ni,Ii,ki),Ri&&(fr=new Wl(di,at,yi,Bi,Oi,Ri,Ai,Xi,Ii,ki))}if(ii){const ki=Jt.layout.get("icon-rotate").evaluate(ut,{}),mr=Jt.layout.get("icon-text-fit")!=="none",Pa=Gp(ii,ki,xi,mr),jr=Ri?Gp(Ri,ki,xi,mr):void 0;En=new Wl(di,at,yi,Bi,Oi,ii,Ai,Xi,!1,ki),Yi=4*Pa.length;const za=Ue.iconSizeData;let ln=null;za.kind==="source"?(ln=[on*Jt.layout.get("icon-size").evaluate(ut,{})],ln[0]>ra&&bi(`${Ue.layerIds[0]}: Value for "icon-size" is >= ${zo}. Reduce your "icon-size".`)):za.kind==="composite"&&(ln=[on*Ci.compositeIconSizes[0].evaluate(ut,{},si),on*Ci.compositeIconSizes[1].evaluate(ut,{},si)],(ln[0]>ra||ln[1]>ra)&&bi(`${Ue.layerIds[0]}: Value for "icon-size" is >= ${zo}. Reduce your "icon-size".`)),Ue.addSymbols(Ue.icon,Pa,ln,ai,Ki,ut,l.ai.none,at,Vr.lineStartIndex,Vr.lineLength,-1,si),_u=Ue.icon.placedSymbolArray.length-1,jr&&(Pn=4*jr.length,Ue.addSymbols(Ue.icon,jr,ln,ai,Ki,ut,l.ai.vertical,at,Vr.lineStartIndex,Vr.lineLength,-1,si),yu=Ue.icon.placedSymbolArray.length-1)}const rd=Object.keys(Lt.horizontal);for(const ki of rd){const mr=Lt.horizontal[ki];if(!Ur){id=An(mr.text);const jr=Jt.layout.get("text-rotate").evaluate(ut,{},si);Ur=new Wl(di,at,yi,Bi,Oi,mr,ri,ni,Ii,jr)}const Pa=mr.positionedLines.length===1;if(Ro+=Kp(Ue,at,mr,cr,Jt,Ii,ut,Ni,Vr,Lt.vertical?l.ai.horizontal:l.ai.horizontalOnly,Pa?rd:[ki],zn,_u,Ci,si),Pa)break}Lt.vertical&&(td+=Kp(Ue,at,Lt.vertical,cr,Jt,Ii,ut,Ni,Vr,l.ai.vertical,["vertical"],zn,yu,Ci,si));const k_=Ur?Ur.boxStartIndex:Ue.collisionBoxArray.length,M_=Ur?Ur.boxEndIndex:Ue.collisionBoxArray.length,E_=Mr?Mr.boxStartIndex:Ue.collisionBoxArray.length,P_=Mr?Mr.boxEndIndex:Ue.collisionBoxArray.length,z_=En?En.boxStartIndex:Ue.collisionBoxArray.length,D_=En?En.boxEndIndex:Ue.collisionBoxArray.length,L_=fr?fr.boxStartIndex:Ue.collisionBoxArray.length,F_=fr?fr.boxEndIndex:Ue.collisionBoxArray.length;let $r=-1;const Kl=(ki,mr)=>ki&&ki.circleDiameter?Math.max(ki.circleDiameter,mr):mr;$r=Kl(Ur,$r),$r=Kl(Mr,$r),$r=Kl(En,$r),$r=Kl(fr,$r);const nd=$r>-1?1:0;nd&&($r*=kr/ti),Ue.glyphOffsetArray.length>=ws.MAX_GLYPHS&&bi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ut.sortKey!==void 0&&Ue.addToSortKeyRanges(Ue.symbolInstances.length,ut.sortKey);const R_=Xp(Jt,ut,si),[B_,O_]=(function(ki,mr){const Pa=ki.length,jr=mr==null?void 0:mr.values;if((jr==null?void 0:jr.length)>0)for(let za=0;za=0?zn.right:-1,zn.center>=0?zn.center:-1,zn.left>=0?zn.left:-1,zn.vertical||-1,_u,yu,id,k_,M_,E_,P_,z_,D_,L_,F_,yi,Ro,td,Yi,Pn,nd,0,ri,$r,B_,O_)})(i,qe,ve,r,a,o,Le,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,q,[ae,ae,ae,ae],ze,y,re,oe,Ne,z,e,p,v,w,f)};if(Ee==="line")for(const ve of Vp(e.geometry,0,0,Yt,Yt)){const qe=v_(ve,Y,me,r.vertical||D,a,24,H,i.overscaling,Yt);for(const Ue of qe)D&&A_(i,D.text,Me,Ue)||Ae(ve,Ue)}else if(Ee==="line-center"){for(const ve of e.geometry)if(ve.length>1){const qe=x_(ve,me,r.vertical||D,a,24,H);qe&&Ae(ve,qe)}}else if(e.type==="Polygon")for(const ve of Uc(e.geometry,0)){const qe=S_(ve,16);Ae(ve[0],new aa(qe.x,qe.y,0))}else if(e.type==="LineString")for(const ve of e.geometry)Ae(ve,new aa(ve[0].x,ve[0].y,0));else if(e.type==="Point")for(const ve of e.geometry)for(const qe of ve)Ae([qe],new aa(qe.x,qe.y,0))}function Kp(i,e,r,a,o,p,f,m,y,v,w,A,k,z,D){const O=(function(re,Y,ae,oe,me,ze,Ne,Ee){const Me=oe.layout.get("text-rotate").evaluate(ze,{})*Math.PI/180,Te=[];for(const Le of Y.positionedLines)for(const Ae of Le.positionedGlyphs){if(!Ae.rect)continue;const ve=Ae.rect||{};let qe=pp+1,Ue=!0,at=1,zt=0;const Lt=(me||Ee)&&Ae.vertical,ii=Ae.metrics.advance*Ae.scale/2;if(Ee&&Y.verticalizable&&(zt=Le.lineOffset/2-(Ae.imageName?-(ti-Ae.metrics.width*Ae.scale)/2:(Ae.scale-1)*ti)),Ae.imageName){const ai=Ne[Ae.imageName];Ue=ai.sdf,at=ai.pixelRatio,qe=Wi/at}const cr=me?[Ae.x+ii,Ae.y]:[0,0];let Ri=me?[0,0]:[Ae.x+ii+ae[0],Ae.y+ae[1]-zt],Jt=[0,0];Lt&&(Jt=Ri,Ri=[0,0]);const di=Ae.metrics.isDoubleResolution?2:1,yi=(Ae.metrics.left-qe)*Ae.scale-ii+Ri[0],Bi=(-Ae.metrics.top-qe)*Ae.scale+Ri[1],Oi=yi+ve.w/di*Ae.scale/at,ri=Bi+ve.h/di*Ae.scale/at,ni=new ye(yi,Bi),Ii=new ye(Oi,Bi),Ni=new ye(yi,ri),Ai=new ye(Oi,ri);if(Lt){const ai=new ye(-ii,ii-Eo),ut=-Math.PI/2,Ci=ti/2-ii,xi=new ye(5-Eo-Ci,-(Ae.imageName?Ci:0)),si=new ye(...Jt);ni._rotateAround(ut,ai)._add(xi)._add(si),Ii._rotateAround(ut,ai)._add(xi)._add(si),Ni._rotateAround(ut,ai)._add(xi)._add(si),Ai._rotateAround(ut,ai)._add(xi)._add(si)}if(Me){const ai=Math.sin(Me),ut=Math.cos(Me),Ci=[ut,-ai,ai,ut];ni._matMult(Ci),Ii._matMult(Ci),Ni._matMult(Ci),Ai._matMult(Ci)}const Xi=new ye(0,0),Ki=new ye(0,0);Te.push({tl:ni,tr:Ii,bl:Ni,br:Ai,tex:ve,writingMode:Y.writingMode,glyphOffset:cr,sectionIndex:Ae.sectionIndex,isSDF:Ue,pixelOffsetTL:Xi,pixelOffsetBR:Ki,minFontScaleX:0,minFontScaleY:0})}return Te})(0,r,m,o,p,f,a,i.allowVerticalPlacement),q=i.textSizeData;let H=null;q.kind==="source"?(H=[on*o.layout.get("text-size").evaluate(f,{})],H[0]>ra&&bi(`${i.layerIds[0]}: Value for "text-size" is >= ${zo}. Reduce your "text-size".`)):q.kind==="composite"&&(H=[on*z.compositeTextSizes[0].evaluate(f,{},D),on*z.compositeTextSizes[1].evaluate(f,{},D)],(H[0]>ra||H[1]>ra)&&bi(`${i.layerIds[0]}: Value for "text-size" is >= ${zo}. Reduce your "text-size".`)),i.addSymbols(i.text,O,H,m,p,f,v,e,y.lineStartIndex,y.lineLength,k,D);for(const re of w)A[re]=i.text.placedSymbolArray.length-1;return 4*O.length}function Yp(i){for(const e in i)return i[e];return null}function A_(i,e,r,a){const o=i.compareText;if(e in o){const p=o[e];for(let f=p.length-1;f>=0;f--)if(a.dist(p[f])>4;if(o!==1)throw new Error(`Got v${o} data when expected v1.`);const p=Jp[15&a];if(!p)throw new Error("Unrecognized array type.");const[f]=new Uint16Array(e,2,1),[m]=new Uint32Array(e,4,1);return new uu(m,f,p,e)}constructor(e,r=64,a=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const p=Jp.indexOf(this.ArrayType),f=2*e*this.ArrayType.BYTES_PER_ELEMENT,m=e*this.IndexArrayType.BYTES_PER_ELEMENT,y=(8-m%8)%8;if(p<0)throw new Error(`Unexpected typed array class: ${a}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+y,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+f+m+y),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+m+y,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+p]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=e,this.coords[this._pos++]=r,a}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return hu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,a,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:p,coords:f,nodeSize:m}=this,y=[0,p.length-1,0],v=[];for(;y.length;){const w=y.pop()||0,A=y.pop()||0,k=y.pop()||0;if(A-k<=m){for(let q=k;q<=A;q++){const H=f[2*q],re=f[2*q+1];H>=e&&H<=a&&re>=r&&re<=o&&v.push(p[q])}continue}const z=k+A>>1,D=f[2*z],O=f[2*z+1];D>=e&&D<=a&&O>=r&&O<=o&&v.push(p[z]),(w===0?e<=D:r<=O)&&(y.push(k),y.push(z-1),y.push(1-w)),(w===0?a>=D:o>=O)&&(y.push(z+1),y.push(A),y.push(1-w))}return v}within(e,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:p,nodeSize:f}=this,m=[0,o.length-1,0],y=[],v=a*a;for(;m.length;){const w=m.pop()||0,A=m.pop()||0,k=m.pop()||0;if(A-k<=f){for(let q=k;q<=A;q++)ed(p[2*q],p[2*q+1],e,r)<=v&&y.push(o[q]);continue}const z=k+A>>1,D=p[2*z],O=p[2*z+1];ed(D,O,e,r)<=v&&y.push(o[z]),(w===0?e-a<=D:r-a<=O)&&(m.push(k),m.push(z-1),m.push(1-w)),(w===0?e+a>=D:r+a>=O)&&(m.push(z+1),m.push(A),m.push(1-w))}return y}}function hu(i,e,r,a,o,p){if(o-a<=r)return;const f=a+o>>1;Qp(i,e,f,a,o,p),hu(i,e,r,a,f-1,1-p),hu(i,e,r,f+1,o,1-p)}function Qp(i,e,r,a,o,p){for(;o>a;){if(o-a>600){const v=o-a+1,w=r-a+1,A=Math.log(v),k=.5*Math.exp(2*A/3),z=.5*Math.sqrt(A*k*(v-k)/v)*(w-v/2<0?-1:1);Qp(i,e,r,Math.max(a,Math.floor(r-w*k/v+z)),Math.min(o,Math.floor(r+(v-w)*k/v+z)),p)}const f=e[2*r+p];let m=a,y=o;for(Lo(i,e,a,r),e[2*o+p]>f&&Lo(i,e,a,o);mf;)y--}e[2*a+p]===f?Lo(i,e,a,y):(y++,Lo(i,e,y,o)),y<=r&&(a=y+1),r<=y&&(o=y-1)}}function Lo(i,e,r,a){pu(i,r,a),pu(e,2*r,2*a),pu(e,2*r+1,2*a+1)}function pu(i,e,r){const a=i[e];i[e]=i[r],i[r]=a}function ed(i,e,r,a){const o=i-r,p=e-a;return o*o+p*p}var du;l.bh=void 0,(du=l.bh||(l.bh={})).create="create",du.load="load",du.fullLoad="fullLoad";let Xl=null,Fo=[];const fu=1e3/60,mu="loadTime",gu="fullLoadTime",C_={mark(i){performance.mark(i)},frame(i){const e=i;Xl!=null&&Fo.push(e-Xl),Xl=e},clearMetrics(){Xl=null,Fo=[],performance.clearMeasures(mu),performance.clearMeasures(gu);for(const i in l.bh)performance.clearMarks(l.bh[i])},getPerformanceMetrics(){performance.measure(mu,l.bh.create,l.bh.load),performance.measure(gu,l.bh.create,l.bh.fullLoad);const i=performance.getEntriesByName(mu)[0].duration,e=performance.getEntriesByName(gu)[0].duration,r=Fo.length,a=1/(Fo.reduce(((p,f)=>p+f),0)/r/1e3),o=Fo.filter((p=>p>fu)).reduce(((p,f)=>p+(f-fu)/fu),0);return{loadTime:i,fullLoadTime:e,fps:a,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};l.$=function(i,e,r){var a,o,p,f,m,y,v,w,A,k,z,D,O=r[0],q=r[1],H=r[2];return e===i?(i[12]=e[0]*O+e[4]*q+e[8]*H+e[12],i[13]=e[1]*O+e[5]*q+e[9]*H+e[13],i[14]=e[2]*O+e[6]*q+e[10]*H+e[14],i[15]=e[3]*O+e[7]*q+e[11]*H+e[15]):(o=e[1],p=e[2],f=e[3],m=e[4],y=e[5],v=e[6],w=e[7],A=e[8],k=e[9],z=e[10],D=e[11],i[0]=a=e[0],i[1]=o,i[2]=p,i[3]=f,i[4]=m,i[5]=y,i[6]=v,i[7]=w,i[8]=A,i[9]=k,i[10]=z,i[11]=D,i[12]=a*O+m*q+A*H+e[12],i[13]=o*O+y*q+k*H+e[13],i[14]=p*O+v*q+z*H+e[14],i[15]=f*O+w*q+D*H+e[15]),i},l.A=gs,l.B=ji,l.C=class{constructor(i,e,r){this.receive=a=>{const o=a.data,p=o.id;if(p&&(!o.targetMapId||this.mapId===o.targetMapId))if(o.type===""){delete this.tasks[p];const f=this.cancelCallbacks[p];delete this.cancelCallbacks[p],f&&f()}else Qi()||o.mustQueue?(this.tasks[p]=o,this.taskQueue.push(p),this.invoker.trigger()):this.processTask(p,o)},this.process=()=>{if(!this.taskQueue.length)return;const a=this.taskQueue.shift(),o=this.tasks[a];delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),o&&this.processTask(a,o)},this.target=i,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new __(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Qi()?i:window}send(i,e,r,a,o=!1){const p=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[p]=r);const f=[],m={id:p,type:i,hasCallback:!!r,targetMapId:a,mustQueue:o,sourceMapId:this.mapId,data:nn(e,f)};return this.target.postMessage(m,{transfer:f}),{cancel:()=>{r&&delete this.callbacks[p],this.target.postMessage({id:p,type:"",targetMapId:a,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type===""){const r=this.callbacks[i];delete this.callbacks[i],r&&(e.error?r(Yn(e.error)):r(null,Yn(e.data)))}else{let r=!1;const a=[],o=e.hasCallback?(m,y)=>{r=!0,delete this.cancelCallbacks[i];const v={id:i,type:"",sourceMapId:this.mapId,error:m?nn(m):null,data:nn(y,a)};this.target.postMessage(v,{transfer:a})}:m=>{r=!0};let p=null;const f=Yn(e.data);if(this.parent[e.type])p=this.parent[e.type](e.sourceMapId,f,o);else if("getWorkerSource"in this.parent){const m=e.type.split(".");p=this.parent.getWorkerSource(e.sourceMapId,m[0],f.source)[m[1]](f,o)}else o(new Error(`Could not find function ${e.type}`));!r&&p&&p.cancel&&(this.cancelCallbacks[i]=p.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},l.D=$e,l.E=fn,l.F=function(i,e){const r={};for(let a=0;a{}}},l.Y=Ie,l.Z=function(){var i=new gs(16);return gs!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},l._=ue,l.a=la,l.a$=class extends P{},l.a0=function(i,e,r){var a=r[0],o=r[1],p=r[2];return i[0]=e[0]*a,i[1]=e[1]*a,i[2]=e[2]*a,i[3]=e[3]*a,i[4]=e[4]*o,i[5]=e[5]*o,i[6]=e[6]*o,i[7]=e[7]*o,i[8]=e[8]*p,i[9]=e[9]*p,i[10]=e[10]*p,i[11]=e[11]*p,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},l.a1=Dh,l.a2=function(){return _r++},l.a3=$,l.a4=ws,l.a5=function(){Gi.isLoading()||Gi.isLoaded()||lo()!=="deferred"||Sl()},l.a6=Ys,l.a7=Ma,l.a8=Et,l.a9=Rp,l.aA=Sa,l.aB=function(i){i=i.slice();const e=Object.create(null);for(let r=0;r{a[f.source]?r.push({command:mt.removeLayer,args:[f.id]}):p.push(f)})),r=r.concat(o),(function(f,m,y){m=m||[];const v=(f=f||[]).map(Yr),w=m.map(Yr),A=f.reduce(mn,{}),k=m.reduce(mn,{}),z=v.slice(),D=Object.create(null);let O,q,H,re,Y,ae,oe;for(O=0,q=0;O@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((r,a,o,p)=>{const f=o||p;return e[a]=!f||f.toLowerCase(),""})),e["max-age"]){const r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e},l.ab=function(i,e){const r=[];for(const a in i)a in e||r.push(a);return r},l.ac=function(i){if(hn==null){const e=i.navigator?i.navigator.userAgent:null;hn=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return hn},l.ad=it,l.ae=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),p=e[0],f=e[1],m=e[2],y=e[3],v=e[4],w=e[5],A=e[6],k=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=p*o+v*a,i[1]=f*o+w*a,i[2]=m*o+A*a,i[3]=y*o+k*a,i[4]=v*o-p*a,i[5]=w*o-f*a,i[6]=A*o-m*a,i[7]=k*o-y*a,i},l.af=function(i){var e=new gs(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},l.ag=Dl,l.ah=function(i,e){let r=0,a=0;if(i.kind==="constant")a=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:o,minZoom:p,maxZoom:f}=i,m=o?it(qi.interpolationFactor(o,e,p,f),0,1):0;i.kind==="camera"?a=ji.number(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:a}},l.aj=function(i,{uSize:e,uSizeT:r},{lowerSize:a,upperSize:o}){return i.kind==="source"?a/on:i.kind==="composite"?ji.number(a/on,o/on,r):e},l.ak=tu,l.al=function(i,e,r,a){const o=e.y-i.y,p=e.x-i.x,f=a.y-r.y,m=a.x-r.x,y=f*p-m*o;if(y===0)return null;const v=(m*(i.y-r.y)-f*(i.x-r.x))/y;return new ye(i.x+v*p,i.y+v*o)},l.am=Vp,l.an=Ch,l.ao=Lc,l.ap=ti,l.ar=eu,l.as=function(i,e){var r=e[0],a=e[1],o=e[2],p=e[3],f=e[4],m=e[5],y=e[6],v=e[7],w=e[8],A=e[9],k=e[10],z=e[11],D=e[12],O=e[13],q=e[14],H=e[15],re=r*m-a*f,Y=r*y-o*f,ae=r*v-p*f,oe=a*y-o*m,me=a*v-p*m,ze=o*v-p*y,Ne=w*O-A*D,Ee=w*q-k*D,Me=w*H-z*D,Te=A*q-k*O,Le=A*H-z*O,Ae=k*H-z*q,ve=re*Ae-Y*Le+ae*Te+oe*Me-me*Ee+ze*Ne;return ve?(i[0]=(m*Ae-y*Le+v*Te)*(ve=1/ve),i[1]=(o*Le-a*Ae-p*Te)*ve,i[2]=(O*ze-q*me+H*oe)*ve,i[3]=(k*me-A*ze-z*oe)*ve,i[4]=(y*Me-f*Ae-v*Ee)*ve,i[5]=(r*Ae-o*Me+p*Ee)*ve,i[6]=(q*ae-D*ze-H*Y)*ve,i[7]=(w*ze-k*ae+z*Y)*ve,i[8]=(f*Le-m*Me+v*Ne)*ve,i[9]=(a*Me-r*Le-p*Ne)*ve,i[10]=(D*me-O*ae+H*re)*ve,i[11]=(A*ae-w*me-z*re)*ve,i[12]=(m*Ee-f*Te-y*Ne)*ve,i[13]=(r*Te-a*Ee+o*Ne)*ve,i[14]=(O*Y-D*oe-q*re)*ve,i[15]=(w*oe-A*Y+k*re)*ve,i):null},l.at=cu,l.au=Qc,l.av=uu,l.aw=function(){const i={},e=he.$version;for(const r in he.$root){const a=he.$root[r];if(a.required){let o=null;o=r==="version"?e:a.type==="array"?[]:{},o!=null&&(i[r]=o)}}return i},l.ax=mt,l.ay=xl,l.az=hr,l.b=function(i,e){const r=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(r).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.`))}))},l.b0=hi,l.b1=function(i,e){var r=i[0],a=i[1],o=i[2],p=i[3],f=i[4],m=i[5],y=i[6],v=i[7],w=i[8],A=i[9],k=i[10],z=i[11],D=i[12],O=i[13],q=i[14],H=i[15],re=e[0],Y=e[1],ae=e[2],oe=e[3],me=e[4],ze=e[5],Ne=e[6],Ee=e[7],Me=e[8],Te=e[9],Le=e[10],Ae=e[11],ve=e[12],qe=e[13],Ue=e[14],at=e[15];return Math.abs(r-re)<=Fi*Math.max(1,Math.abs(r),Math.abs(re))&&Math.abs(a-Y)<=Fi*Math.max(1,Math.abs(a),Math.abs(Y))&&Math.abs(o-ae)<=Fi*Math.max(1,Math.abs(o),Math.abs(ae))&&Math.abs(p-oe)<=Fi*Math.max(1,Math.abs(p),Math.abs(oe))&&Math.abs(f-me)<=Fi*Math.max(1,Math.abs(f),Math.abs(me))&&Math.abs(m-ze)<=Fi*Math.max(1,Math.abs(m),Math.abs(ze))&&Math.abs(y-Ne)<=Fi*Math.max(1,Math.abs(y),Math.abs(Ne))&&Math.abs(v-Ee)<=Fi*Math.max(1,Math.abs(v),Math.abs(Ee))&&Math.abs(w-Me)<=Fi*Math.max(1,Math.abs(w),Math.abs(Me))&&Math.abs(A-Te)<=Fi*Math.max(1,Math.abs(A),Math.abs(Te))&&Math.abs(k-Le)<=Fi*Math.max(1,Math.abs(k),Math.abs(Le))&&Math.abs(z-Ae)<=Fi*Math.max(1,Math.abs(z),Math.abs(Ae))&&Math.abs(D-ve)<=Fi*Math.max(1,Math.abs(D),Math.abs(ve))&&Math.abs(O-qe)<=Fi*Math.max(1,Math.abs(O),Math.abs(qe))&&Math.abs(q-Ue)<=Fi*Math.max(1,Math.abs(q),Math.abs(Ue))&&Math.abs(H-at)<=Fi*Math.max(1,Math.abs(H),Math.abs(at))},l.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},l.b3=function(i,e,r){return i[0]=e[0]*r[0],i[1]=e[1]*r[1],i[2]=e[2]*r[2],i[3]=e[3]*r[3],i},l.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},l.b5=It,l.b6=Dp,l.b7=Ep,l.b8=function(i,e,r,a,o){var p,f=1/Math.tan(e/2);return i[0]=f/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,o!=null&&o!==1/0?(i[10]=(o+a)*(p=1/(a-o)),i[14]=2*o*a*p):(i[10]=-1,i[14]=-2*a),i},l.b9=function(i,e,r){var a=Math.sin(r),o=Math.cos(r),p=e[4],f=e[5],m=e[6],y=e[7],v=e[8],w=e[9],A=e[10],k=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=p*o+v*a,i[5]=f*o+w*a,i[6]=m*o+A*a,i[7]=y*o+k*a,i[8]=v*o-p*a,i[9]=w*o-f*a,i[10]=A*o-m*a,i[11]=k*o-y*a,i},l.bA=Fe,l.bB=ap,l.bC=rs,l.bD=Gi,l.ba=un,l.bb=Zr,l.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},l.bd=class extends Ca{},l.be=au,l.bf=Pp,l.bg=C_,l.bi=Hr,l.bj=function(i,e,r=!1){if(Di===ro||Di===no||Di===ao)throw new Error("setRTLTextPlugin cannot be called multiple times.");an=Rn.resolveURL(i),Di=ro,so=e,oo(),r||Sl()},l.bk=lo,l.bl=function(i,e){const r={};for(let o=0;ove*ti))}let Ee=f?"center":r.get("text-justify").evaluate(v,{},i.canonical);const Me=r.get("symbol-placement"),Te=Me==="point"?r.get("text-max-width").evaluate(v,{},i.canonical)*ti:0,Le=()=>{i.bucket.allowVerticalPlacement&&eo(ae)&&(D.vertical=Vl(O,i.glyphMap,i.glyphPositions,i.imagePositions,w,Te,p,ze,"left",me,H,l.ai.vertical,!0,Me,k,A))};if(!f&&Ne){const Ae=new Set;if(Ee==="auto")for(let qe=0;qe{e(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>{r.src=Oa}))},r.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(i)],{type:"image/png"});r.src=i.byteLength?URL.createObjectURL(a):Oa},l.e=vt,l.f=function(i,e){return Wr(vt(i,{type:"json"}),e)},l.g=er,l.h=Rn,l.i=Qi,l.j=Kr,l.k=Xr,l.l=ha,l.m=Wr,l.n=function(i){return new Xc(i).readFields(i_,[])},l.o=function(i,e,r){if(!i.length)return r(null,[]);let a=i.length;const o=new Array(i.length);let p=null;i.forEach(((f,m)=>{e(f,((y,v)=>{y&&(p=y),o[m]=v,--a==0&&r(p,o)}))}))},l.p=dp,l.q=wo,l.r=Ht,l.s=Pr,l.t=Ic,l.u=Pe,l.v=he,l.w=bi,l.x=us,l.y=Br,l.z=function([i,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(r),y:i*Math.sin(e)*Math.sin(r),z:i*Math.cos(r)}}})),ee(["./shared"],(function(l){class ue{constructor(C){this.keyCache={},C&&this.replace(C)}replace(C){this._layerConfigs={},this._layers={},this.update(C,[])}update(C,E){for(const j of C){this._layerConfigs[j.id]=j;const Z=this._layers[j.id]=l.aC(j);Z._featureFilter=l.a6(Z.filter),this.keyCache[j.id]&&delete this.keyCache[j.id]}for(const j of E)delete this.keyCache[j],delete this._layerConfigs[j],delete this._layers[j];this.familiesBySource={};const F=l.bl(Object.values(this._layerConfigs),this.keyCache);for(const j of F){const Z=j.map((de=>this._layers[de.id])),ne=Z[0];if(ne.visibility==="none")continue;const J=ne.source||"";let W=this.familiesBySource[J];W||(W=this.familiesBySource[J]={});const ie=ne.sourceLayer||"_geojsonTileLayer";let pe=W[ie];pe||(pe=W[ie]=[]),pe.push(Z)}}}class X{constructor(C){const E={},F=[];for(const J in C){const W=C[J],ie=E[J]={};for(const pe in W){const de=W[+pe];if(!de||de.bitmap.width===0||de.bitmap.height===0)continue;const ge={x:0,y:0,w:de.bitmap.width+2,h:de.bitmap.height+2};F.push(ge),ie[pe]={rect:ge,metrics:de.metrics}}}const{w:j,h:Z}=l.p(F),ne=new l.q({width:j||1,height:Z||1});for(const J in C){const W=C[J];for(const ie in W){const pe=W[+ie];if(!pe||pe.bitmap.width===0||pe.bitmap.height===0)continue;const de=E[J][ie].rect;l.q.copy(pe.bitmap,ne,{x:0,y:0},{x:de.x+1,y:de.y+1},pe.bitmap)}}this.image=ne,this.positions=E}}l.bm("GlyphAtlas",X);class Fe{constructor(C){this.tileID=new l.O(C.tileID.overscaledZ,C.tileID.wrap,C.tileID.canonical.z,C.tileID.canonical.x,C.tileID.canonical.y),this.uid=C.uid,this.zoom=C.zoom,this.pixelRatio=C.pixelRatio,this.tileSize=C.tileSize,this.source=C.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=C.showCollisionBoxes,this.collectResourceTiming=!!C.collectResourceTiming,this.returnDependencies=!!C.returnDependencies,this.promoteId=C.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(C,E,F,j,Z){this.status="parsing",this.data=C,this.collisionBoxArray=new l.a3;const ne=new l.bn(Object.keys(C.layers).sort()),J=new l.bo(this.tileID,this.promoteId);J.bucketLayerIDs=[];const W={},ie={featureIndex:J,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:F},pe=E.familiesBySource[this.source];for(const ft in pe){const dt=C.layers[ft];if(!dt)continue;dt.version===1&&l.w(`Vector tile source "${this.source}" layer "${ft}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const fi=ne.encode(ft),Ct=[];for(let Kt=0;Kt=ci.maxzoom||ci.visibility!=="none"&&(be(Kt,this.zoom,F),(W[ci.id]=ci.createBucket({index:J.bucketLayerIDs.length,layers:Kt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:fi,sourceID:this.source})).populate(Ct,ie,this.tileID.canonical),J.bucketLayerIDs.push(Kt.map((ir=>ir.id))))}}let de,ge,je,Ke;const Be=l.aH(ie.glyphDependencies,(ft=>Object.keys(ft).map(Number)));this.inFlightDependencies.forEach((ft=>ft==null?void 0:ft.cancel())),this.inFlightDependencies=[];const Ze=++this.dependencySentinel;Object.keys(Be).length?this.inFlightDependencies.push(j.send("getGlyphs",{uid:this.uid,stacks:Be,source:this.source,tileID:this.tileID,type:"glyphs"},((ft,dt)=>{Ze===this.dependencySentinel&&(de||(de=ft,ge=dt,St.call(this)))}))):ge={};const Je=Object.keys(ie.iconDependencies);Je.length?this.inFlightDependencies.push(j.send("getImages",{icons:Je,source:this.source,tileID:this.tileID,type:"icons"},((ft,dt)=>{Ze===this.dependencySentinel&&(de||(de=ft,je=dt,St.call(this)))}))):je={};const xt=Object.keys(ie.patternDependencies);function St(){if(de)return Z(de);if(ge&&je&&Ke){const ft=new X(ge),dt=new l.bp(je,Ke);for(const fi in W){const Ct=W[fi];Ct instanceof l.a4?(be(Ct.layers,this.zoom,F),l.bq({bucket:Ct,glyphMap:ge,glyphPositions:ft.positions,imageMap:je,imagePositions:dt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Ct.hasPattern&&(Ct instanceof l.br||Ct instanceof l.bs||Ct instanceof l.bt)&&(be(Ct.layers,this.zoom,F),Ct.addFeatures(ie,this.tileID.canonical,dt.patternPositions))}this.status="done",Z(null,{buckets:Object.values(W).filter((fi=>!fi.isEmpty())),featureIndex:J,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ft.image,imageAtlas:dt,glyphMap:this.returnDependencies?ge:null,iconMap:this.returnDependencies?je:null,glyphPositions:this.returnDependencies?ft.positions:null})}}xt.length?this.inFlightDependencies.push(j.send("getImages",{icons:xt,source:this.source,tileID:this.tileID,type:"patterns"},((ft,dt)=>{Ze===this.dependencySentinel&&(de||(de=ft,Ke=dt,St.call(this)))}))):Ke={},St.call(this)}}function be(U,C,E){const F=new l.a8(C);for(const j of U)j.recalculate(F,E)}function ye(U,C){const E=l.l(U.request,((F,j,Z,ne)=>{if(F)C(F);else if(j)try{const J=new l.bw.VectorTile(new l.bv(j));C(null,{vectorTile:J,rawData:j,cacheControl:Z,expires:ne})}catch(J){const W=new Uint8Array(j);let ie=`Unable to parse the tile at ${U.request.url}, `;ie+=W[0]===31&&W[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${J.messge}`,C(new Error(ie))}}));return()=>{E.cancel(),C()}}class we{constructor(C,E,F,j){this.actor=C,this.layerIndex=E,this.availableImages=F,this.loadVectorData=j||ye,this.fetching={},this.loading={},this.loaded={}}loadTile(C,E){const F=C.uid;this.loading||(this.loading={});const j=!!(C&&C.request&&C.request.collectResourceTiming)&&new l.bu(C.request),Z=this.loading[F]=new Fe(C);Z.abort=this.loadVectorData(C,((ne,J)=>{if(delete this.loading[F],ne||!J)return Z.status="done",this.loaded[F]=Z,E(ne);const W=J.rawData,ie={};J.expires&&(ie.expires=J.expires),J.cacheControl&&(ie.cacheControl=J.cacheControl);const pe={};if(j){const de=j.finish();de&&(pe.resourceTiming=JSON.parse(JSON.stringify(de)))}Z.vectorTile=J.vectorTile,Z.parse(J.vectorTile,this.layerIndex,this.availableImages,this.actor,((de,ge)=>{if(delete this.fetching[F],de||!ge)return E(de);E(null,l.e({rawTileData:W.slice(0)},ge,ie,pe))})),this.loaded=this.loaded||{},this.loaded[F]=Z,this.fetching[F]={rawTileData:W,cacheControl:ie,resourceTiming:pe}}))}reloadTile(C,E){const F=this.loaded,j=C.uid;if(F&&F[j]){const Z=F[j];Z.showCollisionBoxes=C.showCollisionBoxes,Z.status==="parsing"?Z.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,((ne,J)=>{if(ne||!J)return E(ne,J);let W;if(this.fetching[j]){const{rawTileData:ie,cacheControl:pe,resourceTiming:de}=this.fetching[j];delete this.fetching[j],W=l.e({rawTileData:ie.slice(0)},J,pe,de)}else W=J;E(null,W)})):Z.status==="done"&&(Z.vectorTile?Z.parse(Z.vectorTile,this.layerIndex,this.availableImages,this.actor,E):E())}}abortTile(C,E){const F=this.loading,j=C.uid;F&&F[j]&&F[j].abort&&(F[j].abort(),delete F[j]),E()}removeTile(C,E){const F=this.loaded,j=C.uid;F&&F[j]&&delete F[j],E()}}class Re{constructor(){this.loaded={}}loadTile(C,E){return l._(this,void 0,void 0,(function*(){const{uid:F,encoding:j,rawImageData:Z,redFactor:ne,greenFactor:J,blueFactor:W,baseShift:ie}=C,pe=Z.width+2,de=Z.height+2,ge=l.a(Z)?new l.R({width:pe,height:de},yield l.bx(Z,-1,-1,pe,de)):Z,je=new l.by(F,ge,j,ne,J,W,ie);this.loaded=this.loaded||{},this.loaded[F]=je,E(null,je)}))}removeTile(C){const E=this.loaded,F=C.uid;E&&E[F]&&delete E[F]}}function We(U,C){if(U.length!==0){nt(U[0],C);for(var E=1;E=Math.abs(J)?E-W+J:J-W+E,E=W}E+F>=0!=!!C&&U.reverse()}var st=l.bz((function U(C,E){var F,j=C&&C.type;if(j==="FeatureCollection")for(F=0;F>31}function Qi(U,C){for(var E=U.loadGeometry(),F=U.type,j=0,Z=0,ne=E.length,J=0;JU},ca=Math.fround||(yr=new Float32Array(1),U=>(yr[0]=+U,yr[0]));var yr;const Mt=3,Ei=5,pn=6;class Rn{constructor(C){this.options=Object.assign(Object.create(Oa),C),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(C){const{log:E,minZoom:F,maxZoom:j}=this.options;E&&console.time("total time");const Z=`prepare ${C.length} points`;E&&console.time(Z),this.points=C;const ne=[];for(let W=0;W=F;W--){const ie=+Date.now();J=this.trees[W]=this._createTree(this._cluster(J,W)),E&&console.log("z%d: %d clusters in %dms",W,J.numItems,+Date.now()-ie)}return E&&console.timeEnd("total time"),this}getClusters(C,E){let F=((C[0]+180)%360+360)%360-180;const j=Math.max(-90,Math.min(90,C[1]));let Z=C[2]===180?180:((C[2]+180)%360+360)%360-180;const ne=Math.max(-90,Math.min(90,C[3]));if(C[2]-C[0]>=360)F=-180,Z=180;else if(F>Z){const de=this.getClusters([F,j,180,ne],E),ge=this.getClusters([-180,j,Z,ne],E);return de.concat(ge)}const J=this.trees[this._limitZoom(E)],W=J.range(hr(F),er(ne),hr(Z),er(j)),ie=J.data,pe=[];for(const de of W){const ge=this.stride*de;pe.push(ie[ge+Ei]>1?Bn(ie,ge,this.clusterProps):this.points[ie[ge+Mt]])}return pe}getChildren(C){const E=this._getOriginId(C),F=this._getOriginZoom(C),j="No cluster with the specified id.",Z=this.trees[F];if(!Z)throw new Error(j);const ne=Z.data;if(E*this.stride>=ne.length)throw new Error(j);const J=this.options.radius/(this.options.extent*Math.pow(2,F-1)),W=Z.within(ne[E*this.stride],ne[E*this.stride+1],J),ie=[];for(const pe of W){const de=pe*this.stride;ne[de+4]===C&&ie.push(ne[de+Ei]>1?Bn(ne,de,this.clusterProps):this.points[ne[de+Mt]])}if(ie.length===0)throw new Error(j);return ie}getLeaves(C,E,F){const j=[];return this._appendLeaves(j,C,E=E||10,F=F||0,0),j}getTile(C,E,F){const j=this.trees[this._limitZoom(C)],Z=Math.pow(2,C),{extent:ne,radius:J}=this.options,W=J/ne,ie=(F-W)/Z,pe=(F+1+W)/Z,de={features:[]};return this._addTileFeatures(j.range((E-W)/Z,ie,(E+1+W)/Z,pe),j.data,E,F,Z,de),E===0&&this._addTileFeatures(j.range(1-W/Z,ie,1,pe),j.data,Z,F,Z,de),E===Z-1&&this._addTileFeatures(j.range(0,ie,W/Z,pe),j.data,-1,F,Z,de),de.features.length?de:null}getClusterExpansionZoom(C){let E=this._getOriginZoom(C)-1;for(;E<=this.options.maxZoom;){const F=this.getChildren(C);if(E++,F.length!==1)break;C=F[0].properties.cluster_id}return E}_appendLeaves(C,E,F,j,Z){const ne=this.getChildren(E);for(const J of ne){const W=J.properties;if(W&&W.cluster?Z+W.point_count<=j?Z+=W.point_count:Z=this._appendLeaves(C,W.cluster_id,F,j,Z):Z1;let pe,de,ge;if(ie)pe=Hr(E,W,this.clusterProps),de=E[W],ge=E[W+1];else{const Be=this.points[E[W+Mt]];pe=Be.properties;const[Ze,Je]=Be.geometry.coordinates;de=hr(Ze),ge=er(Je)}const je={type:1,geometry:[[Math.round(this.options.extent*(de*Z-F)),Math.round(this.options.extent*(ge*Z-j))]],tags:pe};let Ke;Ke=ie||this.options.generateId?E[W+Mt]:this.points[E[W+Mt]].id,Ke!==void 0&&(je.id=Ke),ne.features.push(je)}}_limitZoom(C){return Math.max(this.options.minZoom,Math.min(Math.floor(+C),this.options.maxZoom+1))}_cluster(C,E){const{radius:F,extent:j,reduce:Z,minPoints:ne}=this.options,J=F/(j*Math.pow(2,E)),W=C.data,ie=[],pe=this.stride;for(let de=0;deE&&(Ze+=W[xt+Ei])}if(Ze>Be&&Ze>=ne){let Je,xt=ge*Be,St=je*Be,ft=-1;const dt=((de/pe|0)<<5)+(E+1)+this.points.length;for(const fi of Ke){const Ct=fi*pe;if(W[Ct+2]<=E)continue;W[Ct+2]=E;const Kt=W[Ct+Ei];xt+=W[Ct]*Kt,St+=W[Ct+1]*Kt,W[Ct+4]=dt,Z&&(Je||(Je=this._map(W,de,!0),ft=this.clusterProps.length,this.clusterProps.push(Je)),Z(Je,this._map(W,Ct)))}W[de+4]=dt,ie.push(xt/Ze,St/Ze,1/0,dt,-1,Ze),Z&&ie.push(ft)}else{for(let Je=0;Je1)for(const Je of Ke){const xt=Je*pe;if(!(W[xt+2]<=E)){W[xt+2]=E;for(let St=0;St>5}_getOriginZoom(C){return(C-this.points.length)%32}_map(C,E,F){if(C[E+Ei]>1){const ne=this.clusterProps[C[E+pn]];return F?Object.assign({},ne):ne}const j=this.points[C[E+Mt]].properties,Z=this.options.map(j);return F&&Z===j?Object.assign({},Z):Z}}function Bn(U,C,E){return{type:"Feature",id:U[C+Mt],properties:Hr(U,C,E),geometry:{type:"Point",coordinates:[(F=U[C],360*(F-.5)),ua(U[C+1])]}};var F}function Hr(U,C,E){const F=U[C+Ei],j=F>=1e4?`${Math.round(F/1e3)}k`:F>=1e3?Math.round(F/100)/10+"k":F,Z=U[C+pn],ne=Z===-1?{}:Object.assign({},E[Z]);return Object.assign(ne,{cluster:!0,cluster_id:U[C+Mt],point_count:F,point_count_abbreviated:j})}function hr(U){return U/360+.5}function er(U){const C=Math.sin(U*Math.PI/180),E=.5-.25*Math.log((1+C)/(1-C))/Math.PI;return E<0?0:E>1?1:E}function ua(U){const C=(180-360*U)*Math.PI/180;return 360*Math.atan(Math.exp(C))/Math.PI-90}function Wr(U,C,E,F){for(var j,Z=F,ne=E-C>>1,J=E-C,W=U[C],ie=U[C+1],pe=U[E],de=U[E+1],ge=C+3;geZ)j=ge,Z=je;else if(je===Z){var Ke=Math.abs(ge-ne);KeF&&(j-C>3&&Wr(U,C,j,F),U[j+2]=Z,E-j>3&&Wr(U,j,E,F))}function ha(U,C,E,F,j,Z){var ne=j-E,J=Z-F;if(ne!==0||J!==0){var W=((U-E)*ne+(C-F)*J)/(ne*ne+J*J);W>1?(E=j,F=Z):W>0&&(E+=ne*W,F+=J*W)}return(ne=U-E)*ne+(J=C-F)*J}function Pr(U,C,E,F){var j={id:U===void 0?null:U,type:C,geometry:E,tags:F,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return(function(Z){var ne=Z.geometry,J=Z.type;if(J==="Point"||J==="MultiPoint"||J==="LineString")On(Z,ne);else if(J==="Polygon"||J==="MultiLineString")for(var W=0;W0&&(ne+=F?(j*ie-W*Z)/2:Math.sqrt(Math.pow(W-j,2)+Math.pow(ie-Z,2))),j=W,Z=ie}var pe=C.length-3;C[2]=1,Wr(C,0,pe,E),C[pe+2]=1,C.size=Math.abs(ne),C.start=0,C.end=C.size}function fn(U,C,E,F){for(var j=0;j1?1:E}function tr(U,C,E,F,j,Z,ne,J){if(F/=C,Z>=(E/=C)&&ne=F)return null;for(var W=[],ie=0;ie=E&&Ke=F)){var Be=[];if(ge==="Point"||ge==="MultiPoint")At(de,Be,E,F,j);else if(ge==="LineString")mt(de,Be,E,F,j,!1,J.lineMetrics);else if(ge==="MultiLineString")Nn(de,Be,E,F,j,!1);else if(ge==="Polygon")Nn(de,Be,E,F,j,!0);else if(ge==="MultiPolygon")for(var Ze=0;Ze=E&&ne<=F&&(C.push(U[Z]),C.push(U[Z+1]),C.push(U[Z+2]))}}function mt(U,C,E,F,j,Z,ne){for(var J,W,ie=xr(U),pe=j===0?Na:Vn,de=U.start,ge=0;geE&&(W=pe(ie,je,Ke,Ze,Je,E),ne&&(ie.start=de+J*W)):xt>F?St=E&&(W=pe(ie,je,Ke,Ze,Je,E),ft=!0),St>F&&xt<=F&&(W=pe(ie,je,Ke,Ze,Je,F),ft=!0),!Z&&ft&&(ne&&(ie.end=de+J*W),C.push(ie),ie=xr(U)),ne&&(de+=J)}var dt=U.length-3;je=U[dt],Ke=U[dt+1],Be=U[dt+2],(xt=j===0?je:Ke)>=E&&xt<=F&&zr(ie,je,Ke,Be),dt=ie.length-3,Z&&dt>=3&&(ie[dt]!==ie[0]||ie[dt+1]!==ie[1])&&zr(ie,ie[0],ie[1],ie[2]),ie.length&&C.push(ie)}function xr(U){var C=[];return C.size=U.size,C.start=U.start,C.end=U.end,C}function Nn(U,C,E,F,j,Z){for(var ne=0;nene.maxX&&(ne.maxX=pe),de>ne.maxY&&(ne.maxY=de)}return ne}function gn(U,C,E,F){var j=C.geometry,Z=C.type,ne=[];if(Z==="Point"||Z==="MultiPoint")for(var J=0;J0&&C.size<(j?ne:F))E.numPoints+=C.length/3;else{for(var J=[],W=0;Wne)&&(E.numSimplified++,J.push(C[W]),J.push(C[W+1])),E.numPoints++;j&&(function(ie,pe){for(var de=0,ge=0,je=ie.length,Ke=je-2;ge0===pe)for(ge=0,je=ie.length;ge24)throw new Error("maxZoom should be in the 0-24 range");if(C.promoteId&&C.generateId)throw new Error("promoteId and generateId cannot be used together.");var F=(function(j,Z){var ne=[];if(j.type==="FeatureCollection")for(var J=0;J1&&console.time("creation"),ge=this.tiles[de]=Vt(U,C,E,F,W),this.tileCoords.push({z:C,x:E,y:F}),ie)){ie>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",C,E,F,ge.numFeatures,ge.numPoints,ge.numSimplified),console.timeEnd("creation"));var je="z"+C;this.stats[je]=(this.stats[je]||0)+1,this.total++}if(ge.source=U,j){if(C===W.maxZoom||C===j)continue;var Ke=1<1&&console.time("clipping");var Be,Ze,Je,xt,St,ft,dt=.5*W.buffer/W.extent,fi=.5-dt,Ct=.5+dt,Kt=1+dt;Be=Ze=Je=xt=null,St=tr(U,pe,E-dt,E+Ct,0,ge.minX,ge.maxX,W),ft=tr(U,pe,E+fi,E+Kt,0,ge.minX,ge.maxX,W),U=null,St&&(Be=tr(St,pe,F-dt,F+Ct,1,ge.minY,ge.maxY,W),Ze=tr(St,pe,F+fi,F+Kt,1,ge.minY,ge.maxY,W),St=null),ft&&(Je=tr(ft,pe,F-dt,F+Ct,1,ge.minY,ge.maxY,W),xt=tr(ft,pe,F+fi,F+Kt,1,ge.minY,ge.maxY,W),ft=null),ie>1&&console.timeEnd("clipping"),J.push(Be||[],C+1,2*E,2*F),J.push(Ze||[],C+1,2*E,2*F+1),J.push(Je||[],C+1,2*E+1,2*F),J.push(xt||[],C+1,2*E+1,2*F+1)}}},Ce.prototype.getTile=function(U,C,E){var F=this.options,j=F.extent,Z=F.debug;if(U<0||U>24)return null;var ne=1<1&&console.log("drilling down to z%d-%d-%d",U,C,E);for(var W,ie=U,pe=C,de=E;!W&&ie>0;)ie--,pe=Math.floor(pe/2),de=Math.floor(de/2),W=this.tiles[rt(ie,pe,de)];return W&&W.source?(Z>1&&console.log("found parent tile z%d-%d-%d",ie,pe,de),Z>1&&console.time("drilling down"),this.splitTile(W.source,ie,pe,de,U,C,E),Z>1&&console.timeEnd("drilling down"),this.tiles[J]?Ie(this.tiles[J],j):null):null};class Qe extends we{constructor(C,E,F,j){super(C,E,F),this._dataUpdateable=new Map,this.loadGeoJSON=(Z,ne)=>{const{promoteId:J}=Z;if(Z.request)return l.f(Z.request,((W,ie,pe,de)=>{this._dataUpdateable=wi(ie,J)?br(ie,J):void 0,ne(W,ie,pe,de)}));if(typeof Z.data=="string")try{const W=JSON.parse(Z.data);this._dataUpdateable=wi(W,J)?br(W,J):void 0,ne(null,W)}catch{ne(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`))}else Z.dataDiff?this._dataUpdateable?((function(W,ie,pe){var de,ge,je,Ke;if(ie.removeAll&&W.clear(),ie.remove)for(const Be of ie.remove)W.delete(Be);if(ie.add)for(const Be of ie.add){const Ze=Ye(Be,pe);Ze!=null&&W.set(Ze,Be)}if(ie.update)for(const Be of ie.update){let Ze=W.get(Be.id);if(Ze==null)continue;const Je=!Be.removeAllProperties&&(((de=Be.removeProperties)===null||de===void 0?void 0:de.length)>0||((ge=Be.addOrUpdateProperties)===null||ge===void 0?void 0:ge.length)>0);if((Be.newGeometry||Be.removeAllProperties||Je)&&(Ze=Object.assign({},Ze),W.set(Be.id,Ze),Je&&(Ze.properties=Object.assign({},Ze.properties))),Be.newGeometry&&(Ze.geometry=Be.newGeometry),Be.removeAllProperties)Ze.properties={};else if(((je=Be.removeProperties)===null||je===void 0?void 0:je.length)>0)for(const xt of Be.removeProperties)Object.prototype.hasOwnProperty.call(Ze.properties,xt)&&delete Ze.properties[xt];if(((Ke=Be.addOrUpdateProperties)===null||Ke===void 0?void 0:Ke.length)>0)for(const{key:xt,value:St}of Be.addOrUpdateProperties)Ze.properties[xt]=St}})(this._dataUpdateable,Z.dataDiff,J),ne(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):ne(new Error(`Cannot update existing geojson data in ${Z.source}`)):ne(new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,j&&(this.loadGeoJSON=j)}loadGeoJSONTile(C,E){const F=C.tileID.canonical;if(!this._geoJSONIndex)return E(null,null);const j=this._geoJSONIndex.getTile(F.z,F.x,F.y);if(!j)return E(null,null);const Z=new class{constructor(J){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.N,this.length=J.length,this._features=J}feature(J){return new class{constructor(W){this._feature=W,this.extent=l.N,this.type=W.type,this.properties=W.tags,"id"in W&&!isNaN(W.id)&&(this.id=parseInt(W.id,10))}loadGeometry(){if(this._feature.type===1){const W=[];for(const ie of this._feature.geometry)W.push([new l.P(ie[0],ie[1])]);return W}{const W=[];for(const ie of this._feature.geometry){const pe=[];for(const de of ie)pe.push(new l.P(de[0],de[1]));W.push(pe)}return W}}toGeoJSON(W,ie,pe){return tt.call(this,W,ie,pe)}}(this._features[J])}}(j.features);let ne=la(Z);ne.byteOffset===0&&ne.byteLength===ne.buffer.byteLength||(ne=new Uint8Array(ne)),E(null,{vectorTile:Z,rawData:ne.buffer})}loadData(C,E){var F;(F=this._pendingRequest)===null||F===void 0||F.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const j=!!(C&&C.request&&C.request.collectResourceTiming)&&new l.bu(C.request);this._pendingCallback=E,this._pendingRequest=this.loadGeoJSON(C,((Z,ne)=>{if(delete this._pendingCallback,delete this._pendingRequest,Z||!ne)return E(Z);if(typeof ne!="object")return E(new Error(`Input data given to '${C.source}' is not a valid GeoJSON object.`));{st(ne,!0);try{if(C.filter){const W=l.bC(C.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(W.result==="error")throw new Error(W.value.map((pe=>`${pe.key}: ${pe.message}`)).join(", "));ne={type:"FeatureCollection",features:ne.features.filter((pe=>W.value.evaluate({zoom:0},pe)))}}this._geoJSONIndex=C.cluster?new Rn((function({superclusterOptions:W,clusterProperties:ie}){if(!ie||!W)return W;const pe={},de={},ge={accumulated:null,zoom:0},je={properties:null},Ke=Object.keys(ie);for(const Be of Ke){const[Ze,Je]=ie[Be],xt=l.bC(Je),St=l.bC(typeof Ze=="string"?[Ze,["accumulated"],["get",Be]]:Ze);pe[Be]=xt.value,de[Be]=St.value}return W.map=Be=>{je.properties=Be;const Ze={};for(const Je of Ke)Ze[Je]=pe[Je].evaluate(ge,je);return Ze},W.reduce=(Be,Ze)=>{je.properties=Ze;for(const Je of Ke)ge.accumulated=Be[Je],Be[Je]=de[Je].evaluate(ge,je)},W})(C)).load(ne.features):(function(W,ie){return new Ce(W,ie)})(ne,C.geojsonVtOptions)}catch(W){return E(W)}this.loaded={};const J={};if(j){const W=j.finish();W&&(J.resourceTiming={},J.resourceTiming[C.source]=JSON.parse(JSON.stringify(W)))}E(null,J)}}))}reloadTile(C,E){const F=this.loaded;return F&&F[C.uid]?super.reloadTile(C,E):this.loadTile(C,E)}removeSource(C,E){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),E()}getClusterExpansionZoom(C,E){try{E(null,this._geoJSONIndex.getClusterExpansionZoom(C.clusterId))}catch(F){E(F)}}getClusterChildren(C,E){try{E(null,this._geoJSONIndex.getChildren(C.clusterId))}catch(F){E(F)}}getClusterLeaves(C,E){try{E(null,this._geoJSONIndex.getLeaves(C.clusterId,C.limit,C.offset))}catch(F){E(F)}}}class Lr{constructor(C){this.self=C,this.actor=new l.C(C,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:we,geojson:Qe},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(E,F)=>{if(this.workerSourceTypes[E])throw new Error(`Worker source with name "${E}" already registered.`);this.workerSourceTypes[E]=F},this.self.registerRTLTextPlugin=E=>{if(l.bD.isParsed())throw new Error("RTL text plugin already registered.");l.bD.applyArabicShaping=E.applyArabicShaping,l.bD.processBidirectionalText=E.processBidirectionalText,l.bD.processStyledBidirectionalText=E.processStyledBidirectionalText}}setReferrer(C,E){this.referrer=E}setImages(C,E,F){this.availableImages[C]=E;for(const j in this.workerSources[C]){const Z=this.workerSources[C][j];for(const ne in Z)Z[ne].availableImages=E}F()}setLayers(C,E,F){this.getLayerIndex(C).replace(E),F()}updateLayers(C,E,F){this.getLayerIndex(C).update(E.layers,E.removedIds),F()}loadTile(C,E,F){this.getWorkerSource(C,E.type,E.source).loadTile(E,F)}loadDEMTile(C,E,F){this.getDEMWorkerSource(C,E.source).loadTile(E,F)}reloadTile(C,E,F){this.getWorkerSource(C,E.type,E.source).reloadTile(E,F)}abortTile(C,E,F){this.getWorkerSource(C,E.type,E.source).abortTile(E,F)}removeTile(C,E,F){this.getWorkerSource(C,E.type,E.source).removeTile(E,F)}removeDEMTile(C,E){this.getDEMWorkerSource(C,E.source).removeTile(E)}removeSource(C,E,F){if(!this.workerSources[C]||!this.workerSources[C][E.type]||!this.workerSources[C][E.type][E.source])return;const j=this.workerSources[C][E.type][E.source];delete this.workerSources[C][E.type][E.source],j.removeSource!==void 0?j.removeSource(E,F):F()}loadWorkerSource(C,E,F){try{this.self.importScripts(E.url),F()}catch(j){F(j.toString())}}syncRTLPluginState(C,E,F){try{l.bD.setState(E);const j=l.bD.getPluginURL();if(l.bD.isLoaded()&&!l.bD.isParsed()&&j!=null){this.self.importScripts(j);const Z=l.bD.isParsed();F(Z?void 0:new Error(`RTL Text Plugin failed to import scripts from ${j}`),Z)}}catch(j){F(j.toString())}}getAvailableImages(C){let E=this.availableImages[C];return E||(E=[]),E}getLayerIndex(C){let E=this.layerIndexes[C];return E||(E=this.layerIndexes[C]=new ue),E}getWorkerSource(C,E,F){return this.workerSources[C]||(this.workerSources[C]={}),this.workerSources[C][E]||(this.workerSources[C][E]={}),this.workerSources[C][E][F]||(this.workerSources[C][E][F]=new this.workerSourceTypes[E]({send:(j,Z,ne)=>{this.actor.send(j,Z,ne,C)}},this.getLayerIndex(C),this.getAvailableImages(C))),this.workerSources[C][E][F]}getDEMWorkerSource(C,E){return this.demWorkerSources[C]||(this.demWorkerSources[C]={}),this.demWorkerSources[C][E]||(this.demWorkerSources[C][E]=new Re),this.demWorkerSources[C][E]}}return l.i()&&(self.worker=new Lr(self)),Lr})),ee(["./shared"],(function(l){var ue="3.6.2";class X{static testProp(t){if(!X.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",X.suppressClickInternal,!0)}),0)}static mousePos(t,n){const s=t.getBoundingClientRect();return new l.P(n.clientX-s.left-t.clientLeft,n.clientY-s.top-t.clientTop)}static touchPos(t,n){const s=t.getBoundingClientRect(),c=[];for(let h=0;h{t=[],n=0,s=0,c={}},u.addThrottleControl=b=>{const T=s++;return c[T]=b,T},u.removeThrottleControl=b=>{delete c[b],_()},u.getImage=(b,T,I=!0)=>{Fe.supported&&(b.headers||(b.headers={}),b.headers.accept="image/webp,*/*");const P={requestParameters:b,supportImageRefresh:I,callback:T,cancelled:!1,completed:!1,cancel:()=>{P.completed||P.cancelled||(P.cancelled=!0,P.innerRequest&&(P.innerRequest.cancel(),n--),_())}};return t.push(P),_(),P};const h=b=>{const{requestParameters:T,supportImageRefresh:I,callback:P}=b;return l.e(T,{type:"image"}),(I!==!1||l.i()||l.g(T.url)||T.headers&&!Object.keys(T.headers).reduce(((V,N)=>V&&N==="accept"),!0)?l.m:x)(T,((V,N,$,B)=>{g(b,P,V,N,$,B)}))},g=(b,T,I,P,V,N)=>{I?T(I):P instanceof HTMLImageElement||l.a(P)?T(null,P):P&&(($,B)=>{typeof createImageBitmap=="function"?l.b($,B):l.d($,B)})(P,(($,B)=>{$!=null?T($):B!=null&&T(null,B,{cacheControl:V,expires:N})})),b.cancelled||(b.completed=!0,n--,_())},_=()=>{const b=(()=>{const T=Object.keys(c);let I=!1;if(T.length>0){for(const P of T)if(I=c[P](),I)break}return I})()?l.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:l.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let T=n;T0;T++){const I=t.shift();if(I.cancelled){T--;continue}const P=h(I);n++,I.innerRequest=P}},x=(b,T)=>{const I=new Image,P=b.url;let V=!1;const N=b.credentials;return N&&N==="include"?I.crossOrigin="use-credentials":(N&&N==="same-origin"||!l.s(P))&&(I.crossOrigin="anonymous"),I.fetchPriority="high",I.onload=()=>{T(null,I),I.onerror=I.onload=null},I.onerror=()=>{V||T(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.")),I.onerror=I.onload=null},I.src=P,{cancel:()=>{V=!0,I.src=""}}}})(nt||(nt={})),nt.resetRequestQueue(),(function(u){u.Glyphs="Glyphs",u.Image="Image",u.Source="Source",u.SpriteImage="SpriteImage",u.SpriteJSON="SpriteJSON",u.Style="Style",u.Tile="Tile",u.Unknown="Unknown"})(st||(st={}));class tt{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,s){const c=(function(h){const g=h.match(gr);if(!g)throw new Error(`Unable to parse URL "${h}"`);return{protocol:g[1],authority:g[2],path:g[3]||"/",params:g[4]?g[4].split("&"):[]}})(t);return c.path+=`${n}${s}`,(function(h){const g=h.params.length?`?${h.params.join("&")}`:"";return`${h.protocol}://${h.authority}${h.path}${g}`})(c)}setTransformRequest(t){this._transformRequestFn=t}}const gr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function un(u){var t=new l.A(3);return t[0]=u[0],t[1]=u[1],t[2]=u[2],t}var Zr,it=function(u,t,n){return u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2],u};Zr=new l.A(3),l.A!=Float32Array&&(Zr[0]=0,Zr[1]=0,Zr[2]=0);var It=function(u){var t=u[0],n=u[1];return t*t+n*n};function vt(u){const t=[];if(typeof u=="string")t.push({id:"default",url:u});else if(u&&u.length>0){const n=[];for(const{id:s,url:c}of u){const h=`${s}${c}`;n.indexOf(h)===-1&&(n.push(h),t.push({id:s,url:c}))}}return t}function _r(u,t,n,s,c){if(s)return void u(s);if(c!==Object.values(t).length||c!==Object.values(n).length)return;const h={};for(const g in t){h[g]={};const _=l.h.getImageCanvasContext(n[g]),x=t[g];for(const b in x){const{width:T,height:I,x:P,y:V,sdf:N,pixelRatio:$,stretchX:B,stretchY:Q,content:se}=x[b];h[g][b]={data:null,pixelRatio:$,sdf:N,stretchX:B,stretchY:Q,content:se,spriteData:{width:T,height:I,x:P,y:V,context:_}}}}u(null,h)}(function(){var u=new l.A(2);l.A!=Float32Array&&(u[0]=0,u[1]=0)})();class Ft{constructor(t,n,s,c){this.context=t,this.format=s,this.texture=t.gl.createTexture(),this.update(n,c)}update(t,n,s){const{width:c,height:h}=t,g=!(this.size&&this.size[0]===c&&this.size[1]===h||s),{context:_}=this,{gl:x}=_;if(this.useMipmap=!!(n&&n.useMipmap),x.bindTexture(x.TEXTURE_2D,this.texture),_.pixelStoreUnpackFlipY.set(!1),_.pixelStoreUnpack.set(1),_.pixelStoreUnpackPremultiplyAlpha.set(this.format===x.RGBA&&(!n||n.premultiply!==!1)),g)this.size=[c,h],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.a(t)?x.texImage2D(x.TEXTURE_2D,0,this.format,this.format,x.UNSIGNED_BYTE,t):x.texImage2D(x.TEXTURE_2D,0,this.format,c,h,0,this.format,x.UNSIGNED_BYTE,t.data);else{const{x:b,y:T}=s||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.a(t)?x.texSubImage2D(x.TEXTURE_2D,0,b,T,x.RGBA,x.UNSIGNED_BYTE,t):x.texSubImage2D(x.TEXTURE_2D,0,b,T,c,h,x.RGBA,x.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&x.generateMipmap(x.TEXTURE_2D)}bind(t,n,s){const{context:c}=this,{gl:h}=c;h.bindTexture(h.TEXTURE_2D,this.texture),s!==h.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=h.LINEAR),t!==this.filter&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,t),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,s||t),this.filter=t),n!==this.wrap&&(h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,n),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,n),this.wrap=n)}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 Fn(u){const{userImage:t}=u;return!!(t&&t.render&&t.render())&&(u.data.replace(new Uint8Array(t.data.buffer)),!0)}class ur extends l.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.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:n,callback:s}of this.requestors)this._notify(n,s);this.requestors=[]}}getImage(t){const n=this.images[t];if(n&&!n.data&&n.spriteData){const s=n.spriteData;n.data=new l.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let s=!0;const c=n.data||n.spriteData;return this._validateStretch(n.stretchX,c&&c.width)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,c&&c.height)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "content" value`))),s=!1),s}_validateStretch(t,n){if(!t)return!0;let s=0;for(const c of t){if(c[0]-1);x++,h[x]=_,g[x]=b,g[x+1]=Gr}for(let _=0,x=0;_{let _=this.entries[c];_||(_=this.entries[c]={glyphs:{},requests:{},ranges:{}});let x=_.glyphs[h];if(x!==void 0)return void g(null,{stack:c,id:h,glyph:x});if(x=this._tinySDF(_,c,h),x)return _.glyphs[h]=x,void g(null,{stack:c,id:h,glyph:x});const b=Math.floor(h/256);if(256*b>65535)return void g(new Error("glyphs > 65535 not supported"));if(_.ranges[b])return void g(null,{stack:c,id:h,glyph:x});if(!this.url)return void g(new Error("glyphsUrl is not set"));let T=_.requests[b];T||(T=_.requests[b]=[],Er.loadGlyphRange(c,b,this.url,this.requestManager,((I,P)=>{if(P){for(const V in P)this._doesCharSupportLocalGlyph(+V)||(_.glyphs[+V]=P[+V]);_.ranges[b]=!0}for(const V of T)V(I,P);delete _.requests[b]}))),T.push(((I,P)=>{I?g(I):P&&g(null,{stack:c,id:h,glyph:P[h]||null})}))}),((c,h)=>{if(c)n(c);else if(h){const g={};for(const{stack:_,id:x,glyph:b}of h)(g[_]||(g[_]={}))[x]=b&&{id:b.id,bitmap:b.bitmap.clone(),metrics:b.metrics};n(null,g)}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(l.u["CJK Unified Ideographs"](t)||l.u["Hangul Syllables"](t)||l.u.Hiragana(t)||l.u.Katakana(t))}_tinySDF(t,n,s){const c=this.localIdeographFontFamily;if(!c||!this._doesCharSupportLocalGlyph(s))return;let h=t.tinySDF;if(!h){let _="400";/bold/i.test(n)?_="900":/medium/i.test(n)?_="500":/light/i.test(n)&&(_="200"),h=t.tinySDF=new Er.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:c,fontWeight:_})}const g=h.draw(String.fromCharCode(s));return{id:s,bitmap:new l.q({width:g.width||60,height:g.height||60},g.data),metrics:{width:g.glyphWidth/2||24,height:g.glyphHeight/2||24,left:g.glyphLeft/2+.5||0,top:g.glyphTop/2-27.5||-8,advance:g.glyphAdvance/2||24,isDoubleResolution:!0}}}}Er.loadGlyphRange=function(u,t,n,s,c){const h=256*t,g=h+255,_=s.transformRequest(n.replace("{fontstack}",u).replace("{range}",`${h}-${g}`),st.Glyphs);l.l(_,((x,b)=>{if(x)c(x);else if(b){const T={};for(const I of l.n(b))T[I.id]=I;c(null,T)}}))},Er.TinySDF=class{constructor({fontSize:u=24,buffer:t=3,radius:n=8,cutoff:s=.25,fontFamily:c="sans-serif",fontWeight:h="normal",fontStyle:g="normal"}={}){this.buffer=t,this.cutoff=s,this.radius=n;const _=this.size=u+4*t,x=this._createCanvas(_),b=this.ctx=x.getContext("2d",{willReadFrequently:!0});b.font=`${g} ${h} ${u}px ${c}`,b.textBaseline="alphabetic",b.textAlign="left",b.fillStyle="black",this.gridOuter=new Float64Array(_*_),this.gridInner=new Float64Array(_*_),this.f=new Float64Array(_),this.z=new Float64Array(_+1),this.v=new Uint16Array(_)}_createCanvas(u){const t=document.createElement("canvas");return t.width=t.height=u,t}draw(u){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:c,actualBoundingBoxRight:h}=this.ctx.measureText(u),g=Math.ceil(n),_=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(h-c))),x=Math.min(this.size-this.buffer,g+Math.ceil(s)),b=_+2*this.buffer,T=x+2*this.buffer,I=Math.max(b*T,0),P=new Uint8ClampedArray(I),V={data:P,width:b,height:T,glyphWidth:_,glyphHeight:x,glyphTop:g,glyphLeft:0,glyphAdvance:t};if(_===0||x===0)return V;const{ctx:N,buffer:$,gridInner:B,gridOuter:Q}=this;N.clearRect($,$,_,x),N.fillText(u,$,$+g);const se=N.getImageData($,$,_,x);Q.fill(Gr,0,I),B.fill(0,0,I);for(let G=0;G0?fe*fe:0,B[ce]=fe<0?fe*fe:0}}bi(Q,0,0,b,T,b,this.f,this.v,this.z),bi(B,$,$,_,x,b,this.f,this.v,this.z);for(let G=0;G1&&(x=t[++_]);const T=Math.abs(b-x.left),I=Math.abs(b-x.right),P=Math.min(T,I);let V;const N=h/s*(c+1);if(x.isDash){const $=c-Math.abs(N);V=Math.sqrt(P*P+$*$)}else V=c-Math.sqrt(P*P+N*N);this.data[g+b]=Math.max(0,Math.min(255,V+128))}}}addRegularDash(t){for(let _=t.length-1;_>=0;--_){const x=t[_],b=t[_+1];x.zeroLength?t.splice(_,1):b&&b.isDash===x.isDash&&(b.left=x.left,t.splice(_,1))}const n=t[0],s=t[t.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const c=this.width*this.nextRow;let h=0,g=t[h];for(let _=0;_1&&(g=t[++h]);const x=Math.abs(_-g.left),b=Math.abs(_-g.right),T=Math.min(x,b);this.data[c+_]=Math.max(0,Math.min(255,(g.isDash?T:-T)+128))}}addDash(t,n){const s=n?7:0,c=2*s+1;if(this.nextRow+c>this.height)return l.w("LineAtlas out of space"),null;let h=0;for(let _=0;_{c.send(t,n,h)}),s=s||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach((n=>{n.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}}function yr(u,t,n){const s=function(c,h){if(c)return n(c);if(h){const g=l.F(l.e(h,u),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);h.vector_layers&&(g.vectorLayers=h.vector_layers,g.vectorLayerIds=g.vectorLayers.map((_=>_.id))),n(null,g)}};return u.url?l.f(t.transformRequest(u.url,st.Source),s):l.h.frame((()=>s(null,u)))}class Mt{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):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 l.L?new l.L(t.lng,t.lat):l.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof l.L?new l.L(t.lng,t.lat):l.L.convert(t),this}extend(t){const n=this._sw,s=this._ne;let c,h;if(t instanceof l.L)c=t,h=t;else{if(!(t instanceof Mt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Mt.convert(t)):this.extend(l.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(l.L.convert(t)):this;if(c=t._sw,h=t._ne,!c||!h)return this}return n||s?(n.lng=Math.min(c.lng,n.lng),n.lat=Math.min(c.lat,n.lat),s.lng=Math.max(h.lng,s.lng),s.lat=Math.max(h.lat,s.lat)):(this._sw=new l.L(c.lng,c.lat),this._ne=new l.L(h.lng,h.lat)),this}getCenter(){return new l.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 l.L(this.getWest(),this.getNorth())}getSouthEast(){return new l.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:n,lat:s}=l.L.convert(t);let c=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(c=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&c}static convert(t){return t instanceof Mt?t:t&&new Mt(t)}static fromLngLat(t,n=0){const s=360*n/40075017,c=s/Math.cos(Math.PI/180*t.lat);return new Mt(new l.L(t.lng-c,t.lat-s),new l.L(t.lng+c,t.lat+s))}}class Ei{constructor(t,n,s){this.bounds=Mt.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=s||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 n=Math.pow(2,t.z),s=Math.floor(l.G(this.bounds.getWest())*n),c=Math.floor(l.H(this.bounds.getNorth())*n),h=Math.ceil(l.G(this.bounds.getEast())*n),g=Math.ceil(l.H(this.bounds.getSouth())*n);return t.x>=s&&t.x=c&&t.y{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=yr(this._options,this.map._requestManager,((h,g)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),h?this.fire(new l.j(h)):g&&(l.e(this,g),g.bounds&&(this.tileBounds=new Ei(g.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})))}))},this.serialize=()=>l.e({},this._options),this.id=t,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.e(this,l.F(n,["url","scheme","tileSize","promoteId"])),this._options=l.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(c)}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,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c={request:this.map._requestManager.transformRequest(s,st.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 h(g,_){return delete t.request,t.aborted?n(null):g&&g.status!==404?n(g):(_&&_.resourceTiming&&(t.resourceTiming=_.resourceTiming),this.map._refreshExpiredTiles&&_&&t.setExpiryData(_),t.loadVectorData(_,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}c.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",c,h.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",c,h.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 Rn extends l.E{constructor(t,n,s,c){super(),this.id=t,this.dispatcher=s,this.setEventedParent(c),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.e({type:"raster"},n),l.e(this,l.F(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=yr(this._options,this.map._requestManager,((t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new l.j(t)):n&&(l.e(this,n),n.bounds&&(this.tileBounds=new Ei(n.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.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 l.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=nt.getImage(this.map._requestManager.transformRequest(s,st.Tile),((c,h,g)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(c)t.state="errored",n(c);else if(h){this.map._refreshExpiredTiles&&g&&t.setExpiryData(g);const _=this.map.painter.context,x=_.gl;t.texture=this.map.painter.getTileTexture(h.width),t.texture?t.texture.update(h,{useMipmap:!0}):(t.texture=new Ft(_,h,x.RGBA,{useMipmap:!0}),t.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE,x.LINEAR_MIPMAP_NEAREST),_.extTextureFilterAnisotropic&&x.texParameterf(x.TEXTURE_2D,_.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,_.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}}),this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Bn extends Rn{constructor(t,n,s,c){super(t,n,s,c),this.type="raster-dem",this.maxzoom=22,this._options=l.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t,n){const s=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),c=this.map._requestManager.transformRequest(s,st.Tile);function h(g,_){g&&(t.state="errored",n(g)),_&&(t.dem=_,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=nt.getImage(c,((g,_,x)=>l._(this,void 0,void 0,(function*(){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(g)t.state="errored",n(g);else if(_){this.map._refreshExpiredTiles&&t.setExpiryData(x);const b=l.a(_)&&l.J()?_:yield(function(I){return l._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&l.K()){const P=I.width+2,V=I.height+2;try{return new l.R({width:P,height:V},yield l.M(I,-1,-1,P,V))}catch{}}return l.h.getImageData(I,1)}))})(_),T={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:b,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",T,h))}}))),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const n=t.canonical,s=Math.pow(2,n.z),c=(n.x-1+s)%s,h=n.x===0?t.wrap-1:t.wrap,g=(n.x+1+s)%s,_=n.x+1===s?t.wrap+1:t.wrap,x={};return x[new l.O(t.overscaledZ,h,n.z,c,n.y).key]={backfilled:!1},x[new l.O(t.overscaledZ,_,n.z,g,n.y).key]={backfilled:!1},n.y>0&&(x[new l.O(t.overscaledZ,h,n.z,c,n.y-1).key]={backfilled:!1},x[new l.O(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},x[new l.O(t.overscaledZ,_,n.z,g,n.y-1).key]={backfilled:!1}),n.y+1{this._updateWorkerData()},this.serialize=()=>l.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=s.getActor(),this.setEventedParent(c),this._data=n.data,this._options=l.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const h=l.N/this.tileSize;this.workerOptions=l.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*h,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*h,extent:l.N,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom!==void 0?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:l.N,radius:(n.clusterRadius||50)*h,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.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,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,s,c){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:s},c),this}_updateWorkerData(t){const n=l.e({},this.workerOptions);t?n.dataDiff=t:typeof this._data=="string"?(n.request=this.map._requestManager.transformRequest(l.h.resolveURL(this._data),st.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new l.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,((s,c)=>{if(this._pendingLoads--,this._removed||c&&c.abandoned)return void this.fire(new l.k("dataabort",{dataType:"source"}));let h=null;if(c&&c.resourceTiming&&c.resourceTiming[this.id]&&(h=c.resourceTiming[this.id].slice(0)),s)return void this.fire(new l.j(s));const g={dataType:"source"};this._collectResourceTiming&&h&&h.length>0&&l.e(g,{resourceTiming:h}),this.fire(new l.k("data",Object.assign(Object.assign({},g),{sourceDataType:"metadata"}))),this.fire(new l.k("data",Object.assign(Object.assign({},g),{sourceDataType:"content"})))}))}loaded(){return this._pendingLoads===0}loadTile(t,n){const s=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const c={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(s,c,((h,g)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):h?n(h):(t.loadVectorData(g,this.map.painter,s==="reloadTile"),n(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 hr=l.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class er extends l.E{constructor(t,n,s,c){super(),this.load=(h,g)=>{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=nt.getImage(this.map._requestManager.transformRequest(this.url,st.Image),((_,x)=>{this._request=null,this._loaded=!0,_?this.fire(new l.j(_)):x&&(this.image=x,h&&(this.coordinates=h),g&&g(),this._finishLoading())}))},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const h=this.map.painter.context,g=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Ft(h,this.image,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let _=!1;for(const x in this.tiles){const b=this.tiles[x];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,_=!0)}_&&this.fire(new l.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=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(c),this.options=n}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 l.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 n=t.map(l.U.fromLngLat);this.tileID=(function(c){let h=1/0,g=1/0,_=-1/0,x=-1/0;for(const P of c)h=Math.min(h,P.x),g=Math.min(g,P.y),_=Math.max(_,P.x),x=Math.max(x,P.y);const b=Math.max(_-h,x-g),T=Math.max(0,Math.floor(-Math.log(b)/Math.LN2)),I=Math.pow(2,T);return new l.W(T,Math.floor((h+_)/2*I),Math.floor((g+x)/2*I))})(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map((c=>this.tileID.getTilePoint(c)._round()));return this._boundsArray=new l.V,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,l.N,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,l.N),this._boundsArray.emplaceBack(s[2].x,s[2].y,l.N,l.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}hasTransition(){return!1}}class ua extends er{constructor(t,n,s,c){super(t,n,s,c),this.load=()=>{this._loaded=!1;const h=this.options;this.urls=[];for(const g of h.urls)this.urls.push(this.map._requestManager.transformRequest(g,st.Source).url);l.X(this.urls,((g,_)=>{this._loaded=!0,g?this.fire(new l.j(g)):_&&(this.video=_,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 h=this.map.painter.context,g=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new Ft(h,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));let _=!1;for(const x in this.tiles){const b=this.tiles[x];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,_=!0)}_&&this.fire(new l.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=n}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;tn.end(0)?this.fire(new l.j(new l.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.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 Wr extends er{constructor(t,n,s,c){super(t,n,s,c),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 l.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 h=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,h=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,h=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const g=this.map.painter.context,_=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,hr.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?(h||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ft(g,this.canvas,_.RGBA,{premultiply:!0});let x=!1;for(const b in this.tiles){const T=this.tiles[b];T.state!=="loaded"&&(T.state="loaded",T.texture=this.texture,x=!0)}x&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some((h=>!Array.isArray(h)||h.length!==2||h.some((g=>typeof g!="number"))))||this.fire(new l.j(new l.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.j(new l.Y(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new l.j(new l.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new l.j(new l.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 l.j(new l.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.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 ha={},Pr=u=>{switch(u){case"geojson":return Hr;case"image":return er;case"raster":return Rn;case"raster-dem":return Bn;case"vector":return pn;case"video":return ua;case"canvas":return Wr}return ha[u]};function On(u,t){const n=l.Z();return l.$(n,n,[1,1,0]),l.a0(n,n,[.5*u.width,.5*u.height,1]),l.a1(n,n,u.calculatePosMatrix(t.toUnwrapped()))}function dn(u,t,n,s,c,h){const g=(function(I,P,V){if(I)for(const N of I){const $=P[N];if($&&$.source===V&&$.type==="fill-extrusion")return!0}else for(const N in P){const $=P[N];if($.source===V&&$.type==="fill-extrusion")return!0}return!1})(c&&c.layers,t,u.id),_=h.maxPitchScaleFactor(),x=u.tilesIn(s,_,g);x.sort(Xr);const b=[];for(const I of x)b.push({wrappedTileID:I.tileID.wrapped().key,queryResults:I.tile.queryRenderedFeatures(t,n,u._state,I.queryGeometry,I.cameraQueryGeometry,I.scale,c,h,_,On(u.transform,I.tileID))});const T=(function(I){const P={},V={};for(const N of I){const $=N.queryResults,B=N.wrappedTileID,Q=V[B]=V[B]||{};for(const se in $){const G=$[se],te=Q[se]=Q[se]||{},le=P[se]=P[se]||[];for(const ce of G)te[ce.featureIndex]||(te[ce.featureIndex]=!0,le.push(ce))}}return P})(b);for(const I in T)T[I].forEach((P=>{const V=P.feature,N=u.getFeatureState(V.layer["source-layer"],V.id);V.source=V.layer.source,V.layer["source-layer"]&&(V.sourceLayer=V.layer["source-layer"]),V.state=N}));return T}function Xr(u,t){const n=u.tileID,s=t.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}class Kr{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=l.a2(),this.uses=0,this.tileSize=n,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 n=t+this.timeAdded;nh.getLayer(b))).filter(Boolean);if(x.length!==0){_.layers=x,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map((b=>x.filter((T=>T.id===b))[0])));for(const b of x)g[b.id]=_}}return g})(t.buckets,n.style),this.hasSymbolBuckets=!1;for(const c in this.buckets){const h=this.buckets[c];if(h instanceof l.a4){if(this.hasSymbolBuckets=!0,!s)break;h.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const c in this.buckets){const h=this.buckets[c];if(h instanceof l.a4&&h.hasRTLText){this.hasRTLText=!0,l.a5();break}}this.queryPadding=0;for(const c in this.buckets){const h=this.buckets[c];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(c).queryRadius(h))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new l.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 s in this.buckets){const c=this.buckets[s];c.uploadPending()&&c.upload(t)}const n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ft(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ft(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,s,c,h,g,_,x,b,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:c,cameraQueryGeometry:h,scale:g,tileSize:this.tileSize,pixelPosMatrix:T,transform:x,params:_,queryPadding:this.queryPadding*b},t,n,s):{}}querySourceFeatures(t,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const c=s.loadVTLayers(),h=n&&n.sourceLayer?n.sourceLayer:"",g=c._geojsonTileLayer||c[h];if(!g)return;const _=l.a6(n&&n.filter),{z:x,x:b,y:T}=this.tileID.canonical,I={z:x,x:b,y:T};for(let P=0;Ps)c=!1;else if(n)if(this.expirationTime{this.remove(t,h)}),s)),this.data[c].push(h),this.order.push(c),this.order.length>this.max){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}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 n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){const n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;const s=t.wrapped().key,c=n===void 0?0:this.data[s].indexOf(n),h=this.data[s][c];return this.data[s].splice(c,1),h.timeout&&clearTimeout(h.timeout),this.data[s].length===0&&delete this.data[s],this.onRemove(h.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){const n=[];for(const s in this.data)for(const c of this.data[s])t(c.value)||n.push(c);for(const s of n)this.remove(s.value.tileID,s)}}class he{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,s){const c=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][c]=this.stateChanges[t][c]||{},l.e(this.stateChanges[t][c],s),this.deletedStates[t]===null){this.deletedStates[t]={};for(const h in this.state[t])h!==c&&(this.deletedStates[t][h]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][c]===null){this.deletedStates[t][c]={};for(const h in this.state[t][c])s[h]||(this.deletedStates[t][c][h]=null)}else for(const h in s)this.deletedStates[t]&&this.deletedStates[t][c]&&this.deletedStates[t][c][h]===null&&delete this.deletedStates[t][c][h]}removeFeatureState(t,n,s){if(this.deletedStates[t]===null)return;const c=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},s&&n!==void 0)this.deletedStates[t][c]!==null&&(this.deletedStates[t][c]=this.deletedStates[t][c]||{},this.deletedStates[t][c][s]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][c])for(s in this.deletedStates[t][c]={},this.stateChanges[t][c])this.deletedStates[t][c][s]=null;else this.deletedStates[t][c]=null;else this.deletedStates[t]=null}getState(t,n){const s=String(n),c=l.e({},(this.state[t]||{})[s],(this.stateChanges[t]||{})[s]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const h=this.deletedStates[t][n];if(h===null)return{};for(const g in h)delete c[g]}return c}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){const s={};for(const c in this.stateChanges){this.state[c]=this.state[c]||{};const h={};for(const g in this.stateChanges[c])this.state[c][g]||(this.state[c][g]={}),l.e(this.state[c][g],this.stateChanges[c][g]),h[g]=this.state[c][g];s[c]=h}for(const c in this.deletedStates){this.state[c]=this.state[c]||{};const h={};if(this.deletedStates[c]===null)for(const g in this.state[c])h[g]={},this.state[c][g]={};else for(const g in this.deletedStates[c]){if(this.deletedStates[c][g]===null)this.state[c][g]={};else for(const _ of Object.keys(this.deletedStates[c][g]))delete this.state[c][g][_];h[g]=this.state[c][g]}s[c]=s[c]||{},l.e(s[c],h)}if(this.stateChanges={},this.deletedStates={},Object.keys(s).length!==0)for(const c in t)t[c].setFeatureState(s,n)}}class Pi extends l.E{constructor(t,n,s){super(),this.id=t,this.dispatcher=s,this.on("data",(c=>{c.dataType==="source"&&c.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&c.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=((c,h,g,_)=>{const x=new(Pr(h.type))(c,h,g,_);if(x.id!==c)throw new Error(`Expected Source id to be ${c} instead of ${x.id}`);return x})(t,n,s,this),this._tiles={},this._cache=new fn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new he,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 n=this._tiles[t];if(n.state!=="loaded"&&n.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,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,(()=>{})),this._source.fire(new l.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 n in this._tiles){const s=this._tiles[n];s.upload(t),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(tr).map((t=>t.key))}getRenderableIds(t){const n=[];for(const s in this._tiles)this._isIdRenderable(s,t)&&n.push(this._tiles[s]);return t?n.sort(((s,c)=>{const h=s.tileID,g=c.tileID,_=new l.P(h.canonical.x,h.canonical.y)._rotate(this.transform.angle),x=new l.P(g.canonical.x,g.canonical.y)._rotate(this.transform.angle);return h.overscaledZ-g.overscaledZ||x.y-_.y||x.x-_.x})).map((s=>s.tileID.key)):n.map((s=>s.tileID)).sort(tr).map((s=>s.key))}hasRenderableParent(t){const n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!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,n){const s=this._tiles[t];s&&(s.state!=="loading"&&(s.state=n),this._loadTile(s,this._tileLoaded.bind(this,s,t,n)))}_tileLoaded(t,n,s,c){if(c)return t.state="errored",void(c.status!==404?this._source.fire(new l.j(c,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=l.h.now(),s==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,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 l.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const n=this.getRenderableIds();for(let c=0;c1||(Math.abs(g)>1&&(Math.abs(g+x)===1?g+=x:Math.abs(g-x)===1&&(g-=x)),h.dem&&c.dem&&(c.dem.backfillBorder(h.dem,g,_),c.neighboringTiles&&c.neighboringTiles[b]&&(c.neighboringTiles[b].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,s,c){for(const h in this._tiles){let g=this._tiles[h];if(c[h]||!g.hasData()||g.tileID.overscaledZ<=n||g.tileID.overscaledZ>s)continue;let _=g.tileID;for(;g&&g.tileID.overscaledZ>n+1;){const b=g.tileID.scaledTo(g.tileID.overscaledZ-1);g=this._tiles[b.key],g&&g.hasData()&&(_=b)}let x=_;for(;x.overscaledZ>n;)if(x=x.scaledTo(x.overscaledZ-1),t[x.key]){c[_.key]=_;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){const s=this._loadedParentTiles[t.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=t.overscaledZ-1;s>=n;s--){const c=t.scaledTo(s),h=this._getLoadedTile(c);if(h)return h}}_getLoadedTile(t){const n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const n=Math.ceil(t.width/this._source.tileSize)+1,s=Math.ceil(t.height/this._source.tileSize)+1,c=Math.floor(n*s*(this._maxTileCacheZoomLevels===null?l.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),h=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,c):c;this._cache.setMaxSize(h)}handleWrapJump(t){const n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){const s={};for(const c in this._tiles){const h=this._tiles[c];h.tileID=h.tileID.unwrapTo(h.tileID.wrap+n),s[h.tileID.key]=h}this._tiles=s;for(const c in this._timers)clearTimeout(this._timers[c]),delete this._timers[c];for(const c in this._tiles)this._setTileReloadTimer(c,this._tiles[c])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let s;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((T=>new l.O(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y))):(s=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:n}),this._source.hasTile&&(s=s.filter((T=>this._source.hasTile(T))))):s=[];const c=t.coveringZoomLevel(this._source),h=Math.max(c-Pi.maxOverzooming,this._source.minzoom),g=Math.max(c+Pi.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const I of s)if(I.canonical.z>this._source.minzoom){const P=I.scaledTo(I.canonical.z-1);T[P.key]=P;const V=I.scaledTo(Math.max(this._source.minzoom,Math.min(I.canonical.z,5)));T[V.key]=V}s=s.concat(Object.values(T))}const _=s.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,_&&this.fire(new l.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const x=this._updateRetainedTiles(s,c);if(At(this._source.type)){const T={},I={},P=Object.keys(x),V=l.h.now();for(const N of P){const $=x[N],B=this._tiles[N];if(!B||B.fadeEndTime!==0&&B.fadeEndTime<=V)continue;const Q=this.findLoadedParent($,h);Q&&(this._addTile(Q.tileID),T[Q.tileID.key]=Q.tileID),I[N]=$}this._retainLoadedChildren(I,c,g,x);for(const N in T)x[N]||(this._coveredTiles[N]=!0,x[N]=T[N]);if(n){const N={},$={};for(const B of s)this._tiles[B.key].hasData()?N[B.key]=B:$[B.key]=B;for(const B in $){const Q=$[B].children(this._source.maxzoom);this._tiles[Q[0].key]&&this._tiles[Q[1].key]&&this._tiles[Q[2].key]&&this._tiles[Q[3].key]&&(N[Q[0].key]=x[Q[0].key]=Q[0],N[Q[1].key]=x[Q[1].key]=Q[1],N[Q[2].key]=x[Q[2].key]=Q[2],N[Q[3].key]=x[Q[3].key]=Q[3],delete $[B])}for(const B in $){const Q=this.findLoadedParent($[B],this._source.minzoom);if(Q){N[Q.tileID.key]=x[Q.tileID.key]=Q.tileID;for(const se in N)N[se].isChildOf(Q.tileID)&&delete N[se]}}for(const B in this._tiles)N[B]||(this._coveredTiles[B]=!0)}}for(const T in x)this._tiles[T].clearFadeHold();const b=l.ab(this._tiles,x);for(const T of b){const I=this._tiles[T];I.hasSymbolBuckets&&!I.holdingForFade()?I.setHoldDuration(this.map._fadeDuration):I.hasSymbolBuckets&&!I.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){const s={},c={},h=Math.max(n-Pi.maxOverzooming,this._source.minzoom),g=Math.max(n+Pi.maxUnderzooming,this._source.minzoom),_={};for(const x of t){const b=this._addTile(x);s[x.key]=x,b.hasData()||nthis._source.maxzoom){const I=x.children(this._source.maxzoom)[0],P=this.getTile(I);if(P&&P.hasData()){s[I.key]=I;continue}}else{const I=x.children(this._source.maxzoom);if(s[I[0].key]&&s[I[1].key]&&s[I[2].key]&&s[I[3].key])continue}let T=b.wasRequested();for(let I=x.overscaledZ-1;I>=h;--I){const P=x.scaledTo(I);if(c[P.key])break;if(c[P.key]=!0,b=this.getTile(P),!b&&T&&(b=this._addTile(P)),b){const V=b.hasData();if((T||V)&&(s[P.key]=P),T=b.wasRequested(),V)break}}}return s}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const n=[];let s,c=this._tiles[t].tileID;for(;c.overscaledZ>0;){if(c.key in this._loadedParentTiles){s=this._loadedParentTiles[c.key];break}n.push(c.key);const h=c.scaledTo(c.overscaledZ-1);if(s=this._getLoadedTile(h),s)break;c=h}for(const h of n)this._loadedParentTiles[h]=s}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));const s=n;return n||(n=new Kr(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,s||this._source.fire(new l.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const s=n.getExpiryTimeout();s&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),s))}_removeTile(t){const n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,s){const c=[],h=this.transform;if(!h)return c;const g=s?h.getCameraQueryGeometry(t):t,_=t.map((N=>h.pointCoordinate(N,this.terrain))),x=g.map((N=>h.pointCoordinate(N,this.terrain))),b=this.getIds();let T=1/0,I=1/0,P=-1/0,V=-1/0;for(const N of x)T=Math.min(T,N.x),I=Math.min(I,N.y),P=Math.max(P,N.x),V=Math.max(V,N.y);for(let N=0;N=0&&G[1].y+se>=0){const te=_.map((ce=>B.getTilePoint(ce))),le=x.map((ce=>B.getTilePoint(ce)));c.push({tile:$,tileID:B,queryGeometry:te,cameraQueryGeometry:le,scale:Q})}}return c}getVisibleCoordinates(t){const n=this.getRenderableIds(t).map((s=>this._tiles[s].tileID));for(const s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(At(this._source.type)){const t=l.h.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,s){this._state.updateState(t=t||"_geojsonTileLayer",n,s)}removeFeatureState(t,n,s){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,s)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,s){const c=this._tiles[t];c&&c.setDependencies(n,s)}reloadTilesForDependencies(t,n){for(const s in this._tiles)this._tiles[s].hasDependency(t,n)&&this._reloadTile(s,"reloading");this._cache.filter((s=>!s.hasDependency(t,n)))}}function tr(u,t){const n=Math.abs(2*u.wrap)-+(u.wrap<0),s=Math.abs(2*t.wrap)-+(t.wrap<0);return u.overscaledZ-t.overscaledZ||s-n||t.canonical.y-u.canonical.y||t.canonical.x-u.canonical.x}function At(u){return u==="raster"||u==="image"||u==="video"}Pi.maxOverzooming=10,Pi.maxUnderzooming=3;const mt="mapboxgl_preloaded_worker_pool";class xr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[mt]}numActive(){return Object.keys(this.active).length}}const Nn=Math.floor(l.h.hardwareConcurrency/2);let zr;function Na(){return zr||(zr=new xr),zr}xr.workerCount=l.ac(globalThis)?Math.max(Math.min(Nn,3),1):1;class Vn{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let s=1;s0?(c-g)/_:0;return this.points[h].mult(1-x).add(this.points[n].mult(x))}}function Yr(u,t){let n=!0;return u==="always"||u!=="never"&&t!=="never"||(n=!1),n}class mn{constructor(t,n,s){const c=this.boxCells=[],h=this.circleCells=[];this.xCellCount=Math.ceil(t/s),this.yCellCount=Math.ceil(n/s);for(let g=0;gthis.width||c<0||n>this.height)return[];const x=[];if(t<=0&&n<=0&&this.width<=s&&this.height<=c){if(h)return[{key:null,x1:t,y1:n,x2:s,y2:c}];for(let b=0;b0}hitTestCircle(t,n,s,c,h){const g=t-s,_=t+s,x=n-s,b=n+s;if(_<0||g>this.width||b<0||x>this.height)return!1;const T=[];return this._forEachCell(g,x,_,b,this._queryCellCircle,T,{hitTest:!0,overlapMode:c,circle:{x:t,y:n,radius:s},seenUids:{box:{},circle:{}}},h),T.length>0}_queryCell(t,n,s,c,h,g,_,x){const{seenUids:b,hitTest:T,overlapMode:I}=_,P=this.boxCells[h];if(P!==null){const N=this.bboxes;for(const $ of P)if(!b.box[$]){b.box[$]=!0;const B=4*$,Q=this.boxKeys[$];if(t<=N[B+2]&&n<=N[B+3]&&s>=N[B+0]&&c>=N[B+1]&&(!x||x(Q))&&(!T||!Yr(I,Q.overlapMode))&&(g.push({key:Q,x1:N[B],y1:N[B+1],x2:N[B+2],y2:N[B+3]}),T))return!0}}const V=this.circleCells[h];if(V!==null){const N=this.circles;for(const $ of V)if(!b.circle[$]){b.circle[$]=!0;const B=3*$,Q=this.circleKeys[$];if(this._circleAndRectCollide(N[B],N[B+1],N[B+2],t,n,s,c)&&(!x||x(Q))&&(!T||!Yr(I,Q.overlapMode))){const se=N[B],G=N[B+1],te=N[B+2];if(g.push({key:Q,x1:se-te,y1:G-te,x2:se+te,y2:G+te}),T)return!0}}}return!1}_queryCellCircle(t,n,s,c,h,g,_,x){const{circle:b,seenUids:T,overlapMode:I}=_,P=this.boxCells[h];if(P!==null){const N=this.bboxes;for(const $ of P)if(!T.box[$]){T.box[$]=!0;const B=4*$,Q=this.boxKeys[$];if(this._circleAndRectCollide(b.x,b.y,b.radius,N[B+0],N[B+1],N[B+2],N[B+3])&&(!x||x(Q))&&!Yr(I,Q.overlapMode))return g.push(!0),!0}}const V=this.circleCells[h];if(V!==null){const N=this.circles;for(const $ of V)if(!T.circle[$]){T.circle[$]=!0;const B=3*$,Q=this.circleKeys[$];if(this._circlesCollide(N[B],N[B+1],N[B+2],b.x,b.y,b.radius)&&(!x||x(Q))&&!Yr(I,Q.overlapMode))return g.push(!0),!0}}}_forEachCell(t,n,s,c,h,g,_,x){const b=this._convertToXCellCoord(t),T=this._convertToYCellCoord(n),I=this._convertToXCellCoord(s),P=this._convertToYCellCoord(c);for(let V=b;V<=I;V++)for(let N=T;N<=P;N++)if(h.call(this,t,n,s,c,this.xCellCount*N+V,g,_,x))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,n,s,c,h,g){const _=c-t,x=h-n,b=s+g;return b*b>_*_+x*x}_circleAndRectCollide(t,n,s,c,h,g,_){const x=(g-c)/2,b=Math.abs(t-(c+x));if(b>x+s)return!1;const T=(_-h)/2,I=Math.abs(n-(h+T));if(I>T+s)return!1;if(b<=x||I<=T)return!0;const P=b-x,V=I-T;return P*P+V*V<=s*s}}function Ie(u,t,n,s,c){const h=l.Z();return t?(l.a0(h,h,[1/c,1/c,1]),n||l.ae(h,h,s.angle)):l.a1(h,s.labelPlaneMatrix,u),h}function vr(u,t,n,s,c){if(t){const h=l.af(u);return l.a0(h,h,[c,c,1]),n||l.ae(h,h,-s.angle),h}return s.glCoordMatrix}function Vt(u,t,n){let s;n?(s=[u.x,u.y,n(u.x,u.y),1],l.ag(s,s,t)):(s=[u.x,u.y,0,1],j(s,s,t));const c=s[3];return{point:new l.P(s[0]/c,s[1]/c),signedDistanceFromCamera:c}}function gn(u,t){return .5+u/t*.5}function Dr(u,t){const n=u[0]/u[3],s=u[1]/u[3];return n>=-t[0]&&n<=t[0]&&s>=-t[1]&&s<=t[1]}function Ce(u,t,n,s,c,h,g,_,x,b){const T=s?u.textSizeData:u.iconSizeData,I=l.ah(T,n.transform.zoom),P=[256/n.width*2+1,256/n.height*2+1],V=s?u.text.dynamicLayoutVertexArray:u.icon.dynamicLayoutVertexArray;V.clear();const N=u.lineVertexArray,$=s?u.text.placedSymbolArray:u.icon.placedSymbolArray,B=n.transform.width/n.transform.height;let Q=!1;for(let se=0;se<$.length;se++){const G=$.get(se);if(G.hidden||G.writingMode===l.ai.vertical&&!Q){F(G.numGlyphs,V);continue}let te;if(Q=!1,b?(te=[G.anchorX,G.anchorY,b(G.anchorX,G.anchorY),1],l.ag(te,te,t)):(te=[G.anchorX,G.anchorY,0,1],j(te,te,t)),!Dr(te,P)){F(G.numGlyphs,V);continue}const le=gn(n.transform.cameraToCenterDistance,te[3]),ce=l.aj(T,I,G),fe=g?ce/le:ce*le,xe=new l.P(G.anchorX,G.anchorY),_e=Vt(xe,c,b).point,Se={projections:{},offsets:{}},Oe=wi(G,fe,!1,_,t,c,h,u.glyphOffsetArray,N,V,_e,xe,Se,B,x,b);Q=Oe.useVertical,(Oe.notEnoughRoom||Q||Oe.needsFlipping&&wi(G,fe,!0,_,t,c,h,u.glyphOffsetArray,N,V,_e,xe,Se,B,x,b).notEnoughRoom)&&F(G.numGlyphs,V)}s?u.text.dynamicLayoutVertexBuffer.updateData(V):u.icon.dynamicLayoutVertexBuffer.updateData(V)}function rt(u,t,n,s,c,h,g,_,x,b,T,I,P){const V=_.glyphStartIndex+_.numGlyphs,N=_.lineStartIndex,$=_.lineStartIndex+_.lineLength,B=t.getoffsetX(_.glyphStartIndex),Q=t.getoffsetX(V-1),se=C(u*B,n,s,c,h,g,_.segment,N,$,x,b,T,I,P);if(!se)return null;const G=C(u*Q,n,s,c,h,g,_.segment,N,$,x,b,T,I,P);return G?{first:se,last:G}:null}function Ye(u,t,n,s){return u===l.ai.horizontal&&Math.abs(n.y-t.y)>Math.abs(n.x-t.x)*s?{useVertical:!0}:(u===l.ai.vertical?t.yn.x)?{needsFlipping:!0}:null}function wi(u,t,n,s,c,h,g,_,x,b,T,I,P,V,N,$){const B=t/24,Q=u.lineOffsetX*B,se=u.lineOffsetY*B;let G;if(u.numGlyphs>1){const te=u.glyphStartIndex+u.numGlyphs,le=u.lineStartIndex,ce=u.lineStartIndex+u.lineLength,fe=rt(B,_,Q,se,n,T,I,u,x,h,P,N,$);if(!fe)return{notEnoughRoom:!0};const xe=Vt(fe.first.point,g,$).point,_e=Vt(fe.last.point,g,$).point;if(s&&!n){const Se=Ye(u.writingMode,xe,_e,V);if(Se)return Se}G=[fe.first];for(let Se=u.glyphStartIndex+1;Se0?xe.point:br(I,fe,le,1,c,$),Se=Ye(u.writingMode,le,_e,V);if(Se)return Se}const te=C(B*_.getoffsetX(u.glyphStartIndex),Q,se,n,T,I,u.segment,u.lineStartIndex,u.lineStartIndex+u.lineLength,x,h,P,N,$);if(!te)return{notEnoughRoom:!0};G=[te]}for(const te of G)l.ak(b,te.point,te.angle);return{}}function br(u,t,n,s,c,h){const g=Vt(u.add(u.sub(t)._unit()),c,h).point,_=n.sub(g);return n.add(_._mult(s/_.mag()))}function Qe(u,t){const{projectionCache:n,lineVertexArray:s,labelPlaneMatrix:c,tileAnchorPoint:h,distanceFromAnchor:g,getElevation:_,previousVertex:x,direction:b,absOffsetX:T}=t;if(n.projections[u])return n.projections[u];const I=new l.P(s.getx(u),s.gety(u)),P=Vt(I,c,_);if(P.signedDistanceFromCamera>0)return n.projections[u]=P.point,P.point;const V=u-b;return br(g===0?h:new l.P(s.getx(V),s.gety(V)),I,x,T-g+1,c,_)}function Lr(u,t,n){return u._unit()._perp()._mult(t*n)}function U(u,t,n,s,c,h,g,_){const{projectionCache:x,direction:b}=_;if(x.offsets[u])return x.offsets[u];const T=n.add(t);if(u+b=c)return x.offsets[u]=T,T;const I=Qe(u+b,_),P=Lr(I.sub(n),g,b),V=n.add(P),N=I.add(P);return x.offsets[u]=l.al(h,T,V,N)||T,x.offsets[u]}function C(u,t,n,s,c,h,g,_,x,b,T,I,P,V){const N=s?u-t:u+t;let $=N>0?1:-1,B=0;s&&($*=-1,B=Math.PI),$<0&&(B+=Math.PI);let Q,se,G=$>0?_+g:_+g+1,te=c,le=c,ce=0,fe=0;const xe=Math.abs(N),_e=[];let Se;for(;ce+fe<=xe;){if(G+=$,G<_||G>=x)return null;ce+=fe,le=te,se=Q;const ke={projectionCache:I,lineVertexArray:b,labelPlaneMatrix:T,tileAnchorPoint:h,distanceFromAnchor:ce,getElevation:V,previousVertex:le,direction:$,absOffsetX:xe};if(te=Qe(G,ke),n===0)_e.push(le),Se=te.sub(le);else{let He;const Ve=te.sub(le);He=Ve.mag()===0?Lr(Qe(G+$,ke).sub(te),n,$):Lr(Ve,n,$),se||(se=le.add(He)),Q=U(G,He,te,_,x,se,n,ke),_e.push(se),Se=Q.sub(se)}fe=Se.mag()}const Oe=Se._mult((xe-ce)/fe)._add(se||le),lt=B+Math.atan2(te.y-le.y,te.x-le.x);return _e.push(Oe),{point:Oe,angle:P?lt:0,path:_e}}const E=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function F(u,t){for(let n=0;n=1;et--)Ve.push(ke.path[et]);for(let et=1;etVt(ct,x,N)));Ve=et.some((ct=>ct.signedDistanceFromCamera<=0))?[]:et.map((ct=>ct.point))}let ot=[];if(Ve.length>0){const et=Ve[0].clone(),ct=Ve[0].clone();for(let qt=1;qt=Se.x&&ct.x<=Oe.x&&et.y>=Se.y&&ct.y<=Oe.y?[Ve]:ct.xOe.x||ct.yOe.y?[]:l.am([Ve],Se.x,Se.y,Oe.x,Oe.y)}for(const et of ot){lt.reset(et,.25*_e);let ct=0;ct=lt.length<=.5*_e?1:Math.ceil(lt.paddedLength/wt)+1;for(let qt=0;qt=this.screenRightBoundary||cthis.screenBottomBoundary}isInsideGrid(t,n,s,c){return s>=0&&t=0&&ns.collisionGroupID===n}}return this.collisionGroups[t]}}function Ke(u,t,n,s,c){const{horizontalAlign:h,verticalAlign:g}=l.au(u);return new l.P(-(h-.5)*t+s[0]*c,-(g-.5)*n+s[1]*c)}function Be(u,t,n,s,c,h){const{x1:g,x2:_,y1:x,y2:b,anchorPointX:T,anchorPointY:I}=u,P=new l.P(t,n);return s&&P._rotate(c?h:-h),{x1:g+P.x,y1:x+P.y,x2:_+P.x,y2:b+P.y,anchorPointX:T,anchorPointY:I}}class Ze{constructor(t,n,s,c,h){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new ne(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=s,this.retainedQueryData={},this.collisionGroups=new je(c),this.collisionCircleArrays={},this.prevPlacement=h,h&&(h.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,s,c){const h=s.getBucket(n),g=s.latestFeatureIndex;if(!h||!g||n.id!==h.layerIds[0])return;const _=s.collisionBoxArray,x=h.layers[0].layout,b=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),T=s.tileSize/l.N,I=this.transform.calculatePosMatrix(s.tileID.toUnwrapped()),P=x.get("text-pitch-alignment")==="map",V=x.get("text-rotation-alignment")==="map",N=J(s,1,this.transform.zoom),$=Ie(I,P,V,this.transform,N);let B=null;if(P){const se=vr(I,P,V,this.transform,N);B=l.a1([],this.transform.labelPlaneMatrix,se)}this.retainedQueryData[h.bucketInstanceId]=new ge(h.bucketInstanceId,g,h.sourceLayerIndex,h.index,s.tileID);const Q={bucket:h,layout:x,posMatrix:I,textLabelPlaneMatrix:$,labelToScreenMatrix:B,scale:b,textPixelRatio:T,holdingForFade:s.holdingForFade(),collisionBoxArray:_,partiallyEvaluatedTextSize:l.ah(h.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(h.sourceID)};if(c)for(const se of h.sortKeyRanges){const{sortKey:G,symbolInstanceStart:te,symbolInstanceEnd:le}=se;t.push({sortKey:G,symbolInstanceStart:te,symbolInstanceEnd:le,parameters:Q})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:h.symbolInstances.length,parameters:Q})}attemptAnchorPlacement(t,n,s,c,h,g,_,x,b,T,I,P,V,N,$,B){const Q=l.aq[t.textAnchor],se=[t.textOffset0,t.textOffset1],G=Ke(Q,s,c,se,h),te=this.collisionIndex.placeCollisionBox(Be(n,G.x,G.y,g,_,this.transform.angle),I,x,b,T.predicate,B);if((!$||this.collisionIndex.placeCollisionBox(Be($,G.x,G.y,g,_,this.transform.angle),I,x,b,T.predicate,B).box.length!==0)&&te.box.length>0){let le;if(this.prevPlacement&&this.prevPlacement.variableOffsets[P.crossTileID]&&this.prevPlacement.placements[P.crossTileID]&&this.prevPlacement.placements[P.crossTileID].text&&(le=this.prevPlacement.variableOffsets[P.crossTileID].anchor),P.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[P.crossTileID]={textOffset:se,width:s,height:c,anchor:Q,textBoxScale:h,prevAnchor:le},this.markUsedJustification(V,Q,P,N),V.allowVerticalPlacement&&(this.markUsedOrientation(V,N,P),this.placedOrientations[P.crossTileID]=N),{shift:G,placedGlyphBoxes:te}}}placeLayerBucketPart(t,n,s){const{bucket:c,layout:h,posMatrix:g,textLabelPlaneMatrix:_,labelToScreenMatrix:x,textPixelRatio:b,holdingForFade:T,collisionBoxArray:I,partiallyEvaluatedTextSize:P,collisionGroup:V}=t.parameters,N=h.get("text-optional"),$=h.get("icon-optional"),B=l.ar(h,"text-overlap","text-allow-overlap"),Q=B==="always",se=l.ar(h,"icon-overlap","icon-allow-overlap"),G=se==="always",te=h.get("text-rotation-alignment")==="map",le=h.get("text-pitch-alignment")==="map",ce=h.get("icon-text-fit")!=="none",fe=h.get("symbol-z-order")==="viewport-y",xe=Q&&(G||!c.hasIconData()||$),_e=G&&(Q||!c.hasTextData()||N);!c.collisionArrays&&I&&c.deserializeCollisionBoxes(I);const Se=this.retainedQueryData[c.bucketInstanceId].tileID,Oe=this.terrain?(ke,He)=>this.terrain.getElevation(Se,ke,He):null,lt=(ke,He)=>{var Ve,wt;if(n[ke.crossTileID])return;if(T)return void(this.placements[ke.crossTileID]=new pe(!1,!1,!1));let ot=!1,et=!1,ct=!0,qt=null,kt={box:null,offscreen:null},hi={box:null},Qt=null,Wt=null,Hi=null,Pt=0,Sr=0,Tr=0;He.textFeatureIndex?Pt=He.textFeatureIndex:ke.useRuntimeCollisionCircles&&(Pt=ke.featureIndex),He.verticalTextFeatureIndex&&(Sr=He.verticalTextFeatureIndex);const sn=He.textBox;if(sn){const gi=Zt=>{let ei=l.ai.horizontal;if(c.allowVerticalPlacement&&!Zt&&this.prevPlacement){const Li=this.prevPlacement.placedOrientations[ke.crossTileID];Li&&(this.placedOrientations[ke.crossTileID]=Li,ei=Li,this.markUsedOrientation(c,ei,ke))}return ei},pi=(Zt,ei)=>{if(c.allowVerticalPlacement&&ke.numVerticalGlyphVertices>0&&He.verticalTextBox){for(const Li of c.writingModes)if(Li===l.ai.vertical?(kt=ei(),hi=kt):kt=Zt(),kt&&kt.box&&kt.box.length)break}else kt=Zt()},Ti=ke.textAnchorOffsetStartIndex,An=ke.textAnchorOffsetEndIndex;if(An===Ti){const Zt=(ei,Li)=>{const Gt=this.collisionIndex.placeCollisionBox(ei,B,b,g,V.predicate,Oe);return Gt&&Gt.box&&Gt.box.length&&(this.markUsedOrientation(c,Li,ke),this.placedOrientations[ke.crossTileID]=Li),Gt};pi((()=>Zt(sn,l.ai.horizontal)),(()=>{const ei=He.verticalTextBox;return c.allowVerticalPlacement&&ke.numVerticalGlyphVertices>0&&ei?Zt(ei,l.ai.vertical):{box:null,offscreen:null}})),gi(kt&&kt.box&&kt.box.length)}else{let Zt=l.aq[(wt=(Ve=this.prevPlacement)===null||Ve===void 0?void 0:Ve.variableOffsets[ke.crossTileID])===null||wt===void 0?void 0:wt.anchor];const ei=(Gt,Cn,fs)=>{const kl=Gt.x2-Gt.x1,Ml=Gt.y2-Gt.y1,Mc=ke.textBoxScale,yo=ce&&se==="never"?Cn:null;let Ir={box:[],offscreen:!1},kn=B==="never"?1:2,Ar="never";Zt&&kn++;for(let lr=0;lrei(sn,He.iconBox,l.ai.horizontal)),(()=>{const Gt=He.verticalTextBox;return c.allowVerticalPlacement&&!(kt&&kt.box&&kt.box.length)&&ke.numVerticalGlyphVertices>0&&Gt?ei(Gt,He.verticalIconBox,l.ai.vertical):{box:null,offscreen:null}})),kt&&(ot=kt.box,ct=kt.offscreen);const Li=gi(kt&&kt.box);if(!ot&&this.prevPlacement){const Gt=this.prevPlacement.variableOffsets[ke.crossTileID];Gt&&(this.variableOffsets[ke.crossTileID]=Gt,this.markUsedJustification(c,Gt.anchor,ke,Li))}}}if(Qt=kt,ot=Qt&&Qt.box&&Qt.box.length>0,ct=Qt&&Qt.offscreen,ke.useRuntimeCollisionCircles){const gi=c.text.placedSymbolArray.get(ke.centerJustifiedTextSymbolIndex),pi=l.aj(c.textSizeData,P,gi),Ti=h.get("text-padding");Wt=this.collisionIndex.placeCollisionCircles(B,gi,c.lineVertexArray,c.glyphOffsetArray,pi,g,_,x,s,le,V.predicate,ke.collisionCircleDiameter,Ti,Oe),Wt.circles.length&&Wt.collisionDetected&&!s&&l.w("Collisions detected, but collision boxes are not shown"),ot=Q||Wt.circles.length>0&&!Wt.collisionDetected,ct=ct&&Wt.offscreen}if(He.iconFeatureIndex&&(Tr=He.iconFeatureIndex),He.iconBox){const gi=pi=>{const Ti=ce&&qt?Be(pi,qt.x,qt.y,te,le,this.transform.angle):pi;return this.collisionIndex.placeCollisionBox(Ti,se,b,g,V.predicate,Oe)};hi&&hi.box&&hi.box.length&&He.verticalIconBox?(Hi=gi(He.verticalIconBox),et=Hi.box.length>0):(Hi=gi(He.iconBox),et=Hi.box.length>0),ct=ct&&Hi.offscreen}const In=N||ke.numHorizontalGlyphVertices===0&&ke.numVerticalGlyphVertices===0,ea=$||ke.numIconVertices===0;if(In||ea?ea?In||(et=et&&ot):ot=et&&ot:et=ot=et&&ot,ot&&Qt&&Qt.box&&this.collisionIndex.insertCollisionBox(Qt.box,B,h.get("text-ignore-placement"),c.bucketInstanceId,hi&&hi.box&&Sr?Sr:Pt,V.ID),et&&Hi&&this.collisionIndex.insertCollisionBox(Hi.box,se,h.get("icon-ignore-placement"),c.bucketInstanceId,Tr,V.ID),Wt&&(ot&&this.collisionIndex.insertCollisionCircles(Wt.circles,B,h.get("text-ignore-placement"),c.bucketInstanceId,Pt,V.ID),s)){const gi=c.bucketInstanceId;let pi=this.collisionCircleArrays[gi];pi===void 0&&(pi=this.collisionCircleArrays[gi]=new de);for(let Ti=0;Ti=0;--He){const Ve=ke[He];lt(c.symbolInstances.get(Ve),c.collisionArrays[Ve])}}else for(let ke=t.symbolInstanceStart;ke=0&&(t.text.placedSymbolArray.get(_).crossTileID=h>=0&&_!==h?0:s.crossTileID)}markUsedOrientation(t,n,s){const c=n===l.ai.horizontal||n===l.ai.horizontalOnly?n:0,h=n===l.ai.vertical?n:0,g=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const _ of g)t.text.placedSymbolArray.get(_).placedOrientation=c;s.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=h)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const c=n?n.symbolFadeChange(t):1,h=n?n.opacities:{},g=n?n.variableOffsets:{},_=n?n.placedOrientations:{};for(const x in this.placements){const b=this.placements[x],T=h[x];T?(this.opacities[x]=new ie(T,c,b.text,b.icon),s=s||b.text!==T.text.placed||b.icon!==T.icon.placed):(this.opacities[x]=new ie(null,c,b.text,b.icon,b.skipFade),s=s||b.text||b.icon)}for(const x in h){const b=h[x];if(!this.opacities[x]){const T=new ie(b,c,!1,!1);T.isHidden()||(this.opacities[x]=T,s=s||b.text.placed||b.icon.placed)}}for(const x in g)this.variableOffsets[x]||!this.opacities[x]||this.opacities[x].isHidden()||(this.variableOffsets[x]=g[x]);for(const x in _)this.placedOrientations[x]||!this.opacities[x]||this.opacities[x].isHidden()||(this.placedOrientations[x]=_[x]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){const s={};for(const c of n){const h=c.getBucket(t);h&&c.latestFeatureIndex&&t.id===h.layerIds[0]&&this.updateBucketOpacities(h,s,c.collisionBoxArray)}}updateBucketOpacities(t,n,s){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 c=t.layers[0],h=c.layout,g=new ie(null,0,!1,!1,!0),_=h.get("text-allow-overlap"),x=h.get("icon-allow-overlap"),b=c._unevaluatedLayout.hasValue("text-variable-anchor")||c._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T=h.get("text-rotation-alignment")==="map",I=h.get("text-pitch-alignment")==="map",P=h.get("icon-text-fit")!=="none",V=new ie(null,0,_&&(x||!t.hasIconData()||h.get("icon-optional")),x&&(_||!t.hasTextData()||h.get("text-optional")),!0);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const N=($,B,Q)=>{for(let se=0;se0,ce=this.placedOrientations[B.crossTileID],fe=ce===l.ai.vertical,xe=ce===l.ai.horizontal||ce===l.ai.horizontalOnly;if(Q>0||se>0){const _e=ci(te.text);N(t.text,Q,fe?ir:_e),N(t.text,se,xe?ir:_e);const Se=te.text.isHidden();[B.rightJustifiedTextSymbolIndex,B.centerJustifiedTextSymbolIndex,B.leftJustifiedTextSymbolIndex].forEach((ke=>{ke>=0&&(t.text.placedSymbolArray.get(ke).hidden=Se||fe?1:0)})),B.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(B.verticalPlacedTextSymbolIndex).hidden=Se||xe?1:0);const Oe=this.variableOffsets[B.crossTileID];Oe&&this.markUsedJustification(t,Oe.anchor,B,ce);const lt=this.placedOrientations[B.crossTileID];lt&&(this.markUsedJustification(t,"left",B,lt),this.markUsedOrientation(t,lt,B))}if(le){const _e=ci(te.icon),Se=!(P&&B.verticalPlacedIconSymbolIndex&&fe);B.placedIconSymbolIndex>=0&&(N(t.icon,B.numIconVertices,Se?_e:ir),t.icon.placedSymbolArray.get(B.placedIconSymbolIndex).hidden=te.icon.isHidden()),B.verticalPlacedIconSymbolIndex>=0&&(N(t.icon,B.numVerticalIconVertices,Se?ir:_e),t.icon.placedSymbolArray.get(B.verticalPlacedIconSymbolIndex).hidden=te.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const _e=t.collisionArrays[$];if(_e){let Se=new l.P(0,0);if(_e.textBox||_e.verticalTextBox){let lt=!0;if(b){const ke=this.variableOffsets[G];ke?(Se=Ke(ke.anchor,ke.width,ke.height,ke.textOffset,ke.textBoxScale),T&&Se._rotate(I?this.transform.angle:-this.transform.angle)):lt=!1}_e.textBox&&Je(t.textCollisionBox.collisionVertexArray,te.text.placed,!lt||fe,Se.x,Se.y),_e.verticalTextBox&&Je(t.textCollisionBox.collisionVertexArray,te.text.placed,!lt||xe,Se.x,Se.y)}const Oe=!!(!xe&&_e.verticalIconBox);_e.iconBox&&Je(t.iconCollisionBox.collisionVertexArray,te.icon.placed,Oe,P?Se.x:0,P?Se.y:0),_e.verticalIconBox&&Je(t.iconCollisionBox.collisionVertexArray,te.icon.placed,!Oe,P?Se.x:0,P?Se.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 $=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=$.invProjMatrix,t.placementViewportMatrix=$.viewportMatrix,t.collisionCircleArray=$.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 Je(u,t,n,s,c){u.emplaceBack(t?1:0,n?1:0,s||0,c||0),u.emplaceBack(t?1:0,n?1:0,s||0,c||0),u.emplaceBack(t?1:0,n?1:0,s||0,c||0),u.emplaceBack(t?1:0,n?1:0,s||0,c||0)}const xt=Math.pow(2,25),St=Math.pow(2,24),ft=Math.pow(2,17),dt=Math.pow(2,16),fi=Math.pow(2,9),Ct=Math.pow(2,8),Kt=Math.pow(2,1);function ci(u){if(u.opacity===0&&!u.placed)return 0;if(u.opacity===1&&u.placed)return 4294967295;const t=u.placed?1:0,n=Math.floor(127*u.opacity);return n*xt+t*St+n*ft+t*dt+n*fi+t*Ct+n*Kt+t}const ir=0;class qo{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,n,s,c,h){const g=this._bucketParts;for(;this._currentTileIndex_.sortKey-x.sortKey)));this._currentPartIndex!this._forceFullPlacement&&l.h.now()-c>2;for(;this._currentPlacementIndex>=0;){const g=n[t[this._currentPlacementIndex]],_=this.placement.collisionIndex.transform.zoom;if(g.type==="symbol"&&(!g.minzoom||g.minzoom<=_)&&(!g.maxzoom||g.maxzoom>_)){if(this._inProgressLayer||(this._inProgressLayer=new qo(g)),this._inProgressLayer.continuePlacement(s[g.source],this.placement,this._showCollisionBoxes,g,h))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const $n=512/l.N/2;class pc{constructor(t,n,s){this.tileID=t,this.bucketInstanceId=s,this._symbolsByKey={};const c=new Map;for(let h=0;h({x:Math.floor(x.anchorX*$n),y:Math.floor(x.anchorY*$n)}))),crossTileIDs:g.map((x=>x.crossTileID))};if(_.positions.length>128){const x=new l.av(_.positions.length,16,Uint16Array);for(const{x:b,y:T}of _.positions)x.add(b,T);x.finish(),delete _.positions,_.index=x}this._symbolsByKey[h]=_}}getScaledCoordinates(t,n){const{x:s,y:c,z:h}=this.tileID.canonical,{x:g,y:_,z:x}=n.canonical,b=$n/Math.pow(2,x-h),T=(_*l.N+t.anchorY)*b,I=c*l.N*$n;return{x:Math.floor((g*l.N+t.anchorX)*b-s*l.N*$n),y:Math.floor(T-I)}}findMatches(t,n,s){const c=this.tileID.canonical.zt))}}class bt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Es{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const n=Math.round((t-this.lng)/360);if(n!==0)for(const s in this.indexes){const c=this.indexes[s],h={};for(const g in c){const _=c[g];_.tileID=_.tileID.unwrapTo(_.tileID.wrap+n),h[_.tileID.key]=_}this.indexes[s]=h}this.lng=t}addBucket(t,n,s){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let h=0;ht.overscaledZ)for(const _ in g){const x=g[_];x.tileID.isChildOf(t)&&x.findMatches(n.symbolInstances,t,c)}else{const _=g[t.scaledTo(Number(h)).key];_&&_.findMatches(n.symbolInstances,t,c)}}for(let h=0;h{n[s]=!0}));for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}const mi=(u,t)=>l.x(u,t&&t.filter((n=>n.identifier!=="source.canvas"))),$i=l.F(l.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),dc=l.F(l.ax,["setCenter","setZoom","setBearing","setPitch"]),rr=l.aw();class ui extends l.E{constructor(t,n={}){super(),this.map=t,this.dispatcher=new ca(Na(),this,t._getMapId()),this.imageManager=new ur,this.imageManager.setEventedParent(this),this.glyphManager=new Er(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new Oa(256,512),this.crossTileSymbolIndex=new Va,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.az());const s=this;this._rtlTextPluginCallback=ui.registerForPluginStateChange((c=>{s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:c.pluginStatus,pluginURL:c.pluginURL},((h,g)=>{if(l.aA(h),g&&g.every((_=>_)))for(const _ in s.sourceCaches){const x=s.sourceCaches[_].getSource().type;x!=="vector"&&x!=="geojson"||s.sourceCaches[_].reload()}}))})),this.on("data",(c=>{if(c.dataType!=="source"||c.sourceDataType!=="metadata")return;const h=this.sourceCaches[c.sourceId];if(!h)return;const g=h.getSource();if(g&&g.vectorLayerIds)for(const _ in this._layers){const x=this._layers[_];x.source===g.id&&this._validateLayer(x)}}))}loadURL(t,n={},s){this.fire(new l.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;const c=this.map._requestManager.transformRequest(t,st.Style);this._request=l.f(c,((h,g)=>{this._request=null,h?this.fire(new l.j(h)):g&&this._load(g,n,s)}))}loadJSON(t,n={},s){this.fire(new l.k("dataloading",{dataType:"style"})),this._request=l.h.frame((()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,s)}))}loadEmpty(){this.fire(new l.k("dataloading",{dataType:"style"})),this._load(rr,{validate:!1})}_load(t,n,s){var c;const h=n.transformStyle?n.transformStyle(s,t):t;if(!n.validate||!mi(this,l.y(h))){this._loaded=!0,this.stylesheet=h;for(const g in h.sources)this.addSource(g,h.sources[g],{validate:!1});h.sprite?this._loadSprite(h.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(h.glyphs),this._createLayers(),this.light=new la(this.stylesheet.light),this.map.setTerrain((c=this.stylesheet.terrain)!==null&&c!==void 0?c:null),this.fire(new l.k("data",{dataType:"style"})),this.fire(new l.k("style.load"))}}_createLayers(){const t=l.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map((n=>n.id)),this._layers={},this._serializedLayers=null;for(const n of t){const s=l.aC(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(t,n=!1,s=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=(function(c,h,g,_){const x=vt(c),b=x.length,T=g>1?"@2x":"",I={},P={},V={};for(const{id:N,url:$}of x){const B=h.transformRequest(h.normalizeSpriteURL($,T,".json"),st.SpriteJSON),Q=`${N}_${B.url}`;I[Q]=l.f(B,((te,le)=>{delete I[Q],P[N]=le,_r(_,P,V,te,b)}));const se=h.transformRequest(h.normalizeSpriteURL($,T,".png"),st.SpriteImage),G=`${N}_${se.url}`;I[G]=nt.getImage(se,((te,le)=>{delete I[G],V[N]=le,_r(_,P,V,te,b)}))}return{cancel(){for(const N of Object.values(I))N.cancel()}}})(t,this.map._requestManager,this.map.getPixelRatio(),((c,h)=>{if(this._spriteRequest=null,c)this.fire(new l.j(c));else if(h)for(const g in h){this._spritesImagesIds[g]=[];const _=this._spritesImagesIds[g]?this._spritesImagesIds[g].filter((x=>!(x in h))):[];for(const x of _)this.imageManager.removeImage(x),this._changedImages[x]=!0;for(const x in h[g]){const b=g==="default"?x:`${g}:${x}`;this._spritesImagesIds[g].push(b),b in this.imageManager.images?this.imageManager.updateImage(b,h[g][x],!1):this.imageManager.addImage(b,h[g][x]),n&&(this._changedImages[b]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"})),s&&s(c)}))}_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 l.k("data",{dataType:"style"}))}_validateLayer(t){const n=this.sourceCaches[t.source];if(!n)return;const s=t.sourceLayer;if(!s)return;const c=n.getSource();(c.type==="geojson"||c.vectorLayerIds&&c.vectorLayerIds.indexOf(s)===-1)&&this.fire(new l.j(new Error(`Source layer "${s}" does not exist on source "${c.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 n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);const s=[];for(const c of t)n[c]&&s.push(n[c]);return s}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const c=this._layers[s];c.type!=="custom"&&(t[s]=c.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 n=this._changed;if(this._changed){const c=Object.keys(this._updatedLayers),h=Object.keys(this._removedLayers);(c.length||h.length)&&this._updateWorkerLayers(c,h);for(const g in this._updatedSources){const _=this._updatedSources[g];if(_==="reload")this._reloadSource(g);else{if(_!=="clear")throw new Error(`Invalid action ${_}`);this._clearSource(g)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const g in this._updatedPaintProps)this._layers[g].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const s={};for(const c in this.sourceCaches){const h=this.sourceCaches[c];s[c]=h.used,h.used=!1}for(const c of this._order){const h=this._layers[c];h.recalculate(t,this._availableImages),!h.isHidden(t.zoom)&&h.source&&(this.sourceCaches[h.source].used=!0)}for(const c in s){const h=this.sourceCaches[c];s[c]!==h.used&&h.fire(new l.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:c}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new l.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const n in this.sourceCaches)this.sourceCaches[n].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,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();const s=this.serialize();if(t=n.transformStyle?n.transformStyle(s,t):t,mi(this,l.y(t)))return!1;(t=l.aD(t)).layers=l.aB(t.layers);const c=l.aE(s,t).filter((g=>!(g.command in dc)));if(c.length===0)return!1;const h=c.filter((g=>!(g.command in $i)));if(h.length>0)throw new Error(`Unimplemented: ${h.map((g=>g.command)).join(", ")}.`);for(const g of c)g.command!=="setTransition"&&this[g.command].apply(this,g.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,n){if(this.getImage(t))return this.fire(new l.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new l.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 l.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,s={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(l.y.source,`sources.${t}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const c=this.sourceCaches[t]=new Pi(t,n,this.dispatcher);c.style=this,c.setEventedParent(this,(()=>({isSourceLoaded:c.loaded(),source:c.serialize(),sourceId:t}))),c.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 s in this._layers)if(this._layers[s].source===t)return this.fire(new l.j(new Error(`Source "${t}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new l.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const s=this.sourceCaches[t].getSource();if(s.type!=="geojson")throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,s={}){this._checkLoaded();const c=t.id;if(this.getLayer(c))return void this.fire(new l.j(new Error(`Layer "${c}" already exists on this map.`)));let h;if(t.type==="custom"){if(mi(this,l.aF(t)))return;h=l.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(c,t.source),t=l.aD(t),t=l.e(t,{source:c})),this._validate(l.y.layer,`layers.${c}`,t,{arrayIndex:-1},s))return;h=l.aC(t),this._validateLayer(h),h.setEventedParent(this,{layer:{id:c}})}const g=n?this._order.indexOf(n):this._order.length;if(n&&g===-1)this.fire(new l.j(new Error(`Cannot add layer "${c}" before non-existing layer "${n}".`)));else{if(this._order.splice(g,0,c),this._layerOrderChanged=!0,this._layers[c]=h,this._removedLayers[c]&&h.source&&h.type!=="custom"){const _=this._removedLayers[c];delete this._removedLayers[c],_.type!==h.type?this._updatedSources[h.source]="clear":(this._updatedSources[h.source]="reload",this.sourceCaches[h.source].pause())}this._updateLayer(h),h.onAdd&&h.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new l.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const s=this._order.indexOf(t);this._order.splice(s,1);const c=n?this._order.indexOf(n):this._order.length;n&&c===-1?this.fire(new l.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(c,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new l.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);const s=this._order.indexOf(t);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,s){this._checkLoaded();const c=this.getLayer(t);c?c.minzoom===n&&c.maxzoom===s||(n!=null&&(c.minzoom=n),s!=null&&(c.maxzoom=s),this._updateLayer(c)):this.fire(new l.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,s={}){this._checkLoaded();const c=this.getLayer(t);if(c){if(!l.aG(c.filter,n))return n==null?(c.filter=void 0,void this._updateLayer(c)):void(this._validate(l.y.filter,`layers.${c.id}.filter`,n,null,s)||(c.filter=l.aD(n),this._updateLayer(c)))}else this.fire(new l.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return l.aD(this.getLayer(t).filter)}setLayoutProperty(t,n,s,c={}){this._checkLoaded();const h=this.getLayer(t);h?l.aG(h.getLayoutProperty(n),s)||(h.setLayoutProperty(n,s,c),this._updateLayer(h)):this.fire(new l.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){const s=this.getLayer(t);if(s)return s.getLayoutProperty(n);this.fire(new l.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,s,c={}){this._checkLoaded();const h=this.getLayer(t);h?l.aG(h.getPaintProperty(n),s)||(h.setPaintProperty(n,s,c)&&this._updateLayer(h),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new l.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();const s=t.source,c=t.sourceLayer,h=this.sourceCaches[s];if(h===void 0)return void this.fire(new l.j(new Error(`The source '${s}' does not exist in the map's style.`)));const g=h.getSource().type;g==="geojson"&&c?this.fire(new l.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||c?(t.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),h.setFeatureState(c,t.id,n)):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();const s=t.source,c=this.sourceCaches[s];if(c===void 0)return void this.fire(new l.j(new Error(`The source '${s}' does not exist in the map's style.`)));const h=c.getSource().type,g=h==="vector"?t.sourceLayer:void 0;h!=="vector"||g?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new l.j(new Error("A feature id is required to remove its specific state property."))):c.removeFeatureState(g,t.id,n):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const n=t.source,s=t.sourceLayer,c=this.sourceCaches[n];if(c!==void 0)return c.getSource().type!=="vector"||s?(t.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),c.getFeatureState(s,t.id)):void this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new l.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return l.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=l.aH(this.sourceCaches,(h=>h.serialize())),n=this._serializeByIds(this._order),s=this.map.getTerrain()||void 0,c=this.stylesheet;return l.aI({version:c.version,name:c.name,metadata:c.metadata,light:c.light,center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch,sprite:c.sprite,glyphs:c.glyphs,transition:c.transition,sources:t,layers:n,terrain:s},(h=>h!==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 n=g=>this._layers[g].type==="fill-extrusion",s={},c=[];for(let g=this._order.length-1;g>=0;g--){const _=this._order[g];if(n(_)){s[_]=g;for(const x of t){const b=x[_];if(b)for(const T of b)c.push(T)}}}c.sort(((g,_)=>_.intersectionZ-g.intersectionZ));const h=[];for(let g=this._order.length-1;g>=0;g--){const _=this._order[g];if(n(_))for(let x=c.length-1;x>=0;x--){const b=c[x].feature;if(s[b.layer.id]{const xe=Q.featureSortOrder;if(xe){const _e=xe.indexOf(ce.featureIndex);return xe.indexOf(fe.featureIndex)-_e}return fe.featureIndex-ce.featureIndex}));for(const ce of le)te.push(ce)}}for(const Q in N)N[Q].forEach((se=>{const G=se.feature,te=b[_[Q].source].getFeatureState(G.layer["source-layer"],G.id);G.source=G.layer.source,G.layer["source-layer"]&&(G.sourceLayer=G.layer["source-layer"]),G.state=te}));return N})(this._layers,g,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(h)}querySourceFeatures(t,n){n&&n.filter&&this._validate(l.y.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[t];return s?(function(c,h){const g=c.getRenderableIds().map((b=>c.getTileByID(b))),_=[],x={};for(let b=0;b{ha[c]=h})(t,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},s):s(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();const s=this.light.getLight();let c=!1;for(const g in t)if(!l.aG(t[g],s[g])){c=!0;break}if(!c)return;const h={now:l.h.now(),transition:l.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(h)}_validate(t,n,s,c,h={}){return(!h||h.validate!==!1)&&mi(this,t.call(l.y,l.e({key:n,style:this.serialize(),value:s,styleSpec:l.v},c)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const s=this.sourceCaches[n];s.setEventedParent(null),s.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 n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,s,c,h=!1){let g=!1,_=!1;const x={};for(const b of this._order){const T=this._layers[b];if(T.type!=="symbol")continue;if(!x[T.source]){const P=this.sourceCaches[T.source];x[T.source]=P.getRenderableIds(!0).map((V=>P.getTileByID(V))).sort(((V,N)=>N.tileID.overscaledZ-V.tileID.overscaledZ||(V.tileID.isLessThan(N.tileID)?-1:1)))}const I=this.crossTileSymbolIndex.addLayer(T,x[T.source],t.center.lng);g=g||I}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((h=h||this._layerOrderChanged||s===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.h.now(),t.zoom))&&(this.pauseablePlacement=new Un(t,this.map.terrain,this._order,h,n,s,c,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,x),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.h.now()),_=!0),g&&this.pauseablePlacement.placement.setStale()),_||g)for(const b of this._order){const T=this._layers[b];T.type==="symbol"&&this.placement.updateLayerOpacities(T,x[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,s){this.imageManager.getImages(n.icons,s),this._updateTilesForChangedImages();const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,s){this.glyphManager.getGlyphs(n.stacks,s);const c=this.sourceCaches[n.source];c&&c.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,s){return l.m(n,s)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(l.y.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,s={},c){this._checkLoaded();const h=[{id:t,url:n}],g=[...vt(this.stylesheet.sprite),...h];this._validate(l.y.sprite,"sprite",g,null,s)||(this.stylesheet.sprite=g,this._loadSprite(h,!0,c))}removeSprite(t){this._checkLoaded();const n=vt(this.stylesheet.sprite);if(n.find((s=>s.id===t))){if(this._spritesImagesIds[t])for(const s of this._spritesImagesIds[t])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex((s=>s.id===t)),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}else this.fire(new l.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return vt(this.stylesheet.sprite)}setSprite(t,n={},s){this._checkLoaded(),t&&this._validate(l.y.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,s):(this._unloadSprite(),s&&s(null)))}}ui.registerForPluginStateChange=l.aK;var Ua=l.Q([{name:"a_pos",type:"Int16",components:2}]),jn="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 Rt={prelude:gt(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -54,15 +54,15 @@ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=frac #else return 0.0; #endif -}`),background:mt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +}`),background:gt(`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; +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:gt(`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; +}`,"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:gt(`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 @@ -98,7 +98,7 @@ void main(void) { #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; +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:gt("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:gt(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { @@ -115,11 +115,11 @@ const highp float ZERO=1.0/255.0/16.0; 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; +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:gt(`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 +}`,"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:gt("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:gt("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:gt("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:gt(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color @@ -134,7 +134,7 @@ gl_FragColor=vec4(1.0); 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; +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:gt(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { @@ -150,7 +150,7 @@ gl_FragColor=vec4(1.0); 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; +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:gt(`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 @@ -174,7 +174,7 @@ void main() { #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 +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:gt(`#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; @@ -201,7 +201,7 @@ void main() { #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; +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:gt(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif @@ -223,7 +223,7 @@ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_off #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; +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:gt(`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 @@ -267,20 +267,20 @@ 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 +: 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:gt(`#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; +}`,"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:gt(`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; +}`,"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:gt(`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 @@ -314,7 +314,7 @@ 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; +v_width2=vec2(outset,inset);}`),lineGradient:gt(`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() { @@ -344,7 +344,7 @@ 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 +v_width2=vec2(outset,inset);}`),linePattern:gt(`#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; @@ -396,7 +396,7 @@ 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; +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:gt(`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 @@ -437,11 +437,11 @@ 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); +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:gt(`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; +}`,"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:gt(`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 @@ -455,7 +455,7 @@ 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 +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:gt(`#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 @@ -486,7 +486,7 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);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 +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:gt(`#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; @@ -523,89 +523,89 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}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);}",Un),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);}",Un),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);}",Un)};function mt(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),c=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=h?h.concat(c):c,_={};return{fragmentSource:u=u.replace(n,((x,b,S,T,M)=>(_[M]=!0,b==="define"?` -#ifndef HAS_UNIFORM_u_${M} -varying ${S} ${T} ${M}; +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:gt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",jn),terrainDepth:gt("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);}",jn),terrainCoords:gt("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);}",jn)};function gt(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),c=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=h?h.concat(c):c,_={};return{fragmentSource:u=u.replace(n,((x,b,T,I,P)=>(_[P]=!0,b==="define"?` +#ifndef HAS_UNIFORM_u_${P} +varying ${T} ${I} ${P}; #else -uniform ${S} ${T} u_${M}; +uniform ${T} ${I} u_${P}; #endif `:` -#ifdef HAS_UNIFORM_u_${M} - ${S} ${T} ${M} = u_${M}; +#ifdef HAS_UNIFORM_u_${P} + ${T} ${I} ${P} = u_${P}; #endif -`))),vertexSource:t=t.replace(n,((x,b,S,T,M)=>{const N=T==="float"?"vec2":"vec4",O=M.match(/color/)?"color":N;return _[M]?b==="define"?` -#ifndef HAS_UNIFORM_u_${M} -uniform lowp float u_${M}_t; -attribute ${S} ${N} a_${M}; -varying ${S} ${T} ${M}; +`))),vertexSource:t=t.replace(n,((x,b,T,I,P)=>{const V=I==="float"?"vec2":"vec4",N=P.match(/color/)?"color":V;return _[P]?b==="define"?` +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${T} ${V} a_${P}; +varying ${T} ${I} ${P}; #else -uniform ${S} ${T} u_${M}; +uniform ${T} ${I} u_${P}; #endif -`:O==="vec4"?` -#ifndef HAS_UNIFORM_u_${M} - ${M} = a_${M}; +`:N==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${P} = a_${P}; #else - ${S} ${T} ${M} = u_${M}; + ${T} ${I} ${P} = u_${P}; #endif `:` -#ifndef HAS_UNIFORM_u_${M} - ${M} = unpack_mix_${O}(a_${M}, u_${M}_t); +#ifndef HAS_UNIFORM_u_${P} + ${P} = unpack_mix_${N}(a_${P}, u_${P}_t); #else - ${S} ${T} ${M} = u_${M}; + ${T} ${I} ${P} = u_${P}; #endif `:b==="define"?` -#ifndef HAS_UNIFORM_u_${M} -uniform lowp float u_${M}_t; -attribute ${S} ${N} a_${M}; +#ifndef HAS_UNIFORM_u_${P} +uniform lowp float u_${P}_t; +attribute ${T} ${V} a_${P}; #else -uniform ${S} ${T} u_${M}; +uniform ${T} ${I} u_${P}; #endif -`:O==="vec4"?` -#ifndef HAS_UNIFORM_u_${M} - ${S} ${T} ${M} = a_${M}; +`:N==="vec4"?` +#ifndef HAS_UNIFORM_u_${P} + ${T} ${I} ${P} = a_${P}; #else - ${S} ${T} ${M} = u_${M}; + ${T} ${I} ${P} = u_${P}; #endif `:` -#ifndef HAS_UNIFORM_u_${M} - ${S} ${T} ${M} = unpack_mix_${O}(a_${M}, u_${M}_t); +#ifndef HAS_UNIFORM_u_${P} + ${T} ${I} ${P} = unpack_mix_${N}(a_${P}, u_${P}_t); #else - ${S} ${T} ${M} = u_${M}; + ${T} ${I} ${P} = u_${P}; #endif -`})),staticAttributes:s,staticUniforms:g}}class mn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,c,h,g,_,x,b){this.context=t;let S=this.boundPaintVertexBuffers.length!==c.length;for(let T=0;!S&&T({u_depth:new l.aL(ce,me.u_depth),u_terrain:new l.aL(ce,me.u_terrain),u_terrain_dim:new l.aM(ce,me.u_terrain_dim),u_terrain_matrix:new l.aN(ce,me.u_terrain_matrix),u_terrain_unpack:new l.aO(ce,me.u_terrain_unpack),u_terrain_exaggeration:new l.aM(ce,me.u_terrain_exaggeration)}))(t,le),this.binderUniforms=s?s.getUniforms(t,le):[]}draw(t,n,s,c,h,g,_,x,b,S,T,M,N,O,$,R,Q,se){const G=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(c),t.setColorMode(h),t.setCullFace(g),x){t.activeTexture.set(G.TEXTURE2),G.bindTexture(G.TEXTURE_2D,x.depthTexture),t.activeTexture.set(G.TEXTURE3),G.bindTexture(G.TEXTURE_2D,x.texture);for(const le in this.terrainUniforms)this.terrainUniforms[le].set(x[le])}for(const le in this.fixedUniforms)this.fixedUniforms[le].set(_[le]);$&&$.setUniforms(t,this.binderUniforms,N,{zoom:O});let ee=0;switch(n){case G.LINES:ee=2;break;case G.TRIANGLES:ee=3;break;case G.LINE_STRIP:ee=1}for(const le of M.get()){const ce=le.vaos||(le.vaos={});(ce[b]||(ce[b]=new mn)).bind(t,this,S,$?$.getPaintVertexBuffers():[],T,le.vertexOffset,R,Q,se),G.drawElements(n,le.primitiveLength*ee,G.UNSIGNED_SHORT,le.primitiveOffset*ee*2)}}}function nr(u,t,n){const s=1/J(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,g=h*(n.tileID.canonical.x+n.tileID.wrap*c),_=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,_>>16],u_pixel_coord_lower:[65535&g,65535&_]}}const Ps=(u,t,n,s)=>{const c=t.style.light,h=c.properties.get("position"),g=[h.x,h.y,h.z],_=(function(){var b=new l.A(9);return l.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b})();c.properties.get("anchor")==="viewport"&&(function(b,S){var T=Math.sin(S),M=Math.cos(S);b[0]=M,b[1]=T,b[2]=0,b[3]=-T,b[4]=M,b[5]=0,b[6]=0,b[7]=0,b[8]=1})(_,-t.transform.angle),(function(b,S,T){var M=S[0],N=S[1],O=S[2];b[0]=M*T[0]+N*T[3]+O*T[6],b[1]=M*T[1]+N*T[4]+O*T[7],b[2]=M*T[2]+N*T[5]+O*T[8]})(g,g,_);const x=c.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[x.r,x.g,x.b],u_vertical_gradient:+n,u_opacity:s}},Yr=(u,t,n,s,c,h,g)=>l.e(Ps(u,t,n,s),nr(h,t,g),{u_height_factor:-Math.pow(2,c.overscaledZ)/g.tileSize/8}),Zo=u=>({u_matrix:u}),zs=(u,t,n,s)=>l.e(Zo(u),nr(n,t,s)),ja=(u,t)=>({u_matrix:u,u_world:t}),qa=(u,t,n,s,c)=>l.e(zs(u,t,n,s),{u_world:c}),Jr=(u,t,n,s)=>{const c=u.transform;let h,g;if(s.paint.get("circle-pitch-alignment")==="map"){const _=J(n,1,c.zoom);h=!0,g=[_,_]}else h=!1,g=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:g}},Ds=(u,t,n)=>{const s=J(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),h=n.tileID.overscaleFactor();return{u_matrix:u,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[t.pixelsToGLUnits[0]/(s*c),t.pixelsToGLUnits[1]/(s*c)],u_overscale_factor:h}},ha=(u,t,n=1)=>({u_matrix:u,u_color:t,u_overlay:0,u_overlay_scale:n}),Go=u=>({u_matrix:u}),dc=(u,t,n,s)=>({u_matrix:u,u_extrude_scale:J(t,1,n),u_intensity:s});function Ls(u,t){const n=Math.pow(2,t.canonical.z),s=t.canonical.y;return[new l.U(0,s/n).toLngLat().lat,new l.U(0,(s+1)/n).toLngLat().lat]}const Fs=(u,t,n,s)=>{const c=u.transform;return{u_matrix:Za(u,t,n,s),u_ratio:1/J(t,1,c.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},Ho=(u,t,n,s,c)=>l.e(Fs(u,t,n,c),{u_image:0,u_image_height:s}),fc=(u,t,n,s,c)=>{const h=u.transform,g=Xo(t,h);return{u_matrix:Za(u,t,n,c),u_texsize:t.imageAtlasTexture.size,u_ratio:1/J(t,1,h.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[g,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},Wo=(u,t,n,s,c,h)=>{const g=u.lineAtlas,_=Xo(t,u.transform),x=n.layout.get("line-cap")==="round",b=g.getDash(s.from,x),S=g.getDash(s.to,x),T=b.width*c.fromScale,M=S.width*c.toScale;return l.e(Fs(u,t,n,h),{u_patternscale_a:[_/T,-b.height/2],u_patternscale_b:[_/M,-S.height/2],u_sdfgamma:g.width/(256*Math.min(T,M)*u.pixelRatio)/2,u_image:0,u_tex_y_a:b.y,u_tex_y_b:S.y,u_mix:c.t})};function Xo(u,t){return 1/J(u,1,t.tileZoom)}function Za(u,t,n,s){return u.translatePosMatrix(s?s.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Ko=(u,t,n,s,c)=>{return{u_matrix:u,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(g=c.paint.get("raster-saturation"),g>0?1-1/(1.001-g):-g),u_contrast_factor:(h=c.paint.get("raster-contrast"),h>0?1/(1-h):1+h),u_spin_weights:Yo(c.paint.get("raster-hue-rotate"))};var h,g};function Yo(u){u*=Math.PI/180;const t=Math.sin(u),n=Math.cos(u);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Rs=(u,t,n,s,c,h,g,_,x,b)=>{const S=c.transform;return{u_is_size_zoom_constant:+(u==="constant"||u==="source"),u_is_size_feature_constant:+(u==="constant"||u==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:S.cameraToCenterDistance,u_pitch:S.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:S.width/S.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:h,u_label_plane_matrix:g,u_coord_matrix:_,u_is_text:+x,u_pitch_with_map:+s,u_texsize:b,u_texture:0}},Bs=(u,t,n,s,c,h,g,_,x,b,S)=>{const T=c.transform;return l.e(Rs(u,t,n,s,c,h,g,_,x,b),{u_gamma_scale:s?Math.cos(T._pitch)*T.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:1})},gn=(u,t,n,s,c,h,g,_,x,b)=>l.e(Bs(u,t,n,s,c,h,g,_,!0,x),{u_texsize_icon:b,u_texture_icon:1}),Ga=(u,t,n)=>({u_matrix:u,u_opacity:t,u_color:n}),ar=(u,t,n,s,c,h)=>l.e((function(g,_,x,b){const S=x.imageManager.getPattern(g.from.toString()),T=x.imageManager.getPattern(g.to.toString()),{width:M,height:N}=x.imageManager.getPixelSize(),O=Math.pow(2,b.tileID.overscaledZ),$=b.tileSize*Math.pow(2,x.transform.tileZoom)/O,R=$*(b.tileID.canonical.x+b.tileID.wrap*O),Q=$*b.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:S.tl,u_pattern_br_a:S.br,u_pattern_tl_b:T.tl,u_pattern_br_b:T.br,u_texsize:[M,N],u_mix:_.t,u_pattern_size_a:S.displaySize,u_pattern_size_b:T.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/J(b,1,x.transform.tileZoom),u_pixel_coord_upper:[R>>16,Q>>16],u_pixel_coord_lower:[65535&R,65535&Q]}})(s,h,n,c),{u_matrix:u,u_opacity:t}),Ha={fillExtrusion:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_lightpos:new l.aP(u,t.u_lightpos),u_lightintensity:new l.aM(u,t.u_lightintensity),u_lightcolor:new l.aP(u,t.u_lightcolor),u_vertical_gradient:new l.aM(u,t.u_vertical_gradient),u_opacity:new l.aM(u,t.u_opacity)}),fillExtrusionPattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_lightpos:new l.aP(u,t.u_lightpos),u_lightintensity:new l.aM(u,t.u_lightintensity),u_lightcolor:new l.aP(u,t.u_lightcolor),u_vertical_gradient:new l.aM(u,t.u_vertical_gradient),u_height_factor:new l.aM(u,t.u_height_factor),u_image:new l.aL(u,t.u_image),u_texsize:new l.aQ(u,t.u_texsize),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade),u_opacity:new l.aM(u,t.u_opacity)}),fill:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix)}),fillPattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_image:new l.aL(u,t.u_image),u_texsize:new l.aQ(u,t.u_texsize),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade)}),fillOutline:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_world:new l.aQ(u,t.u_world)}),fillOutlinePattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_world:new l.aQ(u,t.u_world),u_image:new l.aL(u,t.u_image),u_texsize:new l.aQ(u,t.u_texsize),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade)}),circle:(u,t)=>({u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_scale_with_map:new l.aL(u,t.u_scale_with_map),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_extrude_scale:new l.aQ(u,t.u_extrude_scale),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_matrix:new l.aN(u,t.u_matrix)}),collisionBox:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pixels_to_tile_units:new l.aM(u,t.u_pixels_to_tile_units),u_extrude_scale:new l.aQ(u,t.u_extrude_scale),u_overscale_factor:new l.aM(u,t.u_overscale_factor)}),collisionCircle:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_inv_matrix:new l.aN(u,t.u_inv_matrix),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_viewport_size:new l.aQ(u,t.u_viewport_size)}),debug:(u,t)=>({u_color:new l.aR(u,t.u_color),u_matrix:new l.aN(u,t.u_matrix),u_overlay:new l.aL(u,t.u_overlay),u_overlay_scale:new l.aM(u,t.u_overlay_scale)}),clippingMask:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix)}),heatmap:(u,t)=>({u_extrude_scale:new l.aM(u,t.u_extrude_scale),u_intensity:new l.aM(u,t.u_intensity),u_matrix:new l.aN(u,t.u_matrix)}),heatmapTexture:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_world:new l.aQ(u,t.u_world),u_image:new l.aL(u,t.u_image),u_color_ramp:new l.aL(u,t.u_color_ramp),u_opacity:new l.aM(u,t.u_opacity)}),hillshade:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_image:new l.aL(u,t.u_image),u_latrange:new l.aQ(u,t.u_latrange),u_light:new l.aQ(u,t.u_light),u_shadow:new l.aR(u,t.u_shadow),u_highlight:new l.aR(u,t.u_highlight),u_accent:new l.aR(u,t.u_accent)}),hillshadePrepare:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_image:new l.aL(u,t.u_image),u_dimension:new l.aQ(u,t.u_dimension),u_zoom:new l.aM(u,t.u_zoom),u_unpack:new l.aO(u,t.u_unpack)}),line:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels)}),lineGradient:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels),u_image:new l.aL(u,t.u_image),u_image_height:new l.aM(u,t.u_image_height)}),linePattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_texsize:new l.aQ(u,t.u_texsize),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_image:new l.aL(u,t.u_image),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade)}),lineSDF:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels),u_patternscale_a:new l.aQ(u,t.u_patternscale_a),u_patternscale_b:new l.aQ(u,t.u_patternscale_b),u_sdfgamma:new l.aM(u,t.u_sdfgamma),u_image:new l.aL(u,t.u_image),u_tex_y_a:new l.aM(u,t.u_tex_y_a),u_tex_y_b:new l.aM(u,t.u_tex_y_b),u_mix:new l.aM(u,t.u_mix)}),raster:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_tl_parent:new l.aQ(u,t.u_tl_parent),u_scale_parent:new l.aM(u,t.u_scale_parent),u_buffer_scale:new l.aM(u,t.u_buffer_scale),u_fade_t:new l.aM(u,t.u_fade_t),u_opacity:new l.aM(u,t.u_opacity),u_image0:new l.aL(u,t.u_image0),u_image1:new l.aL(u,t.u_image1),u_brightness_low:new l.aM(u,t.u_brightness_low),u_brightness_high:new l.aM(u,t.u_brightness_high),u_saturation_factor:new l.aM(u,t.u_saturation_factor),u_contrast_factor:new l.aM(u,t.u_contrast_factor),u_spin_weights:new l.aP(u,t.u_spin_weights)}),symbolIcon:(u,t)=>({u_is_size_zoom_constant:new l.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(u,t.u_is_size_feature_constant),u_size_t:new l.aM(u,t.u_size_t),u_size:new l.aM(u,t.u_size),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pitch:new l.aM(u,t.u_pitch),u_rotate_symbol:new l.aL(u,t.u_rotate_symbol),u_aspect_ratio:new l.aM(u,t.u_aspect_ratio),u_fade_change:new l.aM(u,t.u_fade_change),u_matrix:new l.aN(u,t.u_matrix),u_label_plane_matrix:new l.aN(u,t.u_label_plane_matrix),u_coord_matrix:new l.aN(u,t.u_coord_matrix),u_is_text:new l.aL(u,t.u_is_text),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_texsize:new l.aQ(u,t.u_texsize),u_texture:new l.aL(u,t.u_texture)}),symbolSDF:(u,t)=>({u_is_size_zoom_constant:new l.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(u,t.u_is_size_feature_constant),u_size_t:new l.aM(u,t.u_size_t),u_size:new l.aM(u,t.u_size),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pitch:new l.aM(u,t.u_pitch),u_rotate_symbol:new l.aL(u,t.u_rotate_symbol),u_aspect_ratio:new l.aM(u,t.u_aspect_ratio),u_fade_change:new l.aM(u,t.u_fade_change),u_matrix:new l.aN(u,t.u_matrix),u_label_plane_matrix:new l.aN(u,t.u_label_plane_matrix),u_coord_matrix:new l.aN(u,t.u_coord_matrix),u_is_text:new l.aL(u,t.u_is_text),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_texsize:new l.aQ(u,t.u_texsize),u_texture:new l.aL(u,t.u_texture),u_gamma_scale:new l.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_is_halo:new l.aL(u,t.u_is_halo)}),symbolTextAndIcon:(u,t)=>({u_is_size_zoom_constant:new l.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(u,t.u_is_size_feature_constant),u_size_t:new l.aM(u,t.u_size_t),u_size:new l.aM(u,t.u_size),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pitch:new l.aM(u,t.u_pitch),u_rotate_symbol:new l.aL(u,t.u_rotate_symbol),u_aspect_ratio:new l.aM(u,t.u_aspect_ratio),u_fade_change:new l.aM(u,t.u_fade_change),u_matrix:new l.aN(u,t.u_matrix),u_label_plane_matrix:new l.aN(u,t.u_label_plane_matrix),u_coord_matrix:new l.aN(u,t.u_coord_matrix),u_is_text:new l.aL(u,t.u_is_text),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_texsize:new l.aQ(u,t.u_texsize),u_texsize_icon:new l.aQ(u,t.u_texsize_icon),u_texture:new l.aL(u,t.u_texture),u_texture_icon:new l.aL(u,t.u_texture_icon),u_gamma_scale:new l.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_is_halo:new l.aL(u,t.u_is_halo)}),background:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_opacity:new l.aM(u,t.u_opacity),u_color:new l.aR(u,t.u_color)}),backgroundPattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_opacity:new l.aM(u,t.u_opacity),u_image:new l.aL(u,t.u_image),u_pattern_tl_a:new l.aQ(u,t.u_pattern_tl_a),u_pattern_br_a:new l.aQ(u,t.u_pattern_br_a),u_pattern_tl_b:new l.aQ(u,t.u_pattern_tl_b),u_pattern_br_b:new l.aQ(u,t.u_pattern_br_b),u_texsize:new l.aQ(u,t.u_texsize),u_mix:new l.aM(u,t.u_mix),u_pattern_size_a:new l.aQ(u,t.u_pattern_size_a),u_pattern_size_b:new l.aQ(u,t.u_pattern_size_b),u_scale_a:new l.aM(u,t.u_scale_a),u_scale_b:new l.aM(u,t.u_scale_b),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_tile_units_to_pixels:new l.aM(u,t.u_tile_units_to_pixels)}),terrain:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_texture:new l.aL(u,t.u_texture),u_ele_delta:new l.aM(u,t.u_ele_delta)}),terrainDepth:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ele_delta:new l.aM(u,t.u_ele_delta)}),terrainCoords:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_texture:new l.aL(u,t.u_texture),u_terrain_coords_id:new l.aM(u,t.u_terrain_coords_id),u_ele_delta:new l.aM(u,t.u_ele_delta)})};class Wa{constructor(t,n,s){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const pa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Xa{constructor(t,n,s,c){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const h=t.gl;this.buffer=h.createBuffer(),t.bindVertexBuffer.set(this.buffer),h.bufferData(h.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete n.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 n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let s=0;s0){const be=l.Z(),Be=me;l.aU(be,ce.placementInvProjMatrix,u.transform.glCoordMatrix),l.aU(be,be,ce.placementViewportMatrix),S.push({circleArray:ye,circleOffset:M,transform:Be,invTransform:be,coord:ee}),T+=ye.length/4,M=T}xe&&b.draw(_,x.LINES,ht.disabled,Ft.disabled,u.colorModeForRenderPass(),Mt.disabled,Ds(me,u.transform,le),u.style.map.terrain&&u.style.map.terrain.getTerrainData(ee),n.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,null,u.transform.zoom,null,null,xe.collisionVertexBuffer)}if(!g||!S.length)return;const N=u.useProgram("collisionCircle"),O=new l.aV;O.resize(4*T),O._trim();let $=0;for(const G of S)for(let ee=0;ee=0&&(O[R.associatedIconIndex]={shiftedAnchor:at,angle:Ce})}else L(R.numGlyphs,M)}if(b){N.clear();const $=u.icon.placedSymbolArray;for(let R=0;R<$.length;R++){const Q=$.get(R);if(Q.hidden)L(Q.numGlyphs,N);else{const se=O[R];if(se)for(let G=0;Gu.style.map.terrain.getElevation(xe,Di,jt):null,Jt=n.layout.get("text-rotation-alignment")==="map";Ae(be,xe.posMatrix,u,c,kt,wr,R,b,Jt,$t)}const Sn=u.translatePosMatrix(xe.posMatrix,ye,h,g),Jn=Q||c&&ce||an?Ws:kt,mi=u.translatePosMatrix(wr,ye,h,g,!0),hi=Ce&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Si;Si=Ce?be.iconsInText?gn(He.kind,nt,se,R,u,Sn,Jn,mi,st,Yt):Bs(He.kind,nt,se,R,u,Sn,Jn,mi,c,st):Rs(He.kind,nt,se,R,u,Sn,Jn,mi,c,st);const Tn={program:vt,buffers:Be,uniformValues:Si,atlasTexture:Ut,atlasTextureIcon:Gt,atlasInterpolation:It,atlasInterpolationIcon:ui,isSDF:Ce,hasHalo:hi};if(G&&be.canOverlap){ee=!0;const $t=Be.segments.get();for(const Jt of $t)me.push({segments:new l.S([Jt]),sortKey:Jt.sortKey,state:Tn,terrainData:tt})}else me.push({segments:Be.segments,sortKey:0,state:Tn,terrainData:tt})}ee&&me.sort(((xe,ye)=>xe.sortKey-ye.sortKey));for(const xe of me){const ye=xe.state;if(M.activeTexture.set(N.TEXTURE0),ye.atlasTexture.bind(ye.atlasInterpolation,N.CLAMP_TO_EDGE),ye.atlasTextureIcon&&(M.activeTexture.set(N.TEXTURE1),ye.atlasTextureIcon&&ye.atlasTextureIcon.bind(ye.atlasInterpolationIcon,N.CLAMP_TO_EDGE)),ye.isSDF){const be=ye.uniformValues;ye.hasHalo&&(be.u_is_halo=1,Ks(ye.buffers,xe.segments,n,u,ye.program,le,S,T,be,xe.terrainData)),be.u_is_halo=0}Ks(ye.buffers,xe.segments,n,u,ye.program,le,S,T,ye.uniformValues,xe.terrainData)}}function Ks(u,t,n,s,c,h,g,_,x,b){const S=s.context;c.draw(S,S.gl.TRIANGLES,h,g,_,Mt.disabled,x,b,n.id,u.layoutVertexBuffer,u.indexBuffer,t,n.paint,s.transform.zoom,u.programConfigurations.get(n.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function fa(u,t,n,s,c){if(!n||!s||!s.imageAtlas)return;const h=s.imageAtlas.patternPositions;let g=h[n.to.toString()],_=h[n.from.toString()];if(!g&&_&&(g=_),!_&&g&&(_=g),!g||!_){const x=c.getPaintProperty(t);g=h[x],_=h[x]}g&&_&&u.setConstantPatternPositions(g,_)}function ma(u,t,n,s,c,h,g){const _=u.context.gl,x="fill-pattern",b=n.paint.get(x),S=b&&b.constantOr(1),T=n.getCrossfadeParameters();let M,N,O,$,R;g?(N=S&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",M=_.LINES):(N=S?"fillPattern":"fill",M=_.TRIANGLES);const Q=b.constantOr(null);for(const se of s){const G=t.getTile(se);if(S&&!G.patternsLoaded())continue;const ee=G.getBucket(n);if(!ee)continue;const le=ee.programConfigurations.get(n.id),ce=u.useProgram(N,le),me=u.style.map.terrain&&u.style.map.terrain.getTerrainData(se);S&&(u.context.activeTexture.set(_.TEXTURE0),G.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),le.updatePaintBuffers(T)),fa(le,x,Q,G,n);const xe=me?se:null,ye=u.translatePosMatrix(xe?xe.posMatrix:se.posMatrix,G,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(g){$=ee.indexBuffer2,R=ee.segments2;const be=[_.drawingBufferWidth,_.drawingBufferHeight];O=N==="fillOutlinePattern"&&S?qa(ye,u,T,G,be):ja(ye,be)}else $=ee.indexBuffer,R=ee.segments,O=S?zs(ye,u,T,G):Zo(ye);ce.draw(u.context,M,c,u.stencilModeForClipping(se),h,Mt.disabled,O,me,n.id,ee.layoutVertexBuffer,$,R,n.paint,u.transform.zoom,le)}}function ga(u,t,n,s,c,h,g){const _=u.context,x=_.gl,b="fill-extrusion-pattern",S=n.paint.get(b),T=S.constantOr(1),M=n.getCrossfadeParameters(),N=n.paint.get("fill-extrusion-opacity"),O=S.constantOr(null);for(const $ of s){const R=t.getTile($),Q=R.getBucket(n);if(!Q)continue;const se=u.style.map.terrain&&u.style.map.terrain.getTerrainData($),G=Q.programConfigurations.get(n.id),ee=u.useProgram(T?"fillExtrusionPattern":"fillExtrusion",G);T&&(u.context.activeTexture.set(x.TEXTURE0),R.imageAtlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),G.updatePaintBuffers(M)),fa(G,b,O,R,n);const le=u.translatePosMatrix($.posMatrix,R,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ce=n.paint.get("fill-extrusion-vertical-gradient"),me=T?Yr(le,u,ce,N,$,M,R):Ps(le,u,ce,N);ee.draw(_,_.gl.TRIANGLES,c,h,g,Mt.backCCW,me,se,n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,n.paint,u.transform.zoom,G,u.style.map.terrain&&Q.centroidVertexBuffer)}}function wc(u,t,n,s,c,h,g){const _=u.context,x=_.gl,b=n.fbo;if(!b)return;const S=u.useProgram("hillshade"),T=u.style.map.terrain&&u.style.map.terrain.getTerrainData(t);_.activeTexture.set(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,b.colorAttachment.get()),S.draw(_,x.TRIANGLES,c,h,g,Mt.disabled,((M,N,O,$)=>{const R=O.paint.get("hillshade-shadow-color"),Q=O.paint.get("hillshade-highlight-color"),se=O.paint.get("hillshade-accent-color");let G=O.paint.get("hillshade-illumination-direction")*(Math.PI/180);O.paint.get("hillshade-illumination-anchor")==="viewport"&&(G-=M.transform.angle);const ee=!M.options.moving;return{u_matrix:$?$.posMatrix:M.transform.calculatePosMatrix(N.tileID.toUnwrapped(),ee),u_image:0,u_latrange:Ls(0,N.tileID),u_light:[O.paint.get("hillshade-exaggeration"),G],u_shadow:R,u_highlight:Q,u_accent:se}})(u,n,s,T?t:null),T,s.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}function Ys(u,t,n,s,c,h){const g=u.context,_=g.gl,x=t.dem;if(x&&x.data){const b=x.dim,S=x.stride,T=x.getPixels();if(g.activeTexture.set(_.TEXTURE1),g.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(S),t.demTexture){const N=t.demTexture;N.update(T,{premultiply:!1}),N.bind(_.NEAREST,_.CLAMP_TO_EDGE)}else t.demTexture=new zt(g,T,_.RGBA,{premultiply:!1}),t.demTexture.bind(_.NEAREST,_.CLAMP_TO_EDGE);g.activeTexture.set(_.TEXTURE0);let M=t.fbo;if(!M){const N=new zt(g,{width:b,height:b,data:null},_.RGBA);N.bind(_.LINEAR,_.CLAMP_TO_EDGE),M=t.fbo=g.createFramebuffer(b,b,!0,!1),M.colorAttachment.set(N.texture)}g.bindFramebuffer.set(M.framebuffer),g.viewport.set([0,0,b,b]),u.useProgram("hillshadePrepare").draw(g,_.TRIANGLES,s,c,h,Mt.disabled,((N,O)=>{const $=O.stride,R=l.Z();return l.aS(R,0,l.N,-l.N,0,0,1),l.$(R,R,[0,-l.N,0]),{u_matrix:R,u_image:1,u_dimension:[$,$],u_zoom:N.overscaledZ,u_unpack:O.getUnpackVector()}})(t.tileID,x),null,n.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Sc(u,t,n,s,c,h){const g=s.paint.get("raster-fade-duration");if(!h&&g>0){const _=l.h.now(),x=(_-u.timeAdded)/g,b=t?(_-t.timeAdded)/g:-1,S=n.getSource(),T=c.coveringZoomLevel({tileSize:S.tileSize,roundZoom:S.roundZoom}),M=!t||Math.abs(t.tileID.overscaledZ-T)>Math.abs(u.tileID.overscaledZ-T),N=M&&u.refreshedUponExpiration?1:l.ad(M?x:1-b,0,1);return u.refreshedUponExpiration&&x>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-N}:{opacity:N,mix:0}}return{opacity:1,mix:0}}const al=new l.aT(1,0,0,1),as=new l.aT(0,1,0,1),Js=new l.aT(0,0,1,1),sl=new l.aT(1,0,1,1),ol=new l.aT(0,1,1,1);function _a(u,t,n,s){os(u,0,t+n/2,u.transform.width,n,s)}function ss(u,t,n,s){os(u,t-n/2,0,n,u.transform.height,s)}function os(u,t,n,s,c,h){const g=u.context,_=g.gl;_.enable(_.SCISSOR_TEST),_.scissor(t*u.pixelRatio,n*u.pixelRatio,s*u.pixelRatio,c*u.pixelRatio),g.clear({color:h}),_.disable(_.SCISSOR_TEST)}function ll(u,t,n){const s=u.context,c=s.gl,h=n.posMatrix,g=u.useProgram("debug"),_=ht.disabled,x=Ft.disabled,b=u.colorModeForRenderPass(),S="$debug",T=u.style.map.terrain&&u.style.map.terrain.getTerrainData(n);s.activeTexture.set(c.TEXTURE0);const M=t.getTileByID(n.key).latestRawTileData,N=Math.floor((M&&M.byteLength||0)/1024),O=t.getTile(n).tileSize,$=512/Math.min(O,512)*(n.overscaledZ/u.transform.zoom)*.5;let R=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(R+=` => ${n.overscaledZ}`),(function(Q,se){Q.initDebugOverlayCanvas();const G=Q.debugOverlayCanvas,ee=Q.context.gl,le=Q.debugOverlayCanvas.getContext("2d");le.clearRect(0,0,G.width,G.height),le.shadowColor="white",le.shadowBlur=2,le.lineWidth=1.5,le.strokeStyle="white",le.textBaseline="top",le.font="bold 36px Open Sans, sans-serif",le.fillText(se,5,5),le.strokeText(se,5,5),Q.debugOverlayTexture.update(G),Q.debugOverlayTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE)})(u,`${R} ${N}kB`),g.draw(s,c.TRIANGLES,_,x,Lt.alphaBlended,Mt.disabled,ha(h,l.aT.transparent,$),null,S,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),g.draw(s,c.LINE_STRIP,_,x,b,Mt.disabled,ha(h,l.aT.red),T,S,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function Nt(u,t,n){const s=u.context,c=s.gl,h=u.colorModeForRenderPass(),g=new ht(c.LEQUAL,ht.ReadWrite,u.depthRangeFor3D),_=u.useProgram("terrain"),x=t.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,u.width,u.height]);for(const b of n){const S=u.renderToTexture.getTexture(b),T=t.getTerrainData(b.tileID);s.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,S.texture);const M={u_matrix:u.transform.calculatePosMatrix(b.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(u.transform.zoom)};_.draw(s,c.TRIANGLES,g,Ft.disabled,h,Mt.backCCW,M,T,"terrain",x.vertexBuffer,x.indexBuffer,x.segments)}}class xn{constructor(t,n){this.context=new bc(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:l.Z(),renderTime:0},this.setup(),this.numSublayers=Mi.maxUnderzooming+Mi.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Va}resize(t,n,s){if(this.width=Math.floor(t*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const c of this.style._order)this.style._layers[c].resize()}setup(){const t=this.context,n=new l.a_;n.emplaceBack(0,0),n.emplaceBack(l.N,0),n.emplaceBack(0,l.N),n.emplaceBack(l.N,l.N),this.tileExtentBuffer=t.createVertexBuffer(n,Ua.members),this.tileExtentSegments=l.S.simpleSegment(0,0,4,2);const s=new l.a_;s.emplaceBack(0,0),s.emplaceBack(l.N,0),s.emplaceBack(0,l.N),s.emplaceBack(l.N,l.N),this.debugBuffer=t.createVertexBuffer(s,Ua.members),this.debugSegments=l.S.simpleSegment(0,0,4,5);const c=new l.V;c.emplaceBack(0,0,0,0),c.emplaceBack(l.N,0,l.N,0),c.emplaceBack(0,l.N,0,l.N),c.emplaceBack(l.N,l.N,l.N,l.N),this.rasterBoundsBuffer=t.createVertexBuffer(c,hr.members),this.rasterBoundsSegments=l.S.simpleSegment(0,0,4,2);const h=new l.a_;h.emplaceBack(0,0),h.emplaceBack(1,0),h.emplaceBack(0,1),h.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(h,Ua.members),this.viewportSegments=l.S.simpleSegment(0,0,4,2);const g=new l.a$;g.emplaceBack(0),g.emplaceBack(1),g.emplaceBack(3),g.emplaceBack(2),g.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(g);const _=new l.b0;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(_);const x=this.context.gl;this.stencilClearMode=new Ft({func:x.ALWAYS,mask:0},0,255,x.ZERO,x.ZERO,x.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=l.Z();l.aS(s,0,this.width,this.height,0,0,1),l.a0(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,ht.disabled,this.stencilClearMode,Lt.disabled,Mt.disabled,Go(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const s=this.context,c=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Lt.disabled),s.setDepthMode(ht.disabled);const h=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const g of n){const _=this._tileClippingMaskIDs[g.key]=this.nextStencilID++,x=this.style.map.terrain&&this.style.map.terrain.getTerrainData(g);h.draw(s,c.TRIANGLES,ht.disabled,new Ft({func:c.ALWAYS,mask:0},_,255,c.KEEP,c.KEEP,c.REPLACE),Lt.disabled,Mt.disabled,Go(g.posMatrix),x,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new Ft({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new Ft({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,s=t.sort(((g,_)=>_.overscaledZ-g.overscaledZ)),c=s[s.length-1].overscaledZ,h=s[0].overscaledZ-c+1;if(h>1){this.currentStencilSource=void 0,this.nextStencilID+h>256&&this.clearStencil();const g={};for(let _=0;_=0;this.currentLayer--){const x=this.style._layers[s[this.currentLayer]],b=c[x.source],S=h[x.source];this._renderTileClippingMasks(x,S),this.renderLayer(this,b,x,S)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerR.source&&!R.isHidden(S)?[b.sourceCaches[R.source]]:[])),N=M.filter((R=>R.getSource().type==="vector")),O=M.filter((R=>R.getSource().type!=="vector")),$=R=>{(!T||T.getSource().maxzoom$(R))),T||O.forEach((R=>$(R))),T})(this.style,this.transform.zoom);x&&(function(b,S,T){for(let M=0;MN.style.map.terrain.getElevation(ce,He,Ne):null)}}})(x,h,_,g,_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),b),_.paint.get("icon-opacity").constantOr(1)!==0&&ns(h,g,_,x,!1,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),_.layout.get("icon-rotation-alignment"),_.layout.get("icon-pitch-alignment"),_.layout.get("icon-keep-upright"),S,T),_.paint.get("text-opacity").constantOr(1)!==0&&ns(h,g,_,x,!0,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),_.layout.get("text-keep-upright"),S,T),g.map.showCollisionBoxes&&(nl(h,g,_,x,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),!0),nl(h,g,_,x,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),!1))})(t,n,s,c,this.style.placement.variableOffsets);break;case"circle":(function(h,g,_,x){if(h.renderPass!=="translucent")return;const b=_.paint.get("circle-opacity"),S=_.paint.get("circle-stroke-width"),T=_.paint.get("circle-stroke-opacity"),M=!_.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(S.constantOr(1)===0||T.constantOr(1)===0))return;const N=h.context,O=N.gl,$=h.depthModeForSublayer(0,ht.ReadOnly),R=Ft.disabled,Q=h.colorModeForRenderPass(),se=[];for(let G=0;GG.sortKey-ee.sortKey));for(const G of se){const{programConfiguration:ee,program:le,layoutVertexBuffer:ce,indexBuffer:me,uniformValues:xe,terrainData:ye}=G.state;le.draw(N,O.TRIANGLES,$,R,Q,Mt.disabled,xe,ye,_.id,ce,me,G.segments,_.paint,h.transform.zoom,ee)}})(t,n,s,c);break;case"heatmap":(function(h,g,_,x){if(_.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){const b=h.context,S=b.gl,T=Ft.disabled,M=new Lt([S.ONE,S.ONE],l.aT.transparent,[!0,!0,!0,!0]);(function(N,O,$){const R=N.gl;N.activeTexture.set(R.TEXTURE1),N.viewport.set([0,0,O.width/4,O.height/4]);let Q=$.heatmapFbo;if(Q)R.bindTexture(R.TEXTURE_2D,Q.colorAttachment.get()),N.bindFramebuffer.set(Q.framebuffer);else{const se=R.createTexture();R.bindTexture(R.TEXTURE_2D,se),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MAG_FILTER,R.LINEAR),Q=$.heatmapFbo=N.createFramebuffer(O.width/4,O.height/4,!1,!1),(function(G,ee,le,ce){var me,xe;const ye=G.gl,be=(me=G.HALF_FLOAT)!==null&&me!==void 0?me:ye.UNSIGNED_BYTE,Be=(xe=G.RGBA16F)!==null&&xe!==void 0?xe:ye.RGBA;ye.texImage2D(ye.TEXTURE_2D,0,Be,ee.width/4,ee.height/4,0,ye.RGBA,be,null),ce.colorAttachment.set(le)})(N,O,se,Q)}})(b,h,_),b.clear({color:l.aT.transparent});for(let N=0;N{const G=l.Z();l.aS(G,0,$.width,$.height,0,0,1);const ee=$.context.gl;return{u_matrix:G,u_world:[ee.drawingBufferWidth,ee.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:R.paint.get("heatmap-opacity")}})(b,S),null,S.id,b.viewportBuffer,b.quadTriangleIndexBuffer,b.viewportSegments,S.paint,b.transform.zoom)})(h,_))})(t,n,s,c);break;case"line":(function(h,g,_,x){if(h.renderPass!=="translucent")return;const b=_.paint.get("line-opacity"),S=_.paint.get("line-width");if(b.constantOr(1)===0||S.constantOr(1)===0)return;const T=h.depthModeForSublayer(0,ht.ReadOnly),M=h.colorModeForRenderPass(),N=_.paint.get("line-dasharray"),O=_.paint.get("line-pattern"),$=O.constantOr(1),R=_.paint.get("line-gradient"),Q=_.getCrossfadeParameters(),se=$?"linePattern":N?"lineSDF":R?"lineGradient":"line",G=h.context,ee=G.gl;let le=!0;for(const ce of x){const me=g.getTile(ce);if($&&!me.patternsLoaded())continue;const xe=me.getBucket(_);if(!xe)continue;const ye=xe.programConfigurations.get(_.id),be=h.context.program.get(),Be=h.useProgram(se,ye),at=le||Be.program!==be,Ce=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ce),He=O.constantOr(null);if(He&&me.imageAtlas){const nt=me.imageAtlas,tt=nt.patternPositions[He.to.toString()],st=nt.patternPositions[He.from.toString()];tt&&st&&ye.setConstantPatternPositions(tt,st)}const Ne=Ce?ce:null,vt=$?fc(h,me,_,Q,Ne):N?Wo(h,me,_,N,Q,Ne):R?Ho(h,me,_,xe.lineClipsArray.length,Ne):Fs(h,me,_,Ne);if($)G.activeTexture.set(ee.TEXTURE0),me.imageAtlasTexture.bind(ee.LINEAR,ee.CLAMP_TO_EDGE),ye.updatePaintBuffers(Q);else if(N&&(at||h.lineAtlas.dirty))G.activeTexture.set(ee.TEXTURE0),h.lineAtlas.bind(G);else if(R){const nt=xe.gradients[_.id];let tt=nt.texture;if(_.gradientVersion!==nt.version){let st=256;if(_.stepInterpolant){const Ut=g.getSource().maxzoom,It=ce.canonical.z===Ut?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),s=this.imageManager.getPattern(t.to.toString());return!n||!s}useProgram(t,n){this.cache=this.cache||{};const s=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new $a(this.context,Dt[t],n,Ha[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}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 zt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class Pi{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,s){const c=Math.pow(2,s),h=[[-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((_=>{const x=1/(_=l.ag([],_,t))[3]/n*c;return l.b3(_,_,[x,x,1/_[3],x])})),g=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((_=>{const x=(function(M,N){var O=N[0],$=N[1],R=N[2],Q=O*O+$*$+R*R;return Q>0&&(Q=1/Math.sqrt(Q)),M[0]=N[0]*Q,M[1]=N[1]*Q,M[2]=N[2]*Q,M})([],(function(M,N,O){var $=N[0],R=N[1],Q=N[2],se=O[0],G=O[1],ee=O[2];return M[0]=R*ee-Q*G,M[1]=Q*se-$*ee,M[2]=$*G-R*se,M})([],gr([],h[_[0]],h[_[1]]),gr([],h[_[2]],h[_[1]]))),b=-((S=x)[0]*(T=h[_[1]])[0]+S[1]*T[1]+S[2]*T[2]);var S,T;return x.concat(b)}));return new Pi(h,g)}}class Gn{constructor(t,n){this.min=t,this.max=n,this.center=(function(s,c,h){return s[0]=.5*c[0],s[1]=.5*c[1],s[2]=.5*c[2],s})([],(function(s,c,h){return s[0]=c[0]+h[0],s[1]=c[1]+h[1],s[2]=c[2]+h[2],s})([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],s=Er(this.min),c=Er(this.max);for(let h=0;h=0&&g++;if(g===0)return 0;g!==n.length&&(s=!1)}if(s)return 2;for(let c=0;c<3;c++){let h=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let _=0;_this.max[c]-this.min[c])return 0}return 1}}class ya{constructor(t=0,n=0,s=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=s,this.right=c}interpolate(t,n,s){return n.top!=null&&t.top!=null&&(this.top=l.B.number(t.top,n.top,s)),n.bottom!=null&&t.bottom!=null&&(this.bottom=l.B.number(t.bottom,n.bottom,s)),n.left!=null&&t.left!=null&&(this.left=l.B.number(t.left,n.left,s)),n.right!=null&&t.right!=null&&(this.right=l.B.number(t.right,n.right,s)),this}getCenter(t,n){const s=l.ad((this.left+t-this.right)/2,0,t),c=l.ad((this.top+n-this.bottom)/2,0,n);return new l.P(s,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new ya(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class ls{constructor(t,n,s,c,h){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=h===void 0||!!h,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=s??0,this._maxPitch=c??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ya,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new ls(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 l.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-l.b5(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(function(){var s=new l.A(4);return l.A!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s})(),(function(s,c,h){var g=c[0],_=c[1],x=c[2],b=c[3],S=Math.sin(h),T=Math.cos(h);s[0]=g*T+x*S,s[1]=_*T+b*S,s[2]=g*-S+x*T,s[3]=_*-S+b*T})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=l.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,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 n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),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,n,s){this._unmodified=!1,this._edgeInsets.interpolate(t,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new l.b6(0,t)];if(this._renderWorldCopies){const s=this.pointCoordinate(new l.P(0,0)),c=this.pointCoordinate(new l.P(this.width,0)),h=this.pointCoordinate(new l.P(this.width,this.height)),g=this.pointCoordinate(new l.P(0,this.height)),_=Math.floor(Math.min(s.x,c.x,h.x,g.x)),x=Math.floor(Math.max(s.x,c.x,h.x,g.x)),b=1;for(let S=_-b;S<=x+b;S++)S!==0&&n.push(new l.b6(S,t))}return n}coveringTiles(t){var n,s;let c=this.coveringZoomLevel(t);const h=c;if(t.minzoom!==void 0&&ct.maxzoom&&(c=t.maxzoom);const g=this.pointCoordinate(this.getCameraPoint()),_=l.U.fromLngLat(this.center),x=Math.pow(2,c),b=[x*g.x,x*g.y,0],S=[x*_.x,x*_.y,0],T=Pi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c);let M=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(M=c);const N=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,O=G=>({aabb:new Gn([G*x,0,0],[(G+1)*x,x,0]),zoom:0,x:0,y:0,wrap:G,fullyVisible:!1}),$=[],R=[],Q=c,se=t.reparseOverscaled?h:c;if(this._renderWorldCopies)for(let G=1;G<=3;G++)$.push(O(-G)),$.push(O(G));for($.push(O(0));$.length>0;){const G=$.pop(),ee=G.x,le=G.y;let ce=G.fullyVisible;if(!ce){const Be=G.aabb.intersects(T);if(Be===0)continue;ce=Be===2}const me=t.terrain?b:S,xe=G.aabb.distanceX(me),ye=G.aabb.distanceY(me),be=Math.max(Math.abs(xe),Math.abs(ye));if(G.zoom===Q||be>N+(1<=M){const Be=Q-G.zoom,at=b[0]-.5-(ee<>1),He=G.zoom+1;let Ne=G.aabb.quadrant(Be);if(t.terrain){const vt=new l.O(He,G.wrap,He,at,Ce),nt=t.terrain.getMinMaxElevation(vt),tt=(n=nt.minElevation)!==null&&n!==void 0?n:this.elevation,st=(s=nt.maxElevation)!==null&&s!==void 0?s:this.elevation;Ne=new Gn([Ne.min[0],Ne.min[1],tt],[Ne.max[0],Ne.max[1],st])}$.push({aabb:Ne,zoom:He,x:at,y:Ce,wrap:G.wrap,fullyVisible:ce})}}return R.sort(((G,ee)=>G.distanceSq-ee.distanceSq)).map((G=>G.tileID))}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],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 n=l.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.P(l.G(t.lng)*this.worldSize,l.H(n)*this.worldSize)}unproject(t){return new l.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 n=this.pointLocation(this.centerPoint,t),s=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-s))return;const c=this.getCameraPosition(),h=l.U.fromLngLat(c.lngLat,c.altitude),g=l.U.fromLngLat(n,s),_=h.x-g.x,x=h.y-g.y,b=h.z-g.z,S=Math.sqrt(_*_+x*x+b*b),T=this.scaleZoom(this.cameraToCenterDistance/S/this.tileSize);this._elevation=s,this._center=n,this.zoom=T}setLocationAtPoint(t,n){const s=this.pointCoordinate(n),c=this.pointCoordinate(this.centerPoint),h=this.locationCoordinate(t),g=new l.U(h.x-(s.x-c.x),h.y-(s.y-c.y));this.center=this.coordinateLocation(g),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return l.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const M=n.pointCoordinate(t);if(M!=null)return M}const s=[t.x,t.y,0,1],c=[t.x,t.y,1,1];l.ag(s,s,this.pixelMatrixInverse),l.ag(c,c,this.pixelMatrixInverse);const h=s[3],g=c[3],_=s[1]/h,x=c[1]/g,b=s[2]/h,S=c[2]/g,T=b===S?0:(0-b)/(S-b);return new l.U(l.B.number(s[0]/h,c[0]/g,T)/this.worldSize,l.B.number(_,x,T)/this.worldSize)}coordinatePoint(t,n=0,s=this.pixelMatrix){const c=[t.x*this.worldSize,t.y*this.worldSize,n,1];return l.ag(c,c,s),new l.P(c[0]/c[3],c[1]/c[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new At().extend(this.pointLocation(new l.P(0,t))).extend(this.pointLocation(new l.P(this.width,t))).extend(this.pointLocation(new l.P(this.width,this.height))).extend(this.pointLocation(new l.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new At([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,n=!1){const s=t.key,c=n?this._alignedPosMatrixCache:this._posMatrixCache;if(c[s])return c[s];const h=t.canonical,g=this.worldSize/this.zoomScale(h.z),_=h.x+Math.pow(2,h.z)*t.wrap,x=l.ao(new Float64Array(16));return l.$(x,x,[_*g,h.y*g,0]),l.a0(x,x,[g/l.N,g/l.N,1]),l.a1(x,n?this.alignedProjMatrix:this.projMatrix,x),c[s]=new Float32Array(x),c[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,s,c,h=-90,g=90,_=-180,x=180;const b=this.size,S=this._unmodified;if(this.latRange){const N=this.latRange;h=l.H(N[1])*this.worldSize,g=l.H(N[0])*this.worldSize,t=g-hg&&(c=g-O)}if(this.lngRange){const N=(_+x)/2,O=l.b5(T.x,N-this.worldSize/2,N+this.worldSize/2),$=b.x/2;O-$<_&&(s=_+$),O+$>x&&(s=x-$)}s===void 0&&c===void 0||(this.center=this.unproject(new l.P(s!==void 0?s:T.x,c!==void 0?c:T.y)).wrap()),this._unmodified=S,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=l.b7(1,this.center.lat)*this.worldSize;let c=l.ao(new Float64Array(16));l.a0(c,c,[this.width/2,-this.height/2,1]),l.$(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=l.ao(new Float64Array(16)),l.a0(c,c,[1,-1,1]),l.$(c,c,[-1,-1,0]),l.a0(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c;const h=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),g=Math.min(this.elevation,this._minEleveationForCurrentTile),_=h-g*this._pixelPerMeter/Math.cos(this._pitch),x=g<0?_:h,b=Math.PI/2+this._pitch,S=this._fov*(.5+t.y/this.height),T=Math.sin(S)*x/Math.sin(l.ad(Math.PI-b-S,.01,Math.PI-.01)),M=this.getHorizon(),N=2*Math.atan(M/this.cameraToCenterDistance)*(.5+t.y/(2*M)),O=Math.sin(N)*x/Math.sin(l.ad(Math.PI-b-N,.01,Math.PI-.01)),$=Math.min(T,O),R=1.01*(Math.cos(Math.PI/2-this._pitch)*$+x),Q=this.height/50;c=new Float64Array(16),l.b8(c,this._fov,this.width/this.height,Q,R),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,l.a0(c,c,[1,-1,1]),l.$(c,c,[0,0,-this.cameraToCenterDistance]),l.b9(c,c,this._pitch),l.ae(c,c,this.angle),l.$(c,c,[-n,-s,0]),this.mercatorMatrix=l.a0([],c,[this.worldSize,this.worldSize,this.worldSize]),l.a0(c,c,[1,1,this._pixelPerMeter]),this.pixelMatrix=l.a1(new Float64Array(16),this.labelPlaneMatrix,c),l.$(c,c,[0,0,-this.elevation]),this.projMatrix=c,this.invProjMatrix=l.as([],c),this.pixelMatrix3D=l.a1(new Float64Array(16),this.labelPlaneMatrix,c);const se=this.width%2/2,G=this.height%2/2,ee=Math.cos(this.angle),le=Math.sin(this.angle),ce=n-Math.round(n)+ee*se+le*G,me=s-Math.round(s)+ee*G+le*se,xe=new Float64Array(c);if(l.$(xe,xe,[ce>.5?ce-1:ce,me>.5?me-1:me,0]),this.alignedProjMatrix=xe,c=l.as(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new l.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return l.ag(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let s=n.x,c=n.y,h=n.x,g=n.y;for(const _ of t)s=Math.min(s,_.x),c=Math.min(c,_.y),h=Math.max(h,_.x),g=Math.max(g,_.y);return[new l.P(s,c),new l.P(h,c),new l.P(h,g),new l.P(s,g),new l.P(s,c)]}}}function vn(u,t){let n,s=!1,c=null,h=null;const g=()=>{c=null,s&&(u.apply(h,n),c=setTimeout(g,t),s=!1)};return(..._)=>(s=!0,h=this,n=_,c||g(),c)}class xa{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map((c=>c.split("="))).forEach((c=>{c[0]===this._hashName&&(s=c)})),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some((s=>isNaN(s)))){const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:s,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=vn(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 n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,c=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),h=Math.pow(10,c),g=Math.round(n.lng*h)/h,_=Math.round(n.lat*h)/h,x=this._map.getBearing(),b=this._map.getPitch();let S="";if(S+=t?`/${g}/${_}/${s}`:`${s}/${_}/${g}`,(x||b)&&(S+="/"+Math.round(10*x)/10),b&&(S+=`/${Math.round(b)}`),this._hashName){const T=this._hashName;let M=!1;const N=window.location.hash.slice(1).split("&").map((O=>{const $=O.split("=")[0];return $===T?(M=!0,`${$}=${S}`):O})).filter((O=>O));return M||N.push(`${T}=${S}`),`#${N.join("&")}`}return`#${S}`}}const Hn={linearity:.3,easing:l.ba(0,0,.3,1)},cl=l.e({deceleration:2500,maxSpeed:1400},Hn),ul=l.e({deceleration:20,maxSpeed:1400},Hn),hl=l.e({deceleration:1e3,maxSpeed:360},Hn),pl=l.e({deceleration:1e3,maxSpeed:90},Hn);class dl{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=l.h.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new l.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)n.zoom+=h.zoomDelta||0,n.bearing+=h.bearingDelta||0,n.pitch+=h.pitchDelta||0,h.panDelta&&n.pan._add(h.panDelta),h.around&&(n.around=h.around),h.pinchAround&&(n.pinchAround=h.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const h=va(n.pan.mag(),s,l.e({},cl,t||{}));c.offset=n.pan.mult(h.amount/n.pan.mag()),c.center=this._map.transform.center,br(c,h)}if(n.zoom){const h=va(n.zoom,s,ul);c.zoom=this._map.transform.zoom+h.amount,br(c,h)}if(n.bearing){const h=va(n.bearing,s,hl);c.bearing=this._map.transform.bearing+l.ad(h.amount,-179,179),br(c,h)}if(n.pitch){const h=va(n.pitch,s,pl);c.pitch=this._map.transform.pitch+h.amount,br(c,h)}if(c.zoom||c.bearing){const h=n.pinchAround===void 0?n.around:n.pinchAround;c.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),l.e(c,{noMoveStart:!0})}}function br(u,t){(!u.duration||u.durationn.unproject(x))),_=h.reduce(((x,b,S,T)=>x.add(b.div(T.length))),new l.P(0,0));super(t,{points:h,point:_,lngLats:g,lngLat:n.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class fl extends l.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s){super(t,{originalEvent:s}),this._defaultPrevented=!1}}class ml{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new fl(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new qi(t.type,this._map,t))}mouseup(t){this._map.fire(new qi(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new qi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new qi(t.type,this._map,t))}mouseover(t){this._map.fire(new qi(t.type,this._map,t))}mouseout(t){this._map.fire(new qi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ba(t.type,this._map,t))}touchmove(t){this._map.fire(new ba(t.type,this._map,t))}touchend(t){this._map.fire(new ba(t.type,this._map,t))}touchcancel(t){this._map.fire(new ba(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class gl{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new qi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new qi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new qi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class tn{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(l.P.convert(t),this._map.terrain)}}class _l{constructor(t,n){this._map=t,this._tr=new tn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(X.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)h.fitScreenCoordinates(s,c,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&&(X.remove(this._box),this._box=null),X.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new l.k(t,{originalEvent:n}))}}function sr(u,t){if(u.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${t.length}`);const n={};for(let s=0;sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),s.length===this.numTouches&&(this.centroid=(function(c){const h=new l.P(0,0);for(const g of c)h._add(g);return h.div(c.length)})(n),this.touches=sr(s,n)))}touchmove(t,n,s){if(this.aborted||!this.centroid)return;const c=sr(s,n);for(const h in this.touches){const g=c[h];(!g||g.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(t,n,s){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class cs{constructor(t){this.singleTap=new Fr(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,s){this.singleTap.touchstart(t,n,s)}touchmove(t,n,s){this.singleTap.touchmove(t,n,s)}touchend(t,n,s){const c=this.singleTap.touchend(t,n,s);if(c){const h=t.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(c)<30;if(h&&g||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class Rr{constructor(t){this._tr=new tn(t),this._zoomIn=new cs({numTouches:1,numTaps:2}),this._zoomOut=new cs({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,s){this._zoomIn.touchstart(t,n,s),this._zoomOut.touchstart(t,n,s)}touchmove(t,n,s){this._zoomIn.touchmove(t,n,s),this._zoomOut.touchmove(t,n,s)}touchend(t,n,s){const c=this._zoomIn.touchend(t,n,s),h=this._zoomOut.touchend(t,n,s),g=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:g.zoom+1,around:g.unproject(c)},{originalEvent:t})}):h?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:g.zoom-1,around:g.unproject(h)},{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 Br{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 n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=n.length?n[0]:n;return!this._moved&&c.dist(s){u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=function(t){t.preventDefault()}},Wn=({enable:u,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const s=new Qs({checkCorrectEvent:c=>X.mouseButton(c)===0&&c.ctrlKey||X.mouseButton(c)===2});return new Br({clickTolerance:t,move:(c,h)=>({bearingDelta:(h.x-c.x)*n}),moveStateManager:s,enable:u,assignEvents:us})},Or=({enable:u,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const s=new Qs({checkCorrectEvent:c=>X.mouseButton(c)===0&&c.ctrlKey||X.mouseButton(c)===2});return new Br({clickTolerance:t,move:(c,h)=>({pitchDelta:(h.y-c.y)*n}),moveStateManager:s,enable:u,assignEvents:us})};class ze{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new l.P(0,0),setTimeout((()=>{this._cancelCooperativeMessage=!1}),200)}touchstart(t,n,s){return this._calculateTransform(t,n,s)}touchmove(t,n,s){if(this._map._cooperativeGestures&&(this._minTouches===2&&s.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,s.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(s.length0&&(this._active=!0);const c=sr(s,n),h=new l.P(0,0),g=new l.P(0,0);let _=0;for(const b in c){const S=c[b],T=this._touches[b];T&&(h._add(S),g._add(S.sub(T)),_++,c[b]=S)}if(this._touches=c,_Math.abs(u.x)}class Ic extends hs{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,s){super.touchstart(t,n,s),this._currentTouchCount=s.length}_start(t){this._lastPoints=t,to(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,s){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),h=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,h,s.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,s){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,h=n.mag()>=2;if(!c&&!h)return;if(!c||!h)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const g=t.y>0==n.y>0;return to(t)&&to(n)&&g}}const io={panStep:100,bearingStep:15,pitchStep:10};class vl{constructor(t){this._tr=new tn(t);const n=io;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,s=0,c=0,h=0,g=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?s=-1:(t.preventDefault(),h=-1);break;case 39:t.shiftKey?s=1:(t.preventDefault(),h=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),g=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(s=0,c=0),{cameraAnimation:_=>{const x=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:bl,zoom:n?Math.round(x.zoom)+n*(t.shiftKey?2:1):x.zoom,bearing:x.bearing+s*this._bearingStep,pitch:x.pitch+c*this._pitchStep,offset:[-h*this._panStep,-g*this._panStep],center:x.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 bl(u){return u*(2-u)}const wl=4.000244140625;class Ac{constructor(t,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=t,this._tr=new tn(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=n,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 n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const s=l.h.now(),c=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,n!==0&&n%wl==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,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 n=X.mousePos(this._el,t),s=this._tr;this._around=l.L.convert(this._aroundCenter?s.center:s.unproject(n)),this._aroundPoint=s.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 _=this._type==="wheel"&&Math.abs(this._delta)>wl?this._wheelZoomRate:this._defaultZoomRate;let x=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&x!==0&&(x=1/x);const b=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(b*x))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,s=this._startZoom,c=this._easing;let h,g=!1;if(this._type==="wheel"&&s&&c){const _=Math.min((l.h.now()-this._lastWheelEventTime)/200,1),x=c(_);h=l.B.number(s,n,x),_<1?this._frameId||(this._frameId=!0):g=!0}else h=n,g=!0;return this._active=!0,g&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!g,zoomDelta:h-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=l.bb;if(this._prevEase){const s=this._prevEase,c=(l.h.now()-s.start)/s.duration,h=s.easing(c+.01)-s.easing(c),g=.27/Math.sqrt(h*h+1e-4)*.01,_=Math.sqrt(.0729-g*g);n=l.ba(g,_,.25,1)}return this._prevEase={start:l.h.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class ro{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 no{constructor(t){this._tr=new tn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ao{constructor(){this._tap=new cs({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,n,s){if(!this._swipePoint)if(this._tapTime){const c=n[0],h=t.timeStamp-this._tapTime<500,g=this._tapPoint.dist(c)<30;h&&g?s.length>0&&(this._swipePoint=c,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(t,n,s)}touchmove(t,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const c=n[0],h=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(t,n,s)}touchend(t,n,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const c=this._tap.touchend(t,n,s);c&&(this._tapTime=t.timeStamp,this._tapPoint=c)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class so{constructor(t,n,s){this._el=t,this._mousePan=n,this._touchPan=s}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 zi{constructor(t,n,s){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=s}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 nn{constructor(t,n,s,c){this._el=t,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=c,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 wa=u=>u.zoom||u.drag||u.pitch||u.rotate;class oo extends l.k{}function Sa(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class lo{constructor(t,n){this.handleWindowEvent=c=>{this.handleEvent(c,`${c.type}Window`)},this.handleEvent=(c,h)=>{if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const g=c.type==="renderFrame"?void 0:c,_={needsRenderFrame:!1},x={},b={},S=c.touches,T=S?this._getMapTouches(S):void 0,M=T?X.touchPos(this._el,T):X.mousePos(this._el,c);for(const{handlerName:$,handler:R,allowed:Q}of this._handlers){if(!R.isEnabled())continue;let se;this._blockedByActive(b,Q,$)?R.reset():R[h||c.type]&&(se=R[h||c.type](c,M,T),this.mergeHandlerResult(_,x,se,$,g),se&&se.needsRenderFrame&&this._triggerRenderFrame()),(se||R.isActive())&&(b[$]=R)}const N={};for(const $ in this._previousActiveHandlers)b[$]||(N[$]=g);this._previousActiveHandlers=b,(Object.keys(N).length||Sa(_))&&(this._changes.push([_,x,N]),this._triggerRenderFrame()),(Object.keys(b).length||Sa(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:O}=_;O&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],O(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new dl(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,h,g]of this._listeners)X.addEventListener(c,h,c===document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[t,n,s]of this._listeners)X.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(t){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new ml(n,t));const c=n.boxZoom=new _l(n,t);this._add("boxZoom",c),t.interactive&&t.boxZoom&&c.enable();const h=new Rr(n),g=new no(n);n.doubleClickZoom=new ro(g,h),this._add("tapZoom",h),this._add("clickZoom",g),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const _=new ao;this._add("tapDragZoom",_);const x=n.touchPitch=new Ic(n);this._add("touchPitch",x),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const b=Wn(t),S=Or(t);n.dragRotate=new zi(t,b,S),this._add("mouseRotate",b,["mousePitch"]),this._add("mousePitch",S,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const T=(({enable:Q,clickTolerance:se})=>{const G=new Qs({checkCorrectEvent:ee=>X.mouseButton(ee)===0&&!ee.ctrlKey});return new Br({clickTolerance:se,move:(ee,le)=>({around:le,panDelta:le.sub(ee)}),activateOnStart:!0,moveStateManager:G,enable:Q,assignEvents:us})})(t),M=new ze(t,n);n.dragPan=new so(s,T,M),this._add("mousePan",T),this._add("touchPan",M,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const N=new eo,O=new xl;n.touchZoomRotate=new nn(s,O,N,_),this._add("touchRotate",N,["touchPan","touchZoom"]),this._add("touchZoom",O,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const $=n.scrollZoom=new Ac(n,(()=>this._triggerRenderFrame()));this._add("scrollZoom",$,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const R=n.keyboard=new vl(n);this._add("keyboard",R),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new gl(n))}_add(t,n,s){this._handlers.push({handlerName:t,handler:n,allowed:s}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.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!!wa(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,s){for(const c in t)if(c!==s&&(!n||n.indexOf(c)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const s of t)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(t,n,s,c,h){if(!s)return;l.e(t,s);const g={handlerName:c,originalEvent:s.originalEvent||h};s.zoomDelta!==void 0&&(n.zoom=g),s.panDelta!==void 0&&(n.drag=g),s.pitchDelta!==void 0&&(n.pitch=g),s.bearingDelta!==void 0&&(n.rotate=g)}_applyChanges(){const t={},n={},s={};for(const[c,h,g]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new l.P(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),l.e(n,h),l.e(s,g);this._updateMapTransform(t,n,s),this._changes=[]}_updateMapTransform(t,n,s){const c=this._map,h=c._getTransformForUpdate(),g=c.terrain;if(!(Sa(t)||g&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:_,zoomDelta:x,bearingDelta:b,pitchDelta:S,around:T,pinchAround:M}=t;M!==void 0&&(T=M),c._stop(!0),T=T||c.transform.centerPoint;const N=h.pointLocation(_?T.sub(_):T);b&&(h.bearing+=b),S&&(h.pitch+=S),x&&(h.zoom+=x),g?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?h.center=h.pointLocation(h.centerPoint.sub(_)):h.setLocationAtPoint(N,T):(this._terrainMovement=!0,this._map._elevationFreeze=!0,h.setLocationAtPoint(N,T),this._map.once("moveend",(()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,h.recalculateZoom(c.terrain)}))):h.setLocationAtPoint(N,T),c._applyUpdatedTransform(h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,s,!0)}_fireEvents(t,n,s){const c=wa(this._eventsInProgress),h=wa(t),g={};for(const S in t){const{originalEvent:T}=t[S];this._eventsInProgress[S]||(g[`${S}start`]=T),this._eventsInProgress[S]=t[S]}!c&&h&&this._fireEvent("movestart",h.originalEvent);for(const S in g)this._fireEvent(S,g[S]);h&&this._fireEvent("move",h.originalEvent);for(const S in t){const{originalEvent:T}=t[S];this._fireEvent(S,T)}const _={};let x;for(const S in this._eventsInProgress){const{handlerName:T,originalEvent:M}=this._eventsInProgress[S];this._handlersById[T].isActive()||(delete this._eventsInProgress[S],x=n[T]||M,_[`${S}end`]=x)}for(const S in _)this._fireEvent(S,_[S]);const b=wa(this._eventsInProgress);if(s&&(c||h)&&!b){this._updatingCamera=!0;const S=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),T=M=>M!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new oo("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Sl extends l.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const s=Math.min((l.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new l.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,s){return t=l.P.convert(t).mult(-1),this.panTo(this.transform.center,l.e({offset:t},n),s)}panTo(t,n,s){return this.easeTo(l.e({center:t},n),s)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,s){return this.easeTo(l.e({zoom:t},n),s)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,s){return this.easeTo(l.e({bearing:t},n),s)}resetNorth(t,n){return this.rotateTo(0,l.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(l.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(s.zoom=l.B.number(c,x,ce)),this._rotating&&(s.bearing=l.B.number(h,b,ce)),this._pitching&&(s.pitch=l.B.number(g,S,ce)),this._padding&&(s.interpolatePadding(_,T,ce),N=s.centerPoint.add(M)),this.terrain&&!t.freezeElevation&&this._updateElevation(ce),G)s.setLocationAtPoint(G,ee);else{const me=s.zoomScale(s.zoom-c),xe=x>c?Math.min(2,se):Math.max(.5,se),ye=Math.pow(xe,1-ce),be=s.unproject(R.add(Q.mult(ce*ye)).mult(me));s.setLocationAtPoint(s.renderWorldCopies?be.wrap():be,N)}this._applyUpdatedTransform(s),this._fireMoveEvents(n)}),(ce=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,ce)}),t),this}_prepareEase(t,n,s={}){this._moving=!0,n||s.moving||this.fire(new l.k("movestart",t)),this._zooming&&!s.zooming&&this.fire(new l.k("zoomstart",t)),this._rotating&&!s.rotating&&this.fire(new l.k("rotatestart",t)),this._pitching&&!s.pitching&&this.fire(new l.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 n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(s-(n-(s*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=l.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 n=t.clone(),{center:s,zoom:c,pitch:h,bearing:g,elevation:_}=this.transformCameraUpdate(n);s&&(n.center=s),c!==void 0&&(n.zoom=c),h!==void 0&&(n.pitch=h),g!==void 0&&(n.bearing=g),_!==void 0&&(n.elevation=_),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new l.k("move",t)),this._zooming&&this.fire(new l.k("zoom",t)),this._rotating&&this.fire(new l.k("rotate",t)),this._pitching&&this.fire(new l.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,c=this._rotating,h=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new l.k("zoomend",t)),c&&this.fire(new l.k("rotateend",t)),h&&this.fire(new l.k("pitchend",t)),this.fire(new l.k("moveend",t))}flyTo(t,n){if(!t.essential&&l.h.prefersReducedMotion){const Ne=l.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ne,n)}this.stop(),t=l.e({offset:[0,0],speed:1.2,curve:1.42,easing:l.bb},t);const s=this._getTransformForUpdate(),c=this.getZoom(),h=this.getBearing(),g=this.getPitch(),_=this.getPadding(),x="zoom"in t?l.ad(+t.zoom,s.minZoom,s.maxZoom):c,b="bearing"in t?this._normalizeBearing(t.bearing,h):h,S="pitch"in t?+t.pitch:g,T="padding"in t?t.padding:s.padding,M=s.zoomScale(x-c),N=l.P.convert(t.offset);let O=s.centerPoint.add(N);const $=s.pointLocation(O),R=l.L.convert(t.center||$);this._normalizeCenter(R);const Q=s.project($),se=s.project(R).sub(Q);let G=t.curve;const ee=Math.max(s.width,s.height),le=ee/M,ce=se.mag();if("minZoom"in t){const Ne=l.ad(Math.min(t.minZoom,c,x),s.minZoom,s.maxZoom),vt=ee/s.zoomScale(Ne-c);G=Math.sqrt(vt/ce*2)}const me=G*G;function xe(Ne){const vt=(le*le-ee*ee+(Ne?-1:1)*me*me*ce*ce)/(2*(Ne?le:ee)*me*ce);return Math.log(Math.sqrt(vt*vt+1)-vt)}function ye(Ne){return(Math.exp(Ne)-Math.exp(-Ne))/2}function be(Ne){return(Math.exp(Ne)+Math.exp(-Ne))/2}const Be=xe(!1);let at=function(Ne){return be(Be)/be(Be+G*Ne)},Ce=function(Ne){return ee*((be(Be)*(ye(vt=Be+G*Ne)/be(vt))-ye(Be))/me)/ce;var vt},He=(xe(!0)-Be)/G;if(Math.abs(ce)<1e-6||!isFinite(He)){if(Math.abs(ee-le)<1e-6)return this.easeTo(t,n);const Ne=let.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=h!==b,this._pitching=S!==g,this._padding=!s.isPaddingEqual(T),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(R),this._ease((Ne=>{const vt=Ne*He,nt=1/at(vt);s.zoom=Ne===1?x:c+s.scaleZoom(nt),this._rotating&&(s.bearing=l.B.number(h,b,Ne)),this._pitching&&(s.pitch=l.B.number(g,S,Ne)),this._padding&&(s.interpolatePadding(_,T,Ne),O=s.centerPoint.add(N)),this.terrain&&!t.freezeElevation&&this._updateElevation(Ne);const tt=Ne===1?R:s.unproject(Q.add(se.mult(Ce(vt))).mult(nt));s.setLocationAtPoint(s.renderWorldCopies?tt.wrap():tt,O),this._applyUpdatedTransform(s),this._fireMoveEvents(n)}),(()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const s=this._onEaseEnd;delete this._onEaseEnd,s.call(this,n)}if(!t){const s=this.handlers;s&&s.stop(!1)}return this}_ease(t,n,s){s.animate===!1||s.duration===0?(t(1),n()):(this._easeStart=l.h.now(),this._easeOptions=s,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=l.b5(t,-180,180);const s=Math.abs(t-n);return Math.abs(t-360-n)180?-360:s<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(l.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Zi{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=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.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=X.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=X.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=X.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(){X.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,n){const s=this._map._getUIString(`AttributionControl.${n}`);t.title=s,t.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((c=>typeof c!="string"?"":c))):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const h=n[c];if(h.used||h.usedForTerrain){const g=h.getSource();g.attribution&&t.indexOf(g.attribution)<0&&t.push(g.attribution)}}t=t.filter((c=>String(c).trim())),t.sort(((c,h)=>c.length-h.length)),t=t.filter(((c,h)=>{for(let g=h+1;g=0)return!1;return!0}));const s=t.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ct{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.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=X.create("div","maplibregl-ctrl");const n=X.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){X.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ps{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(const c of s)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const co={"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 Tl=l.Q([{name:"a_pos3d",type:"Int16",components:3}]);class Il extends l.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,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const s={};for(const c of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))s[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.posMatrix=new Float64Array(16),l.aS(c.posMatrix,0,l.N,0,l.N,0,1),this._tiles[c.key]=new Xr(c,this.tileSize));for(const c in this._tiles)s[c]||delete this._tiles[c]}freeRtt(t){for(const n in this._tiles){const s=this._tiles[n];(!t||s.tileID.equals(t)||s.tileID.isChildOf(t)||t.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const s of this._renderableTilesKeys){const c=this._tiles[s].tileID;if(c.canonical.equals(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16),l.aS(h.posMatrix,0,l.N,0,l.N,0,1),n[s]=h}else if(c.canonical.isChildOf(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const g=c.canonical.z-t.canonical.z,_=c.canonical.x-(c.canonical.x>>g<>g<>g;l.aS(h.posMatrix,0,b,0,b,0,1),l.$(h.posMatrix,h.posMatrix,[-_*b,-x*b,0]),n[s]=h}else if(t.canonical.isChildOf(c.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const g=t.canonical.z-c.canonical.z,_=t.canonical.x-(t.canonical.x>>g<>g<>g;l.aS(h.posMatrix,0,l.N,0,l.N,0,1),l.$(h.posMatrix,h.posMatrix,[_*b,x*b,0]),l.a0(h.posMatrix,h.posMatrix,[1/2**g,1/2**g,0]),n[s]=h}}return n}getSourceTile(t,n){const s=this.sourceCache._source;let c=t.overscaledZ-this.deltaZoom;if(c>s.maxzoom&&(c=s.maxzoom),c=s.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(t.scaledTo(c--).key);return h}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter((n=>n.timeAdded>=t))}}class Al{constructor(t,n,s){this.painter=t,this.sourceCache=new Il(n),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,s,c=l.N){var h;if(!(n>=0&&n=0&&st.canonical.z&&(t.canonical.z>=c?h=t.canonical.z-c:l.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const g=t.canonical.x-(t.canonical.x>>h<>h<>8<<4|h>>8,n[g+3]=0;const s=new l.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new zt(t,s,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){const n=new Uint8Array(4),s=this.painter.context,c=s.gl;s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);const h=n[0]+(n[2]>>4<<8),g=n[1]+((15&n[2])<<8),_=this.coordsIndex[255-n[3]],x=_&&this.sourceCache.getTileByID(_);if(!x)return null;const b=this._coordsTextureSize,S=(1<0&&Math.sign(h)<0||!s&&Math.sign(c)<0&&Math.sign(h)>0?(c=360*Math.sign(h)+c,l.G(c)):n}}class Cc{constructor(t,n,s){this._context=t,this._size=n,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new zt(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(s.texture),{id:t,fbo:n,texture:s,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((n=>t.id!==n)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];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 wi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ds{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Cc(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((s=>!t._layers[s].isHidden(n))),this._coordsDescendingInv={};for(const s in t.sourceCaches){this._coordsDescendingInv[s]={};const c=t.sourceCaches[s].getVisibleCoordinates();for(const h of c){const g=this.terrain.sourceCache.getTerrainCoords(h);for(const _ in g)this._coordsDescendingInv[s][_]||(this._coordsDescendingInv[s][_]=[]),this._coordsDescendingInv[s][_].push(g[_])}}this._coordsDescendingInvStr={};for(const s of t._order){const c=t._layers[s],h=c.source;if(wi[c.type]&&!this._coordsDescendingInvStr[h]){this._coordsDescendingInvStr[h]={};for(const g in this._coordsDescendingInv[h])this._coordsDescendingInvStr[h][g]=this._coordsDescendingInv[h][g].map((_=>_.key)).sort().join()}}for(const s of this._renderableTiles)for(const c in this._coordsDescendingInvStr){const h=this._coordsDescendingInvStr[c][s.tileID.key];h&&h!==s.rttCoords[c]&&(s.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,s=this.painter,c=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(wi[n]&&(this._prevType&&wi[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!c))return!0;if(wi[this._prevType]||wi[n]&&c){this._prevType=n;const h=this._stacks.length-1,g=this._stacks[h]||[];for(const _ of this._renderableTiles){if(this.pool.isFull()&&(Nt(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(_),_.rtt[h]){const b=this.pool.getObjectForId(_.rtt[h].id);if(b.stamp===_.rtt[h].stamp){this.pool.useObject(b);continue}}const x=this.pool.getOrCreateFreeObject();this.pool.useObject(x),this.pool.stampObject(x),_.rtt[h]={id:x.id,stamp:x.stamp},s.context.bindFramebuffer.set(x.fbo.framebuffer),s.context.clear({color:l.aT.transparent,stencil:0}),s.currentStencilSource=void 0;for(let b=0;b{u.touchstart=u.dragStart,u.touchmoveWindow=u.dragMove,u.touchend=u.dragEnd},uo={showCompass:!0,showZoom:!0,visualizePitch:!1};class ho{constructor(t,n,s=!1){this.mousedown=g=>{this.startMouse(l.e({},g,{ctrlKey:!0,preventDefault:()=>g.preventDefault()}),X.mousePos(this.element,g)),X.addEventListener(window,"mousemove",this.mousemove),X.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=g=>{this.moveMouse(g,X.mousePos(this.element,g))},this.mouseup=g=>{this.mouseRotate.dragEnd(g),this.mousePitch&&this.mousePitch.dragEnd(g),this.offTemp()},this.touchstart=g=>{g.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=X.touchPos(this.element,g.targetTouches)[0],this.startTouch(g,this._startPos),X.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.addEventListener(window,"touchend",this.touchend))},this.touchmove=g=>{g.targetTouches.length!==1?this.reset():(this._lastPos=X.touchPos(this.element,g.targetTouches)[0],this.moveTouch(g,this._lastPos))},this.touchend=g=>{g.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 c=t.dragRotate._mouseRotate.getClickTolerance(),h=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Wn({clickTolerance:c,enable:!0}),this.touchRotate=(({enable:g,clickTolerance:_,bearingDegreesPerPixelMoved:x=.8})=>{const b=new yl;return new Br({clickTolerance:_,move:(S,T)=>({bearingDelta:(T.x-S.x)*x}),moveStateManager:b,enable:g,assignEvents:Ta})})({clickTolerance:c,enable:!0}),this.map=t,s&&(this.mousePitch=Or({clickTolerance:h,enable:!0}),this.touchPitch=(({enable:g,clickTolerance:_,pitchDegreesPerPixelMoved:x=-.5})=>{const b=new yl;return new Br({clickTolerance:_,move:(S,T)=>({pitchDelta:(T.y-S.y)*x}),moveStateManager:b,enable:g,assignEvents:Ta})})({clickTolerance:h,enable:!0})),X.addEventListener(n,"mousedown",this.mousedown),X.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),X.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),X.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),X.disableDrag()}moveMouse(t,n){const s=this.map,{bearingDelta:c}=this.mouseRotate.dragMove(t,n)||{};if(c&&s.setBearing(s.getBearing()+c),this.mousePitch){const{pitchDelta:h}=this.mousePitch.dragMove(t,n)||{};h&&s.setPitch(s.getPitch()+h)}}moveTouch(t,n){const s=this.map,{bearingDelta:c}=this.touchRotate.dragMove(t,n)||{};if(c&&s.setBearing(s.getBearing()+c),this.touchPitch){const{pitchDelta:h}=this.touchPitch.dragMove(t,n)||{};h&&s.setPitch(s.getPitch()+h)}}off(){const t=this.element;X.removeEventListener(t,"mousedown",this.mousedown),X.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend),X.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){X.enableDrag(),X.removeEventListener(window,"mousemove",this.mousemove),X.removeEventListener(window,"mouseup",this.mouseup),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend)}}let Zt;function po(u,t,n){if(u=new l.L(u.lng,u.lat),t){const s=new l.L(u.lng-360,u.lat),c=new l.L(u.lng+360,u.lat),h=n.locationPoint(u).distSqr(t);n.locationPoint(s).distSqr(t)180;){const s=n.locationPoint(u);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;u.lng>n.center.lng?u.lng-=360:u.lng+=360}return u}const or={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 Cl(u,t,n){const s=u.classList;for(const c in or)s.remove(`maplibregl-${n}-anchor-${c}`);s.add(`maplibregl-${n}-anchor-${t}`)}class bn extends l.E{constructor(t){if(super(),this._onKeyPress=n=>{const s=n.code,c=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&c!==32&&c!==13||this.togglePopup()},this._onMapClick=n=>{const s=n.originalEvent.target,c=this._element;this._popup&&(s===c||c.contains(s))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const s=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!s)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=po(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let h="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?h="rotateX(0deg)":this._pitchAlignment==="map"&&(h=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),X.setTransform(this._element,`${or[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${h} ${c}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout((()=>{const g=this._map.unproject(this._pos),_=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=g.distanceTo(this._lngLat)>20*_?"0.2":"1.0",this._opacityTimeout=null}),100))},this._onMove=n=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.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 l.k("dragstart"))),this.fire(new l.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 l.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.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=l.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=X.create("div"),this._element.setAttribute("aria-label","Map marker");const n=X.createNS("http://www.w3.org/2000/svg","svg"),s=41,c=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${s}px`),n.setAttributeNS(null,"width",`${c}px`),n.setAttributeNS(null,"viewBox",`0 0 ${c} ${s}`);const h=X.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const g=X.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"fill-rule","nonzero");const _=X.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const x=[{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 Q of x){const se=X.createNS("http://www.w3.org/2000/svg","ellipse");se.setAttributeNS(null,"opacity","0.04"),se.setAttributeNS(null,"cx","10.5"),se.setAttributeNS(null,"cy","5.80029008"),se.setAttributeNS(null,"rx",Q.rx),se.setAttributeNS(null,"ry",Q.ry),_.appendChild(se)}const b=X.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"fill",this._color);const S=X.createNS("http://www.w3.org/2000/svg","path");S.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"),b.appendChild(S);const T=X.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"opacity","0.25"),T.setAttributeNS(null,"fill","#000000");const M=X.createNS("http://www.w3.org/2000/svg","path");M.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"),T.appendChild(M);const N=X.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"transform","translate(6.0, 7.0)"),N.setAttributeNS(null,"fill","#FFFFFF");const O=X.createNS("http://www.w3.org/2000/svg","g");O.setAttributeNS(null,"transform","translate(8.0, 8.0)");const $=X.createNS("http://www.w3.org/2000/svg","circle");$.setAttributeNS(null,"fill","#000000"),$.setAttributeNS(null,"opacity","0.25"),$.setAttributeNS(null,"cx","5.5"),$.setAttributeNS(null,"cy","5.5"),$.setAttributeNS(null,"r","5.4999962");const R=X.createNS("http://www.w3.org/2000/svg","circle");R.setAttributeNS(null,"fill","#FFFFFF"),R.setAttributeNS(null,"cx","5.5"),R.setAttributeNS(null,"cy","5.5"),R.setAttributeNS(null,"r","5.4999962"),O.appendChild($),O.appendChild(R),g.appendChild(_),g.appendChild(b),g.appendChild(T),g.appendChild(N),g.appendChild(O),n.appendChild(g),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",c*this._scale+"px"),this._element.appendChild(n),this._offset=l.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(n=>{n.preventDefault()})),this._element.addEventListener("mousedown",(n=>{n.preventDefault()})),Cl(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);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),X.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=l.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 c=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":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],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=l.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 Vt={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Rt=0,Kn=!1;const Ia={maxWidth:100,unit:"metric"};function Aa(u,t,n){const s=n&&n.maxWidth||100,c=u._container.clientHeight/2,h=u.unproject([0,c]),g=u.unproject([s,c]),_=h.distanceTo(g);if(n&&n.unit==="imperial"){const x=3.2808*_;x>5280?wn(t,s,x/5280,u._getUIString("ScaleControl.Miles")):wn(t,s,x,u._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?wn(t,s,_/1852,u._getUIString("ScaleControl.NauticalMiles")):_>=1e3?wn(t,s,_/1e3,u._getUIString("ScaleControl.Kilometers")):wn(t,s,_,u._getUIString("ScaleControl.Meters"))}function wn(u,t,n,s){const c=(function(h){const g=Math.pow(10,`${Math.floor(h)}`.length-1);let _=h/g;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:(function(x){const b=Math.pow(10,Math.ceil(-Math.log(x)/Math.LN10));return Math.round(x*b)/b})(_),g*_})(n);u.style.width=t*(c/n)+"px",u.innerHTML=`${c} ${s}`}const fo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},mo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Yn(u){if(u){if(typeof u=="number"){const t=Math.round(Math.abs(u)/Math.SQRT2);return{center:new l.P(0,0),top:new l.P(0,u),"top-left":new l.P(t,t),"top-right":new l.P(-t,t),bottom:new l.P(0,-u),"bottom-left":new l.P(t,-t),"bottom-right":new l.P(-t,-t),left:new l.P(u,0),right:new l.P(-u,0)}}if(u instanceof l.P||Array.isArray(u)){const t=l.P.convert(u);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:l.P.convert(u.center||[0,0]),top:l.P.convert(u.top||[0,0]),"top-left":l.P.convert(u["top-left"]||[0,0]),"top-right":l.P.convert(u["top-right"]||[0,0]),bottom:l.P.convert(u.bottom||[0,0]),"bottom-left":l.P.convert(u["bottom-left"]||[0,0]),"bottom-right":l.P.convert(u["bottom-right"]||[0,0]),left:l.P.convert(u.left||[0,0]),right:l.P.convert(u.right||[0,0])}}return Yn(new l.P(0,0))}const go={extend:(u,...t)=>l.e(u,...t),run(u){u()},logToElement(u,t=!1,n="log"){const s=window.document.getElementById(n);s&&(t&&(s.innerHTML=""),s.innerHTML+=`
${u}`)}},_o=ue;class _t{static get version(){return _o}static get workerCount(){return yr.workerCount}static set workerCount(t){yr.workerCount=t}static get maxParallelImageRequests(){return l.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){l.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return l.c.WORKER_URL}static set workerUrl(t){l.c.WORKER_URL=t}static addProtocol(t,n){l.c.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete l.c.REGISTERED_PROTOCOLS[t]}}return _t.Map=class extends Sl{constructor(u){if(l.bg.mark(l.bh.create),(u=l.e({},Ge,u)).minZoom!=null&&u.maxZoom!=null&&u.minZoom>u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(u.minPitch!=null&&u.maxPitch!=null&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(u.minPitch!=null&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(u.maxPitch!=null&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ls(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.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 l.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new l.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=u.interactive,this._cooperativeGestures=u.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=u.preserveDrawingBuffer,this._antialias=u.antialias,this._trackResize=u.trackResize,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles,this._fadeDuration=u.fadeDuration,this._crossSourceCollisions=u.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=u.collectResourceTiming,this._renderTaskQueue=new ps,this._controls=[],this._mapId=l.a2(),this._locale=l.e({},co,u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this._imageQueueHandle=Qe.addThrottleControl((()=>this.isMoving())),this._requestManager=new $e(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.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 n=vn((s=>{this._trackResize&&!this._removed&&this.resize(s)._update()}),50);this._resizeObserver=new ResizeObserver((s=>{t?n(s):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new lo(this,u),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=u.hash&&new xa(typeof u.hash=="string"&&u.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,l.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new Zi({customAttribution:u.customAttribution})),u.maplibreLogo&&this.addControl(new Ct,u.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 l.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new l.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new l.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(u,t){if(t===void 0&&(t=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new l.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=u.onAdd(this);this._controls.push(u);const s=this._controlPositions[t];return t.indexOf("bottom")!==-1?s.insertBefore(n,s.firstChild):s.appendChild(n),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new l.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(u);return t>-1&&this._controls.splice(t,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}calculateCameraOptionsFromTo(u,t,n,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,t,n,s)}resize(u){var t;const n=this._containerDimensions(),s=n[0],c=n[1],h=this._getClampedPixelRatio(s,c);if(this._resizeCanvas(s,c,h),this.painter.resize(s,c,h),this.painter.overLimit()){const _=this.painter.context.gl;this._maxCanvasSize=[_.drawingBufferWidth,_.drawingBufferHeight];const x=this._getClampedPixelRatio(s,c);this._resizeCanvas(s,c,x),this.painter.resize(s,c,x)}this.transform.resize(s,c),(t=this._requestedCameraState)===null||t===void 0||t.resize(s,c);const g=!this._moving;return g&&(this.stop(),this.fire(new l.k("movestart",u)).fire(new l.k("move",u))),this.fire(new l.k("resize",u)),g&&this.fire(new l.k("moveend",u)),this}_getClampedPixelRatio(u,t){const{0:n,1:s}=this._maxCanvasSize,c=this.getPixelRatio(),h=u*c,g=t*c;return Math.min(h>n?n/h:1,g>s?s/g:1)*c}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(At.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.minZoom=u,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=u,this._update(),this.getZoom()>u&&this.setZoom(u),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.minPitch=u,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(u>=this.transform.minPitch)return this.transform.maxPitch=u,this._update(),this.getPitch()>u&&this.setPitch(u),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(u){return this._cooperativeGestures=u,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(u){return this.transform.locationPoint(l.L.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.pointLocation(l.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}_createDelegatedListener(u,t,n){if(u==="mouseenter"||u==="mouseover"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:h=>{const g=this.getLayer(t)?this.queryRenderedFeatures(h.point,{layers:[t]}):[];g.length?s||(s=!0,n.call(this,new qi(u,this,h.originalEvent,{features:g}))):s=!1},mouseout:()=>{s=!1}}}}if(u==="mouseleave"||u==="mouseout"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:g=>{(this.getLayer(t)?this.queryRenderedFeatures(g.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,n.call(this,new qi(u,this,g.originalEvent)))},mouseout:g=>{s&&(s=!1,n.call(this,new qi(u,this,g.originalEvent)))}}}}{const s=c=>{const h=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];h.length&&(c.features=h,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[u]:s}}}}on(u,t,n){if(n===void 0)return super.on(u,t);const s=this._createDelegatedListener(u,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(s);for(const c in s.delegates)this.on(c,s.delegates[c]);return this}once(u,t,n){if(n===void 0)return super.once(u,t);const s=this._createDelegatedListener(u,t,n);for(const c in s.delegates)this.once(c,s.delegates[c]);return this}off(u,t,n){return n===void 0?super.off(u,t):(this._delegatedListeners&&this._delegatedListeners[u]&&(s=>{const c=this._delegatedListeners[u];for(let h=0;hthis._updateStyle(u,t)));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new ci(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,t,n):this.style.loadJSON(u,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ci(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,t){if(typeof u=="string"){const n=this._requestManager.transformRequest(u,lt.Style);l.f(n,((s,c)=>{s?this.fire(new l.j(s)):c&&this._updateDiff(c,t)}))}else typeof u=="object"&&this._updateDiff(u,t)}_updateDiff(u,t){try{this.style.setState(u,t)&&this._update(!0)}catch(n){l.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(u,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():l.w("There is no style added to the map.")}addSource(u,t){return this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)}isSourceLoaded(u){const t=this.style&&this.style.sourceCaches[u];if(t!==void 0)return t.loaded();this.fire(new l.j(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const t=this.style.sourceCaches[u.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);for(const n in this.style._layers){const s=this.style._layers[n];s.type==="hillshade"&&s.source===u.source&&l.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 Al(this.painter,t,u),this.painter.renderToTexture=new ds(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=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==u.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(n.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 l.k("terrain",{terrain:u})),this}getTerrain(){var u,t;return(t=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const t in u){const n=u[t]._tiles;for(const s in n){const c=n[s];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(u,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(u,t,n)}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,t,n={}){const{pixelRatio:s=1,sdf:c=!1,stretchX:h,stretchY:g,content:_}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||l.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new l.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:x,height:b,data:S}=t,T=t;return this.style.addImage(u,{data:new l.R({width:x,height:b},new Uint8Array(S)),pixelRatio:s,stretchX:h,stretchY:g,content:_,sdf:c,version:0,userImage:T}),T.onAdd&&T.onAdd(this,u),this}}{const{width:x,height:b,data:S}=l.h.getImageData(t);this.style.addImage(u,{data:new l.R({width:x,height:b},S),pixelRatio:s,stretchX:h,stretchY:g,content:_,sdf:c,version:0})}}updateImage(u,t){const n=this.style.getImage(u);if(!n)return this.fire(new l.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=t instanceof HTMLImageElement||l.a(t)?l.h.getImageData(t):t,{width:c,height:h,data:g}=s;if(c===void 0||h===void 0)return this.fire(new l.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(c!==n.data.width||h!==n.data.height)return this.fire(new l.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const _=!(t instanceof HTMLImageElement||l.a(t));return n.data.replace(g,_),this.style.updateImage(u,n),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new l.j(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u,t){Qe.getImage(this._requestManager.transformRequest(u,lt.Image),t)}listImages(){return this.style.listImages()}addLayer(u,t){return this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)}moveLayer(u,t){return this.style.moveLayer(u,t),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,t,n){return this.style.setLayerZoomRange(u,t,n),this._update(!0)}setFilter(u,t,n={}){return this.style.setFilter(u,t,n),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,t,n,s={}){return this.style.setPaintProperty(u,t,n,s),this._update(!0)}getPaintProperty(u,t){return this.style.getPaintProperty(u,t)}setLayoutProperty(u,t,n,s={}){return this.style.setLayoutProperty(u,t,n,s),this._update(!0)}getLayoutProperty(u,t){return this.style.getLayoutProperty(u,t)}setGlyphs(u,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,t,n,(s=>{s||this._update(!0)})),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,t,(n=>{n||this._update(!0)})),this}setLight(u,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(u,t){return this.style.setFeatureState(u,t),this._update()}removeFeatureState(u,t){return this.style.removeFeatureState(u,t),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,t=0;return this._container&&(u=this._container.clientWidth||400,t=this._container.clientHeight||300),[u,t]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const t=this._canvasContainer=X.create("div","maplibregl-canvas-container",u);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=X.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 n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);const c=this._controlContainer=X.create("div","maplibregl-control-container",u),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((g=>{h[g]=X.create("div",`maplibregl-ctrl-${g} `,c)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=X.create("div","maplibregl-cooperative-gesture-screen",this._container);let u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` +`})),staticAttributes:s,staticUniforms:g}}class _n{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,c,h,g,_,x,b){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let I=0;!T&&I({u_depth:new l.aL(ce,fe.u_depth),u_terrain:new l.aL(ce,fe.u_terrain),u_terrain_dim:new l.aM(ce,fe.u_terrain_dim),u_terrain_matrix:new l.aN(ce,fe.u_terrain_matrix),u_terrain_unpack:new l.aO(ce,fe.u_terrain_unpack),u_terrain_exaggeration:new l.aM(ce,fe.u_terrain_exaggeration)}))(t,le),this.binderUniforms=s?s.getUniforms(t,le):[]}draw(t,n,s,c,h,g,_,x,b,T,I,P,V,N,$,B,Q,se){const G=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(c),t.setColorMode(h),t.setCullFace(g),x){t.activeTexture.set(G.TEXTURE2),G.bindTexture(G.TEXTURE_2D,x.depthTexture),t.activeTexture.set(G.TEXTURE3),G.bindTexture(G.TEXTURE_2D,x.texture);for(const le in this.terrainUniforms)this.terrainUniforms[le].set(x[le])}for(const le in this.fixedUniforms)this.fixedUniforms[le].set(_[le]);$&&$.setUniforms(t,this.binderUniforms,V,{zoom:N});let te=0;switch(n){case G.LINES:te=2;break;case G.TRIANGLES:te=3;break;case G.LINE_STRIP:te=1}for(const le of P.get()){const ce=le.vaos||(le.vaos={});(ce[b]||(ce[b]=new _n)).bind(t,this,T,$?$.getPaintVertexBuffers():[],I,le.vertexOffset,B,Q,se),G.drawElements(n,le.primitiveLength*te,G.UNSIGNED_SHORT,le.primitiveOffset*te*2)}}}function nr(u,t,n){const s=1/J(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,g=h*(n.tileID.canonical.x+n.tileID.wrap*c),_=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,_>>16],u_pixel_coord_lower:[65535&g,65535&_]}}const Ps=(u,t,n,s)=>{const c=t.style.light,h=c.properties.get("position"),g=[h.x,h.y,h.z],_=(function(){var b=new l.A(9);return l.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b})();c.properties.get("anchor")==="viewport"&&(function(b,T){var I=Math.sin(T),P=Math.cos(T);b[0]=P,b[1]=I,b[2]=0,b[3]=-I,b[4]=P,b[5]=0,b[6]=0,b[7]=0,b[8]=1})(_,-t.transform.angle),(function(b,T,I){var P=T[0],V=T[1],N=T[2];b[0]=P*I[0]+V*I[3]+N*I[6],b[1]=P*I[1]+V*I[4]+N*I[7],b[2]=P*I[2]+V*I[5]+N*I[8]})(g,g,_);const x=c.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[x.r,x.g,x.b],u_vertical_gradient:+n,u_opacity:s}},Jr=(u,t,n,s,c,h,g)=>l.e(Ps(u,t,n,s),nr(h,t,g),{u_height_factor:-Math.pow(2,c.overscaledZ)/g.tileSize/8}),Zo=u=>({u_matrix:u}),zs=(u,t,n,s)=>l.e(Zo(u),nr(n,t,s)),ja=(u,t)=>({u_matrix:u,u_world:t}),qa=(u,t,n,s,c)=>l.e(zs(u,t,n,s),{u_world:c}),Qr=(u,t,n,s)=>{const c=u.transform;let h,g;if(s.paint.get("circle-pitch-alignment")==="map"){const _=J(n,1,c.zoom);h=!0,g=[_,_]}else h=!1,g=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:u.pixelRatio,u_extrude_scale:g}},Ds=(u,t,n)=>{const s=J(n,1,t.zoom),c=Math.pow(2,t.zoom-n.tileID.overscaledZ),h=n.tileID.overscaleFactor();return{u_matrix:u,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[t.pixelsToGLUnits[0]/(s*c),t.pixelsToGLUnits[1]/(s*c)],u_overscale_factor:h}},pa=(u,t,n=1)=>({u_matrix:u,u_color:t,u_overlay:0,u_overlay_scale:n}),Go=u=>({u_matrix:u}),fc=(u,t,n,s)=>({u_matrix:u,u_extrude_scale:J(t,1,n),u_intensity:s});function Ls(u,t){const n=Math.pow(2,t.canonical.z),s=t.canonical.y;return[new l.U(0,s/n).toLngLat().lat,new l.U(0,(s+1)/n).toLngLat().lat]}const Fs=(u,t,n,s)=>{const c=u.transform;return{u_matrix:Za(u,t,n,s),u_ratio:1/J(t,1,c.zoom),u_device_pixel_ratio:u.pixelRatio,u_units_to_pixels:[1/c.pixelsToGLUnits[0],1/c.pixelsToGLUnits[1]]}},Ho=(u,t,n,s,c)=>l.e(Fs(u,t,n,c),{u_image:0,u_image_height:s}),mc=(u,t,n,s,c)=>{const h=u.transform,g=Xo(t,h);return{u_matrix:Za(u,t,n,c),u_texsize:t.imageAtlasTexture.size,u_ratio:1/J(t,1,h.zoom),u_device_pixel_ratio:u.pixelRatio,u_image:0,u_scale:[g,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},Wo=(u,t,n,s,c,h)=>{const g=u.lineAtlas,_=Xo(t,u.transform),x=n.layout.get("line-cap")==="round",b=g.getDash(s.from,x),T=g.getDash(s.to,x),I=b.width*c.fromScale,P=T.width*c.toScale;return l.e(Fs(u,t,n,h),{u_patternscale_a:[_/I,-b.height/2],u_patternscale_b:[_/P,-T.height/2],u_sdfgamma:g.width/(256*Math.min(I,P)*u.pixelRatio)/2,u_image:0,u_tex_y_a:b.y,u_tex_y_b:T.y,u_mix:c.t})};function Xo(u,t){return 1/J(u,1,t.tileZoom)}function Za(u,t,n,s){return u.translatePosMatrix(s?s.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const Ko=(u,t,n,s,c)=>{return{u_matrix:u,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*c.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:c.paint.get("raster-brightness-min"),u_brightness_high:c.paint.get("raster-brightness-max"),u_saturation_factor:(g=c.paint.get("raster-saturation"),g>0?1-1/(1.001-g):-g),u_contrast_factor:(h=c.paint.get("raster-contrast"),h>0?1/(1-h):1+h),u_spin_weights:Yo(c.paint.get("raster-hue-rotate"))};var h,g};function Yo(u){u*=Math.PI/180;const t=Math.sin(u),n=Math.cos(u);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const Rs=(u,t,n,s,c,h,g,_,x,b)=>{const T=c.transform;return{u_is_size_zoom_constant:+(u==="constant"||u==="source"),u_is_size_feature_constant:+(u==="constant"||u==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:T.cameraToCenterDistance,u_pitch:T.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:T.width/T.height,u_fade_change:c.options.fadeDuration?c.symbolFadeChange:1,u_matrix:h,u_label_plane_matrix:g,u_coord_matrix:_,u_is_text:+x,u_pitch_with_map:+s,u_texsize:b,u_texture:0}},Bs=(u,t,n,s,c,h,g,_,x,b,T)=>{const I=c.transform;return l.e(Rs(u,t,n,s,c,h,g,_,x,b),{u_gamma_scale:s?Math.cos(I._pitch)*I.cameraToCenterDistance:1,u_device_pixel_ratio:c.pixelRatio,u_is_halo:1})},yn=(u,t,n,s,c,h,g,_,x,b)=>l.e(Bs(u,t,n,s,c,h,g,_,!0,x),{u_texsize_icon:b,u_texture_icon:1}),Ga=(u,t,n)=>({u_matrix:u,u_opacity:t,u_color:n}),ar=(u,t,n,s,c,h)=>l.e((function(g,_,x,b){const T=x.imageManager.getPattern(g.from.toString()),I=x.imageManager.getPattern(g.to.toString()),{width:P,height:V}=x.imageManager.getPixelSize(),N=Math.pow(2,b.tileID.overscaledZ),$=b.tileSize*Math.pow(2,x.transform.tileZoom)/N,B=$*(b.tileID.canonical.x+b.tileID.wrap*N),Q=$*b.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:I.tl,u_pattern_br_b:I.br,u_texsize:[P,V],u_mix:_.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:I.displaySize,u_scale_a:_.fromScale,u_scale_b:_.toScale,u_tile_units_to_pixels:1/J(b,1,x.transform.tileZoom),u_pixel_coord_upper:[B>>16,Q>>16],u_pixel_coord_lower:[65535&B,65535&Q]}})(s,h,n,c),{u_matrix:u,u_opacity:t}),Ha={fillExtrusion:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_lightpos:new l.aP(u,t.u_lightpos),u_lightintensity:new l.aM(u,t.u_lightintensity),u_lightcolor:new l.aP(u,t.u_lightcolor),u_vertical_gradient:new l.aM(u,t.u_vertical_gradient),u_opacity:new l.aM(u,t.u_opacity)}),fillExtrusionPattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_lightpos:new l.aP(u,t.u_lightpos),u_lightintensity:new l.aM(u,t.u_lightintensity),u_lightcolor:new l.aP(u,t.u_lightcolor),u_vertical_gradient:new l.aM(u,t.u_vertical_gradient),u_height_factor:new l.aM(u,t.u_height_factor),u_image:new l.aL(u,t.u_image),u_texsize:new l.aQ(u,t.u_texsize),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade),u_opacity:new l.aM(u,t.u_opacity)}),fill:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix)}),fillPattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_image:new l.aL(u,t.u_image),u_texsize:new l.aQ(u,t.u_texsize),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade)}),fillOutline:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_world:new l.aQ(u,t.u_world)}),fillOutlinePattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_world:new l.aQ(u,t.u_world),u_image:new l.aL(u,t.u_image),u_texsize:new l.aQ(u,t.u_texsize),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade)}),circle:(u,t)=>({u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_scale_with_map:new l.aL(u,t.u_scale_with_map),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_extrude_scale:new l.aQ(u,t.u_extrude_scale),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_matrix:new l.aN(u,t.u_matrix)}),collisionBox:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pixels_to_tile_units:new l.aM(u,t.u_pixels_to_tile_units),u_extrude_scale:new l.aQ(u,t.u_extrude_scale),u_overscale_factor:new l.aM(u,t.u_overscale_factor)}),collisionCircle:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_inv_matrix:new l.aN(u,t.u_inv_matrix),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_viewport_size:new l.aQ(u,t.u_viewport_size)}),debug:(u,t)=>({u_color:new l.aR(u,t.u_color),u_matrix:new l.aN(u,t.u_matrix),u_overlay:new l.aL(u,t.u_overlay),u_overlay_scale:new l.aM(u,t.u_overlay_scale)}),clippingMask:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix)}),heatmap:(u,t)=>({u_extrude_scale:new l.aM(u,t.u_extrude_scale),u_intensity:new l.aM(u,t.u_intensity),u_matrix:new l.aN(u,t.u_matrix)}),heatmapTexture:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_world:new l.aQ(u,t.u_world),u_image:new l.aL(u,t.u_image),u_color_ramp:new l.aL(u,t.u_color_ramp),u_opacity:new l.aM(u,t.u_opacity)}),hillshade:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_image:new l.aL(u,t.u_image),u_latrange:new l.aQ(u,t.u_latrange),u_light:new l.aQ(u,t.u_light),u_shadow:new l.aR(u,t.u_shadow),u_highlight:new l.aR(u,t.u_highlight),u_accent:new l.aR(u,t.u_accent)}),hillshadePrepare:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_image:new l.aL(u,t.u_image),u_dimension:new l.aQ(u,t.u_dimension),u_zoom:new l.aM(u,t.u_zoom),u_unpack:new l.aO(u,t.u_unpack)}),line:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels)}),lineGradient:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels),u_image:new l.aL(u,t.u_image),u_image_height:new l.aM(u,t.u_image_height)}),linePattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_texsize:new l.aQ(u,t.u_texsize),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_image:new l.aL(u,t.u_image),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels),u_scale:new l.aP(u,t.u_scale),u_fade:new l.aM(u,t.u_fade)}),lineSDF:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ratio:new l.aM(u,t.u_ratio),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(u,t.u_units_to_pixels),u_patternscale_a:new l.aQ(u,t.u_patternscale_a),u_patternscale_b:new l.aQ(u,t.u_patternscale_b),u_sdfgamma:new l.aM(u,t.u_sdfgamma),u_image:new l.aL(u,t.u_image),u_tex_y_a:new l.aM(u,t.u_tex_y_a),u_tex_y_b:new l.aM(u,t.u_tex_y_b),u_mix:new l.aM(u,t.u_mix)}),raster:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_tl_parent:new l.aQ(u,t.u_tl_parent),u_scale_parent:new l.aM(u,t.u_scale_parent),u_buffer_scale:new l.aM(u,t.u_buffer_scale),u_fade_t:new l.aM(u,t.u_fade_t),u_opacity:new l.aM(u,t.u_opacity),u_image0:new l.aL(u,t.u_image0),u_image1:new l.aL(u,t.u_image1),u_brightness_low:new l.aM(u,t.u_brightness_low),u_brightness_high:new l.aM(u,t.u_brightness_high),u_saturation_factor:new l.aM(u,t.u_saturation_factor),u_contrast_factor:new l.aM(u,t.u_contrast_factor),u_spin_weights:new l.aP(u,t.u_spin_weights)}),symbolIcon:(u,t)=>({u_is_size_zoom_constant:new l.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(u,t.u_is_size_feature_constant),u_size_t:new l.aM(u,t.u_size_t),u_size:new l.aM(u,t.u_size),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pitch:new l.aM(u,t.u_pitch),u_rotate_symbol:new l.aL(u,t.u_rotate_symbol),u_aspect_ratio:new l.aM(u,t.u_aspect_ratio),u_fade_change:new l.aM(u,t.u_fade_change),u_matrix:new l.aN(u,t.u_matrix),u_label_plane_matrix:new l.aN(u,t.u_label_plane_matrix),u_coord_matrix:new l.aN(u,t.u_coord_matrix),u_is_text:new l.aL(u,t.u_is_text),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_texsize:new l.aQ(u,t.u_texsize),u_texture:new l.aL(u,t.u_texture)}),symbolSDF:(u,t)=>({u_is_size_zoom_constant:new l.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(u,t.u_is_size_feature_constant),u_size_t:new l.aM(u,t.u_size_t),u_size:new l.aM(u,t.u_size),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pitch:new l.aM(u,t.u_pitch),u_rotate_symbol:new l.aL(u,t.u_rotate_symbol),u_aspect_ratio:new l.aM(u,t.u_aspect_ratio),u_fade_change:new l.aM(u,t.u_fade_change),u_matrix:new l.aN(u,t.u_matrix),u_label_plane_matrix:new l.aN(u,t.u_label_plane_matrix),u_coord_matrix:new l.aN(u,t.u_coord_matrix),u_is_text:new l.aL(u,t.u_is_text),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_texsize:new l.aQ(u,t.u_texsize),u_texture:new l.aL(u,t.u_texture),u_gamma_scale:new l.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_is_halo:new l.aL(u,t.u_is_halo)}),symbolTextAndIcon:(u,t)=>({u_is_size_zoom_constant:new l.aL(u,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(u,t.u_is_size_feature_constant),u_size_t:new l.aM(u,t.u_size_t),u_size:new l.aM(u,t.u_size),u_camera_to_center_distance:new l.aM(u,t.u_camera_to_center_distance),u_pitch:new l.aM(u,t.u_pitch),u_rotate_symbol:new l.aL(u,t.u_rotate_symbol),u_aspect_ratio:new l.aM(u,t.u_aspect_ratio),u_fade_change:new l.aM(u,t.u_fade_change),u_matrix:new l.aN(u,t.u_matrix),u_label_plane_matrix:new l.aN(u,t.u_label_plane_matrix),u_coord_matrix:new l.aN(u,t.u_coord_matrix),u_is_text:new l.aL(u,t.u_is_text),u_pitch_with_map:new l.aL(u,t.u_pitch_with_map),u_texsize:new l.aQ(u,t.u_texsize),u_texsize_icon:new l.aQ(u,t.u_texsize_icon),u_texture:new l.aL(u,t.u_texture),u_texture_icon:new l.aL(u,t.u_texture_icon),u_gamma_scale:new l.aM(u,t.u_gamma_scale),u_device_pixel_ratio:new l.aM(u,t.u_device_pixel_ratio),u_is_halo:new l.aL(u,t.u_is_halo)}),background:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_opacity:new l.aM(u,t.u_opacity),u_color:new l.aR(u,t.u_color)}),backgroundPattern:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_opacity:new l.aM(u,t.u_opacity),u_image:new l.aL(u,t.u_image),u_pattern_tl_a:new l.aQ(u,t.u_pattern_tl_a),u_pattern_br_a:new l.aQ(u,t.u_pattern_br_a),u_pattern_tl_b:new l.aQ(u,t.u_pattern_tl_b),u_pattern_br_b:new l.aQ(u,t.u_pattern_br_b),u_texsize:new l.aQ(u,t.u_texsize),u_mix:new l.aM(u,t.u_mix),u_pattern_size_a:new l.aQ(u,t.u_pattern_size_a),u_pattern_size_b:new l.aQ(u,t.u_pattern_size_b),u_scale_a:new l.aM(u,t.u_scale_a),u_scale_b:new l.aM(u,t.u_scale_b),u_pixel_coord_upper:new l.aQ(u,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(u,t.u_pixel_coord_lower),u_tile_units_to_pixels:new l.aM(u,t.u_tile_units_to_pixels)}),terrain:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_texture:new l.aL(u,t.u_texture),u_ele_delta:new l.aM(u,t.u_ele_delta)}),terrainDepth:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_ele_delta:new l.aM(u,t.u_ele_delta)}),terrainCoords:(u,t)=>({u_matrix:new l.aN(u,t.u_matrix),u_texture:new l.aL(u,t.u_texture),u_terrain_coords_id:new l.aM(u,t.u_terrain_coords_id),u_ele_delta:new l.aM(u,t.u_ele_delta)})};class Wa{constructor(t,n,s){this.context=t;const c=t.gl;this.buffer=c.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?c.DYNAMIC_DRAW:c.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const da={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Xa{constructor(t,n,s,c){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=c,this.context=t;const h=t.gl;this.buffer=h.createBuffer(),t.bindVertexBuffer.set(this.buffer),h.bufferData(h.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete n.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 n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let s=0;s0){const Se=l.Z(),Oe=fe;l.aU(Se,ce.placementInvProjMatrix,u.transform.glCoordMatrix),l.aU(Se,Se,ce.placementViewportMatrix),T.push({circleArray:_e,circleOffset:P,transform:Oe,invTransform:Se,coord:te}),I+=_e.length/4,P=I}xe&&b.draw(_,x.LINES,pt.disabled,Ot.disabled,u.colorModeForRenderPass(),Dt.disabled,Ds(fe,u.transform,le),u.style.map.terrain&&u.style.map.terrain.getTerrainData(te),n.id,xe.layoutVertexBuffer,xe.indexBuffer,xe.segments,null,u.transform.zoom,null,null,xe.collisionVertexBuffer)}if(!g||!T.length)return;const V=u.useProgram("collisionCircle"),N=new l.aV;N.resize(4*I),N._trim();let $=0;for(const G of T)for(let te=0;te=0&&(N[B.associatedIconIndex]={shiftedAnchor:lt,angle:ke})}else F(B.numGlyphs,P)}if(b){V.clear();const $=u.icon.placedSymbolArray;for(let B=0;B<$.length;B++){const Q=$.get(B);if(Q.hidden)F(Q.numGlyphs,V);else{const se=N[B];if(se)for(let G=0;Gu.style.map.terrain.getElevation(xe,Li,Gt):null,ei=n.layout.get("text-rotation-alignment")==="map";Ce(Se,xe.posMatrix,u,c,Pt,Sr,B,b,ei,Zt)}const In=u.translatePosMatrix(xe.posMatrix,_e,h,g),ea=Q||c&&ce||sn?Ws:Pt,gi=u.translatePosMatrix(Sr,_e,h,g,!0),pi=ke&&n.paint.get(c?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ti;Ti=ke?Se.iconsInText?yn(He.kind,ot,se,B,u,In,ea,gi,ct,Qt):Bs(He.kind,ot,se,B,u,In,ea,gi,c,ct):Rs(He.kind,ot,se,B,u,In,ea,gi,c,ct);const An={program:wt,buffers:Oe,uniformValues:Ti,atlasTexture:qt,atlasTextureIcon:Wt,atlasInterpolation:kt,atlasInterpolationIcon:hi,isSDF:ke,hasHalo:pi};if(G&&Se.canOverlap){te=!0;const Zt=Oe.segments.get();for(const ei of Zt)fe.push({segments:new l.S([ei]),sortKey:ei.sortKey,state:An,terrainData:et})}else fe.push({segments:Oe.segments,sortKey:0,state:An,terrainData:et})}te&&fe.sort(((xe,_e)=>xe.sortKey-_e.sortKey));for(const xe of fe){const _e=xe.state;if(P.activeTexture.set(V.TEXTURE0),_e.atlasTexture.bind(_e.atlasInterpolation,V.CLAMP_TO_EDGE),_e.atlasTextureIcon&&(P.activeTexture.set(V.TEXTURE1),_e.atlasTextureIcon&&_e.atlasTextureIcon.bind(_e.atlasInterpolationIcon,V.CLAMP_TO_EDGE)),_e.isSDF){const Se=_e.uniformValues;_e.hasHalo&&(Se.u_is_halo=1,Ks(_e.buffers,xe.segments,n,u,_e.program,le,T,I,Se,xe.terrainData)),Se.u_is_halo=0}Ks(_e.buffers,xe.segments,n,u,_e.program,le,T,I,_e.uniformValues,xe.terrainData)}}function Ks(u,t,n,s,c,h,g,_,x,b){const T=s.context;c.draw(T,T.gl.TRIANGLES,h,g,_,Dt.disabled,x,b,n.id,u.layoutVertexBuffer,u.indexBuffer,t,n.paint,s.transform.zoom,u.programConfigurations.get(n.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}function ma(u,t,n,s,c){if(!n||!s||!s.imageAtlas)return;const h=s.imageAtlas.patternPositions;let g=h[n.to.toString()],_=h[n.from.toString()];if(!g&&_&&(g=_),!_&&g&&(_=g),!g||!_){const x=c.getPaintProperty(t);g=h[x],_=h[x]}g&&_&&u.setConstantPatternPositions(g,_)}function ga(u,t,n,s,c,h,g){const _=u.context.gl,x="fill-pattern",b=n.paint.get(x),T=b&&b.constantOr(1),I=n.getCrossfadeParameters();let P,V,N,$,B;g?(V=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",P=_.LINES):(V=T?"fillPattern":"fill",P=_.TRIANGLES);const Q=b.constantOr(null);for(const se of s){const G=t.getTile(se);if(T&&!G.patternsLoaded())continue;const te=G.getBucket(n);if(!te)continue;const le=te.programConfigurations.get(n.id),ce=u.useProgram(V,le),fe=u.style.map.terrain&&u.style.map.terrain.getTerrainData(se);T&&(u.context.activeTexture.set(_.TEXTURE0),G.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),le.updatePaintBuffers(I)),ma(le,x,Q,G,n);const xe=fe?se:null,_e=u.translatePosMatrix(xe?xe.posMatrix:se.posMatrix,G,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(g){$=te.indexBuffer2,B=te.segments2;const Se=[_.drawingBufferWidth,_.drawingBufferHeight];N=V==="fillOutlinePattern"&&T?qa(_e,u,I,G,Se):ja(_e,Se)}else $=te.indexBuffer,B=te.segments,N=T?zs(_e,u,I,G):Zo(_e);ce.draw(u.context,P,c,u.stencilModeForClipping(se),h,Dt.disabled,N,fe,n.id,te.layoutVertexBuffer,$,B,n.paint,u.transform.zoom,le)}}function _a(u,t,n,s,c,h,g){const _=u.context,x=_.gl,b="fill-extrusion-pattern",T=n.paint.get(b),I=T.constantOr(1),P=n.getCrossfadeParameters(),V=n.paint.get("fill-extrusion-opacity"),N=T.constantOr(null);for(const $ of s){const B=t.getTile($),Q=B.getBucket(n);if(!Q)continue;const se=u.style.map.terrain&&u.style.map.terrain.getTerrainData($),G=Q.programConfigurations.get(n.id),te=u.useProgram(I?"fillExtrusionPattern":"fillExtrusion",G);I&&(u.context.activeTexture.set(x.TEXTURE0),B.imageAtlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE),G.updatePaintBuffers(P)),ma(G,b,N,B,n);const le=u.translatePosMatrix($.posMatrix,B,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),ce=n.paint.get("fill-extrusion-vertical-gradient"),fe=I?Jr(le,u,ce,V,$,P,B):Ps(le,u,ce,V);te.draw(_,_.gl.TRIANGLES,c,h,g,Dt.backCCW,fe,se,n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,n.paint,u.transform.zoom,G,u.style.map.terrain&&Q.centroidVertexBuffer)}}function Sc(u,t,n,s,c,h,g){const _=u.context,x=_.gl,b=n.fbo;if(!b)return;const T=u.useProgram("hillshade"),I=u.style.map.terrain&&u.style.map.terrain.getTerrainData(t);_.activeTexture.set(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,b.colorAttachment.get()),T.draw(_,x.TRIANGLES,c,h,g,Dt.disabled,((P,V,N,$)=>{const B=N.paint.get("hillshade-shadow-color"),Q=N.paint.get("hillshade-highlight-color"),se=N.paint.get("hillshade-accent-color");let G=N.paint.get("hillshade-illumination-direction")*(Math.PI/180);N.paint.get("hillshade-illumination-anchor")==="viewport"&&(G-=P.transform.angle);const te=!P.options.moving;return{u_matrix:$?$.posMatrix:P.transform.calculatePosMatrix(V.tileID.toUnwrapped(),te),u_image:0,u_latrange:Ls(0,V.tileID),u_light:[N.paint.get("hillshade-exaggeration"),G],u_shadow:B,u_highlight:Q,u_accent:se}})(u,n,s,I?t:null),I,s.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}function Ys(u,t,n,s,c,h){const g=u.context,_=g.gl,x=t.dem;if(x&&x.data){const b=x.dim,T=x.stride,I=x.getPixels();if(g.activeTexture.set(_.TEXTURE1),g.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||u.getTileTexture(T),t.demTexture){const V=t.demTexture;V.update(I,{premultiply:!1}),V.bind(_.NEAREST,_.CLAMP_TO_EDGE)}else t.demTexture=new Ft(g,I,_.RGBA,{premultiply:!1}),t.demTexture.bind(_.NEAREST,_.CLAMP_TO_EDGE);g.activeTexture.set(_.TEXTURE0);let P=t.fbo;if(!P){const V=new Ft(g,{width:b,height:b,data:null},_.RGBA);V.bind(_.LINEAR,_.CLAMP_TO_EDGE),P=t.fbo=g.createFramebuffer(b,b,!0,!1),P.colorAttachment.set(V.texture)}g.bindFramebuffer.set(P.framebuffer),g.viewport.set([0,0,b,b]),u.useProgram("hillshadePrepare").draw(g,_.TRIANGLES,s,c,h,Dt.disabled,((V,N)=>{const $=N.stride,B=l.Z();return l.aS(B,0,l.N,-l.N,0,0,1),l.$(B,B,[0,-l.N,0]),{u_matrix:B,u_image:1,u_dimension:[$,$],u_zoom:V.overscaledZ,u_unpack:N.getUnpackVector()}})(t.tileID,x),null,n.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Tc(u,t,n,s,c,h){const g=s.paint.get("raster-fade-duration");if(!h&&g>0){const _=l.h.now(),x=(_-u.timeAdded)/g,b=t?(_-t.timeAdded)/g:-1,T=n.getSource(),I=c.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),P=!t||Math.abs(t.tileID.overscaledZ-I)>Math.abs(u.tileID.overscaledZ-I),V=P&&u.refreshedUponExpiration?1:l.ad(P?x:1-b,0,1);return u.refreshedUponExpiration&&x>=1&&(u.refreshedUponExpiration=!1),t?{opacity:1,mix:1-V}:{opacity:V,mix:0}}return{opacity:1,mix:0}}const al=new l.aT(1,0,0,1),as=new l.aT(0,1,0,1),Js=new l.aT(0,0,1,1),sl=new l.aT(1,0,1,1),ol=new l.aT(0,1,1,1);function ya(u,t,n,s){os(u,0,t+n/2,u.transform.width,n,s)}function ss(u,t,n,s){os(u,t-n/2,0,n,u.transform.height,s)}function os(u,t,n,s,c,h){const g=u.context,_=g.gl;_.enable(_.SCISSOR_TEST),_.scissor(t*u.pixelRatio,n*u.pixelRatio,s*u.pixelRatio,c*u.pixelRatio),g.clear({color:h}),_.disable(_.SCISSOR_TEST)}function ll(u,t,n){const s=u.context,c=s.gl,h=n.posMatrix,g=u.useProgram("debug"),_=pt.disabled,x=Ot.disabled,b=u.colorModeForRenderPass(),T="$debug",I=u.style.map.terrain&&u.style.map.terrain.getTerrainData(n);s.activeTexture.set(c.TEXTURE0);const P=t.getTileByID(n.key).latestRawTileData,V=Math.floor((P&&P.byteLength||0)/1024),N=t.getTile(n).tileSize,$=512/Math.min(N,512)*(n.overscaledZ/u.transform.zoom)*.5;let B=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(B+=` => ${n.overscaledZ}`),(function(Q,se){Q.initDebugOverlayCanvas();const G=Q.debugOverlayCanvas,te=Q.context.gl,le=Q.debugOverlayCanvas.getContext("2d");le.clearRect(0,0,G.width,G.height),le.shadowColor="white",le.shadowBlur=2,le.lineWidth=1.5,le.strokeStyle="white",le.textBaseline="top",le.font="bold 36px Open Sans, sans-serif",le.fillText(se,5,5),le.strokeText(se,5,5),Q.debugOverlayTexture.update(G),Q.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)})(u,`${B} ${V}kB`),g.draw(s,c.TRIANGLES,_,x,Bt.alphaBlended,Dt.disabled,pa(h,l.aT.transparent,$),null,T,u.debugBuffer,u.quadTriangleIndexBuffer,u.debugSegments),g.draw(s,c.LINE_STRIP,_,x,b,Dt.disabled,pa(h,l.aT.red),I,T,u.debugBuffer,u.tileBorderIndexBuffer,u.debugSegments)}function $t(u,t,n){const s=u.context,c=s.gl,h=u.colorModeForRenderPass(),g=new pt(c.LEQUAL,pt.ReadWrite,u.depthRangeFor3D),_=u.useProgram("terrain"),x=t.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,u.width,u.height]);for(const b of n){const T=u.renderToTexture.getTexture(b),I=t.getTerrainData(b.tileID);s.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,T.texture);const P={u_matrix:u.transform.calculatePosMatrix(b.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(u.transform.zoom)};_.draw(s,c.TRIANGLES,g,Ot.disabled,h,Dt.backCCW,P,I,"terrain",x.vertexBuffer,x.indexBuffer,x.segments)}}class bn{constructor(t,n){this.context=new wc(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:l.Z(),renderTime:0},this.setup(),this.numSublayers=Pi.maxUnderzooming+Pi.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Va}resize(t,n,s){if(this.width=Math.floor(t*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const c of this.style._order)this.style._layers[c].resize()}setup(){const t=this.context,n=new l.a_;n.emplaceBack(0,0),n.emplaceBack(l.N,0),n.emplaceBack(0,l.N),n.emplaceBack(l.N,l.N),this.tileExtentBuffer=t.createVertexBuffer(n,Ua.members),this.tileExtentSegments=l.S.simpleSegment(0,0,4,2);const s=new l.a_;s.emplaceBack(0,0),s.emplaceBack(l.N,0),s.emplaceBack(0,l.N),s.emplaceBack(l.N,l.N),this.debugBuffer=t.createVertexBuffer(s,Ua.members),this.debugSegments=l.S.simpleSegment(0,0,4,5);const c=new l.V;c.emplaceBack(0,0,0,0),c.emplaceBack(l.N,0,l.N,0),c.emplaceBack(0,l.N,0,l.N),c.emplaceBack(l.N,l.N,l.N,l.N),this.rasterBoundsBuffer=t.createVertexBuffer(c,hr.members),this.rasterBoundsSegments=l.S.simpleSegment(0,0,4,2);const h=new l.a_;h.emplaceBack(0,0),h.emplaceBack(1,0),h.emplaceBack(0,1),h.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(h,Ua.members),this.viewportSegments=l.S.simpleSegment(0,0,4,2);const g=new l.a$;g.emplaceBack(0),g.emplaceBack(1),g.emplaceBack(3),g.emplaceBack(2),g.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(g);const _=new l.b0;_.emplaceBack(0,1,2),_.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(_);const x=this.context.gl;this.stencilClearMode=new Ot({func:x.ALWAYS,mask:0},0,255,x.ZERO,x.ZERO,x.ZERO)}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=l.Z();l.aS(s,0,this.width,this.height,0,0,1),l.a0(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,pt.disabled,this.stencilClearMode,Bt.disabled,Dt.disabled,Go(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;const s=this.context,c=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Bt.disabled),s.setDepthMode(pt.disabled);const h=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const g of n){const _=this._tileClippingMaskIDs[g.key]=this.nextStencilID++,x=this.style.map.terrain&&this.style.map.terrain.getTerrainData(g);h.draw(s,c.TRIANGLES,pt.disabled,new Ot({func:c.ALWAYS,mask:0},_,255,c.KEEP,c.KEEP,c.REPLACE),Bt.disabled,Dt.disabled,Go(g.posMatrix),x,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new Ot({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){const n=this.context.gl;return new Ot({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,s=t.sort(((g,_)=>_.overscaledZ-g.overscaledZ)),c=s[s.length-1].overscaledZ,h=s[0].overscaledZ-c+1;if(h>1){this.currentStencilSource=void 0,this.nextStencilID+h>256&&this.clearStencil();const g={};for(let _=0;_=0;this.currentLayer--){const x=this.style._layers[s[this.currentLayer]],b=c[x.source],T=h[x.source];this._renderTileClippingMasks(x,T),this.renderLayer(this,b,x,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerB.source&&!B.isHidden(T)?[b.sourceCaches[B.source]]:[])),V=P.filter((B=>B.getSource().type==="vector")),N=P.filter((B=>B.getSource().type!=="vector")),$=B=>{(!I||I.getSource().maxzoom$(B))),I||N.forEach((B=>$(B))),I})(this.style,this.transform.zoom);x&&(function(b,T,I){for(let P=0;PV.style.map.terrain.getElevation(ce,He,Ve):null)}}})(x,h,_,g,_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),b),_.paint.get("icon-opacity").constantOr(1)!==0&&ns(h,g,_,x,!1,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),_.layout.get("icon-rotation-alignment"),_.layout.get("icon-pitch-alignment"),_.layout.get("icon-keep-upright"),T,I),_.paint.get("text-opacity").constantOr(1)!==0&&ns(h,g,_,x,!0,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),_.layout.get("text-rotation-alignment"),_.layout.get("text-pitch-alignment"),_.layout.get("text-keep-upright"),T,I),g.map.showCollisionBoxes&&(nl(h,g,_,x,_.paint.get("text-translate"),_.paint.get("text-translate-anchor"),!0),nl(h,g,_,x,_.paint.get("icon-translate"),_.paint.get("icon-translate-anchor"),!1))})(t,n,s,c,this.style.placement.variableOffsets);break;case"circle":(function(h,g,_,x){if(h.renderPass!=="translucent")return;const b=_.paint.get("circle-opacity"),T=_.paint.get("circle-stroke-width"),I=_.paint.get("circle-stroke-opacity"),P=!_.layout.get("circle-sort-key").isConstant();if(b.constantOr(1)===0&&(T.constantOr(1)===0||I.constantOr(1)===0))return;const V=h.context,N=V.gl,$=h.depthModeForSublayer(0,pt.ReadOnly),B=Ot.disabled,Q=h.colorModeForRenderPass(),se=[];for(let G=0;GG.sortKey-te.sortKey));for(const G of se){const{programConfiguration:te,program:le,layoutVertexBuffer:ce,indexBuffer:fe,uniformValues:xe,terrainData:_e}=G.state;le.draw(V,N.TRIANGLES,$,B,Q,Dt.disabled,xe,_e,_.id,ce,fe,G.segments,_.paint,h.transform.zoom,te)}})(t,n,s,c);break;case"heatmap":(function(h,g,_,x){if(_.paint.get("heatmap-opacity")!==0)if(h.renderPass==="offscreen"){const b=h.context,T=b.gl,I=Ot.disabled,P=new Bt([T.ONE,T.ONE],l.aT.transparent,[!0,!0,!0,!0]);(function(V,N,$){const B=V.gl;V.activeTexture.set(B.TEXTURE1),V.viewport.set([0,0,N.width/4,N.height/4]);let Q=$.heatmapFbo;if(Q)B.bindTexture(B.TEXTURE_2D,Q.colorAttachment.get()),V.bindFramebuffer.set(Q.framebuffer);else{const se=B.createTexture();B.bindTexture(B.TEXTURE_2D,se),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_S,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_WRAP_T,B.CLAMP_TO_EDGE),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MIN_FILTER,B.LINEAR),B.texParameteri(B.TEXTURE_2D,B.TEXTURE_MAG_FILTER,B.LINEAR),Q=$.heatmapFbo=V.createFramebuffer(N.width/4,N.height/4,!1,!1),(function(G,te,le,ce){var fe,xe;const _e=G.gl,Se=(fe=G.HALF_FLOAT)!==null&&fe!==void 0?fe:_e.UNSIGNED_BYTE,Oe=(xe=G.RGBA16F)!==null&&xe!==void 0?xe:_e.RGBA;_e.texImage2D(_e.TEXTURE_2D,0,Oe,te.width/4,te.height/4,0,_e.RGBA,Se,null),ce.colorAttachment.set(le)})(V,N,se,Q)}})(b,h,_),b.clear({color:l.aT.transparent});for(let V=0;V{const G=l.Z();l.aS(G,0,$.width,$.height,0,0,1);const te=$.context.gl;return{u_matrix:G,u_world:[te.drawingBufferWidth,te.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:B.paint.get("heatmap-opacity")}})(b,T),null,T.id,b.viewportBuffer,b.quadTriangleIndexBuffer,b.viewportSegments,T.paint,b.transform.zoom)})(h,_))})(t,n,s,c);break;case"line":(function(h,g,_,x){if(h.renderPass!=="translucent")return;const b=_.paint.get("line-opacity"),T=_.paint.get("line-width");if(b.constantOr(1)===0||T.constantOr(1)===0)return;const I=h.depthModeForSublayer(0,pt.ReadOnly),P=h.colorModeForRenderPass(),V=_.paint.get("line-dasharray"),N=_.paint.get("line-pattern"),$=N.constantOr(1),B=_.paint.get("line-gradient"),Q=_.getCrossfadeParameters(),se=$?"linePattern":V?"lineSDF":B?"lineGradient":"line",G=h.context,te=G.gl;let le=!0;for(const ce of x){const fe=g.getTile(ce);if($&&!fe.patternsLoaded())continue;const xe=fe.getBucket(_);if(!xe)continue;const _e=xe.programConfigurations.get(_.id),Se=h.context.program.get(),Oe=h.useProgram(se,_e),lt=le||Oe.program!==Se,ke=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ce),He=N.constantOr(null);if(He&&fe.imageAtlas){const ot=fe.imageAtlas,et=ot.patternPositions[He.to.toString()],ct=ot.patternPositions[He.from.toString()];et&&ct&&_e.setConstantPatternPositions(et,ct)}const Ve=ke?ce:null,wt=$?mc(h,fe,_,Q,Ve):V?Wo(h,fe,_,V,Q,Ve):B?Ho(h,fe,_,xe.lineClipsArray.length,Ve):Fs(h,fe,_,Ve);if($)G.activeTexture.set(te.TEXTURE0),fe.imageAtlasTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE),_e.updatePaintBuffers(Q);else if(V&&(lt||h.lineAtlas.dirty))G.activeTexture.set(te.TEXTURE0),h.lineAtlas.bind(G);else if(B){const ot=xe.gradients[_.id];let et=ot.texture;if(_.gradientVersion!==ot.version){let ct=256;if(_.stepInterpolant){const qt=g.getSource().maxzoom,kt=ce.canonical.z===qt?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const n=this.imageManager.getPattern(t.from.toString()),s=this.imageManager.getPattern(t.to.toString());return!n||!s}useProgram(t,n){this.cache=this.cache||{};const s=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new $a(this.context,Rt[t],n,Ha[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}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 Ft(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class zi{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,s){const c=Math.pow(2,s),h=[[-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((_=>{const x=1/(_=l.ag([],_,t))[3]/n*c;return l.b3(_,_,[x,x,1/_[3],x])})),g=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((_=>{const x=(function(P,V){var N=V[0],$=V[1],B=V[2],Q=N*N+$*$+B*B;return Q>0&&(Q=1/Math.sqrt(Q)),P[0]=V[0]*Q,P[1]=V[1]*Q,P[2]=V[2]*Q,P})([],(function(P,V,N){var $=V[0],B=V[1],Q=V[2],se=N[0],G=N[1],te=N[2];return P[0]=B*te-Q*G,P[1]=Q*se-$*te,P[2]=$*G-B*se,P})([],it([],h[_[0]],h[_[1]]),it([],h[_[2]],h[_[1]]))),b=-((T=x)[0]*(I=h[_[1]])[0]+T[1]*I[1]+T[2]*I[2]);var T,I;return x.concat(b)}));return new zi(h,g)}}class Wn{constructor(t,n){this.min=t,this.max=n,this.center=(function(s,c,h){return s[0]=.5*c[0],s[1]=.5*c[1],s[2]=.5*c[2],s})([],(function(s,c,h){return s[0]=c[0]+h[0],s[1]=c[1]+h[1],s[2]=c[2]+h[2],s})([],this.min,this.max))}quadrant(t){const n=[t%2==0,t<2],s=un(this.min),c=un(this.max);for(let h=0;h=0&&g++;if(g===0)return 0;g!==n.length&&(s=!1)}if(s)return 2;for(let c=0;c<3;c++){let h=Number.MAX_VALUE,g=-Number.MAX_VALUE;for(let _=0;_this.max[c]-this.min[c])return 0}return 1}}class xa{constructor(t=0,n=0,s=0,c=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(c)||c<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=s,this.right=c}interpolate(t,n,s){return n.top!=null&&t.top!=null&&(this.top=l.B.number(t.top,n.top,s)),n.bottom!=null&&t.bottom!=null&&(this.bottom=l.B.number(t.bottom,n.bottom,s)),n.left!=null&&t.left!=null&&(this.left=l.B.number(t.left,n.left,s)),n.right!=null&&t.right!=null&&(this.right=l.B.number(t.right,n.right,s)),this}getCenter(t,n){const s=l.ad((this.left+t-this.right)/2,0,t),c=l.ad((this.top+n-this.bottom)/2,0,n);return new l.P(s,c)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new xa(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class ls{constructor(t,n,s,c,h){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=h===void 0||!!h,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=s??0,this._maxPitch=c??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xa,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new ls(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 l.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const n=-l.b5(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(function(){var s=new l.A(4);return l.A!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s})(),(function(s,c,h){var g=c[0],_=c[1],x=c[2],b=c[3],T=Math.sin(h),I=Math.cos(h);s[0]=g*I+x*T,s[1]=_*I+b*T,s[2]=g*-T+x*I,s[3]=_*-T+b*I})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=l.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,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 n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),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,n,s){this._unmodified=!1,this._edgeInsets.interpolate(t,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){const n=[new l.b6(0,t)];if(this._renderWorldCopies){const s=this.pointCoordinate(new l.P(0,0)),c=this.pointCoordinate(new l.P(this.width,0)),h=this.pointCoordinate(new l.P(this.width,this.height)),g=this.pointCoordinate(new l.P(0,this.height)),_=Math.floor(Math.min(s.x,c.x,h.x,g.x)),x=Math.floor(Math.max(s.x,c.x,h.x,g.x)),b=1;for(let T=_-b;T<=x+b;T++)T!==0&&n.push(new l.b6(T,t))}return n}coveringTiles(t){var n,s;let c=this.coveringZoomLevel(t);const h=c;if(t.minzoom!==void 0&&ct.maxzoom&&(c=t.maxzoom);const g=this.pointCoordinate(this.getCameraPoint()),_=l.U.fromLngLat(this.center),x=Math.pow(2,c),b=[x*g.x,x*g.y,0],T=[x*_.x,x*_.y,0],I=zi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,c);let P=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(P=c);const V=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,N=G=>({aabb:new Wn([G*x,0,0],[(G+1)*x,x,0]),zoom:0,x:0,y:0,wrap:G,fullyVisible:!1}),$=[],B=[],Q=c,se=t.reparseOverscaled?h:c;if(this._renderWorldCopies)for(let G=1;G<=3;G++)$.push(N(-G)),$.push(N(G));for($.push(N(0));$.length>0;){const G=$.pop(),te=G.x,le=G.y;let ce=G.fullyVisible;if(!ce){const Oe=G.aabb.intersects(I);if(Oe===0)continue;ce=Oe===2}const fe=t.terrain?b:T,xe=G.aabb.distanceX(fe),_e=G.aabb.distanceY(fe),Se=Math.max(Math.abs(xe),Math.abs(_e));if(G.zoom===Q||Se>V+(1<=P){const Oe=Q-G.zoom,lt=b[0]-.5-(te<>1),He=G.zoom+1;let Ve=G.aabb.quadrant(Oe);if(t.terrain){const wt=new l.O(He,G.wrap,He,lt,ke),ot=t.terrain.getMinMaxElevation(wt),et=(n=ot.minElevation)!==null&&n!==void 0?n:this.elevation,ct=(s=ot.maxElevation)!==null&&s!==void 0?s:this.elevation;Ve=new Wn([Ve.min[0],Ve.min[1],et],[Ve.max[0],Ve.max[1],ct])}$.push({aabb:Ve,zoom:He,x:lt,y:ke,wrap:G.wrap,fullyVisible:ce})}}return B.sort(((G,te)=>G.distanceSq-te.distanceSq)).map((G=>G.tileID))}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],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 n=l.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.P(l.G(t.lng)*this.worldSize,l.H(n)*this.worldSize)}unproject(t){return new l.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 n=this.pointLocation(this.centerPoint,t),s=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-s))return;const c=this.getCameraPosition(),h=l.U.fromLngLat(c.lngLat,c.altitude),g=l.U.fromLngLat(n,s),_=h.x-g.x,x=h.y-g.y,b=h.z-g.z,T=Math.sqrt(_*_+x*x+b*b),I=this.scaleZoom(this.cameraToCenterDistance/T/this.tileSize);this._elevation=s,this._center=n,this.zoom=I}setLocationAtPoint(t,n){const s=this.pointCoordinate(n),c=this.pointCoordinate(this.centerPoint),h=this.locationCoordinate(t),g=new l.U(h.x-(s.x-c.x),h.y-(s.y-c.y));this.center=this.coordinateLocation(g),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return l.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){const P=n.pointCoordinate(t);if(P!=null)return P}const s=[t.x,t.y,0,1],c=[t.x,t.y,1,1];l.ag(s,s,this.pixelMatrixInverse),l.ag(c,c,this.pixelMatrixInverse);const h=s[3],g=c[3],_=s[1]/h,x=c[1]/g,b=s[2]/h,T=c[2]/g,I=b===T?0:(0-b)/(T-b);return new l.U(l.B.number(s[0]/h,c[0]/g,I)/this.worldSize,l.B.number(_,x,I)/this.worldSize)}coordinatePoint(t,n=0,s=this.pixelMatrix){const c=[t.x*this.worldSize,t.y*this.worldSize,n,1];return l.ag(c,c,s),new l.P(c[0]/c[3],c[1]/c[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new Mt().extend(this.pointLocation(new l.P(0,t))).extend(this.pointLocation(new l.P(this.width,t))).extend(this.pointLocation(new l.P(this.width,this.height))).extend(this.pointLocation(new l.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Mt([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,n=!1){const s=t.key,c=n?this._alignedPosMatrixCache:this._posMatrixCache;if(c[s])return c[s];const h=t.canonical,g=this.worldSize/this.zoomScale(h.z),_=h.x+Math.pow(2,h.z)*t.wrap,x=l.ao(new Float64Array(16));return l.$(x,x,[_*g,h.y*g,0]),l.a0(x,x,[g/l.N,g/l.N,1]),l.a1(x,n?this.alignedProjMatrix:this.projMatrix,x),c[s]=new Float32Array(x),c[s]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,s,c,h=-90,g=90,_=-180,x=180;const b=this.size,T=this._unmodified;if(this.latRange){const V=this.latRange;h=l.H(V[1])*this.worldSize,g=l.H(V[0])*this.worldSize,t=g-hg&&(c=g-N)}if(this.lngRange){const V=(_+x)/2,N=l.b5(I.x,V-this.worldSize/2,V+this.worldSize/2),$=b.x/2;N-$<_&&(s=_+$),N+$>x&&(s=x-$)}s===void 0&&c===void 0||(this.center=this.unproject(new l.P(s!==void 0?s:I.x,c!==void 0?c:I.y)).wrap()),this._unmodified=T,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=l.b7(1,this.center.lat)*this.worldSize;let c=l.ao(new Float64Array(16));l.a0(c,c,[this.width/2,-this.height/2,1]),l.$(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=l.ao(new Float64Array(16)),l.a0(c,c,[1,-1,1]),l.$(c,c,[-1,-1,0]),l.a0(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c;const h=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),g=Math.min(this.elevation,this._minEleveationForCurrentTile),_=h-g*this._pixelPerMeter/Math.cos(this._pitch),x=g<0?_:h,b=Math.PI/2+this._pitch,T=this._fov*(.5+t.y/this.height),I=Math.sin(T)*x/Math.sin(l.ad(Math.PI-b-T,.01,Math.PI-.01)),P=this.getHorizon(),V=2*Math.atan(P/this.cameraToCenterDistance)*(.5+t.y/(2*P)),N=Math.sin(V)*x/Math.sin(l.ad(Math.PI-b-V,.01,Math.PI-.01)),$=Math.min(I,N),B=1.01*(Math.cos(Math.PI/2-this._pitch)*$+x),Q=this.height/50;c=new Float64Array(16),l.b8(c,this._fov,this.width/this.height,Q,B),c[8]=2*-t.x/this.width,c[9]=2*t.y/this.height,l.a0(c,c,[1,-1,1]),l.$(c,c,[0,0,-this.cameraToCenterDistance]),l.b9(c,c,this._pitch),l.ae(c,c,this.angle),l.$(c,c,[-n,-s,0]),this.mercatorMatrix=l.a0([],c,[this.worldSize,this.worldSize,this.worldSize]),l.a0(c,c,[1,1,this._pixelPerMeter]),this.pixelMatrix=l.a1(new Float64Array(16),this.labelPlaneMatrix,c),l.$(c,c,[0,0,-this.elevation]),this.projMatrix=c,this.invProjMatrix=l.as([],c),this.pixelMatrix3D=l.a1(new Float64Array(16),this.labelPlaneMatrix,c);const se=this.width%2/2,G=this.height%2/2,te=Math.cos(this.angle),le=Math.sin(this.angle),ce=n-Math.round(n)+te*se+le*G,fe=s-Math.round(s)+te*G+le*se,xe=new Float64Array(c);if(l.$(xe,xe,[ce>.5?ce-1:ce,fe>.5?fe-1:fe,0]),this.alignedProjMatrix=xe,c=l.as(new Float64Array(16),this.pixelMatrix),!c)throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new l.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return l.ag(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.P(0,t))}getCameraQueryGeometry(t){const n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let s=n.x,c=n.y,h=n.x,g=n.y;for(const _ of t)s=Math.min(s,_.x),c=Math.min(c,_.y),h=Math.max(h,_.x),g=Math.max(g,_.y);return[new l.P(s,c),new l.P(h,c),new l.P(h,g),new l.P(s,g),new l.P(s,c)]}}}function wn(u,t){let n,s=!1,c=null,h=null;const g=()=>{c=null,s&&(u.apply(h,n),c=setTimeout(g,t),s=!1)};return(..._)=>(s=!0,h=this,n=_,c||g(),c)}class va{constructor(t){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map((c=>c.split("="))).forEach((c=>{c[0]===this._hashName&&(s=c)})),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some((s=>isNaN(s)))){const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:s,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=wn(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 n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,c=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),h=Math.pow(10,c),g=Math.round(n.lng*h)/h,_=Math.round(n.lat*h)/h,x=this._map.getBearing(),b=this._map.getPitch();let T="";if(T+=t?`/${g}/${_}/${s}`:`${s}/${_}/${g}`,(x||b)&&(T+="/"+Math.round(10*x)/10),b&&(T+=`/${Math.round(b)}`),this._hashName){const I=this._hashName;let P=!1;const V=window.location.hash.slice(1).split("&").map((N=>{const $=N.split("=")[0];return $===I?(P=!0,`${$}=${T}`):N})).filter((N=>N));return P||V.push(`${I}=${T}`),`#${V.join("&")}`}return`#${T}`}}const Xn={linearity:.3,easing:l.ba(0,0,.3,1)},cl=l.e({deceleration:2500,maxSpeed:1400},Xn),ul=l.e({deceleration:20,maxSpeed:1400},Xn),hl=l.e({deceleration:1e3,maxSpeed:360},Xn),pl=l.e({deceleration:1e3,maxSpeed:90},Xn);class dl{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=l.h.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new l.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:h}of this._inertiaBuffer)n.zoom+=h.zoomDelta||0,n.bearing+=h.bearingDelta||0,n.pitch+=h.pitchDelta||0,h.panDelta&&n.pan._add(h.panDelta),h.around&&(n.around=h.around),h.pinchAround&&(n.pinchAround=h.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,c={};if(n.pan.mag()){const h=ba(n.pan.mag(),s,l.e({},cl,t||{}));c.offset=n.pan.mult(h.amount/n.pan.mag()),c.center=this._map.transform.center,wr(c,h)}if(n.zoom){const h=ba(n.zoom,s,ul);c.zoom=this._map.transform.zoom+h.amount,wr(c,h)}if(n.bearing){const h=ba(n.bearing,s,hl);c.bearing=this._map.transform.bearing+l.ad(h.amount,-179,179),wr(c,h)}if(n.pitch){const h=ba(n.pitch,s,pl);c.pitch=this._map.transform.pitch+h.amount,wr(c,h)}if(c.zoom||c.bearing){const h=n.pinchAround===void 0?n.around:n.pinchAround;c.around=h?this._map.unproject(h):this._map.getCenter()}return this.clear(),l.e(c,{noMoveStart:!0})}}function wr(u,t){(!u.duration||u.durationn.unproject(x))),_=h.reduce(((x,b,T,I)=>x.add(b.div(I.length))),new l.P(0,0));super(t,{points:h,point:_,lngLats:g,lngLat:n.unproject(_),originalEvent:s}),this._defaultPrevented=!1}}class fl extends l.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,s){super(t,{originalEvent:s}),this._defaultPrevented=!1}}class ml{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new fl(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Zi(t.type,this._map,t))}mouseup(t){this._map.fire(new Zi(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Zi(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Zi(t.type,this._map,t))}mouseover(t){this._map.fire(new Zi(t.type,this._map,t))}mouseout(t){this._map.fire(new Zi(t.type,this._map,t))}touchstart(t){return this._firePreventable(new wa(t.type,this._map,t))}touchmove(t){this._map.fire(new wa(t.type,this._map,t))}touchend(t){this._map.fire(new wa(t.type,this._map,t))}touchcancel(t){this._map.fire(new wa(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class gl{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Zi(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Zi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Zi(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class rn{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(l.P.convert(t),this._map.terrain)}}class _l{constructor(t,n){this._map=t,this._tr=new rn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(X.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)h.fitScreenCoordinates(s,c,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&&(X.remove(this._box),this._box=null),X.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new l.k(t,{originalEvent:n}))}}function sr(u,t){if(u.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${u.length}, points ${t.length}`);const n={};for(let s=0;sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),s.length===this.numTouches&&(this.centroid=(function(c){const h=new l.P(0,0);for(const g of c)h._add(g);return h.div(c.length)})(n),this.touches=sr(s,n)))}touchmove(t,n,s){if(this.aborted||!this.centroid)return;const c=sr(s,n);for(const h in this.touches){const g=c[h];(!g||g.dist(this.touches[h])>30)&&(this.aborted=!0)}}touchend(t,n,s){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),s.length===0){const c=!this.aborted&&this.centroid;if(this.reset(),c)return c}}}class cs{constructor(t){this.singleTap=new Fr(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,s){this.singleTap.touchstart(t,n,s)}touchmove(t,n,s){this.singleTap.touchmove(t,n,s)}touchend(t,n,s){const c=this.singleTap.touchend(t,n,s);if(c){const h=t.timeStamp-this.lastTime<500,g=!this.lastTap||this.lastTap.dist(c)<30;if(h&&g||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=c,this.count===this.numTaps)return this.reset(),c}}}class Rr{constructor(t){this._tr=new rn(t),this._zoomIn=new cs({numTouches:1,numTaps:2}),this._zoomOut=new cs({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,s){this._zoomIn.touchstart(t,n,s),this._zoomOut.touchstart(t,n,s)}touchmove(t,n,s){this._zoomIn.touchmove(t,n,s),this._zoomOut.touchmove(t,n,s)}touchend(t,n,s){const c=this._zoomIn.touchend(t,n,s),h=this._zoomOut.touchend(t,n,s),g=this._tr;return c?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:g.zoom+1,around:g.unproject(c)},{originalEvent:t})}):h?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:_=>_.easeTo({duration:300,zoom:g.zoom-1,around:g.unproject(h)},{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 Br{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 n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const c=n.length?n[0]:n;return!this._moved&&c.dist(s){u.mousedown=u.dragStart,u.mousemoveWindow=u.dragMove,u.mouseup=u.dragEnd,u.contextmenu=function(t){t.preventDefault()}},Kn=({enable:u,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{const s=new Qs({checkCorrectEvent:c=>X.mouseButton(c)===0&&c.ctrlKey||X.mouseButton(c)===2});return new Br({clickTolerance:t,move:(c,h)=>({bearingDelta:(h.x-c.x)*n}),moveStateManager:s,enable:u,assignEvents:us})},Or=({enable:u,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{const s=new Qs({checkCorrectEvent:c=>X.mouseButton(c)===0&&c.ctrlKey||X.mouseButton(c)===2});return new Br({clickTolerance:t,move:(c,h)=>({pitchDelta:(h.y-c.y)*n}),moveStateManager:s,enable:u,assignEvents:us})};class De{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new l.P(0,0),setTimeout((()=>{this._cancelCooperativeMessage=!1}),200)}touchstart(t,n,s){return this._calculateTransform(t,n,s)}touchmove(t,n,s){if(this._map._cooperativeGestures&&(this._minTouches===2&&s.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,s.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(s.length0&&(this._active=!0);const c=sr(s,n),h=new l.P(0,0),g=new l.P(0,0);let _=0;for(const b in c){const T=c[b],I=this._touches[b];I&&(h._add(T),g._add(T.sub(I)),_++,c[b]=T)}if(this._touches=c,_Math.abs(u.x)}class Ac extends hs{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,s){super.touchstart(t,n,s),this._currentTouchCount=s.length}_start(t){this._lastPoints=t,to(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,s){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const c=t[0].sub(this._lastPoints[0]),h=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(c,h,s.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(c.y+h.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,s){if(this._valid!==void 0)return this._valid;const c=t.mag()>=2,h=n.mag()>=2;if(!c&&!h)return;if(!c||!h)return this._firstMove===void 0&&(this._firstMove=s),s-this._firstMove<100&&void 0;const g=t.y>0==n.y>0;return to(t)&&to(n)&&g}}const io={panStep:100,bearingStep:15,pitchStep:10};class vl{constructor(t){this._tr=new rn(t);const n=io;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,s=0,c=0,h=0,g=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?s=-1:(t.preventDefault(),h=-1);break;case 39:t.shiftKey?s=1:(t.preventDefault(),h=1);break;case 38:t.shiftKey?c=1:(t.preventDefault(),g=-1);break;case 40:t.shiftKey?c=-1:(t.preventDefault(),g=1);break;default:return}return this._rotationDisabled&&(s=0,c=0),{cameraAnimation:_=>{const x=this._tr;_.easeTo({duration:300,easeId:"keyboardHandler",easing:bl,zoom:n?Math.round(x.zoom)+n*(t.shiftKey?2:1):x.zoom,bearing:x.bearing+s*this._bearingStep,pitch:x.pitch+c*this._pitchStep,offset:[-h*this._panStep,-g*this._panStep],center:x.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 bl(u){return u*(2-u)}const wl=4.000244140625;class Cc{constructor(t,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=t,this._tr=new rn(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=n,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 n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const s=l.h.now(),c=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,n!==0&&n%wl==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":c>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(c*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,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 n=X.mousePos(this._el,t),s=this._tr;this._around=l.L.convert(this._aroundCenter?s.center:s.unproject(n)),this._aroundPoint=s.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 _=this._type==="wheel"&&Math.abs(this._delta)>wl?this._wheelZoomRate:this._defaultZoomRate;let x=2/(1+Math.exp(-Math.abs(this._delta*_)));this._delta<0&&x!==0&&(x=1/x);const b=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(b*x))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,s=this._startZoom,c=this._easing;let h,g=!1;if(this._type==="wheel"&&s&&c){const _=Math.min((l.h.now()-this._lastWheelEventTime)/200,1),x=c(_);h=l.B.number(s,n,x),_<1?this._frameId||(this._frameId=!0):g=!0}else h=n,g=!0;return this._active=!0,g&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!g,zoomDelta:h-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=l.bb;if(this._prevEase){const s=this._prevEase,c=(l.h.now()-s.start)/s.duration,h=s.easing(c+.01)-s.easing(c),g=.27/Math.sqrt(h*h+1e-4)*.01,_=Math.sqrt(.0729-g*g);n=l.ba(g,_,.25,1)}return this._prevEase={start:l.h.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class ro{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 no{constructor(t){this._tr=new rn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ao{constructor(){this._tap=new cs({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,n,s){if(!this._swipePoint)if(this._tapTime){const c=n[0],h=t.timeStamp-this._tapTime<500,g=this._tapPoint.dist(c)<30;h&&g?s.length>0&&(this._swipePoint=c,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(t,n,s)}touchmove(t,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const c=n[0],h=c.y-this._swipePoint.y;return this._swipePoint=c,t.preventDefault(),this._active=!0,{zoomDelta:h/128}}}else this._tap.touchmove(t,n,s)}touchend(t,n,s){if(this._tapTime)this._swipePoint&&s.length===0&&this.reset();else{const c=this._tap.touchend(t,n,s);c&&(this._tapTime=t.timeStamp,this._tapPoint=c)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class so{constructor(t,n,s){this._el=t,this._mousePan=n,this._touchPan=s}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 Di{constructor(t,n,s){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=s}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 an{constructor(t,n,s,c){this._el=t,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=c,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 Sa=u=>u.zoom||u.drag||u.pitch||u.rotate;class oo extends l.k{}function Ta(u){return u.panDelta&&u.panDelta.mag()||u.zoomDelta||u.bearingDelta||u.pitchDelta}class lo{constructor(t,n){this.handleWindowEvent=c=>{this.handleEvent(c,`${c.type}Window`)},this.handleEvent=(c,h)=>{if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const g=c.type==="renderFrame"?void 0:c,_={needsRenderFrame:!1},x={},b={},T=c.touches,I=T?this._getMapTouches(T):void 0,P=I?X.touchPos(this._el,I):X.mousePos(this._el,c);for(const{handlerName:$,handler:B,allowed:Q}of this._handlers){if(!B.isEnabled())continue;let se;this._blockedByActive(b,Q,$)?B.reset():B[h||c.type]&&(se=B[h||c.type](c,P,I),this.mergeHandlerResult(_,x,se,$,g),se&&se.needsRenderFrame&&this._triggerRenderFrame()),(se||B.isActive())&&(b[$]=B)}const V={};for(const $ in this._previousActiveHandlers)b[$]||(V[$]=g);this._previousActiveHandlers=b,(Object.keys(V).length||Ta(_))&&(this._changes.push([_,x,V]),this._triggerRenderFrame()),(Object.keys(b).length||Ta(_))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:N}=_;N&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],N(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new dl(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[c,h,g]of this._listeners)X.addEventListener(c,h,c===document?this.handleWindowEvent:this.handleEvent,g)}destroy(){for(const[t,n,s]of this._listeners)X.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(t){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new ml(n,t));const c=n.boxZoom=new _l(n,t);this._add("boxZoom",c),t.interactive&&t.boxZoom&&c.enable();const h=new Rr(n),g=new no(n);n.doubleClickZoom=new ro(g,h),this._add("tapZoom",h),this._add("clickZoom",g),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();const _=new ao;this._add("tapDragZoom",_);const x=n.touchPitch=new Ac(n);this._add("touchPitch",x),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);const b=Kn(t),T=Or(t);n.dragRotate=new Di(t,b,T),this._add("mouseRotate",b,["mousePitch"]),this._add("mousePitch",T,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();const I=(({enable:Q,clickTolerance:se})=>{const G=new Qs({checkCorrectEvent:te=>X.mouseButton(te)===0&&!te.ctrlKey});return new Br({clickTolerance:se,move:(te,le)=>({around:le,panDelta:le.sub(te)}),activateOnStart:!0,moveStateManager:G,enable:Q,assignEvents:us})})(t),P=new De(t,n);n.dragPan=new so(s,I,P),this._add("mousePan",I),this._add("touchPan",P,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);const V=new eo,N=new xl;n.touchZoomRotate=new an(s,N,V,_),this._add("touchRotate",V,["touchPan","touchZoom"]),this._add("touchZoom",N,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);const $=n.scrollZoom=new Cc(n,(()=>this._triggerRenderFrame()));this._add("scrollZoom",$,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);const B=n.keyboard=new vl(n);this._add("keyboard",B),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new gl(n))}_add(t,n,s){this._handlers.push({handlerName:t,handler:n,allowed:s}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.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!!Sa(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,s){for(const c in t)if(c!==s&&(!n||n.indexOf(c)<0))return!0;return!1}_getMapTouches(t){const n=[];for(const s of t)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(t,n,s,c,h){if(!s)return;l.e(t,s);const g={handlerName:c,originalEvent:s.originalEvent||h};s.zoomDelta!==void 0&&(n.zoom=g),s.panDelta!==void 0&&(n.drag=g),s.pitchDelta!==void 0&&(n.pitch=g),s.bearingDelta!==void 0&&(n.rotate=g)}_applyChanges(){const t={},n={},s={};for(const[c,h,g]of this._changes)c.panDelta&&(t.panDelta=(t.panDelta||new l.P(0,0))._add(c.panDelta)),c.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+c.zoomDelta),c.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+c.bearingDelta),c.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+c.pitchDelta),c.around!==void 0&&(t.around=c.around),c.pinchAround!==void 0&&(t.pinchAround=c.pinchAround),c.noInertia&&(t.noInertia=c.noInertia),l.e(n,h),l.e(s,g);this._updateMapTransform(t,n,s),this._changes=[]}_updateMapTransform(t,n,s){const c=this._map,h=c._getTransformForUpdate(),g=c.terrain;if(!(Ta(t)||g&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:_,zoomDelta:x,bearingDelta:b,pitchDelta:T,around:I,pinchAround:P}=t;P!==void 0&&(I=P),c._stop(!0),I=I||c.transform.centerPoint;const V=h.pointLocation(_?I.sub(_):I);b&&(h.bearing+=b),T&&(h.pitch+=T),x&&(h.zoom+=x),g?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?h.center=h.pointLocation(h.centerPoint.sub(_)):h.setLocationAtPoint(V,I):(this._terrainMovement=!0,this._map._elevationFreeze=!0,h.setLocationAtPoint(V,I),this._map.once("moveend",(()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,h.recalculateZoom(c.terrain)}))):h.setLocationAtPoint(V,I),c._applyUpdatedTransform(h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,s,!0)}_fireEvents(t,n,s){const c=Sa(this._eventsInProgress),h=Sa(t),g={};for(const T in t){const{originalEvent:I}=t[T];this._eventsInProgress[T]||(g[`${T}start`]=I),this._eventsInProgress[T]=t[T]}!c&&h&&this._fireEvent("movestart",h.originalEvent);for(const T in g)this._fireEvent(T,g[T]);h&&this._fireEvent("move",h.originalEvent);for(const T in t){const{originalEvent:I}=t[T];this._fireEvent(T,I)}const _={};let x;for(const T in this._eventsInProgress){const{handlerName:I,originalEvent:P}=this._eventsInProgress[T];this._handlersById[I].isActive()||(delete this._eventsInProgress[T],x=n[I]||P,_[`${T}end`]=x)}for(const T in _)this._fireEvent(T,_[T]);const b=Sa(this._eventsInProgress);if(s&&(c||h)&&!b){this._updatingCamera=!0;const T=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),I=P=>P!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new oo("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Sl extends l.E{constructor(t,n){super(),this._renderFrameCallback=()=>{const s=Math.min((l.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new l.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,s){return t=l.P.convert(t).mult(-1),this.panTo(this.transform.center,l.e({offset:t},n),s)}panTo(t,n,s){return this.easeTo(l.e({center:t},n),s)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,s){return this.easeTo(l.e({zoom:t},n),s)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,s){return this.easeTo(l.e({bearing:t},n),s)}resetNorth(t,n){return this.rotateTo(0,l.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(l.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(s.zoom=l.B.number(c,x,ce)),this._rotating&&(s.bearing=l.B.number(h,b,ce)),this._pitching&&(s.pitch=l.B.number(g,T,ce)),this._padding&&(s.interpolatePadding(_,I,ce),V=s.centerPoint.add(P)),this.terrain&&!t.freezeElevation&&this._updateElevation(ce),G)s.setLocationAtPoint(G,te);else{const fe=s.zoomScale(s.zoom-c),xe=x>c?Math.min(2,se):Math.max(.5,se),_e=Math.pow(xe,1-ce),Se=s.unproject(B.add(Q.mult(ce*_e)).mult(fe));s.setLocationAtPoint(s.renderWorldCopies?Se.wrap():Se,V)}this._applyUpdatedTransform(s),this._fireMoveEvents(n)}),(ce=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,ce)}),t),this}_prepareEase(t,n,s={}){this._moving=!0,n||s.moving||this.fire(new l.k("movestart",t)),this._zooming&&!s.zooming&&this.fire(new l.k("zoomstart",t)),this._rotating&&!s.rotating&&this.fire(new l.k("rotatestart",t)),this._pitching&&!s.pitching&&this.fire(new l.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 n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(s-(n-(s*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=l.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 n=t.clone(),{center:s,zoom:c,pitch:h,bearing:g,elevation:_}=this.transformCameraUpdate(n);s&&(n.center=s),c!==void 0&&(n.zoom=c),h!==void 0&&(n.pitch=h),g!==void 0&&(n.bearing=g),_!==void 0&&(n.elevation=_),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new l.k("move",t)),this._zooming&&this.fire(new l.k("zoom",t)),this._rotating&&this.fire(new l.k("rotate",t)),this._pitching&&this.fire(new l.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,c=this._rotating,h=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new l.k("zoomend",t)),c&&this.fire(new l.k("rotateend",t)),h&&this.fire(new l.k("pitchend",t)),this.fire(new l.k("moveend",t))}flyTo(t,n){if(!t.essential&&l.h.prefersReducedMotion){const Ve=l.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ve,n)}this.stop(),t=l.e({offset:[0,0],speed:1.2,curve:1.42,easing:l.bb},t);const s=this._getTransformForUpdate(),c=this.getZoom(),h=this.getBearing(),g=this.getPitch(),_=this.getPadding(),x="zoom"in t?l.ad(+t.zoom,s.minZoom,s.maxZoom):c,b="bearing"in t?this._normalizeBearing(t.bearing,h):h,T="pitch"in t?+t.pitch:g,I="padding"in t?t.padding:s.padding,P=s.zoomScale(x-c),V=l.P.convert(t.offset);let N=s.centerPoint.add(V);const $=s.pointLocation(N),B=l.L.convert(t.center||$);this._normalizeCenter(B);const Q=s.project($),se=s.project(B).sub(Q);let G=t.curve;const te=Math.max(s.width,s.height),le=te/P,ce=se.mag();if("minZoom"in t){const Ve=l.ad(Math.min(t.minZoom,c,x),s.minZoom,s.maxZoom),wt=te/s.zoomScale(Ve-c);G=Math.sqrt(wt/ce*2)}const fe=G*G;function xe(Ve){const wt=(le*le-te*te+(Ve?-1:1)*fe*fe*ce*ce)/(2*(Ve?le:te)*fe*ce);return Math.log(Math.sqrt(wt*wt+1)-wt)}function _e(Ve){return(Math.exp(Ve)-Math.exp(-Ve))/2}function Se(Ve){return(Math.exp(Ve)+Math.exp(-Ve))/2}const Oe=xe(!1);let lt=function(Ve){return Se(Oe)/Se(Oe+G*Ve)},ke=function(Ve){return te*((Se(Oe)*(_e(wt=Oe+G*Ve)/Se(wt))-_e(Oe))/fe)/ce;var wt},He=(xe(!0)-Oe)/G;if(Math.abs(ce)<1e-6||!isFinite(He)){if(Math.abs(te-le)<1e-6)return this.easeTo(t,n);const Ve=let.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=h!==b,this._pitching=T!==g,this._padding=!s.isPaddingEqual(I),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(B),this._ease((Ve=>{const wt=Ve*He,ot=1/lt(wt);s.zoom=Ve===1?x:c+s.scaleZoom(ot),this._rotating&&(s.bearing=l.B.number(h,b,Ve)),this._pitching&&(s.pitch=l.B.number(g,T,Ve)),this._padding&&(s.interpolatePadding(_,I,Ve),N=s.centerPoint.add(V)),this.terrain&&!t.freezeElevation&&this._updateElevation(Ve);const et=Ve===1?B:s.unproject(Q.add(se.mult(ke(wt))).mult(ot));s.setLocationAtPoint(s.renderWorldCopies?et.wrap():et,N),this._applyUpdatedTransform(s),this._fireMoveEvents(n)}),(()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const s=this._onEaseEnd;delete this._onEaseEnd,s.call(this,n)}if(!t){const s=this.handlers;s&&s.stop(!1)}return this}_ease(t,n,s){s.animate===!1||s.duration===0?(t(1),n()):(this._easeStart=l.h.now(),this._easeOptions=s,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=l.b5(t,-180,180);const s=Math.abs(t-n);return Math.abs(t-360-n)180?-360:s<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(l.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Gi{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=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.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=X.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=X.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=X.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(){X.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,n){const s=this._map._getUIString(`AttributionControl.${n}`);t.title=s,t.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((c=>typeof c!="string"?"":c))):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const c=this._map.style.stylesheet;this.styleOwner=c.owner,this.styleId=c.id}const n=this._map.style.sourceCaches;for(const c in n){const h=n[c];if(h.used||h.usedForTerrain){const g=h.getSource();g.attribution&&t.indexOf(g.attribution)<0&&t.push(g.attribution)}}t=t.filter((c=>String(c).trim())),t.sort(((c,h)=>c.length-h.length)),t=t.filter(((c,h)=>{for(let g=h+1;g=0)return!1;return!0}));const s=t.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Et{constructor(t={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&s.classList.add("maplibregl-compact"):s.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=X.create("div","maplibregl-ctrl");const n=X.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){X.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ps{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(const c of s)if(c.id===t)return void(c.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const co={"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 Tl=l.Q([{name:"a_pos3d",type:"Int16",components:3}]);class Il extends l.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,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];const s={};for(const c of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))s[c.key]=!0,this._renderableTilesKeys.push(c.key),this._tiles[c.key]||(c.posMatrix=new Float64Array(16),l.aS(c.posMatrix,0,l.N,0,l.N,0,1),this._tiles[c.key]=new Kr(c,this.tileSize));for(const c in this._tiles)s[c]||delete this._tiles[c]}freeRtt(t){for(const n in this._tiles){const s=this._tiles[n];(!t||s.tileID.equals(t)||s.tileID.isChildOf(t)||t.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const n={};for(const s of this._renderableTilesKeys){const c=this._tiles[s].tileID;if(c.canonical.equals(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16),l.aS(h.posMatrix,0,l.N,0,l.N,0,1),n[s]=h}else if(c.canonical.isChildOf(t.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const g=c.canonical.z-t.canonical.z,_=c.canonical.x-(c.canonical.x>>g<>g<>g;l.aS(h.posMatrix,0,b,0,b,0,1),l.$(h.posMatrix,h.posMatrix,[-_*b,-x*b,0]),n[s]=h}else if(t.canonical.isChildOf(c.canonical)){const h=t.clone();h.posMatrix=new Float64Array(16);const g=t.canonical.z-c.canonical.z,_=t.canonical.x-(t.canonical.x>>g<>g<>g;l.aS(h.posMatrix,0,l.N,0,l.N,0,1),l.$(h.posMatrix,h.posMatrix,[_*b,x*b,0]),l.a0(h.posMatrix,h.posMatrix,[1/2**g,1/2**g,0]),n[s]=h}}return n}getSourceTile(t,n){const s=this.sourceCache._source;let c=t.overscaledZ-this.deltaZoom;if(c>s.maxzoom&&(c=s.maxzoom),c=s.minzoom&&(!h||!h.dem);)h=this.sourceCache.getTileByID(t.scaledTo(c--).key);return h}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter((n=>n.timeAdded>=t))}}class Al{constructor(t,n,s){this.painter=t,this.sourceCache=new Il(n),this.options=s,this.exaggeration=typeof s.exaggeration=="number"?s.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,s,c=l.N){var h;if(!(n>=0&&n=0&&st.canonical.z&&(t.canonical.z>=c?h=t.canonical.z-c:l.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const g=t.canonical.x-(t.canonical.x>>h<>h<>8<<4|h>>8,n[g+3]=0;const s=new l.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),c=new Ft(t,s,t.gl.RGBA,{premultiply:!1});return c.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=c,c}pointCoordinate(t){const n=new Uint8Array(4),s=this.painter.context,c=s.gl;s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),c.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,c.RGBA,c.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);const h=n[0]+(n[2]>>4<<8),g=n[1]+((15&n[2])<<8),_=this.coordsIndex[255-n[3]],x=_&&this.sourceCache.getTileByID(_);if(!x)return null;const b=this._coordsTextureSize,T=(1<0&&Math.sign(h)<0||!s&&Math.sign(c)<0&&Math.sign(h)>0?(c=360*Math.sign(h)+c,l.G(c)):n}}class kc{constructor(t,n,s){this._context=t,this._size=n,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new Ft(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(s.texture),{id:t,fbo:n,texture:s,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((n=>t.id!==n)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];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 Si={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ds{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new kc(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((s=>!t._layers[s].isHidden(n))),this._coordsDescendingInv={};for(const s in t.sourceCaches){this._coordsDescendingInv[s]={};const c=t.sourceCaches[s].getVisibleCoordinates();for(const h of c){const g=this.terrain.sourceCache.getTerrainCoords(h);for(const _ in g)this._coordsDescendingInv[s][_]||(this._coordsDescendingInv[s][_]=[]),this._coordsDescendingInv[s][_].push(g[_])}}this._coordsDescendingInvStr={};for(const s of t._order){const c=t._layers[s],h=c.source;if(Si[c.type]&&!this._coordsDescendingInvStr[h]){this._coordsDescendingInvStr[h]={};for(const g in this._coordsDescendingInv[h])this._coordsDescendingInvStr[h][g]=this._coordsDescendingInv[h][g].map((_=>_.key)).sort().join()}}for(const s of this._renderableTiles)for(const c in this._coordsDescendingInvStr){const h=this._coordsDescendingInvStr[c][s.tileID.key];h&&h!==s.rttCoords[c]&&(s.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const n=t.type,s=this.painter,c=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Si[n]&&(this._prevType&&Si[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!c))return!0;if(Si[this._prevType]||Si[n]&&c){this._prevType=n;const h=this._stacks.length-1,g=this._stacks[h]||[];for(const _ of this._renderableTiles){if(this.pool.isFull()&&($t(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(_),_.rtt[h]){const b=this.pool.getObjectForId(_.rtt[h].id);if(b.stamp===_.rtt[h].stamp){this.pool.useObject(b);continue}}const x=this.pool.getOrCreateFreeObject();this.pool.useObject(x),this.pool.stampObject(x),_.rtt[h]={id:x.id,stamp:x.stamp},s.context.bindFramebuffer.set(x.fbo.framebuffer),s.context.clear({color:l.aT.transparent,stencil:0}),s.currentStencilSource=void 0;for(let b=0;b{u.touchstart=u.dragStart,u.touchmoveWindow=u.dragMove,u.touchend=u.dragEnd},uo={showCompass:!0,showZoom:!0,visualizePitch:!1};class ho{constructor(t,n,s=!1){this.mousedown=g=>{this.startMouse(l.e({},g,{ctrlKey:!0,preventDefault:()=>g.preventDefault()}),X.mousePos(this.element,g)),X.addEventListener(window,"mousemove",this.mousemove),X.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=g=>{this.moveMouse(g,X.mousePos(this.element,g))},this.mouseup=g=>{this.mouseRotate.dragEnd(g),this.mousePitch&&this.mousePitch.dragEnd(g),this.offTemp()},this.touchstart=g=>{g.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=X.touchPos(this.element,g.targetTouches)[0],this.startTouch(g,this._startPos),X.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.addEventListener(window,"touchend",this.touchend))},this.touchmove=g=>{g.targetTouches.length!==1?this.reset():(this._lastPos=X.touchPos(this.element,g.targetTouches)[0],this.moveTouch(g,this._lastPos))},this.touchend=g=>{g.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 c=t.dragRotate._mouseRotate.getClickTolerance(),h=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Kn({clickTolerance:c,enable:!0}),this.touchRotate=(({enable:g,clickTolerance:_,bearingDegreesPerPixelMoved:x=.8})=>{const b=new yl;return new Br({clickTolerance:_,move:(T,I)=>({bearingDelta:(I.x-T.x)*x}),moveStateManager:b,enable:g,assignEvents:Ia})})({clickTolerance:c,enable:!0}),this.map=t,s&&(this.mousePitch=Or({clickTolerance:h,enable:!0}),this.touchPitch=(({enable:g,clickTolerance:_,pitchDegreesPerPixelMoved:x=-.5})=>{const b=new yl;return new Br({clickTolerance:_,move:(T,I)=>({pitchDelta:(I.y-T.y)*x}),moveStateManager:b,enable:g,assignEvents:Ia})})({clickTolerance:h,enable:!0})),X.addEventListener(n,"mousedown",this.mousedown),X.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),X.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),X.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),X.disableDrag()}moveMouse(t,n){const s=this.map,{bearingDelta:c}=this.mouseRotate.dragMove(t,n)||{};if(c&&s.setBearing(s.getBearing()+c),this.mousePitch){const{pitchDelta:h}=this.mousePitch.dragMove(t,n)||{};h&&s.setPitch(s.getPitch()+h)}}moveTouch(t,n){const s=this.map,{bearingDelta:c}=this.touchRotate.dragMove(t,n)||{};if(c&&s.setBearing(s.getBearing()+c),this.touchPitch){const{pitchDelta:h}=this.touchPitch.dragMove(t,n)||{};h&&s.setPitch(s.getPitch()+h)}}off(){const t=this.element;X.removeEventListener(t,"mousedown",this.mousedown),X.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend),X.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){X.enableDrag(),X.removeEventListener(window,"mousemove",this.mousemove),X.removeEventListener(window,"mouseup",this.mouseup),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend)}}let Ht;function po(u,t,n){if(u=new l.L(u.lng,u.lat),t){const s=new l.L(u.lng-360,u.lat),c=new l.L(u.lng+360,u.lat),h=n.locationPoint(u).distSqr(t);n.locationPoint(s).distSqr(t)180;){const s=n.locationPoint(u);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;u.lng>n.center.lng?u.lng-=360:u.lng+=360}return u}const or={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 Cl(u,t,n){const s=u.classList;for(const c in or)s.remove(`maplibregl-${n}-anchor-${c}`);s.add(`maplibregl-${n}-anchor-${t}`)}class Sn extends l.E{constructor(t){if(super(),this._onKeyPress=n=>{const s=n.code,c=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&c!==32&&c!==13||this.togglePopup()},this._onMapClick=n=>{const s=n.originalEvent.target,c=this._element;this._popup&&(s===c||c.contains(s))&&this.togglePopup()},this._update=n=>{if(!this._map)return;const s=this._map.loaded()&&!this._map.isMoving();((n==null?void 0:n.type)==="terrain"||(n==null?void 0:n.type)==="render"&&!s)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=po(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let c="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?c=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(c=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let h="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?h="rotateX(0deg)":this._pitchAlignment==="map"&&(h=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),X.setTransform(this._element,`${or[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${h} ${c}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout((()=>{const g=this._map.unproject(this._pos),_=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=g.distanceTo(this._lngLat)>20*_?"0.2":"1.0",this._opacityTimeout=null}),100))},this._onMove=n=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.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 l.k("dragstart"))),this.fire(new l.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 l.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.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=l.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=X.create("div"),this._element.setAttribute("aria-label","Map marker");const n=X.createNS("http://www.w3.org/2000/svg","svg"),s=41,c=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${s}px`),n.setAttributeNS(null,"width",`${c}px`),n.setAttributeNS(null,"viewBox",`0 0 ${c} ${s}`);const h=X.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"stroke","none"),h.setAttributeNS(null,"stroke-width","1"),h.setAttributeNS(null,"fill","none"),h.setAttributeNS(null,"fill-rule","evenodd");const g=X.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"fill-rule","nonzero");const _=X.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"transform","translate(3.0, 29.0)"),_.setAttributeNS(null,"fill","#000000");const x=[{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 Q of x){const se=X.createNS("http://www.w3.org/2000/svg","ellipse");se.setAttributeNS(null,"opacity","0.04"),se.setAttributeNS(null,"cx","10.5"),se.setAttributeNS(null,"cy","5.80029008"),se.setAttributeNS(null,"rx",Q.rx),se.setAttributeNS(null,"ry",Q.ry),_.appendChild(se)}const b=X.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"fill",this._color);const T=X.createNS("http://www.w3.org/2000/svg","path");T.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"),b.appendChild(T);const I=X.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"opacity","0.25"),I.setAttributeNS(null,"fill","#000000");const P=X.createNS("http://www.w3.org/2000/svg","path");P.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"),I.appendChild(P);const V=X.createNS("http://www.w3.org/2000/svg","g");V.setAttributeNS(null,"transform","translate(6.0, 7.0)"),V.setAttributeNS(null,"fill","#FFFFFF");const N=X.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"transform","translate(8.0, 8.0)");const $=X.createNS("http://www.w3.org/2000/svg","circle");$.setAttributeNS(null,"fill","#000000"),$.setAttributeNS(null,"opacity","0.25"),$.setAttributeNS(null,"cx","5.5"),$.setAttributeNS(null,"cy","5.5"),$.setAttributeNS(null,"r","5.4999962");const B=X.createNS("http://www.w3.org/2000/svg","circle");B.setAttributeNS(null,"fill","#FFFFFF"),B.setAttributeNS(null,"cx","5.5"),B.setAttributeNS(null,"cy","5.5"),B.setAttributeNS(null,"r","5.4999962"),N.appendChild($),N.appendChild(B),g.appendChild(_),g.appendChild(b),g.appendChild(I),g.appendChild(V),g.appendChild(N),n.appendChild(g),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",c*this._scale+"px"),this._element.appendChild(n),this._offset=l.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(n=>{n.preventDefault()})),this._element.addEventListener("mousedown",(n=>{n.preventDefault()})),Cl(this._element,this._anchor,"marker"),t&&t.className)for(const n of t.className.split(" "))this._element.classList.add(n);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),X.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=l.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 c=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":[c,-1*(38.1-13.5+c)],"bottom-right":[-c,-1*(38.1-13.5+c)],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=l.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 jt={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Nt=0,Jn=!1;const Aa={maxWidth:100,unit:"metric"};function Ca(u,t,n){const s=n&&n.maxWidth||100,c=u._container.clientHeight/2,h=u.unproject([0,c]),g=u.unproject([s,c]),_=h.distanceTo(g);if(n&&n.unit==="imperial"){const x=3.2808*_;x>5280?Tn(t,s,x/5280,u._getUIString("ScaleControl.Miles")):Tn(t,s,x,u._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Tn(t,s,_/1852,u._getUIString("ScaleControl.NauticalMiles")):_>=1e3?Tn(t,s,_/1e3,u._getUIString("ScaleControl.Kilometers")):Tn(t,s,_,u._getUIString("ScaleControl.Meters"))}function Tn(u,t,n,s){const c=(function(h){const g=Math.pow(10,`${Math.floor(h)}`.length-1);let _=h/g;return _=_>=10?10:_>=5?5:_>=3?3:_>=2?2:_>=1?1:(function(x){const b=Math.pow(10,Math.ceil(-Math.log(x)/Math.LN10));return Math.round(x*b)/b})(_),g*_})(n);u.style.width=t*(c/n)+"px",u.innerHTML=`${c} ${s}`}const fo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},mo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Qn(u){if(u){if(typeof u=="number"){const t=Math.round(Math.abs(u)/Math.SQRT2);return{center:new l.P(0,0),top:new l.P(0,u),"top-left":new l.P(t,t),"top-right":new l.P(-t,t),bottom:new l.P(0,-u),"bottom-left":new l.P(t,-t),"bottom-right":new l.P(-t,-t),left:new l.P(u,0),right:new l.P(-u,0)}}if(u instanceof l.P||Array.isArray(u)){const t=l.P.convert(u);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:l.P.convert(u.center||[0,0]),top:l.P.convert(u.top||[0,0]),"top-left":l.P.convert(u["top-left"]||[0,0]),"top-right":l.P.convert(u["top-right"]||[0,0]),bottom:l.P.convert(u.bottom||[0,0]),"bottom-left":l.P.convert(u["bottom-left"]||[0,0]),"bottom-right":l.P.convert(u["bottom-right"]||[0,0]),left:l.P.convert(u.left||[0,0]),right:l.P.convert(u.right||[0,0])}}return Qn(new l.P(0,0))}const go={extend:(u,...t)=>l.e(u,...t),run(u){u()},logToElement(u,t=!1,n="log"){const s=window.document.getElementById(n);s&&(t&&(s.innerHTML=""),s.innerHTML+=`
${u}`)}},_o=ue;class yt{static get version(){return _o}static get workerCount(){return xr.workerCount}static set workerCount(t){xr.workerCount=t}static get maxParallelImageRequests(){return l.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){l.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return l.c.WORKER_URL}static set workerUrl(t){l.c.WORKER_URL=t}static addProtocol(t,n){l.c.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete l.c.REGISTERED_PROTOCOLS[t]}}return yt.Map=class extends Sl{constructor(u){if(l.bg.mark(l.bh.create),(u=l.e({},Ge,u)).minZoom!=null&&u.maxZoom!=null&&u.minZoom>u.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(u.minPitch!=null&&u.maxPitch!=null&&u.minPitch>u.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(u.minPitch!=null&&u.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(u.maxPitch!=null&&u.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ls(u.minZoom,u.maxZoom,u.minPitch,u.maxPitch,u.renderWorldCopies),{bearingSnap:u.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 l.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new l.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=u.interactive,this._cooperativeGestures=u.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=u.maxTileCacheSize,this._maxTileCacheZoomLevels=u.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=u.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=u.preserveDrawingBuffer,this._antialias=u.antialias,this._trackResize=u.trackResize,this._bearingSnap=u.bearingSnap,this._refreshExpiredTiles=u.refreshExpiredTiles,this._fadeDuration=u.fadeDuration,this._crossSourceCollisions=u.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=u.collectResourceTiming,this._renderTaskQueue=new ps,this._controls=[],this._mapId=l.a2(),this._locale=l.e({},co,u.locale),this._clickTolerance=u.clickTolerance,this._overridePixelRatio=u.pixelRatio,this._maxCanvasSize=u.maxCanvasSize,this.transformCameraUpdate=u.transformCameraUpdate,this._imageQueueHandle=nt.addThrottleControl((()=>this.isMoving())),this._requestManager=new tt(u.transformRequest),typeof u.container=="string"){if(this._container=document.getElementById(u.container),!this._container)throw new Error(`Container '${u.container}' not found.`)}else{if(!(u.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=u.container}if(u.maxBounds&&this.setMaxBounds(u.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 n=wn((s=>{this._trackResize&&!this._removed&&this.resize(s)._update()}),50);this._resizeObserver=new ResizeObserver((s=>{t?n(s):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new lo(this,u),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=u.hash&&new va(typeof u.hash=="string"&&u.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:u.center,zoom:u.zoom,bearing:u.bearing,pitch:u.pitch}),u.bounds&&(this.resize(),this.fitBounds(u.bounds,l.e({},u.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=u.localIdeographFontFamily,this._validateStyle=u.validateStyle,u.style&&this.setStyle(u.style,{localIdeographFontFamily:u.localIdeographFontFamily}),u.attributionControl&&this.addControl(new Gi({customAttribution:u.customAttribution})),u.maplibreLogo&&this.addControl(new Et,u.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 l.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new l.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new l.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(u,t){if(t===void 0&&(t=u.getDefaultPosition?u.getDefaultPosition():"top-right"),!u||!u.onAdd)return this.fire(new l.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=u.onAdd(this);this._controls.push(u);const s=this._controlPositions[t];return t.indexOf("bottom")!==-1?s.insertBefore(n,s.firstChild):s.appendChild(n),this}removeControl(u){if(!u||!u.onRemove)return this.fire(new l.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(u);return t>-1&&this._controls.splice(t,1),u.onRemove(this),this}hasControl(u){return this._controls.indexOf(u)>-1}calculateCameraOptionsFromTo(u,t,n,s){return s==null&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(u,t,n,s)}resize(u){var t;const n=this._containerDimensions(),s=n[0],c=n[1],h=this._getClampedPixelRatio(s,c);if(this._resizeCanvas(s,c,h),this.painter.resize(s,c,h),this.painter.overLimit()){const _=this.painter.context.gl;this._maxCanvasSize=[_.drawingBufferWidth,_.drawingBufferHeight];const x=this._getClampedPixelRatio(s,c);this._resizeCanvas(s,c,x),this.painter.resize(s,c,x)}this.transform.resize(s,c),(t=this._requestedCameraState)===null||t===void 0||t.resize(s,c);const g=!this._moving;return g&&(this.stop(),this.fire(new l.k("movestart",u)).fire(new l.k("move",u))),this.fire(new l.k("resize",u)),g&&this.fire(new l.k("moveend",u)),this}_getClampedPixelRatio(u,t){const{0:n,1:s}=this._maxCanvasSize,c=this.getPixelRatio(),h=u*c,g=t*c;return Math.min(h>n?n/h:1,g>s?s/g:1)*c}getPixelRatio(){var u;return(u=this._overridePixelRatio)!==null&&u!==void 0?u:devicePixelRatio}setPixelRatio(u){this._overridePixelRatio=u,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(u){return this.transform.setMaxBounds(Mt.convert(u)),this._update()}setMinZoom(u){if((u=u??-2)>=-2&&u<=this.transform.maxZoom)return this.transform.minZoom=u,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=u,this._update(),this.getZoom()>u&&this.setZoom(u),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(u){if((u=u??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(u>=0&&u<=this.transform.maxPitch)return this.transform.minPitch=u,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(u>=this.transform.minPitch)return this.transform.maxPitch=u,this._update(),this.getPitch()>u&&this.setPitch(u),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(u){return this.transform.renderWorldCopies=u,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(u){return this._cooperativeGestures=u,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(u){return this.transform.locationPoint(l.L.convert(u),this.style&&this.terrain)}unproject(u){return this.transform.pointLocation(l.P.convert(u),this.terrain)}isMoving(){var u;return this._moving||((u=this.handlers)===null||u===void 0?void 0:u.isMoving())}isZooming(){var u;return this._zooming||((u=this.handlers)===null||u===void 0?void 0:u.isZooming())}isRotating(){var u;return this._rotating||((u=this.handlers)===null||u===void 0?void 0:u.isRotating())}_createDelegatedListener(u,t,n){if(u==="mouseenter"||u==="mouseover"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:h=>{const g=this.getLayer(t)?this.queryRenderedFeatures(h.point,{layers:[t]}):[];g.length?s||(s=!0,n.call(this,new Zi(u,this,h.originalEvent,{features:g}))):s=!1},mouseout:()=>{s=!1}}}}if(u==="mouseleave"||u==="mouseout"){let s=!1;return{layer:t,listener:n,delegates:{mousemove:g=>{(this.getLayer(t)?this.queryRenderedFeatures(g.point,{layers:[t]}):[]).length?s=!0:s&&(s=!1,n.call(this,new Zi(u,this,g.originalEvent)))},mouseout:g=>{s&&(s=!1,n.call(this,new Zi(u,this,g.originalEvent)))}}}}{const s=c=>{const h=this.getLayer(t)?this.queryRenderedFeatures(c.point,{layers:[t]}):[];h.length&&(c.features=h,n.call(this,c),delete c.features)};return{layer:t,listener:n,delegates:{[u]:s}}}}on(u,t,n){if(n===void 0)return super.on(u,t);const s=this._createDelegatedListener(u,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[u]=this._delegatedListeners[u]||[],this._delegatedListeners[u].push(s);for(const c in s.delegates)this.on(c,s.delegates[c]);return this}once(u,t,n){if(n===void 0)return super.once(u,t);const s=this._createDelegatedListener(u,t,n);for(const c in s.delegates)this.once(c,s.delegates[c]);return this}off(u,t,n){return n===void 0?super.off(u,t):(this._delegatedListeners&&this._delegatedListeners[u]&&(s=>{const c=this._delegatedListeners[u];for(let h=0;hthis._updateStyle(u,t)));const n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!u)),u?(this.style=new ui(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof u=="string"?this.style.loadURL(u,t,n):this.style.loadJSON(u,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(u,t){if(typeof u=="string"){const n=this._requestManager.transformRequest(u,st.Style);l.f(n,((s,c)=>{s?this.fire(new l.j(s)):c&&this._updateDiff(c,t)}))}else typeof u=="object"&&this._updateDiff(u,t)}_updateDiff(u,t){try{this.style.setState(u,t)&&this._update(!0)}catch(n){l.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(u,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():l.w("There is no style added to the map.")}addSource(u,t){return this._lazyInitEmptyStyle(),this.style.addSource(u,t),this._update(!0)}isSourceLoaded(u){const t=this.style&&this.style.sourceCaches[u];if(t!==void 0)return t.loaded();this.fire(new l.j(new Error(`There is no source with ID '${u}'`)))}setTerrain(u){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),u){const t=this.style.sourceCaches[u.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${u.source}`);for(const n in this.style._layers){const s=this.style._layers[n];s.type==="hillshade"&&s.source===u.source&&l.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 Al(this.painter,t,u),this.painter.renderToTexture=new ds(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=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==u.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(n.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 l.k("terrain",{terrain:u})),this}getTerrain(){var u,t;return(t=(u=this.terrain)===null||u===void 0?void 0:u.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const u=this.style&&this.style.sourceCaches;for(const t in u){const n=u[t]._tiles;for(const s in n){const c=n[s];if(c.state!=="loaded"&&c.state!=="errored")return!1}}return!0}addSourceType(u,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(u,t,n)}removeSource(u){return this.style.removeSource(u),this._update(!0)}getSource(u){return this.style.getSource(u)}addImage(u,t,n={}){const{pixelRatio:s=1,sdf:c=!1,stretchX:h,stretchY:g,content:_}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||l.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new l.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:x,height:b,data:T}=t,I=t;return this.style.addImage(u,{data:new l.R({width:x,height:b},new Uint8Array(T)),pixelRatio:s,stretchX:h,stretchY:g,content:_,sdf:c,version:0,userImage:I}),I.onAdd&&I.onAdd(this,u),this}}{const{width:x,height:b,data:T}=l.h.getImageData(t);this.style.addImage(u,{data:new l.R({width:x,height:b},T),pixelRatio:s,stretchX:h,stretchY:g,content:_,sdf:c,version:0})}}updateImage(u,t){const n=this.style.getImage(u);if(!n)return this.fire(new l.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=t instanceof HTMLImageElement||l.a(t)?l.h.getImageData(t):t,{width:c,height:h,data:g}=s;if(c===void 0||h===void 0)return this.fire(new l.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(c!==n.data.width||h!==n.data.height)return this.fire(new l.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const _=!(t instanceof HTMLImageElement||l.a(t));return n.data.replace(g,_),this.style.updateImage(u,n),this}getImage(u){return this.style.getImage(u)}hasImage(u){return u?!!this.style.getImage(u):(this.fire(new l.j(new Error("Missing required image id"))),!1)}removeImage(u){this.style.removeImage(u)}loadImage(u,t){nt.getImage(this._requestManager.transformRequest(u,st.Image),t)}listImages(){return this.style.listImages()}addLayer(u,t){return this._lazyInitEmptyStyle(),this.style.addLayer(u,t),this._update(!0)}moveLayer(u,t){return this.style.moveLayer(u,t),this._update(!0)}removeLayer(u){return this.style.removeLayer(u),this._update(!0)}getLayer(u){return this.style.getLayer(u)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(u,t,n){return this.style.setLayerZoomRange(u,t,n),this._update(!0)}setFilter(u,t,n={}){return this.style.setFilter(u,t,n),this._update(!0)}getFilter(u){return this.style.getFilter(u)}setPaintProperty(u,t,n,s={}){return this.style.setPaintProperty(u,t,n,s),this._update(!0)}getPaintProperty(u,t){return this.style.getPaintProperty(u,t)}setLayoutProperty(u,t,n,s={}){return this.style.setLayoutProperty(u,t,n,s),this._update(!0)}getLayoutProperty(u,t){return this.style.getLayoutProperty(u,t)}setGlyphs(u,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(u,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(u,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(u,t,n,(s=>{s||this._update(!0)})),this}removeSprite(u){return this._lazyInitEmptyStyle(),this.style.removeSprite(u),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(u,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(u,t,(n=>{n||this._update(!0)})),this}setLight(u,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(u,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(u,t){return this.style.setFeatureState(u,t),this._update()}removeFeatureState(u,t){return this.style.removeFeatureState(u,t),this._update()}getFeatureState(u){return this.style.getFeatureState(u)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let u=0,t=0;return this._container&&(u=this._container.clientWidth||400,t=this._container.clientHeight||300),[u,t]}_setupContainer(){const u=this._container;u.classList.add("maplibregl-map");const t=this._canvasContainer=X.create("div","maplibregl-canvas-container",u);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=X.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 n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);const c=this._controlContainer=X.create("div","maplibregl-control-container",u),h=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((g=>{h[g]=X.create("div",`maplibregl-ctrl-${g} `,c)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=X.create("div","maplibregl-cooperative-gesture-screen",this._container);let u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(u=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
${u}
${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(){X.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(s=>{t={requestedAttributes:u},s&&(t.statusMessage=s.statusMessage,t.type=s.type)}),{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new xn(n,this.transform),Le.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<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(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,h=l.h.now();this.style.zoomHistory.update(c,h);const g=new l.a8(c,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=g.crossFadingFactor();_===1&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),this.style.update(g)}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 l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bg.mark(l.bh.load),this.fire(new l.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,l.bg.mark(l.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.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),Qe.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.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),X.remove(this._canvasContainer),X.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),l.bg.clearMetrics(),this._removed=!0,this.fire(new l.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=l.h.frame((u=>{l.bg.frame(u),this._frame=null,this._render(u)})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return Ue}getCameraTargetElevation(){return this.transform.elevation}},_t.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),s=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.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,n)=>{const s=this._map._getUIString(`NavigationControl.${n}`);t.title=s,t.setAttribute("aria-label",s)},this.options=l.e({},uo,u),this._container=X.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}))),X.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}))),X.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=X.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,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 ho(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){X.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(u,t){const n=X.create("button",u,this._container);return n.type="button",n.addEventListener("click",t),n}},_t.GeolocateControl=class extends l.E{constructor(u){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new l.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 l.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new l.L(t.coords.longitude,t.coords.latitude),s=t.coords.accuracy,c=this._map.getBearing(),h=l.e({bearing:c},this.options.fitBoundsOptions),g=At.fromLngLat(n,s);this._map.fitBounds(g,h,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new l.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).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 n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Kn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new l.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",(n=>n.preventDefault())),this._geolocateButton=X.create("button","maplibregl-ctrl-geolocate",this._container),X.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){l.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=X.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new bn({element:this._dotElement}),this._circleElement=X.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new bn({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",(n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.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 l.k("trackuserlocationend")))}))}},this.options=l.e({},Vt,u)}onAdd(u){return this._map=u,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),(function(t,n=!1){Zt===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then((s=>{Zt=s.state!=="denied",t(Zt)})).catch((()=>{Zt=!!window.navigator.geolocation,t(Zt)})):(Zt=!!window.navigator.geolocation,t(Zt)):t(Zt)})(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(),X.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Rt=0,Kn=!1}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),n=u.coords;return t&&(n.longitudet.getEast()||n.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 u=this._map.getBounds(),t=u.getSouthEast(),n=u.getNorthEast(),s=t.distanceTo(n),c=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}trigger(){if(!this._setup)return l.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 l.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Rt--,Kn=!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 l.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 l.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 u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Rt++,Rt>1?(u={maximumAge:6e5,timeout:0},Kn=!0):(u=this.options.positionOptions,Kn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}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)}},_t.AttributionControl=Zi,_t.LogoControl=Ct,_t.ScaleControl=class{constructor(u){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=l.e({},Ia,u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){X.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},_t.FullscreenControl=class extends l.E{constructor(u={}){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,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:l.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(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){X.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=X.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);X.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_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 l.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new l.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()}},_t.TerrainControl=class{constructor(u){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=u}onAdd(u){return this._map=u,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=X.create("button","maplibregl-ctrl-terrain",this._container),X.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(){X.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},_t.Popup=class extends l.E{constructor(u){super(),this.remove=()=>(this._content&&X.remove(this._content),this._container&&(X.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 l.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=X.create("div","maplibregl-popup",this._map.getContainer()),this._tip=X.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);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=po(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let s=this.options.anchor;const c=Yn(this.options.offset);if(!s){const g=this._container.offsetWidth,_=this._container.offsetHeight;let x;x=n.y+c.bottom.y<_?["top"]:n.y>this._map.transform.height-_?["bottom"]:[],n.xthis._map.transform.width-g/2&&x.push("right"),s=x.length===0?"bottom":x.join("-")}const h=n.add(c[s]).round();X.setTransform(this._container,`${or[s]} translate(${h.x}px,${h.y}px)`),Cl(this._container,s,"popup")},this._onClose=()=>{this.remove()},this.options=l.e(Object.create(fo),u)}addTo(u){return this._map&&this.remove(),this._map=u,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 l.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=l.L.convert(u),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(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=u;s=n.firstChild,s;)t.appendChild(s);return this.setDOMContent(t)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=X.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){this._container&&this._container.classList.add(u)}removeClassName(u){this._container&&this._container.classList.remove(u)}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}_createCloseButton(){this.options.closeButton&&(this._closeButton=X.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 u=this._container.querySelector(mo);u&&u.focus()}},_t.Marker=bn,_t.Style=ci,_t.LngLat=l.L,_t.LngLatBounds=At,_t.Point=l.P,_t.MercatorCoordinate=l.U,_t.Evented=l.E,_t.AJAXError=l.bi,_t.config=l.c,_t.CanvasSource=Hr,_t.GeoJSONSource=Gr,_t.ImageSource=er,_t.RasterDEMTileSource=Fn,_t.RasterTileSource=Ln,_t.VectorTileSource=un,_t.VideoSource=ca,_t.setRTLTextPlugin=l.bj,_t.getRTLTextPluginStatus=l.bk,_t.prewarm=function(){Na().acquire(ft)},_t.clearPrewarmedResources=function(){const u=zr;u&&(u.isPreloaded()&&u.numActive()===1?(u.release(ft),zr=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()"))},go.extend(_t,{isSafari:l.ac,getPerformanceMetrics:l.bg.getPerformanceMetrics}),_t}));var Y=F;return Y}))})(Bo)),Bo.exports}var cd=ld();const xu=sd(cd);function vu(d,A,D,V,F,te,Y,l){var ue=typeof d=="function"?d.options:d;return A&&(ue.render=A,ue.staticRenderFns=D,ue._compiled=!0),{exports:d,options:ue}}const ud={props:{center:{type:Object,required:!0},zoom:{type:Number,required:!0},markers:{type:Array,default:()=>[]},selectedMarkerId:{type:String,default:null}},setup(d,{emit:A}){const D=Vue.ref(null),V=Vue.ref(null),F=Vue.ref(!0),te=Vue.ref(new Map),Y=Vue.ref(!1);Vue.onMounted(async()=>{await Vue.nextTick(),l()}),Vue.onBeforeUnmount(()=>{V.value&&(V.value.remove(),V.value=null),te.value.clear()}),Vue.watch(()=>d.center,he=>{if(V.value&&V.value.loaded()&&!Y.value){const Fe=V.value.getCenter();(Math.abs(Fe.lat-he.lat)>1e-5||Math.abs(Fe.lng-he.lon)>1e-5)&&V.value.setCenter([he.lon,he.lat])}},{deep:!0}),Vue.watch(()=>d.zoom,he=>{if(V.value&&V.value.loaded()){const Fe=V.value.getZoom();Math.abs(Fe-he)>.01&&V.value.setZoom(he)}}),Vue.watch(()=>d.markers,()=>{ue()},{deep:!0}),Vue.watch(()=>d.selectedMarkerId,he=>{Le(he)});function l(){if(!D.value){console.error("Map container not found");return}F.value=!0;try{V.value=new xu.Map({container:D.value,style:{version:8,sources:{osm:{type:"raster",tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png","https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256,attribution:'© OpenStreetMap contributors'}},layers:[{id:"osm",type:"raster",source:"osm",minzoom:0,maxzoom:19}]},center:[d.center.lon,d.center.lat],zoom:d.zoom}),V.value.on("load",()=>{F.value=!1,ue()}),V.value.on("click",he=>{he.originalEvent.target.closest(".custom-marker")||A("map-click",{lat:he.lngLat.lat,lng:he.lngLat.lng})})}catch(he){console.error("Error initializing map:",he),F.value=!1}}function ue(){!V.value||!V.value.loaded()||(te.value.forEach(({marker:he})=>{he&&he.remove()}),te.value.clear(),d.markers&&Array.isArray(d.markers)&&d.markers.forEach((he,Fe)=>{X(he,Fe)}))}function X(he,Fe){if(!V.value||!he||!he.position)return;const Ke=document.createElement("div");Ke.className="custom-marker",d.selectedMarkerId===he.id&&Ke.classList.add("selected");const ot=document.createElement("div");ot.className="marker-number",ot.textContent=Fe+1,Ke.appendChild(ot);try{const Qe=new xu.Marker({element:Ke,draggable:!0}).setLngLat([he.position.lon,he.position.lat]).addTo(V.value);Qe.on("dragstart",()=>{Y.value=!0}),Qe.on("dragend",()=>{const lt=Qe.getLngLat();A("marker-moved",{markerId:he.id,position:{lat:lt.lat,lng:lt.lng}}),setTimeout(()=>{Y.value=!1},100)}),Ke.addEventListener("click",lt=>{lt.stopPropagation(),A("marker-click",he.id)}),te.value.set(he.id,{marker:Qe,element:Ke})}catch(Qe){console.error("Error adding marker to map:",Qe)}}function Le(he){te.value.forEach(({element:Fe},Ke)=>{Fe&&(Ke===he?Fe.classList.add("selected"):Fe.classList.remove("selected"))})}function we(){if(V.value&&V.value.loaded()){const he=V.value.getCenter();return{lat:he.lat,lon:he.lng}}return{lat:d.center.lat,lon:d.center.lon}}return{mapContainer:D,loading:F,getCurrentCenter:we}}};var hd=function(){var A=this,D=A._self._c;return D("div",{staticClass:"map-preview"},[D("div",{ref:"mapContainer",staticClass:"map-container"}),A.loading?D("div",{staticClass:"map-loading"},[D("div",{staticClass:"spinner"}),D("span",[A._v("Loading map...")])]):A._e()])},pd=[],dd=vu(ud,hd,pd);const fd=dd.exports;/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function bu(d){return typeof d>"u"||d===null}function md(d){return typeof d=="object"&&d!==null}function gd(d){return Array.isArray(d)?d:bu(d)?[]:[d]}function _d(d,A){var D,V,F,te;if(A)for(te=Object.keys(A),D=0,V=te.length;D{t={requestedAttributes:u},s&&(t.statusMessage=s.statusMessage,t.type=s.type)}),{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new bn(n,this.transform),Fe.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<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(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,h=l.h.now();this.style.zoomHistory.update(c,h);const g=new l.a8(c,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=g.crossFadingFactor();_===1&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),this.style.update(g)}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 l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bg.mark(l.bh.load),this.fire(new l.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,l.bg.mark(l.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.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),nt.removeThrottleControl(this._imageQueueHandle),(u=this._resizeObserver)===null||u===void 0||u.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),X.remove(this._canvasContainer),X.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),l.bg.clearMetrics(),this._removed=!0,this.fire(new l.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=l.h.frame((u=>{l.bg.frame(u),this._frame=null,this._render(u)})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(u){this._showTileBoundaries!==u&&(this._showTileBoundaries=u,this._update())}get showPadding(){return!!this._showPadding}set showPadding(u){this._showPadding!==u&&(this._showPadding=u,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(u){this._showCollisionBoxes!==u&&(this._showCollisionBoxes=u,u?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(u){this._showOverdrawInspector!==u&&(this._showOverdrawInspector=u,this._update())}get repaint(){return!!this._repaint}set repaint(u){this._repaint!==u&&(this._repaint=u,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(u){this._vertices=u,this._update()}get version(){return $e}getCameraTargetElevation(){return this.transform.elevation}},yt.NavigationControl=class{constructor(u){this._updateZoomButtons=()=>{const t=this._map.getZoom(),n=t===this._map.getMaxZoom(),s=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.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,n)=>{const s=this._map._getUIString(`NavigationControl.${n}`);t.title=s,t.setAttribute("aria-label",s)},this.options=l.e({},uo,u),this._container=X.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}))),X.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}))),X.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=X.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(u){return this._map=u,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 ho(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){X.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(u,t){const n=X.create("button",u,this._container);return n.type="button",n.addEventListener("click",t),n}},yt.GeolocateControl=class extends l.E{constructor(u){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new l.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 l.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const n=new l.L(t.coords.longitude,t.coords.latitude),s=t.coords.accuracy,c=this._map.getBearing(),h=l.e({bearing:c},this.options.fitBoundsOptions),g=Mt.fromLngLat(n,s);this._map.fitBounds(g,h,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const n=new l.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).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 n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&Jn)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new l.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",(n=>n.preventDefault())),this._geolocateButton=X.create("button","maplibregl-ctrl-geolocate",this._container),X.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){l.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=X.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Sn({element:this._dotElement}),this._circleElement=X.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Sn({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",(n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.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 l.k("trackuserlocationend")))}))}},this.options=l.e({},jt,u)}onAdd(u){return this._map=u,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),(function(t,n=!1){Ht===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then((s=>{Ht=s.state!=="denied",t(Ht)})).catch((()=>{Ht=!!window.navigator.geolocation,t(Ht)})):(Ht=!!window.navigator.geolocation,t(Ht)):t(Ht)})(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(),X.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Nt=0,Jn=!1}_isOutOfMapMaxBounds(u){const t=this._map.getMaxBounds(),n=u.coords;return t&&(n.longitudet.getEast()||n.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 u=this._map.getBounds(),t=u.getSouthEast(),n=u.getNorthEast(),s=t.distanceTo(n),c=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}trigger(){if(!this._setup)return l.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 l.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Nt--,Jn=!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 l.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 l.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 u;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Nt++,Nt>1?(u={maximumAge:6e5,timeout:0},Jn=!0):(u=this.options.positionOptions,Jn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,u)}}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)}},yt.AttributionControl=Gi,yt.LogoControl=Et,yt.ScaleControl=class{constructor(u){this._onMove=()=>{Ca(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ca(this._map,this._container,this.options)},this.options=l.e({},Aa,u)}getDefaultPosition(){return"bottom-left"}onAdd(u){return this._map=u,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-scale",u.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){X.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},yt.FullscreenControl=class extends l.E{constructor(u={}){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,u&&u.container&&(u.container instanceof HTMLElement?this._container=u.container:l.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(u){return this._map=u,this._container||(this._container=this._map.getContainer()),this._controlContainer=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){X.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const u=this._fullscreenButton=X.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);X.create("span","maplibregl-ctrl-icon",u).setAttribute("aria-hidden","true"),u.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const u=this._getTitle();this._fullscreenButton.setAttribute("aria-label",u),this._fullscreenButton.title=u}_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 l.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new l.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()}},yt.TerrainControl=class{constructor(u){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=u}onAdd(u){return this._map=u,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=X.create("button","maplibregl-ctrl-terrain",this._container),X.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(){X.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},yt.Popup=class extends l.E{constructor(u){super(),this.remove=()=>(this._content&&X.remove(this._content),this._container&&(X.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 l.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=X.create("div","maplibregl-popup",this._map.getContainer()),this._tip=X.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const g of this.options.className.split(" "))this._container.classList.add(g);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=po(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let s=this.options.anchor;const c=Qn(this.options.offset);if(!s){const g=this._container.offsetWidth,_=this._container.offsetHeight;let x;x=n.y+c.bottom.y<_?["top"]:n.y>this._map.transform.height-_?["bottom"]:[],n.xthis._map.transform.width-g/2&&x.push("right"),s=x.length===0?"bottom":x.join("-")}const h=n.add(c[s]).round();X.setTransform(this._container,`${or[s]} translate(${h.x}px,${h.y}px)`),Cl(this._container,s,"popup")},this._onClose=()=>{this.remove()},this.options=l.e(Object.create(fo),u)}addTo(u){return this._map&&this.remove(),this._map=u,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 l.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(u){return this._lngLat=l.L.convert(u),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(u){return this.setDOMContent(document.createTextNode(u))}setHTML(u){const t=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=u;s=n.firstChild,s;)t.appendChild(s);return this.setDOMContent(t)}getMaxWidth(){var u;return(u=this._container)===null||u===void 0?void 0:u.style.maxWidth}setMaxWidth(u){return this.options.maxWidth=u,this._update(),this}setDOMContent(u){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=X.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(u),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(u){this._container&&this._container.classList.add(u)}removeClassName(u){this._container&&this._container.classList.remove(u)}setOffset(u){return this.options.offset=u,this._update(),this}toggleClassName(u){if(this._container)return this._container.classList.toggle(u)}_createCloseButton(){this.options.closeButton&&(this._closeButton=X.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 u=this._container.querySelector(mo);u&&u.focus()}},yt.Marker=Sn,yt.Style=ui,yt.LngLat=l.L,yt.LngLatBounds=Mt,yt.Point=l.P,yt.MercatorCoordinate=l.U,yt.Evented=l.E,yt.AJAXError=l.bi,yt.config=l.c,yt.CanvasSource=Wr,yt.GeoJSONSource=Hr,yt.ImageSource=er,yt.RasterDEMTileSource=Bn,yt.RasterTileSource=Rn,yt.VectorTileSource=pn,yt.VideoSource=ua,yt.setRTLTextPlugin=l.bj,yt.getRTLTextPluginStatus=l.bk,yt.prewarm=function(){Na().acquire(mt)},yt.clearPrewarmedResources=function(){const u=zr;u&&(u.isPreloaded()&&u.numActive()===1?(u.release(mt),zr=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()"))},go.extend(yt,{isSafari:l.ac,getPerformanceMetrics:l.bg.getPerformanceMetrics}),yt}));var K=R;return K}))})(Bo)),Bo.exports}var cd=ld();const vu=sd(cd);function Yl(d,S,M,L,R,ee,K,l){var ue=typeof d=="function"?d.options:d;return S&&(ue.render=S,ue.staticRenderFns=M,ue._compiled=!0),{exports:d,options:ue}}const ud={props:{center:{type:Object,required:!0},zoom:{type:Number,required:!0},markers:{type:Array,default:()=>[]},selectedMarkerId:{type:String,default:null}},setup(d,{emit:S}){const M=Vue.ref(null),L=Vue.ref(null),R=Vue.ref(!0),ee=Vue.ref(new Map),K=Vue.ref(!1);Vue.onMounted(async()=>{await Vue.nextTick(),l()}),Vue.onBeforeUnmount(()=>{L.value&&(L.value.remove(),L.value=null),ee.value.clear()}),Vue.watch(()=>d.center,we=>{if(L.value&&L.value.loaded()&&!K.value){const Re=L.value.getCenter();(Math.abs(Re.lat-we.lat)>1e-5||Math.abs(Re.lng-we.lon)>1e-5)&&L.value.setCenter([we.lon,we.lat])}},{deep:!0}),Vue.watch(()=>d.zoom,we=>{if(L.value&&L.value.loaded()){const Re=L.value.getZoom();Math.abs(Re-we)>.01&&L.value.setZoom(we)}}),Vue.watch(()=>d.markers,()=>{ue()},{deep:!0}),Vue.watch(()=>d.selectedMarkerId,we=>{Fe(we)});function l(){if(!M.value){console.error("Map container not found");return}R.value=!0;try{L.value=new vu.Map({container:M.value,style:{version:8,sources:{osm:{type:"raster",tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png","https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256,attribution:'© OpenStreetMap contributors'}},layers:[{id:"osm",type:"raster",source:"osm",minzoom:0,maxzoom:19}]},center:[d.center.lon,d.center.lat],zoom:d.zoom}),L.value.on("load",()=>{R.value=!1,ue()}),L.value.on("click",we=>{we.originalEvent.target.closest(".custom-marker")||S("map-click",{lat:we.lngLat.lat,lng:we.lngLat.lng})})}catch(we){console.error("Error initializing map:",we),R.value=!1}}function ue(){!L.value||!L.value.loaded()||(ee.value.forEach(({marker:we})=>{we&&we.remove()}),ee.value.clear(),d.markers&&Array.isArray(d.markers)&&d.markers.forEach((we,Re)=>{X(we,Re)}))}function X(we,Re){if(!L.value||!we||!we.position)return;const We=document.createElement("div");We.className="custom-marker",d.selectedMarkerId===we.id&&We.classList.add("selected");const nt=document.createElement("div");nt.className="marker-number",nt.textContent=Re+1,We.appendChild(nt);try{const st=new vu.Marker({element:We,draggable:!0,anchor:"bottom"}).setLngLat([we.position.lon,we.position.lat]).addTo(L.value);st.on("dragstart",()=>{K.value=!0}),st.on("dragend",()=>{const tt=st.getLngLat();S("marker-moved",{markerId:we.id,position:{lat:tt.lat,lng:tt.lng}}),setTimeout(()=>{K.value=!1},100)}),We.addEventListener("click",tt=>{tt.stopPropagation(),S("marker-click",we.id)}),We.addEventListener("dblclick",tt=>{tt.stopPropagation(),S("marker-dblclick",we.id)}),ee.value.set(we.id,{marker:st,element:We})}catch(st){console.error("Error adding marker to map:",st)}}function Fe(we){ee.value.forEach(({element:Re},We)=>{Re&&(We===we?Re.classList.add("selected"):Re.classList.remove("selected"))})}function be(){if(L.value&&L.value.loaded()){const we=L.value.getCenter();return{lat:we.lat,lon:we.lng}}return{lat:d.center.lat,lon:d.center.lon}}function ye(we,Re){L.value&&L.value.loaded()&&L.value.flyTo({center:[Re,we],zoom:L.value.getZoom(),duration:1e3})}return{mapContainer:M,loading:R,getCurrentCenter:be,centerOnPosition:ye}}};var hd=function(){var S=this,M=S._self._c;return M("div",{staticClass:"map-preview"},[M("div",{ref:"mapContainer",staticClass:"map-container"}),S.loading?M("div",{staticClass:"map-loading"},[M("div",{staticClass:"spinner"}),M("span",[S._v("Loading map...")])]):S._e()])},pd=[],dd=Yl(ud,hd,pd);const fd=dd.exports,md={props:{marker:{type:Object,required:!0},isNew:{type:Boolean,default:!1}},setup(d,{emit:S}){const M=JSON.parse(JSON.stringify(d.marker));M.description||(M.description=""),M.content||(M.content=[]),M.icon||(M.icon={type:"default",image:null});const L=Vue.ref(M),R=Vue.ref(!1);Vue.watch(L,()=>{R.value=!0},{deep:!0});const ee=Vue.computed(()=>L.value.title&&L.value.title.trim()!==""&&R.value);Vue.watch(()=>d.marker,Re=>{L.value=JSON.parse(JSON.stringify(Re))},{deep:!0});function K(){ee.value&&(S("save",L.value),S("close"))}function l(){L.value.icon.image=null}function ue(){L.value.icon.image=null,L.value.icon.type="default"}function X(){L.value.content.push({type:"text",text:""})}function Fe(){L.value.content.push({type:"image",image:null,caption:""})}function be(Re){L.value.content.splice(Re,1)}function ye(Re){if(Re===0)return;const We=L.value.content;[We[Re-1],We[Re]]=[We[Re],We[Re-1]]}function we(Re){if(Re===L.value.content.length-1)return;const We=L.value.content;[We[Re],We[Re+1]]=[We[Re+1],We[Re]]}return{localMarker:L,isValid:ee,saveMarker:K,clearCustomIcon:l,removeCustomIcon:ue,addTextBlock:X,addImageBlock:Fe,removeBlock:be,moveBlockUp:ye,moveBlockDown:we}}};var gd=function(){var S=this,M=S._self._c;return M("div",{staticClass:"marker-editor-overlay",on:{click:function(L){return L.target!==L.currentTarget?null:S.$emit("close")}}},[M("div",{staticClass:"marker-editor-modal"},[M("div",{staticClass:"editor-header"},[M("h2",[S._v(S._s(S.isNew?"Nouveau marqueur":"Modifier le marqueur"))]),M("button",{staticClass:"k-button k-button-icon",attrs:{type:"button"},on:{click:function(L){return S.$emit("close")}}},[M("k-icon",{attrs:{type:"cancel"}})],1)]),M("div",{staticClass:"marker-editor-content"},[M("div",{staticClass:"field"},[S._m(0),M("input",{directives:[{name:"model",rawName:"v-model",value:S.localMarker.title,expression:"localMarker.title"}],staticClass:"k-input",attrs:{type:"text",placeholder:"Titre du marqueur",maxlength:"100"},domProps:{value:S.localMarker.title},on:{input:function(L){L.target.composing||S.$set(S.localMarker,"title",L.target.value)}}})]),M("div",{staticClass:"field"},[M("label",{staticClass:"field-label"},[S._v(" Contenu ")]),M("textarea",{directives:[{name:"model",rawName:"v-model",value:S.localMarker.description,expression:"localMarker.description"}],staticClass:"k-textarea",attrs:{rows:"4",placeholder:"Description du marqueur"},domProps:{value:S.localMarker.description},on:{input:function(L){L.target.composing||S.$set(S.localMarker,"description",L.target.value)}}})]),M("div",{staticClass:"field-group"},[M("div",{staticClass:"field"},[M("label",{staticClass:"field-label"},[S._v("Latitude")]),M("input",{directives:[{name:"model",rawName:"v-model.number",value:S.localMarker.position.lat,expression:"localMarker.position.lat",modifiers:{number:!0}}],staticClass:"k-input",attrs:{type:"number",step:"0.000001",min:"-90",max:"90"},domProps:{value:S.localMarker.position.lat},on:{input:function(L){L.target.composing||S.$set(S.localMarker.position,"lat",S._n(L.target.value))},blur:function(L){return S.$forceUpdate()}}})]),M("div",{staticClass:"field"},[M("label",{staticClass:"field-label"},[S._v("Longitude")]),M("input",{directives:[{name:"model",rawName:"v-model.number",value:S.localMarker.position.lon,expression:"localMarker.position.lon",modifiers:{number:!0}}],staticClass:"k-input",attrs:{type:"number",step:"0.000001",min:"-180",max:"180"},domProps:{value:S.localMarker.position.lon},on:{input:function(L){L.target.composing||S.$set(S.localMarker.position,"lon",S._n(L.target.value))},blur:function(L){return S.$forceUpdate()}}})])]),M("div",{staticClass:"field"},[M("label",{staticClass:"field-label"},[S._v("Icône")]),M("div",{staticClass:"icon-selector"},[M("label",{staticClass:"radio-option"},[M("input",{directives:[{name:"model",rawName:"v-model",value:S.localMarker.icon.type,expression:"localMarker.icon.type"}],attrs:{type:"radio",value:"default"},domProps:{checked:S._q(S.localMarker.icon.type,"default")},on:{change:[function(L){return S.$set(S.localMarker.icon,"type","default")},S.clearCustomIcon]}}),M("span",[S._v("Épingle par défaut")])]),M("label",{staticClass:"radio-option"},[M("input",{directives:[{name:"model",rawName:"v-model",value:S.localMarker.icon.type,expression:"localMarker.icon.type"}],attrs:{type:"radio",value:"custom"},domProps:{checked:S._q(S.localMarker.icon.type,"custom")},on:{change:function(L){return S.$set(S.localMarker.icon,"type","custom")}}}),M("span",[S._v("Icône personnalisée")])])]),S.localMarker.icon.type==="custom"?M("div",{staticClass:"custom-icon-upload"},[M("input",{directives:[{name:"model",rawName:"v-model",value:S.localMarker.icon.image,expression:"localMarker.icon.image"}],staticClass:"k-input",attrs:{type:"text",placeholder:"Nom ou UUID du fichier"},domProps:{value:S.localMarker.icon.image},on:{input:function(L){L.target.composing||S.$set(S.localMarker.icon,"image",L.target.value)}}}),M("small",{staticClass:"field-help"},[S._v("Entrez le nom ou l'UUID d'une image depuis les fichiers de la page")])]):S._e()]),M("div",{staticClass:"dialog-footer"},[M("k-button",{attrs:{variant:"dimmed"},on:{click:function(L){return S.$emit("close")}}},[S._v("Annuler")]),M("k-button",{attrs:{disabled:!S.isValid},on:{click:S.saveMarker}},[S._v("Enregistrer")])],1)])])])},_d=[function(){var d=this,S=d._self._c;return S("label",{staticClass:"field-label"},[d._v(" Titre "),S("span",{staticClass:"required"},[d._v("*")])])}],yd=Yl(md,gd,_d);const xd=yd.exports;/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function bu(d){return typeof d>"u"||d===null}function vd(d){return typeof d=="object"&&d!==null}function bd(d){return Array.isArray(d)?d:bu(d)?[]:[d]}function wd(d,S){var M,L,R,ee;if(S)for(ee=Object.keys(S),M=0,L=ee.length;Ml&&(te=" ... ",A=V-l+te.length),D-V>l&&(Y=" ...",D=V+l-Y.length),{str:te+d.slice(A,D).replace(/\t/g,"→")+Y,pos:V-A+te.length}}function Jl(d,A){return si.repeat(" ",A-d.length)+d}function Ad(d,A){if(A=Object.create(A||null),!d.buffer)return null;A.maxLength||(A.maxLength=79),typeof A.indent!="number"&&(A.indent=1),typeof A.linesBefore!="number"&&(A.linesBefore=3),typeof A.linesAfter!="number"&&(A.linesAfter=2);for(var D=/\r?\n|\r|\0/g,V=[0],F=[],te,Y=-1;te=D.exec(d.buffer);)F.push(te.index),V.push(te.index+te[0].length),d.position<=te.index&&Y<0&&(Y=V.length-2);Y<0&&(Y=V.length-1);var l="",ue,X,Le=Math.min(d.line+A.linesAfter,F.length).toString().length,we=A.maxLength-(A.indent+Le+3);for(ue=1;ue<=A.linesBefore&&!(Y-ue<0);ue++)X=Yl(d.buffer,V[Y-ue],F[Y-ue],d.position-(V[Y]-V[Y-ue]),we),l=si.repeat(" ",A.indent)+Jl((d.line-ue+1).toString(),Le)+" | "+X.str+` -`+l;for(X=Yl(d.buffer,V[Y],F[Y],d.position,we),l+=si.repeat(" ",A.indent)+Jl((d.line+1).toString(),Le)+" | "+X.str+` -`,l+=si.repeat("-",A.indent+Le+3+X.pos)+`^ -`,ue=1;ue<=A.linesAfter&&!(Y+ue>=F.length);ue++)X=Yl(d.buffer,V[Y+ue],F[Y+ue],d.position-(V[Y]-V[Y+ue]),we),l+=si.repeat(" ",A.indent)+Jl((d.line+ue+1).toString(),Le)+" | "+X.str+` -`;return l.replace(/\n$/,"")}var Cd=Ad,kd=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ed=["scalar","sequence","mapping"];function Md(d){var A={};return d!==null&&Object.keys(d).forEach(function(D){d[D].forEach(function(V){A[String(V)]=D})}),A}function Pd(d,A){if(A=A||{},Object.keys(A).forEach(function(D){if(kd.indexOf(D)===-1)throw new Ni('Unknown option "'+D+'" is met in definition of "'+d+'" YAML type.')}),this.options=A,this.tag=d,this.kind=A.kind||null,this.resolve=A.resolve||function(){return!0},this.construct=A.construct||function(D){return D},this.instanceOf=A.instanceOf||null,this.predicate=A.predicate||null,this.represent=A.represent||null,this.representName=A.representName||null,this.defaultStyle=A.defaultStyle||null,this.multi=A.multi||!1,this.styleAliases=Md(A.styleAliases||null),Ed.indexOf(this.kind)===-1)throw new Ni('Unknown kind "'+this.kind+'" is specified for "'+d+'" YAML type.')}var xi=Pd;function Su(d,A){var D=[];return d[A].forEach(function(V){var F=D.length;D.forEach(function(te,Y){te.tag===V.tag&&te.kind===V.kind&&te.multi===V.multi&&(F=Y)}),D[F]=V}),D}function zd(){var d={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},A,D;function V(F){F.multi?(d.multi[F.kind].push(F),d.multi.fallback.push(F)):d[F.kind][F.tag]=d.fallback[F.tag]=F}for(A=0,D=arguments.length;A=0?"0b"+d.toString(2):"-0b"+d.toString(2).slice(1)},octal:function(d){return d>=0?"0o"+d.toString(8):"-0o"+d.toString(8).slice(1)},decimal:function(d){return d.toString(10)},hexadecimal:function(d){return d>=0?"0x"+d.toString(16).toUpperCase():"-0x"+d.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Zd=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Gd(d){return!(d===null||!Zd.test(d)||d[d.length-1]==="_")}function Hd(d){var A,D;return A=d.replace(/_/g,"").toLowerCase(),D=A[0]==="-"?-1:1,"+-".indexOf(A[0])>=0&&(A=A.slice(1)),A===".inf"?D===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:A===".nan"?NaN:D*parseFloat(A,10)}var Wd=/^[-+]?[0-9]+e/;function Xd(d,A){var D;if(isNaN(d))switch(A){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===d)switch(A){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===d)switch(A){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(si.isNegativeZero(d))return"-0.0";return D=d.toString(10),Wd.test(D)?D.replace("e",".e"):D}function Kd(d){return Object.prototype.toString.call(d)==="[object Number]"&&(d%1!==0||si.isNegativeZero(d))}var zu=new xi("tag:yaml.org,2002:float",{kind:"scalar",resolve:Gd,construct:Hd,predicate:Kd,represent:Xd,defaultStyle:"lowercase"}),Du=ku.extend({implicit:[Eu,Mu,Pu,zu]}),Lu=Du,Fu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ru=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Yd(d){return d===null?!1:Fu.exec(d)!==null||Ru.exec(d)!==null}function Jd(d){var A,D,V,F,te,Y,l,ue=0,X=null,Le,we,he;if(A=Fu.exec(d),A===null&&(A=Ru.exec(d)),A===null)throw new Error("Date resolve error");if(D=+A[1],V=+A[2]-1,F=+A[3],!A[4])return new Date(Date.UTC(D,V,F));if(te=+A[4],Y=+A[5],l=+A[6],A[7]){for(ue=A[7].slice(0,3);ue.length<3;)ue+="0";ue=+ue}return A[9]&&(Le=+A[10],we=+(A[11]||0),X=(Le*60+we)*6e4,A[9]==="-"&&(X=-X)),he=new Date(Date.UTC(D,V,F,te,Y,l,ue)),X&&he.setTime(he.getTime()-X),he}function Qd(d){return d.toISOString()}var Bu=new xi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Yd,construct:Jd,instanceOf:Date,represent:Qd});function ef(d){return d==="<<"||d===null}var Ou=new xi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ef}),ec=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function tf(d){if(d===null)return!1;var A,D,V=0,F=d.length,te=ec;for(D=0;D64)){if(A<0)return!1;V+=6}return V%8===0}function rf(d){var A,D,V=d.replace(/[\r\n=]/g,""),F=V.length,te=ec,Y=0,l=[];for(A=0;A>16&255),l.push(Y>>8&255),l.push(Y&255)),Y=Y<<6|te.indexOf(V.charAt(A));return D=F%4*6,D===0?(l.push(Y>>16&255),l.push(Y>>8&255),l.push(Y&255)):D===18?(l.push(Y>>10&255),l.push(Y>>2&255)):D===12&&l.push(Y>>4&255),new Uint8Array(l)}function nf(d){var A="",D=0,V,F,te=d.length,Y=ec;for(V=0;V>18&63],A+=Y[D>>12&63],A+=Y[D>>6&63],A+=Y[D&63]),D=(D<<8)+d[V];return F=te%3,F===0?(A+=Y[D>>18&63],A+=Y[D>>12&63],A+=Y[D>>6&63],A+=Y[D&63]):F===2?(A+=Y[D>>10&63],A+=Y[D>>4&63],A+=Y[D<<2&63],A+=Y[64]):F===1&&(A+=Y[D>>2&63],A+=Y[D<<4&63],A+=Y[64],A+=Y[64]),A}function af(d){return Object.prototype.toString.call(d)==="[object Uint8Array]"}var Nu=new xi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:tf,construct:rf,predicate:af,represent:nf}),sf=Object.prototype.hasOwnProperty,of=Object.prototype.toString;function lf(d){if(d===null)return!0;var A=[],D,V,F,te,Y,l=d;for(D=0,V=l.length;D>10)+55296,(d-65536&1023)+56320)}function Ku(d,A,D){A==="__proto__"?Object.defineProperty(d,A,{configurable:!0,enumerable:!0,writable:!0,value:D}):d[A]=D}for(var Yu=new Array(256),Ju=new Array(256),Da=0;Da<256;Da++)Yu[Da]=Xu(Da)?1:0,Ju[Da]=Xu(Da);function Tf(d,A){this.input=d,this.filename=A.filename||null,this.schema=A.schema||tc,this.onWarning=A.onWarning||null,this.legacy=A.legacy||!1,this.json=A.json||!1,this.listener=A.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=d.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Qu(d,A){var D={name:d.filename,buffer:d.input.slice(0,-1),position:d.position,line:d.line,column:d.position-d.lineStart};return D.snippet=Cd(D),new Ni(A,D)}function We(d,A){throw Qu(d,A)}function Vo(d,A){d.onWarning&&d.onWarning.call(null,Qu(d,A))}var eh={YAML:function(A,D,V){var F,te,Y;A.version!==null&&We(A,"duplication of %YAML directive"),V.length!==1&&We(A,"YAML directive accepts exactly one argument"),F=/^([0-9]+)\.([0-9]+)$/.exec(V[0]),F===null&&We(A,"ill-formed argument of the YAML directive"),te=parseInt(F[1],10),Y=parseInt(F[2],10),te!==1&&We(A,"unacceptable YAML version of the document"),A.version=V[0],A.checkLineBreaks=Y<2,Y!==1&&Y!==2&&Vo(A,"unsupported YAML version of the document")},TAG:function(A,D,V){var F,te;V.length!==2&&We(A,"TAG directive accepts exactly two arguments"),F=V[0],te=V[1],Gu.test(F)||We(A,"ill-formed tag handle (first argument) of the TAG directive"),Pn.call(A.tagMap,F)&&We(A,'there is a previously declared suffix for "'+F+'" tag handle'),Hu.test(te)||We(A,"ill-formed tag prefix (second argument) of the TAG directive");try{te=decodeURIComponent(te)}catch{We(A,"tag prefix is malformed: "+te)}A.tagMap[F]=te}};function zn(d,A,D,V){var F,te,Y,l;if(A1&&(d.result+=si.repeat(` -`,A-1))}function If(d,A,D){var V,F,te,Y,l,ue,X,Le,we=d.kind,he=d.result,Fe;if(Fe=d.input.charCodeAt(d.position),Yi(Fe)||za(Fe)||Fe===35||Fe===38||Fe===42||Fe===33||Fe===124||Fe===62||Fe===39||Fe===34||Fe===37||Fe===64||Fe===96||(Fe===63||Fe===45)&&(F=d.input.charCodeAt(d.position+1),Yi(F)||D&&za(F)))return!1;for(d.kind="scalar",d.result="",te=Y=d.position,l=!1;Fe!==0;){if(Fe===58){if(F=d.input.charCodeAt(d.position+1),Yi(F)||D&&za(F))break}else if(Fe===35){if(V=d.input.charCodeAt(d.position-1),Yi(V))break}else{if(d.position===d.lineStart&&Uo(d)||D&&za(Fe))break;if(qr(Fe))if(ue=d.line,X=d.lineStart,Le=d.lineIndent,ai(d,!1,-1),d.lineIndent>=A){l=!0,Fe=d.input.charCodeAt(d.position);continue}else{d.position=Y,d.line=ue,d.lineStart=X,d.lineIndent=Le;break}}l&&(zn(d,te,Y,!1),nc(d,d.line-ue),te=Y=d.position,l=!1),aa(Fe)||(Y=d.position+1),Fe=d.input.charCodeAt(++d.position)}return zn(d,te,Y,!1),d.result?!0:(d.kind=we,d.result=he,!1)}function Af(d,A){var D,V,F;if(D=d.input.charCodeAt(d.position),D!==39)return!1;for(d.kind="scalar",d.result="",d.position++,V=F=d.position;(D=d.input.charCodeAt(d.position))!==0;)if(D===39)if(zn(d,V,d.position,!0),D=d.input.charCodeAt(++d.position),D===39)V=d.position,d.position++,F=d.position;else return!0;else qr(D)?(zn(d,V,F,!0),nc(d,ai(d,!1,A)),V=F=d.position):d.position===d.lineStart&&Uo(d)?We(d,"unexpected end of the document within a single quoted scalar"):(d.position++,F=d.position);We(d,"unexpected end of the stream within a single quoted scalar")}function Cf(d,A){var D,V,F,te,Y,l;if(l=d.input.charCodeAt(d.position),l!==34)return!1;for(d.kind="scalar",d.result="",d.position++,D=V=d.position;(l=d.input.charCodeAt(d.position))!==0;){if(l===34)return zn(d,D,d.position,!0),d.position++,!0;if(l===92){if(zn(d,D,d.position,!0),l=d.input.charCodeAt(++d.position),qr(l))ai(d,!1,A);else if(l<256&&Yu[l])d.result+=Ju[l],d.position++;else if((Y=bf(l))>0){for(F=Y,te=0;F>0;F--)l=d.input.charCodeAt(++d.position),(Y=vf(l))>=0?te=(te<<4)+Y:We(d,"expected hexadecimal character");d.result+=Sf(te),d.position++}else We(d,"unknown escape sequence");D=V=d.position}else qr(l)?(zn(d,D,V,!0),nc(d,ai(d,!1,A)),D=V=d.position):d.position===d.lineStart&&Uo(d)?We(d,"unexpected end of the document within a double quoted scalar"):(d.position++,V=d.position)}We(d,"unexpected end of the stream within a double quoted scalar")}function kf(d,A){var D=!0,V,F,te,Y=d.tag,l,ue=d.anchor,X,Le,we,he,Fe,Ke=Object.create(null),ot,Qe,lt,$e;if($e=d.input.charCodeAt(d.position),$e===91)Le=93,Fe=!1,l=[];else if($e===123)Le=125,Fe=!0,l={};else return!1;for(d.anchor!==null&&(d.anchorMap[d.anchor]=l),$e=d.input.charCodeAt(++d.position);$e!==0;){if(ai(d,!0,A),$e=d.input.charCodeAt(d.position),$e===Le)return d.position++,d.tag=Y,d.anchor=ue,d.kind=Fe?"mapping":"sequence",d.result=l,!0;D?$e===44&&We(d,"expected the node content, but found ','"):We(d,"missed comma between flow collection entries"),Qe=ot=lt=null,we=he=!1,$e===63&&(X=d.input.charCodeAt(d.position+1),Yi(X)&&(we=he=!0,d.position++,ai(d,!0,A))),V=d.line,F=d.lineStart,te=d.position,Fa(d,A,Oo,!1,!0),Qe=d.tag,ot=d.result,ai(d,!0,A),$e=d.input.charCodeAt(d.position),(he||d.line===V)&&$e===58&&(we=!0,$e=d.input.charCodeAt(++d.position),ai(d,!0,A),Fa(d,A,Oo,!1,!0),lt=d.result),Fe?La(d,l,Ke,Qe,ot,lt,V,F,te):we?l.push(La(d,null,Ke,Qe,ot,lt,V,F,te)):l.push(ot),ai(d,!0,A),$e=d.input.charCodeAt(d.position),$e===44?(D=!0,$e=d.input.charCodeAt(++d.position)):D=!1}We(d,"unexpected end of the stream within a flow collection")}function Ef(d,A){var D,V,F=ic,te=!1,Y=!1,l=A,ue=0,X=!1,Le,we;if(we=d.input.charCodeAt(d.position),we===124)V=!1;else if(we===62)V=!0;else return!1;for(d.kind="scalar",d.result="";we!==0;)if(we=d.input.charCodeAt(++d.position),we===43||we===45)ic===F?F=we===43?Zu:gf:We(d,"repeat of a chomping mode identifier");else if((Le=wf(we))>=0)Le===0?We(d,"bad explicit indentation width of a block scalar; it cannot be less than one"):Y?We(d,"repeat of an indentation width identifier"):(l=A+Le-1,Y=!0);else break;if(aa(we)){do we=d.input.charCodeAt(++d.position);while(aa(we));if(we===35)do we=d.input.charCodeAt(++d.position);while(!qr(we)&&we!==0)}for(;we!==0;){for(rc(d),d.lineIndent=0,we=d.input.charCodeAt(d.position);(!Y||d.lineIndentl&&(l=d.lineIndent),qr(we)){ue++;continue}if(d.lineIndentA)&&ue!==0)We(d,"bad indentation of a sequence entry");else if(d.lineIndentA)&&(Qe&&(Y=d.line,l=d.lineStart,ue=d.position),Fa(d,A,No,!0,F)&&(Qe?Ke=d.result:ot=d.result),Qe||(La(d,we,he,Fe,Ke,ot,Y,l,ue),Fe=Ke=ot=null),ai(d,!0,-1),$e=d.input.charCodeAt(d.position)),(d.line===te||d.lineIndent>A)&&$e!==0)We(d,"bad indentation of a mapping entry");else if(d.lineIndentA?ue=1:d.lineIndent===A?ue=0:d.lineIndentA?ue=1:d.lineIndent===A?ue=0:d.lineIndent tag; it should be "scalar", not "'+d.kind+'"'),we=0,he=d.implicitTypes.length;we"),d.result!==null&&Ke.kind!==d.kind&&We(d,"unacceptable node kind for !<"+d.tag+'> tag; it should be "'+Ke.kind+'", not "'+d.kind+'"'),Ke.resolve(d.result,d.tag)?(d.result=Ke.construct(d.result,d.tag),d.anchor!==null&&(d.anchorMap[d.anchor]=d.result)):We(d,"cannot resolve a node with !<"+d.tag+"> explicit tag")}return d.listener!==null&&d.listener("close",d),d.tag!==null||d.anchor!==null||Le}function Lf(d){var A=d.position,D,V,F,te=!1,Y;for(d.version=null,d.checkLineBreaks=d.legacy,d.tagMap=Object.create(null),d.anchorMap=Object.create(null);(Y=d.input.charCodeAt(d.position))!==0&&(ai(d,!0,-1),Y=d.input.charCodeAt(d.position),!(d.lineIndent>0||Y!==37));){for(te=!0,Y=d.input.charCodeAt(++d.position),D=d.position;Y!==0&&!Yi(Y);)Y=d.input.charCodeAt(++d.position);for(V=d.input.slice(D,d.position),F=[],V.length<1&&We(d,"directive name must not be less than one character in length");Y!==0;){for(;aa(Y);)Y=d.input.charCodeAt(++d.position);if(Y===35){do Y=d.input.charCodeAt(++d.position);while(Y!==0&&!qr(Y));break}if(qr(Y))break;for(D=d.position;Y!==0&&!Yi(Y);)Y=d.input.charCodeAt(++d.position);F.push(d.input.slice(D,d.position))}Y!==0&&rc(d),Pn.call(eh,V)?eh[V](d,V,F):Vo(d,'unknown document directive "'+V+'"')}if(ai(d,!0,-1),d.lineIndent===0&&d.input.charCodeAt(d.position)===45&&d.input.charCodeAt(d.position+1)===45&&d.input.charCodeAt(d.position+2)===45?(d.position+=3,ai(d,!0,-1)):te&&We(d,"directives end mark is expected"),Fa(d,d.lineIndent-1,No,!1,!0),ai(d,!0,-1),d.checkLineBreaks&&yf.test(d.input.slice(A,d.position))&&Vo(d,"non-ASCII line breaks are interpreted as content"),d.documents.push(d.result),d.position===d.lineStart&&Uo(d)){d.input.charCodeAt(d.position)===46&&(d.position+=3,ai(d,!0,-1));return}if(d.position"u"&&(D=A,A=null);var V=rh(d,D);if(typeof A!="function")return V;for(var F=0,te=V.length;F=55296&&D<=56319&&A+1=56320&&V<=57343)?(D-55296)*1024+V-56320+65536:D}function mh(d){var A=/^\n* /;return A.test(d)}var gh=1,lc=2,_h=3,yh=4,Ra=5;function um(d,A,D,V,F,te,Y,l){var ue,X=0,Le=null,we=!1,he=!1,Fe=V!==-1,Ke=-1,ot=lm(Es(d,0))&&cm(Es(d,d.length-1));if(A||Y)for(ue=0;ue=65536?ue+=2:ue++){if(X=Es(d,ue),!ks(X))return Ra;ot=ot&&fh(X,Le,l),Le=X}else{for(ue=0;ue=65536?ue+=2:ue++){if(X=Es(d,ue),X===As)we=!0,Fe&&(he=he||ue-Ke-1>V&&d[Ke+1]!==" ",Ke=ue);else if(!ks(X))return Ra;ot=ot&&fh(X,Le,l),Le=X}he=he||Fe&&ue-Ke-1>V&&d[Ke+1]!==" "}return!we&&!he?ot&&!Y&&!F(d)?gh:te===Cs?Ra:lc:D>9&&mh(d)?Ra:Y?te===Cs?Ra:lc:he?yh:_h}function hm(d,A,D,V,F){d.dump=(function(){if(A.length===0)return d.quotingType===Cs?'""':"''";if(!d.noCompatMode&&(tm.indexOf(A)!==-1||im.test(A)))return d.quotingType===Cs?'"'+A+'"':"'"+A+"'";var te=d.indent*Math.max(1,D),Y=d.lineWidth===-1?-1:Math.max(Math.min(d.lineWidth,40),d.lineWidth-te),l=V||d.flowLevel>-1&&D>=d.flowLevel;function ue(X){return om(d,X)}switch(um(A,l,d.indent,Y,ue,d.quotingType,d.forceQuotes&&!V,F)){case gh:return A;case lc:return"'"+A.replace(/'/g,"''")+"'";case _h:return"|"+xh(A,d.indent)+vh(ph(A,te));case yh:return">"+xh(A,d.indent)+vh(ph(pm(A,Y),te));case Ra:return'"'+dm(A)+'"';default:throw new Ni("impossible error: invalid scalar style")}})()}function xh(d,A){var D=mh(d)?String(A):"",V=d[d.length-1]===` -`,F=V&&(d[d.length-2]===` +`+d.mark.snippet),L+" "+M):L}function Is(d,S){Error.call(this),this.name="YAMLException",this.reason=d,this.mark=S,this.message=wu(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Is.prototype=Object.create(Error.prototype),Is.prototype.constructor=Is,Is.prototype.toString=function(S){return this.name+": "+wu(this,S)};var Vi=Is;function Jl(d,S,M,L,R){var ee="",K="",l=Math.floor(R/2)-1;return L-S>l&&(ee=" ... ",S=L-l+ee.length),M-L>l&&(K=" ...",M=L+l-K.length),{str:ee+d.slice(S,M).replace(/\t/g,"→")+K,pos:L-S+ee.length}}function Ql(d,S){return li.repeat(" ",S-d.length)+d}function Pd(d,S){if(S=Object.create(S||null),!d.buffer)return null;S.maxLength||(S.maxLength=79),typeof S.indent!="number"&&(S.indent=1),typeof S.linesBefore!="number"&&(S.linesBefore=3),typeof S.linesAfter!="number"&&(S.linesAfter=2);for(var M=/\r?\n|\r|\0/g,L=[0],R=[],ee,K=-1;ee=M.exec(d.buffer);)R.push(ee.index),L.push(ee.index+ee[0].length),d.position<=ee.index&&K<0&&(K=L.length-2);K<0&&(K=L.length-1);var l="",ue,X,Fe=Math.min(d.line+S.linesAfter,R.length).toString().length,be=S.maxLength-(S.indent+Fe+3);for(ue=1;ue<=S.linesBefore&&!(K-ue<0);ue++)X=Jl(d.buffer,L[K-ue],R[K-ue],d.position-(L[K]-L[K-ue]),be),l=li.repeat(" ",S.indent)+Ql((d.line-ue+1).toString(),Fe)+" | "+X.str+` +`+l;for(X=Jl(d.buffer,L[K],R[K],d.position,be),l+=li.repeat(" ",S.indent)+Ql((d.line+1).toString(),Fe)+" | "+X.str+` +`,l+=li.repeat("-",S.indent+Fe+3+X.pos)+`^ +`,ue=1;ue<=S.linesAfter&&!(K+ue>=R.length);ue++)X=Jl(d.buffer,L[K+ue],R[K+ue],d.position-(L[K]-L[K+ue]),be),l+=li.repeat(" ",S.indent)+Ql((d.line+ue+1).toString(),Fe)+" | "+X.str+` +`;return l.replace(/\n$/,"")}var zd=Pd,Dd=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ld=["scalar","sequence","mapping"];function Fd(d){var S={};return d!==null&&Object.keys(d).forEach(function(M){d[M].forEach(function(L){S[String(L)]=M})}),S}function Rd(d,S){if(S=S||{},Object.keys(S).forEach(function(M){if(Dd.indexOf(M)===-1)throw new Vi('Unknown option "'+M+'" is met in definition of "'+d+'" YAML type.')}),this.options=S,this.tag=d,this.kind=S.kind||null,this.resolve=S.resolve||function(){return!0},this.construct=S.construct||function(M){return M},this.instanceOf=S.instanceOf||null,this.predicate=S.predicate||null,this.represent=S.represent||null,this.representName=S.representName||null,this.defaultStyle=S.defaultStyle||null,this.multi=S.multi||!1,this.styleAliases=Fd(S.styleAliases||null),Ld.indexOf(this.kind)===-1)throw new Vi('Unknown kind "'+this.kind+'" is specified for "'+d+'" YAML type.')}var vi=Rd;function Su(d,S){var M=[];return d[S].forEach(function(L){var R=M.length;M.forEach(function(ee,K){ee.tag===L.tag&&ee.kind===L.kind&&ee.multi===L.multi&&(R=K)}),M[R]=L}),M}function Bd(){var d={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},S,M;function L(R){R.multi?(d.multi[R.kind].push(R),d.multi.fallback.push(R)):d[R.kind][R.tag]=d.fallback[R.tag]=R}for(S=0,M=arguments.length;S=0?"0b"+d.toString(2):"-0b"+d.toString(2).slice(1)},octal:function(d){return d>=0?"0o"+d.toString(8):"-0o"+d.toString(8).slice(1)},decimal:function(d){return d.toString(10)},hexadecimal:function(d){return d>=0?"0x"+d.toString(16).toUpperCase():"-0x"+d.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Kd=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Yd(d){return!(d===null||!Kd.test(d)||d[d.length-1]==="_")}function Jd(d){var S,M;return S=d.replace(/_/g,"").toLowerCase(),M=S[0]==="-"?-1:1,"+-".indexOf(S[0])>=0&&(S=S.slice(1)),S===".inf"?M===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:S===".nan"?NaN:M*parseFloat(S,10)}var Qd=/^[-+]?[0-9]+e/;function ef(d,S){var M;if(isNaN(d))switch(S){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===d)switch(S){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===d)switch(S){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(li.isNegativeZero(d))return"-0.0";return M=d.toString(10),Qd.test(M)?M.replace("e",".e"):M}function tf(d){return Object.prototype.toString.call(d)==="[object Number]"&&(d%1!==0||li.isNegativeZero(d))}var zu=new vi("tag:yaml.org,2002:float",{kind:"scalar",resolve:Yd,construct:Jd,predicate:tf,represent:ef,defaultStyle:"lowercase"}),Du=ku.extend({implicit:[Mu,Eu,Pu,zu]}),Lu=Du,Fu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ru=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function rf(d){return d===null?!1:Fu.exec(d)!==null||Ru.exec(d)!==null}function nf(d){var S,M,L,R,ee,K,l,ue=0,X=null,Fe,be,ye;if(S=Fu.exec(d),S===null&&(S=Ru.exec(d)),S===null)throw new Error("Date resolve error");if(M=+S[1],L=+S[2]-1,R=+S[3],!S[4])return new Date(Date.UTC(M,L,R));if(ee=+S[4],K=+S[5],l=+S[6],S[7]){for(ue=S[7].slice(0,3);ue.length<3;)ue+="0";ue=+ue}return S[9]&&(Fe=+S[10],be=+(S[11]||0),X=(Fe*60+be)*6e4,S[9]==="-"&&(X=-X)),ye=new Date(Date.UTC(M,L,R,ee,K,l,ue)),X&&ye.setTime(ye.getTime()-X),ye}function af(d){return d.toISOString()}var Bu=new vi("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:rf,construct:nf,instanceOf:Date,represent:af});function sf(d){return d==="<<"||d===null}var Ou=new vi("tag:yaml.org,2002:merge",{kind:"scalar",resolve:sf}),tc=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function of(d){if(d===null)return!1;var S,M,L=0,R=d.length,ee=tc;for(M=0;M64)){if(S<0)return!1;L+=6}return L%8===0}function lf(d){var S,M,L=d.replace(/[\r\n=]/g,""),R=L.length,ee=tc,K=0,l=[];for(S=0;S>16&255),l.push(K>>8&255),l.push(K&255)),K=K<<6|ee.indexOf(L.charAt(S));return M=R%4*6,M===0?(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)):M===18?(l.push(K>>10&255),l.push(K>>2&255)):M===12&&l.push(K>>4&255),new Uint8Array(l)}function cf(d){var S="",M=0,L,R,ee=d.length,K=tc;for(L=0;L>18&63],S+=K[M>>12&63],S+=K[M>>6&63],S+=K[M&63]),M=(M<<8)+d[L];return R=ee%3,R===0?(S+=K[M>>18&63],S+=K[M>>12&63],S+=K[M>>6&63],S+=K[M&63]):R===2?(S+=K[M>>10&63],S+=K[M>>4&63],S+=K[M<<2&63],S+=K[64]):R===1&&(S+=K[M>>2&63],S+=K[M<<4&63],S+=K[64],S+=K[64]),S}function uf(d){return Object.prototype.toString.call(d)==="[object Uint8Array]"}var Nu=new vi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:of,construct:lf,predicate:uf,represent:cf}),hf=Object.prototype.hasOwnProperty,pf=Object.prototype.toString;function df(d){if(d===null)return!0;var S=[],M,L,R,ee,K,l=d;for(M=0,L=l.length;M>10)+55296,(d-65536&1023)+56320)}function Ku(d,S,M){S==="__proto__"?Object.defineProperty(d,S,{configurable:!0,enumerable:!0,writable:!0,value:M}):d[S]=M}for(var Yu=new Array(256),Ju=new Array(256),La=0;La<256;La++)Yu[La]=Xu(La)?1:0,Ju[La]=Xu(La);function Mf(d,S){this.input=d,this.filename=S.filename||null,this.schema=S.schema||ic,this.onWarning=S.onWarning||null,this.legacy=S.legacy||!1,this.json=S.json||!1,this.listener=S.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=d.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Qu(d,S){var M={name:d.filename,buffer:d.input.slice(0,-1),position:d.position,line:d.line,column:d.position-d.lineStart};return M.snippet=zd(M),new Vi(S,M)}function Xe(d,S){throw Qu(d,S)}function Vo(d,S){d.onWarning&&d.onWarning.call(null,Qu(d,S))}var eh={YAML:function(S,M,L){var R,ee,K;S.version!==null&&Xe(S,"duplication of %YAML directive"),L.length!==1&&Xe(S,"YAML directive accepts exactly one argument"),R=/^([0-9]+)\.([0-9]+)$/.exec(L[0]),R===null&&Xe(S,"ill-formed argument of the YAML directive"),ee=parseInt(R[1],10),K=parseInt(R[2],10),ee!==1&&Xe(S,"unacceptable YAML version of the document"),S.version=L[0],S.checkLineBreaks=K<2,K!==1&&K!==2&&Vo(S,"unsupported YAML version of the document")},TAG:function(S,M,L){var R,ee;L.length!==2&&Xe(S,"TAG directive accepts exactly two arguments"),R=L[0],ee=L[1],Gu.test(R)||Xe(S,"ill-formed tag handle (first argument) of the TAG directive"),Dn.call(S.tagMap,R)&&Xe(S,'there is a previously declared suffix for "'+R+'" tag handle'),Hu.test(ee)||Xe(S,"ill-formed tag prefix (second argument) of the TAG directive");try{ee=decodeURIComponent(ee)}catch{Xe(S,"tag prefix is malformed: "+ee)}S.tagMap[R]=ee}};function Ln(d,S,M,L){var R,ee,K,l;if(S1&&(d.result+=li.repeat(` +`,S-1))}function Ef(d,S,M){var L,R,ee,K,l,ue,X,Fe,be=d.kind,ye=d.result,we;if(we=d.input.charCodeAt(d.position),Ji(we)||Da(we)||we===35||we===38||we===42||we===33||we===124||we===62||we===39||we===34||we===37||we===64||we===96||(we===63||we===45)&&(R=d.input.charCodeAt(d.position+1),Ji(R)||M&&Da(R)))return!1;for(d.kind="scalar",d.result="",ee=K=d.position,l=!1;we!==0;){if(we===58){if(R=d.input.charCodeAt(d.position+1),Ji(R)||M&&Da(R))break}else if(we===35){if(L=d.input.charCodeAt(d.position-1),Ji(L))break}else{if(d.position===d.lineStart&&Uo(d)||M&&Da(we))break;if(qr(we))if(ue=d.line,X=d.lineStart,Fe=d.lineIndent,oi(d,!1,-1),d.lineIndent>=S){l=!0,we=d.input.charCodeAt(d.position);continue}else{d.position=K,d.line=ue,d.lineStart=X,d.lineIndent=Fe;break}}l&&(Ln(d,ee,K,!1),ac(d,d.line-ue),ee=K=d.position,l=!1),oa(we)||(K=d.position+1),we=d.input.charCodeAt(++d.position)}return Ln(d,ee,K,!1),d.result?!0:(d.kind=be,d.result=ye,!1)}function Pf(d,S){var M,L,R;if(M=d.input.charCodeAt(d.position),M!==39)return!1;for(d.kind="scalar",d.result="",d.position++,L=R=d.position;(M=d.input.charCodeAt(d.position))!==0;)if(M===39)if(Ln(d,L,d.position,!0),M=d.input.charCodeAt(++d.position),M===39)L=d.position,d.position++,R=d.position;else return!0;else qr(M)?(Ln(d,L,R,!0),ac(d,oi(d,!1,S)),L=R=d.position):d.position===d.lineStart&&Uo(d)?Xe(d,"unexpected end of the document within a single quoted scalar"):(d.position++,R=d.position);Xe(d,"unexpected end of the stream within a single quoted scalar")}function zf(d,S){var M,L,R,ee,K,l;if(l=d.input.charCodeAt(d.position),l!==34)return!1;for(d.kind="scalar",d.result="",d.position++,M=L=d.position;(l=d.input.charCodeAt(d.position))!==0;){if(l===34)return Ln(d,M,d.position,!0),d.position++,!0;if(l===92){if(Ln(d,M,d.position,!0),l=d.input.charCodeAt(++d.position),qr(l))oi(d,!1,S);else if(l<256&&Yu[l])d.result+=Ju[l],d.position++;else if((K=Af(l))>0){for(R=K,ee=0;R>0;R--)l=d.input.charCodeAt(++d.position),(K=If(l))>=0?ee=(ee<<4)+K:Xe(d,"expected hexadecimal character");d.result+=kf(ee),d.position++}else Xe(d,"unknown escape sequence");M=L=d.position}else qr(l)?(Ln(d,M,L,!0),ac(d,oi(d,!1,S)),M=L=d.position):d.position===d.lineStart&&Uo(d)?Xe(d,"unexpected end of the document within a double quoted scalar"):(d.position++,L=d.position)}Xe(d,"unexpected end of the stream within a double quoted scalar")}function Df(d,S){var M=!0,L,R,ee,K=d.tag,l,ue=d.anchor,X,Fe,be,ye,we,Re=Object.create(null),We,nt,st,tt;if(tt=d.input.charCodeAt(d.position),tt===91)Fe=93,we=!1,l=[];else if(tt===123)Fe=125,we=!0,l={};else return!1;for(d.anchor!==null&&(d.anchorMap[d.anchor]=l),tt=d.input.charCodeAt(++d.position);tt!==0;){if(oi(d,!0,S),tt=d.input.charCodeAt(d.position),tt===Fe)return d.position++,d.tag=K,d.anchor=ue,d.kind=we?"mapping":"sequence",d.result=l,!0;M?tt===44&&Xe(d,"expected the node content, but found ','"):Xe(d,"missed comma between flow collection entries"),nt=We=st=null,be=ye=!1,tt===63&&(X=d.input.charCodeAt(d.position+1),Ji(X)&&(be=ye=!0,d.position++,oi(d,!0,S))),L=d.line,R=d.lineStart,ee=d.position,Ra(d,S,Oo,!1,!0),nt=d.tag,We=d.result,oi(d,!0,S),tt=d.input.charCodeAt(d.position),(ye||d.line===L)&&tt===58&&(be=!0,tt=d.input.charCodeAt(++d.position),oi(d,!0,S),Ra(d,S,Oo,!1,!0),st=d.result),we?Fa(d,l,Re,nt,We,st,L,R,ee):be?l.push(Fa(d,null,Re,nt,We,st,L,R,ee)):l.push(We),oi(d,!0,S),tt=d.input.charCodeAt(d.position),tt===44?(M=!0,tt=d.input.charCodeAt(++d.position)):M=!1}Xe(d,"unexpected end of the stream within a flow collection")}function Lf(d,S){var M,L,R=rc,ee=!1,K=!1,l=S,ue=0,X=!1,Fe,be;if(be=d.input.charCodeAt(d.position),be===124)L=!1;else if(be===62)L=!0;else return!1;for(d.kind="scalar",d.result="";be!==0;)if(be=d.input.charCodeAt(++d.position),be===43||be===45)rc===R?R=be===43?Zu:bf:Xe(d,"repeat of a chomping mode identifier");else if((Fe=Cf(be))>=0)Fe===0?Xe(d,"bad explicit indentation width of a block scalar; it cannot be less than one"):K?Xe(d,"repeat of an indentation width identifier"):(l=S+Fe-1,K=!0);else break;if(oa(be)){do be=d.input.charCodeAt(++d.position);while(oa(be));if(be===35)do be=d.input.charCodeAt(++d.position);while(!qr(be)&&be!==0)}for(;be!==0;){for(nc(d),d.lineIndent=0,be=d.input.charCodeAt(d.position);(!K||d.lineIndentl&&(l=d.lineIndent),qr(be)){ue++;continue}if(d.lineIndentS)&&ue!==0)Xe(d,"bad indentation of a sequence entry");else if(d.lineIndentS)&&(nt&&(K=d.line,l=d.lineStart,ue=d.position),Ra(d,S,No,!0,R)&&(nt?Re=d.result:We=d.result),nt||(Fa(d,be,ye,we,Re,We,K,l,ue),we=Re=We=null),oi(d,!0,-1),tt=d.input.charCodeAt(d.position)),(d.line===ee||d.lineIndent>S)&&tt!==0)Xe(d,"bad indentation of a mapping entry");else if(d.lineIndentS?ue=1:d.lineIndent===S?ue=0:d.lineIndentS?ue=1:d.lineIndent===S?ue=0:d.lineIndent tag; it should be "scalar", not "'+d.kind+'"'),be=0,ye=d.implicitTypes.length;be"),d.result!==null&&Re.kind!==d.kind&&Xe(d,"unacceptable node kind for !<"+d.tag+'> tag; it should be "'+Re.kind+'", not "'+d.kind+'"'),Re.resolve(d.result,d.tag)?(d.result=Re.construct(d.result,d.tag),d.anchor!==null&&(d.anchorMap[d.anchor]=d.result)):Xe(d,"cannot resolve a node with !<"+d.tag+"> explicit tag")}return d.listener!==null&&d.listener("close",d),d.tag!==null||d.anchor!==null||Fe}function Nf(d){var S=d.position,M,L,R,ee=!1,K;for(d.version=null,d.checkLineBreaks=d.legacy,d.tagMap=Object.create(null),d.anchorMap=Object.create(null);(K=d.input.charCodeAt(d.position))!==0&&(oi(d,!0,-1),K=d.input.charCodeAt(d.position),!(d.lineIndent>0||K!==37));){for(ee=!0,K=d.input.charCodeAt(++d.position),M=d.position;K!==0&&!Ji(K);)K=d.input.charCodeAt(++d.position);for(L=d.input.slice(M,d.position),R=[],L.length<1&&Xe(d,"directive name must not be less than one character in length");K!==0;){for(;oa(K);)K=d.input.charCodeAt(++d.position);if(K===35){do K=d.input.charCodeAt(++d.position);while(K!==0&&!qr(K));break}if(qr(K))break;for(M=d.position;K!==0&&!Ji(K);)K=d.input.charCodeAt(++d.position);R.push(d.input.slice(M,d.position))}K!==0&&nc(d),Dn.call(eh,L)?eh[L](d,L,R):Vo(d,'unknown document directive "'+L+'"')}if(oi(d,!0,-1),d.lineIndent===0&&d.input.charCodeAt(d.position)===45&&d.input.charCodeAt(d.position+1)===45&&d.input.charCodeAt(d.position+2)===45?(d.position+=3,oi(d,!0,-1)):ee&&Xe(d,"directives end mark is expected"),Ra(d,d.lineIndent-1,No,!1,!0),oi(d,!0,-1),d.checkLineBreaks&&Sf.test(d.input.slice(S,d.position))&&Vo(d,"non-ASCII line breaks are interpreted as content"),d.documents.push(d.result),d.position===d.lineStart&&Uo(d)){d.input.charCodeAt(d.position)===46&&(d.position+=3,oi(d,!0,-1));return}if(d.position"u"&&(M=S,S=null);var L=rh(d,M);if(typeof S!="function")return L;for(var R=0,ee=L.length;R=55296&&M<=56319&&S+1=56320&&L<=57343)?(M-55296)*1024+L-56320+65536:M}function mh(d){var S=/^\n* /;return S.test(d)}var gh=1,cc=2,_h=3,yh=4,Ba=5;function mm(d,S,M,L,R,ee,K,l){var ue,X=0,Fe=null,be=!1,ye=!1,we=L!==-1,Re=-1,We=dm(Ms(d,0))&&fm(Ms(d,d.length-1));if(S||K)for(ue=0;ue=65536?ue+=2:ue++){if(X=Ms(d,ue),!ks(X))return Ba;We=We&&fh(X,Fe,l),Fe=X}else{for(ue=0;ue=65536?ue+=2:ue++){if(X=Ms(d,ue),X===As)be=!0,we&&(ye=ye||ue-Re-1>L&&d[Re+1]!==" ",Re=ue);else if(!ks(X))return Ba;We=We&&fh(X,Fe,l),Fe=X}ye=ye||we&&ue-Re-1>L&&d[Re+1]!==" "}return!be&&!ye?We&&!K&&!R(d)?gh:ee===Cs?Ba:cc:M>9&&mh(d)?Ba:K?ee===Cs?Ba:cc:ye?yh:_h}function gm(d,S,M,L,R){d.dump=(function(){if(S.length===0)return d.quotingType===Cs?'""':"''";if(!d.noCompatMode&&(sm.indexOf(S)!==-1||om.test(S)))return d.quotingType===Cs?'"'+S+'"':"'"+S+"'";var ee=d.indent*Math.max(1,M),K=d.lineWidth===-1?-1:Math.max(Math.min(d.lineWidth,40),d.lineWidth-ee),l=L||d.flowLevel>-1&&M>=d.flowLevel;function ue(X){return pm(d,X)}switch(mm(S,l,d.indent,K,ue,d.quotingType,d.forceQuotes&&!L,R)){case gh:return S;case cc:return"'"+S.replace(/'/g,"''")+"'";case _h:return"|"+xh(S,d.indent)+vh(ph(S,ee));case yh:return">"+xh(S,d.indent)+vh(ph(_m(S,K),ee));case Ba:return'"'+ym(S)+'"';default:throw new Vi("impossible error: invalid scalar style")}})()}function xh(d,S){var M=mh(d)?String(S):"",L=d[d.length-1]===` +`,R=L&&(d[d.length-2]===` `||d===` -`),te=F?"+":V?"":"-";return D+te+` +`),ee=R?"+":L?"":"-";return M+ee+` `}function vh(d){return d[d.length-1]===` -`?d.slice(0,-1):d}function pm(d,A){for(var D=/(\n+)([^\n]*)/g,V=(function(){var X=d.indexOf(` -`);return X=X!==-1?X:d.length,D.lastIndex=X,bh(d.slice(0,X),A)})(),F=d[0]===` -`||d[0]===" ",te,Y;Y=D.exec(d);){var l=Y[1],ue=Y[2];te=ue[0]===" ",V+=l+(!F&&!te&&ue!==""?` -`:"")+bh(ue,A),F=te}return V}function bh(d,A){if(d===""||d[0]===" ")return d;for(var D=/ [^ ]/g,V,F=0,te,Y=0,l=0,ue="";V=D.exec(d);)l=V.index,l-F>A&&(te=Y>F?Y:l,ue+=` -`+d.slice(F,te),F=te+1),Y=l;return ue+=` -`,d.length-F>A&&Y>F?ue+=d.slice(F,Y)+` -`+d.slice(Y+1):ue+=d.slice(F),ue.slice(1)}function dm(d){for(var A="",D=0,V,F=0;F=65536?F+=2:F++)D=Es(d,F),V=ki[D],!V&&ks(D)?(A+=d[F],D>=65536&&(A+=d[F+1])):A+=V||nm(D);return A}function fm(d,A,D){var V="",F=d.tag,te,Y,l;for(te=0,Y=D.length;te"u"&&ln(d,A,null,!1,!1))&&(V!==""&&(V+=","+(d.condenseFlow?"":" ")),V+=d.dump);d.tag=F,d.dump="["+V+"]"}function wh(d,A,D,V){var F="",te=d.tag,Y,l,ue;for(Y=0,l=D.length;Y"u"&&ln(d,A+1,null,!0,!0,!1,!0))&&((!V||F!=="")&&(F+=oc(d,A)),d.dump&&As===d.dump.charCodeAt(0)?F+="-":F+="- ",F+=d.dump);d.tag=te,d.dump=F||"[]"}function mm(d,A,D){var V="",F=d.tag,te=Object.keys(D),Y,l,ue,X,Le;for(Y=0,l=te.length;Y1024&&(Le+="? "),Le+=d.dump+(d.condenseFlow?'"':"")+":"+(d.condenseFlow?"":" "),ln(d,A,X,!1,!1)&&(Le+=d.dump,V+=Le));d.tag=F,d.dump="{"+V+"}"}function gm(d,A,D,V){var F="",te=d.tag,Y=Object.keys(D),l,ue,X,Le,we,he;if(d.sortKeys===!0)Y.sort();else if(typeof d.sortKeys=="function")Y.sort(d.sortKeys);else if(d.sortKeys)throw new Ni("sortKeys must be a boolean or a function");for(l=0,ue=Y.length;l1024,we&&(d.dump&&As===d.dump.charCodeAt(0)?he+="?":he+="? "),he+=d.dump,we&&(he+=oc(d,A)),ln(d,A+1,Le,!0,we)&&(d.dump&&As===d.dump.charCodeAt(0)?he+=":":he+=": ",he+=d.dump,F+=he));d.tag=te,d.dump=F||"{}"}function Sh(d,A,D){var V,F,te,Y,l,ue;for(F=D?d.explicitTypes:d.implicitTypes,te=0,Y=F.length;te tag resolver accepts not "'+ue+'" style');d.dump=V}return!0}return!1}function ln(d,A,D,V,F,te,Y){d.tag=null,d.dump=D,Sh(d,D,!1)||Sh(d,D,!0);var l=ah.call(d.dump),ue=V,X;V&&(V=d.flowLevel<0||d.flowLevel>A);var Le=l==="[object Object]"||l==="[object Array]",we,he;if(Le&&(we=d.duplicates.indexOf(D),he=we!==-1),(d.tag!==null&&d.tag!=="?"||he||d.indent!==2&&A>0)&&(F=!1),he&&d.usedDuplicates[we])d.dump="*ref_"+we;else{if(Le&&he&&!d.usedDuplicates[we]&&(d.usedDuplicates[we]=!0),l==="[object Object]")V&&Object.keys(d.dump).length!==0?(gm(d,A,d.dump,F),he&&(d.dump="&ref_"+we+d.dump)):(mm(d,A,d.dump),he&&(d.dump="&ref_"+we+" "+d.dump));else if(l==="[object Array]")V&&d.dump.length!==0?(d.noArrayIndent&&!Y&&A>0?wh(d,A-1,d.dump,F):wh(d,A,d.dump,F),he&&(d.dump="&ref_"+we+d.dump)):(fm(d,A,d.dump),he&&(d.dump="&ref_"+we+" "+d.dump));else if(l==="[object String]")d.tag!=="?"&&hm(d,d.dump,A,te,ue);else{if(l==="[object Undefined]")return!1;if(d.skipInvalid)return!1;throw new Ni("unacceptable kind of an object to dump "+l)}d.tag!==null&&d.tag!=="?"&&(X=encodeURI(d.tag[0]==="!"?d.tag.slice(1):d.tag).replace(/!/g,"%21"),d.tag[0]==="!"?X="!"+X:X.slice(0,18)==="tag:yaml.org,2002:"?X="!!"+X.slice(18):X="!<"+X+">",d.dump=X+" "+d.dump)}return!0}function _m(d,A){var D=[],V=[],F,te;for(cc(d,D,V),F=0,te=V.length;F[43.836699,4.360054]},defaultZoom:{type:Number,default:13},maxMarkers:{type:Number,default:50}},setup(d,{emit:A}){const D=Vue.ref({lat:d.defaultCenter[0],lon:d.defaultCenter[1]}),V=Vue.ref(d.defaultZoom),F=Vue.ref([]),te=Vue.ref(null),Y=Vue.ref(!1),l=Vue.ref(null),ue=Vue.ref(null);Vue.onMounted(async()=>{X(),await Vue.nextTick(),Y.value=!0}),Vue.onBeforeUnmount(()=>{l.value&&clearTimeout(l.value)}),Vue.watch(F,()=>{Le()},{deep:!0});function X(){if(!(!d.value||d.value.trim()===""))try{const $e=Th.load(d.value);$e&&($e.center&&(D.value={lat:$e.center.lat,lon:$e.center.lon}),$e.zoom!==void 0&&(V.value=$e.zoom),$e.markers&&Array.isArray($e.markers)&&(F.value=$e.markers))}catch($e){console.error("Error loading map data:",$e)}}function Le(){l.value&&clearTimeout(l.value),l.value=setTimeout(()=>{we()},300)}function we(){const $e={background:{type:"osm"},center:{lat:D.value.lat,lon:D.value.lon},zoom:V.value,markers:F.value},qt=Th.dump($e,{indent:2,lineWidth:-1,noRefs:!0});A("input",qt)}function he(){return`marker_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function Fe(){if(F.value.length>=d.maxMarkers)return;let $e={lat:D.value.lat,lon:D.value.lon};ue.value&&ue.value.getCurrentCenter&&($e=ue.value.getCurrentCenter());const qt={id:he(),position:{lat:$e.lat,lon:$e.lon},icon:{type:"default"},title:"",content:[]};F.value=[...F.value,qt],te.value=qt.id}function Ke($e){if(F.value.length>=d.maxMarkers)return;const qt={id:he(),position:{lat:$e.lat,lon:$e.lng},icon:{type:"default"},title:"",content:[]};F.value=[...F.value,qt],te.value=qt.id}function ot($e){confirm("Are you sure you want to delete this marker?")&&(F.value=F.value.filter(qt=>qt.id!==$e),te.value===$e&&(te.value=null))}function Qe($e){te.value=$e}function lt({markerId:$e,position:qt}){const Er=F.value.findIndex(Ji=>Ji.id===$e);if(Er!==-1){const Ji=[...F.value];Ji[Er]={...Ji[Er],position:{lat:qt.lat,lon:qt.lng}},F.value=Ji}}return{center:D,zoom:V,markers:F,selectedMarkerId:te,mapReady:Y,mapPreview:ue,addMarkerAtCenter:Fe,handleMapClick:Ke,deleteMarker:ot,selectMarker:Qe,handleMarkerMoved:lt}}};var Rm=function(){var A=this,D=A._self._c;return D("k-field",A._b({staticClass:"k-map-editor-field"},"k-field",A.$props,!1),[D("div",{staticClass:"map-editor-container"},[D("div",{staticClass:"map-content"},[D("div",{staticClass:"marker-list-sidebar"},[D("div",{staticClass:"marker-list-header"},[D("h3",[A._v("Markers ("+A._s(A.markers.length)+"/"+A._s(A.maxMarkers)+")")]),D("button",{staticClass:"k-button k-button-icon",attrs:{type:"button",disabled:A.markers.length>=A.maxMarkers,title:"Add marker"},on:{click:A.addMarkerAtCenter}},[D("k-icon",{attrs:{type:"add"}})],1)]),D("div",{staticClass:"marker-list-items"},[A._l(A.markers,function(V,F){return D("div",{key:V.id,staticClass:"marker-item",class:{active:A.selectedMarkerId===V.id},on:{click:function(te){return A.selectMarker(V.id)}}},[D("div",{staticClass:"marker-item-content"},[D("span",{staticClass:"marker-number"},[A._v(A._s(F+1))]),D("span",{staticClass:"marker-title"},[A._v(" "+A._s(V.title||`Marker ${F+1}`)+" ")])]),D("div",{staticClass:"marker-item-actions"},[D("button",{staticClass:"k-button k-button-small",attrs:{type:"button",title:"Delete marker"},on:{click:function(te){return te.stopPropagation(),A.deleteMarker(V.id)}}},[D("k-icon",{attrs:{type:"trash"}})],1)])])}),A.markers.length===0?D("div",{staticClass:"marker-list-empty"},[A._v(" Click on the map to add markers ")]):A._e()],2)]),D("div",{staticClass:"map-preview-container"},[A.mapReady?D("MapPreview",{ref:"mapPreview",attrs:{center:A.center,zoom:A.zoom,markers:A.markers,"selected-marker-id":A.selectedMarkerId},on:{"marker-moved":A.handleMarkerMoved,"map-click":A.handleMapClick,"marker-click":A.selectMarker}}):A._e()],1)])])])},Bm=[],Om=vu(Fm,Rm,Bm);const Nm=Om.exports;window.panel.plugin("geoproject/map-editor",{fields:{"map-editor":Nm}})})(); +`?d.slice(0,-1):d}function _m(d,S){for(var M=/(\n+)([^\n]*)/g,L=(function(){var X=d.indexOf(` +`);return X=X!==-1?X:d.length,M.lastIndex=X,bh(d.slice(0,X),S)})(),R=d[0]===` +`||d[0]===" ",ee,K;K=M.exec(d);){var l=K[1],ue=K[2];ee=ue[0]===" ",L+=l+(!R&&!ee&&ue!==""?` +`:"")+bh(ue,S),R=ee}return L}function bh(d,S){if(d===""||d[0]===" ")return d;for(var M=/ [^ ]/g,L,R=0,ee,K=0,l=0,ue="";L=M.exec(d);)l=L.index,l-R>S&&(ee=K>R?K:l,ue+=` +`+d.slice(R,ee),R=ee+1),K=l;return ue+=` +`,d.length-R>S&&K>R?ue+=d.slice(R,K)+` +`+d.slice(K+1):ue+=d.slice(R),ue.slice(1)}function ym(d){for(var S="",M=0,L,R=0;R=65536?R+=2:R++)M=Ms(d,R),L=Mi[M],!L&&ks(M)?(S+=d[R],M>=65536&&(S+=d[R+1])):S+=L||cm(M);return S}function xm(d,S,M){var L="",R=d.tag,ee,K,l;for(ee=0,K=M.length;ee"u"&&cn(d,S,null,!1,!1))&&(L!==""&&(L+=","+(d.condenseFlow?"":" ")),L+=d.dump);d.tag=R,d.dump="["+L+"]"}function wh(d,S,M,L){var R="",ee=d.tag,K,l,ue;for(K=0,l=M.length;K"u"&&cn(d,S+1,null,!0,!0,!1,!0))&&((!L||R!=="")&&(R+=lc(d,S)),d.dump&&As===d.dump.charCodeAt(0)?R+="-":R+="- ",R+=d.dump);d.tag=ee,d.dump=R||"[]"}function vm(d,S,M){var L="",R=d.tag,ee=Object.keys(M),K,l,ue,X,Fe;for(K=0,l=ee.length;K1024&&(Fe+="? "),Fe+=d.dump+(d.condenseFlow?'"':"")+":"+(d.condenseFlow?"":" "),cn(d,S,X,!1,!1)&&(Fe+=d.dump,L+=Fe));d.tag=R,d.dump="{"+L+"}"}function bm(d,S,M,L){var R="",ee=d.tag,K=Object.keys(M),l,ue,X,Fe,be,ye;if(d.sortKeys===!0)K.sort();else if(typeof d.sortKeys=="function")K.sort(d.sortKeys);else if(d.sortKeys)throw new Vi("sortKeys must be a boolean or a function");for(l=0,ue=K.length;l1024,be&&(d.dump&&As===d.dump.charCodeAt(0)?ye+="?":ye+="? "),ye+=d.dump,be&&(ye+=lc(d,S)),cn(d,S+1,Fe,!0,be)&&(d.dump&&As===d.dump.charCodeAt(0)?ye+=":":ye+=": ",ye+=d.dump,R+=ye));d.tag=ee,d.dump=R||"{}"}function Sh(d,S,M){var L,R,ee,K,l,ue;for(R=M?d.explicitTypes:d.implicitTypes,ee=0,K=R.length;ee tag resolver accepts not "'+ue+'" style');d.dump=L}return!0}return!1}function cn(d,S,M,L,R,ee,K){d.tag=null,d.dump=M,Sh(d,M,!1)||Sh(d,M,!0);var l=ah.call(d.dump),ue=L,X;L&&(L=d.flowLevel<0||d.flowLevel>S);var Fe=l==="[object Object]"||l==="[object Array]",be,ye;if(Fe&&(be=d.duplicates.indexOf(M),ye=be!==-1),(d.tag!==null&&d.tag!=="?"||ye||d.indent!==2&&S>0)&&(R=!1),ye&&d.usedDuplicates[be])d.dump="*ref_"+be;else{if(Fe&&ye&&!d.usedDuplicates[be]&&(d.usedDuplicates[be]=!0),l==="[object Object]")L&&Object.keys(d.dump).length!==0?(bm(d,S,d.dump,R),ye&&(d.dump="&ref_"+be+d.dump)):(vm(d,S,d.dump),ye&&(d.dump="&ref_"+be+" "+d.dump));else if(l==="[object Array]")L&&d.dump.length!==0?(d.noArrayIndent&&!K&&S>0?wh(d,S-1,d.dump,R):wh(d,S,d.dump,R),ye&&(d.dump="&ref_"+be+d.dump)):(xm(d,S,d.dump),ye&&(d.dump="&ref_"+be+" "+d.dump));else if(l==="[object String]")d.tag!=="?"&&gm(d,d.dump,S,ee,ue);else{if(l==="[object Undefined]")return!1;if(d.skipInvalid)return!1;throw new Vi("unacceptable kind of an object to dump "+l)}d.tag!==null&&d.tag!=="?"&&(X=encodeURI(d.tag[0]==="!"?d.tag.slice(1):d.tag).replace(/!/g,"%21"),d.tag[0]==="!"?X="!"+X:X.slice(0,18)==="tag:yaml.org,2002:"?X="!!"+X.slice(18):X="!<"+X+">",d.dump=X+" "+d.dump)}return!0}function wm(d,S){var M=[],L=[],R,ee;for(uc(d,M,L),R=0,ee=L.length;R[43.836699,4.360054]},defaultZoom:{type:Number,default:13},maxMarkers:{type:Number,default:50}},setup(d,{emit:S}){const M=Vue.ref({lat:d.defaultCenter[0],lon:d.defaultCenter[1]}),L=Vue.ref(d.defaultZoom),R=Vue.ref([]),ee=Vue.ref(null),K=Vue.ref(!1),l=Vue.ref(null),ue=Vue.ref(null),X=Vue.ref(null);Vue.onMounted(async()=>{Fe(),await Vue.nextTick(),K.value=!0}),Vue.onBeforeUnmount(()=>{l.value&&clearTimeout(l.value)}),Vue.watch(R,()=>{be()},{deep:!0});function Fe(){if(!(!d.value||d.value.trim()===""))try{const it=Th.load(d.value);it&&(it.center&&(M.value={lat:it.center.lat,lon:it.center.lon}),it.zoom!==void 0&&(L.value=it.zoom),it.markers&&Array.isArray(it.markers)&&(R.value=it.markers))}catch(it){console.error("Error loading map data:",it)}}function be(){l.value&&clearTimeout(l.value),l.value=setTimeout(()=>{ye()},300)}function ye(){const it={background:{type:"osm"},center:{lat:M.value.lat,lon:M.value.lon},zoom:L.value,markers:R.value},It=Th.dump(it,{indent:2,lineWidth:-1,noRefs:!0});S("input",It)}function we(){return`marker_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function Re(){if(R.value.length>=d.maxMarkers)return;let it={lat:M.value.lat,lon:M.value.lon};ue.value&&ue.value.getCurrentCenter&&(it=ue.value.getCurrentCenter());const It={id:we(),position:{lat:it.lat,lon:it.lon},icon:{type:"default"},title:"",description:"",content:[]};R.value=[...R.value,It],ee.value=It.id}function We(it){if(R.value.length>=d.maxMarkers)return;const It={id:we(),position:{lat:it.lat,lon:it.lng},icon:{type:"default"},title:"",description:"",content:[]};R.value=[...R.value,It],ee.value=It.id}function nt(it){confirm("Êtes-vous sûr de vouloir supprimer ce marqueur ?")&&(R.value=R.value.filter(It=>It.id!==it),ee.value===it&&(ee.value=null))}function st(it){ee.value=it;const It=R.value.find(vt=>vt.id===it);It&&ue.value&&ue.value.centerOnPosition&&ue.value.centerOnPosition(It.position.lat,It.position.lon)}function tt({markerId:it,position:It}){const vt=R.value.findIndex(_r=>_r.id===it);if(vt!==-1){const _r=[...R.value];_r[vt]={..._r[vt],position:{lat:It.lat,lon:It.lng}},R.value=_r}}function gr(it){const It=R.value.find(vt=>vt.id===it);It&&(X.value=JSON.parse(JSON.stringify(It)))}function un(it){const It=R.value.findIndex(vt=>vt.id===it.id);if(It!==-1){const vt=[...R.value];vt[It]=it,R.value=vt}}function Zr(){X.value=null}return{center:M,zoom:L,markers:R,selectedMarkerId:ee,mapReady:K,mapPreview:ue,editingMarker:X,addMarkerAtCenter:Re,handleMapClick:We,deleteMarker:nt,selectMarker:st,handleMarkerMoved:tt,editMarker:gr,handleMarkerSave:un,closeEditor:Zr}}};var Um=function(){var S=this,M=S._self._c;return M("k-field",S._b({staticClass:"k-map-editor-field"},"k-field",S.$props,!1),[M("div",{staticClass:"map-editor-container"},[M("div",{staticClass:"map-content"},[M("div",{staticClass:"marker-list-sidebar"},[M("div",{staticClass:"marker-list-header"},[M("h3",[S._v("Marqueurs ("+S._s(S.markers.length)+"/"+S._s(S.maxMarkers)+")")]),M("button",{staticClass:"k-button k-button-icon",attrs:{type:"button",disabled:S.markers.length>=S.maxMarkers,title:"Ajouter un marqueur"},on:{click:S.addMarkerAtCenter}},[M("k-icon",{attrs:{type:"add"}})],1)]),M("div",{staticClass:"marker-list-items"},[S._l(S.markers,function(L,R){return M("div",{key:L.id,staticClass:"marker-item",class:{active:S.selectedMarkerId===L.id},on:{click:function(ee){return S.selectMarker(L.id)}}},[M("div",{staticClass:"marker-item-content"},[M("span",{staticClass:"marker-number"},[S._v(S._s(R+1))]),M("span",{staticClass:"marker-title"},[S._v(" "+S._s(L.title||`Marqueur ${R+1}`)+" ")])]),M("div",{staticClass:"marker-item-actions"},[M("button",{staticClass:"k-button k-button-small",attrs:{type:"button",title:"Modifier le marqueur"},on:{click:function(ee){return ee.stopPropagation(),S.editMarker(L.id)}}},[M("k-icon",{attrs:{type:"edit"}})],1),M("button",{staticClass:"k-button k-button-small",attrs:{type:"button",title:"Supprimer le marqueur"},on:{click:function(ee){return ee.stopPropagation(),S.deleteMarker(L.id)}}},[M("k-icon",{attrs:{type:"trash"}})],1)])])}),S.markers.length===0?M("div",{staticClass:"marker-list-empty"},[S._v(" Cliquez sur la carte pour ajouter des marqueurs ")]):S._e()],2)]),M("div",{staticClass:"map-preview-container"},[S.mapReady?M("MapPreview",{ref:"mapPreview",attrs:{center:S.center,zoom:S.zoom,markers:S.markers,"selected-marker-id":S.selectedMarkerId},on:{"marker-moved":S.handleMarkerMoved,"map-click":S.handleMapClick,"marker-click":S.selectMarker,"marker-dblclick":S.editMarker}}):S._e()],1)])]),S.editingMarker?M("MarkerEditor",{attrs:{marker:S.editingMarker,"is-new":!1},on:{save:S.handleMarkerSave,close:S.closeEditor}}):S._e()],1)},$m=[],jm=Yl(Vm,Um,$m);const qm=jm.exports;window.panel.plugin("geoproject/map-editor",{fields:{"map-editor":qm}})})(); diff --git a/public/site/plugins/map-editor/src/components/field/MapEditor.vue b/public/site/plugins/map-editor/src/components/field/MapEditor.vue index c93d906..03a820b 100644 --- a/public/site/plugins/map-editor/src/components/field/MapEditor.vue +++ b/public/site/plugins/map-editor/src/components/field/MapEditor.vue @@ -6,13 +6,13 @@
-

Markers ({{ markers.length }}/{{ maxMarkers }})

+

Marqueurs ({{ markers.length }}/{{ maxMarkers }})

@@ -29,15 +29,23 @@
{{ index + 1 }} - {{ marker.title || `Marker ${index + 1}` }} + {{ marker.title || `Marqueur ${index + 1}` }}
+ @@ -45,7 +53,7 @@
- Click on the map to add markers + Cliquez sur la carte pour ajouter des marqueurs
@@ -62,21 +70,33 @@ @marker-moved="handleMarkerMoved" @map-click="handleMapClick" @marker-click="selectMarker" + @marker-dblclick="editMarker" /> + + + + +