diff --git a/assets/index-e33d7585.css b/assets/index-efd9afef.css similarity index 96% rename from assets/index-e33d7585.css rename to assets/index-efd9afef.css index 873af48..20b0193 100644 --- a/assets/index-e33d7585.css +++ b/assets/index-efd9afef.css @@ -1,4 +1,4 @@ @charset "UTF-8";span.svelte-kzgqtg{display:block;float:left;height:16px;width:30px;margin-right:5px;border:1px solid #999}div.svelte-1uuov7f{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);display:flex;justify-content:center;align-items:center;z-index:999;color:#fff;font-size:32px}table.svelte-lh2o9l{border:solid}/*! * Pico CSS ✨ v2.0.3 (https://picocss.com) * Copyright 2019-2024 - Licensed under MIT -*/:root{--pico-font-family-emoji:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--pico-font-family-sans-serif:system-ui,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,Helvetica,Arial,"Helvetica Neue",sans-serif,var(--pico-font-family-emoji);--pico-font-family-monospace:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace,var(--pico-font-family-emoji);--pico-font-family:var(--pico-font-family-sans-serif);--pico-line-height:1.5;--pico-font-weight:400;--pico-font-size:100%;--pico-text-underline-offset:.1rem;--pico-border-radius:.25rem;--pico-border-width:.0625rem;--pico-outline-width:.125rem;--pico-transition:.2s ease-in-out;--pico-spacing:1rem;--pico-typography-spacing-vertical:1rem;--pico-block-spacing-vertical:var(--pico-spacing);--pico-block-spacing-horizontal:var(--pico-spacing);--pico-grid-column-gap:var(--pico-spacing);--pico-grid-row-gap:var(--pico-spacing);--pico-form-element-spacing-vertical:.75rem;--pico-form-element-spacing-horizontal:1rem;--pico-group-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-primary-focus);--pico-group-box-shadow-focus-with-input:0 0 0 .0625rem var(--pico-form-element-border-color);--pico-modal-overlay-backdrop-filter:blur(.375rem);--pico-nav-element-spacing-vertical:1rem;--pico-nav-element-spacing-horizontal:.5rem;--pico-nav-link-spacing-vertical:.5rem;--pico-nav-link-spacing-horizontal:.5rem;--pico-nav-breadcrumb-divider:">";--pico-icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--pico-icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--pico-icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--pico-icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--pico-icon-loading:url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E")}@media (min-width:576px){:root{--pico-font-size:106.25%}}@media (min-width:768px){:root{--pico-font-size:112.5%}}@media (min-width:1024px){:root{--pico-font-size:118.75%}}@media (min-width:1280px){:root{--pico-font-size:125%}}@media (min-width:1536px){:root{--pico-font-size:131.25%}}a,a.contrast,a.secondary{--pico-text-decoration:underline}small{--pico-font-size:.875em}h1,h2,h3,h4,h5,h6{--pico-font-weight:700}h1{--pico-font-size:2rem;--pico-line-height:1.125;--pico-typography-spacing-top:3rem}h2{--pico-font-size:1.75rem;--pico-line-height:1.15;--pico-typography-spacing-top:2.625rem}h3{--pico-font-size:1.5rem;--pico-line-height:1.175;--pico-typography-spacing-top:2.25rem}h4{--pico-font-size:1.25rem;--pico-line-height:1.2;--pico-typography-spacing-top:1.874rem}h5{--pico-font-size:1.125rem;--pico-line-height:1.225;--pico-typography-spacing-top:1.6875rem}h6{--pico-font-size:1rem;--pico-line-height:1.25;--pico-typography-spacing-top:1.5rem}tfoot td,tfoot th,thead td,thead th{--pico-font-weight:600;--pico-border-width:.1875rem}code,kbd,pre,samp{--pico-font-family:var(--pico-font-family-monospace)}kbd{--pico-font-weight:bolder}:where(select,textarea),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-outline-width:.0625rem}[type=search]{--pico-border-radius:5rem}[type=checkbox],[type=radio]{--pico-border-width:.125rem}[type=checkbox][role=switch]{--pico-border-width:.1875rem}details.dropdown summary:not([role=button]){--pico-outline-width:.0625rem}nav details.dropdown summary:focus-visible{--pico-outline-width:.125rem}[role=search]{--pico-border-radius:5rem}[role=group]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus),[role=search]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[role=group]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus),[role=search]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=submit],[role=search] button{--pico-form-element-spacing-horizontal:2rem}details summary[role=button]:not(.outline):after{filter:brightness(0) invert(1)}[aria-busy=true]:not(input,select,textarea):is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0) invert(1)}:root:not([data-theme=dark]),[data-theme=light]{--pico-background-color:#fff;--pico-color:#373c44;--pico-text-selection-color:rgba(0, 166, 110, .25);--pico-muted-color:#646b79;--pico-muted-border-color:#e7eaf0;--pico-primary:#007a50;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 122, 80, .5);--pico-primary-hover:#005f3d;--pico-primary-hover-background:#006d46;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 166, 110, .5);--pico-primary-inverse:#fff;--pico-secondary:#5d6b89;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(93, 107, 137, .5);--pico-secondary-hover:#48536b;--pico-secondary-hover-background:#48536b;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(93, 107, 137, .25);--pico-secondary-inverse:#fff;--pico-contrast:#181c25;--pico-contrast-background:#181c25;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(24, 28, 37, .5);--pico-contrast-hover:#000;--pico-contrast-hover-background:#000;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-secondary-hover);--pico-contrast-focus:rgba(93, 107, 137, .25);--pico-contrast-inverse:#fff;--pico-box-shadow:.0145rem .029rem .174rem rgba(129, 145, 181, .01698),.0335rem .067rem .402rem rgba(129, 145, 181, .024),.0625rem .125rem .75rem rgba(129, 145, 181, .03),.1125rem .225rem 1.35rem rgba(129, 145, 181, .036),.2085rem .417rem 2.502rem rgba(129, 145, 181, .04302),.5rem 1rem 6rem rgba(129, 145, 181, .06),0 0 0 .0625rem rgba(129, 145, 181, .015);--pico-h1-color:#2d3138;--pico-h2-color:#373c44;--pico-h3-color:#424751;--pico-h4-color:#4d535e;--pico-h5-color:#5c6370;--pico-h6-color:#646b79;--pico-mark-background-color:#fde7c0;--pico-mark-color:#0f1114;--pico-ins-color:#1d6a54;--pico-del-color:#883935;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#f3f5f7;--pico-code-color:#646b79;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#fbfcfc;--pico-form-element-selected-background-color:#dfe3eb;--pico-form-element-border-color:#cfd5e2;--pico-form-element-color:#23262c;--pico-form-element-placeholder-color:var(--pico-muted-color);--pico-form-element-active-background-color:#fff;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#b86a6b;--pico-form-element-invalid-active-border-color:#c84f48;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#4c9b8a;--pico-form-element-valid-active-border-color:#279977;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#bfc7d9;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#dfe3eb;--pico-range-active-border-color:#bfc7d9;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:var(--pico-background-color);--pico-card-border-color:var(--pico-muted-border-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#fbfcfc;--pico-dropdown-background-color:#fff;--pico-dropdown-border-color:#eff1f4;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#eff1f4;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(232, 234, 237, .75);--pico-progress-background-color:#dfe3eb;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(76, 155, 138)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(200, 79, 72)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:light}:root:not([data-theme=dark]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]),[data-theme=light] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}@media only screen and (prefers-color-scheme:dark){:root:not([data-theme]){--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}:root:not([data-theme]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}:root:not([data-theme]) details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}:root:not([data-theme]) [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}}[data-theme=dark]{--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}[data-theme=dark] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}[data-theme=dark] details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}[data-theme=dark] [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}[type=checkbox],[type=radio],[type=range],progress{accent-color:var(--pico-primary)}*,:after,:before{box-sizing:border-box;background-repeat:no-repeat}:after,:before{text-decoration:inherit;vertical-align:inherit}:where(:root){-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family);text-underline-offset:var(--pico-text-underline-offset);text-rendering:optimizeLegibility;overflow-wrap:break-word;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{width:100%;margin:0}main{display:block}body>footer,body>header,body>main{padding-block:var(--pico-block-spacing-vertical)}section{margin-bottom:var(--pico-block-spacing-vertical)}.container,.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:var(--pico-spacing);padding-left:var(--pico-spacing)}@media (min-width:576px){.container{max-width:510px;padding-right:0;padding-left:0}}@media (min-width:768px){.container{max-width:700px}}@media (min-width:1024px){.container{max-width:950px}}@media (min-width:1280px){.container{max-width:1200px}}@media (min-width:1536px){.container{max-width:1450px}}.grid{grid-column-gap:var(--pico-grid-column-gap);grid-row-gap:var(--pico-grid-row-gap);display:grid;grid-template-columns:1fr}@media (min-width:768px){.grid{grid-template-columns:repeat(auto-fit,minmax(0%,1fr))}}.grid>*{min-width:0}.overflow-auto{overflow:auto}b,strong{font-weight:bolder}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}address,blockquote,dl,ol,p,pre,table,ul{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-style:normal;font-weight:var(--pico-font-weight)}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family)}h1{--pico-color:var(--pico-h1-color)}h2{--pico-color:var(--pico-h2-color)}h3{--pico-color:var(--pico-h3-color)}h4{--pico-color:var(--pico-h4-color)}h5{--pico-color:var(--pico-h5-color)}h6{--pico-color:var(--pico-h6-color)}:where(article,address,blockquote,dl,figure,form,ol,p,pre,table,ul)~:is(h1,h2,h3,h4,h5,h6){margin-top:var(--pico-typography-spacing-top)}p{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup>*{margin-top:0;margin-bottom:0}hgroup>:not(:first-child):last-child{--pico-color:var(--pico-muted-color);--pico-font-weight:unset;font-size:1rem}:where(ol,ul) li{margin-bottom:calc(var(--pico-typography-spacing-vertical) * .25)}:where(dl,ol,ul) :where(dl,ol,ul){margin:0;margin-top:calc(var(--pico-typography-spacing-vertical) * .25)}ul li{list-style:square}mark{padding:.125rem .25rem;background-color:var(--pico-mark-background-color);color:var(--pico-mark-color);vertical-align:baseline}blockquote{display:block;margin:var(--pico-typography-spacing-vertical) 0;padding:var(--pico-spacing);border-right:none;border-left:.25rem solid var(--pico-blockquote-border-color);border-inline-start:.25rem solid var(--pico-blockquote-border-color);border-inline-end:none}blockquote footer{margin-top:calc(var(--pico-typography-spacing-vertical) * .5);color:var(--pico-blockquote-footer-color)}abbr[title]{border-bottom:1px dotted;text-decoration:none;cursor:help}ins{color:var(--pico-ins-color);text-decoration:none}del{color:var(--pico-del-color)}::-moz-selection{background-color:var(--pico-text-selection-color)}::selection{background-color:var(--pico-text-selection-color)}:where(a:not([role=button])),[role=link]{--pico-color:var(--pico-primary);--pico-background-color:transparent;--pico-underline:var(--pico-primary-underline);outline:0;background-color:var(--pico-background-color);color:var(--pico-color);-webkit-text-decoration:var(--pico-text-decoration);text-decoration:var(--pico-text-decoration);text-decoration-color:var(--pico-underline);text-underline-offset:.125em;transition:background-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition)}:where(a:not([role=button])):is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-primary-hover);--pico-underline:var(--pico-primary-hover-underline);--pico-text-decoration:underline}:where(a:not([role=button])):focus-visible,[role=link]:focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}:where(a:not([role=button])).secondary,[role=link].secondary{--pico-color:var(--pico-secondary);--pico-underline:var(--pico-secondary-underline)}:where(a:not([role=button])).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-underline:var(--pico-secondary-hover-underline)}:where(a:not([role=button])).contrast,[role=link].contrast{--pico-color:var(--pico-contrast);--pico-underline:var(--pico-contrast-underline)}:where(a:not([role=button])).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-underline:var(--pico-contrast-hover-underline)}a[role=button]{display:inline-block}button{margin:0;overflow:visible;font-family:inherit;text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[role=button],[type=button],[type=file]::file-selector-button,[type=reset],[type=submit],button{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);--pico-color:var(--pico-primary-inverse);--pico-box-shadow:var(--pico-button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:1rem;line-height:var(--pico-line-height);text-align:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}[role=button]:is(:hover,:active,:focus),[role=button]:is([aria-current]:not([aria-current=false])),[type=button]:is(:hover,:active,:focus),[type=button]:is([aria-current]:not([aria-current=false])),[type=file]::file-selector-button:is(:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])),[type=reset]:is(:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false])),[type=submit]:is(:hover,:active,:focus),[type=submit]:is([aria-current]:not([aria-current=false])),button:is(:hover,:active,:focus),button:is([aria-current]:not([aria-current=false])){--pico-background-color:var(--pico-primary-hover-background);--pico-border-color:var(--pico-primary-hover-border);--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));--pico-color:var(--pico-primary-inverse)}[role=button]:focus,[role=button]:is([aria-current]:not([aria-current=false])):focus,[type=button]:focus,[type=button]:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus,[type=submit]:focus,[type=submit]:is([aria-current]:not([aria-current=false])):focus,button:focus,button:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}[type=button],[type=reset],[type=submit]{margin-bottom:var(--pico-spacing)}:is(button,[type=submit],[type=button],[role=button]).secondary,[type=file]::file-selector-button,[type=reset]{--pico-background-color:var(--pico-secondary-background);--pico-border-color:var(--pico-secondary-border);--pico-color:var(--pico-secondary-inverse);cursor:pointer}:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border);--pico-color:var(--pico-secondary-inverse)}:is(button,[type=submit],[type=button],[role=button]).secondary:focus,:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}:is(button,[type=submit],[type=button],[role=button]).contrast{--pico-background-color:var(--pico-contrast-background);--pico-border-color:var(--pico-contrast-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-contrast-hover-background);--pico-border-color:var(--pico-contrast-hover-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:focus,:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}:is(button,[type=submit],[type=button],[role=button]).outline,[type=reset].outline{--pico-background-color:transparent;--pico-color:var(--pico-primary);--pico-border-color:var(--pico-primary)}:is(button,[type=submit],[type=button],[role=button]).outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:transparent;--pico-color:var(--pico-primary-hover);--pico-border-color:var(--pico-primary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary,[type=reset].outline{--pico-color:var(--pico-secondary);--pico-border-color:var(--pico-secondary)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-border-color:var(--pico-secondary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast{--pico-color:var(--pico-contrast);--pico-border-color:var(--pico-contrast)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-border-color:var(--pico-contrast-hover)}:where(button,[type=submit],[type=reset],[type=button],[role=button])[disabled],:where(fieldset[disabled]) :is(button,[type=submit],[type=button],[type=reset],[role=button]){opacity:.5;pointer-events:none}:where(table){width:100%;border-collapse:collapse;border-spacing:0;text-indent:0}td,th{padding:calc(var(--pico-spacing)/ 2) var(--pico-spacing);border-bottom:var(--pico-border-width) solid var(--pico-table-border-color);background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);text-align:left;text-align:start}tfoot td,tfoot th{border-top:var(--pico-border-width) solid var(--pico-table-border-color);border-bottom:0}table.striped tbody tr:nth-child(odd) td,table.striped tbody tr:nth-child(odd) th{background-color:var(--pico-table-row-stripped-background-color)}:where(audio,canvas,iframe,img,svg,video){vertical-align:middle}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}:where(iframe){border-style:none}img{max-width:100%;height:auto;border-style:none}:where(svg:not([fill])){fill:currentColor}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-size:.875em;font-family:var(--pico-font-family)}pre code{font-size:inherit;font-family:inherit}pre{-ms-overflow-style:scrollbar;overflow:auto}code,kbd,pre{border-radius:var(--pico-border-radius);background:var(--pico-code-background-color);color:var(--pico-code-color);font-weight:var(--pico-font-weight);line-height:initial}code,kbd{display:inline-block;padding:.375rem}pre{display:block;margin-bottom:var(--pico-spacing);overflow-x:auto}pre>code{display:block;padding:var(--pico-spacing);background:0 0;line-height:var(--pico-line-height)}kbd{background-color:var(--pico-code-kbd-background-color);color:var(--pico-code-kbd-color);vertical-align:baseline}figure{display:block;margin:0;padding:0}figure figcaption{padding:calc(var(--pico-spacing) * .5) 0;color:var(--pico-muted-color)}hr{height:0;margin:var(--pico-typography-spacing-vertical) 0;border:0;border-top:1px solid var(--pico-muted-border-color);color:inherit}[hidden],template{display:none!important}canvas{display:inline-block}input,optgroup,select,textarea{margin:0;font-size:1rem;line-height:var(--pico-line-height);font-family:inherit;letter-spacing:inherit}input{overflow:visible}select{text-transform:none}legend{max-width:100%;padding:0;color:inherit;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}::-moz-focus-inner{padding:0;border-style:none}:-moz-focusring{outline:0}:-moz-ui-invalid{box-shadow:none}::-ms-expand{display:none}[type=file],[type=range]{padding:0;border-width:0}input:not([type=checkbox],[type=radio],[type=range]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2)}fieldset{width:100%;margin:0;margin-bottom:var(--pico-spacing);padding:0;border:0}fieldset legend,label{display:block;margin-bottom:calc(var(--pico-spacing) * .375);color:var(--pico-color);font-weight:var(--pico-form-label-font-weight,var(--pico-font-weight))}fieldset legend{margin-bottom:calc(var(--pico-spacing) * .5)}button[type=submit],input:not([type=checkbox],[type=radio]),select,textarea{width:100%}input:not([type=checkbox],[type=radio],[type=range],[type=file]),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal)}input,select,textarea{--pico-background-color:var(--pico-form-element-background-color);--pico-border-color:var(--pico-form-element-border-color);--pico-color:var(--pico-form-element-color);--pico-box-shadow:none;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[readonly]):is(:active,:focus){--pico-background-color:var(--pico-form-element-active-background-color)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[role=switch],[readonly]):is(:active,:focus){--pico-border-color:var(--pico-form-element-active-border-color)}:where(select,textarea):not([readonly]):focus,input:not([type=submit],[type=button],[type=reset],[type=range],[type=file],[readonly]):focus{--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}:where(fieldset[disabled]) :is(input:not([type=submit],[type=button],[type=reset]),select,textarea),input:not([type=submit],[type=button],[type=reset])[disabled],label[aria-disabled=true],select[disabled],textarea[disabled]{opacity:var(--pico-form-element-disabled-opacity);pointer-events:none}label[aria-disabled=true] input[disabled]{opacity:1}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid]{padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal)!important;padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=false]:not(select){background-image:var(--pico-icon-valid)}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=true]:not(select){background-image:var(--pico-icon-invalid)}:where(input,select,textarea)[aria-invalid=false]{--pico-border-color:var(--pico-form-element-valid-border-color)}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus){--pico-border-color:var(--pico-form-element-valid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-valid-focus-color)!important}:where(input,select,textarea)[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus){--pico-border-color:var(--pico-form-element-invalid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-invalid-focus-color)!important}[dir=rtl] :where(input,select,textarea):not([type=checkbox],[type=radio]):is([aria-invalid],[aria-invalid=true],[aria-invalid=false]){background-position:center left .75rem}input::-webkit-input-placeholder,input::placeholder,select:invalid,textarea::-webkit-input-placeholder,textarea::placeholder{color:var(--pico-form-element-placeholder-color);opacity:1}input:not([type=checkbox],[type=radio]),select,textarea{margin-bottom:var(--pico-spacing)}select::-ms-expand{border:0;background-color:transparent}select:not([multiple],[size]){padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal);padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);background-image:var(--pico-icon-chevron);background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}select[multiple] option:checked{background:var(--pico-form-element-selected-background-color)}[dir=rtl] select:not([multiple],[size]){background-position:center left .75rem}textarea{display:block;resize:vertical}textarea[aria-invalid]{--pico-icon-height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);background-position:top right .75rem!important;background-size:1rem var(--pico-icon-height)!important}:where(input,select,textarea,fieldset,.grid)+small{display:block;width:100%;margin-top:calc(var(--pico-spacing) * -.75);margin-bottom:var(--pico-spacing);color:var(--pico-muted-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=false]+small{color:var(--pico-ins-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=true]+small{color:var(--pico-del-color)}label>:where(input,select,textarea){margin-top:calc(var(--pico-spacing) * .25)}label:has([type=checkbox],[type=radio]){width:-moz-fit-content;width:fit-content;cursor:pointer}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1.25em;height:1.25em;margin-top:-.125em;margin-inline-end:.5em;border-width:var(--pico-border-width);vertical-align:middle;cursor:pointer}[type=checkbox]::-ms-check,[type=radio]::-ms-check{display:none}[type=checkbox]:checked,[type=checkbox]:checked:active,[type=checkbox]:checked:focus,[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-checkbox);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=checkbox]~label,[type=radio]~label{display:inline-block;margin-bottom:0;cursor:pointer}[type=checkbox]~label:not(:last-of-type),[type=radio]~label:not(:last-of-type){margin-inline-end:1em}[type=checkbox]:indeterminate{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-minus);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=radio]{border-radius:50%}[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-inverse);border-width:.35em;background-image:none}[type=checkbox][role=switch]{--pico-background-color:var(--pico-switch-background-color);--pico-color:var(--pico-switch-color);width:2.25em;height:1.25em;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:1.25em;background-color:var(--pico-background-color);line-height:1.25em}[type=checkbox][role=switch]:not([aria-invalid]){--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:before{display:block;width:calc(1.25em - var(--pico-border-width) * 2);height:100%;border-radius:50%;background-color:var(--pico-color);box-shadow:var(--pico-switch-thumb-box-shadow);content:"";transition:margin .1s ease-in-out}[type=checkbox][role=switch]:focus{--pico-background-color:var(--pico-switch-background-color);--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:checked{--pico-background-color:var(--pico-switch-checked-background-color);--pico-border-color:var(--pico-switch-checked-background-color);background-image:none}[type=checkbox][role=switch]:checked:before{margin-inline-start:calc(1.125em - var(--pico-border-width))}[type=checkbox][role=switch][disabled]{--pico-background-color:var(--pico-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus{--pico-background-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true]{--pico-background-color:var(--pico-form-element-invalid-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus,[type=radio][aria-invalid=false]:checked,[type=radio][aria-invalid=false]:checked:active,[type=radio][aria-invalid=false]:checked:focus{--pico-border-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true],[type=radio]:checked:active[aria-invalid=true],[type=radio]:checked:focus[aria-invalid=true],[type=radio]:checked[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}[type=color]::-webkit-color-swatch-wrapper{padding:0}[type=color]::-moz-focus-inner{padding:0}[type=color]::-webkit-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}[type=color]::-moz-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}input:not([type=checkbox],[type=radio],[type=range],[type=file]):is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){--pico-icon-position:.75rem;--pico-icon-width:1rem;padding-right:calc(var(--pico-icon-width) + var(--pico-icon-position));background-image:var(--pico-icon-date);background-position:center right var(--pico-icon-position);background-size:var(--pico-icon-width) auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=time]{background-image:var(--pico-icon-time)}[type=date]::-webkit-calendar-picker-indicator,[type=datetime-local]::-webkit-calendar-picker-indicator,[type=month]::-webkit-calendar-picker-indicator,[type=time]::-webkit-calendar-picker-indicator,[type=week]::-webkit-calendar-picker-indicator{width:var(--pico-icon-width);margin-right:calc(var(--pico-icon-width) * -1);margin-left:var(--pico-icon-position);opacity:0}@-moz-document url-prefix(){[type=date],[type=datetime-local],[type=month],[type=time],[type=week]{padding-right:var(--pico-form-element-spacing-horizontal)!important;background-image:none!important}}[dir=rtl] :is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){text-align:right}[type=file]{--pico-color:var(--pico-muted-color);margin-left:calc(var(--pico-outline-width) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) 0;padding-left:var(--pico-outline-width);border:0;border-radius:0;background:0 0}[type=file]::file-selector-button{margin-right:calc(var(--pico-spacing)/ 2);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal)}[type=file]:is(:hover,:active,:focus)::file-selector-button{--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border)}[type=file]:focus::file-selector-button{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:1.25rem;background:0 0}[type=range]::-webkit-slider-runnable-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-webkit-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-moz-range-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-moz-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-ms-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-ms-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-webkit-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-moz-range-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-moz-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-ms-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-ms-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]:active,[type=range]:focus-within{--pico-range-border-color:var(--pico-range-active-border-color);--pico-range-thumb-color:var(--pico-range-thumb-active-color)}[type=range]:active::-webkit-slider-thumb{transform:scale(1.25)}[type=range]:active::-moz-range-thumb{transform:scale(1.25)}[type=range]:active::-ms-thumb{transform:scale(1.25)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem);background-image:var(--pico-icon-search);background-position:center left calc(var(--pico-form-element-spacing-horizontal) + .125rem);background-size:1rem auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem)!important;background-position:center left 1.125rem,center right .75rem}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=false]{background-image:var(--pico-icon-search),var(--pico-icon-valid)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=true]{background-image:var(--pico-icon-search),var(--pico-icon-invalid)}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{background-position:center right 1.125rem}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{background-position:center right 1.125rem,center left .75rem}details{display:block;margin-bottom:var(--pico-spacing)}details summary{line-height:1rem;list-style-type:none;cursor:pointer;transition:color var(--pico-transition)}details summary:not([role]){color:var(--pico-accordion-close-summary-color)}details summary::-webkit-details-marker{display:none}details summary::marker{display:none}details summary::-moz-list-bullet{list-style-type:none}details summary:after{display:block;width:1rem;height:1rem;margin-inline-start:calc(var(--pico-spacing,1rem) * .5);float:right;transform:rotate(-90deg);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:"";transition:transform var(--pico-transition)}details summary:focus{outline:0}details summary:focus:not([role]){color:var(--pico-accordion-active-summary-color)}details summary:focus-visible:not([role]){outline:var(--pico-outline-width) solid var(--pico-primary-focus);outline-offset:calc(var(--pico-spacing,1rem) * .5);color:var(--pico-primary)}details summary[role=button]{width:100%;text-align:left}details summary[role=button]:after{height:calc(1rem * var(--pico-line-height,1.5))}details[open]>summary{margin-bottom:var(--pico-spacing)}details[open]>summary:not([role]):not(:focus){color:var(--pico-accordion-open-summary-color)}details[open]>summary:after{transform:rotate(0)}[dir=rtl] details summary{text-align:right}[dir=rtl] details summary:after{float:left;background-position:left center}article{margin-bottom:var(--pico-block-spacing-vertical);padding:var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);border-radius:var(--pico-border-radius);background:var(--pico-card-background-color);box-shadow:var(--pico-card-box-shadow)}article>footer,article>header{margin-right:calc(var(--pico-block-spacing-horizontal) * -1);margin-left:calc(var(--pico-block-spacing-horizontal) * -1);padding:calc(var(--pico-block-spacing-vertical) * .66) var(--pico-block-spacing-horizontal);background-color:var(--pico-card-sectioning-background-color)}article>header{margin-top:calc(var(--pico-block-spacing-vertical) * -1);margin-bottom:var(--pico-block-spacing-vertical);border-bottom:var(--pico-border-width) solid var(--pico-card-border-color);border-top-right-radius:var(--pico-border-radius);border-top-left-radius:var(--pico-border-radius)}article>footer{margin-top:var(--pico-block-spacing-vertical);margin-bottom:calc(var(--pico-block-spacing-vertical) * -1);border-top:var(--pico-border-width) solid var(--pico-card-border-color);border-bottom-right-radius:var(--pico-border-radius);border-bottom-left-radius:var(--pico-border-radius)}details.dropdown{position:relative;border-bottom:none}details.dropdown summary:after,details.dropdown>a:after,details.dropdown>button:after{display:block;width:1rem;height:calc(1rem * var(--pico-line-height,1.5));margin-inline-start:.25rem;float:right;transform:rotate(0) translate(.2rem);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:""}nav details.dropdown{margin-bottom:0}details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-form-element-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-form-element-background-color);color:var(--pico-form-element-placeholder-color);line-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}details.dropdown summary:not([role]):active,details.dropdown summary:not([role]):focus{border-color:var(--pico-form-element-active-border-color);background-color:var(--pico-form-element-active-background-color)}details.dropdown summary:not([role]):focus{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}details.dropdown summary:not([role]):focus-visible{outline:0}details.dropdown summary:not([role])[aria-invalid=false]{--pico-form-element-border-color:var(--pico-form-element-valid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-valid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-valid-focus-color)}details.dropdown summary:not([role])[aria-invalid=true]{--pico-form-element-border-color:var(--pico-form-element-invalid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-invalid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-invalid-focus-color)}nav details.dropdown{display:inline;margin:calc(var(--pico-nav-element-spacing-vertical) * -1) 0}nav details.dropdown summary:after{transform:rotate(0) translate(0)}nav details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2);padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav details.dropdown summary:not([role]):focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}details.dropdown summary+ul{display:flex;z-index:99;position:absolute;left:0;flex-direction:column;width:100%;min-width:-moz-fit-content;min-width:fit-content;margin:0;margin-top:var(--pico-outline-width);padding:0;border:var(--pico-border-width) solid var(--pico-dropdown-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-dropdown-background-color);box-shadow:var(--pico-dropdown-box-shadow);color:var(--pico-dropdown-color);white-space:nowrap;opacity:0;transition:opacity var(--pico-transition),transform 0s ease-in-out 1s}details.dropdown summary+ul[dir=rtl]{right:0;left:auto}details.dropdown summary+ul li{width:100%;margin-bottom:0;padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);list-style:none}details.dropdown summary+ul li:first-of-type{margin-top:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li:last-of-type{margin-bottom:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li a{display:block;margin:calc(var(--pico-form-element-spacing-vertical) * -.5) calc(var(--pico-form-element-spacing-horizontal) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);overflow:hidden;border-radius:0;color:var(--pico-dropdown-color);text-decoration:none;text-overflow:ellipsis}details.dropdown summary+ul li a:active,details.dropdown summary+ul li a:focus,details.dropdown summary+ul li a:focus-visible,details.dropdown summary+ul li a:hover,details.dropdown summary+ul li a[aria-current]:not([aria-current=false]){background-color:var(--pico-dropdown-hover-background-color)}details.dropdown summary+ul li label{width:100%}details.dropdown summary+ul li:has(label):hover{background-color:var(--pico-dropdown-hover-background-color)}details.dropdown[open] summary{margin-bottom:0}details.dropdown[open] summary+ul{transform:scaleY(1);opacity:1;transition:opacity var(--pico-transition),transform 0s ease-in-out 0s}details.dropdown[open] summary:before{display:block;z-index:1;position:fixed;width:100vw;height:100vh;top:0;right:0;bottom:0;left:0;background:0 0;content:"";cursor:default}label>details.dropdown{margin-top:calc(var(--pico-spacing) * .25)}[role=group],[role=search]{display:inline-flex;position:relative;width:100%;margin-bottom:var(--pico-spacing);border-radius:var(--pico-border-radius);box-shadow:var(--pico-group-box-shadow,0 0 0 transparent);vertical-align:middle;transition:box-shadow var(--pico-transition)}[role=group] input:not([type=checkbox],[type=radio]),[role=group] select,[role=group]>*,[role=search] input:not([type=checkbox],[type=radio]),[role=search] select,[role=search]>*{position:relative;flex:1 1 auto;margin-bottom:0}[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=group]>:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child),[role=search]>:not(:first-child){margin-left:0;border-top-left-radius:0;border-bottom-left-radius:0}[role=group] input:not([type=checkbox],[type=radio]):not(:last-child),[role=group] select:not(:last-child),[role=group]>:not(:last-child),[role=search] input:not([type=checkbox],[type=radio]):not(:last-child),[role=search] select:not(:last-child),[role=search]>:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}[role=group] input:not([type=checkbox],[type=radio]):focus,[role=group] select:focus,[role=group]>:focus,[role=search] input:not([type=checkbox],[type=radio]):focus,[role=search] select:focus,[role=search]>:focus{z-index:2}[role=group] [role=button]:not(:first-child),[role=group] [type=button]:not(:first-child),[role=group] [type=reset]:not(:first-child),[role=group] [type=submit]:not(:first-child),[role=group] button:not(:first-child),[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=search] [role=button]:not(:first-child),[role=search] [type=button]:not(:first-child),[role=search] [type=reset]:not(:first-child),[role=search] [type=submit]:not(:first-child),[role=search] button:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child){margin-left:calc(var(--pico-border-width) * -1)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=reset],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=reset],[role=search] [type=submit],[role=search] button{width:auto}@supports selector(:has(*)){[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-button)}[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select,[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select{border-color:transparent}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus),[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-input)}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) button,[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) button{--pico-button-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-border);--pico-button-hover-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-hover-border)}[role=group] [role=button]:focus,[role=group] [type=button]:focus,[role=group] [type=reset]:focus,[role=group] [type=submit]:focus,[role=group] button:focus,[role=search] [role=button]:focus,[role=search] [type=button]:focus,[role=search] [type=reset]:focus,[role=search] [type=submit]:focus,[role=search] button:focus{box-shadow:none}}[role=search]>:first-child{border-top-left-radius:5rem;border-bottom-left-radius:5rem}[role=search]>:last-child{border-top-right-radius:5rem;border-bottom-right-radius:5rem}[aria-busy=true]:not(input,select,textarea,html){white-space:nowrap}[aria-busy=true]:not(input,select,textarea,html):before{display:inline-block;width:1em;height:1em;background-image:var(--pico-icon-loading);background-size:1rem auto;background-repeat:no-repeat;content:"";vertical-align:-.125em}[aria-busy=true]:not(input,select,textarea,html):not(:empty):before{margin-inline-end:calc(var(--pico-spacing) * .5)}[aria-busy=true]:not(input,select,textarea,html):empty{text-align:center}[role=button][aria-busy=true],[type=button][aria-busy=true],[type=reset][aria-busy=true],[type=submit][aria-busy=true],a[aria-busy=true],button[aria-busy=true]{pointer-events:none}:root{--pico-scrollbar-width:0px}dialog{display:flex;z-index:999;position:fixed;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center;width:inherit;min-width:100%;height:inherit;min-height:100%;padding:0;border:0;-webkit-backdrop-filter:var(--pico-modal-overlay-backdrop-filter);backdrop-filter:var(--pico-modal-overlay-backdrop-filter);background-color:var(--pico-modal-overlay-background-color);color:var(--pico-color)}dialog article{width:100%;max-height:calc(100vh - var(--pico-spacing) * 2);margin:var(--pico-spacing);overflow:auto}@media (min-width:576px){dialog article{max-width:510px}}@media (min-width:768px){dialog article{max-width:700px}}dialog article>header>*{margin-bottom:0}dialog article>header .close,dialog article>header :is(a,button)[rel=prev]{margin:0;margin-left:var(--pico-spacing);padding:0;float:right}dialog article>footer{text-align:right}dialog article>footer [role=button],dialog article>footer button{margin-bottom:0}dialog article>footer [role=button]:not(:first-of-type),dialog article>footer button:not(:first-of-type){margin-left:calc(var(--pico-spacing) * .5)}dialog article .close,dialog article :is(a,button)[rel=prev]{display:block;width:1rem;height:1rem;margin-top:calc(var(--pico-spacing) * -1);margin-bottom:var(--pico-spacing);margin-left:auto;border:none;background-image:var(--pico-icon-close);background-position:center;background-size:auto 1rem;background-repeat:no-repeat;background-color:transparent;opacity:.5;transition:opacity var(--pico-transition)}dialog article .close:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),dialog article :is(a,button)[rel=prev]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){opacity:1}dialog:not([open]),dialog[open=false]{display:none}.modal-is-open{padding-right:var(--pico-scrollbar-width,0);overflow:hidden;pointer-events:none;touch-action:none}.modal-is-open dialog{pointer-events:auto;touch-action:auto}:where(.modal-is-opening,.modal-is-closing) dialog,:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-duration:.2s;animation-timing-function:ease-in-out;animation-fill-mode:both}:where(.modal-is-opening,.modal-is-closing) dialog{animation-duration:.8s;animation-name:modal-overlay}:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-delay:.2s;animation-name:modal}.modal-is-closing dialog,.modal-is-closing dialog>article{animation-delay:0s;animation-direction:reverse}@keyframes modal-overlay{0%{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:transparent}}@keyframes modal{0%{transform:translateY(-100%);opacity:0}}:where(nav li):before{float:left;content:"​"}nav,nav ul{display:flex}nav{justify-content:space-between;overflow:visible}nav ol,nav ul{align-items:center;margin-bottom:0;padding:0;list-style:none}nav ol:first-of-type,nav ul:first-of-type{margin-left:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav ol:last-of-type,nav ul:last-of-type{margin-right:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav li{display:inline-block;margin:0;padding:var(--pico-nav-element-spacing-vertical) var(--pico-nav-element-spacing-horizontal)}nav li :where(a,[role=link]){display:inline-block;margin:calc(var(--pico-nav-link-spacing-vertical) * -1) calc(var(--pico-nav-link-spacing-horizontal) * -1);padding:var(--pico-nav-link-spacing-vertical) var(--pico-nav-link-spacing-horizontal);border-radius:var(--pico-border-radius)}nav li :where(a,[role=link]):not(:hover){text-decoration:none}nav li [role=button],nav li button,nav li input:not([type=checkbox],[type=radio],[type=range],[type=file]),nav li select{height:auto;margin-right:inherit;margin-bottom:0;margin-left:inherit;padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb]{align-items:center;justify-content:start}nav[aria-label=breadcrumb] ul li:not(:first-child){margin-inline-start:var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb] ul li a{margin:calc(var(--pico-nav-link-spacing-vertical) * -1) 0;margin-inline-start:calc(var(--pico-nav-link-spacing-horizontal) * -1)}nav[aria-label=breadcrumb] ul li:not(:last-child):after{display:inline-block;position:absolute;width:calc(var(--pico-nav-link-spacing-horizontal) * 4);margin:0 calc(var(--pico-nav-link-spacing-horizontal) * -1);content:var(--pico-nav-breadcrumb-divider);color:var(--pico-muted-color);text-align:center;text-decoration:none;white-space:nowrap}nav[aria-label=breadcrumb] a[aria-current]:not([aria-current=false]){background-color:transparent;color:inherit;text-decoration:none;pointer-events:none}aside li,aside nav,aside ol,aside ul{display:block}aside li{padding:calc(var(--pico-nav-element-spacing-vertical) * .5) var(--pico-nav-element-spacing-horizontal)}aside li a{display:block}aside li [role=button]{margin:inherit}[dir=rtl] nav[aria-label=breadcrumb] ul li:not(:last-child) :after{content:"\\"}progress{display:inline-block;vertical-align:baseline}progress{-webkit-appearance:none;-moz-appearance:none;display:inline-block;appearance:none;width:100%;height:.5rem;margin-bottom:calc(var(--pico-spacing) * .5);overflow:hidden;border:0;border-radius:var(--pico-border-radius);background-color:var(--pico-progress-background-color);color:var(--pico-progress-color)}progress::-webkit-progress-bar{border-radius:var(--pico-border-radius);background:0 0}progress[value]::-webkit-progress-value{background-color:var(--pico-progress-color);-webkit-transition:inline-size var(--pico-transition);transition:inline-size var(--pico-transition)}progress::-moz-progress-bar{background-color:var(--pico-progress-color)}@media (prefers-reduced-motion:no-preference){progress:indeterminate{background:var(--pico-progress-background-color) linear-gradient(to right,var(--pico-progress-color) 30%,var(--pico-progress-background-color) 30%) top left/150% 150% no-repeat;animation:progress-indeterminate 1s linear infinite}progress:indeterminate[value]::-webkit-progress-value{background-color:transparent}progress:indeterminate::-moz-progress-bar{background-color:transparent}}@media (prefers-reduced-motion:no-preference){[dir=rtl] progress:indeterminate{animation-direction:reverse}}@keyframes progress-indeterminate{0%{background-position:200% 0}to{background-position:-200% 0}}[data-tooltip]{position:relative}[data-tooltip]:not(a,button,input){border-bottom:1px dotted;text-decoration:none;cursor:help}[data-tooltip]:after,[data-tooltip]:before,[data-tooltip][data-placement=top]:after,[data-tooltip][data-placement=top]:before{display:block;z-index:99;position:absolute;bottom:100%;left:50%;padding:.25rem .5rem;overflow:hidden;transform:translate(-50%,-.25rem);border-radius:var(--pico-border-radius);background:var(--pico-tooltip-background-color);content:attr(data-tooltip);color:var(--pico-tooltip-color);font-style:normal;font-weight:var(--pico-font-weight);font-size:.875rem;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;opacity:0;pointer-events:none}[data-tooltip]:after,[data-tooltip][data-placement=top]:after{padding:0;transform:translate(-50%);border-top:.3rem solid;border-right:.3rem solid transparent;border-left:.3rem solid transparent;border-radius:0;background-color:transparent;content:"";color:var(--pico-tooltip-background-color)}[data-tooltip][data-placement=bottom]:after,[data-tooltip][data-placement=bottom]:before{top:100%;bottom:auto;transform:translate(-50%,.25rem)}[data-tooltip][data-placement=bottom]:after{transform:translate(-50%,-.3rem);border:.3rem solid transparent;border-bottom:.3rem solid}[data-tooltip][data-placement=left]:after,[data-tooltip][data-placement=left]:before{top:50%;right:100%;bottom:auto;left:auto;transform:translate(-.25rem,-50%)}[data-tooltip][data-placement=left]:after{transform:translate(.3rem,-50%);border:.3rem solid transparent;border-left:.3rem solid}[data-tooltip][data-placement=right]:after,[data-tooltip][data-placement=right]:before{top:50%;right:auto;bottom:auto;left:100%;transform:translate(.25rem,-50%)}[data-tooltip][data-placement=right]:after{transform:translate(-.3rem,-50%);border:.3rem solid transparent;border-right:.3rem solid}[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{opacity:1}@media (hover:hover) and (pointer:fine){[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{--pico-tooltip-slide-to:translate(-50%, -.25rem);transform:translate(-50%,.75rem);animation-duration:.2s;animation-fill-mode:forwards;animation-name:tooltip-slide;opacity:0}[data-tooltip]:focus:after,[data-tooltip]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, 0rem);transform:translate(-50%,-.25rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:focus:before,[data-tooltip][data-placement=bottom]:hover:after,[data-tooltip][data-placement=bottom]:hover:before{--pico-tooltip-slide-to:translate(-50%, .25rem);transform:translate(-50%,-.75rem);animation-name:tooltip-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, -.3rem);transform:translate(-50%,-.5rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:focus:before,[data-tooltip][data-placement=left]:hover:after,[data-tooltip][data-placement=left]:hover:before{--pico-tooltip-slide-to:translate(-.25rem, -50%);transform:translate(.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:hover:after{--pico-tooltip-caret-slide-to:translate(.3rem, -50%);transform:translate(.05rem,-50%);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:focus:before,[data-tooltip][data-placement=right]:hover:after,[data-tooltip][data-placement=right]:hover:before{--pico-tooltip-slide-to:translate(.25rem, -50%);transform:translate(-.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:hover:after{--pico-tooltip-caret-slide-to:translate(-.3rem, -50%);transform:translate(-.05rem,-50%);animation-name:tooltip-caret-slide}}@keyframes tooltip-slide{to{transform:var(--pico-tooltip-slide-to);opacity:1}}@keyframes tooltip-caret-slide{50%{opacity:0}to{transform:var(--pico-tooltip-caret-slide-to);opacity:1}}[aria-controls]{cursor:pointer}[aria-disabled=true],[disabled]{cursor:not-allowed}[aria-hidden=false][hidden]{display:initial}[aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);position:absolute}[tabindex],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation}[dir=rtl]{direction:rtl}@media (prefers-reduced-motion:reduce){:not([aria-busy=true]),:not([aria-busy=true]):after,:not([aria-busy=true]):before{background-attachment:initial!important;animation-duration:1ms!important;animation-delay:-1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-delay:0s!important;transition-duration:0s!important}}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (-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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (-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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (-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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (-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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (-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 8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-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 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (-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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (-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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#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;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #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:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}svg.svelte-1bpbt60{display:block;stroke:var(--color-icon-button)}form.svelte-zh3kmv.svelte-zh3kmv{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text:#444952;--color-icon-button:#444952}form.svelte-zh3kmv.svelte-zh3kmv,form.svelte-zh3kmv .svelte-zh3kmv,form.svelte-zh3kmv .svelte-zh3kmv:after,form.svelte-zh3kmv .svelte-zh3kmv:before{box-sizing:border-box}form.can-collapse.svelte-zh3kmv.svelte-zh3kmv{max-width:29px}form.svelte-zh3kmv.svelte-zh3kmv,form.svelte-zh3kmv.svelte-zh3kmv:focus-within,form.svelte-zh3kmv.svelte-zh3kmv:hover{width:270px;max-width:270px}input.svelte-zh3kmv.svelte-zh3kmv{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input.svelte-zh3kmv.svelte-zh3kmv:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-zh3kmv.svelte-zh3kmv,div.error.svelte-zh3kmv.svelte-zh3kmv,div.no-results.svelte-zh3kmv.svelte-zh3kmv{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul.svelte-zh3kmv.svelte-zh3kmv{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-zh3kmv.svelte-zh3kmv,div.no-results.svelte-zh3kmv.svelte-zh3kmv{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-zh3kmv.svelte-zh3kmv{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-zh3kmv div.svelte-zh3kmv{flex-grow:1}div.error.svelte-zh3kmv svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-zh3kmv button.svelte-zh3kmv{flex-shrink:0}div.error.svelte-zh3kmv button.svelte-zh3kmv>svg{width:13px;fill:#e25041}div.error.svelte-zh3kmv button.svelte-zh3kmv:hover svg,div.error.svelte-zh3kmv button.svelte-zh3kmv:active svg{fill:#444952}div.no-results.svelte-zh3kmv.svelte-zh3kmv{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-zh3kmv svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.maplibregl-ctrl-bottom-left ul.svelte-zh3kmv.svelte-zh3kmv,.maplibregl-ctrl-bottom-right ul.svelte-zh3kmv.svelte-zh3kmv{top:auto;bottom:100%}button.svelte-zh3kmv.svelte-zh3kmv{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-zh3kmv.svelte-zh3kmv:hover{background-color:transparent}button.svelte-zh3kmv:hover svg,button.svelte-zh3kmv:active svg{fill:#2b8bfb}.input-group.svelte-zh3kmv.svelte-zh3kmv{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-zh3kmv.svelte-zh3kmv:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-zh3kmv.svelte-zh3kmv{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-zh3kmv.svelte-zh3kmv{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-zh3kmv.svelte-zh3kmv{display:flex;flex-shrink:0}.maplibregl-ctrl-geocoder{position:relative;z-index:3}.maptiler-ctrl:not(:empty){box-shadow:none}.maptiler-ctrl .input-group.svelte-zh3kmv.svelte-zh3kmv{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-zh3kmv.svelte-zh3kmv:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-zh3kmv.svelte-zh3kmv{max-width:33px}.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv,.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv:focus-within,.maptiler-ctrl form.svelte-zh3kmv.svelte-zh3kmv:hover{width:270px;max-width:270px}div.svelte-ixhnie{position:absolute;top:20px;left:50px}div.svelte-mpick2{float:left}.top.svelte-mpick2{width:100%;height:10vh}.left.svelte-mpick2{width:25%;height:90vh;overflow:scroll;padding:8px}.main.svelte-mpick2{width:75%;height:90vh}button.svelte-gb6dzm{background:none;border:1px solid rgba(0,0,0,0)}button.svelte-gb6dzm:hover{border:1px solid black}.popup .maplibregl-popup-content{background-color:var(--pico-background-color)}.dot.svelte-1gcxp27{width:30px;height:30px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:gray;font-weight:700}.dot.svelte-1cj4rwq{width:30px;height:30px;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;background-color:#00f;font-weight:700}.dot.svelte-1cj4rwq:hover{border:1px solid black;cursor:pointer}.snapped.svelte-1cj4rwq{background-color:red}.free-node.svelte-1cj4rwq,.snapped-node.svelte-1cj4rwq{width:20px;height:20px;background-color:gray}.snapped-node.svelte-1cj4rwq:hover{border:3px solid red}.free-node.svelte-1cj4rwq:hover{border:3px solid blue}.hide.svelte-1cj4rwq{visibility:hidden}.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0} +*/:root{--pico-font-family-emoji:"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--pico-font-family-sans-serif:system-ui,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,Helvetica,Arial,"Helvetica Neue",sans-serif,var(--pico-font-family-emoji);--pico-font-family-monospace:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace,var(--pico-font-family-emoji);--pico-font-family:var(--pico-font-family-sans-serif);--pico-line-height:1.5;--pico-font-weight:400;--pico-font-size:100%;--pico-text-underline-offset:.1rem;--pico-border-radius:.25rem;--pico-border-width:.0625rem;--pico-outline-width:.125rem;--pico-transition:.2s ease-in-out;--pico-spacing:1rem;--pico-typography-spacing-vertical:1rem;--pico-block-spacing-vertical:var(--pico-spacing);--pico-block-spacing-horizontal:var(--pico-spacing);--pico-grid-column-gap:var(--pico-spacing);--pico-grid-row-gap:var(--pico-spacing);--pico-form-element-spacing-vertical:.75rem;--pico-form-element-spacing-horizontal:1rem;--pico-group-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-primary-focus);--pico-group-box-shadow-focus-with-input:0 0 0 .0625rem var(--pico-form-element-border-color);--pico-modal-overlay-backdrop-filter:blur(.375rem);--pico-nav-element-spacing-vertical:1rem;--pico-nav-element-spacing-horizontal:.5rem;--pico-nav-link-spacing-vertical:.5rem;--pico-nav-link-spacing-horizontal:.5rem;--pico-nav-breadcrumb-divider:">";--pico-icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--pico-icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--pico-icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--pico-icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(136, 145, 164)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--pico-icon-loading:url("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E")}@media (min-width:576px){:root{--pico-font-size:106.25%}}@media (min-width:768px){:root{--pico-font-size:112.5%}}@media (min-width:1024px){:root{--pico-font-size:118.75%}}@media (min-width:1280px){:root{--pico-font-size:125%}}@media (min-width:1536px){:root{--pico-font-size:131.25%}}a,a.contrast,a.secondary{--pico-text-decoration:underline}small{--pico-font-size:.875em}h1,h2,h3,h4,h5,h6{--pico-font-weight:700}h1{--pico-font-size:2rem;--pico-line-height:1.125;--pico-typography-spacing-top:3rem}h2{--pico-font-size:1.75rem;--pico-line-height:1.15;--pico-typography-spacing-top:2.625rem}h3{--pico-font-size:1.5rem;--pico-line-height:1.175;--pico-typography-spacing-top:2.25rem}h4{--pico-font-size:1.25rem;--pico-line-height:1.2;--pico-typography-spacing-top:1.874rem}h5{--pico-font-size:1.125rem;--pico-line-height:1.225;--pico-typography-spacing-top:1.6875rem}h6{--pico-font-size:1rem;--pico-line-height:1.25;--pico-typography-spacing-top:1.5rem}tfoot td,tfoot th,thead td,thead th{--pico-font-weight:600;--pico-border-width:.1875rem}code,kbd,pre,samp{--pico-font-family:var(--pico-font-family-monospace)}kbd{--pico-font-weight:bolder}:where(select,textarea),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-outline-width:.0625rem}[type=search]{--pico-border-radius:5rem}[type=checkbox],[type=radio]{--pico-border-width:.125rem}[type=checkbox][role=switch]{--pico-border-width:.1875rem}details.dropdown summary:not([role=button]){--pico-outline-width:.0625rem}nav details.dropdown summary:focus-visible{--pico-outline-width:.125rem}[role=search]{--pico-border-radius:5rem}[role=group]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus),[role=search]:has(button.secondary:focus,[type=submit].secondary:focus,[type=button].secondary:focus,[role=button].secondary:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[role=group]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus),[role=search]:has(button.contrast:focus,[type=submit].contrast:focus,[type=button].contrast:focus,[role=button].contrast:focus){--pico-group-box-shadow-focus-with-button:0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=submit],[role=search] button{--pico-form-element-spacing-horizontal:2rem}details summary[role=button]:not(.outline):after{filter:brightness(0) invert(1)}[aria-busy=true]:not(input,select,textarea):is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0) invert(1)}:root:not([data-theme=dark]),[data-theme=light]{--pico-background-color:#fff;--pico-color:#373c44;--pico-text-selection-color:rgba(0, 166, 110, .25);--pico-muted-color:#646b79;--pico-muted-border-color:#e7eaf0;--pico-primary:#007a50;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 122, 80, .5);--pico-primary-hover:#005f3d;--pico-primary-hover-background:#006d46;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 166, 110, .5);--pico-primary-inverse:#fff;--pico-secondary:#5d6b89;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(93, 107, 137, .5);--pico-secondary-hover:#48536b;--pico-secondary-hover-background:#48536b;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(93, 107, 137, .25);--pico-secondary-inverse:#fff;--pico-contrast:#181c25;--pico-contrast-background:#181c25;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(24, 28, 37, .5);--pico-contrast-hover:#000;--pico-contrast-hover-background:#000;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-secondary-hover);--pico-contrast-focus:rgba(93, 107, 137, .25);--pico-contrast-inverse:#fff;--pico-box-shadow:.0145rem .029rem .174rem rgba(129, 145, 181, .01698),.0335rem .067rem .402rem rgba(129, 145, 181, .024),.0625rem .125rem .75rem rgba(129, 145, 181, .03),.1125rem .225rem 1.35rem rgba(129, 145, 181, .036),.2085rem .417rem 2.502rem rgba(129, 145, 181, .04302),.5rem 1rem 6rem rgba(129, 145, 181, .06),0 0 0 .0625rem rgba(129, 145, 181, .015);--pico-h1-color:#2d3138;--pico-h2-color:#373c44;--pico-h3-color:#424751;--pico-h4-color:#4d535e;--pico-h5-color:#5c6370;--pico-h6-color:#646b79;--pico-mark-background-color:#fde7c0;--pico-mark-color:#0f1114;--pico-ins-color:#1d6a54;--pico-del-color:#883935;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#f3f5f7;--pico-code-color:#646b79;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#fbfcfc;--pico-form-element-selected-background-color:#dfe3eb;--pico-form-element-border-color:#cfd5e2;--pico-form-element-color:#23262c;--pico-form-element-placeholder-color:var(--pico-muted-color);--pico-form-element-active-background-color:#fff;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#b86a6b;--pico-form-element-invalid-active-border-color:#c84f48;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#4c9b8a;--pico-form-element-valid-active-border-color:#279977;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#bfc7d9;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#dfe3eb;--pico-range-active-border-color:#bfc7d9;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:var(--pico-background-color);--pico-card-border-color:var(--pico-muted-border-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#fbfcfc;--pico-dropdown-background-color:#fff;--pico-dropdown-border-color:#eff1f4;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#eff1f4;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(232, 234, 237, .75);--pico-progress-background-color:#dfe3eb;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(76, 155, 138)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(200, 79, 72)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:light}:root:not([data-theme=dark]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]),[data-theme=light] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}@media only screen and (prefers-color-scheme:dark){:root:not([data-theme]){--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}:root:not([data-theme]) input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}:root:not([data-theme]) details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}:root:not([data-theme]) [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}}[data-theme=dark]{--pico-background-color:#13171f;--pico-color:#c2c7d0;--pico-text-selection-color:rgba(0, 180, 120, .1875);--pico-muted-color:#7b8495;--pico-muted-border-color:#202632;--pico-primary:#00b478;--pico-primary-background:#007a50;--pico-primary-border:var(--pico-primary-background);--pico-primary-underline:rgba(0, 180, 120, .5);--pico-primary-hover:#00cc88;--pico-primary-hover-background:#00895a;--pico-primary-hover-border:var(--pico-primary-hover-background);--pico-primary-hover-underline:var(--pico-primary-hover);--pico-primary-focus:rgba(0, 180, 120, .375);--pico-primary-inverse:#fff;--pico-secondary:#969eaf;--pico-secondary-background:#525f7a;--pico-secondary-border:var(--pico-secondary-background);--pico-secondary-underline:rgba(150, 158, 175, .5);--pico-secondary-hover:#b3b9c5;--pico-secondary-hover-background:#5d6b89;--pico-secondary-hover-border:var(--pico-secondary-hover-background);--pico-secondary-hover-underline:var(--pico-secondary-hover);--pico-secondary-focus:rgba(144, 158, 190, .25);--pico-secondary-inverse:#fff;--pico-contrast:#dfe3eb;--pico-contrast-background:#eff1f4;--pico-contrast-border:var(--pico-contrast-background);--pico-contrast-underline:rgba(223, 227, 235, .5);--pico-contrast-hover:#fff;--pico-contrast-hover-background:#fff;--pico-contrast-hover-border:var(--pico-contrast-hover-background);--pico-contrast-hover-underline:var(--pico-contrast-hover);--pico-contrast-focus:rgba(207, 213, 226, .25);--pico-contrast-inverse:#000;--pico-box-shadow:.0145rem .029rem .174rem rgba(7, 9, 12, .01698),.0335rem .067rem .402rem rgba(7, 9, 12, .024),.0625rem .125rem .75rem rgba(7, 9, 12, .03),.1125rem .225rem 1.35rem rgba(7, 9, 12, .036),.2085rem .417rem 2.502rem rgba(7, 9, 12, .04302),.5rem 1rem 6rem rgba(7, 9, 12, .06),0 0 0 .0625rem rgba(7, 9, 12, .015);--pico-h1-color:#f0f1f3;--pico-h2-color:#e0e3e7;--pico-h3-color:#c2c7d0;--pico-h4-color:#b3b9c5;--pico-h5-color:#a4acba;--pico-h6-color:#8891a4;--pico-mark-background-color:#014063;--pico-mark-color:#fff;--pico-ins-color:#62af9a;--pico-del-color:#ce7e7b;--pico-blockquote-border-color:var(--pico-muted-border-color);--pico-blockquote-footer-color:var(--pico-muted-color);--pico-button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-table-border-color:var(--pico-muted-border-color);--pico-table-row-stripped-background-color:rgba(111, 120, 135, .0375);--pico-code-background-color:#1a1f28;--pico-code-color:#8891a4;--pico-code-kbd-background-color:var(--pico-color);--pico-code-kbd-color:var(--pico-background-color);--pico-form-element-background-color:#1c212c;--pico-form-element-selected-background-color:#2a3140;--pico-form-element-border-color:#2a3140;--pico-form-element-color:#e0e3e7;--pico-form-element-placeholder-color:#8891a4;--pico-form-element-active-background-color:#1a1f28;--pico-form-element-active-border-color:var(--pico-primary-border);--pico-form-element-focus-color:var(--pico-primary-border);--pico-form-element-disabled-opacity:.5;--pico-form-element-invalid-border-color:#964a50;--pico-form-element-invalid-active-border-color:#b7403b;--pico-form-element-invalid-focus-color:var(--pico-form-element-invalid-active-border-color);--pico-form-element-valid-border-color:#2a7b6f;--pico-form-element-valid-active-border-color:#16896a;--pico-form-element-valid-focus-color:var(--pico-form-element-valid-active-border-color);--pico-switch-background-color:#333c4e;--pico-switch-checked-background-color:var(--pico-primary-background);--pico-switch-color:#fff;--pico-switch-thumb-box-shadow:0 0 0 rgba(0, 0, 0, 0);--pico-range-border-color:#202632;--pico-range-active-border-color:#2a3140;--pico-range-thumb-border-color:var(--pico-background-color);--pico-range-thumb-color:var(--pico-secondary-background);--pico-range-thumb-active-color:var(--pico-primary-background);--pico-accordion-border-color:var(--pico-muted-border-color);--pico-accordion-active-summary-color:var(--pico-primary-hover);--pico-accordion-close-summary-color:var(--pico-color);--pico-accordion-open-summary-color:var(--pico-muted-color);--pico-card-background-color:#181c25;--pico-card-border-color:var(--pico-card-background-color);--pico-card-box-shadow:var(--pico-box-shadow);--pico-card-sectioning-background-color:#1a1f28;--pico-dropdown-background-color:#181c25;--pico-dropdown-border-color:#202632;--pico-dropdown-box-shadow:var(--pico-box-shadow);--pico-dropdown-color:var(--pico-color);--pico-dropdown-hover-background-color:#202632;--pico-loading-spinner-opacity:.5;--pico-modal-overlay-background-color:rgba(8, 9, 10, .75);--pico-progress-background-color:#202632;--pico-progress-color:var(--pico-primary-background);--pico-tooltip-background-color:var(--pico-contrast-background);--pico-tooltip-color:var(--pico-contrast-inverse);--pico-icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(42, 123, 111)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--pico-icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(150, 74, 80)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");color-scheme:dark}[data-theme=dark] input:is([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[type=file]){--pico-form-element-focus-color:var(--pico-primary-focus)}[data-theme=dark] details summary[role=button].contrast:not(.outline):after{filter:brightness(0)}[data-theme=dark] [aria-busy=true]:not(input,select,textarea).contrast:is(button,[type=submit],[type=button],[type=reset],[role=button]):not(.outline):before{filter:brightness(0)}[type=checkbox],[type=radio],[type=range],progress{accent-color:var(--pico-primary)}*,:after,:before{box-sizing:border-box;background-repeat:no-repeat}:after,:before{text-decoration:inherit;vertical-align:inherit}:where(:root){-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family);text-underline-offset:var(--pico-text-underline-offset);text-rendering:optimizeLegibility;overflow-wrap:break-word;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{width:100%;margin:0}main{display:block}body>footer,body>header,body>main{padding-block:var(--pico-block-spacing-vertical)}section{margin-bottom:var(--pico-block-spacing-vertical)}.container,.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:var(--pico-spacing);padding-left:var(--pico-spacing)}@media (min-width:576px){.container{max-width:510px;padding-right:0;padding-left:0}}@media (min-width:768px){.container{max-width:700px}}@media (min-width:1024px){.container{max-width:950px}}@media (min-width:1280px){.container{max-width:1200px}}@media (min-width:1536px){.container{max-width:1450px}}.grid{grid-column-gap:var(--pico-grid-column-gap);grid-row-gap:var(--pico-grid-row-gap);display:grid;grid-template-columns:1fr}@media (min-width:768px){.grid{grid-template-columns:repeat(auto-fit,minmax(0%,1fr))}}.grid>*{min-width:0}.overflow-auto{overflow:auto}b,strong{font-weight:bolder}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}address,blockquote,dl,ol,p,pre,table,ul{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-style:normal;font-weight:var(--pico-font-weight)}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:var(--pico-typography-spacing-vertical);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:var(--pico-font-size);line-height:var(--pico-line-height);font-family:var(--pico-font-family)}h1{--pico-color:var(--pico-h1-color)}h2{--pico-color:var(--pico-h2-color)}h3{--pico-color:var(--pico-h3-color)}h4{--pico-color:var(--pico-h4-color)}h5{--pico-color:var(--pico-h5-color)}h6{--pico-color:var(--pico-h6-color)}:where(article,address,blockquote,dl,figure,form,ol,p,pre,table,ul)~:is(h1,h2,h3,h4,h5,h6){margin-top:var(--pico-typography-spacing-top)}p{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup{margin-bottom:var(--pico-typography-spacing-vertical)}hgroup>*{margin-top:0;margin-bottom:0}hgroup>:not(:first-child):last-child{--pico-color:var(--pico-muted-color);--pico-font-weight:unset;font-size:1rem}:where(ol,ul) li{margin-bottom:calc(var(--pico-typography-spacing-vertical) * .25)}:where(dl,ol,ul) :where(dl,ol,ul){margin:0;margin-top:calc(var(--pico-typography-spacing-vertical) * .25)}ul li{list-style:square}mark{padding:.125rem .25rem;background-color:var(--pico-mark-background-color);color:var(--pico-mark-color);vertical-align:baseline}blockquote{display:block;margin:var(--pico-typography-spacing-vertical) 0;padding:var(--pico-spacing);border-right:none;border-left:.25rem solid var(--pico-blockquote-border-color);border-inline-start:.25rem solid var(--pico-blockquote-border-color);border-inline-end:none}blockquote footer{margin-top:calc(var(--pico-typography-spacing-vertical) * .5);color:var(--pico-blockquote-footer-color)}abbr[title]{border-bottom:1px dotted;text-decoration:none;cursor:help}ins{color:var(--pico-ins-color);text-decoration:none}del{color:var(--pico-del-color)}::-moz-selection{background-color:var(--pico-text-selection-color)}::selection{background-color:var(--pico-text-selection-color)}:where(a:not([role=button])),[role=link]{--pico-color:var(--pico-primary);--pico-background-color:transparent;--pico-underline:var(--pico-primary-underline);outline:0;background-color:var(--pico-background-color);color:var(--pico-color);-webkit-text-decoration:var(--pico-text-decoration);text-decoration:var(--pico-text-decoration);text-decoration-color:var(--pico-underline);text-underline-offset:.125em;transition:background-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),color var(--pico-transition),text-decoration var(--pico-transition),box-shadow var(--pico-transition),-webkit-text-decoration var(--pico-transition)}:where(a:not([role=button])):is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-primary-hover);--pico-underline:var(--pico-primary-hover-underline);--pico-text-decoration:underline}:where(a:not([role=button])):focus-visible,[role=link]:focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}:where(a:not([role=button])).secondary,[role=link].secondary{--pico-color:var(--pico-secondary);--pico-underline:var(--pico-secondary-underline)}:where(a:not([role=button])).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-underline:var(--pico-secondary-hover-underline)}:where(a:not([role=button])).contrast,[role=link].contrast{--pico-color:var(--pico-contrast);--pico-underline:var(--pico-contrast-underline)}:where(a:not([role=button])).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[role=link].contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-underline:var(--pico-contrast-hover-underline)}a[role=button]{display:inline-block}button{margin:0;overflow:visible;font-family:inherit;text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[role=button],[type=button],[type=file]::file-selector-button,[type=reset],[type=submit],button{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);--pico-color:var(--pico-primary-inverse);--pico-box-shadow:var(--pico-button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);font-size:1rem;line-height:var(--pico-line-height);text-align:center;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}[role=button]:is(:hover,:active,:focus),[role=button]:is([aria-current]:not([aria-current=false])),[type=button]:is(:hover,:active,:focus),[type=button]:is([aria-current]:not([aria-current=false])),[type=file]::file-selector-button:is(:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])),[type=reset]:is(:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false])),[type=submit]:is(:hover,:active,:focus),[type=submit]:is([aria-current]:not([aria-current=false])),button:is(:hover,:active,:focus),button:is([aria-current]:not([aria-current=false])){--pico-background-color:var(--pico-primary-hover-background);--pico-border-color:var(--pico-primary-hover-border);--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));--pico-color:var(--pico-primary-inverse)}[role=button]:focus,[role=button]:is([aria-current]:not([aria-current=false])):focus,[type=button]:focus,[type=button]:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus,[type=submit]:focus,[type=submit]:is([aria-current]:not([aria-current=false])):focus,button:focus,button:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}[type=button],[type=reset],[type=submit]{margin-bottom:var(--pico-spacing)}:is(button,[type=submit],[type=button],[role=button]).secondary,[type=file]::file-selector-button,[type=reset]{--pico-background-color:var(--pico-secondary-background);--pico-border-color:var(--pico-secondary-border);--pico-color:var(--pico-secondary-inverse);cursor:pointer}:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=file]::file-selector-button:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border);--pico-color:var(--pico-secondary-inverse)}:is(button,[type=submit],[type=button],[role=button]).secondary:focus,:is(button,[type=submit],[type=button],[role=button]).secondary:is([aria-current]:not([aria-current=false])):focus,[type=file]::file-selector-button:focus,[type=file]::file-selector-button:is([aria-current]:not([aria-current=false])):focus,[type=reset]:focus,[type=reset]:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}:is(button,[type=submit],[type=button],[role=button]).contrast{--pico-background-color:var(--pico-contrast-background);--pico-border-color:var(--pico-contrast-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:var(--pico-contrast-hover-background);--pico-border-color:var(--pico-contrast-hover-border);--pico-color:var(--pico-contrast-inverse)}:is(button,[type=submit],[type=button],[role=button]).contrast:focus,:is(button,[type=submit],[type=button],[role=button]).contrast:is([aria-current]:not([aria-current=false])):focus{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-contrast-focus)}:is(button,[type=submit],[type=button],[role=button]).outline,[type=reset].outline{--pico-background-color:transparent;--pico-color:var(--pico-primary);--pico-border-color:var(--pico-primary)}:is(button,[type=submit],[type=button],[role=button]).outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-background-color:transparent;--pico-color:var(--pico-primary-hover);--pico-border-color:var(--pico-primary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary,[type=reset].outline{--pico-color:var(--pico-secondary);--pico-border-color:var(--pico-secondary)}:is(button,[type=submit],[type=button],[role=button]).outline.secondary:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),[type=reset].outline:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-secondary-hover);--pico-border-color:var(--pico-secondary-hover)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast{--pico-color:var(--pico-contrast);--pico-border-color:var(--pico-contrast)}:is(button,[type=submit],[type=button],[role=button]).outline.contrast:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){--pico-color:var(--pico-contrast-hover);--pico-border-color:var(--pico-contrast-hover)}:where(button,[type=submit],[type=reset],[type=button],[role=button])[disabled],:where(fieldset[disabled]) :is(button,[type=submit],[type=button],[type=reset],[role=button]){opacity:.5;pointer-events:none}:where(table){width:100%;border-collapse:collapse;border-spacing:0;text-indent:0}td,th{padding:calc(var(--pico-spacing)/ 2) var(--pico-spacing);border-bottom:var(--pico-border-width) solid var(--pico-table-border-color);background-color:var(--pico-background-color);color:var(--pico-color);font-weight:var(--pico-font-weight);text-align:left;text-align:start}tfoot td,tfoot th{border-top:var(--pico-border-width) solid var(--pico-table-border-color);border-bottom:0}table.striped tbody tr:nth-child(odd) td,table.striped tbody tr:nth-child(odd) th{background-color:var(--pico-table-row-stripped-background-color)}:where(audio,canvas,iframe,img,svg,video){vertical-align:middle}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}:where(iframe){border-style:none}img{max-width:100%;height:auto;border-style:none}:where(svg:not([fill])){fill:currentColor}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-size:.875em;font-family:var(--pico-font-family)}pre code{font-size:inherit;font-family:inherit}pre{-ms-overflow-style:scrollbar;overflow:auto}code,kbd,pre{border-radius:var(--pico-border-radius);background:var(--pico-code-background-color);color:var(--pico-code-color);font-weight:var(--pico-font-weight);line-height:initial}code,kbd{display:inline-block;padding:.375rem}pre{display:block;margin-bottom:var(--pico-spacing);overflow-x:auto}pre>code{display:block;padding:var(--pico-spacing);background:0 0;line-height:var(--pico-line-height)}kbd{background-color:var(--pico-code-kbd-background-color);color:var(--pico-code-kbd-color);vertical-align:baseline}figure{display:block;margin:0;padding:0}figure figcaption{padding:calc(var(--pico-spacing) * .5) 0;color:var(--pico-muted-color)}hr{height:0;margin:var(--pico-typography-spacing-vertical) 0;border:0;border-top:1px solid var(--pico-muted-border-color);color:inherit}[hidden],template{display:none!important}canvas{display:inline-block}input,optgroup,select,textarea{margin:0;font-size:1rem;line-height:var(--pico-line-height);font-family:inherit;letter-spacing:inherit}input{overflow:visible}select{text-transform:none}legend{max-width:100%;padding:0;color:inherit;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}::-moz-focus-inner{padding:0;border-style:none}:-moz-focusring{outline:0}:-moz-ui-invalid{box-shadow:none}::-ms-expand{display:none}[type=file],[type=range]{padding:0;border-width:0}input:not([type=checkbox],[type=radio],[type=range]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2)}fieldset{width:100%;margin:0;margin-bottom:var(--pico-spacing);padding:0;border:0}fieldset legend,label{display:block;margin-bottom:calc(var(--pico-spacing) * .375);color:var(--pico-color);font-weight:var(--pico-form-label-font-weight,var(--pico-font-weight))}fieldset legend{margin-bottom:calc(var(--pico-spacing) * .5)}button[type=submit],input:not([type=checkbox],[type=radio]),select,textarea{width:100%}input:not([type=checkbox],[type=radio],[type=range],[type=file]),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal)}input,select,textarea{--pico-background-color:var(--pico-form-element-background-color);--pico-border-color:var(--pico-form-element-border-color);--pico-color:var(--pico-form-element-color);--pico-box-shadow:none;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:var(--pico-border-radius);outline:0;background-color:var(--pico-background-color);box-shadow:var(--pico-box-shadow);color:var(--pico-color);font-weight:var(--pico-font-weight);transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[readonly]):is(:active,:focus){--pico-background-color:var(--pico-form-element-active-background-color)}:where(select,textarea):not([readonly]):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[role=switch],[readonly]):is(:active,:focus){--pico-border-color:var(--pico-form-element-active-border-color)}:where(select,textarea):not([readonly]):focus,input:not([type=submit],[type=button],[type=reset],[type=range],[type=file],[readonly]):focus{--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}:where(fieldset[disabled]) :is(input:not([type=submit],[type=button],[type=reset]),select,textarea),input:not([type=submit],[type=button],[type=reset])[disabled],label[aria-disabled=true],select[disabled],textarea[disabled]{opacity:var(--pico-form-element-disabled-opacity);pointer-events:none}label[aria-disabled=true] input[disabled]{opacity:1}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid]{padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal)!important;padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem)!important;background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=false]:not(select){background-image:var(--pico-icon-valid)}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week],[type=range])[aria-invalid=true]:not(select){background-image:var(--pico-icon-invalid)}:where(input,select,textarea)[aria-invalid=false]{--pico-border-color:var(--pico-form-element-valid-border-color)}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus){--pico-border-color:var(--pico-form-element-valid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-valid-focus-color)!important}:where(input,select,textarea)[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus){--pico-border-color:var(--pico-form-element-invalid-active-border-color)!important}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus):not([type=checkbox],[type=radio]){--pico-box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-invalid-focus-color)!important}[dir=rtl] :where(input,select,textarea):not([type=checkbox],[type=radio]):is([aria-invalid],[aria-invalid=true],[aria-invalid=false]){background-position:center left .75rem}input::-webkit-input-placeholder,input::placeholder,select:invalid,textarea::-webkit-input-placeholder,textarea::placeholder{color:var(--pico-form-element-placeholder-color);opacity:1}input:not([type=checkbox],[type=radio]),select,textarea{margin-bottom:var(--pico-spacing)}select::-ms-expand{border:0;background-color:transparent}select:not([multiple],[size]){padding-right:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);padding-left:var(--pico-form-element-spacing-horizontal);padding-inline-start:var(--pico-form-element-spacing-horizontal);padding-inline-end:calc(var(--pico-form-element-spacing-horizontal) + 1.5rem);background-image:var(--pico-icon-chevron);background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}select[multiple] option:checked{background:var(--pico-form-element-selected-background-color)}[dir=rtl] select:not([multiple],[size]){background-position:center left .75rem}textarea{display:block;resize:vertical}textarea[aria-invalid]{--pico-icon-height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);background-position:top right .75rem!important;background-size:1rem var(--pico-icon-height)!important}:where(input,select,textarea,fieldset,.grid)+small{display:block;width:100%;margin-top:calc(var(--pico-spacing) * -.75);margin-bottom:var(--pico-spacing);color:var(--pico-muted-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=false]+small{color:var(--pico-ins-color)}:where(input,select,textarea,fieldset,.grid)[aria-invalid=true]+small{color:var(--pico-del-color)}label>:where(input,select,textarea){margin-top:calc(var(--pico-spacing) * .25)}label:has([type=checkbox],[type=radio]){width:-moz-fit-content;width:fit-content;cursor:pointer}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1.25em;height:1.25em;margin-top:-.125em;margin-inline-end:.5em;border-width:var(--pico-border-width);vertical-align:middle;cursor:pointer}[type=checkbox]::-ms-check,[type=radio]::-ms-check{display:none}[type=checkbox]:checked,[type=checkbox]:checked:active,[type=checkbox]:checked:focus,[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-checkbox);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=checkbox]~label,[type=radio]~label{display:inline-block;margin-bottom:0;cursor:pointer}[type=checkbox]~label:not(:last-of-type),[type=radio]~label:not(:last-of-type){margin-inline-end:1em}[type=checkbox]:indeterminate{--pico-background-color:var(--pico-primary-background);--pico-border-color:var(--pico-primary-border);background-image:var(--pico-icon-minus);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=radio]{border-radius:50%}[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--pico-background-color:var(--pico-primary-inverse);border-width:.35em;background-image:none}[type=checkbox][role=switch]{--pico-background-color:var(--pico-switch-background-color);--pico-color:var(--pico-switch-color);width:2.25em;height:1.25em;border:var(--pico-border-width) solid var(--pico-border-color);border-radius:1.25em;background-color:var(--pico-background-color);line-height:1.25em}[type=checkbox][role=switch]:not([aria-invalid]){--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:before{display:block;width:calc(1.25em - var(--pico-border-width) * 2);height:100%;border-radius:50%;background-color:var(--pico-color);box-shadow:var(--pico-switch-thumb-box-shadow);content:"";transition:margin .1s ease-in-out}[type=checkbox][role=switch]:focus{--pico-background-color:var(--pico-switch-background-color);--pico-border-color:var(--pico-switch-background-color)}[type=checkbox][role=switch]:checked{--pico-background-color:var(--pico-switch-checked-background-color);--pico-border-color:var(--pico-switch-checked-background-color);background-image:none}[type=checkbox][role=switch]:checked:before{margin-inline-start:calc(1.125em - var(--pico-border-width))}[type=checkbox][role=switch][disabled]{--pico-background-color:var(--pico-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus{--pico-background-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true]{--pico-background-color:var(--pico-form-element-invalid-border-color)}[type=checkbox][aria-invalid=false]:checked,[type=checkbox][aria-invalid=false]:checked:active,[type=checkbox][aria-invalid=false]:checked:focus,[type=checkbox][role=switch][aria-invalid=false]:checked,[type=checkbox][role=switch][aria-invalid=false]:checked:active,[type=checkbox][role=switch][aria-invalid=false]:checked:focus,[type=radio][aria-invalid=false]:checked,[type=radio][aria-invalid=false]:checked:active,[type=radio][aria-invalid=false]:checked:focus{--pico-border-color:var(--pico-form-element-valid-border-color)}[type=checkbox]:checked:active[aria-invalid=true],[type=checkbox]:checked:focus[aria-invalid=true],[type=checkbox]:checked[aria-invalid=true],[type=checkbox][role=switch]:checked:active[aria-invalid=true],[type=checkbox][role=switch]:checked:focus[aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true],[type=radio]:checked:active[aria-invalid=true],[type=radio]:checked:focus[aria-invalid=true],[type=radio]:checked[aria-invalid=true]{--pico-border-color:var(--pico-form-element-invalid-border-color)}[type=color]::-webkit-color-swatch-wrapper{padding:0}[type=color]::-moz-focus-inner{padding:0}[type=color]::-webkit-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}[type=color]::-moz-color-swatch{border:0;border-radius:calc(var(--pico-border-radius) * .5)}input:not([type=checkbox],[type=radio],[type=range],[type=file]):is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){--pico-icon-position:.75rem;--pico-icon-width:1rem;padding-right:calc(var(--pico-icon-width) + var(--pico-icon-position));background-image:var(--pico-icon-date);background-position:center right var(--pico-icon-position);background-size:var(--pico-icon-width) auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=time]{background-image:var(--pico-icon-time)}[type=date]::-webkit-calendar-picker-indicator,[type=datetime-local]::-webkit-calendar-picker-indicator,[type=month]::-webkit-calendar-picker-indicator,[type=time]::-webkit-calendar-picker-indicator,[type=week]::-webkit-calendar-picker-indicator{width:var(--pico-icon-width);margin-right:calc(var(--pico-icon-width) * -1);margin-left:var(--pico-icon-position);opacity:0}@-moz-document url-prefix(){[type=date],[type=datetime-local],[type=month],[type=time],[type=week]{padding-right:var(--pico-form-element-spacing-horizontal)!important;background-image:none!important}}[dir=rtl] :is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){text-align:right}[type=file]{--pico-color:var(--pico-muted-color);margin-left:calc(var(--pico-outline-width) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) 0;padding-left:var(--pico-outline-width);border:0;border-radius:0;background:0 0}[type=file]::file-selector-button{margin-right:calc(var(--pico-spacing)/ 2);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal)}[type=file]:is(:hover,:active,:focus)::file-selector-button{--pico-background-color:var(--pico-secondary-hover-background);--pico-border-color:var(--pico-secondary-hover-border)}[type=file]:focus::file-selector-button{--pico-box-shadow:var(--pico-button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--pico-outline-width) var(--pico-secondary-focus)}[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:1.25rem;background:0 0}[type=range]::-webkit-slider-runnable-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-webkit-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-moz-range-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-moz-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-ms-track{width:100%;height:.375rem;border-radius:var(--pico-border-radius);background-color:var(--pico-range-border-color);-ms-transition:background-color var(--pico-transition),box-shadow var(--pico-transition);transition:background-color var(--pico-transition),box-shadow var(--pico-transition)}[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-webkit-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-moz-range-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-moz-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]::-ms-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.4375rem;border:2px solid var(--pico-range-thumb-border-color);border-radius:50%;background-color:var(--pico-range-thumb-color);cursor:pointer;-ms-transition:background-color var(--pico-transition),transform var(--pico-transition);transition:background-color var(--pico-transition),transform var(--pico-transition)}[type=range]:active,[type=range]:focus-within{--pico-range-border-color:var(--pico-range-active-border-color);--pico-range-thumb-color:var(--pico-range-thumb-active-color)}[type=range]:active::-webkit-slider-thumb{transform:scale(1.25)}[type=range]:active::-moz-range-thumb{transform:scale(1.25)}[type=range]:active::-ms-thumb{transform:scale(1.25)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem);background-image:var(--pico-icon-search);background-position:center left calc(var(--pico-form-element-spacing-horizontal) + .125rem);background-size:1rem auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{padding-inline-start:calc(var(--pico-form-element-spacing-horizontal) + 1.75rem)!important;background-position:center left 1.125rem,center right .75rem}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=false]{background-image:var(--pico-icon-search),var(--pico-icon-valid)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=true]{background-image:var(--pico-icon-search),var(--pico-icon-invalid)}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{background-position:center right 1.125rem}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{background-position:center right 1.125rem,center left .75rem}details{display:block;margin-bottom:var(--pico-spacing)}details summary{line-height:1rem;list-style-type:none;cursor:pointer;transition:color var(--pico-transition)}details summary:not([role]){color:var(--pico-accordion-close-summary-color)}details summary::-webkit-details-marker{display:none}details summary::marker{display:none}details summary::-moz-list-bullet{list-style-type:none}details summary:after{display:block;width:1rem;height:1rem;margin-inline-start:calc(var(--pico-spacing,1rem) * .5);float:right;transform:rotate(-90deg);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:"";transition:transform var(--pico-transition)}details summary:focus{outline:0}details summary:focus:not([role]){color:var(--pico-accordion-active-summary-color)}details summary:focus-visible:not([role]){outline:var(--pico-outline-width) solid var(--pico-primary-focus);outline-offset:calc(var(--pico-spacing,1rem) * .5);color:var(--pico-primary)}details summary[role=button]{width:100%;text-align:left}details summary[role=button]:after{height:calc(1rem * var(--pico-line-height,1.5))}details[open]>summary{margin-bottom:var(--pico-spacing)}details[open]>summary:not([role]):not(:focus){color:var(--pico-accordion-open-summary-color)}details[open]>summary:after{transform:rotate(0)}[dir=rtl] details summary{text-align:right}[dir=rtl] details summary:after{float:left;background-position:left center}article{margin-bottom:var(--pico-block-spacing-vertical);padding:var(--pico-block-spacing-vertical) var(--pico-block-spacing-horizontal);border-radius:var(--pico-border-radius);background:var(--pico-card-background-color);box-shadow:var(--pico-card-box-shadow)}article>footer,article>header{margin-right:calc(var(--pico-block-spacing-horizontal) * -1);margin-left:calc(var(--pico-block-spacing-horizontal) * -1);padding:calc(var(--pico-block-spacing-vertical) * .66) var(--pico-block-spacing-horizontal);background-color:var(--pico-card-sectioning-background-color)}article>header{margin-top:calc(var(--pico-block-spacing-vertical) * -1);margin-bottom:var(--pico-block-spacing-vertical);border-bottom:var(--pico-border-width) solid var(--pico-card-border-color);border-top-right-radius:var(--pico-border-radius);border-top-left-radius:var(--pico-border-radius)}article>footer{margin-top:var(--pico-block-spacing-vertical);margin-bottom:calc(var(--pico-block-spacing-vertical) * -1);border-top:var(--pico-border-width) solid var(--pico-card-border-color);border-bottom-right-radius:var(--pico-border-radius);border-bottom-left-radius:var(--pico-border-radius)}details.dropdown{position:relative;border-bottom:none}details.dropdown summary:after,details.dropdown>a:after,details.dropdown>button:after{display:block;width:1rem;height:calc(1rem * var(--pico-line-height,1.5));margin-inline-start:.25rem;float:right;transform:rotate(0) translate(.2rem);background-image:var(--pico-icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:""}nav details.dropdown{margin-bottom:0}details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2);padding:var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);border:var(--pico-border-width) solid var(--pico-form-element-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-form-element-background-color);color:var(--pico-form-element-placeholder-color);line-height:inherit;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:background-color var(--pico-transition),border-color var(--pico-transition),color var(--pico-transition),box-shadow var(--pico-transition)}details.dropdown summary:not([role]):active,details.dropdown summary:not([role]):focus{border-color:var(--pico-form-element-active-border-color);background-color:var(--pico-form-element-active-background-color)}details.dropdown summary:not([role]):focus{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-form-element-focus-color)}details.dropdown summary:not([role]):focus-visible{outline:0}details.dropdown summary:not([role])[aria-invalid=false]{--pico-form-element-border-color:var(--pico-form-element-valid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-valid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-valid-focus-color)}details.dropdown summary:not([role])[aria-invalid=true]{--pico-form-element-border-color:var(--pico-form-element-invalid-border-color);--pico-form-element-active-border-color:var(--pico-form-element-invalid-focus-color);--pico-form-element-focus-color:var(--pico-form-element-invalid-focus-color)}nav details.dropdown{display:inline;margin:calc(var(--pico-nav-element-spacing-vertical) * -1) 0}nav details.dropdown summary:after{transform:rotate(0) translate(0)}nav details.dropdown summary:not([role]){height:calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2);padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav details.dropdown summary:not([role]):focus-visible{box-shadow:0 0 0 var(--pico-outline-width) var(--pico-primary-focus)}details.dropdown summary+ul{display:flex;z-index:99;position:absolute;left:0;flex-direction:column;width:100%;min-width:-moz-fit-content;min-width:fit-content;margin:0;margin-top:var(--pico-outline-width);padding:0;border:var(--pico-border-width) solid var(--pico-dropdown-border-color);border-radius:var(--pico-border-radius);background-color:var(--pico-dropdown-background-color);box-shadow:var(--pico-dropdown-box-shadow);color:var(--pico-dropdown-color);white-space:nowrap;opacity:0;transition:opacity var(--pico-transition),transform 0s ease-in-out 1s}details.dropdown summary+ul[dir=rtl]{right:0;left:auto}details.dropdown summary+ul li{width:100%;margin-bottom:0;padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);list-style:none}details.dropdown summary+ul li:first-of-type{margin-top:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li:last-of-type{margin-bottom:calc(var(--pico-form-element-spacing-vertical) * .5)}details.dropdown summary+ul li a{display:block;margin:calc(var(--pico-form-element-spacing-vertical) * -.5) calc(var(--pico-form-element-spacing-horizontal) * -1);padding:calc(var(--pico-form-element-spacing-vertical) * .5) var(--pico-form-element-spacing-horizontal);overflow:hidden;border-radius:0;color:var(--pico-dropdown-color);text-decoration:none;text-overflow:ellipsis}details.dropdown summary+ul li a:active,details.dropdown summary+ul li a:focus,details.dropdown summary+ul li a:focus-visible,details.dropdown summary+ul li a:hover,details.dropdown summary+ul li a[aria-current]:not([aria-current=false]){background-color:var(--pico-dropdown-hover-background-color)}details.dropdown summary+ul li label{width:100%}details.dropdown summary+ul li:has(label):hover{background-color:var(--pico-dropdown-hover-background-color)}details.dropdown[open] summary{margin-bottom:0}details.dropdown[open] summary+ul{transform:scaleY(1);opacity:1;transition:opacity var(--pico-transition),transform 0s ease-in-out 0s}details.dropdown[open] summary:before{display:block;z-index:1;position:fixed;width:100vw;height:100vh;top:0;right:0;bottom:0;left:0;background:0 0;content:"";cursor:default}label>details.dropdown{margin-top:calc(var(--pico-spacing) * .25)}[role=group],[role=search]{display:inline-flex;position:relative;width:100%;margin-bottom:var(--pico-spacing);border-radius:var(--pico-border-radius);box-shadow:var(--pico-group-box-shadow,0 0 0 transparent);vertical-align:middle;transition:box-shadow var(--pico-transition)}[role=group] input:not([type=checkbox],[type=radio]),[role=group] select,[role=group]>*,[role=search] input:not([type=checkbox],[type=radio]),[role=search] select,[role=search]>*{position:relative;flex:1 1 auto;margin-bottom:0}[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=group]>:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child),[role=search]>:not(:first-child){margin-left:0;border-top-left-radius:0;border-bottom-left-radius:0}[role=group] input:not([type=checkbox],[type=radio]):not(:last-child),[role=group] select:not(:last-child),[role=group]>:not(:last-child),[role=search] input:not([type=checkbox],[type=radio]):not(:last-child),[role=search] select:not(:last-child),[role=search]>:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}[role=group] input:not([type=checkbox],[type=radio]):focus,[role=group] select:focus,[role=group]>:focus,[role=search] input:not([type=checkbox],[type=radio]):focus,[role=search] select:focus,[role=search]>:focus{z-index:2}[role=group] [role=button]:not(:first-child),[role=group] [type=button]:not(:first-child),[role=group] [type=reset]:not(:first-child),[role=group] [type=submit]:not(:first-child),[role=group] button:not(:first-child),[role=group] input:not([type=checkbox],[type=radio]):not(:first-child),[role=group] select:not(:first-child),[role=search] [role=button]:not(:first-child),[role=search] [type=button]:not(:first-child),[role=search] [type=reset]:not(:first-child),[role=search] [type=submit]:not(:first-child),[role=search] button:not(:first-child),[role=search] input:not([type=checkbox],[type=radio]):not(:first-child),[role=search] select:not(:first-child){margin-left:calc(var(--pico-border-width) * -1)}[role=group] [role=button],[role=group] [type=button],[role=group] [type=reset],[role=group] [type=submit],[role=group] button,[role=search] [role=button],[role=search] [type=button],[role=search] [type=reset],[role=search] [type=submit],[role=search] button{width:auto}@supports selector(:has(*)){[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-button)}[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=group]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select,[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) input:not([type=checkbox],[type=radio]),[role=search]:has(button:focus,[type=submit]:focus,[type=button]:focus,[role=button]:focus) select{border-color:transparent}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus),[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus){--pico-group-box-shadow:var(--pico-group-box-shadow-focus-with-input)}[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=group]:has(input:not([type=submit],[type=button]):focus,select:focus) button,[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [role=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=button],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) [type=submit],[role=search]:has(input:not([type=submit],[type=button]):focus,select:focus) button{--pico-button-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-border);--pico-button-hover-box-shadow:0 0 0 var(--pico-border-width) var(--pico-primary-hover-border)}[role=group] [role=button]:focus,[role=group] [type=button]:focus,[role=group] [type=reset]:focus,[role=group] [type=submit]:focus,[role=group] button:focus,[role=search] [role=button]:focus,[role=search] [type=button]:focus,[role=search] [type=reset]:focus,[role=search] [type=submit]:focus,[role=search] button:focus{box-shadow:none}}[role=search]>:first-child{border-top-left-radius:5rem;border-bottom-left-radius:5rem}[role=search]>:last-child{border-top-right-radius:5rem;border-bottom-right-radius:5rem}[aria-busy=true]:not(input,select,textarea,html){white-space:nowrap}[aria-busy=true]:not(input,select,textarea,html):before{display:inline-block;width:1em;height:1em;background-image:var(--pico-icon-loading);background-size:1rem auto;background-repeat:no-repeat;content:"";vertical-align:-.125em}[aria-busy=true]:not(input,select,textarea,html):not(:empty):before{margin-inline-end:calc(var(--pico-spacing) * .5)}[aria-busy=true]:not(input,select,textarea,html):empty{text-align:center}[role=button][aria-busy=true],[type=button][aria-busy=true],[type=reset][aria-busy=true],[type=submit][aria-busy=true],a[aria-busy=true],button[aria-busy=true]{pointer-events:none}:root{--pico-scrollbar-width:0px}dialog{display:flex;z-index:999;position:fixed;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center;width:inherit;min-width:100%;height:inherit;min-height:100%;padding:0;border:0;-webkit-backdrop-filter:var(--pico-modal-overlay-backdrop-filter);backdrop-filter:var(--pico-modal-overlay-backdrop-filter);background-color:var(--pico-modal-overlay-background-color);color:var(--pico-color)}dialog article{width:100%;max-height:calc(100vh - var(--pico-spacing) * 2);margin:var(--pico-spacing);overflow:auto}@media (min-width:576px){dialog article{max-width:510px}}@media (min-width:768px){dialog article{max-width:700px}}dialog article>header>*{margin-bottom:0}dialog article>header .close,dialog article>header :is(a,button)[rel=prev]{margin:0;margin-left:var(--pico-spacing);padding:0;float:right}dialog article>footer{text-align:right}dialog article>footer [role=button],dialog article>footer button{margin-bottom:0}dialog article>footer [role=button]:not(:first-of-type),dialog article>footer button:not(:first-of-type){margin-left:calc(var(--pico-spacing) * .5)}dialog article .close,dialog article :is(a,button)[rel=prev]{display:block;width:1rem;height:1rem;margin-top:calc(var(--pico-spacing) * -1);margin-bottom:var(--pico-spacing);margin-left:auto;border:none;background-image:var(--pico-icon-close);background-position:center;background-size:auto 1rem;background-repeat:no-repeat;background-color:transparent;opacity:.5;transition:opacity var(--pico-transition)}dialog article .close:is([aria-current]:not([aria-current=false]),:hover,:active,:focus),dialog article :is(a,button)[rel=prev]:is([aria-current]:not([aria-current=false]),:hover,:active,:focus){opacity:1}dialog:not([open]),dialog[open=false]{display:none}.modal-is-open{padding-right:var(--pico-scrollbar-width,0);overflow:hidden;pointer-events:none;touch-action:none}.modal-is-open dialog{pointer-events:auto;touch-action:auto}:where(.modal-is-opening,.modal-is-closing) dialog,:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-duration:.2s;animation-timing-function:ease-in-out;animation-fill-mode:both}:where(.modal-is-opening,.modal-is-closing) dialog{animation-duration:.8s;animation-name:modal-overlay}:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-delay:.2s;animation-name:modal}.modal-is-closing dialog,.modal-is-closing dialog>article{animation-delay:0s;animation-direction:reverse}@keyframes modal-overlay{0%{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:transparent}}@keyframes modal{0%{transform:translateY(-100%);opacity:0}}:where(nav li):before{float:left;content:"​"}nav,nav ul{display:flex}nav{justify-content:space-between;overflow:visible}nav ol,nav ul{align-items:center;margin-bottom:0;padding:0;list-style:none}nav ol:first-of-type,nav ul:first-of-type{margin-left:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav ol:last-of-type,nav ul:last-of-type{margin-right:calc(var(--pico-nav-element-spacing-horizontal) * -1)}nav li{display:inline-block;margin:0;padding:var(--pico-nav-element-spacing-vertical) var(--pico-nav-element-spacing-horizontal)}nav li :where(a,[role=link]){display:inline-block;margin:calc(var(--pico-nav-link-spacing-vertical) * -1) calc(var(--pico-nav-link-spacing-horizontal) * -1);padding:var(--pico-nav-link-spacing-vertical) var(--pico-nav-link-spacing-horizontal);border-radius:var(--pico-border-radius)}nav li :where(a,[role=link]):not(:hover){text-decoration:none}nav li [role=button],nav li button,nav li input:not([type=checkbox],[type=radio],[type=range],[type=file]),nav li select{height:auto;margin-right:inherit;margin-bottom:0;margin-left:inherit;padding:calc(var(--pico-nav-link-spacing-vertical) - var(--pico-border-width) * 2) var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb]{align-items:center;justify-content:start}nav[aria-label=breadcrumb] ul li:not(:first-child){margin-inline-start:var(--pico-nav-link-spacing-horizontal)}nav[aria-label=breadcrumb] ul li a{margin:calc(var(--pico-nav-link-spacing-vertical) * -1) 0;margin-inline-start:calc(var(--pico-nav-link-spacing-horizontal) * -1)}nav[aria-label=breadcrumb] ul li:not(:last-child):after{display:inline-block;position:absolute;width:calc(var(--pico-nav-link-spacing-horizontal) * 4);margin:0 calc(var(--pico-nav-link-spacing-horizontal) * -1);content:var(--pico-nav-breadcrumb-divider);color:var(--pico-muted-color);text-align:center;text-decoration:none;white-space:nowrap}nav[aria-label=breadcrumb] a[aria-current]:not([aria-current=false]){background-color:transparent;color:inherit;text-decoration:none;pointer-events:none}aside li,aside nav,aside ol,aside ul{display:block}aside li{padding:calc(var(--pico-nav-element-spacing-vertical) * .5) var(--pico-nav-element-spacing-horizontal)}aside li a{display:block}aside li [role=button]{margin:inherit}[dir=rtl] nav[aria-label=breadcrumb] ul li:not(:last-child) :after{content:"\\"}progress{display:inline-block;vertical-align:baseline}progress{-webkit-appearance:none;-moz-appearance:none;display:inline-block;appearance:none;width:100%;height:.5rem;margin-bottom:calc(var(--pico-spacing) * .5);overflow:hidden;border:0;border-radius:var(--pico-border-radius);background-color:var(--pico-progress-background-color);color:var(--pico-progress-color)}progress::-webkit-progress-bar{border-radius:var(--pico-border-radius);background:0 0}progress[value]::-webkit-progress-value{background-color:var(--pico-progress-color);-webkit-transition:inline-size var(--pico-transition);transition:inline-size var(--pico-transition)}progress::-moz-progress-bar{background-color:var(--pico-progress-color)}@media (prefers-reduced-motion:no-preference){progress:indeterminate{background:var(--pico-progress-background-color) linear-gradient(to right,var(--pico-progress-color) 30%,var(--pico-progress-background-color) 30%) top left/150% 150% no-repeat;animation:progress-indeterminate 1s linear infinite}progress:indeterminate[value]::-webkit-progress-value{background-color:transparent}progress:indeterminate::-moz-progress-bar{background-color:transparent}}@media (prefers-reduced-motion:no-preference){[dir=rtl] progress:indeterminate{animation-direction:reverse}}@keyframes progress-indeterminate{0%{background-position:200% 0}to{background-position:-200% 0}}[data-tooltip]{position:relative}[data-tooltip]:not(a,button,input){border-bottom:1px dotted;text-decoration:none;cursor:help}[data-tooltip]:after,[data-tooltip]:before,[data-tooltip][data-placement=top]:after,[data-tooltip][data-placement=top]:before{display:block;z-index:99;position:absolute;bottom:100%;left:50%;padding:.25rem .5rem;overflow:hidden;transform:translate(-50%,-.25rem);border-radius:var(--pico-border-radius);background:var(--pico-tooltip-background-color);content:attr(data-tooltip);color:var(--pico-tooltip-color);font-style:normal;font-weight:var(--pico-font-weight);font-size:.875rem;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;opacity:0;pointer-events:none}[data-tooltip]:after,[data-tooltip][data-placement=top]:after{padding:0;transform:translate(-50%);border-top:.3rem solid;border-right:.3rem solid transparent;border-left:.3rem solid transparent;border-radius:0;background-color:transparent;content:"";color:var(--pico-tooltip-background-color)}[data-tooltip][data-placement=bottom]:after,[data-tooltip][data-placement=bottom]:before{top:100%;bottom:auto;transform:translate(-50%,.25rem)}[data-tooltip][data-placement=bottom]:after{transform:translate(-50%,-.3rem);border:.3rem solid transparent;border-bottom:.3rem solid}[data-tooltip][data-placement=left]:after,[data-tooltip][data-placement=left]:before{top:50%;right:100%;bottom:auto;left:auto;transform:translate(-.25rem,-50%)}[data-tooltip][data-placement=left]:after{transform:translate(.3rem,-50%);border:.3rem solid transparent;border-left:.3rem solid}[data-tooltip][data-placement=right]:after,[data-tooltip][data-placement=right]:before{top:50%;right:auto;bottom:auto;left:100%;transform:translate(.25rem,-50%)}[data-tooltip][data-placement=right]:after{transform:translate(-.3rem,-50%);border:.3rem solid transparent;border-right:.3rem solid}[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{opacity:1}@media (hover:hover) and (pointer:fine){[data-tooltip]:focus:after,[data-tooltip]:focus:before,[data-tooltip]:hover:after,[data-tooltip]:hover:before{--pico-tooltip-slide-to:translate(-50%, -.25rem);transform:translate(-50%,.75rem);animation-duration:.2s;animation-fill-mode:forwards;animation-name:tooltip-slide;opacity:0}[data-tooltip]:focus:after,[data-tooltip]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, 0rem);transform:translate(-50%,-.25rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:focus:before,[data-tooltip][data-placement=bottom]:hover:after,[data-tooltip][data-placement=bottom]:hover:before{--pico-tooltip-slide-to:translate(-50%, .25rem);transform:translate(-50%,-.75rem);animation-name:tooltip-slide}[data-tooltip][data-placement=bottom]:focus:after,[data-tooltip][data-placement=bottom]:hover:after{--pico-tooltip-caret-slide-to:translate(-50%, -.3rem);transform:translate(-50%,-.5rem);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:focus:before,[data-tooltip][data-placement=left]:hover:after,[data-tooltip][data-placement=left]:hover:before{--pico-tooltip-slide-to:translate(-.25rem, -50%);transform:translate(.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=left]:focus:after,[data-tooltip][data-placement=left]:hover:after{--pico-tooltip-caret-slide-to:translate(.3rem, -50%);transform:translate(.05rem,-50%);animation-name:tooltip-caret-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:focus:before,[data-tooltip][data-placement=right]:hover:after,[data-tooltip][data-placement=right]:hover:before{--pico-tooltip-slide-to:translate(.25rem, -50%);transform:translate(-.75rem,-50%);animation-name:tooltip-slide}[data-tooltip][data-placement=right]:focus:after,[data-tooltip][data-placement=right]:hover:after{--pico-tooltip-caret-slide-to:translate(-.3rem, -50%);transform:translate(-.05rem,-50%);animation-name:tooltip-caret-slide}}@keyframes tooltip-slide{to{transform:var(--pico-tooltip-slide-to);opacity:1}}@keyframes tooltip-caret-slide{50%{opacity:0}to{transform:var(--pico-tooltip-caret-slide-to);opacity:1}}[aria-controls]{cursor:pointer}[aria-disabled=true],[disabled]{cursor:not-allowed}[aria-hidden=false][hidden]{display:initial}[aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);position:absolute}[tabindex],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation}[dir=rtl]{direction:rtl}@media (prefers-reduced-motion:reduce){:not([aria-busy=true]),:not([aria-busy=true]):after,:not([aria-busy=true]):before{background-attachment:initial!important;animation-duration:1ms!important;animation-delay:-1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-delay:0s!important;transition-duration:0s!important}}.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (-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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (-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 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (-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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (-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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (-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 8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-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 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (-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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (-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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#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;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #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:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;top:0;right:0;bottom:0;left:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}svg.svelte-d2loi5{display:block;fill:#e15042}li.svelte-ltkwvy.svelte-ltkwvy{text-align:left;cursor:default;display:grid;grid-template-columns:40px 1fr;color:var(--color-text);padding:8px 0;font-size:14px;line-height:18px;min-width:fit-content}li.svelte-ltkwvy.svelte-ltkwvy:first-child{padding-top:10px}li.svelte-ltkwvy.svelte-ltkwvy:last-child{padding-bottom:10px}li.selected.svelte-ltkwvy.svelte-ltkwvy{background-color:#f3f6ff}li.selected.svelte-ltkwvy.svelte-ltkwvy{animation:svelte-ltkwvy-backAndForth 5s linear infinite}li.selected.svelte-ltkwvy .primary.svelte-ltkwvy{color:#2b8bfb}li.svelte-ltkwvy>img.svelte-ltkwvy{align-self:center;justify-self:center;opacity:.75}.texts.svelte-ltkwvy.svelte-ltkwvy{padding:0 17px 0 0}.texts.svelte-ltkwvy>.svelte-ltkwvy{white-space:nowrap;display:block;min-width:fit-content}.primary.svelte-ltkwvy.svelte-ltkwvy{font-weight:600}.secondary.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7;padding-left:4px}.line2.svelte-ltkwvy.svelte-ltkwvy{color:#aeb6c7}@keyframes svelte-ltkwvy-backAndForth{0%{transform:translate(0)}10%{transform:translate(0)}45%{transform:translate(calc(-100% + 270px))}55%{transform:translate(calc(-100% + 270px))}90%{transform:translate(0)}to{transform:translate(0)}}div.svelte-7cmwmc{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;display:flex;align-items:center}svg.svelte-7cmwmc{animation:svelte-7cmwmc-rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@keyframes svelte-7cmwmc-rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}svg.svelte-gzo3ar.svelte-gzo3ar{display:block;fill:#6b7c93;stroke:#6b7c93}.list-icon.svelte-gzo3ar.svelte-gzo3ar{grid-row:1/3;align-self:center;margin:8px}.in-map.svelte-gzo3ar.svelte-gzo3ar{height:30px}.maplibregl-canvas-container .marker-selected{z-index:1}.maplibregl-canvas-container svg.svelte-gzo3ar path.svelte-gzo3ar,.leaflet-map-pane svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#3170fe;stroke:#3170fe}.marker-selected svg.svelte-gzo3ar path.svelte-gzo3ar{fill:#98b7ff;stroke:#3170fe}.marker-reverse svg.svelte-gzo3ar path.svelte-gzo3ar{fill:silver;stroke:gray}.marker-interactive{cursor:pointer!important}.maptiler-gc-popup>.maplibregl-popup-content{padding:2px 8px}svg.svelte-en2qvf{display:block;fill:var(--color-icon-button)}circle.svelte-1aq105l{stroke-width:1.875;fill:none}path.svelte-1aq105l{stroke-width:1.875;stroke-linecap:round}svg.svelte-1aq105l{display:block;stroke:var(--color-icon-button)}form.svelte-bz0zu3.svelte-bz0zu3{font-family:Open Sans,Ubuntu,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;z-index:10;border-radius:4px;margin:0;transition:max-width .25s;box-shadow:0 2px 5px #33335926;--color-text:#444952;--color-icon-button:#444952}form.svelte-bz0zu3.svelte-bz0zu3,form.svelte-bz0zu3 .svelte-bz0zu3,form.svelte-bz0zu3 .svelte-bz0zu3:after,form.svelte-bz0zu3 .svelte-bz0zu3:before{box-sizing:border-box}form.can-collapse.svelte-bz0zu3.svelte-bz0zu3{max-width:29px}form.can-collapse.svelte-bz0zu3 input.svelte-bz0zu3::placeholder{transition:opacity .25s;opacity:0}form.svelte-bz0zu3.svelte-bz0zu3,form.svelte-bz0zu3.svelte-bz0zu3:focus-within,form.svelte-bz0zu3.svelte-bz0zu3:hover{width:270px;max-width:270px}form.svelte-bz0zu3 input.svelte-bz0zu3::placeholder,form.svelte-bz0zu3:focus-within input.svelte-bz0zu3::placeholder,form.svelte-bz0zu3:hover input.svelte-bz0zu3::placeholder{opacity:1}input.svelte-bz0zu3.svelte-bz0zu3{font:inherit;font-size:14px;flex-grow:1;min-height:29px;background-color:transparent;color:#444952;white-space:nowrap;overflow:hidden;border:0;margin:0;padding:0}input.svelte-bz0zu3.svelte-bz0zu3:focus{color:#444952;outline:0;outline:none;box-shadow:none}ul.svelte-bz0zu3.svelte-bz0zu3,div.error.svelte-bz0zu3.svelte-bz0zu3,div.no-results.svelte-bz0zu3.svelte-bz0zu3{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:calc(100% + 6px);overflow:hidden}ul.svelte-bz0zu3.svelte-bz0zu3{font-size:14px;line-height:16px;box-shadow:0 5px 10px #33335926}div.error.svelte-bz0zu3.svelte-bz0zu3,div.no-results.svelte-bz0zu3.svelte-bz0zu3{font:inherit;line-height:18px;font-size:12px;display:flex;gap:16px}div.error.svelte-bz0zu3.svelte-bz0zu3{padding:16px;font-weight:600;color:#e25041;background-color:#fbeae8}div.error.svelte-bz0zu3 div.svelte-bz0zu3{flex-grow:1}div.error.svelte-bz0zu3 svg{flex-shrink:0;width:20px;height:20px}div.error.svelte-bz0zu3 button.svelte-bz0zu3{flex-shrink:0}div.error.svelte-bz0zu3 button.svelte-bz0zu3>svg{width:13px;fill:#e25041}div.error.svelte-bz0zu3 button.svelte-bz0zu3:hover svg,div.error.svelte-bz0zu3 button.svelte-bz0zu3:active svg{fill:#444952}div.no-results.svelte-bz0zu3.svelte-bz0zu3{padding:14px 24px 14px 16px;font-weight:400;color:#6b7c93;box-shadow:0 5px 10px #33335926}div.no-results.svelte-bz0zu3 svg{margin-top:4px;flex-shrink:0;width:20px;height:20px;width:30px;height:30px}.leaflet-bottom ul.options.svelte-bz0zu3.svelte-bz0zu3,.maplibregl-ctrl-bottom-left ul.options.svelte-bz0zu3.svelte-bz0zu3,.maplibregl-ctrl-bottom-right ul.options.svelte-bz0zu3.svelte-bz0zu3{top:auto;bottom:calc(100% + 6px)}button.svelte-bz0zu3.svelte-bz0zu3{padding:0;margin:0;border:0;background-color:transparent;height:auto;width:auto}button.svelte-bz0zu3.svelte-bz0zu3:hover{background-color:transparent}button.svelte-bz0zu3:hover svg,button.svelte-bz0zu3:active svg{fill:#2b8bfb}.input-group.svelte-bz0zu3.svelte-bz0zu3{display:flex;align-items:stretch;gap:7px;padding-inline:8px;border-radius:4px;overflow:hidden}.input-group.svelte-bz0zu3.svelte-bz0zu3:focus-within{outline:#2b8bfb solid 2px}.search-button.svelte-bz0zu3.svelte-bz0zu3{flex-shrink:0}.maplibregl-ctrl-geocoder:not(.maptiler-ctrl) .search-button svg{width:12px!important;transform:translate(.5px)}.clear-button-container.svelte-bz0zu3.svelte-bz0zu3{display:flex;display:none;position:relative;align-items:stretch}.clear-button-container.displayable.svelte-bz0zu3.svelte-bz0zu3{display:flex;flex-shrink:0}.maplibregl-ctrl-geocoder{position:relative;z-index:3}.maptiler-ctrl:not(:empty){box-shadow:none}.maptiler-ctrl .input-group.svelte-bz0zu3.svelte-bz0zu3{padding-inline:8px;border:white solid 2px}.maptiler-ctrl .input-group.svelte-bz0zu3.svelte-bz0zu3:focus-within{border:#2b8bfb solid 2px;outline:0;outline:none}.maptiler-ctrl form.can-collapse.svelte-bz0zu3.svelte-bz0zu3{max-width:33px}.maptiler-ctrl form.svelte-bz0zu3.svelte-bz0zu3,.maptiler-ctrl form.svelte-bz0zu3.svelte-bz0zu3:focus-within,.maptiler-ctrl form.svelte-bz0zu3.svelte-bz0zu3:hover{width:270px;max-width:270px}div.svelte-ixhnie{position:absolute;top:20px;left:50px}div.svelte-mpick2{float:left}.top.svelte-mpick2{width:100%;height:10vh}.left.svelte-mpick2{width:25%;height:90vh;overflow:scroll;padding:8px}.main.svelte-mpick2{width:75%;height:90vh}button.svelte-gb6dzm{background:none;border:1px solid rgba(0,0,0,0)}button.svelte-gb6dzm:hover{border:1px solid black}.popup .maplibregl-popup-content{background-color:var(--pico-background-color)}.dot.svelte-1gcxp27{width:30px;height:30px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:gray;font-weight:700}.dot.svelte-1cj4rwq{width:30px;height:30px;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;background-color:#00f;font-weight:700}.dot.svelte-1cj4rwq:hover{border:1px solid black;cursor:pointer}.snapped.svelte-1cj4rwq{background-color:red}.free-node.svelte-1cj4rwq,.snapped-node.svelte-1cj4rwq{width:20px;height:20px;background-color:gray}.snapped-node.svelte-1cj4rwq:hover{border:3px solid red}.free-node.svelte-1cj4rwq:hover{border:3px solid blue}.hide.svelte-1cj4rwq{visibility:hidden}.ctrl-btn-center.svelte-1s83zbq{display:grid!important;height:100%;width:100%;place-items:center}.expand-map.svelte-p00lfq{position:absolute;top:0;bottom:0;left:0;right:0} diff --git a/assets/main-1f3fabc2.js b/assets/main-1f3fabc2.js new file mode 100644 index 0000000..5d6ab38 --- /dev/null +++ b/assets/main-1f3fabc2.js @@ -0,0 +1,675 @@ +var zS=Object.defineProperty;var DS=(r,e,t)=>e in r?zS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Wn=(r,e,t)=>(DS(r,typeof e!="symbol"?e+"":e,t),t);function RS(r,e){for(var t=0;tn[l]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function t(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function n(l){if(l.ep)return;l.ep=!0;const u=t(l);fetch(l.href,u)}})();function Ct(){}function Rn(r,e){for(const t in e)r[t]=e[t];return r}function Sb(r){return r()}function Ry(){return Object.create(null)}function _n(r){r.forEach(Sb)}function wc(r){return typeof r=="function"}function jt(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}let Df;function En(r,e){return r===e?!0:(Df||(Df=document.createElement("a")),Df.href=e,r===Df.href)}function BS(r){return Object.keys(r).length===0}function kb(r,...e){if(r==null){for(const n of e)n(void 0);return Ct}const t=r.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Hi(r){let e;return kb(r,t=>e=t)(),e}function wt(r,e,t){r.$$.on_destroy.push(kb(e,t))}function Vr(r,e,t,n){if(r){const l=Tb(r,e,t,n);return r[0](l)}}function Tb(r,e,t,n){return r[1]&&n?Rn(t.ctx.slice(),r[1](n(e))):t.ctx}function qr(r,e,t,n){if(r[2]&&n){const l=r[2](n(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const u=[],d=Math.max(e.dirty.length,l.length);for(let a=0;a32){const e=[],t=r.ctx.length/32;for(let n=0;nr.removeEventListener(e,t,n)}function vg(r){return function(e){return e.preventDefault(),r.call(this,e)}}function Kp(r){return function(e){return e.stopPropagation(),r.call(this,e)}}function Ee(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Eb(r){let e;return{p(...t){e=t,e.forEach(n=>r.push(n))},r(){e.forEach(t=>r.splice(r.indexOf(t),1))}}}function bg(r){return r===""?null:+r}function OS(r){return Array.from(r.childNodes)}function Lr(r,e){e=""+e,r.data!==e&&(r.data=e)}function ei(r,e){r.value=e??""}function fn(r,e,t,n){t==null?r.style.removeProperty(e):r.style.setProperty(e,t,n?"important":"")}function sd(r,e,t){for(let n=0;n{const l=r.$$.callbacks[e];if(l){const u=NS(e,t,{cancelable:n});return l.slice().forEach(d=>{d.call(r,u)}),!u.defaultPrevented}return!0}}function wg(r,e){return wh().$$.context.set(r,e),e}function Cb(r){return wh().$$.context.get(r)}function ur(r,e){const t=r.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const hc=[],pn=[];let _c=[];const Cm=[],Ib=Promise.resolve();let Im=!1;function Ab(){Im||(Im=!0,Ib.then(Pb))}function Lb(){return Ab(),Ib}function uh(r){_c.push(r)}function Po(r){Cm.push(r)}const Jp=new Set;let nc=0;function Pb(){if(nc!==0)return;const r=ch;do{try{for(;ncr.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),_c=e}const Vf=new Set;let Ja;function vr(){Ja={r:0,c:[],p:Ja}}function br(){Ja.r||_n(Ja.c),Ja=Ja.p}function oe(r,e){r&&r.i&&(Vf.delete(r),r.i(e))}function de(r,e,t,n){if(r&&r.o){if(Vf.has(r))return;Vf.add(r),Ja.c.push(()=>{Vf.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}function Jn(r){return(r==null?void 0:r.length)!==void 0?r:Array.from(r)}function VS(r,e){de(r,1,1,()=>{e.delete(r.key)})}function qS(r,e,t,n,l,u,d,a,_,x,S,k){let C=r.length,P=u.length,D=C;const N={};for(;D--;)N[r[D].key]=D;const z=[],B=new Map,O=new Map,G=[];for(D=P;D--;){const X=k(l,u,D),Y=t(X);let _e=d.get(Y);_e?n&&G.push(()=>_e.p(X,e)):(_e=x(Y,X),_e.c()),B.set(Y,z[D]=_e),Y in N&&O.set(Y,Math.abs(D-N[Y]))}const U=new Set,K=new Set;function me(X){oe(X,1),X.m(a,S),d.set(X.key,X),S=X.first,P--}for(;C&&P;){const X=z[P-1],Y=r[C-1],_e=X.key,ze=Y.key;X===Y?(S=X.first,C--,P--):B.has(ze)?!d.has(_e)||U.has(_e)?me(X):K.has(ze)?C--:O.get(_e)>O.get(ze)?(K.add(_e),me(X)):(U.add(ze),C--):(_(Y,d),C--)}for(;C--;){const X=r[C];B.has(X.key)||_(X,d)}for(;P;)me(z[P-1]);return _n(G),z}function Am(r,e){const t={},n={},l={$$scope:1};let u=r.length;for(;u--;){const d=r[u],a=e[u];if(a){for(const _ in d)_ in a||(n[_]=1);for(const _ in a)l[_]||(t[_]=a[_],l[_]=1);r[u]=a}else for(const _ in d)l[_]=1}for(const d in n)d in t||(t[d]=void 0);return t}function zo(r,e,t){const n=r.$$.props[e];n!==void 0&&(r.$$.bound[n]=t,t(r.$$.ctx[n]))}function je(r){r&&r.c()}function Oe(r,e,t){const{fragment:n,after_update:l}=r.$$;n&&n.m(e,t),uh(()=>{const u=r.$$.on_mount.map(Sb).filter(wc);r.$$.on_destroy?r.$$.on_destroy.push(...u):_n(u),r.$$.on_mount=[]}),l.forEach(uh)}function Ne(r,e){const t=r.$$;t.fragment!==null&&(US(t.after_update),_n(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function GS(r,e){r.$$.dirty[0]===-1&&(hc.push(r),Ab(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{const D=P.length?P[0]:C;return x.ctx&&l(x.ctx[k],x.ctx[k]=D)&&(!x.skip_bound&&x.bound[k]&&x.bound[k](D),S&&GS(r,k)),C}):[],x.update(),S=!0,_n(x.before_update),x.fragment=n?n(x.ctx):!1,e.target){if(e.hydrate){const k=OS(e.target);x.fragment&&x.fragment.l(k),k.forEach(ve)}else x.fragment&&x.fragment.c();e.intro&&oe(r.$$.fragment),Oe(r,e.target,e.anchor),Pb()}th(_)}class Ht{constructor(){Wn(this,"$$");Wn(this,"$$set")}$destroy(){Ne(this,1),this.$destroy=Ct}$on(e,t){if(!wc(t))return Ct;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const l=n.indexOf(t);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!BS(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const WS="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(WS);function By(r){let e,t;return{c(){e=fe("div"),t=rt(r[0]),Ee(e,"class","svelte-1uuov7f")},m(n,l){be(n,e,l),ie(e,t)},p(n,l){l&1&&Lr(t,n[0])},d(n){n&&ve(e)}}}function ZS(r){let e,t=r[0]&&By(r);return{c(){t&&t.c(),e=$n()},m(n,l){t&&t.m(n,l),be(n,e,l)},p(n,[l]){n[0]?t?t.p(n,l):(t=By(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Ct,o:Ct,d(n){n&&ve(e),t&&t.d(n)}}}function HS(r,e,t){let{loading:n}=e;return r.$$set=l=>{"loading"in l&&t(0,n=l.loading)},[n]}class zb extends Ht{constructor(e){super(),Zt(this,e,HS,ZS,jt,{loading:0})}}const $S=r=>({dialog:r&1}),Fy=r=>({dialog:r[0]});function XS(r){let e,t,n,l,u;const d=r[4].default,a=Vr(d,r,r[3],Fy);return{c(){e=fe("dialog"),t=fe("article"),a&&a.c(),e.open=!0},m(_,x){be(_,e,x),ie(e,t),a&&a.m(t,null),r[6](e),n=!0,l||(u=[Tt(window,"click",r[1]),Tt(window,"keydown",r[2]),Tt(e,"close",r[5])],l=!0)},p(_,[x]){a&&a.p&&(!n||x&9)&&Gr(a,d,_,_[3],n?qr(d,_[3],x,$S):Wr(_[3]),Fy)},i(_){n||(oe(a,_),n=!0)},o(_){de(a,_),n=!1},d(_){_&&ve(e),a&&a.d(_),r[6](null),l=!1,_n(u)}}}function KS(r,e,t){let{$$slots:n={},$$scope:l}=e,u;function d(S){u.open&&S.target==u&&u.close()}function a(S){(S.key=="Escape"||S.key=="Enter")&&(S.stopPropagation(),u.close())}function _(S){ur.call(this,r,S)}function x(S){pn[S?"unshift":"push"](()=>{u=S,t(0,u)})}return r.$$set=S=>{"$$scope"in S&&t(3,l=S.$$scope)},[u,d,a,l,n,_,x]}class Pd extends Ht{constructor(e){super(),Zt(this,e,KS,XS,jt,{})}}function Oy(r,e,t){const n=r.slice();return n[1]=e[t][0],n[2]=e[t][1],n}function Ny(r){let e,t,n=r[1]+"",l,u,d,a=r[2]+"",_,x;return{c(){e=fe("tr"),t=fe("td"),l=rt(n),u=Ve(),d=fe("td"),_=rt(a),x=Ve()},m(S,k){be(S,e,k),ie(e,t),ie(t,l),ie(e,u),ie(e,d),ie(d,_),ie(e,x)},p(S,k){k&1&&n!==(n=S[1]+"")&&Lr(l,n),k&1&&a!==(a=S[2]+"")&&Lr(_,a)},d(S){S&&ve(e)}}}function JS(r){let e,t,n=Jn(Object.entries(r[0])),l=[];for(let u=0;u{"properties"in l&&t(0,n=l.properties)},[n]}class zd extends Ht{constructor(e){super(),Zt(this,e,YS,JS,jt,{properties:0})}}function ad(r,e){let t=document.createElement("a");t.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),t.setAttribute("download",r),document.body.appendChild(t),t.click(),document.body.removeChild(t)}function dn(r){if(r==null||r==null)throw new Error("Oops, notNull given something null");return r}let ut;const Db=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Db.decode();let Hu=null;function yc(){return(Hu===null||Hu.byteLength===0)&&(Hu=new Uint8Array(ut.memory.buffer)),Hu}function Qi(r,e){return r=r>>>0,Db.decode(yc().subarray(r,r+e))}const Is=new Array(128).fill(void 0);Is.push(void 0,null,!0,!1);let rh=Is.length;function Ur(r){rh===Is.length&&Is.push(Is.length+1);const e=rh;return rh=Is[e],Is[e]=r,e}function hr(r){return Is[r]}function QS(r){r<132||(Is[r]=rh,rh=r)}function Ai(r){const e=hr(r);return QS(r),e}let Wi=0;const qf=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},e4=typeof qf.encodeInto=="function"?function(r,e){return qf.encodeInto(r,e)}:function(r,e){const t=qf.encode(r);return e.set(t),{read:r.length,written:t.length}};function Go(r,e,t){if(t===void 0){const a=qf.encode(r),_=e(a.length,1)>>>0;return yc().subarray(_,_+a.length).set(a),Wi=a.length,_}let n=r.length,l=e(n,1)>>>0;const u=yc();let d=0;for(;d127)break;u[l+d]=a}if(d!==n){d!==0&&(r=r.slice(d)),l=t(l,n,n=d+r.length*3,1)>>>0;const a=yc().subarray(l+d,l+n),_=e4(r,a);d+=_.written}return Wi=d,l}function fc(r){return r==null}let $u=null;function Wt(){return($u===null||$u.byteLength===0)&&($u=new Int32Array(ut.memory.buffer)),$u}let Xu=null;function Rb(){return(Xu===null||Xu.byteLength===0)&&(Xu=new Float64Array(ut.memory.buffer)),Xu}let Ku=null;function t4(){return(Ku===null||Ku.byteLength===0)&&(Ku=new BigInt64Array(ut.memory.buffer)),Ku}function Lm(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const l=r.description;return l==null?"Symbol":`Symbol(${l})`}if(e=="function"){const l=r.name;return typeof l=="string"&&l.length>0?`Function(${l})`:"Function"}if(Array.isArray(r)){const l=r.length;let u="[";l>0&&(u+=Lm(r[0]));for(let d=1;d1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} +${r.stack}`:n}function r4(r,e){const t=e(r.length*1,1)>>>0;return yc().set(r,t/1),Wi=r.length,t}function n4(r,e){return r=r>>>0,Rb().subarray(r/8,r/8+e)}function i4(r,e){return r=r>>>0,yc().subarray(r/1,r/1+e)}function Ka(r,e){try{return r.apply(this,e)}catch(t){ut.__wbindgen_exn_store(Ur(t))}}class Bb{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();ut.__wbg_ltn_free(e)}constructor(e,t,n){try{const x=ut.__wbindgen_add_to_stack_pointer(-16),S=r4(e,ut.__wbindgen_malloc),k=Wi;var l=fc(n)?0:Go(n,ut.__wbindgen_malloc,ut.__wbindgen_realloc),u=Wi;ut.ltn_new(x,S,k,Ur(t),l,u);var d=Wt()[x/4+0],a=Wt()[x/4+1],_=Wt()[x/4+2];if(_)throw Ai(a);return this.__wbg_ptr=d>>>0,this}finally{ut.__wbindgen_add_to_stack_pointer(16)}}getInvertedBoundary(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_getInvertedBoundary(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}getBounds(){try{const l=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_getBounds(l,this.__wbg_ptr);var e=Wt()[l/4+0],t=Wt()[l/4+1],n=n4(e,t).slice();return ut.__wbindgen_free(e,t*8,8),n}finally{ut.__wbindgen_add_to_stack_pointer(16)}}toRouteSnapper(){try{const l=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_toRouteSnapper(l,this.__wbg_ptr);var e=Wt()[l/4+0],t=Wt()[l/4+1],n=i4(e,t).slice();return ut.__wbindgen_free(e,t*1,1),n}finally{ut.__wbindgen_add_to_stack_pointer(16)}}toRouteSnapperGj(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_toRouteSnapperGj(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}renderModalFilters(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_renderModalFilters(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}renderNeighbourhood(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_renderNeighbourhood(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}renderAutoBoundaries(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_renderAutoBoundaries(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}setNeighbourhoodBoundary(e,t){try{const u=ut.__wbindgen_add_to_stack_pointer(-16),d=Go(e,ut.__wbindgen_malloc,ut.__wbindgen_realloc),a=Wi;ut.ltn_setNeighbourhoodBoundary(u,this.__wbg_ptr,d,a,Ur(t));var n=Wt()[u/4+0],l=Wt()[u/4+1];if(l)throw Ai(n)}finally{ut.__wbindgen_add_to_stack_pointer(16)}}deleteNeighbourhoodBoundary(e){const t=Go(e,ut.__wbindgen_malloc,ut.__wbindgen_realloc),n=Wi;ut.ltn_deleteNeighbourhoodBoundary(this.__wbg_ptr,t,n)}renameNeighbourhoodBoundary(e,t){const n=Go(e,ut.__wbindgen_malloc,ut.__wbindgen_realloc),l=Wi,u=Go(t,ut.__wbindgen_malloc,ut.__wbindgen_realloc),d=Wi;ut.ltn_renameNeighbourhoodBoundary(this.__wbg_ptr,n,l,u,d)}setCurrentNeighbourhood(e){try{const l=ut.__wbindgen_add_to_stack_pointer(-16),u=Go(e,ut.__wbindgen_malloc,ut.__wbindgen_realloc),d=Wi;ut.ltn_setCurrentNeighbourhood(l,this.__wbg_ptr,u,d);var t=Wt()[l/4+0],n=Wt()[l/4+1];if(n)throw Ai(t)}finally{ut.__wbindgen_add_to_stack_pointer(16)}}addModalFilter(e,t){try{const u=ut.__wbindgen_add_to_stack_pointer(-16),d=Go(t,ut.__wbindgen_malloc,ut.__wbindgen_realloc),a=Wi;ut.ltn_addModalFilter(u,this.__wbg_ptr,Ur(e),d,a);var n=Wt()[u/4+0],l=Wt()[u/4+1];if(l)throw Ai(n)}finally{ut.__wbindgen_add_to_stack_pointer(16)}}addManyModalFilters(e,t){try{const u=ut.__wbindgen_add_to_stack_pointer(-16),d=Go(t,ut.__wbindgen_malloc,ut.__wbindgen_realloc),a=Wi;ut.ltn_addManyModalFilters(u,this.__wbg_ptr,Ur(e),d,a);var n=Wt()[u/4+0],l=Wt()[u/4+1];if(l)throw Ai(n)}finally{ut.__wbindgen_add_to_stack_pointer(16)}}deleteModalFilter(e){ut.ltn_deleteModalFilter(this.__wbg_ptr,e)}toggleDirection(e){ut.ltn_toggleDirection(this.__wbg_ptr,e)}undo(){ut.ltn_undo(this.__wbg_ptr)}redo(){ut.ltn_redo(this.__wbg_ptr)}getShortcutsCrossingRoad(e){let t,n;try{const S=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_getShortcutsCrossingRoad(S,this.__wbg_ptr,e);var l=Wt()[S/4+0],u=Wt()[S/4+1],d=Wt()[S/4+2],a=Wt()[S/4+3],_=l,x=u;if(a)throw _=0,x=0,Ai(d);return t=_,n=x,Qi(_,x)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(t,n,1)}}getAllShortcuts(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_getAllShortcuts(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}toSavefile(){let e,t;try{const x=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_toSavefile(x,this.__wbg_ptr);var n=Wt()[x/4+0],l=Wt()[x/4+1],u=Wt()[x/4+2],d=Wt()[x/4+3],a=n,_=l;if(d)throw a=0,_=0,Ai(u);return e=a,t=_,Qi(a,_)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(e,t,1)}}loadSavefile(e){try{const l=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_loadSavefile(l,this.__wbg_ptr,Ur(e));var t=Wt()[l/4+0],n=Wt()[l/4+1];if(n)throw Ai(t)}finally{ut.__wbindgen_add_to_stack_pointer(16)}}compareRoute(e,t,n,l,u){let d,a;try{const D=ut.__wbindgen_add_to_stack_pointer(-16);ut.ltn_compareRoute(D,this.__wbg_ptr,e,t,n,l,u);var _=Wt()[D/4+0],x=Wt()[D/4+1],S=Wt()[D/4+2],k=Wt()[D/4+3],C=_,P=x;if(k)throw C=0,P=0,Ai(S);return d=C,a=P,Qi(C,P)}finally{ut.__wbindgen_add_to_stack_pointer(16),ut.__wbindgen_free(d,a,1)}}}async function o4(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const t=await r.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}}function s4(){const r={};return r.wbg={},r.wbg.__wbindgen_error_new=function(e,t){const n=new Error(Qi(e,t));return Ur(n)},r.wbg.__wbindgen_object_drop_ref=function(e){Ai(e)},r.wbg.__wbindgen_string_get=function(e,t){const n=hr(t),l=typeof n=="string"?n:void 0;var u=fc(l)?0:Go(l,ut.__wbindgen_malloc,ut.__wbindgen_realloc),d=Wi;Wt()[e/4+1]=d,Wt()[e/4+0]=u},r.wbg.__wbindgen_boolean_get=function(e){const t=hr(e);return typeof t=="boolean"?t?1:0:2},r.wbg.__wbindgen_is_bigint=function(e){return typeof hr(e)=="bigint"},r.wbg.__wbindgen_number_get=function(e,t){const n=hr(t),l=typeof n=="number"?n:void 0;Rb()[e/8+1]=fc(l)?0:l,Wt()[e/4+0]=!fc(l)},r.wbg.__wbindgen_is_object=function(e){const t=hr(e);return typeof t=="object"&&t!==null},r.wbg.__wbindgen_in=function(e,t){return hr(e)in hr(t)},r.wbg.__wbindgen_bigint_from_i64=function(e){return Ur(e)},r.wbg.__wbindgen_jsval_eq=function(e,t){return hr(e)===hr(t)},r.wbg.__wbindgen_bigint_from_u64=function(e){const t=BigInt.asUintN(64,e);return Ur(t)},r.wbg.__wbindgen_is_undefined=function(e){return hr(e)===void 0},r.wbg.__wbindgen_string_new=function(e,t){const n=Qi(e,t);return Ur(n)},r.wbg.__wbindgen_jsval_loose_eq=function(e,t){return hr(e)==hr(t)},r.wbg.__wbindgen_object_clone_ref=function(e){const t=hr(e);return Ur(t)},r.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(e,t){const n=hr(e)[hr(t)];return Ur(n)},r.wbg.__wbg_debug_34c9290896ec9856=function(e){console.debug(hr(e))},r.wbg.__wbg_error_e60eff06f24ab7a4=function(e){console.error(hr(e))},r.wbg.__wbg_info_d7d58472d0bab115=function(e){console.info(hr(e))},r.wbg.__wbg_log_a4530b4fe289336f=function(e){console.log(hr(e))},r.wbg.__wbg_warn_f260f49434e45e62=function(e){console.warn(hr(e))},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Ur(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const n=hr(t).stack,l=Go(n,ut.__wbindgen_malloc,ut.__wbindgen_realloc),u=Wi;Wt()[e/4+1]=u,Wt()[e/4+0]=l},r.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let n,l;try{n=e,l=t,console.error(Qi(e,t))}finally{ut.__wbindgen_free(n,l,1)}},r.wbg.__wbg_performance_3f3012faa4463882=function(e){const t=hr(e).performance;return Ur(t)},r.wbg.__wbg_now_2fd65358804c9485=function(e){return hr(e).now()},r.wbg.__wbg_get_f01601b5a68d10e3=function(e,t){const n=hr(e)[t>>>0];return Ur(n)},r.wbg.__wbg_length_1009b1af0c481d7b=function(e){return hr(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof hr(e)=="function"},r.wbg.__wbg_newnoargs_c62ea9419c21fbac=function(e,t){const n=new Function(Qi(e,t));return Ur(n)},r.wbg.__wbg_next_9b877f231f476d01=function(e){const t=hr(e).next;return Ur(t)},r.wbg.__wbg_next_6529ee0cca8d57ed=function(){return Ka(function(e){const t=hr(e).next();return Ur(t)},arguments)},r.wbg.__wbg_done_5fe336b092d60cf2=function(e){return hr(e).done},r.wbg.__wbg_value_0c248a78fdc8e19f=function(e){const t=hr(e).value;return Ur(t)},r.wbg.__wbg_iterator_db7ca081358d4fb2=function(){return Ur(Symbol.iterator)},r.wbg.__wbg_get_7b48513de5dc5ea4=function(){return Ka(function(e,t){const n=Reflect.get(hr(e),hr(t));return Ur(n)},arguments)},r.wbg.__wbg_call_90c26b09837aba1c=function(){return Ka(function(e,t){const n=hr(e).call(hr(t));return Ur(n)},arguments)},r.wbg.__wbg_self_f0e34d89f33b99fd=function(){return Ka(function(){const e=self.self;return Ur(e)},arguments)},r.wbg.__wbg_window_d3b084224f4774d7=function(){return Ka(function(){const e=window.window;return Ur(e)},arguments)},r.wbg.__wbg_globalThis_9caa27ff917c6860=function(){return Ka(function(){const e=globalThis.globalThis;return Ur(e)},arguments)},r.wbg.__wbg_global_35dfdd59a4da3e74=function(){return Ka(function(){const e=global.global;return Ur(e)},arguments)},r.wbg.__wbg_isArray_74fb723e24f76012=function(e){return Array.isArray(hr(e))},r.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(e){let t;try{t=hr(e)instanceof ArrayBuffer}catch{t=!1}return t},r.wbg.__wbg_isSafeInteger_f93fde0dca9820f8=function(e){return Number.isSafeInteger(hr(e))},r.wbg.__wbg_entries_9e2e2aa45aa5094a=function(e){const t=Object.entries(hr(e));return Ur(t)},r.wbg.__wbg_buffer_a448f833075b71ba=function(e){const t=hr(e).buffer;return Ur(t)},r.wbg.__wbg_new_8f67e318f15d7254=function(e){const t=new Uint8Array(hr(e));return Ur(t)},r.wbg.__wbg_set_2357bf09366ee480=function(e,t,n){hr(e).set(hr(t),n>>>0)},r.wbg.__wbg_length_1d25fa9e4ac21ce7=function(e){return hr(e).length},r.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(e){let t;try{t=hr(e)instanceof Uint8Array}catch{t=!1}return t},r.wbg.__wbindgen_bigint_get_as_i64=function(e,t){const n=hr(t),l=typeof n=="bigint"?n:void 0;t4()[e/8+1]=fc(l)?BigInt(0):l,Wt()[e/4+0]=!fc(l)},r.wbg.__wbindgen_debug_string=function(e,t){const n=Lm(hr(t)),l=Go(n,ut.__wbindgen_malloc,ut.__wbindgen_realloc),u=Wi;Wt()[e/4+1]=u,Wt()[e/4+0]=l},r.wbg.__wbindgen_throw=function(e,t){throw new Error(Qi(e,t))},r.wbg.__wbindgen_memory=function(){const e=ut.memory;return Ur(e)},r}function a4(r,e){return ut=r.exports,Fb.__wbindgen_wasm_module=e,Ku=null,Xu=null,$u=null,Hu=null,ut}async function Fb(r){if(ut!==void 0)return ut;typeof r>"u"&&(r="/ltn/assets/backend_bg.wasm");const e=s4();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:t,module:n}=await o4(await r,e);return a4(t,n)}var xh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xg(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Dd(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var l=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return r[n]}})}),t}var Ob={exports:{}};/** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.1.3/LICENSE.txt + */(function(r,e){(function(t,n){r.exports=n()})(xh,function(){var t={},n={};function l(d,a,_){if(n[d]=_,d==="index"){var x="var sharedModule = {}; ("+n.shared+")(sharedModule); ("+n.worker+")(sharedModule);",S={};return n.shared(S),n.index(t,S),typeof window<"u"&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([x],{type:"text/javascript"}))),t}}l("shared",["exports"],function(d){function a(s,i,c,f){return new(c||(c=Promise))(function(g,b){function w(L){try{I(f.next(L))}catch(F){b(F)}}function T(L){try{I(f.throw(L))}catch(F){b(F)}}function I(L){var F;L.done?g(L.value):(F=L.value,F instanceof c?F:new c(function(j){j(F)})).then(w,T)}I((f=f.apply(s,i||[])).next())})}function _(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}typeof SuppressedError=="function"&&SuppressedError;var x=S;function S(s,i){this.x=s,this.y=i}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,i){return this.clone()._rotateAround(s,i)},matMult:function(s){return this.clone()._matMult(s)},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(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var i=s.x-this.x,c=s.y-this.y;return i*i+c*c},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,i){return Math.atan2(this.x*i-this.y*s,this.x*s+this.y*i)},_matMult:function(s){var i=s[2]*this.x+s[3]*this.y;return this.x=s[0]*this.x+s[1]*this.y,this.y=i,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var i=Math.cos(s),c=Math.sin(s),f=c*this.x+i*this.y;return this.x=i*this.x-c*this.y,this.y=f,this},_rotateAround:function(s,i){var c=Math.cos(s),f=Math.sin(s),g=i.y+f*(this.x-i.x)+c*(this.y-i.y);return this.x=i.x+c*(this.x-i.x)-f*(this.y-i.y),this.y=g,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},S.convert=function(s){return s instanceof S?s:Array.isArray(s)?new S(s[0],s[1]):s};var k=_(x),C=P;function P(s,i,c,f){this.cx=3*s,this.bx=3*(c-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(f-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=i,this.p2x=c,this.p2y=f}P.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,i){if(i===void 0&&(i=1e-6),s<0)return 0;if(s>1)return 1;for(var c=s,f=0;f<8;f++){var g=this.sampleCurveX(c)-s;if(Math.abs(g)g?w=c:T=c,c=.5*(T-w)+w;return c},solve:function(s,i){return this.sampleCurveY(this.solveCurveX(s,i))}};var D=_(C);let N,z;function B(){return N==null&&(N=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),N}function O(){if(z==null&&(z=!1,B())){const i=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(i){for(let f=0;f<5*5;f++){const g=4*f;i.fillStyle=`rgb(${g},${g+1},${g+2})`,i.fillRect(f%5,Math.floor(f/5),1,1)}const c=i.getImageData(0,0,5,5).data;for(let f=0;f<5*5*4;f++)if(f%4!=3&&c[f]!==f){z=!0;break}}}return z||!1}function G(s,i,c,f){const g=new D(s,i,c,f);return function(b){return g.solve(b)}}const U=G(.25,.1,.25,1);function K(s,i,c){return Math.min(c,Math.max(i,s))}function me(s,i,c){const f=c-i,g=((s-i)%f+f)%f+i;return g===i?c:g}function X(s,...i){for(const c of i)for(const f in c)s[f]=c[f];return s}let Y=1;function _e(s,i,c){const f={};for(const g in s)f[g]=i.call(c||this,s[g],g,s);return f}function ze(s,i,c){const f={};for(const g in s)i.call(c||this,s[g],g,s)&&(f[g]=s[g]);return f}function re(s){return Array.isArray(s)?s.map(re):typeof s=="object"&&s?_e(s,re):s}const ce={};function Ze(s){ce[s]||(typeof console<"u"&&console.warn(s),ce[s]=!0)}function Me(s,i,c){return(c.y-s.y)*(i.x-s.x)>(i.y-s.y)*(c.x-s.x)}function ht(s){let i=0;for(let c,f,g=0,b=s.length,w=b-1;g"u")throw new Error("VideoFrame not supported");const b=new VideoFrame(s,{timestamp:0});try{const w=b==null?void 0:b.format;if(!w||!w.startsWith("BGR")&&!w.startsWith("RGB"))throw new Error(`Unrecognized format ${w}`);const T=w.startsWith("BGR"),I=new Uint8ClampedArray(f*g*4);if(yield b.copyTo(I,function(L,F,j,H,J){const ee=4*Math.max(-F,0),ae=(Math.max(0,j)-j)*H*4+ee,ge=4*H,xe=Math.max(0,F),De=Math.max(0,j);return{rect:{x:xe,y:De,width:Math.min(L.width,F+H)-xe,height:Math.min(L.height,j+J)-De},layout:[{offset:ae,stride:ge}]}}(s,i,c,f,g)),T)for(let L=0;LIt(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,pt=function(s,i){if(/:\/\//.test(s.url)&&!/^https?:|^file:/.test(s.url)){const f=Nt(s.url);if(f)return f(s,i);if(It(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,targetMapId:nr},i)}if(!(/^file:/.test(c=s.url)||/^file:/.test(Pr())&&!/^\w+:/.test(c))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(f,g){return a(this,void 0,void 0,function*(){const b=new Request(f.url,{method:f.method||"GET",body:f.body,credentials:f.credentials,headers:f.headers,cache:f.cache,referrer:Pr(),signal:g.signal});f.type==="json"&&b.headers.set("Accept","application/json");const w=yield fetch(b);if(!w.ok){const L=yield w.blob();throw new tr(w.status,w.statusText,f.url,L)}let T;T=f.type==="arrayBuffer"||f.type==="image"?w.arrayBuffer():f.type==="json"?w.json():w.text();const I=yield T;if(g.signal.aborted)throw fr();return{data:I,cacheControl:w.headers.get("Cache-Control"),expires:w.headers.get("Expires")}})}(s,i);if(It(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:s,mustQueue:!0,targetMapId:nr},i)}var c;return function(f,g){return new Promise((b,w)=>{const T=new XMLHttpRequest;T.open(f.method||"GET",f.url,!0),f.type!=="arrayBuffer"&&f.type!=="image"||(T.responseType="arraybuffer");for(const I in f.headers)T.setRequestHeader(I,f.headers[I]);f.type==="json"&&(T.responseType="text",T.setRequestHeader("Accept","application/json")),T.withCredentials=f.credentials==="include",T.onerror=()=>{w(new Error(T.statusText))},T.onload=()=>{if(!g.signal.aborted)if((T.status>=200&&T.status<300||T.status===0)&&T.response!==null){let I=T.response;if(f.type==="json")try{I=JSON.parse(T.response)}catch(L){return void w(L)}b({data:I,cacheControl:T.getResponseHeader("Cache-Control"),expires:T.getResponseHeader("Expires")})}else{const I=new Blob([T.response],{type:T.getResponseHeader("Content-Type")});w(new tr(T.status,T.statusText,f.url,I))}},g.signal.addEventListener("abort",()=>{T.abort(),w(fr())}),T.send(f.body)})}(s,i)};function Et(s){if(!s||s.indexOf("://")<=0||s.indexOf("data:image/")===0||s.indexOf("blob:")===0)return!0;const i=new URL(s),c=window.location;return i.protocol===c.protocol&&i.host===c.host}function gr(s,i,c){c[s]&&c[s].indexOf(i)!==-1||(c[s]=c[s]||[],c[s].push(i))}function Re(s,i,c){if(c&&c[s]){const f=c[s].indexOf(i);f!==-1&&c[s].splice(f,1)}}class st{constructor(i,c={}){X(this,c),this.type=i}}class tt extends st{constructor(i,c={}){super("error",X({error:i},c))}}class it{on(i,c){return this._listeners=this._listeners||{},gr(i,c,this._listeners),this}off(i,c){return Re(i,c,this._listeners),Re(i,c,this._oneTimeListeners),this}once(i,c){return c?(this._oneTimeListeners=this._oneTimeListeners||{},gr(i,c,this._oneTimeListeners),this):new Promise(f=>this.once(i,f))}fire(i,c){typeof i=="string"&&(i=new st(i,c||{}));const f=i.type;if(this.listens(f)){i.target=this;const g=this._listeners&&this._listeners[f]?this._listeners[f].slice():[];for(const T of g)T.call(this,i);const b=this._oneTimeListeners&&this._oneTimeListeners[f]?this._oneTimeListeners[f].slice():[];for(const T of b)Re(f,T,this._oneTimeListeners),T.call(this,i);const w=this._eventedParent;w&&(X(i,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),w.fire(i))}else i instanceof tt&&console.error(i.error);return this}listens(i){return this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i)}setEventedParent(i,c){return this._eventedParent=i,this._eventedParentData=c,this}}var ne={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 wr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function We(s,i){const c={};for(const f in s)f!=="ref"&&(c[f]=s[f]);return wr.forEach(f=>{f in i&&(c[f]=i[f])}),c}function Ye(s,i){if(Array.isArray(s)){if(!Array.isArray(i)||s.length!==i.length)return!1;for(let c=0;c`:s.itemType.kind==="value"?"array":`array<${i}>`}return s.kind}const Ce=[Or,mt,rr,Jt,Nr,an,vi,te(Qt),pe,Z,$];function Ie(s,i){if(i.kind==="error")return null;if(s.kind==="array"){if(i.kind==="array"&&(i.N===0&&i.itemType.kind==="value"||!Ie(s.itemType,i.itemType))&&(typeof s.N!="number"||s.N===i.N))return null}else{if(s.kind===i.kind)return null;if(s.kind==="value"){for(const c of Ce)if(!Ie(c,i))return null}}return`Expected ${le(s)} but found ${le(i)} instead.`}function Pe(s,i){return i.some(c=>c.kind===s.kind)}function Se(s,i){return i.some(c=>c==="null"?s===null:c==="array"?Array.isArray(s):c==="object"?s&&!Array.isArray(s)&&typeof s=="object":c===typeof s)}function W(s,i){return s.kind==="array"&&i.kind==="array"?s.itemType.kind===i.itemType.kind&&typeof s.N=="number":s.kind===i.kind}const Be=.96422,Fe=.82521,qe=4/29,Xe=6/29,ct=3*Xe*Xe,Pt=Xe*Xe*Xe,$t=Math.PI/180,ar=180/Math.PI;function _r(s){return(s%=360)<0&&(s+=360),s}function Yr([s,i,c,f]){let g,b;const w=lr((.2225045*(s=Cn(s))+.7168786*(i=Cn(i))+.0606169*(c=Cn(c)))/1);s===i&&i===c?g=b=w:(g=lr((.4360747*s+.3850649*i+.1430804*c)/Be),b=lr((.0139322*s+.0971045*i+.7141733*c)/Fe));const T=116*w-16;return[T<0?0:T,500*(g-w),200*(w-b),f]}function Cn(s){return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}function lr(s){return s>Pt?Math.pow(s,1/3):s/ct+qe}function ln([s,i,c,f]){let g=(s+16)/116,b=isNaN(i)?g:g+i/500,w=isNaN(c)?g:g-c/200;return g=1*fi(g),b=Be*fi(b),w=Fe*fi(w),[Bn(3.1338561*b-1.6168667*g-.4906146*w),Bn(-.9787684*b+1.9161415*g+.033454*w),Bn(.0719453*b-.2289914*g+1.4052427*w),f]}function Bn(s){return(s=s<=.00304?12.92*s:1.055*Math.pow(s,1/2.4)-.055)<0?0:s>1?1:s}function fi(s){return s>Xe?s*s*s:ct*(s-qe)}function bi(s){return parseInt(s.padEnd(2,s),16)/255}function Kn(s,i){return mo(i?s/100:s,0,1)}function mo(s,i,c){return Math.min(Math.max(i,s),c)}function Ch(s){return!s.some(Number.isNaN)}const Wd={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 zr{constructor(i,c,f,g=1,b=!0){this.r=i,this.g=c,this.b=f,this.a=g,b||(this.r*=g,this.g*=g,this.b*=g,g||this.overwriteGetter("rgb",[i,c,f,g]))}static parse(i){if(i instanceof zr)return i;if(typeof i!="string")return;const c=function(f){if((f=f.toLowerCase().trim())==="transparent")return[0,0,0,0];const g=Wd[f];if(g){const[w,T,I]=g;return[w/255,T/255,I/255,1]}if(f.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(f)){const w=f.length<6?1:2;let T=1;return[bi(f.slice(T,T+=w)),bi(f.slice(T,T+=w)),bi(f.slice(T,T+=w)),bi(f.slice(T,T+w)||"ff")]}if(f.startsWith("rgb")){const w=f.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(w){const[T,I,L,F,j,H,J,ee,ae,ge,xe,De]=w,ke=[F||" ",J||" ",ge].join("");if(ke===" "||ke===" /"||ke===",,"||ke===",,,"){const Ae=[L,H,ae].join(""),Je=Ae==="%%%"?100:Ae===""?255:0;if(Je){const Qe=[mo(+I/Je,0,1),mo(+j/Je,0,1),mo(+ee/Je,0,1),xe?Kn(+xe,De):1];if(Ch(Qe))return Qe}}return}}const b=f.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(b){const[w,T,I,L,F,j,H,J,ee]=b,ae=[I||" ",F||" ",H].join("");if(ae===" "||ae===" /"||ae===",,"||ae===",,,"){const ge=[+T,mo(+L,0,100),mo(+j,0,100),J?Kn(+J,ee):1];if(Ch(ge))return function([xe,De,ke,Ae]){function Je(Qe){const kt=(Qe+xe/30)%12,zt=De*Math.min(ke,1-ke);return ke-zt*Math.max(-1,Math.min(kt-3,9-kt,1))}return xe=_r(xe),De/=100,ke/=100,[Je(0),Je(8),Je(4),Ae]}(ge)}}}(i);return c?new zr(...c,!1):void 0}get rgb(){const{r:i,g:c,b:f,a:g}=this,b=g||1/0;return this.overwriteGetter("rgb",[i/b,c/b,f/b,g])}get hcl(){return this.overwriteGetter("hcl",function(i){const[c,f,g,b]=Yr(i),w=Math.sqrt(f*f+g*g);return[Math.round(1e4*w)?_r(Math.atan2(g,f)*ar):NaN,w,c,b]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Yr(this.rgb))}overwriteGetter(i,c){return Object.defineProperty(this,i,{value:c}),c}toString(){const[i,c,f,g]=this.rgb;return`rgba(${[i,c,f].map(b=>Math.round(255*b)).join(",")},${g})`}}zr.black=new zr(0,0,0,1),zr.white=new zr(1,1,1,1),zr.transparent=new zr(0,0,0,0),zr.red=new zr(1,0,0,1);class Fc{constructor(i,c,f){this.sensitivity=i?c?"variant":"case":c?"accent":"base",this.locale=f,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,c){return this.collator.compare(i,c)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Oc{constructor(i,c,f,g,b){this.text=i,this.image=c,this.scale=f,this.fontStack=g,this.textColor=b}}class Ri{constructor(i){this.sections=i}static fromString(i){return new Ri([new Oc(i,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(i=>i.text.length!==0||i.image&&i.image.name.length!==0)}static factory(i){return i instanceof Ri?i:Ri.fromString(i)}toString(){return this.sections.length===0?"":this.sections.map(i=>i.text).join("")}}class wi{constructor(i){this.values=i.slice()}static parse(i){if(i instanceof wi)return i;if(typeof i=="number")return new wi([i,i,i,i]);if(Array.isArray(i)&&!(i.length<1||i.length>4)){for(const c of i)if(typeof c!="number")return;switch(i.length){case 1:i=[i[0],i[0],i[0],i[0]];break;case 2:i=[i[0],i[1],i[0],i[1]];break;case 3:i=[i[0],i[1],i[2],i[1]]}return new wi(i)}}toString(){return JSON.stringify(this.values)}}const ka=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class $i{constructor(i){this.values=i.slice()}static parse(i){if(i instanceof $i)return i;if(Array.isArray(i)&&!(i.length<1)&&i.length%2==0){for(let c=0;c=0&&s<=255&&typeof i=="number"&&i>=0&&i<=255&&typeof c=="number"&&c>=0&&c<=255?f===void 0||typeof f=="number"&&f>=0&&f<=1?null:`Invalid rgba value [${[s,i,c,f].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof f=="number"?[s,i,c,f]:[s,i,c]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function sl(s){if(s===null||typeof s=="string"||typeof s=="boolean"||typeof s=="number"||s instanceof zr||s instanceof Fc||s instanceof Ri||s instanceof wi||s instanceof $i||s instanceof Xi)return!0;if(Array.isArray(s)){for(const i of s)if(!sl(i))return!1;return!0}if(typeof s=="object"){for(const i in s)if(!sl(s[i]))return!1;return!0}return!1}function In(s){if(s===null)return Or;if(typeof s=="string")return rr;if(typeof s=="boolean")return Jt;if(typeof s=="number")return mt;if(s instanceof zr)return Nr;if(s instanceof Fc)return ro;if(s instanceof Ri)return an;if(s instanceof wi)return pe;if(s instanceof $i)return $;if(s instanceof Xi)return Z;if(Array.isArray(s)){const i=s.length;let c;for(const f of s){const g=In(f);if(c){if(c===g)continue;c=Qt;break}c=g}return te(c||Qt,i)}return vi}function Ta(s){const i=typeof s;return s===null?"":i==="string"||i==="number"||i==="boolean"?String(s):s instanceof zr||s instanceof Ri||s instanceof wi||s instanceof $i||s instanceof Xi?s.toString():JSON.stringify(s)}class Xo{constructor(i,c){this.type=i,this.value=c}static parse(i,c){if(i.length!==2)return c.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!sl(i[1]))return c.error("invalid value");const f=i[1];let g=In(f);const b=c.expectedType;return g.kind!=="array"||g.N!==0||!b||b.kind!=="array"||typeof b.N=="number"&&b.N!==0||(g=b),new Xo(g,f)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class rn{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}const al={string:rr,number:mt,boolean:Jt,object:vi};class Bi{constructor(i,c){this.type=i,this.args=c}static parse(i,c){if(i.length<2)return c.error("Expected at least one argument.");let f,g=1;const b=i[0];if(b==="array"){let T,I;if(i.length>2){const L=i[1];if(typeof L!="string"||!(L in al)||L==="object")return c.error('The item type argument of "array" must be one of string, number, boolean',1);T=al[L],g++}else T=Qt;if(i.length>3){if(i[2]!==null&&(typeof i[2]!="number"||i[2]<0||i[2]!==Math.floor(i[2])))return c.error('The length argument to "array" must be a positive integer literal',2);I=i[2],g++}f=te(T,I)}else{if(!al[b])throw new Error(`Types doesn't contain name = ${b}`);f=al[b]}const w=[];for(;gi.outputDefined())}}const ll={"to-boolean":Jt,"to-color":Nr,"to-number":mt,"to-string":rr};class go{constructor(i,c){this.type=i,this.args=c}static parse(i,c){if(i.length<2)return c.error("Expected at least one argument.");const f=i[0];if(!ll[f])throw new Error(`Can't parse ${f} as it is not part of the known types`);if((f==="to-boolean"||f==="to-string")&&i.length!==2)return c.error("Expected one argument.");const g=ll[f],b=[];for(let w=1;w4?`Invalid rbga value ${JSON.stringify(c)}: expected an array containing either three or four numeric values.`:Ns(c[0],c[1],c[2],c[3]),!f))return new zr(c[0]/255,c[1]/255,c[2]/255,c[3])}throw new rn(f||`Could not parse color from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"padding":{let c;for(const f of this.args){c=f.evaluate(i);const g=wi.parse(c);if(g)return g}throw new rn(`Could not parse padding from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"variableAnchorOffsetCollection":{let c;for(const f of this.args){c=f.evaluate(i);const g=$i.parse(c);if(g)return g}throw new rn(`Could not parse variableAnchorOffsetCollection from value '${typeof c=="string"?c:JSON.stringify(c)}'`)}case"number":{let c=null;for(const f of this.args){if(c=f.evaluate(i),c===null)return 0;const g=Number(c);if(!isNaN(g))return g}throw new rn(`Could not convert ${JSON.stringify(c)} to number.`)}case"formatted":return Ri.fromString(Ta(this.args[0].evaluate(i)));case"resolvedImage":return Xi.fromString(Ta(this.args[0].evaluate(i)));default:return Ta(this.args[0].evaluate(i))}}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}}const Ea=["Unknown","Point","LineString","Polygon"];class Dr{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"?Ea[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(i){let c=this._parseColorCache[i];return c||(c=this._parseColorCache[i]=zr.parse(i)),c}}class cl{constructor(i,c,f=[],g,b=new Bo,w=[]){this.registry=i,this.path=f,this.key=f.map(T=>`[${T}]`).join(""),this.scope=b,this.errors=w,this.expectedType=g,this._isConstant=c}parse(i,c,f,g,b={}){return c?this.concat(c,f,g)._parse(i,b):this._parse(i,b)}_parse(i,c){function f(g,b,w){return w==="assert"?new Bi(b,[g]):w==="coerce"?new go(b,[g]):g}if(i!==null&&typeof i!="string"&&typeof i!="boolean"&&typeof i!="number"||(i=["literal",i]),Array.isArray(i)){if(i.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const g=i[0];if(typeof g!="string")return this.error(`Expression name must be a string, but found ${typeof g} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const b=this.registry[g];if(b){let w=b.parse(i,this);if(!w)return null;if(this.expectedType){const T=this.expectedType,I=w.type;if(T.kind!=="string"&&T.kind!=="number"&&T.kind!=="boolean"&&T.kind!=="object"&&T.kind!=="array"||I.kind!=="value")if(T.kind!=="color"&&T.kind!=="formatted"&&T.kind!=="resolvedImage"||I.kind!=="value"&&I.kind!=="string")if(T.kind!=="padding"||I.kind!=="value"&&I.kind!=="number"&&I.kind!=="array")if(T.kind!=="variableAnchorOffsetCollection"||I.kind!=="value"&&I.kind!=="array"){if(this.checkSubtype(T,I))return null}else w=f(w,T,c.typeAnnotation||"coerce");else w=f(w,T,c.typeAnnotation||"coerce");else w=f(w,T,c.typeAnnotation||"coerce");else w=f(w,T,c.typeAnnotation||"assert")}if(!(w instanceof Xo)&&w.type.kind!=="resolvedImage"&&this._isConstant(w)){const T=new Dr;try{w=new Xo(w.type,w.evaluate(T))}catch(I){return this.error(I.message),null}}return w}return this.error(`Unknown expression "${g}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(i===void 0?"'undefined' value invalid. Use null instead.":typeof i=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,c,f){const g=typeof i=="number"?this.path.concat(i):this.path,b=f?this.scope.concat(f):this.scope;return new cl(this.registry,this._isConstant,g,c||null,b,this.errors)}error(i,...c){const f=`${this.key}${c.map(g=>`[${g}]`).join("")}`;this.errors.push(new xn(f,i))}checkSubtype(i,c){const f=Ie(i,c);return f&&this.error(f),f}}class js{constructor(i,c,f){this.type=ro,this.locale=f,this.caseSensitive=i,this.diacriticSensitive=c}static parse(i,c){if(i.length!==2)return c.error("Expected one argument.");const f=i[1];if(typeof f!="object"||Array.isArray(f))return c.error("Collator options argument must be an object.");const g=c.parse(f["case-sensitive"]!==void 0&&f["case-sensitive"],1,Jt);if(!g)return null;const b=c.parse(f["diacritic-sensitive"]!==void 0&&f["diacritic-sensitive"],1,Jt);if(!b)return null;let w=null;return f.locale&&(w=c.parse(f.locale,1,rr),!w)?null:new js(g,b,w)}evaluate(i){return new Fc(this.caseSensitive.evaluate(i),this.diacriticSensitive.evaluate(i),this.locale?this.locale.evaluate(i):null)}eachChild(i){i(this.caseSensitive),i(this.diacriticSensitive),this.locale&&i(this.locale)}outputDefined(){return!1}}const Ko=8192;function ul(s,i){s[0]=Math.min(s[0],i[0]),s[1]=Math.min(s[1],i[1]),s[2]=Math.max(s[2],i[0]),s[3]=Math.max(s[3],i[1])}function Ma(s,i){return!(s[0]<=i[0]||s[2]>=i[2]||s[1]<=i[1]||s[3]>=i[3])}function Zd(s,i){const c=(180+s[0])/360,f=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s[1]*Math.PI/360)))/360,g=Math.pow(2,i.z);return[Math.round(c*g*Ko),Math.round(f*g*Ko)]}function Ih(s,i,c){const f=s[0]-i[0],g=s[1]-i[1],b=s[0]-c[0],w=s[1]-c[1];return f*w-b*g==0&&f*b<=0&&g*w<=0}function hl(s,i){let c=!1;for(let w=0,T=i.length;w(f=s)[1]!=(b=I[L+1])[1]>f[1]&&f[0]<(b[0]-g[0])*(f[1]-g[1])/(b[1]-g[1])+g[0]&&(c=!c)}}var f,g,b;return c}function Hd(s,i){for(let c=0;c0&&T<0||w<0&&T>0}function $d(s,i,c){for(const L of c)for(let F=0;Fc[2]){const g=.5*f;let b=s[0]-c[0]>g?-f:c[0]-s[0]>g?f:0;b===0&&(b=s[0]-c[2]>g?-f:c[2]-s[0]>g?f:0),s[0]+=b}ul(i,s)}function dl(s,i,c,f){const g=Math.pow(2,f.z)*Ko,b=[f.x*Ko,f.y*Ko],w=[];for(const T of s)for(const I of T){const L=[I.x+b[0],I.y+b[1]];Dh(L,i,c,g),w.push(L)}return w}function Rh(s,i,c,f){const g=Math.pow(2,f.z)*Ko,b=[f.x*Ko,f.y*Ko],w=[];for(const I of s){const L=[];for(const F of I){const j=[F.x+b[0],F.y+b[1]];ul(i,j),L.push(j)}w.push(L)}if(i[2]-i[0]<=g/2){(T=i)[0]=T[1]=1/0,T[2]=T[3]=-1/0;for(const I of w)for(const L of I)Dh(L,i,c,g)}var T;return w}class ds{constructor(i,c){this.type=Jt,this.geojson=i,this.geometries=c}static parse(i,c){if(i.length!==2)return c.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(sl(i[1])){const f=i[1];if(f.type==="FeatureCollection"){const g=[];for(const b of f.features){const{type:w,coordinates:T}=b.geometry;w==="Polygon"&&g.push(T),w==="MultiPolygon"&&g.push(...T)}if(g.length)return new ds(f,{type:"MultiPolygon",coordinates:g})}else if(f.type==="Feature"){const g=f.geometry.type;if(g==="Polygon"||g==="MultiPolygon")return new ds(f,f.geometry)}else if(f.type==="Polygon"||f.type==="MultiPolygon")return new ds(f,f)}return c.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(i){if(i.geometry()!=null&&i.canonicalID()!=null){if(i.geometryType()==="Point")return function(c,f){const g=[1/0,1/0,-1/0,-1/0],b=[1/0,1/0,-1/0,-1/0],w=c.canonicalID();if(f.type==="Polygon"){const T=fl(f.coordinates,b,w),I=dl(c.geometry(),g,b,w);if(!Ma(g,b))return!1;for(const L of I)if(!hl(L,T))return!1}if(f.type==="MultiPolygon"){const T=zh(f.coordinates,b,w),I=dl(c.geometry(),g,b,w);if(!Ma(g,b))return!1;for(const L of I)if(!Hd(L,T))return!1}return!0}(i,this.geometries);if(i.geometryType()==="LineString")return function(c,f){const g=[1/0,1/0,-1/0,-1/0],b=[1/0,1/0,-1/0,-1/0],w=c.canonicalID();if(f.type==="Polygon"){const T=fl(f.coordinates,b,w),I=Rh(c.geometry(),g,b,w);if(!Ma(g,b))return!1;for(const L of I)if(!Lh(L,T))return!1}if(f.type==="MultiPolygon"){const T=zh(f.coordinates,b,w),I=Rh(c.geometry(),g,b,w);if(!Ma(g,b))return!1;for(const L of I)if(!Ph(L,T))return!1}return!0}(i,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class pl{constructor(i,c){this.type=c.type,this.name=i,this.boundExpression=c}static parse(i,c){if(i.length!==2||typeof i[1]!="string")return c.error("'var' expression requires exactly one string literal argument.");const f=i[1];return c.scope.has(f)?new pl(f,c.scope.get(f)):c.error(`Unknown variable "${f}". Make sure "${f}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}}class Fi{constructor(i,c,f,g){this.name=i,this.type=c,this._evaluate=f,this.args=g}evaluate(i){return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}static parse(i,c){const f=i[0],g=Fi.definitions[f];if(!g)return c.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0);const b=Array.isArray(g)?g[0]:g.type,w=Array.isArray(g)?[[g[1],g[2]]]:g.overloads,T=w.filter(([L])=>!Array.isArray(L)||L.length===i.length-1);let I=null;for(const[L,F]of T){I=new cl(c.registry,Ca,c.path,null,c.scope);const j=[];let H=!1;for(let J=1;J{return H=j,Array.isArray(H)?`(${H.map(le).join(", ")})`:`(${le(H.type)}...)`;var H}).join(" | "),F=[];for(let j=1;j{c=i?c&&Ca(f):c&&f instanceof Xo}),!!c&&ml(s)&&Aa(s,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ml(s){if(s instanceof Fi&&(s.name==="get"&&s.args.length===1||s.name==="feature-state"||s.name==="has"&&s.args.length===1||s.name==="properties"||s.name==="geometry-type"||s.name==="id"||/^filter-/.test(s.name))||s instanceof ds)return!1;let i=!0;return s.eachChild(c=>{i&&!ml(c)&&(i=!1)}),i}function Ia(s){if(s instanceof Fi&&s.name==="feature-state")return!1;let i=!0;return s.eachChild(c=>{i&&!Ia(c)&&(i=!1)}),i}function Aa(s,i){if(s instanceof Fi&&i.indexOf(s.name)>=0)return!1;let c=!0;return s.eachChild(f=>{c&&!Aa(f,i)&&(c=!1)}),c}function La(s,i){const c=s.length-1;let f,g,b=0,w=c,T=0;for(;b<=w;)if(T=Math.floor((b+w)/2),f=s[T],g=s[T+1],f<=i){if(T===c||ii))throw new rn("Input is not a number.");w=T-1}return 0}class Pa{constructor(i,c,f){this.type=i,this.input=c,this.labels=[],this.outputs=[];for(const[g,b]of f)this.labels.push(g),this.outputs.push(b)}static parse(i,c){if(i.length-1<4)return c.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return c.error("Expected an even number of arguments.");const f=c.parse(i[1],1,mt);if(!f)return null;const g=[];let b=null;c.expectedType&&c.expectedType.kind!=="value"&&(b=c.expectedType);for(let w=1;w=T)return c.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',L);const j=c.parse(I,F,b);if(!j)return null;b=b||j.type,g.push([T,j])}return new Pa(b,f,g)}evaluate(i){const c=this.labels,f=this.outputs;if(c.length===1)return f[0].evaluate(i);const g=this.input.evaluate(i);if(g<=c[0])return f[0].evaluate(i);const b=c.length;return g>=c[b-1]?f[b-1].evaluate(i):f[La(c,g)].evaluate(i)}eachChild(i){i(this.input);for(const c of this.outputs)i(c)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}}function Xd(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Kd=Bh;function Bh(s,i,c,f){this.cx=3*s,this.bx=3*(c-s)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(f-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=s,this.p1y=i,this.p2x=c,this.p2y=f}Bh.prototype={sampleCurveX:function(s){return((this.ax*s+this.bx)*s+this.cx)*s},sampleCurveY:function(s){return((this.ay*s+this.by)*s+this.cy)*s},sampleCurveDerivativeX:function(s){return(3*this.ax*s+2*this.bx)*s+this.cx},solveCurveX:function(s,i){if(i===void 0&&(i=1e-6),s<0)return 0;if(s>1)return 1;for(var c=s,f=0;f<8;f++){var g=this.sampleCurveX(c)-s;if(Math.abs(g)g?w=c:T=c,c=.5*(T-w)+w;return c},solve:function(s,i){return this.sampleCurveY(this.solveCurveX(s,i))}};var Jd=Xd(Kd);function ps(s,i,c){return s+c*(i-s)}function gl(s,i,c){return s.map((f,g)=>ps(f,i[g],c))}const di={number:ps,color:function(s,i,c,f="rgb"){switch(f){case"rgb":{const[g,b,w,T]=gl(s.rgb,i.rgb,c);return new zr(g,b,w,T,!1)}case"hcl":{const[g,b,w,T]=s.hcl,[I,L,F,j]=i.hcl;let H,J;if(isNaN(g)||isNaN(I))isNaN(g)?isNaN(I)?H=NaN:(H=I,w!==1&&w!==0||(J=L)):(H=g,F!==1&&F!==0||(J=b));else{let De=I-g;I>g&&De>180?De-=360:I180&&(De+=360),H=g+c*De}const[ee,ae,ge,xe]=function([De,ke,Ae,Je]){return De=isNaN(De)?0:De*$t,ln([Ae,Math.cos(De)*ke,Math.sin(De)*ke,Je])}([H,J??ps(b,L,c),ps(w,F,c),ps(T,j,c)]);return new zr(ee,ae,ge,xe,!1)}case"lab":{const[g,b,w,T]=ln(gl(s.lab,i.lab,c));return new zr(g,b,w,T,!1)}}},array:gl,padding:function(s,i,c){return new wi(gl(s.values,i.values,c))},variableAnchorOffsetCollection:function(s,i,c){const f=s.values,g=i.values;if(f.length!==g.length)throw new rn(`Cannot interpolate values of different length. from: ${s.toString()}, to: ${i.toString()}`);const b=[];for(let w=0;wtypeof F!="number"||F<0||F>1))return c.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);g={name:"cubic-bezier",controlPoints:L}}}if(i.length-1<4)return c.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return c.error("Expected an even number of arguments.");if(b=c.parse(b,2,mt),!b)return null;const T=[];let I=null;f==="interpolate-hcl"||f==="interpolate-lab"?I=Nr:c.expectedType&&c.expectedType.kind!=="value"&&(I=c.expectedType);for(let L=0;L=F)return c.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const ee=c.parse(j,J,I);if(!ee)return null;I=I||ee.type,T.push([F,ee])}return W(I,mt)||W(I,Nr)||W(I,pe)||W(I,$)||W(I,te(mt))?new oi(I,f,g,b,T):c.error(`Type ${le(I)} is not interpolatable.`)}evaluate(i){const c=this.labels,f=this.outputs;if(c.length===1)return f[0].evaluate(i);const g=this.input.evaluate(i);if(g<=c[0])return f[0].evaluate(i);const b=c.length;if(g>=c[b-1])return f[b-1].evaluate(i);const w=La(c,g),T=oi.interpolationFactor(this.interpolation,g,c[w],c[w+1]),I=f[w].evaluate(i),L=f[w+1].evaluate(i);switch(this.operator){case"interpolate":return di[this.type.kind](I,L,T);case"interpolate-hcl":return di.color(I,L,T,"hcl");case"interpolate-lab":return di.color(I,L,T,"lab")}}eachChild(i){i(this.input);for(const c of this.outputs)i(c)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}}function Mr(s,i,c,f){const g=f-c,b=s-c;return g===0?0:i===1?b/g:(Math.pow(i,b)-1)/(Math.pow(i,g)-1)}class _l{constructor(i,c){this.type=i,this.args=c}static parse(i,c){if(i.length<2)return c.error("Expectected at least one argument.");let f=null;const g=c.expectedType;g&&g.kind!=="value"&&(f=g);const b=[];for(const T of i.slice(1)){const I=c.parse(T,1+b.length,f,void 0,{typeAnnotation:"omit"});if(!I)return null;f=f||I.type,b.push(I)}if(!f)throw new Error("No output type");const w=g&&b.some(T=>Ie(g,T.type));return new _l(w?Qt:f,b)}evaluate(i){let c,f=null,g=0;for(const b of this.args)if(g++,f=b.evaluate(i),f&&f instanceof Xi&&!f.available&&(c||(c=f.name),f=null,g===this.args.length&&(f=c)),f!==null)break;return f}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}}class yl{constructor(i,c){this.type=c.type,this.bindings=[].concat(i),this.result=c}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(const c of this.bindings)i(c[1]);i(this.result)}static parse(i,c){if(i.length<4)return c.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);const f=[];for(let b=1;b=f.length)throw new rn(`Array index out of bounds: ${c} > ${f.length-1}.`);if(c!==Math.floor(c))throw new rn(`Array index must be an integer, but found ${c} instead.`);return f[c]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}}class jc{constructor(i,c){this.type=Jt,this.needle=i,this.haystack=c}static parse(i,c){if(i.length!==3)return c.error(`Expected 2 arguments, but found ${i.length-1} instead.`);const f=c.parse(i[1],1,Qt),g=c.parse(i[2],2,Qt);return f&&g?Pe(f.type,[Jt,rr,mt,Or,Qt])?new jc(f,g):c.error(`Expected first argument to be of type boolean, string, number or null, but found ${le(f.type)} instead`):null}evaluate(i){const c=this.needle.evaluate(i),f=this.haystack.evaluate(i);if(!f)return!1;if(!Se(c,["boolean","string","number","null"]))throw new rn(`Expected first argument to be of type boolean, string, number or null, but found ${le(In(c))} instead.`);if(!Se(f,["string","array"]))throw new rn(`Expected second argument to be of type array or string, but found ${le(In(f))} instead.`);return f.indexOf(c)>=0}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}}class vl{constructor(i,c,f){this.type=mt,this.needle=i,this.haystack=c,this.fromIndex=f}static parse(i,c){if(i.length<=2||i.length>=5)return c.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const f=c.parse(i[1],1,Qt),g=c.parse(i[2],2,Qt);if(!f||!g)return null;if(!Pe(f.type,[Jt,rr,mt,Or,Qt]))return c.error(`Expected first argument to be of type boolean, string, number or null, but found ${le(f.type)} instead`);if(i.length===4){const b=c.parse(i[3],3,mt);return b?new vl(f,g,b):null}return new vl(f,g)}evaluate(i){const c=this.needle.evaluate(i),f=this.haystack.evaluate(i);if(!Se(c,["boolean","string","number","null"]))throw new rn(`Expected first argument to be of type boolean, string, number or null, but found ${le(In(c))} instead.`);if(!Se(f,["string","array"]))throw new rn(`Expected second argument to be of type array or string, but found ${le(In(f))} instead.`);if(this.fromIndex){const g=this.fromIndex.evaluate(i);return f.indexOf(c,g)}return f.indexOf(c)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}}class Uc{constructor(i,c,f,g,b,w){this.inputType=i,this.type=c,this.input=f,this.cases=g,this.outputs=b,this.otherwise=w}static parse(i,c){if(i.length<5)return c.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return c.error("Expected an even number of arguments.");let f,g;c.expectedType&&c.expectedType.kind!=="value"&&(g=c.expectedType);const b={},w=[];for(let L=2;LNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ee=="number"&&Math.floor(ee)!==ee)return H.error("Numeric branch labels must be integer values.");if(f){if(H.checkSubtype(f,In(ee)))return null}else f=In(ee);if(b[String(ee)]!==void 0)return H.error("Branch labels must be unique.");b[String(ee)]=w.length}const J=c.parse(j,L,g);if(!J)return null;g=g||J.type,w.push(J)}const T=c.parse(i[1],1,Qt);if(!T)return null;const I=c.parse(i[i.length-1],i.length-1,g);return I?T.type.kind!=="value"&&c.concat(1).checkSubtype(f,T.type)?null:new Uc(f,g,T,b,w,I):null}evaluate(i){const c=this.input.evaluate(i);return(In(c)===this.inputType&&this.outputs[this.cases[c]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}}class Vc{constructor(i,c,f){this.type=i,this.branches=c,this.otherwise=f}static parse(i,c){if(i.length<4)return c.error(`Expected at least 3 arguments, but found only ${i.length-1}.`);if(i.length%2!=0)return c.error("Expected an odd number of arguments.");let f;c.expectedType&&c.expectedType.kind!=="value"&&(f=c.expectedType);const g=[];for(let w=1;wc.outputDefined())&&this.otherwise.outputDefined()}}class bl{constructor(i,c,f,g){this.type=i,this.input=c,this.beginIndex=f,this.endIndex=g}static parse(i,c){if(i.length<=2||i.length>=5)return c.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const f=c.parse(i[1],1,Qt),g=c.parse(i[2],2,mt);if(!f||!g)return null;if(!Pe(f.type,[te(Qt),rr,Qt]))return c.error(`Expected first argument to be of type array or string, but found ${le(f.type)} instead`);if(i.length===4){const b=c.parse(i[3],3,mt);return b?new bl(f.type,f,g,b):null}return new bl(f.type,f,g)}evaluate(i){const c=this.input.evaluate(i),f=this.beginIndex.evaluate(i);if(!Se(c,["string","array"]))throw new rn(`Expected first argument to be of type array or string, but found ${le(In(c))} instead.`);if(this.endIndex){const g=this.endIndex.evaluate(i);return c.slice(f,g)}return c.slice(f)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}}function Fh(s,i){return s==="=="||s==="!="?i.kind==="boolean"||i.kind==="string"||i.kind==="number"||i.kind==="null"||i.kind==="value":i.kind==="string"||i.kind==="number"||i.kind==="value"}function Oh(s,i,c,f){return f.compare(i,c)===0}function Us(s,i,c){const f=s!=="=="&&s!=="!=";return class Nb{constructor(b,w,T){this.type=Jt,this.lhs=b,this.rhs=w,this.collator=T,this.hasUntypedArgument=b.type.kind==="value"||w.type.kind==="value"}static parse(b,w){if(b.length!==3&&b.length!==4)return w.error("Expected two or three arguments.");const T=b[0];let I=w.parse(b[1],1,Qt);if(!I)return null;if(!Fh(T,I.type))return w.concat(1).error(`"${T}" comparisons are not supported for type '${le(I.type)}'.`);let L=w.parse(b[2],2,Qt);if(!L)return null;if(!Fh(T,L.type))return w.concat(2).error(`"${T}" comparisons are not supported for type '${le(L.type)}'.`);if(I.type.kind!==L.type.kind&&I.type.kind!=="value"&&L.type.kind!=="value")return w.error(`Cannot compare types '${le(I.type)}' and '${le(L.type)}'.`);f&&(I.type.kind==="value"&&L.type.kind!=="value"?I=new Bi(L.type,[I]):I.type.kind!=="value"&&L.type.kind==="value"&&(L=new Bi(I.type,[L])));let F=null;if(b.length===4){if(I.type.kind!=="string"&&L.type.kind!=="string"&&I.type.kind!=="value"&&L.type.kind!=="value")return w.error("Cannot use collator to compare non-string types.");if(F=w.parse(b[3],3,ro),!F)return null}return new Nb(I,L,F)}evaluate(b){const w=this.lhs.evaluate(b),T=this.rhs.evaluate(b);if(f&&this.hasUntypedArgument){const I=In(w),L=In(T);if(I.kind!==L.kind||I.kind!=="string"&&I.kind!=="number")throw new rn(`Expected arguments for "${s}" to be (string, string) or (number, number), but found (${I.kind}, ${L.kind}) instead.`)}if(this.collator&&!f&&this.hasUntypedArgument){const I=In(w),L=In(T);if(I.kind!=="string"||L.kind!=="string")return i(b,w,T)}return this.collator?c(b,w,T,this.collator.evaluate(b)):i(b,w,T)}eachChild(b){b(this.lhs),b(this.rhs),this.collator&&b(this.collator)}outputDefined(){return!0}}}const Yd=Us("==",function(s,i,c){return i===c},Oh),Qd=Us("!=",function(s,i,c){return i!==c},function(s,i,c,f){return!Oh(0,i,c,f)}),ep=Us("<",function(s,i,c){return i",function(s,i,c){return i>c},function(s,i,c,f){return f.compare(i,c)>0}),rp=Us("<=",function(s,i,c){return i<=c},function(s,i,c,f){return f.compare(i,c)<=0}),np=Us(">=",function(s,i,c){return i>=c},function(s,i,c,f){return f.compare(i,c)>=0});class qc{constructor(i,c,f,g,b){this.type=rr,this.number=i,this.locale=c,this.currency=f,this.minFractionDigits=g,this.maxFractionDigits=b}static parse(i,c){if(i.length!==3)return c.error("Expected two arguments.");const f=c.parse(i[1],1,mt);if(!f)return null;const g=i[2];if(typeof g!="object"||Array.isArray(g))return c.error("NumberFormat options argument must be an object.");let b=null;if(g.locale&&(b=c.parse(g.locale,1,rr),!b))return null;let w=null;if(g.currency&&(w=c.parse(g.currency,1,rr),!w))return null;let T=null;if(g["min-fraction-digits"]&&(T=c.parse(g["min-fraction-digits"],1,mt),!T))return null;let I=null;return g["max-fraction-digits"]&&(I=c.parse(g["max-fraction-digits"],1,mt),!I)?null:new qc(f,b,w,T,I)}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}}class wl{constructor(i){this.type=an,this.sections=i}static parse(i,c){if(i.length<2)return c.error("Expected at least one argument.");const f=i[1];if(!Array.isArray(f)&&typeof f=="object")return c.error("First argument must be an image or text section.");const g=[];let b=!1;for(let w=1;w<=i.length-1;++w){const T=i[w];if(b&&typeof T=="object"&&!Array.isArray(T)){b=!1;let I=null;if(T["font-scale"]&&(I=c.parse(T["font-scale"],1,mt),!I))return null;let L=null;if(T["text-font"]&&(L=c.parse(T["text-font"],1,te(rr)),!L))return null;let F=null;if(T["text-color"]&&(F=c.parse(T["text-color"],1,Nr),!F))return null;const j=g[g.length-1];j.scale=I,j.font=L,j.textColor=F}else{const I=c.parse(i[w],1,Qt);if(!I)return null;const L=I.type.kind;if(L!=="string"&&L!=="value"&&L!=="null"&&L!=="resolvedImage")return c.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");b=!0,g.push({content:I,scale:null,font:null,textColor:null})}}return new wl(g)}evaluate(i){return new Ri(this.sections.map(c=>{const f=c.content.evaluate(i);return In(f)===Z?new Oc("",f,null,null,null):new Oc(Ta(f),null,c.scale?c.scale.evaluate(i):null,c.font?c.font.evaluate(i).join(","):null,c.textColor?c.textColor.evaluate(i):null)}))}eachChild(i){for(const c of this.sections)i(c.content),c.scale&&i(c.scale),c.font&&i(c.font),c.textColor&&i(c.textColor)}outputDefined(){return!1}}class Gc{constructor(i){this.type=Z,this.input=i}static parse(i,c){if(i.length!==2)return c.error("Expected two arguments.");const f=c.parse(i[1],1,rr);return f?new Gc(f):c.error("No image name provided.")}evaluate(i){const c=this.input.evaluate(i),f=Xi.fromString(c);return f&&i.availableImages&&(f.available=i.availableImages.indexOf(c)>-1),f}eachChild(i){i(this.input)}outputDefined(){return!1}}class Wc{constructor(i){this.type=mt,this.input=i}static parse(i,c){if(i.length!==2)return c.error(`Expected 1 argument, but found ${i.length-1} instead.`);const f=c.parse(i[1],1);return f?f.type.kind!=="array"&&f.type.kind!=="string"&&f.type.kind!=="value"?c.error(`Expected argument of type string or array, but found ${le(f.type)} instead.`):new Wc(f):null}evaluate(i){const c=this.input.evaluate(i);if(typeof c=="string"||Array.isArray(c))return c.length;throw new rn(`Expected value to be of type string or array, but found ${le(In(c))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}}const Vs={"==":Yd,"!=":Qd,">":tp,"<":ep,">=":np,"<=":rp,array:Bi,at:Nc,boolean:Bi,case:Vc,coalesce:_l,collator:js,format:wl,image:Gc,in:jc,"index-of":vl,interpolate:oi,"interpolate-hcl":oi,"interpolate-lab":oi,length:Wc,let:yl,literal:Xo,match:Uc,number:Bi,"number-format":qc,object:Bi,slice:bl,step:Pa,string:Bi,"to-boolean":go,"to-color":go,"to-number":go,"to-string":go,var:pl,within:ds};function Nh(s,[i,c,f,g]){i=i.evaluate(s),c=c.evaluate(s),f=f.evaluate(s);const b=g?g.evaluate(s):1,w=Ns(i,c,f,b);if(w)throw new rn(w);return new zr(i/255,c/255,f/255,b,!1)}function jh(s,i){return s in i}function Zc(s,i){const c=i[s];return c===void 0?null:c}function ms(s){return{type:s}}function Uh(s){return{result:"success",value:s}}function qs(s){return{result:"error",value:s}}function Gs(s){return s["property-type"]==="data-driven"||s["property-type"]==="cross-faded-data-driven"}function Vh(s){return!!s.expression&&s.expression.parameters.indexOf("zoom")>-1}function Hc(s){return!!s.expression&&s.expression.interpolated}function Tr(s){return s instanceof Number?"number":s instanceof String?"string":s instanceof Boolean?"boolean":Array.isArray(s)?"array":s===null?"null":typeof s}function xl(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function ip(s){return s}function qh(s,i){const c=i.type==="color",f=s.stops&&typeof s.stops[0][0]=="object",g=f||!(f||s.property!==void 0),b=s.type||(Hc(i)?"exponential":"interval");if(c||i.type==="padding"){const F=c?zr.parse:wi.parse;(s=Xn({},s)).stops&&(s.stops=s.stops.map(j=>[j[0],F(j[1])])),s.default=F(s.default?s.default:i.default)}if(s.colorSpace&&(w=s.colorSpace)!=="rgb"&&w!=="hcl"&&w!=="lab")throw new Error(`Unknown color space: "${s.colorSpace}"`);var w;let T,I,L;if(b==="exponential")T=xr;else if(b==="interval")T=op;else if(b==="categorical"){T=Sn,I=Object.create(null);for(const F of s.stops)I[F[0]]=F[1];L=typeof s.stops[0][0]}else{if(b!=="identity")throw new Error(`Unknown function type "${b}"`);T=$c}if(f){const F={},j=[];for(let ee=0;eeee[0]),evaluate:({zoom:ee},ae)=>xr({stops:H,base:s.base},i,ee).evaluate(ee,ae)}}if(g){const F=b==="exponential"?{name:"exponential",base:s.base!==void 0?s.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:oi.interpolationFactor.bind(void 0,F),zoomStops:s.stops.map(j=>j[0]),evaluate:({zoom:j})=>T(s,i,j,I,L)}}return{kind:"source",evaluate(F,j){const H=j&&j.properties?j.properties[s.property]:void 0;return H===void 0?za(s.default,i.default):T(s,i,H,I,L)}}}function za(s,i,c){return s!==void 0?s:i!==void 0?i:c!==void 0?c:void 0}function Sn(s,i,c,f,g){return za(typeof c===g?f[c]:void 0,s.default,i.default)}function op(s,i,c){if(Tr(c)!=="number")return za(s.default,i.default);const f=s.stops.length;if(f===1||c<=s.stops[0][0])return s.stops[0][1];if(c>=s.stops[f-1][0])return s.stops[f-1][1];const g=La(s.stops.map(b=>b[0]),c);return s.stops[g][1]}function xr(s,i,c){const f=s.base!==void 0?s.base:1;if(Tr(c)!=="number")return za(s.default,i.default);const g=s.stops.length;if(g===1||c<=s.stops[0][0])return s.stops[0][1];if(c>=s.stops[g-1][0])return s.stops[g-1][1];const b=La(s.stops.map(F=>F[0]),c),w=function(F,j,H,J){const ee=J-H,ae=F-H;return ee===0?0:j===1?ae/ee:(Math.pow(j,ae)-1)/(Math.pow(j,ee)-1)}(c,f,s.stops[b][0],s.stops[b+1][0]),T=s.stops[b][1],I=s.stops[b+1][1],L=di[i.type]||ip;return typeof T.evaluate=="function"?{evaluate(...F){const j=T.evaluate.apply(void 0,F),H=I.evaluate.apply(void 0,F);if(j!==void 0&&H!==void 0)return L(j,H,w,s.colorSpace)}}:L(T,I,w,s.colorSpace)}function $c(s,i,c){switch(i.type){case"color":c=zr.parse(c);break;case"formatted":c=Ri.fromString(c.toString());break;case"resolvedImage":c=Xi.fromString(c.toString());break;case"padding":c=wi.parse(c);break;default:Tr(c)===i.type||i.type==="enum"&&i.values[c]||(c=void 0)}return za(c,s.default,i.default)}Fi.register(Vs,{error:[{kind:"error"},[rr],(s,[i])=>{throw new rn(i.evaluate(s))}],typeof:[rr,[Qt],(s,[i])=>le(In(i.evaluate(s)))],"to-rgba":[te(mt,4),[Nr],(s,[i])=>{const[c,f,g,b]=i.evaluate(s).rgb;return[255*c,255*f,255*g,b]}],rgb:[Nr,[mt,mt,mt],Nh],rgba:[Nr,[mt,mt,mt,mt],Nh],has:{type:Jt,overloads:[[[rr],(s,[i])=>jh(i.evaluate(s),s.properties())],[[rr,vi],(s,[i,c])=>jh(i.evaluate(s),c.evaluate(s))]]},get:{type:Qt,overloads:[[[rr],(s,[i])=>Zc(i.evaluate(s),s.properties())],[[rr,vi],(s,[i,c])=>Zc(i.evaluate(s),c.evaluate(s))]]},"feature-state":[Qt,[rr],(s,[i])=>Zc(i.evaluate(s),s.featureState||{})],properties:[vi,[],s=>s.properties()],"geometry-type":[rr,[],s=>s.geometryType()],id:[Qt,[],s=>s.id()],zoom:[mt,[],s=>s.globals.zoom],"heatmap-density":[mt,[],s=>s.globals.heatmapDensity||0],"line-progress":[mt,[],s=>s.globals.lineProgress||0],accumulated:[Qt,[],s=>s.globals.accumulated===void 0?null:s.globals.accumulated],"+":[mt,ms(mt),(s,i)=>{let c=0;for(const f of i)c+=f.evaluate(s);return c}],"*":[mt,ms(mt),(s,i)=>{let c=1;for(const f of i)c*=f.evaluate(s);return c}],"-":{type:mt,overloads:[[[mt,mt],(s,[i,c])=>i.evaluate(s)-c.evaluate(s)],[[mt],(s,[i])=>-i.evaluate(s)]]},"/":[mt,[mt,mt],(s,[i,c])=>i.evaluate(s)/c.evaluate(s)],"%":[mt,[mt,mt],(s,[i,c])=>i.evaluate(s)%c.evaluate(s)],ln2:[mt,[],()=>Math.LN2],pi:[mt,[],()=>Math.PI],e:[mt,[],()=>Math.E],"^":[mt,[mt,mt],(s,[i,c])=>Math.pow(i.evaluate(s),c.evaluate(s))],sqrt:[mt,[mt],(s,[i])=>Math.sqrt(i.evaluate(s))],log10:[mt,[mt],(s,[i])=>Math.log(i.evaluate(s))/Math.LN10],ln:[mt,[mt],(s,[i])=>Math.log(i.evaluate(s))],log2:[mt,[mt],(s,[i])=>Math.log(i.evaluate(s))/Math.LN2],sin:[mt,[mt],(s,[i])=>Math.sin(i.evaluate(s))],cos:[mt,[mt],(s,[i])=>Math.cos(i.evaluate(s))],tan:[mt,[mt],(s,[i])=>Math.tan(i.evaluate(s))],asin:[mt,[mt],(s,[i])=>Math.asin(i.evaluate(s))],acos:[mt,[mt],(s,[i])=>Math.acos(i.evaluate(s))],atan:[mt,[mt],(s,[i])=>Math.atan(i.evaluate(s))],min:[mt,ms(mt),(s,i)=>Math.min(...i.map(c=>c.evaluate(s)))],max:[mt,ms(mt),(s,i)=>Math.max(...i.map(c=>c.evaluate(s)))],abs:[mt,[mt],(s,[i])=>Math.abs(i.evaluate(s))],round:[mt,[mt],(s,[i])=>{const c=i.evaluate(s);return c<0?-Math.round(-c):Math.round(c)}],floor:[mt,[mt],(s,[i])=>Math.floor(i.evaluate(s))],ceil:[mt,[mt],(s,[i])=>Math.ceil(i.evaluate(s))],"filter-==":[Jt,[rr,Qt],(s,[i,c])=>s.properties()[i.value]===c.value],"filter-id-==":[Jt,[Qt],(s,[i])=>s.id()===i.value],"filter-type-==":[Jt,[rr],(s,[i])=>s.geometryType()===i.value],"filter-<":[Jt,[rr,Qt],(s,[i,c])=>{const f=s.properties()[i.value],g=c.value;return typeof f==typeof g&&f{const c=s.id(),f=i.value;return typeof c==typeof f&&c":[Jt,[rr,Qt],(s,[i,c])=>{const f=s.properties()[i.value],g=c.value;return typeof f==typeof g&&f>g}],"filter-id->":[Jt,[Qt],(s,[i])=>{const c=s.id(),f=i.value;return typeof c==typeof f&&c>f}],"filter-<=":[Jt,[rr,Qt],(s,[i,c])=>{const f=s.properties()[i.value],g=c.value;return typeof f==typeof g&&f<=g}],"filter-id-<=":[Jt,[Qt],(s,[i])=>{const c=s.id(),f=i.value;return typeof c==typeof f&&c<=f}],"filter->=":[Jt,[rr,Qt],(s,[i,c])=>{const f=s.properties()[i.value],g=c.value;return typeof f==typeof g&&f>=g}],"filter-id->=":[Jt,[Qt],(s,[i])=>{const c=s.id(),f=i.value;return typeof c==typeof f&&c>=f}],"filter-has":[Jt,[Qt],(s,[i])=>i.value in s.properties()],"filter-has-id":[Jt,[],s=>s.id()!==null&&s.id()!==void 0],"filter-type-in":[Jt,[te(rr)],(s,[i])=>i.value.indexOf(s.geometryType())>=0],"filter-id-in":[Jt,[te(Qt)],(s,[i])=>i.value.indexOf(s.id())>=0],"filter-in-small":[Jt,[rr,te(Qt)],(s,[i,c])=>c.value.indexOf(s.properties()[i.value])>=0],"filter-in-large":[Jt,[rr,te(Qt)],(s,[i,c])=>function(f,g,b,w){for(;b<=w;){const T=b+w>>1;if(g[T]===f)return!0;g[T]>f?w=T-1:b=T+1}return!1}(s.properties()[i.value],c.value,0,c.value.length-1)],all:{type:Jt,overloads:[[[Jt,Jt],(s,[i,c])=>i.evaluate(s)&&c.evaluate(s)],[ms(Jt),(s,i)=>{for(const c of i)if(!c.evaluate(s))return!1;return!0}]]},any:{type:Jt,overloads:[[[Jt,Jt],(s,[i,c])=>i.evaluate(s)||c.evaluate(s)],[ms(Jt),(s,i)=>{for(const c of i)if(c.evaluate(s))return!0;return!1}]]},"!":[Jt,[Jt],(s,[i])=>!i.evaluate(s)],"is-supported-script":[Jt,[rr],(s,[i])=>{const c=s.globals&&s.globals.isSupportedScript;return!c||c(i.evaluate(s))}],upcase:[rr,[rr],(s,[i])=>i.evaluate(s).toUpperCase()],downcase:[rr,[rr],(s,[i])=>i.evaluate(s).toLowerCase()],concat:[rr,ms(Qt),(s,i)=>i.map(c=>Ta(c.evaluate(s))).join("")],"resolved-locale":[rr,[ro],(s,[i])=>i.evaluate(s).resolvedLocale()]});class $r{constructor(i,c){var f;this.expression=i,this._warningHistory={},this._evaluator=new Dr,this._defaultValue=c?(f=c).type==="color"&&xl(f.default)?new zr(0,0,0,0):f.type==="color"?zr.parse(f.default)||null:f.type==="padding"?wi.parse(f.default)||null:f.type==="variableAnchorOffsetCollection"?$i.parse(f.default)||null:f.default===void 0?null:f.default:null,this._enumValues=c&&c.type==="enum"?c.values:null}evaluateWithoutErrorHandling(i,c,f,g,b,w){return this._evaluator.globals=i,this._evaluator.feature=c,this._evaluator.featureState=f,this._evaluator.canonical=g,this._evaluator.availableImages=b||null,this._evaluator.formattedSection=w,this.expression.evaluate(this._evaluator)}evaluate(i,c,f,g,b,w){this._evaluator.globals=i,this._evaluator.feature=c||null,this._evaluator.featureState=f||null,this._evaluator.canonical=g,this._evaluator.availableImages=b||null,this._evaluator.formattedSection=w||null;try{const T=this.expression.evaluate(this._evaluator);if(T==null||typeof T=="number"&&T!=T)return this._defaultValue;if(this._enumValues&&!(T in this._enumValues))throw new rn(`Expected value to be one of ${Object.keys(this._enumValues).map(I=>JSON.stringify(I)).join(", ")}, but found ${JSON.stringify(T)} instead.`);return T}catch(T){return this._warningHistory[T.message]||(this._warningHistory[T.message]=!0,typeof console<"u"&&console.warn(T.message)),this._defaultValue}}}function jr(s){return Array.isArray(s)&&s.length>0&&typeof s[0]=="string"&&s[0]in Vs}function gs(s,i){const c=new cl(Vs,Ca,[],i?function(g){const b={color:Nr,string:rr,number:mt,enum:rr,boolean:Jt,formatted:an,padding:pe,resolvedImage:Z,variableAnchorOffsetCollection:$};return g.type==="array"?te(b[g.value]||Qt,g.length):b[g.type]}(i):void 0),f=c.parse(s,void 0,void 0,void 0,i&&i.type==="string"?{typeAnnotation:"coerce"}:void 0);return f?Uh(new $r(f,i)):qs(c.errors)}class Sl{constructor(i,c){this.kind=i,this._styleExpression=c,this.isStateDependent=i!=="constant"&&!Ia(c.expression)}evaluateWithoutErrorHandling(i,c,f,g,b,w){return this._styleExpression.evaluateWithoutErrorHandling(i,c,f,g,b,w)}evaluate(i,c,f,g,b,w){return this._styleExpression.evaluate(i,c,f,g,b,w)}}class Xc{constructor(i,c,f,g){this.kind=i,this.zoomStops=f,this._styleExpression=c,this.isStateDependent=i!=="camera"&&!Ia(c.expression),this.interpolationType=g}evaluateWithoutErrorHandling(i,c,f,g,b,w){return this._styleExpression.evaluateWithoutErrorHandling(i,c,f,g,b,w)}evaluate(i,c,f,g,b,w){return this._styleExpression.evaluate(i,c,f,g,b,w)}interpolationFactor(i,c,f){return this.interpolationType?oi.interpolationFactor(this.interpolationType,i,c,f):0}}function Gh(s,i){const c=gs(s,i);if(c.result==="error")return c;const f=c.value.expression,g=ml(f);if(!g&&!Gs(i))return qs([new xn("","data expressions not supported")]);const b=Aa(f,["zoom"]);if(!b&&!Vh(i))return qs([new xn("","zoom expressions not supported")]);const w=Tl(f);return w||b?w instanceof xn?qs([w]):w instanceof oi&&!Hc(i)?qs([new xn("",'"interpolate" expressions cannot be used with this property')]):Uh(w?new Xc(g?"camera":"composite",c.value,w.labels,w instanceof oi?w.interpolation:void 0):new Sl(g?"constant":"source",c.value)):qs([new xn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class kl{constructor(i,c){this._parameters=i,this._specification=c,Xn(this,qh(this._parameters,this._specification))}static deserialize(i){return new kl(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}function Tl(s){let i=null;if(s instanceof yl)i=Tl(s.result);else if(s instanceof _l){for(const c of s.args)if(i=Tl(c),i)break}else(s instanceof Pa||s instanceof oi)&&s.input instanceof Fi&&s.input.name==="zoom"&&(i=s);return i instanceof xn||s.eachChild(c=>{const f=Tl(c);f instanceof xn?i=f:!i&&f?i=new xn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&f&&i!==f&&(i=new xn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),i}function El(s){if(s===!0||s===!1)return!0;if(!Array.isArray(s)||s.length===0)return!1;switch(s[0]){case"has":return s.length>=2&&s[1]!=="$id"&&s[1]!=="$type";case"in":return s.length>=3&&(typeof s[1]!="string"||Array.isArray(s[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return s.length!==3||Array.isArray(s[1])||Array.isArray(s[2]);case"any":case"all":for(const i of s.slice(1))if(!El(i)&&typeof i!="boolean")return!1;return!0;default:return!0}}const Wh={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ml(s){if(s==null)return{filter:()=>!0,needGeometry:!1};El(s)||(s=Il(s));const i=gs(s,Wh);if(i.result==="error")throw new Error(i.value.map(c=>`${c.key}: ${c.message}`).join(", "));return{filter:(c,f,g)=>i.value.evaluate(c,f,{},g),needGeometry:Cl(s)}}function Zh(s,i){return si?1:0}function Cl(s){if(!Array.isArray(s))return!1;if(s[0]==="within")return!0;for(let i=1;i"||i==="<="||i===">="?Kc(s[1],s[2],i):i==="any"?(c=s.slice(1),["any"].concat(c.map(Il))):i==="all"?["all"].concat(s.slice(1).map(Il)):i==="none"?["all"].concat(s.slice(1).map(Il).map(Al)):i==="in"?Hh(s[1],s.slice(2)):i==="!in"?Al(Hh(s[1],s.slice(2))):i==="has"?$h(s[1]):i==="!has"?Al($h(s[1])):i!=="within"||s;var c}function Kc(s,i,c){switch(s){case"$type":return[`filter-type-${c}`,i];case"$id":return[`filter-id-${c}`,i];default:return[`filter-${c}`,s,i]}}function Hh(s,i){if(i.length===0)return!1;switch(s){case"$type":return["filter-type-in",["literal",i]];case"$id":return["filter-id-in",["literal",i]];default:return i.length>200&&!i.some(c=>typeof c!=typeof i[0])?["filter-in-large",s,["literal",i.sort(Zh)]]:["filter-in-small",s,["literal",i]]}}function $h(s){switch(s){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",s]}}function Al(s){return["!",s]}function Jc(s){const i=typeof s;if(i==="number"||i==="boolean"||i==="string"||s==null)return JSON.stringify(s);if(Array.isArray(s)){let g="[";for(const b of s)g+=`${Jc(b)},`;return`${g}]`}const c=Object.keys(s).sort();let f="{";for(let g=0;gf.maximum?[new lt(i,c,`${c} is greater than the maximum value ${f.maximum}`)]:[]}function Kh(s){const i=s.valueSpec,c=cn(s.value.type);let f,g,b,w={};const T=c!=="categorical"&&s.value.property===void 0,I=!T,L=Tr(s.value.stops)==="array"&&Tr(s.value.stops[0])==="array"&&Tr(s.value.stops[0][0])==="object",F=pi({key:s.key,value:s.value,valueSpec:s.styleSpec.function,validateSpec:s.validateSpec,style:s.style,styleSpec:s.styleSpec,objectElementValidators:{stops:function(J){if(c==="identity")return[new lt(J.key,J.value,'identity function may not have a "stops" property')];let ee=[];const ae=J.value;return ee=ee.concat(Yc({key:J.key,value:ae,valueSpec:J.valueSpec,validateSpec:J.validateSpec,style:J.style,styleSpec:J.styleSpec,arrayElementValidator:j})),Tr(ae)==="array"&&ae.length===0&&ee.push(new lt(J.key,ae,"array must have at least one stop")),ee},default:function(J){return J.validateSpec({key:J.key,value:J.value,valueSpec:i,validateSpec:J.validateSpec,style:J.style,styleSpec:J.styleSpec})}}});return c==="identity"&&T&&F.push(new lt(s.key,s.value,'missing required property "property"')),c==="identity"||s.value.stops||F.push(new lt(s.key,s.value,'missing required property "stops"')),c==="exponential"&&s.valueSpec.expression&&!Hc(s.valueSpec)&&F.push(new lt(s.key,s.value,"exponential functions not supported")),s.styleSpec.$version>=8&&(I&&!Gs(s.valueSpec)?F.push(new lt(s.key,s.value,"property functions not supported")):T&&!Vh(s.valueSpec)&&F.push(new lt(s.key,s.value,"zoom functions not supported"))),c!=="categorical"&&!L||s.value.property!==void 0||F.push(new lt(s.key,s.value,'"property" property is required')),F;function j(J){let ee=[];const ae=J.value,ge=J.key;if(Tr(ae)!=="array")return[new lt(ge,ae,`array expected, ${Tr(ae)} found`)];if(ae.length!==2)return[new lt(ge,ae,`array length 2 expected, length ${ae.length} found`)];if(L){if(Tr(ae[0])!=="object")return[new lt(ge,ae,`object expected, ${Tr(ae[0])} found`)];if(ae[0].zoom===void 0)return[new lt(ge,ae,"object stop key must have zoom")];if(ae[0].value===void 0)return[new lt(ge,ae,"object stop key must have value")];if(b&&b>cn(ae[0].zoom))return[new lt(ge,ae[0].zoom,"stop zoom values must appear in ascending order")];cn(ae[0].zoom)!==b&&(b=cn(ae[0].zoom),g=void 0,w={}),ee=ee.concat(pi({key:`${ge}[0]`,value:ae[0],valueSpec:{zoom:{}},validateSpec:J.validateSpec,style:J.style,styleSpec:J.styleSpec,objectElementValidators:{zoom:Ll,value:H}}))}else ee=ee.concat(H({key:`${ge}[0]`,value:ae[0],valueSpec:{},validateSpec:J.validateSpec,style:J.style,styleSpec:J.styleSpec},ae));return jr(Jo(ae[1]))?ee.concat([new lt(`${ge}[1]`,ae[1],"expressions are not allowed in function stops.")]):ee.concat(J.validateSpec({key:`${ge}[1]`,value:ae[1],valueSpec:i,validateSpec:J.validateSpec,style:J.style,styleSpec:J.styleSpec}))}function H(J,ee){const ae=Tr(J.value),ge=cn(J.value),xe=J.value!==null?J.value:ee;if(f){if(ae!==f)return[new lt(J.key,xe,`${ae} stop domain type must match previous stop domain type ${f}`)]}else f=ae;if(ae!=="number"&&ae!=="string"&&ae!=="boolean")return[new lt(J.key,xe,"stop domain value must be a number, string, or boolean")];if(ae!=="number"&&c!=="categorical"){let De=`number expected, ${ae} found`;return Gs(i)&&c===void 0&&(De+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new lt(J.key,xe,De)]}return c!=="categorical"||ae!=="number"||isFinite(ge)&&Math.floor(ge)===ge?c!=="categorical"&&ae==="number"&&g!==void 0&&genew lt(`${s.key}${f.key}`,s.value,f.message));const c=i.value.expression||i.value._styleExpression.expression;if(s.expressionContext==="property"&&s.propertyKey==="text-font"&&!c.outputDefined())return[new lt(s.key,s.value,`Invalid data expression for "${s.propertyKey}". Output values must be contained as literals within the expression.`)];if(s.expressionContext==="property"&&s.propertyType==="layout"&&!Ia(c))return[new lt(s.key,s.value,'"feature-state" data expressions are not supported with layout properties.')];if(s.expressionContext==="filter"&&!Ia(c))return[new lt(s.key,s.value,'"feature-state" data expressions are not supported with filters.')];if(s.expressionContext&&s.expressionContext.indexOf("cluster")===0){if(!Aa(c,["zoom","feature-state"]))return[new lt(s.key,s.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(s.expressionContext==="cluster-initial"&&!ml(c))return[new lt(s.key,s.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qo(s){const i=s.key,c=s.value,f=s.valueSpec,g=[];return Array.isArray(f.values)?f.values.indexOf(cn(c))===-1&&g.push(new lt(i,c,`expected one of [${f.values.join(", ")}], ${JSON.stringify(c)} found`)):Object.keys(f.values).indexOf(cn(c))===-1&&g.push(new lt(i,c,`expected one of [${Object.keys(f.values).join(", ")}], ${JSON.stringify(c)} found`)),g}function Ws(s){return El(Jo(s.value))?Yo(Xn({},s,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Qc(s)}function Qc(s){const i=s.value,c=s.key;if(Tr(i)!=="array")return[new lt(c,i,`array expected, ${Tr(i)} found`)];const f=s.styleSpec;let g,b=[];if(i.length<1)return[new lt(c,i,"filter array must have at least 1 element")];switch(b=b.concat(Qo({key:`${c}[0]`,value:i[0],valueSpec:f.filter_operator,style:s.style,styleSpec:s.styleSpec})),cn(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&cn(i[1])==="$type"&&b.push(new lt(c,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":i.length!==3&&b.push(new lt(c,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(g=Tr(i[1]),g!=="string"&&b.push(new lt(`${c}[1]`,i[1],`string expected, ${g} found`)));for(let w=2;w{L in c&&i.push(new lt(f,c[L],`"${L}" is prohibited for ref layers`))}),g.layers.forEach(L=>{cn(L.id)===T&&(I=L)}),I?I.ref?i.push(new lt(f,c.ref,"ref cannot reference another ref layer")):w=cn(I.type):i.push(new lt(f,c.ref,`ref layer "${T}" not found`))}else if(w!=="background")if(c.source){const I=g.sources&&g.sources[c.source],L=I&&cn(I.type);I?L==="vector"&&w==="raster"?i.push(new lt(f,c.source,`layer "${c.id}" requires a raster source`)):L!=="raster-dem"&&w==="hillshade"?i.push(new lt(f,c.source,`layer "${c.id}" requires a raster-dem source`)):L==="raster"&&w!=="raster"?i.push(new lt(f,c.source,`layer "${c.id}" requires a vector source`)):L!=="vector"||c["source-layer"]?L==="raster-dem"&&w!=="hillshade"?i.push(new lt(f,c.source,"raster-dem source can only be used with layer type 'hillshade'.")):w!=="line"||!c.paint||!c.paint["line-gradient"]||L==="geojson"&&I.lineMetrics||i.push(new lt(f,c,`layer "${c.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new lt(f,c,`layer "${c.id}" must specify a "source-layer"`)):i.push(new lt(f,c.source,`source "${c.source}" not found`))}else i.push(new lt(f,c,'missing required property "source"'));return i=i.concat(pi({key:f,value:c,valueSpec:b.layer,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,objectElementValidators:{"*":()=>[],type:()=>s.validateSpec({key:`${f}.type`,value:c.type,valueSpec:b.layer.type,style:s.style,styleSpec:s.styleSpec,validateSpec:s.validateSpec,object:c,objectKey:"type"}),filter:Ws,layout:I=>pi({layer:c,key:I.key,value:I.value,style:I.style,styleSpec:I.styleSpec,validateSpec:I.validateSpec,objectElementValidators:{"*":L=>tu(Xn({layerType:w},L))}}),paint:I=>pi({layer:c,key:I.key,value:I.value,style:I.style,styleSpec:I.styleSpec,validateSpec:I.validateSpec,objectElementValidators:{"*":L=>eu(Xn({layerType:w},L))}})}})),i}function _s(s){const i=s.value,c=s.key,f=Tr(i);return f!=="string"?[new lt(c,i,`string expected, ${f} found`)]:[]}const Jh={promoteId:function({key:s,value:i}){if(Tr(i)==="string")return _s({key:s,value:i});{const c=[];for(const f in i)c.push(..._s({key:`${s}.${f}`,value:i[f]}));return c}}};function Yh(s){const i=s.value,c=s.key,f=s.styleSpec,g=s.style,b=s.validateSpec;if(!i.type)return[new lt(c,i,'"type" is required')];const w=cn(i.type);let T;switch(w){case"vector":case"raster":return T=pi({key:c,value:i,valueSpec:f[`source_${w.replace("-","_")}`],style:s.style,styleSpec:f,objectElementValidators:Jh,validateSpec:b}),T;case"raster-dem":return T=function(I){var L;const F=(L=I.sourceName)!==null&&L!==void 0?L:"",j=I.value,H=I.styleSpec,J=H.source_raster_dem,ee=I.style;let ae=[];const ge=Tr(j);if(j===void 0)return ae;if(ge!=="object")return ae.push(new lt("source_raster_dem",j,`object expected, ${ge} found`)),ae;const xe=cn(j.encoding)==="custom",De=["redFactor","greenFactor","blueFactor","baseShift"],ke=I.value.encoding?`"${I.value.encoding}"`:"Default";for(const Ae in j)!xe&&De.includes(Ae)?ae.push(new lt(Ae,j[Ae],`In "${F}": "${Ae}" is only valid when "encoding" is set to "custom". ${ke} encoding found`)):J[Ae]?ae=ae.concat(I.validateSpec({key:Ae,value:j[Ae],valueSpec:J[Ae],validateSpec:I.validateSpec,style:ee,styleSpec:H})):ae.push(new lt(Ae,j[Ae],`unknown property "${Ae}"`));return ae}({sourceName:c,value:i,style:s.style,styleSpec:f,validateSpec:b}),T;case"geojson":if(T=pi({key:c,value:i,valueSpec:f.source_geojson,style:g,styleSpec:f,validateSpec:b,objectElementValidators:Jh}),i.cluster)for(const I in i.clusterProperties){const[L,F]=i.clusterProperties[I],j=typeof L=="string"?[L,["accumulated"],["get",I]]:L;T.push(...Yo({key:`${c}.${I}.map`,value:F,validateSpec:b,expressionContext:"cluster-map"})),T.push(...Yo({key:`${c}.${I}.reduce`,value:j,validateSpec:b,expressionContext:"cluster-reduce"}))}return T;case"video":return pi({key:c,value:i,valueSpec:f.source_video,style:g,validateSpec:b,styleSpec:f});case"image":return pi({key:c,value:i,valueSpec:f.source_image,style:g,validateSpec:b,styleSpec:f});case"canvas":return[new lt(c,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Qo({key:`${c}.type`,value:i.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:g,validateSpec:b,styleSpec:f})}}function Qh(s){const i=s.value,c=s.styleSpec,f=c.light,g=s.style;let b=[];const w=Tr(i);if(i===void 0)return b;if(w!=="object")return b=b.concat([new lt("light",i,`object expected, ${w} found`)]),b;for(const T in i){const I=T.match(/^(.*)-transition$/);b=b.concat(I&&f[I[1]]&&f[I[1]].transition?s.validateSpec({key:T,value:i[T],valueSpec:c.transition,validateSpec:s.validateSpec,style:g,styleSpec:c}):f[T]?s.validateSpec({key:T,value:i[T],valueSpec:f[T],validateSpec:s.validateSpec,style:g,styleSpec:c}):[new lt(T,i[T],`unknown property "${T}"`)])}return b}function ef(s){const i=s.value,c=s.styleSpec,f=c.sky,g=s.style,b=Tr(i);if(i===void 0)return[];if(b!=="object")return[new lt("sky",i,`object expected, ${b} found`)];let w=[];for(const T in i)w=w.concat(f[T]?_o({key:T,value:i[T],valueSpec:f[T],style:g,styleSpec:c}):[new lt(T,i[T],`unknown property "${T}"`)]);return w}function Ra(s){const i=s.value,c=s.styleSpec,f=c.terrain,g=s.style;let b=[];const w=Tr(i);if(i===void 0)return b;if(w!=="object")return b=b.concat([new lt("terrain",i,`object expected, ${w} found`)]),b;for(const T in i)b=b.concat(f[T]?s.validateSpec({key:T,value:i[T],valueSpec:f[T],validateSpec:s.validateSpec,style:g,styleSpec:c}):[new lt(T,i[T],`unknown property "${T}"`)]);return b}function Ba(s){let i=[];const c=s.value,f=s.key;if(Array.isArray(c)){const g=[],b=[];for(const w in c)c[w].id&&g.includes(c[w].id)&&i.push(new lt(f,c,`all the sprites' ids must be unique, but ${c[w].id} is duplicated`)),g.push(c[w].id),c[w].url&&b.includes(c[w].url)&&i.push(new lt(f,c,`all the sprites' URLs must be unique, but ${c[w].url} is duplicated`)),b.push(c[w].url),i=i.concat(pi({key:`${f}[${w}]`,value:c[w],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:s.validateSpec}));return i}return _s({key:f,value:c})}const xi={"*":()=>[],array:Yc,boolean:function(s){const i=s.value,c=s.key,f=Tr(i);return f!=="boolean"?[new lt(c,i,`boolean expected, ${f} found`)]:[]},number:Ll,color:function(s){const i=s.key,c=s.value,f=Tr(c);return f!=="string"?[new lt(i,c,`color expected, ${f} found`)]:zr.parse(String(c))?[]:[new lt(i,c,`color expected, "${c}" found`)]},constants:Xh,enum:Qo,filter:Ws,function:Kh,layer:Da,object:pi,source:Yh,light:Qh,sky:ef,terrain:Ra,string:_s,formatted:function(s){return _s(s).length===0?[]:Yo(s)},resolvedImage:function(s){return _s(s).length===0?[]:Yo(s)},padding:function(s){const i=s.key,c=s.value;if(Tr(c)==="array"){if(c.length<1||c.length>4)return[new lt(i,c,`padding requires 1 to 4 values; ${c.length} values found`)];const f={type:"number"};let g=[];for(let b=0;b[]}})),s.constants&&(c=c.concat(Xh({key:"constants",value:s.constants,style:s,styleSpec:i,validateSpec:_o}))),Zs(c)}function yo(s){return function(i){return s({...i,validateSpec:_o})}}function Zs(s){return[].concat(s).sort((i,c)=>i.line-c.line)}function io(s){return function(...i){return Zs(s.apply(this,i))}}no.source=io(yo(Yh)),no.sprite=io(yo(Ba)),no.glyphs=io(yo(ru)),no.light=io(yo(Qh)),no.sky=io(yo(ef)),no.terrain=io(yo(Ra)),no.layer=io(yo(Da)),no.filter=io(yo(Ws)),no.paintProperty=io(yo(eu)),no.layoutProperty=io(yo(tu));const ys=no,ap=ys.light,nu=ys.paintProperty,lp=ys.layoutProperty;function Hs(s,i){let c=!1;if(i&&i.length)for(const f of i)s.fire(new tt(new Error(f.message))),c=!0;return c}class Fa{constructor(i,c,f){const g=this.cells=[];if(i instanceof ArrayBuffer){this.arrayBuffer=i;const w=new Int32Array(this.arrayBuffer);i=w[0],this.d=(c=w[1])+2*(f=w[2]);for(let I=0;I=j[ee+0]&&g>=j[ee+1])?(T[J]=!0,w.push(F[J])):T[J]=!1}}}}_forEachCell(i,c,f,g,b,w,T,I){const L=this._convertToCellCoord(i),F=this._convertToCellCoord(c),j=this._convertToCellCoord(f),H=this._convertToCellCoord(g);for(let J=L;J<=j;J++)for(let ee=F;ee<=H;ee++){const ae=this.d*ee+J;if((!I||I(this._convertFromCellCoord(J),this._convertFromCellCoord(ee),this._convertFromCellCoord(J+1),this._convertFromCellCoord(ee+1)))&&b.call(this,i,c,f,g,ae,w,T,I))return}}_convertFromCellCoord(i){return(i-this.padding)/this.scale}_convertToCellCoord(i){return Math.max(0,Math.min(this.d-1,Math.floor(i*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const i=this.cells,c=3+this.cells.length+1+1;let f=0;for(let w=0;w=0)continue;const w=s[b];g[b]=vo[f].shallow.indexOf(b)>=0?w:$s(w,i)}s instanceof Error&&(g.message=s.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return f!=="Object"&&(g.$name=f),g}throw new Error("can't serialize object of type "+typeof s)}function Xs(s){if(s==null||typeof s=="boolean"||typeof s=="number"||typeof s=="string"||s instanceof Boolean||s instanceof Number||s instanceof String||s instanceof Date||s instanceof RegExp||s instanceof Blob||s instanceof Error||zl(s)||Ke(s)||ArrayBuffer.isView(s)||s instanceof ImageData)return s;if(Array.isArray(s))return s.map(Xs);if(typeof s=="object"){const i=s.$name||"Object";if(!vo[i])throw new Error(`can't deserialize unregistered class ${i}`);const{klass:c}=vo[i];if(!c)throw new Error(`can't deserialize unregistered class ${i}`);if(c.deserialize)return c.deserialize(s);const f=Object.create(c.prototype);for(const g of Object.keys(s)){if(g==="$name")continue;const b=s[g];f[g]=vo[i].shallow.indexOf(g)>=0?b:Xs(b)}return f}throw new Error("can't deserialize object of type "+typeof s)}class tf{constructor(){this.first=!0}update(i,c){const f=Math.floor(i);return this.first?(this.first=!1,this.lastIntegerZoom=f,this.lastIntegerZoomTime=0,this.lastZoom=i,this.lastFloorZoom=f,!0):(this.lastFloorZoom>f?(this.lastIntegerZoom=f+1,this.lastIntegerZoomTime=c):this.lastFloorZooms>=128&&s<=255,Arabic:s=>s>=1536&&s<=1791,"Arabic Supplement":s=>s>=1872&&s<=1919,"Arabic Extended-A":s=>s>=2208&&s<=2303,"Hangul Jamo":s=>s>=4352&&s<=4607,"Unified Canadian Aboriginal Syllabics":s=>s>=5120&&s<=5759,Khmer:s=>s>=6016&&s<=6143,"Unified Canadian Aboriginal Syllabics Extended":s=>s>=6320&&s<=6399,"General Punctuation":s=>s>=8192&&s<=8303,"Letterlike Symbols":s=>s>=8448&&s<=8527,"Number Forms":s=>s>=8528&&s<=8591,"Miscellaneous Technical":s=>s>=8960&&s<=9215,"Control Pictures":s=>s>=9216&&s<=9279,"Optical Character Recognition":s=>s>=9280&&s<=9311,"Enclosed Alphanumerics":s=>s>=9312&&s<=9471,"Geometric Shapes":s=>s>=9632&&s<=9727,"Miscellaneous Symbols":s=>s>=9728&&s<=9983,"Miscellaneous Symbols and Arrows":s=>s>=11008&&s<=11263,"CJK Radicals Supplement":s=>s>=11904&&s<=12031,"Kangxi Radicals":s=>s>=12032&&s<=12255,"Ideographic Description Characters":s=>s>=12272&&s<=12287,"CJK Symbols and Punctuation":s=>s>=12288&&s<=12351,Hiragana:s=>s>=12352&&s<=12447,Katakana:s=>s>=12448&&s<=12543,Bopomofo:s=>s>=12544&&s<=12591,"Hangul Compatibility Jamo":s=>s>=12592&&s<=12687,Kanbun:s=>s>=12688&&s<=12703,"Bopomofo Extended":s=>s>=12704&&s<=12735,"CJK Strokes":s=>s>=12736&&s<=12783,"Katakana Phonetic Extensions":s=>s>=12784&&s<=12799,"Enclosed CJK Letters and Months":s=>s>=12800&&s<=13055,"CJK Compatibility":s=>s>=13056&&s<=13311,"CJK Unified Ideographs Extension A":s=>s>=13312&&s<=19903,"Yijing Hexagram Symbols":s=>s>=19904&&s<=19967,"CJK Unified Ideographs":s=>s>=19968&&s<=40959,"Yi Syllables":s=>s>=40960&&s<=42127,"Yi Radicals":s=>s>=42128&&s<=42191,"Hangul Jamo Extended-A":s=>s>=43360&&s<=43391,"Hangul Syllables":s=>s>=44032&&s<=55215,"Hangul Jamo Extended-B":s=>s>=55216&&s<=55295,"Private Use Area":s=>s>=57344&&s<=63743,"CJK Compatibility Ideographs":s=>s>=63744&&s<=64255,"Arabic Presentation Forms-A":s=>s>=64336&&s<=65023,"Vertical Forms":s=>s>=65040&&s<=65055,"CJK Compatibility Forms":s=>s>=65072&&s<=65103,"Small Form Variants":s=>s>=65104&&s<=65135,"Arabic Presentation Forms-B":s=>s>=65136&&s<=65279,"Halfwidth and Fullwidth Forms":s=>s>=65280&&s<=65519};function Ks(s){for(const i of s)if(Dl(i.charCodeAt(0)))return!0;return!1}function rf(s){for(const i of s)if(!nf(i.charCodeAt(0)))return!1;return!0}function nf(s){return!(xt.Arabic(s)||xt["Arabic Supplement"](s)||xt["Arabic Extended-A"](s)||xt["Arabic Presentation Forms-A"](s)||xt["Arabic Presentation Forms-B"](s))}function Dl(s){return!(s!==746&&s!==747&&(s<4352||!(xt["Bopomofo Extended"](s)||xt.Bopomofo(s)||xt["CJK Compatibility Forms"](s)&&!(s>=65097&&s<=65103)||xt["CJK Compatibility Ideographs"](s)||xt["CJK Compatibility"](s)||xt["CJK Radicals Supplement"](s)||xt["CJK Strokes"](s)||!(!xt["CJK Symbols and Punctuation"](s)||s>=12296&&s<=12305||s>=12308&&s<=12319||s===12336)||xt["CJK Unified Ideographs Extension A"](s)||xt["CJK Unified Ideographs"](s)||xt["Enclosed CJK Letters and Months"](s)||xt["Hangul Compatibility Jamo"](s)||xt["Hangul Jamo Extended-A"](s)||xt["Hangul Jamo Extended-B"](s)||xt["Hangul Jamo"](s)||xt["Hangul Syllables"](s)||xt.Hiragana(s)||xt["Ideographic Description Characters"](s)||xt.Kanbun(s)||xt["Kangxi Radicals"](s)||xt["Katakana Phonetic Extensions"](s)||xt.Katakana(s)&&s!==12540||!(!xt["Halfwidth and Fullwidth Forms"](s)||s===65288||s===65289||s===65293||s>=65306&&s<=65310||s===65339||s===65341||s===65343||s>=65371&&s<=65503||s===65507||s>=65512&&s<=65519)||!(!xt["Small Form Variants"](s)||s>=65112&&s<=65118||s>=65123&&s<=65126)||xt["Unified Canadian Aboriginal Syllabics"](s)||xt["Unified Canadian Aboriginal Syllabics Extended"](s)||xt["Vertical Forms"](s)||xt["Yijing Hexagram Symbols"](s)||xt["Yi Syllables"](s)||xt["Yi Radicals"](s))))}function iu(s){return!(Dl(s)||function(i){return!!(xt["Latin-1 Supplement"](i)&&(i===167||i===169||i===174||i===177||i===188||i===189||i===190||i===215||i===247)||xt["General Punctuation"](i)&&(i===8214||i===8224||i===8225||i===8240||i===8241||i===8251||i===8252||i===8258||i===8263||i===8264||i===8265||i===8273)||xt["Letterlike Symbols"](i)||xt["Number Forms"](i)||xt["Miscellaneous Technical"](i)&&(i>=8960&&i<=8967||i>=8972&&i<=8991||i>=8996&&i<=9e3||i===9003||i>=9085&&i<=9114||i>=9150&&i<=9165||i===9167||i>=9169&&i<=9179||i>=9186&&i<=9215)||xt["Control Pictures"](i)&&i!==9251||xt["Optical Character Recognition"](i)||xt["Enclosed Alphanumerics"](i)||xt["Geometric Shapes"](i)||xt["Miscellaneous Symbols"](i)&&!(i>=9754&&i<=9759)||xt["Miscellaneous Symbols and Arrows"](i)&&(i>=11026&&i<=11055||i>=11088&&i<=11097||i>=11192&&i<=11243)||xt["CJK Symbols and Punctuation"](i)||xt.Katakana(i)||xt["Private Use Area"](i)||xt["CJK Compatibility Forms"](i)||xt["Small Form Variants"](i)||xt["Halfwidth and Fullwidth Forms"](i)||i===8734||i===8756||i===8757||i>=9984&&i<=10087||i>=10102&&i<=10131||i===65532||i===65533)}(s))}function Rl(s){return s>=1424&&s<=2303||xt["Arabic Presentation Forms-A"](s)||xt["Arabic Presentation Forms-B"](s)}function of(s,i){return!(!i&&Rl(s)||s>=2304&&s<=3583||s>=3840&&s<=4255||xt.Khmer(s))}function cp(s){for(const i of s)if(Rl(i.charCodeAt(0)))return!0;return!1}const es=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(s){this.pluginStatus=s.pluginStatus,this.pluginURL=s.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(s){this.applyArabicShaping=s.applyArabicShaping,this.processBidirectionalText=s.processBidirectionalText,this.processStyledBidirectionalText=s.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Qr{constructor(i,c){this.zoom=i,c?(this.now=c.now,this.fadeDuration=c.fadeDuration,this.zoomHistory=c.zoomHistory,this.transition=c.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new tf,this.transition={})}isSupportedScript(i){return function(c,f){for(const g of c)if(!of(g.charCodeAt(0),f))return!1;return!0}(i,es.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const i=this.zoom,c=i-Math.floor(i),f=this.crossFadingFactor();return i>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:c+(1-c)*f}:{fromScale:.5,toScale:1,t:1-(1-f)*c}}}class Oa{constructor(i,c){this.property=i,this.value=c,this.expression=function(f,g){if(xl(f))return new kl(f,g);if(jr(f)){const b=Gh(f,g);if(b.result==="error")throw new Error(b.value.map(w=>`${w.key}: ${w.message}`).join(", "));return b.value}{let b=f;return g.type==="color"&&typeof f=="string"?b=zr.parse(f):g.type!=="padding"||typeof f!="number"&&!Array.isArray(f)?g.type==="variableAnchorOffsetCollection"&&Array.isArray(f)&&(b=$i.parse(f)):b=wi.parse(f),{kind:"constant",evaluate:()=>b}}}(c===void 0?i.specification.default:c,i.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(i,c,f){return this.property.possiblyEvaluate(this,i,c,f)}}class Bl{constructor(i){this.property=i,this.value=new Oa(i,void 0)}transitioned(i,c){return new sf(this.property,this.value,c,X({},i.transition,this.transition),i.now)}untransitioned(){return new sf(this.property,this.value,null,{},0)}}class ou{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitionablePropertyValues)}getValue(i){return re(this._values[i].value.value)}setValue(i,c){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new Bl(this._values[i].property)),this._values[i].value=new Oa(this._values[i].property,c===null?void 0:re(c))}getTransition(i){return re(this._values[i].transition)}setTransition(i,c){Object.prototype.hasOwnProperty.call(this._values,i)||(this._values[i]=new Bl(this._values[i].property)),this._values[i].transition=re(c)||void 0}serialize(){const i={};for(const c of Object.keys(this._values)){const f=this.getValue(c);f!==void 0&&(i[c]=f);const g=this.getTransition(c);g!==void 0&&(i[`${c}-transition`]=g)}return i}transitioned(i,c){const f=new af(this._properties);for(const g of Object.keys(this._values))f._values[g]=this._values[g].transitioned(i,c._values[g]);return f}untransitioned(){const i=new af(this._properties);for(const c of Object.keys(this._values))i._values[c]=this._values[c].untransitioned();return i}}class sf{constructor(i,c,f,g,b){this.property=i,this.value=c,this.begin=b+g.delay||0,this.end=this.begin+g.duration||0,i.specification.transition&&(g.delay||g.duration)&&(this.prior=f)}possiblyEvaluate(i,c,f){const g=i.now||0,b=this.value.possiblyEvaluate(i,c,f),w=this.prior;if(w){if(g>this.end)return this.prior=null,b;if(this.value.isDataDriven())return this.prior=null,b;if(g=1)return 1;const L=I*I,F=L*I;return 4*(I<.5?F:3*(I-L)+F-.75)}(T))}}return b}}class af{constructor(i){this._properties=i,this._values=Object.create(i.defaultTransitioningPropertyValues)}possiblyEvaluate(i,c,f){const g=new Na(this._properties);for(const b of Object.keys(this._values))g._values[b]=this._values[b].possiblyEvaluate(i,c,f);return g}hasTransition(){for(const i of Object.keys(this._values))if(this._values[i].prior)return!0;return!1}}class lf{constructor(i){this._properties=i,this._values=Object.create(i.defaultPropertyValues)}hasValue(i){return this._values[i].value!==void 0}getValue(i){return re(this._values[i].value)}setValue(i,c){this._values[i]=new Oa(this._values[i].property,c===null?void 0:re(c))}serialize(){const i={};for(const c of Object.keys(this._values)){const f=this.getValue(c);f!==void 0&&(i[c]=f)}return i}possiblyEvaluate(i,c,f){const g=new Na(this._properties);for(const b of Object.keys(this._values))g._values[b]=this._values[b].possiblyEvaluate(i,c,f);return g}}class oo{constructor(i,c,f){this.property=i,this.value=c,this.parameters=f}isConstant(){return this.value.kind==="constant"}constantOr(i){return this.value.kind==="constant"?this.value.value:i}evaluate(i,c,f,g){return this.property.evaluate(this.value,this.parameters,i,c,f,g)}}class Na{constructor(i){this._properties=i,this._values=Object.create(i.defaultPossiblyEvaluatedValues)}get(i){return this._values[i]}}class Bt{constructor(i){this.specification=i}possiblyEvaluate(i,c){if(i.isDataDriven())throw new Error("Value should not be data driven");return i.expression.evaluate(c)}interpolate(i,c,f){const g=di[this.specification.type];return g?g(i,c,f):i}}class Gt{constructor(i,c){this.specification=i,this.overrides=c}possiblyEvaluate(i,c,f,g){return new oo(this,i.expression.kind==="constant"||i.expression.kind==="camera"?{kind:"constant",value:i.expression.evaluate(c,null,{},f,g)}:i.expression,c)}interpolate(i,c,f){if(i.value.kind!=="constant"||c.value.kind!=="constant")return i;if(i.value.value===void 0||c.value.value===void 0)return new oo(this,{kind:"constant",value:void 0},i.parameters);const g=di[this.specification.type];if(g){const b=g(i.value.value,c.value.value,f);return new oo(this,{kind:"constant",value:b},i.parameters)}return i}evaluate(i,c,f,g,b,w){return i.kind==="constant"?i.value:i.evaluate(c,f,g,b,w)}}class Fl extends Gt{possiblyEvaluate(i,c,f,g){if(i.value===void 0)return new oo(this,{kind:"constant",value:void 0},c);if(i.expression.kind==="constant"){const b=i.expression.evaluate(c,null,{},f,g),w=i.property.specification.type==="resolvedImage"&&typeof b!="string"?b.name:b,T=this._calculate(w,w,w,c);return new oo(this,{kind:"constant",value:T},c)}if(i.expression.kind==="camera"){const b=this._calculate(i.expression.evaluate({zoom:c.zoom-1}),i.expression.evaluate({zoom:c.zoom}),i.expression.evaluate({zoom:c.zoom+1}),c);return new oo(this,{kind:"constant",value:b},c)}return new oo(this,i.expression,c)}evaluate(i,c,f,g,b,w){if(i.kind==="source"){const T=i.evaluate(c,f,g,b,w);return this._calculate(T,T,T,c)}return i.kind==="composite"?this._calculate(i.evaluate({zoom:Math.floor(c.zoom)-1},f,g),i.evaluate({zoom:Math.floor(c.zoom)},f,g),i.evaluate({zoom:Math.floor(c.zoom)+1},f,g),c):i.value}_calculate(i,c,f,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:i,to:c}:{from:f,to:c}}interpolate(i){return i}}class ja{constructor(i){this.specification=i}possiblyEvaluate(i,c,f,g){if(i.value!==void 0){if(i.expression.kind==="constant"){const b=i.expression.evaluate(c,null,{},f,g);return this._calculate(b,b,b,c)}return this._calculate(i.expression.evaluate(new Qr(Math.floor(c.zoom-1),c)),i.expression.evaluate(new Qr(Math.floor(c.zoom),c)),i.expression.evaluate(new Qr(Math.floor(c.zoom+1),c)),c)}}_calculate(i,c,f,g){return g.zoom>g.zoomHistory.lastIntegerZoom?{from:i,to:c}:{from:f,to:c}}interpolate(i){return i}}class su{constructor(i){this.specification=i}possiblyEvaluate(i,c,f,g){return!!i.expression.evaluate(c,null,{},f,g)}interpolate(){return!1}}class Si{constructor(i){this.properties=i,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const c in i){const f=i[c];f.specification.overridable&&this.overridableProperties.push(c);const g=this.defaultPropertyValues[c]=new Oa(f,void 0),b=this.defaultTransitionablePropertyValues[c]=new Bl(f);this.defaultTransitioningPropertyValues[c]=b.untransitioned(),this.defaultPossiblyEvaluatedValues[c]=g.possiblyEvaluate({})}}}Mt("DataDrivenProperty",Gt),Mt("DataConstantProperty",Bt),Mt("CrossFadedDataDrivenProperty",Fl),Mt("CrossFadedProperty",ja),Mt("ColorRampProperty",su);const au="-transition";class so extends it{constructor(i,c){if(super(),this.id=i.id,this.type=i.type,this._featureFilter={filter:()=>!0,needGeometry:!1},i.type!=="custom"&&(this.metadata=i.metadata,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,i.type!=="background"&&(this.source=i.source,this.sourceLayer=i["source-layer"],this.filter=i.filter),c.layout&&(this._unevaluatedLayout=new lf(c.layout)),c.paint)){this._transitionablePaint=new ou(c.paint);for(const f in i.paint)this.setPaintProperty(f,i.paint[f],{validate:!1});for(const f in i.layout)this.setLayoutProperty(f,i.layout[f],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Na(c.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(i){return i==="visibility"?this.visibility:this._unevaluatedLayout.getValue(i)}setLayoutProperty(i,c,f={}){c!=null&&this._validate(lp,`layers.${this.id}.layout.${i}`,i,c,f)||(i!=="visibility"?this._unevaluatedLayout.setValue(i,c):this.visibility=c)}getPaintProperty(i){return i.endsWith(au)?this._transitionablePaint.getTransition(i.slice(0,-11)):this._transitionablePaint.getValue(i)}setPaintProperty(i,c,f={}){if(c!=null&&this._validate(nu,`layers.${this.id}.paint.${i}`,i,c,f))return!1;if(i.endsWith(au))return this._transitionablePaint.setTransition(i.slice(0,-11),c||void 0),!1;{const g=this._transitionablePaint._values[i],b=g.property.specification["property-type"]==="cross-faded-data-driven",w=g.value.isDataDriven(),T=g.value;this._transitionablePaint.setValue(i,c),this._handleSpecialPaintPropertyUpdate(i);const I=this._transitionablePaint._values[i].value;return I.isDataDriven()||w||b||this._handleOverridablePaintPropertyUpdate(i,T,I)}}_handleSpecialPaintPropertyUpdate(i){}_handleOverridablePaintPropertyUpdate(i,c,f){return!1}isHidden(i){return!!(this.minzoom&&i=this.maxzoom)||this.visibility==="none"}updateTransitions(i){this._transitioningPaint=this._transitionablePaint.transitioned(i,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(i,c){i.getCrossfadeParameters&&(this._crossfadeParameters=i.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(i,void 0,c)),this.paint=this._transitioningPaint.possiblyEvaluate(i,void 0,c)}serialize(){const i={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&&(i.layout=i.layout||{},i.layout.visibility=this.visibility),ze(i,(c,f)=>!(c===void 0||f==="layout"&&!Object.keys(c).length||f==="paint"&&!Object.keys(c).length))}_validate(i,c,f,g,b={}){return(!b||b.validate!==!1)&&Hs(this,i.call(ys,{key:c,layerType:this.type,objectKey:f,value:g,styleSpec:ne,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const i in this.paint._values){const c=this.paint.get(i);if(c instanceof oo&&Gs(c.property.specification)&&(c.value.kind==="source"||c.value.kind==="composite")&&c.value.isStateDependent)return!0}return!1}}const cf={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ua{constructor(i,c){this._structArray=i,this._pos1=c*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class un{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(i,c){return i._trim(),c&&(i.isTransferred=!0,c.push(i.arrayBuffer)),{length:i.length,arrayBuffer:i.arrayBuffer}}static deserialize(i){const c=Object.create(this.prototype);return c.arrayBuffer=i.arrayBuffer,c.length=i.length,c.capacity=i.arrayBuffer.byteLength/c.bytesPerElement,c._refreshViews(),c}_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(i){this.reserve(i),this.length=i}reserve(i){if(i>this.capacity){this.capacity=Math.max(i,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const c=this.uint8;this._refreshViews(),c&&this.uint8.set(c)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function kn(s,i=1){let c=0,f=0;return{members:s.map(g=>{const b=cf[g.type].BYTES_PER_ELEMENT,w=c=uf(c,Math.max(i,b)),T=g.components||1;return f=Math.max(f,b),c+=b*T,{name:g.name,type:g.type,components:T,offset:w}}),size:uf(c,Math.max(f,i)),alignment:i}}function uf(s,i){return Math.ceil(s/i)*i}class Va extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c){const f=this.length;return this.resize(f+1),this.emplace(f,i,c)}emplace(i,c,f){const g=2*i;return this.int16[g+0]=c,this.int16[g+1]=f,i}}Va.prototype.bytesPerElement=4,Mt("StructArrayLayout2i4",Va);class Fo extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,f){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,f)}emplace(i,c,f,g){const b=3*i;return this.int16[b+0]=c,this.int16[b+1]=f,this.int16[b+2]=g,i}}Fo.prototype.bytesPerElement=6,Mt("StructArrayLayout3i6",Fo);class lu extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,f,g){const b=this.length;return this.resize(b+1),this.emplace(b,i,c,f,g)}emplace(i,c,f,g,b){const w=4*i;return this.int16[w+0]=c,this.int16[w+1]=f,this.int16[w+2]=g,this.int16[w+3]=b,i}}lu.prototype.bytesPerElement=8,Mt("StructArrayLayout4i8",lu);class cu extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,f,g,b,w){const T=this.length;return this.resize(T+1),this.emplace(T,i,c,f,g,b,w)}emplace(i,c,f,g,b,w,T){const I=6*i;return this.int16[I+0]=c,this.int16[I+1]=f,this.int16[I+2]=g,this.int16[I+3]=b,this.int16[I+4]=w,this.int16[I+5]=T,i}}cu.prototype.bytesPerElement=12,Mt("StructArrayLayout2i4i12",cu);class uu extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,f,g,b,w){const T=this.length;return this.resize(T+1),this.emplace(T,i,c,f,g,b,w)}emplace(i,c,f,g,b,w,T){const I=4*i,L=8*i;return this.int16[I+0]=c,this.int16[I+1]=f,this.uint8[L+4]=g,this.uint8[L+5]=b,this.uint8[L+6]=w,this.uint8[L+7]=T,i}}uu.prototype.bytesPerElement=8,Mt("StructArrayLayout2i4ub8",uu);class qa extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c){const f=this.length;return this.resize(f+1),this.emplace(f,i,c)}emplace(i,c,f){const g=2*i;return this.float32[g+0]=c,this.float32[g+1]=f,i}}qa.prototype.bytesPerElement=8,Mt("StructArrayLayout2f8",qa);class Ol extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,f,g,b,w,T,I,L,F){const j=this.length;return this.resize(j+1),this.emplace(j,i,c,f,g,b,w,T,I,L,F)}emplace(i,c,f,g,b,w,T,I,L,F,j){const H=10*i;return this.uint16[H+0]=c,this.uint16[H+1]=f,this.uint16[H+2]=g,this.uint16[H+3]=b,this.uint16[H+4]=w,this.uint16[H+5]=T,this.uint16[H+6]=I,this.uint16[H+7]=L,this.uint16[H+8]=F,this.uint16[H+9]=j,i}}Ol.prototype.bytesPerElement=20,Mt("StructArrayLayout10ui20",Ol);class hu extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,f,g,b,w,T,I,L,F,j,H){const J=this.length;return this.resize(J+1),this.emplace(J,i,c,f,g,b,w,T,I,L,F,j,H)}emplace(i,c,f,g,b,w,T,I,L,F,j,H,J){const ee=12*i;return this.int16[ee+0]=c,this.int16[ee+1]=f,this.int16[ee+2]=g,this.int16[ee+3]=b,this.uint16[ee+4]=w,this.uint16[ee+5]=T,this.uint16[ee+6]=I,this.uint16[ee+7]=L,this.int16[ee+8]=F,this.int16[ee+9]=j,this.int16[ee+10]=H,this.int16[ee+11]=J,i}}hu.prototype.bytesPerElement=24,Mt("StructArrayLayout4i4ui4i24",hu);class fu extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,f){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,f)}emplace(i,c,f,g){const b=3*i;return this.float32[b+0]=c,this.float32[b+1]=f,this.float32[b+2]=g,i}}fu.prototype.bytesPerElement=12,Mt("StructArrayLayout3f12",fu);class Oo extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(i){const c=this.length;return this.resize(c+1),this.emplace(c,i)}emplace(i,c){return this.uint32[1*i+0]=c,i}}Oo.prototype.bytesPerElement=4,Mt("StructArrayLayout1ul4",Oo);class Nl extends un{_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(i,c,f,g,b,w,T,I,L){const F=this.length;return this.resize(F+1),this.emplace(F,i,c,f,g,b,w,T,I,L)}emplace(i,c,f,g,b,w,T,I,L,F){const j=10*i,H=5*i;return this.int16[j+0]=c,this.int16[j+1]=f,this.int16[j+2]=g,this.int16[j+3]=b,this.int16[j+4]=w,this.int16[j+5]=T,this.uint32[H+3]=I,this.uint16[j+8]=L,this.uint16[j+9]=F,i}}Nl.prototype.bytesPerElement=20,Mt("StructArrayLayout6i1ul2ui20",Nl);class Ga extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,f,g,b,w){const T=this.length;return this.resize(T+1),this.emplace(T,i,c,f,g,b,w)}emplace(i,c,f,g,b,w,T){const I=6*i;return this.int16[I+0]=c,this.int16[I+1]=f,this.int16[I+2]=g,this.int16[I+3]=b,this.int16[I+4]=w,this.int16[I+5]=T,i}}Ga.prototype.bytesPerElement=12,Mt("StructArrayLayout2i2i2i12",Ga);class jl extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(i,c,f,g,b){const w=this.length;return this.resize(w+1),this.emplace(w,i,c,f,g,b)}emplace(i,c,f,g,b,w){const T=4*i,I=8*i;return this.float32[T+0]=c,this.float32[T+1]=f,this.float32[T+2]=g,this.int16[I+6]=b,this.int16[I+7]=w,i}}jl.prototype.bytesPerElement=16,Mt("StructArrayLayout2f1f2i16",jl);class Wa extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,f,g){const b=this.length;return this.resize(b+1),this.emplace(b,i,c,f,g)}emplace(i,c,f,g,b){const w=12*i,T=3*i;return this.uint8[w+0]=c,this.uint8[w+1]=f,this.float32[T+1]=g,this.float32[T+2]=b,i}}Wa.prototype.bytesPerElement=12,Mt("StructArrayLayout2ub2f12",Wa);class Ul extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,f){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,f)}emplace(i,c,f,g){const b=3*i;return this.uint16[b+0]=c,this.uint16[b+1]=f,this.uint16[b+2]=g,i}}Ul.prototype.bytesPerElement=6,Mt("StructArrayLayout3ui6",Ul);class Js extends un{_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(i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae,ge,xe){const De=this.length;return this.resize(De+1),this.emplace(De,i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae,ge,xe)}emplace(i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae,ge,xe,De){const ke=24*i,Ae=12*i,Je=48*i;return this.int16[ke+0]=c,this.int16[ke+1]=f,this.uint16[ke+2]=g,this.uint16[ke+3]=b,this.uint32[Ae+2]=w,this.uint32[Ae+3]=T,this.uint32[Ae+4]=I,this.uint16[ke+10]=L,this.uint16[ke+11]=F,this.uint16[ke+12]=j,this.float32[Ae+7]=H,this.float32[Ae+8]=J,this.uint8[Je+36]=ee,this.uint8[Je+37]=ae,this.uint8[Je+38]=ge,this.uint32[Ae+10]=xe,this.int16[ke+22]=De,i}}Js.prototype.bytesPerElement=48,Mt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Js);class vs extends un{_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(i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae,ge,xe,De,ke,Ae,Je,Qe,kt,zt,St,bt,dt,At){const yt=this.length;return this.resize(yt+1),this.emplace(yt,i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae,ge,xe,De,ke,Ae,Je,Qe,kt,zt,St,bt,dt,At)}emplace(i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae,ge,xe,De,ke,Ae,Je,Qe,kt,zt,St,bt,dt,At,yt){const at=32*i,qt=16*i;return this.int16[at+0]=c,this.int16[at+1]=f,this.int16[at+2]=g,this.int16[at+3]=b,this.int16[at+4]=w,this.int16[at+5]=T,this.int16[at+6]=I,this.int16[at+7]=L,this.uint16[at+8]=F,this.uint16[at+9]=j,this.uint16[at+10]=H,this.uint16[at+11]=J,this.uint16[at+12]=ee,this.uint16[at+13]=ae,this.uint16[at+14]=ge,this.uint16[at+15]=xe,this.uint16[at+16]=De,this.uint16[at+17]=ke,this.uint16[at+18]=Ae,this.uint16[at+19]=Je,this.uint16[at+20]=Qe,this.uint16[at+21]=kt,this.uint16[at+22]=zt,this.uint32[qt+12]=St,this.float32[qt+13]=bt,this.float32[qt+14]=dt,this.uint16[at+30]=At,this.uint16[at+31]=yt,i}}vs.prototype.bytesPerElement=64,Mt("StructArrayLayout8i15ui1ul2f2ui64",vs);class Vl extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i){const c=this.length;return this.resize(c+1),this.emplace(c,i)}emplace(i,c){return this.float32[1*i+0]=c,i}}Vl.prototype.bytesPerElement=4,Mt("StructArrayLayout1f4",Vl);class ql extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,f){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,f)}emplace(i,c,f,g){const b=3*i;return this.uint16[6*i+0]=c,this.float32[b+1]=f,this.float32[b+2]=g,i}}ql.prototype.bytesPerElement=12,Mt("StructArrayLayout1ui2f12",ql);class bs extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c,f){const g=this.length;return this.resize(g+1),this.emplace(g,i,c,f)}emplace(i,c,f,g){const b=4*i;return this.uint32[2*i+0]=c,this.uint16[b+2]=f,this.uint16[b+3]=g,i}}bs.prototype.bytesPerElement=8,Mt("StructArrayLayout1ul2ui8",bs);class du extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i,c){const f=this.length;return this.resize(f+1),this.emplace(f,i,c)}emplace(i,c,f){const g=2*i;return this.uint16[g+0]=c,this.uint16[g+1]=f,i}}du.prototype.bytesPerElement=4,Mt("StructArrayLayout2ui4",du);class pu extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(i){const c=this.length;return this.resize(c+1),this.emplace(c,i)}emplace(i,c){return this.uint16[1*i+0]=c,i}}pu.prototype.bytesPerElement=2,Mt("StructArrayLayout1ui2",pu);class Gl extends un{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(i,c,f,g){const b=this.length;return this.resize(b+1),this.emplace(b,i,c,f,g)}emplace(i,c,f,g,b){const w=4*i;return this.float32[w+0]=c,this.float32[w+1]=f,this.float32[w+2]=g,this.float32[w+3]=b,i}}Gl.prototype.bytesPerElement=16,Mt("StructArrayLayout4f16",Gl);class hf extends Ua{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 k(this.anchorPointX,this.anchorPointY)}}hf.prototype.size=20;class y extends Nl{get(i){return new hf(this,i)}}Mt("CollisionBoxArray",y);class o extends Ua{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(i){this._structArray.uint8[this._pos1+37]=i}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(i){this._structArray.uint8[this._pos1+38]=i}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(i){this._structArray.uint32[this._pos4+10]=i}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}o.prototype.size=48;class h extends Js{get(i){return new o(this,i)}}Mt("PlacedSymbolArray",h);class p extends Ua{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(i){this._structArray.uint32[this._pos4+12]=i}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]}}p.prototype.size=64;class m extends vs{get(i){return new p(this,i)}}Mt("SymbolInstanceArray",m);class v extends Vl{getoffsetX(i){return this.float32[1*i+0]}}Mt("GlyphOffsetArray",v);class E extends Fo{getx(i){return this.int16[3*i+0]}gety(i){return this.int16[3*i+1]}gettileUnitDistanceFromAnchor(i){return this.int16[3*i+2]}}Mt("SymbolLineVertexArray",E);class M extends Ua{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]}}M.prototype.size=12;class A extends ql{get(i){return new M(this,i)}}Mt("TextAnchorOffsetArray",A);class R extends Ua{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]}}R.prototype.size=8;class V extends bs{get(i){return new R(this,i)}}Mt("FeatureIndexArray",V);class q extends Va{}class Q extends Va{}class he extends Va{}class ue extends cu{}class ye extends uu{}class se extends qa{}class Te extends Ol{}class Ue extends hu{}class we extends fu{}class Le extends Oo{}class Ge extends Ga{}class He extends Wa{}class $e extends Ul{}class nt extends du{}const et=kn([{name:"a_pos",components:2,type:"Int16"}],4),{members:ft}=et;class gt{constructor(i=[]){this.segments=i}prepareSegment(i,c,f,g){let b=this.segments[this.segments.length-1];return i>gt.MAX_VERTEX_ARRAY_LENGTH&&Ze(`Max vertices per segment is ${gt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${i}`),(!b||b.vertexLength+i>gt.MAX_VERTEX_ARRAY_LENGTH||b.sortKey!==g)&&(b={vertexOffset:c.length,primitiveOffset:f.length,vertexLength:0,primitiveLength:0},g!==void 0&&(b.sortKey=g),this.segments.push(b)),b}get(){return this.segments}destroy(){for(const i of this.segments)for(const c in i.vaos)i.vaos[c].destroy()}static simpleSegment(i,c,f,g){return new gt([{vertexOffset:i,primitiveOffset:c,vertexLength:f,primitiveLength:g,vaos:{},sortKey:0}])}}function ir(s,i){return 256*(s=K(Math.floor(s),0,255))+K(Math.floor(i),0,255)}gt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Mt("SegmentVector",gt);const _t=kn([{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 Xt={exports:{}},or={exports:{}};or.exports=function(s,i){var c,f,g,b,w,T,I,L;for(f=s.length-(c=3&s.length),g=i,w=3432918353,T=461845907,L=0;L>>16)*w&65535)<<16)&4294967295)<<15|I>>>17))*T+(((I>>>16)*T&65535)<<16)&4294967295)<<13|g>>>19))+((5*(g>>>16)&65535)<<16)&4294967295))+((58964+(b>>>16)&65535)<<16);switch(I=0,c){case 3:I^=(255&s.charCodeAt(L+2))<<16;case 2:I^=(255&s.charCodeAt(L+1))<<8;case 1:g^=I=(65535&(I=(I=(65535&(I^=255&s.charCodeAt(L)))*w+(((I>>>16)*w&65535)<<16)&4294967295)<<15|I>>>17))*T+(((I>>>16)*T&65535)<<16)&4294967295}return g^=s.length,g=2246822507*(65535&(g^=g>>>16))+((2246822507*(g>>>16)&65535)<<16)&4294967295,g=3266489909*(65535&(g^=g>>>13))+((3266489909*(g>>>16)&65535)<<16)&4294967295,(g^=g>>>16)>>>0};var Sr=or.exports,Yt={exports:{}};Yt.exports=function(s,i){for(var c,f=s.length,g=i^f,b=0;f>=4;)c=1540483477*(65535&(c=255&s.charCodeAt(b)|(255&s.charCodeAt(++b))<<8|(255&s.charCodeAt(++b))<<16|(255&s.charCodeAt(++b))<<24))+((1540483477*(c>>>16)&65535)<<16),g=1540483477*(65535&g)+((1540483477*(g>>>16)&65535)<<16)^(c=1540483477*(65535&(c^=c>>>24))+((1540483477*(c>>>16)&65535)<<16)),f-=4,++b;switch(f){case 3:g^=(255&s.charCodeAt(b+2))<<16;case 2:g^=(255&s.charCodeAt(b+1))<<8;case 1:g=1540483477*(65535&(g^=255&s.charCodeAt(b)))+((1540483477*(g>>>16)&65535)<<16)}return g=1540483477*(65535&(g^=g>>>13))+((1540483477*(g>>>16)&65535)<<16),(g^=g>>>15)>>>0};var cr=Sr,dr=Yt.exports;Xt.exports=cr,Xt.exports.murmur3=cr,Xt.exports.murmur2=dr;var hn=_(Xt.exports);class Rr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(i,c,f,g){this.ids.push(Oi(i)),this.positions.push(c,f,g)}getPositions(i){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const c=Oi(i);let f=0,g=this.ids.length-1;for(;f>1;this.ids[w]>=c?g=w:f=w+1}const b=[];for(;this.ids[f]===c;)b.push({index:this.positions[3*f],start:this.positions[3*f+1],end:this.positions[3*f+2]}),f++;return b}static serialize(i,c){const f=new Float64Array(i.ids),g=new Uint32Array(i.positions);return Fn(f,g,0,f.length-1),c&&c.push(f.buffer,g.buffer),{ids:f,positions:g}}static deserialize(i){const c=new Rr;return c.ids=i.ids,c.positions=i.positions,c.indexed=!0,c}}function Oi(s){const i=+s;return!isNaN(i)&&i<=Number.MAX_SAFE_INTEGER?i:hn(String(s))}function Fn(s,i,c,f){for(;c>1];let b=c-1,w=f+1;for(;;){do b++;while(s[b]g);if(b>=w)break;nn(s,b,w),nn(i,3*b,3*w),nn(i,3*b+1,3*w+1),nn(i,3*b+2,3*w+2)}w-c`u_${g}`),this.type=f}setUniform(i,c,f){i.set(f.constantOr(this.value))}getBinding(i,c,f){return this.type==="color"?new ts(i,c):new Ni(i,c)}}class An{constructor(i,c){this.uniformNames=c.map(f=>`u_${f}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(i,c){this.pixelRatioFrom=c.pixelRatio,this.pixelRatioTo=i.pixelRatio,this.patternFrom=c.tlbr,this.patternTo=i.tlbr}setUniform(i,c,f,g){const b=g==="u_pattern_to"?this.patternTo:g==="u_pattern_from"?this.patternFrom:g==="u_pixel_ratio_to"?this.pixelRatioTo:g==="u_pixel_ratio_from"?this.pixelRatioFrom:null;b&&i.set(b)}getBinding(i,c,f){return f.substr(0,9)==="u_pattern"?new bo(i,c):new Ni(i,c)}}class on{constructor(i,c,f,g){this.expression=i,this.type=f,this.maxValue=0,this.paintVertexAttributes=c.map(b=>({name:`a_${b}`,type:"Float32",components:f==="color"?2:1,offset:0})),this.paintVertexArray=new g}populatePaintArray(i,c,f,g,b){const w=this.paintVertexArray.length,T=this.expression.evaluate(new Qr(0),c,{},g,[],b);this.paintVertexArray.resize(i),this._setPaintValue(w,i,T)}updatePaintArray(i,c,f,g){const b=this.expression.evaluate({zoom:0},f,g);this._setPaintValue(i,c,b)}_setPaintValue(i,c,f){if(this.type==="color"){const g=rs(f);for(let b=i;b`u_${T}_t`),this.type=f,this.useIntegerZoom=g,this.zoom=b,this.maxValue=0,this.paintVertexAttributes=c.map(T=>({name:`a_${T}`,type:"Float32",components:f==="color"?4:2,offset:0})),this.paintVertexArray=new w}populatePaintArray(i,c,f,g,b){const w=this.expression.evaluate(new Qr(this.zoom),c,{},g,[],b),T=this.expression.evaluate(new Qr(this.zoom+1),c,{},g,[],b),I=this.paintVertexArray.length;this.paintVertexArray.resize(i),this._setPaintValue(I,i,w,T)}updatePaintArray(i,c,f,g){const b=this.expression.evaluate({zoom:this.zoom},f,g),w=this.expression.evaluate({zoom:this.zoom+1},f,g);this._setPaintValue(i,c,b,w)}_setPaintValue(i,c,f,g){if(this.type==="color"){const b=rs(f),w=rs(g);for(let T=i;T`#define HAS_UNIFORM_${g}`))}return i}getBinderAttributes(){const i=[];for(const c in this.binders){const f=this.binders[c];if(f instanceof on||f instanceof en)for(let g=0;g!0){this.programConfigurations={};for(const g of i)this.programConfigurations[g.id]=new Ln(g,c,f);this.needsUpload=!1,this._featureMap=new Rr,this._bufferOffset=0}populatePaintArrays(i,c,f,g,b,w){for(const T in this.programConfigurations)this.programConfigurations[T].populatePaintArrays(i,c,g,b,w);c.id!==void 0&&this._featureMap.add(c.id,f,this._bufferOffset,i),this._bufferOffset=i,this.needsUpload=!0}updatePaintArrays(i,c,f,g){for(const b of f)this.needsUpload=this.programConfigurations[b.id].updatePaintArrays(i,this._featureMap,c,b,g)||this.needsUpload}get(i){return this.programConfigurations[i]}upload(i){if(this.needsUpload){for(const c in this.programConfigurations)this.programConfigurations[c].upload(i);this.needsUpload=!1}}destroy(){for(const i in this.programConfigurations)this.programConfigurations[i].destroy()}}function Ji(s,i){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"]}[s]||[s.replace(`${i}-`,"").replace(/-/g,"_")]}function Pn(s,i,c){const f={color:{source:qa,composite:Gl},number:{source:Vl,composite:qa}},g=function(b){return{"line-pattern":{source:Te,composite:Te},"fill-pattern":{source:Te,composite:Te},"fill-extrusion-pattern":{source:Te,composite:Te}}[b]}(s);return g&&g[c]||f[i][c]}Mt("ConstantBinder",wo),Mt("CrossFadedConstantBinder",An),Mt("SourceExpressionBinder",on),Mt("CrossFadedCompositeBinder",Ki),Mt("CompositeExpressionBinder",en),Mt("ProgramConfiguration",Ln,{omit:["_buffers"]}),Mt("ProgramConfigurationSet",sn);const yn=8192,mu=Math.pow(2,14)-1,ff=-mu-1;function ws(s){const i=yn/s.extent,c=s.loadGeometry();for(let f=0;fw.x+1||Iw.y+1)&&Ze("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return c}function xs(s,i){return{type:s.type,id:s.id,properties:s.properties,geometry:i?ws(s):[]}}function Wl(s,i,c,f,g){s.emplaceBack(2*i+(f+1)/2,2*c+(g+1)/2)}class ns{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(c=>c.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new Q,this.indexArray=new $e,this.segments=new gt,this.programConfigurations=new sn(i.layers,i.zoom),this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,f){const g=this.layers[0],b=[];let w=null,T=!1;g.type==="circle"&&(w=g.layout.get("circle-sort-key"),T=!w.isConstant());for(const{feature:I,id:L,index:F,sourceLayerIndex:j}of i){const H=this.layers[0]._featureFilter.needGeometry,J=xs(I,H);if(!this.layers[0]._featureFilter.filter(new Qr(this.zoom),J,f))continue;const ee=T?w.evaluate(J,{},f):void 0,ae={id:L,properties:I.properties,type:I.type,sourceLayerIndex:j,index:F,geometry:H?J.geometry:ws(I),patterns:{},sortKey:ee};b.push(ae)}T&&b.sort((I,L)=>I.sortKey-L.sortKey);for(const I of b){const{geometry:L,index:F,sourceLayerIndex:j}=I,H=i[F].feature;this.addFeature(I,L,F,f),c.featureIndex.insert(H,L,F,j,this.index)}}update(i,c,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,ft),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(i,c,f,g){for(const b of c)for(const w of b){const T=w.x,I=w.y;if(T<0||T>=yn||I<0||I>=yn)continue;const L=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,i.sortKey),F=L.vertexLength;Wl(this.layoutVertexArray,T,I,-1,-1),Wl(this.layoutVertexArray,T,I,1,-1),Wl(this.layoutVertexArray,T,I,1,1),Wl(this.layoutVertexArray,T,I,-1,1),this.indexArray.emplaceBack(F,F+1,F+2),this.indexArray.emplaceBack(F,F+3,F+2),L.vertexLength+=4,L.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,f,{},g)}}function gu(s,i){for(let c=0;c1){if(Zl(s,i))return!0;for(let f=0;f1?c:c.sub(i)._mult(g)._add(i))}function a_(s,i){let c,f,g,b=!1;for(let w=0;wi.y!=g.y>i.y&&i.x<(g.x-f.x)*(i.y-f.y)/(g.y-f.y)+f.x&&(b=!b)}return b}function Hl(s,i){let c=!1;for(let f=0,g=s.length-1;fi.y!=w.y>i.y&&i.x<(w.x-b.x)*(i.y-b.y)/(w.y-b.y)+b.x&&(c=!c)}return c}function qx(s,i,c){const f=c[0],g=c[2];if(s.xg.x&&i.x>g.x||s.yg.y&&i.y>g.y)return!1;const b=Me(s,i,c[0]);return b!==Me(s,i,c[1])||b!==Me(s,i,c[2])||b!==Me(s,i,c[3])}function bu(s,i,c){const f=i.paint.get(s).value;return f.kind==="constant"?f.value:c.programConfigurations.get(i.id).getMaxValue(s)}function pf(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}function mf(s,i,c,f,g){if(!i[0]&&!i[1])return s;const b=k.convert(i)._mult(g);c==="viewport"&&b._rotate(-f);const w=[];for(let T=0;Th_(ge,ae))}(L,I),J=j?F*T:F;for(const ee of g)for(const ae of ee){const ge=j?ae:h_(ae,I);let xe=J;const De=gf([],[ae.x,ae.y,0,1],I);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?xe*=De[3]/w.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(xe*=w.cameraToCenterDistance/De[3]),df(H,ge,xe))return!0}return!1}}function h_(s,i){const c=gf([],[s.x,s.y,0,1],i);return new k(c[0]/c[3],c[1]/c[3])}class f_ extends ns{}let d_;Mt("HeatmapBucket",f_,{omit:["layers"]});var Hx={get paint(){return d_=d_||new Si({"heatmap-radius":new Gt(ne.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Gt(ne.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Bt(ne.paint_heatmap["heatmap-intensity"]),"heatmap-color":new su(ne.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Bt(ne.paint_heatmap["heatmap-opacity"])})}};function fp(s,{width:i,height:c},f,g){if(g){if(g instanceof Uint8ClampedArray)g=new Uint8Array(g.buffer);else if(g.length!==i*c*f)throw new RangeError(`mismatched image size. expected: ${g.length} but got: ${i*c*f}`)}else g=new Uint8Array(i*c*f);return s.width=i,s.height=c,s.data=g,s}function p_(s,{width:i,height:c},f){if(i===s.width&&c===s.height)return;const g=fp({},{width:i,height:c},f);dp(s,g,{x:0,y:0},{x:0,y:0},{width:Math.min(s.width,i),height:Math.min(s.height,c)},f),s.width=i,s.height=c,s.data=g.data}function dp(s,i,c,f,g,b){if(g.width===0||g.height===0)return i;if(g.width>s.width||g.height>s.height||c.x>s.width-g.width||c.y>s.height-g.height)throw new RangeError("out of range source coordinates for image copy");if(g.width>i.width||g.height>i.height||f.x>i.width-g.width||f.y>i.height-g.height)throw new RangeError("out of range destination coordinates for image copy");const w=s.data,T=i.data;if(w===T)throw new Error("srcData equals dstData, so image is already copied");for(let I=0;I{i[s.evaluationKey]=I;const L=s.expression.evaluate(i);g.data[w+T+0]=Math.floor(255*L.r/L.a),g.data[w+T+1]=Math.floor(255*L.g/L.a),g.data[w+T+2]=Math.floor(255*L.b/L.a),g.data[w+T+3]=Math.floor(255*L.a)};if(s.clips)for(let w=0,T=0;w80*c){f=b=s[0],g=w=s[1];for(var ee=c;eeb&&(b=T),I>w&&(w=I);L=(L=Math.max(b-f,w-g))!==0?32767/L:0}return Su(H,J,c,f,g,L,0),J}function __(s,i,c,f,g){var b,w;if(g===_p(s,i,c,f)>0)for(b=i;b=i;b-=f)w=b_(b,s[b],s[b+1],w);return w&&yf(w,w.next)&&(Tu(w),w=w.next),w}function Ha(s,i){if(!s)return s;i||(i=s);var c,f=s;do if(c=!1,f.steiner||!yf(f,f.next)&&Tn(f.prev,f,f.next)!==0)f=f.next;else{if(Tu(f),(f=i=f.prev)===f.next)break;c=!0}while(c||f!==i);return i}function Su(s,i,c,f,g,b,w){if(s){!w&&b&&function(F,j,H,J){var ee=F;do ee.z===0&&(ee.z=mp(ee.x,ee.y,j,H,J)),ee.prevZ=ee.prev,ee.nextZ=ee.next,ee=ee.next;while(ee!==F);ee.prevZ.nextZ=null,ee.prevZ=null,function(ae){var ge,xe,De,ke,Ae,Je,Qe,kt,zt=1;do{for(xe=ae,ae=null,Ae=null,Je=0;xe;){for(Je++,De=xe,Qe=0,ge=0;ge0||kt>0&&De;)Qe!==0&&(kt===0||!De||xe.z<=De.z)?(ke=xe,xe=xe.nextZ,Qe--):(ke=De,De=De.nextZ,kt--),Ae?Ae.nextZ=ke:ae=ke,ke.prevZ=Ae,Ae=ke;xe=De}Ae.nextZ=null,zt*=2}while(Je>1)}(ee)}(s,f,g,b);for(var T,I,L=s;s.prev!==s.next;)if(T=s.prev,I=s.next,b?e2(s,f,g,b):Qx(s))i.push(T.i/c|0),i.push(s.i/c|0),i.push(I.i/c|0),Tu(s),s=I.next,L=I.next;else if((s=I)===L){w?w===1?Su(s=t2(Ha(s),i,c),i,c,f,g,b,2):w===2&&r2(s,i,c,f,g,b):Su(Ha(s),i,c,f,g,b,1);break}}}function Qx(s){var i=s.prev,c=s,f=s.next;if(Tn(i,c,f)>=0)return!1;for(var g=i.x,b=c.x,w=f.x,T=i.y,I=c.y,L=f.y,F=gb?g>w?g:w:b>w?b:w,J=T>I?T>L?T:L:I>L?I:L,ee=f.next;ee!==i;){if(ee.x>=F&&ee.x<=H&&ee.y>=j&&ee.y<=J&&Xl(g,T,b,I,w,L,ee.x,ee.y)&&Tn(ee.prev,ee,ee.next)>=0)return!1;ee=ee.next}return!0}function e2(s,i,c,f){var g=s.prev,b=s,w=s.next;if(Tn(g,b,w)>=0)return!1;for(var T=g.x,I=b.x,L=w.x,F=g.y,j=b.y,H=w.y,J=TI?T>L?T:L:I>L?I:L,ge=F>j?F>H?F:H:j>H?j:H,xe=mp(J,ee,i,c,f),De=mp(ae,ge,i,c,f),ke=s.prevZ,Ae=s.nextZ;ke&&ke.z>=xe&&Ae&&Ae.z<=De;){if(ke.x>=J&&ke.x<=ae&&ke.y>=ee&&ke.y<=ge&&ke!==g&&ke!==w&&Xl(T,F,I,j,L,H,ke.x,ke.y)&&Tn(ke.prev,ke,ke.next)>=0||(ke=ke.prevZ,Ae.x>=J&&Ae.x<=ae&&Ae.y>=ee&&Ae.y<=ge&&Ae!==g&&Ae!==w&&Xl(T,F,I,j,L,H,Ae.x,Ae.y)&&Tn(Ae.prev,Ae,Ae.next)>=0))return!1;Ae=Ae.nextZ}for(;ke&&ke.z>=xe;){if(ke.x>=J&&ke.x<=ae&&ke.y>=ee&&ke.y<=ge&&ke!==g&&ke!==w&&Xl(T,F,I,j,L,H,ke.x,ke.y)&&Tn(ke.prev,ke,ke.next)>=0)return!1;ke=ke.prevZ}for(;Ae&&Ae.z<=De;){if(Ae.x>=J&&Ae.x<=ae&&Ae.y>=ee&&Ae.y<=ge&&Ae!==g&&Ae!==w&&Xl(T,F,I,j,L,H,Ae.x,Ae.y)&&Tn(Ae.prev,Ae,Ae.next)>=0)return!1;Ae=Ae.nextZ}return!0}function t2(s,i,c){var f=s;do{var g=f.prev,b=f.next.next;!yf(g,b)&&y_(g,f,f.next,b)&&ku(g,b)&&ku(b,g)&&(i.push(g.i/c|0),i.push(f.i/c|0),i.push(b.i/c|0),Tu(f),Tu(f.next),f=s=b),f=f.next}while(f!==s);return Ha(f)}function r2(s,i,c,f,g,b){var w=s;do{for(var T=w.next.next;T!==w.prev;){if(w.i!==T.i&&a2(w,T)){var I=v_(w,T);return w=Ha(w,w.next),I=Ha(I,I.next),Su(w,i,c,f,g,b,0),void Su(I,i,c,f,g,b,0)}T=T.next}w=w.next}while(w!==s)}function n2(s,i){return s.x-i.x}function i2(s,i){var c=function(g,b){var w,T=b,I=g.x,L=g.y,F=-1/0;do{if(L<=T.y&&L>=T.next.y&&T.next.y!==T.y){var j=T.x+(L-T.y)*(T.next.x-T.x)/(T.next.y-T.y);if(j<=I&&j>F&&(F=j,w=T.x=T.x&&T.x>=ee&&I!==T.x&&Xl(Lw.x||T.x===w.x&&o2(w,T)))&&(w=T,ge=H)),T=T.next;while(T!==J);return w}(s,i);if(!c)return i;var f=v_(c,s);return Ha(f,f.next),Ha(c,c.next)}function o2(s,i){return Tn(s.prev,s,i.prev)<0&&Tn(i.next,s,s.next)<0}function mp(s,i,c,f,g){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-c)*g|0)|s<<8))|s<<4))|s<<2))|s<<1))|(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-f)*g|0)|i<<8))|i<<4))|i<<2))|i<<1))<<1}function s2(s){var i=s,c=s;do(i.x=(s-w)*(b-T)&&(s-w)*(f-T)>=(c-w)*(i-T)&&(c-w)*(b-T)>=(g-w)*(f-T)}function a2(s,i){return s.next.i!==i.i&&s.prev.i!==i.i&&!function(c,f){var g=c;do{if(g.i!==c.i&&g.next.i!==c.i&&g.i!==f.i&&g.next.i!==f.i&&y_(g,g.next,c,f))return!0;g=g.next}while(g!==c);return!1}(s,i)&&(ku(s,i)&&ku(i,s)&&function(c,f){var g=c,b=!1,w=(c.x+f.x)/2,T=(c.y+f.y)/2;do g.y>T!=g.next.y>T&&g.next.y!==g.y&&w<(g.next.x-g.x)*(T-g.y)/(g.next.y-g.y)+g.x&&(b=!b),g=g.next;while(g!==c);return b}(s,i)&&(Tn(s.prev,s,i.prev)||Tn(s,i.prev,i))||yf(s,i)&&Tn(s.prev,s,s.next)>0&&Tn(i.prev,i,i.next)>0)}function Tn(s,i,c){return(i.y-s.y)*(c.x-i.x)-(i.x-s.x)*(c.y-i.y)}function yf(s,i){return s.x===i.x&&s.y===i.y}function y_(s,i,c,f){var g=bf(Tn(s,i,c)),b=bf(Tn(s,i,f)),w=bf(Tn(c,f,s)),T=bf(Tn(c,f,i));return g!==b&&w!==T||!(g!==0||!vf(s,c,i))||!(b!==0||!vf(s,f,i))||!(w!==0||!vf(c,s,f))||!(T!==0||!vf(c,i,f))}function vf(s,i,c){return i.x<=Math.max(s.x,c.x)&&i.x>=Math.min(s.x,c.x)&&i.y<=Math.max(s.y,c.y)&&i.y>=Math.min(s.y,c.y)}function bf(s){return s>0?1:s<0?-1:0}function ku(s,i){return Tn(s.prev,s,s.next)<0?Tn(s,i,s.next)>=0&&Tn(s,s.prev,i)>=0:Tn(s,i,s.prev)<0||Tn(s,s.next,i)<0}function v_(s,i){var c=new gp(s.i,s.x,s.y),f=new gp(i.i,i.x,i.y),g=s.next,b=i.prev;return s.next=i,i.prev=s,c.next=g,g.prev=c,f.next=c,c.prev=f,b.next=f,f.prev=b,f}function b_(s,i,c,f){var g=new gp(s,i,c);return f?(g.next=f.next,g.prev=f,f.next.prev=g,f.next=g):(g.prev=g,g.next=g),g}function Tu(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function gp(s,i,c){this.i=s,this.x=i,this.y=c,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _p(s,i,c,f){for(var g=0,b=i,w=c-f;b0&&c.holes.push(f+=s[g-1].length)}return c};var w_=_(pp.exports);function l2(s,i,c,f,g){x_(s,i,c||0,f||s.length-1,g||c2)}function x_(s,i,c,f,g){for(;f>c;){if(f-c>600){var b=f-c+1,w=i-c+1,T=Math.log(b),I=.5*Math.exp(2*T/3),L=.5*Math.sqrt(T*I*(b-I)/b)*(w-b/2<0?-1:1);x_(s,i,Math.max(c,Math.floor(i-w*I/b+L)),Math.min(f,Math.floor(i+(b-w)*I/b+L)),g)}var F=s[i],j=c,H=f;for(Eu(s,c,i),g(s[f],F)>0&&Eu(s,c,f);j0;)H--}g(s[c],F)===0?Eu(s,c,H):Eu(s,++H,f),H<=i&&(c=H+1),i<=H&&(f=H-1)}}function Eu(s,i,c){var f=s[i];s[i]=s[c],s[c]=f}function c2(s,i){return si?1:0}function yp(s,i){const c=s.length;if(c<=1)return[s];const f=[];let g,b;for(let w=0;w1)for(let w=0;wc.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new he,this.indexArray=new $e,this.indexArray2=new nt,this.programConfigurations=new sn(i.layers,i.zoom),this.segments=new gt,this.segments2=new gt,this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,f){this.hasPattern=vp("fill",this.layers,c);const g=this.layers[0].layout.get("fill-sort-key"),b=!g.isConstant(),w=[];for(const{feature:T,id:I,index:L,sourceLayerIndex:F}of i){const j=this.layers[0]._featureFilter.needGeometry,H=xs(T,j);if(!this.layers[0]._featureFilter.filter(new Qr(this.zoom),H,f))continue;const J=b?g.evaluate(H,{},f,c.availableImages):void 0,ee={id:I,properties:T.properties,type:T.type,sourceLayerIndex:F,index:L,geometry:j?H.geometry:ws(T),patterns:{},sortKey:J};w.push(ee)}b&&w.sort((T,I)=>T.sortKey-I.sortKey);for(const T of w){const{geometry:I,index:L,sourceLayerIndex:F}=T;if(this.hasPattern){const j=bp("fill",this.layers,T,this.zoom,c);this.patternFeatures.push(j)}else this.addFeature(T,I,L,f,{});c.featureIndex.insert(i[L].feature,I,L,F,this.index)}}update(i,c,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,f)}addFeatures(i,c,f){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,c,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,Yx),this.indexBuffer=i.createIndexBuffer(this.indexArray),this.indexBuffer2=i.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(i),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(i,c,f,g,b){for(const w of yp(c,500)){let T=0;for(const J of w)T+=J.length;const I=this.segments.prepareSegment(T,this.layoutVertexArray,this.indexArray),L=I.vertexLength,F=[],j=[];for(const J of w){if(J.length===0)continue;J!==w[0]&&j.push(F.length/2);const ee=this.segments2.prepareSegment(J.length,this.layoutVertexArray,this.indexArray2),ae=ee.vertexLength;this.layoutVertexArray.emplaceBack(J[0].x,J[0].y),this.indexArray2.emplaceBack(ae+J.length-1,ae),F.push(J[0].x),F.push(J[0].y);for(let ge=1;ge>3}if(g--,f===1||f===2)b+=s.readSVarint(),w+=s.readSVarint(),f===1&&(i&&T.push(i),i=[]),i.push(new g2(b,w));else{if(f!==7)throw new Error("unknown command "+f);i&&i.push(i[0].clone())}}return i&&T.push(i),T},Kl.prototype.bbox=function(){var s=this._pbf;s.pos=this._geometry;for(var i=s.readVarint()+s.pos,c=1,f=0,g=0,b=0,w=1/0,T=-1/0,I=1/0,L=-1/0;s.pos>3}if(f--,c===1||c===2)(g+=s.readSVarint())T&&(T=g),(b+=s.readSVarint())L&&(L=b);else if(c!==7)throw new Error("unknown command "+c)}return[w,I,T,L]},Kl.prototype.toGeoJSON=function(s,i,c){var f,g,b=this.extent*Math.pow(2,c),w=this.extent*s,T=this.extent*i,I=this.loadGeometry(),L=Kl.types[this.type];function F(J){for(var ee=0;ee>3;g=w===1?f.readString():w===2?f.readFloat():w===3?f.readDouble():w===4?f.readVarint64():w===5?f.readVarint():w===6?f.readSVarint():w===7?f.readBoolean():null}return g}(c))}M_.prototype.feature=function(s){if(s<0||s>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[s];var i=this._pbf.readVarint()+this._pbf.pos;return new v2(this._pbf,i,this.extent,this._keys,this._values)};var w2=E_;function x2(s,i,c){if(s===3){var f=new w2(c,c.readVarint()+c.pos);f.length&&(i[f.name]=f)}}Ys.VectorTile=function(s,i){this.layers=s.readFields(x2,{},i)},Ys.VectorTileFeature=T_,Ys.VectorTileLayer=E_;const S2=Ys.VectorTileFeature.types,xp=Math.pow(2,13);function Mu(s,i,c,f,g,b,w,T){s.emplaceBack(i,c,2*Math.floor(f*xp)+w,g*xp*2,b*xp*2,Math.round(T))}class Sp{constructor(i){this.zoom=i.zoom,this.overscaling=i.overscaling,this.layers=i.layers,this.layerIds=this.layers.map(c=>c.id),this.index=i.index,this.hasPattern=!1,this.layoutVertexArray=new ue,this.centroidVertexArray=new q,this.indexArray=new $e,this.programConfigurations=new sn(i.layers,i.zoom),this.segments=new gt,this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,f){this.features=[],this.hasPattern=vp("fill-extrusion",this.layers,c);for(const{feature:g,id:b,index:w,sourceLayerIndex:T}of i){const I=this.layers[0]._featureFilter.needGeometry,L=xs(g,I);if(!this.layers[0]._featureFilter.filter(new Qr(this.zoom),L,f))continue;const F={id:b,sourceLayerIndex:T,index:w,geometry:I?L.geometry:ws(g),properties:g.properties,type:g.type,patterns:{}};this.hasPattern?this.features.push(bp("fill-extrusion",this.layers,F,this.zoom,c)):this.addFeature(F,F.geometry,w,f,{}),c.featureIndex.insert(g,F.geometry,w,T,this.index,!0)}}addFeatures(i,c,f){for(const g of this.features){const{geometry:b}=g;this.addFeature(g,b,g.index,c,f)}}update(i,c,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,f)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,m2),this.centroidVertexBuffer=i.createVertexBuffer(this.centroidVertexArray,p2.members,!0),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(i,c,f,g,b){const w={x:0,y:0,vertexCount:0};for(const T of yp(c,500)){let I=0;for(const ee of T)I+=ee.length;let L=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const ee of T){if(ee.length===0||T2(ee))continue;let ae=0;for(let ge=0;ge=1){const De=ee[ge-1];if(!k2(xe,De)){L.vertexLength+4>gt.MAX_VERTEX_ARRAY_LENGTH&&(L=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ke=xe.sub(De)._perp()._unit(),Ae=De.dist(xe);ae+Ae>32768&&(ae=0),Mu(this.layoutVertexArray,xe.x,xe.y,ke.x,ke.y,0,0,ae),Mu(this.layoutVertexArray,xe.x,xe.y,ke.x,ke.y,0,1,ae),w.x+=2*xe.x,w.y+=2*xe.y,w.vertexCount+=2,ae+=Ae,Mu(this.layoutVertexArray,De.x,De.y,ke.x,ke.y,0,0,ae),Mu(this.layoutVertexArray,De.x,De.y,ke.x,ke.y,0,1,ae),w.x+=2*De.x,w.y+=2*De.y,w.vertexCount+=2;const Je=L.vertexLength;this.indexArray.emplaceBack(Je,Je+2,Je+1),this.indexArray.emplaceBack(Je+1,Je+2,Je+3),L.vertexLength+=4,L.primitiveLength+=2}}}}if(L.vertexLength+I>gt.MAX_VERTEX_ARRAY_LENGTH&&(L=this.segments.prepareSegment(I,this.layoutVertexArray,this.indexArray)),S2[i.type]!=="Polygon")continue;const F=[],j=[],H=L.vertexLength;for(const ee of T)if(ee.length!==0){ee!==T[0]&&j.push(F.length/2);for(let ae=0;aeyn)||s.y===i.y&&(s.y<0||s.y>yn)}function T2(s){return s.every(i=>i.x<0)||s.every(i=>i.x>yn)||s.every(i=>i.y<0)||s.every(i=>i.y>yn)}let C_;Mt("FillExtrusionBucket",Sp,{omit:["layers","features"]});var E2={get paint(){return C_=C_||new Si({"fill-extrusion-opacity":new Bt(ne["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Gt(ne["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Bt(ne["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Bt(ne["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Fl(ne["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Gt(ne["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Gt(ne["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Bt(ne["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class M2 extends so{constructor(i){super(i,E2)}createBucket(i){return new Sp(i)}queryRadius(){return pf(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(i,c,f,g,b,w,T,I){const L=mf(i,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),w.angle,T),F=this.paint.get("fill-extrusion-height").evaluate(c,f),j=this.paint.get("fill-extrusion-base").evaluate(c,f),H=function(ee,ae,ge,xe){const De=[];for(const ke of ee){const Ae=[ke.x,ke.y,0,1];gf(Ae,Ae,ae),De.push(new k(Ae[0]/Ae[3],Ae[1]/Ae[3]))}return De}(L,I),J=function(ee,ae,ge,xe){const De=[],ke=[],Ae=xe[8]*ae,Je=xe[9]*ae,Qe=xe[10]*ae,kt=xe[11]*ae,zt=xe[8]*ge,St=xe[9]*ge,bt=xe[10]*ge,dt=xe[11]*ge;for(const At of ee){const yt=[],at=[];for(const qt of At){const Dt=qt.x,mr=qt.y,Xr=xe[0]*Dt+xe[4]*mr+xe[12],tn=xe[1]*Dt+xe[5]*mr+xe[13],jn=xe[2]*Dt+xe[6]*mr+xe[14],Yi=xe[3]*Dt+xe[7]*mr+xe[15],Ti=jn+Qe,zn=Yi+kt,Yn=Xr+zt,ai=tn+St,Ei=jn+bt,Mi=Yi+dt,Un=new k((Xr+Ae)/zn,(tn+Je)/zn);Un.z=Ti/zn,yt.push(Un);const Vn=new k(Yn/Mi,ai/Mi);Vn.z=Ei/Mi,at.push(Vn)}De.push(yt),ke.push(at)}return[De,ke]}(g,j,F,I);return function(ee,ae,ge){let xe=1/0;_u(ge,ae)&&(xe=I_(ge,ae[0]));for(let De=0;Dec.id),this.index=i.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(c=>{this.gradients[c.id]={}}),this.layoutVertexArray=new ye,this.layoutVertexArray2=new se,this.indexArray=new $e,this.programConfigurations=new sn(i.layers,i.zoom),this.segments=new gt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(c=>c.isStateDependent()).map(c=>c.id)}populate(i,c,f){this.hasPattern=vp("line",this.layers,c);const g=this.layers[0].layout.get("line-sort-key"),b=!g.isConstant(),w=[];for(const{feature:T,id:I,index:L,sourceLayerIndex:F}of i){const j=this.layers[0]._featureFilter.needGeometry,H=xs(T,j);if(!this.layers[0]._featureFilter.filter(new Qr(this.zoom),H,f))continue;const J=b?g.evaluate(H,{},f):void 0,ee={id:I,properties:T.properties,type:T.type,sourceLayerIndex:F,index:L,geometry:j?H.geometry:ws(T),patterns:{},sortKey:J};w.push(ee)}b&&w.sort((T,I)=>T.sortKey-I.sortKey);for(const T of w){const{geometry:I,index:L,sourceLayerIndex:F}=T;if(this.hasPattern){const j=bp("line",this.layers,T,this.zoom,c);this.patternFeatures.push(j)}else this.addFeature(T,I,L,f,{});c.featureIndex.insert(i[L].feature,I,L,F,this.index)}}update(i,c,f){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(i,c,this.stateDependentLayers,f)}addFeatures(i,c,f){for(const g of this.patternFeatures)this.addFeature(g,g.geometry,g.index,c,f)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(i){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=i.createVertexBuffer(this.layoutVertexArray2,L2)),this.layoutVertexBuffer=i.createVertexBuffer(this.layoutVertexArray,I2),this.indexBuffer=i.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(i),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(i){if(i.properties&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(i.properties,"mapbox_clip_end"))return{start:+i.properties.mapbox_clip_start,end:+i.properties.mapbox_clip_end}}addFeature(i,c,f,g,b){const w=this.layers[0].layout,T=w.get("line-join").evaluate(i,{}),I=w.get("line-cap"),L=w.get("line-miter-limit"),F=w.get("line-round-limit");this.lineClips=this.lineFeatureClips(i);for(const j of c)this.addLine(j,i,T,I,L,F);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,i,f,b,g)}addLine(i,c,f,g,b,w){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let xe=0;xe=2&&i[I-1].equals(i[I-2]);)I--;let L=0;for(;L0;if(kt&&xe>L){const dt=H.dist(J);if(dt>2*F){const At=H.sub(H.sub(J)._mult(F/dt)._round());this.updateDistance(J,At),this.addCurrentVertex(At,ae,0,0,j),J=At}}const St=J&ⅇlet bt=St?f:T?"butt":g;if(St&&bt==="round"&&(Jeb&&(bt="bevel"),bt==="bevel"&&(Je>2&&(bt="flipbevel"),Je100)De=ge.mult(-1);else{const dt=Je*ae.add(ge).mag()/ae.sub(ge).mag();De._perp()._mult(dt*(zt?-1:1))}this.addCurrentVertex(H,De,0,0,j),this.addCurrentVertex(H,De.mult(-1),0,0,j)}else if(bt==="bevel"||bt==="fakeround"){const dt=-Math.sqrt(Je*Je-1),At=zt?dt:0,yt=zt?0:dt;if(J&&this.addCurrentVertex(H,ae,At,yt,j),bt==="fakeround"){const at=Math.round(180*Qe/Math.PI/20);for(let qt=1;qt2*F){const At=H.add(ee.sub(H)._mult(F/dt)._round());this.updateDistance(H,At),this.addCurrentVertex(At,ge,0,0,j),H=At}}}}addCurrentVertex(i,c,f,g,b,w=!1){const T=c.y*g-c.x,I=-c.y-c.x*g;this.addHalfVertex(i,c.x+c.y*f,c.y-c.x*f,w,!1,f,b),this.addHalfVertex(i,T,I,w,!0,-g,b),this.distance>A_/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(i,c,f,g,b,w))}addHalfVertex({x:i,y:c},f,g,b,w,T,I){const L=.5*(this.lineClips?this.scaledDistance*(A_-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((i<<1)+(b?1:0),(c<<1)+(w?1:0),Math.round(63*f)+128,Math.round(63*g)+128,1+(T===0?0:T<0?-1:1)|(63&L)<<2,L>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const F=I.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,F),I.primitiveLength++),w?this.e2=F:this.e1=F}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(i,c){this.distance+=i.dist(c),this.updateScaledDistance()}}let L_,P_;Mt("LineBucket",kp,{omit:["layers","patternFeatures"]});var z_={get paint(){return P_=P_||new Si({"line-opacity":new Gt(ne.paint_line["line-opacity"]),"line-color":new Gt(ne.paint_line["line-color"]),"line-translate":new Bt(ne.paint_line["line-translate"]),"line-translate-anchor":new Bt(ne.paint_line["line-translate-anchor"]),"line-width":new Gt(ne.paint_line["line-width"]),"line-gap-width":new Gt(ne.paint_line["line-gap-width"]),"line-offset":new Gt(ne.paint_line["line-offset"]),"line-blur":new Gt(ne.paint_line["line-blur"]),"line-dasharray":new ja(ne.paint_line["line-dasharray"]),"line-pattern":new Fl(ne.paint_line["line-pattern"]),"line-gradient":new su(ne.paint_line["line-gradient"])})},get layout(){return L_=L_||new Si({"line-cap":new Bt(ne.layout_line["line-cap"]),"line-join":new Gt(ne.layout_line["line-join"]),"line-miter-limit":new Bt(ne.layout_line["line-miter-limit"]),"line-round-limit":new Bt(ne.layout_line["line-round-limit"]),"line-sort-key":new Gt(ne.layout_line["line-sort-key"])})}};class D2 extends Gt{possiblyEvaluate(i,c){return c=new Qr(Math.floor(c.zoom),{now:c.now,fadeDuration:c.fadeDuration,zoomHistory:c.zoomHistory,transition:c.transition}),super.possiblyEvaluate(i,c)}evaluate(i,c,f,g){return c=X({},c,{zoom:Math.floor(c.zoom)}),super.evaluate(i,c,f,g)}}let wf;class R2 extends so{constructor(i){super(i,z_),this.gradientVersion=0,wf||(wf=new D2(z_.paint.properties["line-width"].specification),wf.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(i){if(i==="line-gradient"){const c=this.gradientExpression();this.stepInterpolant=!!function(f){return f._styleExpression!==void 0}(c)&&c._styleExpression.expression instanceof Pa,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(i,c){super.recalculate(i,c),this.paint._values["line-floorwidth"]=wf.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,i)}createBucket(i){return new kp(i)}queryRadius(i){const c=i,f=D_(bu("line-width",this,c),bu("line-gap-width",this,c)),g=bu("line-offset",this,c);return f/2+Math.abs(g)+pf(this.paint.get("line-translate"))}queryIntersectsFeature(i,c,f,g,b,w,T){const I=mf(i,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),w.angle,T),L=T/2*D_(this.paint.get("line-width").evaluate(c,f),this.paint.get("line-gap-width").evaluate(c,f)),F=this.paint.get("line-offset").evaluate(c,f);return F&&(g=function(j,H){const J=[];for(let ee=0;ee=3){for(let ge=0;ge0?i+2*s:s}const B2=kn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),F2=kn([{name:"a_projected_pos",components:3,type:"Float32"}],4);kn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const O2=kn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);kn([{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 R_=kn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),N2=kn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function j2(s,i,c){return s.sections.forEach(f=>{f.text=function(g,b,w){const T=b.layout.get("text-transform").evaluate(w,{});return T==="uppercase"?g=g.toLocaleUpperCase():T==="lowercase"&&(g=g.toLocaleLowerCase()),es.applyArabicShaping&&(g=es.applyArabicShaping(g)),g}(f.text,i,c)}),s}kn([{name:"triangle",components:3,type:"Uint16"}]),kn([{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"}]),kn([{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"}]),kn([{type:"Float32",name:"offsetX"}]),kn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),kn([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Iu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Nn=24,B_=Br,F_=function(s,i,c,f,g){var b,w,T=8*g-f-1,I=(1<>1,F=-7,j=c?g-1:0,H=c?-1:1,J=s[i+j];for(j+=H,b=J&(1<<-F)-1,J>>=-F,F+=T;F>0;b=256*b+s[i+j],j+=H,F-=8);for(w=b&(1<<-F)-1,b>>=-F,F+=f;F>0;w=256*w+s[i+j],j+=H,F-=8);if(b===0)b=1-L;else{if(b===I)return w?NaN:1/0*(J?-1:1);w+=Math.pow(2,f),b-=L}return(J?-1:1)*w*Math.pow(2,b-f)},O_=function(s,i,c,f,g,b){var w,T,I,L=8*b-g-1,F=(1<>1,H=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,J=f?0:b-1,ee=f?1:-1,ae=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(T=isNaN(i)?1:0,w=F):(w=Math.floor(Math.log(i)/Math.LN2),i*(I=Math.pow(2,-w))<1&&(w--,I*=2),(i+=w+j>=1?H/I:H*Math.pow(2,1-j))*I>=2&&(w++,I/=2),w+j>=F?(T=0,w=F):w+j>=1?(T=(i*I-1)*Math.pow(2,g),w+=j):(T=i*Math.pow(2,j-1)*Math.pow(2,g),w=0));g>=8;s[c+J]=255&T,J+=ee,T/=256,g-=8);for(w=w<0;s[c+J]=255&w,J+=ee,w/=256,L-=8);s[c+J-ee]|=128*ae};function Br(s){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(s)?s:new Uint8Array(s||0),this.pos=0,this.type=0,this.length=this.buf.length}Br.Varint=0,Br.Fixed64=1,Br.Bytes=2,Br.Fixed32=5;var Tp=4294967296,N_=1/Tp,j_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ss(s){return s.type===Br.Bytes?s.readVarint()+s.pos:s.pos+1}function Jl(s,i,c){return c?4294967296*i+(s>>>0):4294967296*(i>>>0)+(s>>>0)}function U_(s,i,c){var f=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));c.realloc(f);for(var g=c.pos-1;g>=s;g--)c.buf[g+f]=c.buf[g]}function U2(s,i){for(var c=0;c>>8,s[c+2]=i>>>16,s[c+3]=i>>>24}function V_(s,i){return(s[i]|s[i+1]<<8|s[i+2]<<16)+(s[i+3]<<24)}Br.prototype={destroy:function(){this.buf=null},readFields:function(s,i,c){for(c=c||this.length;this.pos>3,b=this.pos;this.type=7&f,s(g,i,this),this.pos===b&&this.skip(f)}return i},readMessage:function(s,i){return this.readFields(s,i,this.readVarint()+this.pos)},readFixed32:function(){var s=xf(this.buf,this.pos);return this.pos+=4,s},readSFixed32:function(){var s=V_(this.buf,this.pos);return this.pos+=4,s},readFixed64:function(){var s=xf(this.buf,this.pos)+xf(this.buf,this.pos+4)*Tp;return this.pos+=8,s},readSFixed64:function(){var s=xf(this.buf,this.pos)+V_(this.buf,this.pos+4)*Tp;return this.pos+=8,s},readFloat:function(){var s=F_(this.buf,this.pos,!0,23,4);return this.pos+=4,s},readDouble:function(){var s=F_(this.buf,this.pos,!0,52,8);return this.pos+=8,s},readVarint:function(s){var i,c,f=this.buf;return i=127&(c=f[this.pos++]),c<128?i:(i|=(127&(c=f[this.pos++]))<<7,c<128?i:(i|=(127&(c=f[this.pos++]))<<14,c<128?i:(i|=(127&(c=f[this.pos++]))<<21,c<128?i:function(g,b,w){var T,I,L=w.buf;if(T=(112&(I=L[w.pos++]))>>4,I<128||(T|=(127&(I=L[w.pos++]))<<3,I<128)||(T|=(127&(I=L[w.pos++]))<<10,I<128)||(T|=(127&(I=L[w.pos++]))<<17,I<128)||(T|=(127&(I=L[w.pos++]))<<24,I<128)||(T|=(1&(I=L[w.pos++]))<<31,I<128))return Jl(g,T,b);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&(c=f[this.pos]))<<28,s,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var s=this.readVarint();return s%2==1?(s+1)/-2:s/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var s=this.readVarint()+this.pos,i=this.pos;return this.pos=s,s-i>=12&&j_?function(c,f,g){return j_.decode(c.subarray(f,g))}(this.buf,i,s):function(c,f,g){for(var b="",w=f;w239?4:F>223?3:F>191?2:1;if(w+H>g)break;H===1?F<128&&(j=F):H===2?(192&(T=c[w+1]))==128&&(j=(31&F)<<6|63&T)<=127&&(j=null):H===3?(I=c[w+2],(192&(T=c[w+1]))==128&&(192&I)==128&&((j=(15&F)<<12|(63&T)<<6|63&I)<=2047||j>=55296&&j<=57343)&&(j=null)):H===4&&(I=c[w+2],L=c[w+3],(192&(T=c[w+1]))==128&&(192&I)==128&&(192&L)==128&&((j=(15&F)<<18|(63&T)<<12|(63&I)<<6|63&L)<=65535||j>=1114112)&&(j=null)),j===null?(j=65533,H=1):j>65535&&(j-=65536,b+=String.fromCharCode(j>>>10&1023|55296),j=56320|1023&j),b+=String.fromCharCode(j),w+=H}return b}(this.buf,i,s)},readBytes:function(){var s=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,s);return this.pos=s,i},readPackedVarint:function(s,i){if(this.type!==Br.Bytes)return s.push(this.readVarint(i));var c=Ss(this);for(s=s||[];this.pos127;);else if(i===Br.Bytes)this.pos=this.readVarint()+this.pos;else if(i===Br.Fixed32)this.pos+=4;else{if(i!==Br.Fixed64)throw new Error("Unimplemented type: "+i);this.pos+=8}},writeTag:function(s,i){this.writeVarint(s<<3|i)},realloc:function(s){for(var i=this.length||16;i268435455||s<0?function(i,c){var f,g;if(i>=0?(f=i%4294967296|0,g=i/4294967296|0):(g=~(-i/4294967296),4294967295^(f=~(-i%4294967296))?f=f+1|0:(f=0,g=g+1|0)),i>=18446744073709552e3||i<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");c.realloc(10),function(b,w,T){T.buf[T.pos++]=127&b|128,b>>>=7,T.buf[T.pos++]=127&b|128,b>>>=7,T.buf[T.pos++]=127&b|128,b>>>=7,T.buf[T.pos++]=127&b|128,T.buf[T.pos]=127&(b>>>=7)}(f,0,c),function(b,w){var T=(7&b)<<4;w.buf[w.pos++]|=T|((b>>>=3)?128:0),b&&(w.buf[w.pos++]=127&b|((b>>>=7)?128:0),b&&(w.buf[w.pos++]=127&b|((b>>>=7)?128:0),b&&(w.buf[w.pos++]=127&b|((b>>>=7)?128:0),b&&(w.buf[w.pos++]=127&b|((b>>>=7)?128:0),b&&(w.buf[w.pos++]=127&b)))))}(g,c)}(s,this):(this.realloc(4),this.buf[this.pos++]=127&s|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=127&(s>>>=7)|(s>127?128:0),s<=127||(this.buf[this.pos++]=s>>>7&127))))},writeSVarint:function(s){this.writeVarint(s<0?2*-s-1:2*s)},writeBoolean:function(s){this.writeVarint(!!s)},writeString:function(s){s=String(s),this.realloc(4*s.length),this.pos++;var i=this.pos;this.pos=function(f,g,b){for(var w,T,I=0;I55295&&w<57344){if(!T){w>56319||I+1===g.length?(f[b++]=239,f[b++]=191,f[b++]=189):T=w;continue}if(w<56320){f[b++]=239,f[b++]=191,f[b++]=189,T=w;continue}w=T-55296<<10|w-56320|65536,T=null}else T&&(f[b++]=239,f[b++]=191,f[b++]=189,T=null);w<128?f[b++]=w:(w<2048?f[b++]=w>>6|192:(w<65536?f[b++]=w>>12|224:(f[b++]=w>>18|240,f[b++]=w>>12&63|128),f[b++]=w>>6&63|128),f[b++]=63&w|128)}return b}(this.buf,s,this.pos);var c=this.pos-i;c>=128&&U_(i,c,this),this.pos=i-1,this.writeVarint(c),this.pos+=c},writeFloat:function(s){this.realloc(4),O_(this.buf,s,this.pos,!0,23,4),this.pos+=4},writeDouble:function(s){this.realloc(8),O_(this.buf,s,this.pos,!0,52,8),this.pos+=8},writeBytes:function(s){var i=s.length;this.writeVarint(i),this.realloc(i);for(var c=0;c=128&&U_(c,f,this),this.pos=c-1,this.writeVarint(f),this.pos+=f},writeMessage:function(s,i,c){this.writeTag(s,Br.Bytes),this.writeRawMessage(i,c)},writePackedVarint:function(s,i){i.length&&this.writeMessage(s,U2,i)},writePackedSVarint:function(s,i){i.length&&this.writeMessage(s,V2,i)},writePackedBoolean:function(s,i){i.length&&this.writeMessage(s,W2,i)},writePackedFloat:function(s,i){i.length&&this.writeMessage(s,q2,i)},writePackedDouble:function(s,i){i.length&&this.writeMessage(s,G2,i)},writePackedFixed32:function(s,i){i.length&&this.writeMessage(s,Z2,i)},writePackedSFixed32:function(s,i){i.length&&this.writeMessage(s,H2,i)},writePackedFixed64:function(s,i){i.length&&this.writeMessage(s,$2,i)},writePackedSFixed64:function(s,i){i.length&&this.writeMessage(s,X2,i)},writeBytesField:function(s,i){this.writeTag(s,Br.Bytes),this.writeBytes(i)},writeFixed32Field:function(s,i){this.writeTag(s,Br.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(s,i){this.writeTag(s,Br.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(s,i){this.writeTag(s,Br.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(s,i){this.writeTag(s,Br.Fixed64),this.writeSFixed64(i)},writeVarintField:function(s,i){this.writeTag(s,Br.Varint),this.writeVarint(i)},writeSVarintField:function(s,i){this.writeTag(s,Br.Varint),this.writeSVarint(i)},writeStringField:function(s,i){this.writeTag(s,Br.Bytes),this.writeString(i)},writeFloatField:function(s,i){this.writeTag(s,Br.Fixed32),this.writeFloat(i)},writeDoubleField:function(s,i){this.writeTag(s,Br.Fixed64),this.writeDouble(i)},writeBooleanField:function(s,i){this.writeVarintField(s,!!i)}};var Ep=_(B_);const Mp=3;function K2(s,i,c){s===1&&c.readMessage(J2,i)}function J2(s,i,c){if(s===3){const{id:f,bitmap:g,width:b,height:w,left:T,top:I,advance:L}=c.readMessage(Y2,{});i.push({id:f,bitmap:new xu({width:b+2*Mp,height:w+2*Mp},g),metrics:{width:b,height:w,left:T,top:I,advance:L}})}}function Y2(s,i,c){s===1?i.id=c.readVarint():s===2?i.bitmap=c.readBytes():s===3?i.width=c.readVarint():s===4?i.height=c.readVarint():s===5?i.left=c.readSVarint():s===6?i.top=c.readSVarint():s===7&&(i.advance=c.readVarint())}const q_=Mp;function G_(s){let i=0,c=0;for(const w of s)i+=w.w*w.h,c=Math.max(c,w.w);s.sort((w,T)=>T.h-w.h);const f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(i/.95)),c),h:1/0}];let g=0,b=0;for(const w of s)for(let T=f.length-1;T>=0;T--){const I=f[T];if(!(w.w>I.w||w.h>I.h)){if(w.x=I.x,w.y=I.y,b=Math.max(b,w.y+w.h),g=Math.max(g,w.x+w.w),w.w===I.w&&w.h===I.h){const L=f.pop();T=0&&f>=i&&kf[this.text.charCodeAt(f)];f--)c--;this.text=this.text.substring(i,c),this.sectionIndex=this.sectionIndex.slice(i,c)}substring(i,c){const f=new Ql;return f.text=this.text.substring(i,c),f.sectionIndex=this.sectionIndex.slice(i,c),f.sections=this.sections,f}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((i,c)=>Math.max(i,this.sections[c].scale),0)}addTextSection(i,c){this.text+=i.text,this.sections.push(Lu.forText(i.scale,i.fontStack||c));const f=this.sections.length-1;for(let g=0;g=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Sf(s,i,c,f,g,b,w,T,I,L,F,j,H,J,ee,ae){const ge=Ql.fromFeature(s,g);let xe;j===d.ah.vertical&&ge.verticalizePunctuation();const{processBidirectionalText:De,processStyledBidirectionalText:ke}=es;if(De&&ge.sections.length===1){xe=[];const Qe=De(ge.toString(),Ip(ge,L,b,i,f,J,ee));for(const kt of Qe){const zt=new Ql;zt.text=kt,zt.sections=ge.sections;for(let St=0;St0&&Ts>Ui&&(Ui=Ts)}else{const co=zt[yr.fontStack],qi=co&&co[li];if(qi&&qi.rect)No=qi.rect,xo=qi.metrics;else{const Ts=kt[yr.fontStack],Bu=Ts&&Ts[li];if(!Bu)continue;xo=Bu.metrics}Gn=(Vn-yr.scale)*Nn}So?(Qe.verticalizable=!0,gi.push({glyph:li,imageName:jo,x:Xr,y:tn+Gn,vertical:So,scale:yr.scale,fontStack:yr.fontStack,sectionIndex:_i,metrics:xo,rect:No}),Xr+=ks*yr.scale+qt):(gi.push({glyph:li,imageName:jo,x:Xr,y:tn+Gn,vertical:So,scale:yr.scale,fontStack:yr.fontStack,sectionIndex:_i,metrics:xo,rect:No}),Xr+=xo.advance*yr.scale+qt)}gi.length!==0&&(jn=Math.max(Xr-qt,jn),tS(gi,0,gi.length-1,Ti,Ui)),Xr=0;const Vi=dt*Vn+Ui;Ci.lineOffset=Math.max(Ui,mi),tn+=Vi,Yi=Math.max(Vi,Yi),++zn}var Yn;const ai=tn-Au,{horizontalAlign:Ei,verticalAlign:Mi}=Ap(At);(function(Un,Vn,mi,Ci,gi,Ui,Vi,qn,yr){const _i=(Vn-mi)*gi;let li=0;li=Ui!==Vi?-qn*Ci-Au:(-Ci*yr+.5)*Vi;for(const Gn of Un)for(const xo of Gn.positionedGlyphs)xo.x+=_i,xo.y+=li})(Qe.positionedLines,Ti,Ei,Mi,jn,Yi,dt,ai,bt.length),Qe.top+=-Mi*ai,Qe.bottom=Qe.top+ai,Qe.left+=-Ei*jn,Qe.right=Qe.left+jn}(Je,i,c,f,xe,w,T,I,j,L,H,ae),!function(Qe){for(const kt of Qe)if(kt.positionedGlyphs.length!==0)return!1;return!0}(Ae)&&Je}const kf={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Q2={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 Z_(s,i,c,f,g,b){if(i.imageName){const w=f[i.imageName];return w?w.displaySize[0]*i.scale*Nn/b+g:0}{const w=c[i.fontStack],T=w&&w[s];return T?T.metrics.advance*i.scale+g:0}}function H_(s,i,c,f){const g=Math.pow(s-i,2);return f?s=0;let F=0;for(let H=0;Hw.id),this.index=i.index,this.pixelRatio=i.pixelRatio,this.sourceLayerIndex=i.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=hp([]),this.placementViewportMatrix=hp([]);const c=this.layers[0]._unevaluatedLayout._values;this.textSizeData=J_(this.zoom,c["text-size"]),this.iconSizeData=J_(this.zoom,c["icon-size"]);const f=this.layers[0].layout,g=f.get("symbol-sort-key"),b=f.get("symbol-z-order");this.canOverlap=Lp(f,"text-overlap","text-allow-overlap")!=="never"||Lp(f,"icon-overlap","icon-allow-overlap")!=="never"||f.get("text-ignore-placement")||f.get("icon-ignore-placement"),this.sortFeaturesByKey=b!=="viewport-y"&&!g.isConstant(),this.sortFeaturesByY=(b==="viewport-y"||b==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,f.get("symbol-placement")==="point"&&(this.writingModes=f.get("text-writing-mode").map(w=>d.ah[w])),this.stateDependentLayerIds=this.layers.filter(w=>w.isStateDependent()).map(w=>w.id),this.sourceID=i.sourceID}createArrays(){this.text=new zp(new sn(this.layers,this.zoom,i=>/^text/.test(i))),this.icon=new zp(new sn(this.layers,this.zoom,i=>/^icon/.test(i))),this.glyphOffsetArray=new v,this.lineVertexArray=new E,this.symbolInstances=new m,this.textAnchorOffsets=new A}calculateGlyphDependencies(i,c,f,g,b){for(let w=0;w0)&&(w.value.kind!=="constant"||w.value.value.length>0),F=I.value.kind!=="constant"||!!I.value.value||Object.keys(I.parameters).length>0,j=b.get("symbol-sort-key");if(this.features=[],!L&&!F)return;const H=c.iconDependencies,J=c.glyphDependencies,ee=c.availableImages,ae=new Qr(this.zoom);for(const{feature:ge,id:xe,index:De,sourceLayerIndex:ke}of i){const Ae=g._featureFilter.needGeometry,Je=xs(ge,Ae);if(!g._featureFilter.filter(ae,Je,f))continue;let Qe,kt;if(Ae||(Je.geometry=ws(ge)),L){const St=g.getValueAndResolveTokens("text-field",Je,f,ee),bt=Ri.factory(St),dt=this.hasRTLText=this.hasRTLText||oS(bt);(!dt||es.getRTLTextPluginStatus()==="unavailable"||dt&&es.isParsed())&&(Qe=j2(bt,g,Je))}if(F){const St=g.getValueAndResolveTokens("icon-image",Je,f,ee);kt=St instanceof Xi?St:Xi.fromString(St)}if(!Qe&&!kt)continue;const zt=this.sortFeaturesByKey?j.evaluate(Je,{},f):void 0;if(this.features.push({id:xe,text:Qe,icon:kt,index:De,sourceLayerIndex:ke,geometry:Je.geometry,properties:ge.properties,type:nS[ge.type],sortKey:zt}),kt&&(H[kt.name]=!0),Qe){const St=w.evaluate(Je,{},f).join(","),bt=b.get("text-rotation-alignment")!=="viewport"&&b.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(d.ah.vertical)>=0;for(const dt of Qe.sections)if(dt.image)H[dt.image.name]=!0;else{const At=Ks(Qe.toString()),yt=dt.fontStack||St,at=J[yt]=J[yt]||{};this.calculateGlyphDependencies(dt.text,at,bt,this.allowVerticalPlacement,At)}}}b.get("symbol-placement")==="line"&&(this.features=function(ge){const xe={},De={},ke=[];let Ae=0;function Je(St){ke.push(ge[St]),Ae++}function Qe(St,bt,dt){const At=De[St];return delete De[St],De[bt]=At,ke[At].geometry[0].pop(),ke[At].geometry[0]=ke[At].geometry[0].concat(dt[0]),At}function kt(St,bt,dt){const At=xe[bt];return delete xe[bt],xe[St]=At,ke[At].geometry[0].shift(),ke[At].geometry[0]=dt[0].concat(ke[At].geometry[0]),At}function zt(St,bt,dt){const At=dt?bt[0][bt[0].length-1]:bt[0][0];return`${St}:${At.x}:${At.y}`}for(let St=0;StSt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ge,xe)=>ge.sortKey-xe.sortKey)}update(i,c,f){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(i,c,this.layers,f),this.icon.programConfigurations.updatePaintArrays(i,c,this.layers,f))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(i){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(i),this.iconCollisionBox.upload(i)),this.text.upload(i,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(i,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(i,c){const f=this.lineVertexArray.length;if(i.segment!==void 0){let g=i.dist(c[i.segment+1]),b=i.dist(c[i.segment]);const w={};for(let T=i.segment+1;T=0;T--)w[T]={x:c[T].x,y:c[T].y,tileUnitDistanceFromAnchor:b},T>0&&(b+=c[T-1].dist(c[T]));for(let T=0;T0}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(i,c){const f=i.placedSymbolArray.get(c),g=f.vertexStartIndex+4*f.numGlyphs;for(let b=f.vertexStartIndex;bg[T]-g[I]||b[I]-b[T]),w}addToSortKeyRanges(i,c){const f=this.sortKeyRanges[this.sortKeyRanges.length-1];f&&f.sortKey===c?f.symbolInstanceEnd=i+1:this.sortKeyRanges.push({sortKey:c,symbolInstanceStart:i,symbolInstanceEnd:i+1})}sortFeatures(i){if(this.sortFeaturesByY&&this.sortedAngle!==i&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(i),this.sortedAngle=i,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const c of this.symbolInstanceIndexes){const f=this.symbolInstances.get(c);this.featureSortOrder.push(f.featureIndex),[f.rightJustifiedTextSymbolIndex,f.centerJustifiedTextSymbolIndex,f.leftJustifiedTextSymbolIndex].forEach((g,b,w)=>{g>=0&&w.indexOf(g)===b&&this.addIndicesForPlacedSymbol(this.text,g)}),f.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,f.verticalPlacedTextSymbolIndex),f.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.placedIconSymbolIndex),f.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,f.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Y_,Q_;Mt("SymbolBucket",ec,{omit:["layers","collisionBoxArray","features","compareText"]}),ec.MAX_GLYPHS=65535,ec.addDynamicAttributes=Pp;var Rp={get paint(){return Q_=Q_||new Si({"icon-opacity":new Gt(ne.paint_symbol["icon-opacity"]),"icon-color":new Gt(ne.paint_symbol["icon-color"]),"icon-halo-color":new Gt(ne.paint_symbol["icon-halo-color"]),"icon-halo-width":new Gt(ne.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Gt(ne.paint_symbol["icon-halo-blur"]),"icon-translate":new Bt(ne.paint_symbol["icon-translate"]),"icon-translate-anchor":new Bt(ne.paint_symbol["icon-translate-anchor"]),"text-opacity":new Gt(ne.paint_symbol["text-opacity"]),"text-color":new Gt(ne.paint_symbol["text-color"],{runtimeType:Nr,getOverride:s=>s.textColor,hasOverride:s=>!!s.textColor}),"text-halo-color":new Gt(ne.paint_symbol["text-halo-color"]),"text-halo-width":new Gt(ne.paint_symbol["text-halo-width"]),"text-halo-blur":new Gt(ne.paint_symbol["text-halo-blur"]),"text-translate":new Bt(ne.paint_symbol["text-translate"]),"text-translate-anchor":new Bt(ne.paint_symbol["text-translate-anchor"])})},get layout(){return Y_=Y_||new Si({"symbol-placement":new Bt(ne.layout_symbol["symbol-placement"]),"symbol-spacing":new Bt(ne.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Bt(ne.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Gt(ne.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Bt(ne.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Bt(ne.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Bt(ne.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Bt(ne.layout_symbol["icon-ignore-placement"]),"icon-optional":new Bt(ne.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Bt(ne.layout_symbol["icon-rotation-alignment"]),"icon-size":new Gt(ne.layout_symbol["icon-size"]),"icon-text-fit":new Bt(ne.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Bt(ne.layout_symbol["icon-text-fit-padding"]),"icon-image":new Gt(ne.layout_symbol["icon-image"]),"icon-rotate":new Gt(ne.layout_symbol["icon-rotate"]),"icon-padding":new Gt(ne.layout_symbol["icon-padding"]),"icon-keep-upright":new Bt(ne.layout_symbol["icon-keep-upright"]),"icon-offset":new Gt(ne.layout_symbol["icon-offset"]),"icon-anchor":new Gt(ne.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Bt(ne.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Bt(ne.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Bt(ne.layout_symbol["text-rotation-alignment"]),"text-field":new Gt(ne.layout_symbol["text-field"]),"text-font":new Gt(ne.layout_symbol["text-font"]),"text-size":new Gt(ne.layout_symbol["text-size"]),"text-max-width":new Gt(ne.layout_symbol["text-max-width"]),"text-line-height":new Bt(ne.layout_symbol["text-line-height"]),"text-letter-spacing":new Gt(ne.layout_symbol["text-letter-spacing"]),"text-justify":new Gt(ne.layout_symbol["text-justify"]),"text-radial-offset":new Gt(ne.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Bt(ne.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Gt(ne.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Gt(ne.layout_symbol["text-anchor"]),"text-max-angle":new Bt(ne.layout_symbol["text-max-angle"]),"text-writing-mode":new Bt(ne.layout_symbol["text-writing-mode"]),"text-rotate":new Gt(ne.layout_symbol["text-rotate"]),"text-padding":new Bt(ne.layout_symbol["text-padding"]),"text-keep-upright":new Bt(ne.layout_symbol["text-keep-upright"]),"text-transform":new Gt(ne.layout_symbol["text-transform"]),"text-offset":new Gt(ne.layout_symbol["text-offset"]),"text-allow-overlap":new Bt(ne.layout_symbol["text-allow-overlap"]),"text-overlap":new Bt(ne.layout_symbol["text-overlap"]),"text-ignore-placement":new Bt(ne.layout_symbol["text-ignore-placement"]),"text-optional":new Bt(ne.layout_symbol["text-optional"])})}};class ey{constructor(i){if(i.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=i.property.overrides?i.property.overrides.runtimeType:Or,this.defaultValue=i}evaluate(i){if(i.formattedSection){const c=this.defaultValue.property.overrides;if(c&&c.hasOverride(i.formattedSection))return c.getOverride(i.formattedSection)}return i.feature&&i.featureState?this.defaultValue.evaluate(i.feature,i.featureState):this.defaultValue.property.specification.default}eachChild(i){this.defaultValue.isConstant()||i(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Mt("FormatSectionOverride",ey,{omit:["defaultValue"]});class Ef extends so{constructor(i){super(i,Rp)}recalculate(i,c){if(super.recalculate(i,c),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 f=this.layout.get("text-writing-mode");if(f){const g=[];for(const b of f)g.indexOf(b)<0&&g.push(b);this.layout._values["text-writing-mode"]=g}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(i,c,f,g){const b=this.layout.get(i).evaluate(c,{},f,g),w=this._unevaluatedLayout._values[i];return w.isDataDriven()||jr(w.value)||!b?b:function(T,I){return I.replace(/{([^{}]+)}/g,(L,F)=>T&&F in T?String(T[F]):"")}(c.properties,b)}createBucket(i){return new ec(i)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const i of Rp.paint.overridableProperties){if(!Ef.hasPaintOverride(this.layout,i))continue;const c=this.paint.get(i),f=new ey(c),g=new $r(f,c.property.specification);let b=null;b=c.value.kind==="constant"||c.value.kind==="source"?new Sl("source",g):new Xc("composite",g,c.value.zoomStops),this.paint._values[i]=new oo(c.property,b,c.parameters)}}_handleOverridablePaintPropertyUpdate(i,c,f){return!(!this.layout||c.isDataDriven()||f.isDataDriven())&&Ef.hasPaintOverride(this.layout,i)}static hasPaintOverride(i,c){const f=i.get("text-field"),g=Rp.paint.properties[c];let b=!1;const w=T=>{for(const I of T)if(g.overrides&&g.overrides.hasOverride(I))return void(b=!0)};if(f.value.kind==="constant"&&f.value.value instanceof Ri)w(f.value.value.sections);else if(f.value.kind==="source"){const T=L=>{b||(L instanceof Xo&&In(L.value)===an?w(L.value.sections):L instanceof wl?w(L.sections):L.eachChild(T))},I=f.value;I._styleExpression&&T(I._styleExpression.expression)}return b}}let ty;var sS={get paint(){return ty=ty||new Si({"background-color":new Bt(ne.paint_background["background-color"]),"background-pattern":new ja(ne.paint_background["background-pattern"]),"background-opacity":new Bt(ne.paint_background["background-opacity"])})}};class aS extends so{constructor(i){super(i,sS)}}let ry;var lS={get paint(){return ry=ry||new Si({"raster-opacity":new Bt(ne.paint_raster["raster-opacity"]),"raster-hue-rotate":new Bt(ne.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Bt(ne.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Bt(ne.paint_raster["raster-brightness-max"]),"raster-saturation":new Bt(ne.paint_raster["raster-saturation"]),"raster-contrast":new Bt(ne.paint_raster["raster-contrast"]),"raster-resampling":new Bt(ne.paint_raster["raster-resampling"]),"raster-fade-duration":new Bt(ne.paint_raster["raster-fade-duration"])})}};class cS extends so{constructor(i){super(i,lS)}}class uS extends so{constructor(i){super(i,{}),this.onAdd=c=>{this.implementation.onAdd&&this.implementation.onAdd(c,c.painter.context.gl)},this.onRemove=c=>{this.implementation.onRemove&&this.implementation.onRemove(c,c.painter.context.gl)},this.implementation=i}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 hS{constructor(i){this._methodToThrottle=i,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Bp=63710088e-1;class ta{constructor(i,c){if(isNaN(i)||isNaN(c))throw new Error(`Invalid LngLat object: (${i}, ${c})`);if(this.lng=+i,this.lat=+c,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ta(me(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(i){const c=Math.PI/180,f=this.lat*c,g=i.lat*c,b=Math.sin(f)*Math.sin(g)+Math.cos(f)*Math.cos(g)*Math.cos((i.lng-this.lng)*c);return Bp*Math.acos(Math.min(b,1))}static convert(i){if(i instanceof ta)return i;if(Array.isArray(i)&&(i.length===2||i.length===3))return new ta(Number(i[0]),Number(i[1]));if(!Array.isArray(i)&&typeof i=="object"&&i!==null)return new ta(Number("lng"in i?i.lng:i.lon),Number(i.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 ny=2*Math.PI*Bp;function iy(s){return ny*Math.cos(s*Math.PI/180)}function oy(s){return(180+s)/360}function sy(s){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+s*Math.PI/360)))/360}function ay(s,i){return s/iy(i)}function Fp(s){return 360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90}class Mf{constructor(i,c,f=0){this.x=+i,this.y=+c,this.z=+f}static fromLngLat(i,c=0){const f=ta.convert(i);return new Mf(oy(f.lng),sy(f.lat),ay(c,f.lat))}toLngLat(){return new ta(360*this.x-180,Fp(this.y))}toAltitude(){return this.z*iy(Fp(this.y))}meterInMercatorCoordinateUnits(){return 1/ny*(i=Fp(this.y),1/Math.cos(i*Math.PI/180));var i}}function ly(s,i,c){var f=2*Math.PI*6378137/256/Math.pow(2,c);return[s*f-2*Math.PI*6378137/2,i*f-2*Math.PI*6378137/2]}class Op{constructor(i,c,f){if(i<0||i>25||f<0||f>=Math.pow(2,i)||c<0||c>=Math.pow(2,i))throw new Error(`x=${c}, y=${f}, z=${i} outside of bounds. 0<=x<${Math.pow(2,i)}, 0<=y<${Math.pow(2,i)} 0<=z<=25 `);this.z=i,this.x=c,this.y=f,this.key=zu(0,i,i,c,f)}equals(i){return this.z===i.z&&this.x===i.x&&this.y===i.y}url(i,c,f){const g=(w=this.y,T=this.z,I=ly(256*(b=this.x),256*(w=Math.pow(2,T)-w-1),T),L=ly(256*(b+1),256*(w+1),T),I[0]+","+I[1]+","+L[0]+","+L[1]);var b,w,T,I,L;const F=function(j,H,J){let ee,ae="";for(let ge=j;ge>0;ge--)ee=1<1?"@2x":"").replace(/{quadkey}/g,F).replace(/{bbox-epsg-3857}/g,g)}isChildOf(i){const c=this.z-i.z;return c>0&&i.x===this.x>>c&&i.y===this.y>>c}getTilePoint(i){const c=Math.pow(2,this.z);return new k((i.x*c-this.x)*yn,(i.y*c-this.y)*yn)}toString(){return`${this.z}/${this.x}/${this.y}`}}class cy{constructor(i,c){this.wrap=i,this.canonical=c,this.key=zu(i,c.z,c.z,c.x,c.y)}}class lo{constructor(i,c,f,g,b){if(i= z; overscaledZ = ${i}; z = ${f}`);this.overscaledZ=i,this.wrap=c,this.canonical=new Op(f,+g,+b),this.key=zu(c,i,f,g,b)}clone(){return new lo(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(i){return this.overscaledZ===i.overscaledZ&&this.wrap===i.wrap&&this.canonical.equals(i.canonical)}scaledTo(i){if(i>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${i}; overscaledZ = ${this.overscaledZ}`);const c=this.canonical.z-i;return i>this.canonical.z?new lo(i,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new lo(i,this.wrap,i,this.canonical.x>>c,this.canonical.y>>c)}calculateScaledKey(i,c){if(i>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${i}; overscaledZ = ${this.overscaledZ}`);const f=this.canonical.z-i;return i>this.canonical.z?zu(this.wrap*+c,i,this.canonical.z,this.canonical.x,this.canonical.y):zu(this.wrap*+c,i,i,this.canonical.x>>f,this.canonical.y>>f)}isChildOf(i){if(i.wrap!==this.wrap)return!1;const c=this.canonical.z-i.canonical.z;return i.overscaledZ===0||i.overscaledZ>c&&i.canonical.y===this.canonical.y>>c}children(i){if(this.overscaledZ>=i)return[new lo(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const c=this.canonical.z+1,f=2*this.canonical.x,g=2*this.canonical.y;return[new lo(c,this.wrap,c,f,g),new lo(c,this.wrap,c,f+1,g),new lo(c,this.wrap,c,f,g+1),new lo(c,this.wrap,c,f+1,g+1)]}isLessThan(i){return this.wrapi.wrap)&&(this.overscaledZi.overscaledZ)&&(this.canonical.xi.canonical.x)&&this.canonical.ythis.max&&(this.max=j),j=this.dim+1||c<-1||c>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(c+1)*this.stride+(i+1)}unpack(i,c,f){return i*this.redFactor+c*this.greenFactor+f*this.blueFactor-this.baseShift}getPixels(){return new ao({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(i,c,f){if(this.dim!==i.dim)throw new Error("dem dimension mismatch");let g=c*this.dim,b=c*this.dim+this.dim,w=f*this.dim,T=f*this.dim+this.dim;switch(c){case-1:g=b-1;break;case 1:b=g+1}switch(f){case-1:w=T-1;break;case 1:T=w+1}const I=-c*this.dim,L=-f*this.dim;for(let F=w;F=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${i} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[i]}}class fy{constructor(i,c,f,g,b){this.type="Feature",this._vectorTileFeature=i,i._z=c,i._x=f,i._y=g,this.properties=i.properties,this.id=b}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(i){this._geometry=i}toJSON(){const i={geometry:this.geometry};for(const c in this)c!=="_geometry"&&c!=="_vectorTileFeature"&&(i[c]=this[c]);return i}}class dy{constructor(i,c){this.tileID=i,this.x=i.canonical.x,this.y=i.canonical.y,this.z=i.canonical.z,this.grid=new Fa(yn,16,0),this.grid3D=new Fa(yn,16,0),this.featureIndexArray=new V,this.promoteId=c}insert(i,c,f,g,b,w){const T=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(f,g,b);const I=w?this.grid3D:this.grid;for(let L=0;L=0&&j[3]>=0&&I.insert(T,j[0],j[1],j[2],j[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ys.VectorTile(new Ep(this.rawTileData)).layers,this.sourceLayerCoder=new hy(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(i,c,f,g){this.loadVTLayers();const b=i.params||{},w=yn/i.tileSize/i.scale,T=Ml(b.filter),I=i.queryGeometry,L=i.queryPadding*w,F=my(I),j=this.grid.query(F.minX-L,F.minY-L,F.maxX+L,F.maxY+L),H=my(i.cameraQueryGeometry),J=this.grid3D.query(H.minX-L,H.minY-L,H.maxX+L,H.maxY+L,(ge,xe,De,ke)=>function(Ae,Je,Qe,kt,zt){for(const bt of Ae)if(Je<=bt.x&&Qe<=bt.y&&kt>=bt.x&&zt>=bt.y)return!0;const St=[new k(Je,Qe),new k(Je,zt),new k(kt,zt),new k(kt,Qe)];if(Ae.length>2){for(const bt of St)if(Hl(Ae,bt))return!0}for(let bt=0;bt(ke||(ke=ws(Ae)),Je.queryIntersectsFeature(I,Ae,Qe,ke,this.z,i.transform,w,i.pixelPosMatrix)))}return ee}loadMatchingFeature(i,c,f,g,b,w,T,I,L,F,j){const H=this.bucketLayerIDs[c];if(w&&!function(ge,xe){for(let De=0;De=0)return!0;return!1}(w,H))return;const J=this.sourceLayerCoder.decode(f),ee=this.vtLayers[J].feature(g);if(b.needGeometry){const ge=xs(ee,!0);if(!b.filter(new Qr(this.tileID.overscaledZ),ge,this.tileID.canonical))return}else if(!b.filter(new Qr(this.tileID.overscaledZ),ee))return;const ae=this.getId(ee,J);for(let ge=0;ge{const T=i instanceof Na?i.get(w):null;return T&&T.evaluate?T.evaluate(c,f,g):T})}function my(s){let i=1/0,c=1/0,f=-1/0,g=-1/0;for(const b of s)i=Math.min(i,b.x),c=Math.min(c,b.y),f=Math.max(f,b.x),g=Math.max(g,b.y);return{minX:i,minY:c,maxX:f,maxY:g}}function fS(s,i){return i-s}function gy(s,i,c,f,g){const b=[];for(let w=0;w=f&&j.x>=f||(F.x>=f?F=new k(f,F.y+(f-F.x)/(j.x-F.x)*(j.y-F.y))._round():j.x>=f&&(j=new k(f,F.y+(f-F.x)/(j.x-F.x)*(j.y-F.y))._round()),F.y>=g&&j.y>=g||(F.y>=g?F=new k(F.x+(g-F.y)/(j.y-F.y)*(j.x-F.x),g)._round():j.y>=g&&(j=new k(F.x+(g-F.y)/(j.y-F.y)*(j.x-F.x),g)._round()),I&&F.equals(I[I.length-1])||(I=[F],b.push(I)),I.push(j)))))}}return b}Mt("FeatureIndex",dy,{omit:["rawTileData","sourceLayerCoder"]});class ra extends k{constructor(i,c,f,g){super(i,c),this.angle=f,g!==void 0&&(this.segment=g)}clone(){return new ra(this.x,this.y,this.angle,this.segment)}}function _y(s,i,c,f,g){if(i.segment===void 0||c===0)return!0;let b=i,w=i.segment+1,T=0;for(;T>-c/2;){if(w--,w<0)return!1;T-=s[w].dist(b),b=s[w]}T+=s[w].dist(s[w+1]),w++;const I=[];let L=0;for(;Tf;)L-=I.shift().angleDelta;if(L>g)return!1;w++,T+=F.dist(j)}return!0}function yy(s){let i=0;for(let c=0;cL){const ee=(L-I)/J,ae=di.number(j.x,H.x,ee),ge=di.number(j.y,H.y,ee),xe=new ra(ae,ge,H.angleTo(j),F);return xe._round(),!w||_y(s,xe,T,w,i)?xe:void 0}I+=J}}function pS(s,i,c,f,g,b,w,T,I){const L=vy(f,b,w),F=by(f,g),j=F*w,H=s[0].x===0||s[0].x===I||s[0].y===0||s[0].y===I;return i-j=0&&Ae=0&&Je=0&&H+L<=F){const Qe=new ra(Ae,Je,De,ee);Qe._round(),f&&!_y(s,Qe,b,f,g)||J.push(Qe)}}j+=xe}return T||J.length||w||(J=wy(s,j/2,c,f,g,b,w,!0,I)),J}Mt("Anchor",ra);const tc=ji;function xy(s,i,c,f){const g=[],b=s.image,w=b.pixelRatio,T=b.paddedRect.w-2*tc,I=b.paddedRect.h-2*tc,L=s.right-s.left,F=s.bottom-s.top,j=b.stretchX||[[0,T]],H=b.stretchY||[[0,I]],J=(dt,At)=>dt+At[1]-At[0],ee=j.reduce(J,0),ae=H.reduce(J,0),ge=T-ee,xe=I-ae;let De=0,ke=ee,Ae=0,Je=ae,Qe=0,kt=ge,zt=0,St=xe;if(b.content&&f){const dt=b.content;De=Cf(j,0,dt[0]),Ae=Cf(H,0,dt[1]),ke=Cf(j,dt[0],dt[2]),Je=Cf(H,dt[1],dt[3]),Qe=dt[0]-De,zt=dt[1]-Ae,kt=dt[2]-dt[0]-ke,St=dt[3]-dt[1]-Je}const bt=(dt,At,yt,at)=>{const qt=If(dt.stretch-De,ke,L,s.left),Dt=Af(dt.fixed-Qe,kt,dt.stretch,ee),mr=If(At.stretch-Ae,Je,F,s.top),Xr=Af(At.fixed-zt,St,At.stretch,ae),tn=If(yt.stretch-De,ke,L,s.left),jn=Af(yt.fixed-Qe,kt,yt.stretch,ee),Yi=If(at.stretch-Ae,Je,F,s.top),Ti=Af(at.fixed-zt,St,at.stretch,ae),zn=new k(qt,mr),Yn=new k(tn,mr),ai=new k(tn,Yi),Ei=new k(qt,Yi),Mi=new k(Dt/w,Xr/w),Un=new k(jn/w,Ti/w),Vn=i*Math.PI/180;if(Vn){const gi=Math.sin(Vn),Ui=Math.cos(Vn),Vi=[Ui,-gi,gi,Ui];zn._matMult(Vi),Yn._matMult(Vi),Ei._matMult(Vi),ai._matMult(Vi)}const mi=dt.stretch+dt.fixed,Ci=At.stretch+At.fixed;return{tl:zn,tr:Yn,bl:Ei,br:ai,tex:{x:b.paddedRect.x+tc+mi,y:b.paddedRect.y+tc+Ci,w:yt.stretch+yt.fixed-mi,h:at.stretch+at.fixed-Ci},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Mi,pixelOffsetBR:Un,minFontScaleX:kt/w/L,minFontScaleY:St/w/F,isSDF:c}};if(f&&(b.stretchX||b.stretchY)){const dt=Sy(j,ge,ee),At=Sy(H,xe,ae);for(let yt=0;yt0&&(ee=Math.max(10,ee),this.circleDiameter=ee)}else{let j=w.top*T-I[0],H=w.bottom*T+I[2],J=w.left*T-I[3],ee=w.right*T+I[1];const ae=w.collisionPadding;if(ae&&(J-=ae[0]*T,j-=ae[1]*T,ee+=ae[2]*T,H+=ae[3]*T),F){const ge=new k(J,j),xe=new k(ee,j),De=new k(J,H),ke=new k(ee,H),Ae=F*Math.PI/180;ge._rotate(Ae),xe._rotate(Ae),De._rotate(Ae),ke._rotate(Ae),J=Math.min(ge.x,xe.x,De.x,ke.x),ee=Math.max(ge.x,xe.x,De.x,ke.x),j=Math.min(ge.y,xe.y,De.y,ke.y),H=Math.max(ge.y,xe.y,De.y,ke.y)}i.emplaceBack(c.x,c.y,J,j,ee,H,f,g,b)}this.boxEndIndex=i.length}}class mS{constructor(i=[],c=gS){if(this.data=i,this.length=this.data.length,this.compare=c,this.length>0)for(let f=(this.length>>1)-1;f>=0;f--)this._down(f)}push(i){this.data.push(i),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const i=this.data[0],c=this.data.pop();return this.length--,this.length>0&&(this.data[0]=c,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:c,compare:f}=this,g=c[i];for(;i>0;){const b=i-1>>1,w=c[b];if(f(g,w)>=0)break;c[i]=w,i=b}c[i]=g}_down(i){const{data:c,compare:f}=this,g=this.length>>1,b=c[i];for(;i=0)break;c[i]=T,i=w}c[i]=b}}function gS(s,i){return si?1:0}function _S(s,i=1,c=!1){let f=1/0,g=1/0,b=-1/0,w=-1/0;const T=s[0];for(let J=0;Jb)&&(b=ee.x),(!J||ee.y>w)&&(w=ee.y)}const I=Math.min(b-f,w-g);let L=I/2;const F=new mS([],yS);if(I===0)return new k(f,g);for(let J=f;Jj.d||!j.d)&&(j=J,c&&console.log("found best %d after %d probes",Math.round(1e4*J.d)/1e4,H)),J.max-j.d<=i||(L=J.h/2,F.push(new rc(J.p.x-L,J.p.y-L,L,s)),F.push(new rc(J.p.x+L,J.p.y-L,L,s)),F.push(new rc(J.p.x-L,J.p.y+L,L,s)),F.push(new rc(J.p.x+L,J.p.y+L,L,s)),H+=4)}return c&&(console.log(`num probes: ${H}`),console.log(`best distance: ${j.d}`)),j.p}function yS(s,i){return i.max-s.max}function rc(s,i,c,f){this.p=new k(s,i),this.h=c,this.d=function(g,b){let w=!1,T=1/0;for(let I=0;Ig.y!=ee.y>g.y&&g.x<(ee.x-J.x)*(g.y-J.y)/(ee.y-J.y)+J.x&&(w=!w),T=Math.min(T,s_(g,J,ee))}}return(w?1:-1)*Math.sqrt(T)}(this.p,f),this.max=this.d+this.h*Math.SQRT2}var si;d.ap=void 0,(si=d.ap||(d.ap={}))[si.center=1]="center",si[si.left=2]="left",si[si.right=3]="right",si[si.top=4]="top",si[si.bottom=5]="bottom",si[si["top-left"]=6]="top-left",si[si["top-right"]=7]="top-right",si[si["bottom-left"]=8]="bottom-left",si[si["bottom-right"]=9]="bottom-right";const na=7,Np=Number.POSITIVE_INFINITY;function ky(s,i){return i[1]!==Np?function(c,f,g){let b=0,w=0;switch(f=Math.abs(f),g=Math.abs(g),c){case"top-right":case"top-left":case"top":w=g-na;break;case"bottom-right":case"bottom-left":case"bottom":w=-g+na}switch(c){case"top-right":case"bottom-right":case"right":b=-f;break;case"top-left":case"bottom-left":case"left":b=f}return[b,w]}(s,i[0],i[1]):function(c,f){let g=0,b=0;f<0&&(f=0);const w=f/Math.SQRT2;switch(c){case"top-right":case"top-left":b=w-na;break;case"bottom-right":case"bottom-left":b=-w+na;break;case"bottom":b=-f+na;break;case"top":b=f-na}switch(c){case"top-right":case"bottom-right":g=-w;break;case"top-left":case"bottom-left":g=w;break;case"left":g=f;break;case"right":g=-f}return[g,b]}(s,i[0])}function Ty(s,i,c){var f;const g=s.layout,b=(f=g.get("text-variable-anchor-offset"))===null||f===void 0?void 0:f.evaluate(i,{},c);if(b){const T=b.values,I=[];for(let L=0;LH*Nn);F.startsWith("top")?j[1]-=na:F.startsWith("bottom")&&(j[1]+=na),I[L+1]=j}return new $i(I)}const w=g.get("text-variable-anchor");if(w){let T;T=s._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[g.get("text-radial-offset").evaluate(i,{},c)*Nn,Np]:g.get("text-offset").evaluate(i,{},c).map(L=>L*Nn);const I=[];for(const L of w)I.push(L,ky(L,T));return new $i(I)}return null}function jp(s){switch(s){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function vS(s,i,c,f,g,b,w,T,I,L,F){let j=b.textMaxSize.evaluate(i,{});j===void 0&&(j=w);const H=s.layers[0].layout,J=H.get("icon-offset").evaluate(i,{},F),ee=My(c.horizontal),ae=w/24,ge=s.tilePixelRatio*ae,xe=s.tilePixelRatio*j/24,De=s.tilePixelRatio*T,ke=s.tilePixelRatio*H.get("symbol-spacing"),Ae=H.get("text-padding")*s.tilePixelRatio,Je=function(at,qt,Dt,mr=1){const Xr=at.get("icon-padding").evaluate(qt,{},Dt),tn=Xr&&Xr.values;return[tn[0]*mr,tn[1]*mr,tn[2]*mr,tn[3]*mr]}(H,i,F,s.tilePixelRatio),Qe=H.get("text-max-angle")/180*Math.PI,kt=H.get("text-rotation-alignment")!=="viewport"&&H.get("symbol-placement")!=="point",zt=H.get("icon-rotation-alignment")==="map"&&H.get("symbol-placement")!=="point",St=H.get("symbol-placement"),bt=ke/2,dt=H.get("icon-text-fit");let At;f&&dt!=="none"&&(s.allowVerticalPlacement&&c.vertical&&(At=K_(f,c.vertical,dt,H.get("icon-text-fit-padding"),J,ae)),ee&&(f=K_(f,ee,dt,H.get("icon-text-fit-padding"),J,ae)));const yt=(at,qt)=>{qt.x<0||qt.x>=yn||qt.y<0||qt.y>=yn||function(Dt,mr,Xr,tn,jn,Yi,Ti,zn,Yn,ai,Ei,Mi,Un,Vn,mi,Ci,gi,Ui,Vi,qn,yr,_i,li,Gn,xo){const No=Dt.addToLineVertexArray(mr,Xr);let jo,ks,So,co,qi=0,Ts=0,Bu=0,Ly=0,$p=-1,Xp=-1;const Es={};let Py=hn("");if(Dt.allowVerticalPlacement&&tn.vertical){const yi=zn.layout.get("text-rotate").evaluate(yr,{},Gn)+90;So=new Lf(Yn,mr,ai,Ei,Mi,tn.vertical,Un,Vn,mi,yi),Ti&&(co=new Lf(Yn,mr,ai,Ei,Mi,Ti,gi,Ui,mi,yi))}if(jn){const yi=zn.layout.get("icon-rotate").evaluate(yr,{}),uo=zn.layout.get("icon-text-fit")!=="none",$a=xy(jn,yi,li,uo),Vo=Ti?xy(Ti,yi,li,uo):void 0;ks=new Lf(Yn,mr,ai,Ei,Mi,jn,gi,Ui,!1,yi),qi=4*$a.length;const Xa=Dt.iconSizeData;let os=null;Xa.kind==="source"?(os=[is*zn.layout.get("icon-size").evaluate(yr,{})],os[0]>ea&&Ze(`${Dt.layerIds[0]}: Value for "icon-size" is >= ${Pu}. Reduce your "icon-size".`)):Xa.kind==="composite"&&(os=[is*_i.compositeIconSizes[0].evaluate(yr,{},Gn),is*_i.compositeIconSizes[1].evaluate(yr,{},Gn)],(os[0]>ea||os[1]>ea)&&Ze(`${Dt.layerIds[0]}: Value for "icon-size" is >= ${Pu}. Reduce your "icon-size".`)),Dt.addSymbols(Dt.icon,$a,os,qn,Vi,yr,d.ah.none,mr,No.lineStartIndex,No.lineLength,-1,Gn),$p=Dt.icon.placedSymbolArray.length-1,Vo&&(Ts=4*Vo.length,Dt.addSymbols(Dt.icon,Vo,os,qn,Vi,yr,d.ah.vertical,mr,No.lineStartIndex,No.lineLength,-1,Gn),Xp=Dt.icon.placedSymbolArray.length-1)}const zy=Object.keys(tn.horizontal);for(const yi of zy){const uo=tn.horizontal[yi];if(!jo){Py=hn(uo.text);const Vo=zn.layout.get("text-rotate").evaluate(yr,{},Gn);jo=new Lf(Yn,mr,ai,Ei,Mi,uo,Un,Vn,mi,Vo)}const $a=uo.positionedLines.length===1;if(Bu+=Ey(Dt,mr,uo,Yi,zn,mi,yr,Ci,No,tn.vertical?d.ah.horizontal:d.ah.horizontalOnly,$a?zy:[yi],Es,$p,_i,Gn),$a)break}tn.vertical&&(Ly+=Ey(Dt,mr,tn.vertical,Yi,zn,mi,yr,Ci,No,d.ah.vertical,["vertical"],Es,Xp,_i,Gn));const xS=jo?jo.boxStartIndex:Dt.collisionBoxArray.length,SS=jo?jo.boxEndIndex:Dt.collisionBoxArray.length,kS=So?So.boxStartIndex:Dt.collisionBoxArray.length,TS=So?So.boxEndIndex:Dt.collisionBoxArray.length,ES=ks?ks.boxStartIndex:Dt.collisionBoxArray.length,MS=ks?ks.boxEndIndex:Dt.collisionBoxArray.length,CS=co?co.boxStartIndex:Dt.collisionBoxArray.length,IS=co?co.boxEndIndex:Dt.collisionBoxArray.length;let Uo=-1;const zf=(yi,uo)=>yi&&yi.circleDiameter?Math.max(yi.circleDiameter,uo):uo;Uo=zf(jo,Uo),Uo=zf(So,Uo),Uo=zf(ks,Uo),Uo=zf(co,Uo);const Dy=Uo>-1?1:0;Dy&&(Uo*=xo/Nn),Dt.glyphOffsetArray.length>=ec.MAX_GLYPHS&&Ze("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),yr.sortKey!==void 0&&Dt.addToSortKeyRanges(Dt.symbolInstances.length,yr.sortKey);const AS=Ty(zn,yr,Gn),[LS,PS]=function(yi,uo){const $a=yi.length,Vo=uo==null?void 0:uo.values;if((Vo==null?void 0:Vo.length)>0)for(let Xa=0;Xa=0?Es.right:-1,Es.center>=0?Es.center:-1,Es.left>=0?Es.left:-1,Es.vertical||-1,$p,Xp,Py,xS,SS,kS,TS,ES,MS,CS,IS,ai,Bu,Ly,qi,Ts,Dy,0,Un,Uo,LS,PS)}(s,qt,at,c,f,g,At,s.layers[0],s.collisionBoxArray,i.index,i.sourceLayerIndex,s.index,ge,[Ae,Ae,Ae,Ae],kt,I,De,Je,zt,J,i,b,L,F,w)};if(St==="line")for(const at of gy(i.geometry,0,0,yn,yn)){const qt=pS(at,ke,Qe,c.vertical||ee,f,24,xe,s.overscaling,yn);for(const Dt of qt)ee&&bS(s,ee.text,bt,Dt)||yt(at,Dt)}else if(St==="line-center"){for(const at of i.geometry)if(at.length>1){const qt=dS(at,Qe,c.vertical||ee,f,24,xe);qt&&yt(at,qt)}}else if(i.type==="Polygon")for(const at of yp(i.geometry,0)){const qt=_S(at,16);yt(at[0],new ra(qt.x,qt.y,0))}else if(i.type==="LineString")for(const at of i.geometry)yt(at,new ra(at[0].x,at[0].y,0));else if(i.type==="Point")for(const at of i.geometry)for(const qt of at)yt([qt],new ra(qt.x,qt.y,0))}function Ey(s,i,c,f,g,b,w,T,I,L,F,j,H,J,ee){const ae=function(De,ke,Ae,Je,Qe,kt,zt,St){const bt=Je.layout.get("text-rotate").evaluate(kt,{})*Math.PI/180,dt=[];for(const At of ke.positionedLines)for(const yt of At.positionedGlyphs){if(!yt.rect)continue;const at=yt.rect||{};let qt=q_+1,Dt=!0,mr=1,Xr=0;const tn=(Qe||St)&&yt.vertical,jn=yt.metrics.advance*yt.scale/2;if(St&&ke.verticalizable&&(Xr=At.lineOffset/2-(yt.imageName?-(Nn-yt.metrics.width*yt.scale)/2:(yt.scale-1)*Nn)),yt.imageName){const qn=zt[yt.imageName];Dt=qn.sdf,mr=qn.pixelRatio,qt=ji/mr}const Yi=Qe?[yt.x+jn,yt.y]:[0,0];let Ti=Qe?[0,0]:[yt.x+jn+Ae[0],yt.y+Ae[1]-Xr],zn=[0,0];tn&&(zn=Ti,Ti=[0,0]);const Yn=yt.metrics.isDoubleResolution?2:1,ai=(yt.metrics.left-qt)*yt.scale-jn+Ti[0],Ei=(-yt.metrics.top-qt)*yt.scale+Ti[1],Mi=ai+at.w/Yn*yt.scale/mr,Un=Ei+at.h/Yn*yt.scale/mr,Vn=new k(ai,Ei),mi=new k(Mi,Ei),Ci=new k(ai,Un),gi=new k(Mi,Un);if(tn){const qn=new k(-jn,jn-Au),yr=-Math.PI/2,_i=Nn/2-jn,li=new k(5-Au-_i,-(yt.imageName?_i:0)),Gn=new k(...zn);Vn._rotateAround(yr,qn)._add(li)._add(Gn),mi._rotateAround(yr,qn)._add(li)._add(Gn),Ci._rotateAround(yr,qn)._add(li)._add(Gn),gi._rotateAround(yr,qn)._add(li)._add(Gn)}if(bt){const qn=Math.sin(bt),yr=Math.cos(bt),_i=[yr,-qn,qn,yr];Vn._matMult(_i),mi._matMult(_i),Ci._matMult(_i),gi._matMult(_i)}const Ui=new k(0,0),Vi=new k(0,0);dt.push({tl:Vn,tr:mi,bl:Ci,br:gi,tex:at,writingMode:ke.writingMode,glyphOffset:Yi,sectionIndex:yt.sectionIndex,isSDF:Dt,pixelOffsetTL:Ui,pixelOffsetBR:Vi,minFontScaleX:0,minFontScaleY:0})}return dt}(0,c,T,g,b,w,f,s.allowVerticalPlacement),ge=s.textSizeData;let xe=null;ge.kind==="source"?(xe=[is*g.layout.get("text-size").evaluate(w,{})],xe[0]>ea&&Ze(`${s.layerIds[0]}: Value for "text-size" is >= ${Pu}. Reduce your "text-size".`)):ge.kind==="composite"&&(xe=[is*J.compositeTextSizes[0].evaluate(w,{},ee),is*J.compositeTextSizes[1].evaluate(w,{},ee)],(xe[0]>ea||xe[1]>ea)&&Ze(`${s.layerIds[0]}: Value for "text-size" is >= ${Pu}. Reduce your "text-size".`)),s.addSymbols(s.text,ae,xe,T,b,w,L,i,I.lineStartIndex,I.lineLength,H,ee);for(const De of F)j[De]=s.text.placedSymbolArray.length-1;return 4*ae.length}function My(s){for(const i in s)return s[i];return null}function bS(s,i,c,f){const g=s.compareText;if(i in g){const b=g[i];for(let w=b.length-1;w>=0;w--)if(f.dist(b[w])>4;if(g!==1)throw new Error(`Got v${g} data when expected v1.`);const b=Cy[15&f];if(!b)throw new Error("Unrecognized array type.");const[w]=new Uint16Array(i,2,1),[T]=new Uint32Array(i,4,1);return new Up(T,w,b,i)}constructor(i,c=64,f=Float64Array,g){if(isNaN(i)||i<0)throw new Error(`Unpexpected numItems value: ${i}.`);this.numItems=+i,this.nodeSize=Math.min(Math.max(+c,2),65535),this.ArrayType=f,this.IndexArrayType=i<65536?Uint16Array:Uint32Array;const b=Cy.indexOf(this.ArrayType),w=2*i*this.ArrayType.BYTES_PER_ELEMENT,T=i*this.IndexArrayType.BYTES_PER_ELEMENT,I=(8-T%8)%8;if(b<0)throw new Error(`Unexpected typed array class: ${f}.`);g&&g instanceof ArrayBuffer?(this.data=g,this.ids=new this.IndexArrayType(this.data,8,i),this.coords=new this.ArrayType(this.data,8+T+I,2*i),this._pos=2*i,this._finished=!0):(this.data=new ArrayBuffer(8+w+T+I),this.ids=new this.IndexArrayType(this.data,8,i),this.coords=new this.ArrayType(this.data,8+T+I,2*i),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+b]),new Uint16Array(this.data,2,1)[0]=c,new Uint32Array(this.data,4,1)[0]=i)}add(i,c){const f=this._pos>>1;return this.ids[f]=f,this.coords[this._pos++]=i,this.coords[this._pos++]=c,f}finish(){const i=this._pos>>1;if(i!==this.numItems)throw new Error(`Added ${i} items when expected ${this.numItems}.`);return Vp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(i,c,f,g){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:b,coords:w,nodeSize:T}=this,I=[0,b.length-1,0],L=[];for(;I.length;){const F=I.pop()||0,j=I.pop()||0,H=I.pop()||0;if(j-H<=T){for(let ge=H;ge<=j;ge++){const xe=w[2*ge],De=w[2*ge+1];xe>=i&&xe<=f&&De>=c&&De<=g&&L.push(b[ge])}continue}const J=H+j>>1,ee=w[2*J],ae=w[2*J+1];ee>=i&&ee<=f&&ae>=c&&ae<=g&&L.push(b[J]),(F===0?i<=ee:c<=ae)&&(I.push(H),I.push(J-1),I.push(1-F)),(F===0?f>=ee:g>=ae)&&(I.push(J+1),I.push(j),I.push(1-F))}return L}within(i,c,f){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:b,nodeSize:w}=this,T=[0,g.length-1,0],I=[],L=f*f;for(;T.length;){const F=T.pop()||0,j=T.pop()||0,H=T.pop()||0;if(j-H<=w){for(let ge=H;ge<=j;ge++)Ay(b[2*ge],b[2*ge+1],i,c)<=L&&I.push(g[ge]);continue}const J=H+j>>1,ee=b[2*J],ae=b[2*J+1];Ay(ee,ae,i,c)<=L&&I.push(g[J]),(F===0?i-f<=ee:c-f<=ae)&&(T.push(H),T.push(J-1),T.push(1-F)),(F===0?i+f>=ee:c+f>=ae)&&(T.push(J+1),T.push(j),T.push(1-F))}return I}}function Vp(s,i,c,f,g,b){if(g-f<=c)return;const w=f+g>>1;Iy(s,i,w,f,g,b),Vp(s,i,c,f,w-1,1-b),Vp(s,i,c,w+1,g,1-b)}function Iy(s,i,c,f,g,b){for(;g>f;){if(g-f>600){const L=g-f+1,F=c-f+1,j=Math.log(L),H=.5*Math.exp(2*j/3),J=.5*Math.sqrt(j*H*(L-H)/L)*(F-L/2<0?-1:1);Iy(s,i,c,Math.max(f,Math.floor(c-F*H/L+J)),Math.min(g,Math.floor(c+(L-F)*H/L+J)),b)}const w=i[2*c+b];let T=f,I=g;for(Du(s,i,f,c),i[2*g+b]>w&&Du(s,i,f,g);Tw;)I--}i[2*f+b]===w?Du(s,i,f,I):(I++,Du(s,i,I,g)),I<=c&&(f=I+1),c<=I&&(g=I-1)}}function Du(s,i,c,f){qp(s,c,f),qp(i,2*c,2*f),qp(i,2*c+1,2*f+1)}function qp(s,i,c){const f=s[i];s[i]=s[c],s[c]=f}function Ay(s,i,c,f){const g=s-c,b=i-f;return g*g+b*b}var Gp;d.bd=void 0,(Gp=d.bd||(d.bd={})).create="create",Gp.load="load",Gp.fullLoad="fullLoad";let Pf=null,Ru=[];const Wp=1e3/60,Zp="loadTime",Hp="fullLoadTime",wS={mark(s){performance.mark(s)},frame(s){const i=s;Pf!=null&&Ru.push(i-Pf),Pf=i},clearMetrics(){Pf=null,Ru=[],performance.clearMeasures(Zp),performance.clearMeasures(Hp);for(const s in d.bd)performance.clearMarks(d.bd[s])},getPerformanceMetrics(){performance.measure(Zp,d.bd.create,d.bd.load),performance.measure(Hp,d.bd.create,d.bd.fullLoad);const s=performance.getEntriesByName(Zp)[0].duration,i=performance.getEntriesByName(Hp)[0].duration,c=Ru.length,f=1/(Ru.reduce((b,w)=>b+w,0)/c/1e3),g=Ru.filter(b=>b>Wp).reduce((b,w)=>b+(w-Wp)/Wp,0);return{loadTime:s,fullLoadTime:i,fps:f,percentDroppedFrames:g/(c+g)*100,totalFrames:c}}};d.$=gt,d.A=$l,d.B=function(s){if(Ot==null){const i=s.navigator?s.navigator.userAgent:null;Ot=!!s.safari||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome")))}return Ot},d.C=class{constructor(s,i){this.target=s,this.mapId=i,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new hS(()=>this.process()),this.subscription=function(c,f,g,b){return c.addEventListener(f,g,!1),{unsubscribe:()=>{c.removeEventListener(f,g,!1)}}}(this.target,"message",c=>this.receive(c)),this.globalScope=It(self)?s:window}registerMessageHandler(s,i){this.messageHandlers[s]=i}sendAsync(s,i){return new Promise((c,f)=>{const g=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[g]={resolve:c,reject:f},i&&i.signal.addEventListener("abort",()=>{delete this.resolveRejects[g];const T={id:g,type:"",origin:location.origin,targetMapId:s.targetMapId,sourceMapId:this.mapId};this.target.postMessage(T)},{once:!0});const b=[],w=Object.assign(Object.assign({},s),{id:g,sourceMapId:this.mapId,origin:location.origin,data:$s(s.data,b)});this.target.postMessage(w,{transfer:b})})}receive(s){const i=s.data,c=i.id;if(!(i.origin!=="file://"&&location.origin!=="file://"&&i.origin!==location.origin||i.targetMapId&&this.mapId!==i.targetMapId)){if(i.type===""){delete this.tasks[c];const f=this.abortControllers[c];return delete this.abortControllers[c],void(f&&f.abort())}if(It(self)||i.mustQueue)return this.tasks[c]=i,this.taskQueue.push(c),void this.invoker.trigger();this.processTask(c,i)}}process(){if(this.taskQueue.length===0)return;const s=this.taskQueue.shift(),i=this.tasks[s];delete this.tasks[s],this.taskQueue.length>0&&this.invoker.trigger(),i&&this.processTask(s,i)}processTask(s,i){return a(this,void 0,void 0,function*(){if(i.type===""){const g=this.resolveRejects[s];return delete this.resolveRejects[s],g?void(i.error?g.reject(Xs(i.error)):g.resolve(Xs(i.data))):void 0}if(!this.messageHandlers[i.type])return void this.completeTask(s,new Error(`Could not find a registered handler for ${i.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const c=Xs(i.data),f=new AbortController;this.abortControllers[s]=f;try{const g=yield this.messageHandlers[i.type](i.sourceMapId,c,f);this.completeTask(s,null,g)}catch(g){this.completeTask(s,g)}})}completeTask(s,i,c){const f=[];delete this.abortControllers[s];const g={id:s,type:"",sourceMapId:this.mapId,origin:location.origin,error:i?$s(i):null,data:$s(c,f)};this.target.postMessage(g,{transfer:f})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},d.D=Bt,d.E=it,d.F=function(){var s=new $l(16);return $l!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s},d.G=nr,d.H=function(s,i,c){var f,g,b,w,T,I,L,F,j,H,J,ee,ae=c[0],ge=c[1],xe=c[2];return i===s?(s[12]=i[0]*ae+i[4]*ge+i[8]*xe+i[12],s[13]=i[1]*ae+i[5]*ge+i[9]*xe+i[13],s[14]=i[2]*ae+i[6]*ge+i[10]*xe+i[14],s[15]=i[3]*ae+i[7]*ge+i[11]*xe+i[15]):(g=i[1],b=i[2],w=i[3],T=i[4],I=i[5],L=i[6],F=i[7],j=i[8],H=i[9],J=i[10],ee=i[11],s[0]=f=i[0],s[1]=g,s[2]=b,s[3]=w,s[4]=T,s[5]=I,s[6]=L,s[7]=F,s[8]=j,s[9]=H,s[10]=J,s[11]=ee,s[12]=f*ae+T*ge+j*xe+i[12],s[13]=g*ae+I*ge+H*xe+i[13],s[14]=b*ae+L*ge+J*xe+i[14],s[15]=w*ae+F*ge+ee*xe+i[15]),s},d.I=Cp,d.J=function(s,i,c){var f=c[0],g=c[1],b=c[2];return s[0]=i[0]*f,s[1]=i[1]*f,s[2]=i[2]*f,s[3]=i[3]*f,s[4]=i[4]*g,s[5]=i[5]*g,s[6]=i[6]*g,s[7]=i[7]*g,s[8]=i[8]*b,s[9]=i[9]*b,s[10]=i[10]*b,s[11]=i[11]*b,s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15],s},d.K=u_,d.L=function(s,i){const c={};for(let f=0;f{const i=window.document.createElement("video");return i.muted=!0,new Promise(c=>{i.onloadstart=()=>{c(i)};for(const f of s){const g=window.document.createElement("source");Et(f)||(i.crossOrigin="Anonymous"),g.src=f,i.appendChild(g)}})},d.a3=function(){return Y++},d.a4=y,d.a5=ec,d.a6=Ml,d.a7=xs,d.a8=Qr,d.a9=fy,d.aA=re,d.aB=function(s,i){if(!s)return[{command:"setStyle",args:[i]}];let c=[];try{if(!Ye(s.version,i.version))return[{command:"setStyle",args:[i]}];Ye(s.center,i.center)||c.push({command:"setCenter",args:[i.center]}),Ye(s.zoom,i.zoom)||c.push({command:"setZoom",args:[i.zoom]}),Ye(s.bearing,i.bearing)||c.push({command:"setBearing",args:[i.bearing]}),Ye(s.pitch,i.pitch)||c.push({command:"setPitch",args:[i.pitch]}),Ye(s.sprite,i.sprite)||c.push({command:"setSprite",args:[i.sprite]}),Ye(s.glyphs,i.glyphs)||c.push({command:"setGlyphs",args:[i.glyphs]}),Ye(s.transition,i.transition)||c.push({command:"setTransition",args:[i.transition]}),Ye(s.light,i.light)||c.push({command:"setLight",args:[i.light]}),Ye(s.terrain,i.terrain)||c.push({command:"setTerrain",args:[i.terrain]}),Ye(s.sky,i.sky)||c.push({command:"setSky",args:[i.sky]});const f={},g=[];(function(w,T,I,L){let F;for(F in T=T||{},w=w||{})Object.prototype.hasOwnProperty.call(w,F)&&(Object.prototype.hasOwnProperty.call(T,F)||wn(F,I,L));for(F in T)Object.prototype.hasOwnProperty.call(T,F)&&(Object.prototype.hasOwnProperty.call(w,F)?Ye(w[F],T[F])||(w[F].type==="geojson"&&T[F].type==="geojson"&&ni(w,T,F)?Ut(I,{command:"setGeoJSONSourceData",args:[F,T[F].data]}):Mn(F,T,I,L)):bn(F,T,I))})(s.sources,i.sources,g,f);const b=[];s.layers&&s.layers.forEach(w=>{"source"in w&&f[w.source]?c.push({command:"removeLayer",args:[w.id]}):b.push(w)}),c=c.concat(g),function(w,T,I){T=T||[];const L=(w=w||[]).map($o),F=T.map($o),j=w.reduce(Jr,{}),H=T.reduce(Jr,{}),J=L.slice(),ee=Object.create(null);let ae,ge,xe,De,ke;for(let Ae=0,Je=0;Ae@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(c,f,g,b)=>{const w=g||b;return i[f]=!w||w.toLowerCase(),""}),i["max-age"]){const c=parseInt(i["max-age"],10);isNaN(c)?delete i["max-age"]:i["max-age"]=c}return i},d.ab=function(s,i){const c=[];for(const f in s)f in i||c.push(f);return c},d.ac=K,d.ad=function(s,i,c){var f=Math.sin(c),g=Math.cos(c),b=i[0],w=i[1],T=i[2],I=i[3],L=i[4],F=i[5],j=i[6],H=i[7];return i!==s&&(s[8]=i[8],s[9]=i[9],s[10]=i[10],s[11]=i[11],s[12]=i[12],s[13]=i[13],s[14]=i[14],s[15]=i[15]),s[0]=b*g+L*f,s[1]=w*g+F*f,s[2]=T*g+j*f,s[3]=I*g+H*f,s[4]=L*g-b*f,s[5]=F*g-w*f,s[6]=j*g-T*f,s[7]=H*g-I*f,s},d.ae=function(s){var i=new $l(16);return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i[4]=s[4],i[5]=s[5],i[6]=s[6],i[7]=s[7],i[8]=s[8],i[9]=s[9],i[10]=s[10],i[11]=s[11],i[12]=s[12],i[13]=s[13],i[14]=s[14],i[15]=s[15],i},d.af=gf,d.ag=function(s,i){let c=0,f=0;if(s.kind==="constant")f=s.layoutSize;else if(s.kind!=="source"){const{interpolationType:g,minZoom:b,maxZoom:w}=s,T=g?K(oi.interpolationFactor(g,i,b,w),0,1):0;s.kind==="camera"?f=di.number(s.minSize,s.maxSize,T):c=T}return{uSizeT:c,uSize:f}},d.ai=function(s,{uSize:i,uSizeT:c},{lowerSize:f,upperSize:g}){return s.kind==="source"?f/is:s.kind==="composite"?di.number(f/is,g/is,c):i},d.aj=Pp,d.ak=function(s,i,c,f){const g=i.y-s.y,b=i.x-s.x,w=f.y-c.y,T=f.x-c.x,I=w*b-T*g;if(I===0)return null;const L=(T*(s.y-c.y)-w*(s.x-c.x))/I;return new k(s.x+L*b,s.y+L*g)},d.al=gy,d.am=gu,d.an=hp,d.ao=Nn,d.aq=Lp,d.ar=function(s,i){var c=i[0],f=i[1],g=i[2],b=i[3],w=i[4],T=i[5],I=i[6],L=i[7],F=i[8],j=i[9],H=i[10],J=i[11],ee=i[12],ae=i[13],ge=i[14],xe=i[15],De=c*T-f*w,ke=c*I-g*w,Ae=c*L-b*w,Je=f*I-g*T,Qe=f*L-b*T,kt=g*L-b*I,zt=F*ae-j*ee,St=F*ge-H*ee,bt=F*xe-J*ee,dt=j*ge-H*ae,At=j*xe-J*ae,yt=H*xe-J*ge,at=De*yt-ke*At+Ae*dt+Je*bt-Qe*St+kt*zt;return at?(s[0]=(T*yt-I*At+L*dt)*(at=1/at),s[1]=(g*At-f*yt-b*dt)*at,s[2]=(ae*kt-ge*Qe+xe*Je)*at,s[3]=(H*Qe-j*kt-J*Je)*at,s[4]=(I*bt-w*yt-L*St)*at,s[5]=(c*yt-g*bt+b*St)*at,s[6]=(ge*Ae-ee*kt-xe*ke)*at,s[7]=(F*kt-H*Ae+J*ke)*at,s[8]=(w*At-T*bt+L*zt)*at,s[9]=(f*bt-c*At-b*zt)*at,s[10]=(ee*Qe-ae*Ae+xe*De)*at,s[11]=(j*Ae-F*Qe-J*De)*at,s[12]=(T*St-w*dt-I*zt)*at,s[13]=(c*dt-f*St+g*zt)*at,s[14]=(ae*ke-ee*Je-ge*De)*at,s[15]=(F*Je-j*ke+H*De)*at,s):null},d.as=jp,d.at=Ap,d.au=Up,d.av=function(){const s={},i=ne.$version;for(const c in ne.$root){const f=ne.$root[c];if(f.required){let g=null;g=c==="version"?i:f.type==="array"?[]:{},g!=null&&(s[c]=g)}}return s},d.aw=tf,d.ax=Pr,d.ay=function(s){s=s.slice();const i=Object.create(null);for(let c=0;cat*Nn)}let St=w?"center":c.get("text-justify").evaluate(L,{},s.canonical);const bt=c.get("symbol-placement"),dt=bt==="point"?c.get("text-max-width").evaluate(L,{},s.canonical)*Nn:0,At=()=>{s.bucket.allowVerticalPlacement&&Ks(Ae)&&(ee.vertical=Sf(ae,s.glyphMap,s.glyphPositions,s.imagePositions,F,dt,b,kt,"left",Qe,xe,d.ah.vertical,!0,bt,H,j))};if(!w&&zt){const yt=new Set;if(St==="auto")for(let qt=0;qta(void 0,void 0,void 0,function*(){if(s.byteLength===0)return createImageBitmap(new ImageData(1,1));const i=new Blob([new Uint8Array(s)],{type:"image/png"});try{return createImageBitmap(i)}catch(c){throw new Error(`Could not load image because of ${c.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),d.e=X,d.f=s=>new Promise((i,c)=>{const f=new Image;f.onload=()=>{i(f),URL.revokeObjectURL(f.src),f.onload=null,window.requestAnimationFrame(()=>{f.src=Kt})},f.onerror=()=>c(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 g=new Blob([new Uint8Array(s)],{type:"image/png"});f.src=s.byteLength?URL.createObjectURL(g):Kt}),d.g=Nt,d.h=(s,i)=>pt(X(s,{type:"json"}),i),d.i=It,d.j=tt,d.k=st,d.l=(s,i)=>pt(X(s,{type:"arrayBuffer"}),i),d.m=pt,d.n=function(s){return new Ep(s).readFields(K2,[])},d.o=xu,d.p=G_,d.q=Si,d.r=ap,d.s=Et,d.t=Hs,d.u=xt,d.v=ne,d.w=Ze,d.x=ys,d.y=function([s,i,c]){return i+=90,i*=Math.PI/180,c*=Math.PI/180,{x:s*Math.cos(i)*Math.sin(c),y:s*Math.sin(i)*Math.sin(c),z:s*Math.cos(c)}},d.z=di}),l("worker",["./shared"],function(d){class a{constructor(Z){this.keyCache={},Z&&this.replace(Z)}replace(Z){this._layerConfigs={},this._layers={},this.update(Z,[])}update(Z,$){for(const le of Z){this._layerConfigs[le.id]=le;const Ce=this._layers[le.id]=d.az(le);Ce._featureFilter=d.a6(Ce.filter),this.keyCache[le.id]&&delete this.keyCache[le.id]}for(const le of $)delete this.keyCache[le],delete this._layerConfigs[le],delete this._layers[le];this.familiesBySource={};const te=d.bh(Object.values(this._layerConfigs),this.keyCache);for(const le of te){const Ce=le.map(Fe=>this._layers[Fe.id]),Ie=Ce[0];if(Ie.visibility==="none")continue;const Pe=Ie.source||"";let Se=this.familiesBySource[Pe];Se||(Se=this.familiesBySource[Pe]={});const W=Ie.sourceLayer||"_geojsonTileLayer";let Be=Se[W];Be||(Be=Se[W]=[]),Be.push(Ce)}}}class _{constructor(Z){const $={},te=[];for(const Pe in Z){const Se=Z[Pe],W=$[Pe]={};for(const Be in Se){const Fe=Se[+Be];if(!Fe||Fe.bitmap.width===0||Fe.bitmap.height===0)continue;const qe={x:0,y:0,w:Fe.bitmap.width+2,h:Fe.bitmap.height+2};te.push(qe),W[Be]={rect:qe,metrics:Fe.metrics}}}const{w:le,h:Ce}=d.p(te),Ie=new d.o({width:le||1,height:Ce||1});for(const Pe in Z){const Se=Z[Pe];for(const W in Se){const Be=Se[+W];if(!Be||Be.bitmap.width===0||Be.bitmap.height===0)continue;const Fe=$[Pe][W].rect;d.o.copy(Be.bitmap,Ie,{x:0,y:0},{x:Fe.x+1,y:Fe.y+1},Be.bitmap)}}this.image=Ie,this.positions=$}}d.bi("GlyphAtlas",_);class x{constructor(Z){this.tileID=new d.Q(Z.tileID.overscaledZ,Z.tileID.wrap,Z.tileID.canonical.z,Z.tileID.canonical.x,Z.tileID.canonical.y),this.uid=Z.uid,this.zoom=Z.zoom,this.pixelRatio=Z.pixelRatio,this.tileSize=Z.tileSize,this.source=Z.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Z.showCollisionBoxes,this.collectResourceTiming=!!Z.collectResourceTiming,this.returnDependencies=!!Z.returnDependencies,this.promoteId=Z.promoteId,this.inFlightDependencies=[]}parse(Z,$,te,le){return d._(this,void 0,void 0,function*(){this.status="parsing",this.data=Z,this.collisionBoxArray=new d.a4;const Ce=new d.bj(Object.keys(Z.layers).sort()),Ie=new d.bk(this.tileID,this.promoteId);Ie.bucketLayerIDs=[];const Pe={},Se={featureIndex:Ie,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:te},W=$.familiesBySource[this.source];for(const lr in W){const ln=Z.layers[lr];if(!ln)continue;ln.version===1&&d.w(`Vector tile source "${this.source}" layer "${lr}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Bn=Ce.encode(lr),fi=[];for(let bi=0;bi=Kn.maxzoom||Kn.visibility!=="none"&&(S(bi,this.zoom,te),(Pe[Kn.id]=Kn.createBucket({index:Ie.bucketLayerIDs.length,layers:bi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Bn,sourceID:this.source})).populate(fi,Se,this.tileID.canonical),Ie.bucketLayerIDs.push(bi.map(mo=>mo.id)))}}const Be=d.aE(Se.glyphDependencies,lr=>Object.keys(lr).map(Number));this.inFlightDependencies.forEach(lr=>lr==null?void 0:lr.abort()),this.inFlightDependencies=[];let Fe=Promise.resolve({});if(Object.keys(Be).length){const lr=new AbortController;this.inFlightDependencies.push(lr),Fe=le.sendAsync({type:"GG",data:{stacks:Be,source:this.source,tileID:this.tileID,type:"glyphs"}},lr)}const qe=Object.keys(Se.iconDependencies);let Xe=Promise.resolve({});if(qe.length){const lr=new AbortController;this.inFlightDependencies.push(lr),Xe=le.sendAsync({type:"GI",data:{icons:qe,source:this.source,tileID:this.tileID,type:"icons"}},lr)}const ct=Object.keys(Se.patternDependencies);let Pt=Promise.resolve({});if(ct.length){const lr=new AbortController;this.inFlightDependencies.push(lr),Pt=le.sendAsync({type:"GI",data:{icons:ct,source:this.source,tileID:this.tileID,type:"patterns"}},lr)}const[$t,ar,_r]=yield Promise.all([Fe,Xe,Pt]),Yr=new _($t),Cn=new d.bl(ar,_r);for(const lr in Pe){const ln=Pe[lr];ln instanceof d.a5?(S(ln.layers,this.zoom,te),d.bm({bucket:ln,glyphMap:$t,glyphPositions:Yr.positions,imageMap:ar,imagePositions:Cn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ln.hasPattern&&(ln instanceof d.bn||ln instanceof d.bo||ln instanceof d.bp)&&(S(ln.layers,this.zoom,te),ln.addFeatures(Se,this.tileID.canonical,Cn.patternPositions))}return this.status="done",{buckets:Object.values(Pe).filter(lr=>!lr.isEmpty()),featureIndex:Ie,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Yr.image,imageAtlas:Cn,glyphMap:this.returnDependencies?$t:null,iconMap:this.returnDependencies?ar:null,glyphPositions:this.returnDependencies?Yr.positions:null}})}}function S(pe,Z,$){const te=new d.a8(Z);for(const le of pe)le.recalculate(te,$)}class k{constructor(Z,$,te){this.actor=Z,this.layerIndex=$,this.availableImages=te,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Z,$){return d._(this,void 0,void 0,function*(){const te=yield d.l(Z.request,$);try{return{vectorTile:new d.bq.VectorTile(new d.br(te.data)),rawData:te.data,cacheControl:te.cacheControl,expires:te.expires}}catch(le){const Ce=new Uint8Array(te.data);let Ie=`Unable to parse the tile at ${Z.request.url}, `;throw Ie+=Ce[0]===31&&Ce[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${le.messge}`,new Error(Ie)}})}loadTile(Z){return d._(this,void 0,void 0,function*(){const $=Z.uid,te=!!(Z&&Z.request&&Z.request.collectResourceTiming)&&new d.bs(Z.request),le=new x(Z);this.loading[$]=le;const Ce=new AbortController;le.abort=Ce;try{const Ie=yield this.loadVectorTile(Z,Ce);if(delete this.loading[$],!Ie)return null;const Pe=Ie.rawData,Se={};Ie.expires&&(Se.expires=Ie.expires),Ie.cacheControl&&(Se.cacheControl=Ie.cacheControl);const W={};if(te){const Fe=te.finish();Fe&&(W.resourceTiming=JSON.parse(JSON.stringify(Fe)))}le.vectorTile=Ie.vectorTile;const Be=le.parse(Ie.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[$]=le,this.fetching[$]={rawTileData:Pe,cacheControl:Se,resourceTiming:W};try{const Fe=yield Be;return d.e({rawTileData:Pe.slice(0)},Fe,Se,W)}finally{delete this.fetching[$]}}catch(Ie){throw delete this.loading[$],le.status="done",this.loaded[$]=le,Ie}})}reloadTile(Z){return d._(this,void 0,void 0,function*(){const $=Z.uid;if(!this.loaded||!this.loaded[$])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const te=this.loaded[$];if(te.showCollisionBoxes=Z.showCollisionBoxes,te.status==="parsing"){const le=yield te.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor);let Ce;if(this.fetching[$]){const{rawTileData:Ie,cacheControl:Pe,resourceTiming:Se}=this.fetching[$];delete this.fetching[$],Ce=d.e({rawTileData:Ie.slice(0)},le,Pe,Se)}else Ce=le;return Ce}if(te.status==="done"&&te.vectorTile)return te.parse(te.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Z){return d._(this,void 0,void 0,function*(){const $=this.loading,te=Z.uid;$&&$[te]&&$[te].abort&&($[te].abort.abort(),delete $[te])})}removeTile(Z){return d._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Z.uid]&&delete this.loaded[Z.uid]})}}class C{constructor(){this.loaded={}}loadTile(Z){return d._(this,void 0,void 0,function*(){const{uid:$,encoding:te,rawImageData:le,redFactor:Ce,greenFactor:Ie,blueFactor:Pe,baseShift:Se}=Z,W=le.width+2,Be=le.height+2,Fe=d.b(le)?new d.R({width:W,height:Be},yield d.bt(le,-1,-1,W,Be)):le,qe=new d.bu($,Fe,te,Ce,Ie,Pe,Se);return this.loaded=this.loaded||{},this.loaded[$]=qe,qe})}removeTile(Z){const $=this.loaded,te=Z.uid;$&&$[te]&&delete $[te]}}function P(pe,Z){if(pe.length!==0){D(pe[0],Z);for(var $=1;$=Math.abs(Pe)?$-Se+Pe:Pe-Se+$,$=Se}$+te>=0!=!!Z&&pe.reverse()}var N=d.bv(function pe(Z,$){var te,le=Z&&Z.type;if(le==="FeatureCollection")for(te=0;te>31}function ht(pe,Z){for(var $=pe.loadGeometry(),te=pe.type,le=0,Ce=0,Ie=$.length,Pe=0;Pepe},Kt=Math.fround||(vt=new Float32Array(1),pe=>(vt[0]=+pe,vt[0]));var vt;const Lt=3,Vt=5,sr=6;class fr{constructor(Z){this.options=Object.assign(Object.create(Ke),Z),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Z){const{log:$,minZoom:te,maxZoom:le}=this.options;$&&console.time("total time");const Ce=`prepare ${Z.length} points`;$&&console.time(Ce),this.points=Z;const Ie=[];for(let Se=0;Se=te;Se--){const W=+Date.now();Pe=this.trees[Se]=this._createTree(this._cluster(Pe,Se)),$&&console.log("z%d: %d clusters in %dms",Se,Pe.numItems,+Date.now()-W)}return $&&console.timeEnd("total time"),this}getClusters(Z,$){let te=((Z[0]+180)%360+360)%360-180;const le=Math.max(-90,Math.min(90,Z[1]));let Ce=Z[2]===180?180:((Z[2]+180)%360+360)%360-180;const Ie=Math.max(-90,Math.min(90,Z[3]));if(Z[2]-Z[0]>=360)te=-180,Ce=180;else if(te>Ce){const Fe=this.getClusters([te,le,180,Ie],$),qe=this.getClusters([-180,le,Ce,Ie],$);return Fe.concat(qe)}const Pe=this.trees[this._limitZoom($)],Se=Pe.range(nr(te),tr(Ie),nr(Ce),tr(le)),W=Pe.data,Be=[];for(const Fe of Se){const qe=this.stride*Fe;Be.push(W[qe+Vt]>1?er(W,qe,this.clusterProps):this.points[W[qe+Lt]])}return Be}getChildren(Z){const $=this._getOriginId(Z),te=this._getOriginZoom(Z),le="No cluster with the specified id.",Ce=this.trees[te];if(!Ce)throw new Error(le);const Ie=Ce.data;if($*this.stride>=Ie.length)throw new Error(le);const Pe=this.options.radius/(this.options.extent*Math.pow(2,te-1)),Se=Ce.within(Ie[$*this.stride],Ie[$*this.stride+1],Pe),W=[];for(const Be of Se){const Fe=Be*this.stride;Ie[Fe+4]===Z&&W.push(Ie[Fe+Vt]>1?er(Ie,Fe,this.clusterProps):this.points[Ie[Fe+Lt]])}if(W.length===0)throw new Error(le);return W}getLeaves(Z,$,te){const le=[];return this._appendLeaves(le,Z,$=$||10,te=te||0,0),le}getTile(Z,$,te){const le=this.trees[this._limitZoom(Z)],Ce=Math.pow(2,Z),{extent:Ie,radius:Pe}=this.options,Se=Pe/Ie,W=(te-Se)/Ce,Be=(te+1+Se)/Ce,Fe={features:[]};return this._addTileFeatures(le.range(($-Se)/Ce,W,($+1+Se)/Ce,Be),le.data,$,te,Ce,Fe),$===0&&this._addTileFeatures(le.range(1-Se/Ce,W,1,Be),le.data,Ce,te,Ce,Fe),$===Ce-1&&this._addTileFeatures(le.range(0,W,Se/Ce,Be),le.data,-1,te,Ce,Fe),Fe.features.length?Fe:null}getClusterExpansionZoom(Z){let $=this._getOriginZoom(Z)-1;for(;$<=this.options.maxZoom;){const te=this.getChildren(Z);if($++,te.length!==1)break;Z=te[0].properties.cluster_id}return $}_appendLeaves(Z,$,te,le,Ce){const Ie=this.getChildren($);for(const Pe of Ie){const Se=Pe.properties;if(Se&&Se.cluster?Ce+Se.point_count<=le?Ce+=Se.point_count:Ce=this._appendLeaves(Z,Se.cluster_id,te,le,Ce):Ce1;let Be,Fe,qe;if(W)Be=Nt($,Se,this.clusterProps),Fe=$[Se],qe=$[Se+1];else{const Pt=this.points[$[Se+Lt]];Be=Pt.properties;const[$t,ar]=Pt.geometry.coordinates;Fe=nr($t),qe=tr(ar)}const Xe={type:1,geometry:[[Math.round(this.options.extent*(Fe*Ce-te)),Math.round(this.options.extent*(qe*Ce-le))]],tags:Be};let ct;ct=W||this.options.generateId?$[Se+Lt]:this.points[$[Se+Lt]].id,ct!==void 0&&(Xe.id=ct),Ie.features.push(Xe)}}_limitZoom(Z){return Math.max(this.options.minZoom,Math.min(Math.floor(+Z),this.options.maxZoom+1))}_cluster(Z,$){const{radius:te,extent:le,reduce:Ce,minPoints:Ie}=this.options,Pe=te/(le*Math.pow(2,$)),Se=Z.data,W=[],Be=this.stride;for(let Fe=0;Fe$&&($t+=Se[_r+Vt])}if($t>Pt&&$t>=Ie){let ar,_r=qe*Pt,Yr=Xe*Pt,Cn=-1;const lr=((Fe/Be|0)<<5)+($+1)+this.points.length;for(const ln of ct){const Bn=ln*Be;if(Se[Bn+2]<=$)continue;Se[Bn+2]=$;const fi=Se[Bn+Vt];_r+=Se[Bn]*fi,Yr+=Se[Bn+1]*fi,Se[Bn+4]=lr,Ce&&(ar||(ar=this._map(Se,Fe,!0),Cn=this.clusterProps.length,this.clusterProps.push(ar)),Ce(ar,this._map(Se,Bn)))}Se[Fe+4]=lr,W.push(_r/$t,Yr/$t,1/0,lr,-1,$t),Ce&&W.push(Cn)}else{for(let ar=0;ar1)for(const ar of ct){const _r=ar*Be;if(!(Se[_r+2]<=$)){Se[_r+2]=$;for(let Yr=0;Yr>5}_getOriginZoom(Z){return(Z-this.points.length)%32}_map(Z,$,te){if(Z[$+Vt]>1){const Ie=this.clusterProps[Z[$+sr]];return te?Object.assign({},Ie):Ie}const le=this.points[Z[$+Lt]].properties,Ce=this.options.map(le);return te&&Ce===le?Object.assign({},Ce):Ce}}function er(pe,Z,$){return{type:"Feature",id:pe[Z+Lt],properties:Nt(pe,Z,$),geometry:{type:"Point",coordinates:[(te=pe[Z],360*(te-.5)),Pr(pe[Z+1])]}};var te}function Nt(pe,Z,$){const te=pe[Z+Vt],le=te>=1e4?`${Math.round(te/1e3)}k`:te>=1e3?Math.round(te/100)/10+"k":te,Ce=pe[Z+sr],Ie=Ce===-1?{}:Object.assign({},$[Ce]);return Object.assign(Ie,{cluster:!0,cluster_id:pe[Z+Lt],point_count:te,point_count_abbreviated:le})}function nr(pe){return pe/360+.5}function tr(pe){const Z=Math.sin(pe*Math.PI/180),$=.5-.25*Math.log((1+Z)/(1-Z))/Math.PI;return $<0?0:$>1?1:$}function Pr(pe){const Z=(180-360*pe)*Math.PI/180;return 360*Math.atan(Math.exp(Z))/Math.PI-90}function pt(pe,Z,$,te){for(var le,Ce=te,Ie=$-Z>>1,Pe=$-Z,Se=pe[Z],W=pe[Z+1],Be=pe[$],Fe=pe[$+1],qe=Z+3;qe<$;qe+=3){var Xe=Et(pe[qe],pe[qe+1],Se,W,Be,Fe);if(Xe>Ce)le=qe,Ce=Xe;else if(Xe===Ce){var ct=Math.abs(qe-Ie);ctte&&(le-Z>3&&pt(pe,Z,le,te),pe[le+2]=Ce,$-le>3&&pt(pe,le,$,te))}function Et(pe,Z,$,te,le,Ce){var Ie=le-$,Pe=Ce-te;if(Ie!==0||Pe!==0){var Se=((pe-$)*Ie+(Z-te)*Pe)/(Ie*Ie+Pe*Pe);Se>1?($=le,te=Ce):Se>0&&($+=Ie*Se,te+=Pe*Se)}return(Ie=pe-$)*Ie+(Pe=Z-te)*Pe}function gr(pe,Z,$,te){var le={id:pe===void 0?null:pe,type:Z,geometry:$,tags:te,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ce){var Ie=Ce.geometry,Pe=Ce.type;if(Pe==="Point"||Pe==="MultiPoint"||Pe==="LineString")Re(Ce,Ie);else if(Pe==="Polygon"||Pe==="MultiLineString")for(var Se=0;Se0&&(Ie+=te?(le*W-Se*Ce)/2:Math.sqrt(Math.pow(Se-le,2)+Math.pow(W-Ce,2))),le=Se,Ce=W}var Be=Z.length-3;Z[2]=1,pt(Z,0,Be,$),Z[Be+2]=1,Z.size=Math.abs(Ie),Z.start=0,Z.end=Z.size}function ne(pe,Z,$,te){for(var le=0;le1?1:$}function Ye(pe,Z,$,te,le,Ce,Ie,Pe){if(te/=Z,Ce>=($/=Z)&&Ie=te)return null;for(var Se=[],W=0;W=$&&ct=te)){var Pt=[];if(qe==="Point"||qe==="MultiPoint")Ut(Fe,Pt,$,te,le);else if(qe==="LineString")bn(Fe,Pt,$,te,le,!1,Pe.lineMetrics);else if(qe==="MultiLineString")Mn(Fe,Pt,$,te,le,!1);else if(qe==="Polygon")Mn(Fe,Pt,$,te,le,!0);else if(qe==="MultiPolygon")for(var $t=0;$t=$&&Ie<=te&&(Z.push(pe[Ce]),Z.push(pe[Ce+1]),Z.push(pe[Ce+2]))}}function bn(pe,Z,$,te,le,Ce,Ie){for(var Pe,Se,W=wn(pe),Be=le===0?ii:$o,Fe=pe.start,qe=0;qe$&&(Se=Be(W,Xe,ct,$t,ar,$),Ie&&(W.start=Fe+Pe*Se)):_r>te?Yr=$&&(Se=Be(W,Xe,ct,$t,ar,$),Cn=!0),Yr>te&&_r<=te&&(Se=Be(W,Xe,ct,$t,ar,te),Cn=!0),!Ce&&Cn&&(Ie&&(W.end=Fe+Pe*Se),Z.push(W),W=wn(pe)),Ie&&(Fe+=Pe)}var lr=pe.length-3;Xe=pe[lr],ct=pe[lr+1],Pt=pe[lr+2],(_r=le===0?Xe:ct)>=$&&_r<=te&&ni(W,Xe,ct,Pt),lr=W.length-3,Ce&&lr>=3&&(W[lr]!==W[0]||W[lr+1]!==W[1])&&ni(W,W[0],W[1],W[2]),W.length&&Z.push(W)}function wn(pe){var Z=[];return Z.size=pe.size,Z.start=pe.start,Z.end=pe.end,Z}function Mn(pe,Z,$,te,le,Ce){for(var Ie=0;IeIe.maxX&&(Ie.maxX=Be),Fe>Ie.maxY&&(Ie.maxY=Fe)}return Ie}function Or(pe,Z,$,te){var le=Z.geometry,Ce=Z.type,Ie=[];if(Ce==="Point"||Ce==="MultiPoint")for(var Pe=0;Pe0&&Z.size<(le?Ie:te))$.numPoints+=Z.length/3;else{for(var Pe=[],Se=0;SeIe)&&($.numSimplified++,Pe.push(Z[Se]),Pe.push(Z[Se+1])),$.numPoints++;le&&function(W,Be){for(var Fe=0,qe=0,Xe=W.length,ct=Xe-2;qe0===Be)for(qe=0,Xe=W.length;qe24)throw new Error("maxZoom should be in the 0-24 range");if(Z.promoteId&&Z.generateId)throw new Error("promoteId and generateId cannot be used together.");var te=function(le,Ce){var Ie=[];if(le.type==="FeatureCollection")for(var Pe=0;Pe1&&console.time("creation"),qe=this.tiles[Fe]=Bo(pe,Z,$,te,Se),this.tileCoords.push({z:Z,x:$,y:te}),W)){W>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Z,$,te,qe.numFeatures,qe.numPoints,qe.numSimplified),console.timeEnd("creation"));var Xe="z"+Z;this.stats[Xe]=(this.stats[Xe]||0)+1,this.total++}if(qe.source=pe,le){if(Z===Se.maxZoom||Z===le)continue;var ct=1<1&&console.time("clipping");var Pt,$t,ar,_r,Yr,Cn,lr=.5*Se.buffer/Se.extent,ln=.5-lr,Bn=.5+lr,fi=1+lr;Pt=$t=ar=_r=null,Yr=Ye(pe,Be,$-lr,$+Bn,0,qe.minX,qe.maxX,Se),Cn=Ye(pe,Be,$+ln,$+fi,0,qe.minX,qe.maxX,Se),pe=null,Yr&&(Pt=Ye(Yr,Be,te-lr,te+Bn,1,qe.minY,qe.maxY,Se),$t=Ye(Yr,Be,te+ln,te+fi,1,qe.minY,qe.maxY,Se),Yr=null),Cn&&(ar=Ye(Cn,Be,te-lr,te+Bn,1,qe.minY,qe.maxY,Se),_r=Ye(Cn,Be,te+ln,te+fi,1,qe.minY,qe.maxY,Se),Cn=null),W>1&&console.timeEnd("clipping"),Pe.push(Pt||[],Z+1,2*$,2*te),Pe.push($t||[],Z+1,2*$,2*te+1),Pe.push(ar||[],Z+1,2*$+1,2*te),Pe.push(_r||[],Z+1,2*$+1,2*te+1)}}},rr.prototype.getTile=function(pe,Z,$){var te=this.options,le=te.extent,Ce=te.debug;if(pe<0||pe>24)return null;var Ie=1<1&&console.log("drilling down to z%d-%d-%d",pe,Z,$);for(var Se,W=pe,Be=Z,Fe=$;!Se&&W>0;)W--,Be=Math.floor(Be/2),Fe=Math.floor(Fe/2),Se=this.tiles[Jt(W,Be,Fe)];return Se&&Se.source?(Ce>1&&console.log("found parent tile z%d-%d-%d",W,Be,Fe),Ce>1&&console.time("drilling down"),this.splitTile(Se.source,W,Be,Fe,pe,Z,$),Ce>1&&console.timeEnd("drilling down"),this.tiles[Pe]?Xn(this.tiles[Pe],le):null):null};class ro extends k{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(Z,$){return d._(this,void 0,void 0,function*(){const te=Z.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const le=this._geoJSONIndex.getTile(te.z,te.x,te.y);if(!le)return null;const Ce=new class{constructor(Pe){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=d.W,this.length=Pe.length,this._features=Pe}feature(Pe){return new class{constructor(Se){this._feature=Se,this.extent=d.W,this.type=Se.type,this.properties=Se.tags,"id"in Se&&!isNaN(Se.id)&&(this.id=parseInt(Se.id,10))}loadGeometry(){if(this._feature.type===1){const Se=[];for(const W of this._feature.geometry)Se.push([new d.P(W[0],W[1])]);return Se}{const Se=[];for(const W of this._feature.geometry){const Be=[];for(const Fe of W)Be.push(new d.P(Fe[0],Fe[1]));Se.push(Be)}return Se}}toGeoJSON(Se,W,Be){return z.call(this,Se,W,Be)}}(this._features[Pe])}}(le.features);let Ie=Ot(Ce);return Ie.byteOffset===0&&Ie.byteLength===Ie.buffer.byteLength||(Ie=new Uint8Array(Ie)),{vectorTile:Ce,rawData:Ie.buffer}})}loadData(Z){return d._(this,void 0,void 0,function*(){var $;($=this._pendingRequest)===null||$===void 0||$.abort();const te=!!(Z&&Z.request&&Z.request.collectResourceTiming)&&new d.bs(Z.request);this._pendingRequest=new AbortController;try{let le=yield this.loadGeoJSON(Z,this._pendingRequest);if(delete this._pendingRequest,typeof le!="object")throw new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`);if(N(le,!0),Z.filter){const Ie=d.by(Z.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ie.result==="error")throw new Error(Ie.value.map(Se=>`${Se.key}: ${Se.message}`).join(", "));le={type:"FeatureCollection",features:le.features.filter(Se=>Ie.value.evaluate({zoom:0},Se))}}this._geoJSONIndex=Z.cluster?new fr(function({superclusterOptions:Ie,clusterProperties:Pe}){if(!Pe||!Ie)return Ie;const Se={},W={},Be={accumulated:null,zoom:0},Fe={properties:null},qe=Object.keys(Pe);for(const Xe of qe){const[ct,Pt]=Pe[Xe],$t=d.by(Pt),ar=d.by(typeof ct=="string"?[ct,["accumulated"],["get",Xe]]:ct);Se[Xe]=$t.value,W[Xe]=ar.value}return Ie.map=Xe=>{Fe.properties=Xe;const ct={};for(const Pt of qe)ct[Pt]=Se[Pt].evaluate(Be,Fe);return ct},Ie.reduce=(Xe,ct)=>{Fe.properties=ct;for(const Pt of qe)Be.accumulated=Xe[Pt],Xe[Pt]=W[Pt].evaluate(Be,Fe)},Ie}(Z)).load(le.features):function(Ie,Pe){return new rr(Ie,Pe)}(le,Z.geojsonVtOptions),this.loaded={};const Ce={};if(te){const Ie=te.finish();Ie&&(Ce.resourceTiming={},Ce.resourceTiming[Z.source]=JSON.parse(JSON.stringify(Ie)))}return Ce}catch(le){if(delete this._pendingRequest,d.bz(le))return{abandoned:!0};throw le}})}reloadTile(Z){const $=this.loaded;return $&&$[Z.uid]?super.reloadTile(Z):this.loadTile(Z)}loadGeoJSON(Z,$){return d._(this,void 0,void 0,function*(){const{promoteId:te}=Z;if(Z.request){const le=yield d.h(Z.request,$);return this._dataUpdateable=vi(le.data,te)?Qt(le.data,te):void 0,le.data}if(typeof Z.data=="string")try{const le=JSON.parse(Z.data);return this._dataUpdateable=vi(le,te)?Qt(le,te):void 0,le}catch{throw new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`)}if(!Z.dataDiff)throw new Error(`Input data given to '${Z.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Z.source}`);return function(le,Ce,Ie){var Pe,Se,W,Be;if(Ce.removeAll&&le.clear(),Ce.remove)for(const Fe of Ce.remove)le.delete(Fe);if(Ce.add)for(const Fe of Ce.add){const qe=Nr(Fe,Ie);qe!=null&&le.set(qe,Fe)}if(Ce.update)for(const Fe of Ce.update){let qe=le.get(Fe.id);if(qe==null)continue;const Xe=!Fe.removeAllProperties&&(((Pe=Fe.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0||((Se=Fe.addOrUpdateProperties)===null||Se===void 0?void 0:Se.length)>0);if((Fe.newGeometry||Fe.removeAllProperties||Xe)&&(qe=Object.assign({},qe),le.set(Fe.id,qe),Xe&&(qe.properties=Object.assign({},qe.properties))),Fe.newGeometry&&(qe.geometry=Fe.newGeometry),Fe.removeAllProperties)qe.properties={};else if(((W=Fe.removeProperties)===null||W===void 0?void 0:W.length)>0)for(const ct of Fe.removeProperties)Object.prototype.hasOwnProperty.call(qe.properties,ct)&&delete qe.properties[ct];if(((Be=Fe.addOrUpdateProperties)===null||Be===void 0?void 0:Be.length)>0)for(const{key:ct,value:Pt}of Fe.addOrUpdateProperties)qe.properties[ct]=Pt}}(this._dataUpdateable,Z.dataDiff,te),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Z){return d._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Z){return this._geoJSONIndex.getClusterExpansionZoom(Z.clusterId)}getClusterChildren(Z){return this._geoJSONIndex.getChildren(Z.clusterId)}getClusterLeaves(Z){return this._geoJSONIndex.getLeaves(Z.clusterId,Z.limit,Z.offset)}}class an{constructor(Z){this.self=Z,this.actor=new d.C(Z),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=($,te)=>{if(this.externalWorkerSourceTypes[$])throw new Error(`Worker source with name "${$}" already registered.`);this.externalWorkerSourceTypes[$]=te},this.self.addProtocol=d.bf,this.self.removeProtocol=d.bg,this.self.registerRTLTextPlugin=$=>{if(d.bA.isParsed())throw new Error("RTL text plugin already registered.");d.bA.setMethods($)},this.actor.registerMessageHandler("LDT",($,te)=>this._getDEMWorkerSource($,te.source).loadTile(te)),this.actor.registerMessageHandler("RDT",($,te)=>d._(this,void 0,void 0,function*(){this._getDEMWorkerSource($,te.source).removeTile(te)})),this.actor.registerMessageHandler("GCEZ",($,te)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource($,te.type,te.source).getClusterExpansionZoom(te)})),this.actor.registerMessageHandler("GCC",($,te)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource($,te.type,te.source).getClusterChildren(te)})),this.actor.registerMessageHandler("GCL",($,te)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource($,te.type,te.source).getClusterLeaves(te)})),this.actor.registerMessageHandler("LD",($,te)=>this._getWorkerSource($,te.type,te.source).loadData(te)),this.actor.registerMessageHandler("LT",($,te)=>this._getWorkerSource($,te.type,te.source).loadTile(te)),this.actor.registerMessageHandler("RT",($,te)=>this._getWorkerSource($,te.type,te.source).reloadTile(te)),this.actor.registerMessageHandler("AT",($,te)=>this._getWorkerSource($,te.type,te.source).abortTile(te)),this.actor.registerMessageHandler("RMT",($,te)=>this._getWorkerSource($,te.type,te.source).removeTile(te)),this.actor.registerMessageHandler("RS",($,te)=>d._(this,void 0,void 0,function*(){if(!this.workerSources[$]||!this.workerSources[$][te.type]||!this.workerSources[$][te.type][te.source])return;const le=this.workerSources[$][te.type][te.source];delete this.workerSources[$][te.type][te.source],le.removeSource!==void 0&&le.removeSource(te)})),this.actor.registerMessageHandler("RM",$=>d._(this,void 0,void 0,function*(){delete this.layerIndexes[$],delete this.availableImages[$],delete this.workerSources[$],delete this.demWorkerSources[$]})),this.actor.registerMessageHandler("SR",($,te)=>d._(this,void 0,void 0,function*(){this.referrer=te})),this.actor.registerMessageHandler("SRPS",($,te)=>this._syncRTLPluginState($,te)),this.actor.registerMessageHandler("IS",($,te)=>d._(this,void 0,void 0,function*(){this.self.importScripts(te)})),this.actor.registerMessageHandler("SI",($,te)=>this._setImages($,te)),this.actor.registerMessageHandler("UL",($,te)=>d._(this,void 0,void 0,function*(){this._getLayerIndex($).update(te.layers,te.removedIds)})),this.actor.registerMessageHandler("SL",($,te)=>d._(this,void 0,void 0,function*(){this._getLayerIndex($).replace(te)}))}_setImages(Z,$){return d._(this,void 0,void 0,function*(){this.availableImages[Z]=$;for(const te in this.workerSources[Z]){const le=this.workerSources[Z][te];for(const Ce in le)le[Ce].availableImages=$}})}_syncRTLPluginState(Z,$){return d._(this,void 0,void 0,function*(){if(d.bA.isParsed())return d.bA.getState();if($.pluginStatus!=="loading")return d.bA.setState($),$;const te=$.pluginURL;if(this.self.importScripts(te),d.bA.isParsed()){const le={pluginStatus:"loaded",pluginURL:te};return d.bA.setState(le),le}throw d.bA.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${te}`)})}_getAvailableImages(Z){let $=this.availableImages[Z];return $||($=[]),$}_getLayerIndex(Z){let $=this.layerIndexes[Z];return $||($=this.layerIndexes[Z]=new a),$}_getWorkerSource(Z,$,te){if(this.workerSources[Z]||(this.workerSources[Z]={}),this.workerSources[Z][$]||(this.workerSources[Z][$]={}),!this.workerSources[Z][$][te]){const le={sendAsync:(Ce,Ie)=>(Ce.targetMapId=Z,this.actor.sendAsync(Ce,Ie))};switch($){case"vector":this.workerSources[Z][$][te]=new k(le,this._getLayerIndex(Z),this._getAvailableImages(Z));break;case"geojson":this.workerSources[Z][$][te]=new ro(le,this._getLayerIndex(Z),this._getAvailableImages(Z));break;default:this.workerSources[Z][$][te]=new this.externalWorkerSourceTypes[$](le,this._getLayerIndex(Z),this._getAvailableImages(Z))}}return this.workerSources[Z][$][te]}_getDEMWorkerSource(Z,$){return this.demWorkerSources[Z]||(this.demWorkerSources[Z]={}),this.demWorkerSources[Z][$]||(this.demWorkerSources[Z][$]=new C),this.demWorkerSources[Z][$]}}return d.i(self)&&(self.worker=new an(self)),an}),l("index",["exports","./shared"],function(d,a){var _="4.1.3";let x,S;const k={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:y=>new Promise((o,h)=>{const p=requestAnimationFrame(o);y.signal.addEventListener("abort",()=>{cancelAnimationFrame(p),h(a.c())})}),getImageData(y,o=0){return this.getImageCanvasContext(y).getImageData(-o,-o,y.width+2*o,y.height+2*o)},getImageCanvasContext(y){const o=window.document.createElement("canvas"),h=o.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("failed to create canvas 2d context");return o.width=y.width,o.height=y.height,h.drawImage(y,0,0,y.width,y.height),h},resolveURL:y=>(x||(x=document.createElement("a")),x.href=y,x.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(S==null&&(S=matchMedia("(prefers-reduced-motion: reduce)")),S.matches)}};class C{static testProp(o){if(!C.docStyle)return o[0];for(let h=0;h{window.removeEventListener("click",C.suppressClickInternal,!0)},0)}static getScale(o){const h=o.getBoundingClientRect();return{x:h.width/o.offsetWidth||1,y:h.height/o.offsetHeight||1,boundingClientRect:h}}static getPoint(o,h,p){const m=h.boundingClientRect;return new a.P((p.clientX-m.left)/h.x-o.clientLeft,(p.clientY-m.top)/h.y-o.clientTop)}static mousePos(o,h){const p=C.getScale(o);return C.getPoint(o,p,h)}static touchPos(o,h){const p=[],m=C.getScale(o);for(let v=0;v{o=[],h=0,p=0,m={}},y.addThrottleControl=A=>{const R=p++;return m[R]=A,R},y.removeThrottleControl=A=>{delete m[A],E()},y.getImage=(A,R,V=!0)=>new Promise((q,Q)=>{P.supported&&(A.headers||(A.headers={}),A.headers.accept="image/webp,*/*"),a.e(A,{type:"image"}),o.push({abortController:R,requestParameters:A,supportImageRefresh:V,state:"queued",onError:he=>{Q(he)},onSuccess:he=>{q(he)}}),E()});const v=A=>a._(this,void 0,void 0,function*(){A.state="running";const{requestParameters:R,supportImageRefresh:V,onError:q,onSuccess:Q,abortController:he}=A,ue=V===!1&&!a.i(self)&&!a.g(R.url)&&(!R.headers||Object.keys(R.headers).reduce((Te,Ue)=>Te&&Ue==="accept",!0));h++;const ye=ue?M(R,he):a.m(R,he);try{const Te=yield ye;delete A.abortController,A.state="completed",Te.data instanceof HTMLImageElement||a.b(Te.data)?Q(Te):Te.data&&Q({data:yield(se=Te.data,typeof createImageBitmap=="function"?a.d(se):a.f(se)),cacheControl:Te.cacheControl,expires:Te.expires})}catch(Te){delete A.abortController,q(Te)}finally{h--,E()}var se}),E=()=>{const A=(()=>{for(const R of Object.keys(m))if(m[R]())return!0;return!1})()?a.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:a.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let R=h;R0;R++){const V=o.shift();V.abortController.signal.aborted?R--:v(V)}},M=(A,R)=>new Promise((V,q)=>{const Q=new Image,he=A.url,ue=A.credentials;ue&&ue==="include"?Q.crossOrigin="use-credentials":(ue&&ue==="same-origin"||!a.s(he))&&(Q.crossOrigin="anonymous"),R.signal.addEventListener("abort",()=>{Q.src="",q(a.c())}),Q.fetchPriority="high",Q.onload=()=>{Q.onerror=Q.onload=null,V({data:Q})},Q.onerror=()=>{Q.onerror=Q.onload=null,R.signal.aborted||q(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."))},Q.src=he})}(G||(G={})),G.resetRequestQueue();class U{constructor(o){this._transformRequestFn=o}transformRequest(o,h){return this._transformRequestFn&&this._transformRequestFn(o,h)||{url:o}}normalizeSpriteURL(o,h,p){const m=function(v){const E=v.match(K);if(!E)throw new Error(`Unable to parse URL "${v}"`);return{protocol:E[1],authority:E[2],path:E[3]||"/",params:E[4]?E[4].split("&"):[]}}(o);return m.path+=`${h}${p}`,function(v){const E=v.params.length?`?${v.params.join("&")}`:"";return`${v.protocol}://${v.authority}${v.path}${E}`}(m)}setTransformRequest(o){this._transformRequestFn=o}}const K=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function me(y){var o=new a.A(3);return o[0]=y[0],o[1]=y[1],o[2]=y[2],o}var X,Y=function(y,o,h){return y[0]=o[0]-h[0],y[1]=o[1]-h[1],y[2]=o[2]-h[2],y};X=new a.A(3),a.A!=Float32Array&&(X[0]=0,X[1]=0,X[2]=0);var _e=function(y){var o=y[0],h=y[1];return o*o+h*h};function ze(y){const o=[];if(typeof y=="string")o.push({id:"default",url:y});else if(y&&y.length>0){const h=[];for(const{id:p,url:m}of y){const v=`${p}${m}`;h.indexOf(v)===-1&&(h.push(v),o.push({id:p,url:m}))}}return o}(function(){var y=new a.A(2);a.A!=Float32Array&&(y[0]=0,y[1]=0)})();class re{constructor(o,h,p,m){this.context=o,this.format=p,this.texture=o.gl.createTexture(),this.update(h,m)}update(o,h,p){const{width:m,height:v}=o,E=!(this.size&&this.size[0]===m&&this.size[1]===v||p),{context:M}=this,{gl:A}=M;if(this.useMipmap=!!(h&&h.useMipmap),A.bindTexture(A.TEXTURE_2D,this.texture),M.pixelStoreUnpackFlipY.set(!1),M.pixelStoreUnpack.set(1),M.pixelStoreUnpackPremultiplyAlpha.set(this.format===A.RGBA&&(!h||h.premultiply!==!1)),E)this.size=[m,v],o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement||o instanceof ImageData||a.b(o)?A.texImage2D(A.TEXTURE_2D,0,this.format,this.format,A.UNSIGNED_BYTE,o):A.texImage2D(A.TEXTURE_2D,0,this.format,m,v,0,this.format,A.UNSIGNED_BYTE,o.data);else{const{x:R,y:V}=p||{x:0,y:0};o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement||o instanceof ImageData||a.b(o)?A.texSubImage2D(A.TEXTURE_2D,0,R,V,A.RGBA,A.UNSIGNED_BYTE,o):A.texSubImage2D(A.TEXTURE_2D,0,R,V,m,v,A.RGBA,A.UNSIGNED_BYTE,o.data)}this.useMipmap&&this.isSizePowerOfTwo()&&A.generateMipmap(A.TEXTURE_2D)}bind(o,h,p){const{context:m}=this,{gl:v}=m;v.bindTexture(v.TEXTURE_2D,this.texture),p!==v.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(p=v.LINEAR),o!==this.filter&&(v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,o),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,p||o),this.filter=o),h!==this.wrap&&(v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,h),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,h),this.wrap=h)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:o}=this.context;o.deleteTexture(this.texture),this.texture=null}}function ce(y){const{userImage:o}=y;return!!(o&&o.render&&o.render())&&(y.data.replace(new Uint8Array(o.data.buffer)),!0)}class Ze extends a.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new a.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(o){if(this.loaded!==o&&(this.loaded=o,o)){for(const{ids:h,promiseResolve:p}of this.requestors)p(this._getImagesForIds(h));this.requestors=[]}}getImage(o){const h=this.images[o];if(h&&!h.data&&h.spriteData){const p=h.spriteData;h.data=new a.R({width:p.width,height:p.height},p.context.getImageData(p.x,p.y,p.width,p.height).data),h.spriteData=null}return h}addImage(o,h){if(this.images[o])throw new Error(`Image id ${o} already exist, use updateImage instead`);this._validate(o,h)&&(this.images[o]=h)}_validate(o,h){let p=!0;const m=h.data||h.spriteData;return this._validateStretch(h.stretchX,m&&m.width)||(this.fire(new a.j(new Error(`Image "${o}" has invalid "stretchX" value`))),p=!1),this._validateStretch(h.stretchY,m&&m.height)||(this.fire(new a.j(new Error(`Image "${o}" has invalid "stretchY" value`))),p=!1),this._validateContent(h.content,h)||(this.fire(new a.j(new Error(`Image "${o}" has invalid "content" value`))),p=!1),p}_validateStretch(o,h){if(!o)return!0;let p=0;for(const m of o){if(m[0]{let m=!0;if(!this.isLoaded())for(const v of o)this.images[v]||(m=!1);this.isLoaded()||m?h(this._getImagesForIds(o)):this.requestors.push({ids:o,promiseResolve:h})})}_getImagesForIds(o){const h={};for(const p of o){let m=this.getImage(p);m||(this.fire(new a.k("styleimagemissing",{id:p})),m=this.getImage(p)),m?h[p]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,hasRenderCallback:!!(m.userImage&&m.userImage.render)}:a.w(`Image "${p}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return h}getPixelSize(){const{width:o,height:h}=this.atlasImage;return{width:o,height:h}}getPattern(o){const h=this.patterns[o],p=this.getImage(o);if(!p)return null;if(h&&h.position.version===p.version)return h.position;if(h)h.position.version=p.version;else{const m={w:p.data.width+2,h:p.data.height+2,x:0,y:0},v=new a.I(m,p);this.patterns[o]={bin:m,position:v}}return this._updatePatternAtlas(),this.patterns[o].position}bind(o){const h=o.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new re(o,this.atlasImage,h.RGBA),this.atlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE)}_updatePatternAtlas(){const o=[];for(const v in this.patterns)o.push(this.patterns[v].bin);const{w:h,h:p}=a.p(o),m=this.atlasImage;m.resize({width:h||1,height:p||1});for(const v in this.patterns){const{bin:E}=this.patterns[v],M=E.x+1,A=E.y+1,R=this.getImage(v).data,V=R.width,q=R.height;a.R.copy(R,m,{x:0,y:0},{x:M,y:A},{width:V,height:q}),a.R.copy(R,m,{x:0,y:q-1},{x:M,y:A-1},{width:V,height:1}),a.R.copy(R,m,{x:0,y:0},{x:M,y:A+q},{width:V,height:1}),a.R.copy(R,m,{x:V-1,y:0},{x:M-1,y:A},{width:1,height:q}),a.R.copy(R,m,{x:0,y:0},{x:M+V,y:A},{width:1,height:q})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(o){for(const h of o){if(this.callbackDispatchedThisFrame[h])continue;this.callbackDispatchedThisFrame[h]=!0;const p=this.getImage(h);p||a.w(`Image with ID: "${h}" was not found`),ce(p)&&this.updateImage(h,p)}}}const Me=1e20;function ht(y,o,h,p,m,v,E,M,A){for(let R=o;R-1);A++,v[A]=M,E[A]=R,E[A+1]=Me}for(let M=0,A=0;M65535)throw new Error("glyphs > 65535 not supported");if(p.ranges[v])return{stack:o,id:h,glyph:m};if(!this.url)throw new Error("glyphsUrl is not set");if(!p.requests[v]){const M=Ot.loadGlyphRange(o,v,this.url,this.requestManager);p.requests[v]=M}const E=yield p.requests[v];for(const M in E)this._doesCharSupportLocalGlyph(+M)||(p.glyphs[+M]=E[+M]);return p.ranges[v]=!0,{stack:o,id:h,glyph:E[h]||null}})}_doesCharSupportLocalGlyph(o){return!!this.localIdeographFontFamily&&(a.u["CJK Unified Ideographs"](o)||a.u["Hangul Syllables"](o)||a.u.Hiragana(o)||a.u.Katakana(o))}_tinySDF(o,h,p){const m=this.localIdeographFontFamily;if(!m||!this._doesCharSupportLocalGlyph(p))return;let v=o.tinySDF;if(!v){let M="400";/bold/i.test(h)?M="900":/medium/i.test(h)?M="500":/light/i.test(h)&&(M="200"),v=o.tinySDF=new Ot.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:m,fontWeight:M})}const E=v.draw(String.fromCharCode(p));return{id:p,bitmap:new a.o({width:E.width||60,height:E.height||60},E.data),metrics:{width:E.glyphWidth/2||24,height:E.glyphHeight/2||24,left:E.glyphLeft/2+.5||0,top:E.glyphTop/2-27.5||-8,advance:E.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ot.loadGlyphRange=function(y,o,h,p){return a._(this,void 0,void 0,function*(){const m=256*o,v=m+255,E=p.transformRequest(h.replace("{fontstack}",y).replace("{range}",`${m}-${v}`),"Glyphs"),M=yield a.l(E,new AbortController);if(!M||!M.data)throw new Error(`Could not load glyph range. range: ${o}, ${m}-${v}`);const A={};for(const R of a.n(M.data))A[R.id]=R;return A})},Ot.TinySDF=class{constructor({fontSize:y=24,buffer:o=3,radius:h=8,cutoff:p=.25,fontFamily:m="sans-serif",fontWeight:v="normal",fontStyle:E="normal"}={}){this.buffer=o,this.cutoff=p,this.radius=h;const M=this.size=y+4*o,A=this._createCanvas(M),R=this.ctx=A.getContext("2d",{willReadFrequently:!0});R.font=`${E} ${v} ${y}px ${m}`,R.textBaseline="alphabetic",R.textAlign="left",R.fillStyle="black",this.gridOuter=new Float64Array(M*M),this.gridInner=new Float64Array(M*M),this.f=new Float64Array(M),this.z=new Float64Array(M+1),this.v=new Uint16Array(M)}_createCanvas(y){const o=document.createElement("canvas");return o.width=o.height=y,o}draw(y){const{width:o,actualBoundingBoxAscent:h,actualBoundingBoxDescent:p,actualBoundingBoxLeft:m,actualBoundingBoxRight:v}=this.ctx.measureText(y),E=Math.ceil(h),M=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(v-m))),A=Math.min(this.size-this.buffer,E+Math.ceil(p)),R=M+2*this.buffer,V=A+2*this.buffer,q=Math.max(R*V,0),Q=new Uint8ClampedArray(q),he={data:Q,width:R,height:V,glyphWidth:M,glyphHeight:A,glyphTop:E,glyphLeft:0,glyphAdvance:o};if(M===0||A===0)return he;const{ctx:ue,buffer:ye,gridInner:se,gridOuter:Te}=this;ue.clearRect(ye,ye,M,A),ue.fillText(y,ye,ye+E);const Ue=ue.getImageData(ye,ye,M,A);Te.fill(Me,0,q),se.fill(0,0,q);for(let we=0;we0?$e*$e:0,se[He]=$e<0?$e*$e:0}}ht(Te,0,0,R,V,R,this.f,this.v,this.z),ht(se,ye,ye,M,A,R,this.f,this.v,this.z);for(let we=0;we1&&(A=o[++M]);const V=Math.abs(R-A.left),q=Math.abs(R-A.right),Q=Math.min(V,q);let he;const ue=v/p*(m+1);if(A.isDash){const ye=m-Math.abs(ue);he=Math.sqrt(Q*Q+ye*ye)}else he=m-Math.sqrt(Q*Q+ue*ue);this.data[E+R]=Math.max(0,Math.min(255,he+128))}}}addRegularDash(o){for(let M=o.length-1;M>=0;--M){const A=o[M],R=o[M+1];A.zeroLength?o.splice(M,1):R&&R.isDash===A.isDash&&(R.left=A.left,o.splice(M,1))}const h=o[0],p=o[o.length-1];h.isDash===p.isDash&&(h.left=p.left-this.width,p.right=h.right+this.width);const m=this.width*this.nextRow;let v=0,E=o[v];for(let M=0;M1&&(E=o[++v]);const A=Math.abs(M-E.left),R=Math.abs(M-E.right),V=Math.min(A,R);this.data[m+M]=Math.max(0,Math.min(255,(E.isDash?V:-V)+128))}}addDash(o,h){const p=h?7:0,m=2*p+1;if(this.nextRow+m>this.height)return a.w("LineAtlas out of space"),null;let v=0;for(let M=0;M{h.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Vt]}numActive(){return Object.keys(this.active).length}}const fr=Math.floor(k.hardwareConcurrency/2);let er,Nt;function nr(){return er||(er=new sr),er}sr.workerCount=a.B(globalThis)?Math.max(Math.min(fr,3),1):1;class tr{constructor(o,h){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=h;const p=this.workerPool.acquire(h);for(let m=0;m{h.remove()}),this.actors=[],o&&this.workerPool.release(this.id)}registerMessageHandler(o,h){for(const p of this.actors)p.registerMessageHandler(o,h)}}function Pr(){return Nt||(Nt=new tr(nr(),a.G),Nt.registerMessageHandler("GR",(y,o,h)=>a.m(o,h))),Nt}function pt(y,o){const h=a.F();return a.H(h,h,[1,1,0]),a.J(h,h,[.5*y.width,.5*y.height,1]),a.K(h,h,y.calculatePosMatrix(o.toUnwrapped()))}function Et(y,o,h,p,m,v){const E=function(q,Q,he){if(q)for(const ue of q){const ye=Q[ue];if(ye&&ye.source===he&&ye.type==="fill-extrusion")return!0}else for(const ue in Q){const ye=Q[ue];if(ye.source===he&&ye.type==="fill-extrusion")return!0}return!1}(m&&m.layers,o,y.id),M=v.maxPitchScaleFactor(),A=y.tilesIn(p,M,E);A.sort(gr);const R=[];for(const q of A)R.push({wrappedTileID:q.tileID.wrapped().key,queryResults:q.tile.queryRenderedFeatures(o,h,y._state,q.queryGeometry,q.cameraQueryGeometry,q.scale,m,v,M,pt(y.transform,q.tileID))});const V=function(q){const Q={},he={};for(const ue of q){const ye=ue.queryResults,se=ue.wrappedTileID,Te=he[se]=he[se]||{};for(const Ue in ye){const we=ye[Ue],Le=Te[Ue]=Te[Ue]||{},Ge=Q[Ue]=Q[Ue]||[];for(const He of we)Le[He.featureIndex]||(Le[He.featureIndex]=!0,Ge.push(He))}}return Q}(R);for(const q in V)V[q].forEach(Q=>{const he=Q.feature,ue=y.getFeatureState(he.layer["source-layer"],he.id);he.source=he.layer.source,he.layer["source-layer"]&&(he.sourceLayer=he.layer["source-layer"]),he.state=ue});return V}function gr(y,o){const h=y.tileID,p=o.tileID;return h.overscaledZ-p.overscaledZ||h.canonical.y-p.canonical.y||h.wrap-p.wrap||h.canonical.x-p.canonical.x}function Re(y,o,h){return a._(this,void 0,void 0,function*(){let p=y;if(y.url?p=(yield a.h(o.transformRequest(y.url,"Source"),h)).data:yield k.frameAsync(h),!p)return null;const m=a.L(a.e(p,y),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in p&&p.vector_layers&&(m.vectorLayerIds=p.vector_layers.map(v=>v.id)),m})}class st{constructor(o,h){o&&(h?this.setSouthWest(o).setNorthEast(h):Array.isArray(o)&&(o.length===4?this.setSouthWest([o[0],o[1]]).setNorthEast([o[2],o[3]]):this.setSouthWest(o[0]).setNorthEast(o[1])))}setNorthEast(o){return this._ne=o instanceof a.M?new a.M(o.lng,o.lat):a.M.convert(o),this}setSouthWest(o){return this._sw=o instanceof a.M?new a.M(o.lng,o.lat):a.M.convert(o),this}extend(o){const h=this._sw,p=this._ne;let m,v;if(o instanceof a.M)m=o,v=o;else{if(!(o instanceof st))return Array.isArray(o)?o.length===4||o.every(Array.isArray)?this.extend(st.convert(o)):this.extend(a.M.convert(o)):o&&("lng"in o||"lon"in o)&&"lat"in o?this.extend(a.M.convert(o)):this;if(m=o._sw,v=o._ne,!m||!v)return this}return h||p?(h.lng=Math.min(m.lng,h.lng),h.lat=Math.min(m.lat,h.lat),p.lng=Math.max(v.lng,p.lng),p.lat=Math.max(v.lat,p.lat)):(this._sw=new a.M(m.lng,m.lat),this._ne=new a.M(v.lng,v.lat)),this}getCenter(){return new a.M((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 a.M(this.getWest(),this.getNorth())}getSouthEast(){return new a.M(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(o){const{lng:h,lat:p}=a.M.convert(o);let m=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(m=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&m}static convert(o){return o instanceof st?o:o&&new st(o)}static fromLngLat(o,h=0){const p=360*h/40075017,m=p/Math.cos(Math.PI/180*o.lat);return new st(new a.M(o.lng-m,o.lat-p),new a.M(o.lng+m,o.lat+p))}}class tt{constructor(o,h,p){this.bounds=st.convert(this.validateBounds(o)),this.minzoom=h||0,this.maxzoom=p||24}validateBounds(o){return Array.isArray(o)&&o.length===4?[Math.max(-180,o[0]),Math.max(-90,o[1]),Math.min(180,o[2]),Math.min(90,o[3])]:[-180,-90,180,90]}contains(o){const h=Math.pow(2,o.z),p=Math.floor(a.N(this.bounds.getWest())*h),m=Math.floor(a.O(this.bounds.getNorth())*h),v=Math.ceil(a.N(this.bounds.getEast())*h),E=Math.ceil(a.O(this.bounds.getSouth())*h);return o.x>=p&&o.x=m&&o.y{this._options.tiles=o}),this}setUrl(o){return this.setSourceProperty(()=>{this.url=o,this._options.url=o}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return a.e({},this._options)}loadTile(o){return a._(this,void 0,void 0,function*(){const h=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p={request:this.map._requestManager.transformRequest(h,"Tile"),uid:o.uid,tileID:o.tileID,zoom:o.tileID.overscaledZ,tileSize:this.tileSize*o.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};p.request.collectResourceTiming=this._collectResourceTiming;let m="RT";if(o.actor&&o.state!=="expired"){if(o.state==="loading")return new Promise((v,E)=>{o.reloadPromise={resolve:v,reject:E}})}else o.actor=this.dispatcher.getActor(),m="LT";o.abortController=new AbortController;try{const v=yield o.actor.sendAsync({type:m,data:p},o.abortController);if(delete o.abortController,o.aborted)return;this._afterTileLoadWorkerResponse(o,v)}catch(v){if(delete o.abortController,o.aborted)return;if(v&&v.status!==404)throw v;this._afterTileLoadWorkerResponse(o,null)}})}_afterTileLoadWorkerResponse(o,h){if(h&&h.resourceTiming&&(o.resourceTiming=h.resourceTiming),h&&this.map._refreshExpiredTiles&&o.setExpiryData(h),o.loadVectorData(h,this.map.painter),o.reloadPromise){const p=o.reloadPromise;o.reloadPromise=null,this.loadTile(o).then(p.resolve).catch(p.reject)}}abortTile(o){return a._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController),o.actor&&(yield o.actor.sendAsync({type:"AT",data:{uid:o.uid,type:this.type,source:this.id}}))})}unloadTile(o){return a._(this,void 0,void 0,function*(){o.unloadVectorData(),o.actor&&(yield o.actor.sendAsync({type:"RMT",data:{uid:o.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class ne extends a.E{constructor(o,h,p,m){super(),this.id=o,this.dispatcher=p,this.setEventedParent(m),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.e({type:"raster"},h),a.e(this,a.L(h,["url","scheme","tileSize"]))}load(){return a._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new a.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const o=yield Re(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,o&&(a.e(this,o),o.bounds&&(this.tileBounds=new tt(o.bounds,this.minzoom,this.maxzoom)),this.fire(new a.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.k("data",{dataType:"source",sourceDataType:"content"})))}catch(o){this._tileJSONRequest=null,this.fire(new a.j(o))}})}loaded(){return this._loaded}onAdd(o){this.map=o,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(o){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),o(),this.load()}setTiles(o){return this.setSourceProperty(()=>{this._options.tiles=o}),this}setUrl(o){return this.setSourceProperty(()=>{this.url=o,this._options.url=o}),this}serialize(){return a.e({},this._options)}hasTile(o){return!this.tileBounds||this.tileBounds.contains(o.canonical)}loadTile(o){return a._(this,void 0,void 0,function*(){const h=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);o.abortController=new AbortController;try{const p=yield G.getImage(this.map._requestManager.transformRequest(h,"Tile"),o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(p&&p.data){this.map._refreshExpiredTiles&&p.cacheControl&&p.expires&&o.setExpiryData({cacheControl:p.cacheControl,expires:p.expires});const m=this.map.painter.context,v=m.gl,E=p.data;o.texture=this.map.painter.getTileTexture(E.width),o.texture?o.texture.update(E,{useMipmap:!0}):(o.texture=new re(m,E,v.RGBA,{useMipmap:!0}),o.texture.bind(v.LINEAR,v.CLAMP_TO_EDGE,v.LINEAR_MIPMAP_NEAREST),m.extTextureFilterAnisotropic&&v.texParameterf(v.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax)),o.state="loaded"}}catch(p){if(delete o.abortController,o.aborted)o.state="unloaded";else if(p)throw o.state="errored",p}})}abortTile(o){return a._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController)})}unloadTile(o){return a._(this,void 0,void 0,function*(){o.texture&&this.map.painter.saveTileTexture(o.texture)})}hasTransition(){return!1}}class wr extends ne{constructor(o,h,p,m){super(o,h,p,m),this.type="raster-dem",this.maxzoom=22,this._options=a.e({type:"raster-dem"},h),this.encoding=h.encoding||"mapbox",this.redFactor=h.redFactor,this.greenFactor=h.greenFactor,this.blueFactor=h.blueFactor,this.baseShift=h.baseShift}loadTile(o){return a._(this,void 0,void 0,function*(){const h=o.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),p=this.map._requestManager.transformRequest(h,"Tile");o.neighboringTiles=this._getNeighboringTiles(o.tileID),o.abortController=new AbortController;try{const m=yield G.getImage(p,o.abortController,this.map._refreshExpiredTiles);if(delete o.abortController,o.aborted)return void(o.state="unloaded");if(m&&m.data){const v=m.data;this.map._refreshExpiredTiles&&m.cacheControl&&m.expires&&o.setExpiryData({cacheControl:m.cacheControl,expires:m.expires});const E=a.b(v)&&a.S()?v:yield this.readImageNow(v),M={type:this.type,uid:o.uid,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!o.actor||o.state==="expired"){o.actor=this.dispatcher.getActor();const A=yield o.actor.sendAsync({type:"LDT",data:M});o.dem=A,o.needsHillshadePrepare=!0,o.needsTerrainPrepare=!0,o.state="loaded"}}}catch(m){if(delete o.abortController,o.aborted)o.state="unloaded";else if(m)throw o.state="errored",m}})}readImageNow(o){return a._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&a.U()){const h=o.width+2,p=o.height+2;try{return new a.R({width:h,height:p},yield a.V(o,-1,-1,h,p))}catch{}}return k.getImageData(o,1)})}_getNeighboringTiles(o){const h=o.canonical,p=Math.pow(2,h.z),m=(h.x-1+p)%p,v=h.x===0?o.wrap-1:o.wrap,E=(h.x+1+p)%p,M=h.x+1===p?o.wrap+1:o.wrap,A={};return A[new a.Q(o.overscaledZ,v,h.z,m,h.y).key]={backfilled:!1},A[new a.Q(o.overscaledZ,M,h.z,E,h.y).key]={backfilled:!1},h.y>0&&(A[new a.Q(o.overscaledZ,v,h.z,m,h.y-1).key]={backfilled:!1},A[new a.Q(o.overscaledZ,o.wrap,h.z,h.x,h.y-1).key]={backfilled:!1},A[new a.Q(o.overscaledZ,M,h.z,E,h.y-1).key]={backfilled:!1}),h.y+10&&a.e(v,{resourceTiming:m}),this.fire(new a.k("data",Object.assign(Object.assign({},v),{sourceDataType:"metadata"}))),this.fire(new a.k("data",Object.assign(Object.assign({},v),{sourceDataType:"content"})))}catch(p){if(this._pendingLoads--,this._removed)return void this.fire(new a.k("dataabort",{dataType:"source"}));this.fire(new a.j(p))}})}loaded(){return this._pendingLoads===0}loadTile(o){return a._(this,void 0,void 0,function*(){const h=o.actor?"RT":"LT";o.actor=this.actor;const p={type:this.type,uid:o.uid,tileID:o.tileID,zoom:o.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};o.abortController=new AbortController;const m=yield this.actor.sendAsync({type:h,data:p},o.abortController);delete o.abortController,o.unloadVectorData(),o.aborted||o.loadVectorData(m,this.map.painter,h==="RT")})}abortTile(o){return a._(this,void 0,void 0,function*(){o.abortController&&(o.abortController.abort(),delete o.abortController),o.aborted=!0})}unloadTile(o){return a._(this,void 0,void 0,function*(){o.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:o.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return a.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ye=a.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ut extends a.E{constructor(o,h,p,m){super(),this.id=o,this.dispatcher=p,this.coordinates=h.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(m),this.options=h}load(o){return a._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new a.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const h=yield G.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,h&&h.data&&(this.image=h.data,o&&(this.coordinates=o),this._finishLoading())}catch(h){this._request=null,this._loaded=!0,this.fire(new a.j(h))}})}loaded(){return this._loaded}updateImage(o){return o.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=o.url,this.load(o.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(o){this.map=o,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(o){this.coordinates=o;const h=o.map(a.Y.fromLngLat);this.tileID=function(m){let v=1/0,E=1/0,M=-1/0,A=-1/0;for(const Q of m)v=Math.min(v,Q.x),E=Math.min(E,Q.y),M=Math.max(M,Q.x),A=Math.max(A,Q.y);const R=Math.max(M-v,A-E),V=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),q=Math.pow(2,V);return new a.a0(V,Math.floor((v+M)/2*q),Math.floor((E+A)/2*q))}(h),this.minzoom=this.maxzoom=this.tileID.z;const p=h.map(m=>this.tileID.getTilePoint(m)._round());return this._boundsArray=new a.Z,this._boundsArray.emplaceBack(p[0].x,p[0].y,0,0),this._boundsArray.emplaceBack(p[1].x,p[1].y,a.W,0),this._boundsArray.emplaceBack(p[3].x,p[3].y,0,a.W),this._boundsArray.emplaceBack(p[2].x,p[2].y,a.W,a.W),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const o=this.map.painter.context,h=o.gl;this.boundsBuffer||(this.boundsBuffer=o.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=a.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new re(o,this.image,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let p=!1;for(const m in this.tiles){const v=this.tiles[m];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,p=!0)}p&&this.fire(new a.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(o){return a._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(o.tileID.canonical)?(this.tiles[String(o.tileID.wrap)]=o,o.buckets={}):o.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class bn extends Ut{constructor(o,h,p,m){super(o,h,p,m),this.roundZoom=!0,this.type="video",this.options=h}load(){return a._(this,void 0,void 0,function*(){this._loaded=!1;const o=this.options;this.urls=[];for(const h of o.urls)this.urls.push(this.map._requestManager.transformRequest(h,"Source").url);try{const h=yield a.a2(this.urls);if(this._loaded=!0,!h)return;this.video=h,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(h){this.fire(new a.j(h))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(o){if(this.video){const h=this.video.seekable;oh.end(0)?this.fire(new a.j(new a.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${h.start(0)} and ${h.end(0)}-second mark.`))):this.video.currentTime=o}}getVideo(){return this.video}onAdd(o){this.map||(this.map=o,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const o=this.map.painter.context,h=o.gl;this.boundsBuffer||(this.boundsBuffer=o.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=a.$.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.texSubImage2D(h.TEXTURE_2D,0,0,0,h.RGBA,h.UNSIGNED_BYTE,this.video)):(this.texture=new re(o,this.video,h.RGBA),this.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE));let p=!1;for(const m in this.tiles){const v=this.tiles[m];v.state!=="loaded"&&(v.state="loaded",v.texture=this.texture,p=!0)}p&&this.fire(new a.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class wn extends Ut{constructor(o,h,p,m){super(o,h,p,m),h.coordinates?Array.isArray(h.coordinates)&&h.coordinates.length===4&&!h.coordinates.some(v=>!Array.isArray(v)||v.length!==2||v.some(E=>typeof E!="number"))||this.fire(new a.j(new a.a1(`sources.${o}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.j(new a.a1(`sources.${o}`,null,'missing required property "coordinates"'))),h.animate&&typeof h.animate!="boolean"&&this.fire(new a.j(new a.a1(`sources.${o}`,null,'optional "animate" property must be a boolean value'))),h.canvas?typeof h.canvas=="string"||h.canvas instanceof HTMLCanvasElement||this.fire(new a.j(new a.a1(`sources.${o}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new a.j(new a.a1(`sources.${o}`,null,'missing required property "canvas"'))),this.options=h,this.animate=h.animate===void 0||h.animate}load(){return a._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new a.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(o){this.map=o,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let o=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,o=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,o=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const h=this.map.painter.context,p=h.gl;this.boundsBuffer||(this.boundsBuffer=h.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=a.$.simpleSegment(0,0,4,2)),this.texture?(o||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new re(h,this.canvas,p.RGBA,{premultiply:!0});let m=!1;for(const v in this.tiles){const E=this.tiles[v];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,m=!0)}m&&this.fire(new a.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const o of[this.canvas.width,this.canvas.height])if(isNaN(o)||o<=0)return!0;return!1}}const Mn={},ni=y=>{switch(y){case"geojson":return We;case"image":return Ut;case"raster":return ne;case"raster-dem":return wr;case"vector":return it;case"video":return bn;case"canvas":return wn}return Mn[y]},ii="RTLPluginLoaded";class $o extends a.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Pr()}_syncState(o){return this.status=o,this.dispatcher.broadcast("SRPS",{pluginStatus:o,pluginURL:this.url}).catch(h=>{throw this.status="error",h})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(o){return a._(this,arguments,void 0,function*(h,p=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=k.resolveURL(h),!this.url)throw new Error(`requested url ${h} is invalid`);if(this.status==="unavailable"){if(!p)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return a._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new a.k(ii))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Jr=null;function lt(){return Jr||(Jr=new $o),Jr}class Xn{constructor(o,h){this.timeAdded=0,this.fadeEndTime=0,this.tileID=o,this.uid=a.a3(),this.uses=0,this.tileSize=h,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(o){const h=o+this.timeAdded;hv.getLayer(R)).filter(Boolean);if(A.length!==0){M.layers=A,M.stateDependentLayerIds&&(M.stateDependentLayers=M.stateDependentLayerIds.map(R=>A.filter(V=>V.id===R)[0]));for(const R of A)E[R.id]=M}}return E}(o.buckets,h.style),this.hasSymbolBuckets=!1;for(const m in this.buckets){const v=this.buckets[m];if(v instanceof a.a5){if(this.hasSymbolBuckets=!0,!p)break;v.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const m in this.buckets){const v=this.buckets[m];if(v instanceof a.a5&&v.hasRTLText){this.hasRTLText=!0,lt().lazyLoad();break}}this.queryPadding=0;for(const m in this.buckets){const v=this.buckets[m];this.queryPadding=Math.max(this.queryPadding,h.style.getLayer(m).queryRadius(v))}o.imageAtlas&&(this.imageAtlas=o.imageAtlas),o.glyphAtlasImage&&(this.glyphAtlasImage=o.glyphAtlasImage)}else this.collisionBoxArray=new a.a4}unloadVectorData(){for(const o in this.buckets)this.buckets[o].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(o){return this.buckets[o.id]}upload(o){for(const p in this.buckets){const m=this.buckets[p];m.uploadPending()&&m.upload(o)}const h=o.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new re(o,this.imageAtlas.image,h.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new re(o,this.glyphAtlasImage,h.ALPHA),this.glyphAtlasImage=null)}prepare(o){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(o,this.imageAtlasTexture)}queryRenderedFeatures(o,h,p,m,v,E,M,A,R,V){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:m,cameraQueryGeometry:v,scale:E,tileSize:this.tileSize,pixelPosMatrix:V,transform:A,params:M,queryPadding:this.queryPadding*R},o,h,p):{}}querySourceFeatures(o,h){const p=this.latestFeatureIndex;if(!p||!p.rawTileData)return;const m=p.loadVTLayers(),v=h&&h.sourceLayer?h.sourceLayer:"",E=m._geojsonTileLayer||m[v];if(!E)return;const M=a.a6(h&&h.filter),{z:A,x:R,y:V}=this.tileID.canonical,q={z:A,x:R,y:V};for(let Q=0;Qp)m=!1;else if(h)if(this.expirationTime{this.remove(o,v)},p)),this.data[m].push(v),this.order.push(m),this.order.length>this.max){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}has(o){return o.wrapped().key in this.data}getAndRemove(o){return this.has(o)?this._getAndRemoveByKey(o.wrapped().key):null}_getAndRemoveByKey(o){const h=this.data[o].shift();return h.timeout&&clearTimeout(h.timeout),this.data[o].length===0&&delete this.data[o],this.order.splice(this.order.indexOf(o),1),h.value}getByKey(o){const h=this.data[o];return h?h[0].value:null}get(o){return this.has(o)?this.data[o.wrapped().key][0].value:null}remove(o,h){if(!this.has(o))return this;const p=o.wrapped().key,m=h===void 0?0:this.data[p].indexOf(h),v=this.data[p][m];return this.data[p].splice(m,1),v.timeout&&clearTimeout(v.timeout),this.data[p].length===0&&delete this.data[p],this.onRemove(v.value),this.order.splice(this.order.indexOf(p),1),this}setMaxSize(o){for(this.max=o;this.order.length>this.max;){const h=this._getAndRemoveByKey(this.order[0]);h&&this.onRemove(h)}return this}filter(o){const h=[];for(const p in this.data)for(const m of this.data[p])o(m.value)||h.push(m);for(const p of h)this.remove(p.value.tileID,p)}}class Bo{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(o,h,p){const m=String(h);if(this.stateChanges[o]=this.stateChanges[o]||{},this.stateChanges[o][m]=this.stateChanges[o][m]||{},a.e(this.stateChanges[o][m],p),this.deletedStates[o]===null){this.deletedStates[o]={};for(const v in this.state[o])v!==m&&(this.deletedStates[o][v]=null)}else if(this.deletedStates[o]&&this.deletedStates[o][m]===null){this.deletedStates[o][m]={};for(const v in this.state[o][m])p[v]||(this.deletedStates[o][m][v]=null)}else for(const v in p)this.deletedStates[o]&&this.deletedStates[o][m]&&this.deletedStates[o][m][v]===null&&delete this.deletedStates[o][m][v]}removeFeatureState(o,h,p){if(this.deletedStates[o]===null)return;const m=String(h);if(this.deletedStates[o]=this.deletedStates[o]||{},p&&h!==void 0)this.deletedStates[o][m]!==null&&(this.deletedStates[o][m]=this.deletedStates[o][m]||{},this.deletedStates[o][m][p]=null);else if(h!==void 0)if(this.stateChanges[o]&&this.stateChanges[o][m])for(p in this.deletedStates[o][m]={},this.stateChanges[o][m])this.deletedStates[o][m][p]=null;else this.deletedStates[o][m]=null;else this.deletedStates[o]=null}getState(o,h){const p=String(h),m=a.e({},(this.state[o]||{})[p],(this.stateChanges[o]||{})[p]);if(this.deletedStates[o]===null)return{};if(this.deletedStates[o]){const v=this.deletedStates[o][h];if(v===null)return{};for(const E in v)delete m[E]}return m}initializeTileState(o,h){o.setFeatureState(this.state,h)}coalesceChanges(o,h){const p={};for(const m in this.stateChanges){this.state[m]=this.state[m]||{};const v={};for(const E in this.stateChanges[m])this.state[m][E]||(this.state[m][E]={}),a.e(this.state[m][E],this.stateChanges[m][E]),v[E]=this.state[m][E];p[m]=v}for(const m in this.deletedStates){this.state[m]=this.state[m]||{};const v={};if(this.deletedStates[m]===null)for(const E in this.state[m])v[E]={},this.state[m][E]={};else for(const E in this.deletedStates[m]){if(this.deletedStates[m][E]===null)this.state[m][E]={};else for(const M of Object.keys(this.deletedStates[m][E]))delete this.state[m][E][M];v[E]=this.state[m][E]}p[m]=p[m]||{},a.e(p[m],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(p).length!==0)for(const m in o)o[m].setFeatureState(p,h)}}class Or extends a.E{constructor(o,h,p){super(),this.id=o,this.dispatcher=p,this.on("data",m=>this._dataHandler(m)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((m,v,E,M)=>{const A=new(ni(v.type))(m,v,E,M);if(A.id!==m)throw new Error(`Expected Source id to be ${m} instead of ${A.id}`);return A})(o,h,p,this),this._tiles={},this._cache=new xn(0,m=>this._unloadTile(m)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Bo,this._didEmitContent=!1,this._updated=!1}onAdd(o){this.map=o,this._maxTileCacheSize=o?o._maxTileCacheSize:null,this._maxTileCacheZoomLevels=o?o._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(o)}onRemove(o){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(o)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const o in this._tiles){const h=this._tiles[o];if(h.state!=="loaded"&&h.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const o=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,o&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(o,h,p){return a._(this,void 0,void 0,function*(){try{yield this._source.loadTile(o),this._tileLoaded(o,h,p)}catch(m){o.state="errored",m.status!==404?this._source.fire(new a.j(m,{tile:o})):this.update(this.transform,this.terrain)}})}_unloadTile(o){this._source.unloadTile&&this._source.unloadTile(o)}_abortTile(o){this._source.abortTile&&this._source.abortTile(o),this._source.fire(new a.k("dataabort",{tile:o,coord:o.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(o){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const h in this._tiles){const p=this._tiles[h];p.upload(o),p.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(o=>o.tileID).sort(mt).map(o=>o.key)}getRenderableIds(o){const h=[];for(const p in this._tiles)this._isIdRenderable(p,o)&&h.push(this._tiles[p]);return o?h.sort((p,m)=>{const v=p.tileID,E=m.tileID,M=new a.P(v.canonical.x,v.canonical.y)._rotate(this.transform.angle),A=new a.P(E.canonical.x,E.canonical.y)._rotate(this.transform.angle);return v.overscaledZ-E.overscaledZ||A.y-M.y||A.x-M.x}).map(p=>p.tileID.key):h.map(p=>p.tileID).sort(mt).map(p=>p.key)}hasRenderableParent(o){const h=this.findLoadedParent(o,0);return!!h&&this._isIdRenderable(h.tileID.key)}_isIdRenderable(o,h){return this._tiles[o]&&this._tiles[o].hasData()&&!this._coveredTiles[o]&&(h||!this._tiles[o].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const o in this._tiles)this._tiles[o].state!=="errored"&&this._reloadTile(o,"reloading")}}_reloadTile(o,h){return a._(this,void 0,void 0,function*(){const p=this._tiles[o];p&&(p.state!=="loading"&&(p.state=h),yield this._loadTile(p,o,h))})}_tileLoaded(o,h,p){o.timeAdded=k.now(),p==="expired"&&(o.refreshedUponExpiration=!0),this._setTileReloadTimer(h,o),this.getSource().type==="raster-dem"&&o.dem&&this._backfillDEM(o),this._state.initializeTileState(o,this.map?this.map.painter:null),o.aborted||this._source.fire(new a.k("data",{dataType:"source",tile:o,coord:o.tileID}))}_backfillDEM(o){const h=this.getRenderableIds();for(let m=0;m1||(Math.abs(E)>1&&(Math.abs(E+A)===1?E+=A:Math.abs(E-A)===1&&(E-=A)),v.dem&&m.dem&&(m.dem.backfillBorder(v.dem,E,M),m.neighboringTiles&&m.neighboringTiles[R]&&(m.neighboringTiles[R].backfilled=!0)))}}getTile(o){return this.getTileByID(o.key)}getTileByID(o){return this._tiles[o]}_retainLoadedChildren(o,h,p,m){for(const v in this._tiles){let E=this._tiles[v];if(m[v]||!E.hasData()||E.tileID.overscaledZ<=h||E.tileID.overscaledZ>p)continue;let M=E.tileID;for(;E&&E.tileID.overscaledZ>h+1;){const R=E.tileID.scaledTo(E.tileID.overscaledZ-1);E=this._tiles[R.key],E&&E.hasData()&&(M=R)}let A=M;for(;A.overscaledZ>h;)if(A=A.scaledTo(A.overscaledZ-1),o[A.key]){m[M.key]=M;break}}}findLoadedParent(o,h){if(o.key in this._loadedParentTiles){const p=this._loadedParentTiles[o.key];return p&&p.tileID.overscaledZ>=h?p:null}for(let p=o.overscaledZ-1;p>=h;p--){const m=o.scaledTo(p),v=this._getLoadedTile(m);if(v)return v}}_getLoadedTile(o){const h=this._tiles[o.key];return h&&h.hasData()?h:this._cache.getByKey(o.wrapped().key)}updateCacheSize(o){const h=Math.ceil(o.width/this._source.tileSize)+1,p=Math.ceil(o.height/this._source.tileSize)+1,m=Math.floor(h*p*(this._maxTileCacheZoomLevels===null?a.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),v=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,m):m;this._cache.setMaxSize(v)}handleWrapJump(o){const h=Math.round((o-(this._prevLng===void 0?o:this._prevLng))/360);if(this._prevLng=o,h){const p={};for(const m in this._tiles){const v=this._tiles[m];v.tileID=v.tileID.unwrapTo(v.tileID.wrap+h),p[v.tileID.key]=v}this._tiles=p;for(const m in this._timers)clearTimeout(this._timers[m]),delete this._timers[m];for(const m in this._tiles)this._setTileReloadTimer(m,this._tiles[m])}}update(o,h){if(!this._sourceLoaded||this._paused)return;let p;this.transform=o,this.terrain=h,this.updateCacheSize(o),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?p=o.getVisibleUnwrappedCoordinates(this._source.tileID).map(V=>new a.Q(V.canonical.z,V.wrap,V.canonical.z,V.canonical.x,V.canonical.y)):(p=o.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:h}),this._source.hasTile&&(p=p.filter(V=>this._source.hasTile(V)))):p=[];const m=o.coveringZoomLevel(this._source),v=Math.max(m-Or.maxOverzooming,this._source.minzoom),E=Math.max(m+Or.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const V={};for(const q of p)if(q.canonical.z>this._source.minzoom){const Q=q.scaledTo(q.canonical.z-1);V[Q.key]=Q;const he=q.scaledTo(Math.max(this._source.minzoom,Math.min(q.canonical.z,5)));V[he.key]=he}p=p.concat(Object.values(V))}const M=p.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,M&&this.fire(new a.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const A=this._updateRetainedTiles(p,m);if(rr(this._source.type)){const V={},q={},Q=Object.keys(A),he=k.now();for(const ue of Q){const ye=A[ue],se=this._tiles[ue];if(!se||se.fadeEndTime!==0&&se.fadeEndTime<=he)continue;const Te=this.findLoadedParent(ye,v);Te&&(this._addTile(Te.tileID),V[Te.tileID.key]=Te.tileID),q[ue]=ye}this._retainLoadedChildren(q,m,E,A);for(const ue in V)A[ue]||(this._coveredTiles[ue]=!0,A[ue]=V[ue]);if(h){const ue={},ye={};for(const se of p)this._tiles[se.key].hasData()?ue[se.key]=se:ye[se.key]=se;for(const se in ye){const Te=ye[se].children(this._source.maxzoom);this._tiles[Te[0].key]&&this._tiles[Te[1].key]&&this._tiles[Te[2].key]&&this._tiles[Te[3].key]&&(ue[Te[0].key]=A[Te[0].key]=Te[0],ue[Te[1].key]=A[Te[1].key]=Te[1],ue[Te[2].key]=A[Te[2].key]=Te[2],ue[Te[3].key]=A[Te[3].key]=Te[3],delete ye[se])}for(const se in ye){const Te=this.findLoadedParent(ye[se],this._source.minzoom);if(Te){ue[Te.tileID.key]=A[Te.tileID.key]=Te.tileID;for(const Ue in ue)ue[Ue].isChildOf(Te.tileID)&&delete ue[Ue]}}for(const se in this._tiles)ue[se]||(this._coveredTiles[se]=!0)}}for(const V in A)this._tiles[V].clearFadeHold();const R=a.ab(this._tiles,A);for(const V of R){const q=this._tiles[V];q.hasSymbolBuckets&&!q.holdingForFade()?q.setHoldDuration(this.map._fadeDuration):q.hasSymbolBuckets&&!q.symbolFadeFinished()||this._removeTile(V)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const o in this._tiles)this._tiles[o].holdingForFade()&&this._removeTile(o)}_updateRetainedTiles(o,h){const p={},m={},v=Math.max(h-Or.maxOverzooming,this._source.minzoom),E=Math.max(h+Or.maxUnderzooming,this._source.minzoom),M={};for(const A of o){const R=this._addTile(A);p[A.key]=A,R.hasData()||hthis._source.maxzoom){const q=A.children(this._source.maxzoom)[0],Q=this.getTile(q);if(Q&&Q.hasData()){p[q.key]=q;continue}}else{const q=A.children(this._source.maxzoom);if(p[q[0].key]&&p[q[1].key]&&p[q[2].key]&&p[q[3].key])continue}let V=R.wasRequested();for(let q=A.overscaledZ-1;q>=v;--q){const Q=A.scaledTo(q);if(m[Q.key])break;if(m[Q.key]=!0,R=this.getTile(Q),!R&&V&&(R=this._addTile(Q)),R){const he=R.hasData();if((V||he)&&(p[Q.key]=Q),V=R.wasRequested(),he)break}}}return p}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const o in this._tiles){const h=[];let p,m=this._tiles[o].tileID;for(;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){p=this._loadedParentTiles[m.key];break}h.push(m.key);const v=m.scaledTo(m.overscaledZ-1);if(p=this._getLoadedTile(v),p)break;m=v}for(const v of h)this._loadedParentTiles[v]=p}}_addTile(o){let h=this._tiles[o.key];if(h)return h;h=this._cache.getAndRemove(o),h&&(this._setTileReloadTimer(o.key,h),h.tileID=o,this._state.initializeTileState(h,this.map?this.map.painter:null),this._cacheTimers[o.key]&&(clearTimeout(this._cacheTimers[o.key]),delete this._cacheTimers[o.key],this._setTileReloadTimer(o.key,h)));const p=h;return h||(h=new Xn(o,this._source.tileSize*o.overscaleFactor()),this._loadTile(h,o.key,h.state)),h.uses++,this._tiles[o.key]=h,p||this._source.fire(new a.k("dataloading",{tile:h,coord:h.tileID,dataType:"source"})),h}_setTileReloadTimer(o,h){o in this._timers&&(clearTimeout(this._timers[o]),delete this._timers[o]);const p=h.getExpiryTimeout();p&&(this._timers[o]=setTimeout(()=>{this._reloadTile(o,"expired"),delete this._timers[o]},p))}_removeTile(o){const h=this._tiles[o];h&&(h.uses--,delete this._tiles[o],this._timers[o]&&(clearTimeout(this._timers[o]),delete this._timers[o]),h.uses>0||(h.hasData()&&h.state!=="reloading"?this._cache.add(h.tileID,h,h.getExpiryTimeout()):(h.aborted=!0,this._abortTile(h),this._unloadTile(h))))}_dataHandler(o){const h=o.sourceDataType;o.dataType==="source"&&h==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&o.dataType==="source"&&h==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const o in this._tiles)this._removeTile(o);this._cache.reset()}tilesIn(o,h,p){const m=[],v=this.transform;if(!v)return m;const E=p?v.getCameraQueryGeometry(o):o,M=o.map(ue=>v.pointCoordinate(ue,this.terrain)),A=E.map(ue=>v.pointCoordinate(ue,this.terrain)),R=this.getIds();let V=1/0,q=1/0,Q=-1/0,he=-1/0;for(const ue of A)V=Math.min(V,ue.x),q=Math.min(q,ue.y),Q=Math.max(Q,ue.x),he=Math.max(he,ue.y);for(let ue=0;ue=0&&we[1].y+Ue>=0){const Le=M.map(He=>se.getTilePoint(He)),Ge=A.map(He=>se.getTilePoint(He));m.push({tile:ye,tileID:se,queryGeometry:Le,cameraQueryGeometry:Ge,scale:Te})}}return m}getVisibleCoordinates(o){const h=this.getRenderableIds(o).map(p=>this._tiles[p].tileID);for(const p of h)p.posMatrix=this.transform.calculatePosMatrix(p.toUnwrapped());return h}hasTransition(){if(this._source.hasTransition())return!0;if(rr(this._source.type)){const o=k.now();for(const h in this._tiles)if(this._tiles[h].fadeEndTime>=o)return!0}return!1}setFeatureState(o,h,p){this._state.updateState(o=o||"_geojsonTileLayer",h,p)}removeFeatureState(o,h,p){this._state.removeFeatureState(o=o||"_geojsonTileLayer",h,p)}getFeatureState(o,h){return this._state.getState(o=o||"_geojsonTileLayer",h)}setDependencies(o,h,p){const m=this._tiles[o];m&&m.setDependencies(h,p)}reloadTilesForDependencies(o,h){for(const p in this._tiles)this._tiles[p].hasDependency(o,h)&&this._reloadTile(p,"reloading");this._cache.filter(p=>!p.hasDependency(o,h))}}function mt(y,o){const h=Math.abs(2*y.wrap)-+(y.wrap<0),p=Math.abs(2*o.wrap)-+(o.wrap<0);return y.overscaledZ-o.overscaledZ||p-h||o.canonical.y-y.canonical.y||o.canonical.x-y.canonical.x}function rr(y){return y==="raster"||y==="image"||y==="video"}Or.maxOverzooming=10,Or.maxUnderzooming=3;class Jt{constructor(o,h){this.reset(o,h)}reset(o,h){this.points=o||[],this._distances=[0];for(let p=1;p0?(m-E)/M:0;return this.points[v].mult(1-A).add(this.points[h].mult(A))}}function Nr(y,o){let h=!0;return y==="always"||y!=="never"&&o!=="never"||(h=!1),h}class vi{constructor(o,h,p){const m=this.boxCells=[],v=this.circleCells=[];this.xCellCount=Math.ceil(o/p),this.yCellCount=Math.ceil(h/p);for(let E=0;Ethis.width||m<0||h>this.height)return[];const A=[];if(o<=0&&h<=0&&this.width<=p&&this.height<=m){if(v)return[{key:null,x1:o,y1:h,x2:p,y2:m}];for(let R=0;R0}hitTestCircle(o,h,p,m,v){const E=o-p,M=o+p,A=h-p,R=h+p;if(M<0||E>this.width||R<0||A>this.height)return!1;const V=[];return this._forEachCell(E,A,M,R,this._queryCellCircle,V,{hitTest:!0,overlapMode:m,circle:{x:o,y:h,radius:p},seenUids:{box:{},circle:{}}},v),V.length>0}_queryCell(o,h,p,m,v,E,M,A){const{seenUids:R,hitTest:V,overlapMode:q}=M,Q=this.boxCells[v];if(Q!==null){const ue=this.bboxes;for(const ye of Q)if(!R.box[ye]){R.box[ye]=!0;const se=4*ye,Te=this.boxKeys[ye];if(o<=ue[se+2]&&h<=ue[se+3]&&p>=ue[se+0]&&m>=ue[se+1]&&(!A||A(Te))&&(!V||!Nr(q,Te.overlapMode))&&(E.push({key:Te,x1:ue[se],y1:ue[se+1],x2:ue[se+2],y2:ue[se+3]}),V))return!0}}const he=this.circleCells[v];if(he!==null){const ue=this.circles;for(const ye of he)if(!R.circle[ye]){R.circle[ye]=!0;const se=3*ye,Te=this.circleKeys[ye];if(this._circleAndRectCollide(ue[se],ue[se+1],ue[se+2],o,h,p,m)&&(!A||A(Te))&&(!V||!Nr(q,Te.overlapMode))){const Ue=ue[se],we=ue[se+1],Le=ue[se+2];if(E.push({key:Te,x1:Ue-Le,y1:we-Le,x2:Ue+Le,y2:we+Le}),V)return!0}}}return!1}_queryCellCircle(o,h,p,m,v,E,M,A){const{circle:R,seenUids:V,overlapMode:q}=M,Q=this.boxCells[v];if(Q!==null){const ue=this.bboxes;for(const ye of Q)if(!V.box[ye]){V.box[ye]=!0;const se=4*ye,Te=this.boxKeys[ye];if(this._circleAndRectCollide(R.x,R.y,R.radius,ue[se+0],ue[se+1],ue[se+2],ue[se+3])&&(!A||A(Te))&&!Nr(q,Te.overlapMode))return E.push(!0),!0}}const he=this.circleCells[v];if(he!==null){const ue=this.circles;for(const ye of he)if(!V.circle[ye]){V.circle[ye]=!0;const se=3*ye,Te=this.circleKeys[ye];if(this._circlesCollide(ue[se],ue[se+1],ue[se+2],R.x,R.y,R.radius)&&(!A||A(Te))&&!Nr(q,Te.overlapMode))return E.push(!0),!0}}}_forEachCell(o,h,p,m,v,E,M,A){const R=this._convertToXCellCoord(o),V=this._convertToYCellCoord(h),q=this._convertToXCellCoord(p),Q=this._convertToYCellCoord(m);for(let he=R;he<=q;he++)for(let ue=V;ue<=Q;ue++)if(v.call(this,o,h,p,m,this.xCellCount*ue+he,E,M,A))return}_convertToXCellCoord(o){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(o*this.xScale)))}_convertToYCellCoord(o){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(o*this.yScale)))}_circlesCollide(o,h,p,m,v,E){const M=m-o,A=v-h,R=p+E;return R*R>M*M+A*A}_circleAndRectCollide(o,h,p,m,v,E,M){const A=(E-m)/2,R=Math.abs(o-(m+A));if(R>A+p)return!1;const V=(M-v)/2,q=Math.abs(h-(v+V));if(q>V+p)return!1;if(R<=A||q<=V)return!0;const Q=R-A,he=q-V;return Q*Q+he*he<=p*p}}function Qt(y,o,h,p,m){const v=a.F();return o?(a.J(v,v,[1/m,1/m,1]),h||a.ad(v,v,p.angle)):a.K(v,p.labelPlaneMatrix,y),v}function ro(y,o,h,p,m){if(o){const v=a.ae(y);return a.J(v,v,[m,m,1]),h||a.ad(v,v,-p.angle),v}return p.glCoordMatrix}function an(y,o,h){let p;h?(p=[y.x,y.y,h(y.x,y.y),1],a.af(p,p,o)):(p=[y.x,y.y,0,1],Xe(p,p,o));const m=p[3];return{point:new a.P(p[0]/m,p[1]/m),signedDistanceFromCamera:m}}function pe(y,o){return .5+y/o*.5}function Z(y,o){const h=y[0]/y[3],p=y[1]/y[3];return h>=-o[0]&&h<=o[0]&&p>=-o[1]&&p<=o[1]}function $(y,o,h,p,m,v,E,M,A,R){const V=p?y.textSizeData:y.iconSizeData,q=a.ag(V,h.transform.zoom),Q=[256/h.width*2+1,256/h.height*2+1],he=p?y.text.dynamicLayoutVertexArray:y.icon.dynamicLayoutVertexArray;he.clear();const ue=y.lineVertexArray,ye=p?y.text.placedSymbolArray:y.icon.placedSymbolArray,se=h.transform.width/h.transform.height;let Te=!1;for(let Ue=0;UeMath.abs(h.x-o.x)*p?{useVertical:!0}:(y===a.ah.vertical?o.yh.x)?{needsFlipping:!0}:null}function Ce(y,o,h,p,m,v,E,M,A,R,V,q,Q,he,ue,ye){const se=o/24,Te=y.lineOffsetX*se,Ue=y.lineOffsetY*se;let we;if(y.numGlyphs>1){const Le=y.glyphStartIndex+y.numGlyphs,Ge=y.lineStartIndex,He=y.lineStartIndex+y.lineLength,$e=te(se,M,Te,Ue,h,V,q,y,A,v,Q,ue,ye);if(!$e)return{notEnoughRoom:!0};const nt=an($e.first.point,E,ye).point,et=an($e.last.point,E,ye).point;if(p&&!h){const ft=le(y.writingMode,nt,et,he);if(ft)return ft}we=[$e.first];for(let ft=y.glyphStartIndex+1;ft0?nt.point:Ie(q,$e,Ge,1,m,ye),ft=le(y.writingMode,Ge,et,he);if(ft)return ft}const Le=Be(se*M.getoffsetX(y.glyphStartIndex),Te,Ue,h,V,q,y.segment,y.lineStartIndex,y.lineStartIndex+y.lineLength,A,v,Q,ue,ye);if(!Le)return{notEnoughRoom:!0};we=[Le]}for(const Le of we)a.aj(R,Le.point,Le.angle);return{}}function Ie(y,o,h,p,m,v){const E=an(y.add(y.sub(o)._unit()),m,v).point,M=h.sub(E);return h.add(M._mult(p/M.mag()))}function Pe(y,o){const{projectionCache:h,lineVertexArray:p,labelPlaneMatrix:m,tileAnchorPoint:v,distanceFromAnchor:E,getElevation:M,previousVertex:A,direction:R,absOffsetX:V}=o;if(h.projections[y])return h.projections[y];const q=new a.P(p.getx(y),p.gety(y)),Q=an(q,m,M);if(Q.signedDistanceFromCamera>0)return h.projections[y]=Q.point,Q.point;const he=y-R;return Ie(E===0?v:new a.P(p.getx(he),p.gety(he)),q,A,V-E+1,m,M)}function Se(y,o,h){return y._unit()._perp()._mult(o*h)}function W(y,o,h,p,m,v,E,M){const{projectionCache:A,direction:R}=M;if(A.offsets[y])return A.offsets[y];const V=h.add(o);if(y+R=m)return A.offsets[y]=V,V;const q=Pe(y+R,M),Q=Se(q.sub(h),E,R),he=h.add(Q),ue=q.add(Q);return A.offsets[y]=a.ak(v,V,he,ue)||V,A.offsets[y]}function Be(y,o,h,p,m,v,E,M,A,R,V,q,Q,he){const ue=p?y-o:y+o;let ye=ue>0?1:-1,se=0;p&&(ye*=-1,se=Math.PI),ye<0&&(se+=Math.PI);let Te,Ue,we=ye>0?M+E:M+E+1,Le=m,Ge=m,He=0,$e=0;const nt=Math.abs(ue),et=[];let ft;for(;He+$e<=nt;){if(we+=ye,we=A)return null;He+=$e,Ge=Le,Ue=Te;const _t={projectionCache:q,lineVertexArray:R,labelPlaneMatrix:V,tileAnchorPoint:v,distanceFromAnchor:He,getElevation:he,previousVertex:Ge,direction:ye,absOffsetX:nt};if(Le=Pe(we,_t),h===0)et.push(Ge),ft=Le.sub(Ge);else{let Xt;const or=Le.sub(Ge);Xt=or.mag()===0?Se(Pe(we+ye,_t).sub(Le),h,ye):Se(or,h,ye),Ue||(Ue=Ge.add(Xt)),Te=W(we,Xt,Le,M,A,Ue,h,_t),et.push(Ue),ft=Te.sub(Ue)}$e=ft.mag()}const gt=ft._mult((nt-He)/$e)._add(Ue||Ge),ir=se+Math.atan2(Le.y-Ge.y,Le.x-Ge.x);return et.push(gt),{point:gt,angle:Q?ir:0,path:et}}const Fe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function qe(y,o){for(let h=0;h=1;cr--)or.push(_t.path[cr]);for(let cr=1;cran(dr,A,ue));or=cr.some(dr=>dr.signedDistanceFromCamera<=0)?[]:cr.map(dr=>dr.point)}let Yt=[];if(or.length>0){const cr=or[0].clone(),dr=or[0].clone();for(let hn=1;hn=ft.x&&dr.x<=gt.x&&cr.y>=ft.y&&dr.y<=gt.y?[or]:dr.xgt.x||dr.ygt.y?[]:a.al([or],ft.x,ft.y,gt.x,gt.y)}for(const cr of Yt){ir.reset(cr,.25*et);let dr=0;dr=ir.length<=.5*et?1:Math.ceil(ir.paddedLength/Sr)+1;for(let hn=0;hn=this.screenRightBoundary||mthis.screenBottomBoundary}isInsideGrid(o,h,p,m){return p>=0&&o=0&&hp.collisionGroupID===h}}return this.collisionGroups[o]}}function Bn(y,o,h,p,m){const{horizontalAlign:v,verticalAlign:E}=a.at(y);return new a.P(-(v-.5)*o+p[0]*m,-(E-.5)*h+p[1]*m)}function fi(y,o,h,p,m,v){const{x1:E,x2:M,y1:A,y2:R,anchorPointX:V,anchorPointY:q}=y,Q=new a.P(o,h);return p&&Q._rotate(m?v:-v),{x1:E+Q.x,y1:A+Q.y,x2:M+Q.x,y2:R+Q.y,anchorPointX:V,anchorPointY:q}}class bi{constructor(o,h,p,m,v){this.transform=o.clone(),this.terrain=h,this.collisionIndex=new Pt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=p,this.retainedQueryData={},this.collisionGroups=new ln(m),this.collisionCircleArrays={},this.prevPlacement=v,v&&(v.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(o,h,p,m){const v=p.getBucket(h),E=p.latestFeatureIndex;if(!v||!E||h.id!==v.layerIds[0])return;const M=p.collisionBoxArray,A=v.layers[0].layout,R=Math.pow(2,this.transform.zoom-p.tileID.overscaledZ),V=p.tileSize/a.W,q=this.transform.calculatePosMatrix(p.tileID.toUnwrapped()),Q=A.get("text-pitch-alignment")==="map",he=A.get("text-rotation-alignment")==="map",ue=$t(p,1,this.transform.zoom),ye=Qt(q,Q,he,this.transform,ue);let se=null;if(Q){const Ue=ro(q,Q,he,this.transform,ue);se=a.K([],this.transform.labelPlaneMatrix,Ue)}this.retainedQueryData[v.bucketInstanceId]=new lr(v.bucketInstanceId,E,v.sourceLayerIndex,v.index,p.tileID);const Te={bucket:v,layout:A,posMatrix:q,textLabelPlaneMatrix:ye,labelToScreenMatrix:se,scale:R,textPixelRatio:V,holdingForFade:p.holdingForFade(),collisionBoxArray:M,partiallyEvaluatedTextSize:a.ag(v.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(v.sourceID)};if(m)for(const Ue of v.sortKeyRanges){const{sortKey:we,symbolInstanceStart:Le,symbolInstanceEnd:Ge}=Ue;o.push({sortKey:we,symbolInstanceStart:Le,symbolInstanceEnd:Ge,parameters:Te})}else o.push({symbolInstanceStart:0,symbolInstanceEnd:v.symbolInstances.length,parameters:Te})}attemptAnchorPlacement(o,h,p,m,v,E,M,A,R,V,q,Q,he,ue,ye,se){const Te=a.ap[o.textAnchor],Ue=[o.textOffset0,o.textOffset1],we=Bn(Te,p,m,Ue,v),Le=this.collisionIndex.placeCollisionBox(fi(h,we.x,we.y,E,M,this.transform.angle),q,A,R,V.predicate,se);if((!ye||this.collisionIndex.placeCollisionBox(fi(ye,we.x,we.y,E,M,this.transform.angle),q,A,R,V.predicate,se).box.length!==0)&&Le.box.length>0){let Ge;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Q.crossTileID]&&this.prevPlacement.placements[Q.crossTileID]&&this.prevPlacement.placements[Q.crossTileID].text&&(Ge=this.prevPlacement.variableOffsets[Q.crossTileID].anchor),Q.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Q.crossTileID]={textOffset:Ue,width:p,height:m,anchor:Te,textBoxScale:v,prevAnchor:Ge},this.markUsedJustification(he,Te,Q,ue),he.allowVerticalPlacement&&(this.markUsedOrientation(he,ue,Q),this.placedOrientations[Q.crossTileID]=ue),{shift:we,placedGlyphBoxes:Le}}}placeLayerBucketPart(o,h,p){const{bucket:m,layout:v,posMatrix:E,textLabelPlaneMatrix:M,labelToScreenMatrix:A,textPixelRatio:R,holdingForFade:V,collisionBoxArray:q,partiallyEvaluatedTextSize:Q,collisionGroup:he}=o.parameters,ue=v.get("text-optional"),ye=v.get("icon-optional"),se=a.aq(v,"text-overlap","text-allow-overlap"),Te=se==="always",Ue=a.aq(v,"icon-overlap","icon-allow-overlap"),we=Ue==="always",Le=v.get("text-rotation-alignment")==="map",Ge=v.get("text-pitch-alignment")==="map",He=v.get("icon-text-fit")!=="none",$e=v.get("symbol-z-order")==="viewport-y",nt=Te&&(we||!m.hasIconData()||ye),et=we&&(Te||!m.hasTextData()||ue);!m.collisionArrays&&q&&m.deserializeCollisionBoxes(q);const ft=this.retainedQueryData[m.bucketInstanceId].tileID,gt=this.terrain?(_t,Xt)=>this.terrain.getElevation(ft,_t,Xt):null,ir=(_t,Xt)=>{var or,Sr;if(h[_t.crossTileID])return;if(V)return void(this.placements[_t.crossTileID]=new Yr(!1,!1,!1));let Yt=!1,cr=!1,dr=!0,hn=null,Rr={box:null,offscreen:null},Oi={box:null,offscreen:null},Fn=null,nn=null,On=null,Ni=0,bo=0,ts=0;Xt.textFeatureIndex?Ni=Xt.textFeatureIndex:_t.useRuntimeCollisionCircles&&(Ni=_t.featureIndex),Xt.verticalTextFeatureIndex&&(bo=Xt.verticalTextFeatureIndex);const Za=Xt.textBox;if(Za){const An=Ln=>{let sn=a.ah.horizontal;if(m.allowVerticalPlacement&&!Ln&&this.prevPlacement){const Ji=this.prevPlacement.placedOrientations[_t.crossTileID];Ji&&(this.placedOrientations[_t.crossTileID]=Ji,sn=Ji,this.markUsedOrientation(m,sn,_t))}return sn},on=(Ln,sn)=>{if(m.allowVerticalPlacement&&_t.numVerticalGlyphVertices>0&&Xt.verticalTextBox){for(const Ji of m.writingModes)if(Ji===a.ah.vertical?(Rr=sn(),Oi=Rr):Rr=Ln(),Rr&&Rr.box&&Rr.box.length)break}else Rr=Ln()},en=_t.textAnchorOffsetStartIndex,Ki=_t.textAnchorOffsetEndIndex;if(Ki===en){const Ln=(sn,Ji)=>{const Pn=this.collisionIndex.placeCollisionBox(sn,se,R,E,he.predicate,gt);return Pn&&Pn.box&&Pn.box.length&&(this.markUsedOrientation(m,Ji,_t),this.placedOrientations[_t.crossTileID]=Ji),Pn};on(()=>Ln(Za,a.ah.horizontal),()=>{const sn=Xt.verticalTextBox;return m.allowVerticalPlacement&&_t.numVerticalGlyphVertices>0&&sn?Ln(sn,a.ah.vertical):{box:null,offscreen:null}}),An(Rr&&Rr.box&&Rr.box.length)}else{let Ln=a.ap[(Sr=(or=this.prevPlacement)===null||or===void 0?void 0:or.variableOffsets[_t.crossTileID])===null||Sr===void 0?void 0:Sr.anchor];const sn=(Pn,yn,mu)=>{const ff=Pn.x2-Pn.x1,ws=Pn.y2-Pn.y1,xs=_t.textBoxScale,Wl=He&&Ue==="never"?yn:null;let ns={box:[],offscreen:!1},gu=se==="never"?1:2,df="never";Ln&&gu++;for(let _u=0;_usn(Za,Xt.iconBox,a.ah.horizontal),()=>{const Pn=Xt.verticalTextBox;return m.allowVerticalPlacement&&!(Rr&&Rr.box&&Rr.box.length)&&_t.numVerticalGlyphVertices>0&&Pn?sn(Pn,Xt.verticalIconBox,a.ah.vertical):{box:null,offscreen:null}}),Rr&&(Yt=Rr.box,dr=Rr.offscreen);const Ji=An(Rr&&Rr.box);if(!Yt&&this.prevPlacement){const Pn=this.prevPlacement.variableOffsets[_t.crossTileID];Pn&&(this.variableOffsets[_t.crossTileID]=Pn,this.markUsedJustification(m,Pn.anchor,_t,Ji))}}}if(Fn=Rr,Yt=Fn&&Fn.box&&Fn.box.length>0,dr=Fn&&Fn.offscreen,_t.useRuntimeCollisionCircles){const An=m.text.placedSymbolArray.get(_t.centerJustifiedTextSymbolIndex),on=a.ai(m.textSizeData,Q,An),en=v.get("text-padding");nn=this.collisionIndex.placeCollisionCircles(se,An,m.lineVertexArray,m.glyphOffsetArray,on,E,M,A,p,Ge,he.predicate,_t.collisionCircleDiameter,en,gt),nn.circles.length&&nn.collisionDetected&&!p&&a.w("Collisions detected, but collision boxes are not shown"),Yt=Te||nn.circles.length>0&&!nn.collisionDetected,dr=dr&&nn.offscreen}if(Xt.iconFeatureIndex&&(ts=Xt.iconFeatureIndex),Xt.iconBox){const An=on=>{const en=He&&hn?fi(on,hn.x,hn.y,Le,Ge,this.transform.angle):on;return this.collisionIndex.placeCollisionBox(en,Ue,R,E,he.predicate,gt)};Oi&&Oi.box&&Oi.box.length&&Xt.verticalIconBox?(On=An(Xt.verticalIconBox),cr=On.box.length>0):(On=An(Xt.iconBox),cr=On.box.length>0),dr=dr&&On.offscreen}const rs=ue||_t.numHorizontalGlyphVertices===0&&_t.numVerticalGlyphVertices===0,wo=ye||_t.numIconVertices===0;if(rs||wo?wo?rs||(cr=cr&&Yt):Yt=cr&&Yt:cr=Yt=cr&&Yt,Yt&&Fn&&Fn.box&&this.collisionIndex.insertCollisionBox(Fn.box,se,v.get("text-ignore-placement"),m.bucketInstanceId,Oi&&Oi.box&&bo?bo:Ni,he.ID),cr&&On&&this.collisionIndex.insertCollisionBox(On.box,Ue,v.get("icon-ignore-placement"),m.bucketInstanceId,ts,he.ID),nn&&(Yt&&this.collisionIndex.insertCollisionCircles(nn.circles,se,v.get("text-ignore-placement"),m.bucketInstanceId,Ni,he.ID),p)){const An=m.bucketInstanceId;let on=this.collisionCircleArrays[An];on===void 0&&(on=this.collisionCircleArrays[An]=new Cn);for(let en=0;en=0;--Xt){const or=_t[Xt];ir(m.symbolInstances.get(or),m.collisionArrays[or])}}else for(let _t=o.symbolInstanceStart;_t=0&&(o.text.placedSymbolArray.get(M).crossTileID=v>=0&&M!==v?0:p.crossTileID)}markUsedOrientation(o,h,p){const m=h===a.ah.horizontal||h===a.ah.horizontalOnly?h:0,v=h===a.ah.vertical?h:0,E=[p.leftJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.rightJustifiedTextSymbolIndex];for(const M of E)o.text.placedSymbolArray.get(M).placedOrientation=m;p.verticalPlacedTextSymbolIndex&&(o.text.placedSymbolArray.get(p.verticalPlacedTextSymbolIndex).placedOrientation=v)}commit(o){this.commitTime=o,this.zoomAtLastRecencyCheck=this.transform.zoom;const h=this.prevPlacement;let p=!1;this.prevZoomAdjustment=h?h.zoomAdjustment(this.transform.zoom):0;const m=h?h.symbolFadeChange(o):1,v=h?h.opacities:{},E=h?h.variableOffsets:{},M=h?h.placedOrientations:{};for(const A in this.placements){const R=this.placements[A],V=v[A];V?(this.opacities[A]=new _r(V,m,R.text,R.icon),p=p||R.text!==V.text.placed||R.icon!==V.icon.placed):(this.opacities[A]=new _r(null,m,R.text,R.icon,R.skipFade),p=p||R.text||R.icon)}for(const A in v){const R=v[A];if(!this.opacities[A]){const V=new _r(R,m,!1,!1);V.isHidden()||(this.opacities[A]=V,p=p||R.text.placed||R.icon.placed)}}for(const A in E)this.variableOffsets[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.variableOffsets[A]=E[A]);for(const A in M)this.placedOrientations[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.placedOrientations[A]=M[A]);if(h&&h.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");p?this.lastPlacementChangeTime=o:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=h?h.lastPlacementChangeTime:o)}updateLayerOpacities(o,h){const p={};for(const m of h){const v=m.getBucket(o);v&&m.latestFeatureIndex&&o.id===v.layerIds[0]&&this.updateBucketOpacities(v,p,m.collisionBoxArray)}}updateBucketOpacities(o,h,p){o.hasTextData()&&(o.text.opacityVertexArray.clear(),o.text.hasVisibleVertices=!1),o.hasIconData()&&(o.icon.opacityVertexArray.clear(),o.icon.hasVisibleVertices=!1),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexArray.clear(),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexArray.clear();const m=o.layers[0],v=m.layout,E=new _r(null,0,!1,!1,!0),M=v.get("text-allow-overlap"),A=v.get("icon-allow-overlap"),R=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),V=v.get("text-rotation-alignment")==="map",q=v.get("text-pitch-alignment")==="map",Q=v.get("icon-text-fit")!=="none",he=new _r(null,0,M&&(A||!o.hasIconData()||v.get("icon-optional")),A&&(M||!o.hasTextData()||v.get("text-optional")),!0);!o.collisionArrays&&p&&(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData())&&o.deserializeCollisionBoxes(p);const ue=(ye,se,Te)=>{for(let Ue=0;Ue0,He=this.placedOrientations[se.crossTileID],$e=He===a.ah.vertical,nt=He===a.ah.horizontal||He===a.ah.horizontalOnly;if(Te>0||Ue>0){const et=wi(Le.text);ue(o.text,Te,$e?ka:et),ue(o.text,Ue,nt?ka:et);const ft=Le.text.isHidden();[se.rightJustifiedTextSymbolIndex,se.centerJustifiedTextSymbolIndex,se.leftJustifiedTextSymbolIndex].forEach(_t=>{_t>=0&&(o.text.placedSymbolArray.get(_t).hidden=ft||$e?1:0)}),se.verticalPlacedTextSymbolIndex>=0&&(o.text.placedSymbolArray.get(se.verticalPlacedTextSymbolIndex).hidden=ft||nt?1:0);const gt=this.variableOffsets[se.crossTileID];gt&&this.markUsedJustification(o,gt.anchor,se,He);const ir=this.placedOrientations[se.crossTileID];ir&&(this.markUsedJustification(o,"left",se,ir),this.markUsedOrientation(o,ir,se))}if(Ge){const et=wi(Le.icon),ft=!(Q&&se.verticalPlacedIconSymbolIndex&&$e);se.placedIconSymbolIndex>=0&&(ue(o.icon,se.numIconVertices,ft?et:ka),o.icon.placedSymbolArray.get(se.placedIconSymbolIndex).hidden=Le.icon.isHidden()),se.verticalPlacedIconSymbolIndex>=0&&(ue(o.icon,se.numVerticalIconVertices,ft?ka:et),o.icon.placedSymbolArray.get(se.verticalPlacedIconSymbolIndex).hidden=Le.icon.isHidden())}if(o.hasIconCollisionBoxData()||o.hasTextCollisionBoxData()){const et=o.collisionArrays[ye];if(et){let ft=new a.P(0,0);if(et.textBox||et.verticalTextBox){let ir=!0;if(R){const _t=this.variableOffsets[we];_t?(ft=Bn(_t.anchor,_t.width,_t.height,_t.textOffset,_t.textBoxScale),V&&ft._rotate(q?this.transform.angle:-this.transform.angle)):ir=!1}et.textBox&&Kn(o.textCollisionBox.collisionVertexArray,Le.text.placed,!ir||$e,ft.x,ft.y),et.verticalTextBox&&Kn(o.textCollisionBox.collisionVertexArray,Le.text.placed,!ir||nt,ft.x,ft.y)}const gt=!!(!nt&&et.verticalIconBox);et.iconBox&&Kn(o.iconCollisionBox.collisionVertexArray,Le.icon.placed,gt,Q?ft.x:0,Q?ft.y:0),et.verticalIconBox&&Kn(o.iconCollisionBox.collisionVertexArray,Le.icon.placed,!gt,Q?ft.x:0,Q?ft.y:0)}}}if(o.sortFeatures(this.transform.angle),this.retainedQueryData[o.bucketInstanceId]&&(this.retainedQueryData[o.bucketInstanceId].featureSortOrder=o.featureSortOrder),o.hasTextData()&&o.text.opacityVertexBuffer&&o.text.opacityVertexBuffer.updateData(o.text.opacityVertexArray),o.hasIconData()&&o.icon.opacityVertexBuffer&&o.icon.opacityVertexBuffer.updateData(o.icon.opacityVertexArray),o.hasIconCollisionBoxData()&&o.iconCollisionBox.collisionVertexBuffer&&o.iconCollisionBox.collisionVertexBuffer.updateData(o.iconCollisionBox.collisionVertexArray),o.hasTextCollisionBoxData()&&o.textCollisionBox.collisionVertexBuffer&&o.textCollisionBox.collisionVertexBuffer.updateData(o.textCollisionBox.collisionVertexArray),o.text.opacityVertexArray.length!==o.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${o.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${o.text.layoutVertexArray.length}) / 4`);if(o.icon.opacityVertexArray.length!==o.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${o.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${o.icon.layoutVertexArray.length}) / 4`);if(o.bucketInstanceId in this.collisionCircleArrays){const ye=this.collisionCircleArrays[o.bucketInstanceId];o.placementInvProjMatrix=ye.invProjMatrix,o.placementViewportMatrix=ye.viewportMatrix,o.collisionCircleArray=ye.circles,delete this.collisionCircleArrays[o.bucketInstanceId]}}symbolFadeChange(o){return this.fadeDuration===0?1:(o-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(o){return Math.max(0,(this.transform.zoom-o)/1.5)}hasTransitions(o){return this.stale||o-this.lastPlacementChangeTimeo}setStale(){this.stale=!0}}function Kn(y,o,h,p,m){y.emplaceBack(o?1:0,h?1:0,p||0,m||0),y.emplaceBack(o?1:0,h?1:0,p||0,m||0),y.emplaceBack(o?1:0,h?1:0,p||0,m||0),y.emplaceBack(o?1:0,h?1:0,p||0,m||0)}const mo=Math.pow(2,25),Ch=Math.pow(2,24),Wd=Math.pow(2,17),zr=Math.pow(2,16),Fc=Math.pow(2,9),Oc=Math.pow(2,8),Ri=Math.pow(2,1);function wi(y){if(y.opacity===0&&!y.placed)return 0;if(y.opacity===1&&y.placed)return 4294967295;const o=y.placed?1:0,h=Math.floor(127*y.opacity);return h*mo+o*Ch+h*Wd+o*zr+h*Fc+o*Oc+h*Ri+o}const ka=0;class $i{constructor(o){this._sortAcrossTiles=o.layout.get("symbol-z-order")!=="viewport-y"&&!o.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(o,h,p,m,v){const E=this._bucketParts;for(;this._currentTileIndexM.sortKey-A.sortKey));this._currentPartIndex!this._forceFullPlacement&&k.now()-m>2;for(;this._currentPlacementIndex>=0;){const E=h[o[this._currentPlacementIndex]],M=this.placement.collisionIndex.transform.zoom;if(E.type==="symbol"&&(!E.minzoom||E.minzoom<=M)&&(!E.maxzoom||E.maxzoom>M)){if(this._inProgressLayer||(this._inProgressLayer=new $i(E)),this._inProgressLayer.continuePlacement(p[E.source],this.placement,this._showCollisionBoxes,E,v))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(o){return this.placement.commit(o),this.placement}}const Ns=512/a.W/2;class sl{constructor(o,h,p){this.tileID=o,this.bucketInstanceId=p,this._symbolsByKey={};const m=new Map;for(let v=0;v({x:Math.floor(A.anchorX*Ns),y:Math.floor(A.anchorY*Ns)})),crossTileIDs:E.map(A=>A.crossTileID)};if(M.positions.length>128){const A=new a.au(M.positions.length,16,Uint16Array);for(const{x:R,y:V}of M.positions)A.add(R,V);A.finish(),delete M.positions,M.index=A}this._symbolsByKey[v]=M}}getScaledCoordinates(o,h){const{x:p,y:m,z:v}=this.tileID.canonical,{x:E,y:M,z:A}=h.canonical,R=Ns/Math.pow(2,A-v),V=(M*a.W+o.anchorY)*R,q=m*a.W*Ns;return{x:Math.floor((E*a.W+o.anchorX)*R-p*a.W*Ns),y:Math.floor(V-q)}}findMatches(o,h,p){const m=this.tileID.canonical.zo)}}class In{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ta{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(o){const h=Math.round((o-this.lng)/360);if(h!==0)for(const p in this.indexes){const m=this.indexes[p],v={};for(const E in m){const M=m[E];M.tileID=M.tileID.unwrapTo(M.tileID.wrap+h),v[M.tileID.key]=M}this.indexes[p]=v}this.lng=o}addBucket(o,h,p){if(this.indexes[o.overscaledZ]&&this.indexes[o.overscaledZ][o.key]){if(this.indexes[o.overscaledZ][o.key].bucketInstanceId===h.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(o.overscaledZ,this.indexes[o.overscaledZ][o.key])}for(let v=0;vo.overscaledZ)for(const M in E){const A=E[M];A.tileID.isChildOf(o)&&A.findMatches(h.symbolInstances,o,m)}else{const M=E[o.scaledTo(Number(v)).key];M&&M.findMatches(h.symbolInstances,o,m)}}for(let v=0;v{h[p]=!0});for(const p in this.layerIndexes)h[p]||delete this.layerIndexes[p]}}const rn=(y,o)=>a.t(y,o&&o.filter(h=>h.identifier!=="source.canvas")),al=a.av();class Bi extends a.E{constructor(o,h={}){super(),this._rtlPluginLoaded=()=>{for(const p in this.sourceCaches){const m=this.sourceCaches[p].getSource().type;m!=="vector"&&m!=="geojson"||this.sourceCaches[p].reload()}},this.map=o,this.dispatcher=new tr(nr(),o._getMapId()),this.dispatcher.registerMessageHandler("GG",(p,m)=>this.getGlyphs(p,m)),this.dispatcher.registerMessageHandler("GI",(p,m)=>this.getImages(p,m)),this.imageManager=new Ze,this.imageManager.setEventedParent(this),this.glyphManager=new Ot(o._requestManager,h.localIdeographFontFamily),this.lineAtlas=new Lt(256,512),this.crossTileSymbolIndex=new Xo,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",a.ax()),lt().on(ii,this._rtlPluginLoaded),this.on("data",p=>{if(p.dataType!=="source"||p.sourceDataType!=="metadata")return;const m=this.sourceCaches[p.sourceId];if(!m)return;const v=m.getSource();if(v&&v.vectorLayerIds)for(const E in this._layers){const M=this._layers[E];M.source===v.id&&this._validateLayer(M)}})}loadURL(o,h={},p){this.fire(new a.k("dataloading",{dataType:"style"})),h.validate=typeof h.validate!="boolean"||h.validate;const m=this.map._requestManager.transformRequest(o,"Style");this._loadStyleRequest=new AbortController,a.h(m,this._loadStyleRequest).then(v=>{this._loadStyleRequest=null,this._load(v.data,h,p)}).catch(v=>{this._loadStyleRequest=null,v&&this.fire(new a.j(v))})}loadJSON(o,h={},p){this.fire(new a.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,k.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,h.validate=h.validate!==!1,this._load(o,h,p)}).catch(()=>{})}loadEmpty(){this.fire(new a.k("dataloading",{dataType:"style"})),this._load(al,{validate:!1})}_load(o,h,p){var m;const v=h.transformStyle?h.transformStyle(p,o):o;if(!h.validate||!rn(this,a.x(v))){this._loaded=!0,this.stylesheet=v;for(const E in v.sources)this.addSource(E,v.sources[E],{validate:!1});v.sprite?this._loadSprite(v.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(v.glyphs),this._createLayers(),this.light=new vt(this.stylesheet.light),this.map.setTerrain((m=this.stylesheet.terrain)!==null&&m!==void 0?m:null),this.fire(new a.k("data",{dataType:"style"})),this.fire(new a.k("style.load"))}}_createLayers(){const o=a.ay(this.stylesheet.layers);this.dispatcher.broadcast("SL",o),this._order=o.map(h=>h.id),this._layers={},this._serializedLayers=null;for(const h of o){const p=a.az(h);p.setEventedParent(this,{layer:{id:h.id}}),this._layers[h.id]=p}}_loadSprite(o,h=!1,p=void 0){let m;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(v,E,M,A){return a._(this,void 0,void 0,function*(){const R=ze(v),V=M>1?"@2x":"",q={},Q={};for(const{id:he,url:ue}of R){const ye=E.transformRequest(E.normalizeSpriteURL(ue,V,".json"),"SpriteJSON");q[he]=a.h(ye,A);const se=E.transformRequest(E.normalizeSpriteURL(ue,V,".png"),"SpriteImage");Q[he]=G.getImage(se,A)}return yield Promise.all([...Object.values(q),...Object.values(Q)]),function(he,ue){return a._(this,void 0,void 0,function*(){const ye={};for(const se in he){ye[se]={};const Te=k.getImageCanvasContext((yield ue[se]).data),Ue=(yield he[se]).data;for(const we in Ue){const{width:Le,height:Ge,x:He,y:$e,sdf:nt,pixelRatio:et,stretchX:ft,stretchY:gt,content:ir}=Ue[we];ye[se][we]={data:null,pixelRatio:et,sdf:nt,stretchX:ft,stretchY:gt,content:ir,spriteData:{width:Le,height:Ge,x:He,y:$e,context:Te}}}}return ye})}(q,Q)})}(o,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(v=>{if(this._spriteRequest=null,v)for(const E in v){this._spritesImagesIds[E]=[];const M=this._spritesImagesIds[E]?this._spritesImagesIds[E].filter(A=>!(A in v)):[];for(const A of M)this.imageManager.removeImage(A),this._changedImages[A]=!0;for(const A in v[E]){const R=E==="default"?A:`${E}:${A}`;this._spritesImagesIds[E].push(R),R in this.imageManager.images?this.imageManager.updateImage(R,v[E][A],!1):this.imageManager.addImage(R,v[E][A]),h&&(this._changedImages[R]=!0)}}}).catch(v=>{this._spriteRequest=null,m=v,this.fire(new a.j(m))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),h&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new a.k("data",{dataType:"style"})),p&&p(m)})}_unloadSprite(){for(const o of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(o),this._changedImages[o]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new a.k("data",{dataType:"style"}))}_validateLayer(o){const h=this.sourceCaches[o.source];if(!h)return;const p=o.sourceLayer;if(!p)return;const m=h.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(p)===-1)&&this.fire(new a.j(new Error(`Source layer "${p}" does not exist on source "${m.id}" as specified by style layer "${o.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const o in this.sourceCaches)if(!this.sourceCaches[o].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(o){const h=this._serializedAllLayers();if(!o||o.length===0)return Object.values(h);const p=[];for(const m of o)h[m]&&p.push(h[m]);return p}_serializedAllLayers(){let o=this._serializedLayers;if(o)return o;o=this._serializedLayers={};const h=Object.keys(this._layers);for(const p of h){const m=this._layers[p];m.type!=="custom"&&(o[p]=m.serialize())}return o}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const o in this.sourceCaches)if(this.sourceCaches[o].hasTransition())return!0;for(const o in this._layers)if(this._layers[o].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(o){if(!this._loaded)return;const h=this._changed;if(h){const m=Object.keys(this._updatedLayers),v=Object.keys(this._removedLayers);(m.length||v.length)&&this._updateWorkerLayers(m,v);for(const E in this._updatedSources){const M=this._updatedSources[E];if(M==="reload")this._reloadSource(E);else{if(M!=="clear")throw new Error(`Invalid action ${M}`);this._clearSource(E)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const E in this._updatedPaintProps)this._layers[E].updateTransitions(o);this.light.updateTransitions(o),this._resetUpdates()}const p={};for(const m in this.sourceCaches){const v=this.sourceCaches[m];p[m]=v.used,v.used=!1}for(const m of this._order){const v=this._layers[m];v.recalculate(o,this._availableImages),!v.isHidden(o.zoom)&&v.source&&(this.sourceCaches[v.source].used=!0)}for(const m in p){const v=this.sourceCaches[m];!!p[m]!=!!v.used&&v.fire(new a.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(o),this.z=o.zoom,h&&this.fire(new a.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const o=Object.keys(this._changedImages);if(o.length){for(const h in this.sourceCaches)this.sourceCaches[h].reloadTilesForDependencies(["icons","patterns"],o);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const o in this.sourceCaches)this.sourceCaches[o].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(o,h){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(o),removedIds:h})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(o,h={}){var p;this._checkLoaded();const m=this.serialize();if(o=h.transformStyle?h.transformStyle(m,o):o,((p=h.validate)===null||p===void 0||p)&&rn(this,a.x(o)))return!1;(o=a.aA(o)).layers=a.ay(o.layers);const v=a.aB(m,o),E=this._getOperationsToPerform(v);if(E.unimplemented.length>0)throw new Error(`Unimplemented: ${E.unimplemented.join(", ")}.`);if(E.operations.length===0)return!1;for(const M of E.operations)M();return this.stylesheet=o,this._serializedLayers=null,!0}_getOperationsToPerform(o){const h=[],p=[];for(const m of o)switch(m.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":h.push(()=>this.addLayer.apply(this,m.args));break;case"removeLayer":h.push(()=>this.removeLayer.apply(this,m.args));break;case"setPaintProperty":h.push(()=>this.setPaintProperty.apply(this,m.args));break;case"setLayoutProperty":h.push(()=>this.setLayoutProperty.apply(this,m.args));break;case"setFilter":h.push(()=>this.setFilter.apply(this,m.args));break;case"addSource":h.push(()=>this.addSource.apply(this,m.args));break;case"removeSource":h.push(()=>this.removeSource.apply(this,m.args));break;case"setLayerZoomRange":h.push(()=>this.setLayerZoomRange.apply(this,m.args));break;case"setLight":h.push(()=>this.setLight.apply(this,m.args));break;case"setGeoJSONSourceData":h.push(()=>this.setGeoJSONSourceData.apply(this,m.args));break;case"setGlyphs":h.push(()=>this.setGlyphs.apply(this,m.args));break;case"setSprite":h.push(()=>this.setSprite.apply(this,m.args));break;case"setTerrain":h.push(()=>this.map.setTerrain.apply(this,m.args));break;case"setTransition":h.push(()=>{});break;default:p.push(m.command)}return{operations:h,unimplemented:p}}addImage(o,h){if(this.getImage(o))return this.fire(new a.j(new Error(`An image named "${o}" already exists.`)));this.imageManager.addImage(o,h),this._afterImageUpdated(o)}updateImage(o,h){this.imageManager.updateImage(o,h)}getImage(o){return this.imageManager.getImage(o)}removeImage(o){if(!this.getImage(o))return this.fire(new a.j(new Error(`An image named "${o}" does not exist.`)));this.imageManager.removeImage(o),this._afterImageUpdated(o)}_afterImageUpdated(o){this._availableImages=this.imageManager.listImages(),this._changedImages[o]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new a.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(o,h,p={}){if(this._checkLoaded(),this.sourceCaches[o]!==void 0)throw new Error(`Source "${o}" already exists.`);if(!h.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(h).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(h.type)>=0&&this._validate(a.x.source,`sources.${o}`,h,null,p))return;this.map&&this.map._collectResourceTiming&&(h.collectResourceTiming=!0);const m=this.sourceCaches[o]=new Or(o,h,this.dispatcher);m.style=this,m.setEventedParent(this,()=>({isSourceLoaded:m.loaded(),source:m.serialize(),sourceId:o})),m.onAdd(this.map),this._changed=!0}removeSource(o){if(this._checkLoaded(),this.sourceCaches[o]===void 0)throw new Error("There is no source with this ID");for(const p in this._layers)if(this._layers[p].source===o)return this.fire(new a.j(new Error(`Source "${o}" cannot be removed while layer "${p}" is using it.`)));const h=this.sourceCaches[o];delete this.sourceCaches[o],delete this._updatedSources[o],h.fire(new a.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:o})),h.setEventedParent(null),h.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(o,h){if(this._checkLoaded(),this.sourceCaches[o]===void 0)throw new Error(`There is no source with this ID=${o}`);const p=this.sourceCaches[o].getSource();if(p.type!=="geojson")throw new Error(`geojsonSource.type is ${p.type}, which is !== 'geojson`);p.setData(h),this._changed=!0}getSource(o){return this.sourceCaches[o]&&this.sourceCaches[o].getSource()}addLayer(o,h,p={}){this._checkLoaded();const m=o.id;if(this.getLayer(m))return void this.fire(new a.j(new Error(`Layer "${m}" already exists on this map.`)));let v;if(o.type==="custom"){if(rn(this,a.aC(o)))return;v=a.az(o)}else{if("source"in o&&typeof o.source=="object"&&(this.addSource(m,o.source),o=a.aA(o),o=a.e(o,{source:m})),this._validate(a.x.layer,`layers.${m}`,o,{arrayIndex:-1},p))return;v=a.az(o),this._validateLayer(v),v.setEventedParent(this,{layer:{id:m}})}const E=h?this._order.indexOf(h):this._order.length;if(h&&E===-1)this.fire(new a.j(new Error(`Cannot add layer "${m}" before non-existing layer "${h}".`)));else{if(this._order.splice(E,0,m),this._layerOrderChanged=!0,this._layers[m]=v,this._removedLayers[m]&&v.source&&v.type!=="custom"){const M=this._removedLayers[m];delete this._removedLayers[m],M.type!==v.type?this._updatedSources[v.source]="clear":(this._updatedSources[v.source]="reload",this.sourceCaches[v.source].pause())}this._updateLayer(v),v.onAdd&&v.onAdd(this.map)}}moveLayer(o,h){if(this._checkLoaded(),this._changed=!0,!this._layers[o])return void this.fire(new a.j(new Error(`The layer '${o}' does not exist in the map's style and cannot be moved.`)));if(o===h)return;const p=this._order.indexOf(o);this._order.splice(p,1);const m=h?this._order.indexOf(h):this._order.length;h&&m===-1?this.fire(new a.j(new Error(`Cannot move layer "${o}" before non-existing layer "${h}".`))):(this._order.splice(m,0,o),this._layerOrderChanged=!0)}removeLayer(o){this._checkLoaded();const h=this._layers[o];if(!h)return void this.fire(new a.j(new Error(`Cannot remove non-existing layer "${o}".`)));h.setEventedParent(null);const p=this._order.indexOf(o);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[o]=h,delete this._layers[o],this._serializedLayers&&delete this._serializedLayers[o],delete this._updatedLayers[o],delete this._updatedPaintProps[o],h.onRemove&&h.onRemove(this.map)}getLayer(o){return this._layers[o]}getLayersOrder(){return[...this._order]}hasLayer(o){return o in this._layers}setLayerZoomRange(o,h,p){this._checkLoaded();const m=this.getLayer(o);m?m.minzoom===h&&m.maxzoom===p||(h!=null&&(m.minzoom=h),p!=null&&(m.maxzoom=p),this._updateLayer(m)):this.fire(new a.j(new Error(`Cannot set the zoom range of non-existing layer "${o}".`)))}setFilter(o,h,p={}){this._checkLoaded();const m=this.getLayer(o);if(m){if(!a.aD(m.filter,h))return h==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(a.x.filter,`layers.${m.id}.filter`,h,null,p)||(m.filter=a.aA(h),this._updateLayer(m)))}else this.fire(new a.j(new Error(`Cannot filter non-existing layer "${o}".`)))}getFilter(o){return a.aA(this.getLayer(o).filter)}setLayoutProperty(o,h,p,m={}){this._checkLoaded();const v=this.getLayer(o);v?a.aD(v.getLayoutProperty(h),p)||(v.setLayoutProperty(h,p,m),this._updateLayer(v)):this.fire(new a.j(new Error(`Cannot style non-existing layer "${o}".`)))}getLayoutProperty(o,h){const p=this.getLayer(o);if(p)return p.getLayoutProperty(h);this.fire(new a.j(new Error(`Cannot get style of non-existing layer "${o}".`)))}setPaintProperty(o,h,p,m={}){this._checkLoaded();const v=this.getLayer(o);v?a.aD(v.getPaintProperty(h),p)||(v.setPaintProperty(h,p,m)&&this._updateLayer(v),this._changed=!0,this._updatedPaintProps[o]=!0,this._serializedLayers=null):this.fire(new a.j(new Error(`Cannot style non-existing layer "${o}".`)))}getPaintProperty(o,h){return this.getLayer(o).getPaintProperty(h)}setFeatureState(o,h){this._checkLoaded();const p=o.source,m=o.sourceLayer,v=this.sourceCaches[p];if(v===void 0)return void this.fire(new a.j(new Error(`The source '${p}' does not exist in the map's style.`)));const E=v.getSource().type;E==="geojson"&&m?this.fire(new a.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):E!=="vector"||m?(o.id===void 0&&this.fire(new a.j(new Error("The feature id parameter must be provided."))),v.setFeatureState(m,o.id,h)):this.fire(new a.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(o,h){this._checkLoaded();const p=o.source,m=this.sourceCaches[p];if(m===void 0)return void this.fire(new a.j(new Error(`The source '${p}' does not exist in the map's style.`)));const v=m.getSource().type,E=v==="vector"?o.sourceLayer:void 0;v!=="vector"||E?h&&typeof o.id!="string"&&typeof o.id!="number"?this.fire(new a.j(new Error("A feature id is required to remove its specific state property."))):m.removeFeatureState(E,o.id,h):this.fire(new a.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(o){this._checkLoaded();const h=o.source,p=o.sourceLayer,m=this.sourceCaches[h];if(m!==void 0)return m.getSource().type!=="vector"||p?(o.id===void 0&&this.fire(new a.j(new Error("The feature id parameter must be provided."))),m.getFeatureState(p,o.id)):void this.fire(new a.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new a.j(new Error(`The source '${h}' does not exist in the map's style.`)))}getTransition(){return a.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const o=a.aE(this.sourceCaches,v=>v.serialize()),h=this._serializeByIds(this._order),p=this.map.getTerrain()||void 0,m=this.stylesheet;return a.aF({version:m.version,name:m.name,metadata:m.metadata,light:m.light,center:m.center,zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,sprite:m.sprite,glyphs:m.glyphs,transition:m.transition,sources:o,layers:h,terrain:p},v=>v!==void 0)}_updateLayer(o){this._updatedLayers[o.id]=!0,o.source&&!this._updatedSources[o.source]&&this.sourceCaches[o.source].getSource().type!=="raster"&&(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(o){const h=E=>this._layers[E].type==="fill-extrusion",p={},m=[];for(let E=this._order.length-1;E>=0;E--){const M=this._order[E];if(h(M)){p[M]=E;for(const A of o){const R=A[M];if(R)for(const V of R)m.push(V)}}}m.sort((E,M)=>M.intersectionZ-E.intersectionZ);const v=[];for(let E=this._order.length-1;E>=0;E--){const M=this._order[E];if(h(M))for(let A=m.length-1;A>=0;A--){const R=m[A].feature;if(p[R.layer.id]{const nt=Te.featureSortOrder;if(nt){const et=nt.indexOf(He.featureIndex);return nt.indexOf($e.featureIndex)-et}return $e.featureIndex-He.featureIndex});for(const He of Ge)Le.push(He)}}for(const Te in ue)ue[Te].forEach(Ue=>{const we=Ue.feature,Le=R[M[Te].source].getFeatureState(we.layer["source-layer"],we.id);we.source=we.layer.source,we.layer["source-layer"]&&(we.sourceLayer=we.layer["source-layer"]),we.state=Le});return ue}(this._layers,E,this.sourceCaches,o,h,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(v)}querySourceFeatures(o,h){h&&h.filter&&this._validate(a.x.filter,"querySourceFeatures.filter",h.filter,null,h);const p=this.sourceCaches[o];return p?function(m,v){const E=m.getRenderableIds().map(R=>m.getTileByID(R)),M=[],A={};for(let R=0;RQ.getTileByID(he)).sort((he,ue)=>ue.tileID.overscaledZ-he.tileID.overscaledZ||(he.tileID.isLessThan(ue.tileID)?-1:1))}const q=this.crossTileSymbolIndex.addLayer(V,A[V.source],o.center.lng);E=E||q}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((v=v||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(k.now(),o.zoom))&&(this.pauseablePlacement=new Xi(o,this.map.terrain,this._order,v,h,p,m,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(k.now()),M=!0),E&&this.pauseablePlacement.placement.setStale()),M||E)for(const R of this._order){const V=this._layers[R];V.type==="symbol"&&this.placement.updateLayerOpacities(V,A[V.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(k.now())}_releaseSymbolFadeTiles(){for(const o in this.sourceCaches)this.sourceCaches[o].releaseSymbolFadeTiles()}getImages(o,h){return a._(this,void 0,void 0,function*(){const p=yield this.imageManager.getImages(h.icons);this._updateTilesForChangedImages();const m=this.sourceCaches[h.source];return m&&m.setDependencies(h.tileID.key,h.type,h.icons),p})}getGlyphs(o,h){return a._(this,void 0,void 0,function*(){const p=yield this.glyphManager.getGlyphs(h.stacks),m=this.sourceCaches[h.source];return m&&m.setDependencies(h.tileID.key,h.type,[""]),p})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(o,h={}){this._checkLoaded(),o&&this._validate(a.x.glyphs,"glyphs",o,null,h)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=o,this.glyphManager.entries={},this.glyphManager.setURL(o))}addSprite(o,h,p={},m){this._checkLoaded();const v=[{id:o,url:h}],E=[...ze(this.stylesheet.sprite),...v];this._validate(a.x.sprite,"sprite",E,null,p)||(this.stylesheet.sprite=E,this._loadSprite(v,!0,m))}removeSprite(o){this._checkLoaded();const h=ze(this.stylesheet.sprite);if(h.find(p=>p.id===o)){if(this._spritesImagesIds[o])for(const p of this._spritesImagesIds[o])this.imageManager.removeImage(p),this._changedImages[p]=!0;h.splice(h.findIndex(p=>p.id===o),1),this.stylesheet.sprite=h.length>0?h:void 0,delete this._spritesImagesIds[o],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new a.k("data",{dataType:"style"}))}else this.fire(new a.j(new Error(`Sprite "${o}" doesn't exists on this map.`)))}getSprite(){return ze(this.stylesheet.sprite)}setSprite(o,h={},p){this._checkLoaded(),o&&this._validate(a.x.sprite,"sprite",o,null,h)||(this.stylesheet.sprite=o,o?this._loadSprite(o,!0,p):(this._unloadSprite(),p&&p(null)))}}var ll=a.X([{name:"a_pos",type:"Int16",components:2}]),go="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 Ea={prelude:Dr(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:Dr(`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:Dr(`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:Dr(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Dr("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:Dr(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Dr(`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:Dr("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:Dr("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:Dr("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:Dr(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Dr(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Dr(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Dr(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Dr(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Dr(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 +? a_pos +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Dr(`#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:Dr(`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:Dr(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Dr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Dr(`#ifdef GL_ES +precision highp float; +#endif +uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Dr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; +#endif +v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Dr(`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:Dr(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Dr(`#define SDF_PX 8.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Dr(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Dr("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",go),terrainDepth:Dr("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);}",go),terrainCoords:Dr("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);}",go)};function Dr(y,o){const h=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,p=o.match(/attribute ([\w]+) ([\w]+)/g),m=y.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),v=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),E=v?v.concat(m):m,M={};return{fragmentSource:y=y.replace(h,(A,R,V,q,Q)=>(M[Q]=!0,R==="define"?` +#ifndef HAS_UNIFORM_u_${Q} +varying ${V} ${q} ${Q}; +#else +uniform ${V} ${q} u_${Q}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Q} + ${V} ${q} ${Q} = u_${Q}; +#endif +`)),vertexSource:o=o.replace(h,(A,R,V,q,Q)=>{const he=q==="float"?"vec2":"vec4",ue=Q.match(/color/)?"color":he;return M[Q]?R==="define"?` +#ifndef HAS_UNIFORM_u_${Q} +uniform lowp float u_${Q}_t; +attribute ${V} ${he} a_${Q}; +varying ${V} ${q} ${Q}; +#else +uniform ${V} ${q} u_${Q}; +#endif +`:ue==="vec4"?` +#ifndef HAS_UNIFORM_u_${Q} + ${Q} = a_${Q}; +#else + ${V} ${q} ${Q} = u_${Q}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Q} + ${Q} = unpack_mix_${ue}(a_${Q}, u_${Q}_t); +#else + ${V} ${q} ${Q} = u_${Q}; +#endif +`:R==="define"?` +#ifndef HAS_UNIFORM_u_${Q} +uniform lowp float u_${Q}_t; +attribute ${V} ${he} a_${Q}; +#else +uniform ${V} ${q} u_${Q}; +#endif +`:ue==="vec4"?` +#ifndef HAS_UNIFORM_u_${Q} + ${V} ${q} ${Q} = a_${Q}; +#else + ${V} ${q} ${Q} = u_${Q}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Q} + ${V} ${q} ${Q} = unpack_mix_${ue}(a_${Q}, u_${Q}_t); +#else + ${V} ${q} ${Q} = u_${Q}; +#endif +`}),staticAttributes:p,staticUniforms:E}}class cl{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(o,h,p,m,v,E,M,A,R){this.context=o;let V=this.boundPaintVertexBuffers.length!==m.length;for(let q=0;!V&&q({u_depth:new a.aG(He,$e.u_depth),u_terrain:new a.aG(He,$e.u_terrain),u_terrain_dim:new a.aH(He,$e.u_terrain_dim),u_terrain_matrix:new a.aI(He,$e.u_terrain_matrix),u_terrain_unpack:new a.aJ(He,$e.u_terrain_unpack),u_terrain_exaggeration:new a.aH(He,$e.u_terrain_exaggeration)}))(o,Ge),this.binderUniforms=p?p.getUniforms(o,Ge):[]}draw(o,h,p,m,v,E,M,A,R,V,q,Q,he,ue,ye,se,Te,Ue){const we=o.gl;if(this.failedToCreate)return;if(o.program.set(this.program),o.setDepthMode(p),o.setStencilMode(m),o.setColorMode(v),o.setCullFace(E),A){o.activeTexture.set(we.TEXTURE2),we.bindTexture(we.TEXTURE_2D,A.depthTexture),o.activeTexture.set(we.TEXTURE3),we.bindTexture(we.TEXTURE_2D,A.texture);for(const Ge in this.terrainUniforms)this.terrainUniforms[Ge].set(A[Ge])}for(const Ge in this.fixedUniforms)this.fixedUniforms[Ge].set(M[Ge]);ye&&ye.setUniforms(o,this.binderUniforms,he,{zoom:ue});let Le=0;switch(h){case we.LINES:Le=2;break;case we.TRIANGLES:Le=3;break;case we.LINE_STRIP:Le=1}for(const Ge of Q.get()){const He=Ge.vaos||(Ge.vaos={});(He[R]||(He[R]=new cl)).bind(o,this,V,ye?ye.getPaintVertexBuffers():[],q,Ge.vertexOffset,se,Te,Ue),we.drawElements(h,Ge.primitiveLength*Le,we.UNSIGNED_SHORT,Ge.primitiveOffset*Le*2)}}}function ul(y,o,h){const p=1/$t(h,1,o.transform.tileZoom),m=Math.pow(2,h.tileID.overscaledZ),v=h.tileSize*Math.pow(2,o.transform.tileZoom)/m,E=v*(h.tileID.canonical.x+h.tileID.wrap*m),M=v*h.tileID.canonical.y;return{u_image:0,u_texsize:h.imageAtlasTexture.size,u_scale:[p,y.fromScale,y.toScale],u_fade:y.t,u_pixel_coord_upper:[E>>16,M>>16],u_pixel_coord_lower:[65535&E,65535&M]}}const Ma=(y,o,h,p)=>{const m=o.style.light,v=m.properties.get("position"),E=[v.x,v.y,v.z],M=function(){var R=new a.A(9);return a.A!=Float32Array&&(R[1]=0,R[2]=0,R[3]=0,R[5]=0,R[6]=0,R[7]=0),R[0]=1,R[4]=1,R[8]=1,R}();m.properties.get("anchor")==="viewport"&&function(R,V){var q=Math.sin(V),Q=Math.cos(V);R[0]=Q,R[1]=q,R[2]=0,R[3]=-q,R[4]=Q,R[5]=0,R[6]=0,R[7]=0,R[8]=1}(M,-o.transform.angle),function(R,V,q){var Q=V[0],he=V[1],ue=V[2];R[0]=Q*q[0]+he*q[3]+ue*q[6],R[1]=Q*q[1]+he*q[4]+ue*q[7],R[2]=Q*q[2]+he*q[5]+ue*q[8]}(E,E,M);const A=m.properties.get("color");return{u_matrix:y,u_lightpos:E,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[A.r,A.g,A.b],u_vertical_gradient:+h,u_opacity:p}},Zd=(y,o,h,p,m,v,E)=>a.e(Ma(y,o,h,p),ul(v,o,E),{u_height_factor:-Math.pow(2,m.overscaledZ)/E.tileSize/8}),Ih=y=>({u_matrix:y}),hl=(y,o,h,p)=>a.e(Ih(y),ul(h,o,p)),Hd=(y,o)=>({u_matrix:y,u_world:o}),Ah=(y,o,h,p,m)=>a.e(hl(y,o,h,p),{u_world:m}),$d=(y,o,h,p)=>{const m=y.transform;let v,E;if(p.paint.get("circle-pitch-alignment")==="map"){const M=$t(h,1,m.zoom);v=!0,E=[M,M]}else v=!1,E=m.pixelsToGLUnits;return{u_camera_to_center_distance:m.cameraToCenterDistance,u_scale_with_map:+(p.paint.get("circle-pitch-scale")==="map"),u_matrix:y.translatePosMatrix(o.posMatrix,h,p.paint.get("circle-translate"),p.paint.get("circle-translate-anchor")),u_pitch_with_map:+v,u_device_pixel_ratio:y.pixelRatio,u_extrude_scale:E}},Lh=(y,o,h)=>{const p=$t(h,1,o.zoom),m=Math.pow(2,o.zoom-h.tileID.overscaledZ),v=h.tileID.overscaleFactor();return{u_matrix:y,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:p,u_extrude_scale:[o.pixelsToGLUnits[0]/(p*m),o.pixelsToGLUnits[1]/(p*m)],u_overscale_factor:v}},Ph=(y,o,h=1)=>({u_matrix:y,u_color:o,u_overlay:0,u_overlay_scale:h}),fl=y=>({u_matrix:y}),zh=(y,o,h,p)=>({u_matrix:y,u_extrude_scale:$t(o,1,h),u_intensity:p});function Dh(y,o){const h=Math.pow(2,o.canonical.z),p=o.canonical.y;return[new a.Y(0,p/h).toLngLat().lat,new a.Y(0,(p+1)/h).toLngLat().lat]}const dl=(y,o,h,p)=>{const m=y.transform;return{u_matrix:Ca(y,o,h,p),u_ratio:1/$t(o,1,m.zoom),u_device_pixel_ratio:y.pixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Rh=(y,o,h,p,m)=>a.e(dl(y,o,h,m),{u_image:0,u_image_height:p}),ds=(y,o,h,p,m)=>{const v=y.transform,E=Fi(o,v);return{u_matrix:Ca(y,o,h,m),u_texsize:o.imageAtlasTexture.size,u_ratio:1/$t(o,1,v.zoom),u_device_pixel_ratio:y.pixelRatio,u_image:0,u_scale:[E,p.fromScale,p.toScale],u_fade:p.t,u_units_to_pixels:[1/v.pixelsToGLUnits[0],1/v.pixelsToGLUnits[1]]}},pl=(y,o,h,p,m,v)=>{const E=y.lineAtlas,M=Fi(o,y.transform),A=h.layout.get("line-cap")==="round",R=E.getDash(p.from,A),V=E.getDash(p.to,A),q=R.width*m.fromScale,Q=V.width*m.toScale;return a.e(dl(y,o,h,v),{u_patternscale_a:[M/q,-R.height/2],u_patternscale_b:[M/Q,-V.height/2],u_sdfgamma:E.width/(256*Math.min(q,Q)*y.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:V.y,u_mix:m.t})};function Fi(y,o){return 1/$t(y,1,o.tileZoom)}function Ca(y,o,h,p){return y.translatePosMatrix(p?p.posMatrix:o.tileID.posMatrix,o,h.paint.get("line-translate"),h.paint.get("line-translate-anchor"))}const ml=(y,o,h,p,m)=>{return{u_matrix:y,u_tl_parent:o,u_scale_parent:h,u_buffer_scale:1,u_fade_t:p.mix,u_opacity:p.opacity*m.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:m.paint.get("raster-brightness-min"),u_brightness_high:m.paint.get("raster-brightness-max"),u_saturation_factor:(E=m.paint.get("raster-saturation"),E>0?1-1/(1.001-E):-E),u_contrast_factor:(v=m.paint.get("raster-contrast"),v>0?1/(1-v):1+v),u_spin_weights:Ia(m.paint.get("raster-hue-rotate"))};var v,E};function Ia(y){y*=Math.PI/180;const o=Math.sin(y),h=Math.cos(y);return[(2*h+1)/3,(-Math.sqrt(3)*o-h+1)/3,(Math.sqrt(3)*o-h+1)/3]}const Aa=(y,o,h,p,m,v,E,M,A,R)=>{const V=m.transform;return{u_is_size_zoom_constant:+(y==="constant"||y==="source"),u_is_size_feature_constant:+(y==="constant"||y==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:V.cameraToCenterDistance,u_pitch:V.pitch/360*2*Math.PI,u_rotate_symbol:+h,u_aspect_ratio:V.width/V.height,u_fade_change:m.options.fadeDuration?m.symbolFadeChange:1,u_matrix:v,u_label_plane_matrix:E,u_coord_matrix:M,u_is_text:+A,u_pitch_with_map:+p,u_texsize:R,u_texture:0}},La=(y,o,h,p,m,v,E,M,A,R,V)=>{const q=m.transform;return a.e(Aa(y,o,h,p,m,v,E,M,A,R),{u_gamma_scale:p?Math.cos(q._pitch)*q.cameraToCenterDistance:1,u_device_pixel_ratio:m.pixelRatio,u_is_halo:+V})},Pa=(y,o,h,p,m,v,E,M,A,R)=>a.e(La(y,o,h,p,m,v,E,M,!0,A,!0),{u_texsize_icon:R,u_texture_icon:1}),Xd=(y,o,h)=>({u_matrix:y,u_opacity:o,u_color:h}),Kd=(y,o,h,p,m,v)=>a.e(function(E,M,A,R){const V=A.imageManager.getPattern(E.from.toString()),q=A.imageManager.getPattern(E.to.toString()),{width:Q,height:he}=A.imageManager.getPixelSize(),ue=Math.pow(2,R.tileID.overscaledZ),ye=R.tileSize*Math.pow(2,A.transform.tileZoom)/ue,se=ye*(R.tileID.canonical.x+R.tileID.wrap*ue),Te=ye*R.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:V.tl,u_pattern_br_a:V.br,u_pattern_tl_b:q.tl,u_pattern_br_b:q.br,u_texsize:[Q,he],u_mix:M.t,u_pattern_size_a:V.displaySize,u_pattern_size_b:q.displaySize,u_scale_a:M.fromScale,u_scale_b:M.toScale,u_tile_units_to_pixels:1/$t(R,1,A.transform.tileZoom),u_pixel_coord_upper:[se>>16,Te>>16],u_pixel_coord_lower:[65535&se,65535&Te]}}(p,v,h,m),{u_matrix:y,u_opacity:o}),Bh={fillExtrusion:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_lightpos:new a.aK(y,o.u_lightpos),u_lightintensity:new a.aH(y,o.u_lightintensity),u_lightcolor:new a.aK(y,o.u_lightcolor),u_vertical_gradient:new a.aH(y,o.u_vertical_gradient),u_opacity:new a.aH(y,o.u_opacity)}),fillExtrusionPattern:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_lightpos:new a.aK(y,o.u_lightpos),u_lightintensity:new a.aH(y,o.u_lightintensity),u_lightcolor:new a.aK(y,o.u_lightcolor),u_vertical_gradient:new a.aH(y,o.u_vertical_gradient),u_height_factor:new a.aH(y,o.u_height_factor),u_image:new a.aG(y,o.u_image),u_texsize:new a.aL(y,o.u_texsize),u_pixel_coord_upper:new a.aL(y,o.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(y,o.u_pixel_coord_lower),u_scale:new a.aK(y,o.u_scale),u_fade:new a.aH(y,o.u_fade),u_opacity:new a.aH(y,o.u_opacity)}),fill:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix)}),fillPattern:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_image:new a.aG(y,o.u_image),u_texsize:new a.aL(y,o.u_texsize),u_pixel_coord_upper:new a.aL(y,o.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(y,o.u_pixel_coord_lower),u_scale:new a.aK(y,o.u_scale),u_fade:new a.aH(y,o.u_fade)}),fillOutline:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_world:new a.aL(y,o.u_world)}),fillOutlinePattern:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_world:new a.aL(y,o.u_world),u_image:new a.aG(y,o.u_image),u_texsize:new a.aL(y,o.u_texsize),u_pixel_coord_upper:new a.aL(y,o.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(y,o.u_pixel_coord_lower),u_scale:new a.aK(y,o.u_scale),u_fade:new a.aH(y,o.u_fade)}),circle:(y,o)=>({u_camera_to_center_distance:new a.aH(y,o.u_camera_to_center_distance),u_scale_with_map:new a.aG(y,o.u_scale_with_map),u_pitch_with_map:new a.aG(y,o.u_pitch_with_map),u_extrude_scale:new a.aL(y,o.u_extrude_scale),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_matrix:new a.aI(y,o.u_matrix)}),collisionBox:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_camera_to_center_distance:new a.aH(y,o.u_camera_to_center_distance),u_pixels_to_tile_units:new a.aH(y,o.u_pixels_to_tile_units),u_extrude_scale:new a.aL(y,o.u_extrude_scale),u_overscale_factor:new a.aH(y,o.u_overscale_factor)}),collisionCircle:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_inv_matrix:new a.aI(y,o.u_inv_matrix),u_camera_to_center_distance:new a.aH(y,o.u_camera_to_center_distance),u_viewport_size:new a.aL(y,o.u_viewport_size)}),debug:(y,o)=>({u_color:new a.aM(y,o.u_color),u_matrix:new a.aI(y,o.u_matrix),u_overlay:new a.aG(y,o.u_overlay),u_overlay_scale:new a.aH(y,o.u_overlay_scale)}),clippingMask:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix)}),heatmap:(y,o)=>({u_extrude_scale:new a.aH(y,o.u_extrude_scale),u_intensity:new a.aH(y,o.u_intensity),u_matrix:new a.aI(y,o.u_matrix)}),heatmapTexture:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_world:new a.aL(y,o.u_world),u_image:new a.aG(y,o.u_image),u_color_ramp:new a.aG(y,o.u_color_ramp),u_opacity:new a.aH(y,o.u_opacity)}),hillshade:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_image:new a.aG(y,o.u_image),u_latrange:new a.aL(y,o.u_latrange),u_light:new a.aL(y,o.u_light),u_shadow:new a.aM(y,o.u_shadow),u_highlight:new a.aM(y,o.u_highlight),u_accent:new a.aM(y,o.u_accent)}),hillshadePrepare:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_image:new a.aG(y,o.u_image),u_dimension:new a.aL(y,o.u_dimension),u_zoom:new a.aH(y,o.u_zoom),u_unpack:new a.aJ(y,o.u_unpack)}),line:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_ratio:new a.aH(y,o.u_ratio),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_units_to_pixels:new a.aL(y,o.u_units_to_pixels)}),lineGradient:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_ratio:new a.aH(y,o.u_ratio),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_units_to_pixels:new a.aL(y,o.u_units_to_pixels),u_image:new a.aG(y,o.u_image),u_image_height:new a.aH(y,o.u_image_height)}),linePattern:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_texsize:new a.aL(y,o.u_texsize),u_ratio:new a.aH(y,o.u_ratio),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_image:new a.aG(y,o.u_image),u_units_to_pixels:new a.aL(y,o.u_units_to_pixels),u_scale:new a.aK(y,o.u_scale),u_fade:new a.aH(y,o.u_fade)}),lineSDF:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_ratio:new a.aH(y,o.u_ratio),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_units_to_pixels:new a.aL(y,o.u_units_to_pixels),u_patternscale_a:new a.aL(y,o.u_patternscale_a),u_patternscale_b:new a.aL(y,o.u_patternscale_b),u_sdfgamma:new a.aH(y,o.u_sdfgamma),u_image:new a.aG(y,o.u_image),u_tex_y_a:new a.aH(y,o.u_tex_y_a),u_tex_y_b:new a.aH(y,o.u_tex_y_b),u_mix:new a.aH(y,o.u_mix)}),raster:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_tl_parent:new a.aL(y,o.u_tl_parent),u_scale_parent:new a.aH(y,o.u_scale_parent),u_buffer_scale:new a.aH(y,o.u_buffer_scale),u_fade_t:new a.aH(y,o.u_fade_t),u_opacity:new a.aH(y,o.u_opacity),u_image0:new a.aG(y,o.u_image0),u_image1:new a.aG(y,o.u_image1),u_brightness_low:new a.aH(y,o.u_brightness_low),u_brightness_high:new a.aH(y,o.u_brightness_high),u_saturation_factor:new a.aH(y,o.u_saturation_factor),u_contrast_factor:new a.aH(y,o.u_contrast_factor),u_spin_weights:new a.aK(y,o.u_spin_weights)}),symbolIcon:(y,o)=>({u_is_size_zoom_constant:new a.aG(y,o.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aG(y,o.u_is_size_feature_constant),u_size_t:new a.aH(y,o.u_size_t),u_size:new a.aH(y,o.u_size),u_camera_to_center_distance:new a.aH(y,o.u_camera_to_center_distance),u_pitch:new a.aH(y,o.u_pitch),u_rotate_symbol:new a.aG(y,o.u_rotate_symbol),u_aspect_ratio:new a.aH(y,o.u_aspect_ratio),u_fade_change:new a.aH(y,o.u_fade_change),u_matrix:new a.aI(y,o.u_matrix),u_label_plane_matrix:new a.aI(y,o.u_label_plane_matrix),u_coord_matrix:new a.aI(y,o.u_coord_matrix),u_is_text:new a.aG(y,o.u_is_text),u_pitch_with_map:new a.aG(y,o.u_pitch_with_map),u_texsize:new a.aL(y,o.u_texsize),u_texture:new a.aG(y,o.u_texture)}),symbolSDF:(y,o)=>({u_is_size_zoom_constant:new a.aG(y,o.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aG(y,o.u_is_size_feature_constant),u_size_t:new a.aH(y,o.u_size_t),u_size:new a.aH(y,o.u_size),u_camera_to_center_distance:new a.aH(y,o.u_camera_to_center_distance),u_pitch:new a.aH(y,o.u_pitch),u_rotate_symbol:new a.aG(y,o.u_rotate_symbol),u_aspect_ratio:new a.aH(y,o.u_aspect_ratio),u_fade_change:new a.aH(y,o.u_fade_change),u_matrix:new a.aI(y,o.u_matrix),u_label_plane_matrix:new a.aI(y,o.u_label_plane_matrix),u_coord_matrix:new a.aI(y,o.u_coord_matrix),u_is_text:new a.aG(y,o.u_is_text),u_pitch_with_map:new a.aG(y,o.u_pitch_with_map),u_texsize:new a.aL(y,o.u_texsize),u_texture:new a.aG(y,o.u_texture),u_gamma_scale:new a.aH(y,o.u_gamma_scale),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_is_halo:new a.aG(y,o.u_is_halo)}),symbolTextAndIcon:(y,o)=>({u_is_size_zoom_constant:new a.aG(y,o.u_is_size_zoom_constant),u_is_size_feature_constant:new a.aG(y,o.u_is_size_feature_constant),u_size_t:new a.aH(y,o.u_size_t),u_size:new a.aH(y,o.u_size),u_camera_to_center_distance:new a.aH(y,o.u_camera_to_center_distance),u_pitch:new a.aH(y,o.u_pitch),u_rotate_symbol:new a.aG(y,o.u_rotate_symbol),u_aspect_ratio:new a.aH(y,o.u_aspect_ratio),u_fade_change:new a.aH(y,o.u_fade_change),u_matrix:new a.aI(y,o.u_matrix),u_label_plane_matrix:new a.aI(y,o.u_label_plane_matrix),u_coord_matrix:new a.aI(y,o.u_coord_matrix),u_is_text:new a.aG(y,o.u_is_text),u_pitch_with_map:new a.aG(y,o.u_pitch_with_map),u_texsize:new a.aL(y,o.u_texsize),u_texsize_icon:new a.aL(y,o.u_texsize_icon),u_texture:new a.aG(y,o.u_texture),u_texture_icon:new a.aG(y,o.u_texture_icon),u_gamma_scale:new a.aH(y,o.u_gamma_scale),u_device_pixel_ratio:new a.aH(y,o.u_device_pixel_ratio),u_is_halo:new a.aG(y,o.u_is_halo)}),background:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_opacity:new a.aH(y,o.u_opacity),u_color:new a.aM(y,o.u_color)}),backgroundPattern:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_opacity:new a.aH(y,o.u_opacity),u_image:new a.aG(y,o.u_image),u_pattern_tl_a:new a.aL(y,o.u_pattern_tl_a),u_pattern_br_a:new a.aL(y,o.u_pattern_br_a),u_pattern_tl_b:new a.aL(y,o.u_pattern_tl_b),u_pattern_br_b:new a.aL(y,o.u_pattern_br_b),u_texsize:new a.aL(y,o.u_texsize),u_mix:new a.aH(y,o.u_mix),u_pattern_size_a:new a.aL(y,o.u_pattern_size_a),u_pattern_size_b:new a.aL(y,o.u_pattern_size_b),u_scale_a:new a.aH(y,o.u_scale_a),u_scale_b:new a.aH(y,o.u_scale_b),u_pixel_coord_upper:new a.aL(y,o.u_pixel_coord_upper),u_pixel_coord_lower:new a.aL(y,o.u_pixel_coord_lower),u_tile_units_to_pixels:new a.aH(y,o.u_tile_units_to_pixels)}),terrain:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_texture:new a.aG(y,o.u_texture),u_ele_delta:new a.aH(y,o.u_ele_delta)}),terrainDepth:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_ele_delta:new a.aH(y,o.u_ele_delta)}),terrainCoords:(y,o)=>({u_matrix:new a.aI(y,o.u_matrix),u_texture:new a.aG(y,o.u_texture),u_terrain_coords_id:new a.aH(y,o.u_terrain_coords_id),u_ele_delta:new a.aH(y,o.u_ele_delta)})};class Jd{constructor(o,h,p){this.context=o;const m=o.gl;this.buffer=m.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),o.bindElementBuffer.set(this.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(o){const h=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),h.bufferSubData(h.ELEMENT_ARRAY_BUFFER,0,o.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ps={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class gl{constructor(o,h,p,m){this.length=h.length,this.attributes=p,this.itemSize=h.bytesPerElement,this.dynamicDraw=m,this.context=o;const v=o.gl;this.buffer=v.createBuffer(),o.bindVertexBuffer.set(this.buffer),v.bufferData(v.ARRAY_BUFFER,h.arrayBuffer,this.dynamicDraw?v.DYNAMIC_DRAW:v.STATIC_DRAW),this.dynamicDraw||delete h.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(o){if(o.length!==this.length)throw new Error(`Length of new data is ${o.length}, which doesn't match current length of ${this.length}`);const h=this.context.gl;this.bind(),h.bufferSubData(h.ARRAY_BUFFER,0,o.arrayBuffer)}enableAttributes(o,h){for(let p=0;p0){const ft=a.F(),gt=$e;a.aP(ft,He.placementInvProjMatrix,y.transform.glCoordMatrix),a.aP(ft,ft,He.placementViewportMatrix),V.push({circleArray:et,circleOffset:Q,transform:gt,invTransform:ft,coord:Le}),q+=et.length/4,Q=q}nt&&R.draw(M,A.LINES,xr.disabled,$r.disabled,y.colorModeForRenderPass(),jr.disabled,Lh($e,y.transform,Ge),y.style.map.terrain&&y.style.map.terrain.getTerrainData(Le),h.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,null,y.transform.zoom,null,null,nt.collisionVertexBuffer)}if(!E||!V.length)return;const he=y.useProgram("collisionCircle"),ue=new a.aQ;ue.resize(4*q),ue._trim();let ye=0;for(const we of V)for(let Le=0;Le=0&&(ue[se.associatedIconIndex]={shiftedAnchor:ir,angle:_t})}else qe(se.numGlyphs,Q)}if(R){he.clear();const ye=y.icon.placedSymbolArray;for(let se=0;sey.style.map.terrain.getElevation(nt,Ji,Pn):null,sn=h.layout.get("text-rotation-alignment")==="map";$(ft,nt.posMatrix,y,m,Ni,bo,se,R,sn,Ln)}const rs=y.translatePosMatrix(nt.posMatrix,et,v,E),wo=Te||m&&He||Za?Xc:Ni,An=y.translatePosMatrix(bo,et,v,E,!0),on=_t&&h.paint.get(m?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let en;en=_t?ft.iconsInText?Pa(Xt.kind,Yt,Ue,se,y,rs,wo,An,dr,Fn):La(Xt.kind,Yt,Ue,se,y,rs,wo,An,m,dr,!0):Aa(Xt.kind,Yt,Ue,se,y,rs,wo,An,m,dr);const Ki={program:Sr,buffers:gt,uniformValues:en,atlasTexture:hn,atlasTextureIcon:nn,atlasInterpolation:Rr,atlasInterpolationIcon:Oi,isSDF:_t,hasHalo:on};if(we&&ft.canOverlap){Le=!0;const Ln=gt.segments.get();for(const sn of Ln)$e.push({segments:new a.$([sn]),sortKey:sn.sortKey,state:Ki,terrainData:cr})}else $e.push({segments:gt.segments,sortKey:0,state:Ki,terrainData:cr})}Le&&$e.sort((nt,et)=>nt.sortKey-et.sortKey);for(const nt of $e){const et=nt.state;if(Q.activeTexture.set(he.TEXTURE0),et.atlasTexture.bind(et.atlasInterpolation,he.CLAMP_TO_EDGE),et.atlasTextureIcon&&(Q.activeTexture.set(he.TEXTURE1),et.atlasTextureIcon&&et.atlasTextureIcon.bind(et.atlasInterpolationIcon,he.CLAMP_TO_EDGE)),et.isSDF){const ft=et.uniformValues;et.hasHalo&&(ft.u_is_halo=1,Wh(et.buffers,nt.segments,h,y,et.program,Ge,V,q,ft,nt.terrainData)),ft.u_is_halo=0}Wh(et.buffers,nt.segments,h,y,et.program,Ge,V,q,et.uniformValues,nt.terrainData)}}function Wh(y,o,h,p,m,v,E,M,A,R){const V=p.context;m.draw(V,V.gl.TRIANGLES,v,E,M,jr.disabled,A,R,h.id,y.layoutVertexBuffer,y.indexBuffer,o,h.paint,p.transform.zoom,y.programConfigurations.get(h.id),y.dynamicLayoutVertexBuffer,y.opacityVertexBuffer)}function Ml(y,o,h,p,m){if(!h||!p||!p.imageAtlas)return;const v=p.imageAtlas.patternPositions;let E=v[h.to.toString()],M=v[h.from.toString()];if(!E&&M&&(E=M),!M&&E&&(M=E),!E||!M){const A=m.getPaintProperty(o);E=v[A],M=v[A]}E&&M&&y.setConstantPatternPositions(E,M)}function Zh(y,o,h,p,m,v,E){const M=y.context.gl,A="fill-pattern",R=h.paint.get(A),V=R&&R.constantOr(1),q=h.getCrossfadeParameters();let Q,he,ue,ye,se;E?(he=V&&!h.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Q=M.LINES):(he=V?"fillPattern":"fill",Q=M.TRIANGLES);const Te=R.constantOr(null);for(const Ue of p){const we=o.getTile(Ue);if(V&&!we.patternsLoaded())continue;const Le=we.getBucket(h);if(!Le)continue;const Ge=Le.programConfigurations.get(h.id),He=y.useProgram(he,Ge),$e=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Ue);V&&(y.context.activeTexture.set(M.TEXTURE0),we.imageAtlasTexture.bind(M.LINEAR,M.CLAMP_TO_EDGE),Ge.updatePaintBuffers(q)),Ml(Ge,A,Te,we,h);const nt=$e?Ue:null,et=y.translatePosMatrix(nt?nt.posMatrix:Ue.posMatrix,we,h.paint.get("fill-translate"),h.paint.get("fill-translate-anchor"));if(E){ye=Le.indexBuffer2,se=Le.segments2;const ft=[M.drawingBufferWidth,M.drawingBufferHeight];ue=he==="fillOutlinePattern"&&V?Ah(et,y,q,we,ft):Hd(et,ft)}else ye=Le.indexBuffer,se=Le.segments,ue=V?hl(et,y,q,we):Ih(et);He.draw(y.context,Q,m,y.stencilModeForClipping(Ue),v,jr.disabled,ue,$e,h.id,Le.layoutVertexBuffer,ye,se,h.paint,y.transform.zoom,Ge)}}function Cl(y,o,h,p,m,v,E){const M=y.context,A=M.gl,R="fill-extrusion-pattern",V=h.paint.get(R),q=V.constantOr(1),Q=h.getCrossfadeParameters(),he=h.paint.get("fill-extrusion-opacity"),ue=V.constantOr(null);for(const ye of p){const se=o.getTile(ye),Te=se.getBucket(h);if(!Te)continue;const Ue=y.style.map.terrain&&y.style.map.terrain.getTerrainData(ye),we=Te.programConfigurations.get(h.id),Le=y.useProgram(q?"fillExtrusionPattern":"fillExtrusion",we);q&&(y.context.activeTexture.set(A.TEXTURE0),se.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),we.updatePaintBuffers(Q)),Ml(we,R,ue,se,h);const Ge=y.translatePosMatrix(ye.posMatrix,se,h.paint.get("fill-extrusion-translate"),h.paint.get("fill-extrusion-translate-anchor")),He=h.paint.get("fill-extrusion-vertical-gradient"),$e=q?Zd(Ge,y,He,he,ye,Q,se):Ma(Ge,y,He,he);Le.draw(M,M.gl.TRIANGLES,m,v,E,jr.backCCW,$e,Ue,h.id,Te.layoutVertexBuffer,Te.indexBuffer,Te.segments,h.paint,y.transform.zoom,we,y.style.map.terrain&&Te.centroidVertexBuffer)}}function Il(y,o,h,p,m,v,E){const M=y.context,A=M.gl,R=h.fbo;if(!R)return;const V=y.useProgram("hillshade"),q=y.style.map.terrain&&y.style.map.terrain.getTerrainData(o);M.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,R.colorAttachment.get()),V.draw(M,A.TRIANGLES,m,v,E,jr.disabled,((Q,he,ue,ye)=>{const se=ue.paint.get("hillshade-shadow-color"),Te=ue.paint.get("hillshade-highlight-color"),Ue=ue.paint.get("hillshade-accent-color");let we=ue.paint.get("hillshade-illumination-direction")*(Math.PI/180);ue.paint.get("hillshade-illumination-anchor")==="viewport"&&(we-=Q.transform.angle);const Le=!Q.options.moving;return{u_matrix:ye?ye.posMatrix:Q.transform.calculatePosMatrix(he.tileID.toUnwrapped(),Le),u_image:0,u_latrange:Dh(0,he.tileID),u_light:[ue.paint.get("hillshade-exaggeration"),we],u_shadow:se,u_highlight:Te,u_accent:Ue}})(y,h,p,q?o:null),q,p.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments)}function Kc(y,o,h,p,m,v){const E=y.context,M=E.gl,A=o.dem;if(A&&A.data){const R=A.dim,V=A.stride,q=A.getPixels();if(E.activeTexture.set(M.TEXTURE1),E.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||y.getTileTexture(V),o.demTexture){const he=o.demTexture;he.update(q,{premultiply:!1}),he.bind(M.NEAREST,M.CLAMP_TO_EDGE)}else o.demTexture=new re(E,q,M.RGBA,{premultiply:!1}),o.demTexture.bind(M.NEAREST,M.CLAMP_TO_EDGE);E.activeTexture.set(M.TEXTURE0);let Q=o.fbo;if(!Q){const he=new re(E,{width:R,height:R,data:null},M.RGBA);he.bind(M.LINEAR,M.CLAMP_TO_EDGE),Q=o.fbo=E.createFramebuffer(R,R,!0,!1),Q.colorAttachment.set(he.texture)}E.bindFramebuffer.set(Q.framebuffer),E.viewport.set([0,0,R,R]),y.useProgram("hillshadePrepare").draw(E,M.TRIANGLES,p,m,v,jr.disabled,((he,ue)=>{const ye=ue.stride,se=a.F();return a.aN(se,0,a.W,-a.W,0,0,1),a.H(se,se,[0,-a.W,0]),{u_matrix:se,u_image:1,u_dimension:[ye,ye],u_zoom:he.overscaledZ,u_unpack:ue.getUnpackVector()}})(o.tileID,A),null,h.id,y.rasterBoundsBuffer,y.quadTriangleIndexBuffer,y.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function Hh(y,o,h,p,m,v){const E=p.paint.get("raster-fade-duration");if(!v&&E>0){const M=k.now(),A=(M-y.timeAdded)/E,R=o?(M-o.timeAdded)/E:-1,V=h.getSource(),q=m.coveringZoomLevel({tileSize:V.tileSize,roundZoom:V.roundZoom}),Q=!o||Math.abs(o.tileID.overscaledZ-q)>Math.abs(y.tileID.overscaledZ-q),he=Q&&y.refreshedUponExpiration?1:a.ac(Q?A:1-R,0,1);return y.refreshedUponExpiration&&A>=1&&(y.refreshedUponExpiration=!1),o?{opacity:1,mix:1-he}:{opacity:he,mix:0}}return{opacity:1,mix:0}}const $h=new a.aO(1,0,0,1),Al=new a.aO(0,1,0,1),Jc=new a.aO(0,0,1,1),sp=new a.aO(1,0,1,1),Xh=new a.aO(0,1,1,1);function cn(y,o,h,p){pi(y,0,o+h/2,y.transform.width,h,p)}function Jo(y,o,h,p){pi(y,o-h/2,0,h,y.transform.height,p)}function pi(y,o,h,p,m,v){const E=y.context,M=E.gl;M.enable(M.SCISSOR_TEST),M.scissor(o*y.pixelRatio,h*y.pixelRatio,p*y.pixelRatio,m*y.pixelRatio),E.clear({color:v}),M.disable(M.SCISSOR_TEST)}function Yc(y,o,h){const p=y.context,m=p.gl,v=h.posMatrix,E=y.useProgram("debug"),M=xr.disabled,A=$r.disabled,R=y.colorModeForRenderPass(),V="$debug",q=y.style.map.terrain&&y.style.map.terrain.getTerrainData(h);p.activeTexture.set(m.TEXTURE0);const Q=o.getTileByID(h.key).latestRawTileData,he=Math.floor((Q&&Q.byteLength||0)/1024),ue=o.getTile(h).tileSize,ye=512/Math.min(ue,512)*(h.overscaledZ/y.transform.zoom)*.5;let se=h.canonical.toString();h.overscaledZ!==h.canonical.z&&(se+=` => ${h.overscaledZ}`),function(Te,Ue){Te.initDebugOverlayCanvas();const we=Te.debugOverlayCanvas,Le=Te.context.gl,Ge=Te.debugOverlayCanvas.getContext("2d");Ge.clearRect(0,0,we.width,we.height),Ge.shadowColor="white",Ge.shadowBlur=2,Ge.lineWidth=1.5,Ge.strokeStyle="white",Ge.textBaseline="top",Ge.font="bold 36px Open Sans, sans-serif",Ge.fillText(Ue,5,5),Ge.strokeText(Ue,5,5),Te.debugOverlayTexture.update(we),Te.debugOverlayTexture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE)}(y,`${se} ${he}kB`),E.draw(p,m.TRIANGLES,M,A,Sn.alphaBlended,jr.disabled,Ph(v,a.aO.transparent,ye),null,V,y.debugBuffer,y.quadTriangleIndexBuffer,y.debugSegments),E.draw(p,m.LINE_STRIP,M,A,R,jr.disabled,Ph(v,a.aO.red),q,V,y.debugBuffer,y.tileBorderIndexBuffer,y.debugSegments)}function Ll(y,o,h){const p=y.context,m=p.gl,v=y.colorModeForRenderPass(),E=new xr(m.LEQUAL,xr.ReadWrite,y.depthRangeFor3D),M=y.useProgram("terrain"),A=o.getTerrainMesh();p.bindFramebuffer.set(null),p.viewport.set([0,0,y.width,y.height]);for(const R of h){const V=y.renderToTexture.getTexture(R),q=o.getTerrainData(R.tileID);p.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,V.texture);const Q={u_matrix:y.transform.calculatePosMatrix(R.tileID.toUnwrapped()),u_texture:0,u_ele_delta:o.getMeshFrameDelta(y.transform.zoom)};M.draw(p,m.TRIANGLES,E,$r.disabled,v,jr.backCCW,Q,q,"terrain",A.vertexBuffer,A.indexBuffer,A.segments)}}class Kh{constructor(o,h){this.context=new op(o),this.transform=h,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:a.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Or.maxUnderzooming+Or.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Xo}resize(o,h,p){if(this.width=Math.floor(o*p),this.height=Math.floor(h*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const m of this.style._order)this.style._layers[m].resize()}setup(){const o=this.context,h=new a.aV;h.emplaceBack(0,0),h.emplaceBack(a.W,0),h.emplaceBack(0,a.W),h.emplaceBack(a.W,a.W),this.tileExtentBuffer=o.createVertexBuffer(h,ll.members),this.tileExtentSegments=a.$.simpleSegment(0,0,4,2);const p=new a.aV;p.emplaceBack(0,0),p.emplaceBack(a.W,0),p.emplaceBack(0,a.W),p.emplaceBack(a.W,a.W),this.debugBuffer=o.createVertexBuffer(p,ll.members),this.debugSegments=a.$.simpleSegment(0,0,4,5);const m=new a.Z;m.emplaceBack(0,0,0,0),m.emplaceBack(a.W,0,a.W,0),m.emplaceBack(0,a.W,0,a.W),m.emplaceBack(a.W,a.W,a.W,a.W),this.rasterBoundsBuffer=o.createVertexBuffer(m,Ye.members),this.rasterBoundsSegments=a.$.simpleSegment(0,0,4,2);const v=new a.aV;v.emplaceBack(0,0),v.emplaceBack(1,0),v.emplaceBack(0,1),v.emplaceBack(1,1),this.viewportBuffer=o.createVertexBuffer(v,ll.members),this.viewportSegments=a.$.simpleSegment(0,0,4,2);const E=new a.aW;E.emplaceBack(0),E.emplaceBack(1),E.emplaceBack(3),E.emplaceBack(2),E.emplaceBack(0),this.tileBorderIndexBuffer=o.createIndexBuffer(E);const M=new a.aX;M.emplaceBack(0,1,2),M.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=o.createIndexBuffer(M);const A=this.context.gl;this.stencilClearMode=new $r({func:A.ALWAYS,mask:0},0,255,A.ZERO,A.ZERO,A.ZERO)}clearStencil(){const o=this.context,h=o.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const p=a.F();a.aN(p,0,this.width,this.height,0,0,1),a.J(p,p,[h.drawingBufferWidth,h.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(o,h.TRIANGLES,xr.disabled,this.stencilClearMode,Sn.disabled,jr.disabled,fl(p),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(o,h){if(this.currentStencilSource===o.source||!o.isTileClipped()||!h||!h.length)return;this.currentStencilSource=o.source;const p=this.context,m=p.gl;this.nextStencilID+h.length>256&&this.clearStencil(),p.setColorMode(Sn.disabled),p.setDepthMode(xr.disabled);const v=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const E of h){const M=this._tileClippingMaskIDs[E.key]=this.nextStencilID++,A=this.style.map.terrain&&this.style.map.terrain.getTerrainData(E);v.draw(p,m.TRIANGLES,xr.disabled,new $r({func:m.ALWAYS,mask:0},M,255,m.KEEP,m.KEEP,m.REPLACE),Sn.disabled,jr.disabled,fl(E.posMatrix),A,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const o=this.nextStencilID++,h=this.context.gl;return new $r({func:h.NOTEQUAL,mask:255},o,255,h.KEEP,h.KEEP,h.REPLACE)}stencilModeForClipping(o){const h=this.context.gl;return new $r({func:h.EQUAL,mask:255},this._tileClippingMaskIDs[o.key],0,h.KEEP,h.KEEP,h.REPLACE)}stencilConfigForOverlap(o){const h=this.context.gl,p=o.sort((E,M)=>M.overscaledZ-E.overscaledZ),m=p[p.length-1].overscaledZ,v=p[0].overscaledZ-m+1;if(v>1){this.currentStencilSource=void 0,this.nextStencilID+v>256&&this.clearStencil();const E={};for(let M=0;M=0;this.currentLayer--){const A=this.style._layers[p[this.currentLayer]],R=m[A.source],V=v[A.source];this._renderTileClippingMasks(A,V),this.renderLayer(this,R,A,V)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerse.source&&!se.isHidden(V)?[R.sourceCaches[se.source]]:[]),he=Q.filter(se=>se.getSource().type==="vector"),ue=Q.filter(se=>se.getSource().type!=="vector"),ye=se=>{(!q||q.getSource().maxzoomye(se)),q||ue.forEach(se=>ye(se)),q}(this.style,this.transform.zoom);A&&function(R,V,q){for(let Q=0;Q0),m&&(a.a_(h,p),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(v,E){const M=v.context,A=M.gl,R=Sn.unblended,V=new xr(A.LEQUAL,xr.ReadWrite,[0,1]),q=E.getTerrainMesh(),Q=E.sourceCache.getRenderableTiles(),he=v.useProgram("terrainDepth");M.bindFramebuffer.set(E.getFramebuffer("depth").framebuffer),M.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),M.clear({color:a.aO.transparent,depth:1});for(const ue of Q){const ye=E.getTerrainData(ue.tileID),se={u_matrix:v.transform.calculatePosMatrix(ue.tileID.toUnwrapped()),u_ele_delta:E.getMeshFrameDelta(v.transform.zoom)};he.draw(M,A.TRIANGLES,V,$r.disabled,R,jr.backCCW,se,ye,"terrain",q.vertexBuffer,q.indexBuffer,q.segments)}M.bindFramebuffer.set(null),M.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain),function(v,E){const M=v.context,A=M.gl,R=Sn.unblended,V=new xr(A.LEQUAL,xr.ReadWrite,[0,1]),q=E.getTerrainMesh(),Q=E.getCoordsTexture(),he=E.sourceCache.getRenderableTiles(),ue=v.useProgram("terrainCoords");M.bindFramebuffer.set(E.getFramebuffer("coords").framebuffer),M.viewport.set([0,0,v.width/devicePixelRatio,v.height/devicePixelRatio]),M.clear({color:a.aO.transparent,depth:1}),E.coordsIndex=[];for(const ye of he){const se=E.getTerrainData(ye.tileID);M.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,Q.texture);const Te={u_matrix:v.transform.calculatePosMatrix(ye.tileID.toUnwrapped()),u_terrain_coords_id:(255-E.coordsIndex.length)/255,u_texture:0,u_ele_delta:E.getMeshFrameDelta(v.transform.zoom)};ue.draw(M,A.TRIANGLES,V,$r.disabled,R,jr.backCCW,Te,se,"terrain",q.vertexBuffer,q.indexBuffer,q.segments),E.coordsIndex.push(ye.tileID.key)}M.bindFramebuffer.set(null),M.viewport.set([0,0,v.width,v.height])}(this,this.style.map.terrain))}renderLayer(o,h,p,m){if(!p.isHidden(this.transform.zoom)&&(p.type==="background"||p.type==="custom"||(m||[]).length))switch(this.id=p.id,p.type){case"symbol":(function(v,E,M,A,R){if(v.renderPass!=="translucent")return;const V=$r.disabled,q=v.colorModeForRenderPass();(M._unevaluatedLayout.hasValue("text-variable-anchor")||M._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Q,he,ue,ye,se,Te,Ue){const we=he.transform,Le=se==="map",Ge=Te==="map";for(const He of Q){const $e=ye.getTile(He),nt=$e.getBucket(ue);if(!nt||!nt.text||!nt.text.segments.get().length)continue;const et=a.ag(nt.textSizeData,we.zoom),ft=$t($e,1,he.transform.zoom),gt=Qt(He.posMatrix,Ge,Le,he.transform,ft),ir=ue.layout.get("icon-text-fit")!=="none"&&nt.hasIconData();if(et){const _t=Math.pow(2,we.zoom-$e.tileID.overscaledZ);kl(nt,Le,Ge,Ue,we,gt,He.posMatrix,_t,et,ir,he.style.map.terrain?(Xt,or)=>he.style.map.terrain.getElevation(He,Xt,or):null)}}}(A,v,M,E,M.layout.get("text-rotation-alignment"),M.layout.get("text-pitch-alignment"),R),M.paint.get("icon-opacity").constantOr(1)!==0&&El(v,E,M,A,!1,M.paint.get("icon-translate"),M.paint.get("icon-translate-anchor"),M.layout.get("icon-rotation-alignment"),M.layout.get("icon-pitch-alignment"),M.layout.get("icon-keep-upright"),V,q),M.paint.get("text-opacity").constantOr(1)!==0&&El(v,E,M,A,!0,M.paint.get("text-translate"),M.paint.get("text-translate-anchor"),M.layout.get("text-rotation-alignment"),M.layout.get("text-pitch-alignment"),M.layout.get("text-keep-upright"),V,q),E.map.showCollisionBoxes&&(Sl(v,E,M,A,M.paint.get("text-translate"),M.paint.get("text-translate-anchor"),!0),Sl(v,E,M,A,M.paint.get("icon-translate"),M.paint.get("icon-translate-anchor"),!1))})(o,h,p,m,this.style.placement.variableOffsets);break;case"circle":(function(v,E,M,A){if(v.renderPass!=="translucent")return;const R=M.paint.get("circle-opacity"),V=M.paint.get("circle-stroke-width"),q=M.paint.get("circle-stroke-opacity"),Q=!M.layout.get("circle-sort-key").isConstant();if(R.constantOr(1)===0&&(V.constantOr(1)===0||q.constantOr(1)===0))return;const he=v.context,ue=he.gl,ye=v.depthModeForSublayer(0,xr.ReadOnly),se=$r.disabled,Te=v.colorModeForRenderPass(),Ue=[];for(let we=0;wewe.sortKey-Le.sortKey);for(const we of Ue){const{programConfiguration:Le,program:Ge,layoutVertexBuffer:He,indexBuffer:$e,uniformValues:nt,terrainData:et}=we.state;Ge.draw(he,ue.TRIANGLES,ye,se,Te,jr.disabled,nt,et,M.id,He,$e,we.segments,M.paint,v.transform.zoom,Le)}})(o,h,p,m);break;case"heatmap":(function(v,E,M,A){if(M.paint.get("heatmap-opacity")!==0)if(v.renderPass==="offscreen"){const R=v.context,V=R.gl,q=$r.disabled,Q=new Sn([V.ONE,V.ONE],a.aO.transparent,[!0,!0,!0,!0]);(function(he,ue,ye){const se=he.gl;he.activeTexture.set(se.TEXTURE1),he.viewport.set([0,0,ue.width/4,ue.height/4]);let Te=ye.heatmapFbo;if(Te)se.bindTexture(se.TEXTURE_2D,Te.colorAttachment.get()),he.bindFramebuffer.set(Te.framebuffer);else{const Ue=se.createTexture();se.bindTexture(se.TEXTURE_2D,Ue),se.texParameteri(se.TEXTURE_2D,se.TEXTURE_WRAP_S,se.CLAMP_TO_EDGE),se.texParameteri(se.TEXTURE_2D,se.TEXTURE_WRAP_T,se.CLAMP_TO_EDGE),se.texParameteri(se.TEXTURE_2D,se.TEXTURE_MIN_FILTER,se.LINEAR),se.texParameteri(se.TEXTURE_2D,se.TEXTURE_MAG_FILTER,se.LINEAR),Te=ye.heatmapFbo=he.createFramebuffer(ue.width/4,ue.height/4,!1,!1),function(we,Le,Ge,He){var $e,nt;const et=we.gl,ft=($e=we.HALF_FLOAT)!==null&&$e!==void 0?$e:et.UNSIGNED_BYTE,gt=(nt=we.RGBA16F)!==null&&nt!==void 0?nt:et.RGBA;et.texImage2D(et.TEXTURE_2D,0,gt,Le.width/4,Le.height/4,0,et.RGBA,ft,null),He.colorAttachment.set(Ge)}(he,ue,Ue,Te)}})(R,v,M),R.clear({color:a.aO.transparent});for(let he=0;he{const we=a.F();a.aN(we,0,ye.width,ye.height,0,0,1);const Le=ye.context.gl;return{u_matrix:we,u_world:[Le.drawingBufferWidth,Le.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:se.paint.get("heatmap-opacity")}})(R,V),null,V.id,R.viewportBuffer,R.quadTriangleIndexBuffer,R.viewportSegments,V.paint,R.transform.zoom)}(v,M))})(o,h,p,m);break;case"line":(function(v,E,M,A){if(v.renderPass!=="translucent")return;const R=M.paint.get("line-opacity"),V=M.paint.get("line-width");if(R.constantOr(1)===0||V.constantOr(1)===0)return;const q=v.depthModeForSublayer(0,xr.ReadOnly),Q=v.colorModeForRenderPass(),he=M.paint.get("line-dasharray"),ue=M.paint.get("line-pattern"),ye=ue.constantOr(1),se=M.paint.get("line-gradient"),Te=M.getCrossfadeParameters(),Ue=ye?"linePattern":he?"lineSDF":se?"lineGradient":"line",we=v.context,Le=we.gl;let Ge=!0;for(const He of A){const $e=E.getTile(He);if(ye&&!$e.patternsLoaded())continue;const nt=$e.getBucket(M);if(!nt)continue;const et=nt.programConfigurations.get(M.id),ft=v.context.program.get(),gt=v.useProgram(Ue,et),ir=Ge||gt.program!==ft,_t=v.style.map.terrain&&v.style.map.terrain.getTerrainData(He),Xt=ue.constantOr(null);if(Xt&&$e.imageAtlas){const Yt=$e.imageAtlas,cr=Yt.patternPositions[Xt.to.toString()],dr=Yt.patternPositions[Xt.from.toString()];cr&&dr&&et.setConstantPatternPositions(cr,dr)}const or=_t?He:null,Sr=ye?ds(v,$e,M,Te,or):he?pl(v,$e,M,he,Te,or):se?Rh(v,$e,M,nt.lineClipsArray.length,or):dl(v,$e,M,or);if(ye)we.activeTexture.set(Le.TEXTURE0),$e.imageAtlasTexture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE),et.updatePaintBuffers(Te);else if(he&&(ir||v.lineAtlas.dirty))we.activeTexture.set(Le.TEXTURE0),v.lineAtlas.bind(we);else if(se){const Yt=nt.gradients[M.id];let cr=Yt.texture;if(M.gradientVersion!==Yt.version){let dr=256;if(M.stepInterpolant){const hn=E.getSource().maxzoom,Rr=He.canonical.z===hn?Math.ceil(1<0?h.pop():null}isPatternMissing(o){if(!o)return!1;if(!o.from||!o.to)return!0;const h=this.imageManager.getPattern(o.from.toString()),p=this.imageManager.getPattern(o.to.toString());return!h||!p}useProgram(o,h){this.cache=this.cache||{};const p=o+(h?h.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[p]||(this.cache[p]=new Ko(this.context,Ea[o],h,Bh[o],this._showOverdrawInspector,this.style.map.terrain)),this.cache[p]}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 o=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(o.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new re(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:o,drawingBufferHeight:h}=this.context.gl;return this.width!==o||this.height!==h}}class Yo{constructor(o,h){this.points=o,this.planes=h}static fromInvProjectionMatrix(o,h,p){const m=Math.pow(2,p),v=[[-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(M=>{const A=1/(M=a.af([],M,o))[3]/h*m;return a.a$(M,M,[A,A,1/M[3],A])}),E=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(M=>{const A=function(Q,he){var ue=he[0],ye=he[1],se=he[2],Te=ue*ue+ye*ye+se*se;return Te>0&&(Te=1/Math.sqrt(Te)),Q[0]=he[0]*Te,Q[1]=he[1]*Te,Q[2]=he[2]*Te,Q}([],function(Q,he,ue){var ye=he[0],se=he[1],Te=he[2],Ue=ue[0],we=ue[1],Le=ue[2];return Q[0]=se*Le-Te*we,Q[1]=Te*Ue-ye*Le,Q[2]=ye*we-se*Ue,Q}([],Y([],v[M[0]],v[M[1]]),Y([],v[M[2]],v[M[1]]))),R=-((V=A)[0]*(q=v[M[1]])[0]+V[1]*q[1]+V[2]*q[2]);var V,q;return A.concat(R)});return new Yo(v,E)}}class Qo{constructor(o,h){this.min=o,this.max=h,this.center=function(p,m,v){return p[0]=.5*m[0],p[1]=.5*m[1],p[2]=.5*m[2],p}([],function(p,m,v){return p[0]=m[0]+v[0],p[1]=m[1]+v[1],p[2]=m[2]+v[2],p}([],this.min,this.max))}quadrant(o){const h=[o%2==0,o<2],p=me(this.min),m=me(this.max);for(let v=0;v=0&&E++;if(E===0)return 0;E!==h.length&&(p=!1)}if(p)return 2;for(let m=0;m<3;m++){let v=Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let M=0;Mthis.max[m]-this.min[m])return 0}return 1}}class Ws{constructor(o=0,h=0,p=0,m=0){if(isNaN(o)||o<0||isNaN(h)||h<0||isNaN(p)||p<0||isNaN(m)||m<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=o,this.bottom=h,this.left=p,this.right=m}interpolate(o,h,p){return h.top!=null&&o.top!=null&&(this.top=a.z.number(o.top,h.top,p)),h.bottom!=null&&o.bottom!=null&&(this.bottom=a.z.number(o.bottom,h.bottom,p)),h.left!=null&&o.left!=null&&(this.left=a.z.number(o.left,h.left,p)),h.right!=null&&o.right!=null&&(this.right=a.z.number(o.right,h.right,p)),this}getCenter(o,h){const p=a.ac((this.left+o-this.right)/2,0,o),m=a.ac((this.top+h-this.bottom)/2,0,h);return new a.P(p,m)}equals(o){return this.top===o.top&&this.bottom===o.bottom&&this.left===o.left&&this.right===o.right}clone(){return new Ws(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Qc=85.051129;class Pl{constructor(o,h,p,m,v){this.tileSize=512,this._renderWorldCopies=v===void 0||!!v,this._minZoom=o||0,this._maxZoom=h||22,this._minPitch=p??0,this._maxPitch=m??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ws,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const o=new Pl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return o.apply(this),o}apply(o){this.tileSize=o.tileSize,this.latRange=o.latRange,this.width=o.width,this.height=o.height,this._center=o._center,this._elevation=o._elevation,this.minElevationForCurrentTile=o.minElevationForCurrentTile,this.zoom=o.zoom,this.angle=o.angle,this._fov=o._fov,this._pitch=o._pitch,this._unmodified=o._unmodified,this._edgeInsets=o._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(o){this._minZoom!==o&&(this._minZoom=o,this.zoom=Math.max(this.zoom,o))}get maxZoom(){return this._maxZoom}set maxZoom(o){this._maxZoom!==o&&(this._maxZoom=o,this.zoom=Math.min(this.zoom,o))}get minPitch(){return this._minPitch}set minPitch(o){this._minPitch!==o&&(this._minPitch=o,this.pitch=Math.max(this.pitch,o))}get maxPitch(){return this._maxPitch}set maxPitch(o){this._maxPitch!==o&&(this._maxPitch=o,this.pitch=Math.min(this.pitch,o))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(o){o===void 0?o=!0:o===null&&(o=!1),this._renderWorldCopies=o}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(o){const h=-a.b1(o,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=function(){var p=new a.A(4);return a.A!=Float32Array&&(p[1]=0,p[2]=0),p[0]=1,p[3]=1,p}(),function(p,m,v){var E=m[0],M=m[1],A=m[2],R=m[3],V=Math.sin(v),q=Math.cos(v);p[0]=E*q+A*V,p[1]=M*q+R*V,p[2]=E*-V+A*q,p[3]=M*-V+R*q}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(o){const h=a.ac(o,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==h&&(this._unmodified=!1,this._pitch=h,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(o){o=Math.max(.01,Math.min(60,o)),this._fov!==o&&(this._unmodified=!1,this._fov=o/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(o){const h=Math.min(Math.max(o,this.minZoom),this.maxZoom);this._zoom!==h&&(this._unmodified=!1,this._zoom=h,this.tileZoom=Math.max(0,Math.floor(h)),this.scale=this.zoomScale(h),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(o){o.lat===this._center.lat&&o.lng===this._center.lng||(this._unmodified=!1,this._center=o,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(o){o!==this._elevation&&(this._elevation=o,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(o){this._edgeInsets.equals(o)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,o,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(o){return this._edgeInsets.equals(o)}interpolatePadding(o,h,p){this._unmodified=!1,this._edgeInsets.interpolate(o,h,p),this._constrain(),this._calcMatrices()}coveringZoomLevel(o){const h=(o.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/o.tileSize));return Math.max(0,h)}getVisibleUnwrappedCoordinates(o){const h=[new a.b2(0,o)];if(this._renderWorldCopies){const p=this.pointCoordinate(new a.P(0,0)),m=this.pointCoordinate(new a.P(this.width,0)),v=this.pointCoordinate(new a.P(this.width,this.height)),E=this.pointCoordinate(new a.P(0,this.height)),M=Math.floor(Math.min(p.x,m.x,v.x,E.x)),A=Math.floor(Math.max(p.x,m.x,v.x,E.x)),R=1;for(let V=M-R;V<=A+R;V++)V!==0&&h.push(new a.b2(V,o))}return h}coveringTiles(o){var h,p;let m=this.coveringZoomLevel(o);const v=m;if(o.minzoom!==void 0&&mo.maxzoom&&(m=o.maxzoom);const E=this.pointCoordinate(this.getCameraPoint()),M=a.Y.fromLngLat(this.center),A=Math.pow(2,m),R=[A*E.x,A*E.y,0],V=[A*M.x,A*M.y,0],q=Yo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,m);let Q=o.minzoom||0;!o.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Q=m);const he=o.terrain?2/Math.min(this.tileSize,o.tileSize)*this.tileSize:3,ue=we=>({aabb:new Qo([we*A,0,0],[(we+1)*A,A,0]),zoom:0,x:0,y:0,wrap:we,fullyVisible:!1}),ye=[],se=[],Te=m,Ue=o.reparseOverscaled?v:m;if(this._renderWorldCopies)for(let we=1;we<=3;we++)ye.push(ue(-we)),ye.push(ue(we));for(ye.push(ue(0));ye.length>0;){const we=ye.pop(),Le=we.x,Ge=we.y;let He=we.fullyVisible;if(!He){const gt=we.aabb.intersects(q);if(gt===0)continue;He=gt===2}const $e=o.terrain?R:V,nt=we.aabb.distanceX($e),et=we.aabb.distanceY($e),ft=Math.max(Math.abs(nt),Math.abs(et));if(we.zoom===Te||ft>he+(1<=Q){const gt=Te-we.zoom,ir=R[0]-.5-(Le<>1),Xt=we.zoom+1;let or=we.aabb.quadrant(gt);if(o.terrain){const Sr=new a.Q(Xt,we.wrap,Xt,ir,_t),Yt=o.terrain.getMinMaxElevation(Sr),cr=(h=Yt.minElevation)!==null&&h!==void 0?h:this.elevation,dr=(p=Yt.maxElevation)!==null&&p!==void 0?p:this.elevation;or=new Qo([or.min[0],or.min[1],cr],[or.max[0],or.max[1],dr])}ye.push({aabb:or,zoom:Xt,x:ir,y:_t,wrap:we.wrap,fullyVisible:He})}}return se.sort((we,Le)=>we.distanceSq-Le.distanceSq).map(we=>we.tileID)}resize(o,h){this.width=o,this.height=h,this.pixelsToGLUnits=[2/o,-2/h],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(o){return Math.pow(2,o)}scaleZoom(o){return Math.log(o)/Math.LN2}project(o){const h=a.ac(o.lat,-85.051129,Qc);return new a.P(a.N(o.lng)*this.worldSize,a.O(h)*this.worldSize)}unproject(o){return new a.Y(o.x/this.worldSize,o.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(o){const h=this.elevation,p=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,m=this.pointLocation(this.centerPoint,o),v=o.getElevationForLngLatZoom(m,this.tileZoom);if(!(this.elevation-v))return;const E=p+h-v,M=Math.cos(this._pitch)*this.cameraToCenterDistance/E/a.b3(1,m.lat),A=this.scaleZoom(M/this.tileSize);this._elevation=v,this._center=m,this.zoom=A}setLocationAtPoint(o,h){const p=this.pointCoordinate(h),m=this.pointCoordinate(this.centerPoint),v=this.locationCoordinate(o),E=new a.Y(v.x-(p.x-m.x),v.y-(p.y-m.y));this.center=this.coordinateLocation(E),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(o,h){return h?this.coordinatePoint(this.locationCoordinate(o),h.getElevationForLngLatZoom(o,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(o))}pointLocation(o,h){return this.coordinateLocation(this.pointCoordinate(o,h))}locationCoordinate(o){return a.Y.fromLngLat(o)}coordinateLocation(o){return o&&o.toLngLat()}pointCoordinate(o,h){if(h){const Q=h.pointCoordinate(o);if(Q!=null)return Q}const p=[o.x,o.y,0,1],m=[o.x,o.y,1,1];a.af(p,p,this.pixelMatrixInverse),a.af(m,m,this.pixelMatrixInverse);const v=p[3],E=m[3],M=p[1]/v,A=m[1]/E,R=p[2]/v,V=m[2]/E,q=R===V?0:(0-R)/(V-R);return new a.Y(a.z.number(p[0]/v,m[0]/E,q)/this.worldSize,a.z.number(M,A,q)/this.worldSize)}coordinatePoint(o,h=0,p=this.pixelMatrix){const m=[o.x*this.worldSize,o.y*this.worldSize,h,1];return a.af(m,m,p),new a.P(m[0]/m[3],m[1]/m[3])}getBounds(){const o=Math.max(0,this.height/2-this.getHorizon());return new st().extend(this.pointLocation(new a.P(0,o))).extend(this.pointLocation(new a.P(this.width,o))).extend(this.pointLocation(new a.P(this.width,this.height))).extend(this.pointLocation(new a.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new st([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(o){o?(this.lngRange=[o.getWest(),o.getEast()],this.latRange=[o.getSouth(),o.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Qc])}calculatePosMatrix(o,h=!1){const p=o.key,m=h?this._alignedPosMatrixCache:this._posMatrixCache;if(m[p])return m[p];const v=o.canonical,E=this.worldSize/this.zoomScale(v.z),M=v.x+Math.pow(2,v.z)*o.wrap,A=a.an(new Float64Array(16));return a.H(A,A,[M*E,v.y*E,0]),a.J(A,A,[E/a.W,E/a.W,1]),a.K(A,h?this.alignedProjMatrix:this.projMatrix,A),m[p]=new Float32Array(A),m[p]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(o,h){h=a.ac(+h,this.minZoom,this.maxZoom);const p={center:new a.M(o.lng,o.lat),zoom:h};let m=this.lngRange;if(!this._renderWorldCopies&&m===null){const we=179.9999999999;m=[-we,we]}const v=this.tileSize*this.zoomScale(p.zoom);let E=0,M=v,A=0,R=v,V=0,q=0;const{x:Q,y:he}=this.size;if(this.latRange){const we=this.latRange;E=a.O(we[1])*v,M=a.O(we[0])*v,M-EM&&(Te=M-we)}if(m){const we=(A+R)/2;let Le=ue;this._renderWorldCopies&&(Le=a.b1(ue,we-v/2,we+v/2));const Ge=Q/2;Le-GeR&&(se=R-Ge)}if(se!==void 0||Te!==void 0){const we=new a.P(se??ue,Te??ye);p.center=this.unproject.call({worldSize:v},we).wrap()}return p}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const o=this._unmodified,{center:h,zoom:p}=this.getConstrained(this.center,this.zoom);this.center=h,this.zoom=p,this._unmodified=o,this._constraining=!1}_calcMatrices(){if(!this.height)return;const o=this.centerOffset,h=this.point.x,p=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=a.b3(1,this.center.lat)*this.worldSize;let m=a.an(new Float64Array(16));a.J(m,m,[this.width/2,-this.height/2,1]),a.H(m,m,[1,-1,0]),this.labelPlaneMatrix=m,m=a.an(new Float64Array(16)),a.J(m,m,[1,-1,1]),a.H(m,m,[-1,-1,0]),a.J(m,m,[2/this.width,2/this.height,1]),this.glCoordMatrix=m;const v=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),E=Math.min(this.elevation,this.minElevationForCurrentTile),M=v-E*this._pixelPerMeter/Math.cos(this._pitch),A=E<0?M:v,R=Math.PI/2+this._pitch,V=this._fov*(.5+o.y/this.height),q=Math.sin(V)*A/Math.sin(a.ac(Math.PI-R-V,.01,Math.PI-.01)),Q=this.getHorizon(),he=2*Math.atan(Q/this.cameraToCenterDistance)*(.5+o.y/(2*Q)),ue=Math.sin(he)*A/Math.sin(a.ac(Math.PI-R-he,.01,Math.PI-.01)),ye=Math.min(q,ue),se=1.01*(Math.cos(Math.PI/2-this._pitch)*ye+A),Te=this.height/50;m=new Float64Array(16),a.b4(m,this._fov,this.width/this.height,Te,se),m[8]=2*-o.x/this.width,m[9]=2*o.y/this.height,a.J(m,m,[1,-1,1]),a.H(m,m,[0,0,-this.cameraToCenterDistance]),a.b5(m,m,this._pitch),a.ad(m,m,this.angle),a.H(m,m,[-h,-p,0]),this.mercatorMatrix=a.J([],m,[this.worldSize,this.worldSize,this.worldSize]),a.J(m,m,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.K(new Float64Array(16),this.labelPlaneMatrix,m),a.H(m,m,[0,0,-this.elevation]),this.projMatrix=m,this.invProjMatrix=a.ar([],m),this.pixelMatrix3D=a.K(new Float64Array(16),this.labelPlaneMatrix,m);const Ue=this.width%2/2,we=this.height%2/2,Le=Math.cos(this.angle),Ge=Math.sin(this.angle),He=h-Math.round(h)+Le*Ue+Ge*we,$e=p-Math.round(p)+Le*we+Ge*Ue,nt=new Float64Array(m);if(a.H(nt,nt,[He>.5?He-1:He,$e>.5?$e-1:$e,0]),this.alignedProjMatrix=nt,m=a.ar(new Float64Array(16),this.pixelMatrix),!m)throw new Error("failed to invert matrix");this.pixelMatrixInverse=m,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const o=this.pointCoordinate(new a.P(0,0)),h=[o.x*this.worldSize,o.y*this.worldSize,0,1];return a.af(h,h,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const o=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.P(0,o))}getCameraQueryGeometry(o){const h=this.getCameraPoint();if(o.length===1)return[o[0],h];{let p=h.x,m=h.y,v=h.x,E=h.y;for(const M of o)p=Math.min(p,M.x),m=Math.min(m,M.y),v=Math.max(v,M.x),E=Math.max(E,M.y);return[new a.P(p,m),new a.P(v,m),new a.P(v,E),new a.P(p,E),new a.P(p,m)]}}lngLatToCameraDepth(o,h){const p=this.locationCoordinate(o),m=[p.x*this.worldSize,p.y*this.worldSize,h,1];return a.af(m,m,this.projMatrix),m[2]/m[3]}}function eu(y,o){let h,p=!1,m=null,v=null;const E=()=>{m=null,p&&(y.apply(v,h),m=setTimeout(E,o),p=!1)};return(...M)=>(p=!0,v=this,h=M,m||E(),m)}class tu{constructor(o){this._getCurrentHash=()=>{const h=window.location.hash.replace("#","");if(this._hashName){let p;return h.split("&").map(m=>m.split("=")).forEach(m=>{m[0]===this._hashName&&(p=m)}),(p&&p[1]||"").split("/")}return h.split("/")},this._onHashChange=()=>{const h=this._getCurrentHash();if(h.length>=3&&!h.some(p=>isNaN(p))){const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(h[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+h[2],+h[1]],zoom:+h[0],bearing:p,pitch:+(h[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const h=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,h)}catch{}},this._updateHash=eu(this._updateHashUnthrottled,300),this._hashName=o&&encodeURIComponent(o)}addTo(o){return this._map=o,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(o){const h=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,m=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),v=Math.pow(10,m),E=Math.round(h.lng*v)/v,M=Math.round(h.lat*v)/v,A=this._map.getBearing(),R=this._map.getPitch();let V="";if(V+=o?`/${E}/${M}/${p}`:`${p}/${M}/${E}`,(A||R)&&(V+="/"+Math.round(10*A)/10),R&&(V+=`/${Math.round(R)}`),this._hashName){const q=this._hashName;let Q=!1;const he=window.location.hash.slice(1).split("&").map(ue=>{const ye=ue.split("=")[0];return ye===q?(Q=!0,`${ye}=${V}`):ue}).filter(ue=>ue);return Q||he.push(`${q}=${V}`),`#${he.join("&")}`}return`#${V}`}}const Da={linearity:.3,easing:a.b6(0,0,.3,1)},_s=a.e({deceleration:2500,maxSpeed:1400},Da),Jh=a.e({deceleration:20,maxSpeed:1400},Da),Yh=a.e({deceleration:1e3,maxSpeed:360},Da),Qh=a.e({deceleration:1e3,maxSpeed:90},Da);class ef{constructor(o){this._map=o,this.clear()}clear(){this._inertiaBuffer=[]}record(o){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:k.now(),settings:o})}_drainInertiaBuffer(){const o=this._inertiaBuffer,h=k.now();for(;o.length>0&&h-o[0].time>160;)o.shift()}_onMoveEnd(o){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const h={zoom:0,bearing:0,pitch:0,pan:new a.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:v}of this._inertiaBuffer)h.zoom+=v.zoomDelta||0,h.bearing+=v.bearingDelta||0,h.pitch+=v.pitchDelta||0,v.panDelta&&h.pan._add(v.panDelta),v.around&&(h.around=v.around),v.pinchAround&&(h.pinchAround=v.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,m={};if(h.pan.mag()){const v=Ba(h.pan.mag(),p,a.e({},_s,o||{}));m.offset=h.pan.mult(v.amount/h.pan.mag()),m.center=this._map.transform.center,Ra(m,v)}if(h.zoom){const v=Ba(h.zoom,p,Jh);m.zoom=this._map.transform.zoom+v.amount,Ra(m,v)}if(h.bearing){const v=Ba(h.bearing,p,Yh);m.bearing=this._map.transform.bearing+a.ac(v.amount,-179,179),Ra(m,v)}if(h.pitch){const v=Ba(h.pitch,p,Qh);m.pitch=this._map.transform.pitch+v.amount,Ra(m,v)}if(m.zoom||m.bearing){const v=h.pinchAround===void 0?h.around:h.pinchAround;m.around=v?this._map.unproject(v):this._map.getCenter()}return this.clear(),a.e(m,{noMoveStart:!0})}}function Ra(y,o){(!y.duration||y.durationh.unproject(A)),M=v.reduce((A,R,V,q)=>A.add(R.div(q.length)),new a.P(0,0));super(o,{points:v,point:M,lngLats:E,lngLat:h.unproject(M),originalEvent:p}),this._defaultPrevented=!1}}class ru extends a.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(o,h,p){super(o,{originalEvent:p}),this._defaultPrevented=!1}}class no{constructor(o,h){this._map=o,this._clickTolerance=h.clickTolerance}reset(){delete this._mousedownPos}wheel(o){return this._firePreventable(new ru(o.type,this._map,o))}mousedown(o,h){return this._mousedownPos=h,this._firePreventable(new xi(o.type,this._map,o))}mouseup(o){this._map.fire(new xi(o.type,this._map,o))}click(o,h){this._mousedownPos&&this._mousedownPos.dist(h)>=this._clickTolerance||this._map.fire(new xi(o.type,this._map,o))}dblclick(o){return this._firePreventable(new xi(o.type,this._map,o))}mouseover(o){this._map.fire(new xi(o.type,this._map,o))}mouseout(o){this._map.fire(new xi(o.type,this._map,o))}touchstart(o){return this._firePreventable(new _o(o.type,this._map,o))}touchmove(o){this._map.fire(new _o(o.type,this._map,o))}touchend(o){this._map.fire(new _o(o.type,this._map,o))}touchcancel(o){this._map.fire(new _o(o.type,this._map,o))}_firePreventable(o){if(this._map.fire(o),o.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class yo{constructor(o){this._map=o}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(o){this._map.fire(new xi(o.type,this._map,o))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new xi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(o){this._delayContextMenu?this._contextMenuEvent=o:this._ignoreContextMenu||this._map.fire(new xi(o.type,this._map,o)),this._map.listens("contextmenu")&&o.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Zs{constructor(o){this._map=o}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(o){return this.transform.pointLocation(a.P.convert(o),this._map.terrain)}}class io{constructor(o,h){this._map=o,this._tr=new Zs(o),this._el=o.getCanvasContainer(),this._container=o.getContainer(),this._clickTolerance=h.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(o,h){this.isEnabled()&&o.shiftKey&&o.button===0&&(C.disableDrag(),this._startPos=this._lastPos=h,this._active=!0)}mousemoveWindow(o,h){if(!this._active)return;const p=h;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)v.fitScreenCoordinates(p,m,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",o)}keydown(o){this._active&&o.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",o))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(C.remove(this._box),this._box=null),C.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(o,h){return this._map.fire(new a.k(o,{originalEvent:h}))}}function ys(y,o){if(y.length!==o.length)throw new Error(`The number of touches and points are not equal - touches ${y.length}, points ${o.length}`);const h={};for(let p=0;pthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=o.timeStamp),p.length===this.numTouches&&(this.centroid=function(m){const v=new a.P(0,0);for(const E of m)v._add(E);return v.div(m.length)}(h),this.touches=ys(p,h)))}touchmove(o,h,p){if(this.aborted||!this.centroid)return;const m=ys(p,h);for(const v in this.touches){const E=m[v];(!E||E.dist(this.touches[v])>30)&&(this.aborted=!0)}}touchend(o,h,p){if((!this.centroid||o.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class nu{constructor(o){this.singleTap=new ap(o),this.numTaps=o.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(o,h,p){this.singleTap.touchstart(o,h,p)}touchmove(o,h,p){this.singleTap.touchmove(o,h,p)}touchend(o,h,p){const m=this.singleTap.touchend(o,h,p);if(m){const v=o.timeStamp-this.lastTime<500,E=!this.lastTap||this.lastTap.dist(m)<30;if(v&&E||this.reset(),this.count++,this.lastTime=o.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class lp{constructor(o){this._tr=new Zs(o),this._zoomIn=new nu({numTouches:1,numTaps:2}),this._zoomOut=new nu({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(o,h,p){this._zoomIn.touchstart(o,h,p),this._zoomOut.touchstart(o,h,p)}touchmove(o,h,p){this._zoomIn.touchmove(o,h,p),this._zoomOut.touchmove(o,h,p)}touchend(o,h,p){const m=this._zoomIn.touchend(o,h,p),v=this._zoomOut.touchend(o,h,p),E=this._tr;return m?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:M=>M.easeTo({duration:300,zoom:E.zoom+1,around:E.unproject(m)},{originalEvent:o})}):v?(this._active=!0,o.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:M=>M.easeTo({duration:300,zoom:E.zoom-1,around:E.unproject(v)},{originalEvent:o})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hs{constructor(o){this._enabled=!!o.enable,this._moveStateManager=o.moveStateManager,this._clickTolerance=o.clickTolerance||1,this._moveFunction=o.move,this._activateOnStart=!!o.activateOnStart,o.assignEvents(this),this.reset()}reset(o){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(o)}_move(...o){const h=this._moveFunction(...o);if(h.bearingDelta||h.pitchDelta||h.around||h.panDelta)return this._active=!0,h}dragStart(o,h){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(o)&&(this._moveStateManager.startMove(o),this._lastPoint=h.length?h[0]:h,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(o,h){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(o.preventDefault(),!this._moveStateManager.isValidMoveEvent(o))return void this.reset(o);const m=h.length?h[0]:h;return!this._moved&&m.dist(p){y.mousedown=y.dragStart,y.mousemoveWindow=y.dragMove,y.mouseup=y.dragEnd,y.contextmenu=function(o){o.preventDefault()}},$s=({enable:y,clickTolerance:o,bearingDegreesPerPixelMoved:h=.8})=>{const p=new vo({checkCorrectEvent:m=>C.mouseButton(m)===0&&m.ctrlKey||C.mouseButton(m)===2});return new Hs({clickTolerance:o,move:(m,v)=>({bearingDelta:(v.x-m.x)*h}),moveStateManager:p,enable:y,assignEvents:zl})},Xs=({enable:y,clickTolerance:o,pitchDegreesPerPixelMoved:h=-.5})=>{const p=new vo({checkCorrectEvent:m=>C.mouseButton(m)===0&&m.ctrlKey||C.mouseButton(m)===2});return new Hs({clickTolerance:o,move:(m,v)=>({pitchDelta:(v.y-m.y)*h}),moveStateManager:p,enable:y,assignEvents:zl})};class tf{constructor(o,h){this._clickTolerance=o.clickTolerance||1,this._map=h,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new a.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(o,h,p){return this._calculateTransform(o,h,p)}touchmove(o,h,p){if(this._active&&!(p.length0&&(this._active=!0);const m=ys(p,h),v=new a.P(0,0),E=new a.P(0,0);let M=0;for(const R in m){const V=m[R],q=this._touches[R];q&&(v._add(V),E._add(V.sub(q)),M++,m[R]=V)}if(this._touches=m,MMath.abs(y.x)}class of extends xt{constructor(o){super(),this._currentTouchCount=0,this._map=o}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(o,h,p){super.touchstart(o,h,p),this._currentTouchCount=p.length}_start(o){this._lastPoints=o,Rl(o[0].sub(o[1]))&&(this._valid=!1)}_move(o,h,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const m=o[0].sub(this._lastPoints[0]),v=o[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,v,p.timeStamp),this._valid?(this._lastPoints=o,this._active=!0,{pitchDelta:(m.y+v.y)/2*-.5}):void 0}gestureBeginsVertically(o,h,p){if(this._valid!==void 0)return this._valid;const m=o.mag()>=2,v=h.mag()>=2;if(!m&&!v)return;if(!m||!v)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const E=o.y>0==h.y>0;return Rl(o)&&Rl(h)&&E}}const cp={panStep:100,bearingStep:15,pitchStep:10};class es{constructor(o){this._tr=new Zs(o);const h=cp;this._panStep=h.panStep,this._bearingStep=h.bearingStep,this._pitchStep=h.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(o){if(o.altKey||o.ctrlKey||o.metaKey)return;let h=0,p=0,m=0,v=0,E=0;switch(o.keyCode){case 61:case 107:case 171:case 187:h=1;break;case 189:case 109:case 173:h=-1;break;case 37:o.shiftKey?p=-1:(o.preventDefault(),v=-1);break;case 39:o.shiftKey?p=1:(o.preventDefault(),v=1);break;case 38:o.shiftKey?m=1:(o.preventDefault(),E=-1);break;case 40:o.shiftKey?m=-1:(o.preventDefault(),E=1);break;default:return}return this._rotationDisabled&&(p=0,m=0),{cameraAnimation:M=>{const A=this._tr;M.easeTo({duration:300,easeId:"keyboardHandler",easing:Qr,zoom:h?Math.round(A.zoom)+h*(o.shiftKey?2:1):A.zoom,bearing:A.bearing+p*this._bearingStep,pitch:A.pitch+m*this._pitchStep,offset:[-v*this._panStep,-E*this._panStep],center:A.center},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Qr(y){return y*(2-y)}const Oa=4.000244140625;class Bl{constructor(o,h){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=o,this._tr=new Zs(o),this._triggerRenderFrame=h,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(o){this._defaultZoomRate=o}setWheelZoomRate(o){this._wheelZoomRate=o}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(o){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!o&&o.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(o){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!o[this._map.cooperativeGestures._bypassKey])return;let h=o.deltaMode===WheelEvent.DOM_DELTA_LINE?40*o.deltaY:o.deltaY;const p=k.now(),m=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,h!==0&&h%Oa==0?this._type="wheel":h!==0&&Math.abs(h)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=h,this._timeout=setTimeout(this._onTimeout,40,o)):this._type||(this._type=Math.abs(m*h)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,h+=this._lastValue)),o.shiftKey&&h&&(h/=4),this._type&&(this._lastWheelEvent=o,this._delta-=h,this._active||this._start(o)),o.preventDefault()}_start(o){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const h=C.mousePos(this._map.getCanvas(),o),p=this._tr;this._around=h.y>p.transform.height/2-p.transform.getHorizon()?a.M.convert(this._aroundCenter?p.center:p.unproject(h)):a.M.convert(p.center),this._aroundPoint=p.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const o=this._tr.transform;if(this._delta!==0){const M=this._type==="wheel"&&Math.abs(this._delta)>Oa?this._wheelZoomRate:this._defaultZoomRate;let A=2/(1+Math.exp(-Math.abs(this._delta*M)));this._delta<0&&A!==0&&(A=1/A);const R=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(R*A))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const h=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,p=this._startZoom,m=this._easing;let v,E=!1;if(this._type==="wheel"&&p&&m){const M=Math.min((k.now()-this._lastWheelEventTime)/200,1),A=m(M);v=a.z.number(p,h,A),M<1?this._frameId||(this._frameId=!0):E=!0}else v=h,E=!0;return this._active=!0,E&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!E,zoomDelta:v-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(o){let h=a.b7;if(this._prevEase){const p=this._prevEase,m=(k.now()-p.start)/p.duration,v=p.easing(m+.01)-p.easing(m),E=.27/Math.sqrt(v*v+1e-4)*.01,M=Math.sqrt(.0729-E*E);h=a.b6(E,M,.25,1)}return this._prevEase={start:k.now(),duration:o,easing:h},h}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class ou{constructor(o,h){this._clickZoom=o,this._tapZoom=h}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 sf{constructor(o){this._tr=new Zs(o),this.reset()}reset(){this._active=!1}dblclick(o,h){return o.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(o.shiftKey?-1:1),around:this._tr.unproject(h)},{originalEvent:o})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class af{constructor(){this._tap=new nu({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(o,h,p){if(!this._swipePoint)if(this._tapTime){const m=h[0],v=o.timeStamp-this._tapTime<500,E=this._tapPoint.dist(m)<30;v&&E?p.length>0&&(this._swipePoint=m,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(o,h,p)}touchmove(o,h,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const m=h[0],v=m.y-this._swipePoint.y;return this._swipePoint=m,o.preventDefault(),this._active=!0,{zoomDelta:v/128}}}else this._tap.touchmove(o,h,p)}touchend(o,h,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const m=this._tap.touchend(o,h,p);m&&(this._tapTime=o.timeStamp,this._tapPoint=m)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class lf{constructor(o,h,p){this._el=o,this._mousePan=h,this._touchPan=p}enable(o){this._inertiaOptions=o||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class oo{constructor(o,h,p){this._pitchWithRotate=o.pitchWithRotate,this._mouseRotate=h,this._mousePitch=p}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 Na{constructor(o,h,p,m){this._el=o,this._touchZoom=h,this._touchRotate=p,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0}enable(o){this._touchZoom.enable(o),this._rotationDisabled||this._touchRotate.enable(o),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Bt{constructor(o,h){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=o,this._options=h,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const o=this._map.getCanvasContainer();o.classList.add("maplibregl-cooperative-gestures"),this._container=C.create("div","maplibregl-cooperative-gesture-screen",o);let h=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(h=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),m=document.createElement("div");m.className="maplibregl-desktop-message",m.textContent=h,this._container.appendChild(m);const v=document.createElement("div");v.className="maplibregl-mobile-message",v.textContent=p,this._container.appendChild(v),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(C.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(o){this._onCooperativeGesture(o.touches.length===1)}wheel(o){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!o[this._bypassKey])}_onCooperativeGesture(o){this._enabled&&o&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Gt=y=>y.zoom||y.drag||y.pitch||y.rotate;class Fl extends a.k{}function ja(y){return y.panDelta&&y.panDelta.mag()||y.zoomDelta||y.bearingDelta||y.pitchDelta}class su{constructor(o,h){this.handleWindowEvent=m=>{this.handleEvent(m,`${m.type}Window`)},this.handleEvent=(m,v)=>{if(m.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const E=m.type==="renderFrame"?void 0:m,M={needsRenderFrame:!1},A={},R={},V=m.touches,q=V?this._getMapTouches(V):void 0,Q=q?C.touchPos(this._map.getCanvas(),q):C.mousePos(this._map.getCanvas(),m);for(const{handlerName:ye,handler:se,allowed:Te}of this._handlers){if(!se.isEnabled())continue;let Ue;this._blockedByActive(R,Te,ye)?se.reset():se[v||m.type]&&(Ue=se[v||m.type](m,Q,q),this.mergeHandlerResult(M,A,Ue,ye,E),Ue&&Ue.needsRenderFrame&&this._triggerRenderFrame()),(Ue||se.isActive())&&(R[ye]=se)}const he={};for(const ye in this._previousActiveHandlers)R[ye]||(he[ye]=E);this._previousActiveHandlers=R,(Object.keys(he).length||ja(M))&&(this._changes.push([M,A,he]),this._triggerRenderFrame()),(Object.keys(R).length||ja(M))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ue}=M;ue&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ue(this._map))},this._map=o,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ef(o),this._bearingSnap=h.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(h);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[m,v,E]of this._listeners)C.addEventListener(m,v,m===document?this.handleWindowEvent:this.handleEvent,E)}destroy(){for(const[o,h,p]of this._listeners)C.removeEventListener(o,h,o===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(o){const h=this._map,p=h.getCanvasContainer();this._add("mapEvent",new no(h,o));const m=h.boxZoom=new io(h,o);this._add("boxZoom",m),o.interactive&&o.boxZoom&&m.enable();const v=h.cooperativeGestures=new Bt(h,o.cooperativeGestures);this._add("cooperativeGestures",v),o.cooperativeGestures&&v.enable();const E=new lp(h),M=new sf(h);h.doubleClickZoom=new ou(M,E),this._add("tapZoom",E),this._add("clickZoom",M),o.interactive&&o.doubleClickZoom&&h.doubleClickZoom.enable();const A=new af;this._add("tapDragZoom",A);const R=h.touchPitch=new of(h);this._add("touchPitch",R),o.interactive&&o.touchPitch&&h.touchPitch.enable(o.touchPitch);const V=$s(o),q=Xs(o);h.dragRotate=new oo(o,V,q),this._add("mouseRotate",V,["mousePitch"]),this._add("mousePitch",q,["mouseRotate"]),o.interactive&&o.dragRotate&&h.dragRotate.enable();const Q=(({enable:Ue,clickTolerance:we})=>{const Le=new vo({checkCorrectEvent:Ge=>C.mouseButton(Ge)===0&&!Ge.ctrlKey});return new Hs({clickTolerance:we,move:(Ge,He)=>({around:He,panDelta:He.sub(Ge)}),activateOnStart:!0,moveStateManager:Le,enable:Ue,assignEvents:zl})})(o),he=new tf(o,h);h.dragPan=new lf(p,Q,he),this._add("mousePan",Q),this._add("touchPan",he,["touchZoom","touchRotate"]),o.interactive&&o.dragPan&&h.dragPan.enable(o.dragPan);const ue=new iu,ye=new nf;h.touchZoomRotate=new Na(p,ye,ue,A),this._add("touchRotate",ue,["touchPan","touchZoom"]),this._add("touchZoom",ye,["touchPan","touchRotate"]),o.interactive&&o.touchZoomRotate&&h.touchZoomRotate.enable(o.touchZoomRotate);const se=h.scrollZoom=new Bl(h,()=>this._triggerRenderFrame());this._add("scrollZoom",se,["mousePan"]),o.interactive&&o.scrollZoom&&h.scrollZoom.enable(o.scrollZoom);const Te=h.keyboard=new es(h);this._add("keyboard",Te),o.interactive&&o.keyboard&&h.keyboard.enable(),this._add("blockableMapEvent",new yo(h))}_add(o,h,p){this._handlers.push({handlerName:o,handler:h,allowed:p}),this._handlersById[o]=h}stop(o){if(!this._updatingCamera){for(const{handler:h}of this._handlers)h.reset();this._inertia.clear(),this._fireEvents({},{},o),this._changes=[]}}isActive(){for(const{handler:o}of this._handlers)if(o.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Gt(this._eventsInProgress)||this.isZooming()}_blockedByActive(o,h,p){for(const m in o)if(m!==p&&(!h||h.indexOf(m)<0))return!0;return!1}_getMapTouches(o){const h=[];for(const p of o)this._el.contains(p.target)&&h.push(p);return h}mergeHandlerResult(o,h,p,m,v){if(!p)return;a.e(o,p);const E={handlerName:m,originalEvent:p.originalEvent||v};p.zoomDelta!==void 0&&(h.zoom=E),p.panDelta!==void 0&&(h.drag=E),p.pitchDelta!==void 0&&(h.pitch=E),p.bearingDelta!==void 0&&(h.rotate=E)}_applyChanges(){const o={},h={},p={};for(const[m,v,E]of this._changes)m.panDelta&&(o.panDelta=(o.panDelta||new a.P(0,0))._add(m.panDelta)),m.zoomDelta&&(o.zoomDelta=(o.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(o.bearingDelta=(o.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(o.pitchDelta=(o.pitchDelta||0)+m.pitchDelta),m.around!==void 0&&(o.around=m.around),m.pinchAround!==void 0&&(o.pinchAround=m.pinchAround),m.noInertia&&(o.noInertia=m.noInertia),a.e(h,v),a.e(p,E);this._updateMapTransform(o,h,p),this._changes=[]}_updateMapTransform(o,h,p){const m=this._map,v=m._getTransformForUpdate(),E=m.terrain;if(!(ja(o)||E&&this._terrainMovement))return this._fireEvents(h,p,!0);let{panDelta:M,zoomDelta:A,bearingDelta:R,pitchDelta:V,around:q,pinchAround:Q}=o;Q!==void 0&&(q=Q),m._stop(!0),q=q||m.transform.centerPoint;const he=v.pointLocation(M?q.sub(M):q);R&&(v.bearing+=R),V&&(v.pitch+=V),A&&(v.zoom+=A),E?this._terrainMovement||!h.drag&&!h.zoom?h.drag&&this._terrainMovement?v.center=v.pointLocation(v.centerPoint.sub(M)):v.setLocationAtPoint(he,q):(this._terrainMovement=!0,this._map._elevationFreeze=!0,v.setLocationAtPoint(he,q),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,v.recalculateZoom(m.terrain)})):v.setLocationAtPoint(he,q),m._applyUpdatedTransform(v),this._map._update(),o.noInertia||this._inertia.record(o),this._fireEvents(h,p,!0)}_fireEvents(o,h,p){const m=Gt(this._eventsInProgress),v=Gt(o),E={};for(const V in o){const{originalEvent:q}=o[V];this._eventsInProgress[V]||(E[`${V}start`]=q),this._eventsInProgress[V]=o[V]}!m&&v&&this._fireEvent("movestart",v.originalEvent);for(const V in E)this._fireEvent(V,E[V]);v&&this._fireEvent("move",v.originalEvent);for(const V in o){const{originalEvent:q}=o[V];this._fireEvent(V,q)}const M={};let A;for(const V in this._eventsInProgress){const{handlerName:q,originalEvent:Q}=this._eventsInProgress[V];this._handlersById[q].isActive()||(delete this._eventsInProgress[V],A=h[q]||Q,M[`${V}end`]=A)}for(const V in M)this._fireEvent(V,M[V]);const R=Gt(this._eventsInProgress);if(p&&(m||v)&&!R){this._updatingCamera=!0;const V=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),q=Q=>Q!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Fl("renderFrame",{timeStamp:o})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Si extends a.E{constructor(o,h){super(),this._renderFrameCallback=()=>{const p=Math.min((k.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(p)),p<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=o,this._bearingSnap=h.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new a.M(this.transform.center.lng,this.transform.center.lat)}setCenter(o,h){return this.jumpTo({center:o},h)}panBy(o,h,p){return o=a.P.convert(o).mult(-1),this.panTo(this.transform.center,a.e({offset:o},h),p)}panTo(o,h,p){return this.easeTo(a.e({center:o},h),p)}getZoom(){return this.transform.zoom}setZoom(o,h){return this.jumpTo({zoom:o},h),this}zoomTo(o,h,p){return this.easeTo(a.e({zoom:o},h),p)}zoomIn(o,h){return this.zoomTo(this.getZoom()+1,o,h),this}zoomOut(o,h){return this.zoomTo(this.getZoom()-1,o,h),this}getBearing(){return this.transform.bearing}setBearing(o,h){return this.jumpTo({bearing:o},h),this}getPadding(){return this.transform.padding}setPadding(o,h){return this.jumpTo({padding:o},h),this}rotateTo(o,h,p){return this.easeTo(a.e({bearing:o},h),p)}resetNorth(o,h){return this.rotateTo(0,a.e({duration:1e3},o),h),this}resetNorthPitch(o,h){return this.easeTo(a.e({bearing:0,pitch:0,duration:1e3},o),h),this}snapToNorth(o,h){return Math.abs(this.getBearing()){if(this._zooming&&(m.zoom=a.z.number(v,se,$e)),this._rotating&&(m.bearing=a.z.number(E,R,$e)),this._pitching&&(m.pitch=a.z.number(M,V,$e)),this._padding&&(m.interpolatePadding(A,q,$e),he=m.centerPoint.add(Q)),this.terrain&&!o.freezeElevation&&this._updateElevation($e),Le)m.setLocationAtPoint(Le,Ge);else{const nt=m.zoomScale(m.zoom-v),et=se>v?Math.min(2,we):Math.max(.5,we),ft=Math.pow(et,1-$e),gt=m.unproject(Te.add(Ue.mult($e*ft)).mult(nt));m.setLocationAtPoint(m.renderWorldCopies?gt.wrap():gt,he)}this._applyUpdatedTransform(m),this._fireMoveEvents(h)},$e=>{this.terrain&&this._finalizeElevation(),this._afterEase(h,$e)},o),this}_prepareEase(o,h,p={}){this._moving=!0,h||p.moving||this.fire(new a.k("movestart",o)),this._zooming&&!p.zooming&&this.fire(new a.k("zoomstart",o)),this._rotating&&!p.rotating&&this.fire(new a.k("rotatestart",o)),this._pitching&&!p.pitching&&this.fire(new a.k("pitchstart",o))}_prepareElevation(o){this._elevationCenter=o,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(o,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(o){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const h=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(o<1&&h!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=o*(p-(h-(p*o+this._elevationStart))/(1-o)),this._elevationTarget=h}this.transform.elevation=a.z.number(this._elevationStart,this._elevationTarget,o)}_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(o){if(!this.transformCameraUpdate)return;const h=o.clone(),{center:p,zoom:m,pitch:v,bearing:E,elevation:M}=this.transformCameraUpdate(h);p&&(h.center=p),m!==void 0&&(h.zoom=m),v!==void 0&&(h.pitch=v),E!==void 0&&(h.bearing=E),M!==void 0&&(h.elevation=M),this.transform.apply(h)}_fireMoveEvents(o){this.fire(new a.k("move",o)),this._zooming&&this.fire(new a.k("zoom",o)),this._rotating&&this.fire(new a.k("rotate",o)),this._pitching&&this.fire(new a.k("pitch",o))}_afterEase(o,h){if(this._easeId&&h&&this._easeId===h)return;delete this._easeId;const p=this._zooming,m=this._rotating,v=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new a.k("zoomend",o)),m&&this.fire(new a.k("rotateend",o)),v&&this.fire(new a.k("pitchend",o)),this.fire(new a.k("moveend",o))}flyTo(o,h){var p;if(!o.essential&&k.prefersReducedMotion){const Sr=a.L(o,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Sr,h)}this.stop(),o=a.e({offset:[0,0],speed:1.2,curve:1.42,easing:a.b7},o);const m=this._getTransformForUpdate(),v=this.getZoom(),E=this.getBearing(),M=this.getPitch(),A=this.getPadding(),R="bearing"in o?this._normalizeBearing(o.bearing,E):E,V="pitch"in o?+o.pitch:M,q="padding"in o?o.padding:m.padding,Q=a.P.convert(o.offset);let he=m.centerPoint.add(Q);const ue=m.pointLocation(he),{center:ye,zoom:se}=m.getConstrained(a.M.convert(o.center||ue),(p=o.zoom)!==null&&p!==void 0?p:v);this._normalizeCenter(ye);const Te=m.zoomScale(se-v),Ue=m.project(ue),we=m.project(ye).sub(Ue);let Le=o.curve;const Ge=Math.max(m.width,m.height),He=Ge/Te,$e=we.mag();if("minZoom"in o){const Sr=a.ac(Math.min(o.minZoom,v,se),m.minZoom,m.maxZoom),Yt=Ge/m.zoomScale(Sr-v);Le=Math.sqrt(Yt/$e*2)}const nt=Le*Le;function et(Sr){const Yt=(He*He-Ge*Ge+(Sr?-1:1)*nt*nt*$e*$e)/(2*(Sr?He:Ge)*nt*$e);return Math.log(Math.sqrt(Yt*Yt+1)-Yt)}function ft(Sr){return(Math.exp(Sr)-Math.exp(-Sr))/2}function gt(Sr){return(Math.exp(Sr)+Math.exp(-Sr))/2}const ir=et(!1);let _t=function(Sr){return gt(ir)/gt(ir+Le*Sr)},Xt=function(Sr){return Ge*((gt(ir)*(ft(Yt=ir+Le*Sr)/gt(Yt))-ft(ir))/nt)/$e;var Yt},or=(et(!0)-ir)/Le;if(Math.abs($e)<1e-6||!isFinite(or)){if(Math.abs(Ge-He)<1e-6)return this.easeTo(o,h);const Sr=Heo.maxDuration&&(o.duration=0),this._zooming=!0,this._rotating=E!==R,this._pitching=V!==M,this._padding=!m.isPaddingEqual(q),this._prepareEase(h,!1),this.terrain&&this._prepareElevation(ye),this._ease(Sr=>{const Yt=Sr*or,cr=1/_t(Yt);m.zoom=Sr===1?se:v+m.scaleZoom(cr),this._rotating&&(m.bearing=a.z.number(E,R,Sr)),this._pitching&&(m.pitch=a.z.number(M,V,Sr)),this._padding&&(m.interpolatePadding(A,q,Sr),he=m.centerPoint.add(Q)),this.terrain&&!o.freezeElevation&&this._updateElevation(Sr);const dr=Sr===1?ye:m.unproject(Ue.add(we.mult(Xt(Yt))).mult(cr));m.setLocationAtPoint(m.renderWorldCopies?dr.wrap():dr,he),this._applyUpdatedTransform(m),this._fireMoveEvents(h)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(h)},o),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(o,h){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,h)}if(!o){const p=this.handlers;p&&p.stop(!1)}return this}_ease(o,h,p){p.animate===!1||p.duration===0?(o(1),h()):(this._easeStart=k.now(),this._easeOptions=p,this._onEaseFrame=o,this._onEaseEnd=h,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(o,h){o=a.b1(o,-180,180);const p=Math.abs(o-h);return Math.abs(o-360-h)180?-360:p<-180?360:0}queryTerrainElevation(o){return this.terrain?this.terrain.getElevationForLngLatZoom(a.M.convert(o),this.transform.tileZoom)-this.transform.elevation:null}}const au={compact:!0,customAttribution:'MapLibre'};class so{constructor(o=au){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=h=>{!h||h.sourceDataType!=="metadata"&&h.sourceDataType!=="visibility"&&h.dataType!=="style"&&h.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=o}getDefaultPosition(){return"bottom-right"}onAdd(o){return this._map=o,this._compact=this.options.compact,this._container=C.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=C.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=C.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(){C.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(o,h){const p=this._map._getUIString(`AttributionControl.${h}`);o.title=p,o.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let o=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?o=o.concat(this.options.customAttribution.map(m=>typeof m!="string"?"":m)):typeof this.options.customAttribution=="string"&&o.push(this.options.customAttribution)),this._map.style.stylesheet){const m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}const h=this._map.style.sourceCaches;for(const m in h){const v=h[m];if(v.used||v.usedForTerrain){const E=v.getSource();E.attribution&&o.indexOf(E.attribution)<0&&o.push(E.attribution)}}o=o.filter(m=>String(m).trim()),o.sort((m,v)=>m.length-v.length),o=o.filter((m,v)=>{for(let E=v+1;E=0)return!1;return!0});const p=o.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,o.length?(this._innerContainer.innerHTML=p,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class cf{constructor(o={}){this._updateCompact=()=>{const h=this._container.children;if(h.length){const p=h[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=o}getDefaultPosition(){return"bottom-left"}onAdd(o){this._map=o,this._compact=this.options&&this.options.compact,this._container=C.create("div","maplibregl-ctrl");const h=C.create("a","maplibregl-ctrl-logo");return h.target="_blank",h.rel="noopener nofollow",h.href="https://maplibre.org/",h.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),h.setAttribute("rel","noopener nofollow"),this._container.appendChild(h),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){C.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ua{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(o){const h=++this._id;return this._queue.push({callback:o,id:h,cancelled:!1}),h}remove(o){const h=this._currentlyRunning,p=h?this._queue.concat(h):this._queue;for(const m of p)if(m.id===o)return void(m.cancelled=!0)}run(o=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const h=this._currentlyRunning=this._queue;this._queue=[];for(const p of h)if(!p.cancelled&&(p.callback(o),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var un=a.X([{name:"a_pos3d",type:"Int16",components:3}]);class kn extends a.E{constructor(o){super(),this.sourceCache=o,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,o.usedForTerrain=!0,o.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(o,h){this.sourceCache.update(o,h),this._renderableTilesKeys=[];const p={};for(const m of o.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:h}))p[m.key]=!0,this._renderableTilesKeys.push(m.key),this._tiles[m.key]||(m.posMatrix=new Float64Array(16),a.aN(m.posMatrix,0,a.W,0,a.W,0,1),this._tiles[m.key]=new Xn(m,this.tileSize));for(const m in this._tiles)p[m]||delete this._tiles[m]}freeRtt(o){for(const h in this._tiles){const p=this._tiles[h];(!o||p.tileID.equals(o)||p.tileID.isChildOf(o)||o.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(o=>this.getTileByID(o))}getTileByID(o){return this._tiles[o]}getTerrainCoords(o){const h={};for(const p of this._renderableTilesKeys){const m=this._tiles[p].tileID;if(m.canonical.equals(o.canonical)){const v=o.clone();v.posMatrix=new Float64Array(16),a.aN(v.posMatrix,0,a.W,0,a.W,0,1),h[p]=v}else if(m.canonical.isChildOf(o.canonical)){const v=o.clone();v.posMatrix=new Float64Array(16);const E=m.canonical.z-o.canonical.z,M=m.canonical.x-(m.canonical.x>>E<>E<>E;a.aN(v.posMatrix,0,R,0,R,0,1),a.H(v.posMatrix,v.posMatrix,[-M*R,-A*R,0]),h[p]=v}else if(o.canonical.isChildOf(m.canonical)){const v=o.clone();v.posMatrix=new Float64Array(16);const E=o.canonical.z-m.canonical.z,M=o.canonical.x-(o.canonical.x>>E<>E<>E;a.aN(v.posMatrix,0,a.W,0,a.W,0,1),a.H(v.posMatrix,v.posMatrix,[M*R,A*R,0]),a.J(v.posMatrix,v.posMatrix,[1/2**E,1/2**E,0]),h[p]=v}}return h}getSourceTile(o,h){const p=this.sourceCache._source;let m=o.overscaledZ-this.deltaZoom;if(m>p.maxzoom&&(m=p.maxzoom),m=p.minzoom&&(!v||!v.dem);)v=this.sourceCache.getTileByID(o.scaledTo(m--).key);return v}tilesAfterTime(o=Date.now()){return Object.values(this._tiles).filter(h=>h.timeAdded>=o)}}class uf{constructor(o,h,p){this.painter=o,this.sourceCache=new kn(h),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(o,h,p,m=a.W){var v;if(!(h>=0&&h=0&&po.canonical.z&&(o.canonical.z>=m?v=o.canonical.z-m:a.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const E=o.canonical.x-(o.canonical.x>>v<>v<>8<<4|v>>8,h[E+3]=0;const p=new a.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(h.buffer)),m=new re(o,p,o.gl.RGBA,{premultiply:!1});return m.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(o){this.painter.maybeDrawDepthAndCoords(!0);const h=new Uint8Array(4),p=this.painter.context,m=p.gl,v=Math.round(o.x*this.painter.pixelRatio/devicePixelRatio),E=Math.round(o.y*this.painter.pixelRatio/devicePixelRatio),M=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),m.readPixels(v,M-E-1,1,1,m.RGBA,m.UNSIGNED_BYTE,h),p.bindFramebuffer.set(null);const A=h[0]+(h[2]>>4<<8),R=h[1]+((15&h[2])<<8),V=this.coordsIndex[255-h[3]],q=V&&this.sourceCache.getTileByID(V);if(!q)return null;const Q=this._coordsTextureSize,he=(1<o.id!==h),this._recentlyUsed.push(o.id)}stampObject(o){o.stamp=++this._stamp}getOrCreateFreeObject(){for(const h of this._recentlyUsed)if(!this._objects[h].inUse)return this._objects[h];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const o=this._createObject(this._objects.length);return this._objects.push(o),o}freeObject(o){o.inUse=!1}freeAllObjects(){for(const o of this._objects)this.freeObject(o)}isFull(){return!(this._objects.length!o.inUse)===!1}}const Fo={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class lu{constructor(o,h){this.painter=o,this.terrain=h,this.pool=new Va(o.context,30,h.sourceCache.tileSize*h.qualityFactor)}destruct(){this.pool.destruct()}getTexture(o){return this.pool.getObjectForId(o.rtt[this._stacks.length-1].id).texture}prepareForRender(o,h){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=o._order.filter(p=>!o._layers[p].isHidden(h)),this._coordsDescendingInv={};for(const p in o.sourceCaches){this._coordsDescendingInv[p]={};const m=o.sourceCaches[p].getVisibleCoordinates();for(const v of m){const E=this.terrain.sourceCache.getTerrainCoords(v);for(const M in E)this._coordsDescendingInv[p][M]||(this._coordsDescendingInv[p][M]=[]),this._coordsDescendingInv[p][M].push(E[M])}}this._coordsDescendingInvStr={};for(const p of o._order){const m=o._layers[p],v=m.source;if(Fo[m.type]&&!this._coordsDescendingInvStr[v]){this._coordsDescendingInvStr[v]={};for(const E in this._coordsDescendingInv[v])this._coordsDescendingInvStr[v][E]=this._coordsDescendingInv[v][E].map(M=>M.key).sort().join()}}for(const p of this._renderableTiles)for(const m in this._coordsDescendingInvStr){const v=this._coordsDescendingInvStr[m][p.tileID.key];v&&v!==p.rttCoords[m]&&(p.rtt=[])}}renderLayer(o){if(o.isHidden(this.painter.transform.zoom))return!1;const h=o.type,p=this.painter,m=this._renderableLayerIds[this._renderableLayerIds.length-1]===o.id;if(Fo[h]&&(this._prevType&&Fo[this._prevType]||this._stacks.push([]),this._prevType=h,this._stacks[this._stacks.length-1].push(o.id),!m))return!0;if(Fo[this._prevType]||Fo[h]&&m){this._prevType=h;const v=this._stacks.length-1,E=this._stacks[v]||[];for(const M of this._renderableTiles){if(this.pool.isFull()&&(Ll(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(M),M.rtt[v]){const R=this.pool.getObjectForId(M.rtt[v].id);if(R.stamp===M.rtt[v].stamp){this.pool.useObject(R);continue}}const A=this.pool.getOrCreateFreeObject();this.pool.useObject(A),this.pool.stampObject(A),M.rtt[v]={id:A.id,stamp:A.stamp},p.context.bindFramebuffer.set(A.fbo.framebuffer),p.context.clear({color:a.aO.transparent,stencil:0}),p.currentStencilSource=void 0;for(let R=0;R{y.touchstart=y.dragStart,y.touchmoveWindow=y.dragMove,y.touchend=y.dragEnd},hu={showCompass:!0,showZoom:!0,visualizePitch:!1};class fu{constructor(o,h,p=!1){this.mousedown=E=>{this.startMouse(a.e({},E,{ctrlKey:!0,preventDefault:()=>E.preventDefault()}),C.mousePos(this.element,E)),C.addEventListener(window,"mousemove",this.mousemove),C.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=E=>{this.moveMouse(E,C.mousePos(this.element,E))},this.mouseup=E=>{this.mouseRotate.dragEnd(E),this.mousePitch&&this.mousePitch.dragEnd(E),this.offTemp()},this.touchstart=E=>{E.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=C.touchPos(this.element,E.targetTouches)[0],this.startTouch(E,this._startPos),C.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),C.addEventListener(window,"touchend",this.touchend))},this.touchmove=E=>{E.targetTouches.length!==1?this.reset():(this._lastPos=C.touchPos(this.element,E.targetTouches)[0],this.moveTouch(E,this._lastPos))},this.touchend=E=>{E.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 m=o.dragRotate._mouseRotate.getClickTolerance(),v=o.dragRotate._mousePitch.getClickTolerance();this.element=h,this.mouseRotate=$s({clickTolerance:m,enable:!0}),this.touchRotate=(({enable:E,clickTolerance:M,bearingDegreesPerPixelMoved:A=.8})=>{const R=new Mt;return new Hs({clickTolerance:M,move:(V,q)=>({bearingDelta:(q.x-V.x)*A}),moveStateManager:R,enable:E,assignEvents:Ol})})({clickTolerance:m,enable:!0}),this.map=o,p&&(this.mousePitch=Xs({clickTolerance:v,enable:!0}),this.touchPitch=(({enable:E,clickTolerance:M,pitchDegreesPerPixelMoved:A=-.5})=>{const R=new Mt;return new Hs({clickTolerance:M,move:(V,q)=>({pitchDelta:(q.y-V.y)*A}),moveStateManager:R,enable:E,assignEvents:Ol})})({clickTolerance:v,enable:!0})),C.addEventListener(h,"mousedown",this.mousedown),C.addEventListener(h,"touchstart",this.touchstart,{passive:!1}),C.addEventListener(h,"touchcancel",this.reset)}startMouse(o,h){this.mouseRotate.dragStart(o,h),this.mousePitch&&this.mousePitch.dragStart(o,h),C.disableDrag()}startTouch(o,h){this.touchRotate.dragStart(o,h),this.touchPitch&&this.touchPitch.dragStart(o,h),C.disableDrag()}moveMouse(o,h){const p=this.map,{bearingDelta:m}=this.mouseRotate.dragMove(o,h)||{};if(m&&p.setBearing(p.getBearing()+m),this.mousePitch){const{pitchDelta:v}=this.mousePitch.dragMove(o,h)||{};v&&p.setPitch(p.getPitch()+v)}}moveTouch(o,h){const p=this.map,{bearingDelta:m}=this.touchRotate.dragMove(o,h)||{};if(m&&p.setBearing(p.getBearing()+m),this.touchPitch){const{pitchDelta:v}=this.touchPitch.dragMove(o,h)||{};v&&p.setPitch(p.getPitch()+v)}}off(){const o=this.element;C.removeEventListener(o,"mousedown",this.mousedown),C.removeEventListener(o,"touchstart",this.touchstart,{passive:!1}),C.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),C.removeEventListener(window,"touchend",this.touchend),C.removeEventListener(o,"touchcancel",this.reset),this.offTemp()}offTemp(){C.enableDrag(),C.removeEventListener(window,"mousemove",this.mousemove),C.removeEventListener(window,"mouseup",this.mouseup),C.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),C.removeEventListener(window,"touchend",this.touchend)}}let Oo;function Nl(y,o,h){const p=new a.M(y.lng,y.lat);if(y=new a.M(y.lng,y.lat),o){const m=new a.M(y.lng-360,y.lat),v=new a.M(y.lng+360,y.lat),E=h.locationPoint(y).distSqr(o);h.locationPoint(m).distSqr(o)180;){const m=h.locationPoint(y);if(m.x>=0&&m.y>=0&&m.x<=h.width&&m.y<=h.height)break;y.lng>h.center.lng?y.lng-=360:y.lng+=360}return y.lng!==p.lng&&h.locationPoint(y).y>h.height/2-h.getHorizon()?y:p}const Ga={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 jl(y,o,h){const p=y.classList;for(const m in Ga)p.remove(`maplibregl-${h}-anchor-${m}`);p.add(`maplibregl-${h}-anchor-${o}`)}class Wa extends a.E{constructor(o){if(super(),this._onKeyPress=h=>{const p=h.code,m=h.charCode||h.keyCode;p!=="Space"&&p!=="Enter"&&m!==32&&m!==13||this.togglePopup()},this._onMapClick=h=>{const p=h.originalEvent.target,m=this._element;this._popup&&(p===m||m.contains(p))&&this.togglePopup()},this._update=h=>{var p;if(!this._map)return;const m=this._map.loaded()&&!this._map.isMoving();((h==null?void 0:h.type)==="terrain"||(h==null?void 0:h.type)==="render"&&!m)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Nl(this._lngLat,this._flatPos,this._map.transform):(p=this._lngLat)===null||p===void 0?void 0:p.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let v="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?v=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(v=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let E="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?E="rotateX(0deg)":this._pitchAlignment==="map"&&(E=`rotateX(${this._map.getPitch()}deg)`),h&&h.type!=="moveend"||(this._pos=this._pos.round()),C.setTransform(this._element,`${Ga[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${E} ${v}`),k.frameAsync(new AbortController).then(()=>{this._updateOpacity(h&&h.type==="moveend")}).catch(()=>{})},this._onMove=h=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=h.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=h.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 a.k("dragstart"))),this.fire(new a.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 a.k("dragend")),this._state="inactive"},this._addDragHandler=h=>{this._element.contains(h.originalEvent.target)&&(h.preventDefault(),this._positionDelta=h.point.sub(this._pos).add(this._offset),this._pointerdownPos=h.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=o&&o.anchor||"center",this._color=o&&o.color||"#3FB1CE",this._scale=o&&o.scale||1,this._draggable=o&&o.draggable||!1,this._clickTolerance=o&&o.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=o&&o.rotation||0,this._rotationAlignment=o&&o.rotationAlignment||"auto",this._pitchAlignment=o&&o.pitchAlignment&&o.pitchAlignment!=="auto"?o.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(o==null?void 0:o.opacity,o==null?void 0:o.opacityWhenCovered),o&&o.element)this._element=o.element,this._offset=a.P.convert(o&&o.offset||[0,0]);else{this._defaultMarker=!0,this._element=C.create("div"),this._element.setAttribute("aria-label","Map marker");const h=C.createNS("http://www.w3.org/2000/svg","svg"),p=41,m=27;h.setAttributeNS(null,"display","block"),h.setAttributeNS(null,"height",`${p}px`),h.setAttributeNS(null,"width",`${m}px`),h.setAttributeNS(null,"viewBox",`0 0 ${m} ${p}`);const v=C.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"stroke","none"),v.setAttributeNS(null,"stroke-width","1"),v.setAttributeNS(null,"fill","none"),v.setAttributeNS(null,"fill-rule","evenodd");const E=C.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill-rule","nonzero");const M=C.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"transform","translate(3.0, 29.0)"),M.setAttributeNS(null,"fill","#000000");const A=[{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 Te of A){const Ue=C.createNS("http://www.w3.org/2000/svg","ellipse");Ue.setAttributeNS(null,"opacity","0.04"),Ue.setAttributeNS(null,"cx","10.5"),Ue.setAttributeNS(null,"cy","5.80029008"),Ue.setAttributeNS(null,"rx",Te.rx),Ue.setAttributeNS(null,"ry",Te.ry),M.appendChild(Ue)}const R=C.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill",this._color);const V=C.createNS("http://www.w3.org/2000/svg","path");V.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"),R.appendChild(V);const q=C.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"fill","#000000");const Q=C.createNS("http://www.w3.org/2000/svg","path");Q.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"),q.appendChild(Q);const he=C.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(6.0, 7.0)"),he.setAttributeNS(null,"fill","#FFFFFF");const ue=C.createNS("http://www.w3.org/2000/svg","g");ue.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ye=C.createNS("http://www.w3.org/2000/svg","circle");ye.setAttributeNS(null,"fill","#000000"),ye.setAttributeNS(null,"opacity","0.25"),ye.setAttributeNS(null,"cx","5.5"),ye.setAttributeNS(null,"cy","5.5"),ye.setAttributeNS(null,"r","5.4999962");const se=C.createNS("http://www.w3.org/2000/svg","circle");se.setAttributeNS(null,"fill","#FFFFFF"),se.setAttributeNS(null,"cx","5.5"),se.setAttributeNS(null,"cy","5.5"),se.setAttributeNS(null,"r","5.4999962"),ue.appendChild(ye),ue.appendChild(se),E.appendChild(M),E.appendChild(R),E.appendChild(q),E.appendChild(he),E.appendChild(ue),h.appendChild(E),h.setAttributeNS(null,"height",p*this._scale+"px"),h.setAttributeNS(null,"width",m*this._scale+"px"),this._element.appendChild(h),this._offset=a.P.convert(o&&o.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",h=>{h.preventDefault()}),this._element.addEventListener("mousedown",h=>{h.preventDefault()}),jl(this._element,this._anchor,"marker"),o&&o.className)for(const h of o.className.split(" "))this._element.classList.add(h);this._popup=null}addTo(o){return this.remove(),this._map=o,o.getCanvasContainer().appendChild(this._element),o.on("move",this._update),o.on("moveend",this._update),o.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("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),C.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(o){return this._lngLat=a.M.convert(o),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(o){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),o){if(!("offset"in o.options)){const m=Math.abs(13.5)/Math.SQRT2;o.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=o,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const o=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:o?(o.isOpen()?o.remove():(o.setLngLat(this._lngLat),o.addTo(this._map)),this):this}_updateOpacity(o=!1){var h,p;if(!(!((h=this._map)===null||h===void 0)&&h.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(o)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const m=this._map,v=m.terrain.depthAtPoint(this._pos),E=m.terrain.getElevationForLngLatZoom(this._lngLat,m.transform.tileZoom);if(m.transform.lngLatToCameraDepth(this._lngLat,E)-v<.006)return void(this._element.style.opacity=this._opacity);const M=-this._offset.y/m.transform._pixelPerMeter,A=Math.sin(m.getPitch()*Math.PI/180)*M,R=m.terrain.depthAtPoint(new a.P(this._pos.x,this._pos.y-this._offset.y)),V=m.transform.lngLatToCameraDepth(this._lngLat,E+A)-R>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&V&&this._popup.remove(),this._element.style.opacity=V?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(o){return this._offset=a.P.convert(o),this._update(),this}addClassName(o){this._element.classList.add(o)}removeClassName(o){this._element.classList.remove(o)}toggleClassName(o){return this._element.classList.toggle(o)}setDraggable(o){return this._draggable=!!o,this._map&&(o?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(o){return this._rotation=o||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(o){return this._rotationAlignment=o||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(o){return this._pitchAlignment=o&&o!=="auto"?o:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(o,h){return o===void 0&&h===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),o!==void 0&&(this._opacity=o),h!==void 0&&(this._opacityWhenCovered=h),this._map&&this._updateOpacity(!0),this}}const Ul={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Js=0,vs=!1;const Vl={maxWidth:100,unit:"metric"};function ql(y,o,h){const p=h&&h.maxWidth||100,m=y._container.clientHeight/2,v=y.unproject([0,m]),E=y.unproject([p,m]),M=v.distanceTo(E);if(h&&h.unit==="imperial"){const A=3.2808*M;A>5280?bs(o,p,A/5280,y._getUIString("ScaleControl.Miles")):bs(o,p,A,y._getUIString("ScaleControl.Feet"))}else h&&h.unit==="nautical"?bs(o,p,M/1852,y._getUIString("ScaleControl.NauticalMiles")):M>=1e3?bs(o,p,M/1e3,y._getUIString("ScaleControl.Kilometers")):bs(o,p,M,y._getUIString("ScaleControl.Meters"))}function bs(y,o,h,p){const m=function(v){const E=Math.pow(10,`${Math.floor(v)}`.length-1);let M=v/E;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:M>=1?1:function(A){const R=Math.pow(10,Math.ceil(-Math.log(A)/Math.LN10));return Math.round(A*R)/R}(M),E*M}(h);y.style.width=o*(m/h)+"px",y.innerHTML=`${m} ${p}`}const du={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},pu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Gl(y){if(y){if(typeof y=="number"){const o=Math.round(Math.abs(y)/Math.SQRT2);return{center:new a.P(0,0),top:new a.P(0,y),"top-left":new a.P(o,o),"top-right":new a.P(-o,o),bottom:new a.P(0,-y),"bottom-left":new a.P(o,-o),"bottom-right":new a.P(-o,-o),left:new a.P(y,0),right:new a.P(-y,0)}}if(y instanceof a.P||Array.isArray(y)){const o=a.P.convert(y);return{center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return{center:a.P.convert(y.center||[0,0]),top:a.P.convert(y.top||[0,0]),"top-left":a.P.convert(y["top-left"]||[0,0]),"top-right":a.P.convert(y["top-right"]||[0,0]),bottom:a.P.convert(y.bottom||[0,0]),"bottom-left":a.P.convert(y["bottom-left"]||[0,0]),"bottom-right":a.P.convert(y["bottom-right"]||[0,0]),left:a.P.convert(y.left||[0,0]),right:a.P.convert(y.right||[0,0])}}return Gl(new a.P(0,0))}const hf=_;d.AJAXError=a.be,d.Evented=a.E,d.LngLat=a.M,d.MercatorCoordinate=a.Y,d.Point=a.P,d.addProtocol=a.bf,d.config=a.a,d.removeProtocol=a.bg,d.AttributionControl=so,d.BoxZoomHandler=io,d.CanvasSource=wn,d.CooperativeGesturesHandler=Bt,d.DoubleClickZoomHandler=ou,d.DragPanHandler=lf,d.DragRotateHandler=oo,d.EdgeInsets=Ws,d.FullscreenControl=class extends a.E{constructor(y={}){super(),this._onFullscreenChange=()=>{var o;let h=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((o=h==null?void 0:h.shadowRoot)===null||o===void 0)&&o.fullscreenElement;)h=h.shadowRoot.fullscreenElement;h===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,y&&y.container&&(y.container instanceof HTMLElement?this._container=y.container:a.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(y){return this._map=y,this._container||(this._container=this._map.getContainer()),this._controlContainer=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){C.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const y=this._fullscreenButton=C.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);C.create("span","maplibregl-ctrl-icon",y).setAttribute("aria-hidden","true"),y.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const y=this._getTitle();this._fullscreenButton.setAttribute("aria-label",y),this._fullscreenButton.title=y}_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 a.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new a.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},d.GeoJSONSource=We,d.GeolocateControl=class extends a.E{constructor(y){super(),this._onSuccess=o=>{if(this._map){if(this._isOutOfMapMaxBounds(o))return this._setErrorState(),this.fire(new a.k("outofmaxbounds",o)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=o,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(o),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(o),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new a.k("geolocate",o)),this._finish()}},this._updateCamera=o=>{const h=new a.M(o.coords.longitude,o.coords.latitude),p=o.coords.accuracy,m=this._map.getBearing(),v=a.e({bearing:m},this.options.fitBoundsOptions),E=st.fromLngLat(h,p);this._map.fitBounds(E,v,{geolocateSource:!0})},this._updateMarker=o=>{if(o){const h=new a.M(o.coords.longitude,o.coords.latitude);this._accuracyCircleMarker.setLngLat(h).addTo(this._map),this._userLocationDotMarker.setLngLat(h).addTo(this._map),this._accuracy=o.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=o=>{if(this._map){if(this.options.trackUserLocation)if(o.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(o.code===3&&vs)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new a.k("error",o)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=o=>{if(this._map){if(this._container.addEventListener("contextmenu",h=>h.preventDefault()),this._geolocateButton=C.create("button","maplibregl-ctrl-geolocate",this._container),C.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",o===!1){a.w("Geolocation support is not available so the GeolocateControl will be disabled.");const h=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}else{const h=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=h,this._geolocateButton.setAttribute("aria-label",h)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=C.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Wa({element:this._dotElement}),this._circleElement=C.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Wa({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",h=>{h.geolocateSource||this._watchState!=="ACTIVE_LOCK"||h.originalEvent&&h.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 a.k("trackuserlocationend")))})}},this.options=a.e({},Ul,y)}onAdd(y){return this._map=y,this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return a._(this,arguments,void 0,function*(o=!1){if(Oo!==void 0&&!o)return Oo;if(window.navigator.permissions===void 0)return Oo=!!window.navigator.geolocation,Oo;try{Oo=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Oo=!!window.navigator.geolocation}return Oo})}().then(o=>this._setupUI(o)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),C.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Js=0,vs=!1}_isOutOfMapMaxBounds(y){const o=this._map.getMaxBounds(),h=y.coords;return o&&(h.longitudeo.getEast()||h.latitudeo.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const y=this._map.getBounds(),o=y.getSouthEast(),h=y.getNorthEast(),p=o.distanceTo(h),m=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}px`}trigger(){if(!this._setup)return a.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 a.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Js--,vs=!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 a.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 a.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 y;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Js++,Js>1?(y={maximumAge:6e5,timeout:0},vs=!0):(y=this.options.positionOptions,vs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,y)}}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)}},d.Hash=tu,d.ImageSource=Ut,d.KeyboardHandler=es,d.LngLatBounds=st,d.LogoControl=cf,d.Map=class extends Si{constructor(y){if(a.bc.mark(a.bd.create),(y=a.e({},qa,y)).minZoom!=null&&y.maxZoom!=null&&y.minZoom>y.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(y.minPitch!=null&&y.maxPitch!=null&&y.minPitch>y.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(y.minPitch!=null&&y.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(y.maxPitch!=null&&y.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Pl(y.minZoom,y.maxZoom,y.minPitch,y.maxPitch,y.renderWorldCopies),{bearingSnap:y.bearingSnap}),this._contextLost=o=>{o.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new a.k("webglcontextlost",{originalEvent:o}))},this._contextRestored=o=>{this._setupPainter(),this.resize(),this._update(),this.fire(new a.k("webglcontextrestored",{originalEvent:o}))},this._onMapScroll=o=>{if(o.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=y.interactive,this._maxTileCacheSize=y.maxTileCacheSize,this._maxTileCacheZoomLevels=y.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=y.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=y.preserveDrawingBuffer,this._antialias=y.antialias,this._trackResize=y.trackResize,this._bearingSnap=y.bearingSnap,this._refreshExpiredTiles=y.refreshExpiredTiles,this._fadeDuration=y.fadeDuration,this._crossSourceCollisions=y.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=y.collectResourceTiming,this._renderTaskQueue=new Ua,this._controls=[],this._mapId=a.a3(),this._locale=a.e({},cu,y.locale),this._clickTolerance=y.clickTolerance,this._overridePixelRatio=y.pixelRatio,this._maxCanvasSize=y.maxCanvasSize,this.transformCameraUpdate=y.transformCameraUpdate,this._imageQueueHandle=G.addThrottleControl(()=>this.isMoving()),this._requestManager=new U(y.transformRequest),typeof y.container=="string"){if(this._container=document.getElementById(y.container),!this._container)throw new Error(`Container '${y.container}' not found.`)}else{if(!(y.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=y.container}if(y.maxBounds&&this.setMaxBounds(y.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 o=!1;const h=eu(p=>{this._trackResize&&!this._removed&&this.resize(p)._update()},50);this._resizeObserver=new ResizeObserver(p=>{o?h(p):o=!0}),this._resizeObserver.observe(this._container)}this.handlers=new su(this,y),this._hash=y.hash&&new tu(typeof y.hash=="string"&&y.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:y.center,zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),y.bounds&&(this.resize(),this.fitBounds(y.bounds,a.e({},y.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=y.localIdeographFontFamily,this._validateStyle=y.validateStyle,y.style&&this.setStyle(y.style,{localIdeographFontFamily:y.localIdeographFontFamily}),y.attributionControl&&this.addControl(new so(typeof y.attributionControl=="boolean"?void 0:y.attributionControl)),y.maplibreLogo&&this.addControl(new cf,y.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",o=>{this._update(o.dataType==="style"),this.fire(new a.k(`${o.dataType}data`,o))}),this.on("dataloading",o=>{this.fire(new a.k(`${o.dataType}dataloading`,o))}),this.on("dataabort",o=>{this.fire(new a.k("sourcedataabort",o))})}_getMapId(){return this._mapId}addControl(y,o){if(o===void 0&&(o=y.getDefaultPosition?y.getDefaultPosition():"top-right"),!y||!y.onAdd)return this.fire(new a.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const h=y.onAdd(this);this._controls.push(y);const p=this._controlPositions[o];return o.indexOf("bottom")!==-1?p.insertBefore(h,p.firstChild):p.appendChild(h),this}removeControl(y){if(!y||!y.onRemove)return this.fire(new a.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const o=this._controls.indexOf(y);return o>-1&&this._controls.splice(o,1),y.onRemove(this),this}hasControl(y){return this._controls.indexOf(y)>-1}calculateCameraOptionsFromTo(y,o,h,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(h,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(y,o,h,p)}resize(y){var o;const h=this._containerDimensions(),p=h[0],m=h[1],v=this._getClampedPixelRatio(p,m);if(this._resizeCanvas(p,m,v),this.painter.resize(p,m,v),this.painter.overLimit()){const M=this.painter.context.gl;this._maxCanvasSize=[M.drawingBufferWidth,M.drawingBufferHeight];const A=this._getClampedPixelRatio(p,m);this._resizeCanvas(p,m,A),this.painter.resize(p,m,A)}this.transform.resize(p,m),(o=this._requestedCameraState)===null||o===void 0||o.resize(p,m);const E=!this._moving;return E&&(this.stop(),this.fire(new a.k("movestart",y)).fire(new a.k("move",y))),this.fire(new a.k("resize",y)),E&&this.fire(new a.k("moveend",y)),this}_getClampedPixelRatio(y,o){const{0:h,1:p}=this._maxCanvasSize,m=this.getPixelRatio(),v=y*m,E=o*m;return Math.min(v>h?h/v:1,E>p?p/E:1)*m}getPixelRatio(){var y;return(y=this._overridePixelRatio)!==null&&y!==void 0?y:devicePixelRatio}setPixelRatio(y){this._overridePixelRatio=y,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(y){return this.transform.setMaxBounds(st.convert(y)),this._update()}setMinZoom(y){if((y=y??-2)>=-2&&y<=this.transform.maxZoom)return this.transform.minZoom=y,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=y,this._update(),this.getZoom()>y&&this.setZoom(y),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(y){if((y=y??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(y>=0&&y<=this.transform.maxPitch)return this.transform.minPitch=y,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(y>=this.transform.minPitch)return this.transform.maxPitch=y,this._update(),this.getPitch()>y&&this.setPitch(y),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(y){return this.transform.renderWorldCopies=y,this._update()}project(y){return this.transform.locationPoint(a.M.convert(y),this.style&&this.terrain)}unproject(y){return this.transform.pointLocation(a.P.convert(y),this.terrain)}isMoving(){var y;return this._moving||((y=this.handlers)===null||y===void 0?void 0:y.isMoving())}isZooming(){var y;return this._zooming||((y=this.handlers)===null||y===void 0?void 0:y.isZooming())}isRotating(){var y;return this._rotating||((y=this.handlers)===null||y===void 0?void 0:y.isRotating())}_createDelegatedListener(y,o,h){if(y==="mouseenter"||y==="mouseover"){let p=!1;return{layer:o,listener:h,delegates:{mousemove:v=>{const E=this.getLayer(o)?this.queryRenderedFeatures(v.point,{layers:[o]}):[];E.length?p||(p=!0,h.call(this,new xi(y,this,v.originalEvent,{features:E}))):p=!1},mouseout:()=>{p=!1}}}}if(y==="mouseleave"||y==="mouseout"){let p=!1;return{layer:o,listener:h,delegates:{mousemove:E=>{(this.getLayer(o)?this.queryRenderedFeatures(E.point,{layers:[o]}):[]).length?p=!0:p&&(p=!1,h.call(this,new xi(y,this,E.originalEvent)))},mouseout:E=>{p&&(p=!1,h.call(this,new xi(y,this,E.originalEvent)))}}}}{const p=m=>{const v=this.getLayer(o)?this.queryRenderedFeatures(m.point,{layers:[o]}):[];v.length&&(m.features=v,h.call(this,m),delete m.features)};return{layer:o,listener:h,delegates:{[y]:p}}}}on(y,o,h){if(h===void 0)return super.on(y,o);const p=this._createDelegatedListener(y,o,h);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[y]=this._delegatedListeners[y]||[],this._delegatedListeners[y].push(p);for(const m in p.delegates)this.on(m,p.delegates[m]);return this}once(y,o,h){if(h===void 0)return super.once(y,o);const p=this._createDelegatedListener(y,o,h);for(const m in p.delegates)this.once(m,p.delegates[m]);return this}off(y,o,h){return h===void 0?super.off(y,o):(this._delegatedListeners&&this._delegatedListeners[y]&&(p=>{const m=this._delegatedListeners[y];for(let v=0;vthis._updateStyle(y,o));const h=this.style&&o.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!y)),y?(this.style=new Bi(this,o||{}),this.style.setEventedParent(this,{style:this.style}),typeof y=="string"?this.style.loadURL(y,o,h):this.style.loadJSON(y,o,h),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Bi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(y,o){if(typeof y=="string"){const h=this._requestManager.transformRequest(y,"Style");a.h(h,new AbortController).then(p=>{this._updateDiff(p.data,o)}).catch(p=>{p&&this.fire(new a.j(p))})}else typeof y=="object"&&this._updateDiff(y,o)}_updateDiff(y,o){try{this.style.setState(y,o)&&this._update(!0)}catch(h){a.w(`Unable to perform style diff: ${h.message||h.error||h}. Rebuilding the style from scratch.`),this._updateStyle(y,o)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.w("There is no style added to the map.")}addSource(y,o){return this._lazyInitEmptyStyle(),this.style.addSource(y,o),this._update(!0)}isSourceLoaded(y){const o=this.style&&this.style.sourceCaches[y];if(o!==void 0)return o.loaded();this.fire(new a.j(new Error(`There is no source with ID '${y}'`)))}setTerrain(y){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),y){const o=this.style.sourceCaches[y.source];if(!o)throw new Error(`cannot load terrain, because there exists no source with ID: ${y.source}`);this.terrain===null&&o.reload();for(const h in this.style._layers){const p=this.style._layers[h];p.type==="hillshade"&&p.source===y.source&&a.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 uf(this.painter,o,y),this.painter.renderToTexture=new lu(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=h=>{h.dataType==="style"?this.terrain.sourceCache.freeRtt():h.dataType==="source"&&h.tile&&(h.sourceId!==y.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(h.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new a.k("terrain",{terrain:y})),this}getTerrain(){var y,o;return(o=(y=this.terrain)===null||y===void 0?void 0:y.options)!==null&&o!==void 0?o:null}areTilesLoaded(){const y=this.style&&this.style.sourceCaches;for(const o in y){const h=y[o]._tiles;for(const p in h){const m=h[p];if(m.state!=="loaded"&&m.state!=="errored")return!1}}return!0}removeSource(y){return this.style.removeSource(y),this._update(!0)}getSource(y){return this.style.getSource(y)}addImage(y,o,h={}){const{pixelRatio:p=1,sdf:m=!1,stretchX:v,stretchY:E,content:M}=h;if(this._lazyInitEmptyStyle(),!(o instanceof HTMLImageElement||a.b(o))){if(o.width===void 0||o.height===void 0)return this.fire(new a.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:A,height:R,data:V}=o,q=o;return this.style.addImage(y,{data:new a.R({width:A,height:R},new Uint8Array(V)),pixelRatio:p,stretchX:v,stretchY:E,content:M,sdf:m,version:0,userImage:q}),q.onAdd&&q.onAdd(this,y),this}}{const{width:A,height:R,data:V}=k.getImageData(o);this.style.addImage(y,{data:new a.R({width:A,height:R},V),pixelRatio:p,stretchX:v,stretchY:E,content:M,sdf:m,version:0})}}updateImage(y,o){const h=this.style.getImage(y);if(!h)return this.fire(new a.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=o instanceof HTMLImageElement||a.b(o)?k.getImageData(o):o,{width:m,height:v,data:E}=p;if(m===void 0||v===void 0)return this.fire(new a.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(m!==h.data.width||v!==h.data.height)return this.fire(new a.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const M=!(o instanceof HTMLImageElement||a.b(o));return h.data.replace(E,M),this.style.updateImage(y,h),this}getImage(y){return this.style.getImage(y)}hasImage(y){return y?!!this.style.getImage(y):(this.fire(new a.j(new Error("Missing required image id"))),!1)}removeImage(y){this.style.removeImage(y)}loadImage(y){return G.getImage(this._requestManager.transformRequest(y,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(y,o){return this._lazyInitEmptyStyle(),this.style.addLayer(y,o),this._update(!0)}moveLayer(y,o){return this.style.moveLayer(y,o),this._update(!0)}removeLayer(y){return this.style.removeLayer(y),this._update(!0)}getLayer(y){return this.style.getLayer(y)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(y,o,h){return this.style.setLayerZoomRange(y,o,h),this._update(!0)}setFilter(y,o,h={}){return this.style.setFilter(y,o,h),this._update(!0)}getFilter(y){return this.style.getFilter(y)}setPaintProperty(y,o,h,p={}){return this.style.setPaintProperty(y,o,h,p),this._update(!0)}getPaintProperty(y,o){return this.style.getPaintProperty(y,o)}setLayoutProperty(y,o,h,p={}){return this.style.setLayoutProperty(y,o,h,p),this._update(!0)}getLayoutProperty(y,o){return this.style.getLayoutProperty(y,o)}setGlyphs(y,o={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(y,o),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(y,o,h={}){return this._lazyInitEmptyStyle(),this.style.addSprite(y,o,h,p=>{p||this._update(!0)}),this}removeSprite(y){return this._lazyInitEmptyStyle(),this.style.removeSprite(y),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(y,o={}){return this._lazyInitEmptyStyle(),this.style.setSprite(y,o,h=>{h||this._update(!0)}),this}setLight(y,o={}){return this._lazyInitEmptyStyle(),this.style.setLight(y,o),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(y,o){return this.style.setFeatureState(y,o),this._update()}removeFeatureState(y,o){return this.style.removeFeatureState(y,o),this._update()}getFeatureState(y){return this.style.getFeatureState(y)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let y=0,o=0;return this._container&&(y=this._container.clientWidth||400,o=this._container.clientHeight||300),[y,o]}_setupContainer(){const y=this._container;y.classList.add("maplibregl-map");const o=this._canvasContainer=C.create("div","maplibregl-canvas-container",y);this._interactive&&o.classList.add("maplibregl-interactive"),this._canvas=C.create("canvas","maplibregl-canvas",o),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 h=this._containerDimensions(),p=this._getClampedPixelRatio(h[0],h[1]);this._resizeCanvas(h[0],h[1],p);const m=this._controlContainer=C.create("div","maplibregl-control-container",y),v=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(E=>{v[E]=C.create("div",`maplibregl-ctrl-${E} `,m)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(y,o,h){this._canvas.width=Math.floor(h*y),this._canvas.height=Math.floor(h*o),this._canvas.style.width=`${y}px`,this._canvas.style.height=`${o}px`}_setupPainter(){const y={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let o=null;this._canvas.addEventListener("webglcontextcreationerror",p=>{o={requestedAttributes:y},p&&(o.statusMessage=p.statusMessage,o.type=p.type)},{once:!0});const h=this._canvas.getContext("webgl2",y)||this._canvas.getContext("webgl",y);if(!h){const p="Failed to initialize WebGL";throw o?(o.message=p,new Error(JSON.stringify(o))):new Error(p)}this.painter=new Kh(h,this.transform),P.testSupport(h)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(y){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||y,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(y){return this._update(),this._renderTaskQueue.add(y)}_cancelRenderFrame(y){this._renderTaskQueue.remove(y)}_render(y){const o=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(y),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const m=this.transform.zoom,v=k.now();this.style.zoomHistory.update(m,v);const E=new a.a8(m,{now:v,fadeDuration:o,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),M=E.crossFadingFactor();M===1&&M===this._crossFadingFactor||(h=!0,this._crossFadingFactor=M),this.style.update(E)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,showPadding:this.showPadding}),this.fire(new a.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.bc.mark(a.bd.load),this.fire(new a.k("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.k("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0,a.bc.mark(a.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var y;this._hash&&this._hash.remove();for(const h of this._controls)h.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),G.removeThrottleControl(this._imageQueueHandle),(y=this._resizeObserver)===null||y===void 0||y.disconnect();const o=this.painter.context.gl.getExtension("WEBGL_lose_context");o&&o.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),C.remove(this._canvasContainer),C.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),a.bc.clearMetrics(),this._removed=!0,this.fire(new a.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,k.frameAsync(this._frameRequest).then(y=>{a.bc.frame(y),this._frameRequest=null,this._render(y)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(y){this._showTileBoundaries!==y&&(this._showTileBoundaries=y,this._update())}get showPadding(){return!!this._showPadding}set showPadding(y){this._showPadding!==y&&(this._showPadding=y,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(y){this._showCollisionBoxes!==y&&(this._showCollisionBoxes=y,y?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(y){this._showOverdrawInspector!==y&&(this._showOverdrawInspector=y,this._update())}get repaint(){return!!this._repaint}set repaint(y){this._repaint!==y&&(this._repaint=y,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(y){this._vertices=y,this._update()}get version(){return uu}getCameraTargetElevation(){return this.transform.elevation}},d.MapMouseEvent=xi,d.MapTouchEvent=_o,d.MapWheelEvent=ru,d.Marker=Wa,d.NavigationControl=class{constructor(y){this._updateZoomButtons=()=>{const o=this._map.getZoom(),h=o===this._map.getMaxZoom(),p=o===this._map.getMinZoom();this._zoomInButton.disabled=h,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",h.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.toString())},this._rotateCompassArrow=()=>{const o=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=o},this._setButtonTitle=(o,h)=>{const p=this._map._getUIString(`NavigationControl.${h}`);o.title=p,o.setAttribute("aria-label",p)},this.options=a.e({},hu,y),this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",o=>o.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",o=>this._map.zoomIn({},{originalEvent:o})),C.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",o=>this._map.zoomOut({},{originalEvent:o})),C.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",o=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:o}):this._map.resetNorth({},{originalEvent:o})}),this._compassIcon=C.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(y){return this._map=y,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 fu(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){C.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(y,o){const h=C.create("button",y,this._container);return h.type="button",h.addEventListener("click",o),h}},d.Popup=class extends a.E{constructor(y){super(),this.remove=()=>(this._content&&C.remove(this._content),this._container&&(C.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new a.k("close"))),this),this._onMouseUp=o=>{this._update(o.point)},this._onMouseMove=o=>{this._update(o.point)},this._onDrag=o=>{this._update(o.point)},this._update=o=>{var h;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=C.create("div","maplibregl-popup",this._map.getContainer()),this._tip=C.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const M of this.options.className.split(" "))this._container.classList.add(M);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Nl(this._lngLat,this._flatPos,this._map.transform):(h=this._lngLat)===null||h===void 0?void 0:h.wrap(),this._trackPointer&&!o)return;const p=this._flatPos=this._pos=this._trackPointer&&o?o:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&o?o:this._map.transform.locationPoint(this._lngLat));let m=this.options.anchor;const v=Gl(this.options.offset);if(!m){const M=this._container.offsetWidth,A=this._container.offsetHeight;let R;R=p.y+v.bottom.ythis._map.transform.height-A?["bottom"]:[],p.xthis._map.transform.width-M/2&&R.push("right"),m=R.length===0?"bottom":R.join("-")}let E=p.add(v[m]);this.options.subpixelPositioning||(E=E.round()),C.setTransform(this._container,`${Ga[m]} translate(${E.x}px,${E.y}px)`),jl(this._container,m,"popup")},this._onClose=()=>{this.remove()},this.options=a.e(Object.create(du),y)}addTo(y){return this._map&&this.remove(),this._map=y,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 a.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(y){return this._lngLat=a.M.convert(y),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(y){return this.setDOMContent(document.createTextNode(y))}setHTML(y){const o=document.createDocumentFragment(),h=document.createElement("body");let p;for(h.innerHTML=y;p=h.firstChild,p;)o.appendChild(p);return this.setDOMContent(o)}getMaxWidth(){var y;return(y=this._container)===null||y===void 0?void 0:y.style.maxWidth}setMaxWidth(y){return this.options.maxWidth=y,this._update(),this}setDOMContent(y){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=C.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(y),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(y){this._container&&this._container.classList.add(y)}removeClassName(y){this._container&&this._container.classList.remove(y)}setOffset(y){return this.options.offset=y,this._update(),this}toggleClassName(y){if(this._container)return this._container.classList.toggle(y)}setSubpixelPositioning(y){this.options.subpixelPositioning=y}_createCloseButton(){this.options.closeButton&&(this._closeButton=C.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 y=this._container.querySelector(pu);y&&y.focus()}},d.RasterDEMTileSource=wr,d.RasterTileSource=ne,d.ScaleControl=class{constructor(y){this._onMove=()=>{ql(this._map,this._container,this.options)},this.setUnit=o=>{this.options.unit=o,ql(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Vl),y)}getDefaultPosition(){return"bottom-left"}onAdd(y){return this._map=y,this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-scale",y.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){C.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},d.ScrollZoomHandler=Bl,d.Style=Bi,d.TerrainControl=class{constructor(y){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=y}onAdd(y){return this._map=y,this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=C.create("button","maplibregl-ctrl-terrain",this._container),C.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(){C.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},d.TwoFingersTouchPitchHandler=of,d.TwoFingersTouchRotateHandler=iu,d.TwoFingersTouchZoomHandler=nf,d.TwoFingersTouchZoomRotateHandler=Na,d.VectorTileSource=it,d.VideoSource=bn,d.addSourceType=(y,o)=>a._(void 0,void 0,void 0,function*(){if(ni(y))throw new Error(`A source type called "${y}" already exists.`);((h,p)=>{Mn[h]=p})(y,o)}),d.clearPrewarmedResources=function(){const y=er;y&&(y.isPreloaded()&&y.numActive()===1?(y.release(Vt),er=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()"))},d.getMaxParallelImageRequests=function(){return a.a.MAX_PARALLEL_IMAGE_REQUESTS},d.getRTLTextPluginStatus=function(){return lt().getRTLTextPluginStatus()},d.getVersion=function(){return hf},d.getWorkerCount=function(){return sr.workerCount},d.getWorkerUrl=function(){return a.a.WORKER_URL},d.importScriptInWorkers=function(y){return Pr().broadcast("IS",y)},d.prewarm=function(){nr().acquire(Vt)},d.setMaxParallelImageRequests=function(y){a.a.MAX_PARALLEL_IMAGE_REQUESTS=y},d.setRTLTextPlugin=function(y,o){return lt().setRTLTextPlugin(y,o)},d.setWorkerCount=function(y){sr.workerCount=y},d.setWorkerUrl=function(y){a.a.WORKER_URL=y}});var u=t;return u})})(Ob);var Pc=Ob.exports;const to=xg(Pc),l4=RS({__proto__:null,default:to},[Pc]),ic=[];function Yp(r,e){return{subscribe:Er(r,e).subscribe}}function Er(r,e=Ct){let t;const n=new Set;function l(a){if(jt(r,a)&&(r=a,t)){const _=!ic.length;for(const x of n)x[1](),ic.push(x,r);if(_){for(let x=0;x{n.delete(x),n.size===0&&t&&(t(),t=null)}}return{set:l,update:u,subscribe:d}}let Ft;const jb=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&jb.decode();let Ju=null;function nh(){return(Ju===null||Ju.byteLength===0)&&(Ju=new Uint8Array(Ft.memory.buffer)),Ju}function Eo(r,e){return r=r>>>0,jb.decode(nh().subarray(r,r+e))}const As=new Array(128).fill(void 0);As.push(void 0,null,!0,!1);let ih=As.length;function Dn(r){ih===As.length&&As.push(As.length+1);const e=ih;return ih=As[e],As[e]=r,e}function kr(r){return As[r]}function c4(r){r<132||(As[r]=ih,ih=r)}function dc(r){const e=kr(r);return c4(r),e}function Qp(r){return r==null}let Yu=null;function u4(){return(Yu===null||Yu.byteLength===0)&&(Yu=new Float64Array(Ft.memory.buffer)),Yu}let Qu=null;function Ir(){return(Qu===null||Qu.byteLength===0)&&(Qu=new Int32Array(Ft.memory.buffer)),Qu}let aa=0;const Gf=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},h4=typeof Gf.encodeInto=="function"?function(r,e){return Gf.encodeInto(r,e)}:function(r,e){const t=Gf.encode(r);return e.set(t),{read:r.length,written:t.length}};function Rf(r,e,t){if(t===void 0){const a=Gf.encode(r),_=e(a.length,1)>>>0;return nh().subarray(_,_+a.length).set(a),aa=a.length,_}let n=r.length,l=e(n,1)>>>0;const u=nh();let d=0;for(;d127)break;u[l+d]=a}if(d!==n){d!==0&&(r=r.slice(d)),l=t(l,n,n=d+r.length*3,1)>>>0;const a=nh().subarray(l+d,l+n),_=h4(r,a);d+=_.written}return aa=d,l}function Pm(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const l=r.description;return l==null?"Symbol":`Symbol(${l})`}if(e=="function"){const l=r.name;return typeof l=="string"&&l.length>0?`Function(${l})`:"Function"}if(Array.isArray(r)){const l=r.length;let u="[";l>0&&(u+=Pm(r[0]));for(let d=1;d1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message} +${r.stack}`:n}function f4(r,e){const t=e(r.length*1,1)>>>0;return nh().set(r,t/1),aa=r.length,t}function em(r,e){try{return r.apply(this,e)}catch(t){Ft.__wbindgen_exn_store(Dn(t))}}class ld{static __wrap(e){e=e>>>0;const t=Object.create(ld.prototype);return t.__wbg_ptr=e,t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();Ft.__wbg_jsroutesnapper_free(e)}constructor(e){try{const u=Ft.__wbindgen_add_to_stack_pointer(-16),d=f4(e,Ft.__wbindgen_malloc),a=aa;Ft.jsroutesnapper_new(u,d,a);var t=Ir()[u/4+0],n=Ir()[u/4+1],l=Ir()[u/4+2];if(l)throw dc(n);return ld.__wrap(t)}finally{Ft.__wbindgen_add_to_stack_pointer(16)}}setRouteConfig(e){Ft.jsroutesnapper_setRouteConfig(this.__wbg_ptr,Dn(e))}setAreaMode(){Ft.jsroutesnapper_setAreaMode(this.__wbg_ptr)}getConfig(){let e,t;try{const u=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_getConfig(u,this.__wbg_ptr);var n=Ir()[u/4+0],l=Ir()[u/4+1];return e=n,t=l,Eo(n,l)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(e,t,1)}}toFinalFeature(){try{const n=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_toFinalFeature(n,this.__wbg_ptr);var e=Ir()[n/4+0],t=Ir()[n/4+1];let l;return e!==0&&(l=Eo(e,t).slice(),Ft.__wbindgen_free(e,t*1)),l}finally{Ft.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){let e,t;try{const u=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_renderGeojson(u,this.__wbg_ptr);var n=Ir()[u/4+0],l=Ir()[u/4+1];return e=n,t=l,Eo(n,l)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(e,t,1)}}toggleSnapMode(){Ft.jsroutesnapper_toggleSnapMode(this.__wbg_ptr)}onMouseMove(e,t,n){return Ft.jsroutesnapper_onMouseMove(this.__wbg_ptr,e,t,n)!==0}onClick(){Ft.jsroutesnapper_onClick(this.__wbg_ptr)}onDragStart(){return Ft.jsroutesnapper_onDragStart(this.__wbg_ptr)!==0}onMouseUp(){return Ft.jsroutesnapper_onMouseUp(this.__wbg_ptr)!==0}clearState(){Ft.jsroutesnapper_clearState(this.__wbg_ptr)}editExisting(e){try{const l=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_editExisting(l,this.__wbg_ptr,Dn(e));var t=Ir()[l/4+0],n=Ir()[l/4+1];if(n)throw dc(t)}finally{Ft.__wbindgen_add_to_stack_pointer(16)}}debugRenderGraph(){let e,t;try{const u=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_debugRenderGraph(u,this.__wbg_ptr);var n=Ir()[u/4+0],l=Ir()[u/4+1];return e=n,t=l,Eo(n,l)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(e,t,1)}}debugSnappableNodes(){let e,t;try{const u=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_debugSnappableNodes(u,this.__wbg_ptr);var n=Ir()[u/4+0],l=Ir()[u/4+1];return e=n,t=l,Eo(n,l)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(e,t,1)}}routeNameForWaypoints(e){let t,n;try{const S=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_routeNameForWaypoints(S,this.__wbg_ptr,Dn(e));var l=Ir()[S/4+0],u=Ir()[S/4+1],d=Ir()[S/4+2],a=Ir()[S/4+3],_=l,x=u;if(a)throw _=0,x=0,dc(d);return t=_,n=x,Eo(_,x)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(t,n,1)}}addSnappedWaypoint(e,t){Ft.jsroutesnapper_addSnappedWaypoint(this.__wbg_ptr,e,t)}undo(){Ft.jsroutesnapper_undo(this.__wbg_ptr)}calculateRoute(e){let t,n;try{const S=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_calculateRoute(S,this.__wbg_ptr,Dn(e));var l=Ir()[S/4+0],u=Ir()[S/4+1],d=Ir()[S/4+2],a=Ir()[S/4+3],_=l,x=u;if(a)throw _=0,x=0,dc(d);return t=_,n=x,Eo(_,x)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(t,n,1)}}getExtraNodes(e,t){let n,l;try{const k=Ft.__wbindgen_add_to_stack_pointer(-16);Ft.jsroutesnapper_getExtraNodes(k,this.__wbg_ptr,Dn(e),Dn(t));var u=Ir()[k/4+0],d=Ir()[k/4+1],a=Ir()[k/4+2],_=Ir()[k/4+3],x=u,S=d;if(_)throw x=0,S=0,dc(a);return n=x,l=S,Eo(x,S)}finally{Ft.__wbindgen_add_to_stack_pointer(16),Ft.__wbindgen_free(n,l,1)}}}async function d4(r,e){if(typeof Response=="function"&&r instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(r,e)}catch(n){if(r.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const t=await r.arrayBuffer();return await WebAssembly.instantiate(t,e)}else{const t=await WebAssembly.instantiate(r,e);return t instanceof WebAssembly.Instance?{instance:t,module:r}:t}}function p4(){const r={};return r.wbg={},r.wbg.__wbindgen_string_new=function(e,t){const n=Eo(e,t);return Dn(n)},r.wbg.__wbindgen_object_drop_ref=function(e){dc(e)},r.wbg.__wbindgen_error_new=function(e,t){const n=new Error(Eo(e,t));return Dn(n)},r.wbg.__wbindgen_number_get=function(e,t){const n=kr(t),l=typeof n=="number"?n:void 0;u4()[e/8+1]=Qp(l)?0:l,Ir()[e/4+0]=!Qp(l)},r.wbg.__wbindgen_is_object=function(e){const t=kr(e);return typeof t=="object"&&t!==null},r.wbg.__wbindgen_is_undefined=function(e){return kr(e)===void 0},r.wbg.__wbindgen_in=function(e,t){return kr(e)in kr(t)},r.wbg.__wbindgen_boolean_get=function(e){const t=kr(e);return typeof t=="boolean"?t?1:0:2},r.wbg.__wbindgen_jsval_loose_eq=function(e,t){return kr(e)==kr(t)},r.wbg.__wbindgen_string_get=function(e,t){const n=kr(t),l=typeof n=="string"?n:void 0;var u=Qp(l)?0:Rf(l,Ft.__wbindgen_malloc,Ft.__wbindgen_realloc),d=aa;Ir()[e/4+1]=d,Ir()[e/4+0]=u},r.wbg.__wbg_String_4370c5505c674d30=function(e,t){const n=String(kr(t)),l=Rf(n,Ft.__wbindgen_malloc,Ft.__wbindgen_realloc),u=aa;Ir()[e/4+1]=u,Ir()[e/4+0]=l},r.wbg.__wbindgen_object_clone_ref=function(e){const t=kr(e);return Dn(t)},r.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea=function(e,t){const n=kr(e)[kr(t)];return Dn(n)},r.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return Dn(e)},r.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const n=kr(t).stack,l=Rf(n,Ft.__wbindgen_malloc,Ft.__wbindgen_realloc),u=aa;Ir()[e/4+1]=u,Ir()[e/4+0]=l},r.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let n,l;try{n=e,l=t,console.error(Eo(e,t))}finally{Ft.__wbindgen_free(n,l,1)}},r.wbg.__wbg_debug_9a6b3243fbbebb61=function(e){console.debug(kr(e))},r.wbg.__wbg_error_788ae33f81d3b84b=function(e){console.error(kr(e))},r.wbg.__wbg_info_2e30e8204b29d91d=function(e){console.info(kr(e))},r.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(kr(e))},r.wbg.__wbg_warn_d60e832f9882c1b2=function(e){console.warn(kr(e))},r.wbg.__wbg_get_44be0491f933a435=function(e,t){const n=kr(e)[t>>>0];return Dn(n)},r.wbg.__wbg_length_fff51ee6522a1a18=function(e){return kr(e).length},r.wbg.__wbindgen_is_function=function(e){return typeof kr(e)=="function"},r.wbg.__wbg_next_526fc47e980da008=function(e){const t=kr(e).next;return Dn(t)},r.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return em(function(e){const t=kr(e).next();return Dn(t)},arguments)},r.wbg.__wbg_done_5c1f01fb660d73b5=function(e){return kr(e).done},r.wbg.__wbg_value_1695675138684bd5=function(e){const t=kr(e).value;return Dn(t)},r.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return Dn(Symbol.iterator)},r.wbg.__wbg_get_97b561fb56f034b5=function(){return em(function(e,t){const n=Reflect.get(kr(e),kr(t));return Dn(n)},arguments)},r.wbg.__wbg_call_cb65541d95d71282=function(){return em(function(e,t){const n=kr(e).call(kr(t));return Dn(n)},arguments)},r.wbg.__wbg_isArray_4c24b343cb13cfb1=function(e){return Array.isArray(kr(e))},r.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(e){let t;try{t=kr(e)instanceof ArrayBuffer}catch{t=!1}return t},r.wbg.__wbg_buffer_085ec1f694018c4f=function(e){const t=kr(e).buffer;return Dn(t)},r.wbg.__wbg_new_8125e318e6245eed=function(e){const t=new Uint8Array(kr(e));return Dn(t)},r.wbg.__wbg_set_5cf90238115182c3=function(e,t,n){kr(e).set(kr(t),n>>>0)},r.wbg.__wbg_length_72e2208bbc0efc61=function(e){return kr(e).length},r.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(e){let t;try{t=kr(e)instanceof Uint8Array}catch{t=!1}return t},r.wbg.__wbindgen_debug_string=function(e,t){const n=Pm(kr(t)),l=Rf(n,Ft.__wbindgen_malloc,Ft.__wbindgen_realloc),u=aa;Ir()[e/4+1]=u,Ir()[e/4+0]=l},r.wbg.__wbindgen_throw=function(e,t){throw new Error(Eo(e,t))},r.wbg.__wbindgen_memory=function(){const e=Ft.memory;return Dn(e)},r}function m4(r,e){return Ft=r.exports,Ub.__wbindgen_wasm_module=e,Yu=null,Qu=null,Ju=null,Ft}async function Ub(r){if(Ft!==void 0)return Ft;typeof r>"u"&&(r="/ltn/assets/route_snapper_bg.wasm");const e=p4();(typeof r=="string"||typeof Request=="function"&&r instanceof Request||typeof URL=="function"&&r instanceof URL)&&(r=fetch(r));const{instance:t,module:n}=await d4(await r,e);return m4(t,n)}var Li=63710088e-1,Sg={centimeters:Li*100,centimetres:Li*100,degrees:Li/111325,feet:Li*3.28084,inches:Li*39.37,kilometers:Li/1e3,kilometres:Li/1e3,meters:Li,metres:Li,miles:Li/1609.344,millimeters:Li*1e3,millimetres:Li*1e3,nauticalmiles:Li/1852,radians:1,yards:Li*1.0936},g4={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Li,yards:1.0936133},zm={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Do(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function _4(r,e,t){switch(r){case"Point":return eo(e).geometry;case"LineString":return Co(e).geometry;case"Polygon":return kg(e).geometry;case"MultiPoint":return qb(e).geometry;case"MultiLineString":return Vb(e).geometry;case"MultiPolygon":return Gb(e).geometry;default:throw new Error(r+" is invalid")}}function eo(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!cd(r[0])||!cd(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Do(n,e,t)}function y4(r,e,t){return t===void 0&&(t={}),tl(r.map(function(n){return eo(n,e)}),t)}function kg(r,e,t){t===void 0&&(t={});for(var n=0,l=r;n=0))throw new Error("precision must be a positive number");var t=Math.pow(10,e||0);return Math.round(r*t)/t}function Tg(r,e){e===void 0&&(e="kilometers");var t=Sg[e];if(!t)throw new Error(e+" units is invalid");return r*t}function Rd(r,e){e===void 0&&(e="kilometers");var t=Sg[e];if(!t)throw new Error(e+" units is invalid");return r/t}function S4(r,e){return hh(Rd(r,e))}function k4(r){var e=r%360;return e<0&&(e+=360),e}function hh(r){var e=r%(2*Math.PI);return e*180/Math.PI}function Io(r){var e=r%360;return e*Math.PI/180}function T4(r,e,t){if(e===void 0&&(e="kilometers"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Tg(Rd(r,e),t)}function E4(r,e,t){if(e===void 0&&(e="meters"),t===void 0&&(t="kilometers"),!(r>=0))throw new Error("area must be a positive number");var n=zm[e];if(!n)throw new Error("invalid original units");var l=zm[t];if(!l)throw new Error("invalid final units");return r/n*l}function cd(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}function Eg(r){return!!r&&r.constructor===Object}function M4(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(e){if(!cd(e))throw new Error("bbox must only contain numbers")})}function C4(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}const I4=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:zm,bearingToAzimuth:k4,convertArea:E4,convertLength:T4,degreesToRadians:Io,earthRadius:Li,factors:Sg,feature:Do,featureCollection:tl,geometry:_4,geometryCollection:w4,isNumber:cd,isObject:Eg,lengthToDegrees:S4,lengthToRadians:Rd,lineString:Co,lineStrings:b4,multiLineString:Vb,multiPoint:qb,multiPolygon:Gb,point:eo,points:y4,polygon:kg,polygons:v4,radiansToDegrees:hh,radiansToLength:Tg,round:x4,unitsFactors:g4,validateBBox:M4,validateId:C4},Symbol.toStringTag,{value:"Module"}));function fh(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return r.geometry.coordinates;if(r.type==="Point")return r.coordinates}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return r;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function xc(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Fu(r,e,t){t===void 0&&(t={});var n=fh(r),l=fh(e),u=Io(l[1]-n[1]),d=Io(l[0]-n[0]),a=Io(n[1]),_=Io(l[1]),x=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(d/2),2)*Math.cos(a)*Math.cos(_);return Tg(2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)),t.units)}function Sh(r,e,t){if(r!==null)for(var n,l,u,d,a,_,x,S=0,k=0,C,P=r.type,D=P==="FeatureCollection",N=P==="Feature",z=D?r.features.length:1,B=0;B_||D>x||N>S){a=k,_=n,x=D,S=N,u=0;return}var z=Co([a,k],t.properties);if(e(z,n,l,N,u)===!1)return!1;u++,a=k})===!1)return!1}}})}function B4(r,e,t){var n=t,l=!1;return Zb(r,function(u,d,a,_,x){l===!1&&t===void 0?n=u:n=e(n,u,d,a,_,x),l=!0}),n}function Hb(r,e){if(!r)throw new Error("geojson is required");zc(r,function(t,n,l){if(t.geometry!==null){var u=t.geometry.type,d=t.geometry.coordinates;switch(u){case"LineString":if(e(t,n,l,0,0)===!1)return!1;break;case"Polygon":for(var a=0;al?t:l,x=n>u?n:u;return[d,a,_,x]}var Cg={exports:{}},Xb={exports:{}};(function(r,e){(function(t,n){r.exports=n()})(xh,function(){function t(O,G,U,K,me){(function X(Y,_e,ze,re,ce){for(;re>ze;){if(re-ze>600){var Ze=re-ze+1,Me=_e-ze+1,ht=Math.log(Ze),It=.5*Math.exp(2*ht/3),Ot=.5*Math.sqrt(ht*It*(Ze-It)/Ze)*(Me-Ze/2<0?-1:1),Ke=Math.max(ze,Math.floor(_e-Me*It/Ze+Ot)),Kt=Math.min(re,Math.floor(_e+(Ze-Me)*It/Ze+Ot));X(Y,_e,Ke,Kt,ce)}var vt=Y[_e],Lt=ze,Vt=re;for(n(Y,ze,_e),ce(Y[re],vt)>0&&n(Y,ze,re);Lt0;)Vt--}ce(Y[ze],vt)===0?n(Y,ze,Vt):n(Y,++Vt,re),Vt<=_e&&(ze=Vt+1),_e<=Vt&&(re=Vt-1)}})(O,G,U||0,K||O.length-1,me||l)}function n(O,G,U){var K=O[G];O[G]=O[U],O[U]=K}function l(O,G){return OG?1:0}var u=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function d(O,G,U){if(!U)return G.indexOf(O);for(var K=0;K=O.minX&&G.maxY>=O.minY}function z(O){return{children:O,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function B(O,G,U,K,me){for(var X=[G,U];X.length;)if(!((U=X.pop())-(G=X.pop())<=K)){var Y=G+Math.ceil((U-G)/K/2)*K;t(O,Y,G,U,me),X.push(G,Y,Y,U)}}return u.prototype.all=function(){return this._all(this.data,[])},u.prototype.search=function(O){var G=this.data,U=[];if(!N(O,G))return U;for(var K=this.toBBox,me=[];G;){for(var X=0;X=0&&me[G].children.length>this._maxEntries;)this._split(me,G),G--;this._adjustParentBBoxes(K,me,G)},u.prototype._split=function(O,G){var U=O[G],K=U.children.length,me=this._minEntries;this._chooseSplitAxis(U,me,K);var X=this._chooseSplitIndex(U,me,K),Y=z(U.children.splice(X,U.children.length-X));Y.height=U.height,Y.leaf=U.leaf,a(U,this.toBBox),a(Y,this.toBBox),G?O[G-1].children.push(Y):this._splitRoot(U,Y)},u.prototype._splitRoot=function(O,G){this.data=z([O,G]),this.data.height=O.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},u.prototype._chooseSplitIndex=function(O,G,U){for(var K,me,X,Y,_e,ze,re,ce=1/0,Ze=1/0,Me=G;Me<=U-G;Me++){var ht=_(O,0,Me,this.toBBox),It=_(O,Me,U,this.toBBox),Ot=(me=ht,X=It,Y=void 0,_e=void 0,ze=void 0,re=void 0,Y=Math.max(me.minX,X.minX),_e=Math.max(me.minY,X.minY),ze=Math.min(me.maxX,X.maxX),re=Math.min(me.maxY,X.maxY),Math.max(0,ze-Y)*Math.max(0,re-_e)),Ke=C(ht)+C(It);Ot=G;ce--){var Ze=O.children[ce];x(Y,O.leaf?me(Ze):Ze),_e+=P(Y)}return _e},u.prototype._adjustParentBBoxes=function(O,G,U){for(var K=U;K>=0;K--)x(G[K],O)},u.prototype._condense=function(O){for(var G=O.length-1,U=void 0;G>=0;G--)O[G].children.length===0?G>0?(U=O[G-1].children).splice(U.indexOf(O[G]),1):this.clear():a(O[G],this.toBBox)},u})})(Xb);var W4=Xb.exports;const Z4=Dd(I4),H4=Dd(j4);function Kb(r,e,t){if(r!==null)for(var n,l,u,d,a,_,x,S=0,k=0,C,P=r.type,D=P==="FeatureCollection",N=P==="Feature",z=D?r.features.length:1,B=0;B{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2] line1 must only contain 2 coordinates");if(n.length!==2)throw new Error(" line2 must only contain 2 coordinates");var l=t[0][0],u=t[0][1],d=t[1][0],a=t[1][1],_=n[0][0],x=n[0][1],S=n[1][0],k=n[1][1],C=(k-x)*(d-l)-(S-_)*(a-u),P=(S-_)*(u-x)-(k-x)*(l-_),D=(d-l)*(u-x)-(a-u)*(l-_);if(C===0)return null;var N=P/C,z=D/C;if(N>=0&&N<=1&&z>=0&&z<=1){var B=l+N*(d-l),O=u+N*(a-u);return eo([B,O])}return null}function tk(r,e,t){t===void 0&&(t={});var n=eo([1/0,1/0],{dist:1/0}),l=0;return zc(r,function(u){for(var d=xc(u),a=0;a0&&(z=N.features[0],z.properties.dist=Fu(e,z,t),z.properties.location=l+Fu(_,z,t)),_.properties.dist{if(!this.active)return;const a=[d.point.x-rk,d.point.y],_=this.map.unproject(d.point).distanceTo(this.map.unproject(a));this.inner.onMouseMove(d.lngLat.lng,d.lngLat.lat,_)&&(this.redraw(),this.dataUpdated())},this.onClick=()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())},this.onDoubleClick=d=>{this.active&&(d.preventDefault(),this.inner.onClick(),this.finish())},this.onDragStart=()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()},this.onMouseUp=()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()},this.onKeyDown=d=>{if(!this.active)return;let a=d.target.tagName;a=="INPUT"||a=="TEXTAREA"||d.key=="Escape"&&(d.stopPropagation(),this.cancel())},this.onKeyPress=d=>{if(!this.active)return;let a=d.target.tagName;a=="INPUT"||a=="TEXTAREA"||(d.key=="Enter"?(d.stopPropagation(),this.finish()):d.key=="s"||d.key=="S"?(d.stopPropagation(),this.inner.toggleSnapMode(),this.redraw()):d.key=="z"&&d.ctrlKey&&this.undo())},this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new ld(t),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.routeToolGj=n,this.snapMode=l,this.undoLength=u,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("dragstart",this.onDragStart),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keypress",this.onKeyPress)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("dragstart",this.onDragStart),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keypress",this.onKeyPress)}startRoute(){this.active||(this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setAreaMode(),this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}stop(){this.active=!1,this.inner.clearState(),this.redraw(),this.map.boxZoom.enable(),this.map.doubleClickZoom.enable()}editExistingRoute(e){this.active&&window.alert("Bug: editExistingRoute called when tool is already active"),e.properties.waypoints||(e.properties.waypoints=[{lon:e.geometry.coordinates[0][0],lat:e.geometry.coordinates[0][1],snapped:!0},{lon:e.geometry.coordinates[e.geometry.coordinates.length-1][0],lat:e.geometry.coordinates[e.geometry.coordinates.length-1][1],snapped:!0}]),this.startRoute(),this.inner.editExisting(e.properties.waypoints),this.redraw()}editExistingArea(e){this.active&&window.alert("Bug: editExistingArea called when tool is already active"),e.properties.waypoints||window.alert("Bug: editExistingArea called for a polygon not produced by the route-snapper"),this.startArea(),this.inner.editExisting(e.properties.waypoints),this.redraw()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}isActive(){return this.active}finish(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersSuccess)t(JSON.parse(e));else for(let t of this.eventListenersFailure)t();this.stop()}cancel(){this.inner.clearState(),this.finish()}setRouteConfig(e){this.inner.setRouteConfig(e),this.redraw()}addSnappedWaypoint(e){this.inner.addSnappedWaypoint(e[0],e[1]),this.redraw()}undo(){this.inner.undo(),this.redraw()}toggleSnapMode(){this.inner.toggleSnapMode(),this.redraw()}redraw(){let e=JSON.parse(this.inner.renderGeojson());this.routeToolGj.set(e),this.map.getCanvas().style.cursor=e.cursor,this.snapMode.set(e.snap_mode),this.undoLength.set(e.undo_length)}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let t of this.eventListenersUpdated)t(JSON.parse(e))}}const Dm="MZEJTanw3WpxRvt7qDfo";let ls=Er(null),Rm=Er("streets-v2"),dh=Er(!1),ha=Er(""),hd=Er(!0),ri=Er(null),Bm=Er(new Pc.LngLat(0,0)),Fm=Er(new Pc.LngLat(0,0)),Gy=Er(1),ia=Er(1),pr=Er({mode:"title"}),Om=Er("walk_cycle_only"),Wy=Er(!1);function Sc(){let r=Hi(ha);r||window.alert("Autosave failed; no projectName set?!"),window.localStorage.setItem(r,Hi(ri).toSavefile())}function Zy(r){let e,t;return e=new Pd({props:{$$slots:{default:[ik,({dialog:n})=>({3:n}),({dialog:n})=>n?8:0]},$$scope:{ctx:r}}}),e.$on("close",r[2]),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&24&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function ik(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D;function N(){return r[1](r[3])}return{c(){e=fe("h1"),e.textContent="The low-traffic neighbourhood (LTN) tool, v2",t=Ve(),n=fe("p"),n.innerHTML=`This is an experimental + version of the + A/B Street LTN tool + . Most parts of it do not work yet, and you should probably use the other version + of the tool instead.`,l=Ve(),u=fe("p"),u.textContent="To use this tool, you need to:",d=Ve(),a=fe("ol"),a.innerHTML=`
  • Choose your study area to analyze
  • Define one or more neighbourhood boundaries
  • Optionally, fix the basemap data on existing modal filters, turn + restrictions, one-ways, etc
  • Create one or more proposals with new modal filters, and explore their + effects
  • `,_=Ve(),x=fe("p"),x.innerHTML=`This tool is created by Dustin Carlino + and relies heavily on + OpenStreetMap + data.`,S=Ve(),k=fe("center"),C=fe("button"),C.textContent="Start!"},m(z,B){be(z,e,B),be(z,t,B),be(z,n,B),be(z,l,B),be(z,u,B),be(z,d,B),be(z,a,B),be(z,_,B),be(z,x,B),be(z,S,B),be(z,k,B),ie(k,C),P||(D=Tt(C,"click",N),P=!0)},p(z,B){r=z},d(z){z&&(ve(e),ve(t),ve(n),ve(l),ve(u),ve(d),ve(a),ve(_),ve(x),ve(S),ve(k)),P=!1,D()}}}function ok(r){let e,t,n=r[0]&&Zy(r);return{c(){n&&n.c(),e=$n()},m(l,u){n&&n.m(l,u),be(l,e,u),t=!0},p(l,[u]){l[0]?n?(n.p(l,u),u&1&&oe(n,1)):(n=Zy(l),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function sk(r,e,t){let n;return wt(r,hd,d=>t(0,n=d)),[n,d=>dn(d).close(),()=>Rt(hd,n=!1,n)]}class ak extends Ht{constructor(e){super(),Zt(this,e,sk,ok,jt,{})}}const lk="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAk0lEQVRIS+3U0Q2AIAwEUNjMUXQydRJH0zZB0wjGuwJfSsKfuWfO1hg6n9g5P3wPWKTSXe6EVstUNEjoloIVghAG0OxR7swgLEAjHoBCvACM1AAQUgJ0DL0nm67WwJom7XrBlhVl4arUAHYniuE1ABTuBeBwD0CFs4D92T12fp9v9iPrnJ8LBu0KC0Ch9qEfeK3sAPceHxk8hJ17AAAAAElFTkSuQmCC",ck="/ltn/assets/logo-97f2d067.svg";let uk=Date.now();function Dc(r){return`${r}-${uk++}`}const Ig=Symbol.for("svelte-maplibre");function nl(){return Cb(Ig)}function hk(r){let e=new WeakMap;return t=>{var d;let n=e.get(t.originalEvent);if(n!==void 0)return n;let u=(d=t.target.queryRenderedFeatures(t.point).find(a=>{var _;return(_=r.get(a.layer.id))==null?void 0:_.interactive}))==null?void 0:d.layer.id;return e.set(t.originalEvent,u),u}}function fk(){let r=new Map;return wg(Ig,{map:Er(null),source:Yp(null),layer:Yp(null),popupTarget:Yp(null),cluster:Er(),loadedImages:Er(new Set),minzoom:Er(0),maxzoom:Er(24),layerEvent:Er(null),layerInfo:r,eventTopMost:hk(r),markerClickManager:new _k})}function Hy(r){return{subscribe:r.subscribe}}function Ag({key:r,setPopupTarget:e=!1,setCluster:t=!1,setMouseEvent:n=!1}){let l=nl(),u=Er(null),d=Hy(u),a={...l,[r]:Hy(u)};if(e&&(a.popupTarget=d),n){let _=Er(null);a.layerEvent=_,l.layerEvent=_}return t&&(a.cluster=Er()),wg(Ig,a),{...l,self:u}}function dk(){return Ag({key:"source",setCluster:!0})}function pk(r=!0){return Ag({key:"layer",setPopupTarget:r,setMouseEvent:r})}function mk(){return Ag({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function gk(r){return"layerType"in r&&r.layerType==="deckgl"}class _k{constructor(){Wn(this,"_handlers",new Set)}add(e){this._handlers.add(e)}remove(e){this._handlers.delete(e)}handleClick(e){for(const t of this._handlers)t(e)}}function $y(r){let e;return t=>{if(t)for(let n in t){let l=e==null?void 0:e[n],u=t[n];l!==u&&r(n,u,l)}else if(e)for(let n in e)r(n,void 0,e[n]);e=t}}function yk(r,...e){let t=[r];for(let n of e)if(n)Array.isArray(n)&&n[0]===r?t.push(...n.slice(1)):t.push(n);else continue;if(t.length!==1)return t.length===2?t[1]:t}function vk(r){return r===!0?["has","point_count"]:r===!1?["!",["has","point_count"]]:void 0}function kc(r,e){return["case",["boolean",["feature-state","hover"],!1],e,r]}var rl=bk;function bk(r){var e,t,n;if(r){if(Array.isArray(r)){for(e=[],t=r.length,n=0;n{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function xk(r,e,t){let n,l,u,d,a,_,x,S,k,C,P,D,{$$slots:N={},$$scope:z}=e,{id:B=Dc("layer")}=e,{source:O=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:U=void 0}=e,{beforeLayerType:K=void 0}=e,{type:me}=e,{paint:X=void 0}=e,{layout:Y=void 0}=e,{filter:_e=void 0}=e,{applyToClusters:ze=void 0}=e,{minzoom:re=void 0}=e,{maxzoom:ce=void 0}=e,{manageHoverState:Ze=!1}=e,{hovered:Me=null}=e,{interactive:ht=!0}=e,{hoverCursor:It=void 0}=e,{eventsIfTopMost:Ot=!1}=e;const Ke=us(),{map:Kt,source:vt,self:Lt,minzoom:Vt,maxzoom:sr,eventTopMost:fr,layerInfo:er}=pk();wt(r,Kt,Re=>t(31,k=Re)),wt(r,vt,Re=>t(32,C=Re)),wt(r,Lt,Re=>t(0,S=Re)),wt(r,Vt,Re=>t(34,D=Re)),wt(r,sr,Re=>t(33,P=Re)),ti(()=>{S&&k&&(er.delete(S),k==null||k.removeLayer(S))});let Nt;function nr(Re){var ne,wr;if(!ht||!S||!k||Ot&&fr(Re)!==S)return;let st=Re.features??[],tt=(wr=(ne=st[0])==null?void 0:ne.properties)==null?void 0:wr.cluster_id,it={event:Re,map:k,clusterId:tt,layer:S,source:a,features:st};Ke(Re.type,it)}function tr(Re){var ne,wr;if(!ht||!S||!k||Ot&&fr(Re)!==S)return;It&&(k.getCanvas().style.cursor=It);let st=Re.features??[];t(6,Me=st[0]??null);let tt=(wr=(ne=st[0])==null?void 0:ne.properties)==null?void 0:wr.cluster_id;Ke("mouseenter",{event:Re,map:k,clusterId:tt,layer:S,source:a,features:st})}function Pr(Re){var ne,wr,We;if(!ht||!k)return;if(Ot&&fr(Re)!==S){t(6,Me=null),Ze&&Nt!==void 0&&(k==null||k.setFeatureState({source:a,sourceLayer:G,id:Nt},{hover:!1}),Nt=void 0);return}k.getCanvas().style.cursor=It;let st=Re.features??[],tt=(wr=(ne=st[0])==null?void 0:ne.properties)==null?void 0:wr.cluster_id,it=(We=st[0])==null?void 0:We.id;it!==Nt&&(Ze&&(Nt!==void 0&&(k==null||k.setFeatureState({source:a,id:Nt,sourceLayer:G},{hover:!1})),k==null||k.setFeatureState({source:a,id:it,sourceLayer:G},{hover:!0})),Nt=it,t(6,Me=st[0]??null)),Ke("mousemove",{event:Re,map:k,clusterId:tt,layer:S,source:a,features:st})}function pt(Re){if(!(!ht||!S||!k)){if(It&&(k.getCanvas().style.cursor=""),t(6,Me=null),Ze&&Nt!==void 0){const st={source:a,id:Nt,sourceLayer:G};k==null||k.setFeatureState(st,{hover:!1}),Nt=void 0}Ke("mouseleave",{map:k,layer:S,source:a})}}let Et=!0;function gr(Re){k&&(k.off("click",Re,nr),k.off("dblclick",Re,nr),k.off("contextmenu",Re,nr),k.off("mouseenter",Re,tr),k.off("mousemove",Re,Pr),k.off("mouseleave",Re,pt))}return ti(()=>{k&&S&&gr(S)}),r.$$set=Re=>{"id"in Re&&t(7,B=Re.id),"source"in Re&&t(8,O=Re.source),"sourceLayer"in Re&&t(9,G=Re.sourceLayer),"beforeId"in Re&&t(10,U=Re.beforeId),"beforeLayerType"in Re&&t(11,K=Re.beforeLayerType),"type"in Re&&t(12,me=Re.type),"paint"in Re&&t(13,X=Re.paint),"layout"in Re&&t(14,Y=Re.layout),"filter"in Re&&t(15,_e=Re.filter),"applyToClusters"in Re&&t(16,ze=Re.applyToClusters),"minzoom"in Re&&t(17,re=Re.minzoom),"maxzoom"in Re&&t(18,ce=Re.maxzoom),"manageHoverState"in Re&&t(19,Ze=Re.manageHoverState),"hovered"in Re&&t(6,Me=Re.hovered),"interactive"in Re&&t(20,ht=Re.interactive),"hoverCursor"in Re&&t(21,It=Re.hoverCursor),"eventsIfTopMost"in Re&&t(22,Ot=Re.eventsIfTopMost),"$$scope"in Re&&t(35,z=Re.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&65536&&t(30,n=vk(ze)),r.$$.dirty[0]&1073774592&&t(24,l=yk("all",n,_e)),r.$$.dirty[0]&131072|r.$$.dirty[1]&8&&t(26,u=re??D),r.$$.dirty[0]&262144|r.$$.dirty[1]&4&&t(25,d=ce??P),r.$$.dirty[0]&256|r.$$.dirty[1]&2&&t(29,a=O||C),r.$$.dirty[0]&654343809|r.$$.dirty[1]&1&&k&&S!==B&&a){S&&(gr(S),er.delete(S));let Re=U;if(!U&&K){let st=k.getStyle().layers,tt=typeof K=="function"?K:ne=>ne.type===K,it=st==null?void 0:st.find(tt);it&&(Re=it.id)}Rt(Lt,S=B,S),k.addLayer(rl({id:S,type:me,source:a,"source-layer":G,filter:l,paint:X,layout:Y,minzoom:u,maxzoom:d}),Re),t(23,Et=!0),k.on("click",S,nr),k.on("dblclick",S,nr),k.on("contextmenu",S,nr),k.on("mouseenter",S,tr),k.on("mousemove",S,Pr),k.on("mouseleave",S,pt)}r.$$.dirty[0]&1048577&&S&&er.set(S,{interactive:ht}),r.$$.dirty[0]&1|r.$$.dirty[1]&1&&t(28,_=S?$y((Re,st)=>{k!=null&&k.style._loaded?k.setPaintProperty(S,Re,st):k==null||k.once("styledata",()=>k==null?void 0:k.setPaintProperty(S,Re,st))}):void 0),r.$$.dirty[0]&1|r.$$.dirty[1]&1&&t(27,x=S?$y((Re,st)=>{k!=null&&k.style._loaded?k.setLayoutProperty(S,Re,st):k==null||k.once("styledata",()=>k==null?void 0:k.setLayoutProperty(S,Re,st))}):void 0),r.$$.dirty[0]&268443648&&(_==null||_(X)),r.$$.dirty[0]&134234112&&(x==null||x(Y)),r.$$.dirty[0]&100663297|r.$$.dirty[1]&1&&S&&(k==null||k.setLayerZoomRange(S,u,d)),r.$$.dirty[0]&25165825|r.$$.dirty[1]&1&&S&&(Et?t(23,Et=!1):k==null||k.setFilter(S,l))},[S,Kt,vt,Lt,Vt,sr,Me,B,O,G,U,K,me,X,Y,_e,ze,re,ce,Ze,ht,It,Ot,Et,l,d,u,x,_,a,n,k,C,P,D,z,N]}let Bd=class extends Ht{constructor(e){super(),Zt(this,e,xk,wk,jt,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}};function Sk(r){let e;const t=r[16].default,n=Vr(t,r,r[24],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&16777216)&&Gr(n,t,l,l[24],e?qr(t,l[24],u,null):Wr(l[24]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function kk(r){let e,t,n;function l(d){r[17](d)}let u={id:r[1],type:"circle",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],applyToClusters:r[9],minzoom:r[10],maxzoom:r[11],hoverCursor:r[12],manageHoverState:r[13],eventsIfTopMost:r[14],interactive:r[15],$$slots:{default:[Sk]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new Bd({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[18]),e.$on("dblclick",r[19]),e.$on("contextmenu",r[20]),e.$on("mouseenter",r[21]),e.$on("mousemove",r[22]),e.$on("mouseleave",r[23]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.applyToClusters=d[9]),a&1024&&(_.minzoom=d[10]),a&2048&&(_.maxzoom=d[11]),a&4096&&(_.hoverCursor=d[12]),a&8192&&(_.manageHoverState=d[13]),a&16384&&(_.eventsIfTopMost=d[14]),a&32768&&(_.interactive=d[15]),a&16777216&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function Tk(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Dc("circle")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{applyToClusters:P=void 0}=e,{minzoom:D=void 0}=e,{maxzoom:N=void 0}=e,{hoverCursor:z=void 0}=e,{manageHoverState:B=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:U=!0}=e;function K(ce){O=ce,t(0,O)}function me(ce){ur.call(this,r,ce)}function X(ce){ur.call(this,r,ce)}function Y(ce){ur.call(this,r,ce)}function _e(ce){ur.call(this,r,ce)}function ze(ce){ur.call(this,r,ce)}function re(ce){ur.call(this,r,ce)}return r.$$set=ce=>{"id"in ce&&t(1,u=ce.id),"source"in ce&&t(2,d=ce.source),"sourceLayer"in ce&&t(3,a=ce.sourceLayer),"beforeId"in ce&&t(4,_=ce.beforeId),"beforeLayerType"in ce&&t(5,x=ce.beforeLayerType),"paint"in ce&&t(6,S=ce.paint),"layout"in ce&&t(7,k=ce.layout),"filter"in ce&&t(8,C=ce.filter),"applyToClusters"in ce&&t(9,P=ce.applyToClusters),"minzoom"in ce&&t(10,D=ce.minzoom),"maxzoom"in ce&&t(11,N=ce.maxzoom),"hoverCursor"in ce&&t(12,z=ce.hoverCursor),"manageHoverState"in ce&&t(13,B=ce.manageHoverState),"hovered"in ce&&t(0,O=ce.hovered),"eventsIfTopMost"in ce&&t(14,G=ce.eventsIfTopMost),"interactive"in ce&&t(15,U=ce.interactive),"$$scope"in ce&&t(24,l=ce.$$scope)},[O,u,d,a,_,x,S,k,C,P,D,N,z,B,G,U,n,K,me,X,Y,_e,ze,re,l]}let Lg=class extends Ht{constructor(e){super(),Zt(this,e,Tk,kk,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}};function Ek(r){let e;const t=r[15].default,n=Vr(t,r,r[23],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&8388608)&&Gr(n,t,l,l[23],e?qr(t,l[23],u,null):Wr(l[23]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function Mk(r){let e,t,n;function l(d){r[16](d)}let u={id:r[1],type:"fill",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],minzoom:r[9],maxzoom:r[10],hoverCursor:r[11],manageHoverState:r[12],eventsIfTopMost:r[13],interactive:r[14],$$slots:{default:[Ek]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new Bd({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[17]),e.$on("dblclick",r[18]),e.$on("contextmenu",r[19]),e.$on("mouseenter",r[20]),e.$on("mousemove",r[21]),e.$on("mouseleave",r[22]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.minzoom=d[9]),a&1024&&(_.maxzoom=d[10]),a&2048&&(_.hoverCursor=d[11]),a&4096&&(_.manageHoverState=d[12]),a&8192&&(_.eventsIfTopMost=d[13]),a&16384&&(_.interactive=d[14]),a&8388608&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function Ck(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Dc("fill")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{minzoom:P=void 0}=e,{maxzoom:D=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:z=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(re){B=re,t(0,B)}function K(re){ur.call(this,r,re)}function me(re){ur.call(this,r,re)}function X(re){ur.call(this,r,re)}function Y(re){ur.call(this,r,re)}function _e(re){ur.call(this,r,re)}function ze(re){ur.call(this,r,re)}return r.$$set=re=>{"id"in re&&t(1,u=re.id),"source"in re&&t(2,d=re.source),"sourceLayer"in re&&t(3,a=re.sourceLayer),"beforeId"in re&&t(4,_=re.beforeId),"beforeLayerType"in re&&t(5,x=re.beforeLayerType),"paint"in re&&t(6,S=re.paint),"layout"in re&&t(7,k=re.layout),"filter"in re&&t(8,C=re.filter),"minzoom"in re&&t(9,P=re.minzoom),"maxzoom"in re&&t(10,D=re.maxzoom),"hoverCursor"in re&&t(11,N=re.hoverCursor),"manageHoverState"in re&&t(12,z=re.manageHoverState),"hovered"in re&&t(0,B=re.hovered),"eventsIfTopMost"in re&&t(13,O=re.eventsIfTopMost),"interactive"in re&&t(14,G=re.interactive),"$$scope"in re&&t(23,l=re.$$scope)},[B,u,d,a,_,x,S,k,C,P,D,N,z,O,G,n,U,K,me,X,Y,_e,ze,l]}let ma=class extends Ht{constructor(e){super(),Zt(this,e,Ck,Mk,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}};function Ik(r,e,t){let n;const{map:l}=nl();wt(r,l,_=>t(4,n=_));let{position:u="top-left"}=e,{container:d=void 0}=e,a=null;return ti(()=>{n!=null&&n.loaded()&&a&&n.removeControl(a)}),r.$$set=_=>{"position"in _&&t(1,u=_.position),"container"in _&&t(2,d=_.container)},r.$$.update=()=>{if(r.$$.dirty&30&&n&&!a){let _;typeof d=="string"?_=document.querySelector(d)??void 0:_=d,t(3,a=new to.FullscreenControl({container:_})),n.addControl(a,u)}},[l,u,d,a,n]}class Ak extends Ht{constructor(e){super(),Zt(this,e,Ik,null,jt,{position:1,container:2})}}function Lk(r,e,t,n,l){let u=!1;r.getSource(e)&&(u=!0,r.removeSource(e));const d=()=>{n(e)&&(r.addSource(e,t),l())};if(u){const a=()=>{e&&(r.getSource(e)?setTimeout(a,1):d())};a()}else d()}function Pk(r,e,t){Lb().then(()=>{let n=Hi(r);if(!n)return;n.getSource(e)===t&&n.removeSource(e)})}function Jy(r){let e=r[0],t,n,l=Yy(r);return{c(){l.c(),t=$n()},m(u,d){l.m(u,d),be(u,t,d),n=!0},p(u,d){d&1&&jt(e,e=u[0])?(vr(),de(l,1,1,Ct),br(),l=Yy(u),l.c(),oe(l,1),l.m(t.parentNode,t)):l.p(u,d)},i(u){n||(oe(l),n=!0)},o(u){de(l),n=!1},d(u){u&&ve(t),l.d(u)}}}function Yy(r){let e;const t=r[19].default,n=Vr(t,r,r[18],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&262144)&&Gr(n,t,l,l[18],e?qr(t,l[18],u,null):Wr(l[18]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function zk(r){let e,t,n=r[0]&&Jy(r);return{c(){n&&n.c(),e=$n()},m(l,u){n&&n.m(l,u),be(l,e,u),t=!0},p(l,[u]){l[0]?n?(n.p(l,u),u&1&&oe(n,1)):(n=Jy(l),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function Dk(r,e,t){let n,l,u,{$$slots:d={},$$scope:a}=e,{id:_=Dc("geojson")}=e,{data:x}=e,{generateId:S=!1}=e,{promoteId:k=void 0}=e,{filter:C=void 0}=e,{lineMetrics:P=void 0}=e,{cluster:D=void 0}=e,{maxzoom:N=void 0}=e,{attribution:z=void 0}=e,{buffer:B=void 0}=e,{tolerance:O=void 0}=e;const{map:G,cluster:U,self:K}=dk();wt(r,G,Y=>t(17,l=Y)),wt(r,U,Y=>t(20,u=Y)),wt(r,K,Y=>t(0,n=Y));let me,X=!0;return ti(()=>{n&&me&&l&&(Pk(G,n,me),Rt(K,n=null,n),t(15,me=void 0))}),r.$$set=Y=>{"id"in Y&&t(4,_=Y.id),"data"in Y&&t(5,x=Y.data),"generateId"in Y&&t(6,S=Y.generateId),"promoteId"in Y&&t(7,k=Y.promoteId),"filter"in Y&&t(8,C=Y.filter),"lineMetrics"in Y&&t(9,P=Y.lineMetrics),"cluster"in Y&&t(10,D=Y.cluster),"maxzoom"in Y&&t(11,N=Y.maxzoom),"attribution"in Y&&t(12,z=Y.attribution),"buffer"in Y&&t(13,B=Y.buffer),"tolerance"in Y&&t(14,O=Y.tolerance),"$$scope"in Y&&t(18,a=Y.$$scope)},r.$$.update=()=>{r.$$.dirty&1024&&Rt(U,u=D,u),r.$$.dirty&196593&&l&&n!==_&&(Rt(K,n=_,n),Lk(l,n,rl({type:"geojson",data:x,filter:C,lineMetrics:P,generateId:S,promoteId:k,cluster:!!D,clusterMinPoints:D==null?void 0:D.minPoints,clusterMaxZoom:D==null?void 0:D.maxZoom,clusterRadius:D==null?void 0:D.radius,clusterProperties:D==null?void 0:D.properties,maxzoom:N,attribution:z,buffer:B,tolerance:O}),Y=>l&&Y===n,()=>{n&&(t(15,me=l==null?void 0:l.getSource(n)),t(16,X=!0))})),r.$$.dirty&131088&&(l==null||l.on("style.load",()=>{t(15,me=l==null?void 0:l.getSource(_))})),r.$$.dirty&98336&&me&&(X?t(16,X=!1):me.setData(x)),r.$$.dirty&33792&&(me==null||me.setClusterOptions(rl({cluster:!!D,clusterMaxZoom:D==null?void 0:D.maxZoom,clusterRadius:D==null?void 0:D.radius})))},[n,G,U,K,_,x,S,k,C,P,D,N,z,B,O,me,X,l,a,d]}let Pi=class extends Ht{constructor(e){super(),Zt(this,e,Dk,zk,jt,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10,maxzoom:11,attribution:12,buffer:13,tolerance:14})}};function Rk(r,e,t){let n;const{map:l}=nl();wt(r,l,C=>t(8,n=C));let{position:u="top-left"}=e,{positionOptions:d=void 0}=e,{fitBoundsOptions:a=void 0}=e,{trackUserLocation:_=!1}=e,{showAccuracyCircle:x=!0}=e,{showUserLocation:S=!0}=e,{control:k=null}=e;return ti(()=>{n!=null&&n.loaded()&&k&&n.removeControl(k)}),r.$$set=C=>{"position"in C&&t(2,u=C.position),"positionOptions"in C&&t(3,d=C.positionOptions),"fitBoundsOptions"in C&&t(4,a=C.fitBoundsOptions),"trackUserLocation"in C&&t(5,_=C.trackUserLocation),"showAccuracyCircle"in C&&t(6,x=C.showAccuracyCircle),"showUserLocation"in C&&t(7,S=C.showUserLocation),"control"in C&&t(1,k=C.control)},r.$$.update=()=>{r.$$.dirty&510&&n&&!k&&(t(1,k=new to.GeolocateControl({positionOptions:d,fitBoundsOptions:a,trackUserLocation:_,showAccuracyCircle:x,showUserLocation:S})),n.addControl(k,u))},[l,k,u,d,a,_,x,S,n]}class Bk extends Ht{constructor(e){super(),Zt(this,e,Rk,null,jt,{position:2,positionOptions:3,fitBoundsOptions:4,trackUserLocation:5,showAccuracyCircle:6,showUserLocation:7,control:1})}}function Fk(r){let e;const t=r[15].default,n=Vr(t,r,r[23],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&8388608)&&Gr(n,t,l,l[23],e?qr(t,l[23],u,null):Wr(l[23]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function Ok(r){let e,t,n;function l(d){r[16](d)}let u={id:r[1],type:"line",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],minzoom:r[9],maxzoom:r[10],hoverCursor:r[11],manageHoverState:r[12],eventsIfTopMost:r[13],interactive:r[14],$$slots:{default:[Fk]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new Bd({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[17]),e.$on("dblclick",r[18]),e.$on("contextmenu",r[19]),e.$on("mouseenter",r[20]),e.$on("mousemove",r[21]),e.$on("mouseleave",r[22]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.minzoom=d[9]),a&1024&&(_.maxzoom=d[10]),a&2048&&(_.hoverCursor=d[11]),a&4096&&(_.manageHoverState=d[12]),a&8192&&(_.eventsIfTopMost=d[13]),a&16384&&(_.interactive=d[14]),a&8388608&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function Nk(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Dc("line")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{minzoom:P=void 0}=e,{maxzoom:D=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:z=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(re){B=re,t(0,B)}function K(re){ur.call(this,r,re)}function me(re){ur.call(this,r,re)}function X(re){ur.call(this,r,re)}function Y(re){ur.call(this,r,re)}function _e(re){ur.call(this,r,re)}function ze(re){ur.call(this,r,re)}return r.$$set=re=>{"id"in re&&t(1,u=re.id),"source"in re&&t(2,d=re.source),"sourceLayer"in re&&t(3,a=re.sourceLayer),"beforeId"in re&&t(4,_=re.beforeId),"beforeLayerType"in re&&t(5,x=re.beforeLayerType),"paint"in re&&t(6,S=re.paint),"layout"in re&&t(7,k=re.layout),"filter"in re&&t(8,C=re.filter),"minzoom"in re&&t(9,P=re.minzoom),"maxzoom"in re&&t(10,D=re.maxzoom),"hoverCursor"in re&&t(11,N=re.hoverCursor),"manageHoverState"in re&&t(12,z=re.manageHoverState),"hovered"in re&&t(0,B=re.hovered),"eventsIfTopMost"in re&&t(13,O=re.eventsIfTopMost),"interactive"in re&&t(14,G=re.interactive),"$$scope"in re&&t(23,l=re.$$scope)},[B,u,d,a,_,x,S,k,C,P,D,N,z,O,G,n,U,K,me,X,Y,_e,ze,l]}let cs=class extends Ht{constructor(e){super(),Zt(this,e,Nk,Ok,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}};function jk(r,e,t){let n;const l=us();let{layer:u=void 0}=e;const{map:d}=nl();wt(r,d,S=>t(2,n=S));function a(S){l(S.type,{...S,map:d})}const _=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],x=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return ti(()=>{if(n)if(u)for(const S of _)n.off(S,u,a);else for(const S of x)n.off(S,a)}),r.$$set=S=>{"layer"in S&&t(1,u=S.layer)},r.$$.update=()=>{if(r.$$.dirty&6&&n)if(u)for(const S of _)n.on(S,u,a);else for(const S of x)n.on(S,a)},[d,u,n]}class Uk extends Ht{constructor(e){super(),Zt(this,e,jk,null,jt,{layer:1})}}function Vk(r){let e=r.getCenter(),t=Math.round(r.getZoom()*100)/100,n=Math.ceil((t*Math.LN2+Math.log(512/360/.5))/Math.LN10),l=Math.pow(10,n),u=Math.round(e.lat*l)/l,d=Math.round(e.lng*l)/l,a=`${t}/${u}/${d}`,_=r.getBearing(),x=r.getPitch();return(_||x)&&(a+=`/${Math.round(_*10)/10}`),x&&(a+=`/${Math.round(x)}`),`#${a}`}function qk(r){return r.replace("#","").split("/").map(parseFloat)}var sc=Pg;function Pg(r,e){return r===e||r!==r&&e!==e?!0:typeof r!=typeof e||{}.toString.call(r)!={}.toString.call(e)||r!==Object(r)||!r?!1:Array.isArray(r)?Qy(r,e):{}.toString.call(r)=="[object Set]"?Qy(Array.from(r),Array.from(e)):{}.toString.call(r)=="[object Object]"?Wk(r,e):Gk(r,e)}function Gk(r,e){return r.toString()===e.toString()}function Qy(r,e){var t=r.length;if(t!=e.length)return!1;for(var n=0;nt(6,n=S));let{position:u="top-left"}=e,{showCompass:d=!0}=e,{showZoom:a=!0}=e,{visualizePitch:_=!1}=e,x=null;return ti(()=>{n!=null&&n.loaded()&&x&&n.removeControl(x)}),r.$$set=S=>{"position"in S&&t(1,u=S.position),"showCompass"in S&&t(2,d=S.showCompass),"showZoom"in S&&t(3,a=S.showZoom),"visualizePitch"in S&&t(4,_=S.visualizePitch)},r.$$.update=()=>{r.$$.dirty&126&&n&&!x&&(t(5,x=new to.NavigationControl({showCompass:d,showZoom:a,visualizePitch:_})),n.addControl(x,u))},[l,u,d,a,_,x,n]}class Hk extends Ht{constructor(e){super(),Zt(this,e,Zk,null,jt,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function $k(r,e,t){let n;const{map:l}=nl();wt(r,l,x=>t(5,n=x));let{position:u="bottom-left"}=e,{maxWidth:d=void 0}=e,{unit:a="metric"}=e,_=null;return ti(()=>{n!=null&&n.loaded()&&_&&n.removeControl(_)}),r.$$set=x=>{"position"in x&&t(1,u=x.position),"maxWidth"in x&&t(2,d=x.maxWidth),"unit"in x&&t(3,a=x.unit)},r.$$.update=()=>{r.$$.dirty&62&&n&&!_&&(t(4,_=new to.ScaleControl({maxWidth:d,unit:a})),n.addControl(_,u))},[l,u,d,a,_,n]}class Xk extends Ht{constructor(e){super(),Zt(this,e,$k,null,jt,{position:1,maxWidth:2,unit:3})}}const{window:Kk}=Ad,Jk=r=>({map:r[0]&16,loadedImages:r[0]&32,allImagesLoaded:r[0]&64}),e0=r=>({map:r[4],loadedImages:r[5],allImagesLoaded:r[6]});function t0(r){let e,t,n=r[3]&&r0(r);const l=r[46].default,u=Vr(l,r,r[45],e0);return{c(){n&&n.c(),e=Ve(),u&&u.c()},m(d,a){n&&n.m(d,a),be(d,e,a),u&&u.m(d,a),t=!0},p(d,a){d[3]?n?(n.p(d,a),a[0]&8&&oe(n,1)):(n=r0(d),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br()),u&&u.p&&(!t||a[0]&112|a[1]&16384)&&Gr(u,l,d,d[45],t?qr(l,d[45],a,Jk):Wr(d[45]),e0)},i(d){t||(oe(n),oe(u,d),t=!0)},o(d){de(n),de(u,d),t=!1},d(d){d&&ve(e),n&&n.d(d),u&&u.d(d)}}}function r0(r){let e,t,n,l,u,d,a,_;return e=new Hk({props:{position:r[7]}}),n=new Bk({props:{position:r[7],fitBoundsOptions:{maxZoom:12}}}),u=new Ak({props:{position:r[7]}}),a=new Xk({props:{position:r[7]}}),{c(){je(e.$$.fragment),t=Ve(),je(n.$$.fragment),l=Ve(),je(u.$$.fragment),d=Ve(),je(a.$$.fragment)},m(x,S){Oe(e,x,S),be(x,t,S),Oe(n,x,S),be(x,l,S),Oe(u,x,S),be(x,d,S),Oe(a,x,S),_=!0},p(x,S){const k={};S[0]&128&&(k.position=x[7]),e.$set(k);const C={};S[0]&128&&(C.position=x[7]),n.$set(C);const P={};S[0]&128&&(P.position=x[7]),u.$set(P);const D={};S[0]&128&&(D.position=x[7]),a.$set(D)},i(x){_||(oe(e.$$.fragment,x),oe(n.$$.fragment,x),oe(u.$$.fragment,x),oe(a.$$.fragment,x),_=!0)},o(x){de(e.$$.fragment,x),de(n.$$.fragment,x),de(u.$$.fragment,x),de(a.$$.fragment,x),_=!1},d(x){x&&(ve(t),ve(l),ve(d)),Ne(e,x),Ne(n,x),Ne(u,x),Ne(a,x)}}}function Yk(r){let e,t,n,l,u,d=r[4]&&r[0]&&t0(r);return{c(){e=fe("div"),d&&d.c(),Ee(e,"class",t=od(r[2])+" svelte-p00lfq"),Ee(e,"data-testid","map-container"),hi(e,"expand-map",!r[2])},m(a,_){be(a,e,_),d&&d.m(e,null),r[47](e),n=!0,l||(u=[Tt(Kk,"hashchange",r[11]),Mm(r[10].call(null,e))],l=!0)},p(a,_){a[4]&&a[0]?d?(d.p(a,_),_[0]&17&&oe(d,1)):(d=t0(a),d.c(),oe(d,1),d.m(e,null)):d&&(vr(),de(d,1,1,()=>{d=null}),br()),(!n||_[0]&4&&t!==(t=od(a[2])+" svelte-p00lfq"))&&Ee(e,"class",t),(!n||_[0]&4)&&hi(e,"expand-map",!a[2])},i(a){n||(oe(d),n=!0)},o(a){de(d),n=!1},d(a){a&&ve(e),d&&d.d(),r[47](null),l=!1,_n(u)}}}function Qk(r,e,t){let n,l,u,d,{$$slots:a={},$$scope:_}=e,{map:x=null}=e,{mapContainer:S=void 0}=e,{class:k=void 0}=e,{style:C}=e,{diffStyleUpdates:P=!1}=e,{center:D=void 0}=e,{zoom:N=void 0}=e,{pitch:z=0}=e,{bearing:B=0}=e,{bounds:O=void 0}=e,{hash:G=!1}=e,{updateHash:U=We=>{window.history.replaceState(window.history.state,"",We)}}=e,{loaded:K=!1}=e,{minZoom:me=0}=e,{maxZoom:X=22}=e,{minPitch:Y=0}=e,{maxPitch:_e=60}=e,{renderWorldCopies:ze=void 0}=e,{dragPan:re=void 0}=e,{dragRotate:ce=void 0}=e,{pitchWithRotate:Ze=void 0}=e,{antialias:Me=void 0}=e,{zoomOnDoubleClick:ht=!0}=e,{locale:It=void 0}=e,{interactive:Ot=!0}=e,{attributionControl:Ke=!0}=e,{cooperativeGestures:Kt=!1}=e,{preserveDrawingBuffer:vt=!1}=e,{maxBounds:Lt=void 0}=e,{images:Vt=[]}=e,{standardControls:sr=!1}=e,{filterLayers:fr=void 0}=e,{transformRequest:er=void 0}=e;const Nt=us(),{map:nr,loadedImages:tr}=fk();wt(r,nr,We=>t(4,u=We)),wt(r,tr,We=>t(5,d=We));let Pr=new Set;async function pt(We,Ye=!1){if(u&&!(!u.loaded()&&!Ye))if("url"in We){Pr.add(We.id);try{let Ut=await u.loadImage(We.url);u==null||u.addImage(We.id,Ut.data,We.options),d.add(We.id),tr.set(d)}catch(Ut){Nt("error",Ut)}finally{Pr.delete(We.id)}}else u.addImage(We.id,We.data,We.options),d.add(We.id),tr.set(d)}let Et,gr,Re,st;function tt(We){return ne(),Rt(nr,u=new to.Map(rl({container:We,style:C,locale:It,center:D,zoom:N,pitch:z,bearing:B,minZoom:me,maxZoom:X,minPitch:Y,maxPitch:_e,renderWorldCopies:ze,dragPan:re,dragRotate:ce,pitchWithRotate:Ze,antialias:Me,interactive:Ot,preserveDrawingBuffer:vt,maxBounds:Lt,bounds:O,attributionControl:Ke,transformRequest:er,cooperativeGestures:Kt})),u),u.on("load",Ye=>{Ye.target.getContainer().setAttribute("data-testid","map"),Ye.target.getCanvas().setAttribute("data-testid","map-canvas"),t(0,K=!0),Nt("load",u)}),u.on("error",Ye=>Nt("error",{...Ye,map:u})),u.on("movestart",Ye=>Nt("movestart",{...Ye,map:u})),u.on("moveend",Ye=>{if(t(12,D=Ye.target.getCenter()),t(13,N=Ye.target.getZoom()),t(14,z=Ye.target.getPitch()),t(15,B=Ye.target.getBearing()),t(16,O=Ye.target.getBounds()),Nt("moveend",{...Ye,map:u}),G){let Ut=new URL(window.location.href.replace(/(#.+)?$/,Vk(u)));U(Ut)}}),u.on("click",Ye=>Nt("click",{...Ye,map:u})),u.on("dblclick",Ye=>Nt("dblclick",{...Ye,map:u})),u.on("contextmenu",Ye=>Nt("contextmenu",{...Ye,map:u})),u.on("zoomstart",Ye=>Nt("zoomstart",{...Ye,map:u})),u.on("zoom",Ye=>{Nt("zoom",{...Ye,map:u})}),u.on("zoomend",Ye=>{Nt("zoomend",{...Ye,map:u})}),u.on("style.load",()=>{if(u){const Ye=u.getStyle();if(t(42,Et=Ye.layers.map(Ut=>Ut.id)),t(43,gr=Object.keys(Ye.sources)),st)for(const[Ut,bn]of Object.entries(st))u.addSource(Ut,bn);if(Re)for(const Ut of Re)u.addLayer(Ut);for(const Ut of Vt)pt(Ut,!0)}}),u.on("styledata",Ye=>{if(u&&fr){const Ut=u.getStyle().layers;if(Ut)for(let bn of Ut)fr(bn)||u.setLayoutProperty(bn.id,"visibility","none")}Nt("styledata",{...Ye,map:u})}),{destroy(){t(0,K=!1),u==null||u.remove(),Rt(nr,u=null,u)}}}let it=C;function ne(){if(G){let We=qk(window.location.hash);We.length>=3&&(t(13,N=We[0]),t(12,D=[We[2],We[1]])),We.length==5&&(t(15,B=We[3]),t(14,z=We[4]))}}function wr(We){pn[We?"unshift":"push"](()=>{S=We,t(1,S)})}return r.$$set=We=>{"map"in We&&t(17,x=We.map),"mapContainer"in We&&t(1,S=We.mapContainer),"class"in We&&t(2,k=We.class),"style"in We&&t(18,C=We.style),"diffStyleUpdates"in We&&t(19,P=We.diffStyleUpdates),"center"in We&&t(12,D=We.center),"zoom"in We&&t(13,N=We.zoom),"pitch"in We&&t(14,z=We.pitch),"bearing"in We&&t(15,B=We.bearing),"bounds"in We&&t(16,O=We.bounds),"hash"in We&&t(20,G=We.hash),"updateHash"in We&&t(21,U=We.updateHash),"loaded"in We&&t(0,K=We.loaded),"minZoom"in We&&t(22,me=We.minZoom),"maxZoom"in We&&t(23,X=We.maxZoom),"minPitch"in We&&t(24,Y=We.minPitch),"maxPitch"in We&&t(25,_e=We.maxPitch),"renderWorldCopies"in We&&t(26,ze=We.renderWorldCopies),"dragPan"in We&&t(27,re=We.dragPan),"dragRotate"in We&&t(28,ce=We.dragRotate),"pitchWithRotate"in We&&t(29,Ze=We.pitchWithRotate),"antialias"in We&&t(30,Me=We.antialias),"zoomOnDoubleClick"in We&&t(31,ht=We.zoomOnDoubleClick),"locale"in We&&t(32,It=We.locale),"interactive"in We&&t(33,Ot=We.interactive),"attributionControl"in We&&t(34,Ke=We.attributionControl),"cooperativeGestures"in We&&t(35,Kt=We.cooperativeGestures),"preserveDrawingBuffer"in We&&t(36,vt=We.preserveDrawingBuffer),"maxBounds"in We&&t(37,Lt=We.maxBounds),"images"in We&&t(38,Vt=We.images),"standardControls"in We&&t(3,sr=We.standardControls),"filterLayers"in We&&t(39,fr=We.filterLayers),"transformRequest"in We&&t(40,er=We.transformRequest),"$$scope"in We&&t(45,_=We.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&8&&t(7,n=typeof sr=="boolean"?void 0:sr),r.$$.dirty[0]&16&&t(17,x=u),r.$$.dirty[0]&786448|r.$$.dirty[1]&14336&&u&&!sc(C,it)){const We=u.getStyle();if(Et&&(Re=We.layers.filter(Ye=>!Et.includes(Ye.id))),gr){const Ye=Object.keys(We.sources).filter(Ut=>!gr.includes(Ut));st={};for(const Ut of Ye)st[Ut]=We.sources[Ut]}t(44,it=C),u.setStyle(C,{diff:P}),Rt(tr,d=new Set,d),t(41,Pr=new Set)}if(r.$$.dirty[0]&49|r.$$.dirty[1]&1152&&K&&u!=null&&u.loaded())for(let We of Vt)!d.has(We.id)&&!Pr.has(We.id)&&!u.hasImage(We.id)&&pt(We);if(r.$$.dirty[0]&32|r.$$.dirty[1]&128&&t(6,l=Vt.every(We=>d.has(We.id))),r.$$.dirty[0]&61456&&u){let We={};D!=null&&!sc(D,u==null?void 0:u.getCenter())&&(We.center=D),N!=null&&!sc(N,u==null?void 0:u.getZoom())&&(We.zoom=N),B!=null&&!sc(B,u==null?void 0:u.getBearing())&&(We.bearing=B),z!=null&&!sc(z,u==null?void 0:u.getPitch())&&(We.pitch=z),Object.keys(We).length&&u.easeTo(We)}r.$$.dirty[0]&65552&&O&&!sc(O,u==null?void 0:u.getBounds())&&(u==null||u.fitBounds(O)),r.$$.dirty[0]&16|r.$$.dirty[1]&1&&(ht?u==null||u.doubleClickZoom.enable():u==null||u.doubleClickZoom.disable())},[K,S,k,sr,u,d,l,n,nr,tr,tt,ne,D,N,z,B,O,x,C,P,G,U,me,X,Y,_e,ze,re,ce,Ze,Me,ht,It,Ot,Ke,Kt,vt,Lt,Vt,fr,er,Pr,Et,gr,it,_,a,wr]}class e3 extends Ht{constructor(e){super(),Zt(this,e,Qk,Yk,jt,{map:17,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:14,bearing:15,bounds:16,hash:20,updateHash:21,loaded:0,minZoom:22,maxZoom:23,minPitch:24,maxPitch:25,renderWorldCopies:26,dragPan:27,dragRotate:28,pitchWithRotate:29,antialias:30,zoomOnDoubleClick:31,locale:32,interactive:33,attributionControl:34,cooperativeGestures:35,preserveDrawingBuffer:36,maxBounds:37,images:38,standardControls:3,filterLayers:39,transformRequest:40},null,[-1,-1])}}const t3=r=>({marker:r&8}),n0=r=>({marker:r[3]});function r3(r){let e,t,n,l,u,d,a;const _=r[19].default,x=Vr(_,r,r[18],n0);return{c(){e=fe("div"),x&&x.c(),Ee(e,"tabindex",t=r[1]?0:void 0),Ee(e,"role",n=r[1]?"button":void 0),fn(e,"z-index",r[2])},m(S,k){be(S,e,k),x&&x.m(e,null),u=!0,d||(a=[Mm(r[7].call(null,e)),Mm(l=n3.call(null,e,r[0])),Tt(e,"click",Kp(r[20])),Tt(e,"dblclick",Kp(r[21])),Tt(e,"contextmenu",Kp(vg(r[22]))),Tt(e,"mouseenter",r[23]),Tt(e,"mouseleave",r[24]),Tt(e,"mousemove",r[25]),Tt(e,"keydown",r[8])],d=!0)},p(S,[k]){x&&x.p&&(!u||k&262152)&&Gr(x,_,S,S[18],u?qr(_,S[18],k,t3):Wr(S[18]),n0),(!u||k&2&&t!==(t=S[1]?0:void 0))&&Ee(e,"tabindex",t),(!u||k&2&&n!==(n=S[1]?"button":void 0))&&Ee(e,"role",n),l&&wc(l.update)&&k&1&&l.update.call(null,S[0]),k&4&&fn(e,"z-index",S[2])},i(S){u||(oe(x,S),u=!0)},o(S){de(x,S),u=!1},d(S){S&&ve(e),x&&x.d(S),d=!1,_n(a)}}}function n3(r,e){const t=r.className;function n(l){l?r.className=`${t} ${l}`:r.className=t}return n(e),{update:n}}function i3(r,e,t){let n,l,u,{$$slots:d={},$$scope:a}=e,{marker:_=void 0}=e,{lngLat:x}=e,{class:S=void 0}=e,{interactive:k=!0}=e,{asButton:C=!1}=e,{draggable:P=!1}=e,{feature:D=null}=e,{offset:N=void 0}=e,{zIndex:z=void 0}=e,{rotation:B=0}=e,{opacity:O=1}=e;const G=us(),{map:U,layerEvent:K,self:me,markerClickManager:X}=mk();wt(r,U,Ke=>t(27,u=Ke)),wt(r,K,Ke=>t(26,n=Ke)),wt(r,me,Ke=>t(3,l=Ke));function Y(Ke){Rt(me,l=new to.Marker({element:Ke,rotation:B,draggable:P,offset:N,opacity:O.toString()}).setLngLat(x).addTo(u),l),t(11,_=l);const Kt=()=>re("dragstart"),vt=()=>{_e(),re("drag")},Lt=()=>{_e(),re("dragend")};return P&&(l.on("dragstart",Kt),l.on("drag",vt),l.on("dragend",Lt)),{destroy(){P&&(l==null||l.off("dragstart",Kt),l==null||l.off("drag",vt),l==null||l.off("dragend",Lt)),t(11,_=void 0),l==null||l.remove()}}}function _e(){let Ke=l==null?void 0:l.getLngLat();Ke&&(Array.isArray(x)?t(10,x=[Ke.lng,Ke.lat]):x&&"lon"in x?t(10,x={lon:Ke.lng,lat:Ke.lat}):t(10,x=Ke))}function ze(Ke){Ke.key===" "&&(Ke.preventDefault(),Ke.stopPropagation(),re("click"))}function re(Ke){if(!k)return;let Kt=l==null?void 0:l.getLngLat();if(!Kt)return;const vt=[Kt.lng,Kt.lat];let Lt={map:u,marker:l,lngLat:vt,features:[{type:"Feature",properties:(D==null?void 0:D.properties)??{},geometry:{type:"Point",coordinates:vt}}]};(Ke==="click"||Ke==="contextmenu")&&X.handleClick(Lt),Rt(K,n={...Lt,layerType:"marker",type:Ke},n),G(Ke,Lt)}const ce=()=>re("click"),Ze=()=>re("dblclick"),Me=()=>{re("contextmenu")},ht=()=>{re("mouseenter")},It=()=>{re("mouseleave")},Ot=()=>re("mousemove");return r.$$set=Ke=>{"marker"in Ke&&t(11,_=Ke.marker),"lngLat"in Ke&&t(10,x=Ke.lngLat),"class"in Ke&&t(0,S=Ke.class),"interactive"in Ke&&t(12,k=Ke.interactive),"asButton"in Ke&&t(1,C=Ke.asButton),"draggable"in Ke&&t(13,P=Ke.draggable),"feature"in Ke&&t(14,D=Ke.feature),"offset"in Ke&&t(15,N=Ke.offset),"zIndex"in Ke&&t(2,z=Ke.zIndex),"rotation"in Ke&&t(16,B=Ke.rotation),"opacity"in Ke&&t(17,O=Ke.opacity),"$$scope"in Ke&&t(18,a=Ke.$$scope)},r.$$.update=()=>{r.$$.dirty&1032&&(l==null||l.setLngLat(x)),r.$$.dirty&32776&&(l==null||l.setOffset(N??[0,0])),r.$$.dirty&65544&&(l==null||l.setRotation(B)),r.$$.dirty&131080&&(l==null||l.setOpacity(O.toString()))},[S,C,z,l,U,K,me,Y,ze,re,x,_,k,P,D,N,B,O,a,d,ce,Ze,Me,ht,It,Ot]}class fd extends Ht{constructor(e){super(),Zt(this,e,i3,r3,jt,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}const o3=r=>({features:r[0]&16,data:r[0]&16,map:r[0]&4,close:r[0]&1}),i0=r=>{var e;return{features:r[4],data:((e=r[4])==null?void 0:e[0])??null,map:r[2],close:r[31]}};function o0(r){var l;let e,t,n=(((l=r[4])==null?void 0:l.length)||r[3]instanceof to.Marker)&&s0(r);return{c(){e=fe("div"),n&&n.c()},m(u,d){be(u,e,d),n&&n.m(e,null),r[32](e),t=!0},p(u,d){var a;(a=u[4])!=null&&a.length||u[3]instanceof to.Marker?n?(n.p(u,d),d[0]&24&&oe(n,1)):(n=s0(u),n.c(),oe(n,1),n.m(e,null)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(u){t||(oe(n),t=!0)},o(u){de(n),t=!1},d(u){u&&ve(e),n&&n.d(),r[32](null)}}}function s0(r){let e;const t=r[30].default,n=Vr(t,r,r[29],i0);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u[0]&536870933)&&Gr(n,t,l,l[29],e?qr(t,l[29],u,o3):Wr(l[29]),i0)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function s3(r){let e,t,n=r[9].default&&o0(r);return{c(){n&&n.c(),e=$n()},m(l,u){n&&n.m(l,u),be(l,e,u),t=!0},p(l,u){l[9].default?n?(n.p(l,u),u[0]&512&&oe(n,1)):(n=o0(l),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function a3(r,e,t){let n,l,u,d,a,_,{$$slots:x={},$$scope:S}=e;const k=FS(x);let{closeButton:C=void 0}=e,{closeOnClickOutside:P=!0}=e,{closeOnClickInside:D=!1}=e,{closeOnMove:N=!1}=e,{openOn:z="click"}=e,{openIfTopMost:B=!0}=e,{focusAfterOpen:O=!0}=e,{anchor:G=void 0}=e,{offset:U=void 0}=e,{popupClass:K=void 0}=e,{maxWidth:me=void 0}=e,{lngLat:X=void 0}=e,{html:Y=void 0}=e,{open:_e=!1}=e;const ze=us(),{map:re,popupTarget:ce,layerEvent:Ze,layer:Me,eventTopMost:ht,markerClickManager:It}=nl();wt(r,re,ne=>t(2,u=ne)),wt(r,ce,ne=>t(3,a=ne)),wt(r,Ze,ne=>t(28,d=ne)),wt(r,Me,ne=>t(35,_=ne));const Ot=["click","dblclick","contextmenu"];let Ke,Kt=!1,vt;function Lt(){if(!Ke)return;let ne=Ke.getElement();!ne||ne===vt||(vt=ne,z==="hover"&&(vt.style.pointerEvents="none"),vt.addEventListener("mouseenter",()=>{t(24,Kt=!0)},{passive:!0}),vt.addEventListener("mouseleave",()=>{t(24,Kt=!1)},{passive:!0}),vt.addEventListener("click",()=>{D&&t(0,_e=!1)},{passive:!0}))}Ld(()=>{if(u)return u.on("click",gr),u.on("contextmenu",gr),It.add(Re),typeof a=="string"&&(u.on("click",a,Nt),u.on("dblclick",a,Nt),u.on("contextmenu",a,Nt),u.on("mousemove",a,Et),u.on("mouseleave",a,pt),u.on("touchstart",a,tr),u.on("touchend",a,Pr)),()=>{u!=null&&u.loaded()&&(Ke==null||Ke.remove(),u.off("click",gr),u.off("contextmenu",gr),It.remove(Re),a instanceof to.Marker?a.getPopup()===Ke&&a.setPopup(void 0):typeof a=="string"&&(u.off("click",a,Nt),u.off("dblclick",a,Nt),u.off("contextmenu",a,Nt),u.off("mousemove",a,Et),u.off("mouseleave",a,pt),u.off("touchstart",a,tr),u.off("touchend",a,Pr)))}});function Vt(ne){return B?!("marker"in ne)&&!gk(ne)&&ht(ne)!==_:!1}let sr=null,fr="normal";function er(ne){"layerType"in ne&&ne.layerType==="deckgl"?(t(10,X=ne.coordinate),t(4,sr=ne.object?[ne.object]:null)):(t(10,X=ne.lngLat),t(4,sr=ne.features??[]))}function Nt(ne){ne.type!==z||Vt(ne)||(er(ne),setTimeout(()=>t(0,_e=!0)))}let nr=null;function tr(ne){nr=ne.point}function Pr(ne){if(!nr||z!=="hover")return;let wr=nr.dist(ne.point);nr=null,wr<3&&(t(10,X=ne.lngLat),t(4,sr=ne.features??[]),Ke.isOpen()?t(25,fr="justOpened"):(t(25,fr="opening"),t(0,_e=!0)))}function pt(ne){z!=="hover"||nr||fr!=="normal"||(t(0,_e=!1),t(4,sr=null))}function Et(ne){if(!(z!=="hover"||nr||fr!=="normal")){if(Vt(ne)){t(0,_e=!1),t(4,sr=null);return}t(0,_e=!0),t(4,sr=ne.features??[]),t(10,X=ne.lngLat)}}function gr(ne){if(fr==="justOpened"){t(25,fr="normal");return}if(!P)return;let wr=[vt,a instanceof to.Marker?a==null?void 0:a.getElement():null];_e&&Ke.isOpen()&&!wr.some(We=>We==null?void 0:We.contains(ne.originalEvent.target))&&(ne.type==="contextmenu"&&z==="contextmenu"||ne.type!=="contextmenu")&&t(0,_e=!1)}function Re(ne){P&&_e&&Ke.isOpen()&&ne.marker!==a&&t(0,_e=!1)}ti(()=>{u&&(Ke!=null&&Ke.isOpen())&&Ke.remove()});let st;const tt=()=>t(0,_e=!1);function it(ne){pn[ne?"unshift":"push"](()=>{st=ne,t(1,st)})}return r.$$set=ne=>{"closeButton"in ne&&t(11,C=ne.closeButton),"closeOnClickOutside"in ne&&t(12,P=ne.closeOnClickOutside),"closeOnClickInside"in ne&&t(13,D=ne.closeOnClickInside),"closeOnMove"in ne&&t(14,N=ne.closeOnMove),"openOn"in ne&&t(15,z=ne.openOn),"openIfTopMost"in ne&&t(16,B=ne.openIfTopMost),"focusAfterOpen"in ne&&t(17,O=ne.focusAfterOpen),"anchor"in ne&&t(18,G=ne.anchor),"offset"in ne&&t(19,U=ne.offset),"popupClass"in ne&&t(20,K=ne.popupClass),"maxWidth"in ne&&t(21,me=ne.maxWidth),"lngLat"in ne&&t(10,X=ne.lngLat),"html"in ne&&t(22,Y=ne.html),"open"in ne&&t(0,_e=ne.open),"$$scope"in ne&&t(29,S=ne.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&14336&&t(27,n=C??(!P&&!D)),r.$$.dirty[0]&146685952&&(Ke||(t(23,Ke=new to.Popup({closeButton:n,closeOnClick:!1,closeOnMove:N,focusAfterOpen:O,maxWidth:me,className:K,anchor:G,offset:U})),vt=Ke.getElement(),Ke.on("open",()=>{t(0,_e=!0),Lt(),ze("open",Ke)}),Ke.on("close",()=>{t(0,_e=!1),ze("close",Ke)}),Ke.on("hover",()=>{ze("hover",Ke)}))),r.$$.dirty[0]&8421384&&Ke&&a instanceof to.Marker&&(z==="click"?a.setPopup(Ke):a.getPopup()===Ke&&a.setPopup(void 0)),r.$$.dirty[0]&268468224&&Ot.includes(z)&&(d==null?void 0:d.type)===z&&(Nt(d),Rt(Ze,d=null,d)),r.$$.dirty[0]&268468224&&t(26,l=z==="hover"&&((d==null?void 0:d.type)==="mousemove"||(d==null?void 0:d.type)==="mouseenter")),r.$$.dirty[0]&352354304&&z==="hover"&&Ze&&(l&&d&&er(d),t(0,_e=(l||Kt)??!1)),r.$$.dirty[0]&12582914&&(st?Ke.setDOMContent(st):Y&&Ke.setHTML(Y)),r.$$.dirty[0]&8389632&&X&&Ke.setLngLat(X),r.$$.dirty[0]&41943045&&u){let ne=Ke.isOpen();_e&&!ne?(Ke.addTo(u),fr==="opening"&&t(25,fr="justOpened")):!_e&&ne&&Ke.remove()}},[_e,st,u,a,sr,re,ce,Ze,Me,k,X,C,P,D,N,z,B,O,G,U,K,me,Y,Ke,Kt,fr,l,n,d,S,x,tt,it]}class l3 extends Ht{constructor(e){super(),Zt(this,e,a3,s3,jt,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}var kh=Uint8Array,tw=Uint16Array,c3=Int32Array,u3=new kh([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h3=new kh([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rw=function(r,e){for(var t=new tw(31),n=0;n<31;++n)t[n]=e+=1<>1|(Fr&21845)<<1,Ms=(Ms&52428)>>2|(Ms&13107)<<2,Ms=(Ms&61680)>>4|(Ms&3855)<<4,p3[Fr]=((Ms&65280)>>8|(Ms&255)<<8)>>1;var Ms,Fr,Fd=new kh(288);for(Fr=0;Fr<144;++Fr)Fd[Fr]=8;var Fr;for(Fr=144;Fr<256;++Fr)Fd[Fr]=9;var Fr;for(Fr=256;Fr<280;++Fr)Fd[Fr]=7;var Fr;for(Fr=280;Fr<288;++Fr)Fd[Fr]=8;var Fr,m3=new kh(32);for(Fr=0;Fr<32;++Fr)m3[Fr]=5;var Fr,g3=new kh(0),_3=typeof TextDecoder<"u"&&new TextDecoder,y3=0;try{_3.decode(g3,{stream:!0}),y3=1}catch{}function v3(r){let e;const t=r[16].default,n=Vr(t,r,r[24],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&16777216)&&Gr(n,t,l,l[24],e?qr(t,l[24],u,null):Wr(l[24]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function b3(r){let e,t,n;function l(d){r[17](d)}let u={id:r[1],type:"symbol",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],applyToClusters:r[9],minzoom:r[10],maxzoom:r[11],hoverCursor:r[12],manageHoverState:r[13],eventsIfTopMost:r[14],interactive:r[15],$$slots:{default:[v3]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new Bd({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[18]),e.$on("dblclick",r[19]),e.$on("contextmenu",r[20]),e.$on("mouseenter",r[21]),e.$on("mousemove",r[22]),e.$on("mouseleave",r[23]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.applyToClusters=d[9]),a&1024&&(_.minzoom=d[10]),a&2048&&(_.maxzoom=d[11]),a&4096&&(_.hoverCursor=d[12]),a&8192&&(_.manageHoverState=d[13]),a&16384&&(_.eventsIfTopMost=d[14]),a&32768&&(_.interactive=d[15]),a&16777216&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function w3(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Dc("symbol")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S=void 0}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{applyToClusters:P=void 0}=e,{minzoom:D=void 0}=e,{maxzoom:N=void 0}=e,{hoverCursor:z=void 0}=e,{manageHoverState:B=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:U=!0}=e;function K(ce){O=ce,t(0,O)}function me(ce){ur.call(this,r,ce)}function X(ce){ur.call(this,r,ce)}function Y(ce){ur.call(this,r,ce)}function _e(ce){ur.call(this,r,ce)}function ze(ce){ur.call(this,r,ce)}function re(ce){ur.call(this,r,ce)}return r.$$set=ce=>{"id"in ce&&t(1,u=ce.id),"source"in ce&&t(2,d=ce.source),"sourceLayer"in ce&&t(3,a=ce.sourceLayer),"beforeId"in ce&&t(4,_=ce.beforeId),"beforeLayerType"in ce&&t(5,x=ce.beforeLayerType),"paint"in ce&&t(6,S=ce.paint),"layout"in ce&&t(7,k=ce.layout),"filter"in ce&&t(8,C=ce.filter),"applyToClusters"in ce&&t(9,P=ce.applyToClusters),"minzoom"in ce&&t(10,D=ce.minzoom),"maxzoom"in ce&&t(11,N=ce.maxzoom),"hoverCursor"in ce&&t(12,z=ce.hoverCursor),"manageHoverState"in ce&&t(13,B=ce.manageHoverState),"hovered"in ce&&t(0,O=ce.hovered),"eventsIfTopMost"in ce&&t(14,G=ce.eventsIfTopMost),"interactive"in ce&&t(15,U=ce.interactive),"$$scope"in ce&&t(24,l=ce.$$scope)},[O,u,d,a,_,x,S,k,C,P,D,N,z,B,G,U,n,K,me,X,Y,_e,ze,re,l]}class iw extends Ht{constructor(e){super(),Zt(this,e,w3,b3,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}var x3=Object.defineProperty,ow=r=>{throw TypeError(r)},S3=(r,e,t)=>e in r?x3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fo=(r,e,t)=>S3(r,typeof e!="symbol"?e+"":e,t),sw=(r,e,t)=>e.has(r)||ow("Cannot "+t),Qn=(r,e,t)=>(sw(r,e,"read from private field"),t?t.call(r):e.get(r)),a0=(r,e,t)=>e.has(r)?ow("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),l0=(r,e,t,n)=>(sw(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);function mn(){}function k3(r,e){for(const t in e)r[t]=e[t];return r}function aw(r){return r()}function c0(){return Object.create(null)}function Bs(r){r.forEach(aw)}function lw(r){return typeof r=="function"}function ga(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}let Bf;function zi(r,e){return r===e?!0:(Bf||(Bf=document.createElement("a")),Bf.href=e,r===Bf.href)}function T3(r){return Object.keys(r).length===0}function E3(r,e,t,n){if(r){const l=cw(r,e,t,n);return r[0](l)}}function cw(r,e,t,n){return r[1]&&n?k3(t.ctx.slice(),r[1](n(e))):t.ctx}function M3(r,e,t,n){if(r[2]&&n){const l=r[2](n(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const u=[],d=Math.max(e.dirty.length,l.length);for(let a=0;a32){const e=[],t=r.ctx.length/32;for(let n=0;nr.removeEventListener(e,t,n)}function L3(r){return function(e){return e.preventDefault(),r.call(this,e)}}function ot(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function P3(r){return Array.from(r.childNodes)}function ph(r,e){e=""+e,r.data!==e&&(r.data=e)}function h0(r,e){r.value=e??""}function Ao(r,e,t){r.classList.toggle(e,!!t)}function z3(r,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(r,{detail:e,bubbles:t,cancelable:n})}let mh;function oh(r){mh=r}function uw(){if(!mh)throw new Error("Function called outside component initialization");return mh}function D3(r){uw().$$.on_destroy.push(r)}function R3(){const r=uw();return(e,t,{cancelable:n=!1}={})=>{const l=r.$$.callbacks[e];if(l){const u=z3(e,t,{cancelable:n});return l.slice().forEach(d=>{d.call(r,u)}),!u.defaultPrevented}return!0}}function f0(r,e){const t=r.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const pc=[],Nm=[];let vc=[];const d0=[],B3=Promise.resolve();let jm=!1;function F3(){jm||(jm=!0,B3.then(hw))}function Um(r){vc.push(r)}const tm=new Set;let ac=0;function hw(){if(ac!==0)return;const r=mh;do{try{for(;acr.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),vc=e}const Wf=new Set;let Ya;function Zf(){Ya={r:0,c:[],p:Ya}}function Hf(){Ya.r||Bs(Ya.c),Ya=Ya.p}function Zn(r,e){r&&r.i&&(Wf.delete(r),r.i(e))}function ui(r,e,t,n){if(r&&r.o){if(Wf.has(r))return;Wf.add(r),Ya.c.push(()=>{Wf.delete(r),n&&(t&&r.d(1),n())}),r.o(e)}else n&&n()}function p0(r){return(r==null?void 0:r.length)!==void 0?r:Array.from(r)}function j3(r,e){ui(r,1,1,()=>{e.delete(r.key)})}function U3(r,e,t,n,l,u,d,a,_,x,S,k){let C=r.length,P=u.length,D=C;const N={};for(;D--;)N[r[D].key]=D;const z=[],B=new Map,O=new Map,G=[];for(D=P;D--;){const X=k(l,u,D),Y=t(X);let _e=d.get(Y);_e?G.push(()=>_e.p(X,e)):(_e=x(Y,X),_e.c()),B.set(Y,z[D]=_e),Y in N&&O.set(Y,Math.abs(D-N[Y]))}const U=new Set,K=new Set;function me(X){Zn(X,1),X.m(a,S),d.set(X.key,X),S=X.first,P--}for(;C&&P;){const X=z[P-1],Y=r[C-1],_e=X.key,ze=Y.key;X===Y?(S=X.first,C--,P--):B.has(ze)?!d.has(_e)||U.has(_e)?me(X):K.has(ze)?C--:O.get(_e)>O.get(ze)?(K.add(_e),me(X)):(U.add(ze),C--):(_(Y,d),C--)}for(;C--;){const X=r[C];B.has(X.key)||_(X,d)}for(;P;)me(z[P-1]);return Bs(G),z}function da(r){r&&r.c()}function Ds(r,e,t){const{fragment:n,after_update:l}=r.$$;n&&n.m(e,t),Um(()=>{const u=r.$$.on_mount.map(aw).filter(lw);r.$$.on_destroy?r.$$.on_destroy.push(...u):Bs(u),r.$$.on_mount=[]}),l.forEach(Um)}function Rs(r,e){const t=r.$$;t.fragment!==null&&(N3(t.after_update),Bs(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function V3(r,e){r.$$.dirty[0]===-1&&(pc.push(r),F3(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{const D=P.length?P[0]:C;return x.ctx&&l(x.ctx[k],x.ctx[k]=D)&&(!x.skip_bound&&x.bound[k]&&x.bound[k](D),S&&V3(r,k)),C}):[],x.update(),S=!0,Bs(x.before_update),x.fragment=n?n(x.ctx):!1,e.target){if(e.hydrate){const k=P3(e.target);x.fragment&&x.fragment.l(k),k.forEach(gn)}else x.fragment&&x.fragment.c();e.intro&&Zn(r.$$.fragment),Ds(r,e.target,e.anchor),hw()}oh(_)}class ya{constructor(){fo(this,"$$"),fo(this,"$$set")}$destroy(){Rs(this,1),this.$destroy=mn}$on(e,t){if(!lw(t))return mn;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const l=n.indexOf(t);l!==-1&&n.splice(l,1)}}$set(e){this.$$set&&!T3(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const q3="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(q3);function G3(r){let e,t;return{c(){e=Zo("svg"),t=Zo("path"),ot(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),ot(e,"viewBox","0 0 14 14"),ot(e,"width","13"),ot(e,"height","13"),ot(e,"class","svelte-en2qvf")},m(n,l){vn(n,e,l),Ar(e,t)},p:mn,i:mn,o:mn,d(n){n&&gn(e)}}}class fw extends ya{constructor(e){super(),_a(this,e,null,G3,ga,{})}}function W3(r){let e,t;return{c(){e=Zo("svg"),t=Zo("path"),ot(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),ot(e,"viewBox","0 0 30 30"),ot(e,"fill","none"),ot(e,"xmlns","http://www.w3.org/2000/svg"),ot(e,"class","svelte-d2loi5")},m(n,l){vn(n,e,l),Ar(e,t)},p:mn,i:mn,o:mn,d(n){n&&gn(e)}}}class dw extends ya{constructor(e){super(),_a(this,e,null,W3,ga,{})}}function Z3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"area.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"area.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function H3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"reverse.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"reverse.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function $3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"poi.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"poi.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function X3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"postal_code.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"postal_code.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function K3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"street.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"street.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function J3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"road.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"road.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function Y3(r){let e,t;return{c(){e=Kr("img"),zi(e.src,t=r[3]+"housenumber.svg")||ot(e,"src",t),ot(e,"alt",r[6]),ot(e,"class","svelte-ltkwvy")},m(n,l){vn(n,e,l)},p(n,l){l&8&&!zi(e.src,t=n[3]+"housenumber.svg")&&ot(e,"src",t),l&64&&ot(e,"alt",n[6])},d(n){n&&gn(e)}}}function Q3(r){let e,t,n,l;return{c(){e=Kr("img"),zi(e.src,t=r[5])||ot(e,"src",t),ot(e,"alt",r[4]),ot(e,"class","svelte-ltkwvy")},m(u,d){vn(u,e,d),n||(l=Zi(e,"error",r[14]),n=!0)},p(u,d){d&32&&!zi(e.src,t=u[5])&&ot(e,"src",t),d&16&&ot(e,"alt",u[4])},d(u){u&&gn(e),n=!1,l()}}}function m0(r){let e,t;return{c(){e=Kr("span"),t=fa(r[6]),ot(e,"class","secondary svelte-ltkwvy")},m(n,l){vn(n,e,l),Ar(e,t)},p(n,l){l&64&&ph(t,n[6])},d(n){n&&gn(e)}}}function eT(r){let e,t,n,l,u,d,a,_,x,S=(r[7]?r[0].place_name:r[0].place_name.replace(/,.*/,""))+"",k,C,P=r[2]==="always"||r[2]!=="never"&&!r[0].address&&!r[0].id.startsWith("road.")&&!r[0].id.startsWith("address.")&&!r[0].id.startsWith("postal_code.")&&(!r[0].id.startsWith("poi.")||!r[5])&&!r[7],D,N,z=(r[7]?"":r[0].place_name.replace(/[^,]*,?\s*/,""))+"",B,O,G;function U(Y,_e){return _e&1&&(t=null),_e&1&&(n=null),_e&1&&(l=null),_e&1&&(u=null),Y[5]?Q3:Y[0].address?Y3:(t==null&&(t=!!Y[0].id.startsWith("road.")),t?J3:(n==null&&(n=!!Y[0].id.startsWith("address.")),n?K3:(l==null&&(l=!!Y[0].id.startsWith("postal_code.")),l?X3:(u==null&&(u=!!Y[0].id.startsWith("poi.")),u?$3:Y[7]?H3:Z3))))}let K=U(r,-1),me=K(r),X=P&&m0(r);return{c(){e=Kr("li"),me.c(),d=po(),a=Kr("span"),_=Kr("span"),x=Kr("span"),k=fa(S),C=po(),X&&X.c(),D=po(),N=Kr("span"),B=fa(z),ot(x,"class","primary svelte-ltkwvy"),ot(_,"class","svelte-ltkwvy"),ot(N,"class","line2 svelte-ltkwvy"),ot(a,"class","texts svelte-ltkwvy"),ot(e,"tabindex","0"),ot(e,"data-selected",r[1]),ot(e,"class","svelte-ltkwvy"),Ao(e,"selected",r[1])},m(Y,_e){vn(Y,e,_e),me.m(e,null),Ar(e,d),Ar(e,a),Ar(a,_),Ar(_,x),Ar(x,k),Ar(_,C),X&&X.m(_,null),Ar(a,D),Ar(a,N),Ar(N,B),O||(G=[Zi(e,"mouseenter",r[12]),Zi(e,"focus",r[13])],O=!0)},p(Y,[_e]){K===(K=U(Y,_e))&&me?me.p(Y,_e):(me.d(1),me=K(Y),me&&(me.c(),me.m(e,d))),_e&1&&S!==(S=(Y[7]?Y[0].place_name:Y[0].place_name.replace(/,.*/,""))+"")&&ph(k,S),_e&37&&(P=Y[2]==="always"||Y[2]!=="never"&&!Y[0].address&&!Y[0].id.startsWith("road.")&&!Y[0].id.startsWith("address.")&&!Y[0].id.startsWith("postal_code.")&&(!Y[0].id.startsWith("poi.")||!Y[5])&&!Y[7]),P?X?X.p(Y,_e):(X=m0(Y),X.c(),X.m(_,null)):X&&(X.d(1),X=null),_e&1&&z!==(z=(Y[7]?"":Y[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&ph(B,z),_e&2&&ot(e,"data-selected",Y[1]),_e&2&&Ao(e,"selected",Y[1])},i:mn,o:mn,d(Y){Y&&gn(e),me.d(),X&&X.d(),O=!1,Bs(G)}}}function tT(r,e,t){var n;let l,u,{feature:d}=e,{selected:a=!1}=e,{showPlaceType:_}=e,{missingIconsCache:x}=e,{iconsBaseUrl:S}=e;const k=(n=d.properties)==null?void 0:n.categories;let C,P,D=0,N=d.place_type[0]==="reverse";function z(){P&&x.add(P),t(10,D++,D)}function B(U){f0.call(this,r,U)}function O(U){f0.call(this,r,U)}const G=()=>z();return r.$$set=U=>{"feature"in U&&t(0,d=U.feature),"selected"in U&&t(1,a=U.selected),"showPlaceType"in U&&t(2,_=U.showPlaceType),"missingIconsCache"in U&&t(9,x=U.missingIconsCache),"iconsBaseUrl"in U&&t(3,S=U.iconsBaseUrl)},r.$$.update=()=>{var U,K,me,X;if(r.$$.dirty&3640)do t(11,l--,l),t(4,C=k==null?void 0:k[l]),t(5,P=C?S+C.replace(/ /g,"_")+".svg":void 0);while(l>-1&&(!P||x.has(P)));r.$$.dirty&1&&t(6,u=((K=(U=d.properties)==null?void 0:U.categories)==null?void 0:K.join(", "))??((X=(me=d.properties)==null?void 0:me.place_type_name)==null?void 0:X[0])??d.place_type[0])},t(11,l=(k==null?void 0:k.length)??0),[d,a,_,S,C,P,u,N,z,x,D,l,B,O,G]}class rT extends ya{constructor(e){super(),_a(this,e,tT,eT,ga,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function nT(r){let e;return{c(){e=Kr("div"),e.innerHTML='',ot(e,"class","svelte-7cmwmc")},m(t,n){vn(t,e,n)},p:mn,i:mn,o:mn,d(t){t&&gn(e)}}}class iT extends ya{constructor(e){super(),_a(this,e,null,nT,ga,{})}}function oT(r){let e,t,n;return{c(){e=Zo("svg"),t=Zo("path"),ot(t,"stroke-width","4"),ot(t,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),ot(t,"class","svelte-gzo3ar"),ot(e,"width",n=r[0]==="list"?20:void 0),ot(e,"viewBox","0 0 70 85"),ot(e,"fill","none"),ot(e,"class","svelte-gzo3ar"),Ao(e,"in-map",r[0]!=="list"),Ao(e,"list-icon",r[0]==="list")},m(l,u){vn(l,e,u),Ar(e,t)},p(l,[u]){u&1&&n!==(n=l[0]==="list"?20:void 0)&&ot(e,"width",n),u&1&&Ao(e,"in-map",l[0]!=="list"),u&1&&Ao(e,"list-icon",l[0]==="list")},i:mn,o:mn,d(l){l&&gn(e)}}}function sT(r,e,t){let{displayIn:n}=e;return r.$$set=l=>{"displayIn"in l&&t(0,n=l.displayIn)},[n]}class aT extends ya{constructor(e){super(),_a(this,e,sT,oT,ga,{displayIn:0})}}function lT(r){let e,t;return{c(){e=Zo("svg"),t=Zo("path"),ot(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),ot(e,"viewBox","0 0 60.006 21.412"),ot(e,"width","14"),ot(e,"height","20"),ot(e,"class","svelte-en2qvf")},m(n,l){vn(n,e,l),Ar(e,t)},p:mn,i:mn,o:mn,d(n){n&&gn(e)}}}class cT extends ya{constructor(e){super(),_a(this,e,null,lT,ga,{})}}function uT(r){let e,t,n;return{c(){e=Zo("svg"),t=Zo("circle"),n=Zo("path"),ot(t,"cx","4.789"),ot(t,"cy","4.787"),ot(t,"r","3.85"),ot(t,"class","svelte-1aq105l"),ot(n,"d","M12.063 12.063 7.635 7.635"),ot(n,"class","svelte-1aq105l"),ot(e,"xmlns","http://www.w3.org/2000/svg"),ot(e,"width","13"),ot(e,"height","13"),ot(e,"viewBox","0 0 13 13"),ot(e,"class","svelte-1aq105l")},m(l,u){vn(l,e,u),Ar(e,t),Ar(e,n)},p:mn,i:mn,o:mn,d(l){l&&gn(e)}}}class hT extends ya{constructor(e){super(),_a(this,e,null,uT,ga,{})}}function fT(r,e,t){const n=e[1],l=e[0],u=n-l;return r===n&&t?r:((r-l)%u+u)%u+l}function dd(r){const e=[...r];return e[2]Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Ou;async function dT(r,e,t){const n=r==null?void 0:r.getCenterAndZoom();for(const l of e??[])if(!(n&&(l.minZoom!=null&&l.minZoom>n[0]||l.maxZoom!=null&&l.maxZoomDate.now()){if(!Ou.coords)break e;return Ou.coords}let u;try{return u=await new Promise((d,a)=>{t.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(_=>{d([_.coords.longitude,_.coords.latitude].map(x=>x.toFixed(6)).join(","))},_=>{a(_)},l)}),u}catch{}finally{l.cachedLocationExpiry&&(Ou={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(l.type==="server-geolocation")return"ip";if(n&&l.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const pT=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,g0=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,_0=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,y0=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,v0=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,b0=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function mT(r){if(!["DMS","DM","DD"].includes(r))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(P=>Number(P.trim())),t=Number(e[0]),n=Number(e[1]),l=Math.abs(t),u=Math.abs(n),d=t>0?"N":"S",a=n>0?"E":"W";let _;r=="DD"&&(_=`${l}° ${d}, ${u}° ${a}`);const x=Math.floor(l),S=Math.floor(u),k=(l-x)*60,C=(u-S)*60;if(r=="DM"){let P=w0(k,3).toFixed(3).padStart(6,"0"),D=w0(C,3).toFixed(3).padStart(6,"0");P.endsWith(".000")&&D.endsWith(".000")&&(P=P.replace(/\.000$/,""),D=D.replace(/\.000$/,"")),_=`${x}° ${P}' ${d}, ${S}° ${D}' ${a}`}if(r=="DMS"){const P=Math.floor(k),D=Math.floor(C);let N=((k-P)*60).toFixed(1).padStart(4,"0"),z=((C-D)*60).toFixed(1).padStart(4,"0");const B=P.toString().padStart(2,"0"),O=D.toString().padStart(2,"0");N.endsWith(".0")&&z.endsWith(".0")&&(N=N.replace(/\.0$/,""),z=z.replace(/\.0$/,"")),_=`${x}° ${B}' ${N}" ${d}, ${S}° ${O}' ${z}" ${a}`}return _}else throw new Error("no decimal coordinates to convert")}function w0(r,e){const t=Math.pow(10,e);return Math.round((r+Number.EPSILON)*t)/t}function zg(r,e){e||(e=5),r=r.replace(/\s+/g," ").trim();let t=null,n=null,l="",u="",d=null,a=[],_=!1;if(pT.test(r))throw new Error("invalid coordinate value");if(g0.test(r))if(a=g0.exec(r),_=Nu(a),_)t=Math.abs(a[1])+a[2]/60,Number(a[1])<0&&(t*=-1),n=Math.abs(a[3])+a[4]/60,Number(a[3])<0&&(n*=-1),d="DM";else throw new Error("invalid coordinate format");else if(_0.test(r))if(a=_0.exec(r),_=Nu(a),_){if(t=a[2],n=a[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),d="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");a[1]?(l=a[1],u=a[5]):a[4]&&(l=a[4],u=a[8])}else throw new Error("invalid decimal coordinate format");else if(y0.test(r))if(a=y0.exec(r),_=Nu(a),_)t=Math.abs(parseInt(a[2])),a[4]&&(t+=a[4]/60,d="DM"),a[6]&&(t+=a[6].replace(",",".")/3600,d="DMS"),parseInt(a[2])<0&&(t=-1*t),n=Math.abs(parseInt(a[9])),a[11]&&(n+=a[11]/60),a[13]&&(n+=a[13].replace(",",".")/3600),parseInt(a[9])<0&&(n=-1*n),a[1]?(l=a[1],u=a[8]):a[7]&&(l=a[7],u=a[14]);else throw new Error("invalid DMS coordinates format");else if(v0.test(r))if(a=v0.exec(r),_=Nu(a),_)t=Math.abs(parseInt(a[2])),a[4]&&(t+=a[4]/60,d="DM"),a[6]&&(t+=a[6]/3600,d="DMS"),parseInt(a[2])<0&&(t=-1*t),n=Math.abs(parseInt(a[10])),a[12]&&(n+=a[12]/60),a[14]&&(n+=a[14]/3600),parseInt(a[10])<0&&(n=-1*n),a[1]?(l=a[1],u=a[9]):a[8]&&(l=a[8],u=a[16]);else throw new Error("invalid DMS coordinates format");else if(b0.test(r)){if(a=b0.exec(r),_=Nu(a),a.filter(x=>x).length<=5)throw new Error("invalid coordinates format");if(_)t=Math.abs(parseInt(a[2])),a[4]&&(t+=a[4].replace(",",".")/60,d="DM"),a[6]&&(t+=a[6].replace(",",".")/3600,d="DMS"),parseInt(a[2])<0&&(t=-1*t),n=Math.abs(parseInt(a[10])),a[12]&&(n+=a[12].replace(",",".")/60),a[14]&&(n+=a[14].replace(",",".")/3600),parseInt(a[10])<0&&(n=-1*n),a[1]?(l=a[1],u=a[9]):a[8]&&(l=a[8],u=a[16]);else throw new Error("invalid coordinates format")}if(_){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(l&&!u||!l&&u)throw new Error("invalid coordinates value");if(l&&l==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let x=/S|SOUTH/i;x.test(l)&&t>0&&(t=-1*t),x=/W|WEST/i,x.test(u)&&n>0&&(n=-1*n);const S=a[0].trim();let k,C;const P=/[,/;\u0020]/g,D=S.match(P);if(D==null){const B=Math.floor(r.length/2);k=S.substring(0,B).trim(),C=S.substring(B).trim()}else{let B;D.length%2==1?B=Math.floor(D.length/2):B=D.length/2-1;let O=0;if(B==0)O=S.indexOf(D[0]),k=S.substring(0,O).trim(),C=S.substring(O+1).trim();else{let G=0,U=0;for(;G<=B;)O=S.indexOf(D[G],U),U=O+1,G++;k=S.substring(0,O).trim(),C=S.substring(O+1).trim()}}const N=k.split(".");if(N.length==2&&N[1]==0&&N[1].length!=2)throw new Error("invalid coordinates format");const z=C.split(".");if(z.length==2&&z[1]==0&&z[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(k)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:S,verbatimLatitude:k,verbatimLongitude:C,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:d,closeEnough:gT,toCoordinateFormat:mT})}else throw new Error("coordinates pattern match failed")}function Nu(r){if(!isNaN(r[0]))return!1;const e=[...r];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,l=e.length/2;for(let u=0;u{e.decimalLatitude?r.push(e):r.push({...e,...vT})}),[...r,...bT,...wT]}const ST=xT();zg.formats=ST.map(r=>r.verbatimCoordinates);const kT=zg;function S0(r,e,t){const n=r.slice();return n[84]=e[t],n[86]=t,n}function k0(r){let e,t;return e=new iT({}),{c(){da(e.$$.fragment)},m(n,l){Ds(e,n,l),t=!0},i(n){t||(Zn(e.$$.fragment,n),t=!0)},o(n){ui(e.$$.fragment,n),t=!1},d(n){Rs(e,n)}}}function T0(r){let e,t,n,l,u;return t=new cT({}),{c(){e=Kr("button"),da(t.$$.fragment),ot(e,"type","button"),ot(e,"title",r[9]),ot(e,"class","svelte-bz0zu3"),Ao(e,"active",r[0])},m(d,a){vn(d,e,a),Ds(t,e,null),n=!0,l||(u=Zi(e,"click",r[69]),l=!0)},p(d,a){(!n||a[0]&512)&&ot(e,"title",d[9]),(!n||a[0]&1)&&Ao(e,"active",d[0])},i(d){n||(Zn(t.$$.fragment,d),n=!0)},o(d){ui(t.$$.fragment,d),n=!1},d(d){d&&gn(e),Rs(t),l=!1,u()}}}function TT(r){let e,t=[],n=new Map,l,u,d,a=p0(r[14]);const _=x=>x[84].id+(x[84].address?","+x[84].address:"");for(let x=0;x{X=null}),Hf()),(!G||ht[0]&2)&&Ao(x,"displayable",Me[1]!==""),Me[5]==="button"?Y?(Y.p(Me,ht),ht[0]&32&&Zn(Y,1)):(Y=T0(Me),Y.c(),Zn(Y,1),Y.m(n,D)):Y&&(Zf(),ui(Y,1,1,()=>{Y=null}),Hf()),ze&&ze.p&&(!G||ht[1]&536870912)&&C3(ze,_e,Me,Me[60],G?M3(_e,Me[60],ht,null):I3(Me[60]),null);let It=z;z=Ze(Me),z===It?~z&&ce[z].p(Me,ht):(B&&(Zf(),ui(ce[It],1,1,()=>{ce[It]=null}),Hf()),~z?(B=ce[z],B?B.p(Me,ht):(B=ce[z]=re[z](Me),B.c()),Zn(B,1),B.m(t,null)):B=null),(!G||ht[0]&4&&O!==(O=u0(Me[2])+" svelte-bz0zu3"))&&ot(t,"class",O),(!G||ht[0]&22)&&Ao(t,"can-collapse",Me[4]&&Me[1]==="")},i(Me){G||(Zn(me),Zn(u.$$.fragment,Me),Zn(k.$$.fragment,Me),Zn(X),Zn(Y),Zn(ze,Me),Zn(B),G=!0)},o(Me){ui(me),ui(u.$$.fragment,Me),ui(k.$$.fragment,Me),ui(X),ui(Y),ui(ze,Me),ui(B),G=!1},d(Me){Me&&(gn(e),gn(t)),Rs(u),r[63](null),Rs(k),X&&X.d(),Y&&Y.d(),ze&&ze.d(Me),~z&&ce[z].d(),U=!1,Bs(K)}}}function AT(r,e,t){let n,l,{$$slots:u={},$$scope:d}=e;const a={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:_=void 0}=e,{apiKey:x}=e,{bbox:S=void 0}=e,{clearButtonTitle:k="clear"}=e,{clearOnBlur:C=!1}=e,{collapsed:P=!1}=e,{country:D=void 0}=e,{debounceSearch:N=200}=e,{enableReverse:z="never"}=e,{errorMessage:B="Something went wrong…"}=e,{filter:O=()=>!0}=e,{flyTo:G=!0}=e,{fuzzyMatch:U=!0}=e,{language:K=void 0}=e,{limit:me=void 0}=e,{mapController:X=void 0}=e,{minLength:Y=2}=e,{noResultsMessage:_e="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:ze="Search"}=e,{proximity:re=[{type:"server-geolocation"}]}=e,{reverseActive:ce=z==="always"}=e,{reverseButtonTitle:Ze="toggle reverse geocoding"}=e,{searchValue:Me=""}=e,{pickedResultStyle:ht="full-geometry"}=e,{showPlaceType:It="if-needed"}=e,{showResultsWhileTyping:Ot=!0}=e,{selectFirst:Ke=!0}=e,{flyToSelected:Kt=!1}=e,{markerOnSelected:vt=!0}=e,{types:Lt=void 0}=e,{exhaustiveReverseGeocoding:Vt=!1}=e,{excludeTypes:sr=!1}=e,{zoom:fr=a}=e,{apiUrl:er="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Nt={}}=e,{iconsBaseUrl:nr="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.1/icons/"}=e,{adjustUrlQuery:tr=()=>{}}=e;function Pr(){We.focus()}function pt(){We.blur()}function Et(W,Be=!0,Fe=!1){t(1,Me=W),Be?(t(15,Ye=-1),lt()):(Jt(!Fe,Fe),setTimeout(()=>{We.focus(),We.select()}))}function gr(){t(14,tt=void 0),t(56,ne=void 0),t(15,Ye=-1)}function Re(){t(55,it=[]),t(56,ne=void 0)}let st=!1,tt,it,ne,wr="",We,Ye=-1,Ut,bn=[],wn,Mn,ni,ii;const $o=new Set,Jr=R3();D3(()=>{X&&(X.setEventHandler(void 0),X.indicateReverse(!1),X.setSelectedMarker(-1),X.setFeatures(void 0,void 0,!1))});function lt(W){if(Mn&&(clearTimeout(Mn),Mn=void 0),Ye>-1&&tt)t(56,ne=tt[Ye]),t(1,Me=ne.place_type[0]==="reverse"?ne.place_name:ne.place_name.replace(/,.*/,"")),t(18,Ut=void 0),t(55,it=void 0),t(15,Ye=-1);else if(Me){const Be=W||!Xn(Me);xn(Me,{exact:!0}).then(()=>{t(55,it=tt),t(56,ne=void 0),Be&&Bo()}).catch(Fe=>t(18,Ut=Fe))}}function Xn(W){try{return kT(W,6)}catch{return!1}}async function xn(W,{byId:Be=!1,exact:Fe=!1}={}){t(18,Ut=void 0),wn==null||wn.abort();const qe=new AbortController;t(19,wn=qe);try{const Xe=Xn(W),ct=new URLSearchParams;if(K!==void 0&&ct.set("language",Array.isArray(K)?K.join(","):K??""),Lt&&ct.set("types",Lt.join(",")),sr&&ct.set("excludeTypes",String(sr)),S&&ct.set("bbox",S.map(_r=>_r.toFixed(6)).join(",")),D&&ct.set("country",Array.isArray(D)?D.join(","):D),!Be&&!Xe){const _r=await dT(X,re,qe);_r&&ct.set("proximity",_r),(Fe||!Ot)&&ct.set("autocomplete","false"),ct.set("fuzzyMatch",String(U))}me!==void 0&&(Vt||!Xe||(Lt==null?void 0:Lt.length)===1)&&ct.set("limit",String(me)),ct.set("key",x),tr(ct);const Pt=er+"/"+encodeURIComponent(Xe?Xe.decimalLongitude+","+Xe.decimalLatitude:W)+".json?"+ct.toString();if(Pt===wr){Be?(t(14,tt=void 0),t(56,ne=bn[0])):t(14,tt=bn);return}wr=Pt;const $t=await fetch(Pt,{signal:qe.signal,...Nt});if(!$t.ok)throw new Error(await $t.text());const ar=await $t.json();Jr("response",{url:Pt,featureCollection:ar}),Be?(t(14,tt=void 0),t(56,ne=ar.features[0]),bn=[ne]):(t(14,tt=ar.features.filter(O)),Xe&&tt.unshift({type:"Feature",properties:{},id:"reverse_"+Xe.decimalLongitude+"_"+Xe.decimalLatitude,text:Xe.decimalLatitude+", "+Xe.decimalLongitude,place_name:Xe.decimalLatitude+", "+Xe.decimalLongitude,place_type:["reverse"],center:[Xe.decimalLongitude,Xe.decimalLatitude],bbox:[Xe.decimalLongitude,Xe.decimalLatitude,Xe.decimalLongitude,Xe.decimalLatitude],geometry:{type:"Point",coordinates:[Xe.decimalLongitude,Xe.decimalLatitude]}}),bn=tt,Xe&&We.focus())}catch(Xe){if(Xe&&typeof Xe=="object"&&"name"in Xe&&Xe.name==="AbortError")return;throw Xe}finally{qe===wn&&t(19,wn=void 0)}}function Bo(){var W;if(!(it!=null&&it.length)||!G)return;const Be=[180,90,-180,-90],Fe=!it.some(Xe=>!Xe.matching_text);let qe;for(const Xe of it){const ct=Or(Xe);if(qe=qe===void 0?ct:ct===void 0?qe:Math.max(qe,ct),Fe||!Xe.matching_text)for(const Pt of[0,1,2,3])Be[Pt]=Math[Pt<2?"min":"max"](Be[Pt],((W=Xe.bbox)==null?void 0:W[Pt])??Xe.center[Pt%2])}X&&it.length>0&&(ne&&Be[0]===Be[2]&&Be[1]===Be[3]?X.flyTo(ne.center,Or(ne)):X.fitBounds(dd(Be),50,qe))}function Or(W){var Be;if(!W.bbox||W.bbox[0]!==W.bbox[2]&&W.bbox[1]!==W.bbox[3])return;const Fe=W.id.replace(/\..*/,"");return(Array.isArray((Be=W.properties)==null?void 0:Be.categories)?W.properties.categories.reduce((qe,Xe)=>{const ct=fr[Fe+"."+Xe];return qe===void 0?ct:ct===void 0?qe:Math.max(qe,ct)},void 0):void 0)??fr[Fe]}function mt(W){t(0,ce=z==="always"),t(14,tt=void 0),t(56,ne=void 0),t(15,Ye=-1),Et(W[1].toFixed(6)+", "+fT(W[0],[-180,180],!0).toFixed(6),!1,!0)}function rr(W){if(!tt)return;let Be=W.key==="ArrowDown"?1:W.key==="ArrowUp"?-1:0;Be&&(Ye===(Ke?0:-1)&&Be===-1&&t(15,Ye=tt.length),t(15,Ye+=Be),Ye>=tt.length&&t(15,Ye=-1),Ye<0&&Ke&&t(15,Ye=0),W.preventDefault())}function Jt(W=!0,Be=!1){if(t(18,Ut=void 0),Ot||Be){if(Mn&&clearTimeout(Mn),Me.length{xn(Fe).catch(qe=>t(18,Ut=qe))},W?N:0)}else t(14,tt=void 0),t(18,Ut=void 0)}function Nr(W){t(56,ne=W),t(1,Me=W.place_name),t(15,Ye=-1)}const vi=()=>We.focus();function Qt(W){Nm[W?"unshift":"push"](()=>{We=W,t(17,We)})}function ro(){Me=this.value,t(1,Me),t(13,st),t(28,C)}const an=()=>t(13,st=!0),pe=()=>t(13,st=!1),Z=()=>Jt(),$=()=>{t(1,Me=""),We.focus()},te=()=>t(0,ce=!ce),le=()=>t(18,Ut=void 0),Ce=W=>t(15,Ye=W),Ie=W=>Nr(W),Pe=()=>{Ke||t(15,Ye=-1)},Se=()=>{};return r.$$set=W=>{"class"in W&&t(2,_=W.class),"apiKey"in W&&t(26,x=W.apiKey),"bbox"in W&&t(27,S=W.bbox),"clearButtonTitle"in W&&t(3,k=W.clearButtonTitle),"clearOnBlur"in W&&t(28,C=W.clearOnBlur),"collapsed"in W&&t(4,P=W.collapsed),"country"in W&&t(29,D=W.country),"debounceSearch"in W&&t(30,N=W.debounceSearch),"enableReverse"in W&&t(5,z=W.enableReverse),"errorMessage"in W&&t(6,B=W.errorMessage),"filter"in W&&t(31,O=W.filter),"flyTo"in W&&t(32,G=W.flyTo),"fuzzyMatch"in W&&t(33,U=W.fuzzyMatch),"language"in W&&t(34,K=W.language),"limit"in W&&t(35,me=W.limit),"mapController"in W&&t(36,X=W.mapController),"minLength"in W&&t(37,Y=W.minLength),"noResultsMessage"in W&&t(7,_e=W.noResultsMessage),"placeholder"in W&&t(8,ze=W.placeholder),"proximity"in W&&t(38,re=W.proximity),"reverseActive"in W&&t(0,ce=W.reverseActive),"reverseButtonTitle"in W&&t(9,Ze=W.reverseButtonTitle),"searchValue"in W&&t(1,Me=W.searchValue),"pickedResultStyle"in W&&t(39,ht=W.pickedResultStyle),"showPlaceType"in W&&t(10,It=W.showPlaceType),"showResultsWhileTyping"in W&&t(40,Ot=W.showResultsWhileTyping),"selectFirst"in W&&t(11,Ke=W.selectFirst),"flyToSelected"in W&&t(41,Kt=W.flyToSelected),"markerOnSelected"in W&&t(42,vt=W.markerOnSelected),"types"in W&&t(43,Lt=W.types),"exhaustiveReverseGeocoding"in W&&t(44,Vt=W.exhaustiveReverseGeocoding),"excludeTypes"in W&&t(45,sr=W.excludeTypes),"zoom"in W&&t(46,fr=W.zoom),"apiUrl"in W&&t(47,er=W.apiUrl),"fetchParameters"in W&&t(48,Nt=W.fetchParameters),"iconsBaseUrl"in W&&t(12,nr=W.iconsBaseUrl),"adjustUrlQuery"in W&&t(49,tr=W.adjustUrlQuery),"$$scope"in W&&t(60,d=W.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&32&&t(0,ce=z==="always"),r.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ni=st),C&&!st&&t(1,Me="")}),r.$$.dirty[0]&16386|r.$$.dirty[1]&64&&Me.lengtht(18,Ut=W)),r.$$.dirty[1]&100663330&&(X&&ne&&ne.id!==ii&&G&&(!ne.bbox||ne.bbox[0]===ne.bbox[2]&&ne.bbox[1]===ne.bbox[3]?X.flyTo(ne.center,Or(ne)):X.fitBounds(dd(ne.bbox),50,Or(ne)),t(14,tt=void 0),t(55,it=void 0),t(15,Ye=-1)),t(57,ii=ne==null?void 0:ne.id)),r.$$.dirty[0]&18432&&Ke&&tt!=null&&tt.length&&t(15,Ye=0),r.$$.dirty[0]&2&&t(15,Ye=-1),r.$$.dirty[0]&16384|r.$$.dirty[1]&16777216&&it!==tt&&t(55,it=void 0),r.$$.dirty[0]&81921|r.$$.dirty[1]&16777248&&X&&X.setEventHandler(W=>{switch(W.type){case"mapClick":ce&&mt(W.coordinates);break;case"markerClick":{const Be=tt==null?void 0:tt.find(Fe=>Fe.id===W.id);Be&&Nr(Be)}break;case"markerMouseEnter":it&&t(15,Ye=ni?(tt==null?void 0:tt.findIndex(Be=>Be.id===W.id))??-1:-1);break;case"markerMouseLeave":it&&t(15,Ye=-1);break}}),r.$$.dirty[0]&49152&&t(58,l=tt==null?void 0:tt[Ye]),r.$$.dirty[1]&134218786&&X&&l&&G&&Kt&&X.flyTo(l.center,Or(l)),r.$$.dirty[1]&256&&t(59,n=ht==="full-geometry-including-polygon-center-marker"),r.$$.dirty[1]&268437536&&(vt||X==null||X.setFeatures(void 0,void 0,n)),r.$$.dirty[1]&419432480&&X&&vt&&!it&&(X.setFeatures(l?[l]:void 0,void 0,n),X.setSelectedMarker(l?0:-1)),r.$$.dirty[1]&318767136&&X&&X.setFeatures(it,ne,n),r.$$.dirty[0]&32768|r.$$.dirty[1]&16777248&&it&&X&&X.setSelectedMarker(Ye),r.$$.dirty[0]&2|r.$$.dirty[1]&32&&X){const W=Xn(Me);X.setReverseMarker(W?[W.decimalLongitude,W.decimalLatitude]:void 0)}r.$$.dirty[1]&134217728&&Jr("select",{feature:l}),r.$$.dirty[1]&33554432&&Jr("pick",{feature:ne}),r.$$.dirty[0]&81920&&Jr("optionsvisibilitychange",{optionsVisible:ni&&!!tt}),r.$$.dirty[0]&16384&&Jr("featureslisted",{features:tt}),r.$$.dirty[1]&16777216&&Jr("featuresmarked",{features:it}),r.$$.dirty[0]&1&&Jr("reversetoggle",{reverse:ce}),r.$$.dirty[0]&2&&Jr("querychange",{query:Me}),r.$$.dirty[0]&1|r.$$.dirty[1]&32&&X&&X.indicateReverse(ce)},[ce,Me,_,k,P,z,B,_e,ze,Ze,It,Ke,nr,st,tt,Ye,ni,We,Ut,wn,$o,lt,rr,Jt,Nr,a,x,S,C,D,N,O,G,U,K,me,X,Y,re,ht,Ot,Kt,vt,Lt,Vt,sr,fr,er,Nt,tr,Pr,pt,Et,gr,Re,it,ne,ii,l,n,d,u,vi,Qt,ro,an,pe,Z,$,te,le,Ce,Ie,Pe,Se]}let LT=class extends ya{constructor(r){super(),_a(this,r,AT,IT,ga,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,exhaustiveReverseGeocoding:44,excludeTypes:45,zoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}};function gh(r,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}function Dg(r,e,t={}){for(const n of r){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let l=0;l + * @license MIT + * @preserve + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */function PT(r,e){var t={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},n,l,u,d;return d={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function a(x){return function(S){return _([x,S])}}function _(x){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,l&&(u=x[0]&2?l.return:x[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,x[1])).done)return u;switch(l=0,u&&(x=[x[0]&2,u.value]),x[0]){case 0:case 1:u=x;break;case 4:return t.label++,{value:x[1],done:!1};case 5:t.label++,l=x[1],x=[0];continue;case 7:x=t.ops.pop(),t.trys.pop();continue;default:if(u=t.trys,!(u=u.length>0&&u[u.length-1])&&(x[0]===6||x[0]===2)){t=0;continue}if(x[0]===3&&(!u||x[1]>u[0]&&x[1]e?1:r0){if(e.right===null)break;if(t(r,e.right.key)>0){var a=e.right;if(e.right=a.left,a.left=e,e=a,e.right===null)break}l.right=e,l=e,e=e.right}else break}return l.right=e.left,u.left=e.right,e.left=n.right,e.right=n.left,e}function rm(r,e,t,n){var l=new pa(r,e);if(t===null)return l.left=l.right=null,l;t=sa(r,t,n);var u=n(r,t.key);return u<0?(l.left=t.left,l.right=t,t.left=null):u>=0&&(l.right=t.right,l.left=t,t.right=null),l}function M0(r,e,t){var n=null,l=null;if(e){e=sa(r,e,t);var u=t(e.key,r);u===0?(n=e.left,l=e.right):u<0?(l=e.right,e.right=null,n=e):(n=e.left,e.left=null,l=e)}return{left:n,right:l}}function DT(r,e,t){return e===null?r:(r===null||(e=sa(r.key,e,t),e.left=r),e)}function Vm(r,e,t,n,l){if(r){n(""+e+(t?"└── ":"├── ")+l(r)+` +`);var u=e+(t?" ":"│ ");r.left&&Vm(r.left,u,!1,n,l),r.right&&Vm(r.right,u,!0,n,l)}}var Rg=function(){function r(e){e===void 0&&(e=zT),this._root=null,this._size=0,this._comparator=e}return r.prototype.insert=function(e,t){return this._size++,this._root=rm(e,t,this._root,this._comparator)},r.prototype.add=function(e,t){var n=new pa(e,t);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var l=this._comparator,u=sa(e,this._root,l),d=l(e,u.key);return d===0?this._root=u:(d<0?(n.left=u.left,n.right=u,u.left=null):d>0&&(n.right=u.right,n.left=u,u.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},r.prototype._remove=function(e,t,n){var l;if(t===null)return null;t=sa(e,t,n);var u=n(e,t.key);return u===0?(t.left===null?l=t.right:(l=sa(e,t.left,n),l.right=t.right),this._size--,l):t},r.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=sa(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},r.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var l=n(e,t.key);if(l===0)return t;l<0?t=t.left:t=t.right}return null},r.prototype.find=function(e){return this._root&&(this._root=sa(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},r.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var l=n(e,t.key);if(l===0)return!0;l<0?t=t.left:t=t.right}return!1},r.prototype.forEach=function(e,t){for(var n=this._root,l=[],u=!1;!u;)n!==null?(l.push(n),n=n.left):l.length!==0?(n=l.pop(),e.call(t,n),n=n.right):u=!0;return this},r.prototype.range=function(e,t,n,l){for(var u=[],d=this._comparator,a=this._root,_;u.length!==0||a;)if(a)u.push(a),a=a.left;else{if(a=u.pop(),_=d(a.key,t),_>0)break;if(d(a.key,e)>=0&&n.call(l,a))return this;a=a.right}return this},r.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},r.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},r.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},r.prototype.at=function(e){for(var t=this._root,n=!1,l=0,u=[];!n;)if(t)u.push(t),t=t.left;else if(u.length>0){if(t=u.pop(),l===e)return t;l++,t=t.right}else n=!0;return null},r.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var l=this._comparator;t;){var u=l(e.key,t.key);if(u===0)break;u<0?(n=t,t=t.left):t=t.right}return n},r.prototype.prev=function(e){var t=this._root,n=null;if(e.left!==null){for(n=e.left;n.right;)n=n.right;return n}for(var l=this._comparator;t;){var u=l(e.key,t.key);if(u===0)break;u<0?t=t.left:(n=t,t=t.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return BT(this._root)},r.prototype.load=function(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!1);var l=e.length,u=this._comparator;if(n&&Wm(e,t,0,l-1,u),this._root===null)this._root=qm(e,t,0,l),this._size=l;else{var d=FT(this.toList(),RT(e,t),u);l=this._size+l,this._root=Gm({head:d},0,l)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(e){e===void 0&&(e=function(n){return String(n.key)});var t=[];return Vm(this._root,"",!0,function(n){return t.push(n)},e),t.join("")},r.prototype.update=function(e,t,n){var l=this._comparator,u=M0(e,this._root,l),d=u.left,a=u.right;l(e,t)<0?a=rm(t,n,a,l):d=rm(t,n,d,l),this._root=DT(d,a,l)},r.prototype.split=function(e){return M0(e,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var e,t,n;return PT(this,function(l){switch(l.label){case 0:e=this._root,t=[],n=!1,l.label=1;case 1:return n?[3,6]:e===null?[3,2]:(t.push(e),e=e.left,[3,5]);case 2:return t.length===0?[3,4]:(e=t.pop(),[4,e]);case 3:return l.sent(),e=e.right,[3,5];case 4:n=!0,l.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function qm(r,e,t,n){var l=n-t;if(l>0){var u=t+Math.floor(l/2),d=r[u],a=e[u],_=new pa(d,a);return _.left=qm(r,e,t,u),_.right=qm(r,e,u+1,n),_}return null}function RT(r,e){for(var t=new pa(null,null),n=t,l=0;l0?(e=u=u.next=t.pop(),e=e.right):n=!0;return u.next=null,l.next}function Gm(r,e,t){var n=t-e;if(n>0){var l=e+Math.floor(n/2),u=Gm(r,e,l),d=r.head;return d.left=u,r.head=r.head.next,d.right=Gm(r,l+1,t),d}return null}function FT(r,e,t){for(var n=new pa(null,null),l=n,u=r,d=e;u!==null&&d!==null;)t(u.key,d.key)<0?(l.next=u,u=u.next):(l.next=d,d=d.next),l=l.next;return u!==null?l.next=u:d!==null&&(l.next=d),n.next}function Wm(r,e,t,n,l){if(!(t>=n)){for(var u=r[t+n>>1],d=t-1,a=n+1;;){do d++;while(l(r[d],u)<0);do a--;while(l(r[a],u)>0);if(d>=a)break;var _=r[d];r[d]=r[a],r[a]=_,_=e[d],e[d]=e[a],e[a]=_}Wm(r,e,t,a,l),Wm(r,e,a+1,n,l)}}const Ps=11102230246251565e-32,Ii=134217729,OT=(3+8*Ps)*Ps;function nm(r,e,t,n,l){let u,d,a,_,x=e[0],S=n[0],k=0,C=0;S>x==S>-x?(u=x,x=e[++k]):(u=S,S=n[++C]);let P=0;if(kx==S>-x?(d=x+u,a=u-(d-x),x=e[++k]):(d=S+u,a=u-(d-S),S=n[++C]),u=d,a!==0&&(l[P++]=a);kx==S>-x?(d=u+x,_=d-u,a=u-(d-_)+(x-_),x=e[++k]):(d=u+S,_=d-u,a=u-(d-_)+(S-_),S=n[++C]),u=d,a!==0&&(l[P++]=a);for(;k=Me||-Ze>=Me||(k=r-_e,a=r-(_e+k)+(k-l),k=t-ze,x=t-(ze+k)+(k-l),k=e-re,_=e-(re+k)+(k-u),k=n-ce,S=n-(ce+k)+(k-u),a===0&&_===0&&x===0&&S===0)||(Me=VT*d+OT*Math.abs(Ze),Ze+=_e*S+ce*a-(re*x+ze*_),Ze>=Me||-Ze>=Me))return Ze;U=a*ce,C=Ii*a,P=C-(C-a),D=a-P,C=Ii*ce,N=C-(C-ce),z=ce-N,K=D*z-(U-P*N-D*N-P*z),me=_*ze,C=Ii*_,P=C-(C-_),D=_-P,C=Ii*ze,N=C-(C-ze),z=ze-N,X=D*z-(me-P*N-D*N-P*z),B=K-X,k=K-B,Gi[0]=K-(B+k)+(k-X),O=U+B,k=O-U,G=U-(O-k)+(B-k),B=G-me,k=G-B,Gi[1]=G-(B+k)+(k-me),Y=O+B,k=Y-O,Gi[2]=O-(Y-k)+(B-k),Gi[3]=Y;const ht=nm(4,lc,4,Gi,C0);U=_e*S,C=Ii*_e,P=C-(C-_e),D=_e-P,C=Ii*S,N=C-(C-S),z=S-N,K=D*z-(U-P*N-D*N-P*z),me=re*x,C=Ii*re,P=C-(C-re),D=re-P,C=Ii*x,N=C-(C-x),z=x-N,X=D*z-(me-P*N-D*N-P*z),B=K-X,k=K-B,Gi[0]=K-(B+k)+(k-X),O=U+B,k=O-U,G=U-(O-k)+(B-k),B=G-me,k=G-B,Gi[1]=G-(B+k)+(k-me),Y=O+B,k=Y-O,Gi[2]=O-(Y-k)+(B-k),Gi[3]=Y;const It=nm(ht,C0,4,Gi,I0);U=a*S,C=Ii*a,P=C-(C-a),D=a-P,C=Ii*S,N=C-(C-S),z=S-N,K=D*z-(U-P*N-D*N-P*z),me=_*x,C=Ii*_,P=C-(C-_),D=_-P,C=Ii*x,N=C-(C-x),z=x-N,X=D*z-(me-P*N-D*N-P*z),B=K-X,k=K-B,Gi[0]=K-(B+k)+(k-X),O=U+B,k=O-U,G=U-(O-k)+(B-k),B=G-me,k=G-B,Gi[1]=G-(B+k)+(k-me),Y=O+B,k=Y-O,Gi[2]=O-(Y-k)+(B-k),Gi[3]=Y;const Ot=nm(It,I0,4,Gi,A0);return A0[Ot-1]}function GT(r,e,t,n,l,u){const d=(e-u)*(t-l),a=(r-l)*(n-u),_=d-a,x=Math.abs(d+a);return Math.abs(_)>=jT*x?_:-qT(r,e,t,n,l,u,x)}const ju=(r,e)=>r.ll.x<=e.x&&e.x<=r.ur.x&&r.ll.y<=e.y&&e.y<=r.ur.y,Zm=(r,e)=>{if(e.ur.x{if(-lar.x*e.y-r.y*e.x,mw=(r,e)=>r.x*e.x+r.y*e.y,z0=(r,e,t)=>{const n=GT(r.x,r.y,e.x,e.y,t.x,t.y);return n>0?-1:n<0?1:0},pd=r=>Math.sqrt(mw(r,r)),HT=(r,e,t)=>{const n={x:e.x-r.x,y:e.y-r.y},l={x:t.x-r.x,y:t.y-r.y};return $f(l,n)/pd(l)/pd(n)},$T=(r,e,t)=>{const n={x:e.x-r.x,y:e.y-r.y},l={x:t.x-r.x,y:t.y-r.y};return mw(l,n)/pd(l)/pd(n)},D0=(r,e,t)=>e.y===0?null:{x:r.x+e.x/e.y*(t-r.y),y:t},R0=(r,e,t)=>e.x===0?null:{x:t,y:r.y+e.y/e.x*(t-r.x)},XT=(r,e,t,n)=>{if(e.x===0)return R0(t,n,r.x);if(n.x===0)return R0(r,e,t.x);if(e.y===0)return D0(t,n,r.y);if(n.y===0)return D0(r,e,t.y);const l=$f(e,n);if(l==0)return null;const u={x:t.x-r.x,y:t.y-r.y},d=$f(u,e)/l,a=$f(u,n)/l,_=r.x+a*e.x,x=t.x+d*n.x,S=r.y+a*e.y,k=t.y+d*n.y,C=(_+x)/2,P=(S+k)/2;return{x:C,y:P}};class Mo{static compare(e,t){const n=Mo.comparePoints(e.point,t.point);return n!==0?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:ua.compare(e.segment,t.segment))}static comparePoints(e,t){return e.xt.x?1:e.yt.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,l=t.length;n{const u=l.otherSE;t.set(l,{sine:HT(this.point,e.point,u.point),cosine:$T(this.point,e.point,u.point)})};return(l,u)=>{t.has(l)||n(l),t.has(u)||n(u);const{sine:d,cosine:a}=t.get(l),{sine:_,cosine:x}=t.get(u);return d>=0&&_>=0?ax?-1:0:d<0&&_<0?ax?1:0:_d?1:0}}}let KT=0;class ua{static compare(e,t){const n=e.leftSE.point.x,l=t.leftSE.point.x,u=e.rightSE.point.x,d=t.rightSE.point.x;if(da&&_>x)return-1;const k=e.comparePoint(t.leftSE.point);if(k<0)return 1;if(k>0)return-1;const C=t.comparePoint(e.rightSE.point);return C!==0?C:-1}if(n>l){if(a<_&&a_&&a>S)return 1;const k=t.comparePoint(e.leftSE.point);if(k!==0)return k;const C=e.comparePoint(t.rightSE.point);return C<0?1:C>0?-1:1}if(a<_)return-1;if(a>_)return 1;if(ud){const k=e.comparePoint(t.rightSE.point);if(k<0)return 1;if(k>0)return-1}if(u!==d){const k=x-a,C=u-n,P=S-_,D=d-l;if(k>C&&PD)return-1}return u>d?1:uS?1:e.idt.id?1:0}constructor(e,t,n,l){this.id=++KT,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=l}static fromRing(e,t,n){let l,u,d;const a=Mo.comparePoints(e,t);if(a<0)l=e,u=t,d=1;else if(a>0)l=t,u=e,d=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);const _=new Mo(l,!0),x=new Mo(u,!1);return new ua(_,x,[n],[d])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,l=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x0&&a.swapEvents(),Mo.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(l.checkForConsuming(),u.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t0){const u=t;t=n,n=u}if(t.prev===n){const u=t;t=n,n=u}for(let u=0,d=n.rings.length;ul.length===1&&l[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${Wo.type}`)}return this._isInResult}}class B0{constructor(e,t,n){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const l=yh.round(e[0][0],e[0][1]);this.bbox={ll:{x:l.x,y:l.y},ur:{x:l.x,y:l.y}};let u=l;for(let d=1,a=e.length;dthis.bbox.ur.x&&(this.bbox.ur.x=_.x),_.y>this.bbox.ur.y&&(this.bbox.ur.y=_.y),u=_)}(l.x!==u.x||l.y!==u.y)&&this.segments.push(ua.fromRing(u,l,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;tthis.bbox.ur.x&&(this.bbox.ur.x=u.bbox.ur.x),u.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=u.bbox.ur.y),this.interiorRings.push(u)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;tthis.bbox.ur.x&&(this.bbox.ur.x=u.bbox.ur.x),u.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=u.bbox.ur.y),this.polys.push(u)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t0&&(e=d)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class O0{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,n=this.interiorRings.length;t1&&arguments[1]!==void 0?arguments[1]:ua.compare;this.queue=e,this.tree=new Rg(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const l=e.isLeft?this.tree.add(t):this.tree.find(t);if(!l)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let u=l,d=l,a,_;for(;a===void 0;)u=this.tree.prev(u),u===null?a=null:u.key.consumedBy===void 0&&(a=u.key);for(;_===void 0;)d=this.tree.next(d),d===null?_=null:d.key.consumedBy===void 0&&(_=d.key);if(e.isLeft){let x=null;if(a){const k=a.getIntersection(t);if(k!==null&&(t.isAnEndpoint(k)||(x=k),!a.isAnEndpoint(k))){const C=this._splitSafely(a,k);for(let P=0,D=C.length;P0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=a)}else{if(a&&_){const x=a.getIntersection(_);if(x!==null){if(!a.isAnEndpoint(x)){const S=this._splitSafely(a,x);for(let k=0,C=S.length;kN0)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const d=new QT(u);let a=u.size,_=u.pop();for(;_;){const S=_.key;if(u.size===a){const C=S.segment;throw new Error(`Unable to pop() ${S.isLeft?"left":"right"} SweepEvent [${S.point.x}, ${S.point.y}] from segment #${C.id} [${C.leftSE.point.x}, ${C.leftSE.point.y}] -> [${C.rightSE.point.x}, ${C.rightSE.point.y}] from queue.`)}if(u.size>N0)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(d.segments.length>eE)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const k=d.process(S);for(let C=0,P=k.length;C1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n{t.push(l.coordinates)}),t.length<2)throw new Error("Must have at least 2 geometries");const n=gw.union(t[0],...t.slice(1));return n.length===0?null:n.length===1?Dg(n[0],e.properties):pw(n,e.properties)}var yw=aE;function lE(r,e={}){if(r.bbox!=null&&e.recompute!==!0)return r.bbox;const t=[1/0,1/0,-1/0,-1/0];return _w(r,n=>{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]{e.push(l.coordinates)}),e.length<2)throw new Error("Must have at least two features");const t=r.features[0].properties||{},n=gw.difference(e[0],...e.slice(1));return n.length===0?null:n.length===1?Dg(n[0],t):pw(n,t)}var uE=cE;function hE(r){if(!r)throw new Error("geojson is required");var e=[];return sE(r,function(t){e.push(t)}),_h(e)}var fE=hE;function U0(r,e){const t=uE(_h([Dg([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!t)return;t.properties={isMask:!0};const n=dd(j0(r)),l=(n[2]-n[0])/360/1e3,u=n[0]<-180,d=n[2]>180,a=fE(r);if(a.features.length>1&&(u||d))for(const _ of a.features){const x=dd(j0(_));if(d&&x[0]<-180+l)for(const S of _.geometry.coordinates)for(const k of S)k[0]+=360-l;if(u&&x[2]>180-l)for(const S of _.geometry.coordinates)for(const k of S)k[0]-=360-l}e(_h([a.features.length<2?r:yw(a)??r,t]))}const V0={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}},Ff="mtlr-gc-full-geom",q0="mtlr-gc-full-geom-fill",G0="mtlr-gc-full-geom-line";function vw(r,e,t=!0,n=!0,l={},u={},d=V0){let a;const _=[];let x,S,k;function C(){if(!r.loaded){r.once("load",C);return}const z=d?d===!0?V0:d:void 0;if(!(z!=null&&z.fill)&&!(z!=null&&z.line))return;const B=r.getSource(Ff);if(B)B.setData(k??_h([]));else if(k)r.addSource(Ff,{type:"geojson",data:k});else return;!r.getLayer(q0)&&z!=null&&z.fill&&r.addLayer({...z==null?void 0:z.fill,id:q0,type:"fill",source:Ff}),!r.getLayer(G0)&&z!=null&&z.line&&r.addLayer({...z==null?void 0:z.line,id:G0,type:"line",source:Ff})}function P(z){k=z,C()}r.on("styledata",()=>{setTimeout(()=>{k&&C()})});const D=z=>{a==null||a({type:"mapClick",coordinates:[z.lngLat.lng,z.lngLat.lat]})};function N(z=!1){if(!e)throw new Error;const B=document.createElement("div");return z&&B.classList.add("marker-interactive"),new aT({props:{displayIn:"maplibre"},target:B}),new e.Marker({element:B,offset:[1,-13]})}return{setEventHandler(z){z?(a=z,r.on("click",D)):(a=void 0,r.off("click",D))},flyTo(z,B){r.flyTo({center:z,...B?{zoom:B}:{},...l})},fitBounds(z,B,O){r.fitBounds([[z[0],z[1]],[z[2],z[3]]],{padding:B,...O?{maxZoom:O}:{},...u})},indicateReverse(z){r.getCanvasContainer().style.cursor=z?"crosshair":""},setReverseMarker(z){!e||!t||(S?z?S.setLngLat(z):(S.remove(),S=void 0):z&&(t instanceof Function?S=t(r)??void 0:(S=(typeof t=="object"?new e.Marker(t):N()).setLngLat(z).addTo(r),S.getElement().classList.add("marker-reverse"))))},setFeatures(z,B,O){for(const G of _)G.remove();if(_.length=0,P(void 0),!!e){if(B){let G=!1;if(B.geometry.type==="GeometryCollection"){const U=B.geometry.geometries.filter(K=>K.type==="Polygon"||K.type==="MultiPolygon");e:if(U.length>0){const K=yw(_h(U.map(me=>gh(me))));if(!K)break e;U0({...B,geometry:K.geometry},P),G=!0}else{const K=B.geometry.geometries.filter(me=>me.type==="LineString"||me.type==="MultiLineString");K.length>0&&(P({...B,geometry:{type:"GeometryCollection",geometries:K}}),G=!0)}}if(!G){if(B.geometry.type==="Polygon"||B.geometry.type==="MultiPolygon")U0(B,P);else if(B.geometry.type==="LineString"||B.geometry.type==="MultiLineString"){P(B);return}}if(!O&&B.geometry.type!=="Point")return;if(t instanceof Function){const U=t(r,B);U&&_.push(U)}else t&&_.push(typeof t=="object"?new e.Marker(t):N().setLngLat(B.center).addTo(r))}if(n)for(const G of z??[]){if(G===B)continue;let U;if(n instanceof Function){if(U=n(r,G),!U)continue}else U=(typeof n=="object"?new e.Marker(n):N(!0)).setLngLat(G.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(G.place_type[0]==="reverse"?G.place_name:G.place_name.replace(/,.*/,""))).addTo(r);const K=U.getElement();K.addEventListener("click",me=>{me.stopPropagation(),a==null||a({type:"markerClick",id:G.id})}),K.addEventListener("mouseenter",()=>{a==null||a({type:"markerMouseEnter",id:G.id}),U.togglePopup()}),K.addEventListener("mouseleave",()=>{a==null||a({type:"markerMouseLeave",id:G.id}),U.togglePopup()}),_.push(U)}}},setSelectedMarker(z){x&&x.getElement().classList.toggle("marker-selected",!1),x=z>-1?_[z]:void 0,x==null||x.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const z=r.getCenter();return[r.getZoom(),z.lng,z.lat]}}}function dE(r,e,t){var n,l;class u{constructor(z,B){fo(this,"type"),fo(this,"target"),this.type=B,this.target=z}}class d extends u{constructor(z,B){super(z,"select"),fo(this,"feature"),Object.assign(this,B)}}class a extends u{constructor(z,B){super(z,"featureslisted"),fo(this,"features"),this.features=B}}class _ extends u{constructor(z,B){super(z,"featuresmarked"),fo(this,"features"),this.features=B}}class x extends u{constructor(z,B){super(z,"optionsvisibilitychange"),fo(this,"optionsVisible"),this.optionsVisible=B}}class S extends u{constructor(z,B){super(z,"pick"),fo(this,"feature"),this.feature=B}}class k extends u{constructor(z,B){super(z,"querychange"),fo(this,"query"),this.query=B}}class C extends u{constructor(z,B,O){super(z,"response"),fo(this,"url"),fo(this,"featureCollection"),this.url=B,this.featureCollection=O}}class P extends u{constructor(z,B){super(z,"reversetoggle"),fo(this,"reverse"),this.reverse=B}}class D extends r{constructor(z={}){super(),a0(this,n),a0(this,l),l0(this,l,z)}onAddInt(z){const B=document.createElement("div");B.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl mapboxgl-ctrl-group";const{marker:O,showResultMarkers:G,flyTo:U,fullGeometryStyle:K,...me}=Qn(this,l),X=typeof U=="boolean"?{}:U,Y={mapController:vw(z,e,O,G,X,X,K),flyTo:U===void 0?!0:!!U,apiKey:"",...t==null?void 0:t(z,B),...me};if(!Y.apiKey)throw new Error("no apiKey provided");return l0(this,n,new LT({target:B,props:Y})),Qn(this,n).$on("select",_e=>{this.fire(new d(this,_e.detail))}),Qn(this,n).$on("pick",_e=>{this.fire(new S(this,_e.detail.feature))}),Qn(this,n).$on("featureslisted",_e=>{this.fire(new a(this,_e.detail.features))}),Qn(this,n).$on("featuresmarked",_e=>{this.fire(new _(this,_e.detail.features))}),Qn(this,n).$on("response",_e=>{this.fire(new C(this,_e.detail.url,_e.detail.featureCollection))}),Qn(this,n).$on("optionsvisibilitychange",_e=>{this.fire(new x(this,_e.detail.optionsVisible))}),Qn(this,n).$on("reversetoggle",_e=>{this.fire(new P(this,_e.detail.reverse))}),Qn(this,n).$on("querychange",_e=>{this.fire(new k(this,_e.detail.query))}),B}on(z,B){return super.on(z,B)}once(z,B){return super.once(z,B)}off(z,B){return super.off(z,B)}listens(z){return super.listens(z)}setOptions(z){var B;Object.assign(Qn(this,l),z);const{marker:O,showResultMarkers:G,flyTo:U,fullGeometryStyle:K,...me}=Qn(this,l);(B=Qn(this,n))==null||B.$set(me)}setQuery(z,B=!0){var O;(O=Qn(this,n))==null||O.setQuery(z,B)}clearMap(){var z;(z=Qn(this,n))==null||z.clearMap()}clearList(){var z;(z=Qn(this,n))==null||z.clearList()}setReverseMode(z){var B;(B=Qn(this,n))==null||B.$set({reverseActive:z})}focus(){var z;(z=Qn(this,n))==null||z.focus()}blur(){var z;(z=Qn(this,n))==null||z.blur()}onRemove(){var z;(z=Qn(this,n))==null||z.$destroy()}}return n=new WeakMap,l=new WeakMap,{MapLibreBasedGeocodingControl:D,events:{SelectEvent:d,FeaturesListedEvent:a,FeaturesMarkedEvent:_,OptionsVisibilityChangeEvent:x,PickEvent:S,QueryChangeEvent:k,ResponseEvent:C,ReverseToggleEvent:P}}}const{MapLibreBasedGeocodingControl:FD,events:va}=dE(Pc.Evented,l4);va.SelectEvent;va.FeaturesListedEvent;va.FeaturesMarkedEvent;va.OptionsVisibilityChangeEvent;va.PickEvent;va.QueryChangeEvent;va.ResponseEvent;va.ReverseToggleEvent;function pE(r){let e,t;return{c(){e=Ls("svg"),t=Ls("path"),Ee(t,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),Ee(e,"viewBox","0 0 14 14"),Ee(e,"width","13"),Ee(e,"height","13"),Ee(e,"class","svelte-en2qvf")},m(n,l){be(n,e,l),ie(e,t)},p:Ct,i:Ct,o:Ct,d(n){n&&ve(e)}}}class bw extends Ht{constructor(e){super(),Zt(this,e,null,pE,jt,{})}}function mE(r){let e,t;return{c(){e=Ls("svg"),t=Ls("path"),Ee(t,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),Ee(e,"viewBox","0 0 30 30"),Ee(e,"fill","none"),Ee(e,"xmlns","http://www.w3.org/2000/svg"),Ee(e,"class","svelte-d2loi5")},m(n,l){be(n,e,l),ie(e,t)},p:Ct,i:Ct,o:Ct,d(n){n&&ve(e)}}}class ww extends Ht{constructor(e){super(),Zt(this,e,null,mE,jt,{})}}function gE(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"area.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"area.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function _E(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"reverse.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"reverse.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function yE(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"poi.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"poi.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function vE(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"postal_code.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"postal_code.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function bE(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"street.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"street.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function wE(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"road.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"road.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function xE(r){let e,t;return{c(){e=fe("img"),En(e.src,t=r[3]+"housenumber.svg")||Ee(e,"src",t),Ee(e,"alt",r[6]),Ee(e,"class","svelte-ltkwvy")},m(n,l){be(n,e,l)},p(n,l){l&8&&!En(e.src,t=n[3]+"housenumber.svg")&&Ee(e,"src",t),l&64&&Ee(e,"alt",n[6])},d(n){n&&ve(e)}}}function SE(r){let e,t,n,l;return{c(){e=fe("img"),En(e.src,t=r[5])||Ee(e,"src",t),Ee(e,"alt",r[4]),Ee(e,"class","svelte-ltkwvy")},m(u,d){be(u,e,d),n||(l=Tt(e,"error",r[14]),n=!0)},p(u,d){d&32&&!En(e.src,t=u[5])&&Ee(e,"src",t),d&16&&Ee(e,"alt",u[4])},d(u){u&&ve(e),n=!1,l()}}}function W0(r){let e,t;return{c(){e=fe("span"),t=rt(r[6]),Ee(e,"class","secondary svelte-ltkwvy")},m(n,l){be(n,e,l),ie(e,t)},p(n,l){l&64&&Lr(t,n[6])},d(n){n&&ve(e)}}}function kE(r){let e,t,n,l,u,d,a,_,x,S=(r[7]?r[0].place_name:r[0].place_name.replace(/,.*/,""))+"",k,C,P=r[2]==="always"||r[2]!=="never"&&!r[0].address&&!r[0].id.startsWith("road.")&&!r[0].id.startsWith("address.")&&!r[0].id.startsWith("postal_code.")&&(!r[0].id.startsWith("poi.")||!r[5])&&!r[7],D,N,z=(r[7]?"":r[0].place_name.replace(/[^,]*,?\s*/,""))+"",B,O,G;function U(Y,_e){return _e&1&&(t=null),_e&1&&(n=null),_e&1&&(l=null),_e&1&&(u=null),Y[5]?SE:Y[0].address?xE:(t==null&&(t=!!Y[0].id.startsWith("road.")),t?wE:(n==null&&(n=!!Y[0].id.startsWith("address.")),n?bE:(l==null&&(l=!!Y[0].id.startsWith("postal_code.")),l?vE:(u==null&&(u=!!Y[0].id.startsWith("poi.")),u?yE:Y[7]?_E:gE))))}let K=U(r,-1),me=K(r),X=P&&W0(r);return{c(){e=fe("li"),me.c(),d=Ve(),a=fe("span"),_=fe("span"),x=fe("span"),k=rt(S),C=Ve(),X&&X.c(),D=Ve(),N=fe("span"),B=rt(z),Ee(x,"class","primary svelte-ltkwvy"),Ee(_,"class","svelte-ltkwvy"),Ee(N,"class","line2 svelte-ltkwvy"),Ee(a,"class","texts svelte-ltkwvy"),Ee(e,"tabindex","0"),Ee(e,"data-selected",r[1]),Ee(e,"class","svelte-ltkwvy"),hi(e,"selected",r[1])},m(Y,_e){be(Y,e,_e),me.m(e,null),ie(e,d),ie(e,a),ie(a,_),ie(_,x),ie(x,k),ie(_,C),X&&X.m(_,null),ie(a,D),ie(a,N),ie(N,B),O||(G=[Tt(e,"mouseenter",r[12]),Tt(e,"focus",r[13])],O=!0)},p(Y,[_e]){K===(K=U(Y,_e))&&me?me.p(Y,_e):(me.d(1),me=K(Y),me&&(me.c(),me.m(e,d))),_e&1&&S!==(S=(Y[7]?Y[0].place_name:Y[0].place_name.replace(/,.*/,""))+"")&&Lr(k,S),_e&37&&(P=Y[2]==="always"||Y[2]!=="never"&&!Y[0].address&&!Y[0].id.startsWith("road.")&&!Y[0].id.startsWith("address.")&&!Y[0].id.startsWith("postal_code.")&&(!Y[0].id.startsWith("poi.")||!Y[5])&&!Y[7]),P?X?X.p(Y,_e):(X=W0(Y),X.c(),X.m(_,null)):X&&(X.d(1),X=null),_e&1&&z!==(z=(Y[7]?"":Y[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Lr(B,z),_e&2&&Ee(e,"data-selected",Y[1]),_e&2&&hi(e,"selected",Y[1])},i:Ct,o:Ct,d(Y){Y&&ve(e),me.d(),X&&X.d(),O=!1,_n(G)}}}function TE(r,e,t){var G;let n,l,{feature:u}=e,{selected:d=!1}=e,{showPlaceType:a}=e,{missingIconsCache:_}=e,{iconsBaseUrl:x}=e;const S=(G=u.properties)==null?void 0:G.categories;let k,C,P=0,D=u.place_type[0]==="reverse";function N(){C&&_.add(C),t(10,P++,P)}function z(U){ur.call(this,r,U)}function B(U){ur.call(this,r,U)}const O=()=>N();return r.$$set=U=>{"feature"in U&&t(0,u=U.feature),"selected"in U&&t(1,d=U.selected),"showPlaceType"in U&&t(2,a=U.showPlaceType),"missingIconsCache"in U&&t(9,_=U.missingIconsCache),"iconsBaseUrl"in U&&t(3,x=U.iconsBaseUrl)},r.$$.update=()=>{var U,K,me,X;if(r.$$.dirty&3640)do t(11,n--,n),t(4,k=S==null?void 0:S[n]),t(5,C=k?x+k.replace(/ /g,"_")+".svg":void 0);while(n>-1&&(!C||_.has(C)));r.$$.dirty&1&&t(6,l=((K=(U=u.properties)==null?void 0:U.categories)==null?void 0:K.join(", "))??((X=(me=u.properties)==null?void 0:me.place_type_name)==null?void 0:X[0])??u.place_type[0])},t(11,n=(S==null?void 0:S.length)??0),[u,d,a,x,k,C,l,D,N,_,P,n,z,B,O]}class EE extends Ht{constructor(e){super(),Zt(this,e,TE,kE,jt,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function ME(r){let e;return{c(){e=fe("div"),e.innerHTML='',Ee(e,"class","svelte-7cmwmc")},m(t,n){be(t,e,n)},p:Ct,i:Ct,o:Ct,d(t){t&&ve(e)}}}class CE extends Ht{constructor(e){super(),Zt(this,e,null,ME,jt,{})}}function IE(r){let e,t;return{c(){e=Ls("svg"),t=Ls("path"),Ee(t,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),Ee(e,"viewBox","0 0 60.006 21.412"),Ee(e,"width","14"),Ee(e,"height","20"),Ee(e,"class","svelte-en2qvf")},m(n,l){be(n,e,l),ie(e,t)},p:Ct,i:Ct,o:Ct,d(n){n&&ve(e)}}}class AE extends Ht{constructor(e){super(),Zt(this,e,null,IE,jt,{})}}function LE(r){let e,t,n;return{c(){e=Ls("svg"),t=Ls("circle"),n=Ls("path"),Ee(t,"cx","4.789"),Ee(t,"cy","4.787"),Ee(t,"r","3.85"),Ee(t,"class","svelte-1aq105l"),Ee(n,"d","M12.063 12.063 7.635 7.635"),Ee(n,"class","svelte-1aq105l"),Ee(e,"xmlns","http://www.w3.org/2000/svg"),Ee(e,"width","13"),Ee(e,"height","13"),Ee(e,"viewBox","0 0 13 13"),Ee(e,"class","svelte-1aq105l")},m(l,u){be(l,e,u),ie(e,t),ie(e,n)},p:Ct,i:Ct,o:Ct,d(l){l&&ve(e)}}}class PE extends Ht{constructor(e){super(),Zt(this,e,null,LE,jt,{})}}function zE(r,e,t){const n=e[1],l=e[0],u=n-l;return r===n&&t?r:((r-l)%u+u)%u+l}function Z0(r){const e=[...r];return e[2]Math.abs((e[0]-360+e[2])/2)?e[0]-=360:e[2]+=360),e}let Uu;async function DE(r,e,t){const n=r==null?void 0:r.getCenterAndZoom();for(const l of e??[])if(!(n&&(l.minZoom!=null&&l.minZoom>n[0]||l.maxZoom!=null&&l.maxZoomDate.now()){if(!Uu.coords)break e;return Uu.coords}let u;try{return u=await new Promise((d,a)=>{t.signal.addEventListener("abort",()=>{a(Error("aborted"))}),navigator.geolocation.getCurrentPosition(_=>{d([_.coords.longitude,_.coords.latitude].map(x=>x.toFixed(6)).join(","))},_=>{a(_)},l)}),u}catch{}finally{l.cachedLocationExpiry&&(Uu={time:Date.now(),coords:u})}if(t.signal.aborted)return}if(l.type==="server-geolocation")return"ip";if(n&&l.type==="map-center")return n[1].toFixed(6)+","+n[2].toFixed(6)}}const RE=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([6-9][0-9])\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*(EAST|WEST|[EW])?$/i,H0=/^([+-]?[0-8]?[0-9])\s+([0-5]?[0-9]\.\d{3,})[\s,]{1,}([+-]?[0-1]?[0-9]?[0-9])\s+([0-5]?[0-9]\.\d{3,})$/,$0=/^(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?$/i,X0=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?$/i,K0=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?$/i,J0=/^(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?$/i;function BE(r){if(!["DMS","DM","DD"].includes(r))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){const e=this.decimalCoordinates.split(",").map(P=>Number(P.trim())),t=Number(e[0]),n=Number(e[1]),l=Math.abs(t),u=Math.abs(n),d=t>0?"N":"S",a=n>0?"E":"W";let _;r=="DD"&&(_=`${l}° ${d}, ${u}° ${a}`);const x=Math.floor(l),S=Math.floor(u),k=(l-x)*60,C=(u-S)*60;if(r=="DM"){let P=Y0(k,3).toFixed(3).padStart(6,"0"),D=Y0(C,3).toFixed(3).padStart(6,"0");P.endsWith(".000")&&D.endsWith(".000")&&(P=P.replace(/\.000$/,""),D=D.replace(/\.000$/,"")),_=`${x}° ${P}' ${d}, ${S}° ${D}' ${a}`}if(r=="DMS"){const P=Math.floor(k),D=Math.floor(C);let N=((k-P)*60).toFixed(1).padStart(4,"0"),z=((C-D)*60).toFixed(1).padStart(4,"0");const B=P.toString().padStart(2,"0"),O=D.toString().padStart(2,"0");N.endsWith(".0")&&z.endsWith(".0")&&(N=N.replace(/\.0$/,""),z=z.replace(/\.0$/,"")),_=`${x}° ${B}' ${N}" ${d}, ${S}° ${O}' ${z}" ${a}`}return _}else throw new Error("no decimal coordinates to convert")}function Y0(r,e){const t=Math.pow(10,e);return Math.round((r+Number.EPSILON)*t)/t}function Fg(r,e){e||(e=5),r=r.replace(/\s+/g," ").trim();let t=null,n=null,l="",u="",d=null,a=[],_=!1;if(RE.test(r))throw new Error("invalid coordinate value");if(H0.test(r))if(a=H0.exec(r),_=Vu(a),_)t=Math.abs(a[1])+a[2]/60,Number(a[1])<0&&(t*=-1),n=Math.abs(a[3])+a[4]/60,Number(a[3])<0&&(n*=-1),d="DM";else throw new Error("invalid coordinate format");else if($0.test(r))if(a=$0.exec(r),_=Vu(a),_){if(t=a[2],n=a[6],t.includes(",")&&(t=t.replace(",",".")),n.includes(",")&&(n=n.replace(",",".")),d="DD",Number(Math.round(t))==Number(t))throw new Error("integer only coordinate provided");if(Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");a[1]?(l=a[1],u=a[5]):a[4]&&(l=a[4],u=a[8])}else throw new Error("invalid decimal coordinate format");else if(X0.test(r))if(a=X0.exec(r),_=Vu(a),_)t=Math.abs(parseInt(a[2])),a[4]&&(t+=a[4]/60,d="DM"),a[6]&&(t+=a[6].replace(",",".")/3600,d="DMS"),parseInt(a[2])<0&&(t=-1*t),n=Math.abs(parseInt(a[9])),a[11]&&(n+=a[11]/60),a[13]&&(n+=a[13].replace(",",".")/3600),parseInt(a[9])<0&&(n=-1*n),a[1]?(l=a[1],u=a[8]):a[7]&&(l=a[7],u=a[14]);else throw new Error("invalid DMS coordinates format");else if(K0.test(r))if(a=K0.exec(r),_=Vu(a),_)t=Math.abs(parseInt(a[2])),a[4]&&(t+=a[4]/60,d="DM"),a[6]&&(t+=a[6]/3600,d="DMS"),parseInt(a[2])<0&&(t=-1*t),n=Math.abs(parseInt(a[10])),a[12]&&(n+=a[12]/60),a[14]&&(n+=a[14]/3600),parseInt(a[10])<0&&(n=-1*n),a[1]?(l=a[1],u=a[9]):a[8]&&(l=a[8],u=a[16]);else throw new Error("invalid DMS coordinates format");else if(J0.test(r)){if(a=J0.exec(r),_=Vu(a),a.filter(x=>x).length<=5)throw new Error("invalid coordinates format");if(_)t=Math.abs(parseInt(a[2])),a[4]&&(t+=a[4].replace(",",".")/60,d="DM"),a[6]&&(t+=a[6].replace(",",".")/3600,d="DMS"),parseInt(a[2])<0&&(t=-1*t),n=Math.abs(parseInt(a[10])),a[12]&&(n+=a[12].replace(",",".")/60),a[14]&&(n+=a[14].replace(",",".")/3600),parseInt(a[10])<0&&(n=-1*n),a[1]?(l=a[1],u=a[9]):a[8]&&(l=a[8],u=a[16]);else throw new Error("invalid coordinates format")}if(_){if(Math.abs(n)>=180)throw new Error("invalid longitude value");if(Math.abs(t)>=90)throw new Error("invalid latitude value");if(l&&!u||!l&&u)throw new Error("invalid coordinates value");if(l&&l==u)throw new Error("invalid coordinates format");t.toString().includes(",")&&(t=t.replace(",",".")),n.toString().includes(",")&&(n=n.replace(",","."));let x=/S|SOUTH/i;x.test(l)&&t>0&&(t=-1*t),x=/W|WEST/i,x.test(u)&&n>0&&(n=-1*n);const S=a[0].trim();let k,C;const P=/[,/;\u0020]/g,D=S.match(P);if(D==null){const B=Math.floor(r.length/2);k=S.substring(0,B).trim(),C=S.substring(B).trim()}else{let B;D.length%2==1?B=Math.floor(D.length/2):B=D.length/2-1;let O=0;if(B==0)O=S.indexOf(D[0]),k=S.substring(0,O).trim(),C=S.substring(O+1).trim();else{let G=0,U=0;for(;G<=B;)O=S.indexOf(D[G],U),U=O+1,G++;k=S.substring(0,O).trim(),C=S.substring(O+1).trim()}}const N=k.split(".");if(N.length==2&&N[1]==0&&N[1].length!=2)throw new Error("invalid coordinates format");const z=C.split(".");if(z.length==2&&z[1]==0&&z[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(k)||/^\d+$/.test(C))throw new Error("degree only coordinate/s provided");return t=Number(Number(t).toFixed(e)),n=Number(Number(n).toFixed(e)),Object.freeze({verbatimCoordinates:S,verbatimLatitude:k,verbatimLongitude:C,decimalLatitude:t,decimalLongitude:n,decimalCoordinates:`${t},${n}`,originalFormat:d,closeEnough:FE,toCoordinateFormat:BE})}else throw new Error("coordinates pattern match failed")}function Vu(r){if(!isNaN(r[0]))return!1;const e=[...r];if(e.shift(),e.length%2>0)return!1;const t=/^[-+]?\d+([\.,]\d+)?$/,n=/[eastsouthnorthwest]+/i,l=e.length/2;for(let u=0;u{e.decimalLatitude?r.push(e):r.push({...e,...jE})}),[...r,...UE,...VE]}const GE=qE();Fg.formats=GE.map(r=>r.verbatimCoordinates);const WE=Fg;function e1(r,e,t){const n=r.slice();return n[84]=e[t],n[86]=t,n}function t1(r){let e,t;return e=new CE({}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function r1(r){let e,t,n,l,u;return t=new AE({}),{c(){e=fe("button"),je(t.$$.fragment),Ee(e,"type","button"),Ee(e,"title",r[9]),Ee(e,"class","svelte-bz0zu3"),hi(e,"active",r[0])},m(d,a){be(d,e,a),Oe(t,e,null),n=!0,l||(u=Tt(e,"click",r[69]),l=!0)},p(d,a){(!n||a[0]&512)&&Ee(e,"title",d[9]),(!n||a[0]&1)&&hi(e,"active",d[0])},i(d){n||(oe(t.$$.fragment,d),n=!0)},o(d){de(t.$$.fragment,d),n=!1},d(d){d&&ve(e),Ne(t),l=!1,u()}}}function ZE(r){let e,t=[],n=new Map,l,u,d,a=Jn(r[14]);const _=x=>x[84].id+(x[84].address?","+x[84].address:"");for(let x=0;x{X=null}),br()),(!G||ht[0]&2)&&hi(x,"displayable",Me[1]!==""),Me[5]==="button"?Y?(Y.p(Me,ht),ht[0]&32&&oe(Y,1)):(Y=r1(Me),Y.c(),oe(Y,1),Y.m(n,D)):Y&&(vr(),de(Y,1,1,()=>{Y=null}),br()),ze&&ze.p&&(!G||ht[1]&536870912)&&Gr(ze,_e,Me,Me[60],G?qr(_e,Me[60],ht,null):Wr(Me[60]),null);let It=z;z=Ze(Me),z===It?~z&&ce[z].p(Me,ht):(B&&(vr(),de(ce[It],1,1,()=>{ce[It]=null}),br()),~z?(B=ce[z],B?B.p(Me,ht):(B=ce[z]=re[z](Me),B.c()),oe(B,1),B.m(t,null)):B=null),(!G||ht[0]&4&&O!==(O=od(Me[2])+" svelte-bz0zu3"))&&Ee(t,"class",O),(!G||ht[0]&22)&&hi(t,"can-collapse",Me[4]&&Me[1]==="")},i(Me){G||(oe(me),oe(u.$$.fragment,Me),oe(k.$$.fragment,Me),oe(X),oe(Y),oe(ze,Me),oe(B),G=!0)},o(Me){de(me),de(u.$$.fragment,Me),de(k.$$.fragment,Me),de(X),de(Y),de(ze,Me),de(B),G=!1},d(Me){Me&&(ve(e),ve(t)),Ne(u),r[63](null),Ne(k),X&&X.d(),Y&&Y.d(),ze&&ze.d(Me),~z&&ce[z].d(),U=!1,_n(K)}}}function JE(r,e,t){let n,l,{$$slots:u={},$$scope:d}=e;const a={continental_marine:4,country:4,major_landform:8,region:5,subregion:6,county:7,joint_municipality:8,joint_submunicipality:9,municipality:10,municipal_district:11,locality:12,neighbourhood:13,place:14,postal_code:14,road:16,poi:17,address:18,"poi.peak":15,"poi.shop":18,"poi.cafe":18,"poi.restaurant":18,"poi.aerodrome":13};let{class:_=void 0}=e,{apiKey:x}=e,{bbox:S=void 0}=e,{clearButtonTitle:k="clear"}=e,{clearOnBlur:C=!1}=e,{collapsed:P=!1}=e,{country:D=void 0}=e,{debounceSearch:N=200}=e,{enableReverse:z="never"}=e,{errorMessage:B="Something went wrong…"}=e,{filter:O=()=>!0}=e,{flyTo:G=!0}=e,{fuzzyMatch:U=!0}=e,{language:K=void 0}=e,{limit:me=void 0}=e,{mapController:X=void 0}=e,{minLength:Y=2}=e,{noResultsMessage:_e="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:ze="Search"}=e,{proximity:re=[{type:"server-geolocation"}]}=e,{reverseActive:ce=z==="always"}=e,{reverseButtonTitle:Ze="toggle reverse geocoding"}=e,{searchValue:Me=""}=e,{pickedResultStyle:ht="full-geometry"}=e,{showPlaceType:It="if-needed"}=e,{showResultsWhileTyping:Ot=!0}=e,{selectFirst:Ke=!0}=e,{flyToSelected:Kt=!1}=e,{markerOnSelected:vt=!0}=e,{types:Lt=void 0}=e,{exhaustiveReverseGeocoding:Vt=!1}=e,{excludeTypes:sr=!1}=e,{zoom:fr=a}=e,{apiUrl:er="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Nt={}}=e,{iconsBaseUrl:nr="https://cdn.maptiler.com/maptiler-geocoding-control/v2.0.1/icons/"}=e,{adjustUrlQuery:tr=()=>{}}=e;function Pr(){We.focus()}function pt(){We.blur()}function Et(W,Be=!0,Fe=!1){t(1,Me=W),Be?(t(15,Ye=-1),lt()):(Jt(!Fe,Fe),setTimeout(()=>{We.focus(),We.select()}))}function gr(){t(14,tt=void 0),t(56,ne=void 0),t(15,Ye=-1)}function Re(){t(55,it=[]),t(56,ne=void 0)}let st=!1,tt,it,ne,wr="",We,Ye=-1,Ut,bn=[],wn,Mn,ni,ii;const $o=new Set,Jr=us();ti(()=>{X&&(X.setEventHandler(void 0),X.indicateReverse(!1),X.setSelectedMarker(-1),X.setFeatures(void 0,void 0,!1))});function lt(W){if(Mn&&(clearTimeout(Mn),Mn=void 0),Ye>-1&&tt)t(56,ne=tt[Ye]),t(1,Me=ne.place_type[0]==="reverse"?ne.place_name:ne.place_name.replace(/,.*/,"")),t(18,Ut=void 0),t(55,it=void 0),t(15,Ye=-1);else if(Me){const Be=W||!Xn(Me);xn(Me,{exact:!0}).then(()=>{t(55,it=tt),t(56,ne=void 0),Be&&Bo()}).catch(Fe=>t(18,Ut=Fe))}}function Xn(W){try{return WE(W,6)}catch{return!1}}async function xn(W,{byId:Be=!1,exact:Fe=!1}={}){t(18,Ut=void 0),wn==null||wn.abort();const qe=new AbortController;t(19,wn=qe);try{const Xe=Xn(W),ct=new URLSearchParams;if(K!==void 0&&ct.set("language",Array.isArray(K)?K.join(","):K??""),Lt&&ct.set("types",Lt.join(",")),sr&&ct.set("excludeTypes",String(sr)),S&&ct.set("bbox",S.map(_r=>_r.toFixed(6)).join(",")),D&&ct.set("country",Array.isArray(D)?D.join(","):D),!Be&&!Xe){const _r=await DE(X,re,qe);_r&&ct.set("proximity",_r),(Fe||!Ot)&&ct.set("autocomplete","false"),ct.set("fuzzyMatch",String(U))}me!==void 0&&(Vt||!Xe||(Lt==null?void 0:Lt.length)===1)&&ct.set("limit",String(me)),ct.set("key",x),tr(ct);const Pt=er+"/"+encodeURIComponent(Xe?Xe.decimalLongitude+","+Xe.decimalLatitude:W)+".json?"+ct.toString();if(Pt===wr){Be?(t(14,tt=void 0),t(56,ne=bn[0])):t(14,tt=bn);return}wr=Pt;const $t=await fetch(Pt,{signal:qe.signal,...Nt});if(!$t.ok)throw new Error(await $t.text());const ar=await $t.json();Jr("response",{url:Pt,featureCollection:ar}),Be?(t(14,tt=void 0),t(56,ne=ar.features[0]),bn=[ne]):(t(14,tt=ar.features.filter(O)),Xe&&tt.unshift({type:"Feature",properties:{},id:"reverse_"+Xe.decimalLongitude+"_"+Xe.decimalLatitude,text:Xe.decimalLatitude+", "+Xe.decimalLongitude,place_name:Xe.decimalLatitude+", "+Xe.decimalLongitude,place_type:["reverse"],center:[Xe.decimalLongitude,Xe.decimalLatitude],bbox:[Xe.decimalLongitude,Xe.decimalLatitude,Xe.decimalLongitude,Xe.decimalLatitude],geometry:{type:"Point",coordinates:[Xe.decimalLongitude,Xe.decimalLatitude]}}),bn=tt,Xe&&We.focus())}catch(Xe){if(Xe&&typeof Xe=="object"&&"name"in Xe&&Xe.name==="AbortError")return;throw Xe}finally{qe===wn&&t(19,wn=void 0)}}function Bo(){var qe;if(!(it!=null&&it.length)||!G)return;const W=[180,90,-180,-90],Be=!it.some(Xe=>!Xe.matching_text);let Fe;for(const Xe of it){const ct=Or(Xe);if(Fe=Fe===void 0?ct:ct===void 0?Fe:Math.max(Fe,ct),Be||!Xe.matching_text)for(const Pt of[0,1,2,3])W[Pt]=Math[Pt<2?"min":"max"](W[Pt],((qe=Xe.bbox)==null?void 0:qe[Pt])??Xe.center[Pt%2])}X&&it.length>0&&(ne&&W[0]===W[2]&&W[1]===W[3]?X.flyTo(ne.center,Or(ne)):X.fitBounds(Z0(W),50,Fe))}function Or(W){var Fe;if(!W.bbox||W.bbox[0]!==W.bbox[2]&&W.bbox[1]!==W.bbox[3])return;const Be=W.id.replace(/\..*/,"");return(Array.isArray((Fe=W.properties)==null?void 0:Fe.categories)?W.properties.categories.reduce((qe,Xe)=>{const ct=fr[Be+"."+Xe];return qe===void 0?ct:ct===void 0?qe:Math.max(qe,ct)},void 0):void 0)??fr[Be]}function mt(W){t(0,ce=z==="always"),t(14,tt=void 0),t(56,ne=void 0),t(15,Ye=-1),Et(W[1].toFixed(6)+", "+zE(W[0],[-180,180],!0).toFixed(6),!1,!0)}function rr(W){if(!tt)return;let Be=W.key==="ArrowDown"?1:W.key==="ArrowUp"?-1:0;Be&&(Ye===(Ke?0:-1)&&Be===-1&&t(15,Ye=tt.length),t(15,Ye+=Be),Ye>=tt.length&&t(15,Ye=-1),Ye<0&&Ke&&t(15,Ye=0),W.preventDefault())}function Jt(W=!0,Be=!1){if(t(18,Ut=void 0),Ot||Be){if(Mn&&clearTimeout(Mn),Me.length{xn(Fe).catch(qe=>t(18,Ut=qe))},W?N:0)}else t(14,tt=void 0),t(18,Ut=void 0)}function Nr(W){t(56,ne=W),t(1,Me=W.place_name),t(15,Ye=-1)}const vi=()=>We.focus();function Qt(W){pn[W?"unshift":"push"](()=>{We=W,t(17,We)})}function ro(){Me=this.value,t(1,Me),t(13,st),t(28,C)}const an=()=>t(13,st=!0),pe=()=>t(13,st=!1),Z=()=>Jt(),$=()=>{t(1,Me=""),We.focus()},te=()=>t(0,ce=!ce),le=()=>t(18,Ut=void 0),Ce=W=>t(15,Ye=W),Ie=W=>Nr(W),Pe=()=>{Ke||t(15,Ye=-1)},Se=()=>{};return r.$$set=W=>{"class"in W&&t(2,_=W.class),"apiKey"in W&&t(26,x=W.apiKey),"bbox"in W&&t(27,S=W.bbox),"clearButtonTitle"in W&&t(3,k=W.clearButtonTitle),"clearOnBlur"in W&&t(28,C=W.clearOnBlur),"collapsed"in W&&t(4,P=W.collapsed),"country"in W&&t(29,D=W.country),"debounceSearch"in W&&t(30,N=W.debounceSearch),"enableReverse"in W&&t(5,z=W.enableReverse),"errorMessage"in W&&t(6,B=W.errorMessage),"filter"in W&&t(31,O=W.filter),"flyTo"in W&&t(32,G=W.flyTo),"fuzzyMatch"in W&&t(33,U=W.fuzzyMatch),"language"in W&&t(34,K=W.language),"limit"in W&&t(35,me=W.limit),"mapController"in W&&t(36,X=W.mapController),"minLength"in W&&t(37,Y=W.minLength),"noResultsMessage"in W&&t(7,_e=W.noResultsMessage),"placeholder"in W&&t(8,ze=W.placeholder),"proximity"in W&&t(38,re=W.proximity),"reverseActive"in W&&t(0,ce=W.reverseActive),"reverseButtonTitle"in W&&t(9,Ze=W.reverseButtonTitle),"searchValue"in W&&t(1,Me=W.searchValue),"pickedResultStyle"in W&&t(39,ht=W.pickedResultStyle),"showPlaceType"in W&&t(10,It=W.showPlaceType),"showResultsWhileTyping"in W&&t(40,Ot=W.showResultsWhileTyping),"selectFirst"in W&&t(11,Ke=W.selectFirst),"flyToSelected"in W&&t(41,Kt=W.flyToSelected),"markerOnSelected"in W&&t(42,vt=W.markerOnSelected),"types"in W&&t(43,Lt=W.types),"exhaustiveReverseGeocoding"in W&&t(44,Vt=W.exhaustiveReverseGeocoding),"excludeTypes"in W&&t(45,sr=W.excludeTypes),"zoom"in W&&t(46,fr=W.zoom),"apiUrl"in W&&t(47,er=W.apiUrl),"fetchParameters"in W&&t(48,Nt=W.fetchParameters),"iconsBaseUrl"in W&&t(12,nr=W.iconsBaseUrl),"adjustUrlQuery"in W&&t(49,tr=W.adjustUrlQuery),"$$scope"in W&&t(60,d=W.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&32&&t(0,ce=z==="always"),r.$$.dirty[0]&268443648&&setTimeout(()=>{t(16,ni=st),C&&!st&&t(1,Me="")}),r.$$.dirty[0]&16386|r.$$.dirty[1]&64&&Me.lengtht(18,Ut=W)),r.$$.dirty[1]&100663330&&(X&&ne&&ne.id!==ii&&G&&(!ne.bbox||ne.bbox[0]===ne.bbox[2]&&ne.bbox[1]===ne.bbox[3]?X.flyTo(ne.center,Or(ne)):X.fitBounds(Z0(ne.bbox),50,Or(ne)),t(14,tt=void 0),t(55,it=void 0),t(15,Ye=-1)),t(57,ii=ne==null?void 0:ne.id)),r.$$.dirty[0]&18432&&Ke&&tt!=null&&tt.length&&t(15,Ye=0),r.$$.dirty[0]&2&&t(15,Ye=-1),r.$$.dirty[0]&16384|r.$$.dirty[1]&16777216&&it!==tt&&t(55,it=void 0),r.$$.dirty[0]&81921|r.$$.dirty[1]&16777248&&X&&X.setEventHandler(W=>{switch(W.type){case"mapClick":ce&&mt(W.coordinates);break;case"markerClick":{const Be=tt==null?void 0:tt.find(Fe=>Fe.id===W.id);Be&&Nr(Be)}break;case"markerMouseEnter":it&&t(15,Ye=ni?(tt==null?void 0:tt.findIndex(Be=>Be.id===W.id))??-1:-1);break;case"markerMouseLeave":it&&t(15,Ye=-1);break}}),r.$$.dirty[0]&49152&&t(58,l=tt==null?void 0:tt[Ye]),r.$$.dirty[1]&134218786&&X&&l&&G&&Kt&&X.flyTo(l.center,Or(l)),r.$$.dirty[1]&256&&t(59,n=ht==="full-geometry-including-polygon-center-marker"),r.$$.dirty[1]&268437536&&(vt||X==null||X.setFeatures(void 0,void 0,n)),r.$$.dirty[1]&419432480&&X&&vt&&!it&&(X.setFeatures(l?[l]:void 0,void 0,n),X.setSelectedMarker(l?0:-1)),r.$$.dirty[1]&318767136&&X&&X.setFeatures(it,ne,n),r.$$.dirty[0]&32768|r.$$.dirty[1]&16777248&&it&&X&&X.setSelectedMarker(Ye),r.$$.dirty[0]&2|r.$$.dirty[1]&32&&X){const W=Xn(Me);X.setReverseMarker(W?[W.decimalLongitude,W.decimalLatitude]:void 0)}r.$$.dirty[1]&134217728&&Jr("select",{feature:l}),r.$$.dirty[1]&33554432&&Jr("pick",{feature:ne}),r.$$.dirty[0]&81920&&Jr("optionsvisibilitychange",{optionsVisible:ni&&!!tt}),r.$$.dirty[0]&16384&&Jr("featureslisted",{features:tt}),r.$$.dirty[1]&16777216&&Jr("featuresmarked",{features:it}),r.$$.dirty[0]&1&&Jr("reversetoggle",{reverse:ce}),r.$$.dirty[0]&2&&Jr("querychange",{query:Me}),r.$$.dirty[0]&1|r.$$.dirty[1]&32&&X&&X.indicateReverse(ce)},[ce,Me,_,k,P,z,B,_e,ze,Ze,It,Ke,nr,st,tt,Ye,ni,We,Ut,wn,$o,lt,rr,Jt,Nr,a,x,S,C,D,N,O,G,U,K,me,X,Y,re,ht,Ot,Kt,vt,Lt,Vt,sr,fr,er,Nt,tr,Pr,pt,Et,gr,Re,it,ne,ii,l,n,d,u,vi,Qt,ro,an,pe,Z,$,te,le,Ce,Ie,Pe,Se]}class YE extends Ht{constructor(e){super(),Zt(this,e,JE,KE,jt,{ZOOM_DEFAULTS:25,class:2,apiKey:26,bbox:27,clearButtonTitle:3,clearOnBlur:28,collapsed:4,country:29,debounceSearch:30,enableReverse:5,errorMessage:6,filter:31,flyTo:32,fuzzyMatch:33,language:34,limit:35,mapController:36,minLength:37,noResultsMessage:7,placeholder:8,proximity:38,reverseActive:0,reverseButtonTitle:9,searchValue:1,pickedResultStyle:39,showPlaceType:10,showResultsWhileTyping:40,selectFirst:11,flyToSelected:41,markerOnSelected:42,types:43,exhaustiveReverseGeocoding:44,excludeTypes:45,zoom:46,apiUrl:47,fetchParameters:48,iconsBaseUrl:12,adjustUrlQuery:49,focus:50,blur:51,setQuery:52,clearList:53,clearMap:54},null,[-1,-1,-1])}get ZOOM_DEFAULTS(){return this.$$.ctx[25]}get focus(){return this.$$.ctx[50]}get blur(){return this.$$.ctx[51]}get setQuery(){return this.$$.ctx[52]}get clearList(){return this.$$.ctx[53]}get clearMap(){return this.$$.ctx[54]}}function i1(r){let e,t,n;return t=new YE({props:{mapController:r[1],apiKey:r[0],proximity:[{type:"map-center"}]}}),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"class","svelte-ixhnie")},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p(l,u){const d={};u&2&&(d.mapController=l[1]),u&1&&(d.apiKey=l[0]),t.$set(d)},i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function QE(r){let e,t,n=r[1]&&i1(r);return{c(){n&&n.c(),e=$n()},m(l,u){n&&n.m(l,u),be(l,e,u),t=!0},p(l,[u]){l[1]?n?(n.p(l,u),u&2&&oe(n,1)):(n=i1(l),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function e5(r,e,t){let n,{apiKey:l}=e,{map:u}=e;function d(a){return a?vw(a,to,!0,!0,{duration:1e3},{duration:1e3}):null}return r.$$set=a=>{"apiKey"in a&&t(0,l=a.apiKey),"map"in a&&t(2,u=a.map)},r.$$.update=()=>{r.$$.dirty&4&&t(1,n=d(u))},[l,n,u]}class t5 extends Ht{constructor(e){super(),Zt(this,e,e5,QE,jt,{apiKey:0,map:2})}}const r5=["==",["geometry-type"],"Polygon"],n5=["==",["geometry-type"],"LineString"];function i5(r,e,t){let n=["match",r];for(let[l,u]of Object.entries(e))n.push(l),n.push(u);return n.push(t),n}function Xf(){return{type:"FeatureCollection",features:[]}}const o5=r=>({}),o1=r=>({}),s5=r=>({}),s1=r=>({}),a5=r=>({}),a1=r=>({});function l5(r){let e,t,n,l,u,d;const a=r[1].top,_=Vr(a,r,r[0],a1),x=r[1].left,S=Vr(x,r,r[0],s1),k=r[1].main,C=Vr(k,r,r[0],o1);return{c(){e=fe("div"),_&&_.c(),t=Ve(),n=fe("div"),S&&S.c(),l=Ve(),u=fe("div"),C&&C.c(),Ee(e,"class","top svelte-mpick2"),Ee(n,"class","left svelte-mpick2"),Ee(u,"class","main svelte-mpick2")},m(P,D){be(P,e,D),_&&_.m(e,null),be(P,t,D),be(P,n,D),S&&S.m(n,null),be(P,l,D),be(P,u,D),C&&C.m(u,null),d=!0},p(P,[D]){_&&_.p&&(!d||D&1)&&Gr(_,a,P,P[0],d?qr(a,P[0],D,a5):Wr(P[0]),a1),S&&S.p&&(!d||D&1)&&Gr(S,x,P,P[0],d?qr(x,P[0],D,s5):Wr(P[0]),s1),C&&C.p&&(!d||D&1)&&Gr(C,k,P,P[0],d?qr(k,P[0],D,o5):Wr(P[0]),o1)},i(P){d||(oe(_,P),oe(S,P),oe(C,P),d=!0)},o(P){de(_,P),de(S,P),de(C,P),d=!1},d(P){P&&(ve(e),ve(t),ve(n),ve(l),ve(u)),_&&_.d(P),S&&S.d(P),C&&C.d(P)}}}function c5(r,e,t){let{$$slots:n={},$$scope:l}=e;return r.$$set=u=>{"$$scope"in u&&t(0,l=u.$$scope)},[l,n]}class u5 extends Ht{constructor(e){super(),Zt(this,e,c5,l5,jt,{})}}const h5=r=>({}),l1=r=>({}),f5=r=>({}),c1=r=>({}),d5=r=>({}),u1=r=>({});function p5(r){let e,t,n,l,u,d;const a=r[4].top,_=Vr(a,r,r[3],u1),x=r[4].sidebar,S=Vr(x,r,r[3],c1),k=r[4].map,C=Vr(k,r,r[3],l1);return{c(){e=fe("div"),_&&_.c(),t=Ve(),n=fe("div"),S&&S.c(),l=Ve(),u=fe("div"),C&&C.c()},m(P,D){be(P,e,D),_&&_.m(e,null),r[5](e),be(P,t,D),be(P,n,D),S&&S.m(n,null),r[6](n),be(P,l,D),be(P,u,D),C&&C.m(u,null),r[7](u),d=!0},p(P,[D]){_&&_.p&&(!d||D&8)&&Gr(_,a,P,P[3],d?qr(a,P[3],D,d5):Wr(P[3]),u1),S&&S.p&&(!d||D&8)&&Gr(S,x,P,P[3],d?qr(x,P[3],D,f5):Wr(P[3]),c1),C&&C.p&&(!d||D&8)&&Gr(C,k,P,P[3],d?qr(k,P[3],D,h5):Wr(P[3]),l1)},i(P){d||(oe(_,P),oe(S,P),oe(C,P),d=!0)},o(P){de(_,P),de(S,P),de(C,P),d=!1},d(P){P&&(ve(e),ve(t),ve(n),ve(l),ve(u)),_&&_.d(P),r[5](null),S&&S.d(P),r[6](null),C&&C.d(P),r[7](null)}}}function m5(r,e,t){let n,l,u;wt(r,Hm,k=>t(0,n=k)),wt(r,$m,k=>t(1,l=k)),wt(r,Xm,k=>t(2,u=k));let{$$slots:d={},$$scope:a}=e;function _(k){pn[k?"unshift":"push"](()=>{n=k,Hm.set(n)})}function x(k){pn[k?"unshift":"push"](()=>{l=k,$m.set(l)})}function S(k){pn[k?"unshift":"push"](()=>{u=k,Xm.set(u)})}return r.$$set=k=>{"$$scope"in k&&t(3,a=k.$$scope)},[n,l,u,a,d,_,x,S]}class Fs extends Ht{constructor(e){super(),Zt(this,e,m5,p5,jt,{})}}let Hm=Er(null),$m=Er(null),Xm=Er(null);function g5(r){let e,t,n,l,u,d,a,_,x;return{c(){e=fe("label"),t=rt(`Basemap: + `),n=fe("select"),l=fe("option"),l.textContent="MapTiler Dataviz",u=fe("option"),u.textContent="MapTiler Streets",d=fe("option"),d.textContent="MapTiler Satellite",a=fe("option"),a.textContent="OS Open Zoomstack",l.__value="dataviz",ei(l,l.__value),u.__value="streets-v2",ei(u,u.__value),d.__value="hybrid",ei(d,d.__value),a.__value="uk-openzoomstack-light",ei(a,a.__value),r[0]===void 0&&uh(()=>r[1].call(n))},m(S,k){be(S,e,k),ie(e,t),ie(e,n),ie(n,l),ie(n,u),ie(n,d),ie(n,a),sd(n,r[0],!0),_||(x=Tt(n,"change",r[1]),_=!0)},p(S,[k]){k&1&&sd(n,S[0])},i:Ct,o:Ct,d(S){S&&ve(e),_=!1,x()}}}function _5(r,e,t){let n;wt(r,Rm,u=>t(0,n=u));function l(){n=Mb(this),Rm.set(n)}return[n,l]}class y5 extends Ht{constructor(e){super(),Zt(this,e,_5,g5,jt,{})}}let Kf=Er(!0);function v5(r){let e,t;return e=new ma({props:{paint:{"fill-color":"black","fill-opacity":0},layout:{visibility:r[0]?"none":"visible"}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&1&&(u.layout={visibility:n[0]?"none":"visible"}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function b5(r){let e,t;return e=new Pi({props:{data:r[1],$$slots:{default:[v5]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&5&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function w5(r,e,t){let n;return wt(r,Kf,u=>t(0,n=u)),[n,{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]}}]}class x5 extends Ht{constructor(e){super(),Zt(this,e,w5,b5,jt,{})}}const S5="/ltn/assets/help-d011708a.svg";function h1(r){let e,t;return e=new Pd({props:{$$slots:{default:[k5]},$$scope:{ctx:r}}}),e.$on("close",r[3]),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&16&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function k5(r){let e,t,n;const l=r[1].default,u=Vr(l,r,r[4],null);return{c(){e=fe("h2"),e.textContent="Help",t=Ve(),u&&u.c()},m(d,a){be(d,e,a),be(d,t,a),u&&u.m(d,a),n=!0},p(d,a){u&&u.p&&(!n||a&16)&&Gr(u,l,d,d[4],n?qr(l,d[4],a,null):Wr(d[4]),null)},i(d){n||(oe(u,d),n=!0)},o(d){de(u,d),n=!1},d(d){d&&(ve(e),ve(t)),u&&u.d(d)}}}function T5(r){let e,t,n,l,u,d,a=r[0]&&h1(r);return{c(){e=fe("button"),e.innerHTML=`Help`,t=Ve(),a&&a.c(),n=$n(),Ee(e,"class","svelte-gb6dzm")},m(_,x){be(_,e,x),be(_,t,x),a&&a.m(_,x),be(_,n,x),l=!0,u||(d=Tt(e,"click",r[2]),u=!0)},p(_,[x]){_[0]?a?(a.p(_,x),x&1&&oe(a,1)):(a=h1(_),a.c(),oe(a,1),a.m(n.parentNode,n)):a&&(vr(),de(a,1,1,()=>{a=null}),br())},i(_){l||(oe(a),l=!0)},o(_){de(a),l=!1},d(_){_&&(ve(e),ve(t),ve(n)),a&&a.d(_),u=!1,d()}}}function E5(r,e,t){let{$$slots:n={},$$scope:l}=e,u=!1;const d=()=>t(0,u=!0),a=()=>t(0,u=!1);return r.$$set=_=>{"$$scope"in _&&t(4,l=_.$$scope)},[u,n,d,a,l]}class Og extends Ht{constructor(e){super(),Zt(this,e,E5,T5,jt,{})}}function M5(r){let e,t,n,l;const u=r[1].default,d=Vr(u,r,r[0],null);return{c(){e=fe("a"),d&&d.c(),Ee(e,"href","#")},m(a,_){be(a,e,_),d&&d.m(e,null),t=!0,n||(l=Tt(e,"click",vg(r[2])),n=!0)},p(a,[_]){d&&d.p&&(!t||_&1)&&Gr(d,u,a,a[0],t?qr(u,a[0],_,null):Wr(a[0]),null)},i(a){t||(oe(d,a),t=!0)},o(a){de(d,a),t=!1},d(a){a&&ve(e),d&&d.d(a),n=!1,l()}}}function C5(r,e,t){let{$$slots:n={},$$scope:l}=e;function u(d){ur.call(this,r,d)}return r.$$set=d=>{"$$scope"in d&&t(0,l=d.$$scope)},[l,n,u]}class Zr extends Ht{constructor(e){super(),Zt(this,e,C5,M5,jt,{})}}const I5=r=>({props:r&8}),f1=r=>({props:P5(r[3])});function A5(r){let e;const t=r[1].default,n=Vr(t,r,r[2],f1);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&12)&&Gr(n,t,l,l[2],e?qr(t,l[2],u,I5):Wr(l[2]),f1)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function L5(r){let e,t;return e=new l3({props:{openOn:r[0],popupClass:"popup",$$slots:{default:[A5,({features:n})=>({3:n}),({features:n})=>n?8:0]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&1&&(u.openOn=n[0]),l&12&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function P5(r){return r?r[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function z5(r,e,t){let{$$slots:n={},$$scope:l}=e,{openOn:u="hover"}=e;return r.$$set=d=>{"openOn"in d&&t(0,u=d.openOn),"$$scope"in d&&t(2,l=d.$$scope)},[u,n,l]}class Os extends Ht{constructor(e){super(),Zt(this,e,z5,L5,jt,{openOn:0})}}function D5(r,e){let t=new Set(r.getStyle().layers.filter(n=>n.type=="line").map(n=>n.id));return e=="dataviz"?["Road network","Path"].filter(n=>t.has(n)):e=="hybrid"?["Path","Road","Tunnel"].filter(n=>t.has(n)):e=="streets-v2"?r.getStyle().layers.filter(n=>n["source-layer"]=="transportation"&&n.type=="line").map(n=>n.id):e=="uk-openzoomstack-light"?r.getStyle().layers.filter(n=>n["source-layer"]=="roads"&&n.type=="line").map(n=>n.id):[]}const{window:R5}=Ad;function B5(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N;return P=Eb(r[8][0]),{c(){e=fe("button"),e.textContent="Stop StreetView",t=Ve(),n=fe("fieldset"),l=fe("legend"),l.textContent="Source:",u=Ve(),d=fe("label"),a=fe("input"),_=rt(` + Google Street View`),x=Ve(),S=fe("label"),k=fe("input"),C=rt(` + Bing Streetside`),Ee(e,"class","secondary"),Ee(a,"type","radio"),a.__value="google",ei(a,a.__value),Ee(k,"type","radio"),k.__value="bing",ei(k,k.__value),P.p(a,k)},m(z,B){be(z,e,B),be(z,t,B),be(z,n,B),ie(n,l),ie(n,u),ie(n,d),ie(d,a),a.checked=a.__value===r[0],ie(d,_),ie(n,x),ie(n,S),ie(S,k),k.checked=k.__value===r[0],ie(S,C),D||(N=[Tt(e,"click",r[3]),Tt(a,"change",r[7]),Tt(k,"change",r[9])],D=!0)},p(z,B){B&1&&(a.checked=a.__value===z[0]),B&1&&(k.checked=k.__value===z[0])},d(z){z&&(ve(e),ve(t),ve(n)),P.r(),D=!1,_n(N)}}}function F5(r){let e,t,n;return{c(){e=fe("button"),e.textContent="StreetView",Ee(e,"class","secondary")},m(l,u){be(l,e,u),t||(n=Tt(e,"click",r[2]),t=!0)},p:Ct,d(l){l&&ve(e),t=!1,n()}}}function O5(r){let e,t,n;function l(a,_){return a[1]?F5:B5}let u=l(r),d=u(r);return{c(){d.c(),e=$n()},m(a,_){d.m(a,_),be(a,e,_),t||(n=Tt(R5,"keydown",r[4]),t=!0)},p(a,[_]){u===(u=l(a))&&d?d.p(a,_):(d.d(1),d=u(a),d&&(d.c(),d.m(e.parentNode,e)))},i:Ct,o:Ct,d(a){a&&ve(e),d.d(a),t=!1,n()}}}function N5(r,e,t){let n;wt(r,Kf,N=>t(1,n=N));let{map:l}=e,{maptilerBasemap:u}=e,d="google",a=[];function _(){Rt(Kf,n=!1,n),l.on("click",S),l.getCanvas().style.cursor="crosshair";for(let N of D5(l,u))a.push([N,l.getPaintProperty(N,"line-color")]),l.setPaintProperty(N,"line-color","cyan")}function x(){Rt(Kf,n=!0,n),l.off("click",S),l.getCanvas().style.cursor="inherit";for(let[N,z]of a)l.setPaintProperty(N,"line-color",z);a=[]}ti(x);function S(N){let z=N.lngLat.lng,B=N.lngLat.lat;d=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${B},${z}&cbp=11,0,0,0,0`,"_blank"):d=="bing"&&window.open(`https://www.bing.com/maps?cp=${B}~${z}&style=x`,"_blank")}function k(N){!n&&N.key=="Escape"&&(N.stopPropagation(),x())}const C=[[]];function P(){d=this.__value,t(0,d)}function D(){d=this.__value,t(0,d)}return r.$$set=N=>{"map"in N&&t(5,l=N.map),"maptilerBasemap"in N&&t(6,u=N.maptilerBasemap)},[d,n,_,x,k,l,u,P,C,D]}class j5 extends Ht{constructor(e){super(),Zt(this,e,N5,O5,jt,{map:5,maptilerBasemap:6})}}function Hn(r){return{id:r,beforeId:U5(r)}}function U5(r){let e=Hi(ls);if(!e){console.warn(`getBeforeId(${r}) called before map is ready. Z-ordering may be incorrect.`);return}let t,n=!1;for(let l=d1.length-1;l>=0;l--){let u=d1[l];if(u==r){n=!0;break}e.getLayer(u)&&(t=u)}if(!n)throw new Error(`Layer ID ${r} not defined in layerZorder`);return t}let im=r=>r,om=r=>r;const d1=[im(om("Background")),"neighbourhood-boundaries",im("Ferry line"),"debug-borders","debug-crosses","debug-filters","cells","interior-roads-outlines","interior-roads","compare-route","shortcuts","shortcuts-focus",om("Building"),"draw-area-lines","draw-area-preview","one-ways",om("Road labels"),im("road_label"),"animate-shortcuts","modal-filters","boundary","neighbourhood-boundary","auto-boundaries-areas","auto-boundaries-severances","freehand-line","edit-polygon-fill","edit-polygon-lines","edit-polygon-vertices"];function V5(r){let e;return{c(){e=rt("Back")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function q5(r){let e,t,n,l;return e=new Zr({props:{$$slots:{default:[V5]},$$scope:{ctx:r}}}),e.$on("click",r[2]),{c(){je(e.$$.fragment)},m(u,d){Oe(e,u,d),t=!0,n||(l=Tt(window,"keydown",r[1]),n=!0)},p(u,[d]){const a={};d&8&&(a.$$scope={dirty:d,ctx:u}),e.$set(a)},i(u){t||(oe(e.$$.fragment,u),t=!0)},o(u){de(e.$$.fragment,u),t=!1},d(u){Ne(e,u),n=!1,l()}}}function G5(r){let e=us();function t(l){l.key=="Escape"&&(l.stopPropagation(),e("click"))}return[e,t,()=>e("click")]}class Od extends Ht{constructor(e){super(),Zt(this,e,G5,q5,jt,{})}}function W5(r){let e,t;const n=[Hn("one-ways"),{filter:["all",["==",["get","kind"],"interior_road"],["!=",["get","direction"],"both"]]},{layout:{"icon-image":"oneway-arrow","icon-size":1,"symbol-placement":"line","symbol-spacing":50,"icon-allow-overlap":!0,"icon-rotate":["case",["==",["get","direction"],"forwards"],0,180]}},{paint:{"icon-opacity":["case",["get","direction_edited"],1,.5]}}];let l={};for(let u=0;u({}),p1=r=>({}),$5=r=>({}),m1=r=>({});function X5(r){let e,t;const n=[Hn("neighbourhood-boundary"),{paint:{"fill-color":"black","fill-opacity":.3}}];let l={};for(let u=0;u{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function J5(r){let e,t,n,l,u,d,a,_,x,S,k;e=new Pi({props:{data:_1(r[3]),$$slots:{default:[X5]},$$scope:{ctx:r}}});const C=[Hn("cells"),{filter:["==",["get","kind"],"cell"]},{paint:{"fill-color":["get","color"],"fill-opacity":.8}}];let P={};for(let U=0;Ut.properties.kind=="boundary");return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]],e.geometry.coordinates[0]]}}}function Q5(r,e,t){let n,l,u,{$$slots:d={},$$scope:a}=e,{gjInput:_}=e,{interactive:x=!0}=e,{onClickLine:S=(C,P)=>{}}=e;const k=C=>x&&S(C.detail.features[0],C.detail.event.lngLat);return r.$$set=C=>{"gjInput"in C&&t(4,_=C.gjInput),"interactive"in C&&t(0,x=C.interactive),"onClickLine"in C&&t(1,S=C.onClickLine),"$$scope"in C&&t(8,a=C.$$scope)},r.$$.update=()=>{r.$$.dirty&16&&t(3,n=Km(_)),r.$$.dirty&16&&t(5,l=Math.max(..._.features.map(C=>C.properties.kind=="interior_road"?C.properties.shortcuts:0))),r.$$.dirty&32&&t(2,u=kc(["interpolate-hcl",["linear"],["get","shortcuts"],0,"white",1,"#F19A93",l,"#A32015"],"blue"))},[x,S,u,n,_,l,d,k,a]}class Nd extends Ht{constructor(e){super(),Zt(this,e,Q5,Y5,jt,{gjInput:4,interactive:0,onClickLine:1})}}function eM(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function tM(r){let e;return{c(){e=rt("Pick neighbourhood")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function rM(r){let e;return{c(){e=rt("Editing")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function nM(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D;return u=new Zr({props:{$$slots:{default:[eM]},$$scope:{ctx:r}}}),u.$on("click",r[4]),_=new Zr({props:{$$slots:{default:[tM]},$$scope:{ctx:r}}}),_.$on("click",r[5]),k=new Zr({props:{$$slots:{default:[rM]},$$scope:{ctx:r}}}),k.$on("click",r[6]),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),je(_.$$.fragment),x=Ve(),S=fe("li"),je(k.$$.fragment),C=Ve(),P=fe("li"),P.textContent="Debug mode",Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top")},m(N,z){be(N,e,z),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),Oe(_,a,null),ie(n,x),ie(n,S),Oe(k,S,null),ie(n,C),ie(n,P),D=!0},p(N,z){const B={};z&256&&(B.$$scope={dirty:z,ctx:N}),u.$set(B);const O={};z&256&&(O.$$scope={dirty:z,ctx:N}),_.$set(O);const G={};z&256&&(G.$$scope={dirty:z,ctx:N}),k.$set(G)},i(N){D||(oe(u.$$.fragment,N),oe(_.$$.fragment,N),oe(k.$$.fragment,N),D=!0)},o(N){de(u.$$.fragment,N),de(_.$$.fragment,N),de(k.$$.fragment,N),D=!1},d(N){N&&ve(e),Ne(u),Ne(_),Ne(k)}}}function iM(r){let e,t,n;return t=new Od({}),t.$on("click",r[3]),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"slot","sidebar")},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p:Ct,i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function oM(r){let e,t;return e=new zd({props:{properties:r[7]}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&128&&(u.properties=n[7]),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function sM(r){let e,t,n;return t=new Os({props:{openOn:"hover",$$slots:{default:[oM,({props:l})=>({7:l}),({props:l})=>l?128:0]},$$scope:{ctx:r}}}),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"slot","line-popup")},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p(l,u){const d={};u&384&&(d.$$scope={dirty:u,ctx:l}),t.$set(d)},i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function aM(r){let e,t;return e=new zd({props:{properties:r[7]}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&128&&(u.properties=n[7]),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function lM(r){let e,t;return e=new Os({props:{openOn:"hover",$$slots:{default:[aM,({props:n})=>({7:n}),({props:n})=>n?128:0]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&384&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function cM(r){let e,t;return e=new zd({props:{properties:r[7]}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&128&&(u.properties=n[7]),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function uM(r){let e,t;return e=new Os({props:{openOn:"hover",$$slots:{default:[cM,({props:n})=>({7:n}),({props:n})=>n?128:0]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&384&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function hM(r){let e,t,n,l;const u=[Hn("debug-borders"),{filter:["==",["get","kind"],"border_intersection"]},{paint:{"circle-radius":15,"circle-color":"green"}}];let d={$$slots:{default:[lM]},$$scope:{ctx:r}};for(let x=0;x({7:n}),({props:n})=>n?128:0]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&384&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function pM(r){let e,t;const n=[Hn("debug-filters"),{paint:{"circle-radius":15,"circle-color":"black"}}];let l={$$slots:{default:[dM]},$$scope:{ctx:r}};for(let u=0;ut(0,n=S)),wt(r,pr,S=>t(1,l=S)),[n,l,(S,k)=>window.open(dn(S.properties).way,"_blank"),()=>Rt(pr,l={mode:"neighbourhood"},l),()=>Rt(pr,l={mode:"title"},l),()=>Rt(pr,l={mode:"network"},l),()=>Rt(pr,l={mode:"neighbourhood"},l)]}class yM extends Ht{constructor(e){super(),Zt(this,e,_M,gM,jt,{})}}function y1(r,e,t){const n=r.slice();return n[7]=e[t][0],n[8]=e[t][1],n[9]=e[t][2],n}function v1(r){let e,t,n,l,u,d,a=r[8]+"",_,x,S,k,C;function P(){return r[3](r[7])}return{c(){e=fe("button"),t=fe("img"),l=Ve(),u=fe("br"),d=Ve(),_=rt(a),x=Ve(),En(t.src,n=`/ltn//filters/${r[7]}_icon.gif`)||Ee(t,"src",n),Ee(t,"width","80"),Ee(t,"alt",r[8]),Ee(e,"class","outline"),fn(e,"width","100%"),e.disabled=S=r[0]==r[7]},m(D,N){be(D,e,N),ie(e,t),ie(e,l),ie(e,u),ie(e,d),ie(e,_),ie(e,x),k||(C=Tt(e,"click",P),k=!0)},p(D,N){r=D,N&1&&S!==(S=r[0]==r[7])&&(e.disabled=S)},d(D){D&&ve(e),k=!1,C()}}}function vM(r){let e,t,n,l,u,d,a,_,x,S,k,C,P=r[1][2]+"",D,N,z,B,O,G,U=Jn(r[2]),K=[];for(let X=0;X({6:n}),({dialog:n})=>n?64:0]},$$scope:{ctx:r}}}),e.$on("close",r[5]),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&4163&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function wM(r,e,t){let n,l;wt(r,Om,x=>t(0,l=x));let u=[["walk_cycle_only","Walking/cycling only","A physical barrier that only allows people walking, cycling, and rolling to pass. Often planters or bollards. Larger vehicles cannot enter."],["no_entry","No entry","An alternative sign to indicate vehicles are not allowed to enter the street. Only people walking, cycling, and rolling may pass through."],["bus_gate","Bus gate","A bus gate sign and traffic cameras are installed to allow buses, pedestrians, and cyclists to pass. There is no physical barrier."],["school_street","School street","A closure during school hours only. The barrier usually allows teachers and staff to access the school."]];const d=x=>Rt(Om,l=x,l),a=x=>dn(x).close();function _(x){ur.call(this,r,x)}return r.$$.update=()=>{r.$$.dirty&1&&t(1,n=u.find(x=>x[0]==l))},[l,n,u,d,a,_]}class xM extends Ht{constructor(e){super(),Zt(this,e,wM,bM,jt,{})}}function b1(r){let e,t;return e=new Pi({props:{data:r[0],$$slots:{default:[SM]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&1&&(u.data=n[0]),l&64&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function SM(r){let e,t;const n=[Hn("freehand-line"),{paint:{"line-width":5,"line-color":"red"}}];let l={};for(let u=0;u{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function TM(r,e,t){let{map:n}=e,l=null;const u=us();n.on("dragstart",d),n.on("mousemove",a),n.on("mouseup",_),ti(()=>{n.dragPan.enable(),n.off("dragstart",d),n.off("mousemove",a),n.off("mouseup",_)});function d(){n.dragPan.disable(),t(0,l={type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}})}function a(x){l&&(l.geometry.coordinates.push(x.lngLat.toArray()),t(0,l))}function _(){l&&(u("done",l),t(0,l=null))}return r.$$set=x=>{"map"in x&&t(1,n=x.map)},[l,n]}class EM extends Ht{constructor(e){super(),Zt(this,e,TM,kM,jt,{map:1})}}function MM(r){let e;const t=r[3].default,n=Vr(t,r,r[5],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&32)&&Gr(n,t,l,l[5],e?qr(t,l[5],u,null):Wr(l[5]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function CM(r){let e,t;const n=[Hn("modal-filters"),{layout:{"icon-image":["get","filter_kind"],"icon-allow-overlap":!0,"icon-size":.1}},{paint:{"icon-opacity":["case",["get","edited"],1,.5]}}];let l={$$slots:{default:[MM]},$$scope:{ctx:r}};for(let u=0;ut(1,l=x)),wt(r,ia,x=>t(2,u=x));let{$$slots:d={},$$scope:a}=e;function _(x){ur.call(this,r,x)}return r.$$set=x=>{"$$scope"in x&&t(5,a=x.$$scope)},r.$$.update=()=>{r.$$.dirty&6&&t(0,n=u>0?JSON.parse(l.renderModalFilters()):null)},[n,l,u,d,_,a]}class jd extends Ht{constructor(e){super(),Zt(this,e,AM,IM,jt,{})}}var w1=Object.prototype.toString,xw=function(e){var t=w1.call(e),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&w1.call(e.callee)==="[object Function]"),n},sm,x1;function LM(){if(x1)return sm;x1=1;var r;if(!Object.keys){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=xw,l=Object.prototype.propertyIsEnumerable,u=!l.call({toString:null},"toString"),d=l.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(C){var P=C.constructor;return P&&P.prototype===C},x={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},S=function(){if(typeof window>"u")return!1;for(var C in window)try{if(!x["$"+C]&&e.call(window,C)&&window[C]!==null&&typeof window[C]=="object")try{_(window[C])}catch{return!0}}catch{return!0}return!1}(),k=function(C){if(typeof window>"u"||!S)return _(C);try{return _(C)}catch{return!1}};r=function(P){var D=P!==null&&typeof P=="object",N=t.call(P)==="[object Function]",z=n(P),B=D&&t.call(P)==="[object String]",O=[];if(!D&&!N&&!z)throw new TypeError("Object.keys called on a non-object");var G=d&&N;if(B&&P.length>0&&!e.call(P,0))for(var U=0;U0)for(var K=0;K"u"||!ci?Cr:ci(Uint8Array),el={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Cr:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Cr:ArrayBuffer,"%ArrayIteratorPrototype%":cc&&ci?ci([][Symbol.iterator]()):Cr,"%AsyncFromSyncIteratorPrototype%":Cr,"%AsyncFunction%":mc,"%AsyncGenerator%":mc,"%AsyncGeneratorFunction%":mc,"%AsyncIteratorPrototype%":mc,"%Atomics%":typeof Atomics>"u"?Cr:Atomics,"%BigInt%":typeof BigInt>"u"?Cr:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Cr:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Cr:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Cr:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":QM,"%eval%":eval,"%EvalError%":eC,"%Float32Array%":typeof Float32Array>"u"?Cr:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Cr:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Cr:FinalizationRegistry,"%Function%":Tw,"%GeneratorFunction%":mc,"%Int8Array%":typeof Int8Array>"u"?Cr:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Cr:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Cr:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":cc&&ci?ci(ci([][Symbol.iterator]())):Cr,"%JSON%":typeof JSON=="object"?JSON:Cr,"%Map%":typeof Map>"u"?Cr:Map,"%MapIteratorPrototype%":typeof Map>"u"||!cc||!ci?Cr:ci(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Cr:Promise,"%Proxy%":typeof Proxy>"u"?Cr:Proxy,"%RangeError%":tC,"%ReferenceError%":rC,"%Reflect%":typeof Reflect>"u"?Cr:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Cr:Set,"%SetIteratorPrototype%":typeof Set>"u"||!cc||!ci?Cr:ci(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Cr:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":cc&&ci?ci(""[Symbol.iterator]()):Cr,"%Symbol%":cc?Symbol:Cr,"%SyntaxError%":Tc,"%ThrowTypeError%":iC,"%TypedArray%":sC,"%TypeError%":bc,"%Uint8Array%":typeof Uint8Array>"u"?Cr:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Cr:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Cr:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Cr:Uint32Array,"%URIError%":nC,"%WeakMap%":typeof WeakMap>"u"?Cr:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Cr:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Cr:WeakSet};if(ci)try{null.error}catch(r){var aC=ci(ci(r));el["%Error.prototype%"]=aC}var lC=function r(e){var t;if(e==="%AsyncFunction%")t=lm("async function () {}");else if(e==="%GeneratorFunction%")t=lm("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=lm("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var l=r("%AsyncGenerator%");l&&ci&&(t=ci(l.prototype))}return el[e]=t,t},M1={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Eh=Ug,gd=kw,cC=Eh.call(Function.call,Array.prototype.concat),uC=Eh.call(Function.apply,Array.prototype.splice),C1=Eh.call(Function.call,String.prototype.replace),_d=Eh.call(Function.call,String.prototype.slice),hC=Eh.call(Function.call,RegExp.prototype.exec),fC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dC=/\\(\\)?/g,pC=function(e){var t=_d(e,0,1),n=_d(e,-1);if(t==="%"&&n!=="%")throw new Tc("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Tc("invalid intrinsic syntax, expected opening `%`");var l=[];return C1(e,fC,function(u,d,a,_){l[l.length]=a?C1(_,dC,"$1"):d||u}),l},mC=function(e,t){var n=e,l;if(gd(M1,n)&&(l=M1[n],n="%"+l[0]+"%"),gd(el,n)){var u=el[n];if(u===mc&&(u=lC(n)),typeof u>"u"&&!t)throw new bc("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:l,name:n,value:u}}throw new Tc("intrinsic "+e+" does not exist!")},hs=function(e,t){if(typeof e!="string"||e.length===0)throw new bc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new bc('"allowMissing" argument must be a boolean');if(hC(/^%?[^%]*%?$/,e)===null)throw new Tc("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=pC(e),l=n.length>0?n[0]:"",u=mC("%"+l+"%",t),d=u.name,a=u.value,_=!1,x=u.alias;x&&(l=x[0],uC(n,cC([0,1],x)));for(var S=1,k=!0;S=n.length){var N=Qa(a,C);k=!!N,k&&"get"in N&&!("originalValue"in N.get)?a=N.get:a=a[C]}else k=gd(a,C),a=a[C];k&&!_&&(el[d]=a)}}return a},um,I1;function Vg(){if(I1)return um;I1=1;var r=hs,e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return um=e,um}var gC=hs,Yf=gC("%Object.getOwnPropertyDescriptor%",!0);if(Yf)try{Yf([],"length")}catch{Yf=null}var qg=Yf,A1=Vg(),_C=Sw,uc=ba,L1=qg,Gg=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new uc("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new uc("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new uc("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new uc("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new uc("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new uc("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,_=!!L1&&L1(e,t);if(A1)A1(e,t,{configurable:d===null&&_?_.configurable:!d,enumerable:l===null&&_?_.enumerable:!l,value:n,writable:u===null&&_?_.writable:!u});else if(a||!l&&!u&&!d)e[t]=n;else throw new _C("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Jm=Vg(),Ew=function(){return!!Jm};Ew.hasArrayLengthDefineBug=function(){if(!Jm)return null;try{return Jm([],"length",{value:1}).length!==1}catch{return!0}};var Wg=Ew,yC=Ng,vC=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",bC=Object.prototype.toString,wC=Array.prototype.concat,P1=Gg,xC=function(r){return typeof r=="function"&&bC.call(r)==="[object Function]"},Mw=Wg(),SC=function(r,e,t,n){if(e in r){if(n===!0){if(r[e]===t)return}else if(!xC(n)||!n())return}Mw?P1(r,e,t,!0):P1(r,e,t)},Cw=function(r,e){var t=arguments.length>2?arguments[2]:{},n=yC(e);vC&&(n=wC.call(n,Object.getOwnPropertySymbols(e)));for(var l=0;l4294967295||EC(t)!==t)throw new R1("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&D1){var d=D1(e,"length");d&&!d.configurable&&(l=!1),d&&!d.writable&&(u=!1)}return(l||u||!n)&&(TC?z1(e,"length",t,!0,!0):z1(e,"length",t)),e};(function(r){var e=Ug,t=hs,n=MC,l=ba,u=t("%Function.prototype.apply%"),d=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(d,u),_=Vg(),x=t("%Math.max%");r.exports=function(C){if(typeof C!="function")throw new l("a function is required");var P=a(e,d,arguments);return n(P,1+x(0,C.length-(arguments.length-1)),!0)};var S=function(){return a(e,u,arguments)};_?_(r.exports,"apply",{value:S}):r.exports.apply=S})(Iw);var Rc=Iw.exports,Aw=hs,Lw=Rc,CC=Lw(Aw("String.prototype.indexOf")),Ro=function(e,t){var n=Aw(e,!!t);return typeof n=="function"&&CC(e,".prototype.")>-1?Lw(n):n},IC=Ng,Pw=Ud(),zw=Ro,B1=Object,AC=zw("Array.prototype.push"),F1=zw("Object.prototype.propertyIsEnumerable"),LC=Pw?Object.getOwnPropertySymbols:null,Dw=function(e,t){if(e==null)throw new TypeError("target must be an object");var n=B1(e);if(arguments.length===1)return n;for(var l=1;l2&&!!arguments[2];return(!n||ZC)&&(WC?O1(e,"name",t,!0,!0):O1(e,"name",t)),e},XC=$C,KC=ba,JC=Object,Ow=XC(function(){if(this==null||this!==JC(this))throw new KC("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),YC=Ow,QC=il.supportsDescriptors,eI=Object.getOwnPropertyDescriptor,Nw=function(){if(QC&&/a/mig.flags==="gim"){var e=eI(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var t="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(n,"sticky",{get:function(){t+="y"}}),t==="dy")return e.get}}return YC},tI=il.supportsDescriptors,rI=Nw,nI=Object.getOwnPropertyDescriptor,iI=Object.defineProperty,oI=TypeError,N1=Object.getPrototypeOf,sI=/a/,aI=function(){if(!tI||!N1)throw new oI("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=rI(),t=N1(sI),n=nI(t,"flags");return(!n||n.get!==e)&&iI(t,"flags",{configurable:!0,enumerable:!1,get:e}),e},lI=il,cI=Rc,uI=Ow,jw=Nw,hI=aI,Uw=cI(jw());lI(Uw,{getPolyfill:jw,implementation:uI,shim:hI});var fI=Uw,Qf={exports:{}},dI=Ud,ol=function(){return dI()&&!!Symbol.toStringTag},pI=ol(),mI=Ro,Ym=mI("Object.prototype.toString"),Vd=function(e){return pI&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ym(e)==="[object Arguments]"},Vw=function(e){return Vd(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Ym(e)!=="[object Array]"&&Ym(e.callee)==="[object Function]"},gI=function(){return Vd(arguments)}();Vd.isLegacyArguments=Vw;var qw=gI?Vd:Vw;const _I={},yI=Object.freeze(Object.defineProperty({__proto__:null,default:_I},Symbol.toStringTag,{value:"Module"})),vI=Dd(yI);var Zg=typeof Map=="function"&&Map.prototype,fm=Object.getOwnPropertyDescriptor&&Zg?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,yd=Zg&&fm&&typeof fm.get=="function"?fm.get:null,j1=Zg&&Map.prototype.forEach,Hg=typeof Set=="function"&&Set.prototype,dm=Object.getOwnPropertyDescriptor&&Hg?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,vd=Hg&&dm&&typeof dm.get=="function"?dm.get:null,U1=Hg&&Set.prototype.forEach,bI=typeof WeakMap=="function"&&WeakMap.prototype,ah=bI?WeakMap.prototype.has:null,wI=typeof WeakSet=="function"&&WeakSet.prototype,lh=wI?WeakSet.prototype.has:null,xI=typeof WeakRef=="function"&&WeakRef.prototype,V1=xI?WeakRef.prototype.deref:null,SI=Boolean.prototype.valueOf,kI=Object.prototype.toString,TI=Function.prototype.toString,EI=String.prototype.match,$g=String.prototype.slice,ca=String.prototype.replace,MI=String.prototype.toUpperCase,q1=String.prototype.toLowerCase,Gw=RegExp.prototype.test,G1=Array.prototype.concat,as=Array.prototype.join,CI=Array.prototype.slice,W1=Math.floor,Qm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,pm=Object.getOwnPropertySymbols,eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Di=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ec||"symbol")?Symbol.toStringTag:null,Ww=Object.prototype.propertyIsEnumerable,Z1=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function H1(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Gw.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-W1(-r):W1(r);if(n!==r){var l=String(n),u=$g.call(e,l.length+1);return ca.call(l,t,"$&_")+"."+ca.call(ca.call(u,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ca.call(e,t,"$&_")}var tg=vI,$1=tg.custom,X1=Hw($1)?$1:null,II=function r(e,t,n,l){var u=t||{};if(oa(u,"quoteStyle")&&u.quoteStyle!=="single"&&u.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(oa(u,"maxStringLength")&&(typeof u.maxStringLength=="number"?u.maxStringLength<0&&u.maxStringLength!==1/0:u.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var d=oa(u,"customInspect")?u.customInspect:!0;if(typeof d!="boolean"&&d!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(oa(u,"indent")&&u.indent!==null&&u.indent!==" "&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(oa(u,"numericSeparator")&&typeof u.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=u.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Xw(e,u);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var _=String(e);return a?H1(e,_):_}if(typeof e=="bigint"){var x=String(e)+"n";return a?H1(e,x):x}var S=typeof u.depth>"u"?5:u.depth;if(typeof n>"u"&&(n=0),n>=S&&S>0&&typeof e=="object")return rg(e)?"[Array]":"[Object]";var k=HI(u,n);if(typeof l>"u")l=[];else if($w(l,e)>=0)return"[Circular]";function C(Ze,Me,ht){if(Me&&(l=CI.call(l),l.push(Me)),ht){var It={depth:u.depth};return oa(u,"quoteStyle")&&(It.quoteStyle=u.quoteStyle),r(Ze,It,n+1,l)}return r(Ze,u,n+1,l)}if(typeof e=="function"&&!K1(e)){var P=OI(e),D=Of(e,C);return"[Function"+(P?": "+P:" (anonymous)")+"]"+(D.length>0?" { "+as.call(D,", ")+" }":"")}if(Hw(e)){var N=Ec?ca.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):eg.call(e);return typeof e=="object"&&!Ec?qu(N):N}if(GI(e)){for(var z="<"+q1.call(String(e.nodeName)),B=e.attributes||[],O=0;O",z}if(rg(e)){if(e.length===0)return"[]";var G=Of(e,C);return k&&!ZI(G)?"["+ng(G,k)+"]":"[ "+as.call(G,", ")+" ]"}if(PI(e)){var U=Of(e,C);return!("cause"in Error.prototype)&&"cause"in e&&!Ww.call(e,"cause")?"{ ["+String(e)+"] "+as.call(G1.call("[cause]: "+C(e.cause),U),", ")+" }":U.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+as.call(U,", ")+" }"}if(typeof e=="object"&&d){if(X1&&typeof e[X1]=="function"&&tg)return tg(e,{depth:S-n});if(d!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(NI(e)){var K=[];return j1&&j1.call(e,function(Ze,Me){K.push(C(Me,e,!0)+" => "+C(Ze,e))}),J1("Map",yd.call(e),K,k)}if(VI(e)){var me=[];return U1&&U1.call(e,function(Ze){me.push(C(Ze,e))}),J1("Set",vd.call(e),me,k)}if(jI(e))return mm("WeakMap");if(qI(e))return mm("WeakSet");if(UI(e))return mm("WeakRef");if(DI(e))return qu(C(Number(e)));if(BI(e))return qu(C(Qm.call(e)));if(RI(e))return qu(SI.call(e));if(zI(e))return qu(C(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===xh)return"{ [object globalThis] }";if(!LI(e)&&!K1(e)){var X=Of(e,C),Y=Z1?Z1(e)===Object.prototype:e instanceof Object||e.constructor===Object,_e=e instanceof Object?"":"null prototype",ze=!Y&&Di&&Object(e)===e&&Di in e?$g.call(wa(e),8,-1):_e?"Object":"",re=Y||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ce=re+(ze||_e?"["+as.call(G1.call([],ze||[],_e||[]),": ")+"] ":"");return X.length===0?ce+"{}":k?ce+"{"+ng(X,k)+"}":ce+"{ "+as.call(X,", ")+" }"}return String(e)};function Zw(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function AI(r){return ca.call(String(r),/"/g,""")}function rg(r){return wa(r)==="[object Array]"&&(!Di||!(typeof r=="object"&&Di in r))}function LI(r){return wa(r)==="[object Date]"&&(!Di||!(typeof r=="object"&&Di in r))}function K1(r){return wa(r)==="[object RegExp]"&&(!Di||!(typeof r=="object"&&Di in r))}function PI(r){return wa(r)==="[object Error]"&&(!Di||!(typeof r=="object"&&Di in r))}function zI(r){return wa(r)==="[object String]"&&(!Di||!(typeof r=="object"&&Di in r))}function DI(r){return wa(r)==="[object Number]"&&(!Di||!(typeof r=="object"&&Di in r))}function RI(r){return wa(r)==="[object Boolean]"&&(!Di||!(typeof r=="object"&&Di in r))}function Hw(r){if(Ec)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!eg)return!1;try{return eg.call(r),!0}catch{}return!1}function BI(r){if(!r||typeof r!="object"||!Qm)return!1;try{return Qm.call(r),!0}catch{}return!1}var FI=Object.prototype.hasOwnProperty||function(r){return r in this};function oa(r,e){return FI.call(r,e)}function wa(r){return kI.call(r)}function OI(r){if(r.name)return r.name;var e=EI.call(TI.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function $w(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;te.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Xw($g.call(r,0,e.maxStringLength),e)+n}var l=ca.call(ca.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,WI);return Zw(l,"single",e)}function WI(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+MI.call(e.toString(16))}function qu(r){return"Object("+r+")"}function mm(r){return r+" { ? }"}function J1(r,e,t,n){var l=n?ng(t,n):as.call(t,", ");return r+" ("+e+") {"+l+"}"}function ZI(r){for(var e=0;e=0)return!1;return!0}function HI(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=as.call(Array(r.indent+1)," ");else return null;return{base:t,prev:as.call(Array(e+1),t)}}function ng(r,e){if(r.length===0)return"";var t=` +`+e.prev+e.base;return t+as.call(r,","+t)+` +`+e.prev}function Of(r,e){var t=rg(r),n=[];if(t){n.length=r.length;for(var l=0;l=n)return t+1;var l=ov(e,t);if(l<55296||l>56319)return t+1;var u=ov(e,t+1);return u<56320||u>57343?t+1:t+2},_m=function(e){var t=0;return{next:function(){var l=t>=e.length,u;return l||(u=e[t],t+=1),{done:l,value:u}}}},sv=function(e,t){if(_A(e)||tv(e))return _m(e);if(yA(e)){var n=0;return{next:function(){var u=xA(e,n),d=wA(e,n,u);return n=u,{done:u>e.length,value:d}}}}if(t&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!vA&&!bA)Qf.exports=function(e){if(e!=null)return sv(e,!0)};else{var SA=tx,kA=nx,av=qo("Map.prototype.forEach",!0),lv=qo("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var cv=qo("Map.prototype.iterator",!0),uv=qo("Set.prototype.iterator",!0);var hv=qo("Map.prototype.@@iterator",!0)||qo("Map.prototype._es6-shim iterator_",!0),fv=qo("Set.prototype.@@iterator",!0)||qo("Set.prototype._es6-shim iterator_",!0),TA=function(e){if(SA(e)){if(cv)return rv(cv(e));if(hv)return hv(e);if(av){var t=[];return av(e,function(l,u){iv(t,[u,l])}),_m(t)}}if(kA(e)){if(uv)return rv(uv(e));if(fv)return fv(e);if(lv){var n=[];return lv(e,function(l){iv(n,l)}),_m(n)}}};Qf.exports=function(e){return TA(e)||sv(e)}}}var EA=Qf.exports,dv=function(r){return r!==r},ix=function(e,t){return e===0&&t===0?1/e===1/t:!!(e===t||dv(e)&&dv(t))},MA=ix,ox=function(){return typeof Object.is=="function"?Object.is:MA},CA=ox,IA=il,AA=function(){var e=CA();return IA(Object,{is:e},{is:function(){return Object.is!==e}}),e},LA=il,PA=Rc,zA=ix,sx=ox,DA=AA,ax=PA(sx(),Object);LA(ax,{getPolyfill:sx,implementation:zA,shim:DA});var RA=ax,BA=Rc,lx=Ro,FA=hs,ig=FA("%ArrayBuffer%",!0),ed=lx("ArrayBuffer.prototype.byteLength",!0),OA=lx("Object.prototype.toString"),pv=!!ig&&!ed&&new ig(0).slice,mv=!!pv&&BA(pv),cx=ed||mv?function(e){if(!e||typeof e!="object")return!1;try{return ed?ed(e):mv(e,0),!0}catch{return!1}}:ig?function(e){return OA(e)==="[object ArrayBuffer]"}:function(e){return!1},NA=Date.prototype.getDay,jA=function(e){try{return NA.call(e),!0}catch{return!1}},UA=Object.prototype.toString,VA="[object Date]",qA=ol(),GA=function(e){return typeof e!="object"||e===null?!1:qA?jA(e):UA.call(e)===VA},og=Ro,ux=ol(),hx,fx,sg,ag;if(ux){hx=og("Object.prototype.hasOwnProperty"),fx=og("RegExp.prototype.exec"),sg={};var ym=function(){throw sg};ag={toString:ym,valueOf:ym},typeof Symbol.toPrimitive=="symbol"&&(ag[Symbol.toPrimitive]=ym)}var WA=og("Object.prototype.toString"),ZA=Object.getOwnPropertyDescriptor,HA="[object RegExp]",$A=ux?function(e){if(!e||typeof e!="object")return!1;var t=ZA(e,"lastIndex"),n=t&&hx(t,"value");if(!n)return!1;try{fx(e,ag)}catch(l){return l===sg}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:WA(e)===HA},XA=Ro,gv=XA("SharedArrayBuffer.prototype.byteLength",!0),KA=gv?function(e){if(!e||typeof e!="object")return!1;try{return gv(e),!0}catch{return!1}}:function(e){return!1},JA=Number.prototype.toString,YA=function(e){try{return JA.call(e),!0}catch{return!1}},QA=Object.prototype.toString,eL="[object Number]",tL=ol(),rL=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:tL?YA(e):QA.call(e)===eL},dx=Ro,nL=dx("Boolean.prototype.toString"),iL=dx("Object.prototype.toString"),oL=function(e){try{return nL(e),!0}catch{return!1}},sL="[object Boolean]",aL=ol(),lL=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:aL&&Symbol.toStringTag in e?oL(e):iL(e)===sL},lg={exports:{}},cL=Object.prototype.toString,uL=jg();if(uL){var hL=Symbol.prototype.toString,fL=/^Symbol\(.*\)$/,dL=function(e){return typeof e.valueOf()!="symbol"?!1:fL.test(hL.call(e))};lg.exports=function(e){if(typeof e=="symbol")return!0;if(cL.call(e)!=="[object Symbol]")return!1;try{return dL(e)}catch{return!1}}}else lg.exports=function(e){return!1};var pL=lg.exports,cg={exports:{}},_v=typeof BigInt<"u"&&BigInt,mL=function(){return typeof _v=="function"&&typeof BigInt=="function"&&typeof _v(42)=="bigint"&&typeof BigInt(42)=="bigint"},gL=mL();if(gL){var _L=BigInt.prototype.valueOf,yL=function(e){try{return _L.call(e),!0}catch{}return!1};cg.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:yL(e)}}else cg.exports=function(e){return!1};var vL=cg.exports,bL=Qw,wL=rL,xL=lL,SL=pL,kL=vL,TL=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(bL(e))return"String";if(wL(e))return"Number";if(xL(e))return"Boolean";if(SL(e))return"Symbol";if(kL(e))return"BigInt"},xd=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,yv=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Sd;xd||(Sd=function(e){return!1});var ug=xd?xd.prototype.has:null,vm=yv?yv.prototype.has:null;!Sd&&!ug&&(Sd=function(e){return!1});var EL=Sd||function(e){if(!e||typeof e!="object")return!1;try{if(ug.call(e,ug),vm)try{vm.call(e,vm)}catch{return!0}return e instanceof xd}catch{}return!1},hg={exports:{}},ML=hs,px=Ro,CL=ML("%WeakSet%",!0),bm=px("WeakSet.prototype.has",!0);if(bm){var wm=px("WeakMap.prototype.has",!0);hg.exports=function(e){if(!e||typeof e!="object")return!1;try{if(bm(e,bm),wm)try{wm(e,wm)}catch{return!0}return e instanceof CL}catch{}return!1}}else hg.exports=function(e){return!1};var IL=hg.exports,AL=tx,LL=nx,PL=EL,zL=IL,DL=function(e){if(e&&typeof e=="object"){if(AL(e))return"Map";if(LL(e))return"Set";if(PL(e))return"WeakMap";if(zL(e))return"WeakSet"}return!1},mx=Function.prototype.toString,gc=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,fg,td;if(typeof gc=="function"&&typeof Object.defineProperty=="function")try{fg=Object.defineProperty({},"length",{get:function(){throw td}}),td={},gc(function(){throw 42},null,fg)}catch(r){r!==td&&(gc=null)}else gc=null;var RL=/^\s*class\b/,dg=function(e){try{var t=mx.call(e);return RL.test(t)}catch{return!1}},xm=function(e){try{return dg(e)?!1:(mx.call(e),!0)}catch{return!1}},rd=Object.prototype.toString,BL="[object Object]",FL="[object Function]",OL="[object GeneratorFunction]",NL="[object HTMLAllCollection]",jL="[object HTML document.all class]",UL="[object HTMLCollection]",VL=typeof Symbol=="function"&&!!Symbol.toStringTag,qL=!(0 in[,]),pg=function(){return!1};if(typeof document=="object"){var GL=document.all;rd.call(GL)===rd.call(document.all)&&(pg=function(e){if((qL||!e)&&(typeof e>"u"||typeof e=="object"))try{var t=rd.call(e);return(t===NL||t===jL||t===UL||t===BL)&&e("")==null}catch{}return!1})}var WL=gc?function(e){if(pg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{gc(e,null,fg)}catch(t){if(t!==td)return!1}return!dg(e)&&xm(e)}:function(e){if(pg(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(VL)return xm(e);if(dg(e))return!1;var t=rd.call(e);return t!==FL&&t!==OL&&!/^\[object HTML/.test(t)?!1:xm(e)},ZL=WL,HL=Object.prototype.toString,gx=Object.prototype.hasOwnProperty,$L=function(e,t,n){for(var l=0,u=e.length;l=3&&(l=n),HL.call(e)==="[object Array]"?$L(e,t,l):typeof e=="string"?XL(e,t,l):KL(e,t,l)},YL=JL,QL=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Sm=QL,eP=typeof globalThis>"u"?xh:globalThis,tP=function(){for(var e=[],t=0;t"u"?xh:globalThis,mg=rP(),e_=Qg("String.prototype.slice"),km=Object.getPrototypeOf,iP=Qg("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n-1?t:t!=="Object"?!1:sP(e)}return nd?oP(e):null},lP=Ro,wv=lP("ArrayBuffer.prototype.byteLength",!0),cP=cx,uP=function(e){return cP(e)?wv?wv(e):e.byteLength:NaN},yx=VC,fs=Ro,xv=fI,hP=hs,Mc=EA,fP=Jw,Sv=RA,kv=qw,Tv=Yw,Ev=cx,Mv=GA,Cv=$A,Iv=KA,Av=Ng,Lv=TL,Pv=DL,zv=aP,Dv=uP,Rv=fs("SharedArrayBuffer.prototype.byteLength",!0),Bv=fs("Date.prototype.getTime"),Tm=Object.getPrototypeOf,Fv=fs("Object.prototype.toString"),Ed=hP("%Set%",!0),gg=fs("Map.prototype.has",!0),Md=fs("Map.prototype.get",!0),Ov=fs("Map.prototype.size",!0),Cd=fs("Set.prototype.add",!0),vx=fs("Set.prototype.delete",!0),Id=fs("Set.prototype.has",!0),id=fs("Set.prototype.size",!0);function Nv(r,e,t,n){for(var l=Mc(r),u;(u=l.next())&&!u.done;)if(Ho(e,u.value,t,n))return vx(r,u.value),!0;return!1}function bx(r){if(typeof r>"u")return null;if(typeof r!="object")return typeof r=="symbol"?!1:typeof r=="string"||typeof r=="number"?+r==+r:!0}function dP(r,e,t,n,l,u){var d=bx(t);if(d!=null)return d;var a=Md(e,d),_=yx({},l,{strict:!1});return typeof a>"u"&&!gg(e,d)||!Ho(n,a,_,u)?!1:!gg(r,d)&&Ho(n,a,_,u)}function pP(r,e,t){var n=bx(t);return n??(Id(e,n)&&!Id(r,n))}function jv(r,e,t,n,l,u){for(var d=Mc(r),a,_;(a=d.next())&&!a.done;)if(_=a.value,Ho(t,_,l,u)&&Ho(n,Md(e,_),l,u))return vx(r,_),!0;return!1}function Ho(r,e,t,n){var l=t||{};if(l.strict?Sv(r,e):r===e)return!0;var u=Lv(r),d=Lv(e);if(u!==d)return!1;if(!r||!e||typeof r!="object"&&typeof e!="object")return l.strict?Sv(r,e):r==e;var a=n.has(r),_=n.has(e),x;if(a&&_){if(n.get(r)===n.get(e))return!0}else x={};return a||n.set(r,x),_||n.set(e,x),_P(r,e,l,n)}function Uv(r){return!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))}function mP(r,e,t,n){if(id(r)!==id(e))return!1;for(var l=Mc(r),u=Mc(e),d,a,_;(d=l.next())&&!d.done;)if(d.value&&typeof d.value=="object")_||(_=new Ed),Cd(_,d.value);else if(!Id(e,d.value)){if(t.strict||!pP(r,e,d.value))return!1;_||(_=new Ed),Cd(_,d.value)}if(_){for(;(a=u.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!Nv(_,a.value,t.strict,n))return!1}else if(!t.strict&&!Id(r,a.value)&&!Nv(_,a.value,t.strict,n))return!1;return id(_)===0}return!0}function gP(r,e,t,n){if(Ov(r)!==Ov(e))return!1;for(var l=Mc(r),u=Mc(e),d,a,_,x,S,k;(d=l.next())&&!d.done;)if(x=d.value[0],S=d.value[1],x&&typeof x=="object")_||(_=new Ed),Cd(_,x);else if(k=Md(e,x),typeof k>"u"&&!gg(e,x)||!Ho(S,k,t,n)){if(t.strict||!dP(r,e,x,S,t,n))return!1;_||(_=new Ed),Cd(_,x)}if(_){for(;(a=u.next())&&!a.done;)if(x=a.value[0],k=a.value[1],x&&typeof x=="object"){if(!jv(_,r,x,k,t,n))return!1}else if(!t.strict&&(!r.has(x)||!Ho(Md(r,x),k,t,n))&&!jv(_,r,x,k,yx({},t,{strict:!1}),n))return!1;return id(_)===0}return!0}function _P(r,e,t,n){var l,u;if(typeof r!=typeof e||r==null||e==null||Fv(r)!==Fv(e)||kv(r)!==kv(e))return!1;var d=Tv(r),a=Tv(e);if(d!==a)return!1;var _=r instanceof Error,x=e instanceof Error;if(_!==x||(_||x)&&(r.name!==e.name||r.message!==e.message))return!1;var S=Cv(r),k=Cv(e);if(S!==k||(S||k)&&(r.source!==e.source||xv(r)!==xv(e)))return!1;var C=Mv(r),P=Mv(e);if(C!==P||(C||P)&&Bv(r)!==Bv(e)||t.strict&&Tm&&Tm(r)!==Tm(e))return!1;var D=zv(r),N=zv(e);if(D!==N)return!1;if(D||N){if(r.length!==e.length)return!1;for(l=0;l=0;l--)if(me[l]!=X[l])return!1;for(l=me.length-1;l>=0;l--)if(u=me[l],!Ho(r[u],e[u],t,n))return!1;var Y=Pv(r),_e=Pv(e);return Y!==_e?!1:Y==="Set"||_e==="Set"?mP(r,e,t,n):Y==="Map"?gP(r,e,t,n):!0}var yP=function(e,t,n){return Ho(e,t,n,fP())};const vP=xg(yP);var bP=Object.defineProperty,Hr=(r,e)=>bP(r,"name",{value:e,configurable:!0}),wP=class{constructor(e){this.direction=!1,this.compareProperties=!0;var t,n,l;this.precision=10**-((t=e==null?void 0:e.precision)!=null?t:17),this.direction=(n=e==null?void 0:e.direction)!=null?n:!1,this.compareProperties=(l=e==null?void 0:e.compareProperties)!=null?l:!0}compare(e,t){if(e.type!==t.type||!eh(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates);case"Polygon":return this.comparePolygon(e,t);case"GeometryCollection":return this.compareGeometryCollection(e,t);case"Feature":return this.compareFeature(e,t);case"FeatureCollection":return this.compareFeatureCollection(e,t);default:if(e.type.startsWith("Multi")){const n=_g(e),l=_g(t);return n.every(u=>l.some(d=>this.compare(u,d)))}}return!1}compareCoord(e,t){return e.length===t.length&&e.every((n,l)=>Math.abs(n-t[l])=0&&(n=[].concat(e.slice(l,e.length),e.slice(1,l+1))),n}comparePath(e,t){return e.every((n,l)=>this.compareCoord(n,t[l]))}comparePolygon(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){const n=e.coordinates.slice(1,e.coordinates.length),l=t.coordinates.slice(1,t.coordinates.length);return n.every(u=>l.some(d=>this.compareLine(u,d,1,!0)))}return!1}compareGeometryCollection(e,t){return eh(e.geometries,t.geometries)&&this.compareBBox(e,t)&&e.geometries.every((n,l)=>this.compare(n,t.geometries[l]))}compareFeature(e,t){return e.id===t.id&&(this.compareProperties?vP(e.properties,t.properties):!0)&&this.compareBBox(e,t)&&this.compare(e.geometry,t.geometry)}compareFeatureCollection(e,t){return eh(e.features,t.features)&&this.compareBBox(e,t)&&e.features.every((n,l)=>this.compare(n,t.features[l]))}compareBBox(e,t){return!e.bbox&&!t.bbox||(e.bbox&&t.bbox?this.compareCoord(e.bbox,t.bbox):!1)}};Hr(wP,"GeojsonEquality");function eh(r,e){return r.coordinates?r.coordinates.length===e.coordinates.length:r.length===e.length}Hr(eh,"sameLength");function _g(r){return r.coordinates.map(e=>({type:r.type.replace("Multi",""),coordinates:e}))}Hr(_g,"explode");var ho=63710088e-1,wx={centimeters:ho*100,centimetres:ho*100,degrees:360/(2*Math.PI),feet:ho*3.28084,inches:ho*39.37,kilometers:ho/1e3,kilometres:ho/1e3,meters:ho,metres:ho,miles:ho/1609.344,millimeters:ho*1e3,millimetres:ho*1e3,nauticalmiles:ho/1852,radians:1,yards:ho*1.0936},Vv={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function xa(r,e,t={}){const n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}Hr(xa,"feature");function xP(r,e,t={}){switch(r){case"Point":return Cc(e).geometry;case"LineString":return r_(e).geometry;case"Polygon":return t_(e).geometry;case"MultiPoint":return Sx(e).geometry;case"MultiLineString":return xx(e).geometry;case"MultiPolygon":return kx(e).geometry;default:throw new Error(r+" is invalid")}}Hr(xP,"geometry");function Cc(r,e,t={}){if(!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ic(r[0])||!Ic(r[1]))throw new Error("coordinates must contain numbers");return xa({type:"Point",coordinates:r},e,t)}Hr(Cc,"point");function SP(r,e,t={}){return qd(r.map(n=>Cc(n,e)),t)}Hr(SP,"points");function t_(r,e,t={}){for(const l of r){if(l.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(l[l.length-1].length!==l[0].length)throw new Error("First and last Position are not equivalent.");for(let u=0;ut_(n,e)),t)}Hr(kP,"polygons");function r_(r,e,t={}){if(r.length<2)throw new Error("coordinates must be an array of two or more positions");return xa({type:"LineString",coordinates:r},e,t)}Hr(r_,"lineString");function TP(r,e,t={}){return qd(r.map(n=>r_(n,e)),t)}Hr(TP,"lineStrings");function qd(r,e={}){const t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}Hr(qd,"featureCollection");function xx(r,e,t={}){return xa({type:"MultiLineString",coordinates:r},e,t)}Hr(xx,"multiLineString");function Sx(r,e,t={}){return xa({type:"MultiPoint",coordinates:r},e,t)}Hr(Sx,"multiPoint");function kx(r,e,t={}){return xa({type:"MultiPolygon",coordinates:r},e,t)}Hr(kx,"multiPolygon");function EP(r,e,t={}){return xa({type:"GeometryCollection",geometries:r},e,t)}Hr(EP,"geometryCollection");function MP(r,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const t=Math.pow(10,e||0);return Math.round(r*t)/t}Hr(MP,"round");function n_(r,e="kilometers"){const t=wx[e];if(!t)throw new Error(e+" units is invalid");return r*t}Hr(n_,"radiansToLength");function Gd(r,e="kilometers"){const t=wx[e];if(!t)throw new Error(e+" units is invalid");return r/t}Hr(Gd,"lengthToRadians");function CP(r,e){return bh(Gd(r,e))}Hr(CP,"lengthToDegrees");function IP(r){let e=r%360;return e<0&&(e+=360),e}Hr(IP,"bearingToAzimuth");function bh(r){return r%(2*Math.PI)*180/Math.PI}Hr(bh,"radiansToDegrees");function Lo(r){return r%360*Math.PI/180}Hr(Lo,"degreesToRadians");function AP(r,e="kilometers",t="kilometers"){if(!(r>=0))throw new Error("length must be a positive number");return n_(Gd(r,e),t)}Hr(AP,"convertLength");function LP(r,e="meters",t="kilometers"){if(!(r>=0))throw new Error("area must be a positive number");const n=Vv[e];if(!n)throw new Error("invalid original units");const l=Vv[t];if(!l)throw new Error("invalid final units");return r/n*l}Hr(LP,"convertArea");function Ic(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Hr(Ic,"isNumber");function PP(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}Hr(PP,"isObject");function zP(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(e=>{if(!Ic(e))throw new Error("bbox must only contain numbers")})}Hr(zP,"validateBBox");function DP(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Hr(DP,"validateId");var RP=Object.defineProperty,Sa=(r,e)=>RP(r,"name",{value:e,configurable:!0});function Ac(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return[...r.geometry.coordinates];if(r.type==="Point")return[...r.coordinates]}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return[...r];throw new Error("coord must be GeoJSON Point or an Array of numbers")}Sa(Ac,"getCoord");function BP(r){if(Array.isArray(r))return r;if(r.type==="Feature"){if(r.geometry!==null)return r.geometry.coordinates}else if(r.coordinates)return r.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}Sa(BP,"getCoords");function Tx(r){if(r.length>1&&Ic(r[0])&&Ic(r[1]))return!0;if(Array.isArray(r[0])&&r[0].length)return Tx(r[0]);throw new Error("coordinates must only contain numbers")}Sa(Tx,"containsNumber");function FP(r,e,t){if(!e||!t)throw new Error("type and name required");if(!r||r.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.type)}Sa(FP,"geojsonType");function OP(r,e,t){if(!r)throw new Error("No feature passed");if(!t)throw new Error(".featureOf() requires a name");if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+r.geometry.type)}Sa(OP,"featureOf");function NP(r,e,t){if(!r)throw new Error("No featureCollection passed");if(!t)throw new Error(".collectionOf() requires a name");if(!r||r.type!=="FeatureCollection")throw new Error("Invalid input to "+t+", FeatureCollection required");for(const n of r.features){if(!n||n.type!=="Feature"||!n.geometry)throw new Error("Invalid input to "+t+", Feature with geometry required");if(!n.geometry||n.geometry.type!==e)throw new Error("Invalid input to "+t+": must be a "+e+", given "+n.geometry.type)}}Sa(NP,"collectionOf");function Ex(r){return r.type==="Feature"?r.geometry:r}Sa(Ex,"getGeom");function jP(r,e){return r.type==="FeatureCollection"?"FeatureCollection":r.type==="GeometryCollection"?"GeometryCollection":r.type==="Feature"&&r.geometry!==null?r.geometry.type:r.type}Sa(jP,"getType");var UP=Object.defineProperty,Mx=(r,e)=>UP(r,"name",{value:e,configurable:!0});function i_(r,e,t={}){if(t.final===!0)return Cx(r,e);const n=Ac(r),l=Ac(e),u=Lo(n[0]),d=Lo(l[0]),a=Lo(n[1]),_=Lo(l[1]),x=Math.sin(d-u)*Math.cos(_),S=Math.cos(a)*Math.sin(_)-Math.sin(a)*Math.cos(_)*Math.cos(d-u);return bh(Math.atan2(x,S))}Mx(i_,"bearing");function Cx(r,e){let t=i_(e,r);return t=(t+180)%360,t}Mx(Cx,"calculateFinalBearing");var VP=Object.defineProperty,qP=(r,e)=>VP(r,"name",{value:e,configurable:!0});function Ix(r,e,t,n={}){const l=Ac(r),u=Lo(l[0]),d=Lo(l[1]),a=Lo(t),_=Gd(e,n.units),x=Math.asin(Math.sin(d)*Math.cos(_)+Math.cos(d)*Math.sin(_)*Math.cos(a)),S=u+Math.atan2(Math.sin(a)*Math.sin(_)*Math.cos(d),Math.cos(_)-Math.sin(d)*Math.sin(x)),k=bh(S),C=bh(x);return Cc([k,C],n.properties)}qP(Ix,"destination");var GP=Object.defineProperty,WP=(r,e)=>GP(r,"name",{value:e,configurable:!0});function Ax(r,e,t={}){var n=Ac(r),l=Ac(e),u=Lo(l[1]-n[1]),d=Lo(l[0]-n[0]),a=Lo(n[1]),_=Lo(l[1]),x=Math.pow(Math.sin(u/2),2)+Math.pow(Math.sin(d/2),2)*Math.cos(a)*Math.cos(_);return n_(2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)),t.units)}WP(Ax,"distance");var ZP=Object.defineProperty,HP=(r,e)=>ZP(r,"name",{value:e,configurable:!0});function Lx(r,e,t={}){const l=Ex(r).coordinates;let u=0;for(let d=0;d=u&&d===l.length-1);d++)if(u>=e){const a=e-u;if(a){const _=i_(l[d],l[d-1])-180;return Ix(l[d],a,_,t)}else return Cc(l[d])}else u+=Ax(l[d],l[d+1],t);return Cc(l[l.length-1])}HP(Lx,"along");var $P=Lx;function XP(r){let e,t;const n=[Hn("animate-shortcuts"),{paint:{"circle-radius":10,"circle-color":"purple","circle-stroke-color":"black","circle-stroke-width":1}}];let l={};for(let u=0;uclearInterval(a));function _(){return n.features.map(P=>1/P.properties.directness).reduce((P,D)=>P+D,0)}function x(){return n.features.length==0?[]:Array.from({length:JP},S)}function S(){let P=Math.random()*l,D=0;for(let[N,z]of n.features.entries())if(D+=1/z.properties.directness,P$P(n.features[P],D,{units:"kilometers"}))}}function C(){for(let[P,D]of u.entries())D.distance+=QP,D.distance>=n.features[D.idx].properties.length_meters/1e3&&(u[P]=S());t(0,d=k())}return r.$$set=P=>{"paths"in P&&t(1,n=P.paths)},r.$$.update=()=>{r.$$.dirty&2&&n&&(l=_(),u=x())},[d,n]}class t6 extends Ht{constructor(e){super(),Zt(this,e,e6,KP,jt,{paths:1})}}function r6(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function n6(r){let e;return{c(){e=rt("Pick neighbourhood")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function i6(r){let e;return{c(){e=fe("p"),e.textContent=`Now that you've defined a neighbourhood boundary, you can see the + possible shortcuts that vehicles are currently able to take + through it. You can add a new modal filter to try and solve this. + The colored "cell" areas show what's reachable for drivers without + leaving the boundary you've drawn.`},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function o6(r){let e;return{c(){e=rt("View shortcuts")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function s6(r){let e;return{c(){e=rt("Route")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function a6(r){let e;return{c(){e=rt("Change this boundary")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function l6(r){let e;return{c(){e=rt("Debug")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function c6(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N,z,B,O,G,U,K,me,X,Y,_e,ze,re;return u=new Zr({props:{$$slots:{default:[r6]},$$scope:{ctx:r}}}),u.$on("click",r[25]),_=new Zr({props:{$$slots:{default:[n6]},$$scope:{ctx:r}}}),_.$on("click",r[26]),C=new Og({props:{$$slots:{default:[i6]},$$scope:{ctx:r}}}),B=new Zr({props:{$$slots:{default:[o6]},$$scope:{ctx:r}}}),B.$on("click",r[27]),U=new Zr({props:{$$slots:{default:[s6]},$$scope:{ctx:r}}}),U.$on("click",r[28]),X=new Zr({props:{$$slots:{default:[a6]},$$scope:{ctx:r}}}),X.$on("click",r[29]),ze=new Zr({props:{$$slots:{default:[l6]},$$scope:{ctx:r}}}),ze.$on("click",r[30]),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),je(_.$$.fragment),x=Ve(),S=fe("li"),k=rt(`Editing + `),je(C.$$.fragment),P=Ve(),D=fe("nav"),N=fe("ul"),z=fe("li"),je(B.$$.fragment),O=Ve(),G=fe("li"),je(U.$$.fragment),K=Ve(),me=fe("li"),je(X.$$.fragment),Y=Ve(),_e=fe("li"),je(ze.$$.fragment),Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top"),fn(e,"display","flex"),fn(e,"justify-content","space-between")},m(ce,Ze){be(ce,e,Ze),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),Oe(_,a,null),ie(n,x),ie(n,S),ie(S,k),Oe(C,S,null),ie(e,P),ie(e,D),ie(D,N),ie(N,z),Oe(B,z,null),ie(N,O),ie(N,G),Oe(U,G,null),ie(N,K),ie(N,me),Oe(X,me,null),ie(N,Y),ie(N,_e),Oe(ze,_e,null),re=!0},p(ce,Ze){const Me={};Ze[1]&8&&(Me.$$scope={dirty:Ze,ctx:ce}),u.$set(Me);const ht={};Ze[1]&8&&(ht.$$scope={dirty:Ze,ctx:ce}),_.$set(ht);const It={};Ze[1]&8&&(It.$$scope={dirty:Ze,ctx:ce}),C.$set(It);const Ot={};Ze[1]&8&&(Ot.$$scope={dirty:Ze,ctx:ce}),B.$set(Ot);const Ke={};Ze[1]&8&&(Ke.$$scope={dirty:Ze,ctx:ce}),U.$set(Ke);const Kt={};Ze[1]&8&&(Kt.$$scope={dirty:Ze,ctx:ce}),X.$set(Kt);const vt={};Ze[1]&8&&(vt.$$scope={dirty:Ze,ctx:ce}),ze.$set(vt)},i(ce){re||(oe(u.$$.fragment,ce),oe(_.$$.fragment,ce),oe(C.$$.fragment,ce),oe(B.$$.fragment,ce),oe(U.$$.fragment,ce),oe(X.$$.fragment,ce),oe(ze.$$.fragment,ce),re=!0)},o(ce){de(u.$$.fragment,ce),de(_.$$.fragment,ce),de(C.$$.fragment,ce),de(B.$$.fragment,ce),de(U.$$.fragment,ce),de(X.$$.fragment,ce),de(ze.$$.fragment,ce),re=!1},d(ce){ce&&ve(e),Ne(u),Ne(_),Ne(C),Ne(B),Ne(U),Ne(X),Ne(ze)}}}function qv(r){let e;return{c(){e=fe("mark"),e.textContent=`Some parts of the neighbourhood aren't reachable by drivers, shown in + red`},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function u6(r){let e,t,n;return{c(){e=rt("Undo ("),t=rt(r[4]),n=rt(")")},m(l,u){be(l,e,u),be(l,t,u),be(l,n,u)},p(l,u){u[0]&16&&Lr(t,l[4])},d(l){l&&(ve(e),ve(t),ve(n))}}}function h6(r){let e;return{c(){e=rt("Undo")},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function f6(r){let e,t,n;return{c(){e=rt("Redo ("),t=rt(r[5]),n=rt(")")},m(l,u){be(l,e,u),be(l,t,u),be(l,n,u)},p(l,u){u[0]&32&&Lr(t,l[5])},d(l){l&&(ve(e),ve(t),ve(n))}}}function d6(r){let e;return{c(){e=rt("Redo")},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function Gv(r){let e,t;return e=new xM({}),e.$on("close",r[24]),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p:Ct,i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function p6(r){let e,t,n,l,u=dn(r[6]).properties.name+"",d,a,_=r[1].area_km2.toFixed(1)+"",x,S,k,C,P,D,N,z,B,O,G,U,K,me,X,Y,_e,ze,re,ce,Ze,Me,ht,It,Ot,Ke,Kt,vt,Lt,Vt,sr,fr,er,Nt,nr,tr=r[8]>0&&qv();function Pr(it,ne){return it[4]==0?h6:u6}let pt=Pr(r),Et=pt(r);function gr(it,ne){return it[5]==0?d6:f6}let Re=gr(r),st=Re(r),tt=r[3]&&Gv(r);return{c(){e=fe("div"),t=fe("p"),n=rt("Editing neighbourhood "),l=fe("u"),d=rt(u),a=rt(` + , with an area of `),x=rt(_),S=rt(" km²"),k=Ve(),tr&&tr.c(),C=Ve(),P=fe("div"),D=fe("button"),N=fe("img"),B=rt(` + Add a modal filter`),G=Ve(),U=fe("button"),K=rt("Add many modal filters along line"),X=Ve(),Y=fe("button"),_e=rt("Reverse directions"),re=Ve(),ce=fe("button"),ce.textContent="Change modal filter type",Ze=Ve(),Me=fe("label"),ht=fe("input"),It=rt(` + Animate shortcuts`),Ot=Ve(),Ke=fe("div"),Kt=fe("button"),Et.c(),Lt=Ve(),Vt=fe("button"),st.c(),fr=Ve(),tt&&tt.c(),En(N.src,z=`/ltn//filters/${r[9]}_icon.gif`)||Ee(N,"src",z),Ee(N,"width","30"),Ee(N,"alt","Add a modal filter"),D.disabled=O=r[0]=="filter",Ee(D,"data-tooltip","hotkey 1"),U.disabled=me=r[0]=="freehand-filters",Ee(U,"data-tooltip","hotkey 2"),Y.disabled=ze=r[0]=="oneway",Ee(Y,"data-tooltip","hotkey 3"),fn(P,"display","flex"),fn(P,"justify-content","space-between"),Ee(ht,"type","checkbox"),Kt.disabled=vt=r[4]==0,Ee(Kt,"data-tooltip","Ctrl+Z"),Vt.disabled=sr=r[5]==0,Ee(Vt,"data-tooltip","Ctrl+Y"),fn(Ke,"display","flex"),fn(Ke,"justify-content","space-between"),Ee(e,"slot","sidebar")},m(it,ne){be(it,e,ne),ie(e,t),ie(t,n),ie(t,l),ie(l,d),ie(t,a),ie(t,x),ie(t,S),ie(e,k),tr&&tr.m(e,null),ie(e,C),ie(e,P),ie(P,D),ie(D,N),ie(D,B),ie(P,G),ie(P,U),ie(U,K),ie(P,X),ie(P,Y),ie(Y,_e),ie(e,re),ie(e,ce),ie(e,Ze),ie(e,Me),ie(Me,ht),ht.checked=r[10],ie(Me,It),ie(e,Ot),ie(e,Ke),ie(Ke,Kt),Et.m(Kt,null),ie(Ke,Lt),ie(Ke,Vt),st.m(Vt,null),ie(e,fr),tt&&tt.m(e,null),er=!0,Nt||(nr=[Tt(D,"click",r[19]),Tt(U,"click",r[20]),Tt(Y,"click",r[21]),Tt(ce,"click",r[22]),Tt(ht,"change",r[23]),Tt(Kt,"click",r[15]),Tt(Vt,"click",r[16])],Nt=!0)},p(it,ne){(!er||ne[0]&64)&&u!==(u=dn(it[6]).properties.name+"")&&Lr(d,u),(!er||ne[0]&2)&&_!==(_=it[1].area_km2.toFixed(1)+"")&&Lr(x,_),it[8]>0?tr||(tr=qv(),tr.c(),tr.m(e,C)):tr&&(tr.d(1),tr=null),(!er||ne[0]&512&&!En(N.src,z=`/ltn//filters/${it[9]}_icon.gif`))&&Ee(N,"src",z),(!er||ne[0]&1&&O!==(O=it[0]=="filter"))&&(D.disabled=O),(!er||ne[0]&1&&me!==(me=it[0]=="freehand-filters"))&&(U.disabled=me),(!er||ne[0]&1&&ze!==(ze=it[0]=="oneway"))&&(Y.disabled=ze),ne[0]&1024&&(ht.checked=it[10]),pt===(pt=Pr(it))&&Et?Et.p(it,ne):(Et.d(1),Et=pt(it),Et&&(Et.c(),Et.m(Kt,null))),(!er||ne[0]&16&&vt!==(vt=it[4]==0))&&(Kt.disabled=vt),Re===(Re=gr(it))&&st?st.p(it,ne):(st.d(1),st=Re(it),st&&(st.c(),st.m(Vt,null))),(!er||ne[0]&32&&sr!==(sr=it[5]==0))&&(Vt.disabled=sr),it[3]?tt?(tt.p(it,ne),ne[0]&8&&oe(tt,1)):(tt=Gv(it),tt.c(),oe(tt,1),tt.m(e,null)):tt&&(vr(),de(tt,1,1,()=>{tt=null}),br())},i(it){er||(oe(tt),er=!0)},o(it){de(tt),er=!1},d(it){it&&ve(e),tr&&tr.d(),Et.d(),st.d(),tt&&tt.d(),Nt=!1,_n(nr)}}}function m6(r){let e;return{c(){e=fe("p"),e.textContent="Click to change direction"},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function g6(r){let e,t,n,l;return{c(){e=fe("div"),t=fe("img"),l=rt(` + Click to add modal filter`),En(t.src,n=`/ltn//filters/${r[9]}_icon.gif`)||Ee(t,"src",n),Ee(t,"width","20"),Ee(t,"alt","Add modal filter")},m(u,d){be(u,e,d),ie(e,t),ie(e,l)},p(u,d){d[0]&512&&!En(t.src,n=`/ltn//filters/${u[9]}_icon.gif`)&&Ee(t,"src",n)},d(u){u&&ve(e)}}}function _6(r){let e,t=r[33].shortcuts+"",n,l,u=(r[33].name??"unnamed road")+"",d,a,_;function x(C,P){return C[0]=="filter"?g6:m6}let S=x(r),k=S(r);return{c(){e=fe("p"),n=rt(t),l=rt(" shortcuts through "),d=rt(u),a=Ve(),k.c(),_=$n()},m(C,P){be(C,e,P),ie(e,n),ie(e,l),ie(e,d),be(C,a,P),k.m(C,P),be(C,_,P)},p(C,P){P[1]&4&&t!==(t=C[33].shortcuts+"")&&Lr(n,t),P[1]&4&&u!==(u=(C[33].name??"unnamed road")+"")&&Lr(d,u),S===(S=x(C))&&k?k.p(C,P):(k.d(1),k=S(C),k&&(k.c(),k.m(_.parentNode,_)))},d(C){C&&(ve(e),ve(a),ve(_)),k.d(C)}}}function y6(r){let e,t,n;return t=new Os({props:{openOn:"hover",$$slots:{default:[_6,({props:l})=>({33:l}),({props:l})=>[0,l?4:0]]},$$scope:{ctx:r}}}),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"slot","line-popup")},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p(l,u){const d={};u[0]&513|u[1]&12&&(d.$$scope={dirty:u,ctx:l}),t.$set(d)},i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function Wv(r){let e,t;return e=new t6({props:{paths:r[7]}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l[0]&128&&(u.paths=n[7]),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function v6(r){let e;return{c(){e=rt("Click to delete")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function b6(r){let e,t;return e=new Os({props:{openOn:"hover",$$slots:{default:[v6]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l[1]&8&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function Zv(r){let e,t;return e=new EM({props:{map:dn(r[2])}}),e.$on("done",r[17]),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l[0]&4&&(u.map=dn(n[2])),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function w6(r){let e,t,n,l,u,d,a;t=new Nd({props:{gjInput:r[1],interactive:r[0]=="filter"||r[0]=="oneway",onClickLine:r[12],$$slots:{"line-popup":[y6]},$$scope:{ctx:r}}});let _=r[10]&&Wv(r);u=new jd({props:{$$slots:{default:[b6]},$$scope:{ctx:r}}}),u.$on("click",r[13]);let x=r[0]=="freehand-filters"&&Zv(r);return{c(){e=fe("div"),je(t.$$.fragment),n=Ve(),_&&_.c(),l=Ve(),je(u.$$.fragment),d=Ve(),x&&x.c(),Ee(e,"slot","map")},m(S,k){be(S,e,k),Oe(t,e,null),ie(e,n),_&&_.m(e,null),ie(e,l),Oe(u,e,null),ie(e,d),x&&x.m(e,null),a=!0},p(S,k){const C={};k[0]&2&&(C.gjInput=S[1]),k[0]&1&&(C.interactive=S[0]=="filter"||S[0]=="oneway"),k[0]&513|k[1]&8&&(C.$$scope={dirty:k,ctx:S}),t.$set(C),S[10]?_?(_.p(S,k),k[0]&1024&&oe(_,1)):(_=Wv(S),_.c(),oe(_,1),_.m(e,l)):_&&(vr(),de(_,1,1,()=>{_=null}),br());const P={};k[1]&8&&(P.$$scope={dirty:k,ctx:S}),u.$set(P),S[0]=="freehand-filters"?x?(x.p(S,k),k[0]&1&&oe(x,1)):(x=Zv(S),x.c(),oe(x,1),x.m(e,null)):x&&(vr(),de(x,1,1,()=>{x=null}),br())},i(S){a||(oe(t.$$.fragment,S),oe(_),oe(u.$$.fragment,S),oe(x),a=!0)},o(S){de(t.$$.fragment,S),de(_),de(u.$$.fragment,S),de(x),a=!1},d(S){S&&ve(e),Ne(t),_&&_.d(),Ne(u),x&&x.d()}}}function x6(r){let e,t,n,l;return e=new Fs({props:{$$slots:{map:[w6],sidebar:[p6],top:[c6]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(u,d){Oe(e,u,d),t=!0,n||(l=Tt(window,"keydown",r[14]),n=!0)},p(u,d){const a={};d[0]&4095|d[1]&8&&(a.$$scope={dirty:d,ctx:u}),e.$set(a)},i(u){t||(oe(e.$$.fragment,u),t=!0)},o(u){de(e.$$.fragment,u),t=!1},d(u){Ne(e,u),n=!1,l()}}}function S6(r,e,t){let n,l,u,d,a,_,x;wt(r,ia,vt=>t(18,l=vt)),wt(r,Om,vt=>t(9,u=vt)),wt(r,ri,vt=>t(31,d=vt)),wt(r,ls,vt=>t(2,a=vt)),wt(r,Wy,vt=>t(10,_=vt)),wt(r,pr,vt=>t(11,x=vt));let S="filter",k=!1,C=0,P=0,D,N,z=JSON.parse(d.getAllShortcuts());ti(()=>{a.doubleClickZoom.enable()});function B(vt){t(1,N=JSON.parse(d.renderNeighbourhood())),t(6,D=N.features.find(Lt=>Lt.properties.kind=="boundary")),t(4,C=N.undo_length),t(5,P=N.redo_length),t(7,z=JSON.parse(d.getAllShortcuts())),Sc()}function O(vt,Lt){S=="filter"?(d.addModalFilter(Lt,u),Rt(ia,l++,l)):S=="oneway"&&(d.toggleDirection(vt.properties.road),Rt(ia,l++,l))}function G(vt){let Lt=vt.detail.features[0];d.deleteModalFilter(Lt.properties.road),Rt(ia,l++,l)}function U(vt){vt.target.tagName!="INPUT"&&(vt.ctrlKey&&vt.key=="z"&&K(),vt.ctrlKey&&vt.key=="y"&&me(),vt.key=="1"&&t(0,S="filter"),vt.key=="2"&&t(0,S="freehand-filters"),vt.key=="3"&&t(0,S="oneway"))}function K(){d.undo(),Rt(ia,l++,l)}function me(){d.redo(),Rt(ia,l++,l)}function X(vt){let Lt=vt.detail;Lt&&(d.addManyModalFilters(Lt,u),Rt(ia,l++,l)),t(0,S="filter")}const Y=()=>t(0,S="filter"),_e=()=>t(0,S="freehand-filters"),ze=()=>t(0,S="oneway"),re=()=>t(3,k=!0);function ce(){_=this.checked,Wy.set(_)}const Ze=()=>t(3,k=!1),Me=()=>Rt(pr,x={mode:"title"},x),ht=()=>Rt(pr,x={mode:"network"},x),It=()=>Rt(pr,x={mode:"view-shortcuts"},x),Ot=()=>Rt(pr,x={mode:"route",prevMode:"neighbourhood"},x),Ke=()=>Rt(pr,x={mode:"set-boundary",name:dn(D).properties.name,existing:D},x),Kt=()=>Rt(pr,x={mode:"debug"},x);return r.$$.update=()=>{r.$$.dirty[0]&5&&(S=="oneway"?a.doubleClickZoom.disable():a.doubleClickZoom.enable()),r.$$.dirty[0]&262144&&B(),r.$$.dirty[0]&2&&t(8,n=N.features.filter(vt=>vt.properties.kind=="cell"&&vt.properties.cell_color=="disconnected").length)},[S,N,a,k,C,P,D,z,n,u,_,x,O,G,U,K,me,X,l,Y,_e,ze,re,ce,Ze,Me,ht,It,Ot,Ke,Kt]}class k6 extends Ht{constructor(e){super(),Zt(this,e,S6,x6,jt,{},null,[-1,-1])}}const Px="/ltn/assets/delete-ec75e756.svg",zx="/ltn/assets/edit-f3f51206.svg";function Hv(r,e,t){const n=r.slice();return n[19]=e[t],n}function T6(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function E6(r){let e;return{c(){e=fe("p"),e.textContent=`Inside the neighbourhood you define, the goal is to eliminate (or + deliberately permit) through-traffic. An appropriate neighbourhood + boundary depends on many factors. The simplest approach is to find + the area bounded on all sides by "main" roads, which are designed + for higher traffic volumes. There are many other considerations, + though -- maybe severances like rivers or rail should be part of a + boundary. Bridges and tunnels near a boundary may be confusing as + well. And note that your boundary may not match the conventional + definition of "neighbourhood."`},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function M6(r){let e;return{c(){e=rt("Route")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function C6(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N;return u=new Zr({props:{$$slots:{default:[T6]},$$scope:{ctx:r}}}),u.$on("click",r[16]),x=new Og({props:{$$slots:{default:[E6]},$$scope:{ctx:r}}}),D=new Zr({props:{$$slots:{default:[M6]},$$scope:{ctx:r}}}),D.$on("click",r[17]),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),_=rt(`Pick neighbourhood + `),je(x.$$.fragment),S=Ve(),k=fe("nav"),C=fe("ul"),P=fe("li"),je(D.$$.fragment),Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top"),fn(e,"display","flex"),fn(e,"justify-content","space-between")},m(z,B){be(z,e,B),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),ie(a,_),Oe(x,a,null),ie(e,S),ie(e,k),ie(k,C),ie(C,P),Oe(D,P,null),N=!0},p(z,B){const O={};B&4194304&&(O.$$scope={dirty:B,ctx:z}),u.$set(O);const G={};B&4194304&&(G.$$scope={dirty:B,ctx:z}),x.$set(G);const U={};B&4194304&&(U.$$scope={dirty:B,ctx:z}),D.$set(U)},i(z){N||(oe(u.$$.fragment,z),oe(x.$$.fragment,z),oe(D.$$.fragment,z),N=!0)},o(z){de(u.$$.fragment,z),de(x.$$.fragment,z),de(D.$$.fragment,z),N=!1},d(z){z&&ve(e),Ne(u),Ne(x),Ne(D)}}}function I6(r){let e;return{c(){e=rt("Draw a new boundary")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function A6(r){let e;return{c(){e=rt("Use an auto-generated boundary")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function L6(r){let e=r[19]+"",t;return{c(){t=rt(e)},m(n,l){be(n,t,l)},p(n,l){l&2&&e!==(e=n[19]+"")&&Lr(t,e)},d(n){n&&ve(t)}}}function $v(r){let e,t,n,l,u,d,a,_,x,S,k;function C(){return r[13](r[19])}n=new Zr({props:{$$slots:{default:[L6]},$$scope:{ctx:r}}}),n.$on("click",C);function P(){return r[14](r[19])}function D(){return r[15](r[19])}return{c(){e=fe("li"),t=fe("span"),je(n.$$.fragment),l=Ve(),u=fe("button"),u.innerHTML=`Rename neighbourhood`,d=Ve(),a=fe("button"),a.innerHTML=`Delete neighbourhood`,_=Ve(),Ee(u,"class","secondary"),Ee(a,"class","secondary"),fn(t,"display","flex"),fn(t,"justify-content","space-between")},m(N,z){be(N,e,z),ie(e,t),Oe(n,t,null),ie(t,l),ie(t,u),ie(t,d),ie(t,a),ie(e,_),x=!0,S||(k=[Tt(u,"click",P),Tt(a,"click",D)],S=!0)},p(N,z){r=N;const B={};z&4194306&&(B.$$scope={dirty:z,ctx:r}),n.$set(B)},i(N){x||(oe(n.$$.fragment,N),x=!0)},o(N){de(n.$$.fragment,N),x=!1},d(N){N&&ve(e),Ne(n),S=!1,_n(k)}}}function P6(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N,z,B,O,G,U,K;n=new Zr({props:{$$slots:{default:[I6]},$$scope:{ctx:r}}}),n.$on("click",r[7]),d=new Zr({props:{$$slots:{default:[A6]},$$scope:{ctx:r}}}),d.$on("click",r[12]);let me=Jn(r[1]),X=[];for(let _e=0;_ede(X[_e],1,1,()=>{X[_e]=null});return{c(){e=fe("div"),t=fe("div"),je(n.$$.fragment),l=Ve(),u=fe("div"),je(d.$$.fragment),a=Ve(),_=fe("ul");for(let _e=0;_e({18:n}),({props:n})=>n?262144:0]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&4456448&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function R6(r){let e,t;const n=[Hn("neighbourhood-boundaries"),{filter:["==",["get","kind"],"boundary"]},{paint:{"fill-color":"red","fill-opacity":kc(.3,.5)}},{eventsIfTopMost:!0},{manageHoverState:!0},{hoverCursor:"pointer"}];let l={$$slots:{default:[D6]},$$scope:{ctx:r}};for(let u=0;ut(10,u=K)),wt(r,ha,K=>t(2,d=K)),wt(r,pr,K=>t(3,a=K));function _(K){u.setCurrentNeighbourhood(K),Rt(pr,a={mode:"neighbourhood"},a)}function x(K){window.confirm(`Really delete neighbourhood ${K}? You can't undo this.`)&&(u.deleteNeighbourhoodBoundary(K),Sc(),t(0,n=JSON.parse(u.toSavefile())))}function S(K){let me=window.prompt(`Rename neighbourhood ${K} to what?`,K);me&&(u.renameNeighbourhoodBoundary(K,me),Sc(),t(0,n=JSON.parse(u.toSavefile())))}function k(){let K=window.prompt("What do you want to name the neighbourhood?");K&&Rt(pr,a={mode:"set-boundary",name:K,existing:null},a)}function C(){ad(d+".geojson",u.toSavefile())}function P(){ad("debug_route_snapper.geojson",u.toRouteSnapperGj())}const D=K=>_(dn(K.detail.features[0].properties).name),N=()=>Rt(pr,a={mode:"auto-boundaries"},a),z=K=>_(K),B=K=>S(K),O=K=>x(K),G=()=>Rt(pr,a={mode:"title"},a),U=()=>Rt(pr,a={mode:"route",prevMode:"network"},a);return r.$$.update=()=>{r.$$.dirty&1024&&t(0,n=JSON.parse(u.toSavefile())),r.$$.dirty&1&&t(1,l=n.features.filter(K=>K.properties.kind=="boundary").map(K=>K.properties.name))},[n,l,d,a,_,x,S,k,C,P,u,D,N,z,B,O,G,U]}class N6 extends Ht{constructor(e){super(),Zt(this,e,O6,F6,jt,{})}}function j6(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function U6(r){let e;return{c(){e=rt("Pick neighbourhood")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function Xv(r){let e,t,n;return t=new Zr({props:{$$slots:{default:[V6]},$$scope:{ctx:r}}}),t.$on("click",r[13]),{c(){e=fe("li"),je(t.$$.fragment)},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p(l,u){const d={};u&16384&&(d.$$scope={dirty:u,ctx:l}),t.$set(d)},i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function V6(r){let e;return{c(){e=rt("Editing")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function q6(r){let e,t,n,l,u,d,a,_,x,S,k,C;u=new Zr({props:{$$slots:{default:[j6]},$$scope:{ctx:r}}}),u.$on("click",r[11]),_=new Zr({props:{$$slots:{default:[U6]},$$scope:{ctx:r}}}),_.$on("click",r[12]);let P=r[0]=="neighbourhood"&&Xv(r);return{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),je(_.$$.fragment),x=Ve(),P&&P.c(),S=Ve(),k=fe("li"),k.textContent="Routing",Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top")},m(D,N){be(D,e,N),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),Oe(_,a,null),ie(n,x),P&&P.m(n,null),ie(n,S),ie(n,k),C=!0},p(D,N){const z={};N&16384&&(z.$$scope={dirty:N,ctx:D}),u.$set(z);const B={};N&16384&&(B.$$scope={dirty:N,ctx:D}),_.$set(B),D[0]=="neighbourhood"?P?(P.p(D,N),N&1&&oe(P,1)):(P=Xv(D),P.c(),oe(P,1),P.m(n,S)):P&&(vr(),de(P,1,1,()=>{P=null}),br())},i(D){C||(oe(u.$$.fragment,D),oe(_.$$.fragment,D),oe(P),C=!0)},o(D){de(u.$$.fragment,D),de(_.$$.fragment,D),de(P),C=!1},d(D){D&&ve(e),Ne(u),Ne(_),P&&P.d()}}}function G6(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N,z,B;return t=new Od({}),t.$on("click",r[7]),{c(){e=fe("div"),je(t.$$.fragment),n=Ve(),l=fe("p"),l.textContent="Drag markers for a route",u=Ve(),d=fe("p"),d.innerHTML=`Route before + , + route after`,a=Ve(),_=fe("label"),x=rt("Slow-down factor for main roads: "),S=rt(r[1]),k=Ve(),C=fe("input"),P=Ve(),D=fe("i"),D.textContent=`Increase to see how drivers may detour in heavy traffic. 1 means + free-flow.`,Ee(C,"type","range"),Ee(C,"min","1.0"),Ee(C,"max","5.0"),Ee(C,"step","0.1"),Ee(e,"slot","sidebar")},m(O,G){be(O,e,G),Oe(t,e,null),ie(e,n),ie(e,l),ie(e,u),ie(e,d),ie(e,a),ie(e,_),ie(_,x),ie(_,S),ie(_,k),ie(_,C),ei(C,r[1]),ie(e,P),ie(e,D),N=!0,z||(B=[Tt(C,"change",r[10]),Tt(C,"input",r[10])],z=!0)},p(O,G){(!N||G&2)&&Lr(S,O[1]),G&2&&ei(C,O[1])},i(O){N||(oe(t.$$.fragment,O),N=!0)},o(O){de(t.$$.fragment,O),N=!1},d(O){O&&ve(e),Ne(t),z=!1,_n(B)}}}function Kv(r){let e,t;return e=new Nd({props:{gjInput:JSON.parse(dn(r[4]).renderNeighbourhood()),interactive:!1}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&16&&(u.gjInput=JSON.parse(dn(n[4]).renderNeighbourhood())),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function W6(r){let e,t;const n=[Hn("compare-route"),{paint:{"line-width":10,"line-color":i5(["get","kind"],{before:"red",after:"blue"},"red")}}];let l={};for(let u=0;uzo(a,"lngLat",D));function z(O){r[9](O)}let B={draggable:!0,$$slots:{default:[H6]},$$scope:{ctx:r}};return r[2]!==void 0&&(B.lngLat=r[2]),S=new fd({props:B}),pn.push(()=>zo(S,"lngLat",z)),{c(){e=fe("div"),P&&P.c(),t=Ve(),je(n.$$.fragment),l=Ve(),je(u.$$.fragment),d=Ve(),je(a.$$.fragment),x=Ve(),je(S.$$.fragment),Ee(e,"slot","map")},m(O,G){be(O,e,G),P&&P.m(e,null),ie(e,t),Oe(n,e,null),ie(e,l),Oe(u,e,null),ie(e,d),Oe(a,e,null),ie(e,x),Oe(S,e,null),C=!0},p(O,G){O[0]=="neighbourhood"?P?(P.p(O,G),G&1&&oe(P,1)):(P=Kv(O),P.c(),oe(P,1),P.m(e,t)):P&&(vr(),de(P,1,1,()=>{P=null}),br());const U={};G&32&&(U.data=O[5]),G&16384&&(U.$$scope={dirty:G,ctx:O}),u.$set(U);const K={};G&16384&&(K.$$scope={dirty:G,ctx:O}),!_&&G&8&&(_=!0,K.lngLat=O[3],Po(()=>_=!1)),a.$set(K);const me={};G&16384&&(me.$$scope={dirty:G,ctx:O}),!k&&G&4&&(k=!0,me.lngLat=O[2],Po(()=>k=!1)),S.$set(me)},i(O){C||(oe(P),oe(n.$$.fragment,O),oe(u.$$.fragment,O),oe(a.$$.fragment,O),oe(S.$$.fragment,O),C=!0)},o(O){de(P),de(n.$$.fragment,O),de(u.$$.fragment,O),de(a.$$.fragment,O),de(S.$$.fragment,O),C=!1},d(O){O&&ve(e),P&&P.d(),Ne(n),Ne(u),Ne(a),Ne(S)}}}function X6(r){let e,t;return e=new Fs({props:{$$slots:{map:[$6],sidebar:[G6],top:[q6]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&16511&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function K6(r,e,t){let n,l,u,d,a,_;wt(r,pr,B=>t(6,l=B)),wt(r,Gy,B=>t(1,u=B)),wt(r,Fm,B=>t(2,d=B)),wt(r,Bm,B=>t(3,a=B)),wt(r,ri,B=>t(4,_=B));let{prevMode:x}=e;function S(){Rt(pr,l={mode:x},l)}function k(B){a=B,Bm.set(a)}function C(B){d=B,Fm.set(d)}function P(){u=bg(this.value),Gy.set(u)}const D=()=>Rt(pr,l={mode:"title"},l),N=()=>Rt(pr,l={mode:"network"},l),z=()=>Rt(pr,l={mode:"neighbourhood"},l);return r.$$set=B=>{"prevMode"in B&&t(0,x=B.prevMode)},r.$$.update=()=>{r.$$.dirty&30&&t(5,n=JSON.parse(_.compareRoute(a.lng,a.lat,d.lng,d.lat,u)))},[x,u,d,a,_,n,l,S,k,C,P,D,N,z]}class J6 extends Ht{constructor(e){super(),Zt(this,e,K6,X6,jt,{prevMode:0})}}const Y6="/ltn/assets/settings-342fb430.svg";function Jv(r){let e,t;return e=new Pd({props:{$$slots:{default:[Q6]},$$scope:{ctx:r}}}),e.$on("close",r[3]),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&17&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function Q6(r){let e,t,n,l,u,d,a,_,x;return n=new y5({}),{c(){e=fe("h1"),e.textContent="Settings",t=Ve(),je(n.$$.fragment),l=Ve(),u=fe("center"),d=fe("button"),d.textContent="Confirm"},m(S,k){be(S,e,k),be(S,t,k),Oe(n,S,k),be(S,l,k),be(S,u,k),ie(u,d),a=!0,_||(x=Tt(d,"click",r[2]),_=!0)},p:Ct,i(S){a||(oe(n.$$.fragment,S),a=!0)},o(S){de(n.$$.fragment,S),a=!1},d(S){S&&(ve(e),ve(t),ve(l),ve(u)),Ne(n,S),_=!1,x()}}}function ez(r){let e,t,n,l,u,d,a=r[0]&&Jv(r);return{c(){e=fe("button"),e.innerHTML=`Settings`,t=Ve(),a&&a.c(),n=$n(),Ee(e,"class","outline")},m(_,x){be(_,e,x),be(_,t,x),a&&a.m(_,x),be(_,n,x),l=!0,u||(d=Tt(e,"click",r[1]),u=!0)},p(_,[x]){_[0]?a?(a.p(_,x),x&1&&oe(a,1)):(a=Jv(_),a.c(),oe(a,1),a.m(n.parentNode,n)):a&&(vr(),de(a,1,1,()=>{a=null}),br())},i(_){l||(oe(a),l=!0)},o(_){de(a),l=!1},d(_){_&&(ve(e),ve(t),ve(n)),a&&a.d(_),u=!1,d()}}}function tz(r,e,t){let n=!1;return[n,()=>t(0,n=!0),()=>t(0,n=!1),()=>t(0,n=!1)]}class rz extends Ht{constructor(e){super(),Zt(this,e,tz,ez,jt,{})}}let Lc=Er(null);const To=Er([]);function Dx(r){if(r.length<3)return JSON.parse(Hi(Lc).inner.calculateRoute(r));let e=JSON.parse(JSON.stringify(r));e.push(e[0]);let t=JSON.parse(Hi(Lc).inner.calculateRoute(e));return t.properties.waypoints.pop(),t.geometry.type="Polygon",t.geometry.coordinates=[t.geometry.coordinates],t}const{window:nz}=Ad,iz=r=>({}),Yv=r=>({}),oz=r=>({}),Qv=r=>({});function eb(r,e,t){const n=r.slice();return n[43]=e[t],n[44]=e,n[45]=t,n}function tb(r,e,t){const n=r.slice();return n[46]=e[t],n[47]=e,n[48]=t,n}function sz(r){let e,t;const n=r[24]["extra-top"],l=Vr(n,r,r[37],Yv);return{c(){e=fe("div"),l&&l.c(),Ee(e,"slot","top")},m(u,d){be(u,e,d),l&&l.m(e,null),t=!0},p(u,d){l&&l.p&&(!t||d[1]&64)&&Gr(l,n,u,u[37],t?qr(n,u[37],d,iz):Wr(u[37]),Yv)},i(u){t||(oe(l,u),t=!0)},o(u){de(l,u),t=!1},d(u){u&&ve(e),l&&l.d(u)}}}function az(r){let e,t,n,l,u;return{c(){e=fe("ul"),e.innerHTML=`
  • Click + the map to add new points, until there are at least 3 points
  • Click and drag + any point to move it
  • Click + a waypoint to toggle snapping
  • Right click + a waypoint to delete it
  • `,t=Ve(),n=fe("p"),n.textContent="Keyboard shortcuts:",l=Ve(),u=fe("ul"),u.innerHTML=`
  • s + to switch between snapping to roads and drawing anywhere
  • Control+Z + to undo your last change
  • Enter + or + Escape + to finish
  • From the main mode, 3 + to draw a new area
  • `},m(d,a){be(d,e,a),be(d,t,a),be(d,n,a),be(d,l,a),be(d,u,a)},p:Ct,d(d){d&&(ve(e),ve(t),ve(n),ve(l),ve(u))}}}function lz(r){let e,t=r[8].length+"",n,l;return{c(){e=rt("Undo ("),n=rt(t),l=rt(")")},m(u,d){be(u,e,d),be(u,n,d),be(u,l,d)},p(u,d){d[0]&256&&t!==(t=u[8].length+"")&&Lr(n,t)},d(u){u&&(ve(e),ve(n),ve(l))}}}function cz(r){let e;return{c(){e=rt("Undo")},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function uz(r){let e;return{c(){e=fe("p"),e.textContent="Drag to adjust. Click to toggle snapped. Right click to delete."},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function hz(r){let e,t,n,l,u,d,a,_,x,S,k,C,P;return k=Eb(r[35][0]),{c(){e=fe("fieldset"),t=fe("label"),n=fe("input"),l=rt(` + Snap to roads`),u=Ve(),d=fe("label"),a=fe("input"),_=rt(` + Draw anywhere`),x=Ve(),S=fe("p"),S.textContent="Click to add at least 3 points",Ee(n,"type","radio"),n.__value="snap",ei(n,n.__value),Ee(a,"type","radio"),a.__value="free",ei(a,a.__value),k.p(n,a)},m(D,N){be(D,e,N),ie(e,t),ie(t,n),n.checked=n.__value===r[7],ie(t,l),ie(e,u),ie(e,d),ie(d,a),a.checked=a.__value===r[7],ie(d,_),be(D,x,N),be(D,S,N),C||(P=[Tt(n,"change",r[34]),Tt(a,"change",r[36])],C=!0)},p(D,N){N[0]&128&&(n.checked=n.__value===D[7]),N[0]&128&&(a.checked=a.__value===D[7])},d(D){D&&(ve(e),ve(x),ve(S)),k.r(),C=!1,_n(P)}}}function fz(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N,z,B;const O=r[24]["extra-sidebar"],G=Vr(O,r,r[37],Qv);S=new Og({props:{$$slots:{default:[az]},$$scope:{ctx:r}}});function U(ze,re){return ze[8].length==0?cz:lz}let K=U(r),me=K(r);function X(ze,re){return ze[5].length<3?hz:uz}let Y=X(r),_e=Y(r);return{c(){e=fe("div"),G&&G.c(),t=Ve(),n=fe("div"),l=fe("button"),u=rt("Finish"),a=Ve(),_=fe("button"),_.textContent="Cancel",x=Ve(),je(S.$$.fragment),k=Ve(),C=fe("button"),me.c(),D=Ve(),_e.c(),l.disabled=d=r[5].length<3,Ee(_,"class","secondary"),fn(n,"display","flex"),Ee(C,"class","secondary"),C.disabled=P=r[8].length==0,Ee(e,"slot","sidebar")},m(ze,re){be(ze,e,re),G&&G.m(e,null),ie(e,t),ie(e,n),ie(n,l),ie(l,u),ie(n,a),ie(n,_),ie(n,x),Oe(S,n,null),ie(e,k),ie(e,C),me.m(C,null),ie(e,D),_e.m(e,null),N=!0,z||(B=[Tt(l,"click",function(){wc(r[0])&&r[0].apply(this,arguments)}),Tt(_,"click",function(){wc(r[1])&&r[1].apply(this,arguments)}),Tt(C,"click",r[11])],z=!0)},p(ze,re){r=ze,G&&G.p&&(!N||re[1]&64)&&Gr(G,O,r,r[37],N?qr(O,r[37],re,oz):Wr(r[37]),Qv),(!N||re[0]&32&&d!==(d=r[5].length<3))&&(l.disabled=d);const ce={};re[1]&64&&(ce.$$scope={dirty:re,ctx:r}),S.$set(ce),K===(K=U(r))&&me?me.p(r,re):(me.d(1),me=K(r),me&&(me.c(),me.m(C,null))),(!N||re[0]&256&&P!==(P=r[8].length==0))&&(C.disabled=P),Y===(Y=X(r))&&_e?_e.p(r,re):(_e.d(1),_e=Y(r),_e&&(_e.c(),_e.m(e,null)))},i(ze){N||(oe(G,ze),oe(S.$$.fragment,ze),N=!0)},o(ze){de(G,ze),de(S.$$.fragment,ze),N=!1},d(ze){ze&&ve(e),G&&G.d(ze),Ne(S),me.d(),_e.d(),z=!1,_n(B)}}}function dz(r){let e;return{c(){e=fe("span"),Ee(e,"class","dot svelte-1cj4rwq"),hi(e,"snapped-node",r[46].snapped),hi(e,"free-node",!r[46].snapped),hi(e,"hide",r[4])},m(t,n){be(t,e,n)},p(t,n){n[0]&512&&hi(e,"snapped-node",t[46].snapped),n[0]&512&&hi(e,"free-node",!t[46].snapped),n[0]&16&&hi(e,"hide",t[4])},d(t){t&&ve(e)}}}function rb(r){let e,t,n;function l(_){r[25](_,r[46])}function u(){return r[26](r[46])}function d(){return r[27](r[46])}let a={draggable:!0,zIndex:0,$$slots:{default:[dz]},$$scope:{ctx:r}};return r[46].point!==void 0&&(a.lngLat=r[46].point),e=new fd({props:a}),pn.push(()=>zo(e,"lngLat",l)),e.$on("dragstart",u),e.$on("drag",d),e.$on("dragend",r[19]),{c(){je(e.$$.fragment)},m(_,x){Oe(e,_,x),n=!0},p(_,x){r=_;const S={};x[0]&528|x[1]&64&&(S.$$scope={dirty:x,ctx:r}),!t&&x[0]&512&&(t=!0,S.lngLat=r[46].point,Po(()=>t=!1)),e.$set(S)},i(_){n||(oe(e.$$.fragment,_),n=!0)},o(_){de(e.$$.fragment,_),n=!1},d(_){Ne(e,_)}}}function pz(r){let e;return{c(){e=fe("span"),e.textContent=`${r[45]+1}`,Ee(e,"class","dot svelte-1cj4rwq"),hi(e,"snapped",r[43].snapped)},m(t,n){be(t,e,n)},p(t,n){n[0]&32&&hi(e,"snapped",t[43].snapped)},d(t){t&&ve(e)}}}function nb(r){let e,t,n;function l(_){r[28](_,r[43])}function u(){return r[29](r[45])}function d(){return r[30](r[45])}let a={draggable:!0,zIndex:1,$$slots:{default:[pz]},$$scope:{ctx:r}};return r[43].point!==void 0&&(a.lngLat=r[43].point),e=new fd({props:a}),pn.push(()=>zo(e,"lngLat",l)),e.$on("click",u),e.$on("contextmenu",d),e.$on("mouseenter",r[31]),e.$on("mouseleave",r[32]),e.$on("dragstart",r[21]),e.$on("dragend",r[33]),{c(){je(e.$$.fragment)},m(_,x){Oe(e,_,x),n=!0},p(_,x){r=_;const S={};x[0]&32|x[1]&64&&(S.$$scope={dirty:x,ctx:r}),!t&&x[0]&32&&(t=!0,S.lngLat=r[43].point,Po(()=>t=!1)),e.$set(S)},i(_){n||(oe(e.$$.fragment,_),n=!0)},o(_){de(e.$$.fragment,_),n=!1},d(_){Ne(e,_)}}}function mz(r){let e,t,n,l;const u=[Hn("draw-area-lines"),{paint:{"line-color":"black","line-width":10}}];let d={};for(let x=0;xde(k[z],1,1,()=>{k[z]=null});let P=Jn(r[5]),D=[];for(let z=0;zde(D[z],1,1,()=>{D[z]=null});return d=new Pi({props:{data:r[16](r[6],r[5]),generateId:!0,$$slots:{default:[mz]},$$scope:{ctx:r}}}),_=new Pi({props:{data:r[10],$$slots:{default:[gz]},$$scope:{ctx:r}}}),{c(){e=fe("div"),je(t.$$.fragment),n=Ve();for(let z=0;zt(5,l=pt)),wt(r,Lc,pt=>t(6,u=pt));let{$$slots:d={},$$scope:a}=e,{map:_}=e,{finish:x}=e,{cancel:S}=e;ti(()=>{Rt(To,l=[],l),u==null||u.stop(),_.getCanvas().style.cursor="inherit"});let k="snap",C=[],P=[],D=null,N=!1,z=!1,B=!1;function O(pt){let Et=pt.length==0?"crosshair":"inherit";_.getCanvas().style.cursor=Et}function G(){let pt=C.pop();t(8,C),pt&&Rt(To,l=pt,l)}function U(){C.length==100&&C.shift(),t(8,C=[...C,JSON.parse(JSON.stringify(l))])}function K(){t(7,k=k=="snap"?"free":"snap"),D&&t(23,D.snapped=k=="snap",D)}function me(pt){l.length>=3||(U(),To.update(Et=>(Et.push({point:pt.detail.lngLat.toArray(),snapped:k=="snap"}),Et)))}function X(pt){t(23,D={point:pt.detail.lngLat.toArray(),snapped:k=="snap"})}function Y(pt){U(),To.update(Et=>(Et[pt].snapped=!Et[pt].snapped,Et))}function _e(pt){U(),To.update(Et=>(Et.splice(pt,1),Et)),t(2,N=!1)}function ze(pt,Et){try{if(pt)return Dx(Et)}catch{}return Xf()}function re(pt,Et,gr,Re){if(Re||Et.length>=3)return Xf();try{if(pt&&Et.length>0&&gr)return JSON.parse(pt.inner.calculateRoute([Et[Et.length-1],gr]))}catch{}return Xf()}function ce(pt,Et,gr){if(gr)return;if(!pt||Et.length<3){t(9,P=[]);return}let Re=[],st=1,tt=JSON.parse(JSON.stringify(Et));tt.push(tt[0]);for(let it=0;it(Et.splice(pt.insertIdx,0,{point:pt.point,snapped:pt.snapped}),Et)),t(4,B=!0)}function Me(pt){To.update(Et=>(Et[pt.insertIdx].point=pt.point,Et))}function ht(){t(4,B=!1)}function It(pt){let Et=pt.target.tagName,gr=Et=="INPUT"||Et=="TEXTAREA";pt.key=="Enter"&&!gr||pt.key=="Escape"?(pt.stopPropagation(),l.length>=3?x():window.alert("You can't save this area unless it has at least three points. Press 'Cancel' to discard these changes.")):pt.key=="s"&&!gr?K():pt.key=="z"&&pt.ctrlKey&&(pt.stopPropagation(),G())}function Ot(){U(),t(3,z=!0)}const Ke=[[]];function Kt(pt,Et){r.$$.not_equal(Et.point,pt)&&(Et.point=pt,t(9,P))}const vt=pt=>Ze(pt),Lt=pt=>Me(pt);function Vt(pt,Et){r.$$.not_equal(Et.point,pt)&&(Et.point=pt,To.set(l))}const sr=pt=>Y(pt),fr=pt=>_e(pt),er=()=>t(2,N=!0),Nt=()=>t(2,N=!1),nr=()=>t(3,z=!1);function tr(){k=this.__value,t(7,k)}function Pr(){k=this.__value,t(7,k)}return r.$$set=pt=>{"map"in pt&&t(22,_=pt.map),"finish"in pt&&t(0,x=pt.finish),"cancel"in pt&&t(1,S=pt.cancel),"$$scope"in pt&&t(37,a=pt.$$scope)},r.$$.update=()=>{r.$$.dirty[0]&112&&ce(u,l,B),r.$$.dirty[0]&8388716&&t(10,n=re(u,l,D,N||z)),r.$$.dirty[0]&32&&O(l)},[x,S,N,z,B,l,u,k,C,P,n,G,me,X,Y,_e,ze,Ze,Me,ht,It,Ot,_,D,d,Kt,vt,Lt,Vt,sr,fr,er,Nt,nr,tr,Ke,Pr,a]}class bz extends Ht{constructor(e){super(),Zt(this,e,vz,yz,jt,{map:22,finish:0,cancel:1},null,[-1,-1])}}function wz(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function xz(r){let e;return{c(){e=rt("Pick neighbourhood")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function Sz(r){let e;return{c(){e=fe("li"),e.textContent="Creating new neighbourhood boundary"},m(t,n){be(t,e,n)},p:Ct,i:Ct,o:Ct,d(t){t&&ve(e)}}}function kz(r){let e,t,n,l,u;return t=new Zr({props:{$$slots:{default:[Tz]},$$scope:{ctx:r}}}),t.$on("click",r[8]),{c(){e=fe("li"),je(t.$$.fragment),n=Ve(),l=fe("li"),l.textContent="Changing neighbourhood boundary"},m(d,a){be(d,e,a),Oe(t,e,null),be(d,n,a),be(d,l,a),u=!0},p(d,a){const _={};a&2048&&(_.$$scope={dirty:a,ctx:d}),t.$set(_)},i(d){u||(oe(t.$$.fragment,d),u=!0)},o(d){de(t.$$.fragment,d),u=!1},d(d){d&&(ve(e),ve(n),ve(l)),Ne(t)}}}function Tz(r){let e;return{c(){e=rt("Editing")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function Ez(r){let e,t,n,l,u,d,a,_,x,S,k,C;u=new Zr({props:{$$slots:{default:[wz]},$$scope:{ctx:r}}}),u.$on("click",r[6]),_=new Zr({props:{$$slots:{default:[xz]},$$scope:{ctx:r}}}),_.$on("click",r[7]);const P=[kz,Sz],D=[];function N(z,B){return z[1]?0:1}return S=N(r),k=D[S]=P[S](r),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),je(_.$$.fragment),x=Ve(),k.c(),Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","extra-top")},m(z,B){be(z,e,B),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),Oe(_,a,null),ie(n,x),D[S].m(n,null),C=!0},p(z,B){const O={};B&2048&&(O.$$scope={dirty:B,ctx:z}),u.$set(O);const G={};B&2048&&(G.$$scope={dirty:B,ctx:z}),_.$set(G);let U=S;S=N(z),S===U?D[S].p(z,B):(vr(),de(D[U],1,1,()=>{D[U]=null}),br(),k=D[S],k?k.p(z,B):(k=D[S]=P[S](z),k.c()),oe(k,1),k.m(n,null))},i(z){C||(oe(u.$$.fragment,z),oe(_.$$.fragment,z),oe(k),C=!0)},o(z){de(u.$$.fragment,z),de(_.$$.fragment,z),de(k),C=!1},d(z){z&&ve(e),Ne(u),Ne(_),D[S].d()}}}function Mz(r){let e,t,n,l;return{c(){e=fe("div"),t=fe("h1"),n=rt("Draw your neighbourhood boundary for "),l=rt(r[0]),Ee(e,"slot","extra-sidebar")},m(u,d){be(u,e,d),ie(e,t),ie(t,n),ie(t,l)},p(u,d){d&1&&Lr(l,u[0])},d(u){u&&ve(e)}}}function Cz(r){let e,t;return e=new bz({props:{map:dn(r[3]),finish:r[4],cancel:r[5],$$slots:{"extra-sidebar":[Mz],"extra-top":[Ez]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&8&&(u.map=dn(n[3])),l&2055&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function Iz(r,e,t){let n,l,u,d;wt(r,pr,D=>t(2,n=D)),wt(r,ri,D=>t(9,l=D)),wt(r,To,D=>t(10,u=D)),wt(r,ls,D=>t(3,d=D));let{name:a}=e,{existing:_}=e;_&&(_.properties.waypoints?Rt(To,u=_.properties.waypoints.map(D=>({point:[D.lon,D.lat],snapped:D.snapped})),u):Rt(To,u=_.geometry.coordinates[0].slice(1).map(D=>({point:D,snapped:!1})),u));function x(){if(u.length>=3)try{let D=Dx(u);l.setNeighbourhoodBoundary(a,D),Sc(),l.setCurrentNeighbourhood(a),Rt(pr,n={mode:"neighbourhood"},n)}catch{window.alert("Known georust bug hit, sorry. You may need to just refresh the page now."),S()}}function S(){_?Rt(pr,n={mode:"neighbourhood"},n):Rt(pr,n={mode:"network"},n)}const k=()=>Rt(pr,n={mode:"title"},n),C=()=>Rt(pr,n={mode:"network"},n),P=()=>Rt(pr,n={mode:"neighbourhood"},n);return r.$$set=D=>{"name"in D&&t(0,a=D.name),"existing"in D&&t(1,_=D.existing)},[a,_,n,d,x,S,k,C,P]}class Az extends Ht{constructor(e){super(),Zt(this,e,Iz,Cz,jt,{name:0,existing:1})}}function Lz(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function Pz(r){let e;return{c(){e=rt("Pick neighbourhood")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function zz(r){let e,t,n,l,u,d,a,_,x,S,k;return u=new Zr({props:{$$slots:{default:[Lz]},$$scope:{ctx:r}}}),u.$on("click",r[10]),_=new Zr({props:{$$slots:{default:[Pz]},$$scope:{ctx:r}}}),_.$on("click",r[11]),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),je(_.$$.fragment),x=Ve(),S=fe("li"),S.textContent="Use an auto-generated boundary",Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top")},m(C,P){be(C,e,P),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),Oe(_,a,null),ie(n,x),ie(n,S),k=!0},p(C,P){const D={};P&16384&&(D.$$scope={dirty:P,ctx:C}),u.$set(D);const N={};P&16384&&(N.$$scope={dirty:P,ctx:C}),_.$set(N)},i(C){k||(oe(u.$$.fragment,C),oe(_.$$.fragment,C),k=!0)},o(C){de(u.$$.fragment,C),de(_.$$.fragment,C),k=!1},d(C){C&&ve(e),Ne(u),Ne(_)}}}function Dz(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D,N,z,B;return t=new Od({}),t.$on("click",r[7]),{c(){e=fe("div"),je(t.$$.fragment),n=Ve(),l=fe("p"),l.textContent=`Click an area to use it as a neighbourhood. These are generated by finding + roads, railways, and water that form severances. There are many bugs; this + is experimental. The colors are arbitrary, just to distinguish better.`,u=Ve(),d=fe("button"),d.textContent="Export to GeoJSON",a=Ve(),_=fe("label"),x=rt(`Minimum area (km²) + `),S=fe("input"),k=Ve(),C=fe("label"),P=fe("input"),D=rt(` + Remove areas not touching a big road`),Ee(d,"class","secondary"),Ee(S,"type","number"),Ee(S,"min","0"),Ee(S,"max","1"),Ee(S,"step","0.01"),Ee(P,"type","checkbox"),Ee(e,"slot","sidebar")},m(O,G){be(O,e,G),Oe(t,e,null),ie(e,n),ie(e,l),ie(e,u),ie(e,d),ie(e,a),ie(e,_),ie(_,x),ie(_,S),ei(S,r[0]),ie(e,k),ie(e,C),ie(C,P),P.checked=r[1],ie(C,D),N=!0,z||(B=[Tt(d,"click",r[5]),Tt(S,"input",r[8]),Tt(P,"change",r[9])],z=!0)},p(O,G){G&1&&bg(S.value)!==O[0]&&ei(S,O[0]),G&2&&(P.checked=O[1])},i(O){N||(oe(t.$$.fragment,O),N=!0)},o(O){de(t.$$.fragment,O),N=!1},d(O){O&&ve(e),Ne(t),z=!1,_n(B)}}}function Rz(r){let e,t,n=r[13].area_km2.toFixed(1)+"",l,u,d,a,_,x=r[13].touches_big_road+"",S,k,C=r[13].touches_railway+"",P,D,N=r[13].touches_waterway+"",z;return{c(){e=fe("p"),t=rt("Area: "),l=rt(n),u=rt(" km²"),d=Ve(),a=fe("p"),_=rt("Borders roads = "),S=rt(x),k=rt(", railway = "),P=rt(C),D=rt(`, + water = `),z=rt(N)},m(B,O){be(B,e,O),ie(e,t),ie(e,l),ie(e,u),be(B,d,O),be(B,a,O),ie(a,_),ie(a,S),ie(a,k),ie(a,P),ie(a,D),ie(a,z)},p(B,O){O&8192&&n!==(n=B[13].area_km2.toFixed(1)+"")&&Lr(l,n),O&8192&&x!==(x=B[13].touches_big_road+"")&&Lr(S,x),O&8192&&C!==(C=B[13].touches_railway+"")&&Lr(P,C),O&8192&&N!==(N=B[13].touches_waterway+"")&&Lr(z,N)},d(B){B&&(ve(e),ve(d),ve(a))}}}function Bz(r){let e,t;return e=new Os({props:{openOn:"hover",$$slots:{default:[Rz,({props:n})=>({13:n}),({props:n})=>n?8192:0]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&24576&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function Fz(r){let e,t,n,l;const u=[Hn("auto-boundaries-areas"),{filter:r[6](r[0],r[1])},{manageHoverState:!0},{paint:{"fill-color":["match",["%",["id"],5],0,"blue",1,"yellow",2,"green",3,"purple",4,"orange","black"],"fill-opacity":kc(.3,.7)}},{hoverCursor:"pointer"}];let d={$$slots:{default:[Bz]},$$scope:{ctx:r}};for(let x=0;xt(2,n=z)),wt(r,ri,z=>t(12,l=z));let u=JSON.parse(l.renderAutoBoundaries()),d=0,a=!0;function _(z){let B=window.prompt("What do you want to name the neighbourhood?");if(B)try{let O={type:"Feature",properties:{},geometry:u.features[z.detail.features[0].id].geometry};l.setNeighbourhoodBoundary(B,O),Sc(),l.setCurrentNeighbourhood(B),Rt(pr,n={mode:"neighbourhood"},n)}catch(O){console.log(O),window.alert("Known georust bug hit, sorry. You may need to just refresh the page now.")}}function x(){ad("auto_boundaries.geojson",JSON.stringify(u,null," "))}function S(z,B){let O=["all",r5,[">=",["get","area_km2"],z]];return B&&O.push(["get","touches_big_road"]),O}const k=()=>Rt(pr,n={mode:"network"},n);function C(){d=bg(this.value),t(0,d)}function P(){a=this.checked,t(1,a)}return[d,a,n,u,_,x,S,k,C,P,()=>Rt(pr,n={mode:"title"},n),()=>Rt(pr,n={mode:"network"},n)]}class Uz extends Ht{constructor(e){super(),Zt(this,e,jz,Nz,jt,{})}}const Vz=["==",["geometry-type"],"Polygon"],qz=["==",["geometry-type"],"LineString"],Gz=["==",["geometry-type"],"Point"];function Rx(){return{type:"FeatureCollection",features:[]}}function Em(r){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:Bx(r)}}}function Bx(r){return[Math.round(r[0]*1e7)/1e7,Math.round(r[1]*1e7)/1e7]}const Fx=Er(Rx()),Ox=Er(0),Wz=100;class Zz{constructor(e){Wn(this,"map");Wn(this,"active");Wn(this,"eventListenersSuccess");Wn(this,"eventListenersUpdated");Wn(this,"eventListenersFailure");Wn(this,"points");Wn(this,"cursor");Wn(this,"hover");Wn(this,"dragFrom");Wn(this,"previousStates");Wn(this,"onMouseMove",e=>{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let t=this.dragFrom[0]-e.lngLat.lng,n=this.dragFrom[1]-e.lngLat.lat;for(let l of this.points)l[0]-=t,l[1]-=n}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});Wn(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let t=[];if(ib(this.points).forEach((n,l)=>{t.push([l+1,tk(n,this.cursor).properties.dist])}),t.sort((n,l)=>n[1]-l[1]),t.length>0){let n=t[0][0];this.points.splice(n,0,this.cursor.geometry.coordinates),this.hover=n}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});Wn(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=Em(e.lngLat.toArray()),this.onClick(e),this.finish())});Wn(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});Wn(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});Wn(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});Wn(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let t of this.eventListenersSuccess)t(e);else for(let t of this.eventListenersFailure)t();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e=Rx();this.points.forEach((l,u)=>{let d=Em(l);d.properties.hover=this.hover==u,d.properties.idx=u,e.features.push(d)}),e.features=e.features.concat(ib(this.points));let t=this.polygonFeature();t&&(t.properties.hover=this.hover=="polygon",e.features.push(t)),Fx.set(e);let n="crosshair";this.hover!=null&&(n=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=n,Ox.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let t of this.eventListenersUpdated)t(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let t of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(t.geometry.type=="Polygon"){this.hover="polygon";break}else if(t.geometry.type=="Point"&&Object.hasOwn(t.properties,"idx")){this.hover=t.properties.idx;break}this.hover==null&&(this.cursor=Em(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(Bx),t=[JSON.parse(JSON.stringify(e))];return t[0].push(JSON.parse(JSON.stringify(t[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>Wz&&this.previousStates.shift()}}function ib(r){let e=[];for(let t=0;t=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[r[r.length-1],r[0]]},properties:{}}),e}function Hz(r){let e,t,n;return{c(){e=rt("Undo ("),t=rt(r[1]),n=rt(")")},m(l,u){be(l,e,u),be(l,t,u),be(l,n,u)},p(l,u){u&2&&Lr(t,l[1])},d(l){l&&(ve(e),ve(t),ve(n))}}}function $z(r){let e;return{c(){e=rt("Undo")},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function Xz(r){let e,t,n,l,u,d,a,_,x,S,k;function C(N,z){return N[1]==0?$z:Hz}let P=C(r),D=P(r);return{c(){e=fe("div"),t=fe("button"),t.textContent="Finish",n=Ve(),l=fe("button"),l.textContent="Cancel",u=Ve(),d=fe("button"),D.c(),_=Ve(),x=fe("ul"),x.innerHTML=`
  • Click + the map to add a vertex
  • Click + a vertex to delete it
  • Drag + a vertex or the polygon to move it
  • Press Control+Z + to undo your last change
  • Press Enter + or + double click + to finish
  • Press Escape + to cancel
  • `,d.disabled=a=r[1]==0,fn(e,"display","flex"),fn(e,"justify-content","space-between")},m(N,z){be(N,e,z),ie(e,t),ie(e,n),ie(e,l),ie(e,u),ie(e,d),D.m(d,null),be(N,_,z),be(N,x,z),S||(k=[Tt(t,"click",r[2]),Tt(l,"click",r[3]),Tt(d,"click",r[4])],S=!0)},p(N,[z]){P===(P=C(N))&&D?D.p(N,z):(D.d(1),D=P(N),D&&(D.c(),D.m(d,null))),z&2&&a!==(a=N[1]==0)&&(d.disabled=a)},i:Ct,o:Ct,d(N){N&&(ve(e),ve(_),ve(x)),D.d(),S=!1,_n(k)}}}function Kz(r,e,t){let n;wt(r,Ox,_=>t(1,n=_));let{polygonTool:l}=e;const u=()=>l.finish(),d=()=>l.cancel(),a=()=>l.undo();return r.$$set=_=>{"polygonTool"in _&&t(0,l=_.polygonTool)},[l,n,u,d,a]}class Jz extends Ht{constructor(e){super(),Zt(this,e,Kz,Xz,jt,{polygonTool:0})}}let Yz=Date.now();function Mh(r){return`${r}-${Yz++}`}const Nx=Symbol.for("svelte-maplibre");function Qz(){return Cb(Nx)}function ob(r){return{subscribe:r.subscribe}}function jx({key:r,setPopupTarget:e=!1,setCluster:t=!1,setMouseEvent:n=!1}){let l=Qz(),u=Er(null),d=ob(u),a={...l,[r]:ob(u)};if(e&&(a.popupTarget=d),n){let _=Er(null);a.layerEvent=_,l.layerEvent=_}return t&&(a.cluster=Er()),wg(Nx,a),{...l,self:u}}function e8(){return jx({key:"source",setCluster:!0})}function t8(r=!0){return jx({key:"layer",setPopupTarget:r,setMouseEvent:r})}function sb(r){let e;return t=>{if(t)for(let n in t){let l=e==null?void 0:e[n],u=t[n];l!==u&&r(n,u,l)}else if(e)for(let n in e)r(n,void 0,e[n]);e=t}}function r8(r,...e){let t=[r];for(let n of e)if(n)Array.isArray(n)&&n[0]===r?t.push(...n.slice(1)):t.push(n);else continue;if(t.length!==1)return t.length===2?t[1]:t}function n8(r){return r===!0?["has","point_count"]:r===!1?["!",["has","point_count"]]:void 0}function ab(r){let e=r[0],t,n,l=lb(r);return{c(){l.c(),t=$n()},m(u,d){l.m(u,d),be(u,t,d),n=!0},p(u,d){d[0]&1&&jt(e,e=u[0])?(vr(),de(l,1,1,Ct),br(),l=lb(u),l.c(),oe(l,1),l.m(t.parentNode,t)):l.p(u,d)},i(u){n||(oe(l),n=!0)},o(u){de(l),n=!1},d(u){u&&ve(t),l.d(u)}}}function lb(r){let e;const t=r[36].default,n=Vr(t,r,r[35],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u[1]&16)&&Gr(n,t,l,l[35],e?qr(t,l[35],u,null):Wr(l[35]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function i8(r){let e,t,n=r[0]&&ab(r);return{c(){n&&n.c(),e=$n()},m(l,u){n&&n.m(l,u),be(l,e,u),t=!0},p(l,u){l[0]?n?(n.p(l,u),u[0]&1&&oe(n,1)):(n=ab(l),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function o8(r,e,t){let n,l,u,d,a,_,x,S,k,C,P,D,{$$slots:N={},$$scope:z}=e,{id:B=Mh("layer")}=e,{source:O=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:U=void 0}=e,{beforeLayerType:K=void 0}=e,{type:me}=e,{paint:X=void 0}=e,{layout:Y=void 0}=e,{filter:_e=void 0}=e,{applyToClusters:ze=void 0}=e,{minzoom:re=void 0}=e,{maxzoom:ce=void 0}=e,{manageHoverState:Ze=!1}=e,{hovered:Me=null}=e,{interactive:ht=!0}=e,{hoverCursor:It=void 0}=e,{eventsIfTopMost:Ot=!1}=e;const Ke=us(),{map:Kt,source:vt,self:Lt,minzoom:Vt,maxzoom:sr,eventTopMost:fr,layerInfo:er}=t8();wt(r,Kt,Re=>t(31,k=Re)),wt(r,vt,Re=>t(32,C=Re)),wt(r,Lt,Re=>t(0,S=Re)),wt(r,Vt,Re=>t(34,D=Re)),wt(r,sr,Re=>t(33,P=Re)),ti(()=>{S&&k&&(er.delete(S),k==null||k.removeLayer(S))});let Nt;function nr(Re){var ne,wr;if(!ht||!S||!k||Ot&&fr(Re)!==S)return;let st=Re.features??[],tt=(wr=(ne=st[0])==null?void 0:ne.properties)==null?void 0:wr.cluster_id,it={event:Re,map:k,clusterId:tt,layer:S,source:a,features:st};Ke(Re.type,it)}function tr(Re){var ne,wr;if(!ht||!S||!k||Ot&&fr(Re)!==S)return;It&&(k.getCanvas().style.cursor=It);let st=Re.features??[];t(6,Me=st[0]??null);let tt=(wr=(ne=st[0])==null?void 0:ne.properties)==null?void 0:wr.cluster_id;Ke("mouseenter",{event:Re,map:k,clusterId:tt,layer:S,source:a,features:st})}function Pr(Re){var ne,wr,We;if(!ht||!k)return;if(Ot&&fr(Re)!==S){t(6,Me=null),Ze&&Nt!==void 0&&(k==null||k.setFeatureState({source:a,sourceLayer:G,id:Nt},{hover:!1}),Nt=void 0);return}k.getCanvas().style.cursor=It;let st=Re.features??[],tt=(wr=(ne=st[0])==null?void 0:ne.properties)==null?void 0:wr.cluster_id,it=(We=st[0])==null?void 0:We.id;it!==Nt&&(Ze&&(Nt!==void 0&&(k==null||k.setFeatureState({source:a,id:Nt,sourceLayer:G},{hover:!1})),k==null||k.setFeatureState({source:a,id:it,sourceLayer:G},{hover:!0})),Nt=it,t(6,Me=st[0]??null)),Ke("mousemove",{event:Re,map:k,clusterId:tt,layer:S,source:a,features:st})}function pt(Re){if(!(!ht||!S||!k)){if(It&&(k.getCanvas().style.cursor=""),t(6,Me=null),Ze&&Nt!==void 0){const st={source:a,id:Nt,sourceLayer:G};k==null||k.setFeatureState(st,{hover:!1}),Nt=void 0}Ke("mouseleave",{map:k,layer:S,source:a})}}let Et=!0;function gr(Re){k&&(k.off("click",Re,nr),k.off("dblclick",Re,nr),k.off("contextmenu",Re,nr),k.off("mouseenter",Re,tr),k.off("mousemove",Re,Pr),k.off("mouseleave",Re,pt))}return ti(()=>{k&&S&&gr(S)}),r.$$set=Re=>{"id"in Re&&t(7,B=Re.id),"source"in Re&&t(8,O=Re.source),"sourceLayer"in Re&&t(9,G=Re.sourceLayer),"beforeId"in Re&&t(10,U=Re.beforeId),"beforeLayerType"in Re&&t(11,K=Re.beforeLayerType),"type"in Re&&t(12,me=Re.type),"paint"in Re&&t(13,X=Re.paint),"layout"in Re&&t(14,Y=Re.layout),"filter"in Re&&t(15,_e=Re.filter),"applyToClusters"in Re&&t(16,ze=Re.applyToClusters),"minzoom"in Re&&t(17,re=Re.minzoom),"maxzoom"in Re&&t(18,ce=Re.maxzoom),"manageHoverState"in Re&&t(19,Ze=Re.manageHoverState),"hovered"in Re&&t(6,Me=Re.hovered),"interactive"in Re&&t(20,ht=Re.interactive),"hoverCursor"in Re&&t(21,It=Re.hoverCursor),"eventsIfTopMost"in Re&&t(22,Ot=Re.eventsIfTopMost),"$$scope"in Re&&t(35,z=Re.$$scope)},r.$$.update=()=>{if(r.$$.dirty[0]&65536&&t(30,n=n8(ze)),r.$$.dirty[0]&1073774592&&t(24,l=r8("all",n,_e)),r.$$.dirty[0]&131072|r.$$.dirty[1]&8&&t(26,u=re??D),r.$$.dirty[0]&262144|r.$$.dirty[1]&4&&t(25,d=ce??P),r.$$.dirty[0]&256|r.$$.dirty[1]&2&&t(29,a=O||C),r.$$.dirty[0]&654343809|r.$$.dirty[1]&1&&k&&S!==B&&a){S&&(gr(S),er.delete(S));let Re=U;if(!U&&K){let st=k.getStyle().layers,tt=typeof K=="function"?K:ne=>ne.type===K,it=st==null?void 0:st.find(tt);it&&(Re=it.id)}Rt(Lt,S=B,S),k.addLayer(rl({id:S,type:me,source:a,"source-layer":G,filter:l,paint:X,layout:Y,minzoom:u,maxzoom:d}),Re),t(23,Et=!0),k.on("click",S,nr),k.on("dblclick",S,nr),k.on("contextmenu",S,nr),k.on("mouseenter",S,tr),k.on("mousemove",S,Pr),k.on("mouseleave",S,pt)}r.$$.dirty[0]&1048577&&S&&er.set(S,{interactive:ht}),r.$$.dirty[0]&1|r.$$.dirty[1]&1&&t(28,_=S?sb((Re,st)=>k==null?void 0:k.setPaintProperty(S,Re,st)):void 0),r.$$.dirty[0]&1|r.$$.dirty[1]&1&&t(27,x=S?sb((Re,st)=>k==null?void 0:k.setLayoutProperty(S,Re,st)):void 0),r.$$.dirty[0]&268443648&&(_==null||_(X)),r.$$.dirty[0]&134234112&&(x==null||x(Y)),r.$$.dirty[0]&100663297|r.$$.dirty[1]&1&&S&&(k==null||k.setLayerZoomRange(S,u,d)),r.$$.dirty[0]&25165825|r.$$.dirty[1]&1&&S&&(Et?t(23,Et=!1):k==null||k.setFilter(S,l))},[S,Kt,vt,Lt,Vt,sr,Me,B,O,G,U,K,me,X,Y,_e,ze,re,ce,Ze,ht,It,Ot,Et,l,d,u,x,_,a,n,k,C,P,D,z,N]}class o_ extends Ht{constructor(e){super(),Zt(this,e,o8,i8,jt,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function s8(r){let e;const t=r[16].default,n=Vr(t,r,r[24],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&16777216)&&Gr(n,t,l,l[24],e?qr(t,l[24],u,null):Wr(l[24]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function a8(r){let e,t,n;function l(d){r[17](d)}let u={id:r[1],type:"circle",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],applyToClusters:r[9],minzoom:r[10],maxzoom:r[11],hoverCursor:r[12],manageHoverState:r[13],eventsIfTopMost:r[14],interactive:r[15],$$slots:{default:[s8]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new o_({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[18]),e.$on("dblclick",r[19]),e.$on("contextmenu",r[20]),e.$on("mouseenter",r[21]),e.$on("mousemove",r[22]),e.$on("mouseleave",r[23]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.applyToClusters=d[9]),a&1024&&(_.minzoom=d[10]),a&2048&&(_.maxzoom=d[11]),a&4096&&(_.hoverCursor=d[12]),a&8192&&(_.manageHoverState=d[13]),a&16384&&(_.eventsIfTopMost=d[14]),a&32768&&(_.interactive=d[15]),a&16777216&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function l8(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Mh("circle")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{applyToClusters:P=void 0}=e,{minzoom:D=void 0}=e,{maxzoom:N=void 0}=e,{hoverCursor:z=void 0}=e,{manageHoverState:B=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:U=!0}=e;function K(ce){O=ce,t(0,O)}function me(ce){ur.call(this,r,ce)}function X(ce){ur.call(this,r,ce)}function Y(ce){ur.call(this,r,ce)}function _e(ce){ur.call(this,r,ce)}function ze(ce){ur.call(this,r,ce)}function re(ce){ur.call(this,r,ce)}return r.$$set=ce=>{"id"in ce&&t(1,u=ce.id),"source"in ce&&t(2,d=ce.source),"sourceLayer"in ce&&t(3,a=ce.sourceLayer),"beforeId"in ce&&t(4,_=ce.beforeId),"beforeLayerType"in ce&&t(5,x=ce.beforeLayerType),"paint"in ce&&t(6,S=ce.paint),"layout"in ce&&t(7,k=ce.layout),"filter"in ce&&t(8,C=ce.filter),"applyToClusters"in ce&&t(9,P=ce.applyToClusters),"minzoom"in ce&&t(10,D=ce.minzoom),"maxzoom"in ce&&t(11,N=ce.maxzoom),"hoverCursor"in ce&&t(12,z=ce.hoverCursor),"manageHoverState"in ce&&t(13,B=ce.manageHoverState),"hovered"in ce&&t(0,O=ce.hovered),"eventsIfTopMost"in ce&&t(14,G=ce.eventsIfTopMost),"interactive"in ce&&t(15,U=ce.interactive),"$$scope"in ce&&t(24,l=ce.$$scope)},[O,u,d,a,_,x,S,k,C,P,D,N,z,B,G,U,n,K,me,X,Y,_e,ze,re,l]}class c8 extends Ht{constructor(e){super(),Zt(this,e,l8,a8,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function u8(r){let e;const t=r[15].default,n=Vr(t,r,r[23],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&8388608)&&Gr(n,t,l,l[23],e?qr(t,l[23],u,null):Wr(l[23]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function h8(r){let e,t,n;function l(d){r[16](d)}let u={id:r[1],type:"fill",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],minzoom:r[9],maxzoom:r[10],hoverCursor:r[11],manageHoverState:r[12],eventsIfTopMost:r[13],interactive:r[14],$$slots:{default:[u8]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new o_({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[17]),e.$on("dblclick",r[18]),e.$on("contextmenu",r[19]),e.$on("mouseenter",r[20]),e.$on("mousemove",r[21]),e.$on("mouseleave",r[22]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.minzoom=d[9]),a&1024&&(_.maxzoom=d[10]),a&2048&&(_.hoverCursor=d[11]),a&4096&&(_.manageHoverState=d[12]),a&8192&&(_.eventsIfTopMost=d[13]),a&16384&&(_.interactive=d[14]),a&8388608&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function f8(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Mh("fill")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{minzoom:P=void 0}=e,{maxzoom:D=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:z=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(re){B=re,t(0,B)}function K(re){ur.call(this,r,re)}function me(re){ur.call(this,r,re)}function X(re){ur.call(this,r,re)}function Y(re){ur.call(this,r,re)}function _e(re){ur.call(this,r,re)}function ze(re){ur.call(this,r,re)}return r.$$set=re=>{"id"in re&&t(1,u=re.id),"source"in re&&t(2,d=re.source),"sourceLayer"in re&&t(3,a=re.sourceLayer),"beforeId"in re&&t(4,_=re.beforeId),"beforeLayerType"in re&&t(5,x=re.beforeLayerType),"paint"in re&&t(6,S=re.paint),"layout"in re&&t(7,k=re.layout),"filter"in re&&t(8,C=re.filter),"minzoom"in re&&t(9,P=re.minzoom),"maxzoom"in re&&t(10,D=re.maxzoom),"hoverCursor"in re&&t(11,N=re.hoverCursor),"manageHoverState"in re&&t(12,z=re.manageHoverState),"hovered"in re&&t(0,B=re.hovered),"eventsIfTopMost"in re&&t(13,O=re.eventsIfTopMost),"interactive"in re&&t(14,G=re.interactive),"$$scope"in re&&t(23,l=re.$$scope)},[B,u,d,a,_,x,S,k,C,P,D,N,z,O,G,n,U,K,me,X,Y,_e,ze,l]}class d8 extends Ht{constructor(e){super(),Zt(this,e,f8,h8,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function p8(r,e,t,n,l){let u=!1;r.getSource(e)&&(u=!0,r.removeSource(e));const d=()=>{n(e)&&(r.addSource(e,t),l())};if(u){const a=()=>{e&&(r.getSource(e)?setTimeout(a,1):d())};a()}else d()}function m8(r,e,t){Lb().then(()=>{let n=Hi(r);if(!n)return;n.getSource(e)===t&&n.removeSource(e)})}function cb(r){let e=r[0],t,n,l=ub(r);return{c(){l.c(),t=$n()},m(u,d){l.m(u,d),be(u,t,d),n=!0},p(u,d){d&1&&jt(e,e=u[0])?(vr(),de(l,1,1,Ct),br(),l=ub(u),l.c(),oe(l,1),l.m(t.parentNode,t)):l.p(u,d)},i(u){n||(oe(l),n=!0)},o(u){de(l),n=!1},d(u){u&&ve(t),l.d(u)}}}function ub(r){let e;const t=r[15].default,n=Vr(t,r,r[14],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&16384)&&Gr(n,t,l,l[14],e?qr(t,l[14],u,null):Wr(l[14]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function g8(r){let e,t,n=r[0]&&cb(r);return{c(){n&&n.c(),e=$n()},m(l,u){n&&n.m(l,u),be(l,e,u),t=!0},p(l,[u]){l[0]?n?(n.p(l,u),u&1&&oe(n,1)):(n=cb(l),n.c(),oe(n,1),n.m(e.parentNode,e)):n&&(vr(),de(n,1,1,()=>{n=null}),br())},i(l){t||(oe(n),t=!0)},o(l){de(n),t=!1},d(l){l&&ve(e),n&&n.d(l)}}}function _8(r,e,t){let n,l,u,{$$slots:d={},$$scope:a}=e,{id:_=Mh("geojson")}=e,{data:x}=e,{generateId:S=!1}=e,{promoteId:k=void 0}=e,{filter:C=void 0}=e,{lineMetrics:P=void 0}=e,{cluster:D=void 0}=e;const{map:N,cluster:z,self:B}=e8();wt(r,N,U=>t(13,l=U)),wt(r,z,U=>t(16,u=U)),wt(r,B,U=>t(0,n=U));let O,G=!0;return ti(()=>{n&&O&&l&&(m8(N,n,O),Rt(B,n=null,n),t(11,O=void 0))}),r.$$set=U=>{"id"in U&&t(4,_=U.id),"data"in U&&t(5,x=U.data),"generateId"in U&&t(6,S=U.generateId),"promoteId"in U&&t(7,k=U.promoteId),"filter"in U&&t(8,C=U.filter),"lineMetrics"in U&&t(9,P=U.lineMetrics),"cluster"in U&&t(10,D=U.cluster),"$$scope"in U&&t(14,a=U.$$scope)},r.$$.update=()=>{r.$$.dirty&1024&&Rt(z,u=D,u),r.$$.dirty&12273&&l&&n!==_&&(Rt(B,n=_,n),p8(l,n,rl({type:"geojson",data:x,filter:C,lineMetrics:P,generateId:S,promoteId:k,cluster:!!D,clusterMinPoints:D==null?void 0:D.minPoints,clusterMaxZoom:D==null?void 0:D.maxZoom,clusterRadius:D==null?void 0:D.radius,clusterProperties:D==null?void 0:D.properties}),U=>l&&U===n,()=>{n&&(t(11,O=l==null?void 0:l.getSource(n)),t(12,G=!0))})),r.$$.dirty&8208&&(l==null||l.on("style.load",()=>{t(11,O=l==null?void 0:l.getSource(_))})),r.$$.dirty&6176&&O&&(G?t(12,G=!1):O.setData(x)),r.$$.dirty&3072&&(O==null||O.setClusterOptions(rl({cluster:!!D,clusterMaxZoom:D==null?void 0:D.maxZoom,clusterRadius:D==null?void 0:D.radius})))},[n,N,z,B,_,x,S,k,C,P,D,O,G,l,a,d]}class y8 extends Ht{constructor(e){super(),Zt(this,e,_8,g8,jt,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function v8(r){let e;const t=r[15].default,n=Vr(t,r,r[23],null);return{c(){n&&n.c()},m(l,u){n&&n.m(l,u),e=!0},p(l,u){n&&n.p&&(!e||u&8388608)&&Gr(n,t,l,l[23],e?qr(t,l[23],u,null):Wr(l[23]),null)},i(l){e||(oe(n,l),e=!0)},o(l){de(n,l),e=!1},d(l){n&&n.d(l)}}}function b8(r){let e,t,n;function l(d){r[16](d)}let u={id:r[1],type:"line",source:r[2],sourceLayer:r[3],beforeId:r[4],beforeLayerType:r[5],paint:r[6],layout:r[7],filter:r[8],minzoom:r[9],maxzoom:r[10],hoverCursor:r[11],manageHoverState:r[12],eventsIfTopMost:r[13],interactive:r[14],$$slots:{default:[v8]},$$scope:{ctx:r}};return r[0]!==void 0&&(u.hovered=r[0]),e=new o_({props:u}),pn.push(()=>zo(e,"hovered",l)),e.$on("click",r[17]),e.$on("dblclick",r[18]),e.$on("contextmenu",r[19]),e.$on("mouseenter",r[20]),e.$on("mousemove",r[21]),e.$on("mouseleave",r[22]),{c(){je(e.$$.fragment)},m(d,a){Oe(e,d,a),n=!0},p(d,[a]){const _={};a&2&&(_.id=d[1]),a&4&&(_.source=d[2]),a&8&&(_.sourceLayer=d[3]),a&16&&(_.beforeId=d[4]),a&32&&(_.beforeLayerType=d[5]),a&64&&(_.paint=d[6]),a&128&&(_.layout=d[7]),a&256&&(_.filter=d[8]),a&512&&(_.minzoom=d[9]),a&1024&&(_.maxzoom=d[10]),a&2048&&(_.hoverCursor=d[11]),a&4096&&(_.manageHoverState=d[12]),a&8192&&(_.eventsIfTopMost=d[13]),a&16384&&(_.interactive=d[14]),a&8388608&&(_.$$scope={dirty:a,ctx:d}),!t&&a&1&&(t=!0,_.hovered=d[0],Po(()=>t=!1)),e.$set(_)},i(d){n||(oe(e.$$.fragment,d),n=!0)},o(d){de(e.$$.fragment,d),n=!1},d(d){Ne(e,d)}}}function w8(r,e,t){let{$$slots:n={},$$scope:l}=e,{id:u=Mh("line")}=e,{source:d=void 0}=e,{sourceLayer:a=void 0}=e,{beforeId:_=void 0}=e,{beforeLayerType:x=void 0}=e,{paint:S}=e,{layout:k=void 0}=e,{filter:C=void 0}=e,{minzoom:P=void 0}=e,{maxzoom:D=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:z=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(re){B=re,t(0,B)}function K(re){ur.call(this,r,re)}function me(re){ur.call(this,r,re)}function X(re){ur.call(this,r,re)}function Y(re){ur.call(this,r,re)}function _e(re){ur.call(this,r,re)}function ze(re){ur.call(this,r,re)}return r.$$set=re=>{"id"in re&&t(1,u=re.id),"source"in re&&t(2,d=re.source),"sourceLayer"in re&&t(3,a=re.sourceLayer),"beforeId"in re&&t(4,_=re.beforeId),"beforeLayerType"in re&&t(5,x=re.beforeLayerType),"paint"in re&&t(6,S=re.paint),"layout"in re&&t(7,k=re.layout),"filter"in re&&t(8,C=re.filter),"minzoom"in re&&t(9,P=re.minzoom),"maxzoom"in re&&t(10,D=re.maxzoom),"hoverCursor"in re&&t(11,N=re.hoverCursor),"manageHoverState"in re&&t(12,z=re.manageHoverState),"hovered"in re&&t(0,B=re.hovered),"eventsIfTopMost"in re&&t(13,O=re.eventsIfTopMost),"interactive"in re&&t(14,G=re.interactive),"$$scope"in re&&t(23,l=re.$$scope)},[B,u,d,a,_,x,S,k,C,P,D,N,z,O,G,n,U,K,me,X,Y,_e,ze,l]}class x8 extends Ht{constructor(e){super(),Zt(this,e,w8,b8,jt,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function S8(r){let e,t,n,l,u,d;return e=new d8({props:{id:"edit-polygon-fill",filter:Vz,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),n=new x8({props:{id:"edit-polygon-lines",filter:qz,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),u=new c8({props:{id:"edit-polygon-vertices",filter:Gz,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){je(e.$$.fragment),t=Ve(),je(n.$$.fragment),l=Ve(),je(u.$$.fragment)},m(a,_){Oe(e,a,_),be(a,t,_),Oe(n,a,_),be(a,l,_),Oe(u,a,_),d=!0},p:Ct,i(a){d||(oe(e.$$.fragment,a),oe(n.$$.fragment,a),oe(u.$$.fragment,a),d=!0)},o(a){de(e.$$.fragment,a),de(n.$$.fragment,a),de(u.$$.fragment,a),d=!1},d(a){a&&(ve(t),ve(l)),Ne(e,a),Ne(n,a),Ne(u,a)}}}function k8(r){let e,t;return e=new y8({props:{data:r[0],$$slots:{default:[S8]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&1&&(u.data=n[0]),l&2&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function T8(r,e,t){let n;return wt(r,Fx,l=>t(0,n=l)),[n]}class E8 extends Ht{constructor(e){super(),Zt(this,e,T8,k8,jt,{})}}function M8(r){let e,t,n,l,u,d,a;return{c(){e=fe("button"),e.textContent="Import current view",t=Ve(),n=fe("i"),n.textContent="or...",l=Ve(),u=fe("button"),u.textContent="Draw an area to import on the map",Ee(e,"type","button"),Ee(u,"type","button")},m(_,x){be(_,e,x),be(_,t,x),be(_,n,x),be(_,l,x),be(_,u,x),d||(a=[Tt(e,"click",r[2]),Tt(u,"click",r[3])],d=!0)},p:Ct,i:Ct,o:Ct,d(_){_&&(ve(e),ve(t),ve(n),ve(l),ve(u)),d=!1,_n(a)}}}function C8(r){let e,t;return e=new Jz({props:{polygonTool:r[0]}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&1&&(u.polygonTool=n[0]),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function I8(r){let e,t,n,l,u,d,a,_,x;const S=[C8,M8],k=[];function C(P,D){return P[0]?0:1}return e=C(r),t=k[e]=S[e](r),{c(){t.c(),n=Ve(),l=fe("label"),u=fe("input"),d=rt(`Save a copy of the osm.xml + after importing`),Ee(u,"type","checkbox")},m(P,D){k[e].m(P,D),be(P,n,D),be(P,l,D),ie(l,u),u.checked=r[1],ie(l,d),a=!0,_||(x=Tt(u,"change",r[5]),_=!0)},p(P,[D]){let N=e;e=C(P),e===N?k[e].p(P,D):(vr(),de(k[N],1,1,()=>{k[N]=null}),br(),t=k[e],t?t.p(P,D):(t=k[e]=S[e](P),t.c()),oe(t,1),t.m(n.parentNode,n)),D&2&&(u.checked=P[1])},i(P){a||(oe(t),a=!0)},o(P){de(t),a=!1},d(P){P&&(ve(n),ve(l)),k[e].d(P),_=!1,x()}}}function Zu(r){return[r.lng,r.lat]}function A8(r,e,t){let{map:n}=e;const l=us();let u=null,d=!1;async function a(C){try{l("loading","Loading from Overpass");let D=await(await fetch(Ux(C))).text();d&&ad("osm.xml",D),l("gotXml",{xml:D,boundary:C})}catch(P){l("error",P.toString())}}function _(){let C=n.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[Zu(C.getSouthWest()),Zu(C.getNorthWest()),Zu(C.getNorthEast()),Zu(C.getSouthEast()),Zu(C.getSouthWest())]],type:"Polygon"}}}async function x(){if(n){if(n.getZoom()<13){l("error","Zoom in more to import");return}await a(_())}}function S(){n&&(t(0,u=new Zz(n)),u.startNew(),u.addEventListenerSuccess(async C=>{t(0,u=null),await a(C)}),u.addEventListenerFailure(()=>{t(0,u=null)}))}function k(){d=this.checked,t(1,d)}return r.$$set=C=>{"map"in C&&t(4,n=C.map)},[u,d,x,S,n,k]}class L8 extends Ht{constructor(e){super(),Zt(this,e,A8,I8,jt,{map:4})}}function Ux(r){let e='poly:"';for(let[n,l]of r.geometry.coordinates[0])e+=`${l} ${n} `;return e=e.slice(0,-1)+'"',`https://overpass-api.de/api/interpreter?data=${`(nwr(${e}); node(w)->.x; <;); out meta;`}`}async function yg(r){ha.set(r);try{let e=JSON.parse(window.localStorage.getItem(r));console.time("get OSM input");let[t,n]=await P8(e);console.timeEnd("get OSM input"),console.time("load"),ri.set(new Bb(new Uint8Array(t),n,e.study_area_name||void 0)),Hi(ri).loadSavefile(e),console.timeEnd("load"),Vx()}catch(e){window.alert(`Couldn't open project: ${e}`),ha.set("")}}async function P8(r){if(r.study_area_name){let e=Hi(dh)?`/osm/${r.study_area_name}.pbf`:`https://assets.od2net.org/severance_pbfs/${r.study_area_name}.pbf`;console.log(`Grabbing ${e}`);let n=await(await fetch(e)).arrayBuffer(),l=Hi(dh)?`/boundaries/${r.study_area_name}.geojson`:`https://assets.od2net.org/boundaries/${r.study_area_name}.geojson`,d=await(await fetch(l)).json();return[n,d]}else{console.log("Grabbing from Overpass");let e=r.features.find(l=>l.properties.kind=="study_area_boundary");return[await(await fetch(Ux(e))).arrayBuffer(),e]}}function Vx(){pr.set({mode:"network"}),Lc.set(new nk(Hi(ls),Hi(ri).toRouteSnapper(),Er(Xf()),Er(!0),Er(0))),Hi(ls).fitBounds(Array.from(Hi(ri).getBounds()),{animate:!1}),Bm.set(hb()),Fm.set(hb())}function hb(){let r=Hi(ri).getBounds(),e=r[0]+Math.random()*(r[2]-r[0]),t=r[1]+Math.random()*(r[3]-r[1]);return new Pc.LngLat(e,t)}function fb(r,e,t){const n=r.slice();return n[18]=e[t][0],n[19]=e[t][1],n}function db(r,e,t){const n=r.slice();return n[22]=e[t],n}function z8(r){let e;return{c(){e=fe("div"),e.innerHTML='',Ee(e,"slot","top")},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function D8(r){let e;return{c(){e=fe("p"),e.textContent="Waiting for MapLibre and WASM to load..."},m(t,n){be(t,e,n)},p:Ct,i:Ct,o:Ct,d(t){t&&ve(e)}}}function R8(r){let e,t,n,l,u,d,a,_,x,S,k,C,P;t=new Zr({props:{$$slots:{default:[B8]},$$scope:{ctx:r}}}),t.$on("click",r[10]);let D=Jn(r[2].entries()),N=[];for(let B=0;Bde(N[B],1,1,()=>{N[B]=null});return{c(){e=fe("div"),je(t.$$.fragment),n=Ve(),l=fe("p"),l.textContent="Load a saved project:",u=Ve(),d=fe("ul");for(let B=0;B`,d=Ve(),a=fe("button"),a.innerHTML=`Delete project`,_=Ve(),Ee(u,"class","secondary"),Ee(a,"class","secondary"),fn(t,"display","flex"),fn(t,"justify-content","space-between")},m(N,z){be(N,e,z),ie(e,t),Oe(n,t,null),ie(t,l),ie(t,u),ie(t,d),ie(t,a),ie(e,_),x=!0,S||(k=[Tt(u,"click",P),Tt(a,"click",D)],S=!0)},p(N,z){r=N;const B={};z&33554436&&(B.$$scope={dirty:z,ctx:r}),n.$set(B)},i(N){x||(oe(n.$$.fragment,N),x=!0)},o(N){de(n.$$.fragment,N),x=!1},d(N){N&&ve(e),Ne(n),S=!1,_n(k)}}}function mb(r){let e,t=(r[18]??"custom area")+"",n,l,u,d,a=Jn(r[19]),_=[];for(let S=0;Sde(_[S],1,1,()=>{_[S]=null});return{c(){e=fe("u"),n=rt(t),l=Ve();for(let S=0;S<_.length;S+=1)_[S].c();u=$n()},m(S,k){be(S,e,k),ie(e,n),be(S,l,k);for(let C=0;C<_.length;C+=1)_[C]&&_[C].m(S,k);be(S,u,k),d=!0},p(S,k){if((!d||k&4)&&t!==(t=(S[18]??"custom area")+"")&&Lr(n,t),k&900){a=Jn(S[19]);let C;for(C=0;C{d[S]=null}),br(),n=d[t],n?n.p(_,x):(n=d[t]=u[t](_),n.c()),oe(n,1),n.m(e,null))},i(_){l||(oe(n),l=!0)},o(_){de(n),l=!1},d(_){_&&ve(e),d[t].d()}}}function N8(r){let e,t,n,l;return e=new zb({props:{loading:r[1]}}),n=new Fs({props:{$$slots:{sidebar:[O8],top:[z8]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment),t=Ve(),je(n.$$.fragment)},m(u,d){Oe(e,u,d),be(u,t,d),Oe(n,u,d),l=!0},p(u,[d]){const a={};d&2&&(a.loading=u[1]),e.$set(a);const _={};d&33554493&&(_.$$scope={dirty:d,ctx:u}),n.$set(_)},i(u){l||(oe(e.$$.fragment,u),oe(n.$$.fragment,u),l=!0)},o(u){de(e.$$.fragment,u),de(n.$$.fragment,u),l=!1},d(u){u&&ve(t),Ne(e,u),Ne(n,u)}}}function Uf(){let r=new Map;for(let e=0;et(15,n=K)),wt(r,Lc,K=>t(16,l=K)),wt(r,ri,K=>t(17,u=K)),wt(r,ls,K=>t(4,d=K)),wt(r,pr,K=>t(5,a=K));let{wasmReady:_}=e,x="";Rt(ri,u=null,u),Rt(Lc,l=null,l),Rt(ha,n="",n);let S=Uf(),k;async function C(K){let me="ltn_"+k.files[0].name;t(1,x=`Loading from file ${me}`),window.localStorage.setItem(me,await k.files[0].text()),t(2,S=Uf()),await yg(me),t(1,x="")}function P(K){window.confirm(`Really delete project ${K}? You can't undo this.`)&&(window.localStorage.removeItem(K),t(2,S=Uf()))}function D(K){let me=window.prompt(`Rename project ${K} to what?`,K);if(me){me.startsWith("ltn_")||(me=`ltn_${me}`);let X=window.localStorage.getItem(K);window.localStorage.setItem(me,X),window.localStorage.removeItem(K),t(2,S=Uf())}}async function N(K){t(1,x=`Loading project ${K}`),await yg(K),t(1,x="")}const z=()=>Rt(pr,a={mode:"new-project"},a),B=K=>N(K),O=K=>D(K),G=K=>P(K);function U(K){pn[K?"unshift":"push"](()=>{k=K,t(3,k)})}return r.$$set=K=>{"wasmReady"in K&&t(0,_=K.wasmReady)},[_,x,S,k,d,a,C,P,D,N,z,B,O,G,U]}class U8 extends Ht{constructor(e){super(),Zt(this,e,j8,N8,jt,{wasmReady:0})}}function gb(r,e,t){const n=r.slice();return n[17]=e[t][0],n[18]=e[t][1],n}function _b(r,e,t){const n=r.slice();return n[21]=e[t][0],n[22]=e[t][1],n}function V8(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function q8(r){let e,t,n,l,u,d,a,_;return u=new Zr({props:{$$slots:{default:[V8]},$$scope:{ctx:r}}}),u.$on("click",r[13]),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),a.textContent="New project",Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top")},m(x,S){be(x,e,S),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),_=!0},p(x,S){const k={};S&33554432&&(k.$$scope={dirty:S,ctx:x}),u.$set(k)},i(x){_||(oe(u.$$.fragment,x),_=!0)},o(x){de(u.$$.fragment,x),_=!1},d(x){x&&ve(e),Ne(u)}}}function yb(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D;e=new zb({props:{loading:r[4]}});let N=Jn(r[3]),z=[];for(let B=0;Br[9].call(u))},m(B,O){Oe(e,B,O),be(B,t,O),be(B,n,O),ie(n,l),ie(n,u),ie(u,d);for(let G=0;G{S=null}),br())},i(k){a||(oe(S),a=!0)},o(k){de(S),a=!1},d(k){k&&ve(e),S&&S.d(),_=!1,x()}}}function W8(r){let e,t,n;return t=new E8({}),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"slot","map")},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p:Ct,i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function Z8(r){let e,t;return e=new Fs({props:{$$slots:{map:[W8],sidebar:[G8],top:[q8]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,[l]){const u={};l&33554558&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function H8(r,e,t){let n,l,u,d,a;wt(r,ha,U=>t(14,n=U)),wt(r,ri,U=>t(15,l=U)),wt(r,dh,U=>t(16,u=U)),wt(r,ls,U=>t(5,d=U)),wt(r,pr,U=>t(6,a=U));let _="",x="",S=[],k="";Ld(async()=>{let U=await fetch(u?"/osm/areas.json":"https://assets.od2net.org/severance_pbfs/areas.json");t(3,S=await U.json())});function C(U){t(4,k="Loading OSM");try{Rt(ri,l=new Bb(new TextEncoder().encode(U.detail.xml),U.detail.boundary,void 0),l),Rt(ha,n=`ltn_${_}`,n),Vx(),Sc()}catch(K){window.alert(`Couldn't import from Overpass: ${K}`)}t(4,k="")}async function P(){if(x=="")return;let U=`ltn_${_}`;window.localStorage.setItem(U,JSON.stringify({type:"FeatureCollection",features:[],study_area_name:x})),t(4,k=`Loading pre-clipped OSM area ${x}`),await yg(U),t(4,k="")}function D(){_=this.value,t(1,_)}function N(){x=Mb(this),t(2,x),t(3,S)}return[P,_,x,S,k,d,a,C,D,N,()=>P(),U=>t(4,k=U.detail),U=>window.alert(U.detail),()=>Rt(pr,a={mode:"title"},a)]}class $8 extends Ht{constructor(e){super(),Zt(this,e,H8,Z8,jt,{loadExample:0})}get loadExample(){return this.$$.ctx[0]}}const{window:X8}=Ad;function K8(r){let e;return{c(){e=rt("Choose project")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function J8(r){let e;return{c(){e=rt("Pick neighbourhood")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function Y8(r){let e;return{c(){e=rt("Editing")},m(t,n){be(t,e,n)},d(t){t&&ve(e)}}}function Q8(r){let e,t,n,l,u,d,a,_,x,S,k,C,P,D;return u=new Zr({props:{$$slots:{default:[K8]},$$scope:{ctx:r}}}),u.$on("click",r[9]),_=new Zr({props:{$$slots:{default:[J8]},$$scope:{ctx:r}}}),_.$on("click",r[10]),k=new Zr({props:{$$slots:{default:[Y8]},$$scope:{ctx:r}}}),k.$on("click",r[5]),{c(){e=fe("div"),t=fe("nav"),n=fe("ul"),l=fe("li"),je(u.$$.fragment),d=Ve(),a=fe("li"),je(_.$$.fragment),x=Ve(),S=fe("li"),je(k.$$.fragment),C=Ve(),P=fe("li"),P.textContent="Viewing shortcuts",Ee(t,"aria-label","breadcrumb"),Ee(e,"slot","top")},m(N,z){be(N,e,z),ie(e,t),ie(t,n),ie(n,l),Oe(u,l,null),ie(n,d),ie(n,a),Oe(_,a,null),ie(n,x),ie(n,S),Oe(k,S,null),ie(n,C),ie(n,P),D=!0},p(N,z){const B={};z&8192&&(B.$$scope={dirty:z,ctx:N}),u.$set(B);const O={};z&8192&&(O.$$scope={dirty:z,ctx:N}),_.$set(O);const G={};z&8192&&(G.$$scope={dirty:z,ctx:N}),k.$set(G)},i(N){D||(oe(u.$$.fragment,N),oe(_.$$.fragment,N),oe(k.$$.fragment,N),D=!0)},o(N){de(u.$$.fragment,N),de(_.$$.fragment,N),de(k.$$.fragment,N),D=!1},d(N){N&&ve(e),Ne(u),Ne(_),Ne(k)}}}function eD(r){let e,t,n,l,u,d,a,_,x,S=r[0].shortcutIndex+1+"",k,C,P=r[0].gj.features.length+"",D,N,z,B,O,G,U,K,me,X=dn(r[0].gj.features[r[0].shortcutIndex].properties).directness.toFixed(1)+"",Y,_e,ze,re,ce;return{c(){e=fe("p"),e.textContent=`This shows all possible shortcuts crossing the blue road you've chosen. + A shortcut is defined as a route starting and ending outside the + neighbourhood, but cutting through it. It might not actually be + considered a "good shortcut" in practice -- this tool doesn't know any + real traffic patterns; it's just looking for any possible path. This + view lets you understand the limits of this assumption.`,t=Ve(),n=fe("button"),n.textContent="Pick a different road",l=Ve(),u=fe("div"),d=fe("button"),a=rt("Previous"),x=Ve(),k=rt(S),C=rt(" / "),D=rt(P),N=Ve(),z=fe("button"),B=rt("Next"),G=Ve(),U=fe("p"),K=rt("This shortcut is "),me=fe("b"),Y=rt(X),_e=rt("x"),ze=rt(` + the length of the shortest route using all roads, not just this neighbourhood`),d.disabled=_=r[0].shortcutIndex==0,Ee(d,"data-tooltip","Left"),z.disabled=O=r[0].shortcutIndex==r[0].gj.features.length-1,Ee(z,"data-tooltip","Right"),fn(u,"display","flex"),fn(u,"justify-content","space-between")},m(Ze,Me){be(Ze,e,Me),be(Ze,t,Me),be(Ze,n,Me),be(Ze,l,Me),be(Ze,u,Me),ie(u,d),ie(d,a),ie(u,x),ie(u,k),ie(u,C),ie(u,D),ie(u,N),ie(u,z),ie(z,B),be(Ze,G,Me),be(Ze,U,Me),ie(U,K),ie(U,me),ie(me,Y),ie(me,_e),ie(U,ze),re||(ce=[Tt(n,"click",r[8]),Tt(d,"click",r[6]),Tt(z,"click",r[7])],re=!0)},p(Ze,Me){Me&1&&_!==(_=Ze[0].shortcutIndex==0)&&(d.disabled=_),Me&1&&S!==(S=Ze[0].shortcutIndex+1+"")&&Lr(k,S),Me&1&&P!==(P=Ze[0].gj.features.length+"")&&Lr(D,P),Me&1&&O!==(O=Ze[0].shortcutIndex==Ze[0].gj.features.length-1)&&(z.disabled=O),Me&1&&X!==(X=dn(Ze[0].gj.features[Ze[0].shortcutIndex].properties).directness.toFixed(1)+"")&&Lr(Y,X)},d(Ze){Ze&&(ve(e),ve(t),ve(n),ve(l),ve(u),ve(G),ve(U)),re=!1,_n(ce)}}}function tD(r){let e;return{c(){e=fe("p"),e.textContent="Click a road to see shortcuts"},m(t,n){be(t,e,n)},p:Ct,d(t){t&&ve(e)}}}function rD(r){let e,t,n,l;t=new Od({}),t.$on("click",r[5]);function u(_,x){if(_[0].state=="neutral")return tD;if(_[0].state=="chose-road")return eD}let d=u(r),a=d&&d(r);return{c(){e=fe("div"),je(t.$$.fragment),n=Ve(),a&&a.c(),Ee(e,"slot","sidebar")},m(_,x){be(_,e,x),Oe(t,e,null),ie(e,n),a&&a.m(e,null),l=!0},p(_,x){d===(d=u(_))&&a?a.p(_,x):(a&&a.d(1),a=d&&d(_),a&&(a.c(),a.m(e,null)))},i(_){l||(oe(t.$$.fragment,_),l=!0)},o(_){de(t.$$.fragment,_),l=!1},d(_){_&&ve(e),Ne(t),a&&a.d()}}}function nD(r){let e,t,n,l,u,d;return e=new Pi({props:{data:Km(JSON.parse(dn(r[2]).renderNeighbourhood())),$$slots:{default:[oD]},$$scope:{ctx:r}}}),n=new Pi({props:{data:r[0].gj.features[r[0].shortcutIndex],$$slots:{default:[sD]},$$scope:{ctx:r}}}),u=new Pi({props:{data:r[0].roadGj,$$slots:{default:[aD]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment),t=Ve(),je(n.$$.fragment),l=Ve(),je(u.$$.fragment)},m(a,_){Oe(e,a,_),be(a,t,_),Oe(n,a,_),be(a,l,_),Oe(u,a,_),d=!0},p(a,_){const x={};_&4&&(x.data=Km(JSON.parse(dn(a[2]).renderNeighbourhood()))),_&8192&&(x.$$scope={dirty:_,ctx:a}),e.$set(x);const S={};_&1&&(S.data=a[0].gj.features[a[0].shortcutIndex]),_&8192&&(S.$$scope={dirty:_,ctx:a}),n.$set(S);const k={};_&1&&(k.data=a[0].roadGj),_&8192&&(k.$$scope={dirty:_,ctx:a}),u.$set(k)},i(a){d||(oe(e.$$.fragment,a),oe(n.$$.fragment,a),oe(u.$$.fragment,a),d=!0)},o(a){de(e.$$.fragment,a),de(n.$$.fragment,a),de(u.$$.fragment,a),d=!1},d(a){a&&(ve(t),ve(l)),Ne(e,a),Ne(n,a),Ne(u,a)}}}function iD(r){let e,t;return e=new Nd({props:{gjInput:JSON.parse(dn(r[2]).renderNeighbourhood()),onClickLine:r[3],$$slots:{"line-popup":[cD]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&4&&(u.gjInput=JSON.parse(dn(n[2]).renderNeighbourhood())),l&8192&&(u.$$scope={dirty:l,ctx:n}),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function oD(r){let e,t;const n=[Hn("cells"),{filter:["==",["get","kind"],"cell"]},{paint:{"fill-color":["get","color"],"fill-opacity":.3}}];let l={};for(let u=0;u({12:l}),({props:l})=>l?4096:0]},$$scope:{ctx:r}}}),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"slot","line-popup")},m(l,u){be(l,e,u),Oe(t,e,null),n=!0},p(l,u){const d={};u&12288&&(d.$$scope={dirty:u,ctx:l}),t.$set(d)},i(l){n||(oe(t.$$.fragment,l),n=!0)},o(l){de(t.$$.fragment,l),n=!1},d(l){l&&ve(e),Ne(t)}}}function uD(r){let e,t,n,l,u,d;const a=[iD,nD],_=[];function x(S,k){return S[0].state=="neutral"?0:S[0].state=="chose-road"?1:-1}return~(t=x(r))&&(n=_[t]=a[t](r)),u=new jd({}),{c(){e=fe("div"),n&&n.c(),l=Ve(),je(u.$$.fragment),Ee(e,"slot","map")},m(S,k){be(S,e,k),~t&&_[t].m(e,null),ie(e,l),Oe(u,e,null),d=!0},p(S,k){let C=t;t=x(S),t===C?~t&&_[t].p(S,k):(n&&(vr(),de(_[C],1,1,()=>{_[C]=null}),br()),~t?(n=_[t],n?n.p(S,k):(n=_[t]=a[t](S),n.c()),oe(n,1),n.m(e,l)):n=null)},i(S){d||(oe(n),oe(u.$$.fragment,S),d=!0)},o(S){de(n),de(u.$$.fragment,S),d=!1},d(S){S&&ve(e),~t&&_[t].d(),Ne(u)}}}function hD(r){let e,t,n,l;return e=new Fs({props:{$$slots:{map:[uD],sidebar:[rD],top:[Q8]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment)},m(u,d){Oe(e,u,d),t=!0,n||(l=Tt(X8,"keydown",r[4]),n=!0)},p(u,[d]){const a={};d&8199&&(a.$$scope={dirty:d,ctx:u}),e.$set(a)},i(u){t||(oe(e.$$.fragment,u),t=!0)},o(u){de(e.$$.fragment,u),t=!1},d(u){Ne(e,u),n=!1,l()}}}function fD(r,e,t){let n,l,u;wt(r,pr,N=>t(1,n=N)),wt(r,ls,N=>t(11,l=N)),wt(r,ri,N=>t(2,u=N));let d={state:"neutral"};function a(N,z){let B=JSON.parse(u.getShortcutsCrossingRoad(N.properties.id));if(B.features.length==0){window.alert("No shortcuts here");return}t(0,d={state:"chose-road",roadGj:N,gj:B,shortcutIndex:0})}Ld(()=>{l==null||l.keyboard.disable()}),ti(()=>{l==null||l.keyboard.enable()});function _(N){d.state=="chose-road"&&(N.key=="ArrowLeft"&&d.shortcutIndex>0&&(N.stopPropagation(),t(0,d.shortcutIndex--,d)),N.key=="ArrowRight"&&(N.stopPropagation(),d.shortcutIndex!=d.gj.features.length-1&&t(0,d.shortcutIndex++,d)))}function x(){Rt(pr,n={mode:"neighbourhood"},n)}function S(){d.state=="chose-road"&&t(0,d.shortcutIndex--,d)}function k(){d.state=="chose-road"&&t(0,d.shortcutIndex++,d)}return[d,n,u,a,_,x,S,k,()=>t(0,d={state:"neutral"}),()=>Rt(pr,n={mode:"title"},n),()=>Rt(pr,n={mode:"network"},n)]}class dD extends Ht{constructor(e){super(),Zt(this,e,fD,hD,jt,{})}}function pD(r){let e,t,n,l,u,d,a,_,x;return l=new rz({}),{c(){e=fe("div"),t=fe("button"),t.innerHTML=`A/B Street logo`,n=Ve(),je(l.$$.fragment),u=Ve(),d=fe("span"),Ee(t,"class","outline"),fn(d,"width","100%"),Ee(e,"slot","top"),fn(e,"display","flex")},m(S,k){be(S,e,k),ie(e,t),ie(e,n),Oe(l,e,null),ie(e,u),ie(e,d),r[19](d),a=!0,_||(x=Tt(t,"click",r[18]),_=!0)},p:Ct,i(S){a||(oe(l.$$.fragment,S),a=!0)},o(S){de(l.$$.fragment,S),a=!1},d(S){S&&ve(e),Ne(l),r[19](null),_=!1,x()}}}function wb(r){let e,t,n,l,u,d;return n=new j5({props:{map:dn(r[6]),maptilerBasemap:r[7]}}),{c(){e=fe("button"),e.textContent="Zoom to fit study area",t=Ve(),je(n.$$.fragment),Ee(e,"class","secondary")},m(a,_){be(a,e,_),be(a,t,_),Oe(n,a,_),l=!0,u||(d=Tt(e,"click",r[10]),u=!0)},p(a,_){const x={};_&64&&(x.map=dn(a[6])),_&128&&(x.maptilerBasemap=a[7]),n.$set(x)},i(a){l||(oe(n.$$.fragment,a),l=!0)},o(a){de(n.$$.fragment,a),l=!1},d(a){a&&(ve(e),ve(t)),Ne(n,a),u=!1,d()}}}function mD(r){let e,t,n,l,u,d,a=r[5]&&wb(r);return{c(){e=fe("div"),t=fe("div"),n=Ve(),l=fe("hr"),u=Ve(),a&&a.c(),Ee(e,"slot","left")},m(_,x){be(_,e,x),ie(e,t),r[17](t),ie(e,n),ie(e,l),ie(e,u),a&&a.m(e,null),d=!0},p(_,x){_[5]?a?(a.p(_,x),x&32&&oe(a,1)):(a=wb(_),a.c(),oe(a,1),a.m(e,null)):a&&(vr(),de(a,1,1,()=>{a=null}),br())},i(_){d||(oe(a),d=!0)},o(_){de(a),d=!1},d(_){_&&ve(e),r[17](null),a&&a.d()}}}function gD(r){let e,t;return e=new $8({}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p:Ct,i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function _D(r){let e,t;return e=new U8({props:{wasmReady:r[4]}}),{c(){je(e.$$.fragment)},m(n,l){Oe(e,n,l),t=!0},p(n,l){const u={};l&16&&(u.wasmReady=n[4]),e.$set(u)},i(n){t||(oe(e.$$.fragment,n),t=!0)},o(n){de(e.$$.fragment,n),t=!1},d(n){Ne(e,n)}}}function xb(r){let e,t,n,l,u,d;e=new Pi({props:{data:JSON.parse(r[5].getInvertedBoundary()),$$slots:{default:[yD]},$$scope:{ctx:r}}});const a=[TD,kD,SD,xD,wD,bD,vD],_=[];function x(S,k){return S[8].mode=="network"?0:S[8].mode=="set-boundary"?1:S[8].mode=="auto-boundaries"?2:S[8].mode=="neighbourhood"?3:S[8].mode=="view-shortcuts"?4:S[8].mode=="route"?5:S[8].mode=="debug"?6:-1}return~(n=x(r))&&(l=_[n]=a[n](r)),{c(){je(e.$$.fragment),t=Ve(),l&&l.c(),u=$n()},m(S,k){Oe(e,S,k),be(S,t,k),~n&&_[n].m(S,k),be(S,u,k),d=!0},p(S,k){const C={};k&32&&(C.data=JSON.parse(S[5].getInvertedBoundary())),k&2097152&&(C.$$scope={dirty:k,ctx:S}),e.$set(C);let P=n;n=x(S),n===P?~n&&_[n].p(S,k):(l&&(vr(),de(_[P],1,1,()=>{_[P]=null}),br()),~n?(l=_[n],l?l.p(S,k):(l=_[n]=a[n](S),l.c()),oe(l,1),l.m(u.parentNode,u)):l=null)},i(S){d||(oe(e.$$.fragment,S),oe(l),d=!0)},o(S){de(e.$$.fragment,S),de(l),d=!1},d(S){S&&(ve(t),ve(u)),Ne(e,S),~n&&_[n].d(S)}}}function yD(r){let e,t;const n=[Hn("boundary"),{paint:{"fill-color":"black","fill-opacity":.3}}];let l={};for(let u=0;u{C[O]=null}),br()),~u?(d=C[u],d?d.p(N,z):(d=C[u]=k[u](N),d.c()),oe(d,1),d.m(a.parentNode,a)):d=null),N[5]?D?(D.p(N,z),z&32&&oe(D,1)):(D=xb(N),D.c(),oe(D,1),D.m(_.parentNode,_)):D&&(vr(),de(D,1,1,()=>{D=null}),br())},i(N){S||(oe(e.$$.fragment,N),oe(d),oe(D),oe(x.$$.fragment,N),S=!0)},o(N){de(e.$$.fragment,N),de(d),de(D),de(x.$$.fragment,N),S=!1},d(N){N&&(ve(t),ve(n),ve(l),ve(a),ve(_)),Ne(e,N),r[14](null),~u&&C[u].d(N),D&&D.d(N),Ne(x,N)}}}function MD(r){let e,t,n,l;function u(a){r[15](a)}let d={style:`https://api.maptiler.com/maps/${r[7]}/style.json?key=${Dm}`,standardControls:!0,hash:!0,images:[{id:"walk_cycle_only",url:"/ltn//filters/walk_cycle_only_icon.gif"},{id:"no_entry",url:"/ltn//filters/no_entry_icon.gif"},{id:"bus_gate",url:"/ltn//filters/bus_gate_icon.gif"},{id:"school_street",url:"/ltn//filters/school_street_icon.gif"},{id:"oneway-arrow",url:lk}],$$slots:{default:[ED]},$$scope:{ctx:r}};return r[0]!==void 0&&(d.map=r[0]),t=new e3({props:d}),pn.push(()=>zo(t,"map",u)),t.$on("error",r[16]),{c(){e=fe("div"),je(t.$$.fragment),Ee(e,"slot","main"),fn(e,"position","relative"),fn(e,"width","100%"),fn(e,"height","100%")},m(a,_){be(a,e,_),Oe(t,e,null),l=!0},p(a,_){const x={};_&128&&(x.style=`https://api.maptiler.com/maps/${a[7]}/style.json?key=${Dm}`),_&2097465&&(x.$$scope={dirty:_,ctx:a}),!n&&_&1&&(n=!0,x.map=a[0],Po(()=>n=!1)),t.$set(x)},i(a){l||(oe(t.$$.fragment,a),l=!0)},o(a){de(t.$$.fragment,a),l=!1},d(a){a&&ve(e),Ne(t)}}}function CD(r){let e,t,n,l;return e=new ak({}),n=new u5({props:{$$slots:{main:[MD],left:[mD],top:[pD]},$$scope:{ctx:r}}}),{c(){je(e.$$.fragment),t=Ve(),je(n.$$.fragment)},m(u,d){Oe(e,u,d),be(u,t,d),Oe(n,u,d),l=!0},p(u,[d]){const a={};d&2098175&&(a.$$scope={dirty:d,ctx:u}),n.$set(a)},i(u){l||(oe(e.$$.fragment,u),oe(n.$$.fragment,u),l=!0)},o(u){de(e.$$.fragment,u),de(n.$$.fragment,u),l=!1},d(u){u&&ve(t),Ne(e,u),Ne(n,u)}}}function ID(r,e,t){let n,l,u,d,a,_,x,S,k;wt(r,Xm,Y=>t(11,n=Y)),wt(r,$m,Y=>t(12,l=Y)),wt(r,Hm,Y=>t(13,u=Y)),wt(r,ri,Y=>t(5,d=Y)),wt(r,ls,Y=>t(6,a=Y)),wt(r,dh,Y=>t(20,_=Y)),wt(r,Rm,Y=>t(7,x=Y)),wt(r,pr,Y=>t(8,S=Y)),wt(r,hd,Y=>t(9,k=Y));let C=!1;Ld(async()=>{await Fb(),await Ub(),t(4,C=!0);try{(await fetch("/osm/areas.json")).ok&&(Rt(dh,_=!0,_),console.log("Using local cache, not od2net.org"))}catch{}});let P;function D(){a.fitBounds(Array.from(d.getBounds()),{animate:!1})}let N,z,B;function O(Y){pn[Y?"unshift":"push"](()=>{B=Y,t(3,B),t(11,n)})}function G(Y){P=Y,t(0,P)}const U=Y=>{console.log(Y.detail.error)};function K(Y){pn[Y?"unshift":"push"](()=>{z=Y,t(2,z),t(12,l)})}const me=()=>Rt(hd,k=!0,k);function X(Y){pn[Y?"unshift":"push"](()=>{N=Y,t(1,N),t(13,u)})}return r.$$.update=()=>{r.$$.dirty&1&&P&&ls.set(P),r.$$.dirty&8194&&N&&u&&(t(1,N.innerHTML="",N),N.appendChild(u)),r.$$.dirty&4100&&z&&l&&(t(2,z.innerHTML="",z),z.appendChild(l)),r.$$.dirty&2056&&B&&n&&(t(3,B.innerHTML="",B),B.appendChild(n))},[P,N,z,B,C,d,a,x,S,k,D,n,l,u,O,G,U,K,me,X]}class AD extends Ht{constructor(e){super(),Zt(this,e,ID,CD,jt,{})}}new AD({target:document.getElementById("app")}); diff --git a/assets/main-872437d6.js b/assets/main-872437d6.js deleted file mode 100644 index a72e7e8..0000000 --- a/assets/main-872437d6.js +++ /dev/null @@ -1,678 +0,0 @@ -var BP=Object.defineProperty;var VP=(t,e,n)=>e in t?BP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ci=(t,e,n)=>(VP(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Mt(){}function gi(t,e){for(const n in e)t[n]=e[n];return t}function OE(t){return t()}function Hx(){return Object.create(null)}function Hr(t){t.forEach(OE)}function Nf(t){return typeof t=="function"}function Ht(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Fg;function si(t,e){return t===e?!0:(Fg||(Fg=document.createElement("a")),Fg.href=e,t===Fg.href)}function UP(t){return Object.keys(t).length===0}function zE(t,...e){if(t==null){for(const r of e)r(void 0);return Mt}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function rs(t){let e;return zE(t,n=>e=n)(),e}function wt(t,e,n){t.$$.on_destroy.push(zE(e,n))}function hr(t,e,n,r){if(t){const i=FE(t,e,n,r);return t[0](i)}}function FE(t,e,n,r){return t[1]&&r?gi(n.ctx.slice(),t[1](r(e))):n.ctx}function fr(t,e,n,r){if(t[2]&&r){const i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],c=Math.max(e.dirty.length,i.length);for(let l=0;l32){const e=[],n=t.ctx.length/32;for(let r=0;rt.removeEventListener(e,n,r)}function h1(t){return function(e){return e.preventDefault(),t.call(this,e)}}function k0(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Ce(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function BE(t){let e;return{p(...n){e=n,e.forEach(r=>t.push(r))},r(){e.forEach(n=>t.splice(t.indexOf(n),1))}}}function f1(t){return t===""?null:+t}function GP(t){return Array.from(t.childNodes)}function Kn(t,e){e=""+e,t.data!==e&&(t.data=e)}function qi(t,e){t.value=e??""}function gr(t,e,n,r){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function p_(t,e,n){for(let r=0;r{const i=t.$$.callbacks[e];if(i){const o=qP(e,n,{cancelable:r});return i.slice().forEach(c=>{c.call(t,o)}),!o.defaultPrevented}return!0}}function p1(t,e){return bm().$$.context.set(t,e),e}function UE(t){return bm().$$.context.get(t)}function xn(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}const Ef=[],Gr=[];let kf=[];const hv=[],jE=Promise.resolve();let fv=!1;function GE(){fv||(fv=!0,jE.then(WE))}function qE(){return GE(),jE}function Jd(t){kf.push(t)}function ba(t){hv.push(t)}const A0=new Set;let _f=0;function WE(){if(_f!==0)return;const t=Kd;do{try{for(;_ft.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),kf=e}const Kg=new Set;let Zc;function Rn(){Zc={r:0,c:[],p:Zc}}function Nn(){Zc.r||Hr(Zc.c),Zc=Zc.p}function ne(t,e){t&&t.i&&(Kg.delete(t),t.i(e))}function de(t,e,n,r){if(t&&t.o){if(Kg.has(t))return;Kg.add(t),Zc.c.push(()=>{Kg.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function Oi(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function ZP(t,e){de(t,1,1,()=>{e.delete(t.key)})}function XP(t,e,n,r,i,o,c,l,d,y,S,E){let C=t.length,A=o.length,M=C;const R={};for(;M--;)R[t[M].key]=M;const N=[],B=new Map,O=new Map,G=[];for(M=A;M--;){const ae=E(i,o,M),se=n(ae);let fe=c.get(se);fe?r&&G.push(()=>fe.p(ae,e)):(fe=y(se,ae),fe.c()),B.set(se,N[M]=fe),se in R&&O.set(se,Math.abs(M-R[se]))}const U=new Set,Z=new Set;function ue(ae){ne(ae,1),ae.m(l,S),c.set(ae.key,ae),S=ae.first,A--}for(;C&&A;){const ae=N[A-1],se=t[C-1],fe=ae.key,ke=se.key;ae===se?(S=ae.first,C--,A--):B.has(ke)?!c.has(fe)||U.has(fe)?ue(ae):Z.has(ke)?C--:O.get(fe)>O.get(ke)?(Z.add(fe),ue(ae)):(U.add(ke),C--):(d(se,c),C--)}for(;C--;){const ae=t[C];B.has(ae.key)||d(ae,c)}for(;A;)ue(N[A-1]);return Hr(G),N}function pv(t,e){const n={},r={},i={$$scope:1};let o=t.length;for(;o--;){const c=t[o],l=e[o];if(l){for(const d in c)d in l||(r[d]=1);for(const d in l)i[d]||(n[d]=l[d],i[d]=1);t[o]=l}else for(const d in c)i[d]=1}for(const c in r)c in n||(n[c]=void 0);return n}function xa(t,e,n){const r=t.$$.props[e];r!==void 0&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function Ve(t){t&&t.c()}function Fe(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),Jd(()=>{const o=t.$$.on_mount.map(OE).filter(Nf);t.$$.on_destroy?t.$$.on_destroy.push(...o):Hr(o),t.$$.on_mount=[]}),i.forEach(Jd)}function Be(t,e){const n=t.$$;n.fragment!==null&&(HP(n.after_update),Hr(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function YP(t,e){t.$$.dirty[0]===-1&&(Ef.push(t),GE(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const M=A.length?A[0]:C;return y.ctx&&i(y.ctx[E],y.ctx[E]=M)&&(!y.skip_bound&&y.bound[E]&&y.bound[E](M),S&&YP(t,E)),C}):[],y.update(),S=!0,Hr(y.before_update),y.fragment=r?r(y.ctx):!1,e.target){if(e.hydrate){const E=GP(e.target);y.fragment&&y.fragment.l(E),E.forEach(ve)}else y.fragment&&y.fragment.c();e.intro&&ne(t.$$.fragment),Fe(t,e.target,e.anchor),WE()}jd(d)}class Qt{constructor(){Ci(this,"$$");Ci(this,"$$set")}$destroy(){Be(this,1),this.$destroy=Mt}$on(e,n){if(!Nf(n))return Mt;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!UP(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $P="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($P);function Zx(t){let e,n;return{c(){e=pe("div"),n=nt(t[0]),Ce(e,"class","svelte-1uuov7f")},m(r,i){be(r,e,i),te(e,n)},p(r,i){i&1&&Kn(n,r[0])},d(r){r&&ve(e)}}}function KP(t){let e,n=t[0]&&Zx(t);return{c(){n&&n.c(),e=ki()},m(r,i){n&&n.m(r,i),be(r,e,i)},p(r,[i]){r[0]?n?n.p(r,i):(n=Zx(r),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:Mt,o:Mt,d(r){r&&ve(e),n&&n.d(r)}}}function JP(t,e,n){let{loading:r}=e;return t.$$set=i=>{"loading"in i&&n(0,r=i.loading)},[r]}class HE extends Qt{constructor(e){super(),Jt(this,e,JP,KP,Ht,{loading:0})}}const QP=t=>({dialog:t&1}),Xx=t=>({dialog:t[0]});function eM(t){let e,n,r,i,o;const c=t[4].default,l=hr(c,t,t[3],Xx);return{c(){e=pe("dialog"),n=pe("article"),l&&l.c(),e.open=!0},m(d,y){be(d,e,y),te(e,n),l&&l.m(n,null),t[6](e),r=!0,i||(o=[Lt(window,"click",t[1]),Lt(window,"keydown",t[2]),Lt(e,"close",t[5])],i=!0)},p(d,[y]){l&&l.p&&(!r||y&9)&&pr(l,c,d,d[3],r?fr(c,d[3],y,QP):dr(d[3]),Xx)},i(d){r||(ne(l,d),r=!0)},o(d){de(l,d),r=!1},d(d){d&&ve(e),l&&l.d(d),t[6](null),i=!1,Hr(o)}}}function tM(t,e,n){let{$$slots:r={},$$scope:i}=e,o;function c(S){o.open&&S.target==o&&o.close()}function l(S){(S.key=="Escape"||S.key=="Enter")&&(S.stopPropagation(),o.close())}function d(S){xn.call(this,t,S)}function y(S){Gr[S?"unshift":"push"](()=>{o=S,n(0,o)})}return t.$$set=S=>{"$$scope"in S&&n(3,i=S.$$scope)},[o,c,l,i,r,d,y]}class $_ extends Qt{constructor(e){super(),Jt(this,e,tM,eM,Ht,{})}}function Yx(t,e,n){const r=t.slice();return r[1]=e[n][0],r[2]=e[n][1],r}function $x(t){let e,n,r=t[1]+"",i,o,c,l=t[2]+"",d,y;return{c(){e=pe("tr"),n=pe("td"),i=nt(r),o=je(),c=pe("td"),d=nt(l),y=je()},m(S,E){be(S,e,E),te(e,n),te(n,i),te(e,o),te(e,c),te(c,d),te(e,y)},p(S,E){E&1&&r!==(r=S[1]+"")&&Kn(i,r),E&1&&l!==(l=S[2]+"")&&Kn(d,l)},d(S){S&&ve(e)}}}function nM(t){let e,n,r=Oi(Object.entries(t[0])),i=[];for(let o=0;o{"properties"in i&&n(0,r=i.properties)},[r]}class K_ extends Qt{constructor(e){super(),Jt(this,e,rM,nM,Ht,{properties:0})}}function d_(t,e){let n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),n.setAttribute("download",t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function Vr(t){if(t==null||t==null)throw new Error("Oops, notNull given something null");return t}let at;const ZE=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&ZE.decode();let kd=null;function Af(){return(kd===null||kd.byteLength===0)&&(kd=new Uint8Array(at.memory.buffer)),kd}function ys(t,e){return t=t>>>0,ZE.decode(Af().subarray(t,t+e))}const au=new Array(128).fill(void 0);au.push(void 0,null,!0,!1);let Gd=au.length;function cr(t){Gd===au.length&&au.push(au.length+1);const e=Gd;return Gd=au[e],au[e]=t,e}function wn(t){return au[t]}function iM(t){t<132||(au[t]=Gd,Gd=t)}function Oo(t){const e=wn(t);return iM(t),e}let ts=0;const Jg=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},oM=typeof Jg.encodeInto=="function"?function(t,e){return Jg.encodeInto(t,e)}:function(t,e){const n=Jg.encode(t);return e.set(n),{read:t.length,written:n.length}};function Wa(t,e,n){if(n===void 0){const l=Jg.encode(t),d=e(l.length,1)>>>0;return Af().subarray(d,d+l.length).set(l),ts=l.length,d}let r=t.length,i=e(r,1)>>>0;const o=Af();let c=0;for(;c127)break;o[i+c]=l}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;const l=Af().subarray(i+c,i+r),d=oM(t,l);c+=d.written}return ts=c,i}function If(t){return t==null}let Ad=null;function Kt(){return(Ad===null||Ad.byteLength===0)&&(Ad=new Int32Array(at.memory.buffer)),Ad}let Dd=null;function XE(){return(Dd===null||Dd.byteLength===0)&&(Dd=new Float64Array(at.memory.buffer)),Dd}let Rd=null;function sM(){return(Rd===null||Rd.byteLength===0)&&(Rd=new BigInt64Array(at.memory.buffer)),Rd}function dv(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){const i=t.length;let o="[";i>0&&(o+=dv(t[0]));for(let c=1;c1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}function aM(t,e){const n=e(t.length*1,1)>>>0;return Af().set(t,n/1),ts=t.length,n}function lM(t,e){return t=t>>>0,XE().subarray(t/8,t/8+e)}function uM(t,e){return t=t>>>0,Af().subarray(t/1,t/1+e)}function Hc(t,e){try{return t.apply(this,e)}catch(n){at.__wbindgen_exn_store(cr(n))}}class YE{__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();at.__wbg_ltn_free(e)}constructor(e,n,r){try{const y=at.__wbindgen_add_to_stack_pointer(-16),S=aM(e,at.__wbindgen_malloc),E=ts;var i=If(r)?0:Wa(r,at.__wbindgen_malloc,at.__wbindgen_realloc),o=ts;at.ltn_new(y,S,E,cr(n),i,o);var c=Kt()[y/4+0],l=Kt()[y/4+1],d=Kt()[y/4+2];if(d)throw Oo(l);return this.__wbg_ptr=c>>>0,this}finally{at.__wbindgen_add_to_stack_pointer(16)}}getInvertedBoundary(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_getInvertedBoundary(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}getBounds(){try{const i=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_getBounds(i,this.__wbg_ptr);var e=Kt()[i/4+0],n=Kt()[i/4+1],r=lM(e,n).slice();return at.__wbindgen_free(e,n*8,8),r}finally{at.__wbindgen_add_to_stack_pointer(16)}}toRouteSnapper(){try{const i=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_toRouteSnapper(i,this.__wbg_ptr);var e=Kt()[i/4+0],n=Kt()[i/4+1],r=uM(e,n).slice();return at.__wbindgen_free(e,n*1,1),r}finally{at.__wbindgen_add_to_stack_pointer(16)}}toRouteSnapperGj(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_toRouteSnapperGj(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}renderModalFilters(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_renderModalFilters(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}renderNeighbourhood(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_renderNeighbourhood(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}renderAutoBoundaries(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_renderAutoBoundaries(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}setNeighbourhoodBoundary(e,n){try{const o=at.__wbindgen_add_to_stack_pointer(-16),c=Wa(e,at.__wbindgen_malloc,at.__wbindgen_realloc),l=ts;at.ltn_setNeighbourhoodBoundary(o,this.__wbg_ptr,c,l,cr(n));var r=Kt()[o/4+0],i=Kt()[o/4+1];if(i)throw Oo(r)}finally{at.__wbindgen_add_to_stack_pointer(16)}}deleteNeighbourhoodBoundary(e){const n=Wa(e,at.__wbindgen_malloc,at.__wbindgen_realloc),r=ts;at.ltn_deleteNeighbourhoodBoundary(this.__wbg_ptr,n,r)}renameNeighbourhoodBoundary(e,n){const r=Wa(e,at.__wbindgen_malloc,at.__wbindgen_realloc),i=ts,o=Wa(n,at.__wbindgen_malloc,at.__wbindgen_realloc),c=ts;at.ltn_renameNeighbourhoodBoundary(this.__wbg_ptr,r,i,o,c)}setCurrentNeighbourhood(e){try{const i=at.__wbindgen_add_to_stack_pointer(-16),o=Wa(e,at.__wbindgen_malloc,at.__wbindgen_realloc),c=ts;at.ltn_setCurrentNeighbourhood(i,this.__wbg_ptr,o,c);var n=Kt()[i/4+0],r=Kt()[i/4+1];if(r)throw Oo(n)}finally{at.__wbindgen_add_to_stack_pointer(16)}}addModalFilter(e,n){try{const o=at.__wbindgen_add_to_stack_pointer(-16),c=Wa(n,at.__wbindgen_malloc,at.__wbindgen_realloc),l=ts;at.ltn_addModalFilter(o,this.__wbg_ptr,cr(e),c,l);var r=Kt()[o/4+0],i=Kt()[o/4+1];if(i)throw Oo(r)}finally{at.__wbindgen_add_to_stack_pointer(16)}}addManyModalFilters(e,n){try{const o=at.__wbindgen_add_to_stack_pointer(-16),c=Wa(n,at.__wbindgen_malloc,at.__wbindgen_realloc),l=ts;at.ltn_addManyModalFilters(o,this.__wbg_ptr,cr(e),c,l);var r=Kt()[o/4+0],i=Kt()[o/4+1];if(i)throw Oo(r)}finally{at.__wbindgen_add_to_stack_pointer(16)}}deleteModalFilter(e){at.ltn_deleteModalFilter(this.__wbg_ptr,e)}toggleDirection(e){at.ltn_toggleDirection(this.__wbg_ptr,e)}undo(){at.ltn_undo(this.__wbg_ptr)}redo(){at.ltn_redo(this.__wbg_ptr)}getShortcutsCrossingRoad(e){let n,r;try{const S=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_getShortcutsCrossingRoad(S,this.__wbg_ptr,e);var i=Kt()[S/4+0],o=Kt()[S/4+1],c=Kt()[S/4+2],l=Kt()[S/4+3],d=i,y=o;if(l)throw d=0,y=0,Oo(c);return n=d,r=y,ys(d,y)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(n,r,1)}}getAllShortcuts(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_getAllShortcuts(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}toSavefile(){let e,n;try{const y=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_toSavefile(y,this.__wbg_ptr);var r=Kt()[y/4+0],i=Kt()[y/4+1],o=Kt()[y/4+2],c=Kt()[y/4+3],l=r,d=i;if(c)throw l=0,d=0,Oo(o);return e=l,n=d,ys(l,d)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(e,n,1)}}loadSavefile(e){try{const i=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_loadSavefile(i,this.__wbg_ptr,cr(e));var n=Kt()[i/4+0],r=Kt()[i/4+1];if(r)throw Oo(n)}finally{at.__wbindgen_add_to_stack_pointer(16)}}compareRoute(e,n,r,i,o){let c,l;try{const M=at.__wbindgen_add_to_stack_pointer(-16);at.ltn_compareRoute(M,this.__wbg_ptr,e,n,r,i,o);var d=Kt()[M/4+0],y=Kt()[M/4+1],S=Kt()[M/4+2],E=Kt()[M/4+3],C=d,A=y;if(E)throw C=0,A=0,Oo(S);return c=C,l=A,ys(C,A)}finally{at.__wbindgen_add_to_stack_pointer(16),at.__wbindgen_free(c,l,1)}}}async function cM(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function hM(){const t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,n){const r=new Error(ys(e,n));return cr(r)},t.wbg.__wbindgen_object_drop_ref=function(e){Oo(e)},t.wbg.__wbindgen_string_get=function(e,n){const r=wn(n),i=typeof r=="string"?r:void 0;var o=If(i)?0:Wa(i,at.__wbindgen_malloc,at.__wbindgen_realloc),c=ts;Kt()[e/4+1]=c,Kt()[e/4+0]=o},t.wbg.__wbindgen_boolean_get=function(e){const n=wn(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_is_bigint=function(e){return typeof wn(e)=="bigint"},t.wbg.__wbindgen_number_get=function(e,n){const r=wn(n),i=typeof r=="number"?r:void 0;XE()[e/8+1]=If(i)?0:i,Kt()[e/4+0]=!If(i)},t.wbg.__wbindgen_is_object=function(e){const n=wn(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_in=function(e,n){return wn(e)in wn(n)},t.wbg.__wbindgen_bigint_from_i64=function(e){return cr(e)},t.wbg.__wbindgen_jsval_eq=function(e,n){return wn(e)===wn(n)},t.wbg.__wbindgen_bigint_from_u64=function(e){const n=BigInt.asUintN(64,e);return cr(n)},t.wbg.__wbindgen_is_undefined=function(e){return wn(e)===void 0},t.wbg.__wbindgen_string_new=function(e,n){const r=ys(e,n);return cr(r)},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return wn(e)==wn(n)},t.wbg.__wbindgen_object_clone_ref=function(e){const n=wn(e);return cr(n)},t.wbg.__wbg_getwithrefkey_3b3c46ba20582127=function(e,n){const r=wn(e)[wn(n)];return cr(r)},t.wbg.__wbg_debug_34c9290896ec9856=function(e){console.debug(wn(e))},t.wbg.__wbg_error_e60eff06f24ab7a4=function(e){console.error(wn(e))},t.wbg.__wbg_info_d7d58472d0bab115=function(e){console.info(wn(e))},t.wbg.__wbg_log_a4530b4fe289336f=function(e){console.log(wn(e))},t.wbg.__wbg_warn_f260f49434e45e62=function(e){console.warn(wn(e))},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return cr(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const r=wn(n).stack,i=Wa(r,at.__wbindgen_malloc,at.__wbindgen_realloc),o=ts;Kt()[e/4+1]=o,Kt()[e/4+0]=i},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let r,i;try{r=e,i=n,console.error(ys(e,n))}finally{at.__wbindgen_free(r,i,1)}},t.wbg.__wbg_performance_3f3012faa4463882=function(e){const n=wn(e).performance;return cr(n)},t.wbg.__wbg_now_2fd65358804c9485=function(e){return wn(e).now()},t.wbg.__wbg_get_f01601b5a68d10e3=function(e,n){const r=wn(e)[n>>>0];return cr(r)},t.wbg.__wbg_length_1009b1af0c481d7b=function(e){return wn(e).length},t.wbg.__wbindgen_is_function=function(e){return typeof wn(e)=="function"},t.wbg.__wbg_newnoargs_c62ea9419c21fbac=function(e,n){const r=new Function(ys(e,n));return cr(r)},t.wbg.__wbg_next_9b877f231f476d01=function(e){const n=wn(e).next;return cr(n)},t.wbg.__wbg_next_6529ee0cca8d57ed=function(){return Hc(function(e){const n=wn(e).next();return cr(n)},arguments)},t.wbg.__wbg_done_5fe336b092d60cf2=function(e){return wn(e).done},t.wbg.__wbg_value_0c248a78fdc8e19f=function(e){const n=wn(e).value;return cr(n)},t.wbg.__wbg_iterator_db7ca081358d4fb2=function(){return cr(Symbol.iterator)},t.wbg.__wbg_get_7b48513de5dc5ea4=function(){return Hc(function(e,n){const r=Reflect.get(wn(e),wn(n));return cr(r)},arguments)},t.wbg.__wbg_call_90c26b09837aba1c=function(){return Hc(function(e,n){const r=wn(e).call(wn(n));return cr(r)},arguments)},t.wbg.__wbg_self_f0e34d89f33b99fd=function(){return Hc(function(){const e=self.self;return cr(e)},arguments)},t.wbg.__wbg_window_d3b084224f4774d7=function(){return Hc(function(){const e=window.window;return cr(e)},arguments)},t.wbg.__wbg_globalThis_9caa27ff917c6860=function(){return Hc(function(){const e=globalThis.globalThis;return cr(e)},arguments)},t.wbg.__wbg_global_35dfdd59a4da3e74=function(){return Hc(function(){const e=global.global;return cr(e)},arguments)},t.wbg.__wbg_isArray_74fb723e24f76012=function(e){return Array.isArray(wn(e))},t.wbg.__wbg_instanceof_ArrayBuffer_e7d53d51371448e2=function(e){let n;try{n=wn(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_isSafeInteger_f93fde0dca9820f8=function(e){return Number.isSafeInteger(wn(e))},t.wbg.__wbg_entries_9e2e2aa45aa5094a=function(e){const n=Object.entries(wn(e));return cr(n)},t.wbg.__wbg_buffer_a448f833075b71ba=function(e){const n=wn(e).buffer;return cr(n)},t.wbg.__wbg_new_8f67e318f15d7254=function(e){const n=new Uint8Array(wn(e));return cr(n)},t.wbg.__wbg_set_2357bf09366ee480=function(e,n,r){wn(e).set(wn(n),r>>>0)},t.wbg.__wbg_length_1d25fa9e4ac21ce7=function(e){return wn(e).length},t.wbg.__wbg_instanceof_Uint8Array_bced6f43aed8c1aa=function(e){let n;try{n=wn(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const r=wn(n),i=typeof r=="bigint"?r:void 0;sM()[e/8+1]=If(i)?BigInt(0):i,Kt()[e/4+0]=!If(i)},t.wbg.__wbindgen_debug_string=function(e,n){const r=dv(wn(n)),i=Wa(r,at.__wbindgen_malloc,at.__wbindgen_realloc),o=ts;Kt()[e/4+1]=o,Kt()[e/4+0]=i},t.wbg.__wbindgen_throw=function(e,n){throw new Error(ys(e,n))},t.wbg.__wbindgen_memory=function(){const e=at.memory;return cr(e)},t}function fM(t,e){return at=t.exports,$E.__wbindgen_wasm_module=e,Rd=null,Dd=null,Ad=null,kd=null,at}async function $E(t){if(at!==void 0)return at;typeof t>"u"&&(t="/ltn/assets/backend_bg.wasm");const e=hM();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await cM(await t,e);return fM(n,r)}var xm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function J_(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var KE={exports:{}};/** - * MapLibre GL JS - * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.1.3/LICENSE.txt - */(function(t,e){(function(n,r){t.exports=r()})(xm,function(){var n={},r={};function i(c,l,d){if(r[c]=d,c==="index"){var y="var sharedModule = {}; ("+r.shared+")(sharedModule); ("+r.worker+")(sharedModule);",S={};return r.shared(S),r.index(n,S),typeof window<"u"&&n.setWorkerUrl(window.URL.createObjectURL(new Blob([y],{type:"text/javascript"}))),n}}i("shared",["exports"],function(c){function l(u,s,h,p){return new(h||(h=Promise))(function(_,x){function w(D){try{P(p.next(D))}catch(F){x(F)}}function I(D){try{P(p.throw(D))}catch(F){x(F)}}function P(D){var F;D.done?_(D.value):(F=D.value,F instanceof h?F:new h(function(V){V(F)})).then(w,I)}P((p=p.apply(u,s||[])).next())})}function d(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}typeof SuppressedError=="function"&&SuppressedError;var y=S;function S(u,s){this.x=u,this.y=s}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(u){return this.clone()._add(u)},sub:function(u){return this.clone()._sub(u)},multByPoint:function(u){return this.clone()._multByPoint(u)},divByPoint:function(u){return this.clone()._divByPoint(u)},mult:function(u){return this.clone()._mult(u)},div:function(u){return this.clone()._div(u)},rotate:function(u){return this.clone()._rotate(u)},rotateAround:function(u,s){return this.clone()._rotateAround(u,s)},matMult:function(u){return this.clone()._matMult(u)},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(u){return this.x===u.x&&this.y===u.y},dist:function(u){return Math.sqrt(this.distSqr(u))},distSqr:function(u){var s=u.x-this.x,h=u.y-this.y;return s*s+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(u){return Math.atan2(this.y-u.y,this.x-u.x)},angleWith:function(u){return this.angleWithSep(u.x,u.y)},angleWithSep:function(u,s){return Math.atan2(this.x*s-this.y*u,this.x*u+this.y*s)},_matMult:function(u){var s=u[2]*this.x+u[3]*this.y;return this.x=u[0]*this.x+u[1]*this.y,this.y=s,this},_add:function(u){return this.x+=u.x,this.y+=u.y,this},_sub:function(u){return this.x-=u.x,this.y-=u.y,this},_mult:function(u){return this.x*=u,this.y*=u,this},_div:function(u){return this.x/=u,this.y/=u,this},_multByPoint:function(u){return this.x*=u.x,this.y*=u.y,this},_divByPoint:function(u){return this.x/=u.x,this.y/=u.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var u=this.y;return this.y=this.x,this.x=-u,this},_rotate:function(u){var s=Math.cos(u),h=Math.sin(u),p=h*this.x+s*this.y;return this.x=s*this.x-h*this.y,this.y=p,this},_rotateAround:function(u,s){var h=Math.cos(u),p=Math.sin(u),_=s.y+p*(this.x-s.x)+h*(this.y-s.y);return this.x=s.x+h*(this.x-s.x)-p*(this.y-s.y),this.y=_,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},S.convert=function(u){return u instanceof S?u:Array.isArray(u)?new S(u[0],u[1]):u};var E=d(y),C=A;function A(u,s,h,p){this.cx=3*u,this.bx=3*(h-u)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(p-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=u,this.p1y=s,this.p2x=h,this.p2y=p}A.prototype={sampleCurveX:function(u){return((this.ax*u+this.bx)*u+this.cx)*u},sampleCurveY:function(u){return((this.ay*u+this.by)*u+this.cy)*u},sampleCurveDerivativeX:function(u){return(3*this.ax*u+2*this.bx)*u+this.cx},solveCurveX:function(u,s){if(s===void 0&&(s=1e-6),u<0)return 0;if(u>1)return 1;for(var h=u,p=0;p<8;p++){var _=this.sampleCurveX(h)-u;if(Math.abs(_)_?w=h:I=h,h=.5*(I-w)+w;return h},solve:function(u,s){return this.sampleCurveY(this.solveCurveX(u,s))}};var M=d(C);let R,N;function B(){return R==null&&(R=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),R}function O(){if(N==null&&(N=!1,B())){const s=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(s){for(let p=0;p<5*5;p++){const _=4*p;s.fillStyle=`rgb(${_},${_+1},${_+2})`,s.fillRect(p%5,Math.floor(p/5),1,1)}const h=s.getImageData(0,0,5,5).data;for(let p=0;p<5*5*4;p++)if(p%4!=3&&h[p]!==p){N=!0;break}}}return N||!1}function G(u,s,h,p){const _=new M(u,s,h,p);return function(x){return _.solve(x)}}const U=G(.25,.1,.25,1);function Z(u,s,h){return Math.min(h,Math.max(s,u))}function ue(u,s,h){const p=h-s,_=((u-s)%p+p)%p+s;return _===s?h:_}function ae(u,...s){for(const h of s)for(const p in h)u[p]=h[p];return u}let se=1;function fe(u,s,h){const p={};for(const _ in u)p[_]=s.call(h||this,u[_],_,u);return p}function ke(u,s,h){const p={};for(const _ in u)s.call(h||this,u[_],_,u)&&(p[_]=u[_]);return p}function K(u){return Array.isArray(u)?u.map(K):typeof u=="object"&&u?fe(u,K):u}const oe={};function Ge(u){oe[u]||(typeof console<"u"&&console.warn(u),oe[u]=!0)}function Te(u,s,h){return(h.y-u.y)*(s.x-u.x)>(s.y-u.y)*(h.x-u.x)}function ot(u){let s=0;for(let h,p,_=0,x=u.length,w=x-1;_"u")throw new Error("VideoFrame not supported");const x=new VideoFrame(u,{timestamp:0});try{const w=x==null?void 0:x.format;if(!w||!w.startsWith("BGR")&&!w.startsWith("RGB"))throw new Error(`Unrecognized format ${w}`);const I=w.startsWith("BGR"),P=new Uint8ClampedArray(p*_*4);if(yield x.copyTo(P,function(D,F,V,H,Y){const J=4*Math.max(-F,0),ie=(Math.max(0,V)-V)*H*4+J,ge=4*H,we=Math.max(0,F),Ne=Math.max(0,V);return{rect:{x:we,y:Ne,width:Math.min(D.width,F+H)-we,height:Math.min(D.height,V+Y)-Ne},layout:[{offset:ie,stride:ge}]}}(u,s,h,p,_)),I)for(let D=0;Dft(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,mt=function(u,s){if(/:\/\//.test(u.url)&&!/^https?:|^file:/.test(u.url)){const p=Xt(u.url);if(p)return p(u,s);if(ft(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:u,targetMapId:En},s)}if(!(/^file:/.test(h=u.url)||/^file:/.test(rr())&&!/^\w+:/.test(h))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(p,_){return l(this,void 0,void 0,function*(){const x=new Request(p.url,{method:p.method||"GET",body:p.body,credentials:p.credentials,headers:p.headers,cache:p.cache,referrer:rr(),signal:_.signal});p.type==="json"&&x.headers.set("Accept","application/json");const w=yield fetch(x);if(!w.ok){const D=yield w.blob();throw new In(w.status,w.statusText,p.url,D)}let I;I=p.type==="arrayBuffer"||p.type==="image"?w.arrayBuffer():p.type==="json"?w.json():w.text();const P=yield I;if(_.signal.aborted)throw Ln();return{data:P,cacheControl:w.headers.get("Cache-Control"),expires:w.headers.get("Expires")}})}(u,s);if(ft(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:u,mustQueue:!0,targetMapId:En},s)}var h;return function(p,_){return new Promise((x,w)=>{const I=new XMLHttpRequest;I.open(p.method||"GET",p.url,!0),p.type!=="arrayBuffer"&&p.type!=="image"||(I.responseType="arraybuffer");for(const P in p.headers)I.setRequestHeader(P,p.headers[P]);p.type==="json"&&(I.responseType="text",I.setRequestHeader("Accept","application/json")),I.withCredentials=p.credentials==="include",I.onerror=()=>{w(new Error(I.statusText))},I.onload=()=>{if(!_.signal.aborted)if((I.status>=200&&I.status<300||I.status===0)&&I.response!==null){let P=I.response;if(p.type==="json")try{P=JSON.parse(I.response)}catch(D){return void w(D)}x({data:P,cacheControl:I.getResponseHeader("Cache-Control"),expires:I.getResponseHeader("Expires")})}else{const P=new Blob([I.response],{type:I.getResponseHeader("Content-Type")});w(new In(I.status,I.statusText,p.url,P))}},_.signal.addEventListener("abort",()=>{I.abort(),w(Ln())}),I.send(p.body)})}(u,s)};function Dt(u){if(!u||u.indexOf("://")<=0||u.indexOf("data:image/")===0||u.indexOf("blob:")===0)return!0;const s=new URL(u),h=window.location;return s.protocol===h.protocol&&s.host===h.host}function Sn(u,s,h){h[u]&&h[u].indexOf(s)!==-1||(h[u]=h[u]||[],h[u].push(s))}function Le(u,s,h){if(h&&h[u]){const p=h[u].indexOf(s);p!==-1&&h[u].splice(p,1)}}class rt{constructor(s,h={}){ae(this,h),this.type=s}}class gt extends rt{constructor(s,h={}){super("error",ae({error:s},h))}}class Nt{on(s,h){return this._listeners=this._listeners||{},Sn(s,h,this._listeners),this}off(s,h){return Le(s,h,this._listeners),Le(s,h,this._oneTimeListeners),this}once(s,h){return h?(this._oneTimeListeners=this._oneTimeListeners||{},Sn(s,h,this._oneTimeListeners),this):new Promise(p=>this.once(s,p))}fire(s,h){typeof s=="string"&&(s=new rt(s,h||{}));const p=s.type;if(this.listens(p)){s.target=this;const _=this._listeners&&this._listeners[p]?this._listeners[p].slice():[];for(const I of _)I.call(this,s);const x=this._oneTimeListeners&&this._oneTimeListeners[p]?this._oneTimeListeners[p].slice():[];for(const I of x)Le(p,I,this._oneTimeListeners),I.call(this,s);const w=this._eventedParent;w&&(ae(s,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),w.fire(s))}else s instanceof gt&&console.error(s.error);return this}listens(s){return this._listeners&&this._listeners[s]&&this._listeners[s].length>0||this._oneTimeListeners&&this._oneTimeListeners[s]&&this._oneTimeListeners[s].length>0||this._eventedParent&&this._eventedParent.listens(s)}setEventedParent(s,h){return this._eventedParent=s,this._eventedParentData=h,this}}var me={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 tn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Xe(u,s){const h={};for(const p in u)p!=="ref"&&(h[p]=u[p]);return tn.forEach(p=>{p in s&&(h[p]=s[p])}),h}function St(u,s){if(Array.isArray(u)){if(!Array.isArray(s)||u.length!==s.length)return!1;for(let h=0;h`:u.itemType.kind==="value"?"array":`array<${s}>`}return u.kind}const Pe=[li,pt,mn,pn,Zr,Jr,fs,Q(fn),_e,W,X];function ee(u,s){if(s.kind==="error")return null;if(u.kind==="array"){if(s.kind==="array"&&(s.N===0&&s.itemType.kind==="value"||!ee(u.itemType,s.itemType))&&(typeof u.N!="number"||u.N===s.N))return null}else{if(u.kind===s.kind)return null;if(u.kind==="value"){for(const h of Pe)if(!ee(h,s))return null}}return`Expected ${le(u)} but found ${le(s)} instead.`}function Me(u,s){return s.some(h=>h.kind===u.kind)}function Se(u,s){return s.some(h=>h==="null"?u===null:h==="array"?Array.isArray(u):h==="object"?u&&!Array.isArray(u)&&typeof u=="object":h===typeof u)}function Re(u,s){return u.kind==="array"&&s.kind==="array"?u.itemType.kind===s.itemType.kind&&typeof u.N=="number":u.kind===s.kind}const We=.96422,Ye=.82521,Je=4/29,Bt=6/29,qt=3*Bt*Bt,sn=Bt*Bt*Bt,un=Math.PI/180,On=180/Math.PI;function ir(u){return(u%=360)<0&&(u+=360),u}function Sr([u,s,h,p]){let _,x;const w=vn((.2225045*(u=ui(u))+.7168786*(s=ui(s))+.0606169*(h=ui(h)))/1);u===s&&s===h?_=x=w:(_=vn((.4360747*u+.3850649*s+.1430804*h)/We),x=vn((.0139322*u+.0971045*s+.7141733*h)/Ye));const I=116*w-16;return[I<0?0:I,500*(_-w),200*(w-x),p]}function ui(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}function vn(u){return u>sn?Math.pow(u,1/3):u/qt+Je}function Or([u,s,h,p]){let _=(u+16)/116,x=isNaN(s)?_:_+s/500,w=isNaN(h)?_:_-h/200;return _=1*po(_),x=We*po(x),w=Ye*po(w),[_i(3.1338561*x-1.6168667*_-.4906146*w),_i(-.9787684*x+1.9161415*_+.033454*w),_i(.0719453*x-.2289914*_+1.4052427*w),p]}function _i(u){return(u=u<=.00304?12.92*u:1.055*Math.pow(u,1/2.4)-.055)<0?0:u>1?1:u}function po(u){return u>Bt?u*u*u:qt*(u-Je)}function To(u){return parseInt(u.padEnd(2,u),16)/255}function Di(u,s){return Qs(s?u/100:u,0,1)}function Qs(u,s,h){return Math.min(Math.max(s,u),h)}function Dm(u){return!u.some(Number.isNaN)}const Cy={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 Qn{constructor(s,h,p,_=1,x=!0){this.r=s,this.g=h,this.b=p,this.a=_,x||(this.r*=_,this.g*=_,this.b*=_,_||this.overwriteGetter("rgb",[s,h,p,_]))}static parse(s){if(s instanceof Qn)return s;if(typeof s!="string")return;const h=function(p){if((p=p.toLowerCase().trim())==="transparent")return[0,0,0,0];const _=Cy[p];if(_){const[w,I,P]=_;return[w/255,I/255,P/255,1]}if(p.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(p)){const w=p.length<6?1:2;let I=1;return[To(p.slice(I,I+=w)),To(p.slice(I,I+=w)),To(p.slice(I,I+=w)),To(p.slice(I,I+w)||"ff")]}if(p.startsWith("rgb")){const w=p.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(w){const[I,P,D,F,V,H,Y,J,ie,ge,we,Ne]=w,Ee=[F||" ",Y||" ",ge].join("");if(Ee===" "||Ee===" /"||Ee===",,"||Ee===",,,"){const Ae=[D,H,ie].join(""),Qe=Ae==="%%%"?100:Ae===""?255:0;if(Qe){const et=[Qs(+P/Qe,0,1),Qs(+V/Qe,0,1),Qs(+J/Qe,0,1),we?Di(+we,Ne):1];if(Dm(et))return et}}return}}const x=p.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[w,I,P,D,F,V,H,Y,J]=x,ie=[P||" ",F||" ",H].join("");if(ie===" "||ie===" /"||ie===",,"||ie===",,,"){const ge=[+I,Qs(+D,0,100),Qs(+V,0,100),Y?Di(+Y,J):1];if(Dm(ge))return function([we,Ne,Ee,Ae]){function Qe(et){const Ct=(et+we/30)%12,zt=Ne*Math.min(Ee,1-Ee);return Ee-zt*Math.max(-1,Math.min(Ct-3,9-Ct,1))}return we=ir(we),Ne/=100,Ee/=100,[Qe(0),Qe(8),Qe(4),Ae]}(ge)}}}(s);return h?new Qn(...h,!1):void 0}get rgb(){const{r:s,g:h,b:p,a:_}=this,x=_||1/0;return this.overwriteGetter("rgb",[s/x,h/x,p/x,_])}get hcl(){return this.overwriteGetter("hcl",function(s){const[h,p,_,x]=Sr(s),w=Math.sqrt(p*p+_*_);return[Math.round(1e4*w)?ir(Math.atan2(_,p)*On):NaN,w,h,x]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Sr(this.rgb))}overwriteGetter(s,h){return Object.defineProperty(this,s,{value:h}),h}toString(){const[s,h,p,_]=this.rgb;return`rgba(${[s,h,p].map(x=>Math.round(255*x)).join(",")},${_})`}}Qn.black=new Qn(0,0,0,1),Qn.white=new Qn(1,1,1,1),Qn.transparent=new Qn(0,0,0,0),Qn.red=new Qn(1,0,0,1);class Sp{constructor(s,h,p){this.sensitivity=s?h?"variant":"case":h?"accent":"base",this.locale=p,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(s,h){return this.collator.compare(s,h)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ep{constructor(s,h,p,_,x){this.text=s,this.image=h,this.scale=p,this.fontStack=_,this.textColor=x}}class Wo{constructor(s){this.sections=s}static fromString(s){return new Wo([new Ep(s,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(s=>s.text.length!==0||s.image&&s.image.name.length!==0)}static factory(s){return s instanceof Wo?s:Wo.fromString(s)}toString(){return this.sections.length===0?"":this.sections.map(s=>s.text).join("")}}class Lo{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof Lo)return s;if(typeof s=="number")return new Lo([s,s,s,s]);if(Array.isArray(s)&&!(s.length<1||s.length>4)){for(const h of s)if(typeof h!="number")return;switch(s.length){case 1:s=[s[0],s[0],s[0],s[0]];break;case 2:s=[s[0],s[1],s[0],s[1]];break;case 3:s=[s[0],s[1],s[2],s[1]]}return new Lo(s)}}toString(){return JSON.stringify(this.values)}}const bc=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ps{constructor(s){this.values=s.slice()}static parse(s){if(s instanceof ps)return s;if(Array.isArray(s)&&!(s.length<1)&&s.length%2==0){for(let h=0;h=0&&u<=255&&typeof s=="number"&&s>=0&&s<=255&&typeof h=="number"&&h>=0&&h<=255?p===void 0||typeof p=="number"&&p>=0&&p<=1?null:`Invalid rgba value [${[u,s,h,p].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof p=="number"?[u,s,h,p]:[u,s,h]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function vh(u){if(u===null||typeof u=="string"||typeof u=="boolean"||typeof u=="number"||u instanceof Qn||u instanceof Sp||u instanceof Wo||u instanceof Lo||u instanceof ps||u instanceof ds)return!0;if(Array.isArray(u)){for(const s of u)if(!vh(s))return!1;return!0}if(typeof u=="object"){for(const s in u)if(!vh(u[s]))return!1;return!0}return!1}function ci(u){if(u===null)return li;if(typeof u=="string")return mn;if(typeof u=="boolean")return pn;if(typeof u=="number")return pt;if(u instanceof Qn)return Zr;if(u instanceof Sp)return za;if(u instanceof Wo)return Jr;if(u instanceof Lo)return _e;if(u instanceof ps)return X;if(u instanceof ds)return W;if(Array.isArray(u)){const s=u.length;let h;for(const p of u){const _=ci(p);if(h){if(h===_)continue;h=fn;break}h=_}return Q(h||fn,s)}return fs}function xc(u){const s=typeof u;return u===null?"":s==="string"||s==="number"||s==="boolean"?String(u):u instanceof Qn||u instanceof Wo||u instanceof Lo||u instanceof ps||u instanceof ds?u.toString():JSON.stringify(u)}class ll{constructor(s,h){this.type=s,this.value=h}static parse(s,h){if(s.length!==2)return h.error(`'literal' expression requires exactly one argument, but found ${s.length-1} instead.`);if(!vh(s[1]))return h.error("invalid value");const p=s[1];let _=ci(p);const x=h.expectedType;return _.kind!=="array"||_.N!==0||!x||x.kind!=="array"||typeof x.N=="number"&&x.N!==0||(_=x),new ll(_,p)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Pr{constructor(s){this.name="ExpressionEvaluationError",this.message=s}toJSON(){return this.message}}const bh={string:mn,number:pt,boolean:pn,object:fs};class Ho{constructor(s,h){this.type=s,this.args=h}static parse(s,h){if(s.length<2)return h.error("Expected at least one argument.");let p,_=1;const x=s[0];if(x==="array"){let I,P;if(s.length>2){const D=s[1];if(typeof D!="string"||!(D in bh)||D==="object")return h.error('The item type argument of "array" must be one of string, number, boolean',1);I=bh[D],_++}else I=fn;if(s.length>3){if(s[2]!==null&&(typeof s[2]!="number"||s[2]<0||s[2]!==Math.floor(s[2])))return h.error('The length argument to "array" must be a positive integer literal',2);P=s[2],_++}p=Q(I,P)}else{if(!bh[x])throw new Error(`Types doesn't contain name = ${x}`);p=bh[x]}const w=[];for(;_s.outputDefined())}}const xh={"to-boolean":pn,"to-color":Zr,"to-number":pt,"to-string":mn};class ea{constructor(s,h){this.type=s,this.args=h}static parse(s,h){if(s.length<2)return h.error("Expected at least one argument.");const p=s[0];if(!xh[p])throw new Error(`Can't parse ${p} as it is not part of the known types`);if((p==="to-boolean"||p==="to-string")&&s.length!==2)return h.error("Expected one argument.");const _=xh[p],x=[];for(let w=1;w4?`Invalid rbga value ${JSON.stringify(h)}: expected an array containing either three or four numeric values.`:Cu(h[0],h[1],h[2],h[3]),!p))return new Qn(h[0]/255,h[1]/255,h[2]/255,h[3])}throw new Pr(p||`Could not parse color from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"padding":{let h;for(const p of this.args){h=p.evaluate(s);const _=Lo.parse(h);if(_)return _}throw new Pr(`Could not parse padding from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"variableAnchorOffsetCollection":{let h;for(const p of this.args){h=p.evaluate(s);const _=ps.parse(h);if(_)return _}throw new Pr(`Could not parse variableAnchorOffsetCollection from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}case"number":{let h=null;for(const p of this.args){if(h=p.evaluate(s),h===null)return 0;const _=Number(h);if(!isNaN(_))return _}throw new Pr(`Could not convert ${JSON.stringify(h)} to number.`)}case"formatted":return Wo.fromString(xc(this.args[0].evaluate(s)));case"resolvedImage":return ds.fromString(xc(this.args[0].evaluate(s)));default:return xc(this.args[0].evaluate(s))}}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}const wc=["Unknown","Point","LineString","Polygon"];class er{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?wc[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(s){let h=this._parseColorCache[s];return h||(h=this._parseColorCache[s]=Qn.parse(s)),h}}class wh{constructor(s,h,p=[],_,x=new Gl,w=[]){this.registry=s,this.path=p,this.key=p.map(I=>`[${I}]`).join(""),this.scope=x,this.errors=w,this.expectedType=_,this._isConstant=h}parse(s,h,p,_,x={}){return h?this.concat(h,p,_)._parse(s,x):this._parse(s,x)}_parse(s,h){function p(_,x,w){return w==="assert"?new Ho(x,[_]):w==="coerce"?new ea(x,[_]):_}if(s!==null&&typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"||(s=["literal",s]),Array.isArray(s)){if(s.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const _=s[0];if(typeof _!="string")return this.error(`Expression name must be a string, but found ${typeof _} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const x=this.registry[_];if(x){let w=x.parse(s,this);if(!w)return null;if(this.expectedType){const I=this.expectedType,P=w.type;if(I.kind!=="string"&&I.kind!=="number"&&I.kind!=="boolean"&&I.kind!=="object"&&I.kind!=="array"||P.kind!=="value")if(I.kind!=="color"&&I.kind!=="formatted"&&I.kind!=="resolvedImage"||P.kind!=="value"&&P.kind!=="string")if(I.kind!=="padding"||P.kind!=="value"&&P.kind!=="number"&&P.kind!=="array")if(I.kind!=="variableAnchorOffsetCollection"||P.kind!=="value"&&P.kind!=="array"){if(this.checkSubtype(I,P))return null}else w=p(w,I,h.typeAnnotation||"coerce");else w=p(w,I,h.typeAnnotation||"coerce");else w=p(w,I,h.typeAnnotation||"coerce");else w=p(w,I,h.typeAnnotation||"assert")}if(!(w instanceof ll)&&w.type.kind!=="resolvedImage"&&this._isConstant(w)){const I=new er;try{w=new ll(w.type,w.evaluate(I))}catch(P){return this.error(P.message),null}}return w}return this.error(`Unknown expression "${_}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(s===void 0?"'undefined' value invalid. Use null instead.":typeof s=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof s} instead.`)}concat(s,h,p){const _=typeof s=="number"?this.path.concat(s):this.path,x=p?this.scope.concat(p):this.scope;return new wh(this.registry,this._isConstant,_,h||null,x,this.errors)}error(s,...h){const p=`${this.key}${h.map(_=>`[${_}]`).join("")}`;this.errors.push(new fo(p,s))}checkSubtype(s,h){const p=ee(s,h);return p&&this.error(p),p}}class Tu{constructor(s,h,p){this.type=za,this.locale=p,this.caseSensitive=s,this.diacriticSensitive=h}static parse(s,h){if(s.length!==2)return h.error("Expected one argument.");const p=s[1];if(typeof p!="object"||Array.isArray(p))return h.error("Collator options argument must be an object.");const _=h.parse(p["case-sensitive"]!==void 0&&p["case-sensitive"],1,pn);if(!_)return null;const x=h.parse(p["diacritic-sensitive"]!==void 0&&p["diacritic-sensitive"],1,pn);if(!x)return null;let w=null;return p.locale&&(w=h.parse(p.locale,1,mn),!w)?null:new Tu(_,x,w)}evaluate(s){return new Sp(this.caseSensitive.evaluate(s),this.diacriticSensitive.evaluate(s),this.locale?this.locale.evaluate(s):null)}eachChild(s){s(this.caseSensitive),s(this.diacriticSensitive),this.locale&&s(this.locale)}outputDefined(){return!1}}const ul=8192;function Sh(u,s){u[0]=Math.min(u[0],s[0]),u[1]=Math.min(u[1],s[1]),u[2]=Math.max(u[2],s[0]),u[3]=Math.max(u[3],s[1])}function Sc(u,s){return!(u[0]<=s[0]||u[2]>=s[2]||u[1]<=s[1]||u[3]>=s[3])}function Ty(u,s){const h=(180+u[0])/360,p=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u[1]*Math.PI/360)))/360,_=Math.pow(2,s.z);return[Math.round(h*_*ul),Math.round(p*_*ul)]}function Rm(u,s,h){const p=u[0]-s[0],_=u[1]-s[1],x=u[0]-h[0],w=u[1]-h[1];return p*w-x*_==0&&p*x<=0&&_*w<=0}function Eh(u,s){let h=!1;for(let w=0,I=s.length;w(p=u)[1]!=(x=P[D+1])[1]>p[1]&&p[0]<(x[0]-_[0])*(p[1]-_[1])/(x[1]-_[1])+_[0]&&(h=!h)}}var p,_,x;return h}function Ly(u,s){for(let h=0;h0&&I<0||w<0&&I>0}function Py(u,s,h){for(const D of h)for(let F=0;Fh[2]){const _=.5*p;let x=u[0]-h[0]>_?-p:h[0]-u[0]>_?p:0;x===0&&(x=u[0]-h[2]>_?-p:h[2]-u[0]>_?p:0),u[0]+=x}Sh(s,u)}function Ch(u,s,h,p){const _=Math.pow(2,p.z)*ul,x=[p.x*ul,p.y*ul],w=[];for(const I of u)for(const P of I){const D=[P.x+x[0],P.y+x[1]];Bm(D,s,h,_),w.push(D)}return w}function Vm(u,s,h,p){const _=Math.pow(2,p.z)*ul,x=[p.x*ul,p.y*ul],w=[];for(const P of u){const D=[];for(const F of P){const V=[F.x+x[0],F.y+x[1]];Sh(s,V),D.push(V)}w.push(D)}if(s[2]-s[0]<=_/2){(I=s)[0]=I[1]=1/0,I[2]=I[3]=-1/0;for(const P of w)for(const D of P)Bm(D,s,h,_)}var I;return w}class ql{constructor(s,h){this.type=pn,this.geojson=s,this.geometries=h}static parse(s,h){if(s.length!==2)return h.error(`'within' expression requires exactly one argument, but found ${s.length-1} instead.`);if(vh(s[1])){const p=s[1];if(p.type==="FeatureCollection"){const _=[];for(const x of p.features){const{type:w,coordinates:I}=x.geometry;w==="Polygon"&&_.push(I),w==="MultiPolygon"&&_.push(...I)}if(_.length)return new ql(p,{type:"MultiPolygon",coordinates:_})}else if(p.type==="Feature"){const _=p.geometry.type;if(_==="Polygon"||_==="MultiPolygon")return new ql(p,p.geometry)}else if(p.type==="Polygon"||p.type==="MultiPolygon")return new ql(p,p)}return h.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(s){if(s.geometry()!=null&&s.canonicalID()!=null){if(s.geometryType()==="Point")return function(h,p){const _=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],w=h.canonicalID();if(p.type==="Polygon"){const I=Ih(p.coordinates,x,w),P=Ch(h.geometry(),_,x,w);if(!Sc(_,x))return!1;for(const D of P)if(!Eh(D,I))return!1}if(p.type==="MultiPolygon"){const I=Fm(p.coordinates,x,w),P=Ch(h.geometry(),_,x,w);if(!Sc(_,x))return!1;for(const D of P)if(!Ly(D,I))return!1}return!0}(s,this.geometries);if(s.geometryType()==="LineString")return function(h,p){const _=[1/0,1/0,-1/0,-1/0],x=[1/0,1/0,-1/0,-1/0],w=h.canonicalID();if(p.type==="Polygon"){const I=Ih(p.coordinates,x,w),P=Vm(h.geometry(),_,x,w);if(!Sc(_,x))return!1;for(const D of P)if(!Om(D,I))return!1}if(p.type==="MultiPolygon"){const I=Fm(p.coordinates,x,w),P=Vm(h.geometry(),_,x,w);if(!Sc(_,x))return!1;for(const D of P)if(!zm(D,I))return!1}return!0}(s,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Th{constructor(s,h){this.type=h.type,this.name=s,this.boundExpression=h}static parse(s,h){if(s.length!==2||typeof s[1]!="string")return h.error("'var' expression requires exactly one string literal argument.");const p=s[1];return h.scope.has(p)?new Th(p,h.scope.get(p)):h.error(`Unknown variable "${p}". Make sure "${p}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(s){return this.boundExpression.evaluate(s)}eachChild(){}outputDefined(){return!1}}class Zo{constructor(s,h,p,_){this.name=s,this.type=h,this._evaluate=p,this.args=_}evaluate(s){return this._evaluate(s,this.args)}eachChild(s){this.args.forEach(s)}outputDefined(){return!1}static parse(s,h){const p=s[0],_=Zo.definitions[p];if(!_)return h.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0);const x=Array.isArray(_)?_[0]:_.type,w=Array.isArray(_)?[[_[1],_[2]]]:_.overloads,I=w.filter(([D])=>!Array.isArray(D)||D.length===s.length-1);let P=null;for(const[D,F]of I){P=new wh(h.registry,Ec,h.path,null,h.scope);const V=[];let H=!1;for(let Y=1;Y{return H=V,Array.isArray(H)?`(${H.map(le).join(", ")})`:`(${le(H.type)}...)`;var H}).join(" | "),F=[];for(let V=1;V{h=s?h&&Ec(p):h&&p instanceof ll}),!!h&&Lh(u)&&Cc(u,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Lh(u){if(u instanceof Zo&&(u.name==="get"&&u.args.length===1||u.name==="feature-state"||u.name==="has"&&u.args.length===1||u.name==="properties"||u.name==="geometry-type"||u.name==="id"||/^filter-/.test(u.name))||u instanceof ql)return!1;let s=!0;return u.eachChild(h=>{s&&!Lh(h)&&(s=!1)}),s}function Ic(u){if(u instanceof Zo&&u.name==="feature-state")return!1;let s=!0;return u.eachChild(h=>{s&&!Ic(h)&&(s=!1)}),s}function Cc(u,s){if(u instanceof Zo&&s.indexOf(u.name)>=0)return!1;let h=!0;return u.eachChild(p=>{h&&!Cc(p,s)&&(h=!1)}),h}function Tc(u,s){const h=u.length-1;let p,_,x=0,w=h,I=0;for(;x<=w;)if(I=Math.floor((x+w)/2),p=u[I],_=u[I+1],p<=s){if(I===h||s<_)return I;x=I+1}else{if(!(p>s))throw new Pr("Input is not a number.");w=I-1}return 0}class Lc{constructor(s,h,p){this.type=s,this.input=h,this.labels=[],this.outputs=[];for(const[_,x]of p)this.labels.push(_),this.outputs.push(x)}static parse(s,h){if(s.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return h.error("Expected an even number of arguments.");const p=h.parse(s[1],1,pt);if(!p)return null;const _=[];let x=null;h.expectedType&&h.expectedType.kind!=="value"&&(x=h.expectedType);for(let w=1;w=I)return h.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',D);const V=h.parse(P,F,x);if(!V)return null;x=x||V.type,_.push([I,V])}return new Lc(x,p,_)}evaluate(s){const h=this.labels,p=this.outputs;if(h.length===1)return p[0].evaluate(s);const _=this.input.evaluate(s);if(_<=h[0])return p[0].evaluate(s);const x=h.length;return _>=h[x-1]?p[x-1].evaluate(s):p[Tc(h,_)].evaluate(s)}eachChild(s){s(this.input);for(const h of this.outputs)s(h)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function My(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var ky=Um;function Um(u,s,h,p){this.cx=3*u,this.bx=3*(h-u)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*s,this.by=3*(p-s)-this.cy,this.ay=1-this.cy-this.by,this.p1x=u,this.p1y=s,this.p2x=h,this.p2y=p}Um.prototype={sampleCurveX:function(u){return((this.ax*u+this.bx)*u+this.cx)*u},sampleCurveY:function(u){return((this.ay*u+this.by)*u+this.cy)*u},sampleCurveDerivativeX:function(u){return(3*this.ax*u+2*this.bx)*u+this.cx},solveCurveX:function(u,s){if(s===void 0&&(s=1e-6),u<0)return 0;if(u>1)return 1;for(var h=u,p=0;p<8;p++){var _=this.sampleCurveX(h)-u;if(Math.abs(_)_?w=h:I=h,h=.5*(I-w)+w;return h},solve:function(u,s){return this.sampleCurveY(this.solveCurveX(u,s))}};var Ay=My(ky);function Wl(u,s,h){return u+h*(s-u)}function Ph(u,s,h){return u.map((p,_)=>Wl(p,s[_],h))}const mo={number:Wl,color:function(u,s,h,p="rgb"){switch(p){case"rgb":{const[_,x,w,I]=Ph(u.rgb,s.rgb,h);return new Qn(_,x,w,I,!1)}case"hcl":{const[_,x,w,I]=u.hcl,[P,D,F,V]=s.hcl;let H,Y;if(isNaN(_)||isNaN(P))isNaN(_)?isNaN(P)?H=NaN:(H=P,w!==1&&w!==0||(Y=D)):(H=_,F!==1&&F!==0||(Y=x));else{let Ne=P-_;P>_&&Ne>180?Ne-=360:P<_&&_-P>180&&(Ne+=360),H=_+h*Ne}const[J,ie,ge,we]=function([Ne,Ee,Ae,Qe]){return Ne=isNaN(Ne)?0:Ne*un,Or([Ae,Math.cos(Ne)*Ee,Math.sin(Ne)*Ee,Qe])}([H,Y??Wl(x,D,h),Wl(w,F,h),Wl(I,V,h)]);return new Qn(J,ie,ge,we,!1)}case"lab":{const[_,x,w,I]=Or(Ph(u.lab,s.lab,h));return new Qn(_,x,w,I,!1)}}},array:Ph,padding:function(u,s,h){return new Lo(Ph(u.values,s.values,h))},variableAnchorOffsetCollection:function(u,s,h){const p=u.values,_=s.values;if(p.length!==_.length)throw new Pr(`Cannot interpolate values of different length. from: ${u.toString()}, to: ${s.toString()}`);const x=[];for(let w=0;wtypeof F!="number"||F<0||F>1))return h.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:D}}}if(s.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if((s.length-1)%2!=0)return h.error("Expected an even number of arguments.");if(x=h.parse(x,2,pt),!x)return null;const I=[];let P=null;p==="interpolate-hcl"||p==="interpolate-lab"?P=Zr:h.expectedType&&h.expectedType.kind!=="value"&&(P=h.expectedType);for(let D=0;D=F)return h.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',H);const J=h.parse(V,Y,P);if(!J)return null;P=P||J.type,I.push([F,J])}return Re(P,pt)||Re(P,Zr)||Re(P,_e)||Re(P,X)||Re(P,Q(pt))?new Ki(P,p,_,x,I):h.error(`Type ${le(P)} is not interpolatable.`)}evaluate(s){const h=this.labels,p=this.outputs;if(h.length===1)return p[0].evaluate(s);const _=this.input.evaluate(s);if(_<=h[0])return p[0].evaluate(s);const x=h.length;if(_>=h[x-1])return p[x-1].evaluate(s);const w=Tc(h,_),I=Ki.interpolationFactor(this.interpolation,_,h[w],h[w+1]),P=p[w].evaluate(s),D=p[w+1].evaluate(s);switch(this.operator){case"interpolate":return mo[this.type.kind](P,D,I);case"interpolate-hcl":return mo.color(P,D,I,"hcl");case"interpolate-lab":return mo.color(P,D,I,"lab")}}eachChild(s){s(this.input);for(const h of this.outputs)s(h)}outputDefined(){return this.outputs.every(s=>s.outputDefined())}}function Zn(u,s,h,p){const _=p-h,x=u-h;return _===0?0:s===1?x/_:(Math.pow(s,x)-1)/(Math.pow(s,_)-1)}class Mh{constructor(s,h){this.type=s,this.args=h}static parse(s,h){if(s.length<2)return h.error("Expectected at least one argument.");let p=null;const _=h.expectedType;_&&_.kind!=="value"&&(p=_);const x=[];for(const I of s.slice(1)){const P=h.parse(I,1+x.length,p,void 0,{typeAnnotation:"omit"});if(!P)return null;p=p||P.type,x.push(P)}if(!p)throw new Error("No output type");const w=_&&x.some(I=>ee(_,I.type));return new Mh(w?fn:p,x)}evaluate(s){let h,p=null,_=0;for(const x of this.args)if(_++,p=x.evaluate(s),p&&p instanceof ds&&!p.available&&(h||(h=p.name),p=null,_===this.args.length&&(p=h)),p!==null)break;return p}eachChild(s){this.args.forEach(s)}outputDefined(){return this.args.every(s=>s.outputDefined())}}class kh{constructor(s,h){this.type=h.type,this.bindings=[].concat(s),this.result=h}evaluate(s){return this.result.evaluate(s)}eachChild(s){for(const h of this.bindings)s(h[1]);s(this.result)}static parse(s,h){if(s.length<4)return h.error(`Expected at least 3 arguments, but found ${s.length-1} instead.`);const p=[];for(let x=1;x=p.length)throw new Pr(`Array index out of bounds: ${h} > ${p.length-1}.`);if(h!==Math.floor(h))throw new Pr(`Array index must be an integer, but found ${h} instead.`);return p[h]}eachChild(s){s(this.index),s(this.input)}outputDefined(){return!1}}class Cp{constructor(s,h){this.type=pn,this.needle=s,this.haystack=h}static parse(s,h){if(s.length!==3)return h.error(`Expected 2 arguments, but found ${s.length-1} instead.`);const p=h.parse(s[1],1,fn),_=h.parse(s[2],2,fn);return p&&_?Me(p.type,[pn,mn,pt,li,fn])?new Cp(p,_):h.error(`Expected first argument to be of type boolean, string, number or null, but found ${le(p.type)} instead`):null}evaluate(s){const h=this.needle.evaluate(s),p=this.haystack.evaluate(s);if(!p)return!1;if(!Se(h,["boolean","string","number","null"]))throw new Pr(`Expected first argument to be of type boolean, string, number or null, but found ${le(ci(h))} instead.`);if(!Se(p,["string","array"]))throw new Pr(`Expected second argument to be of type array or string, but found ${le(ci(p))} instead.`);return p.indexOf(h)>=0}eachChild(s){s(this.needle),s(this.haystack)}outputDefined(){return!0}}class Ah{constructor(s,h,p){this.type=pt,this.needle=s,this.haystack=h,this.fromIndex=p}static parse(s,h){if(s.length<=2||s.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const p=h.parse(s[1],1,fn),_=h.parse(s[2],2,fn);if(!p||!_)return null;if(!Me(p.type,[pn,mn,pt,li,fn]))return h.error(`Expected first argument to be of type boolean, string, number or null, but found ${le(p.type)} instead`);if(s.length===4){const x=h.parse(s[3],3,pt);return x?new Ah(p,_,x):null}return new Ah(p,_)}evaluate(s){const h=this.needle.evaluate(s),p=this.haystack.evaluate(s);if(!Se(h,["boolean","string","number","null"]))throw new Pr(`Expected first argument to be of type boolean, string, number or null, but found ${le(ci(h))} instead.`);if(!Se(p,["string","array"]))throw new Pr(`Expected second argument to be of type array or string, but found ${le(ci(p))} instead.`);if(this.fromIndex){const _=this.fromIndex.evaluate(s);return p.indexOf(h,_)}return p.indexOf(h)}eachChild(s){s(this.needle),s(this.haystack),this.fromIndex&&s(this.fromIndex)}outputDefined(){return!1}}class Tp{constructor(s,h,p,_,x,w){this.inputType=s,this.type=h,this.input=p,this.cases=_,this.outputs=x,this.otherwise=w}static parse(s,h){if(s.length<5)return h.error(`Expected at least 4 arguments, but found only ${s.length-1}.`);if(s.length%2!=1)return h.error("Expected an even number of arguments.");let p,_;h.expectedType&&h.expectedType.kind!=="value"&&(_=h.expectedType);const x={},w=[];for(let D=2;DNumber.MAX_SAFE_INTEGER)return H.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof J=="number"&&Math.floor(J)!==J)return H.error("Numeric branch labels must be integer values.");if(p){if(H.checkSubtype(p,ci(J)))return null}else p=ci(J);if(x[String(J)]!==void 0)return H.error("Branch labels must be unique.");x[String(J)]=w.length}const Y=h.parse(V,D,_);if(!Y)return null;_=_||Y.type,w.push(Y)}const I=h.parse(s[1],1,fn);if(!I)return null;const P=h.parse(s[s.length-1],s.length-1,_);return P?I.type.kind!=="value"&&h.concat(1).checkSubtype(p,I.type)?null:new Tp(p,_,I,x,w,P):null}evaluate(s){const h=this.input.evaluate(s);return(ci(h)===this.inputType&&this.outputs[this.cases[h]]||this.otherwise).evaluate(s)}eachChild(s){s(this.input),this.outputs.forEach(s),s(this.otherwise)}outputDefined(){return this.outputs.every(s=>s.outputDefined())&&this.otherwise.outputDefined()}}class Lp{constructor(s,h,p){this.type=s,this.branches=h,this.otherwise=p}static parse(s,h){if(s.length<4)return h.error(`Expected at least 3 arguments, but found only ${s.length-1}.`);if(s.length%2!=0)return h.error("Expected an odd number of arguments.");let p;h.expectedType&&h.expectedType.kind!=="value"&&(p=h.expectedType);const _=[];for(let w=1;wh.outputDefined())&&this.otherwise.outputDefined()}}class Dh{constructor(s,h,p,_){this.type=s,this.input=h,this.beginIndex=p,this.endIndex=_}static parse(s,h){if(s.length<=2||s.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${s.length-1} instead.`);const p=h.parse(s[1],1,fn),_=h.parse(s[2],2,pt);if(!p||!_)return null;if(!Me(p.type,[Q(fn),mn,fn]))return h.error(`Expected first argument to be of type array or string, but found ${le(p.type)} instead`);if(s.length===4){const x=h.parse(s[3],3,pt);return x?new Dh(p.type,p,_,x):null}return new Dh(p.type,p,_)}evaluate(s){const h=this.input.evaluate(s),p=this.beginIndex.evaluate(s);if(!Se(h,["string","array"]))throw new Pr(`Expected first argument to be of type array or string, but found ${le(ci(h))} instead.`);if(this.endIndex){const _=this.endIndex.evaluate(s);return h.slice(p,_)}return h.slice(p)}eachChild(s){s(this.input),s(this.beginIndex),this.endIndex&&s(this.endIndex)}outputDefined(){return!1}}function jm(u,s){return u==="=="||u==="!="?s.kind==="boolean"||s.kind==="string"||s.kind==="number"||s.kind==="null"||s.kind==="value":s.kind==="string"||s.kind==="number"||s.kind==="value"}function Gm(u,s,h,p){return p.compare(s,h)===0}function Lu(u,s,h){const p=u!=="=="&&u!=="!=";return class JE{constructor(x,w,I){this.type=pn,this.lhs=x,this.rhs=w,this.collator=I,this.hasUntypedArgument=x.type.kind==="value"||w.type.kind==="value"}static parse(x,w){if(x.length!==3&&x.length!==4)return w.error("Expected two or three arguments.");const I=x[0];let P=w.parse(x[1],1,fn);if(!P)return null;if(!jm(I,P.type))return w.concat(1).error(`"${I}" comparisons are not supported for type '${le(P.type)}'.`);let D=w.parse(x[2],2,fn);if(!D)return null;if(!jm(I,D.type))return w.concat(2).error(`"${I}" comparisons are not supported for type '${le(D.type)}'.`);if(P.type.kind!==D.type.kind&&P.type.kind!=="value"&&D.type.kind!=="value")return w.error(`Cannot compare types '${le(P.type)}' and '${le(D.type)}'.`);p&&(P.type.kind==="value"&&D.type.kind!=="value"?P=new Ho(D.type,[P]):P.type.kind!=="value"&&D.type.kind==="value"&&(D=new Ho(P.type,[D])));let F=null;if(x.length===4){if(P.type.kind!=="string"&&D.type.kind!=="string"&&P.type.kind!=="value"&&D.type.kind!=="value")return w.error("Cannot use collator to compare non-string types.");if(F=w.parse(x[3],3,za),!F)return null}return new JE(P,D,F)}evaluate(x){const w=this.lhs.evaluate(x),I=this.rhs.evaluate(x);if(p&&this.hasUntypedArgument){const P=ci(w),D=ci(I);if(P.kind!==D.kind||P.kind!=="string"&&P.kind!=="number")throw new Pr(`Expected arguments for "${u}" to be (string, string) or (number, number), but found (${P.kind}, ${D.kind}) instead.`)}if(this.collator&&!p&&this.hasUntypedArgument){const P=ci(w),D=ci(I);if(P.kind!=="string"||D.kind!=="string")return s(x,w,I)}return this.collator?h(x,w,I,this.collator.evaluate(x)):s(x,w,I)}eachChild(x){x(this.lhs),x(this.rhs),this.collator&&x(this.collator)}outputDefined(){return!0}}}const Dy=Lu("==",function(u,s,h){return s===h},Gm),Ry=Lu("!=",function(u,s,h){return s!==h},function(u,s,h,p){return!Gm(0,s,h,p)}),Ny=Lu("<",function(u,s,h){return s",function(u,s,h){return s>h},function(u,s,h,p){return p.compare(s,h)>0}),zy=Lu("<=",function(u,s,h){return s<=h},function(u,s,h,p){return p.compare(s,h)<=0}),Fy=Lu(">=",function(u,s,h){return s>=h},function(u,s,h,p){return p.compare(s,h)>=0});class Pp{constructor(s,h,p,_,x){this.type=mn,this.number=s,this.locale=h,this.currency=p,this.minFractionDigits=_,this.maxFractionDigits=x}static parse(s,h){if(s.length!==3)return h.error("Expected two arguments.");const p=h.parse(s[1],1,pt);if(!p)return null;const _=s[2];if(typeof _!="object"||Array.isArray(_))return h.error("NumberFormat options argument must be an object.");let x=null;if(_.locale&&(x=h.parse(_.locale,1,mn),!x))return null;let w=null;if(_.currency&&(w=h.parse(_.currency,1,mn),!w))return null;let I=null;if(_["min-fraction-digits"]&&(I=h.parse(_["min-fraction-digits"],1,pt),!I))return null;let P=null;return _["max-fraction-digits"]&&(P=h.parse(_["max-fraction-digits"],1,pt),!P)?null:new Pp(p,x,w,I,P)}evaluate(s){return new Intl.NumberFormat(this.locale?this.locale.evaluate(s):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(s):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(s):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(s):void 0}).format(this.number.evaluate(s))}eachChild(s){s(this.number),this.locale&&s(this.locale),this.currency&&s(this.currency),this.minFractionDigits&&s(this.minFractionDigits),this.maxFractionDigits&&s(this.maxFractionDigits)}outputDefined(){return!1}}class Rh{constructor(s){this.type=Jr,this.sections=s}static parse(s,h){if(s.length<2)return h.error("Expected at least one argument.");const p=s[1];if(!Array.isArray(p)&&typeof p=="object")return h.error("First argument must be an image or text section.");const _=[];let x=!1;for(let w=1;w<=s.length-1;++w){const I=s[w];if(x&&typeof I=="object"&&!Array.isArray(I)){x=!1;let P=null;if(I["font-scale"]&&(P=h.parse(I["font-scale"],1,pt),!P))return null;let D=null;if(I["text-font"]&&(D=h.parse(I["text-font"],1,Q(mn)),!D))return null;let F=null;if(I["text-color"]&&(F=h.parse(I["text-color"],1,Zr),!F))return null;const V=_[_.length-1];V.scale=P,V.font=D,V.textColor=F}else{const P=h.parse(s[w],1,fn);if(!P)return null;const D=P.type.kind;if(D!=="string"&&D!=="value"&&D!=="null"&&D!=="resolvedImage")return h.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");x=!0,_.push({content:P,scale:null,font:null,textColor:null})}}return new Rh(_)}evaluate(s){return new Wo(this.sections.map(h=>{const p=h.content.evaluate(s);return ci(p)===W?new Ep("",p,null,null,null):new Ep(xc(p),null,h.scale?h.scale.evaluate(s):null,h.font?h.font.evaluate(s).join(","):null,h.textColor?h.textColor.evaluate(s):null)}))}eachChild(s){for(const h of this.sections)s(h.content),h.scale&&s(h.scale),h.font&&s(h.font),h.textColor&&s(h.textColor)}outputDefined(){return!1}}class Mp{constructor(s){this.type=W,this.input=s}static parse(s,h){if(s.length!==2)return h.error("Expected two arguments.");const p=h.parse(s[1],1,mn);return p?new Mp(p):h.error("No image name provided.")}evaluate(s){const h=this.input.evaluate(s),p=ds.fromString(h);return p&&s.availableImages&&(p.available=s.availableImages.indexOf(h)>-1),p}eachChild(s){s(this.input)}outputDefined(){return!1}}class kp{constructor(s){this.type=pt,this.input=s}static parse(s,h){if(s.length!==2)return h.error(`Expected 1 argument, but found ${s.length-1} instead.`);const p=h.parse(s[1],1);return p?p.type.kind!=="array"&&p.type.kind!=="string"&&p.type.kind!=="value"?h.error(`Expected argument of type string or array, but found ${le(p.type)} instead.`):new kp(p):null}evaluate(s){const h=this.input.evaluate(s);if(typeof h=="string"||Array.isArray(h))return h.length;throw new Pr(`Expected value to be of type string or array, but found ${le(ci(h))} instead.`)}eachChild(s){s(this.input)}outputDefined(){return!1}}const Pu={"==":Dy,"!=":Ry,">":Oy,"<":Ny,">=":Fy,"<=":zy,array:Ho,at:Ip,boolean:Ho,case:Lp,coalesce:Mh,collator:Tu,format:Rh,image:Mp,in:Cp,"index-of":Ah,interpolate:Ki,"interpolate-hcl":Ki,"interpolate-lab":Ki,length:kp,let:kh,literal:ll,match:Tp,number:Ho,"number-format":Pp,object:Ho,slice:Dh,step:Lc,string:Ho,"to-boolean":ea,"to-color":ea,"to-number":ea,"to-string":ea,var:Th,within:ql};function qm(u,[s,h,p,_]){s=s.evaluate(u),h=h.evaluate(u),p=p.evaluate(u);const x=_?_.evaluate(u):1,w=Cu(s,h,p,x);if(w)throw new Pr(w);return new Qn(s/255,h/255,p/255,x,!1)}function Wm(u,s){return u in s}function Ap(u,s){const h=s[u];return h===void 0?null:h}function Hl(u){return{type:u}}function Hm(u){return{result:"success",value:u}}function Mu(u){return{result:"error",value:u}}function ku(u){return u["property-type"]==="data-driven"||u["property-type"]==="cross-faded-data-driven"}function Zm(u){return!!u.expression&&u.expression.parameters.indexOf("zoom")>-1}function Dp(u){return!!u.expression&&u.expression.interpolated}function Un(u){return u instanceof Number?"number":u instanceof String?"string":u instanceof Boolean?"boolean":Array.isArray(u)?"array":u===null?"null":typeof u}function Nh(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)}function By(u){return u}function Xm(u,s){const h=s.type==="color",p=u.stops&&typeof u.stops[0][0]=="object",_=p||!(p||u.property!==void 0),x=u.type||(Dp(s)?"exponential":"interval");if(h||s.type==="padding"){const F=h?Qn.parse:Lo.parse;(u=hs({},u)).stops&&(u.stops=u.stops.map(V=>[V[0],F(V[1])])),u.default=F(u.default?u.default:s.default)}if(u.colorSpace&&(w=u.colorSpace)!=="rgb"&&w!=="hcl"&&w!=="lab")throw new Error(`Unknown color space: "${u.colorSpace}"`);var w;let I,P,D;if(x==="exponential")I=zn;else if(x==="interval")I=Vy;else if(x==="categorical"){I=Qr,P=Object.create(null);for(const F of u.stops)P[F[0]]=F[1];D=typeof u.stops[0][0]}else{if(x!=="identity")throw new Error(`Unknown function type "${x}"`);I=Rp}if(p){const F={},V=[];for(let J=0;JJ[0]),evaluate:({zoom:J},ie)=>zn({stops:H,base:u.base},s,J).evaluate(J,ie)}}if(_){const F=x==="exponential"?{name:"exponential",base:u.base!==void 0?u.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:Ki.interpolationFactor.bind(void 0,F),zoomStops:u.stops.map(V=>V[0]),evaluate:({zoom:V})=>I(u,s,V,P,D)}}return{kind:"source",evaluate(F,V){const H=V&&V.properties?V.properties[u.property]:void 0;return H===void 0?Pc(u.default,s.default):I(u,s,H,P,D)}}}function Pc(u,s,h){return u!==void 0?u:s!==void 0?s:h!==void 0?h:void 0}function Qr(u,s,h,p,_){return Pc(typeof h===_?p[h]:void 0,u.default,s.default)}function Vy(u,s,h){if(Un(h)!=="number")return Pc(u.default,s.default);const p=u.stops.length;if(p===1||h<=u.stops[0][0])return u.stops[0][1];if(h>=u.stops[p-1][0])return u.stops[p-1][1];const _=Tc(u.stops.map(x=>x[0]),h);return u.stops[_][1]}function zn(u,s,h){const p=u.base!==void 0?u.base:1;if(Un(h)!=="number")return Pc(u.default,s.default);const _=u.stops.length;if(_===1||h<=u.stops[0][0])return u.stops[0][1];if(h>=u.stops[_-1][0])return u.stops[_-1][1];const x=Tc(u.stops.map(F=>F[0]),h),w=function(F,V,H,Y){const J=Y-H,ie=F-H;return J===0?0:V===1?ie/J:(Math.pow(V,ie)-1)/(Math.pow(V,J)-1)}(h,p,u.stops[x][0],u.stops[x+1][0]),I=u.stops[x][1],P=u.stops[x+1][1],D=mo[s.type]||By;return typeof I.evaluate=="function"?{evaluate(...F){const V=I.evaluate.apply(void 0,F),H=P.evaluate.apply(void 0,F);if(V!==void 0&&H!==void 0)return D(V,H,w,u.colorSpace)}}:D(I,P,w,u.colorSpace)}function Rp(u,s,h){switch(s.type){case"color":h=Qn.parse(h);break;case"formatted":h=Wo.fromString(h.toString());break;case"resolvedImage":h=ds.fromString(h.toString());break;case"padding":h=Lo.parse(h);break;default:Un(h)===s.type||s.type==="enum"&&s.values[h]||(h=void 0)}return Pc(h,u.default,s.default)}Zo.register(Pu,{error:[{kind:"error"},[mn],(u,[s])=>{throw new Pr(s.evaluate(u))}],typeof:[mn,[fn],(u,[s])=>le(ci(s.evaluate(u)))],"to-rgba":[Q(pt,4),[Zr],(u,[s])=>{const[h,p,_,x]=s.evaluate(u).rgb;return[255*h,255*p,255*_,x]}],rgb:[Zr,[pt,pt,pt],qm],rgba:[Zr,[pt,pt,pt,pt],qm],has:{type:pn,overloads:[[[mn],(u,[s])=>Wm(s.evaluate(u),u.properties())],[[mn,fs],(u,[s,h])=>Wm(s.evaluate(u),h.evaluate(u))]]},get:{type:fn,overloads:[[[mn],(u,[s])=>Ap(s.evaluate(u),u.properties())],[[mn,fs],(u,[s,h])=>Ap(s.evaluate(u),h.evaluate(u))]]},"feature-state":[fn,[mn],(u,[s])=>Ap(s.evaluate(u),u.featureState||{})],properties:[fs,[],u=>u.properties()],"geometry-type":[mn,[],u=>u.geometryType()],id:[fn,[],u=>u.id()],zoom:[pt,[],u=>u.globals.zoom],"heatmap-density":[pt,[],u=>u.globals.heatmapDensity||0],"line-progress":[pt,[],u=>u.globals.lineProgress||0],accumulated:[fn,[],u=>u.globals.accumulated===void 0?null:u.globals.accumulated],"+":[pt,Hl(pt),(u,s)=>{let h=0;for(const p of s)h+=p.evaluate(u);return h}],"*":[pt,Hl(pt),(u,s)=>{let h=1;for(const p of s)h*=p.evaluate(u);return h}],"-":{type:pt,overloads:[[[pt,pt],(u,[s,h])=>s.evaluate(u)-h.evaluate(u)],[[pt],(u,[s])=>-s.evaluate(u)]]},"/":[pt,[pt,pt],(u,[s,h])=>s.evaluate(u)/h.evaluate(u)],"%":[pt,[pt,pt],(u,[s,h])=>s.evaluate(u)%h.evaluate(u)],ln2:[pt,[],()=>Math.LN2],pi:[pt,[],()=>Math.PI],e:[pt,[],()=>Math.E],"^":[pt,[pt,pt],(u,[s,h])=>Math.pow(s.evaluate(u),h.evaluate(u))],sqrt:[pt,[pt],(u,[s])=>Math.sqrt(s.evaluate(u))],log10:[pt,[pt],(u,[s])=>Math.log(s.evaluate(u))/Math.LN10],ln:[pt,[pt],(u,[s])=>Math.log(s.evaluate(u))],log2:[pt,[pt],(u,[s])=>Math.log(s.evaluate(u))/Math.LN2],sin:[pt,[pt],(u,[s])=>Math.sin(s.evaluate(u))],cos:[pt,[pt],(u,[s])=>Math.cos(s.evaluate(u))],tan:[pt,[pt],(u,[s])=>Math.tan(s.evaluate(u))],asin:[pt,[pt],(u,[s])=>Math.asin(s.evaluate(u))],acos:[pt,[pt],(u,[s])=>Math.acos(s.evaluate(u))],atan:[pt,[pt],(u,[s])=>Math.atan(s.evaluate(u))],min:[pt,Hl(pt),(u,s)=>Math.min(...s.map(h=>h.evaluate(u)))],max:[pt,Hl(pt),(u,s)=>Math.max(...s.map(h=>h.evaluate(u)))],abs:[pt,[pt],(u,[s])=>Math.abs(s.evaluate(u))],round:[pt,[pt],(u,[s])=>{const h=s.evaluate(u);return h<0?-Math.round(-h):Math.round(h)}],floor:[pt,[pt],(u,[s])=>Math.floor(s.evaluate(u))],ceil:[pt,[pt],(u,[s])=>Math.ceil(s.evaluate(u))],"filter-==":[pn,[mn,fn],(u,[s,h])=>u.properties()[s.value]===h.value],"filter-id-==":[pn,[fn],(u,[s])=>u.id()===s.value],"filter-type-==":[pn,[mn],(u,[s])=>u.geometryType()===s.value],"filter-<":[pn,[mn,fn],(u,[s,h])=>{const p=u.properties()[s.value],_=h.value;return typeof p==typeof _&&p<_}],"filter-id-<":[pn,[fn],(u,[s])=>{const h=u.id(),p=s.value;return typeof h==typeof p&&h":[pn,[mn,fn],(u,[s,h])=>{const p=u.properties()[s.value],_=h.value;return typeof p==typeof _&&p>_}],"filter-id->":[pn,[fn],(u,[s])=>{const h=u.id(),p=s.value;return typeof h==typeof p&&h>p}],"filter-<=":[pn,[mn,fn],(u,[s,h])=>{const p=u.properties()[s.value],_=h.value;return typeof p==typeof _&&p<=_}],"filter-id-<=":[pn,[fn],(u,[s])=>{const h=u.id(),p=s.value;return typeof h==typeof p&&h<=p}],"filter->=":[pn,[mn,fn],(u,[s,h])=>{const p=u.properties()[s.value],_=h.value;return typeof p==typeof _&&p>=_}],"filter-id->=":[pn,[fn],(u,[s])=>{const h=u.id(),p=s.value;return typeof h==typeof p&&h>=p}],"filter-has":[pn,[fn],(u,[s])=>s.value in u.properties()],"filter-has-id":[pn,[],u=>u.id()!==null&&u.id()!==void 0],"filter-type-in":[pn,[Q(mn)],(u,[s])=>s.value.indexOf(u.geometryType())>=0],"filter-id-in":[pn,[Q(fn)],(u,[s])=>s.value.indexOf(u.id())>=0],"filter-in-small":[pn,[mn,Q(fn)],(u,[s,h])=>h.value.indexOf(u.properties()[s.value])>=0],"filter-in-large":[pn,[mn,Q(fn)],(u,[s,h])=>function(p,_,x,w){for(;x<=w;){const I=x+w>>1;if(_[I]===p)return!0;_[I]>p?w=I-1:x=I+1}return!1}(u.properties()[s.value],h.value,0,h.value.length-1)],all:{type:pn,overloads:[[[pn,pn],(u,[s,h])=>s.evaluate(u)&&h.evaluate(u)],[Hl(pn),(u,s)=>{for(const h of s)if(!h.evaluate(u))return!1;return!0}]]},any:{type:pn,overloads:[[[pn,pn],(u,[s,h])=>s.evaluate(u)||h.evaluate(u)],[Hl(pn),(u,s)=>{for(const h of s)if(h.evaluate(u))return!0;return!1}]]},"!":[pn,[pn],(u,[s])=>!s.evaluate(u)],"is-supported-script":[pn,[mn],(u,[s])=>{const h=u.globals&&u.globals.isSupportedScript;return!h||h(s.evaluate(u))}],upcase:[mn,[mn],(u,[s])=>s.evaluate(u).toUpperCase()],downcase:[mn,[mn],(u,[s])=>s.evaluate(u).toLowerCase()],concat:[mn,Hl(fn),(u,s)=>s.map(h=>xc(h.evaluate(u))).join("")],"resolved-locale":[mn,[za],(u,[s])=>s.evaluate(u).resolvedLocale()]});class br{constructor(s,h){var p;this.expression=s,this._warningHistory={},this._evaluator=new er,this._defaultValue=h?(p=h).type==="color"&&Nh(p.default)?new Qn(0,0,0,0):p.type==="color"?Qn.parse(p.default)||null:p.type==="padding"?Lo.parse(p.default)||null:p.type==="variableAnchorOffsetCollection"?ps.parse(p.default)||null:p.default===void 0?null:p.default:null,this._enumValues=h&&h.type==="enum"?h.values:null}evaluateWithoutErrorHandling(s,h,p,_,x,w){return this._evaluator.globals=s,this._evaluator.feature=h,this._evaluator.featureState=p,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=w,this.expression.evaluate(this._evaluator)}evaluate(s,h,p,_,x,w){this._evaluator.globals=s,this._evaluator.feature=h||null,this._evaluator.featureState=p||null,this._evaluator.canonical=_,this._evaluator.availableImages=x||null,this._evaluator.formattedSection=w||null;try{const I=this.expression.evaluate(this._evaluator);if(I==null||typeof I=="number"&&I!=I)return this._defaultValue;if(this._enumValues&&!(I in this._enumValues))throw new Pr(`Expected value to be one of ${Object.keys(this._enumValues).map(P=>JSON.stringify(P)).join(", ")}, but found ${JSON.stringify(I)} instead.`);return I}catch(I){return this._warningHistory[I.message]||(this._warningHistory[I.message]=!0,typeof console<"u"&&console.warn(I.message)),this._defaultValue}}}function ur(u){return Array.isArray(u)&&u.length>0&&typeof u[0]=="string"&&u[0]in Pu}function Zl(u,s){const h=new wh(Pu,Ec,[],s?function(_){const x={color:Zr,string:mn,number:pt,enum:mn,boolean:pn,formatted:Jr,padding:_e,resolvedImage:W,variableAnchorOffsetCollection:X};return _.type==="array"?Q(x[_.value]||fn,_.length):x[_.type]}(s):void 0),p=h.parse(u,void 0,void 0,void 0,s&&s.type==="string"?{typeAnnotation:"coerce"}:void 0);return p?Hm(new br(p,s)):Mu(h.errors)}class Oh{constructor(s,h){this.kind=s,this._styleExpression=h,this.isStateDependent=s!=="constant"&&!Ic(h.expression)}evaluateWithoutErrorHandling(s,h,p,_,x,w){return this._styleExpression.evaluateWithoutErrorHandling(s,h,p,_,x,w)}evaluate(s,h,p,_,x,w){return this._styleExpression.evaluate(s,h,p,_,x,w)}}class Np{constructor(s,h,p,_){this.kind=s,this.zoomStops=p,this._styleExpression=h,this.isStateDependent=s!=="camera"&&!Ic(h.expression),this.interpolationType=_}evaluateWithoutErrorHandling(s,h,p,_,x,w){return this._styleExpression.evaluateWithoutErrorHandling(s,h,p,_,x,w)}evaluate(s,h,p,_,x,w){return this._styleExpression.evaluate(s,h,p,_,x,w)}interpolationFactor(s,h,p){return this.interpolationType?Ki.interpolationFactor(this.interpolationType,s,h,p):0}}function Ym(u,s){const h=Zl(u,s);if(h.result==="error")return h;const p=h.value.expression,_=Lh(p);if(!_&&!ku(s))return Mu([new fo("","data expressions not supported")]);const x=Cc(p,["zoom"]);if(!x&&!Zm(s))return Mu([new fo("","zoom expressions not supported")]);const w=Fh(p);return w||x?w instanceof fo?Mu([w]):w instanceof Ki&&!Dp(s)?Mu([new fo("",'"interpolate" expressions cannot be used with this property')]):Hm(w?new Np(_?"camera":"composite",h.value,w.labels,w instanceof Ki?w.interpolation:void 0):new Oh(_?"constant":"source",h.value)):Mu([new fo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class zh{constructor(s,h){this._parameters=s,this._specification=h,hs(this,Xm(this._parameters,this._specification))}static deserialize(s){return new zh(s._parameters,s._specification)}static serialize(s){return{_parameters:s._parameters,_specification:s._specification}}}function Fh(u){let s=null;if(u instanceof kh)s=Fh(u.result);else if(u instanceof Mh){for(const h of u.args)if(s=Fh(h),s)break}else(u instanceof Lc||u instanceof Ki)&&u.input instanceof Zo&&u.input.name==="zoom"&&(s=u);return s instanceof fo||u.eachChild(h=>{const p=Fh(h);p instanceof fo?s=p:!s&&p?s=new fo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&p&&s!==p&&(s=new fo("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}function Bh(u){if(u===!0||u===!1)return!0;if(!Array.isArray(u)||u.length===0)return!1;switch(u[0]){case"has":return u.length>=2&&u[1]!=="$id"&&u[1]!=="$type";case"in":return u.length>=3&&(typeof u[1]!="string"||Array.isArray(u[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return u.length!==3||Array.isArray(u[1])||Array.isArray(u[2]);case"any":case"all":for(const s of u.slice(1))if(!Bh(s)&&typeof s!="boolean")return!1;return!0;default:return!0}}const $m={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Vh(u){if(u==null)return{filter:()=>!0,needGeometry:!1};Bh(u)||(u=jh(u));const s=Zl(u,$m);if(s.result==="error")throw new Error(s.value.map(h=>`${h.key}: ${h.message}`).join(", "));return{filter:(h,p,_)=>s.value.evaluate(h,p,{},_),needGeometry:Uh(u)}}function Km(u,s){return us?1:0}function Uh(u){if(!Array.isArray(u))return!1;if(u[0]==="within")return!0;for(let s=1;s"||s==="<="||s===">="?Op(u[1],u[2],s):s==="any"?(h=u.slice(1),["any"].concat(h.map(jh))):s==="all"?["all"].concat(u.slice(1).map(jh)):s==="none"?["all"].concat(u.slice(1).map(jh).map(Gh)):s==="in"?Jm(u[1],u.slice(2)):s==="!in"?Gh(Jm(u[1],u.slice(2))):s==="has"?Qm(u[1]):s==="!has"?Gh(Qm(u[1])):s!=="within"||u;var h}function Op(u,s,h){switch(u){case"$type":return[`filter-type-${h}`,s];case"$id":return[`filter-id-${h}`,s];default:return[`filter-${h}`,u,s]}}function Jm(u,s){if(s.length===0)return!1;switch(u){case"$type":return["filter-type-in",["literal",s]];case"$id":return["filter-id-in",["literal",s]];default:return s.length>200&&!s.some(h=>typeof h!=typeof s[0])?["filter-in-large",u,["literal",s.sort(Km)]]:["filter-in-small",u,["literal",s]]}}function Qm(u){switch(u){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",u]}}function Gh(u){return["!",u]}function zp(u){const s=typeof u;if(s==="number"||s==="boolean"||s==="string"||u==null)return JSON.stringify(u);if(Array.isArray(u)){let _="[";for(const x of u)_+=`${zp(x)},`;return`${_}]`}const h=Object.keys(u).sort();let p="{";for(let _=0;_p.maximum?[new lt(s,h,`${h} is greater than the maximum value ${p.maximum}`)]:[]}function tg(u){const s=u.valueSpec,h=zr(u.value.type);let p,_,x,w={};const I=h!=="categorical"&&u.value.property===void 0,P=!I,D=Un(u.value.stops)==="array"&&Un(u.value.stops[0])==="array"&&Un(u.value.stops[0][0])==="object",F=go({key:u.key,value:u.value,valueSpec:u.styleSpec.function,validateSpec:u.validateSpec,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{stops:function(Y){if(h==="identity")return[new lt(Y.key,Y.value,'identity function may not have a "stops" property')];let J=[];const ie=Y.value;return J=J.concat(Fp({key:Y.key,value:ie,valueSpec:Y.valueSpec,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,arrayElementValidator:V})),Un(ie)==="array"&&ie.length===0&&J.push(new lt(Y.key,ie,"array must have at least one stop")),J},default:function(Y){return Y.validateSpec({key:Y.key,value:Y.value,valueSpec:s,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec})}}});return h==="identity"&&I&&F.push(new lt(u.key,u.value,'missing required property "property"')),h==="identity"||u.value.stops||F.push(new lt(u.key,u.value,'missing required property "stops"')),h==="exponential"&&u.valueSpec.expression&&!Dp(u.valueSpec)&&F.push(new lt(u.key,u.value,"exponential functions not supported")),u.styleSpec.$version>=8&&(P&&!ku(u.valueSpec)?F.push(new lt(u.key,u.value,"property functions not supported")):I&&!Zm(u.valueSpec)&&F.push(new lt(u.key,u.value,"zoom functions not supported"))),h!=="categorical"&&!D||u.value.property!==void 0||F.push(new lt(u.key,u.value,'"property" property is required')),F;function V(Y){let J=[];const ie=Y.value,ge=Y.key;if(Un(ie)!=="array")return[new lt(ge,ie,`array expected, ${Un(ie)} found`)];if(ie.length!==2)return[new lt(ge,ie,`array length 2 expected, length ${ie.length} found`)];if(D){if(Un(ie[0])!=="object")return[new lt(ge,ie,`object expected, ${Un(ie[0])} found`)];if(ie[0].zoom===void 0)return[new lt(ge,ie,"object stop key must have zoom")];if(ie[0].value===void 0)return[new lt(ge,ie,"object stop key must have value")];if(x&&x>zr(ie[0].zoom))return[new lt(ge,ie[0].zoom,"stop zoom values must appear in ascending order")];zr(ie[0].zoom)!==x&&(x=zr(ie[0].zoom),_=void 0,w={}),J=J.concat(go({key:`${ge}[0]`,value:ie[0],valueSpec:{zoom:{}},validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,objectElementValidators:{zoom:qh,value:H}}))}else J=J.concat(H({key:`${ge}[0]`,value:ie[0],valueSpec:{},validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec},ie));return ur(cl(ie[1]))?J.concat([new lt(`${ge}[1]`,ie[1],"expressions are not allowed in function stops.")]):J.concat(Y.validateSpec({key:`${ge}[1]`,value:ie[1],valueSpec:s,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec}))}function H(Y,J){const ie=Un(Y.value),ge=zr(Y.value),we=Y.value!==null?Y.value:J;if(p){if(ie!==p)return[new lt(Y.key,we,`${ie} stop domain type must match previous stop domain type ${p}`)]}else p=ie;if(ie!=="number"&&ie!=="string"&&ie!=="boolean")return[new lt(Y.key,we,"stop domain value must be a number, string, or boolean")];if(ie!=="number"&&h!=="categorical"){let Ne=`number expected, ${ie} found`;return ku(s)&&h===void 0&&(Ne+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new lt(Y.key,we,Ne)]}return h!=="categorical"||ie!=="number"||isFinite(ge)&&Math.floor(ge)===ge?h!=="categorical"&&ie==="number"&&_!==void 0&&ge<_?[new lt(Y.key,we,"stop domain values must appear in ascending order")]:(_=ge,h==="categorical"&&ge in w?[new lt(Y.key,we,"stop domain values must be unique")]:(w[ge]=!0,[])):[new lt(Y.key,we,`integer expected, found ${ge}`)]}}function hl(u){const s=(u.expressionContext==="property"?Ym:Zl)(cl(u.value),u.valueSpec);if(s.result==="error")return s.value.map(p=>new lt(`${u.key}${p.key}`,u.value,p.message));const h=s.value.expression||s.value._styleExpression.expression;if(u.expressionContext==="property"&&u.propertyKey==="text-font"&&!h.outputDefined())return[new lt(u.key,u.value,`Invalid data expression for "${u.propertyKey}". Output values must be contained as literals within the expression.`)];if(u.expressionContext==="property"&&u.propertyType==="layout"&&!Ic(h))return[new lt(u.key,u.value,'"feature-state" data expressions are not supported with layout properties.')];if(u.expressionContext==="filter"&&!Ic(h))return[new lt(u.key,u.value,'"feature-state" data expressions are not supported with filters.')];if(u.expressionContext&&u.expressionContext.indexOf("cluster")===0){if(!Cc(h,["zoom","feature-state"]))return[new lt(u.key,u.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(u.expressionContext==="cluster-initial"&&!Lh(h))return[new lt(u.key,u.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function fl(u){const s=u.key,h=u.value,p=u.valueSpec,_=[];return Array.isArray(p.values)?p.values.indexOf(zr(h))===-1&&_.push(new lt(s,h,`expected one of [${p.values.join(", ")}], ${JSON.stringify(h)} found`)):Object.keys(p.values).indexOf(zr(h))===-1&&_.push(new lt(s,h,`expected one of [${Object.keys(p.values).join(", ")}], ${JSON.stringify(h)} found`)),_}function Au(u){return Bh(cl(u.value))?hl(hs({},u,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Bp(u)}function Bp(u){const s=u.value,h=u.key;if(Un(s)!=="array")return[new lt(h,s,`array expected, ${Un(s)} found`)];const p=u.styleSpec;let _,x=[];if(s.length<1)return[new lt(h,s,"filter array must have at least 1 element")];switch(x=x.concat(fl({key:`${h}[0]`,value:s[0],valueSpec:p.filter_operator,style:u.style,styleSpec:u.styleSpec})),zr(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&zr(s[1])==="$type"&&x.push(new lt(h,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":s.length!==3&&x.push(new lt(h,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(_=Un(s[1]),_!=="string"&&x.push(new lt(`${h}[1]`,s[1],`string expected, ${_} found`)));for(let w=2;w{D in h&&s.push(new lt(p,h[D],`"${D}" is prohibited for ref layers`))}),_.layers.forEach(D=>{zr(D.id)===I&&(P=D)}),P?P.ref?s.push(new lt(p,h.ref,"ref cannot reference another ref layer")):w=zr(P.type):s.push(new lt(p,h.ref,`ref layer "${I}" not found`))}else if(w!=="background")if(h.source){const P=_.sources&&_.sources[h.source],D=P&&zr(P.type);P?D==="vector"&&w==="raster"?s.push(new lt(p,h.source,`layer "${h.id}" requires a raster source`)):D!=="raster-dem"&&w==="hillshade"?s.push(new lt(p,h.source,`layer "${h.id}" requires a raster-dem source`)):D==="raster"&&w!=="raster"?s.push(new lt(p,h.source,`layer "${h.id}" requires a vector source`)):D!=="vector"||h["source-layer"]?D==="raster-dem"&&w!=="hillshade"?s.push(new lt(p,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):w!=="line"||!h.paint||!h.paint["line-gradient"]||D==="geojson"&&P.lineMetrics||s.push(new lt(p,h,`layer "${h.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new lt(p,h,`layer "${h.id}" must specify a "source-layer"`)):s.push(new lt(p,h.source,`source "${h.source}" not found`))}else s.push(new lt(p,h,'missing required property "source"'));return s=s.concat(go({key:p,value:h,valueSpec:x.layer,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*":()=>[],type:()=>u.validateSpec({key:`${p}.type`,value:h.type,valueSpec:x.layer.type,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,object:h,objectKey:"type"}),filter:Au,layout:P=>go({layer:h,key:P.key,value:P.value,style:P.style,styleSpec:P.styleSpec,validateSpec:P.validateSpec,objectElementValidators:{"*":D=>Up(hs({layerType:w},D))}}),paint:P=>go({layer:h,key:P.key,value:P.value,style:P.style,styleSpec:P.styleSpec,validateSpec:P.validateSpec,objectElementValidators:{"*":D=>Vp(hs({layerType:w},D))}})}})),s}function Xl(u){const s=u.value,h=u.key,p=Un(s);return p!=="string"?[new lt(h,s,`string expected, ${p} found`)]:[]}const ng={promoteId:function({key:u,value:s}){if(Un(s)==="string")return Xl({key:u,value:s});{const h=[];for(const p in s)h.push(...Xl({key:`${u}.${p}`,value:s[p]}));return h}}};function rg(u){const s=u.value,h=u.key,p=u.styleSpec,_=u.style,x=u.validateSpec;if(!s.type)return[new lt(h,s,'"type" is required')];const w=zr(s.type);let I;switch(w){case"vector":case"raster":return I=go({key:h,value:s,valueSpec:p[`source_${w.replace("-","_")}`],style:u.style,styleSpec:p,objectElementValidators:ng,validateSpec:x}),I;case"raster-dem":return I=function(P){var D;const F=(D=P.sourceName)!==null&&D!==void 0?D:"",V=P.value,H=P.styleSpec,Y=H.source_raster_dem,J=P.style;let ie=[];const ge=Un(V);if(V===void 0)return ie;if(ge!=="object")return ie.push(new lt("source_raster_dem",V,`object expected, ${ge} found`)),ie;const we=zr(V.encoding)==="custom",Ne=["redFactor","greenFactor","blueFactor","baseShift"],Ee=P.value.encoding?`"${P.value.encoding}"`:"Default";for(const Ae in V)!we&&Ne.includes(Ae)?ie.push(new lt(Ae,V[Ae],`In "${F}": "${Ae}" is only valid when "encoding" is set to "custom". ${Ee} encoding found`)):Y[Ae]?ie=ie.concat(P.validateSpec({key:Ae,value:V[Ae],valueSpec:Y[Ae],validateSpec:P.validateSpec,style:J,styleSpec:H})):ie.push(new lt(Ae,V[Ae],`unknown property "${Ae}"`));return ie}({sourceName:h,value:s,style:u.style,styleSpec:p,validateSpec:x}),I;case"geojson":if(I=go({key:h,value:s,valueSpec:p.source_geojson,style:_,styleSpec:p,validateSpec:x,objectElementValidators:ng}),s.cluster)for(const P in s.clusterProperties){const[D,F]=s.clusterProperties[P],V=typeof D=="string"?[D,["accumulated"],["get",P]]:D;I.push(...hl({key:`${h}.${P}.map`,value:F,validateSpec:x,expressionContext:"cluster-map"})),I.push(...hl({key:`${h}.${P}.reduce`,value:V,validateSpec:x,expressionContext:"cluster-reduce"}))}return I;case"video":return go({key:h,value:s,valueSpec:p.source_video,style:_,validateSpec:x,styleSpec:p});case"image":return go({key:h,value:s,valueSpec:p.source_image,style:_,validateSpec:x,styleSpec:p});case"canvas":return[new lt(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return fl({key:`${h}.type`,value:s.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:_,validateSpec:x,styleSpec:p})}}function ig(u){const s=u.value,h=u.styleSpec,p=h.light,_=u.style;let x=[];const w=Un(s);if(s===void 0)return x;if(w!=="object")return x=x.concat([new lt("light",s,`object expected, ${w} found`)]),x;for(const I in s){const P=I.match(/^(.*)-transition$/);x=x.concat(P&&p[P[1]]&&p[P[1]].transition?u.validateSpec({key:I,value:s[I],valueSpec:h.transition,validateSpec:u.validateSpec,style:_,styleSpec:h}):p[I]?u.validateSpec({key:I,value:s[I],valueSpec:p[I],validateSpec:u.validateSpec,style:_,styleSpec:h}):[new lt(I,s[I],`unknown property "${I}"`)])}return x}function og(u){const s=u.value,h=u.styleSpec,p=h.sky,_=u.style,x=Un(s);if(s===void 0)return[];if(x!=="object")return[new lt("sky",s,`object expected, ${x} found`)];let w=[];for(const I in s)w=w.concat(p[I]?ta({key:I,value:s[I],valueSpec:p[I],style:_,styleSpec:h}):[new lt(I,s[I],`unknown property "${I}"`)]);return w}function kc(u){const s=u.value,h=u.styleSpec,p=h.terrain,_=u.style;let x=[];const w=Un(s);if(s===void 0)return x;if(w!=="object")return x=x.concat([new lt("terrain",s,`object expected, ${w} found`)]),x;for(const I in s)x=x.concat(p[I]?u.validateSpec({key:I,value:s[I],valueSpec:p[I],validateSpec:u.validateSpec,style:_,styleSpec:h}):[new lt(I,s[I],`unknown property "${I}"`)]);return x}function Ac(u){let s=[];const h=u.value,p=u.key;if(Array.isArray(h)){const _=[],x=[];for(const w in h)h[w].id&&_.includes(h[w].id)&&s.push(new lt(p,h,`all the sprites' ids must be unique, but ${h[w].id} is duplicated`)),_.push(h[w].id),h[w].url&&x.includes(h[w].url)&&s.push(new lt(p,h,`all the sprites' URLs must be unique, but ${h[w].url} is duplicated`)),x.push(h[w].url),s=s.concat(go({key:`${p}[${w}]`,value:h[w],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:u.validateSpec}));return s}return Xl({key:p,value:h})}const Po={"*":()=>[],array:Fp,boolean:function(u){const s=u.value,h=u.key,p=Un(s);return p!=="boolean"?[new lt(h,s,`boolean expected, ${p} found`)]:[]},number:qh,color:function(u){const s=u.key,h=u.value,p=Un(h);return p!=="string"?[new lt(s,h,`color expected, ${p} found`)]:Qn.parse(String(h))?[]:[new lt(s,h,`color expected, "${h}" found`)]},constants:eg,enum:fl,filter:Au,function:tg,layer:Mc,object:go,source:rg,light:ig,sky:og,terrain:kc,string:Xl,formatted:function(u){return Xl(u).length===0?[]:hl(u)},resolvedImage:function(u){return Xl(u).length===0?[]:hl(u)},padding:function(u){const s=u.key,h=u.value;if(Un(h)==="array"){if(h.length<1||h.length>4)return[new lt(s,h,`padding requires 1 to 4 values; ${h.length} values found`)];const p={type:"number"};let _=[];for(let x=0;x[]}})),u.constants&&(h=h.concat(eg({key:"constants",value:u.constants,style:u,styleSpec:s,validateSpec:ta}))),Du(h)}function na(u){return function(s){return u({...s,validateSpec:ta})}}function Du(u){return[].concat(u).sort((s,h)=>s.line-h.line)}function ks(u){return function(...s){return Du(u.apply(this,s))}}Ms.source=ks(na(rg)),Ms.sprite=ks(na(Ac)),Ms.glyphs=ks(na(jp)),Ms.light=ks(na(ig)),Ms.sky=ks(na(og)),Ms.terrain=ks(na(kc)),Ms.layer=ks(na(Mc)),Ms.filter=ks(na(Au)),Ms.paintProperty=ks(na(Vp)),Ms.layoutProperty=ks(na(Up));const Yl=Ms,jy=Yl.light,Gp=Yl.paintProperty,Gy=Yl.layoutProperty;function Ru(u,s){let h=!1;if(s&&s.length)for(const p of s)u.fire(new gt(new Error(p.message))),h=!0;return h}class Dc{constructor(s,h,p){const _=this.cells=[];if(s instanceof ArrayBuffer){this.arrayBuffer=s;const w=new Int32Array(this.arrayBuffer);s=w[0],this.d=(h=w[1])+2*(p=w[2]);for(let P=0;P=V[J+0]&&_>=V[J+1])?(I[Y]=!0,w.push(F[Y])):I[Y]=!1}}}}_forEachCell(s,h,p,_,x,w,I,P){const D=this._convertToCellCoord(s),F=this._convertToCellCoord(h),V=this._convertToCellCoord(p),H=this._convertToCellCoord(_);for(let Y=D;Y<=V;Y++)for(let J=F;J<=H;J++){const ie=this.d*J+Y;if((!P||P(this._convertFromCellCoord(Y),this._convertFromCellCoord(J),this._convertFromCellCoord(Y+1),this._convertFromCellCoord(J+1)))&&x.call(this,s,h,p,_,ie,w,I,P))return}}_convertFromCellCoord(s){return(s-this.padding)/this.scale}_convertToCellCoord(s){return Math.max(0,Math.min(this.d-1,Math.floor(s*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const s=this.cells,h=3+this.cells.length+1+1;let p=0;for(let w=0;w=0)continue;const w=u[x];_[x]=ra[p].shallow.indexOf(x)>=0?w:Nu(w,s)}u instanceof Error&&(_.message=u.message)}if(_.$name)throw new Error("$name property is reserved for worker serialization logic.");return p!=="Object"&&(_.$name=p),_}throw new Error("can't serialize object of type "+typeof u)}function Ou(u){if(u==null||typeof u=="boolean"||typeof u=="number"||typeof u=="string"||u instanceof Boolean||u instanceof Number||u instanceof String||u instanceof Date||u instanceof RegExp||u instanceof Blob||u instanceof Error||Hh(u)||Ke(u)||ArrayBuffer.isView(u)||u instanceof ImageData)return u;if(Array.isArray(u))return u.map(Ou);if(typeof u=="object"){const s=u.$name||"Object";if(!ra[s])throw new Error(`can't deserialize unregistered class ${s}`);const{klass:h}=ra[s];if(!h)throw new Error(`can't deserialize unregistered class ${s}`);if(h.deserialize)return h.deserialize(u);const p=Object.create(h.prototype);for(const _ of Object.keys(u)){if(_==="$name")continue;const x=u[_];p[_]=ra[s].shallow.indexOf(_)>=0?x:Ou(x)}return p}throw new Error("can't deserialize object of type "+typeof u)}class sg{constructor(){this.first=!0}update(s,h){const p=Math.floor(s);return this.first?(this.first=!1,this.lastIntegerZoom=p,this.lastIntegerZoomTime=0,this.lastZoom=s,this.lastFloorZoom=p,!0):(this.lastFloorZoom>p?(this.lastIntegerZoom=p+1,this.lastIntegerZoomTime=h):this.lastFloorZoomu>=128&&u<=255,Arabic:u=>u>=1536&&u<=1791,"Arabic Supplement":u=>u>=1872&&u<=1919,"Arabic Extended-A":u=>u>=2208&&u<=2303,"Hangul Jamo":u=>u>=4352&&u<=4607,"Unified Canadian Aboriginal Syllabics":u=>u>=5120&&u<=5759,Khmer:u=>u>=6016&&u<=6143,"Unified Canadian Aboriginal Syllabics Extended":u=>u>=6320&&u<=6399,"General Punctuation":u=>u>=8192&&u<=8303,"Letterlike Symbols":u=>u>=8448&&u<=8527,"Number Forms":u=>u>=8528&&u<=8591,"Miscellaneous Technical":u=>u>=8960&&u<=9215,"Control Pictures":u=>u>=9216&&u<=9279,"Optical Character Recognition":u=>u>=9280&&u<=9311,"Enclosed Alphanumerics":u=>u>=9312&&u<=9471,"Geometric Shapes":u=>u>=9632&&u<=9727,"Miscellaneous Symbols":u=>u>=9728&&u<=9983,"Miscellaneous Symbols and Arrows":u=>u>=11008&&u<=11263,"CJK Radicals Supplement":u=>u>=11904&&u<=12031,"Kangxi Radicals":u=>u>=12032&&u<=12255,"Ideographic Description Characters":u=>u>=12272&&u<=12287,"CJK Symbols and Punctuation":u=>u>=12288&&u<=12351,Hiragana:u=>u>=12352&&u<=12447,Katakana:u=>u>=12448&&u<=12543,Bopomofo:u=>u>=12544&&u<=12591,"Hangul Compatibility Jamo":u=>u>=12592&&u<=12687,Kanbun:u=>u>=12688&&u<=12703,"Bopomofo Extended":u=>u>=12704&&u<=12735,"CJK Strokes":u=>u>=12736&&u<=12783,"Katakana Phonetic Extensions":u=>u>=12784&&u<=12799,"Enclosed CJK Letters and Months":u=>u>=12800&&u<=13055,"CJK Compatibility":u=>u>=13056&&u<=13311,"CJK Unified Ideographs Extension A":u=>u>=13312&&u<=19903,"Yijing Hexagram Symbols":u=>u>=19904&&u<=19967,"CJK Unified Ideographs":u=>u>=19968&&u<=40959,"Yi Syllables":u=>u>=40960&&u<=42127,"Yi Radicals":u=>u>=42128&&u<=42191,"Hangul Jamo Extended-A":u=>u>=43360&&u<=43391,"Hangul Syllables":u=>u>=44032&&u<=55215,"Hangul Jamo Extended-B":u=>u>=55216&&u<=55295,"Private Use Area":u=>u>=57344&&u<=63743,"CJK Compatibility Ideographs":u=>u>=63744&&u<=64255,"Arabic Presentation Forms-A":u=>u>=64336&&u<=65023,"Vertical Forms":u=>u>=65040&&u<=65055,"CJK Compatibility Forms":u=>u>=65072&&u<=65103,"Small Form Variants":u=>u>=65104&&u<=65135,"Arabic Presentation Forms-B":u=>u>=65136&&u<=65279,"Halfwidth and Fullwidth Forms":u=>u>=65280&&u<=65519};function zu(u){for(const s of u)if(Zh(s.charCodeAt(0)))return!0;return!1}function ag(u){for(const s of u)if(!lg(s.charCodeAt(0)))return!1;return!0}function lg(u){return!(Et.Arabic(u)||Et["Arabic Supplement"](u)||Et["Arabic Extended-A"](u)||Et["Arabic Presentation Forms-A"](u)||Et["Arabic Presentation Forms-B"](u))}function Zh(u){return!(u!==746&&u!==747&&(u<4352||!(Et["Bopomofo Extended"](u)||Et.Bopomofo(u)||Et["CJK Compatibility Forms"](u)&&!(u>=65097&&u<=65103)||Et["CJK Compatibility Ideographs"](u)||Et["CJK Compatibility"](u)||Et["CJK Radicals Supplement"](u)||Et["CJK Strokes"](u)||!(!Et["CJK Symbols and Punctuation"](u)||u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||Et["CJK Unified Ideographs Extension A"](u)||Et["CJK Unified Ideographs"](u)||Et["Enclosed CJK Letters and Months"](u)||Et["Hangul Compatibility Jamo"](u)||Et["Hangul Jamo Extended-A"](u)||Et["Hangul Jamo Extended-B"](u)||Et["Hangul Jamo"](u)||Et["Hangul Syllables"](u)||Et.Hiragana(u)||Et["Ideographic Description Characters"](u)||Et.Kanbun(u)||Et["Kangxi Radicals"](u)||Et["Katakana Phonetic Extensions"](u)||Et.Katakana(u)&&u!==12540||!(!Et["Halfwidth and Fullwidth Forms"](u)||u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||!(!Et["Small Form Variants"](u)||u>=65112&&u<=65118||u>=65123&&u<=65126)||Et["Unified Canadian Aboriginal Syllabics"](u)||Et["Unified Canadian Aboriginal Syllabics Extended"](u)||Et["Vertical Forms"](u)||Et["Yijing Hexagram Symbols"](u)||Et["Yi Syllables"](u)||Et["Yi Radicals"](u))))}function qp(u){return!(Zh(u)||function(s){return!!(Et["Latin-1 Supplement"](s)&&(s===167||s===169||s===174||s===177||s===188||s===189||s===190||s===215||s===247)||Et["General Punctuation"](s)&&(s===8214||s===8224||s===8225||s===8240||s===8241||s===8251||s===8252||s===8258||s===8263||s===8264||s===8265||s===8273)||Et["Letterlike Symbols"](s)||Et["Number Forms"](s)||Et["Miscellaneous Technical"](s)&&(s>=8960&&s<=8967||s>=8972&&s<=8991||s>=8996&&s<=9e3||s===9003||s>=9085&&s<=9114||s>=9150&&s<=9165||s===9167||s>=9169&&s<=9179||s>=9186&&s<=9215)||Et["Control Pictures"](s)&&s!==9251||Et["Optical Character Recognition"](s)||Et["Enclosed Alphanumerics"](s)||Et["Geometric Shapes"](s)||Et["Miscellaneous Symbols"](s)&&!(s>=9754&&s<=9759)||Et["Miscellaneous Symbols and Arrows"](s)&&(s>=11026&&s<=11055||s>=11088&&s<=11097||s>=11192&&s<=11243)||Et["CJK Symbols and Punctuation"](s)||Et.Katakana(s)||Et["Private Use Area"](s)||Et["CJK Compatibility Forms"](s)||Et["Small Form Variants"](s)||Et["Halfwidth and Fullwidth Forms"](s)||s===8734||s===8756||s===8757||s>=9984&&s<=10087||s>=10102&&s<=10131||s===65532||s===65533)}(u))}function Xh(u){return u>=1424&&u<=2303||Et["Arabic Presentation Forms-A"](u)||Et["Arabic Presentation Forms-B"](u)}function ug(u,s){return!(!s&&Xh(u)||u>=2304&&u<=3583||u>=3840&&u<=4255||Et.Khmer(u))}function qy(u){for(const s of u)if(Xh(s.charCodeAt(0)))return!0;return!1}const pl=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(u){this.pluginStatus=u.pluginStatus,this.pluginURL=u.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(u){this.applyArabicShaping=u.applyArabicShaping,this.processBidirectionalText=u.processBidirectionalText,this.processStyledBidirectionalText=u.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Er{constructor(s,h){this.zoom=s,h?(this.now=h.now,this.fadeDuration=h.fadeDuration,this.zoomHistory=h.zoomHistory,this.transition=h.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new sg,this.transition={})}isSupportedScript(s){return function(h,p){for(const _ of h)if(!ug(_.charCodeAt(0),p))return!1;return!0}(s,pl.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const s=this.zoom,h=s-Math.floor(s),p=this.crossFadingFactor();return s>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:h+(1-h)*p}:{fromScale:.5,toScale:1,t:1-(1-p)*h}}}class Rc{constructor(s,h){this.property=s,this.value=h,this.expression=function(p,_){if(Nh(p))return new zh(p,_);if(ur(p)){const x=Ym(p,_);if(x.result==="error")throw new Error(x.value.map(w=>`${w.key}: ${w.message}`).join(", "));return x.value}{let x=p;return _.type==="color"&&typeof p=="string"?x=Qn.parse(p):_.type!=="padding"||typeof p!="number"&&!Array.isArray(p)?_.type==="variableAnchorOffsetCollection"&&Array.isArray(p)&&(x=ps.parse(p)):x=Lo.parse(p),{kind:"constant",evaluate:()=>x}}}(h===void 0?s.specification.default:h,s.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(s,h,p){return this.property.possiblyEvaluate(this,s,h,p)}}class Yh{constructor(s){this.property=s,this.value=new Rc(s,void 0)}transitioned(s,h){return new cg(this.property,this.value,h,ae({},s.transition,this.transition),s.now)}untransitioned(){return new cg(this.property,this.value,null,{},0)}}class Wp{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitionablePropertyValues)}getValue(s){return K(this._values[s].value.value)}setValue(s,h){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new Yh(this._values[s].property)),this._values[s].value=new Rc(this._values[s].property,h===null?void 0:K(h))}getTransition(s){return K(this._values[s].transition)}setTransition(s,h){Object.prototype.hasOwnProperty.call(this._values,s)||(this._values[s]=new Yh(this._values[s].property)),this._values[s].transition=K(h)||void 0}serialize(){const s={};for(const h of Object.keys(this._values)){const p=this.getValue(h);p!==void 0&&(s[h]=p);const _=this.getTransition(h);_!==void 0&&(s[`${h}-transition`]=_)}return s}transitioned(s,h){const p=new hg(this._properties);for(const _ of Object.keys(this._values))p._values[_]=this._values[_].transitioned(s,h._values[_]);return p}untransitioned(){const s=new hg(this._properties);for(const h of Object.keys(this._values))s._values[h]=this._values[h].untransitioned();return s}}class cg{constructor(s,h,p,_,x){this.property=s,this.value=h,this.begin=x+_.delay||0,this.end=this.begin+_.duration||0,s.specification.transition&&(_.delay||_.duration)&&(this.prior=p)}possiblyEvaluate(s,h,p){const _=s.now||0,x=this.value.possiblyEvaluate(s,h,p),w=this.prior;if(w){if(_>this.end)return this.prior=null,x;if(this.value.isDataDriven())return this.prior=null,x;if(_=1)return 1;const D=P*P,F=D*P;return 4*(P<.5?F:3*(P-D)+F-.75)}(I))}}return x}}class hg{constructor(s){this._properties=s,this._values=Object.create(s.defaultTransitioningPropertyValues)}possiblyEvaluate(s,h,p){const _=new Nc(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,h,p);return _}hasTransition(){for(const s of Object.keys(this._values))if(this._values[s].prior)return!0;return!1}}class fg{constructor(s){this._properties=s,this._values=Object.create(s.defaultPropertyValues)}hasValue(s){return this._values[s].value!==void 0}getValue(s){return K(this._values[s].value)}setValue(s,h){this._values[s]=new Rc(this._values[s].property,h===null?void 0:K(h))}serialize(){const s={};for(const h of Object.keys(this._values)){const p=this.getValue(h);p!==void 0&&(s[h]=p)}return s}possiblyEvaluate(s,h,p){const _=new Nc(this._properties);for(const x of Object.keys(this._values))_._values[x]=this._values[x].possiblyEvaluate(s,h,p);return _}}class As{constructor(s,h,p){this.property=s,this.value=h,this.parameters=p}isConstant(){return this.value.kind==="constant"}constantOr(s){return this.value.kind==="constant"?this.value.value:s}evaluate(s,h,p,_){return this.property.evaluate(this.value,this.parameters,s,h,p,_)}}class Nc{constructor(s){this._properties=s,this._values=Object.create(s.defaultPossiblyEvaluatedValues)}get(s){return this._values[s]}}class jt{constructor(s){this.specification=s}possiblyEvaluate(s,h){if(s.isDataDriven())throw new Error("Value should not be data driven");return s.expression.evaluate(h)}interpolate(s,h,p){const _=mo[this.specification.type];return _?_(s,h,p):s}}class $t{constructor(s,h){this.specification=s,this.overrides=h}possiblyEvaluate(s,h,p,_){return new As(this,s.expression.kind==="constant"||s.expression.kind==="camera"?{kind:"constant",value:s.expression.evaluate(h,null,{},p,_)}:s.expression,h)}interpolate(s,h,p){if(s.value.kind!=="constant"||h.value.kind!=="constant")return s;if(s.value.value===void 0||h.value.value===void 0)return new As(this,{kind:"constant",value:void 0},s.parameters);const _=mo[this.specification.type];if(_){const x=_(s.value.value,h.value.value,p);return new As(this,{kind:"constant",value:x},s.parameters)}return s}evaluate(s,h,p,_,x,w){return s.kind==="constant"?s.value:s.evaluate(h,p,_,x,w)}}class $h extends $t{possiblyEvaluate(s,h,p,_){if(s.value===void 0)return new As(this,{kind:"constant",value:void 0},h);if(s.expression.kind==="constant"){const x=s.expression.evaluate(h,null,{},p,_),w=s.property.specification.type==="resolvedImage"&&typeof x!="string"?x.name:x,I=this._calculate(w,w,w,h);return new As(this,{kind:"constant",value:I},h)}if(s.expression.kind==="camera"){const x=this._calculate(s.expression.evaluate({zoom:h.zoom-1}),s.expression.evaluate({zoom:h.zoom}),s.expression.evaluate({zoom:h.zoom+1}),h);return new As(this,{kind:"constant",value:x},h)}return new As(this,s.expression,h)}evaluate(s,h,p,_,x,w){if(s.kind==="source"){const I=s.evaluate(h,p,_,x,w);return this._calculate(I,I,I,h)}return s.kind==="composite"?this._calculate(s.evaluate({zoom:Math.floor(h.zoom)-1},p,_),s.evaluate({zoom:Math.floor(h.zoom)},p,_),s.evaluate({zoom:Math.floor(h.zoom)+1},p,_),h):s.value}_calculate(s,h,p,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:h}:{from:p,to:h}}interpolate(s){return s}}class Oc{constructor(s){this.specification=s}possiblyEvaluate(s,h,p,_){if(s.value!==void 0){if(s.expression.kind==="constant"){const x=s.expression.evaluate(h,null,{},p,_);return this._calculate(x,x,x,h)}return this._calculate(s.expression.evaluate(new Er(Math.floor(h.zoom-1),h)),s.expression.evaluate(new Er(Math.floor(h.zoom),h)),s.expression.evaluate(new Er(Math.floor(h.zoom+1),h)),h)}}_calculate(s,h,p,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:s,to:h}:{from:p,to:h}}interpolate(s){return s}}class Hp{constructor(s){this.specification=s}possiblyEvaluate(s,h,p,_){return!!s.expression.evaluate(h,null,{},p,_)}interpolate(){return!1}}class Mo{constructor(s){this.properties=s,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const h in s){const p=s[h];p.specification.overridable&&this.overridableProperties.push(h);const _=this.defaultPropertyValues[h]=new Rc(p,void 0),x=this.defaultTransitionablePropertyValues[h]=new Yh(p);this.defaultTransitioningPropertyValues[h]=x.untransitioned(),this.defaultPossiblyEvaluatedValues[h]=_.possiblyEvaluate({})}}}Pt("DataDrivenProperty",$t),Pt("DataConstantProperty",jt),Pt("CrossFadedDataDrivenProperty",$h),Pt("CrossFadedProperty",Oc),Pt("ColorRampProperty",Hp);const Zp="-transition";class Ds extends Nt{constructor(s,h){if(super(),this.id=s.id,this.type=s.type,this._featureFilter={filter:()=>!0,needGeometry:!1},s.type!=="custom"&&(this.metadata=s.metadata,this.minzoom=s.minzoom,this.maxzoom=s.maxzoom,s.type!=="background"&&(this.source=s.source,this.sourceLayer=s["source-layer"],this.filter=s.filter),h.layout&&(this._unevaluatedLayout=new fg(h.layout)),h.paint)){this._transitionablePaint=new Wp(h.paint);for(const p in s.paint)this.setPaintProperty(p,s.paint[p],{validate:!1});for(const p in s.layout)this.setLayoutProperty(p,s.layout[p],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Nc(h.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(s){return s==="visibility"?this.visibility:this._unevaluatedLayout.getValue(s)}setLayoutProperty(s,h,p={}){h!=null&&this._validate(Gy,`layers.${this.id}.layout.${s}`,s,h,p)||(s!=="visibility"?this._unevaluatedLayout.setValue(s,h):this.visibility=h)}getPaintProperty(s){return s.endsWith(Zp)?this._transitionablePaint.getTransition(s.slice(0,-11)):this._transitionablePaint.getValue(s)}setPaintProperty(s,h,p={}){if(h!=null&&this._validate(Gp,`layers.${this.id}.paint.${s}`,s,h,p))return!1;if(s.endsWith(Zp))return this._transitionablePaint.setTransition(s.slice(0,-11),h||void 0),!1;{const _=this._transitionablePaint._values[s],x=_.property.specification["property-type"]==="cross-faded-data-driven",w=_.value.isDataDriven(),I=_.value;this._transitionablePaint.setValue(s,h),this._handleSpecialPaintPropertyUpdate(s);const P=this._transitionablePaint._values[s].value;return P.isDataDriven()||w||x||this._handleOverridablePaintPropertyUpdate(s,I,P)}}_handleSpecialPaintPropertyUpdate(s){}_handleOverridablePaintPropertyUpdate(s,h,p){return!1}isHidden(s){return!!(this.minzoom&&s=this.maxzoom)||this.visibility==="none"}updateTransitions(s){this._transitioningPaint=this._transitionablePaint.transitioned(s,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(s,h){s.getCrossfadeParameters&&(this._crossfadeParameters=s.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(s,void 0,h)),this.paint=this._transitioningPaint.possiblyEvaluate(s,void 0,h)}serialize(){const s={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&&(s.layout=s.layout||{},s.layout.visibility=this.visibility),ke(s,(h,p)=>!(h===void 0||p==="layout"&&!Object.keys(h).length||p==="paint"&&!Object.keys(h).length))}_validate(s,h,p,_,x={}){return(!x||x.validate!==!1)&&Ru(this,s.call(Yl,{key:h,layerType:this.type,objectKey:p,value:_,styleSpec:me,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const s in this.paint._values){const h=this.paint.get(s);if(h instanceof As&&ku(h.property.specification)&&(h.value.kind==="source"||h.value.kind==="composite")&&h.value.isStateDependent)return!0}return!1}}const pg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class zc{constructor(s,h){this._structArray=s,this._pos1=h*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Fr{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(s,h){return s._trim(),h&&(s.isTransferred=!0,h.push(s.arrayBuffer)),{length:s.length,arrayBuffer:s.arrayBuffer}}static deserialize(s){const h=Object.create(this.prototype);return h.arrayBuffer=s.arrayBuffer,h.length=s.length,h.capacity=s.arrayBuffer.byteLength/h.bytesPerElement,h._refreshViews(),h}_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(s){this.reserve(s),this.length=s}reserve(s){if(s>this.capacity){this.capacity=Math.max(s,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const h=this.uint8;this._refreshViews(),h&&this.uint8.set(h)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ei(u,s=1){let h=0,p=0;return{members:u.map(_=>{const x=pg[_.type].BYTES_PER_ELEMENT,w=h=dg(h,Math.max(s,x)),I=_.components||1;return p=Math.max(p,x),h+=x*I,{name:_.name,type:_.type,components:I,offset:w}}),size:dg(h,Math.max(p,s)),alignment:s}}function dg(u,s){return Math.ceil(u/s)*s}class Fc extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h){const p=this.length;return this.resize(p+1),this.emplace(p,s,h)}emplace(s,h,p){const _=2*s;return this.int16[_+0]=h,this.int16[_+1]=p,s}}Fc.prototype.bytesPerElement=4,Pt("StructArrayLayout2i4",Fc);class Fa extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h,p){const _=this.length;return this.resize(_+1),this.emplace(_,s,h,p)}emplace(s,h,p,_){const x=3*s;return this.int16[x+0]=h,this.int16[x+1]=p,this.int16[x+2]=_,s}}Fa.prototype.bytesPerElement=6,Pt("StructArrayLayout3i6",Fa);class Xp extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h,p,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,h,p,_)}emplace(s,h,p,_,x){const w=4*s;return this.int16[w+0]=h,this.int16[w+1]=p,this.int16[w+2]=_,this.int16[w+3]=x,s}}Xp.prototype.bytesPerElement=8,Pt("StructArrayLayout4i8",Xp);class Yp extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h,p,_,x,w){const I=this.length;return this.resize(I+1),this.emplace(I,s,h,p,_,x,w)}emplace(s,h,p,_,x,w,I){const P=6*s;return this.int16[P+0]=h,this.int16[P+1]=p,this.int16[P+2]=_,this.int16[P+3]=x,this.int16[P+4]=w,this.int16[P+5]=I,s}}Yp.prototype.bytesPerElement=12,Pt("StructArrayLayout2i4i12",Yp);class $p extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h,p,_,x,w){const I=this.length;return this.resize(I+1),this.emplace(I,s,h,p,_,x,w)}emplace(s,h,p,_,x,w,I){const P=4*s,D=8*s;return this.int16[P+0]=h,this.int16[P+1]=p,this.uint8[D+4]=_,this.uint8[D+5]=x,this.uint8[D+6]=w,this.uint8[D+7]=I,s}}$p.prototype.bytesPerElement=8,Pt("StructArrayLayout2i4ub8",$p);class Bc extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,h){const p=this.length;return this.resize(p+1),this.emplace(p,s,h)}emplace(s,h,p){const _=2*s;return this.float32[_+0]=h,this.float32[_+1]=p,s}}Bc.prototype.bytesPerElement=8,Pt("StructArrayLayout2f8",Bc);class Kh extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,h,p,_,x,w,I,P,D,F){const V=this.length;return this.resize(V+1),this.emplace(V,s,h,p,_,x,w,I,P,D,F)}emplace(s,h,p,_,x,w,I,P,D,F,V){const H=10*s;return this.uint16[H+0]=h,this.uint16[H+1]=p,this.uint16[H+2]=_,this.uint16[H+3]=x,this.uint16[H+4]=w,this.uint16[H+5]=I,this.uint16[H+6]=P,this.uint16[H+7]=D,this.uint16[H+8]=F,this.uint16[H+9]=V,s}}Kh.prototype.bytesPerElement=20,Pt("StructArrayLayout10ui20",Kh);class Kp extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,h,p,_,x,w,I,P,D,F,V,H){const Y=this.length;return this.resize(Y+1),this.emplace(Y,s,h,p,_,x,w,I,P,D,F,V,H)}emplace(s,h,p,_,x,w,I,P,D,F,V,H,Y){const J=12*s;return this.int16[J+0]=h,this.int16[J+1]=p,this.int16[J+2]=_,this.int16[J+3]=x,this.uint16[J+4]=w,this.uint16[J+5]=I,this.uint16[J+6]=P,this.uint16[J+7]=D,this.int16[J+8]=F,this.int16[J+9]=V,this.int16[J+10]=H,this.int16[J+11]=Y,s}}Kp.prototype.bytesPerElement=24,Pt("StructArrayLayout4i4ui4i24",Kp);class Jp extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,h,p){const _=this.length;return this.resize(_+1),this.emplace(_,s,h,p)}emplace(s,h,p,_){const x=3*s;return this.float32[x+0]=h,this.float32[x+1]=p,this.float32[x+2]=_,s}}Jp.prototype.bytesPerElement=12,Pt("StructArrayLayout3f12",Jp);class Ba extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(s){const h=this.length;return this.resize(h+1),this.emplace(h,s)}emplace(s,h){return this.uint32[1*s+0]=h,s}}Ba.prototype.bytesPerElement=4,Pt("StructArrayLayout1ul4",Ba);class Jh extends Fr{_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(s,h,p,_,x,w,I,P,D){const F=this.length;return this.resize(F+1),this.emplace(F,s,h,p,_,x,w,I,P,D)}emplace(s,h,p,_,x,w,I,P,D,F){const V=10*s,H=5*s;return this.int16[V+0]=h,this.int16[V+1]=p,this.int16[V+2]=_,this.int16[V+3]=x,this.int16[V+4]=w,this.int16[V+5]=I,this.uint32[H+3]=P,this.uint16[V+8]=D,this.uint16[V+9]=F,s}}Jh.prototype.bytesPerElement=20,Pt("StructArrayLayout6i1ul2ui20",Jh);class Vc extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h,p,_,x,w){const I=this.length;return this.resize(I+1),this.emplace(I,s,h,p,_,x,w)}emplace(s,h,p,_,x,w,I){const P=6*s;return this.int16[P+0]=h,this.int16[P+1]=p,this.int16[P+2]=_,this.int16[P+3]=x,this.int16[P+4]=w,this.int16[P+5]=I,s}}Vc.prototype.bytesPerElement=12,Pt("StructArrayLayout2i2i2i12",Vc);class Qh extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(s,h,p,_,x){const w=this.length;return this.resize(w+1),this.emplace(w,s,h,p,_,x)}emplace(s,h,p,_,x,w){const I=4*s,P=8*s;return this.float32[I+0]=h,this.float32[I+1]=p,this.float32[I+2]=_,this.int16[P+6]=x,this.int16[P+7]=w,s}}Qh.prototype.bytesPerElement=16,Pt("StructArrayLayout2f1f2i16",Qh);class Uc extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,h,p,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,h,p,_)}emplace(s,h,p,_,x){const w=12*s,I=3*s;return this.uint8[w+0]=h,this.uint8[w+1]=p,this.float32[I+1]=_,this.float32[I+2]=x,s}}Uc.prototype.bytesPerElement=12,Pt("StructArrayLayout2ub2f12",Uc);class ef extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,h,p){const _=this.length;return this.resize(_+1),this.emplace(_,s,h,p)}emplace(s,h,p,_){const x=3*s;return this.uint16[x+0]=h,this.uint16[x+1]=p,this.uint16[x+2]=_,s}}ef.prototype.bytesPerElement=6,Pt("StructArrayLayout3ui6",ef);class Fu extends Fr{_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(s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie,ge,we){const Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie,ge,we)}emplace(s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie,ge,we,Ne){const Ee=24*s,Ae=12*s,Qe=48*s;return this.int16[Ee+0]=h,this.int16[Ee+1]=p,this.uint16[Ee+2]=_,this.uint16[Ee+3]=x,this.uint32[Ae+2]=w,this.uint32[Ae+3]=I,this.uint32[Ae+4]=P,this.uint16[Ee+10]=D,this.uint16[Ee+11]=F,this.uint16[Ee+12]=V,this.float32[Ae+7]=H,this.float32[Ae+8]=Y,this.uint8[Qe+36]=J,this.uint8[Qe+37]=ie,this.uint8[Qe+38]=ge,this.uint32[Ae+10]=we,this.int16[Ee+22]=Ne,s}}Fu.prototype.bytesPerElement=48,Pt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Fu);class $l extends Fr{_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(s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie,ge,we,Ne,Ee,Ae,Qe,et,Ct,zt,It,xt,ht,kt){const yt=this.length;return this.resize(yt+1),this.emplace(yt,s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie,ge,we,Ne,Ee,Ae,Qe,et,Ct,zt,It,xt,ht,kt)}emplace(s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie,ge,we,Ne,Ee,Ae,Qe,et,Ct,zt,It,xt,ht,kt,yt){const st=32*s,Yt=16*s;return this.int16[st+0]=h,this.int16[st+1]=p,this.int16[st+2]=_,this.int16[st+3]=x,this.int16[st+4]=w,this.int16[st+5]=I,this.int16[st+6]=P,this.int16[st+7]=D,this.uint16[st+8]=F,this.uint16[st+9]=V,this.uint16[st+10]=H,this.uint16[st+11]=Y,this.uint16[st+12]=J,this.uint16[st+13]=ie,this.uint16[st+14]=ge,this.uint16[st+15]=we,this.uint16[st+16]=Ne,this.uint16[st+17]=Ee,this.uint16[st+18]=Ae,this.uint16[st+19]=Qe,this.uint16[st+20]=et,this.uint16[st+21]=Ct,this.uint16[st+22]=zt,this.uint32[Yt+12]=It,this.float32[Yt+13]=xt,this.float32[Yt+14]=ht,this.uint16[st+30]=kt,this.uint16[st+31]=yt,s}}$l.prototype.bytesPerElement=64,Pt("StructArrayLayout8i15ui1ul2f2ui64",$l);class tf extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s){const h=this.length;return this.resize(h+1),this.emplace(h,s)}emplace(s,h){return this.float32[1*s+0]=h,s}}tf.prototype.bytesPerElement=4,Pt("StructArrayLayout1f4",tf);class nf extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,h,p){const _=this.length;return this.resize(_+1),this.emplace(_,s,h,p)}emplace(s,h,p,_){const x=3*s;return this.uint16[6*s+0]=h,this.float32[x+1]=p,this.float32[x+2]=_,s}}nf.prototype.bytesPerElement=12,Pt("StructArrayLayout1ui2f12",nf);class Kl extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,h,p){const _=this.length;return this.resize(_+1),this.emplace(_,s,h,p)}emplace(s,h,p,_){const x=4*s;return this.uint32[2*s+0]=h,this.uint16[x+2]=p,this.uint16[x+3]=_,s}}Kl.prototype.bytesPerElement=8,Pt("StructArrayLayout1ul2ui8",Kl);class Qp extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s,h){const p=this.length;return this.resize(p+1),this.emplace(p,s,h)}emplace(s,h,p){const _=2*s;return this.uint16[_+0]=h,this.uint16[_+1]=p,s}}Qp.prototype.bytesPerElement=4,Pt("StructArrayLayout2ui4",Qp);class ed extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(s){const h=this.length;return this.resize(h+1),this.emplace(h,s)}emplace(s,h){return this.uint16[1*s+0]=h,s}}ed.prototype.bytesPerElement=2,Pt("StructArrayLayout1ui2",ed);class rf extends Fr{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(s,h,p,_){const x=this.length;return this.resize(x+1),this.emplace(x,s,h,p,_)}emplace(s,h,p,_,x){const w=4*s;return this.float32[w+0]=h,this.float32[w+1]=p,this.float32[w+2]=_,this.float32[w+3]=x,s}}rf.prototype.bytesPerElement=16,Pt("StructArrayLayout4f16",rf);class mg extends zc{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 E(this.anchorPointX,this.anchorPointY)}}mg.prototype.size=20;class v extends Jh{get(s){return new mg(this,s)}}Pt("CollisionBoxArray",v);class a extends zc{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(s){this._structArray.uint8[this._pos1+37]=s}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(s){this._structArray.uint8[this._pos1+38]=s}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(s){this._structArray.uint32[this._pos4+10]=s}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}a.prototype.size=48;class f extends Fu{get(s){return new a(this,s)}}Pt("PlacedSymbolArray",f);class m extends zc{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(s){this._structArray.uint32[this._pos4+12]=s}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]}}m.prototype.size=64;class g extends $l{get(s){return new m(this,s)}}Pt("SymbolInstanceArray",g);class b extends tf{getoffsetX(s){return this.float32[1*s+0]}}Pt("GlyphOffsetArray",b);class T extends Fa{getx(s){return this.int16[3*s+0]}gety(s){return this.int16[3*s+1]}gettileUnitDistanceFromAnchor(s){return this.int16[3*s+2]}}Pt("SymbolLineVertexArray",T);class L extends zc{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]}}L.prototype.size=12;class k extends nf{get(s){return new L(this,s)}}Pt("TextAnchorOffsetArray",k);class z extends zc{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]}}z.prototype.size=8;class j extends Kl{get(s){return new z(this,s)}}Pt("FeatureIndexArray",j);class q extends Fc{}class $ extends Fc{}class he extends Fc{}class ce extends Yp{}class ye extends $p{}class re extends Bc{}class Ie extends Kh{}class Ue extends Kp{}class xe extends Jp{}class De extends Ba{}class qe extends Vc{}class He extends Uc{}class $e extends ef{}class it extends Qp{}const tt=ei([{name:"a_pos",components:2,type:"Int16"}],4),{members:ct}=tt;class dt{constructor(s=[]){this.segments=s}prepareSegment(s,h,p,_){let x=this.segments[this.segments.length-1];return s>dt.MAX_VERTEX_ARRAY_LENGTH&&Ge(`Max vertices per segment is ${dt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${s}`),(!x||x.vertexLength+s>dt.MAX_VERTEX_ARRAY_LENGTH||x.sortKey!==_)&&(x={vertexOffset:h.length,primitiveOffset:p.length,vertexLength:0,primitiveLength:0},_!==void 0&&(x.sortKey=_),this.segments.push(x)),x}get(){return this.segments}destroy(){for(const s of this.segments)for(const h in s.vaos)s.vaos[h].destroy()}static simpleSegment(s,h,p,_){return new dt([{vertexOffset:s,primitiveOffset:h,vertexLength:p,primitiveLength:_,vaos:{},sortKey:0}])}}function gn(u,s){return 256*(u=Z(Math.floor(u),0,255))+Z(Math.floor(s),0,255)}dt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Pt("SegmentVector",dt);const _t=ei([{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 en={exports:{}},_n={exports:{}};_n.exports=function(u,s){var h,p,_,x,w,I,P,D;for(p=u.length-(h=3&u.length),_=s,w=3432918353,I=461845907,D=0;D>>16)*w&65535)<<16)&4294967295)<<15|P>>>17))*I+(((P>>>16)*I&65535)<<16)&4294967295)<<13|_>>>19))+((5*(_>>>16)&65535)<<16)&4294967295))+((58964+(x>>>16)&65535)<<16);switch(P=0,h){case 3:P^=(255&u.charCodeAt(D+2))<<16;case 2:P^=(255&u.charCodeAt(D+1))<<8;case 1:_^=P=(65535&(P=(P=(65535&(P^=255&u.charCodeAt(D)))*w+(((P>>>16)*w&65535)<<16)&4294967295)<<15|P>>>17))*I+(((P>>>16)*I&65535)<<16)&4294967295}return _^=u.length,_=2246822507*(65535&(_^=_>>>16))+((2246822507*(_>>>16)&65535)<<16)&4294967295,_=3266489909*(65535&(_^=_>>>13))+((3266489909*(_>>>16)&65535)<<16)&4294967295,(_^=_>>>16)>>>0};var Fn=_n.exports,on={exports:{}};on.exports=function(u,s){for(var h,p=u.length,_=s^p,x=0;p>=4;)h=1540483477*(65535&(h=255&u.charCodeAt(x)|(255&u.charCodeAt(++x))<<8|(255&u.charCodeAt(++x))<<16|(255&u.charCodeAt(++x))<<24))+((1540483477*(h>>>16)&65535)<<16),_=1540483477*(65535&_)+((1540483477*(_>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),p-=4,++x;switch(p){case 3:_^=(255&u.charCodeAt(x+2))<<16;case 2:_^=(255&u.charCodeAt(x+1))<<8;case 1:_=1540483477*(65535&(_^=255&u.charCodeAt(x)))+((1540483477*(_>>>16)&65535)<<16)}return _=1540483477*(65535&(_^=_>>>13))+((1540483477*(_>>>16)&65535)<<16),(_^=_>>>15)>>>0};var bn=Fn,Cn=on.exports;en.exports=bn,en.exports.murmur3=bn,en.exports.murmur2=Cn;var Br=d(en.exports);class tr{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(s,h,p,_){this.ids.push(Xo(s)),this.positions.push(h,p,_)}getPositions(s){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const h=Xo(s);let p=0,_=this.ids.length-1;for(;p<_;){const w=p+_>>1;this.ids[w]>=h?_=w:p=w+1}const x=[];for(;this.ids[p]===h;)x.push({index:this.positions[3*p],start:this.positions[3*p+1],end:this.positions[3*p+2]}),p++;return x}static serialize(s,h){const p=new Float64Array(s.ids),_=new Uint32Array(s.positions);return yi(p,_,0,p.length-1),h&&h.push(p.buffer,_.buffer),{ids:p,positions:_}}static deserialize(s){const h=new tr;return h.ids=s.ids,h.positions=s.positions,h.indexed=!0,h}}function Xo(u){const s=+u;return!isNaN(s)&&s<=Number.MAX_SAFE_INTEGER?s:Br(String(u))}function yi(u,s,h,p){for(;h>1];let x=h-1,w=p+1;for(;;){do x++;while(u[x]<_);do w--;while(u[w]>_);if(x>=w)break;Mr(u,x,w),Mr(s,3*x,3*w),Mr(s,3*x+1,3*w+1),Mr(s,3*x+2,3*w+2)}w-h`u_${_}`),this.type=p}setUniform(s,h,p){s.set(p.constantOr(this.value))}getBinding(s,h,p){return this.type==="color"?new dl(s,h):new Yo(s,h)}}class hi{constructor(s,h){this.uniformNames=h.map(p=>`u_${p}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(s,h){this.pixelRatioFrom=h.pixelRatio,this.pixelRatioTo=s.pixelRatio,this.patternFrom=h.tlbr,this.patternTo=s.tlbr}setUniform(s,h,p,_){const x=_==="u_pattern_to"?this.patternTo:_==="u_pattern_from"?this.patternFrom:_==="u_pixel_ratio_to"?this.pixelRatioTo:_==="u_pixel_ratio_from"?this.pixelRatioFrom:null;x&&s.set(x)}getBinding(s,h,p){return p.substr(0,9)==="u_pattern"?new ia(s,h):new Yo(s,h)}}class kr{constructor(s,h,p,_){this.expression=s,this.type=p,this.maxValue=0,this.paintVertexAttributes=h.map(x=>({name:`a_${x}`,type:"Float32",components:p==="color"?2:1,offset:0})),this.paintVertexArray=new _}populatePaintArray(s,h,p,_,x){const w=this.paintVertexArray.length,I=this.expression.evaluate(new Er(0),h,{},_,[],x);this.paintVertexArray.resize(s),this._setPaintValue(w,s,I)}updatePaintArray(s,h,p,_){const x=this.expression.evaluate({zoom:0},p,_);this._setPaintValue(s,h,x)}_setPaintValue(s,h,p){if(this.type==="color"){const _=ml(p);for(let x=s;x`u_${I}_t`),this.type=p,this.useIntegerZoom=_,this.zoom=x,this.maxValue=0,this.paintVertexAttributes=h.map(I=>({name:`a_${I}`,type:"Float32",components:p==="color"?4:2,offset:0})),this.paintVertexArray=new w}populatePaintArray(s,h,p,_,x){const w=this.expression.evaluate(new Er(this.zoom),h,{},_,[],x),I=this.expression.evaluate(new Er(this.zoom+1),h,{},_,[],x),P=this.paintVertexArray.length;this.paintVertexArray.resize(s),this._setPaintValue(P,s,w,I)}updatePaintArray(s,h,p,_){const x=this.expression.evaluate({zoom:this.zoom},p,_),w=this.expression.evaluate({zoom:this.zoom+1},p,_);this._setPaintValue(s,h,x,w)}_setPaintValue(s,h,p,_){if(this.type==="color"){const x=ml(p),w=ml(_);for(let I=s;I`#define HAS_UNIFORM_${_}`))}return s}getBinderAttributes(){const s=[];for(const h in this.binders){const p=this.binders[h];if(p instanceof kr||p instanceof Ir)for(let _=0;_!0){this.programConfigurations={};for(const _ of s)this.programConfigurations[_.id]=new fi(_,h,p);this.needsUpload=!1,this._featureMap=new tr,this._bufferOffset=0}populatePaintArrays(s,h,p,_,x,w){for(const I in this.programConfigurations)this.programConfigurations[I].populatePaintArrays(s,h,_,x,w);h.id!==void 0&&this._featureMap.add(h.id,p,this._bufferOffset,s),this._bufferOffset=s,this.needsUpload=!0}updatePaintArrays(s,h,p,_){for(const x of p)this.needsUpload=this.programConfigurations[x.id].updatePaintArrays(s,this._featureMap,h,x,_)||this.needsUpload}get(s){return this.programConfigurations[s]}upload(s){if(this.needsUpload){for(const h in this.programConfigurations)this.programConfigurations[h].upload(s);this.needsUpload=!1}}destroy(){for(const s in this.programConfigurations)this.programConfigurations[s].destroy()}}function gs(u,s){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"]}[u]||[u.replace(`${s}-`,"").replace(/-/g,"_")]}function pi(u,s,h){const p={color:{source:Bc,composite:rf},number:{source:tf,composite:Bc}},_=function(x){return{"line-pattern":{source:Ie,composite:Ie},"fill-pattern":{source:Ie,composite:Ie},"fill-extrusion-pattern":{source:Ie,composite:Ie}}[x]}(u);return _&&_[h]||p[s][h]}Pt("ConstantBinder",oa),Pt("CrossFadedConstantBinder",hi),Pt("SourceExpressionBinder",kr),Pt("CrossFadedCompositeBinder",ms),Pt("CompositeExpressionBinder",Ir),Pt("ProgramConfiguration",fi,{omit:["_buffers"]}),Pt("ProgramConfigurationSet",Ar);const Xr=8192,td=Math.pow(2,14)-1,gg=-td-1;function Jl(u){const s=Xr/u.extent,h=u.loadGeometry();for(let p=0;pw.x+1||Pw.y+1)&&Ge("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return h}function Ql(u,s){return{type:u.type,id:u.id,properties:u.properties,geometry:s?Jl(u):[]}}function of(u,s,h,p,_){u.emplaceBack(2*s+(p+1)/2,2*h+(_+1)/2)}class gl{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(h=>h.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new $,this.indexArray=new $e,this.segments=new dt,this.programConfigurations=new Ar(s.layers,s.zoom),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(s,h,p){const _=this.layers[0],x=[];let w=null,I=!1;_.type==="circle"&&(w=_.layout.get("circle-sort-key"),I=!w.isConstant());for(const{feature:P,id:D,index:F,sourceLayerIndex:V}of s){const H=this.layers[0]._featureFilter.needGeometry,Y=Ql(P,H);if(!this.layers[0]._featureFilter.filter(new Er(this.zoom),Y,p))continue;const J=I?w.evaluate(Y,{},p):void 0,ie={id:D,properties:P.properties,type:P.type,sourceLayerIndex:V,index:F,geometry:H?Y.geometry:Jl(P),patterns:{},sortKey:J};x.push(ie)}I&&x.sort((P,D)=>P.sortKey-D.sortKey);for(const P of x){const{geometry:D,index:F,sourceLayerIndex:V}=P,H=s[F].feature;this.addFeature(P,D,F,p),h.featureIndex.insert(H,D,F,V,this.index)}}update(s,h,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,h,this.stateDependentLayers,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,ct),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(s,h,p,_){for(const x of h)for(const w of x){const I=w.x,P=w.y;if(I<0||I>=Xr||P<0||P>=Xr)continue;const D=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,s.sortKey),F=D.vertexLength;of(this.layoutVertexArray,I,P,-1,-1),of(this.layoutVertexArray,I,P,1,-1),of(this.layoutVertexArray,I,P,1,1),of(this.layoutVertexArray,I,P,-1,1),this.indexArray.emplaceBack(F,F+1,F+2),this.indexArray.emplaceBack(F,F+3,F+2),D.vertexLength+=4,D.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,p,{},_)}}function nd(u,s){for(let h=0;h1){if(sf(u,s))return!0;for(let p=0;p1?h:h.sub(s)._mult(_)._add(s))}function yb(u,s){let h,p,_,x=!1;for(let w=0;ws.y!=_.y>s.y&&s.x<(_.x-p.x)*(s.y-p.y)/(_.y-p.y)+p.x&&(x=!x)}return x}function af(u,s){let h=!1;for(let p=0,_=u.length-1;ps.y!=w.y>s.y&&s.x<(w.x-x.x)*(s.y-x.y)/(w.y-x.y)+x.x&&(h=!h)}return h}function YT(u,s,h){const p=h[0],_=h[2];if(u.x_.x&&s.x>_.x||u.y_.y&&s.y>_.y)return!1;const x=Te(u,s,h[0]);return x!==Te(u,s,h[1])||x!==Te(u,s,h[2])||x!==Te(u,s,h[3])}function sd(u,s,h){const p=s.paint.get(u).value;return p.kind==="constant"?p.value:h.programConfigurations.get(s.id).getMaxValue(u)}function yg(u){return Math.sqrt(u[0]*u[0]+u[1]*u[1])}function vg(u,s,h,p,_){if(!s[0]&&!s[1])return u;const x=E.convert(s)._mult(_);h==="viewport"&&x._rotate(-p);const w=[];for(let I=0;Iwb(ge,ie))}(D,P),Y=V?F*I:F;for(const J of _)for(const ie of J){const ge=V?ie:wb(ie,P);let we=Y;const Ne=bg([],[ie.x,ie.y,0,1],P);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?we*=Ne[3]/w.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(we*=w.cameraToCenterDistance/Ne[3]),_g(H,ge,we))return!0}return!1}}function wb(u,s){const h=bg([],[u.x,u.y,0,1],s);return new E(h[0]/h[3],h[1]/h[3])}class Sb extends gl{}let Eb;Pt("HeatmapBucket",Sb,{omit:["layers"]});var QT={get paint(){return Eb=Eb||new Mo({"heatmap-radius":new $t(me.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $t(me.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new jt(me.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Hp(me.paint_heatmap["heatmap-color"]),"heatmap-opacity":new jt(me.paint_heatmap["heatmap-opacity"])})}};function Zy(u,{width:s,height:h},p,_){if(_){if(_ instanceof Uint8ClampedArray)_=new Uint8Array(_.buffer);else if(_.length!==s*h*p)throw new RangeError(`mismatched image size. expected: ${_.length} but got: ${s*h*p}`)}else _=new Uint8Array(s*h*p);return u.width=s,u.height=h,u.data=_,u}function Ib(u,{width:s,height:h},p){if(s===u.width&&h===u.height)return;const _=Zy({},{width:s,height:h},p);Xy(u,_,{x:0,y:0},{x:0,y:0},{width:Math.min(u.width,s),height:Math.min(u.height,h)},p),u.width=s,u.height=h,u.data=_.data}function Xy(u,s,h,p,_,x){if(_.width===0||_.height===0)return s;if(_.width>u.width||_.height>u.height||h.x>u.width-_.width||h.y>u.height-_.height)throw new RangeError("out of range source coordinates for image copy");if(_.width>s.width||_.height>s.height||p.x>s.width-_.width||p.y>s.height-_.height)throw new RangeError("out of range destination coordinates for image copy");const w=u.data,I=s.data;if(w===I)throw new Error("srcData equals dstData, so image is already copied");for(let P=0;P<_.height;P++){const D=((h.y+P)*u.width+h.x)*x,F=((p.y+P)*s.width+p.x)*x;for(let V=0;V<_.width*x;V++)I[F+V]=w[D+V]}return s}class ld{constructor(s,h){Zy(this,s,1,h)}resize(s){Ib(this,s,1)}clone(){return new ld({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,h,p,_,x){Xy(s,h,p,_,x,1)}}class Rs{constructor(s,h){Zy(this,s,4,h)}resize(s){Ib(this,s,4)}replace(s,h){h?this.data.set(s):this.data=s instanceof Uint8ClampedArray?new Uint8Array(s.buffer):s}clone(){return new Rs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(s,h,p,_,x){Xy(s,h,p,_,x,4)}}function Cb(u){const s={},h=u.resolution||256,p=u.clips?u.clips.length:1,_=u.image||new Rs({width:h,height:p});if(Math.log(h)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${h}`);const x=(w,I,P)=>{s[u.evaluationKey]=P;const D=u.expression.evaluate(s);_.data[w+I+0]=Math.floor(255*D.r/D.a),_.data[w+I+1]=Math.floor(255*D.g/D.a),_.data[w+I+2]=Math.floor(255*D.b/D.a),_.data[w+I+3]=Math.floor(255*D.a)};if(u.clips)for(let w=0,I=0;w80*h){p=x=u[0],_=w=u[1];for(var J=h;Jx&&(x=I),P>w&&(w=P);D=(D=Math.max(x-p,w-_))!==0?32767/D:0}return ud(H,Y,h,p,_,D,0),Y}function Lb(u,s,h,p,_){var x,w;if(_===Jy(u,s,h,p)>0)for(x=s;x=s;x-=p)w=kb(x,u[x],u[x+1],w);return w&&wg(w,w.next)&&(hd(w),w=w.next),w}function Gc(u,s){if(!u)return u;s||(s=u);var h,p=u;do if(h=!1,p.steiner||!wg(p,p.next)&&ti(p.prev,p,p.next)!==0)p=p.next;else{if(hd(p),(p=s=p.prev)===p.next)break;h=!0}while(h||p!==s);return s}function ud(u,s,h,p,_,x,w){if(u){!w&&x&&function(F,V,H,Y){var J=F;do J.z===0&&(J.z=$y(J.x,J.y,V,H,Y)),J.prevZ=J.prev,J.nextZ=J.next,J=J.next;while(J!==F);J.prevZ.nextZ=null,J.prevZ=null,function(ie){var ge,we,Ne,Ee,Ae,Qe,et,Ct,zt=1;do{for(we=ie,ie=null,Ae=null,Qe=0;we;){for(Qe++,Ne=we,et=0,ge=0;ge0||Ct>0&&Ne;)et!==0&&(Ct===0||!Ne||we.z<=Ne.z)?(Ee=we,we=we.nextZ,et--):(Ee=Ne,Ne=Ne.nextZ,Ct--),Ae?Ae.nextZ=Ee:ie=Ee,Ee.prevZ=Ae,Ae=Ee;we=Ne}Ae.nextZ=null,zt*=2}while(Qe>1)}(J)}(u,p,_,x);for(var I,P,D=u;u.prev!==u.next;)if(I=u.prev,P=u.next,x?sL(u,p,_,x):oL(u))s.push(I.i/h|0),s.push(u.i/h|0),s.push(P.i/h|0),hd(u),u=P.next,D=P.next;else if((u=P)===D){w?w===1?ud(u=aL(Gc(u),s,h),s,h,p,_,x,2):w===2&&lL(u,s,h,p,_,x):ud(Gc(u),s,h,p,_,x,1);break}}}function oL(u){var s=u.prev,h=u,p=u.next;if(ti(s,h,p)>=0)return!1;for(var _=s.x,x=h.x,w=p.x,I=s.y,P=h.y,D=p.y,F=_x?_>w?_:w:x>w?x:w,Y=I>P?I>D?I:D:P>D?P:D,J=p.next;J!==s;){if(J.x>=F&&J.x<=H&&J.y>=V&&J.y<=Y&&uf(_,I,x,P,w,D,J.x,J.y)&&ti(J.prev,J,J.next)>=0)return!1;J=J.next}return!0}function sL(u,s,h,p){var _=u.prev,x=u,w=u.next;if(ti(_,x,w)>=0)return!1;for(var I=_.x,P=x.x,D=w.x,F=_.y,V=x.y,H=w.y,Y=IP?I>D?I:D:P>D?P:D,ge=F>V?F>H?F:H:V>H?V:H,we=$y(Y,J,s,h,p),Ne=$y(ie,ge,s,h,p),Ee=u.prevZ,Ae=u.nextZ;Ee&&Ee.z>=we&&Ae&&Ae.z<=Ne;){if(Ee.x>=Y&&Ee.x<=ie&&Ee.y>=J&&Ee.y<=ge&&Ee!==_&&Ee!==w&&uf(I,F,P,V,D,H,Ee.x,Ee.y)&&ti(Ee.prev,Ee,Ee.next)>=0||(Ee=Ee.prevZ,Ae.x>=Y&&Ae.x<=ie&&Ae.y>=J&&Ae.y<=ge&&Ae!==_&&Ae!==w&&uf(I,F,P,V,D,H,Ae.x,Ae.y)&&ti(Ae.prev,Ae,Ae.next)>=0))return!1;Ae=Ae.nextZ}for(;Ee&&Ee.z>=we;){if(Ee.x>=Y&&Ee.x<=ie&&Ee.y>=J&&Ee.y<=ge&&Ee!==_&&Ee!==w&&uf(I,F,P,V,D,H,Ee.x,Ee.y)&&ti(Ee.prev,Ee,Ee.next)>=0)return!1;Ee=Ee.prevZ}for(;Ae&&Ae.z<=Ne;){if(Ae.x>=Y&&Ae.x<=ie&&Ae.y>=J&&Ae.y<=ge&&Ae!==_&&Ae!==w&&uf(I,F,P,V,D,H,Ae.x,Ae.y)&&ti(Ae.prev,Ae,Ae.next)>=0)return!1;Ae=Ae.nextZ}return!0}function aL(u,s,h){var p=u;do{var _=p.prev,x=p.next.next;!wg(_,x)&&Pb(_,p,p.next,x)&&cd(_,x)&&cd(x,_)&&(s.push(_.i/h|0),s.push(p.i/h|0),s.push(x.i/h|0),hd(p),hd(p.next),p=u=x),p=p.next}while(p!==u);return Gc(p)}function lL(u,s,h,p,_,x){var w=u;do{for(var I=w.next.next;I!==w.prev;){if(w.i!==I.i&&pL(w,I)){var P=Mb(w,I);return w=Gc(w,w.next),P=Gc(P,P.next),ud(w,s,h,p,_,x,0),void ud(P,s,h,p,_,x,0)}I=I.next}w=w.next}while(w!==u)}function uL(u,s){return u.x-s.x}function cL(u,s){var h=function(_,x){var w,I=x,P=_.x,D=_.y,F=-1/0;do{if(D<=I.y&&D>=I.next.y&&I.next.y!==I.y){var V=I.x+(D-I.y)*(I.next.x-I.x)/(I.next.y-I.y);if(V<=P&&V>F&&(F=V,w=I.x=I.x&&I.x>=J&&P!==I.x&&uf(Dw.x||I.x===w.x&&hL(w,I)))&&(w=I,ge=H)),I=I.next;while(I!==Y);return w}(u,s);if(!h)return s;var p=Mb(h,u);return Gc(p,p.next),Gc(h,h.next)}function hL(u,s){return ti(u.prev,u,s.prev)<0&&ti(s.next,u,u.next)<0}function $y(u,s,h,p,_){return(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=(u-h)*_|0)|u<<8))|u<<4))|u<<2))|u<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=(s-p)*_|0)|s<<8))|s<<4))|s<<2))|s<<1))<<1}function fL(u){var s=u,h=u;do(s.x=(u-w)*(x-I)&&(u-w)*(p-I)>=(h-w)*(s-I)&&(h-w)*(x-I)>=(_-w)*(p-I)}function pL(u,s){return u.next.i!==s.i&&u.prev.i!==s.i&&!function(h,p){var _=h;do{if(_.i!==h.i&&_.next.i!==h.i&&_.i!==p.i&&_.next.i!==p.i&&Pb(_,_.next,h,p))return!0;_=_.next}while(_!==h);return!1}(u,s)&&(cd(u,s)&&cd(s,u)&&function(h,p){var _=h,x=!1,w=(h.x+p.x)/2,I=(h.y+p.y)/2;do _.y>I!=_.next.y>I&&_.next.y!==_.y&&w<(_.next.x-_.x)*(I-_.y)/(_.next.y-_.y)+_.x&&(x=!x),_=_.next;while(_!==h);return x}(u,s)&&(ti(u.prev,u,s.prev)||ti(u,s.prev,s))||wg(u,s)&&ti(u.prev,u,u.next)>0&&ti(s.prev,s,s.next)>0)}function ti(u,s,h){return(s.y-u.y)*(h.x-s.x)-(s.x-u.x)*(h.y-s.y)}function wg(u,s){return u.x===s.x&&u.y===s.y}function Pb(u,s,h,p){var _=Eg(ti(u,s,h)),x=Eg(ti(u,s,p)),w=Eg(ti(h,p,u)),I=Eg(ti(h,p,s));return _!==x&&w!==I||!(_!==0||!Sg(u,h,s))||!(x!==0||!Sg(u,p,s))||!(w!==0||!Sg(h,u,p))||!(I!==0||!Sg(h,s,p))}function Sg(u,s,h){return s.x<=Math.max(u.x,h.x)&&s.x>=Math.min(u.x,h.x)&&s.y<=Math.max(u.y,h.y)&&s.y>=Math.min(u.y,h.y)}function Eg(u){return u>0?1:u<0?-1:0}function cd(u,s){return ti(u.prev,u,u.next)<0?ti(u,s,u.next)>=0&&ti(u,u.prev,s)>=0:ti(u,s,u.prev)<0||ti(u,u.next,s)<0}function Mb(u,s){var h=new Ky(u.i,u.x,u.y),p=new Ky(s.i,s.x,s.y),_=u.next,x=s.prev;return u.next=s,s.prev=u,h.next=_,_.prev=h,p.next=h,h.prev=p,x.next=p,p.prev=x,p}function kb(u,s,h,p){var _=new Ky(u,s,h);return p?(_.next=p.next,_.prev=p,p.next.prev=_,p.next=_):(_.prev=_,_.next=_),_}function hd(u){u.next.prev=u.prev,u.prev.next=u.next,u.prevZ&&(u.prevZ.nextZ=u.nextZ),u.nextZ&&(u.nextZ.prevZ=u.prevZ)}function Ky(u,s,h){this.i=u,this.x=s,this.y=h,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Jy(u,s,h,p){for(var _=0,x=s,w=h-p;x0&&h.holes.push(p+=u[_-1].length)}return h};var Ab=d(Yy.exports);function dL(u,s,h,p,_){Db(u,s,h||0,p||u.length-1,_||mL)}function Db(u,s,h,p,_){for(;p>h;){if(p-h>600){var x=p-h+1,w=s-h+1,I=Math.log(x),P=.5*Math.exp(2*I/3),D=.5*Math.sqrt(I*P*(x-P)/x)*(w-x/2<0?-1:1);Db(u,s,Math.max(h,Math.floor(s-w*P/x+D)),Math.min(p,Math.floor(s+(x-w)*P/x+D)),_)}var F=u[s],V=h,H=p;for(fd(u,h,s),_(u[p],F)>0&&fd(u,h,p);V0;)H--}_(u[h],F)===0?fd(u,h,H):fd(u,++H,p),H<=s&&(h=H+1),s<=H&&(p=H-1)}}function fd(u,s,h){var p=u[s];u[s]=u[h],u[h]=p}function mL(u,s){return us?1:0}function Qy(u,s){const h=u.length;if(h<=1)return[u];const p=[];let _,x;for(let w=0;w1)for(let w=0;wh.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new he,this.indexArray=new $e,this.indexArray2=new it,this.programConfigurations=new Ar(s.layers,s.zoom),this.segments=new dt,this.segments2=new dt,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(s,h,p){this.hasPattern=e0("fill",this.layers,h);const _=this.layers[0].layout.get("fill-sort-key"),x=!_.isConstant(),w=[];for(const{feature:I,id:P,index:D,sourceLayerIndex:F}of s){const V=this.layers[0]._featureFilter.needGeometry,H=Ql(I,V);if(!this.layers[0]._featureFilter.filter(new Er(this.zoom),H,p))continue;const Y=x?_.evaluate(H,{},p,h.availableImages):void 0,J={id:P,properties:I.properties,type:I.type,sourceLayerIndex:F,index:D,geometry:V?H.geometry:Jl(I),patterns:{},sortKey:Y};w.push(J)}x&&w.sort((I,P)=>I.sortKey-P.sortKey);for(const I of w){const{geometry:P,index:D,sourceLayerIndex:F}=I;if(this.hasPattern){const V=t0("fill",this.layers,I,this.zoom,h);this.patternFeatures.push(V)}else this.addFeature(I,P,D,p,{});h.featureIndex.insert(s[D].feature,P,D,F,this.index)}}update(s,h,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,h,this.stateDependentLayers,p)}addFeatures(s,h,p){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,h,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,iL),this.indexBuffer=s.createIndexBuffer(this.indexArray),this.indexBuffer2=s.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(s),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(s,h,p,_,x){for(const w of Qy(h,500)){let I=0;for(const Y of w)I+=Y.length;const P=this.segments.prepareSegment(I,this.layoutVertexArray,this.indexArray),D=P.vertexLength,F=[],V=[];for(const Y of w){if(Y.length===0)continue;Y!==w[0]&&V.push(F.length/2);const J=this.segments2.prepareSegment(Y.length,this.layoutVertexArray,this.indexArray2),ie=J.vertexLength;this.layoutVertexArray.emplaceBack(Y[0].x,Y[0].y),this.indexArray2.emplaceBack(ie+Y.length-1,ie),F.push(Y[0].x),F.push(Y[0].y);for(let ge=1;ge>3}if(_--,p===1||p===2)x+=u.readSVarint(),w+=u.readSVarint(),p===1&&(s&&I.push(s),s=[]),s.push(new wL(x,w));else{if(p!==7)throw new Error("unknown command "+p);s&&s.push(s[0].clone())}}return s&&I.push(s),I},cf.prototype.bbox=function(){var u=this._pbf;u.pos=this._geometry;for(var s=u.readVarint()+u.pos,h=1,p=0,_=0,x=0,w=1/0,I=-1/0,P=1/0,D=-1/0;u.pos>3}if(p--,h===1||h===2)(_+=u.readSVarint())I&&(I=_),(x+=u.readSVarint())D&&(D=x);else if(h!==7)throw new Error("unknown command "+h)}return[w,P,I,D]},cf.prototype.toGeoJSON=function(u,s,h){var p,_,x=this.extent*Math.pow(2,h),w=this.extent*u,I=this.extent*s,P=this.loadGeometry(),D=cf.types[this.type];function F(Y){for(var J=0;J>3;_=w===1?p.readString():w===2?p.readFloat():w===3?p.readDouble():w===4?p.readVarint64():w===5?p.readVarint():w===6?p.readSVarint():w===7?p.readBoolean():null}return _}(h))}Fb.prototype.feature=function(u){if(u<0||u>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[u];var s=this._pbf.readVarint()+this._pbf.pos;return new IL(this._pbf,s,this.extent,this._keys,this._values)};var TL=zb;function LL(u,s,h){if(u===3){var p=new TL(h,h.readVarint()+h.pos);p.length&&(s[p.name]=p)}}Bu.VectorTile=function(u,s){this.layers=u.readFields(LL,{},s)},Bu.VectorTileFeature=Ob,Bu.VectorTileLayer=zb;const PL=Bu.VectorTileFeature.types,r0=Math.pow(2,13);function pd(u,s,h,p,_,x,w,I){u.emplaceBack(s,h,2*Math.floor(p*r0)+w,_*r0*2,x*r0*2,Math.round(I))}class i0{constructor(s){this.zoom=s.zoom,this.overscaling=s.overscaling,this.layers=s.layers,this.layerIds=this.layers.map(h=>h.id),this.index=s.index,this.hasPattern=!1,this.layoutVertexArray=new ce,this.centroidVertexArray=new q,this.indexArray=new $e,this.programConfigurations=new Ar(s.layers,s.zoom),this.segments=new dt,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(s,h,p){this.features=[],this.hasPattern=e0("fill-extrusion",this.layers,h);for(const{feature:_,id:x,index:w,sourceLayerIndex:I}of s){const P=this.layers[0]._featureFilter.needGeometry,D=Ql(_,P);if(!this.layers[0]._featureFilter.filter(new Er(this.zoom),D,p))continue;const F={id:x,sourceLayerIndex:I,index:w,geometry:P?D.geometry:Jl(_),properties:_.properties,type:_.type,patterns:{}};this.hasPattern?this.features.push(t0("fill-extrusion",this.layers,F,this.zoom,h)):this.addFeature(F,F.geometry,w,p,{}),h.featureIndex.insert(_,F.geometry,w,I,this.index,!0)}}addFeatures(s,h,p){for(const _ of this.features){const{geometry:x}=_;this.addFeature(_,x,_.index,h,p)}}update(s,h,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,h,this.stateDependentLayers,p)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,xL),this.centroidVertexBuffer=s.createVertexBuffer(this.centroidVertexArray,bL.members,!0),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(s,h,p,_,x){const w={x:0,y:0,vertexCount:0};for(const I of Qy(h,500)){let P=0;for(const J of I)P+=J.length;let D=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const J of I){if(J.length===0||kL(J))continue;let ie=0;for(let ge=0;ge=1){const Ne=J[ge-1];if(!ML(we,Ne)){D.vertexLength+4>dt.MAX_VERTEX_ARRAY_LENGTH&&(D=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ee=we.sub(Ne)._perp()._unit(),Ae=Ne.dist(we);ie+Ae>32768&&(ie=0),pd(this.layoutVertexArray,we.x,we.y,Ee.x,Ee.y,0,0,ie),pd(this.layoutVertexArray,we.x,we.y,Ee.x,Ee.y,0,1,ie),w.x+=2*we.x,w.y+=2*we.y,w.vertexCount+=2,ie+=Ae,pd(this.layoutVertexArray,Ne.x,Ne.y,Ee.x,Ee.y,0,0,ie),pd(this.layoutVertexArray,Ne.x,Ne.y,Ee.x,Ee.y,0,1,ie),w.x+=2*Ne.x,w.y+=2*Ne.y,w.vertexCount+=2;const Qe=D.vertexLength;this.indexArray.emplaceBack(Qe,Qe+2,Qe+1),this.indexArray.emplaceBack(Qe+1,Qe+2,Qe+3),D.vertexLength+=4,D.primitiveLength+=2}}}}if(D.vertexLength+P>dt.MAX_VERTEX_ARRAY_LENGTH&&(D=this.segments.prepareSegment(P,this.layoutVertexArray,this.indexArray)),PL[s.type]!=="Polygon")continue;const F=[],V=[],H=D.vertexLength;for(const J of I)if(J.length!==0){J!==I[0]&&V.push(F.length/2);for(let ie=0;ieXr)||u.y===s.y&&(u.y<0||u.y>Xr)}function kL(u){return u.every(s=>s.x<0)||u.every(s=>s.x>Xr)||u.every(s=>s.y<0)||u.every(s=>s.y>Xr)}let Bb;Pt("FillExtrusionBucket",i0,{omit:["layers","features"]});var AL={get paint(){return Bb=Bb||new Mo({"fill-extrusion-opacity":new jt(me["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $t(me["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new jt(me["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new jt(me["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new $h(me["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $t(me["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $t(me["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new jt(me["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class DL extends Ds{constructor(s){super(s,AL)}createBucket(s){return new i0(s)}queryRadius(){return yg(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(s,h,p,_,x,w,I,P){const D=vg(s,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),w.angle,I),F=this.paint.get("fill-extrusion-height").evaluate(h,p),V=this.paint.get("fill-extrusion-base").evaluate(h,p),H=function(J,ie,ge,we){const Ne=[];for(const Ee of J){const Ae=[Ee.x,Ee.y,0,1];bg(Ae,Ae,ie),Ne.push(new E(Ae[0]/Ae[3],Ae[1]/Ae[3]))}return Ne}(D,P),Y=function(J,ie,ge,we){const Ne=[],Ee=[],Ae=we[8]*ie,Qe=we[9]*ie,et=we[10]*ie,Ct=we[11]*ie,zt=we[8]*ge,It=we[9]*ge,xt=we[10]*ge,ht=we[11]*ge;for(const kt of J){const yt=[],st=[];for(const Yt of kt){const Vt=Yt.x,Pn=Yt.y,xr=we[0]*Vt+we[4]*Pn+we[12],Cr=we[1]*Vt+we[5]*Pn+we[13],xi=we[2]*Vt+we[6]*Pn+we[14],_s=we[3]*Vt+we[7]*Pn+we[15],Ao=xi+et,di=_s+Ct,Gi=xr+zt,Qi=Cr+It,Do=xi+xt,Ro=_s+ht,wi=new E((xr+Ae)/di,(Cr+Qe)/di);wi.z=Ao/di,yt.push(wi);const Si=new E(Gi/Ro,Qi/Ro);Si.z=Do/Ro,st.push(Si)}Ne.push(yt),Ee.push(st)}return[Ne,Ee]}(_,V,F,P);return function(J,ie,ge){let we=1/0;rd(ge,ie)&&(we=Vb(ge,ie[0]));for(let Ne=0;Neh.id),this.index=s.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(h=>{this.gradients[h.id]={}}),this.layoutVertexArray=new ye,this.layoutVertexArray2=new re,this.indexArray=new $e,this.programConfigurations=new Ar(s.layers,s.zoom),this.segments=new dt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(s,h,p){this.hasPattern=e0("line",this.layers,h);const _=this.layers[0].layout.get("line-sort-key"),x=!_.isConstant(),w=[];for(const{feature:I,id:P,index:D,sourceLayerIndex:F}of s){const V=this.layers[0]._featureFilter.needGeometry,H=Ql(I,V);if(!this.layers[0]._featureFilter.filter(new Er(this.zoom),H,p))continue;const Y=x?_.evaluate(H,{},p):void 0,J={id:P,properties:I.properties,type:I.type,sourceLayerIndex:F,index:D,geometry:V?H.geometry:Jl(I),patterns:{},sortKey:Y};w.push(J)}x&&w.sort((I,P)=>I.sortKey-P.sortKey);for(const I of w){const{geometry:P,index:D,sourceLayerIndex:F}=I;if(this.hasPattern){const V=t0("line",this.layers,I,this.zoom,h);this.patternFeatures.push(V)}else this.addFeature(I,P,D,p,{});h.featureIndex.insert(s[D].feature,P,D,F,this.index)}}update(s,h,p){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(s,h,this.stateDependentLayers,p)}addFeatures(s,h,p){for(const _ of this.patternFeatures)this.addFeature(_,_.geometry,_.index,h,p)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(s){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=s.createVertexBuffer(this.layoutVertexArray2,zL)),this.layoutVertexBuffer=s.createVertexBuffer(this.layoutVertexArray,NL),this.indexBuffer=s.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(s),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(s){if(s.properties&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(s.properties,"mapbox_clip_end"))return{start:+s.properties.mapbox_clip_start,end:+s.properties.mapbox_clip_end}}addFeature(s,h,p,_,x){const w=this.layers[0].layout,I=w.get("line-join").evaluate(s,{}),P=w.get("line-cap"),D=w.get("line-miter-limit"),F=w.get("line-round-limit");this.lineClips=this.lineFeatureClips(s);for(const V of h)this.addLine(V,s,I,P,D,F);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,s,p,x,_)}addLine(s,h,p,_,x,w){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let we=0;we=2&&s[P-1].equals(s[P-2]);)P--;let D=0;for(;D0;if(Ct&&we>D){const ht=H.dist(Y);if(ht>2*F){const kt=H.sub(H.sub(Y)._mult(F/ht)._round());this.updateDistance(Y,kt),this.addCurrentVertex(kt,ie,0,0,V),Y=kt}}const It=Y&&J;let xt=It?p:I?"butt":_;if(It&&xt==="round"&&(Qex&&(xt="bevel"),xt==="bevel"&&(Qe>2&&(xt="flipbevel"),Qe100)Ne=ge.mult(-1);else{const ht=Qe*ie.add(ge).mag()/ie.sub(ge).mag();Ne._perp()._mult(ht*(zt?-1:1))}this.addCurrentVertex(H,Ne,0,0,V),this.addCurrentVertex(H,Ne.mult(-1),0,0,V)}else if(xt==="bevel"||xt==="fakeround"){const ht=-Math.sqrt(Qe*Qe-1),kt=zt?ht:0,yt=zt?0:ht;if(Y&&this.addCurrentVertex(H,ie,kt,yt,V),xt==="fakeround"){const st=Math.round(180*et/Math.PI/20);for(let Yt=1;Yt2*F){const kt=H.add(J.sub(H)._mult(F/ht)._round());this.updateDistance(H,kt),this.addCurrentVertex(kt,ge,0,0,V),H=kt}}}}addCurrentVertex(s,h,p,_,x,w=!1){const I=h.y*_-h.x,P=-h.y-h.x*_;this.addHalfVertex(s,h.x+h.y*p,h.y-h.x*p,w,!1,p,x),this.addHalfVertex(s,I,P,w,!0,-_,x),this.distance>Ub/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(s,h,p,_,x,w))}addHalfVertex({x:s,y:h},p,_,x,w,I,P){const D=.5*(this.lineClips?this.scaledDistance*(Ub-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(x?1:0),(h<<1)+(w?1:0),Math.round(63*p)+128,Math.round(63*_)+128,1+(I===0?0:I<0?-1:1)|(63&D)<<2,D>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const F=P.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,F),P.primitiveLength++),w?this.e2=F:this.e1=F}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(s,h){this.distance+=s.dist(h),this.updateScaledDistance()}}let jb,Gb;Pt("LineBucket",o0,{omit:["layers","patternFeatures"]});var qb={get paint(){return Gb=Gb||new Mo({"line-opacity":new $t(me.paint_line["line-opacity"]),"line-color":new $t(me.paint_line["line-color"]),"line-translate":new jt(me.paint_line["line-translate"]),"line-translate-anchor":new jt(me.paint_line["line-translate-anchor"]),"line-width":new $t(me.paint_line["line-width"]),"line-gap-width":new $t(me.paint_line["line-gap-width"]),"line-offset":new $t(me.paint_line["line-offset"]),"line-blur":new $t(me.paint_line["line-blur"]),"line-dasharray":new Oc(me.paint_line["line-dasharray"]),"line-pattern":new $h(me.paint_line["line-pattern"]),"line-gradient":new Hp(me.paint_line["line-gradient"])})},get layout(){return jb=jb||new Mo({"line-cap":new jt(me.layout_line["line-cap"]),"line-join":new $t(me.layout_line["line-join"]),"line-miter-limit":new jt(me.layout_line["line-miter-limit"]),"line-round-limit":new jt(me.layout_line["line-round-limit"]),"line-sort-key":new $t(me.layout_line["line-sort-key"])})}};class VL extends $t{possiblyEvaluate(s,h){return h=new Er(Math.floor(h.zoom),{now:h.now,fadeDuration:h.fadeDuration,zoomHistory:h.zoomHistory,transition:h.transition}),super.possiblyEvaluate(s,h)}evaluate(s,h,p,_){return h=ae({},h,{zoom:Math.floor(h.zoom)}),super.evaluate(s,h,p,_)}}let Ig;class UL extends Ds{constructor(s){super(s,qb),this.gradientVersion=0,Ig||(Ig=new VL(qb.paint.properties["line-width"].specification),Ig.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(s){if(s==="line-gradient"){const h=this.gradientExpression();this.stepInterpolant=!!function(p){return p._styleExpression!==void 0}(h)&&h._styleExpression.expression instanceof Lc,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(s,h){super.recalculate(s,h),this.paint._values["line-floorwidth"]=Ig.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,s)}createBucket(s){return new o0(s)}queryRadius(s){const h=s,p=Wb(sd("line-width",this,h),sd("line-gap-width",this,h)),_=sd("line-offset",this,h);return p/2+Math.abs(_)+yg(this.paint.get("line-translate"))}queryIntersectsFeature(s,h,p,_,x,w,I){const P=vg(s,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),w.angle,I),D=I/2*Wb(this.paint.get("line-width").evaluate(h,p),this.paint.get("line-gap-width").evaluate(h,p)),F=this.paint.get("line-offset").evaluate(h,p);return F&&(_=function(V,H){const Y=[];for(let J=0;J=3){for(let ge=0;ge0?s+2*u:u}const jL=ei([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),GL=ei([{name:"a_projected_pos",components:3,type:"Float32"}],4);ei([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const qL=ei([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ei([{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 Hb=ei([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),WL=ei([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function HL(u,s,h){return u.sections.forEach(p=>{p.text=function(_,x,w){const I=x.layout.get("text-transform").evaluate(w,{});return I==="uppercase"?_=_.toLocaleUpperCase():I==="lowercase"&&(_=_.toLocaleLowerCase()),pl.applyArabicShaping&&(_=pl.applyArabicShaping(_)),_}(p.text,s,h)}),u}ei([{name:"triangle",components:3,type:"Uint16"}]),ei([{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"}]),ei([{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"}]),ei([{type:"Float32",name:"offsetX"}]),ei([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ei([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const md={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var bi=24,Zb=or,Xb=function(u,s,h,p,_){var x,w,I=8*_-p-1,P=(1<>1,F=-7,V=h?_-1:0,H=h?-1:1,Y=u[s+V];for(V+=H,x=Y&(1<<-F)-1,Y>>=-F,F+=I;F>0;x=256*x+u[s+V],V+=H,F-=8);for(w=x&(1<<-F)-1,x>>=-F,F+=p;F>0;w=256*w+u[s+V],V+=H,F-=8);if(x===0)x=1-D;else{if(x===P)return w?NaN:1/0*(Y?-1:1);w+=Math.pow(2,p),x-=D}return(Y?-1:1)*w*Math.pow(2,x-p)},Yb=function(u,s,h,p,_,x){var w,I,P,D=8*x-_-1,F=(1<>1,H=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,Y=p?0:x-1,J=p?1:-1,ie=s<0||s===0&&1/s<0?1:0;for(s=Math.abs(s),isNaN(s)||s===1/0?(I=isNaN(s)?1:0,w=F):(w=Math.floor(Math.log(s)/Math.LN2),s*(P=Math.pow(2,-w))<1&&(w--,P*=2),(s+=w+V>=1?H/P:H*Math.pow(2,1-V))*P>=2&&(w++,P/=2),w+V>=F?(I=0,w=F):w+V>=1?(I=(s*P-1)*Math.pow(2,_),w+=V):(I=s*Math.pow(2,V-1)*Math.pow(2,_),w=0));_>=8;u[h+Y]=255&I,Y+=J,I/=256,_-=8);for(w=w<<_|I,D+=_;D>0;u[h+Y]=255&w,Y+=J,w/=256,D-=8);u[h+Y-J]|=128*ie};function or(u){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(u)?u:new Uint8Array(u||0),this.pos=0,this.type=0,this.length=this.buf.length}or.Varint=0,or.Fixed64=1,or.Bytes=2,or.Fixed32=5;var s0=4294967296,$b=1/s0,Kb=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function eu(u){return u.type===or.Bytes?u.readVarint()+u.pos:u.pos+1}function hf(u,s,h){return h?4294967296*s+(u>>>0):4294967296*(s>>>0)+(u>>>0)}function Jb(u,s,h){var p=s<=16383?1:s<=2097151?2:s<=268435455?3:Math.floor(Math.log(s)/(7*Math.LN2));h.realloc(p);for(var _=h.pos-1;_>=u;_--)h.buf[_+p]=h.buf[_]}function ZL(u,s){for(var h=0;h>>8,u[h+2]=s>>>16,u[h+3]=s>>>24}function Qb(u,s){return(u[s]|u[s+1]<<8|u[s+2]<<16)+(u[s+3]<<24)}or.prototype={destroy:function(){this.buf=null},readFields:function(u,s,h){for(h=h||this.length;this.pos>3,x=this.pos;this.type=7&p,u(_,s,this),this.pos===x&&this.skip(p)}return s},readMessage:function(u,s){return this.readFields(u,s,this.readVarint()+this.pos)},readFixed32:function(){var u=Cg(this.buf,this.pos);return this.pos+=4,u},readSFixed32:function(){var u=Qb(this.buf,this.pos);return this.pos+=4,u},readFixed64:function(){var u=Cg(this.buf,this.pos)+Cg(this.buf,this.pos+4)*s0;return this.pos+=8,u},readSFixed64:function(){var u=Cg(this.buf,this.pos)+Qb(this.buf,this.pos+4)*s0;return this.pos+=8,u},readFloat:function(){var u=Xb(this.buf,this.pos,!0,23,4);return this.pos+=4,u},readDouble:function(){var u=Xb(this.buf,this.pos,!0,52,8);return this.pos+=8,u},readVarint:function(u){var s,h,p=this.buf;return s=127&(h=p[this.pos++]),h<128?s:(s|=(127&(h=p[this.pos++]))<<7,h<128?s:(s|=(127&(h=p[this.pos++]))<<14,h<128?s:(s|=(127&(h=p[this.pos++]))<<21,h<128?s:function(_,x,w){var I,P,D=w.buf;if(I=(112&(P=D[w.pos++]))>>4,P<128||(I|=(127&(P=D[w.pos++]))<<3,P<128)||(I|=(127&(P=D[w.pos++]))<<10,P<128)||(I|=(127&(P=D[w.pos++]))<<17,P<128)||(I|=(127&(P=D[w.pos++]))<<24,P<128)||(I|=(1&(P=D[w.pos++]))<<31,P<128))return hf(_,I,x);throw new Error("Expected varint not more than 10 bytes")}(s|=(15&(h=p[this.pos]))<<28,u,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var u=this.readVarint();return u%2==1?(u+1)/-2:u/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var u=this.readVarint()+this.pos,s=this.pos;return this.pos=u,u-s>=12&&Kb?function(h,p,_){return Kb.decode(h.subarray(p,_))}(this.buf,s,u):function(h,p,_){for(var x="",w=p;w<_;){var I,P,D,F=h[w],V=null,H=F>239?4:F>223?3:F>191?2:1;if(w+H>_)break;H===1?F<128&&(V=F):H===2?(192&(I=h[w+1]))==128&&(V=(31&F)<<6|63&I)<=127&&(V=null):H===3?(P=h[w+2],(192&(I=h[w+1]))==128&&(192&P)==128&&((V=(15&F)<<12|(63&I)<<6|63&P)<=2047||V>=55296&&V<=57343)&&(V=null)):H===4&&(P=h[w+2],D=h[w+3],(192&(I=h[w+1]))==128&&(192&P)==128&&(192&D)==128&&((V=(15&F)<<18|(63&I)<<12|(63&P)<<6|63&D)<=65535||V>=1114112)&&(V=null)),V===null?(V=65533,H=1):V>65535&&(V-=65536,x+=String.fromCharCode(V>>>10&1023|55296),V=56320|1023&V),x+=String.fromCharCode(V),w+=H}return x}(this.buf,s,u)},readBytes:function(){var u=this.readVarint()+this.pos,s=this.buf.subarray(this.pos,u);return this.pos=u,s},readPackedVarint:function(u,s){if(this.type!==or.Bytes)return u.push(this.readVarint(s));var h=eu(this);for(u=u||[];this.pos127;);else if(s===or.Bytes)this.pos=this.readVarint()+this.pos;else if(s===or.Fixed32)this.pos+=4;else{if(s!==or.Fixed64)throw new Error("Unimplemented type: "+s);this.pos+=8}},writeTag:function(u,s){this.writeVarint(u<<3|s)},realloc:function(u){for(var s=this.length||16;s268435455||u<0?function(s,h){var p,_;if(s>=0?(p=s%4294967296|0,_=s/4294967296|0):(_=~(-s/4294967296),4294967295^(p=~(-s%4294967296))?p=p+1|0:(p=0,_=_+1|0)),s>=18446744073709552e3||s<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(x,w,I){I.buf[I.pos++]=127&x|128,x>>>=7,I.buf[I.pos++]=127&x|128,x>>>=7,I.buf[I.pos++]=127&x|128,x>>>=7,I.buf[I.pos++]=127&x|128,I.buf[I.pos]=127&(x>>>=7)}(p,0,h),function(x,w){var I=(7&x)<<4;w.buf[w.pos++]|=I|((x>>>=3)?128:0),x&&(w.buf[w.pos++]=127&x|((x>>>=7)?128:0),x&&(w.buf[w.pos++]=127&x|((x>>>=7)?128:0),x&&(w.buf[w.pos++]=127&x|((x>>>=7)?128:0),x&&(w.buf[w.pos++]=127&x|((x>>>=7)?128:0),x&&(w.buf[w.pos++]=127&x)))))}(_,h)}(u,this):(this.realloc(4),this.buf[this.pos++]=127&u|(u>127?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(u>127?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(u>127?128:0),u<=127||(this.buf[this.pos++]=u>>>7&127))))},writeSVarint:function(u){this.writeVarint(u<0?2*-u-1:2*u)},writeBoolean:function(u){this.writeVarint(!!u)},writeString:function(u){u=String(u),this.realloc(4*u.length),this.pos++;var s=this.pos;this.pos=function(p,_,x){for(var w,I,P=0;P<_.length;P++){if((w=_.charCodeAt(P))>55295&&w<57344){if(!I){w>56319||P+1===_.length?(p[x++]=239,p[x++]=191,p[x++]=189):I=w;continue}if(w<56320){p[x++]=239,p[x++]=191,p[x++]=189,I=w;continue}w=I-55296<<10|w-56320|65536,I=null}else I&&(p[x++]=239,p[x++]=191,p[x++]=189,I=null);w<128?p[x++]=w:(w<2048?p[x++]=w>>6|192:(w<65536?p[x++]=w>>12|224:(p[x++]=w>>18|240,p[x++]=w>>12&63|128),p[x++]=w>>6&63|128),p[x++]=63&w|128)}return x}(this.buf,u,this.pos);var h=this.pos-s;h>=128&&Jb(s,h,this),this.pos=s-1,this.writeVarint(h),this.pos+=h},writeFloat:function(u){this.realloc(4),Yb(this.buf,u,this.pos,!0,23,4),this.pos+=4},writeDouble:function(u){this.realloc(8),Yb(this.buf,u,this.pos,!0,52,8),this.pos+=8},writeBytes:function(u){var s=u.length;this.writeVarint(s),this.realloc(s);for(var h=0;h=128&&Jb(h,p,this),this.pos=h-1,this.writeVarint(p),this.pos+=p},writeMessage:function(u,s,h){this.writeTag(u,or.Bytes),this.writeRawMessage(s,h)},writePackedVarint:function(u,s){s.length&&this.writeMessage(u,ZL,s)},writePackedSVarint:function(u,s){s.length&&this.writeMessage(u,XL,s)},writePackedBoolean:function(u,s){s.length&&this.writeMessage(u,KL,s)},writePackedFloat:function(u,s){s.length&&this.writeMessage(u,YL,s)},writePackedDouble:function(u,s){s.length&&this.writeMessage(u,$L,s)},writePackedFixed32:function(u,s){s.length&&this.writeMessage(u,JL,s)},writePackedSFixed32:function(u,s){s.length&&this.writeMessage(u,QL,s)},writePackedFixed64:function(u,s){s.length&&this.writeMessage(u,eP,s)},writePackedSFixed64:function(u,s){s.length&&this.writeMessage(u,tP,s)},writeBytesField:function(u,s){this.writeTag(u,or.Bytes),this.writeBytes(s)},writeFixed32Field:function(u,s){this.writeTag(u,or.Fixed32),this.writeFixed32(s)},writeSFixed32Field:function(u,s){this.writeTag(u,or.Fixed32),this.writeSFixed32(s)},writeFixed64Field:function(u,s){this.writeTag(u,or.Fixed64),this.writeFixed64(s)},writeSFixed64Field:function(u,s){this.writeTag(u,or.Fixed64),this.writeSFixed64(s)},writeVarintField:function(u,s){this.writeTag(u,or.Varint),this.writeVarint(s)},writeSVarintField:function(u,s){this.writeTag(u,or.Varint),this.writeSVarint(s)},writeStringField:function(u,s){this.writeTag(u,or.Bytes),this.writeString(s)},writeFloatField:function(u,s){this.writeTag(u,or.Fixed32),this.writeFloat(s)},writeDoubleField:function(u,s){this.writeTag(u,or.Fixed64),this.writeDouble(s)},writeBooleanField:function(u,s){this.writeVarintField(u,!!s)}};var a0=d(Zb);const l0=3;function nP(u,s,h){u===1&&h.readMessage(rP,s)}function rP(u,s,h){if(u===3){const{id:p,bitmap:_,width:x,height:w,left:I,top:P,advance:D}=h.readMessage(iP,{});s.push({id:p,bitmap:new ld({width:x+2*l0,height:w+2*l0},_),metrics:{width:x,height:w,left:I,top:P,advance:D}})}}function iP(u,s,h){u===1?s.id=h.readVarint():u===2?s.bitmap=h.readBytes():u===3?s.width=h.readVarint():u===4?s.height=h.readVarint():u===5?s.left=h.readSVarint():u===6?s.top=h.readSVarint():u===7&&(s.advance=h.readVarint())}const ex=l0;function tx(u){let s=0,h=0;for(const w of u)s+=w.w*w.h,h=Math.max(h,w.w);u.sort((w,I)=>I.h-w.h);const p=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(s/.95)),h),h:1/0}];let _=0,x=0;for(const w of u)for(let I=p.length-1;I>=0;I--){const P=p[I];if(!(w.w>P.w||w.h>P.h)){if(w.x=P.x,w.y=P.y,x=Math.max(x,w.y+w.h),_=Math.max(_,w.x+w.w),w.w===P.w&&w.h===P.h){const D=p.pop();I=0&&p>=s&&Lg[this.text.charCodeAt(p)];p--)h--;this.text=this.text.substring(s,h),this.sectionIndex=this.sectionIndex.slice(s,h)}substring(s,h){const p=new pf;return p.text=this.text.substring(s,h),p.sectionIndex=this.sectionIndex.slice(s,h),p.sections=this.sections,p}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((s,h)=>Math.max(s,this.sections[h].scale),0)}addTextSection(s,h){this.text+=s.text,this.sections.push(_d.forText(s.scale,s.fontStack||h));const p=this.sections.length-1;for(let _=0;_=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Tg(u,s,h,p,_,x,w,I,P,D,F,V,H,Y,J,ie){const ge=pf.fromFeature(u,_);let we;V===c.ah.vertical&&ge.verticalizePunctuation();const{processBidirectionalText:Ne,processStyledBidirectionalText:Ee}=pl;if(Ne&&ge.sections.length===1){we=[];const et=Ne(ge.toString(),c0(ge,D,x,s,p,Y,J));for(const Ct of et){const zt=new pf;zt.text=Ct,zt.sections=ge.sections;for(let It=0;It0&&nu>Ko&&(Ko=nu)}else{const Os=zt[An.fontStack],Qo=Os&&Os[eo];if(Qo&&Qo.rect)Va=Qo.rect,sa=Qo.metrics;else{const nu=Ct[An.fontStack],wd=nu&&nu[eo];if(!wd)continue;sa=wd.metrics}Ii=(Si-An.scale)*bi}aa?(et.verticalizable=!0,yo.push({glyph:eo,imageName:Ua,x:xr,y:Cr+Ii,vertical:aa,scale:An.scale,fontStack:An.fontStack,sectionIndex:vo,metrics:sa,rect:Va}),xr+=tu*An.scale+Yt):(yo.push({glyph:eo,imageName:Ua,x:xr,y:Cr+Ii,vertical:aa,scale:An.scale,fontStack:An.fontStack,sectionIndex:vo,metrics:sa,rect:Va}),xr+=sa.advance*An.scale+Yt)}yo.length!==0&&(xi=Math.max(xr-Yt,xi),aP(yo,0,yo.length-1,Ao,Ko)),xr=0;const Jo=ht*Si+Ko;No.lineOffset=Math.max(Ko,_o),Cr+=Jo,_s=Math.max(Jo,_s),++di}var Gi;const Qi=Cr-gd,{horizontalAlign:Do,verticalAlign:Ro}=h0(kt);(function(wi,Si,_o,No,yo,Ko,Jo,Ei,An){const vo=(Si-_o)*yo;let eo=0;eo=Ko!==Jo?-Ei*No-gd:(-No*An+.5)*Jo;for(const Ii of wi)for(const sa of Ii.positionedGlyphs)sa.x+=vo,sa.y+=eo})(et.positionedLines,Ao,Do,Ro,xi,_s,ht,Qi,xt.length),et.top+=-Ro*Qi,et.bottom=et.top+Qi,et.left+=-Do*xi,et.right=et.left+xi}(Qe,s,h,p,we,w,I,P,V,D,H,ie),!function(et){for(const Ct of et)if(Ct.positionedGlyphs.length!==0)return!1;return!0}(Ae)&&Qe}const Lg={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},oP={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 rx(u,s,h,p,_,x){if(s.imageName){const w=p[s.imageName];return w?w.displaySize[0]*s.scale*bi/x+_:0}{const w=h[s.fontStack],I=w&&w[u];return I?I.metrics.advance*s.scale+_:0}}function ix(u,s,h,p){const _=Math.pow(u-s,2);return p?u=0;let F=0;for(let H=0;Hw.id),this.index=s.index,this.pixelRatio=s.pixelRatio,this.sourceLayerIndex=s.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Hy([]),this.placementViewportMatrix=Hy([]);const h=this.layers[0]._unevaluatedLayout._values;this.textSizeData=lx(this.zoom,h["text-size"]),this.iconSizeData=lx(this.zoom,h["icon-size"]);const p=this.layers[0].layout,_=p.get("symbol-sort-key"),x=p.get("symbol-z-order");this.canOverlap=f0(p,"text-overlap","text-allow-overlap")!=="never"||f0(p,"icon-overlap","icon-allow-overlap")!=="never"||p.get("text-ignore-placement")||p.get("icon-ignore-placement"),this.sortFeaturesByKey=x!=="viewport-y"&&!_.isConstant(),this.sortFeaturesByY=(x==="viewport-y"||x==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,p.get("symbol-placement")==="point"&&(this.writingModes=p.get("text-writing-mode").map(w=>c.ah[w])),this.stateDependentLayerIds=this.layers.filter(w=>w.isStateDependent()).map(w=>w.id),this.sourceID=s.sourceID}createArrays(){this.text=new d0(new Ar(this.layers,this.zoom,s=>/^text/.test(s))),this.icon=new d0(new Ar(this.layers,this.zoom,s=>/^icon/.test(s))),this.glyphOffsetArray=new b,this.lineVertexArray=new T,this.symbolInstances=new g,this.textAnchorOffsets=new k}calculateGlyphDependencies(s,h,p,_,x){for(let w=0;w0)&&(w.value.kind!=="constant"||w.value.value.length>0),F=P.value.kind!=="constant"||!!P.value.value||Object.keys(P.parameters).length>0,V=x.get("symbol-sort-key");if(this.features=[],!D&&!F)return;const H=h.iconDependencies,Y=h.glyphDependencies,J=h.availableImages,ie=new Er(this.zoom);for(const{feature:ge,id:we,index:Ne,sourceLayerIndex:Ee}of s){const Ae=_._featureFilter.needGeometry,Qe=Ql(ge,Ae);if(!_._featureFilter.filter(ie,Qe,p))continue;let et,Ct;if(Ae||(Qe.geometry=Jl(ge)),D){const It=_.getValueAndResolveTokens("text-field",Qe,p,J),xt=Wo.factory(It),ht=this.hasRTLText=this.hasRTLText||hP(xt);(!ht||pl.getRTLTextPluginStatus()==="unavailable"||ht&&pl.isParsed())&&(et=HL(xt,_,Qe))}if(F){const It=_.getValueAndResolveTokens("icon-image",Qe,p,J);Ct=It instanceof ds?It:ds.fromString(It)}if(!et&&!Ct)continue;const zt=this.sortFeaturesByKey?V.evaluate(Qe,{},p):void 0;if(this.features.push({id:we,text:et,icon:Ct,index:Ne,sourceLayerIndex:Ee,geometry:Qe.geometry,properties:ge.properties,type:uP[ge.type],sortKey:zt}),Ct&&(H[Ct.name]=!0),et){const It=w.evaluate(Qe,{},p).join(","),xt=x.get("text-rotation-alignment")!=="viewport"&&x.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(c.ah.vertical)>=0;for(const ht of et.sections)if(ht.image)H[ht.image.name]=!0;else{const kt=zu(et.toString()),yt=ht.fontStack||It,st=Y[yt]=Y[yt]||{};this.calculateGlyphDependencies(ht.text,st,xt,this.allowVerticalPlacement,kt)}}}x.get("symbol-placement")==="line"&&(this.features=function(ge){const we={},Ne={},Ee=[];let Ae=0;function Qe(It){Ee.push(ge[It]),Ae++}function et(It,xt,ht){const kt=Ne[It];return delete Ne[It],Ne[xt]=kt,Ee[kt].geometry[0].pop(),Ee[kt].geometry[0]=Ee[kt].geometry[0].concat(ht[0]),kt}function Ct(It,xt,ht){const kt=we[xt];return delete we[xt],we[It]=kt,Ee[kt].geometry[0].shift(),Ee[kt].geometry[0]=ht[0].concat(Ee[kt].geometry[0]),kt}function zt(It,xt,ht){const kt=ht?xt[0][xt[0].length-1]:xt[0][0];return`${It}:${kt.x}:${kt.y}`}for(let It=0;ItIt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ge,we)=>ge.sortKey-we.sortKey)}update(s,h,p){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(s,h,this.layers,p),this.icon.programConfigurations.updatePaintArrays(s,h,this.layers,p))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(s){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(s),this.iconCollisionBox.upload(s)),this.text.upload(s,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(s,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(s,h){const p=this.lineVertexArray.length;if(s.segment!==void 0){let _=s.dist(h[s.segment+1]),x=s.dist(h[s.segment]);const w={};for(let I=s.segment+1;I=0;I--)w[I]={x:h[I].x,y:h[I].y,tileUnitDistanceFromAnchor:x},I>0&&(x+=h[I-1].dist(h[I]));for(let I=0;I0}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(s,h){const p=s.placedSymbolArray.get(h),_=p.vertexStartIndex+4*p.numGlyphs;for(let x=p.vertexStartIndex;x<_;x+=4)s.indexArray.emplaceBack(x,x+1,x+2),s.indexArray.emplaceBack(x+1,x+2,x+3)}getSortedSymbolIndexes(s){if(this.sortedAngle===s&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const h=Math.sin(s),p=Math.cos(s),_=[],x=[],w=[];for(let I=0;I_[I]-_[P]||x[P]-x[I]),w}addToSortKeyRanges(s,h){const p=this.sortKeyRanges[this.sortKeyRanges.length-1];p&&p.sortKey===h?p.symbolInstanceEnd=s+1:this.sortKeyRanges.push({sortKey:h,symbolInstanceStart:s,symbolInstanceEnd:s+1})}sortFeatures(s){if(this.sortFeaturesByY&&this.sortedAngle!==s&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(s),this.sortedAngle=s,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const h of this.symbolInstanceIndexes){const p=this.symbolInstances.get(h);this.featureSortOrder.push(p.featureIndex),[p.rightJustifiedTextSymbolIndex,p.centerJustifiedTextSymbolIndex,p.leftJustifiedTextSymbolIndex].forEach((_,x,w)=>{_>=0&&w.indexOf(_)===x&&this.addIndicesForPlacedSymbol(this.text,_)}),p.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,p.verticalPlacedTextSymbolIndex),p.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.placedIconSymbolIndex),p.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,p.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let ux,cx;Pt("SymbolBucket",df,{omit:["layers","collisionBoxArray","features","compareText"]}),df.MAX_GLYPHS=65535,df.addDynamicAttributes=p0;var g0={get paint(){return cx=cx||new Mo({"icon-opacity":new $t(me.paint_symbol["icon-opacity"]),"icon-color":new $t(me.paint_symbol["icon-color"]),"icon-halo-color":new $t(me.paint_symbol["icon-halo-color"]),"icon-halo-width":new $t(me.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $t(me.paint_symbol["icon-halo-blur"]),"icon-translate":new jt(me.paint_symbol["icon-translate"]),"icon-translate-anchor":new jt(me.paint_symbol["icon-translate-anchor"]),"text-opacity":new $t(me.paint_symbol["text-opacity"]),"text-color":new $t(me.paint_symbol["text-color"],{runtimeType:Zr,getOverride:u=>u.textColor,hasOverride:u=>!!u.textColor}),"text-halo-color":new $t(me.paint_symbol["text-halo-color"]),"text-halo-width":new $t(me.paint_symbol["text-halo-width"]),"text-halo-blur":new $t(me.paint_symbol["text-halo-blur"]),"text-translate":new jt(me.paint_symbol["text-translate"]),"text-translate-anchor":new jt(me.paint_symbol["text-translate-anchor"])})},get layout(){return ux=ux||new Mo({"symbol-placement":new jt(me.layout_symbol["symbol-placement"]),"symbol-spacing":new jt(me.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new jt(me.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $t(me.layout_symbol["symbol-sort-key"]),"symbol-z-order":new jt(me.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new jt(me.layout_symbol["icon-allow-overlap"]),"icon-overlap":new jt(me.layout_symbol["icon-overlap"]),"icon-ignore-placement":new jt(me.layout_symbol["icon-ignore-placement"]),"icon-optional":new jt(me.layout_symbol["icon-optional"]),"icon-rotation-alignment":new jt(me.layout_symbol["icon-rotation-alignment"]),"icon-size":new $t(me.layout_symbol["icon-size"]),"icon-text-fit":new jt(me.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new jt(me.layout_symbol["icon-text-fit-padding"]),"icon-image":new $t(me.layout_symbol["icon-image"]),"icon-rotate":new $t(me.layout_symbol["icon-rotate"]),"icon-padding":new $t(me.layout_symbol["icon-padding"]),"icon-keep-upright":new jt(me.layout_symbol["icon-keep-upright"]),"icon-offset":new $t(me.layout_symbol["icon-offset"]),"icon-anchor":new $t(me.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new jt(me.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new jt(me.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new jt(me.layout_symbol["text-rotation-alignment"]),"text-field":new $t(me.layout_symbol["text-field"]),"text-font":new $t(me.layout_symbol["text-font"]),"text-size":new $t(me.layout_symbol["text-size"]),"text-max-width":new $t(me.layout_symbol["text-max-width"]),"text-line-height":new jt(me.layout_symbol["text-line-height"]),"text-letter-spacing":new $t(me.layout_symbol["text-letter-spacing"]),"text-justify":new $t(me.layout_symbol["text-justify"]),"text-radial-offset":new $t(me.layout_symbol["text-radial-offset"]),"text-variable-anchor":new jt(me.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new $t(me.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new $t(me.layout_symbol["text-anchor"]),"text-max-angle":new jt(me.layout_symbol["text-max-angle"]),"text-writing-mode":new jt(me.layout_symbol["text-writing-mode"]),"text-rotate":new $t(me.layout_symbol["text-rotate"]),"text-padding":new jt(me.layout_symbol["text-padding"]),"text-keep-upright":new jt(me.layout_symbol["text-keep-upright"]),"text-transform":new $t(me.layout_symbol["text-transform"]),"text-offset":new $t(me.layout_symbol["text-offset"]),"text-allow-overlap":new jt(me.layout_symbol["text-allow-overlap"]),"text-overlap":new jt(me.layout_symbol["text-overlap"]),"text-ignore-placement":new jt(me.layout_symbol["text-ignore-placement"]),"text-optional":new jt(me.layout_symbol["text-optional"])})}};class hx{constructor(s){if(s.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=s.property.overrides?s.property.overrides.runtimeType:li,this.defaultValue=s}evaluate(s){if(s.formattedSection){const h=this.defaultValue.property.overrides;if(h&&h.hasOverride(s.formattedSection))return h.getOverride(s.formattedSection)}return s.feature&&s.featureState?this.defaultValue.evaluate(s.feature,s.featureState):this.defaultValue.property.specification.default}eachChild(s){this.defaultValue.isConstant()||s(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Pt("FormatSectionOverride",hx,{omit:["defaultValue"]});class Mg extends Ds{constructor(s){super(s,g0)}recalculate(s,h){if(super.recalculate(s,h),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 p=this.layout.get("text-writing-mode");if(p){const _=[];for(const x of p)_.indexOf(x)<0&&_.push(x);this.layout._values["text-writing-mode"]=_}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(s,h,p,_){const x=this.layout.get(s).evaluate(h,{},p,_),w=this._unevaluatedLayout._values[s];return w.isDataDriven()||ur(w.value)||!x?x:function(I,P){return P.replace(/{([^{}]+)}/g,(D,F)=>I&&F in I?String(I[F]):"")}(h.properties,x)}createBucket(s){return new df(s)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const s of g0.paint.overridableProperties){if(!Mg.hasPaintOverride(this.layout,s))continue;const h=this.paint.get(s),p=new hx(h),_=new br(p,h.property.specification);let x=null;x=h.value.kind==="constant"||h.value.kind==="source"?new Oh("source",_):new Np("composite",_,h.value.zoomStops),this.paint._values[s]=new As(h.property,x,h.parameters)}}_handleOverridablePaintPropertyUpdate(s,h,p){return!(!this.layout||h.isDataDriven()||p.isDataDriven())&&Mg.hasPaintOverride(this.layout,s)}static hasPaintOverride(s,h){const p=s.get("text-field"),_=g0.paint.properties[h];let x=!1;const w=I=>{for(const P of I)if(_.overrides&&_.overrides.hasOverride(P))return void(x=!0)};if(p.value.kind==="constant"&&p.value.value instanceof Wo)w(p.value.value.sections);else if(p.value.kind==="source"){const I=D=>{x||(D instanceof ll&&ci(D.value)===Jr?w(D.value.sections):D instanceof Rh?w(D.sections):D.eachChild(I))},P=p.value;P._styleExpression&&I(P._styleExpression.expression)}return x}}let fx;var fP={get paint(){return fx=fx||new Mo({"background-color":new jt(me.paint_background["background-color"]),"background-pattern":new Oc(me.paint_background["background-pattern"]),"background-opacity":new jt(me.paint_background["background-opacity"])})}};class pP extends Ds{constructor(s){super(s,fP)}}let px;var dP={get paint(){return px=px||new Mo({"raster-opacity":new jt(me.paint_raster["raster-opacity"]),"raster-hue-rotate":new jt(me.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new jt(me.paint_raster["raster-brightness-min"]),"raster-brightness-max":new jt(me.paint_raster["raster-brightness-max"]),"raster-saturation":new jt(me.paint_raster["raster-saturation"]),"raster-contrast":new jt(me.paint_raster["raster-contrast"]),"raster-resampling":new jt(me.paint_raster["raster-resampling"]),"raster-fade-duration":new jt(me.paint_raster["raster-fade-duration"])})}};class mP extends Ds{constructor(s){super(s,dP)}}class gP extends Ds{constructor(s){super(s,{}),this.onAdd=h=>{this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},this.onRemove=h=>{this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},this.implementation=s}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(s){this._methodToThrottle=s,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const _0=63710088e-1;class ju{constructor(s,h){if(isNaN(s)||isNaN(h))throw new Error(`Invalid LngLat object: (${s}, ${h})`);if(this.lng=+s,this.lat=+h,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ju(ue(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(s){const h=Math.PI/180,p=this.lat*h,_=s.lat*h,x=Math.sin(p)*Math.sin(_)+Math.cos(p)*Math.cos(_)*Math.cos((s.lng-this.lng)*h);return _0*Math.acos(Math.min(x,1))}static convert(s){if(s instanceof ju)return s;if(Array.isArray(s)&&(s.length===2||s.length===3))return new ju(Number(s[0]),Number(s[1]));if(!Array.isArray(s)&&typeof s=="object"&&s!==null)return new ju(Number("lng"in s?s.lng:s.lon),Number(s.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 dx=2*Math.PI*_0;function mx(u){return dx*Math.cos(u*Math.PI/180)}function gx(u){return(180+u)/360}function _x(u){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360}function yx(u,s){return u/mx(s)}function y0(u){return 360/Math.PI*Math.atan(Math.exp((180-360*u)*Math.PI/180))-90}class kg{constructor(s,h,p=0){this.x=+s,this.y=+h,this.z=+p}static fromLngLat(s,h=0){const p=ju.convert(s);return new kg(gx(p.lng),_x(p.lat),yx(h,p.lat))}toLngLat(){return new ju(360*this.x-180,y0(this.y))}toAltitude(){return this.z*mx(y0(this.y))}meterInMercatorCoordinateUnits(){return 1/dx*(s=y0(this.y),1/Math.cos(s*Math.PI/180));var s}}function vx(u,s,h){var p=2*Math.PI*6378137/256/Math.pow(2,h);return[u*p-2*Math.PI*6378137/2,s*p-2*Math.PI*6378137/2]}class v0{constructor(s,h,p){if(s<0||s>25||p<0||p>=Math.pow(2,s)||h<0||h>=Math.pow(2,s))throw new Error(`x=${h}, y=${p}, z=${s} outside of bounds. 0<=x<${Math.pow(2,s)}, 0<=y<${Math.pow(2,s)} 0<=z<=25 `);this.z=s,this.x=h,this.y=p,this.key=vd(0,s,s,h,p)}equals(s){return this.z===s.z&&this.x===s.x&&this.y===s.y}url(s,h,p){const _=(w=this.y,I=this.z,P=vx(256*(x=this.x),256*(w=Math.pow(2,I)-w-1),I),D=vx(256*(x+1),256*(w+1),I),P[0]+","+P[1]+","+D[0]+","+D[1]);var x,w,I,P,D;const F=function(V,H,Y){let J,ie="";for(let ge=V;ge>0;ge--)J=1<1?"@2x":"").replace(/{quadkey}/g,F).replace(/{bbox-epsg-3857}/g,_)}isChildOf(s){const h=this.z-s.z;return h>0&&s.x===this.x>>h&&s.y===this.y>>h}getTilePoint(s){const h=Math.pow(2,this.z);return new E((s.x*h-this.x)*Xr,(s.y*h-this.y)*Xr)}toString(){return`${this.z}/${this.x}/${this.y}`}}class bx{constructor(s,h){this.wrap=s,this.canonical=h,this.key=vd(s,h.z,h.z,h.x,h.y)}}class Ns{constructor(s,h,p,_,x){if(s= z; overscaledZ = ${s}; z = ${p}`);this.overscaledZ=s,this.wrap=h,this.canonical=new v0(p,+_,+x),this.key=vd(h,s,p,_,x)}clone(){return new Ns(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(s){return this.overscaledZ===s.overscaledZ&&this.wrap===s.wrap&&this.canonical.equals(s.canonical)}scaledTo(s){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const h=this.canonical.z-s;return s>this.canonical.z?new Ns(s,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ns(s,this.wrap,s,this.canonical.x>>h,this.canonical.y>>h)}calculateScaledKey(s,h){if(s>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${s}; overscaledZ = ${this.overscaledZ}`);const p=this.canonical.z-s;return s>this.canonical.z?vd(this.wrap*+h,s,this.canonical.z,this.canonical.x,this.canonical.y):vd(this.wrap*+h,s,s,this.canonical.x>>p,this.canonical.y>>p)}isChildOf(s){if(s.wrap!==this.wrap)return!1;const h=this.canonical.z-s.canonical.z;return s.overscaledZ===0||s.overscaledZ>h&&s.canonical.y===this.canonical.y>>h}children(s){if(this.overscaledZ>=s)return[new Ns(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const h=this.canonical.z+1,p=2*this.canonical.x,_=2*this.canonical.y;return[new Ns(h,this.wrap,h,p,_),new Ns(h,this.wrap,h,p+1,_),new Ns(h,this.wrap,h,p,_+1),new Ns(h,this.wrap,h,p+1,_+1)]}isLessThan(s){return this.wraps.wrap)&&(this.overscaledZs.overscaledZ)&&(this.canonical.xs.canonical.x)&&this.canonical.ythis.max&&(this.max=V),V=this.dim+1||h<-1||h>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(h+1)*this.stride+(s+1)}unpack(s,h,p){return s*this.redFactor+h*this.greenFactor+p*this.blueFactor-this.baseShift}getPixels(){return new Rs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(s,h,p){if(this.dim!==s.dim)throw new Error("dem dimension mismatch");let _=h*this.dim,x=h*this.dim+this.dim,w=p*this.dim,I=p*this.dim+this.dim;switch(h){case-1:_=x-1;break;case 1:x=_+1}switch(p){case-1:w=I-1;break;case 1:I=w+1}const P=-h*this.dim,D=-p*this.dim;for(let F=w;F=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${s} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[s]}}class Sx{constructor(s,h,p,_,x){this.type="Feature",this._vectorTileFeature=s,s._z=h,s._x=p,s._y=_,this.properties=s.properties,this.id=x}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(s){this._geometry=s}toJSON(){const s={geometry:this.geometry};for(const h in this)h!=="_geometry"&&h!=="_vectorTileFeature"&&(s[h]=this[h]);return s}}class Ex{constructor(s,h){this.tileID=s,this.x=s.canonical.x,this.y=s.canonical.y,this.z=s.canonical.z,this.grid=new Dc(Xr,16,0),this.grid3D=new Dc(Xr,16,0),this.featureIndexArray=new j,this.promoteId=h}insert(s,h,p,_,x,w){const I=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(p,_,x);const P=w?this.grid3D:this.grid;for(let D=0;D=0&&V[3]>=0&&P.insert(I,V[0],V[1],V[2],V[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Bu.VectorTile(new a0(this.rawTileData)).layers,this.sourceLayerCoder=new wx(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(s,h,p,_){this.loadVTLayers();const x=s.params||{},w=Xr/s.tileSize/s.scale,I=Vh(x.filter),P=s.queryGeometry,D=s.queryPadding*w,F=Cx(P),V=this.grid.query(F.minX-D,F.minY-D,F.maxX+D,F.maxY+D),H=Cx(s.cameraQueryGeometry),Y=this.grid3D.query(H.minX-D,H.minY-D,H.maxX+D,H.maxY+D,(ge,we,Ne,Ee)=>function(Ae,Qe,et,Ct,zt){for(const xt of Ae)if(Qe<=xt.x&&et<=xt.y&&Ct>=xt.x&&zt>=xt.y)return!0;const It=[new E(Qe,et),new E(Qe,zt),new E(Ct,zt),new E(Ct,et)];if(Ae.length>2){for(const xt of It)if(af(Ae,xt))return!0}for(let xt=0;xt(Ee||(Ee=Jl(Ae)),Qe.queryIntersectsFeature(P,Ae,et,Ee,this.z,s.transform,w,s.pixelPosMatrix)))}return J}loadMatchingFeature(s,h,p,_,x,w,I,P,D,F,V){const H=this.bucketLayerIDs[h];if(w&&!function(ge,we){for(let Ne=0;Ne=0)return!0;return!1}(w,H))return;const Y=this.sourceLayerCoder.decode(p),J=this.vtLayers[Y].feature(_);if(x.needGeometry){const ge=Ql(J,!0);if(!x.filter(new Er(this.tileID.overscaledZ),ge,this.tileID.canonical))return}else if(!x.filter(new Er(this.tileID.overscaledZ),J))return;const ie=this.getId(J,Y);for(let ge=0;ge{const I=s instanceof Nc?s.get(w):null;return I&&I.evaluate?I.evaluate(h,p,_):I})}function Cx(u){let s=1/0,h=1/0,p=-1/0,_=-1/0;for(const x of u)s=Math.min(s,x.x),h=Math.min(h,x.y),p=Math.max(p,x.x),_=Math.max(_,x.y);return{minX:s,minY:h,maxX:p,maxY:_}}function yP(u,s){return s-u}function Tx(u,s,h,p,_){const x=[];for(let w=0;w=p&&V.x>=p||(F.x>=p?F=new E(p,F.y+(p-F.x)/(V.x-F.x)*(V.y-F.y))._round():V.x>=p&&(V=new E(p,F.y+(p-F.x)/(V.x-F.x)*(V.y-F.y))._round()),F.y>=_&&V.y>=_||(F.y>=_?F=new E(F.x+(_-F.y)/(V.y-F.y)*(V.x-F.x),_)._round():V.y>=_&&(V=new E(F.x+(_-F.y)/(V.y-F.y)*(V.x-F.x),_)._round()),P&&F.equals(P[P.length-1])||(P=[F],x.push(P)),P.push(V)))))}}return x}Pt("FeatureIndex",Ex,{omit:["rawTileData","sourceLayerCoder"]});class Gu extends E{constructor(s,h,p,_){super(s,h),this.angle=p,_!==void 0&&(this.segment=_)}clone(){return new Gu(this.x,this.y,this.angle,this.segment)}}function Lx(u,s,h,p,_){if(s.segment===void 0||h===0)return!0;let x=s,w=s.segment+1,I=0;for(;I>-h/2;){if(w--,w<0)return!1;I-=u[w].dist(x),x=u[w]}I+=u[w].dist(u[w+1]),w++;const P=[];let D=0;for(;Ip;)D-=P.shift().angleDelta;if(D>_)return!1;w++,I+=F.dist(V)}return!0}function Px(u){let s=0;for(let h=0;hD){const J=(D-P)/Y,ie=mo.number(V.x,H.x,J),ge=mo.number(V.y,H.y,J),we=new Gu(ie,ge,H.angleTo(V),F);return we._round(),!w||Lx(u,we,I,w,s)?we:void 0}P+=Y}}function bP(u,s,h,p,_,x,w,I,P){const D=Mx(p,x,w),F=kx(p,_),V=F*w,H=u[0].x===0||u[0].x===P||u[0].y===0||u[0].y===P;return s-V=0&&Ae=0&&Qe=0&&H+D<=F){const et=new Gu(Ae,Qe,Ne,J);et._round(),p&&!Lx(u,et,x,p,_)||Y.push(et)}}V+=we}return I||Y.length||w||(Y=Ax(u,V/2,h,p,_,x,w,!0,P)),Y}Pt("Anchor",Gu);const mf=$o;function Dx(u,s,h,p){const _=[],x=u.image,w=x.pixelRatio,I=x.paddedRect.w-2*mf,P=x.paddedRect.h-2*mf,D=u.right-u.left,F=u.bottom-u.top,V=x.stretchX||[[0,I]],H=x.stretchY||[[0,P]],Y=(ht,kt)=>ht+kt[1]-kt[0],J=V.reduce(Y,0),ie=H.reduce(Y,0),ge=I-J,we=P-ie;let Ne=0,Ee=J,Ae=0,Qe=ie,et=0,Ct=ge,zt=0,It=we;if(x.content&&p){const ht=x.content;Ne=Ag(V,0,ht[0]),Ae=Ag(H,0,ht[1]),Ee=Ag(V,ht[0],ht[2]),Qe=Ag(H,ht[1],ht[3]),et=ht[0]-Ne,zt=ht[1]-Ae,Ct=ht[2]-ht[0]-Ee,It=ht[3]-ht[1]-Qe}const xt=(ht,kt,yt,st)=>{const Yt=Dg(ht.stretch-Ne,Ee,D,u.left),Vt=Rg(ht.fixed-et,Ct,ht.stretch,J),Pn=Dg(kt.stretch-Ae,Qe,F,u.top),xr=Rg(kt.fixed-zt,It,kt.stretch,ie),Cr=Dg(yt.stretch-Ne,Ee,D,u.left),xi=Rg(yt.fixed-et,Ct,yt.stretch,J),_s=Dg(st.stretch-Ae,Qe,F,u.top),Ao=Rg(st.fixed-zt,It,st.stretch,ie),di=new E(Yt,Pn),Gi=new E(Cr,Pn),Qi=new E(Cr,_s),Do=new E(Yt,_s),Ro=new E(Vt/w,xr/w),wi=new E(xi/w,Ao/w),Si=s*Math.PI/180;if(Si){const yo=Math.sin(Si),Ko=Math.cos(Si),Jo=[Ko,-yo,yo,Ko];di._matMult(Jo),Gi._matMult(Jo),Do._matMult(Jo),Qi._matMult(Jo)}const _o=ht.stretch+ht.fixed,No=kt.stretch+kt.fixed;return{tl:di,tr:Gi,bl:Do,br:Qi,tex:{x:x.paddedRect.x+mf+_o,y:x.paddedRect.y+mf+No,w:yt.stretch+yt.fixed-_o,h:st.stretch+st.fixed-No},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ro,pixelOffsetBR:wi,minFontScaleX:Ct/w/D,minFontScaleY:It/w/F,isSDF:h}};if(p&&(x.stretchX||x.stretchY)){const ht=Rx(V,ge,J),kt=Rx(H,we,ie);for(let yt=0;yt0&&(J=Math.max(10,J),this.circleDiameter=J)}else{let V=w.top*I-P[0],H=w.bottom*I+P[2],Y=w.left*I-P[3],J=w.right*I+P[1];const ie=w.collisionPadding;if(ie&&(Y-=ie[0]*I,V-=ie[1]*I,J+=ie[2]*I,H+=ie[3]*I),F){const ge=new E(Y,V),we=new E(J,V),Ne=new E(Y,H),Ee=new E(J,H),Ae=F*Math.PI/180;ge._rotate(Ae),we._rotate(Ae),Ne._rotate(Ae),Ee._rotate(Ae),Y=Math.min(ge.x,we.x,Ne.x,Ee.x),J=Math.max(ge.x,we.x,Ne.x,Ee.x),V=Math.min(ge.y,we.y,Ne.y,Ee.y),H=Math.max(ge.y,we.y,Ne.y,Ee.y)}s.emplaceBack(h.x,h.y,Y,V,J,H,p,_,x)}this.boxEndIndex=s.length}}class xP{constructor(s=[],h=wP){if(this.data=s,this.length=this.data.length,this.compare=h,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(s){this.data.push(s),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const s=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),s}peek(){return this.data[0]}_up(s){const{data:h,compare:p}=this,_=h[s];for(;s>0;){const x=s-1>>1,w=h[x];if(p(_,w)>=0)break;h[s]=w,s=x}h[s]=_}_down(s){const{data:h,compare:p}=this,_=this.length>>1,x=h[s];for(;s<_;){let w=1+(s<<1),I=h[w];const P=w+1;if(P=0)break;h[s]=I,s=w}h[s]=x}}function wP(u,s){return us?1:0}function SP(u,s=1,h=!1){let p=1/0,_=1/0,x=-1/0,w=-1/0;const I=u[0];for(let Y=0;Yx)&&(x=J.x),(!Y||J.y>w)&&(w=J.y)}const P=Math.min(x-p,w-_);let D=P/2;const F=new xP([],EP);if(P===0)return new E(p,_);for(let Y=p;YV.d||!V.d)&&(V=Y,h&&console.log("found best %d after %d probes",Math.round(1e4*Y.d)/1e4,H)),Y.max-V.d<=s||(D=Y.h/2,F.push(new gf(Y.p.x-D,Y.p.y-D,D,u)),F.push(new gf(Y.p.x+D,Y.p.y-D,D,u)),F.push(new gf(Y.p.x-D,Y.p.y+D,D,u)),F.push(new gf(Y.p.x+D,Y.p.y+D,D,u)),H+=4)}return h&&(console.log(`num probes: ${H}`),console.log(`best distance: ${V.d}`)),V.p}function EP(u,s){return s.max-u.max}function gf(u,s,h,p){this.p=new E(u,s),this.h=h,this.d=function(_,x){let w=!1,I=1/0;for(let P=0;P_.y!=J.y>_.y&&_.x<(J.x-Y.x)*(_.y-Y.y)/(J.y-Y.y)+Y.x&&(w=!w),I=Math.min(I,_b(_,Y,J))}}return(w?1:-1)*Math.sqrt(I)}(this.p,p),this.max=this.d+this.h*Math.SQRT2}var Ji;c.ap=void 0,(Ji=c.ap||(c.ap={}))[Ji.center=1]="center",Ji[Ji.left=2]="left",Ji[Ji.right=3]="right",Ji[Ji.top=4]="top",Ji[Ji.bottom=5]="bottom",Ji[Ji["top-left"]=6]="top-left",Ji[Ji["top-right"]=7]="top-right",Ji[Ji["bottom-left"]=8]="bottom-left",Ji[Ji["bottom-right"]=9]="bottom-right";const qu=7,b0=Number.POSITIVE_INFINITY;function Nx(u,s){return s[1]!==b0?function(h,p,_){let x=0,w=0;switch(p=Math.abs(p),_=Math.abs(_),h){case"top-right":case"top-left":case"top":w=_-qu;break;case"bottom-right":case"bottom-left":case"bottom":w=-_+qu}switch(h){case"top-right":case"bottom-right":case"right":x=-p;break;case"top-left":case"bottom-left":case"left":x=p}return[x,w]}(u,s[0],s[1]):function(h,p){let _=0,x=0;p<0&&(p=0);const w=p/Math.SQRT2;switch(h){case"top-right":case"top-left":x=w-qu;break;case"bottom-right":case"bottom-left":x=-w+qu;break;case"bottom":x=-p+qu;break;case"top":x=p-qu}switch(h){case"top-right":case"bottom-right":_=-w;break;case"top-left":case"bottom-left":_=w;break;case"left":_=p;break;case"right":_=-p}return[_,x]}(u,s[0])}function Ox(u,s,h){var p;const _=u.layout,x=(p=_.get("text-variable-anchor-offset"))===null||p===void 0?void 0:p.evaluate(s,{},h);if(x){const I=x.values,P=[];for(let D=0;DH*bi);F.startsWith("top")?V[1]-=qu:F.startsWith("bottom")&&(V[1]+=qu),P[D+1]=V}return new ps(P)}const w=_.get("text-variable-anchor");if(w){let I;I=u._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[_.get("text-radial-offset").evaluate(s,{},h)*bi,b0]:_.get("text-offset").evaluate(s,{},h).map(D=>D*bi);const P=[];for(const D of w)P.push(D,Nx(D,I));return new ps(P)}return null}function x0(u){switch(u){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function IP(u,s,h,p,_,x,w,I,P,D,F){let V=x.textMaxSize.evaluate(s,{});V===void 0&&(V=w);const H=u.layers[0].layout,Y=H.get("icon-offset").evaluate(s,{},F),J=Fx(h.horizontal),ie=w/24,ge=u.tilePixelRatio*ie,we=u.tilePixelRatio*V/24,Ne=u.tilePixelRatio*I,Ee=u.tilePixelRatio*H.get("symbol-spacing"),Ae=H.get("text-padding")*u.tilePixelRatio,Qe=function(st,Yt,Vt,Pn=1){const xr=st.get("icon-padding").evaluate(Yt,{},Vt),Cr=xr&&xr.values;return[Cr[0]*Pn,Cr[1]*Pn,Cr[2]*Pn,Cr[3]*Pn]}(H,s,F,u.tilePixelRatio),et=H.get("text-max-angle")/180*Math.PI,Ct=H.get("text-rotation-alignment")!=="viewport"&&H.get("symbol-placement")!=="point",zt=H.get("icon-rotation-alignment")==="map"&&H.get("symbol-placement")!=="point",It=H.get("symbol-placement"),xt=Ee/2,ht=H.get("icon-text-fit");let kt;p&&ht!=="none"&&(u.allowVerticalPlacement&&h.vertical&&(kt=ax(p,h.vertical,ht,H.get("icon-text-fit-padding"),Y,ie)),J&&(p=ax(p,J,ht,H.get("icon-text-fit-padding"),Y,ie)));const yt=(st,Yt)=>{Yt.x<0||Yt.x>=Xr||Yt.y<0||Yt.y>=Xr||function(Vt,Pn,xr,Cr,xi,_s,Ao,di,Gi,Qi,Do,Ro,wi,Si,_o,No,yo,Ko,Jo,Ei,An,vo,eo,Ii,sa){const Va=Vt.addToLineVertexArray(Pn,xr);let Ua,tu,aa,Os,Qo=0,nu=0,wd=0,jx=0,P0=-1,M0=-1;const ru={};let Gx=Br("");if(Vt.allowVerticalPlacement&&Cr.vertical){const bo=di.layout.get("text-rotate").evaluate(An,{},Ii)+90;aa=new Ng(Gi,Pn,Qi,Do,Ro,Cr.vertical,wi,Si,_o,bo),Ao&&(Os=new Ng(Gi,Pn,Qi,Do,Ro,Ao,yo,Ko,_o,bo))}if(xi){const bo=di.layout.get("icon-rotate").evaluate(An,{}),zs=di.layout.get("icon-text-fit")!=="none",qc=Dx(xi,bo,eo,zs),Ga=Ao?Dx(Ao,bo,eo,zs):void 0;tu=new Ng(Gi,Pn,Qi,Do,Ro,xi,yo,Ko,!1,bo),Qo=4*qc.length;const Wc=Vt.iconSizeData;let yl=null;Wc.kind==="source"?(yl=[_l*di.layout.get("icon-size").evaluate(An,{})],yl[0]>Uu&&Ge(`${Vt.layerIds[0]}: Value for "icon-size" is >= ${yd}. Reduce your "icon-size".`)):Wc.kind==="composite"&&(yl=[_l*vo.compositeIconSizes[0].evaluate(An,{},Ii),_l*vo.compositeIconSizes[1].evaluate(An,{},Ii)],(yl[0]>Uu||yl[1]>Uu)&&Ge(`${Vt.layerIds[0]}: Value for "icon-size" is >= ${yd}. Reduce your "icon-size".`)),Vt.addSymbols(Vt.icon,qc,yl,Ei,Jo,An,c.ah.none,Pn,Va.lineStartIndex,Va.lineLength,-1,Ii),P0=Vt.icon.placedSymbolArray.length-1,Ga&&(nu=4*Ga.length,Vt.addSymbols(Vt.icon,Ga,yl,Ei,Jo,An,c.ah.vertical,Pn,Va.lineStartIndex,Va.lineLength,-1,Ii),M0=Vt.icon.placedSymbolArray.length-1)}const qx=Object.keys(Cr.horizontal);for(const bo of qx){const zs=Cr.horizontal[bo];if(!Ua){Gx=Br(zs.text);const Ga=di.layout.get("text-rotate").evaluate(An,{},Ii);Ua=new Ng(Gi,Pn,Qi,Do,Ro,zs,wi,Si,_o,Ga)}const qc=zs.positionedLines.length===1;if(wd+=zx(Vt,Pn,zs,_s,di,_o,An,No,Va,Cr.vertical?c.ah.horizontal:c.ah.horizontalOnly,qc?qx:[bo],ru,P0,vo,Ii),qc)break}Cr.vertical&&(jx+=zx(Vt,Pn,Cr.vertical,_s,di,_o,An,No,Va,c.ah.vertical,["vertical"],ru,M0,vo,Ii));const LP=Ua?Ua.boxStartIndex:Vt.collisionBoxArray.length,PP=Ua?Ua.boxEndIndex:Vt.collisionBoxArray.length,MP=aa?aa.boxStartIndex:Vt.collisionBoxArray.length,kP=aa?aa.boxEndIndex:Vt.collisionBoxArray.length,AP=tu?tu.boxStartIndex:Vt.collisionBoxArray.length,DP=tu?tu.boxEndIndex:Vt.collisionBoxArray.length,RP=Os?Os.boxStartIndex:Vt.collisionBoxArray.length,NP=Os?Os.boxEndIndex:Vt.collisionBoxArray.length;let ja=-1;const zg=(bo,zs)=>bo&&bo.circleDiameter?Math.max(bo.circleDiameter,zs):zs;ja=zg(Ua,ja),ja=zg(aa,ja),ja=zg(tu,ja),ja=zg(Os,ja);const Wx=ja>-1?1:0;Wx&&(ja*=sa/bi),Vt.glyphOffsetArray.length>=df.MAX_GLYPHS&&Ge("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),An.sortKey!==void 0&&Vt.addToSortKeyRanges(Vt.symbolInstances.length,An.sortKey);const OP=Ox(di,An,Ii),[zP,FP]=function(bo,zs){const qc=bo.length,Ga=zs==null?void 0:zs.values;if((Ga==null?void 0:Ga.length)>0)for(let Wc=0;Wc=0?ru.right:-1,ru.center>=0?ru.center:-1,ru.left>=0?ru.left:-1,ru.vertical||-1,P0,M0,Gx,LP,PP,MP,kP,AP,DP,RP,NP,Qi,wd,jx,Qo,nu,Wx,0,wi,ja,zP,FP)}(u,Yt,st,h,p,_,kt,u.layers[0],u.collisionBoxArray,s.index,s.sourceLayerIndex,u.index,ge,[Ae,Ae,Ae,Ae],Ct,P,Ne,Qe,zt,Y,s,x,D,F,w)};if(It==="line")for(const st of Tx(s.geometry,0,0,Xr,Xr)){const Yt=bP(st,Ee,et,h.vertical||J,p,24,we,u.overscaling,Xr);for(const Vt of Yt)J&&CP(u,J.text,xt,Vt)||yt(st,Vt)}else if(It==="line-center"){for(const st of s.geometry)if(st.length>1){const Yt=vP(st,et,h.vertical||J,p,24,we);Yt&&yt(st,Yt)}}else if(s.type==="Polygon")for(const st of Qy(s.geometry,0)){const Yt=SP(st,16);yt(st[0],new Gu(Yt.x,Yt.y,0))}else if(s.type==="LineString")for(const st of s.geometry)yt(st,new Gu(st[0].x,st[0].y,0));else if(s.type==="Point")for(const st of s.geometry)for(const Yt of st)yt([Yt],new Gu(Yt.x,Yt.y,0))}function zx(u,s,h,p,_,x,w,I,P,D,F,V,H,Y,J){const ie=function(Ne,Ee,Ae,Qe,et,Ct,zt,It){const xt=Qe.layout.get("text-rotate").evaluate(Ct,{})*Math.PI/180,ht=[];for(const kt of Ee.positionedLines)for(const yt of kt.positionedGlyphs){if(!yt.rect)continue;const st=yt.rect||{};let Yt=ex+1,Vt=!0,Pn=1,xr=0;const Cr=(et||It)&&yt.vertical,xi=yt.metrics.advance*yt.scale/2;if(It&&Ee.verticalizable&&(xr=kt.lineOffset/2-(yt.imageName?-(bi-yt.metrics.width*yt.scale)/2:(yt.scale-1)*bi)),yt.imageName){const Ei=zt[yt.imageName];Vt=Ei.sdf,Pn=Ei.pixelRatio,Yt=$o/Pn}const _s=et?[yt.x+xi,yt.y]:[0,0];let Ao=et?[0,0]:[yt.x+xi+Ae[0],yt.y+Ae[1]-xr],di=[0,0];Cr&&(di=Ao,Ao=[0,0]);const Gi=yt.metrics.isDoubleResolution?2:1,Qi=(yt.metrics.left-Yt)*yt.scale-xi+Ao[0],Do=(-yt.metrics.top-Yt)*yt.scale+Ao[1],Ro=Qi+st.w/Gi*yt.scale/Pn,wi=Do+st.h/Gi*yt.scale/Pn,Si=new E(Qi,Do),_o=new E(Ro,Do),No=new E(Qi,wi),yo=new E(Ro,wi);if(Cr){const Ei=new E(-xi,xi-gd),An=-Math.PI/2,vo=bi/2-xi,eo=new E(5-gd-vo,-(yt.imageName?vo:0)),Ii=new E(...di);Si._rotateAround(An,Ei)._add(eo)._add(Ii),_o._rotateAround(An,Ei)._add(eo)._add(Ii),No._rotateAround(An,Ei)._add(eo)._add(Ii),yo._rotateAround(An,Ei)._add(eo)._add(Ii)}if(xt){const Ei=Math.sin(xt),An=Math.cos(xt),vo=[An,-Ei,Ei,An];Si._matMult(vo),_o._matMult(vo),No._matMult(vo),yo._matMult(vo)}const Ko=new E(0,0),Jo=new E(0,0);ht.push({tl:Si,tr:_o,bl:No,br:yo,tex:st,writingMode:Ee.writingMode,glyphOffset:_s,sectionIndex:yt.sectionIndex,isSDF:Vt,pixelOffsetTL:Ko,pixelOffsetBR:Jo,minFontScaleX:0,minFontScaleY:0})}return ht}(0,h,I,_,x,w,p,u.allowVerticalPlacement),ge=u.textSizeData;let we=null;ge.kind==="source"?(we=[_l*_.layout.get("text-size").evaluate(w,{})],we[0]>Uu&&Ge(`${u.layerIds[0]}: Value for "text-size" is >= ${yd}. Reduce your "text-size".`)):ge.kind==="composite"&&(we=[_l*Y.compositeTextSizes[0].evaluate(w,{},J),_l*Y.compositeTextSizes[1].evaluate(w,{},J)],(we[0]>Uu||we[1]>Uu)&&Ge(`${u.layerIds[0]}: Value for "text-size" is >= ${yd}. Reduce your "text-size".`)),u.addSymbols(u.text,ie,we,I,x,w,D,s,P.lineStartIndex,P.lineLength,H,J);for(const Ne of F)V[Ne]=u.text.placedSymbolArray.length-1;return 4*ie.length}function Fx(u){for(const s in u)return u[s];return null}function CP(u,s,h,p){const _=u.compareText;if(s in _){const x=_[s];for(let w=x.length-1;w>=0;w--)if(p.dist(x[w])>4;if(_!==1)throw new Error(`Got v${_} data when expected v1.`);const x=Bx[15&p];if(!x)throw new Error("Unrecognized array type.");const[w]=new Uint16Array(s,2,1),[I]=new Uint32Array(s,4,1);return new w0(I,w,x,s)}constructor(s,h=64,p=Float64Array,_){if(isNaN(s)||s<0)throw new Error(`Unpexpected numItems value: ${s}.`);this.numItems=+s,this.nodeSize=Math.min(Math.max(+h,2),65535),this.ArrayType=p,this.IndexArrayType=s<65536?Uint16Array:Uint32Array;const x=Bx.indexOf(this.ArrayType),w=2*s*this.ArrayType.BYTES_PER_ELEMENT,I=s*this.IndexArrayType.BYTES_PER_ELEMENT,P=(8-I%8)%8;if(x<0)throw new Error(`Unexpected typed array class: ${p}.`);_&&_ instanceof ArrayBuffer?(this.data=_,this.ids=new this.IndexArrayType(this.data,8,s),this.coords=new this.ArrayType(this.data,8+I+P,2*s),this._pos=2*s,this._finished=!0):(this.data=new ArrayBuffer(8+w+I+P),this.ids=new this.IndexArrayType(this.data,8,s),this.coords=new this.ArrayType(this.data,8+I+P,2*s),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+x]),new Uint16Array(this.data,2,1)[0]=h,new Uint32Array(this.data,4,1)[0]=s)}add(s,h){const p=this._pos>>1;return this.ids[p]=p,this.coords[this._pos++]=s,this.coords[this._pos++]=h,p}finish(){const s=this._pos>>1;if(s!==this.numItems)throw new Error(`Added ${s} items when expected ${this.numItems}.`);return S0(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(s,h,p,_){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:x,coords:w,nodeSize:I}=this,P=[0,x.length-1,0],D=[];for(;P.length;){const F=P.pop()||0,V=P.pop()||0,H=P.pop()||0;if(V-H<=I){for(let ge=H;ge<=V;ge++){const we=w[2*ge],Ne=w[2*ge+1];we>=s&&we<=p&&Ne>=h&&Ne<=_&&D.push(x[ge])}continue}const Y=H+V>>1,J=w[2*Y],ie=w[2*Y+1];J>=s&&J<=p&&ie>=h&&ie<=_&&D.push(x[Y]),(F===0?s<=J:h<=ie)&&(P.push(H),P.push(Y-1),P.push(1-F)),(F===0?p>=J:_>=ie)&&(P.push(Y+1),P.push(V),P.push(1-F))}return D}within(s,h,p){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:_,coords:x,nodeSize:w}=this,I=[0,_.length-1,0],P=[],D=p*p;for(;I.length;){const F=I.pop()||0,V=I.pop()||0,H=I.pop()||0;if(V-H<=w){for(let ge=H;ge<=V;ge++)Ux(x[2*ge],x[2*ge+1],s,h)<=D&&P.push(_[ge]);continue}const Y=H+V>>1,J=x[2*Y],ie=x[2*Y+1];Ux(J,ie,s,h)<=D&&P.push(_[Y]),(F===0?s-p<=J:h-p<=ie)&&(I.push(H),I.push(Y-1),I.push(1-F)),(F===0?s+p>=J:h+p>=ie)&&(I.push(Y+1),I.push(V),I.push(1-F))}return P}}function S0(u,s,h,p,_,x){if(_-p<=h)return;const w=p+_>>1;Vx(u,s,w,p,_,x),S0(u,s,h,p,w-1,1-x),S0(u,s,h,w+1,_,1-x)}function Vx(u,s,h,p,_,x){for(;_>p;){if(_-p>600){const D=_-p+1,F=h-p+1,V=Math.log(D),H=.5*Math.exp(2*V/3),Y=.5*Math.sqrt(V*H*(D-H)/D)*(F-D/2<0?-1:1);Vx(u,s,h,Math.max(p,Math.floor(h-F*H/D+Y)),Math.min(_,Math.floor(h+(D-F)*H/D+Y)),x)}const w=s[2*h+x];let I=p,P=_;for(bd(u,s,p,h),s[2*_+x]>w&&bd(u,s,p,_);Iw;)P--}s[2*p+x]===w?bd(u,s,p,P):(P++,bd(u,s,P,_)),P<=h&&(p=P+1),h<=P&&(_=P-1)}}function bd(u,s,h,p){E0(u,h,p),E0(s,2*h,2*p),E0(s,2*h+1,2*p+1)}function E0(u,s,h){const p=u[s];u[s]=u[h],u[h]=p}function Ux(u,s,h,p){const _=u-h,x=s-p;return _*_+x*x}var I0;c.bd=void 0,(I0=c.bd||(c.bd={})).create="create",I0.load="load",I0.fullLoad="fullLoad";let Og=null,xd=[];const C0=1e3/60,T0="loadTime",L0="fullLoadTime",TP={mark(u){performance.mark(u)},frame(u){const s=u;Og!=null&&xd.push(s-Og),Og=s},clearMetrics(){Og=null,xd=[],performance.clearMeasures(T0),performance.clearMeasures(L0);for(const u in c.bd)performance.clearMarks(c.bd[u])},getPerformanceMetrics(){performance.measure(T0,c.bd.create,c.bd.load),performance.measure(L0,c.bd.create,c.bd.fullLoad);const u=performance.getEntriesByName(T0)[0].duration,s=performance.getEntriesByName(L0)[0].duration,h=xd.length,p=1/(xd.reduce((x,w)=>x+w,0)/h/1e3),_=xd.filter(x=>x>C0).reduce((x,w)=>x+(w-C0)/C0,0);return{loadTime:u,fullLoadTime:s,fps:p,percentDroppedFrames:_/(h+_)*100,totalFrames:h}}};c.$=dt,c.A=lf,c.B=function(u){if(At==null){const s=u.navigator?u.navigator.userAgent:null;At=!!u.safari||!(!s||!(/\b(iPad|iPhone|iPod)\b/.test(s)||s.match("Safari")&&!s.match("Chrome")))}return At},c.C=class{constructor(u,s){this.target=u,this.mapId=s,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new _P(()=>this.process()),this.subscription=function(h,p,_,x){return h.addEventListener(p,_,!1),{unsubscribe:()=>{h.removeEventListener(p,_,!1)}}}(this.target,"message",h=>this.receive(h)),this.globalScope=ft(self)?u:window}registerMessageHandler(u,s){this.messageHandlers[u]=s}sendAsync(u,s){return new Promise((h,p)=>{const _=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[_]={resolve:h,reject:p},s&&s.signal.addEventListener("abort",()=>{delete this.resolveRejects[_];const I={id:_,type:"",origin:location.origin,targetMapId:u.targetMapId,sourceMapId:this.mapId};this.target.postMessage(I)},{once:!0});const x=[],w=Object.assign(Object.assign({},u),{id:_,sourceMapId:this.mapId,origin:location.origin,data:Nu(u.data,x)});this.target.postMessage(w,{transfer:x})})}receive(u){const s=u.data,h=s.id;if(!(s.origin!=="file://"&&location.origin!=="file://"&&s.origin!==location.origin||s.targetMapId&&this.mapId!==s.targetMapId)){if(s.type===""){delete this.tasks[h];const p=this.abortControllers[h];return delete this.abortControllers[h],void(p&&p.abort())}if(ft(self)||s.mustQueue)return this.tasks[h]=s,this.taskQueue.push(h),void this.invoker.trigger();this.processTask(h,s)}}process(){if(this.taskQueue.length===0)return;const u=this.taskQueue.shift(),s=this.tasks[u];delete this.tasks[u],this.taskQueue.length>0&&this.invoker.trigger(),s&&this.processTask(u,s)}processTask(u,s){return l(this,void 0,void 0,function*(){if(s.type===""){const _=this.resolveRejects[u];return delete this.resolveRejects[u],_?void(s.error?_.reject(Ou(s.error)):_.resolve(Ou(s.data))):void 0}if(!this.messageHandlers[s.type])return void this.completeTask(u,new Error(`Could not find a registered handler for ${s.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const h=Ou(s.data),p=new AbortController;this.abortControllers[u]=p;try{const _=yield this.messageHandlers[s.type](s.sourceMapId,h,p);this.completeTask(u,null,_)}catch(_){this.completeTask(u,_)}})}completeTask(u,s,h){const p=[];delete this.abortControllers[u];const _={id:u,type:"",sourceMapId:this.mapId,origin:location.origin,error:s?Nu(s):null,data:Nu(h,p)};this.target.postMessage(_,{transfer:p})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},c.D=jt,c.E=Nt,c.F=function(){var u=new lf(16);return lf!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u},c.G=En,c.H=function(u,s,h){var p,_,x,w,I,P,D,F,V,H,Y,J,ie=h[0],ge=h[1],we=h[2];return s===u?(u[12]=s[0]*ie+s[4]*ge+s[8]*we+s[12],u[13]=s[1]*ie+s[5]*ge+s[9]*we+s[13],u[14]=s[2]*ie+s[6]*ge+s[10]*we+s[14],u[15]=s[3]*ie+s[7]*ge+s[11]*we+s[15]):(_=s[1],x=s[2],w=s[3],I=s[4],P=s[5],D=s[6],F=s[7],V=s[8],H=s[9],Y=s[10],J=s[11],u[0]=p=s[0],u[1]=_,u[2]=x,u[3]=w,u[4]=I,u[5]=P,u[6]=D,u[7]=F,u[8]=V,u[9]=H,u[10]=Y,u[11]=J,u[12]=p*ie+I*ge+V*we+s[12],u[13]=_*ie+P*ge+H*we+s[13],u[14]=x*ie+D*ge+Y*we+s[14],u[15]=w*ie+F*ge+J*we+s[15]),u},c.I=u0,c.J=function(u,s,h){var p=h[0],_=h[1],x=h[2];return u[0]=s[0]*p,u[1]=s[1]*p,u[2]=s[2]*p,u[3]=s[3]*p,u[4]=s[4]*_,u[5]=s[5]*_,u[6]=s[6]*_,u[7]=s[7]*_,u[8]=s[8]*x,u[9]=s[9]*x,u[10]=s[10]*x,u[11]=s[11]*x,u[12]=s[12],u[13]=s[13],u[14]=s[14],u[15]=s[15],u},c.K=xb,c.L=function(u,s){const h={};for(let p=0;p{const s=window.document.createElement("video");return s.muted=!0,new Promise(h=>{s.onloadstart=()=>{h(s)};for(const p of u){const _=window.document.createElement("source");Dt(p)||(s.crossOrigin="Anonymous"),_.src=p,s.appendChild(_)}})},c.a3=function(){return se++},c.a4=v,c.a5=df,c.a6=Vh,c.a7=Ql,c.a8=Er,c.a9=Sx,c.aA=K,c.aB=function(u,s){if(!u)return[{command:"setStyle",args:[s]}];let h=[];try{if(!St(u.version,s.version))return[{command:"setStyle",args:[s]}];St(u.center,s.center)||h.push({command:"setCenter",args:[s.center]}),St(u.zoom,s.zoom)||h.push({command:"setZoom",args:[s.zoom]}),St(u.bearing,s.bearing)||h.push({command:"setBearing",args:[s.bearing]}),St(u.pitch,s.pitch)||h.push({command:"setPitch",args:[s.pitch]}),St(u.sprite,s.sprite)||h.push({command:"setSprite",args:[s.sprite]}),St(u.glyphs,s.glyphs)||h.push({command:"setGlyphs",args:[s.glyphs]}),St(u.transition,s.transition)||h.push({command:"setTransition",args:[s.transition]}),St(u.light,s.light)||h.push({command:"setLight",args:[s.light]}),St(u.terrain,s.terrain)||h.push({command:"setTerrain",args:[s.terrain]}),St(u.sky,s.sky)||h.push({command:"setSky",args:[s.sky]});const p={},_=[];(function(w,I,P,D){let F;for(F in I=I||{},w=w||{})Object.prototype.hasOwnProperty.call(w,F)&&(Object.prototype.hasOwnProperty.call(I,F)||Ls(F,P,D));for(F in I)Object.prototype.hasOwnProperty.call(I,F)&&(Object.prototype.hasOwnProperty.call(w,F)?St(w[F],I[F])||(w[F].type==="geojson"&&I[F].type==="geojson"&&al(w,I,F)?hn(P,{command:"setGeoJSONSourceData",args:[F,I[F].data]}):Js(F,I,P,D)):Ai(F,I,P))})(u.sources,s.sources,_,p);const x=[];u.layers&&u.layers.forEach(w=>{"source"in w&&p[w.source]?h.push({command:"removeLayer",args:[w.id]}):x.push(w)}),h=h.concat(_),function(w,I,P){I=I||[];const D=(w=w||[]).map(jl),F=I.map(jl),V=w.reduce(Ps,{}),H=I.reduce(Ps,{}),Y=D.slice(),J=Object.create(null);let ie,ge,we,Ne,Ee;for(let Ae=0,Qe=0;Ae@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(h,p,_,x)=>{const w=_||x;return s[p]=!w||w.toLowerCase(),""}),s["max-age"]){const h=parseInt(s["max-age"],10);isNaN(h)?delete s["max-age"]:s["max-age"]=h}return s},c.ab=function(u,s){const h=[];for(const p in u)p in s||h.push(p);return h},c.ac=Z,c.ad=function(u,s,h){var p=Math.sin(h),_=Math.cos(h),x=s[0],w=s[1],I=s[2],P=s[3],D=s[4],F=s[5],V=s[6],H=s[7];return s!==u&&(u[8]=s[8],u[9]=s[9],u[10]=s[10],u[11]=s[11],u[12]=s[12],u[13]=s[13],u[14]=s[14],u[15]=s[15]),u[0]=x*_+D*p,u[1]=w*_+F*p,u[2]=I*_+V*p,u[3]=P*_+H*p,u[4]=D*_-x*p,u[5]=F*_-w*p,u[6]=V*_-I*p,u[7]=H*_-P*p,u},c.ae=function(u){var s=new lf(16);return s[0]=u[0],s[1]=u[1],s[2]=u[2],s[3]=u[3],s[4]=u[4],s[5]=u[5],s[6]=u[6],s[7]=u[7],s[8]=u[8],s[9]=u[9],s[10]=u[10],s[11]=u[11],s[12]=u[12],s[13]=u[13],s[14]=u[14],s[15]=u[15],s},c.af=bg,c.ag=function(u,s){let h=0,p=0;if(u.kind==="constant")p=u.layoutSize;else if(u.kind!=="source"){const{interpolationType:_,minZoom:x,maxZoom:w}=u,I=_?Z(Ki.interpolationFactor(_,s,x,w),0,1):0;u.kind==="camera"?p=mo.number(u.minSize,u.maxSize,I):h=I}return{uSizeT:h,uSize:p}},c.ai=function(u,{uSize:s,uSizeT:h},{lowerSize:p,upperSize:_}){return u.kind==="source"?p/_l:u.kind==="composite"?mo.number(p/_l,_/_l,h):s},c.aj=p0,c.ak=function(u,s,h,p){const _=s.y-u.y,x=s.x-u.x,w=p.y-h.y,I=p.x-h.x,P=w*x-I*_;if(P===0)return null;const D=(I*(u.y-h.y)-w*(u.x-h.x))/P;return new E(u.x+D*x,u.y+D*_)},c.al=Tx,c.am=nd,c.an=Hy,c.ao=bi,c.aq=f0,c.ar=function(u,s){var h=s[0],p=s[1],_=s[2],x=s[3],w=s[4],I=s[5],P=s[6],D=s[7],F=s[8],V=s[9],H=s[10],Y=s[11],J=s[12],ie=s[13],ge=s[14],we=s[15],Ne=h*I-p*w,Ee=h*P-_*w,Ae=h*D-x*w,Qe=p*P-_*I,et=p*D-x*I,Ct=_*D-x*P,zt=F*ie-V*J,It=F*ge-H*J,xt=F*we-Y*J,ht=V*ge-H*ie,kt=V*we-Y*ie,yt=H*we-Y*ge,st=Ne*yt-Ee*kt+Ae*ht+Qe*xt-et*It+Ct*zt;return st?(u[0]=(I*yt-P*kt+D*ht)*(st=1/st),u[1]=(_*kt-p*yt-x*ht)*st,u[2]=(ie*Ct-ge*et+we*Qe)*st,u[3]=(H*et-V*Ct-Y*Qe)*st,u[4]=(P*xt-w*yt-D*It)*st,u[5]=(h*yt-_*xt+x*It)*st,u[6]=(ge*Ae-J*Ct-we*Ee)*st,u[7]=(F*Ct-H*Ae+Y*Ee)*st,u[8]=(w*kt-I*xt+D*zt)*st,u[9]=(p*xt-h*kt-x*zt)*st,u[10]=(J*et-ie*Ae+we*Ne)*st,u[11]=(V*Ae-F*et-Y*Ne)*st,u[12]=(I*It-w*ht-P*zt)*st,u[13]=(h*ht-p*It+_*zt)*st,u[14]=(ie*Ee-J*Qe-ge*Ne)*st,u[15]=(F*Qe-V*Ee+H*Ne)*st,u):null},c.as=x0,c.at=h0,c.au=w0,c.av=function(){const u={},s=me.$version;for(const h in me.$root){const p=me.$root[h];if(p.required){let _=null;_=h==="version"?s:p.type==="array"?[]:{},_!=null&&(u[h]=_)}}return u},c.aw=sg,c.ax=rr,c.ay=function(u){u=u.slice();const s=Object.create(null);for(let h=0;hst*bi)}let It=w?"center":h.get("text-justify").evaluate(D,{},u.canonical);const xt=h.get("symbol-placement"),ht=xt==="point"?h.get("text-max-width").evaluate(D,{},u.canonical)*bi:0,kt=()=>{u.bucket.allowVerticalPlacement&&zu(Ae)&&(J.vertical=Tg(ie,u.glyphMap,u.glyphPositions,u.imagePositions,F,ht,x,Ct,"left",et,we,c.ah.vertical,!0,xt,H,V))};if(!w&&zt){const yt=new Set;if(It==="auto")for(let Yt=0;Ytl(void 0,void 0,void 0,function*(){if(u.byteLength===0)return createImageBitmap(new ImageData(1,1));const s=new Blob([new Uint8Array(u)],{type:"image/png"});try{return createImageBitmap(s)}catch(h){throw new Error(`Could not load image because of ${h.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),c.e=ae,c.f=u=>new Promise((s,h)=>{const p=new Image;p.onload=()=>{s(p),URL.revokeObjectURL(p.src),p.onload=null,window.requestAnimationFrame(()=>{p.src=Ft})},p.onerror=()=>h(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 _=new Blob([new Uint8Array(u)],{type:"image/png"});p.src=u.byteLength?URL.createObjectURL(_):Ft}),c.g=Xt,c.h=(u,s)=>mt(ae(u,{type:"json"}),s),c.i=ft,c.j=gt,c.k=rt,c.l=(u,s)=>mt(ae(u,{type:"arrayBuffer"}),s),c.m=mt,c.n=function(u){return new a0(u).readFields(nP,[])},c.o=ld,c.p=tx,c.q=Mo,c.r=jy,c.s=Dt,c.t=Ru,c.u=Et,c.v=me,c.w=Ge,c.x=Yl,c.y=function([u,s,h]){return s+=90,s*=Math.PI/180,h*=Math.PI/180,{x:u*Math.cos(s)*Math.sin(h),y:u*Math.sin(s)*Math.sin(h),z:u*Math.cos(h)}},c.z=mo}),i("worker",["./shared"],function(c){class l{constructor(W){this.keyCache={},W&&this.replace(W)}replace(W){this._layerConfigs={},this._layers={},this.update(W,[])}update(W,X){for(const le of W){this._layerConfigs[le.id]=le;const Pe=this._layers[le.id]=c.az(le);Pe._featureFilter=c.a6(Pe.filter),this.keyCache[le.id]&&delete this.keyCache[le.id]}for(const le of X)delete this.keyCache[le],delete this._layerConfigs[le],delete this._layers[le];this.familiesBySource={};const Q=c.bh(Object.values(this._layerConfigs),this.keyCache);for(const le of Q){const Pe=le.map(Ye=>this._layers[Ye.id]),ee=Pe[0];if(ee.visibility==="none")continue;const Me=ee.source||"";let Se=this.familiesBySource[Me];Se||(Se=this.familiesBySource[Me]={});const Re=ee.sourceLayer||"_geojsonTileLayer";let We=Se[Re];We||(We=Se[Re]=[]),We.push(Pe)}}}class d{constructor(W){const X={},Q=[];for(const Me in W){const Se=W[Me],Re=X[Me]={};for(const We in Se){const Ye=Se[+We];if(!Ye||Ye.bitmap.width===0||Ye.bitmap.height===0)continue;const Je={x:0,y:0,w:Ye.bitmap.width+2,h:Ye.bitmap.height+2};Q.push(Je),Re[We]={rect:Je,metrics:Ye.metrics}}}const{w:le,h:Pe}=c.p(Q),ee=new c.o({width:le||1,height:Pe||1});for(const Me in W){const Se=W[Me];for(const Re in Se){const We=Se[+Re];if(!We||We.bitmap.width===0||We.bitmap.height===0)continue;const Ye=X[Me][Re].rect;c.o.copy(We.bitmap,ee,{x:0,y:0},{x:Ye.x+1,y:Ye.y+1},We.bitmap)}}this.image=ee,this.positions=X}}c.bi("GlyphAtlas",d);class y{constructor(W){this.tileID=new c.Q(W.tileID.overscaledZ,W.tileID.wrap,W.tileID.canonical.z,W.tileID.canonical.x,W.tileID.canonical.y),this.uid=W.uid,this.zoom=W.zoom,this.pixelRatio=W.pixelRatio,this.tileSize=W.tileSize,this.source=W.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=W.showCollisionBoxes,this.collectResourceTiming=!!W.collectResourceTiming,this.returnDependencies=!!W.returnDependencies,this.promoteId=W.promoteId,this.inFlightDependencies=[]}parse(W,X,Q,le){return c._(this,void 0,void 0,function*(){this.status="parsing",this.data=W,this.collisionBoxArray=new c.a4;const Pe=new c.bj(Object.keys(W.layers).sort()),ee=new c.bk(this.tileID,this.promoteId);ee.bucketLayerIDs=[];const Me={},Se={featureIndex:ee,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Q},Re=X.familiesBySource[this.source];for(const vn in Re){const Or=W.layers[vn];if(!Or)continue;Or.version===1&&c.w(`Vector tile source "${this.source}" layer "${vn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const _i=Pe.encode(vn),po=[];for(let To=0;To=Di.maxzoom||Di.visibility!=="none"&&(S(To,this.zoom,Q),(Me[Di.id]=Di.createBucket({index:ee.bucketLayerIDs.length,layers:To,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_i,sourceID:this.source})).populate(po,Se,this.tileID.canonical),ee.bucketLayerIDs.push(To.map(Qs=>Qs.id)))}}const We=c.aE(Se.glyphDependencies,vn=>Object.keys(vn).map(Number));this.inFlightDependencies.forEach(vn=>vn==null?void 0:vn.abort()),this.inFlightDependencies=[];let Ye=Promise.resolve({});if(Object.keys(We).length){const vn=new AbortController;this.inFlightDependencies.push(vn),Ye=le.sendAsync({type:"GG",data:{stacks:We,source:this.source,tileID:this.tileID,type:"glyphs"}},vn)}const Je=Object.keys(Se.iconDependencies);let Bt=Promise.resolve({});if(Je.length){const vn=new AbortController;this.inFlightDependencies.push(vn),Bt=le.sendAsync({type:"GI",data:{icons:Je,source:this.source,tileID:this.tileID,type:"icons"}},vn)}const qt=Object.keys(Se.patternDependencies);let sn=Promise.resolve({});if(qt.length){const vn=new AbortController;this.inFlightDependencies.push(vn),sn=le.sendAsync({type:"GI",data:{icons:qt,source:this.source,tileID:this.tileID,type:"patterns"}},vn)}const[un,On,ir]=yield Promise.all([Ye,Bt,sn]),Sr=new d(un),ui=new c.bl(On,ir);for(const vn in Me){const Or=Me[vn];Or instanceof c.a5?(S(Or.layers,this.zoom,Q),c.bm({bucket:Or,glyphMap:un,glyphPositions:Sr.positions,imageMap:On,imagePositions:ui.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Or.hasPattern&&(Or instanceof c.bn||Or instanceof c.bo||Or instanceof c.bp)&&(S(Or.layers,this.zoom,Q),Or.addFeatures(Se,this.tileID.canonical,ui.patternPositions))}return this.status="done",{buckets:Object.values(Me).filter(vn=>!vn.isEmpty()),featureIndex:ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Sr.image,imageAtlas:ui,glyphMap:this.returnDependencies?un:null,iconMap:this.returnDependencies?On:null,glyphPositions:this.returnDependencies?Sr.positions:null}})}}function S(_e,W,X){const Q=new c.a8(W);for(const le of _e)le.recalculate(Q,X)}class E{constructor(W,X,Q){this.actor=W,this.layerIndex=X,this.availableImages=Q,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(W,X){return c._(this,void 0,void 0,function*(){const Q=yield c.l(W.request,X);try{return{vectorTile:new c.bq.VectorTile(new c.br(Q.data)),rawData:Q.data,cacheControl:Q.cacheControl,expires:Q.expires}}catch(le){const Pe=new Uint8Array(Q.data);let ee=`Unable to parse the tile at ${W.request.url}, `;throw ee+=Pe[0]===31&&Pe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${le.messge}`,new Error(ee)}})}loadTile(W){return c._(this,void 0,void 0,function*(){const X=W.uid,Q=!!(W&&W.request&&W.request.collectResourceTiming)&&new c.bs(W.request),le=new y(W);this.loading[X]=le;const Pe=new AbortController;le.abort=Pe;try{const ee=yield this.loadVectorTile(W,Pe);if(delete this.loading[X],!ee)return null;const Me=ee.rawData,Se={};ee.expires&&(Se.expires=ee.expires),ee.cacheControl&&(Se.cacheControl=ee.cacheControl);const Re={};if(Q){const Ye=Q.finish();Ye&&(Re.resourceTiming=JSON.parse(JSON.stringify(Ye)))}le.vectorTile=ee.vectorTile;const We=le.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[X]=le,this.fetching[X]={rawTileData:Me,cacheControl:Se,resourceTiming:Re};try{const Ye=yield We;return c.e({rawTileData:Me.slice(0)},Ye,Se,Re)}finally{delete this.fetching[X]}}catch(ee){throw delete this.loading[X],le.status="done",this.loaded[X]=le,ee}})}reloadTile(W){return c._(this,void 0,void 0,function*(){const X=W.uid;if(!this.loaded||!this.loaded[X])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Q=this.loaded[X];if(Q.showCollisionBoxes=W.showCollisionBoxes,Q.status==="parsing"){const le=yield Q.parse(Q.vectorTile,this.layerIndex,this.availableImages,this.actor);let Pe;if(this.fetching[X]){const{rawTileData:ee,cacheControl:Me,resourceTiming:Se}=this.fetching[X];delete this.fetching[X],Pe=c.e({rawTileData:ee.slice(0)},le,Me,Se)}else Pe=le;return Pe}if(Q.status==="done"&&Q.vectorTile)return Q.parse(Q.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(W){return c._(this,void 0,void 0,function*(){const X=this.loading,Q=W.uid;X&&X[Q]&&X[Q].abort&&(X[Q].abort.abort(),delete X[Q])})}removeTile(W){return c._(this,void 0,void 0,function*(){this.loaded&&this.loaded[W.uid]&&delete this.loaded[W.uid]})}}class C{constructor(){this.loaded={}}loadTile(W){return c._(this,void 0,void 0,function*(){const{uid:X,encoding:Q,rawImageData:le,redFactor:Pe,greenFactor:ee,blueFactor:Me,baseShift:Se}=W,Re=le.width+2,We=le.height+2,Ye=c.b(le)?new c.R({width:Re,height:We},yield c.bt(le,-1,-1,Re,We)):le,Je=new c.bu(X,Ye,Q,Pe,ee,Me,Se);return this.loaded=this.loaded||{},this.loaded[X]=Je,Je})}removeTile(W){const X=this.loaded,Q=W.uid;X&&X[Q]&&delete X[Q]}}function A(_e,W){if(_e.length!==0){M(_e[0],W);for(var X=1;X<_e.length;X++)M(_e[X],!W)}}function M(_e,W){for(var X=0,Q=0,le=0,Pe=_e.length,ee=Pe-1;le=Math.abs(Me)?X-Se+Me:Me-Se+X,X=Se}X+Q>=0!=!!W&&_e.reverse()}var R=c.bv(function _e(W,X){var Q,le=W&&W.type;if(le==="FeatureCollection")for(Q=0;Q>31}function ot(_e,W){for(var X=_e.loadGeometry(),Q=_e.type,le=0,Pe=0,ee=X.length,Me=0;Me_e},Ft=Math.fround||(bt=new Float32Array(1),_e=>(bt[0]=+_e,bt[0]));var bt;const Rt=3,Ot=5,ln=6;class Ln{constructor(W){this.options=Object.assign(Object.create(Ke),W),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(W){const{log:X,minZoom:Q,maxZoom:le}=this.options;X&&console.time("total time");const Pe=`prepare ${W.length} points`;X&&console.time(Pe),this.points=W;const ee=[];for(let Se=0;Se=Q;Se--){const Re=+Date.now();Me=this.trees[Se]=this._createTree(this._cluster(Me,Se)),X&&console.log("z%d: %d clusters in %dms",Se,Me.numItems,+Date.now()-Re)}return X&&console.timeEnd("total time"),this}getClusters(W,X){let Q=((W[0]+180)%360+360)%360-180;const le=Math.max(-90,Math.min(90,W[1]));let Pe=W[2]===180?180:((W[2]+180)%360+360)%360-180;const ee=Math.max(-90,Math.min(90,W[3]));if(W[2]-W[0]>=360)Q=-180,Pe=180;else if(Q>Pe){const Ye=this.getClusters([Q,le,180,ee],X),Je=this.getClusters([-180,le,Pe,ee],X);return Ye.concat(Je)}const Me=this.trees[this._limitZoom(X)],Se=Me.range(En(Q),In(ee),En(Pe),In(le)),Re=Me.data,We=[];for(const Ye of Se){const Je=this.stride*Ye;We.push(Re[Je+Ot]>1?an(Re,Je,this.clusterProps):this.points[Re[Je+Rt]])}return We}getChildren(W){const X=this._getOriginId(W),Q=this._getOriginZoom(W),le="No cluster with the specified id.",Pe=this.trees[Q];if(!Pe)throw new Error(le);const ee=Pe.data;if(X*this.stride>=ee.length)throw new Error(le);const Me=this.options.radius/(this.options.extent*Math.pow(2,Q-1)),Se=Pe.within(ee[X*this.stride],ee[X*this.stride+1],Me),Re=[];for(const We of Se){const Ye=We*this.stride;ee[Ye+4]===W&&Re.push(ee[Ye+Ot]>1?an(ee,Ye,this.clusterProps):this.points[ee[Ye+Rt]])}if(Re.length===0)throw new Error(le);return Re}getLeaves(W,X,Q){const le=[];return this._appendLeaves(le,W,X=X||10,Q=Q||0,0),le}getTile(W,X,Q){const le=this.trees[this._limitZoom(W)],Pe=Math.pow(2,W),{extent:ee,radius:Me}=this.options,Se=Me/ee,Re=(Q-Se)/Pe,We=(Q+1+Se)/Pe,Ye={features:[]};return this._addTileFeatures(le.range((X-Se)/Pe,Re,(X+1+Se)/Pe,We),le.data,X,Q,Pe,Ye),X===0&&this._addTileFeatures(le.range(1-Se/Pe,Re,1,We),le.data,Pe,Q,Pe,Ye),X===Pe-1&&this._addTileFeatures(le.range(0,Re,Se/Pe,We),le.data,-1,Q,Pe,Ye),Ye.features.length?Ye:null}getClusterExpansionZoom(W){let X=this._getOriginZoom(W)-1;for(;X<=this.options.maxZoom;){const Q=this.getChildren(W);if(X++,Q.length!==1)break;W=Q[0].properties.cluster_id}return X}_appendLeaves(W,X,Q,le,Pe){const ee=this.getChildren(X);for(const Me of ee){const Se=Me.properties;if(Se&&Se.cluster?Pe+Se.point_count<=le?Pe+=Se.point_count:Pe=this._appendLeaves(W,Se.cluster_id,Q,le,Pe):Pe1;let We,Ye,Je;if(Re)We=Xt(X,Se,this.clusterProps),Ye=X[Se],Je=X[Se+1];else{const sn=this.points[X[Se+Rt]];We=sn.properties;const[un,On]=sn.geometry.coordinates;Ye=En(un),Je=In(On)}const Bt={type:1,geometry:[[Math.round(this.options.extent*(Ye*Pe-Q)),Math.round(this.options.extent*(Je*Pe-le))]],tags:We};let qt;qt=Re||this.options.generateId?X[Se+Rt]:this.points[X[Se+Rt]].id,qt!==void 0&&(Bt.id=qt),ee.features.push(Bt)}}_limitZoom(W){return Math.max(this.options.minZoom,Math.min(Math.floor(+W),this.options.maxZoom+1))}_cluster(W,X){const{radius:Q,extent:le,reduce:Pe,minPoints:ee}=this.options,Me=Q/(le*Math.pow(2,X)),Se=W.data,Re=[],We=this.stride;for(let Ye=0;YeX&&(un+=Se[ir+Ot])}if(un>sn&&un>=ee){let On,ir=Je*sn,Sr=Bt*sn,ui=-1;const vn=((Ye/We|0)<<5)+(X+1)+this.points.length;for(const Or of qt){const _i=Or*We;if(Se[_i+2]<=X)continue;Se[_i+2]=X;const po=Se[_i+Ot];ir+=Se[_i]*po,Sr+=Se[_i+1]*po,Se[_i+4]=vn,Pe&&(On||(On=this._map(Se,Ye,!0),ui=this.clusterProps.length,this.clusterProps.push(On)),Pe(On,this._map(Se,_i)))}Se[Ye+4]=vn,Re.push(ir/un,Sr/un,1/0,vn,-1,un),Pe&&Re.push(ui)}else{for(let On=0;On1)for(const On of qt){const ir=On*We;if(!(Se[ir+2]<=X)){Se[ir+2]=X;for(let Sr=0;Sr>5}_getOriginZoom(W){return(W-this.points.length)%32}_map(W,X,Q){if(W[X+Ot]>1){const ee=this.clusterProps[W[X+ln]];return Q?Object.assign({},ee):ee}const le=this.points[W[X+Rt]].properties,Pe=this.options.map(le);return Q&&Pe===le?Object.assign({},Pe):Pe}}function an(_e,W,X){return{type:"Feature",id:_e[W+Rt],properties:Xt(_e,W,X),geometry:{type:"Point",coordinates:[(Q=_e[W],360*(Q-.5)),rr(_e[W+1])]}};var Q}function Xt(_e,W,X){const Q=_e[W+Ot],le=Q>=1e4?`${Math.round(Q/1e3)}k`:Q>=1e3?Math.round(Q/100)/10+"k":Q,Pe=_e[W+ln],ee=Pe===-1?{}:Object.assign({},X[Pe]);return Object.assign(ee,{cluster:!0,cluster_id:_e[W+Rt],point_count:Q,point_count_abbreviated:le})}function En(_e){return _e/360+.5}function In(_e){const W=Math.sin(_e*Math.PI/180),X=.5-.25*Math.log((1+W)/(1-W))/Math.PI;return X<0?0:X>1?1:X}function rr(_e){const W=(180-360*_e)*Math.PI/180;return 360*Math.atan(Math.exp(W))/Math.PI-90}function mt(_e,W,X,Q){for(var le,Pe=Q,ee=X-W>>1,Me=X-W,Se=_e[W],Re=_e[W+1],We=_e[X],Ye=_e[X+1],Je=W+3;JePe)le=Je,Pe=Bt;else if(Bt===Pe){var qt=Math.abs(Je-ee);qtQ&&(le-W>3&&mt(_e,W,le,Q),_e[le+2]=Pe,X-le>3&&mt(_e,le,X,Q))}function Dt(_e,W,X,Q,le,Pe){var ee=le-X,Me=Pe-Q;if(ee!==0||Me!==0){var Se=((_e-X)*ee+(W-Q)*Me)/(ee*ee+Me*Me);Se>1?(X=le,Q=Pe):Se>0&&(X+=ee*Se,Q+=Me*Se)}return(ee=_e-X)*ee+(Me=W-Q)*Me}function Sn(_e,W,X,Q){var le={id:_e===void 0?null:_e,type:W,geometry:X,tags:Q,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Pe){var ee=Pe.geometry,Me=Pe.type;if(Me==="Point"||Me==="MultiPoint"||Me==="LineString")Le(Pe,ee);else if(Me==="Polygon"||Me==="MultiLineString")for(var Se=0;Se0&&(ee+=Q?(le*Re-Se*Pe)/2:Math.sqrt(Math.pow(Se-le,2)+Math.pow(Re-Pe,2))),le=Se,Pe=Re}var We=W.length-3;W[2]=1,mt(W,0,We,X),W[We+2]=1,W.size=Math.abs(ee),W.start=0,W.end=W.size}function me(_e,W,X,Q){for(var le=0;le<_e.length;le++){var Pe=[];Nt(_e[le],Pe,X,Q),W.push(Pe)}}function tn(_e){return _e/360+.5}function Xe(_e){var W=Math.sin(_e*Math.PI/180),X=.5-.25*Math.log((1+W)/(1-W))/Math.PI;return X<0?0:X>1?1:X}function St(_e,W,X,Q,le,Pe,ee,Me){if(Q/=W,Pe>=(X/=W)&&ee=Q)return null;for(var Se=[],Re=0;Re<_e.length;Re++){var We=_e[Re],Ye=We.geometry,Je=We.type,Bt=le===0?We.minX:We.minY,qt=le===0?We.maxX:We.maxY;if(Bt>=X&&qt=Q)){var sn=[];if(Je==="Point"||Je==="MultiPoint")hn(Ye,sn,X,Q,le);else if(Je==="LineString")Ai(Ye,sn,X,Q,le,!1,Me.lineMetrics);else if(Je==="MultiLineString")Js(Ye,sn,X,Q,le,!1);else if(Je==="Polygon")Js(Ye,sn,X,Q,le,!0);else if(Je==="MultiPolygon")for(var un=0;un=X&&ee<=Q&&(W.push(_e[Pe]),W.push(_e[Pe+1]),W.push(_e[Pe+2]))}}function Ai(_e,W,X,Q,le,Pe,ee){for(var Me,Se,Re=Ls(_e),We=le===0?ji:jl,Ye=_e.start,Je=0;Je<_e.length-3;Je+=3){var Bt=_e[Je],qt=_e[Je+1],sn=_e[Je+2],un=_e[Je+3],On=_e[Je+4],ir=le===0?Bt:qt,Sr=le===0?un:On,ui=!1;ee&&(Me=Math.sqrt(Math.pow(Bt-un,2)+Math.pow(qt-On,2))),irX&&(Se=We(Re,Bt,qt,un,On,X),ee&&(Re.start=Ye+Me*Se)):ir>Q?Sr=X&&(Se=We(Re,Bt,qt,un,On,X),ui=!0),Sr>Q&&ir<=Q&&(Se=We(Re,Bt,qt,un,On,Q),ui=!0),!Pe&&ui&&(ee&&(Re.end=Ye+Me*Se),W.push(Re),Re=Ls(_e)),ee&&(Ye+=Me)}var vn=_e.length-3;Bt=_e[vn],qt=_e[vn+1],sn=_e[vn+2],(ir=le===0?Bt:qt)>=X&&ir<=Q&&al(Re,Bt,qt,sn),vn=Re.length-3,Pe&&vn>=3&&(Re[vn]!==Re[0]||Re[vn+1]!==Re[1])&&al(Re,Re[0],Re[1],Re[2]),Re.length&&W.push(Re)}function Ls(_e){var W=[];return W.size=_e.size,W.start=_e.start,W.end=_e.end,W}function Js(_e,W,X,Q,le,Pe){for(var ee=0;ee<_e.length;ee++)Ai(_e[ee],W,X,Q,le,Pe,!1)}function al(_e,W,X,Q){_e.push(W),_e.push(X),_e.push(Q)}function ji(_e,W,X,Q,le,Pe){var ee=(Pe-W)/(Q-W);return _e.push(Pe),_e.push(X+(le-X)*ee),_e.push(1),ee}function jl(_e,W,X,Q,le,Pe){var ee=(Pe-X)/(le-X);return _e.push(W+(Q-W)*ee),_e.push(Pe),_e.push(1),ee}function Ps(_e,W){for(var X=[],Q=0;Q<_e.length;Q++){var le,Pe=_e[Q],ee=Pe.type;if(ee==="Point"||ee==="MultiPoint"||ee==="LineString")le=lt(Pe.geometry,W);else if(ee==="MultiLineString"||ee==="Polygon"){le=[];for(var Me=0;Meee.maxX&&(ee.maxX=We),Ye>ee.maxY&&(ee.maxY=Ye)}return ee}function li(_e,W,X,Q){var le=W.geometry,Pe=W.type,ee=[];if(Pe==="Point"||Pe==="MultiPoint")for(var Me=0;Me0&&W.size<(le?ee:Q))X.numPoints+=W.length/3;else{for(var Me=[],Se=0;Seee)&&(X.numSimplified++,Me.push(W[Se]),Me.push(W[Se+1])),X.numPoints++;le&&function(Re,We){for(var Ye=0,Je=0,Bt=Re.length,qt=Bt-2;Je0===We)for(Je=0,Bt=Re.length;Je24)throw new Error("maxZoom should be in the 0-24 range");if(W.promoteId&&W.generateId)throw new Error("promoteId and generateId cannot be used together.");var Q=function(le,Pe){var ee=[];if(le.type==="FeatureCollection")for(var Me=0;Me1&&console.time("creation"),Je=this.tiles[Ye]=Gl(_e,W,X,Q,Se),this.tileCoords.push({z:W,x:X,y:Q}),Re)){Re>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",W,X,Q,Je.numFeatures,Je.numPoints,Je.numSimplified),console.timeEnd("creation"));var Bt="z"+W;this.stats[Bt]=(this.stats[Bt]||0)+1,this.total++}if(Je.source=_e,le){if(W===Se.maxZoom||W===le)continue;var qt=1<1&&console.time("clipping");var sn,un,On,ir,Sr,ui,vn=.5*Se.buffer/Se.extent,Or=.5-vn,_i=.5+vn,po=1+vn;sn=un=On=ir=null,Sr=St(_e,We,X-vn,X+_i,0,Je.minX,Je.maxX,Se),ui=St(_e,We,X+Or,X+po,0,Je.minX,Je.maxX,Se),_e=null,Sr&&(sn=St(Sr,We,Q-vn,Q+_i,1,Je.minY,Je.maxY,Se),un=St(Sr,We,Q+Or,Q+po,1,Je.minY,Je.maxY,Se),Sr=null),ui&&(On=St(ui,We,Q-vn,Q+_i,1,Je.minY,Je.maxY,Se),ir=St(ui,We,Q+Or,Q+po,1,Je.minY,Je.maxY,Se),ui=null),Re>1&&console.timeEnd("clipping"),Me.push(sn||[],W+1,2*X,2*Q),Me.push(un||[],W+1,2*X,2*Q+1),Me.push(On||[],W+1,2*X+1,2*Q),Me.push(ir||[],W+1,2*X+1,2*Q+1)}}},mn.prototype.getTile=function(_e,W,X){var Q=this.options,le=Q.extent,Pe=Q.debug;if(_e<0||_e>24)return null;var ee=1<<_e,Me=pn(_e,W=(W%ee+ee)%ee,X);if(this.tiles[Me])return hs(this.tiles[Me],le);Pe>1&&console.log("drilling down to z%d-%d-%d",_e,W,X);for(var Se,Re=_e,We=W,Ye=X;!Se&&Re>0;)Re--,We=Math.floor(We/2),Ye=Math.floor(Ye/2),Se=this.tiles[pn(Re,We,Ye)];return Se&&Se.source?(Pe>1&&console.log("found parent tile z%d-%d-%d",Re,We,Ye),Pe>1&&console.time("drilling down"),this.splitTile(Se.source,Re,We,Ye,_e,W,X),Pe>1&&console.timeEnd("drilling down"),this.tiles[Me]?hs(this.tiles[Me],le):null):null};class za extends E{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(W,X){return c._(this,void 0,void 0,function*(){const Q=W.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const le=this._geoJSONIndex.getTile(Q.z,Q.x,Q.y);if(!le)return null;const Pe=new class{constructor(Me){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=c.W,this.length=Me.length,this._features=Me}feature(Me){return new class{constructor(Se){this._feature=Se,this.extent=c.W,this.type=Se.type,this.properties=Se.tags,"id"in Se&&!isNaN(Se.id)&&(this.id=parseInt(Se.id,10))}loadGeometry(){if(this._feature.type===1){const Se=[];for(const Re of this._feature.geometry)Se.push([new c.P(Re[0],Re[1])]);return Se}{const Se=[];for(const Re of this._feature.geometry){const We=[];for(const Ye of Re)We.push(new c.P(Ye[0],Ye[1]));Se.push(We)}return Se}}toGeoJSON(Se,Re,We){return N.call(this,Se,Re,We)}}(this._features[Me])}}(le.features);let ee=At(Pe);return ee.byteOffset===0&&ee.byteLength===ee.buffer.byteLength||(ee=new Uint8Array(ee)),{vectorTile:Pe,rawData:ee.buffer}})}loadData(W){return c._(this,void 0,void 0,function*(){var X;(X=this._pendingRequest)===null||X===void 0||X.abort();const Q=!!(W&&W.request&&W.request.collectResourceTiming)&&new c.bs(W.request);this._pendingRequest=new AbortController;try{let le=yield this.loadGeoJSON(W,this._pendingRequest);if(delete this._pendingRequest,typeof le!="object")throw new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`);if(R(le,!0),W.filter){const ee=c.by(W.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ee.result==="error")throw new Error(ee.value.map(Se=>`${Se.key}: ${Se.message}`).join(", "));le={type:"FeatureCollection",features:le.features.filter(Se=>ee.value.evaluate({zoom:0},Se))}}this._geoJSONIndex=W.cluster?new Ln(function({superclusterOptions:ee,clusterProperties:Me}){if(!Me||!ee)return ee;const Se={},Re={},We={accumulated:null,zoom:0},Ye={properties:null},Je=Object.keys(Me);for(const Bt of Je){const[qt,sn]=Me[Bt],un=c.by(sn),On=c.by(typeof qt=="string"?[qt,["accumulated"],["get",Bt]]:qt);Se[Bt]=un.value,Re[Bt]=On.value}return ee.map=Bt=>{Ye.properties=Bt;const qt={};for(const sn of Je)qt[sn]=Se[sn].evaluate(We,Ye);return qt},ee.reduce=(Bt,qt)=>{Ye.properties=qt;for(const sn of Je)We.accumulated=Bt[sn],Bt[sn]=Re[sn].evaluate(We,Ye)},ee}(W)).load(le.features):function(ee,Me){return new mn(ee,Me)}(le,W.geojsonVtOptions),this.loaded={};const Pe={};if(Q){const ee=Q.finish();ee&&(Pe.resourceTiming={},Pe.resourceTiming[W.source]=JSON.parse(JSON.stringify(ee)))}return Pe}catch(le){if(delete this._pendingRequest,c.bz(le))return{abandoned:!0};throw le}})}reloadTile(W){const X=this.loaded;return X&&X[W.uid]?super.reloadTile(W):this.loadTile(W)}loadGeoJSON(W,X){return c._(this,void 0,void 0,function*(){const{promoteId:Q}=W;if(W.request){const le=yield c.h(W.request,X);return this._dataUpdateable=fs(le.data,Q)?fn(le.data,Q):void 0,le.data}if(typeof W.data=="string")try{const le=JSON.parse(W.data);return this._dataUpdateable=fs(le,Q)?fn(le,Q):void 0,le}catch{throw new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`)}if(!W.dataDiff)throw new Error(`Input data given to '${W.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${W.source}`);return function(le,Pe,ee){var Me,Se,Re,We;if(Pe.removeAll&&le.clear(),Pe.remove)for(const Ye of Pe.remove)le.delete(Ye);if(Pe.add)for(const Ye of Pe.add){const Je=Zr(Ye,ee);Je!=null&&le.set(Je,Ye)}if(Pe.update)for(const Ye of Pe.update){let Je=le.get(Ye.id);if(Je==null)continue;const Bt=!Ye.removeAllProperties&&(((Me=Ye.removeProperties)===null||Me===void 0?void 0:Me.length)>0||((Se=Ye.addOrUpdateProperties)===null||Se===void 0?void 0:Se.length)>0);if((Ye.newGeometry||Ye.removeAllProperties||Bt)&&(Je=Object.assign({},Je),le.set(Ye.id,Je),Bt&&(Je.properties=Object.assign({},Je.properties))),Ye.newGeometry&&(Je.geometry=Ye.newGeometry),Ye.removeAllProperties)Je.properties={};else if(((Re=Ye.removeProperties)===null||Re===void 0?void 0:Re.length)>0)for(const qt of Ye.removeProperties)Object.prototype.hasOwnProperty.call(Je.properties,qt)&&delete Je.properties[qt];if(((We=Ye.addOrUpdateProperties)===null||We===void 0?void 0:We.length)>0)for(const{key:qt,value:sn}of Ye.addOrUpdateProperties)Je.properties[qt]=sn}}(this._dataUpdateable,W.dataDiff,Q),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(W){return c._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(W){return this._geoJSONIndex.getClusterExpansionZoom(W.clusterId)}getClusterChildren(W){return this._geoJSONIndex.getChildren(W.clusterId)}getClusterLeaves(W){return this._geoJSONIndex.getLeaves(W.clusterId,W.limit,W.offset)}}class Jr{constructor(W){this.self=W,this.actor=new c.C(W),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(X,Q)=>{if(this.externalWorkerSourceTypes[X])throw new Error(`Worker source with name "${X}" already registered.`);this.externalWorkerSourceTypes[X]=Q},this.self.addProtocol=c.bf,this.self.removeProtocol=c.bg,this.self.registerRTLTextPlugin=X=>{if(c.bA.isParsed())throw new Error("RTL text plugin already registered.");c.bA.setMethods(X)},this.actor.registerMessageHandler("LDT",(X,Q)=>this._getDEMWorkerSource(X,Q.source).loadTile(Q)),this.actor.registerMessageHandler("RDT",(X,Q)=>c._(this,void 0,void 0,function*(){this._getDEMWorkerSource(X,Q.source).removeTile(Q)})),this.actor.registerMessageHandler("GCEZ",(X,Q)=>c._(this,void 0,void 0,function*(){return this._getWorkerSource(X,Q.type,Q.source).getClusterExpansionZoom(Q)})),this.actor.registerMessageHandler("GCC",(X,Q)=>c._(this,void 0,void 0,function*(){return this._getWorkerSource(X,Q.type,Q.source).getClusterChildren(Q)})),this.actor.registerMessageHandler("GCL",(X,Q)=>c._(this,void 0,void 0,function*(){return this._getWorkerSource(X,Q.type,Q.source).getClusterLeaves(Q)})),this.actor.registerMessageHandler("LD",(X,Q)=>this._getWorkerSource(X,Q.type,Q.source).loadData(Q)),this.actor.registerMessageHandler("LT",(X,Q)=>this._getWorkerSource(X,Q.type,Q.source).loadTile(Q)),this.actor.registerMessageHandler("RT",(X,Q)=>this._getWorkerSource(X,Q.type,Q.source).reloadTile(Q)),this.actor.registerMessageHandler("AT",(X,Q)=>this._getWorkerSource(X,Q.type,Q.source).abortTile(Q)),this.actor.registerMessageHandler("RMT",(X,Q)=>this._getWorkerSource(X,Q.type,Q.source).removeTile(Q)),this.actor.registerMessageHandler("RS",(X,Q)=>c._(this,void 0,void 0,function*(){if(!this.workerSources[X]||!this.workerSources[X][Q.type]||!this.workerSources[X][Q.type][Q.source])return;const le=this.workerSources[X][Q.type][Q.source];delete this.workerSources[X][Q.type][Q.source],le.removeSource!==void 0&&le.removeSource(Q)})),this.actor.registerMessageHandler("RM",X=>c._(this,void 0,void 0,function*(){delete this.layerIndexes[X],delete this.availableImages[X],delete this.workerSources[X],delete this.demWorkerSources[X]})),this.actor.registerMessageHandler("SR",(X,Q)=>c._(this,void 0,void 0,function*(){this.referrer=Q})),this.actor.registerMessageHandler("SRPS",(X,Q)=>this._syncRTLPluginState(X,Q)),this.actor.registerMessageHandler("IS",(X,Q)=>c._(this,void 0,void 0,function*(){this.self.importScripts(Q)})),this.actor.registerMessageHandler("SI",(X,Q)=>this._setImages(X,Q)),this.actor.registerMessageHandler("UL",(X,Q)=>c._(this,void 0,void 0,function*(){this._getLayerIndex(X).update(Q.layers,Q.removedIds)})),this.actor.registerMessageHandler("SL",(X,Q)=>c._(this,void 0,void 0,function*(){this._getLayerIndex(X).replace(Q)}))}_setImages(W,X){return c._(this,void 0,void 0,function*(){this.availableImages[W]=X;for(const Q in this.workerSources[W]){const le=this.workerSources[W][Q];for(const Pe in le)le[Pe].availableImages=X}})}_syncRTLPluginState(W,X){return c._(this,void 0,void 0,function*(){if(c.bA.isParsed())return c.bA.getState();if(X.pluginStatus!=="loading")return c.bA.setState(X),X;const Q=X.pluginURL;if(this.self.importScripts(Q),c.bA.isParsed()){const le={pluginStatus:"loaded",pluginURL:Q};return c.bA.setState(le),le}throw c.bA.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Q}`)})}_getAvailableImages(W){let X=this.availableImages[W];return X||(X=[]),X}_getLayerIndex(W){let X=this.layerIndexes[W];return X||(X=this.layerIndexes[W]=new l),X}_getWorkerSource(W,X,Q){if(this.workerSources[W]||(this.workerSources[W]={}),this.workerSources[W][X]||(this.workerSources[W][X]={}),!this.workerSources[W][X][Q]){const le={sendAsync:(Pe,ee)=>(Pe.targetMapId=W,this.actor.sendAsync(Pe,ee))};switch(X){case"vector":this.workerSources[W][X][Q]=new E(le,this._getLayerIndex(W),this._getAvailableImages(W));break;case"geojson":this.workerSources[W][X][Q]=new za(le,this._getLayerIndex(W),this._getAvailableImages(W));break;default:this.workerSources[W][X][Q]=new this.externalWorkerSourceTypes[X](le,this._getLayerIndex(W),this._getAvailableImages(W))}}return this.workerSources[W][X][Q]}_getDEMWorkerSource(W,X){return this.demWorkerSources[W]||(this.demWorkerSources[W]={}),this.demWorkerSources[W][X]||(this.demWorkerSources[W][X]=new C),this.demWorkerSources[W][X]}}return c.i(self)&&(self.worker=new Jr(self)),Jr}),i("index",["exports","./shared"],function(c,l){var d="4.1.3";let y,S;const E={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:v=>new Promise((a,f)=>{const m=requestAnimationFrame(a);v.signal.addEventListener("abort",()=>{cancelAnimationFrame(m),f(l.c())})}),getImageData(v,a=0){return this.getImageCanvasContext(v).getImageData(-a,-a,v.width+2*a,v.height+2*a)},getImageCanvasContext(v){const a=window.document.createElement("canvas"),f=a.getContext("2d",{willReadFrequently:!0});if(!f)throw new Error("failed to create canvas 2d context");return a.width=v.width,a.height=v.height,f.drawImage(v,0,0,v.width,v.height),f},resolveURL:v=>(y||(y=document.createElement("a")),y.href=v,y.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(S==null&&(S=matchMedia("(prefers-reduced-motion: reduce)")),S.matches)}};class C{static testProp(a){if(!C.docStyle)return a[0];for(let f=0;f{window.removeEventListener("click",C.suppressClickInternal,!0)},0)}static getScale(a){const f=a.getBoundingClientRect();return{x:f.width/a.offsetWidth||1,y:f.height/a.offsetHeight||1,boundingClientRect:f}}static getPoint(a,f,m){const g=f.boundingClientRect;return new l.P((m.clientX-g.left)/f.x-a.clientLeft,(m.clientY-g.top)/f.y-a.clientTop)}static mousePos(a,f){const m=C.getScale(a);return C.getPoint(a,m,f)}static touchPos(a,f){const m=[],g=C.getScale(a);for(let b=0;b{a=[],f=0,m=0,g={}},v.addThrottleControl=k=>{const z=m++;return g[z]=k,z},v.removeThrottleControl=k=>{delete g[k],T()},v.getImage=(k,z,j=!0)=>new Promise((q,$)=>{A.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),l.e(k,{type:"image"}),a.push({abortController:z,requestParameters:k,supportImageRefresh:j,state:"queued",onError:he=>{$(he)},onSuccess:he=>{q(he)}}),T()});const b=k=>l._(this,void 0,void 0,function*(){k.state="running";const{requestParameters:z,supportImageRefresh:j,onError:q,onSuccess:$,abortController:he}=k,ce=j===!1&&!l.i(self)&&!l.g(z.url)&&(!z.headers||Object.keys(z.headers).reduce((Ie,Ue)=>Ie&&Ue==="accept",!0));f++;const ye=ce?L(z,he):l.m(z,he);try{const Ie=yield ye;delete k.abortController,k.state="completed",Ie.data instanceof HTMLImageElement||l.b(Ie.data)?$(Ie):Ie.data&&$({data:yield(re=Ie.data,typeof createImageBitmap=="function"?l.d(re):l.f(re)),cacheControl:Ie.cacheControl,expires:Ie.expires})}catch(Ie){delete k.abortController,q(Ie)}finally{f--,T()}var re}),T=()=>{const k=(()=>{for(const z of Object.keys(g))if(g[z]())return!0;return!1})()?l.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:l.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let z=f;z0;z++){const j=a.shift();j.abortController.signal.aborted?z--:b(j)}},L=(k,z)=>new Promise((j,q)=>{const $=new Image,he=k.url,ce=k.credentials;ce&&ce==="include"?$.crossOrigin="use-credentials":(ce&&ce==="same-origin"||!l.s(he))&&($.crossOrigin="anonymous"),z.signal.addEventListener("abort",()=>{$.src="",q(l.c())}),$.fetchPriority="high",$.onload=()=>{$.onerror=$.onload=null,j({data:$})},$.onerror=()=>{$.onerror=$.onload=null,z.signal.aborted||q(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."))},$.src=he})}(G||(G={})),G.resetRequestQueue();class U{constructor(a){this._transformRequestFn=a}transformRequest(a,f){return this._transformRequestFn&&this._transformRequestFn(a,f)||{url:a}}normalizeSpriteURL(a,f,m){const g=function(b){const T=b.match(Z);if(!T)throw new Error(`Unable to parse URL "${b}"`);return{protocol:T[1],authority:T[2],path:T[3]||"/",params:T[4]?T[4].split("&"):[]}}(a);return g.path+=`${f}${m}`,function(b){const T=b.params.length?`?${b.params.join("&")}`:"";return`${b.protocol}://${b.authority}${b.path}${T}`}(g)}setTransformRequest(a){this._transformRequestFn=a}}const Z=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ue(v){var a=new l.A(3);return a[0]=v[0],a[1]=v[1],a[2]=v[2],a}var ae,se=function(v,a,f){return v[0]=a[0]-f[0],v[1]=a[1]-f[1],v[2]=a[2]-f[2],v};ae=new l.A(3),l.A!=Float32Array&&(ae[0]=0,ae[1]=0,ae[2]=0);var fe=function(v){var a=v[0],f=v[1];return a*a+f*f};function ke(v){const a=[];if(typeof v=="string")a.push({id:"default",url:v});else if(v&&v.length>0){const f=[];for(const{id:m,url:g}of v){const b=`${m}${g}`;f.indexOf(b)===-1&&(f.push(b),a.push({id:m,url:g}))}}return a}(function(){var v=new l.A(2);l.A!=Float32Array&&(v[0]=0,v[1]=0)})();class K{constructor(a,f,m,g){this.context=a,this.format=m,this.texture=a.gl.createTexture(),this.update(f,g)}update(a,f,m){const{width:g,height:b}=a,T=!(this.size&&this.size[0]===g&&this.size[1]===b||m),{context:L}=this,{gl:k}=L;if(this.useMipmap=!!(f&&f.useMipmap),k.bindTexture(k.TEXTURE_2D,this.texture),L.pixelStoreUnpackFlipY.set(!1),L.pixelStoreUnpack.set(1),L.pixelStoreUnpackPremultiplyAlpha.set(this.format===k.RGBA&&(!f||f.premultiply!==!1)),T)this.size=[g,b],a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||l.b(a)?k.texImage2D(k.TEXTURE_2D,0,this.format,this.format,k.UNSIGNED_BYTE,a):k.texImage2D(k.TEXTURE_2D,0,this.format,g,b,0,this.format,k.UNSIGNED_BYTE,a.data);else{const{x:z,y:j}=m||{x:0,y:0};a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||l.b(a)?k.texSubImage2D(k.TEXTURE_2D,0,z,j,k.RGBA,k.UNSIGNED_BYTE,a):k.texSubImage2D(k.TEXTURE_2D,0,z,j,g,b,k.RGBA,k.UNSIGNED_BYTE,a.data)}this.useMipmap&&this.isSizePowerOfTwo()&&k.generateMipmap(k.TEXTURE_2D)}bind(a,f,m){const{context:g}=this,{gl:b}=g;b.bindTexture(b.TEXTURE_2D,this.texture),m!==b.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(m=b.LINEAR),a!==this.filter&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,m||a),this.filter=a),f!==this.wrap&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,f),this.wrap=f)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:a}=this.context;a.deleteTexture(this.texture),this.texture=null}}function oe(v){const{userImage:a}=v;return!!(a&&a.render&&a.render())&&(v.data.replace(new Uint8Array(a.data.buffer)),!0)}class Ge 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(a){if(this.loaded!==a&&(this.loaded=a,a)){for(const{ids:f,promiseResolve:m}of this.requestors)m(this._getImagesForIds(f));this.requestors=[]}}getImage(a){const f=this.images[a];if(f&&!f.data&&f.spriteData){const m=f.spriteData;f.data=new l.R({width:m.width,height:m.height},m.context.getImageData(m.x,m.y,m.width,m.height).data),f.spriteData=null}return f}addImage(a,f){if(this.images[a])throw new Error(`Image id ${a} already exist, use updateImage instead`);this._validate(a,f)&&(this.images[a]=f)}_validate(a,f){let m=!0;const g=f.data||f.spriteData;return this._validateStretch(f.stretchX,g&&g.width)||(this.fire(new l.j(new Error(`Image "${a}" has invalid "stretchX" value`))),m=!1),this._validateStretch(f.stretchY,g&&g.height)||(this.fire(new l.j(new Error(`Image "${a}" has invalid "stretchY" value`))),m=!1),this._validateContent(f.content,f)||(this.fire(new l.j(new Error(`Image "${a}" has invalid "content" value`))),m=!1),m}_validateStretch(a,f){if(!a)return!0;let m=0;for(const g of a){if(g[0]{let g=!0;if(!this.isLoaded())for(const b of a)this.images[b]||(g=!1);this.isLoaded()||g?f(this._getImagesForIds(a)):this.requestors.push({ids:a,promiseResolve:f})})}_getImagesForIds(a){const f={};for(const m of a){let g=this.getImage(m);g||(this.fire(new l.k("styleimagemissing",{id:m})),g=this.getImage(m)),g?f[m]={data:g.data.clone(),pixelRatio:g.pixelRatio,sdf:g.sdf,version:g.version,stretchX:g.stretchX,stretchY:g.stretchY,content:g.content,hasRenderCallback:!!(g.userImage&&g.userImage.render)}:l.w(`Image "${m}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return f}getPixelSize(){const{width:a,height:f}=this.atlasImage;return{width:a,height:f}}getPattern(a){const f=this.patterns[a],m=this.getImage(a);if(!m)return null;if(f&&f.position.version===m.version)return f.position;if(f)f.position.version=m.version;else{const g={w:m.data.width+2,h:m.data.height+2,x:0,y:0},b=new l.I(g,m);this.patterns[a]={bin:g,position:b}}return this._updatePatternAtlas(),this.patterns[a].position}bind(a){const f=a.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new K(a,this.atlasImage,f.RGBA),this.atlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE)}_updatePatternAtlas(){const a=[];for(const b in this.patterns)a.push(this.patterns[b].bin);const{w:f,h:m}=l.p(a),g=this.atlasImage;g.resize({width:f||1,height:m||1});for(const b in this.patterns){const{bin:T}=this.patterns[b],L=T.x+1,k=T.y+1,z=this.getImage(b).data,j=z.width,q=z.height;l.R.copy(z,g,{x:0,y:0},{x:L,y:k},{width:j,height:q}),l.R.copy(z,g,{x:0,y:q-1},{x:L,y:k-1},{width:j,height:1}),l.R.copy(z,g,{x:0,y:0},{x:L,y:k+q},{width:j,height:1}),l.R.copy(z,g,{x:j-1,y:0},{x:L-1,y:k},{width:1,height:q}),l.R.copy(z,g,{x:0,y:0},{x:L+j,y:k},{width:1,height:q})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(a){for(const f of a){if(this.callbackDispatchedThisFrame[f])continue;this.callbackDispatchedThisFrame[f]=!0;const m=this.getImage(f);m||l.w(`Image with ID: "${f}" was not found`),oe(m)&&this.updateImage(f,m)}}}const Te=1e20;function ot(v,a,f,m,g,b,T,L,k){for(let z=a;z-1);k++,b[k]=L,T[k]=z,T[k+1]=Te}for(let L=0,k=0;L65535)throw new Error("glyphs > 65535 not supported");if(m.ranges[b])return{stack:a,id:f,glyph:g};if(!this.url)throw new Error("glyphsUrl is not set");if(!m.requests[b]){const L=At.loadGlyphRange(a,b,this.url,this.requestManager);m.requests[b]=L}const T=yield m.requests[b];for(const L in T)this._doesCharSupportLocalGlyph(+L)||(m.glyphs[+L]=T[+L]);return m.ranges[b]=!0,{stack:a,id:f,glyph:T[f]||null}})}_doesCharSupportLocalGlyph(a){return!!this.localIdeographFontFamily&&(l.u["CJK Unified Ideographs"](a)||l.u["Hangul Syllables"](a)||l.u.Hiragana(a)||l.u.Katakana(a))}_tinySDF(a,f,m){const g=this.localIdeographFontFamily;if(!g||!this._doesCharSupportLocalGlyph(m))return;let b=a.tinySDF;if(!b){let L="400";/bold/i.test(f)?L="900":/medium/i.test(f)?L="500":/light/i.test(f)&&(L="200"),b=a.tinySDF=new At.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:g,fontWeight:L})}const T=b.draw(String.fromCharCode(m));return{id:m,bitmap:new l.o({width:T.width||60,height:T.height||60},T.data),metrics:{width:T.glyphWidth/2||24,height:T.glyphHeight/2||24,left:T.glyphLeft/2+.5||0,top:T.glyphTop/2-27.5||-8,advance:T.glyphAdvance/2||24,isDoubleResolution:!0}}}}At.loadGlyphRange=function(v,a,f,m){return l._(this,void 0,void 0,function*(){const g=256*a,b=g+255,T=m.transformRequest(f.replace("{fontstack}",v).replace("{range}",`${g}-${b}`),"Glyphs"),L=yield l.l(T,new AbortController);if(!L||!L.data)throw new Error(`Could not load glyph range. range: ${a}, ${g}-${b}`);const k={};for(const z of l.n(L.data))k[z.id]=z;return k})},At.TinySDF=class{constructor({fontSize:v=24,buffer:a=3,radius:f=8,cutoff:m=.25,fontFamily:g="sans-serif",fontWeight:b="normal",fontStyle:T="normal"}={}){this.buffer=a,this.cutoff=m,this.radius=f;const L=this.size=v+4*a,k=this._createCanvas(L),z=this.ctx=k.getContext("2d",{willReadFrequently:!0});z.font=`${T} ${b} ${v}px ${g}`,z.textBaseline="alphabetic",z.textAlign="left",z.fillStyle="black",this.gridOuter=new Float64Array(L*L),this.gridInner=new Float64Array(L*L),this.f=new Float64Array(L),this.z=new Float64Array(L+1),this.v=new Uint16Array(L)}_createCanvas(v){const a=document.createElement("canvas");return a.width=a.height=v,a}draw(v){const{width:a,actualBoundingBoxAscent:f,actualBoundingBoxDescent:m,actualBoundingBoxLeft:g,actualBoundingBoxRight:b}=this.ctx.measureText(v),T=Math.ceil(f),L=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(b-g))),k=Math.min(this.size-this.buffer,T+Math.ceil(m)),z=L+2*this.buffer,j=k+2*this.buffer,q=Math.max(z*j,0),$=new Uint8ClampedArray(q),he={data:$,width:z,height:j,glyphWidth:L,glyphHeight:k,glyphTop:T,glyphLeft:0,glyphAdvance:a};if(L===0||k===0)return he;const{ctx:ce,buffer:ye,gridInner:re,gridOuter:Ie}=this;ce.clearRect(ye,ye,L,k),ce.fillText(v,ye,ye+T);const Ue=ce.getImageData(ye,ye,L,k);Ie.fill(Te,0,q),re.fill(0,0,q);for(let xe=0;xe0?$e*$e:0,re[He]=$e<0?$e*$e:0}}ot(Ie,0,0,z,j,z,this.f,this.v,this.z),ot(re,ye,ye,L,k,z,this.f,this.v,this.z);for(let xe=0;xe1&&(k=a[++L]);const j=Math.abs(z-k.left),q=Math.abs(z-k.right),$=Math.min(j,q);let he;const ce=b/m*(g+1);if(k.isDash){const ye=g-Math.abs(ce);he=Math.sqrt($*$+ye*ye)}else he=g-Math.sqrt($*$+ce*ce);this.data[T+z]=Math.max(0,Math.min(255,he+128))}}}addRegularDash(a){for(let L=a.length-1;L>=0;--L){const k=a[L],z=a[L+1];k.zeroLength?a.splice(L,1):z&&z.isDash===k.isDash&&(z.left=k.left,a.splice(L,1))}const f=a[0],m=a[a.length-1];f.isDash===m.isDash&&(f.left=m.left-this.width,m.right=f.right+this.width);const g=this.width*this.nextRow;let b=0,T=a[b];for(let L=0;L1&&(T=a[++b]);const k=Math.abs(L-T.left),z=Math.abs(L-T.right),j=Math.min(k,z);this.data[g+L]=Math.max(0,Math.min(255,(T.isDash?j:-j)+128))}}addDash(a,f){const m=f?7:0,g=2*m+1;if(this.nextRow+g>this.height)return l.w("LineAtlas out of space"),null;let b=0;for(let L=0;L{f.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Ot]}numActive(){return Object.keys(this.active).length}}const Ln=Math.floor(E.hardwareConcurrency/2);let an,Xt;function En(){return an||(an=new ln),an}ln.workerCount=l.B(globalThis)?Math.max(Math.min(Ln,3),1):1;class In{constructor(a,f){this.workerPool=a,this.actors=[],this.currentActor=0,this.id=f;const m=this.workerPool.acquire(f);for(let g=0;g{f.remove()}),this.actors=[],a&&this.workerPool.release(this.id)}registerMessageHandler(a,f){for(const m of this.actors)m.registerMessageHandler(a,f)}}function rr(){return Xt||(Xt=new In(En(),l.G),Xt.registerMessageHandler("GR",(v,a,f)=>l.m(a,f))),Xt}function mt(v,a){const f=l.F();return l.H(f,f,[1,1,0]),l.J(f,f,[.5*v.width,.5*v.height,1]),l.K(f,f,v.calculatePosMatrix(a.toUnwrapped()))}function Dt(v,a,f,m,g,b){const T=function(q,$,he){if(q)for(const ce of q){const ye=$[ce];if(ye&&ye.source===he&&ye.type==="fill-extrusion")return!0}else for(const ce in $){const ye=$[ce];if(ye.source===he&&ye.type==="fill-extrusion")return!0}return!1}(g&&g.layers,a,v.id),L=b.maxPitchScaleFactor(),k=v.tilesIn(m,L,T);k.sort(Sn);const z=[];for(const q of k)z.push({wrappedTileID:q.tileID.wrapped().key,queryResults:q.tile.queryRenderedFeatures(a,f,v._state,q.queryGeometry,q.cameraQueryGeometry,q.scale,g,b,L,mt(v.transform,q.tileID))});const j=function(q){const $={},he={};for(const ce of q){const ye=ce.queryResults,re=ce.wrappedTileID,Ie=he[re]=he[re]||{};for(const Ue in ye){const xe=ye[Ue],De=Ie[Ue]=Ie[Ue]||{},qe=$[Ue]=$[Ue]||[];for(const He of xe)De[He.featureIndex]||(De[He.featureIndex]=!0,qe.push(He))}}return $}(z);for(const q in j)j[q].forEach($=>{const he=$.feature,ce=v.getFeatureState(he.layer["source-layer"],he.id);he.source=he.layer.source,he.layer["source-layer"]&&(he.sourceLayer=he.layer["source-layer"]),he.state=ce});return j}function Sn(v,a){const f=v.tileID,m=a.tileID;return f.overscaledZ-m.overscaledZ||f.canonical.y-m.canonical.y||f.wrap-m.wrap||f.canonical.x-m.canonical.x}function Le(v,a,f){return l._(this,void 0,void 0,function*(){let m=v;if(v.url?m=(yield l.h(a.transformRequest(v.url,"Source"),f)).data:yield E.frameAsync(f),!m)return null;const g=l.L(l.e(m,v),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in m&&m.vector_layers&&(g.vectorLayerIds=m.vector_layers.map(b=>b.id)),g})}class rt{constructor(a,f){a&&(f?this.setSouthWest(a).setNorthEast(f):Array.isArray(a)&&(a.length===4?this.setSouthWest([a[0],a[1]]).setNorthEast([a[2],a[3]]):this.setSouthWest(a[0]).setNorthEast(a[1])))}setNorthEast(a){return this._ne=a instanceof l.M?new l.M(a.lng,a.lat):l.M.convert(a),this}setSouthWest(a){return this._sw=a instanceof l.M?new l.M(a.lng,a.lat):l.M.convert(a),this}extend(a){const f=this._sw,m=this._ne;let g,b;if(a instanceof l.M)g=a,b=a;else{if(!(a instanceof rt))return Array.isArray(a)?a.length===4||a.every(Array.isArray)?this.extend(rt.convert(a)):this.extend(l.M.convert(a)):a&&("lng"in a||"lon"in a)&&"lat"in a?this.extend(l.M.convert(a)):this;if(g=a._sw,b=a._ne,!g||!b)return this}return f||m?(f.lng=Math.min(g.lng,f.lng),f.lat=Math.min(g.lat,f.lat),m.lng=Math.max(b.lng,m.lng),m.lat=Math.max(b.lat,m.lat)):(this._sw=new l.M(g.lng,g.lat),this._ne=new l.M(b.lng,b.lat)),this}getCenter(){return new l.M((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.M(this.getWest(),this.getNorth())}getSouthEast(){return new l.M(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(a){const{lng:f,lat:m}=l.M.convert(a);let g=this._sw.lng<=f&&f<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=f&&f>=this._ne.lng),this._sw.lat<=m&&m<=this._ne.lat&&g}static convert(a){return a instanceof rt?a:a&&new rt(a)}static fromLngLat(a,f=0){const m=360*f/40075017,g=m/Math.cos(Math.PI/180*a.lat);return new rt(new l.M(a.lng-g,a.lat-m),new l.M(a.lng+g,a.lat+m))}}class gt{constructor(a,f,m){this.bounds=rt.convert(this.validateBounds(a)),this.minzoom=f||0,this.maxzoom=m||24}validateBounds(a){return Array.isArray(a)&&a.length===4?[Math.max(-180,a[0]),Math.max(-90,a[1]),Math.min(180,a[2]),Math.min(90,a[3])]:[-180,-90,180,90]}contains(a){const f=Math.pow(2,a.z),m=Math.floor(l.N(this.bounds.getWest())*f),g=Math.floor(l.O(this.bounds.getNorth())*f),b=Math.ceil(l.N(this.bounds.getEast())*f),T=Math.ceil(l.O(this.bounds.getSouth())*f);return a.x>=m&&a.x=g&&a.y{this._options.tiles=a}),this}setUrl(a){return this.setSourceProperty(()=>{this.url=a,this._options.url=a}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return l.e({},this._options)}loadTile(a){return l._(this,void 0,void 0,function*(){const f=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),m={request:this.map._requestManager.transformRequest(f,"Tile"),uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,tileSize:this.tileSize*a.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};m.request.collectResourceTiming=this._collectResourceTiming;let g="RT";if(a.actor&&a.state!=="expired"){if(a.state==="loading")return new Promise((b,T)=>{a.reloadPromise={resolve:b,reject:T}})}else a.actor=this.dispatcher.getActor(),g="LT";a.abortController=new AbortController;try{const b=yield a.actor.sendAsync({type:g,data:m},a.abortController);if(delete a.abortController,a.aborted)return;this._afterTileLoadWorkerResponse(a,b)}catch(b){if(delete a.abortController,a.aborted)return;if(b&&b.status!==404)throw b;this._afterTileLoadWorkerResponse(a,null)}})}_afterTileLoadWorkerResponse(a,f){if(f&&f.resourceTiming&&(a.resourceTiming=f.resourceTiming),f&&this.map._refreshExpiredTiles&&a.setExpiryData(f),a.loadVectorData(f,this.map.painter),a.reloadPromise){const m=a.reloadPromise;a.reloadPromise=null,this.loadTile(a).then(m.resolve).catch(m.reject)}}abortTile(a){return l._(this,void 0,void 0,function*(){a.abortController&&(a.abortController.abort(),delete a.abortController),a.actor&&(yield a.actor.sendAsync({type:"AT",data:{uid:a.uid,type:this.type,source:this.id}}))})}unloadTile(a){return l._(this,void 0,void 0,function*(){a.unloadVectorData(),a.actor&&(yield a.actor.sendAsync({type:"RMT",data:{uid:a.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class me extends l.E{constructor(a,f,m,g){super(),this.id=a,this.dispatcher=m,this.setEventedParent(g),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"},f),l.e(this,l.L(f,["url","scheme","tileSize"]))}load(){return l._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const a=yield Le(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,a&&(l.e(this,a),a.bounds&&(this.tileBounds=new gt(a.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"})))}catch(a){this._tileJSONRequest=null,this.fire(new l.j(a))}})}loaded(){return this._loaded}onAdd(a){this.map=a,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(a){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),a(),this.load()}setTiles(a){return this.setSourceProperty(()=>{this._options.tiles=a}),this}setUrl(a){return this.setSourceProperty(()=>{this.url=a,this._options.url=a}),this}serialize(){return l.e({},this._options)}hasTile(a){return!this.tileBounds||this.tileBounds.contains(a.canonical)}loadTile(a){return l._(this,void 0,void 0,function*(){const f=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);a.abortController=new AbortController;try{const m=yield G.getImage(this.map._requestManager.transformRequest(f,"Tile"),a.abortController,this.map._refreshExpiredTiles);if(delete a.abortController,a.aborted)return void(a.state="unloaded");if(m&&m.data){this.map._refreshExpiredTiles&&m.cacheControl&&m.expires&&a.setExpiryData({cacheControl:m.cacheControl,expires:m.expires});const g=this.map.painter.context,b=g.gl,T=m.data;a.texture=this.map.painter.getTileTexture(T.width),a.texture?a.texture.update(T,{useMipmap:!0}):(a.texture=new K(g,T,b.RGBA,{useMipmap:!0}),a.texture.bind(b.LINEAR,b.CLAMP_TO_EDGE,b.LINEAR_MIPMAP_NEAREST),g.extTextureFilterAnisotropic&&b.texParameterf(b.TEXTURE_2D,g.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,g.extTextureFilterAnisotropicMax)),a.state="loaded"}}catch(m){if(delete a.abortController,a.aborted)a.state="unloaded";else if(m)throw a.state="errored",m}})}abortTile(a){return l._(this,void 0,void 0,function*(){a.abortController&&(a.abortController.abort(),delete a.abortController)})}unloadTile(a){return l._(this,void 0,void 0,function*(){a.texture&&this.map.painter.saveTileTexture(a.texture)})}hasTransition(){return!1}}class tn extends me{constructor(a,f,m,g){super(a,f,m,g),this.type="raster-dem",this.maxzoom=22,this._options=l.e({type:"raster-dem"},f),this.encoding=f.encoding||"mapbox",this.redFactor=f.redFactor,this.greenFactor=f.greenFactor,this.blueFactor=f.blueFactor,this.baseShift=f.baseShift}loadTile(a){return l._(this,void 0,void 0,function*(){const f=a.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),m=this.map._requestManager.transformRequest(f,"Tile");a.neighboringTiles=this._getNeighboringTiles(a.tileID),a.abortController=new AbortController;try{const g=yield G.getImage(m,a.abortController,this.map._refreshExpiredTiles);if(delete a.abortController,a.aborted)return void(a.state="unloaded");if(g&&g.data){const b=g.data;this.map._refreshExpiredTiles&&g.cacheControl&&g.expires&&a.setExpiryData({cacheControl:g.cacheControl,expires:g.expires});const T=l.b(b)&&l.S()?b:yield this.readImageNow(b),L={type:this.type,uid:a.uid,source:this.id,rawImageData:T,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!a.actor||a.state==="expired"){a.actor=this.dispatcher.getActor();const k=yield a.actor.sendAsync({type:"LDT",data:L});a.dem=k,a.needsHillshadePrepare=!0,a.needsTerrainPrepare=!0,a.state="loaded"}}}catch(g){if(delete a.abortController,a.aborted)a.state="unloaded";else if(g)throw a.state="errored",g}})}readImageNow(a){return l._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&l.U()){const f=a.width+2,m=a.height+2;try{return new l.R({width:f,height:m},yield l.V(a,-1,-1,f,m))}catch{}}return E.getImageData(a,1)})}_getNeighboringTiles(a){const f=a.canonical,m=Math.pow(2,f.z),g=(f.x-1+m)%m,b=f.x===0?a.wrap-1:a.wrap,T=(f.x+1+m)%m,L=f.x+1===m?a.wrap+1:a.wrap,k={};return k[new l.Q(a.overscaledZ,b,f.z,g,f.y).key]={backfilled:!1},k[new l.Q(a.overscaledZ,L,f.z,T,f.y).key]={backfilled:!1},f.y>0&&(k[new l.Q(a.overscaledZ,b,f.z,g,f.y-1).key]={backfilled:!1},k[new l.Q(a.overscaledZ,a.wrap,f.z,f.x,f.y-1).key]={backfilled:!1},k[new l.Q(a.overscaledZ,L,f.z,T,f.y-1).key]={backfilled:!1}),f.y+10&&l.e(b,{resourceTiming:g}),this.fire(new l.k("data",Object.assign(Object.assign({},b),{sourceDataType:"metadata"}))),this.fire(new l.k("data",Object.assign(Object.assign({},b),{sourceDataType:"content"})))}catch(m){if(this._pendingLoads--,this._removed)return void this.fire(new l.k("dataabort",{dataType:"source"}));this.fire(new l.j(m))}})}loaded(){return this._pendingLoads===0}loadTile(a){return l._(this,void 0,void 0,function*(){const f=a.actor?"RT":"LT";a.actor=this.actor;const m={type:this.type,uid:a.uid,tileID:a.tileID,zoom:a.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.abortController=new AbortController;const g=yield this.actor.sendAsync({type:f,data:m},a.abortController);delete a.abortController,a.unloadVectorData(),a.aborted||a.loadVectorData(g,this.map.painter,f==="RT")})}abortTile(a){return l._(this,void 0,void 0,function*(){a.abortController&&(a.abortController.abort(),delete a.abortController),a.aborted=!0})}unloadTile(a){return l._(this,void 0,void 0,function*(){a.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:a.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return l.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var St=l.X([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class hn extends l.E{constructor(a,f,m,g){super(),this.id=a,this.dispatcher=m,this.coordinates=f.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(g),this.options=f}load(a){return l._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const f=yield G.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,f&&f.data&&(this.image=f.data,a&&(this.coordinates=a),this._finishLoading())}catch(f){this._request=null,this._loaded=!0,this.fire(new l.j(f))}})}loaded(){return this._loaded}updateImage(a){return a.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=a.url,this.load(a.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(a){this.map=a,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(a){this.coordinates=a;const f=a.map(l.Y.fromLngLat);this.tileID=function(g){let b=1/0,T=1/0,L=-1/0,k=-1/0;for(const $ of g)b=Math.min(b,$.x),T=Math.min(T,$.y),L=Math.max(L,$.x),k=Math.max(k,$.y);const z=Math.max(L-b,k-T),j=Math.max(0,Math.floor(-Math.log(z)/Math.LN2)),q=Math.pow(2,j);return new l.a0(j,Math.floor((b+L)/2*q),Math.floor((T+k)/2*q))}(f),this.minzoom=this.maxzoom=this.tileID.z;const m=f.map(g=>this.tileID.getTilePoint(g)._round());return this._boundsArray=new l.Z,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,l.W,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,l.W),this._boundsArray.emplaceBack(m[2].x,m[2].y,l.W,l.W),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const a=this.map.painter.context,f=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,St.members)),this.boundsSegments||(this.boundsSegments=l.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new K(a,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let m=!1;for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,m=!0)}m&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(a){return l._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(a.tileID.canonical)?(this.tiles[String(a.tileID.wrap)]=a,a.buckets={}):a.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Ai extends hn{constructor(a,f,m,g){super(a,f,m,g),this.roundZoom=!0,this.type="video",this.options=f}load(){return l._(this,void 0,void 0,function*(){this._loaded=!1;const a=this.options;this.urls=[];for(const f of a.urls)this.urls.push(this.map._requestManager.transformRequest(f,"Source").url);try{const f=yield l.a2(this.urls);if(this._loaded=!0,!f)return;this.video=f,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(f){this.fire(new l.j(f))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(a){if(this.video){const f=this.video.seekable;af.end(0)?this.fire(new l.j(new l.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${f.start(0)} and ${f.end(0)}-second mark.`))):this.video.currentTime=a}}getVideo(){return this.video}onAdd(a){this.map||(this.map=a,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const a=this.map.painter.context,f=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,St.members)),this.boundsSegments||(this.boundsSegments=l.$.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new K(a,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let m=!1;for(const g in this.tiles){const b=this.tiles[g];b.state!=="loaded"&&(b.state="loaded",b.texture=this.texture,m=!0)}m&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ls extends hn{constructor(a,f,m,g){super(a,f,m,g),f.coordinates?Array.isArray(f.coordinates)&&f.coordinates.length===4&&!f.coordinates.some(b=>!Array.isArray(b)||b.length!==2||b.some(T=>typeof T!="number"))||this.fire(new l.j(new l.a1(`sources.${a}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.j(new l.a1(`sources.${a}`,null,'missing required property "coordinates"'))),f.animate&&typeof f.animate!="boolean"&&this.fire(new l.j(new l.a1(`sources.${a}`,null,'optional "animate" property must be a boolean value'))),f.canvas?typeof f.canvas=="string"||f.canvas instanceof HTMLCanvasElement||this.fire(new l.j(new l.a1(`sources.${a}`,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.a1(`sources.${a}`,null,'missing required property "canvas"'))),this.options=f,this.animate=f.animate===void 0||f.animate}load(){return l._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new 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())})}getCanvas(){return this.canvas}onAdd(a){this.map=a,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let a=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,a=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,a=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const f=this.map.painter.context,m=f.gl;this.boundsBuffer||(this.boundsBuffer=f.createVertexBuffer(this._boundsArray,St.members)),this.boundsSegments||(this.boundsSegments=l.$.simpleSegment(0,0,4,2)),this.texture?(a||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new K(f,this.canvas,m.RGBA,{premultiply:!0});let g=!1;for(const b in this.tiles){const T=this.tiles[b];T.state!=="loaded"&&(T.state="loaded",T.texture=this.texture,g=!0)}g&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const a of[this.canvas.width,this.canvas.height])if(isNaN(a)||a<=0)return!0;return!1}}const Js={},al=v=>{switch(v){case"geojson":return Xe;case"image":return hn;case"raster":return me;case"raster-dem":return tn;case"vector":return Nt;case"video":return Ai;case"canvas":return Ls}return Js[v]},ji="RTLPluginLoaded";class jl extends l.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=rr()}_syncState(a){return this.status=a,this.dispatcher.broadcast("SRPS",{pluginStatus:a,pluginURL:this.url}).catch(f=>{throw this.status="error",f})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(a){return l._(this,arguments,void 0,function*(f,m=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=E.resolveURL(f),!this.url)throw new Error(`requested url ${f} is invalid`);if(this.status==="unavailable"){if(!m)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return l._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new l.k(ji))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ps=null;function lt(){return Ps||(Ps=new jl),Ps}class hs{constructor(a,f){this.timeAdded=0,this.fadeEndTime=0,this.tileID=a,this.uid=l.a3(),this.uses=0,this.tileSize=f,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(a){const f=a+this.timeAdded;fb.getLayer(z)).filter(Boolean);if(k.length!==0){L.layers=k,L.stateDependentLayerIds&&(L.stateDependentLayers=L.stateDependentLayerIds.map(z=>k.filter(j=>j.id===z)[0]));for(const z of k)T[z.id]=L}}return T}(a.buckets,f.style),this.hasSymbolBuckets=!1;for(const g in this.buckets){const b=this.buckets[g];if(b instanceof l.a5){if(this.hasSymbolBuckets=!0,!m)break;b.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const g in this.buckets){const b=this.buckets[g];if(b instanceof l.a5&&b.hasRTLText){this.hasRTLText=!0,lt().lazyLoad();break}}this.queryPadding=0;for(const g in this.buckets){const b=this.buckets[g];this.queryPadding=Math.max(this.queryPadding,f.style.getLayer(g).queryRadius(b))}a.imageAtlas&&(this.imageAtlas=a.imageAtlas),a.glyphAtlasImage&&(this.glyphAtlasImage=a.glyphAtlasImage)}else this.collisionBoxArray=new l.a4}unloadVectorData(){for(const a in this.buckets)this.buckets[a].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(a){return this.buckets[a.id]}upload(a){for(const m in this.buckets){const g=this.buckets[m];g.uploadPending()&&g.upload(a)}const f=a.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new K(a,this.imageAtlas.image,f.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new K(a,this.glyphAtlasImage,f.ALPHA),this.glyphAtlasImage=null)}prepare(a){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(a,this.imageAtlasTexture)}queryRenderedFeatures(a,f,m,g,b,T,L,k,z,j){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:g,cameraQueryGeometry:b,scale:T,tileSize:this.tileSize,pixelPosMatrix:j,transform:k,params:L,queryPadding:this.queryPadding*z},a,f,m):{}}querySourceFeatures(a,f){const m=this.latestFeatureIndex;if(!m||!m.rawTileData)return;const g=m.loadVTLayers(),b=f&&f.sourceLayer?f.sourceLayer:"",T=g._geojsonTileLayer||g[b];if(!T)return;const L=l.a6(f&&f.filter),{z:k,x:z,y:j}=this.tileID.canonical,q={z:k,x:z,y:j};for(let $=0;$m)g=!1;else if(f)if(this.expirationTime{this.remove(a,b)},m)),this.data[g].push(b),this.order.push(g),this.order.length>this.max){const T=this._getAndRemoveByKey(this.order[0]);T&&this.onRemove(T)}return this}has(a){return a.wrapped().key in this.data}getAndRemove(a){return this.has(a)?this._getAndRemoveByKey(a.wrapped().key):null}_getAndRemoveByKey(a){const f=this.data[a].shift();return f.timeout&&clearTimeout(f.timeout),this.data[a].length===0&&delete this.data[a],this.order.splice(this.order.indexOf(a),1),f.value}getByKey(a){const f=this.data[a];return f?f[0].value:null}get(a){return this.has(a)?this.data[a.wrapped().key][0].value:null}remove(a,f){if(!this.has(a))return this;const m=a.wrapped().key,g=f===void 0?0:this.data[m].indexOf(f),b=this.data[m][g];return this.data[m].splice(g,1),b.timeout&&clearTimeout(b.timeout),this.data[m].length===0&&delete this.data[m],this.onRemove(b.value),this.order.splice(this.order.indexOf(m),1),this}setMaxSize(a){for(this.max=a;this.order.length>this.max;){const f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}filter(a){const f=[];for(const m in this.data)for(const g of this.data[m])a(g.value)||f.push(g);for(const m of f)this.remove(m.value.tileID,m)}}class Gl{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(a,f,m){const g=String(f);if(this.stateChanges[a]=this.stateChanges[a]||{},this.stateChanges[a][g]=this.stateChanges[a][g]||{},l.e(this.stateChanges[a][g],m),this.deletedStates[a]===null){this.deletedStates[a]={};for(const b in this.state[a])b!==g&&(this.deletedStates[a][b]=null)}else if(this.deletedStates[a]&&this.deletedStates[a][g]===null){this.deletedStates[a][g]={};for(const b in this.state[a][g])m[b]||(this.deletedStates[a][g][b]=null)}else for(const b in m)this.deletedStates[a]&&this.deletedStates[a][g]&&this.deletedStates[a][g][b]===null&&delete this.deletedStates[a][g][b]}removeFeatureState(a,f,m){if(this.deletedStates[a]===null)return;const g=String(f);if(this.deletedStates[a]=this.deletedStates[a]||{},m&&f!==void 0)this.deletedStates[a][g]!==null&&(this.deletedStates[a][g]=this.deletedStates[a][g]||{},this.deletedStates[a][g][m]=null);else if(f!==void 0)if(this.stateChanges[a]&&this.stateChanges[a][g])for(m in this.deletedStates[a][g]={},this.stateChanges[a][g])this.deletedStates[a][g][m]=null;else this.deletedStates[a][g]=null;else this.deletedStates[a]=null}getState(a,f){const m=String(f),g=l.e({},(this.state[a]||{})[m],(this.stateChanges[a]||{})[m]);if(this.deletedStates[a]===null)return{};if(this.deletedStates[a]){const b=this.deletedStates[a][f];if(b===null)return{};for(const T in b)delete g[T]}return g}initializeTileState(a,f){a.setFeatureState(this.state,f)}coalesceChanges(a,f){const m={};for(const g in this.stateChanges){this.state[g]=this.state[g]||{};const b={};for(const T in this.stateChanges[g])this.state[g][T]||(this.state[g][T]={}),l.e(this.state[g][T],this.stateChanges[g][T]),b[T]=this.state[g][T];m[g]=b}for(const g in this.deletedStates){this.state[g]=this.state[g]||{};const b={};if(this.deletedStates[g]===null)for(const T in this.state[g])b[T]={},this.state[g][T]={};else for(const T in this.deletedStates[g]){if(this.deletedStates[g][T]===null)this.state[g][T]={};else for(const L of Object.keys(this.deletedStates[g][T]))delete this.state[g][T][L];b[T]=this.state[g][T]}m[g]=m[g]||{},l.e(m[g],b)}if(this.stateChanges={},this.deletedStates={},Object.keys(m).length!==0)for(const g in a)a[g].setFeatureState(m,f)}}class li extends l.E{constructor(a,f,m){super(),this.id=a,this.dispatcher=m,this.on("data",g=>this._dataHandler(g)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((g,b,T,L)=>{const k=new(al(b.type))(g,b,T,L);if(k.id!==g)throw new Error(`Expected Source id to be ${g} instead of ${k.id}`);return k})(a,f,m,this),this._tiles={},this._cache=new fo(0,g=>this._unloadTile(g)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Gl,this._didEmitContent=!1,this._updated=!1}onAdd(a){this.map=a,this._maxTileCacheSize=a?a._maxTileCacheSize:null,this._maxTileCacheZoomLevels=a?a._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(a)}onRemove(a){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(a)}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 a in this._tiles){const f=this._tiles[a];if(f.state!=="loaded"&&f.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const a=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,a&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(a,f,m){return l._(this,void 0,void 0,function*(){try{yield this._source.loadTile(a),this._tileLoaded(a,f,m)}catch(g){a.state="errored",g.status!==404?this._source.fire(new l.j(g,{tile:a})):this.update(this.transform,this.terrain)}})}_unloadTile(a){this._source.unloadTile&&this._source.unloadTile(a)}_abortTile(a){this._source.abortTile&&this._source.abortTile(a),this._source.fire(new l.k("dataabort",{tile:a,coord:a.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(a){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const f in this._tiles){const m=this._tiles[f];m.upload(a),m.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(a=>a.tileID).sort(pt).map(a=>a.key)}getRenderableIds(a){const f=[];for(const m in this._tiles)this._isIdRenderable(m,a)&&f.push(this._tiles[m]);return a?f.sort((m,g)=>{const b=m.tileID,T=g.tileID,L=new l.P(b.canonical.x,b.canonical.y)._rotate(this.transform.angle),k=new l.P(T.canonical.x,T.canonical.y)._rotate(this.transform.angle);return b.overscaledZ-T.overscaledZ||k.y-L.y||k.x-L.x}).map(m=>m.tileID.key):f.map(m=>m.tileID).sort(pt).map(m=>m.key)}hasRenderableParent(a){const f=this.findLoadedParent(a,0);return!!f&&this._isIdRenderable(f.tileID.key)}_isIdRenderable(a,f){return this._tiles[a]&&this._tiles[a].hasData()&&!this._coveredTiles[a]&&(f||!this._tiles[a].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const a in this._tiles)this._tiles[a].state!=="errored"&&this._reloadTile(a,"reloading")}}_reloadTile(a,f){return l._(this,void 0,void 0,function*(){const m=this._tiles[a];m&&(m.state!=="loading"&&(m.state=f),yield this._loadTile(m,a,f))})}_tileLoaded(a,f,m){a.timeAdded=E.now(),m==="expired"&&(a.refreshedUponExpiration=!0),this._setTileReloadTimer(f,a),this.getSource().type==="raster-dem"&&a.dem&&this._backfillDEM(a),this._state.initializeTileState(a,this.map?this.map.painter:null),a.aborted||this._source.fire(new l.k("data",{dataType:"source",tile:a,coord:a.tileID}))}_backfillDEM(a){const f=this.getRenderableIds();for(let g=0;g1||(Math.abs(T)>1&&(Math.abs(T+k)===1?T+=k:Math.abs(T-k)===1&&(T-=k)),b.dem&&g.dem&&(g.dem.backfillBorder(b.dem,T,L),g.neighboringTiles&&g.neighboringTiles[z]&&(g.neighboringTiles[z].backfilled=!0)))}}getTile(a){return this.getTileByID(a.key)}getTileByID(a){return this._tiles[a]}_retainLoadedChildren(a,f,m,g){for(const b in this._tiles){let T=this._tiles[b];if(g[b]||!T.hasData()||T.tileID.overscaledZ<=f||T.tileID.overscaledZ>m)continue;let L=T.tileID;for(;T&&T.tileID.overscaledZ>f+1;){const z=T.tileID.scaledTo(T.tileID.overscaledZ-1);T=this._tiles[z.key],T&&T.hasData()&&(L=z)}let k=L;for(;k.overscaledZ>f;)if(k=k.scaledTo(k.overscaledZ-1),a[k.key]){g[L.key]=L;break}}}findLoadedParent(a,f){if(a.key in this._loadedParentTiles){const m=this._loadedParentTiles[a.key];return m&&m.tileID.overscaledZ>=f?m:null}for(let m=a.overscaledZ-1;m>=f;m--){const g=a.scaledTo(m),b=this._getLoadedTile(g);if(b)return b}}_getLoadedTile(a){const f=this._tiles[a.key];return f&&f.hasData()?f:this._cache.getByKey(a.wrapped().key)}updateCacheSize(a){const f=Math.ceil(a.width/this._source.tileSize)+1,m=Math.ceil(a.height/this._source.tileSize)+1,g=Math.floor(f*m*(this._maxTileCacheZoomLevels===null?l.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),b=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,g):g;this._cache.setMaxSize(b)}handleWrapJump(a){const f=Math.round((a-(this._prevLng===void 0?a:this._prevLng))/360);if(this._prevLng=a,f){const m={};for(const g in this._tiles){const b=this._tiles[g];b.tileID=b.tileID.unwrapTo(b.tileID.wrap+f),m[b.tileID.key]=b}this._tiles=m;for(const g in this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(const g in this._tiles)this._setTileReloadTimer(g,this._tiles[g])}}update(a,f){if(!this._sourceLoaded||this._paused)return;let m;this.transform=a,this.terrain=f,this.updateCacheSize(a),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?m=a.getVisibleUnwrappedCoordinates(this._source.tileID).map(j=>new l.Q(j.canonical.z,j.wrap,j.canonical.z,j.canonical.x,j.canonical.y)):(m=a.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:f}),this._source.hasTile&&(m=m.filter(j=>this._source.hasTile(j)))):m=[];const g=a.coveringZoomLevel(this._source),b=Math.max(g-li.maxOverzooming,this._source.minzoom),T=Math.max(g+li.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const j={};for(const q of m)if(q.canonical.z>this._source.minzoom){const $=q.scaledTo(q.canonical.z-1);j[$.key]=$;const he=q.scaledTo(Math.max(this._source.minzoom,Math.min(q.canonical.z,5)));j[he.key]=he}m=m.concat(Object.values(j))}const L=m.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,L&&this.fire(new l.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const k=this._updateRetainedTiles(m,g);if(mn(this._source.type)){const j={},q={},$=Object.keys(k),he=E.now();for(const ce of $){const ye=k[ce],re=this._tiles[ce];if(!re||re.fadeEndTime!==0&&re.fadeEndTime<=he)continue;const Ie=this.findLoadedParent(ye,b);Ie&&(this._addTile(Ie.tileID),j[Ie.tileID.key]=Ie.tileID),q[ce]=ye}this._retainLoadedChildren(q,g,T,k);for(const ce in j)k[ce]||(this._coveredTiles[ce]=!0,k[ce]=j[ce]);if(f){const ce={},ye={};for(const re of m)this._tiles[re.key].hasData()?ce[re.key]=re:ye[re.key]=re;for(const re in ye){const Ie=ye[re].children(this._source.maxzoom);this._tiles[Ie[0].key]&&this._tiles[Ie[1].key]&&this._tiles[Ie[2].key]&&this._tiles[Ie[3].key]&&(ce[Ie[0].key]=k[Ie[0].key]=Ie[0],ce[Ie[1].key]=k[Ie[1].key]=Ie[1],ce[Ie[2].key]=k[Ie[2].key]=Ie[2],ce[Ie[3].key]=k[Ie[3].key]=Ie[3],delete ye[re])}for(const re in ye){const Ie=this.findLoadedParent(ye[re],this._source.minzoom);if(Ie){ce[Ie.tileID.key]=k[Ie.tileID.key]=Ie.tileID;for(const Ue in ce)ce[Ue].isChildOf(Ie.tileID)&&delete ce[Ue]}}for(const re in this._tiles)ce[re]||(this._coveredTiles[re]=!0)}}for(const j in k)this._tiles[j].clearFadeHold();const z=l.ab(this._tiles,k);for(const j of z){const q=this._tiles[j];q.hasSymbolBuckets&&!q.holdingForFade()?q.setHoldDuration(this.map._fadeDuration):q.hasSymbolBuckets&&!q.symbolFadeFinished()||this._removeTile(j)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const a in this._tiles)this._tiles[a].holdingForFade()&&this._removeTile(a)}_updateRetainedTiles(a,f){const m={},g={},b=Math.max(f-li.maxOverzooming,this._source.minzoom),T=Math.max(f+li.maxUnderzooming,this._source.minzoom),L={};for(const k of a){const z=this._addTile(k);m[k.key]=k,z.hasData()||fthis._source.maxzoom){const q=k.children(this._source.maxzoom)[0],$=this.getTile(q);if($&&$.hasData()){m[q.key]=q;continue}}else{const q=k.children(this._source.maxzoom);if(m[q[0].key]&&m[q[1].key]&&m[q[2].key]&&m[q[3].key])continue}let j=z.wasRequested();for(let q=k.overscaledZ-1;q>=b;--q){const $=k.scaledTo(q);if(g[$.key])break;if(g[$.key]=!0,z=this.getTile($),!z&&j&&(z=this._addTile($)),z){const he=z.hasData();if((j||he)&&(m[$.key]=$),j=z.wasRequested(),he)break}}}return m}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const a in this._tiles){const f=[];let m,g=this._tiles[a].tileID;for(;g.overscaledZ>0;){if(g.key in this._loadedParentTiles){m=this._loadedParentTiles[g.key];break}f.push(g.key);const b=g.scaledTo(g.overscaledZ-1);if(m=this._getLoadedTile(b),m)break;g=b}for(const b of f)this._loadedParentTiles[b]=m}}_addTile(a){let f=this._tiles[a.key];if(f)return f;f=this._cache.getAndRemove(a),f&&(this._setTileReloadTimer(a.key,f),f.tileID=a,this._state.initializeTileState(f,this.map?this.map.painter:null),this._cacheTimers[a.key]&&(clearTimeout(this._cacheTimers[a.key]),delete this._cacheTimers[a.key],this._setTileReloadTimer(a.key,f)));const m=f;return f||(f=new hs(a,this._source.tileSize*a.overscaleFactor()),this._loadTile(f,a.key,f.state)),f.uses++,this._tiles[a.key]=f,m||this._source.fire(new l.k("dataloading",{tile:f,coord:f.tileID,dataType:"source"})),f}_setTileReloadTimer(a,f){a in this._timers&&(clearTimeout(this._timers[a]),delete this._timers[a]);const m=f.getExpiryTimeout();m&&(this._timers[a]=setTimeout(()=>{this._reloadTile(a,"expired"),delete this._timers[a]},m))}_removeTile(a){const f=this._tiles[a];f&&(f.uses--,delete this._tiles[a],this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),f.uses>0||(f.hasData()&&f.state!=="reloading"?this._cache.add(f.tileID,f,f.getExpiryTimeout()):(f.aborted=!0,this._abortTile(f),this._unloadTile(f))))}_dataHandler(a){const f=a.sourceDataType;a.dataType==="source"&&f==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&a.dataType==="source"&&f==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const a in this._tiles)this._removeTile(a);this._cache.reset()}tilesIn(a,f,m){const g=[],b=this.transform;if(!b)return g;const T=m?b.getCameraQueryGeometry(a):a,L=a.map(ce=>b.pointCoordinate(ce,this.terrain)),k=T.map(ce=>b.pointCoordinate(ce,this.terrain)),z=this.getIds();let j=1/0,q=1/0,$=-1/0,he=-1/0;for(const ce of k)j=Math.min(j,ce.x),q=Math.min(q,ce.y),$=Math.max($,ce.x),he=Math.max(he,ce.y);for(let ce=0;ce=0&&xe[1].y+Ue>=0){const De=L.map(He=>re.getTilePoint(He)),qe=k.map(He=>re.getTilePoint(He));g.push({tile:ye,tileID:re,queryGeometry:De,cameraQueryGeometry:qe,scale:Ie})}}return g}getVisibleCoordinates(a){const f=this.getRenderableIds(a).map(m=>this._tiles[m].tileID);for(const m of f)m.posMatrix=this.transform.calculatePosMatrix(m.toUnwrapped());return f}hasTransition(){if(this._source.hasTransition())return!0;if(mn(this._source.type)){const a=E.now();for(const f in this._tiles)if(this._tiles[f].fadeEndTime>=a)return!0}return!1}setFeatureState(a,f,m){this._state.updateState(a=a||"_geojsonTileLayer",f,m)}removeFeatureState(a,f,m){this._state.removeFeatureState(a=a||"_geojsonTileLayer",f,m)}getFeatureState(a,f){return this._state.getState(a=a||"_geojsonTileLayer",f)}setDependencies(a,f,m){const g=this._tiles[a];g&&g.setDependencies(f,m)}reloadTilesForDependencies(a,f){for(const m in this._tiles)this._tiles[m].hasDependency(a,f)&&this._reloadTile(m,"reloading");this._cache.filter(m=>!m.hasDependency(a,f))}}function pt(v,a){const f=Math.abs(2*v.wrap)-+(v.wrap<0),m=Math.abs(2*a.wrap)-+(a.wrap<0);return v.overscaledZ-a.overscaledZ||m-f||a.canonical.y-v.canonical.y||a.canonical.x-v.canonical.x}function mn(v){return v==="raster"||v==="image"||v==="video"}li.maxOverzooming=10,li.maxUnderzooming=3;class pn{constructor(a,f){this.reset(a,f)}reset(a,f){this.points=a||[],this._distances=[0];for(let m=1;m0?(g-T)/L:0;return this.points[b].mult(1-k).add(this.points[f].mult(k))}}function Zr(v,a){let f=!0;return v==="always"||v!=="never"&&a!=="never"||(f=!1),f}class fs{constructor(a,f,m){const g=this.boxCells=[],b=this.circleCells=[];this.xCellCount=Math.ceil(a/m),this.yCellCount=Math.ceil(f/m);for(let T=0;Tthis.width||g<0||f>this.height)return[];const k=[];if(a<=0&&f<=0&&this.width<=m&&this.height<=g){if(b)return[{key:null,x1:a,y1:f,x2:m,y2:g}];for(let z=0;z0}hitTestCircle(a,f,m,g,b){const T=a-m,L=a+m,k=f-m,z=f+m;if(L<0||T>this.width||z<0||k>this.height)return!1;const j=[];return this._forEachCell(T,k,L,z,this._queryCellCircle,j,{hitTest:!0,overlapMode:g,circle:{x:a,y:f,radius:m},seenUids:{box:{},circle:{}}},b),j.length>0}_queryCell(a,f,m,g,b,T,L,k){const{seenUids:z,hitTest:j,overlapMode:q}=L,$=this.boxCells[b];if($!==null){const ce=this.bboxes;for(const ye of $)if(!z.box[ye]){z.box[ye]=!0;const re=4*ye,Ie=this.boxKeys[ye];if(a<=ce[re+2]&&f<=ce[re+3]&&m>=ce[re+0]&&g>=ce[re+1]&&(!k||k(Ie))&&(!j||!Zr(q,Ie.overlapMode))&&(T.push({key:Ie,x1:ce[re],y1:ce[re+1],x2:ce[re+2],y2:ce[re+3]}),j))return!0}}const he=this.circleCells[b];if(he!==null){const ce=this.circles;for(const ye of he)if(!z.circle[ye]){z.circle[ye]=!0;const re=3*ye,Ie=this.circleKeys[ye];if(this._circleAndRectCollide(ce[re],ce[re+1],ce[re+2],a,f,m,g)&&(!k||k(Ie))&&(!j||!Zr(q,Ie.overlapMode))){const Ue=ce[re],xe=ce[re+1],De=ce[re+2];if(T.push({key:Ie,x1:Ue-De,y1:xe-De,x2:Ue+De,y2:xe+De}),j)return!0}}}return!1}_queryCellCircle(a,f,m,g,b,T,L,k){const{circle:z,seenUids:j,overlapMode:q}=L,$=this.boxCells[b];if($!==null){const ce=this.bboxes;for(const ye of $)if(!j.box[ye]){j.box[ye]=!0;const re=4*ye,Ie=this.boxKeys[ye];if(this._circleAndRectCollide(z.x,z.y,z.radius,ce[re+0],ce[re+1],ce[re+2],ce[re+3])&&(!k||k(Ie))&&!Zr(q,Ie.overlapMode))return T.push(!0),!0}}const he=this.circleCells[b];if(he!==null){const ce=this.circles;for(const ye of he)if(!j.circle[ye]){j.circle[ye]=!0;const re=3*ye,Ie=this.circleKeys[ye];if(this._circlesCollide(ce[re],ce[re+1],ce[re+2],z.x,z.y,z.radius)&&(!k||k(Ie))&&!Zr(q,Ie.overlapMode))return T.push(!0),!0}}}_forEachCell(a,f,m,g,b,T,L,k){const z=this._convertToXCellCoord(a),j=this._convertToYCellCoord(f),q=this._convertToXCellCoord(m),$=this._convertToYCellCoord(g);for(let he=z;he<=q;he++)for(let ce=j;ce<=$;ce++)if(b.call(this,a,f,m,g,this.xCellCount*ce+he,T,L,k))return}_convertToXCellCoord(a){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(a*this.xScale)))}_convertToYCellCoord(a){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(a*this.yScale)))}_circlesCollide(a,f,m,g,b,T){const L=g-a,k=b-f,z=m+T;return z*z>L*L+k*k}_circleAndRectCollide(a,f,m,g,b,T,L){const k=(T-g)/2,z=Math.abs(a-(g+k));if(z>k+m)return!1;const j=(L-b)/2,q=Math.abs(f-(b+j));if(q>j+m)return!1;if(z<=k||q<=j)return!0;const $=z-k,he=q-j;return $*$+he*he<=m*m}}function fn(v,a,f,m,g){const b=l.F();return a?(l.J(b,b,[1/g,1/g,1]),f||l.ad(b,b,m.angle)):l.K(b,m.labelPlaneMatrix,v),b}function za(v,a,f,m,g){if(a){const b=l.ae(v);return l.J(b,b,[g,g,1]),f||l.ad(b,b,-m.angle),b}return m.glCoordMatrix}function Jr(v,a,f){let m;f?(m=[v.x,v.y,f(v.x,v.y),1],l.af(m,m,a)):(m=[v.x,v.y,0,1],Bt(m,m,a));const g=m[3];return{point:new l.P(m[0]/g,m[1]/g),signedDistanceFromCamera:g}}function _e(v,a){return .5+v/a*.5}function W(v,a){const f=v[0]/v[3],m=v[1]/v[3];return f>=-a[0]&&f<=a[0]&&m>=-a[1]&&m<=a[1]}function X(v,a,f,m,g,b,T,L,k,z){const j=m?v.textSizeData:v.iconSizeData,q=l.ag(j,f.transform.zoom),$=[256/f.width*2+1,256/f.height*2+1],he=m?v.text.dynamicLayoutVertexArray:v.icon.dynamicLayoutVertexArray;he.clear();const ce=v.lineVertexArray,ye=m?v.text.placedSymbolArray:v.icon.placedSymbolArray,re=f.transform.width/f.transform.height;let Ie=!1;for(let Ue=0;UeMath.abs(f.x-a.x)*m?{useVertical:!0}:(v===l.ah.vertical?a.yf.x)?{needsFlipping:!0}:null}function Pe(v,a,f,m,g,b,T,L,k,z,j,q,$,he,ce,ye){const re=a/24,Ie=v.lineOffsetX*re,Ue=v.lineOffsetY*re;let xe;if(v.numGlyphs>1){const De=v.glyphStartIndex+v.numGlyphs,qe=v.lineStartIndex,He=v.lineStartIndex+v.lineLength,$e=Q(re,L,Ie,Ue,f,j,q,v,k,b,$,ce,ye);if(!$e)return{notEnoughRoom:!0};const it=Jr($e.first.point,T,ye).point,tt=Jr($e.last.point,T,ye).point;if(m&&!f){const ct=le(v.writingMode,it,tt,he);if(ct)return ct}xe=[$e.first];for(let ct=v.glyphStartIndex+1;ct0?it.point:ee(q,$e,qe,1,g,ye),ct=le(v.writingMode,qe,tt,he);if(ct)return ct}const De=We(re*L.getoffsetX(v.glyphStartIndex),Ie,Ue,f,j,q,v.segment,v.lineStartIndex,v.lineStartIndex+v.lineLength,k,b,$,ce,ye);if(!De)return{notEnoughRoom:!0};xe=[De]}for(const De of xe)l.aj(z,De.point,De.angle);return{}}function ee(v,a,f,m,g,b){const T=Jr(v.add(v.sub(a)._unit()),g,b).point,L=f.sub(T);return f.add(L._mult(m/L.mag()))}function Me(v,a){const{projectionCache:f,lineVertexArray:m,labelPlaneMatrix:g,tileAnchorPoint:b,distanceFromAnchor:T,getElevation:L,previousVertex:k,direction:z,absOffsetX:j}=a;if(f.projections[v])return f.projections[v];const q=new l.P(m.getx(v),m.gety(v)),$=Jr(q,g,L);if($.signedDistanceFromCamera>0)return f.projections[v]=$.point,$.point;const he=v-z;return ee(T===0?b:new l.P(m.getx(he),m.gety(he)),q,k,j-T+1,g,L)}function Se(v,a,f){return v._unit()._perp()._mult(a*f)}function Re(v,a,f,m,g,b,T,L){const{projectionCache:k,direction:z}=L;if(k.offsets[v])return k.offsets[v];const j=f.add(a);if(v+z=g)return k.offsets[v]=j,j;const q=Me(v+z,L),$=Se(q.sub(f),T,z),he=f.add($),ce=q.add($);return k.offsets[v]=l.ak(b,j,he,ce)||j,k.offsets[v]}function We(v,a,f,m,g,b,T,L,k,z,j,q,$,he){const ce=m?v-a:v+a;let ye=ce>0?1:-1,re=0;m&&(ye*=-1,re=Math.PI),ye<0&&(re+=Math.PI);let Ie,Ue,xe=ye>0?L+T:L+T+1,De=g,qe=g,He=0,$e=0;const it=Math.abs(ce),tt=[];let ct;for(;He+$e<=it;){if(xe+=ye,xe=k)return null;He+=$e,qe=De,Ue=Ie;const _t={projectionCache:q,lineVertexArray:z,labelPlaneMatrix:j,tileAnchorPoint:b,distanceFromAnchor:He,getElevation:he,previousVertex:qe,direction:ye,absOffsetX:it};if(De=Me(xe,_t),f===0)tt.push(qe),ct=De.sub(qe);else{let en;const _n=De.sub(qe);en=_n.mag()===0?Se(Me(xe+ye,_t).sub(De),f,ye):Se(_n,f,ye),Ue||(Ue=qe.add(en)),Ie=Re(xe,en,De,L,k,Ue,f,_t),tt.push(Ue),ct=Ie.sub(Ue)}$e=ct.mag()}const dt=ct._mult((it-He)/$e)._add(Ue||qe),gn=re+Math.atan2(De.y-qe.y,De.x-qe.x);return tt.push(dt),{point:dt,angle:$?gn:0,path:tt}}const Ye=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Je(v,a){for(let f=0;f=1;bn--)_n.push(_t.path[bn]);for(let bn=1;bnJr(Cn,k,ce));_n=bn.some(Cn=>Cn.signedDistanceFromCamera<=0)?[]:bn.map(Cn=>Cn.point)}let on=[];if(_n.length>0){const bn=_n[0].clone(),Cn=_n[0].clone();for(let Br=1;Br<_n.length;Br++)bn.x=Math.min(bn.x,_n[Br].x),bn.y=Math.min(bn.y,_n[Br].y),Cn.x=Math.max(Cn.x,_n[Br].x),Cn.y=Math.max(Cn.y,_n[Br].y);on=bn.x>=ct.x&&Cn.x<=dt.x&&bn.y>=ct.y&&Cn.y<=dt.y?[_n]:Cn.xdt.x||Cn.ydt.y?[]:l.al([_n],ct.x,ct.y,dt.x,dt.y)}for(const bn of on){gn.reset(bn,.25*tt);let Cn=0;Cn=gn.length<=.5*tt?1:Math.ceil(gn.paddedLength/Fn)+1;for(let Br=0;Br=this.screenRightBoundary||gthis.screenBottomBoundary}isInsideGrid(a,f,m,g){return m>=0&&a=0&&fm.collisionGroupID===f}}return this.collisionGroups[a]}}function _i(v,a,f,m,g){const{horizontalAlign:b,verticalAlign:T}=l.at(v);return new l.P(-(b-.5)*a+m[0]*g,-(T-.5)*f+m[1]*g)}function po(v,a,f,m,g,b){const{x1:T,x2:L,y1:k,y2:z,anchorPointX:j,anchorPointY:q}=v,$=new l.P(a,f);return m&&$._rotate(g?b:-b),{x1:T+$.x,y1:k+$.y,x2:L+$.x,y2:z+$.y,anchorPointX:j,anchorPointY:q}}class To{constructor(a,f,m,g,b){this.transform=a.clone(),this.terrain=f,this.collisionIndex=new sn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new Or(g),this.collisionCircleArrays={},this.prevPlacement=b,b&&(b.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(a,f,m,g){const b=m.getBucket(f),T=m.latestFeatureIndex;if(!b||!T||f.id!==b.layerIds[0])return;const L=m.collisionBoxArray,k=b.layers[0].layout,z=Math.pow(2,this.transform.zoom-m.tileID.overscaledZ),j=m.tileSize/l.W,q=this.transform.calculatePosMatrix(m.tileID.toUnwrapped()),$=k.get("text-pitch-alignment")==="map",he=k.get("text-rotation-alignment")==="map",ce=un(m,1,this.transform.zoom),ye=fn(q,$,he,this.transform,ce);let re=null;if($){const Ue=za(q,$,he,this.transform,ce);re=l.K([],this.transform.labelPlaneMatrix,Ue)}this.retainedQueryData[b.bucketInstanceId]=new vn(b.bucketInstanceId,T,b.sourceLayerIndex,b.index,m.tileID);const Ie={bucket:b,layout:k,posMatrix:q,textLabelPlaneMatrix:ye,labelToScreenMatrix:re,scale:z,textPixelRatio:j,holdingForFade:m.holdingForFade(),collisionBoxArray:L,partiallyEvaluatedTextSize:l.ag(b.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(b.sourceID)};if(g)for(const Ue of b.sortKeyRanges){const{sortKey:xe,symbolInstanceStart:De,symbolInstanceEnd:qe}=Ue;a.push({sortKey:xe,symbolInstanceStart:De,symbolInstanceEnd:qe,parameters:Ie})}else a.push({symbolInstanceStart:0,symbolInstanceEnd:b.symbolInstances.length,parameters:Ie})}attemptAnchorPlacement(a,f,m,g,b,T,L,k,z,j,q,$,he,ce,ye,re){const Ie=l.ap[a.textAnchor],Ue=[a.textOffset0,a.textOffset1],xe=_i(Ie,m,g,Ue,b),De=this.collisionIndex.placeCollisionBox(po(f,xe.x,xe.y,T,L,this.transform.angle),q,k,z,j.predicate,re);if((!ye||this.collisionIndex.placeCollisionBox(po(ye,xe.x,xe.y,T,L,this.transform.angle),q,k,z,j.predicate,re).box.length!==0)&&De.box.length>0){let qe;if(this.prevPlacement&&this.prevPlacement.variableOffsets[$.crossTileID]&&this.prevPlacement.placements[$.crossTileID]&&this.prevPlacement.placements[$.crossTileID].text&&(qe=this.prevPlacement.variableOffsets[$.crossTileID].anchor),$.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[$.crossTileID]={textOffset:Ue,width:m,height:g,anchor:Ie,textBoxScale:b,prevAnchor:qe},this.markUsedJustification(he,Ie,$,ce),he.allowVerticalPlacement&&(this.markUsedOrientation(he,ce,$),this.placedOrientations[$.crossTileID]=ce),{shift:xe,placedGlyphBoxes:De}}}placeLayerBucketPart(a,f,m){const{bucket:g,layout:b,posMatrix:T,textLabelPlaneMatrix:L,labelToScreenMatrix:k,textPixelRatio:z,holdingForFade:j,collisionBoxArray:q,partiallyEvaluatedTextSize:$,collisionGroup:he}=a.parameters,ce=b.get("text-optional"),ye=b.get("icon-optional"),re=l.aq(b,"text-overlap","text-allow-overlap"),Ie=re==="always",Ue=l.aq(b,"icon-overlap","icon-allow-overlap"),xe=Ue==="always",De=b.get("text-rotation-alignment")==="map",qe=b.get("text-pitch-alignment")==="map",He=b.get("icon-text-fit")!=="none",$e=b.get("symbol-z-order")==="viewport-y",it=Ie&&(xe||!g.hasIconData()||ye),tt=xe&&(Ie||!g.hasTextData()||ce);!g.collisionArrays&&q&&g.deserializeCollisionBoxes(q);const ct=this.retainedQueryData[g.bucketInstanceId].tileID,dt=this.terrain?(_t,en)=>this.terrain.getElevation(ct,_t,en):null,gn=(_t,en)=>{var _n,Fn;if(f[_t.crossTileID])return;if(j)return void(this.placements[_t.crossTileID]=new Sr(!1,!1,!1));let on=!1,bn=!1,Cn=!0,Br=null,tr={box:null,offscreen:null},Xo={box:null,offscreen:null},yi=null,Mr=null,vi=null,Yo=0,ia=0,dl=0;en.textFeatureIndex?Yo=en.textFeatureIndex:_t.useRuntimeCollisionCircles&&(Yo=_t.featureIndex),en.verticalTextFeatureIndex&&(ia=en.verticalTextFeatureIndex);const jc=en.textBox;if(jc){const hi=fi=>{let Ar=l.ah.horizontal;if(g.allowVerticalPlacement&&!fi&&this.prevPlacement){const gs=this.prevPlacement.placedOrientations[_t.crossTileID];gs&&(this.placedOrientations[_t.crossTileID]=gs,Ar=gs,this.markUsedOrientation(g,Ar,_t))}return Ar},kr=(fi,Ar)=>{if(g.allowVerticalPlacement&&_t.numVerticalGlyphVertices>0&&en.verticalTextBox){for(const gs of g.writingModes)if(gs===l.ah.vertical?(tr=Ar(),Xo=tr):tr=fi(),tr&&tr.box&&tr.box.length)break}else tr=fi()},Ir=_t.textAnchorOffsetStartIndex,ms=_t.textAnchorOffsetEndIndex;if(ms===Ir){const fi=(Ar,gs)=>{const pi=this.collisionIndex.placeCollisionBox(Ar,re,z,T,he.predicate,dt);return pi&&pi.box&&pi.box.length&&(this.markUsedOrientation(g,gs,_t),this.placedOrientations[_t.crossTileID]=gs),pi};kr(()=>fi(jc,l.ah.horizontal),()=>{const Ar=en.verticalTextBox;return g.allowVerticalPlacement&&_t.numVerticalGlyphVertices>0&&Ar?fi(Ar,l.ah.vertical):{box:null,offscreen:null}}),hi(tr&&tr.box&&tr.box.length)}else{let fi=l.ap[(Fn=(_n=this.prevPlacement)===null||_n===void 0?void 0:_n.variableOffsets[_t.crossTileID])===null||Fn===void 0?void 0:Fn.anchor];const Ar=(pi,Xr,td)=>{const gg=pi.x2-pi.x1,Jl=pi.y2-pi.y1,Ql=_t.textBoxScale,of=He&&Ue==="never"?Xr:null;let gl={box:[],offscreen:!1},nd=re==="never"?1:2,_g="never";fi&&nd++;for(let rd=0;rdAr(jc,en.iconBox,l.ah.horizontal),()=>{const pi=en.verticalTextBox;return g.allowVerticalPlacement&&!(tr&&tr.box&&tr.box.length)&&_t.numVerticalGlyphVertices>0&&pi?Ar(pi,en.verticalIconBox,l.ah.vertical):{box:null,offscreen:null}}),tr&&(on=tr.box,Cn=tr.offscreen);const gs=hi(tr&&tr.box);if(!on&&this.prevPlacement){const pi=this.prevPlacement.variableOffsets[_t.crossTileID];pi&&(this.variableOffsets[_t.crossTileID]=pi,this.markUsedJustification(g,pi.anchor,_t,gs))}}}if(yi=tr,on=yi&&yi.box&&yi.box.length>0,Cn=yi&&yi.offscreen,_t.useRuntimeCollisionCircles){const hi=g.text.placedSymbolArray.get(_t.centerJustifiedTextSymbolIndex),kr=l.ai(g.textSizeData,$,hi),Ir=b.get("text-padding");Mr=this.collisionIndex.placeCollisionCircles(re,hi,g.lineVertexArray,g.glyphOffsetArray,kr,T,L,k,m,qe,he.predicate,_t.collisionCircleDiameter,Ir,dt),Mr.circles.length&&Mr.collisionDetected&&!m&&l.w("Collisions detected, but collision boxes are not shown"),on=Ie||Mr.circles.length>0&&!Mr.collisionDetected,Cn=Cn&&Mr.offscreen}if(en.iconFeatureIndex&&(dl=en.iconFeatureIndex),en.iconBox){const hi=kr=>{const Ir=He&&Br?po(kr,Br.x,Br.y,De,qe,this.transform.angle):kr;return this.collisionIndex.placeCollisionBox(Ir,Ue,z,T,he.predicate,dt)};Xo&&Xo.box&&Xo.box.length&&en.verticalIconBox?(vi=hi(en.verticalIconBox),bn=vi.box.length>0):(vi=hi(en.iconBox),bn=vi.box.length>0),Cn=Cn&&vi.offscreen}const ml=ce||_t.numHorizontalGlyphVertices===0&&_t.numVerticalGlyphVertices===0,oa=ye||_t.numIconVertices===0;if(ml||oa?oa?ml||(bn=bn&&on):on=bn&&on:bn=on=bn&&on,on&&yi&&yi.box&&this.collisionIndex.insertCollisionBox(yi.box,re,b.get("text-ignore-placement"),g.bucketInstanceId,Xo&&Xo.box&&ia?ia:Yo,he.ID),bn&&vi&&this.collisionIndex.insertCollisionBox(vi.box,Ue,b.get("icon-ignore-placement"),g.bucketInstanceId,dl,he.ID),Mr&&(on&&this.collisionIndex.insertCollisionCircles(Mr.circles,re,b.get("text-ignore-placement"),g.bucketInstanceId,Yo,he.ID),m)){const hi=g.bucketInstanceId;let kr=this.collisionCircleArrays[hi];kr===void 0&&(kr=this.collisionCircleArrays[hi]=new ui);for(let Ir=0;Ir=0;--en){const _n=_t[en];gn(g.symbolInstances.get(_n),g.collisionArrays[_n])}}else for(let _t=a.symbolInstanceStart;_t=0&&(a.text.placedSymbolArray.get(L).crossTileID=b>=0&&L!==b?0:m.crossTileID)}markUsedOrientation(a,f,m){const g=f===l.ah.horizontal||f===l.ah.horizontalOnly?f:0,b=f===l.ah.vertical?f:0,T=[m.leftJustifiedTextSymbolIndex,m.centerJustifiedTextSymbolIndex,m.rightJustifiedTextSymbolIndex];for(const L of T)a.text.placedSymbolArray.get(L).placedOrientation=g;m.verticalPlacedTextSymbolIndex&&(a.text.placedSymbolArray.get(m.verticalPlacedTextSymbolIndex).placedOrientation=b)}commit(a){this.commitTime=a,this.zoomAtLastRecencyCheck=this.transform.zoom;const f=this.prevPlacement;let m=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;const g=f?f.symbolFadeChange(a):1,b=f?f.opacities:{},T=f?f.variableOffsets:{},L=f?f.placedOrientations:{};for(const k in this.placements){const z=this.placements[k],j=b[k];j?(this.opacities[k]=new ir(j,g,z.text,z.icon),m=m||z.text!==j.text.placed||z.icon!==j.icon.placed):(this.opacities[k]=new ir(null,g,z.text,z.icon,z.skipFade),m=m||z.text||z.icon)}for(const k in b){const z=b[k];if(!this.opacities[k]){const j=new ir(z,g,!1,!1);j.isHidden()||(this.opacities[k]=j,m=m||z.text.placed||z.icon.placed)}}for(const k in T)this.variableOffsets[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.variableOffsets[k]=T[k]);for(const k in L)this.placedOrientations[k]||!this.opacities[k]||this.opacities[k].isHidden()||(this.placedOrientations[k]=L[k]);if(f&&f.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");m?this.lastPlacementChangeTime=a:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:a)}updateLayerOpacities(a,f){const m={};for(const g of f){const b=g.getBucket(a);b&&g.latestFeatureIndex&&a.id===b.layerIds[0]&&this.updateBucketOpacities(b,m,g.collisionBoxArray)}}updateBucketOpacities(a,f,m){a.hasTextData()&&(a.text.opacityVertexArray.clear(),a.text.hasVisibleVertices=!1),a.hasIconData()&&(a.icon.opacityVertexArray.clear(),a.icon.hasVisibleVertices=!1),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexArray.clear(),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexArray.clear();const g=a.layers[0],b=g.layout,T=new ir(null,0,!1,!1,!0),L=b.get("text-allow-overlap"),k=b.get("icon-allow-overlap"),z=g._unevaluatedLayout.hasValue("text-variable-anchor")||g._unevaluatedLayout.hasValue("text-variable-anchor-offset"),j=b.get("text-rotation-alignment")==="map",q=b.get("text-pitch-alignment")==="map",$=b.get("icon-text-fit")!=="none",he=new ir(null,0,L&&(k||!a.hasIconData()||b.get("icon-optional")),k&&(L||!a.hasTextData()||b.get("text-optional")),!0);!a.collisionArrays&&m&&(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData())&&a.deserializeCollisionBoxes(m);const ce=(ye,re,Ie)=>{for(let Ue=0;Ue0,He=this.placedOrientations[re.crossTileID],$e=He===l.ah.vertical,it=He===l.ah.horizontal||He===l.ah.horizontalOnly;if(Ie>0||Ue>0){const tt=Lo(De.text);ce(a.text,Ie,$e?bc:tt),ce(a.text,Ue,it?bc:tt);const ct=De.text.isHidden();[re.rightJustifiedTextSymbolIndex,re.centerJustifiedTextSymbolIndex,re.leftJustifiedTextSymbolIndex].forEach(_t=>{_t>=0&&(a.text.placedSymbolArray.get(_t).hidden=ct||$e?1:0)}),re.verticalPlacedTextSymbolIndex>=0&&(a.text.placedSymbolArray.get(re.verticalPlacedTextSymbolIndex).hidden=ct||it?1:0);const dt=this.variableOffsets[re.crossTileID];dt&&this.markUsedJustification(a,dt.anchor,re,He);const gn=this.placedOrientations[re.crossTileID];gn&&(this.markUsedJustification(a,"left",re,gn),this.markUsedOrientation(a,gn,re))}if(qe){const tt=Lo(De.icon),ct=!($&&re.verticalPlacedIconSymbolIndex&&$e);re.placedIconSymbolIndex>=0&&(ce(a.icon,re.numIconVertices,ct?tt:bc),a.icon.placedSymbolArray.get(re.placedIconSymbolIndex).hidden=De.icon.isHidden()),re.verticalPlacedIconSymbolIndex>=0&&(ce(a.icon,re.numVerticalIconVertices,ct?bc:tt),a.icon.placedSymbolArray.get(re.verticalPlacedIconSymbolIndex).hidden=De.icon.isHidden())}if(a.hasIconCollisionBoxData()||a.hasTextCollisionBoxData()){const tt=a.collisionArrays[ye];if(tt){let ct=new l.P(0,0);if(tt.textBox||tt.verticalTextBox){let gn=!0;if(z){const _t=this.variableOffsets[xe];_t?(ct=_i(_t.anchor,_t.width,_t.height,_t.textOffset,_t.textBoxScale),j&&ct._rotate(q?this.transform.angle:-this.transform.angle)):gn=!1}tt.textBox&&Di(a.textCollisionBox.collisionVertexArray,De.text.placed,!gn||$e,ct.x,ct.y),tt.verticalTextBox&&Di(a.textCollisionBox.collisionVertexArray,De.text.placed,!gn||it,ct.x,ct.y)}const dt=!!(!it&&tt.verticalIconBox);tt.iconBox&&Di(a.iconCollisionBox.collisionVertexArray,De.icon.placed,dt,$?ct.x:0,$?ct.y:0),tt.verticalIconBox&&Di(a.iconCollisionBox.collisionVertexArray,De.icon.placed,!dt,$?ct.x:0,$?ct.y:0)}}}if(a.sortFeatures(this.transform.angle),this.retainedQueryData[a.bucketInstanceId]&&(this.retainedQueryData[a.bucketInstanceId].featureSortOrder=a.featureSortOrder),a.hasTextData()&&a.text.opacityVertexBuffer&&a.text.opacityVertexBuffer.updateData(a.text.opacityVertexArray),a.hasIconData()&&a.icon.opacityVertexBuffer&&a.icon.opacityVertexBuffer.updateData(a.icon.opacityVertexArray),a.hasIconCollisionBoxData()&&a.iconCollisionBox.collisionVertexBuffer&&a.iconCollisionBox.collisionVertexBuffer.updateData(a.iconCollisionBox.collisionVertexArray),a.hasTextCollisionBoxData()&&a.textCollisionBox.collisionVertexBuffer&&a.textCollisionBox.collisionVertexBuffer.updateData(a.textCollisionBox.collisionVertexArray),a.text.opacityVertexArray.length!==a.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${a.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${a.text.layoutVertexArray.length}) / 4`);if(a.icon.opacityVertexArray.length!==a.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${a.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${a.icon.layoutVertexArray.length}) / 4`);if(a.bucketInstanceId in this.collisionCircleArrays){const ye=this.collisionCircleArrays[a.bucketInstanceId];a.placementInvProjMatrix=ye.invProjMatrix,a.placementViewportMatrix=ye.viewportMatrix,a.collisionCircleArray=ye.circles,delete this.collisionCircleArrays[a.bucketInstanceId]}}symbolFadeChange(a){return this.fadeDuration===0?1:(a-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(a){return Math.max(0,(this.transform.zoom-a)/1.5)}hasTransitions(a){return this.stale||a-this.lastPlacementChangeTimea}setStale(){this.stale=!0}}function Di(v,a,f,m,g){v.emplaceBack(a?1:0,f?1:0,m||0,g||0),v.emplaceBack(a?1:0,f?1:0,m||0,g||0),v.emplaceBack(a?1:0,f?1:0,m||0,g||0),v.emplaceBack(a?1:0,f?1:0,m||0,g||0)}const Qs=Math.pow(2,25),Dm=Math.pow(2,24),Cy=Math.pow(2,17),Qn=Math.pow(2,16),Sp=Math.pow(2,9),Ep=Math.pow(2,8),Wo=Math.pow(2,1);function Lo(v){if(v.opacity===0&&!v.placed)return 0;if(v.opacity===1&&v.placed)return 4294967295;const a=v.placed?1:0,f=Math.floor(127*v.opacity);return f*Qs+a*Dm+f*Cy+a*Qn+f*Sp+a*Ep+f*Wo+a}const bc=0;class ps{constructor(a){this._sortAcrossTiles=a.layout.get("symbol-z-order")!=="viewport-y"&&!a.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(a,f,m,g,b){const T=this._bucketParts;for(;this._currentTileIndexL.sortKey-k.sortKey));this._currentPartIndex!this._forceFullPlacement&&E.now()-g>2;for(;this._currentPlacementIndex>=0;){const T=f[a[this._currentPlacementIndex]],L=this.placement.collisionIndex.transform.zoom;if(T.type==="symbol"&&(!T.minzoom||T.minzoom<=L)&&(!T.maxzoom||T.maxzoom>L)){if(this._inProgressLayer||(this._inProgressLayer=new ps(T)),this._inProgressLayer.continuePlacement(m[T.source],this.placement,this._showCollisionBoxes,T,b))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(a){return this.placement.commit(a),this.placement}}const Cu=512/l.W/2;class vh{constructor(a,f,m){this.tileID=a,this.bucketInstanceId=m,this._symbolsByKey={};const g=new Map;for(let b=0;b({x:Math.floor(k.anchorX*Cu),y:Math.floor(k.anchorY*Cu)})),crossTileIDs:T.map(k=>k.crossTileID)};if(L.positions.length>128){const k=new l.au(L.positions.length,16,Uint16Array);for(const{x:z,y:j}of L.positions)k.add(z,j);k.finish(),delete L.positions,L.index=k}this._symbolsByKey[b]=L}}getScaledCoordinates(a,f){const{x:m,y:g,z:b}=this.tileID.canonical,{x:T,y:L,z:k}=f.canonical,z=Cu/Math.pow(2,k-b),j=(L*l.W+a.anchorY)*z,q=g*l.W*Cu;return{x:Math.floor((T*l.W+a.anchorX)*z-m*l.W*Cu),y:Math.floor(j-q)}}findMatches(a,f,m){const g=this.tileID.canonical.za)}}class ci{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class xc{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(a){const f=Math.round((a-this.lng)/360);if(f!==0)for(const m in this.indexes){const g=this.indexes[m],b={};for(const T in g){const L=g[T];L.tileID=L.tileID.unwrapTo(L.tileID.wrap+f),b[L.tileID.key]=L}this.indexes[m]=b}this.lng=a}addBucket(a,f,m){if(this.indexes[a.overscaledZ]&&this.indexes[a.overscaledZ][a.key]){if(this.indexes[a.overscaledZ][a.key].bucketInstanceId===f.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(a.overscaledZ,this.indexes[a.overscaledZ][a.key])}for(let b=0;ba.overscaledZ)for(const L in T){const k=T[L];k.tileID.isChildOf(a)&&k.findMatches(f.symbolInstances,a,g)}else{const L=T[a.scaledTo(Number(b)).key];L&&L.findMatches(f.symbolInstances,a,g)}}for(let b=0;b{f[m]=!0});for(const m in this.layerIndexes)f[m]||delete this.layerIndexes[m]}}const Pr=(v,a)=>l.t(v,a&&a.filter(f=>f.identifier!=="source.canvas")),bh=l.av();class Ho extends l.E{constructor(a,f={}){super(),this._rtlPluginLoaded=()=>{for(const m in this.sourceCaches){const g=this.sourceCaches[m].getSource().type;g!=="vector"&&g!=="geojson"||this.sourceCaches[m].reload()}},this.map=a,this.dispatcher=new In(En(),a._getMapId()),this.dispatcher.registerMessageHandler("GG",(m,g)=>this.getGlyphs(m,g)),this.dispatcher.registerMessageHandler("GI",(m,g)=>this.getImages(m,g)),this.imageManager=new Ge,this.imageManager.setEventedParent(this),this.glyphManager=new At(a._requestManager,f.localIdeographFontFamily),this.lineAtlas=new Rt(256,512),this.crossTileSymbolIndex=new ll,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",l.ax()),lt().on(ji,this._rtlPluginLoaded),this.on("data",m=>{if(m.dataType!=="source"||m.sourceDataType!=="metadata")return;const g=this.sourceCaches[m.sourceId];if(!g)return;const b=g.getSource();if(b&&b.vectorLayerIds)for(const T in this._layers){const L=this._layers[T];L.source===b.id&&this._validateLayer(L)}})}loadURL(a,f={},m){this.fire(new l.k("dataloading",{dataType:"style"})),f.validate=typeof f.validate!="boolean"||f.validate;const g=this.map._requestManager.transformRequest(a,"Style");this._loadStyleRequest=new AbortController,l.h(g,this._loadStyleRequest).then(b=>{this._loadStyleRequest=null,this._load(b.data,f,m)}).catch(b=>{this._loadStyleRequest=null,b&&this.fire(new l.j(b))})}loadJSON(a,f={},m){this.fire(new l.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,E.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,f.validate=f.validate!==!1,this._load(a,f,m)}).catch(()=>{})}loadEmpty(){this.fire(new l.k("dataloading",{dataType:"style"})),this._load(bh,{validate:!1})}_load(a,f,m){var g;const b=f.transformStyle?f.transformStyle(m,a):a;if(!f.validate||!Pr(this,l.x(b))){this._loaded=!0,this.stylesheet=b;for(const T in b.sources)this.addSource(T,b.sources[T],{validate:!1});b.sprite?this._loadSprite(b.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(b.glyphs),this._createLayers(),this.light=new bt(this.stylesheet.light),this.map.setTerrain((g=this.stylesheet.terrain)!==null&&g!==void 0?g:null),this.fire(new l.k("data",{dataType:"style"})),this.fire(new l.k("style.load"))}}_createLayers(){const a=l.ay(this.stylesheet.layers);this.dispatcher.broadcast("SL",a),this._order=a.map(f=>f.id),this._layers={},this._serializedLayers=null;for(const f of a){const m=l.az(f);m.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=m}}_loadSprite(a,f=!1,m=void 0){let g;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(b,T,L,k){return l._(this,void 0,void 0,function*(){const z=ke(b),j=L>1?"@2x":"",q={},$={};for(const{id:he,url:ce}of z){const ye=T.transformRequest(T.normalizeSpriteURL(ce,j,".json"),"SpriteJSON");q[he]=l.h(ye,k);const re=T.transformRequest(T.normalizeSpriteURL(ce,j,".png"),"SpriteImage");$[he]=G.getImage(re,k)}return yield Promise.all([...Object.values(q),...Object.values($)]),function(he,ce){return l._(this,void 0,void 0,function*(){const ye={};for(const re in he){ye[re]={};const Ie=E.getImageCanvasContext((yield ce[re]).data),Ue=(yield he[re]).data;for(const xe in Ue){const{width:De,height:qe,x:He,y:$e,sdf:it,pixelRatio:tt,stretchX:ct,stretchY:dt,content:gn}=Ue[xe];ye[re][xe]={data:null,pixelRatio:tt,sdf:it,stretchX:ct,stretchY:dt,content:gn,spriteData:{width:De,height:qe,x:He,y:$e,context:Ie}}}}return ye})}(q,$)})}(a,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(b=>{if(this._spriteRequest=null,b)for(const T in b){this._spritesImagesIds[T]=[];const L=this._spritesImagesIds[T]?this._spritesImagesIds[T].filter(k=>!(k in b)):[];for(const k of L)this.imageManager.removeImage(k),this._changedImages[k]=!0;for(const k in b[T]){const z=T==="default"?k:`${T}:${k}`;this._spritesImagesIds[T].push(z),z in this.imageManager.images?this.imageManager.updateImage(z,b[T][k],!1):this.imageManager.addImage(z,b[T][k]),f&&(this._changedImages[z]=!0)}}}).catch(b=>{this._spriteRequest=null,g=b,this.fire(new l.j(g))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),f&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new l.k("data",{dataType:"style"})),m&&m(g)})}_unloadSprite(){for(const a of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(a),this._changedImages[a]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}_validateLayer(a){const f=this.sourceCaches[a.source];if(!f)return;const m=a.sourceLayer;if(!m)return;const g=f.getSource();(g.type==="geojson"||g.vectorLayerIds&&g.vectorLayerIds.indexOf(m)===-1)&&this.fire(new l.j(new Error(`Source layer "${m}" does not exist on source "${g.id}" as specified by style layer "${a.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const a in this.sourceCaches)if(!this.sourceCaches[a].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(a){const f=this._serializedAllLayers();if(!a||a.length===0)return Object.values(f);const m=[];for(const g of a)f[g]&&m.push(f[g]);return m}_serializedAllLayers(){let a=this._serializedLayers;if(a)return a;a=this._serializedLayers={};const f=Object.keys(this._layers);for(const m of f){const g=this._layers[m];g.type!=="custom"&&(a[m]=g.serialize())}return a}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const a in this.sourceCaches)if(this.sourceCaches[a].hasTransition())return!0;for(const a in this._layers)if(this._layers[a].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(a){if(!this._loaded)return;const f=this._changed;if(f){const g=Object.keys(this._updatedLayers),b=Object.keys(this._removedLayers);(g.length||b.length)&&this._updateWorkerLayers(g,b);for(const T in this._updatedSources){const L=this._updatedSources[T];if(L==="reload")this._reloadSource(T);else{if(L!=="clear")throw new Error(`Invalid action ${L}`);this._clearSource(T)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const T in this._updatedPaintProps)this._layers[T].updateTransitions(a);this.light.updateTransitions(a),this._resetUpdates()}const m={};for(const g in this.sourceCaches){const b=this.sourceCaches[g];m[g]=b.used,b.used=!1}for(const g of this._order){const b=this._layers[g];b.recalculate(a,this._availableImages),!b.isHidden(a.zoom)&&b.source&&(this.sourceCaches[b.source].used=!0)}for(const g in m){const b=this.sourceCaches[g];!!m[g]!=!!b.used&&b.fire(new l.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:g}))}this.light.recalculate(a),this.z=a.zoom,f&&this.fire(new l.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const a=Object.keys(this._changedImages);if(a.length){for(const f in this.sourceCaches)this.sourceCaches[f].reloadTilesForDependencies(["icons","patterns"],a);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(a,f){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(a),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(a,f={}){var m;this._checkLoaded();const g=this.serialize();if(a=f.transformStyle?f.transformStyle(g,a):a,((m=f.validate)===null||m===void 0||m)&&Pr(this,l.x(a)))return!1;(a=l.aA(a)).layers=l.ay(a.layers);const b=l.aB(g,a),T=this._getOperationsToPerform(b);if(T.unimplemented.length>0)throw new Error(`Unimplemented: ${T.unimplemented.join(", ")}.`);if(T.operations.length===0)return!1;for(const L of T.operations)L();return this.stylesheet=a,this._serializedLayers=null,!0}_getOperationsToPerform(a){const f=[],m=[];for(const g of a)switch(g.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":f.push(()=>this.addLayer.apply(this,g.args));break;case"removeLayer":f.push(()=>this.removeLayer.apply(this,g.args));break;case"setPaintProperty":f.push(()=>this.setPaintProperty.apply(this,g.args));break;case"setLayoutProperty":f.push(()=>this.setLayoutProperty.apply(this,g.args));break;case"setFilter":f.push(()=>this.setFilter.apply(this,g.args));break;case"addSource":f.push(()=>this.addSource.apply(this,g.args));break;case"removeSource":f.push(()=>this.removeSource.apply(this,g.args));break;case"setLayerZoomRange":f.push(()=>this.setLayerZoomRange.apply(this,g.args));break;case"setLight":f.push(()=>this.setLight.apply(this,g.args));break;case"setGeoJSONSourceData":f.push(()=>this.setGeoJSONSourceData.apply(this,g.args));break;case"setGlyphs":f.push(()=>this.setGlyphs.apply(this,g.args));break;case"setSprite":f.push(()=>this.setSprite.apply(this,g.args));break;case"setTerrain":f.push(()=>this.map.setTerrain.apply(this,g.args));break;case"setTransition":f.push(()=>{});break;default:m.push(g.command)}return{operations:f,unimplemented:m}}addImage(a,f){if(this.getImage(a))return this.fire(new l.j(new Error(`An image named "${a}" already exists.`)));this.imageManager.addImage(a,f),this._afterImageUpdated(a)}updateImage(a,f){this.imageManager.updateImage(a,f)}getImage(a){return this.imageManager.getImage(a)}removeImage(a){if(!this.getImage(a))return this.fire(new l.j(new Error(`An image named "${a}" does not exist.`)));this.imageManager.removeImage(a),this._afterImageUpdated(a)}_afterImageUpdated(a){this._availableImages=this.imageManager.listImages(),this._changedImages[a]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(a,f,m={}){if(this._checkLoaded(),this.sourceCaches[a]!==void 0)throw new Error(`Source "${a}" already exists.`);if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(f.type)>=0&&this._validate(l.x.source,`sources.${a}`,f,null,m))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);const g=this.sourceCaches[a]=new li(a,f,this.dispatcher);g.style=this,g.setEventedParent(this,()=>({isSourceLoaded:g.loaded(),source:g.serialize(),sourceId:a})),g.onAdd(this.map),this._changed=!0}removeSource(a){if(this._checkLoaded(),this.sourceCaches[a]===void 0)throw new Error("There is no source with this ID");for(const m in this._layers)if(this._layers[m].source===a)return this.fire(new l.j(new Error(`Source "${a}" cannot be removed while layer "${m}" is using it.`)));const f=this.sourceCaches[a];delete this.sourceCaches[a],delete this._updatedSources[a],f.fire(new l.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:a})),f.setEventedParent(null),f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(a,f){if(this._checkLoaded(),this.sourceCaches[a]===void 0)throw new Error(`There is no source with this ID=${a}`);const m=this.sourceCaches[a].getSource();if(m.type!=="geojson")throw new Error(`geojsonSource.type is ${m.type}, which is !== 'geojson`);m.setData(f),this._changed=!0}getSource(a){return this.sourceCaches[a]&&this.sourceCaches[a].getSource()}addLayer(a,f,m={}){this._checkLoaded();const g=a.id;if(this.getLayer(g))return void this.fire(new l.j(new Error(`Layer "${g}" already exists on this map.`)));let b;if(a.type==="custom"){if(Pr(this,l.aC(a)))return;b=l.az(a)}else{if("source"in a&&typeof a.source=="object"&&(this.addSource(g,a.source),a=l.aA(a),a=l.e(a,{source:g})),this._validate(l.x.layer,`layers.${g}`,a,{arrayIndex:-1},m))return;b=l.az(a),this._validateLayer(b),b.setEventedParent(this,{layer:{id:g}})}const T=f?this._order.indexOf(f):this._order.length;if(f&&T===-1)this.fire(new l.j(new Error(`Cannot add layer "${g}" before non-existing layer "${f}".`)));else{if(this._order.splice(T,0,g),this._layerOrderChanged=!0,this._layers[g]=b,this._removedLayers[g]&&b.source&&b.type!=="custom"){const L=this._removedLayers[g];delete this._removedLayers[g],L.type!==b.type?this._updatedSources[b.source]="clear":(this._updatedSources[b.source]="reload",this.sourceCaches[b.source].pause())}this._updateLayer(b),b.onAdd&&b.onAdd(this.map)}}moveLayer(a,f){if(this._checkLoaded(),this._changed=!0,!this._layers[a])return void this.fire(new l.j(new Error(`The layer '${a}' does not exist in the map's style and cannot be moved.`)));if(a===f)return;const m=this._order.indexOf(a);this._order.splice(m,1);const g=f?this._order.indexOf(f):this._order.length;f&&g===-1?this.fire(new l.j(new Error(`Cannot move layer "${a}" before non-existing layer "${f}".`))):(this._order.splice(g,0,a),this._layerOrderChanged=!0)}removeLayer(a){this._checkLoaded();const f=this._layers[a];if(!f)return void this.fire(new l.j(new Error(`Cannot remove non-existing layer "${a}".`)));f.setEventedParent(null);const m=this._order.indexOf(a);this._order.splice(m,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[a]=f,delete this._layers[a],this._serializedLayers&&delete this._serializedLayers[a],delete this._updatedLayers[a],delete this._updatedPaintProps[a],f.onRemove&&f.onRemove(this.map)}getLayer(a){return this._layers[a]}getLayersOrder(){return[...this._order]}hasLayer(a){return a in this._layers}setLayerZoomRange(a,f,m){this._checkLoaded();const g=this.getLayer(a);g?g.minzoom===f&&g.maxzoom===m||(f!=null&&(g.minzoom=f),m!=null&&(g.maxzoom=m),this._updateLayer(g)):this.fire(new l.j(new Error(`Cannot set the zoom range of non-existing layer "${a}".`)))}setFilter(a,f,m={}){this._checkLoaded();const g=this.getLayer(a);if(g){if(!l.aD(g.filter,f))return f==null?(g.filter=void 0,void this._updateLayer(g)):void(this._validate(l.x.filter,`layers.${g.id}.filter`,f,null,m)||(g.filter=l.aA(f),this._updateLayer(g)))}else this.fire(new l.j(new Error(`Cannot filter non-existing layer "${a}".`)))}getFilter(a){return l.aA(this.getLayer(a).filter)}setLayoutProperty(a,f,m,g={}){this._checkLoaded();const b=this.getLayer(a);b?l.aD(b.getLayoutProperty(f),m)||(b.setLayoutProperty(f,m,g),this._updateLayer(b)):this.fire(new l.j(new Error(`Cannot style non-existing layer "${a}".`)))}getLayoutProperty(a,f){const m=this.getLayer(a);if(m)return m.getLayoutProperty(f);this.fire(new l.j(new Error(`Cannot get style of non-existing layer "${a}".`)))}setPaintProperty(a,f,m,g={}){this._checkLoaded();const b=this.getLayer(a);b?l.aD(b.getPaintProperty(f),m)||(b.setPaintProperty(f,m,g)&&this._updateLayer(b),this._changed=!0,this._updatedPaintProps[a]=!0,this._serializedLayers=null):this.fire(new l.j(new Error(`Cannot style non-existing layer "${a}".`)))}getPaintProperty(a,f){return this.getLayer(a).getPaintProperty(f)}setFeatureState(a,f){this._checkLoaded();const m=a.source,g=a.sourceLayer,b=this.sourceCaches[m];if(b===void 0)return void this.fire(new l.j(new Error(`The source '${m}' does not exist in the map's style.`)));const T=b.getSource().type;T==="geojson"&&g?this.fire(new l.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):T!=="vector"||g?(a.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),b.setFeatureState(g,a.id,f)):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(a,f){this._checkLoaded();const m=a.source,g=this.sourceCaches[m];if(g===void 0)return void this.fire(new l.j(new Error(`The source '${m}' does not exist in the map's style.`)));const b=g.getSource().type,T=b==="vector"?a.sourceLayer:void 0;b!=="vector"||T?f&&typeof a.id!="string"&&typeof a.id!="number"?this.fire(new l.j(new Error("A feature id is required to remove its specific state property."))):g.removeFeatureState(T,a.id,f):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(a){this._checkLoaded();const f=a.source,m=a.sourceLayer,g=this.sourceCaches[f];if(g!==void 0)return g.getSource().type!=="vector"||m?(a.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),g.getFeatureState(m,a.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 '${f}' 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 a=l.aE(this.sourceCaches,b=>b.serialize()),f=this._serializeByIds(this._order),m=this.map.getTerrain()||void 0,g=this.stylesheet;return l.aF({version:g.version,name:g.name,metadata:g.metadata,light:g.light,center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch,sprite:g.sprite,glyphs:g.glyphs,transition:g.transition,sources:a,layers:f,terrain:m},b=>b!==void 0)}_updateLayer(a){this._updatedLayers[a.id]=!0,a.source&&!this._updatedSources[a.source]&&this.sourceCaches[a.source].getSource().type!=="raster"&&(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(a){const f=T=>this._layers[T].type==="fill-extrusion",m={},g=[];for(let T=this._order.length-1;T>=0;T--){const L=this._order[T];if(f(L)){m[L]=T;for(const k of a){const z=k[L];if(z)for(const j of z)g.push(j)}}}g.sort((T,L)=>L.intersectionZ-T.intersectionZ);const b=[];for(let T=this._order.length-1;T>=0;T--){const L=this._order[T];if(f(L))for(let k=g.length-1;k>=0;k--){const z=g[k].feature;if(m[z.layer.id]{const it=Ie.featureSortOrder;if(it){const tt=it.indexOf(He.featureIndex);return it.indexOf($e.featureIndex)-tt}return $e.featureIndex-He.featureIndex});for(const He of qe)De.push(He)}}for(const Ie in ce)ce[Ie].forEach(Ue=>{const xe=Ue.feature,De=z[L[Ie].source].getFeatureState(xe.layer["source-layer"],xe.id);xe.source=xe.layer.source,xe.layer["source-layer"]&&(xe.sourceLayer=xe.layer["source-layer"]),xe.state=De});return ce}(this._layers,T,this.sourceCaches,a,f,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(b)}querySourceFeatures(a,f){f&&f.filter&&this._validate(l.x.filter,"querySourceFeatures.filter",f.filter,null,f);const m=this.sourceCaches[a];return m?function(g,b){const T=g.getRenderableIds().map(z=>g.getTileByID(z)),L=[],k={};for(let z=0;z$.getTileByID(he)).sort((he,ce)=>ce.tileID.overscaledZ-he.tileID.overscaledZ||(he.tileID.isLessThan(ce.tileID)?-1:1))}const q=this.crossTileSymbolIndex.addLayer(j,k[j.source],a.center.lng);T=T||q}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((b=b||this._layerOrderChanged||m===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(E.now(),a.zoom))&&(this.pauseablePlacement=new ds(a,this.map.terrain,this._order,b,f,m,g,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,k),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(E.now()),L=!0),T&&this.pauseablePlacement.placement.setStale()),L||T)for(const z of this._order){const j=this._layers[z];j.type==="symbol"&&this.placement.updateLayerOpacities(j,k[j.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(E.now())}_releaseSymbolFadeTiles(){for(const a in this.sourceCaches)this.sourceCaches[a].releaseSymbolFadeTiles()}getImages(a,f){return l._(this,void 0,void 0,function*(){const m=yield this.imageManager.getImages(f.icons);this._updateTilesForChangedImages();const g=this.sourceCaches[f.source];return g&&g.setDependencies(f.tileID.key,f.type,f.icons),m})}getGlyphs(a,f){return l._(this,void 0,void 0,function*(){const m=yield this.glyphManager.getGlyphs(f.stacks),g=this.sourceCaches[f.source];return g&&g.setDependencies(f.tileID.key,f.type,[""]),m})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(a,f={}){this._checkLoaded(),a&&this._validate(l.x.glyphs,"glyphs",a,null,f)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=a,this.glyphManager.entries={},this.glyphManager.setURL(a))}addSprite(a,f,m={},g){this._checkLoaded();const b=[{id:a,url:f}],T=[...ke(this.stylesheet.sprite),...b];this._validate(l.x.sprite,"sprite",T,null,m)||(this.stylesheet.sprite=T,this._loadSprite(b,!0,g))}removeSprite(a){this._checkLoaded();const f=ke(this.stylesheet.sprite);if(f.find(m=>m.id===a)){if(this._spritesImagesIds[a])for(const m of this._spritesImagesIds[a])this.imageManager.removeImage(m),this._changedImages[m]=!0;f.splice(f.findIndex(m=>m.id===a),1),this.stylesheet.sprite=f.length>0?f:void 0,delete this._spritesImagesIds[a],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}else this.fire(new l.j(new Error(`Sprite "${a}" doesn't exists on this map.`)))}getSprite(){return ke(this.stylesheet.sprite)}setSprite(a,f={},m){this._checkLoaded(),a&&this._validate(l.x.sprite,"sprite",a,null,f)||(this.stylesheet.sprite=a,a?this._loadSprite(a,!0,m):(this._unloadSprite(),m&&m(null)))}}var xh=l.X([{name:"a_pos",type:"Int16",components:2}]),ea="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 wc={prelude:er(`#ifdef GL_ES -precision mediump float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -`,`#ifdef GL_ES -precision highp float; -#else -#if !defined(lowp) -#define lowp -#endif -#if !defined(mediump) -#define mediump -#endif -#if !defined(highp) -#define highp -#endif -#endif -vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 -);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} -#ifdef TERRAIN3D -uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; -#endif -const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { -#ifdef TERRAIN3D -highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); -#else -return 1.0; -#endif -}float calculate_visibility(vec4 pos) { -#ifdef TERRAIN3D -vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; -#else -return 1.0; -#endif -}float ele(vec2 pos) { -#ifdef TERRAIN3D -vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; -#else -return 0.0; -#endif -}float get_elevation(vec2 pos) { -#ifdef TERRAIN3D -vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; -#else -return 0.0; -#endif -}`),background:er(`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:er(`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:er(`varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define mediump float radius -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define highp vec4 stroke_color -#pragma mapbox: define mediump float stroke_width -#pragma mapbox: define lowp float stroke_opacity -void main(void) { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize mediump float radius -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize highp vec4 stroke_color -#pragma mapbox: initialize mediump float stroke_width -#pragma mapbox: initialize lowp float stroke_opacity -vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:er("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:er(`uniform highp float u_intensity;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#define GAUSS_COEF 0.3989422804014327 -void main() { -#pragma mapbox: initialize highp float weight -float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; -#pragma mapbox: define highp float weight -#pragma mapbox: define mediump float radius -const highp float ZERO=1.0/255.0/16.0; -#define GAUSS_COEF 0.3989422804014327 -void main(void) { -#pragma mapbox: initialize highp float weight -#pragma mapbox: initialize mediump float radius -vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:er(`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:er("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:er("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:er("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:er(`#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_FragColor=color*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:er(`varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; -#pragma mapbox: define highp vec4 outline_color -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 outline_color -#pragma mapbox: initialize lowp float opacity -gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:er(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:er(`#ifdef GL_ES -precision highp float; -#endif -uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:er(`varying vec4 v_color;void main() {gl_FragColor=v_color; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec4 v_color; -#pragma mapbox: define highp float base -#pragma mapbox: define highp float height -#pragma mapbox: define highp vec4 color -void main() { -#pragma mapbox: initialize highp float base -#pragma mapbox: initialize highp float height -#pragma mapbox: initialize highp vec4 color -vec3 normal=a_normal_ed.xyz; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:er(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; -#ifdef TERRAIN3D -attribute vec2 a_centroid; -#endif -varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; -#pragma mapbox: define lowp float base -#pragma mapbox: define lowp float height -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float base -#pragma mapbox: initialize lowp float height -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; -#ifdef TERRAIN3D -float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); -#else -float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; -#endif -base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 -? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:er(`#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:er(`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:er(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),lineGradient:er(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_width2=vec2(outset,inset);}`),linePattern:er(`#ifdef GL_ES -precision highp float; -#endif -uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -#pragma mapbox: define lowp vec4 pattern_from -#pragma mapbox: define lowp vec4 pattern_to -#pragma mapbox: define lowp float pixel_ratio_from -#pragma mapbox: define lowp float pixel_ratio_to -void main() { -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -#pragma mapbox: initialize mediump vec4 pattern_from -#pragma mapbox: initialize mediump vec4 pattern_to -#pragma mapbox: initialize lowp float pixel_ratio_from -#pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:er(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,` -#define scale 0.015873016 -#define LINE_DISTANCE_SCALE 2.0 -attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; -#pragma mapbox: define highp vec4 color -#pragma mapbox: define lowp float blur -#pragma mapbox: define lowp float opacity -#pragma mapbox: define mediump float gapwidth -#pragma mapbox: define lowp float offset -#pragma mapbox: define mediump float width -#pragma mapbox: define lowp float floorwidth -void main() { -#pragma mapbox: initialize highp vec4 color -#pragma mapbox: initialize lowp float blur -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize mediump float gapwidth -#pragma mapbox: initialize lowp float offset -#pragma mapbox: initialize mediump float width -#pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; -#ifdef TERRAIN3D -v_gamma_scale=1.0; -#else -float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; -#endif -v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:er(`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:er(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; -#pragma mapbox: define lowp float opacity -void main() { -#pragma mapbox: initialize lowp float opacity -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:er(`#define SDF_PX 8.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:er(`#define SDF_PX 8.0 -#define SDF 1.0 -#define ICON 0.0 -uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); -#ifdef OVERDRAW_INSPECTOR -gl_FragColor=vec4(1.0); -#endif -}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; -#pragma mapbox: define highp vec4 fill_color -#pragma mapbox: define highp vec4 halo_color -#pragma mapbox: define lowp float opacity -#pragma mapbox: define lowp float halo_width -#pragma mapbox: define lowp float halo_blur -void main() { -#pragma mapbox: initialize highp vec4 fill_color -#pragma mapbox: initialize highp vec4 halo_color -#pragma mapbox: initialize lowp float opacity -#pragma mapbox: initialize lowp float halo_width -#pragma mapbox: initialize lowp float halo_blur -vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? -camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:er("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",ea),terrainDepth:er("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);}",ea),terrainCoords:er("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);}",ea)};function er(v,a){const f=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,m=a.match(/attribute ([\w]+) ([\w]+)/g),g=v.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),b=a.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),T=b?b.concat(g):g,L={};return{fragmentSource:v=v.replace(f,(k,z,j,q,$)=>(L[$]=!0,z==="define"?` -#ifndef HAS_UNIFORM_u_${$} -varying ${j} ${q} ${$}; -#else -uniform ${j} ${q} u_${$}; -#endif -`:` -#ifdef HAS_UNIFORM_u_${$} - ${j} ${q} ${$} = u_${$}; -#endif -`)),vertexSource:a=a.replace(f,(k,z,j,q,$)=>{const he=q==="float"?"vec2":"vec4",ce=$.match(/color/)?"color":he;return L[$]?z==="define"?` -#ifndef HAS_UNIFORM_u_${$} -uniform lowp float u_${$}_t; -attribute ${j} ${he} a_${$}; -varying ${j} ${q} ${$}; -#else -uniform ${j} ${q} u_${$}; -#endif -`:ce==="vec4"?` -#ifndef HAS_UNIFORM_u_${$} - ${$} = a_${$}; -#else - ${j} ${q} ${$} = u_${$}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${$} - ${$} = unpack_mix_${ce}(a_${$}, u_${$}_t); -#else - ${j} ${q} ${$} = u_${$}; -#endif -`:z==="define"?` -#ifndef HAS_UNIFORM_u_${$} -uniform lowp float u_${$}_t; -attribute ${j} ${he} a_${$}; -#else -uniform ${j} ${q} u_${$}; -#endif -`:ce==="vec4"?` -#ifndef HAS_UNIFORM_u_${$} - ${j} ${q} ${$} = a_${$}; -#else - ${j} ${q} ${$} = u_${$}; -#endif -`:` -#ifndef HAS_UNIFORM_u_${$} - ${j} ${q} ${$} = unpack_mix_${ce}(a_${$}, u_${$}_t); -#else - ${j} ${q} ${$} = u_${$}; -#endif -`}),staticAttributes:m,staticUniforms:T}}class wh{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(a,f,m,g,b,T,L,k,z){this.context=a;let j=this.boundPaintVertexBuffers.length!==g.length;for(let q=0;!j&&q({u_depth:new l.aG(He,$e.u_depth),u_terrain:new l.aG(He,$e.u_terrain),u_terrain_dim:new l.aH(He,$e.u_terrain_dim),u_terrain_matrix:new l.aI(He,$e.u_terrain_matrix),u_terrain_unpack:new l.aJ(He,$e.u_terrain_unpack),u_terrain_exaggeration:new l.aH(He,$e.u_terrain_exaggeration)}))(a,qe),this.binderUniforms=m?m.getUniforms(a,qe):[]}draw(a,f,m,g,b,T,L,k,z,j,q,$,he,ce,ye,re,Ie,Ue){const xe=a.gl;if(this.failedToCreate)return;if(a.program.set(this.program),a.setDepthMode(m),a.setStencilMode(g),a.setColorMode(b),a.setCullFace(T),k){a.activeTexture.set(xe.TEXTURE2),xe.bindTexture(xe.TEXTURE_2D,k.depthTexture),a.activeTexture.set(xe.TEXTURE3),xe.bindTexture(xe.TEXTURE_2D,k.texture);for(const qe in this.terrainUniforms)this.terrainUniforms[qe].set(k[qe])}for(const qe in this.fixedUniforms)this.fixedUniforms[qe].set(L[qe]);ye&&ye.setUniforms(a,this.binderUniforms,he,{zoom:ce});let De=0;switch(f){case xe.LINES:De=2;break;case xe.TRIANGLES:De=3;break;case xe.LINE_STRIP:De=1}for(const qe of $.get()){const He=qe.vaos||(qe.vaos={});(He[z]||(He[z]=new wh)).bind(a,this,j,ye?ye.getPaintVertexBuffers():[],q,qe.vertexOffset,re,Ie,Ue),xe.drawElements(f,qe.primitiveLength*De,xe.UNSIGNED_SHORT,qe.primitiveOffset*De*2)}}}function Sh(v,a,f){const m=1/un(f,1,a.transform.tileZoom),g=Math.pow(2,f.tileID.overscaledZ),b=f.tileSize*Math.pow(2,a.transform.tileZoom)/g,T=b*(f.tileID.canonical.x+f.tileID.wrap*g),L=b*f.tileID.canonical.y;return{u_image:0,u_texsize:f.imageAtlasTexture.size,u_scale:[m,v.fromScale,v.toScale],u_fade:v.t,u_pixel_coord_upper:[T>>16,L>>16],u_pixel_coord_lower:[65535&T,65535&L]}}const Sc=(v,a,f,m)=>{const g=a.style.light,b=g.properties.get("position"),T=[b.x,b.y,b.z],L=function(){var z=new l.A(9);return l.A!=Float32Array&&(z[1]=0,z[2]=0,z[3]=0,z[5]=0,z[6]=0,z[7]=0),z[0]=1,z[4]=1,z[8]=1,z}();g.properties.get("anchor")==="viewport"&&function(z,j){var q=Math.sin(j),$=Math.cos(j);z[0]=$,z[1]=q,z[2]=0,z[3]=-q,z[4]=$,z[5]=0,z[6]=0,z[7]=0,z[8]=1}(L,-a.transform.angle),function(z,j,q){var $=j[0],he=j[1],ce=j[2];z[0]=$*q[0]+he*q[3]+ce*q[6],z[1]=$*q[1]+he*q[4]+ce*q[7],z[2]=$*q[2]+he*q[5]+ce*q[8]}(T,T,L);const k=g.properties.get("color");return{u_matrix:v,u_lightpos:T,u_lightintensity:g.properties.get("intensity"),u_lightcolor:[k.r,k.g,k.b],u_vertical_gradient:+f,u_opacity:m}},Ty=(v,a,f,m,g,b,T)=>l.e(Sc(v,a,f,m),Sh(b,a,T),{u_height_factor:-Math.pow(2,g.overscaledZ)/T.tileSize/8}),Rm=v=>({u_matrix:v}),Eh=(v,a,f,m)=>l.e(Rm(v),Sh(f,a,m)),Ly=(v,a)=>({u_matrix:v,u_world:a}),Nm=(v,a,f,m,g)=>l.e(Eh(v,a,f,m),{u_world:g}),Py=(v,a,f,m)=>{const g=v.transform;let b,T;if(m.paint.get("circle-pitch-alignment")==="map"){const L=un(f,1,g.zoom);b=!0,T=[L,L]}else b=!1,T=g.pixelsToGLUnits;return{u_camera_to_center_distance:g.cameraToCenterDistance,u_scale_with_map:+(m.paint.get("circle-pitch-scale")==="map"),u_matrix:v.translatePosMatrix(a.posMatrix,f,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_pitch_with_map:+b,u_device_pixel_ratio:v.pixelRatio,u_extrude_scale:T}},Om=(v,a,f)=>{const m=un(f,1,a.zoom),g=Math.pow(2,a.zoom-f.tileID.overscaledZ),b=f.tileID.overscaleFactor();return{u_matrix:v,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:m,u_extrude_scale:[a.pixelsToGLUnits[0]/(m*g),a.pixelsToGLUnits[1]/(m*g)],u_overscale_factor:b}},zm=(v,a,f=1)=>({u_matrix:v,u_color:a,u_overlay:0,u_overlay_scale:f}),Ih=v=>({u_matrix:v}),Fm=(v,a,f,m)=>({u_matrix:v,u_extrude_scale:un(a,1,f),u_intensity:m});function Bm(v,a){const f=Math.pow(2,a.canonical.z),m=a.canonical.y;return[new l.Y(0,m/f).toLngLat().lat,new l.Y(0,(m+1)/f).toLngLat().lat]}const Ch=(v,a,f,m)=>{const g=v.transform;return{u_matrix:Ec(v,a,f,m),u_ratio:1/un(a,1,g.zoom),u_device_pixel_ratio:v.pixelRatio,u_units_to_pixels:[1/g.pixelsToGLUnits[0],1/g.pixelsToGLUnits[1]]}},Vm=(v,a,f,m,g)=>l.e(Ch(v,a,f,g),{u_image:0,u_image_height:m}),ql=(v,a,f,m,g)=>{const b=v.transform,T=Zo(a,b);return{u_matrix:Ec(v,a,f,g),u_texsize:a.imageAtlasTexture.size,u_ratio:1/un(a,1,b.zoom),u_device_pixel_ratio:v.pixelRatio,u_image:0,u_scale:[T,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},Th=(v,a,f,m,g,b)=>{const T=v.lineAtlas,L=Zo(a,v.transform),k=f.layout.get("line-cap")==="round",z=T.getDash(m.from,k),j=T.getDash(m.to,k),q=z.width*g.fromScale,$=j.width*g.toScale;return l.e(Ch(v,a,f,b),{u_patternscale_a:[L/q,-z.height/2],u_patternscale_b:[L/$,-j.height/2],u_sdfgamma:T.width/(256*Math.min(q,$)*v.pixelRatio)/2,u_image:0,u_tex_y_a:z.y,u_tex_y_b:j.y,u_mix:g.t})};function Zo(v,a){return 1/un(v,1,a.tileZoom)}function Ec(v,a,f,m){return v.translatePosMatrix(m?m.posMatrix:a.tileID.posMatrix,a,f.paint.get("line-translate"),f.paint.get("line-translate-anchor"))}const Lh=(v,a,f,m,g)=>{return{u_matrix:v,u_tl_parent:a,u_scale_parent:f,u_buffer_scale:1,u_fade_t:m.mix,u_opacity:m.opacity*g.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:g.paint.get("raster-brightness-min"),u_brightness_high:g.paint.get("raster-brightness-max"),u_saturation_factor:(T=g.paint.get("raster-saturation"),T>0?1-1/(1.001-T):-T),u_contrast_factor:(b=g.paint.get("raster-contrast"),b>0?1/(1-b):1+b),u_spin_weights:Ic(g.paint.get("raster-hue-rotate"))};var b,T};function Ic(v){v*=Math.PI/180;const a=Math.sin(v),f=Math.cos(v);return[(2*f+1)/3,(-Math.sqrt(3)*a-f+1)/3,(Math.sqrt(3)*a-f+1)/3]}const Cc=(v,a,f,m,g,b,T,L,k,z)=>{const j=g.transform;return{u_is_size_zoom_constant:+(v==="constant"||v==="source"),u_is_size_feature_constant:+(v==="constant"||v==="camera"),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:j.cameraToCenterDistance,u_pitch:j.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:j.width/j.height,u_fade_change:g.options.fadeDuration?g.symbolFadeChange:1,u_matrix:b,u_label_plane_matrix:T,u_coord_matrix:L,u_is_text:+k,u_pitch_with_map:+m,u_texsize:z,u_texture:0}},Tc=(v,a,f,m,g,b,T,L,k,z,j)=>{const q=g.transform;return l.e(Cc(v,a,f,m,g,b,T,L,k,z),{u_gamma_scale:m?Math.cos(q._pitch)*q.cameraToCenterDistance:1,u_device_pixel_ratio:g.pixelRatio,u_is_halo:+j})},Lc=(v,a,f,m,g,b,T,L,k,z)=>l.e(Tc(v,a,f,m,g,b,T,L,!0,k,!0),{u_texsize_icon:z,u_texture_icon:1}),My=(v,a,f)=>({u_matrix:v,u_opacity:a,u_color:f}),ky=(v,a,f,m,g,b)=>l.e(function(T,L,k,z){const j=k.imageManager.getPattern(T.from.toString()),q=k.imageManager.getPattern(T.to.toString()),{width:$,height:he}=k.imageManager.getPixelSize(),ce=Math.pow(2,z.tileID.overscaledZ),ye=z.tileSize*Math.pow(2,k.transform.tileZoom)/ce,re=ye*(z.tileID.canonical.x+z.tileID.wrap*ce),Ie=ye*z.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:j.tl,u_pattern_br_a:j.br,u_pattern_tl_b:q.tl,u_pattern_br_b:q.br,u_texsize:[$,he],u_mix:L.t,u_pattern_size_a:j.displaySize,u_pattern_size_b:q.displaySize,u_scale_a:L.fromScale,u_scale_b:L.toScale,u_tile_units_to_pixels:1/un(z,1,k.transform.tileZoom),u_pixel_coord_upper:[re>>16,Ie>>16],u_pixel_coord_lower:[65535&re,65535&Ie]}}(m,b,f,g),{u_matrix:v,u_opacity:a}),Um={fillExtrusion:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_lightpos:new l.aK(v,a.u_lightpos),u_lightintensity:new l.aH(v,a.u_lightintensity),u_lightcolor:new l.aK(v,a.u_lightcolor),u_vertical_gradient:new l.aH(v,a.u_vertical_gradient),u_opacity:new l.aH(v,a.u_opacity)}),fillExtrusionPattern:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_lightpos:new l.aK(v,a.u_lightpos),u_lightintensity:new l.aH(v,a.u_lightintensity),u_lightcolor:new l.aK(v,a.u_lightcolor),u_vertical_gradient:new l.aH(v,a.u_vertical_gradient),u_height_factor:new l.aH(v,a.u_height_factor),u_image:new l.aG(v,a.u_image),u_texsize:new l.aL(v,a.u_texsize),u_pixel_coord_upper:new l.aL(v,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.aL(v,a.u_pixel_coord_lower),u_scale:new l.aK(v,a.u_scale),u_fade:new l.aH(v,a.u_fade),u_opacity:new l.aH(v,a.u_opacity)}),fill:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix)}),fillPattern:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_image:new l.aG(v,a.u_image),u_texsize:new l.aL(v,a.u_texsize),u_pixel_coord_upper:new l.aL(v,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.aL(v,a.u_pixel_coord_lower),u_scale:new l.aK(v,a.u_scale),u_fade:new l.aH(v,a.u_fade)}),fillOutline:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_world:new l.aL(v,a.u_world)}),fillOutlinePattern:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_world:new l.aL(v,a.u_world),u_image:new l.aG(v,a.u_image),u_texsize:new l.aL(v,a.u_texsize),u_pixel_coord_upper:new l.aL(v,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.aL(v,a.u_pixel_coord_lower),u_scale:new l.aK(v,a.u_scale),u_fade:new l.aH(v,a.u_fade)}),circle:(v,a)=>({u_camera_to_center_distance:new l.aH(v,a.u_camera_to_center_distance),u_scale_with_map:new l.aG(v,a.u_scale_with_map),u_pitch_with_map:new l.aG(v,a.u_pitch_with_map),u_extrude_scale:new l.aL(v,a.u_extrude_scale),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_matrix:new l.aI(v,a.u_matrix)}),collisionBox:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_camera_to_center_distance:new l.aH(v,a.u_camera_to_center_distance),u_pixels_to_tile_units:new l.aH(v,a.u_pixels_to_tile_units),u_extrude_scale:new l.aL(v,a.u_extrude_scale),u_overscale_factor:new l.aH(v,a.u_overscale_factor)}),collisionCircle:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_inv_matrix:new l.aI(v,a.u_inv_matrix),u_camera_to_center_distance:new l.aH(v,a.u_camera_to_center_distance),u_viewport_size:new l.aL(v,a.u_viewport_size)}),debug:(v,a)=>({u_color:new l.aM(v,a.u_color),u_matrix:new l.aI(v,a.u_matrix),u_overlay:new l.aG(v,a.u_overlay),u_overlay_scale:new l.aH(v,a.u_overlay_scale)}),clippingMask:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix)}),heatmap:(v,a)=>({u_extrude_scale:new l.aH(v,a.u_extrude_scale),u_intensity:new l.aH(v,a.u_intensity),u_matrix:new l.aI(v,a.u_matrix)}),heatmapTexture:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_world:new l.aL(v,a.u_world),u_image:new l.aG(v,a.u_image),u_color_ramp:new l.aG(v,a.u_color_ramp),u_opacity:new l.aH(v,a.u_opacity)}),hillshade:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_image:new l.aG(v,a.u_image),u_latrange:new l.aL(v,a.u_latrange),u_light:new l.aL(v,a.u_light),u_shadow:new l.aM(v,a.u_shadow),u_highlight:new l.aM(v,a.u_highlight),u_accent:new l.aM(v,a.u_accent)}),hillshadePrepare:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_image:new l.aG(v,a.u_image),u_dimension:new l.aL(v,a.u_dimension),u_zoom:new l.aH(v,a.u_zoom),u_unpack:new l.aJ(v,a.u_unpack)}),line:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_ratio:new l.aH(v,a.u_ratio),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_units_to_pixels:new l.aL(v,a.u_units_to_pixels)}),lineGradient:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_ratio:new l.aH(v,a.u_ratio),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_units_to_pixels:new l.aL(v,a.u_units_to_pixels),u_image:new l.aG(v,a.u_image),u_image_height:new l.aH(v,a.u_image_height)}),linePattern:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_texsize:new l.aL(v,a.u_texsize),u_ratio:new l.aH(v,a.u_ratio),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_image:new l.aG(v,a.u_image),u_units_to_pixels:new l.aL(v,a.u_units_to_pixels),u_scale:new l.aK(v,a.u_scale),u_fade:new l.aH(v,a.u_fade)}),lineSDF:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_ratio:new l.aH(v,a.u_ratio),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_units_to_pixels:new l.aL(v,a.u_units_to_pixels),u_patternscale_a:new l.aL(v,a.u_patternscale_a),u_patternscale_b:new l.aL(v,a.u_patternscale_b),u_sdfgamma:new l.aH(v,a.u_sdfgamma),u_image:new l.aG(v,a.u_image),u_tex_y_a:new l.aH(v,a.u_tex_y_a),u_tex_y_b:new l.aH(v,a.u_tex_y_b),u_mix:new l.aH(v,a.u_mix)}),raster:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_tl_parent:new l.aL(v,a.u_tl_parent),u_scale_parent:new l.aH(v,a.u_scale_parent),u_buffer_scale:new l.aH(v,a.u_buffer_scale),u_fade_t:new l.aH(v,a.u_fade_t),u_opacity:new l.aH(v,a.u_opacity),u_image0:new l.aG(v,a.u_image0),u_image1:new l.aG(v,a.u_image1),u_brightness_low:new l.aH(v,a.u_brightness_low),u_brightness_high:new l.aH(v,a.u_brightness_high),u_saturation_factor:new l.aH(v,a.u_saturation_factor),u_contrast_factor:new l.aH(v,a.u_contrast_factor),u_spin_weights:new l.aK(v,a.u_spin_weights)}),symbolIcon:(v,a)=>({u_is_size_zoom_constant:new l.aG(v,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aG(v,a.u_is_size_feature_constant),u_size_t:new l.aH(v,a.u_size_t),u_size:new l.aH(v,a.u_size),u_camera_to_center_distance:new l.aH(v,a.u_camera_to_center_distance),u_pitch:new l.aH(v,a.u_pitch),u_rotate_symbol:new l.aG(v,a.u_rotate_symbol),u_aspect_ratio:new l.aH(v,a.u_aspect_ratio),u_fade_change:new l.aH(v,a.u_fade_change),u_matrix:new l.aI(v,a.u_matrix),u_label_plane_matrix:new l.aI(v,a.u_label_plane_matrix),u_coord_matrix:new l.aI(v,a.u_coord_matrix),u_is_text:new l.aG(v,a.u_is_text),u_pitch_with_map:new l.aG(v,a.u_pitch_with_map),u_texsize:new l.aL(v,a.u_texsize),u_texture:new l.aG(v,a.u_texture)}),symbolSDF:(v,a)=>({u_is_size_zoom_constant:new l.aG(v,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aG(v,a.u_is_size_feature_constant),u_size_t:new l.aH(v,a.u_size_t),u_size:new l.aH(v,a.u_size),u_camera_to_center_distance:new l.aH(v,a.u_camera_to_center_distance),u_pitch:new l.aH(v,a.u_pitch),u_rotate_symbol:new l.aG(v,a.u_rotate_symbol),u_aspect_ratio:new l.aH(v,a.u_aspect_ratio),u_fade_change:new l.aH(v,a.u_fade_change),u_matrix:new l.aI(v,a.u_matrix),u_label_plane_matrix:new l.aI(v,a.u_label_plane_matrix),u_coord_matrix:new l.aI(v,a.u_coord_matrix),u_is_text:new l.aG(v,a.u_is_text),u_pitch_with_map:new l.aG(v,a.u_pitch_with_map),u_texsize:new l.aL(v,a.u_texsize),u_texture:new l.aG(v,a.u_texture),u_gamma_scale:new l.aH(v,a.u_gamma_scale),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_is_halo:new l.aG(v,a.u_is_halo)}),symbolTextAndIcon:(v,a)=>({u_is_size_zoom_constant:new l.aG(v,a.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aG(v,a.u_is_size_feature_constant),u_size_t:new l.aH(v,a.u_size_t),u_size:new l.aH(v,a.u_size),u_camera_to_center_distance:new l.aH(v,a.u_camera_to_center_distance),u_pitch:new l.aH(v,a.u_pitch),u_rotate_symbol:new l.aG(v,a.u_rotate_symbol),u_aspect_ratio:new l.aH(v,a.u_aspect_ratio),u_fade_change:new l.aH(v,a.u_fade_change),u_matrix:new l.aI(v,a.u_matrix),u_label_plane_matrix:new l.aI(v,a.u_label_plane_matrix),u_coord_matrix:new l.aI(v,a.u_coord_matrix),u_is_text:new l.aG(v,a.u_is_text),u_pitch_with_map:new l.aG(v,a.u_pitch_with_map),u_texsize:new l.aL(v,a.u_texsize),u_texsize_icon:new l.aL(v,a.u_texsize_icon),u_texture:new l.aG(v,a.u_texture),u_texture_icon:new l.aG(v,a.u_texture_icon),u_gamma_scale:new l.aH(v,a.u_gamma_scale),u_device_pixel_ratio:new l.aH(v,a.u_device_pixel_ratio),u_is_halo:new l.aG(v,a.u_is_halo)}),background:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_opacity:new l.aH(v,a.u_opacity),u_color:new l.aM(v,a.u_color)}),backgroundPattern:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_opacity:new l.aH(v,a.u_opacity),u_image:new l.aG(v,a.u_image),u_pattern_tl_a:new l.aL(v,a.u_pattern_tl_a),u_pattern_br_a:new l.aL(v,a.u_pattern_br_a),u_pattern_tl_b:new l.aL(v,a.u_pattern_tl_b),u_pattern_br_b:new l.aL(v,a.u_pattern_br_b),u_texsize:new l.aL(v,a.u_texsize),u_mix:new l.aH(v,a.u_mix),u_pattern_size_a:new l.aL(v,a.u_pattern_size_a),u_pattern_size_b:new l.aL(v,a.u_pattern_size_b),u_scale_a:new l.aH(v,a.u_scale_a),u_scale_b:new l.aH(v,a.u_scale_b),u_pixel_coord_upper:new l.aL(v,a.u_pixel_coord_upper),u_pixel_coord_lower:new l.aL(v,a.u_pixel_coord_lower),u_tile_units_to_pixels:new l.aH(v,a.u_tile_units_to_pixels)}),terrain:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_texture:new l.aG(v,a.u_texture),u_ele_delta:new l.aH(v,a.u_ele_delta)}),terrainDepth:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_ele_delta:new l.aH(v,a.u_ele_delta)}),terrainCoords:(v,a)=>({u_matrix:new l.aI(v,a.u_matrix),u_texture:new l.aG(v,a.u_texture),u_terrain_coords_id:new l.aH(v,a.u_terrain_coords_id),u_ele_delta:new l.aH(v,a.u_ele_delta)})};class Ay{constructor(a,f,m){this.context=a;const g=a.gl;this.buffer=g.createBuffer(),this.dynamicDraw=!!m,this.context.unbindVAO(),a.bindElementBuffer.set(this.buffer),g.bufferData(g.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?g.DYNAMIC_DRAW:g.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(a){const f=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,a.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Wl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ph{constructor(a,f,m,g){this.length=f.length,this.attributes=m,this.itemSize=f.bytesPerElement,this.dynamicDraw=g,this.context=a;const b=a.gl;this.buffer=b.createBuffer(),a.bindVertexBuffer.set(this.buffer),b.bufferData(b.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(a){if(a.length!==this.length)throw new Error(`Length of new data is ${a.length}, which doesn't match current length of ${this.length}`);const f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,a.arrayBuffer)}enableAttributes(a,f){for(let m=0;m0){const ct=l.F(),dt=$e;l.aP(ct,He.placementInvProjMatrix,v.transform.glCoordMatrix),l.aP(ct,ct,He.placementViewportMatrix),j.push({circleArray:tt,circleOffset:$,transform:dt,invTransform:ct,coord:De}),q+=tt.length/4,$=q}it&&z.draw(L,k.LINES,zn.disabled,br.disabled,v.colorModeForRenderPass(),ur.disabled,Om($e,v.transform,qe),v.style.map.terrain&&v.style.map.terrain.getTerrainData(De),f.id,it.layoutVertexBuffer,it.indexBuffer,it.segments,null,v.transform.zoom,null,null,it.collisionVertexBuffer)}if(!T||!j.length)return;const he=v.useProgram("collisionCircle"),ce=new l.aQ;ce.resize(4*q),ce._trim();let ye=0;for(const xe of j)for(let De=0;De=0&&(ce[re.associatedIconIndex]={shiftedAnchor:gn,angle:_t})}else Je(re.numGlyphs,$)}if(z){he.clear();const ye=v.icon.placedSymbolArray;for(let re=0;rev.style.map.terrain.getElevation(it,gs,pi):null,Ar=f.layout.get("text-rotation-alignment")==="map";X(ct,it.posMatrix,v,g,Yo,ia,re,z,Ar,fi)}const ml=v.translatePosMatrix(it.posMatrix,tt,b,T),oa=Ie||g&&He||jc?Np:Yo,hi=v.translatePosMatrix(ia,tt,b,T,!0),kr=_t&&f.paint.get(g?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ir;Ir=_t?ct.iconsInText?Lc(en.kind,on,Ue,re,v,ml,oa,hi,Cn,yi):Tc(en.kind,on,Ue,re,v,ml,oa,hi,g,Cn,!0):Cc(en.kind,on,Ue,re,v,ml,oa,hi,g,Cn);const ms={program:Fn,buffers:dt,uniformValues:Ir,atlasTexture:Br,atlasTextureIcon:Mr,atlasInterpolation:tr,atlasInterpolationIcon:Xo,isSDF:_t,hasHalo:kr};if(xe&&ct.canOverlap){De=!0;const fi=dt.segments.get();for(const Ar of fi)$e.push({segments:new l.$([Ar]),sortKey:Ar.sortKey,state:ms,terrainData:bn})}else $e.push({segments:dt.segments,sortKey:0,state:ms,terrainData:bn})}De&&$e.sort((it,tt)=>it.sortKey-tt.sortKey);for(const it of $e){const tt=it.state;if($.activeTexture.set(he.TEXTURE0),tt.atlasTexture.bind(tt.atlasInterpolation,he.CLAMP_TO_EDGE),tt.atlasTextureIcon&&($.activeTexture.set(he.TEXTURE1),tt.atlasTextureIcon&&tt.atlasTextureIcon.bind(tt.atlasInterpolationIcon,he.CLAMP_TO_EDGE)),tt.isSDF){const ct=tt.uniformValues;tt.hasHalo&&(ct.u_is_halo=1,$m(tt.buffers,it.segments,f,v,tt.program,qe,j,q,ct,it.terrainData)),ct.u_is_halo=0}$m(tt.buffers,it.segments,f,v,tt.program,qe,j,q,tt.uniformValues,it.terrainData)}}function $m(v,a,f,m,g,b,T,L,k,z){const j=m.context;g.draw(j,j.gl.TRIANGLES,b,T,L,ur.disabled,k,z,f.id,v.layoutVertexBuffer,v.indexBuffer,a,f.paint,m.transform.zoom,v.programConfigurations.get(f.id),v.dynamicLayoutVertexBuffer,v.opacityVertexBuffer)}function Vh(v,a,f,m,g){if(!f||!m||!m.imageAtlas)return;const b=m.imageAtlas.patternPositions;let T=b[f.to.toString()],L=b[f.from.toString()];if(!T&&L&&(T=L),!L&&T&&(L=T),!T||!L){const k=g.getPaintProperty(a);T=b[k],L=b[k]}T&&L&&v.setConstantPatternPositions(T,L)}function Km(v,a,f,m,g,b,T){const L=v.context.gl,k="fill-pattern",z=f.paint.get(k),j=z&&z.constantOr(1),q=f.getCrossfadeParameters();let $,he,ce,ye,re;T?(he=j&&!f.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",$=L.LINES):(he=j?"fillPattern":"fill",$=L.TRIANGLES);const Ie=z.constantOr(null);for(const Ue of m){const xe=a.getTile(Ue);if(j&&!xe.patternsLoaded())continue;const De=xe.getBucket(f);if(!De)continue;const qe=De.programConfigurations.get(f.id),He=v.useProgram(he,qe),$e=v.style.map.terrain&&v.style.map.terrain.getTerrainData(Ue);j&&(v.context.activeTexture.set(L.TEXTURE0),xe.imageAtlasTexture.bind(L.LINEAR,L.CLAMP_TO_EDGE),qe.updatePaintBuffers(q)),Vh(qe,k,Ie,xe,f);const it=$e?Ue:null,tt=v.translatePosMatrix(it?it.posMatrix:Ue.posMatrix,xe,f.paint.get("fill-translate"),f.paint.get("fill-translate-anchor"));if(T){ye=De.indexBuffer2,re=De.segments2;const ct=[L.drawingBufferWidth,L.drawingBufferHeight];ce=he==="fillOutlinePattern"&&j?Nm(tt,v,q,xe,ct):Ly(tt,ct)}else ye=De.indexBuffer,re=De.segments,ce=j?Eh(tt,v,q,xe):Rm(tt);He.draw(v.context,$,g,v.stencilModeForClipping(Ue),b,ur.disabled,ce,$e,f.id,De.layoutVertexBuffer,ye,re,f.paint,v.transform.zoom,qe)}}function Uh(v,a,f,m,g,b,T){const L=v.context,k=L.gl,z="fill-extrusion-pattern",j=f.paint.get(z),q=j.constantOr(1),$=f.getCrossfadeParameters(),he=f.paint.get("fill-extrusion-opacity"),ce=j.constantOr(null);for(const ye of m){const re=a.getTile(ye),Ie=re.getBucket(f);if(!Ie)continue;const Ue=v.style.map.terrain&&v.style.map.terrain.getTerrainData(ye),xe=Ie.programConfigurations.get(f.id),De=v.useProgram(q?"fillExtrusionPattern":"fillExtrusion",xe);q&&(v.context.activeTexture.set(k.TEXTURE0),re.imageAtlasTexture.bind(k.LINEAR,k.CLAMP_TO_EDGE),xe.updatePaintBuffers($)),Vh(xe,z,ce,re,f);const qe=v.translatePosMatrix(ye.posMatrix,re,f.paint.get("fill-extrusion-translate"),f.paint.get("fill-extrusion-translate-anchor")),He=f.paint.get("fill-extrusion-vertical-gradient"),$e=q?Ty(qe,v,He,he,ye,$,re):Sc(qe,v,He,he);De.draw(L,L.gl.TRIANGLES,g,b,T,ur.backCCW,$e,Ue,f.id,Ie.layoutVertexBuffer,Ie.indexBuffer,Ie.segments,f.paint,v.transform.zoom,xe,v.style.map.terrain&&Ie.centroidVertexBuffer)}}function jh(v,a,f,m,g,b,T){const L=v.context,k=L.gl,z=f.fbo;if(!z)return;const j=v.useProgram("hillshade"),q=v.style.map.terrain&&v.style.map.terrain.getTerrainData(a);L.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,z.colorAttachment.get()),j.draw(L,k.TRIANGLES,g,b,T,ur.disabled,(($,he,ce,ye)=>{const re=ce.paint.get("hillshade-shadow-color"),Ie=ce.paint.get("hillshade-highlight-color"),Ue=ce.paint.get("hillshade-accent-color");let xe=ce.paint.get("hillshade-illumination-direction")*(Math.PI/180);ce.paint.get("hillshade-illumination-anchor")==="viewport"&&(xe-=$.transform.angle);const De=!$.options.moving;return{u_matrix:ye?ye.posMatrix:$.transform.calculatePosMatrix(he.tileID.toUnwrapped(),De),u_image:0,u_latrange:Bm(0,he.tileID),u_light:[ce.paint.get("hillshade-exaggeration"),xe],u_shadow:re,u_highlight:Ie,u_accent:Ue}})(v,f,m,q?a:null),q,m.id,v.rasterBoundsBuffer,v.quadTriangleIndexBuffer,v.rasterBoundsSegments)}function Op(v,a,f,m,g,b){const T=v.context,L=T.gl,k=a.dem;if(k&&k.data){const z=k.dim,j=k.stride,q=k.getPixels();if(T.activeTexture.set(L.TEXTURE1),T.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||v.getTileTexture(j),a.demTexture){const he=a.demTexture;he.update(q,{premultiply:!1}),he.bind(L.NEAREST,L.CLAMP_TO_EDGE)}else a.demTexture=new K(T,q,L.RGBA,{premultiply:!1}),a.demTexture.bind(L.NEAREST,L.CLAMP_TO_EDGE);T.activeTexture.set(L.TEXTURE0);let $=a.fbo;if(!$){const he=new K(T,{width:z,height:z,data:null},L.RGBA);he.bind(L.LINEAR,L.CLAMP_TO_EDGE),$=a.fbo=T.createFramebuffer(z,z,!0,!1),$.colorAttachment.set(he.texture)}T.bindFramebuffer.set($.framebuffer),T.viewport.set([0,0,z,z]),v.useProgram("hillshadePrepare").draw(T,L.TRIANGLES,m,g,b,ur.disabled,((he,ce)=>{const ye=ce.stride,re=l.F();return l.aN(re,0,l.W,-l.W,0,0,1),l.H(re,re,[0,-l.W,0]),{u_matrix:re,u_image:1,u_dimension:[ye,ye],u_zoom:he.overscaledZ,u_unpack:ce.getUnpackVector()}})(a.tileID,k),null,f.id,v.rasterBoundsBuffer,v.quadTriangleIndexBuffer,v.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function Jm(v,a,f,m,g,b){const T=m.paint.get("raster-fade-duration");if(!b&&T>0){const L=E.now(),k=(L-v.timeAdded)/T,z=a?(L-a.timeAdded)/T:-1,j=f.getSource(),q=g.coveringZoomLevel({tileSize:j.tileSize,roundZoom:j.roundZoom}),$=!a||Math.abs(a.tileID.overscaledZ-q)>Math.abs(v.tileID.overscaledZ-q),he=$&&v.refreshedUponExpiration?1:l.ac($?k:1-z,0,1);return v.refreshedUponExpiration&&k>=1&&(v.refreshedUponExpiration=!1),a?{opacity:1,mix:1-he}:{opacity:he,mix:0}}return{opacity:1,mix:0}}const Qm=new l.aO(1,0,0,1),Gh=new l.aO(0,1,0,1),zp=new l.aO(0,0,1,1),Uy=new l.aO(1,0,1,1),eg=new l.aO(0,1,1,1);function zr(v,a,f,m){go(v,0,a+f/2,v.transform.width,f,m)}function cl(v,a,f,m){go(v,a-f/2,0,f,v.transform.height,m)}function go(v,a,f,m,g,b){const T=v.context,L=T.gl;L.enable(L.SCISSOR_TEST),L.scissor(a*v.pixelRatio,f*v.pixelRatio,m*v.pixelRatio,g*v.pixelRatio),T.clear({color:b}),L.disable(L.SCISSOR_TEST)}function Fp(v,a,f){const m=v.context,g=m.gl,b=f.posMatrix,T=v.useProgram("debug"),L=zn.disabled,k=br.disabled,z=v.colorModeForRenderPass(),j="$debug",q=v.style.map.terrain&&v.style.map.terrain.getTerrainData(f);m.activeTexture.set(g.TEXTURE0);const $=a.getTileByID(f.key).latestRawTileData,he=Math.floor(($&&$.byteLength||0)/1024),ce=a.getTile(f).tileSize,ye=512/Math.min(ce,512)*(f.overscaledZ/v.transform.zoom)*.5;let re=f.canonical.toString();f.overscaledZ!==f.canonical.z&&(re+=` => ${f.overscaledZ}`),function(Ie,Ue){Ie.initDebugOverlayCanvas();const xe=Ie.debugOverlayCanvas,De=Ie.context.gl,qe=Ie.debugOverlayCanvas.getContext("2d");qe.clearRect(0,0,xe.width,xe.height),qe.shadowColor="white",qe.shadowBlur=2,qe.lineWidth=1.5,qe.strokeStyle="white",qe.textBaseline="top",qe.font="bold 36px Open Sans, sans-serif",qe.fillText(Ue,5,5),qe.strokeText(Ue,5,5),Ie.debugOverlayTexture.update(xe),Ie.debugOverlayTexture.bind(De.LINEAR,De.CLAMP_TO_EDGE)}(v,`${re} ${he}kB`),T.draw(m,g.TRIANGLES,L,k,Qr.alphaBlended,ur.disabled,zm(b,l.aO.transparent,ye),null,j,v.debugBuffer,v.quadTriangleIndexBuffer,v.debugSegments),T.draw(m,g.LINE_STRIP,L,k,z,ur.disabled,zm(b,l.aO.red),q,j,v.debugBuffer,v.tileBorderIndexBuffer,v.debugSegments)}function qh(v,a,f){const m=v.context,g=m.gl,b=v.colorModeForRenderPass(),T=new zn(g.LEQUAL,zn.ReadWrite,v.depthRangeFor3D),L=v.useProgram("terrain"),k=a.getTerrainMesh();m.bindFramebuffer.set(null),m.viewport.set([0,0,v.width,v.height]);for(const z of f){const j=v.renderToTexture.getTexture(z),q=a.getTerrainData(z.tileID);m.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,j.texture);const $={u_matrix:v.transform.calculatePosMatrix(z.tileID.toUnwrapped()),u_texture:0,u_ele_delta:a.getMeshFrameDelta(v.transform.zoom)};L.draw(m,g.TRIANGLES,T,br.disabled,b,ur.backCCW,$,q,"terrain",k.vertexBuffer,k.indexBuffer,k.segments)}}class tg{constructor(a,f){this.context=new Vy(a),this.transform=f,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:l.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=li.maxUnderzooming+li.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ll}resize(a,f,m){if(this.width=Math.floor(a*m),this.height=Math.floor(f*m),this.pixelRatio=m,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const g of this.style._order)this.style._layers[g].resize()}setup(){const a=this.context,f=new l.aV;f.emplaceBack(0,0),f.emplaceBack(l.W,0),f.emplaceBack(0,l.W),f.emplaceBack(l.W,l.W),this.tileExtentBuffer=a.createVertexBuffer(f,xh.members),this.tileExtentSegments=l.$.simpleSegment(0,0,4,2);const m=new l.aV;m.emplaceBack(0,0),m.emplaceBack(l.W,0),m.emplaceBack(0,l.W),m.emplaceBack(l.W,l.W),this.debugBuffer=a.createVertexBuffer(m,xh.members),this.debugSegments=l.$.simpleSegment(0,0,4,5);const g=new l.Z;g.emplaceBack(0,0,0,0),g.emplaceBack(l.W,0,l.W,0),g.emplaceBack(0,l.W,0,l.W),g.emplaceBack(l.W,l.W,l.W,l.W),this.rasterBoundsBuffer=a.createVertexBuffer(g,St.members),this.rasterBoundsSegments=l.$.simpleSegment(0,0,4,2);const b=new l.aV;b.emplaceBack(0,0),b.emplaceBack(1,0),b.emplaceBack(0,1),b.emplaceBack(1,1),this.viewportBuffer=a.createVertexBuffer(b,xh.members),this.viewportSegments=l.$.simpleSegment(0,0,4,2);const T=new l.aW;T.emplaceBack(0),T.emplaceBack(1),T.emplaceBack(3),T.emplaceBack(2),T.emplaceBack(0),this.tileBorderIndexBuffer=a.createIndexBuffer(T);const L=new l.aX;L.emplaceBack(0,1,2),L.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=a.createIndexBuffer(L);const k=this.context.gl;this.stencilClearMode=new br({func:k.ALWAYS,mask:0},0,255,k.ZERO,k.ZERO,k.ZERO)}clearStencil(){const a=this.context,f=a.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const m=l.F();l.aN(m,0,this.width,this.height,0,0,1),l.J(m,m,[f.drawingBufferWidth,f.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(a,f.TRIANGLES,zn.disabled,this.stencilClearMode,Qr.disabled,ur.disabled,Ih(m),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(a,f){if(this.currentStencilSource===a.source||!a.isTileClipped()||!f||!f.length)return;this.currentStencilSource=a.source;const m=this.context,g=m.gl;this.nextStencilID+f.length>256&&this.clearStencil(),m.setColorMode(Qr.disabled),m.setDepthMode(zn.disabled);const b=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const T of f){const L=this._tileClippingMaskIDs[T.key]=this.nextStencilID++,k=this.style.map.terrain&&this.style.map.terrain.getTerrainData(T);b.draw(m,g.TRIANGLES,zn.disabled,new br({func:g.ALWAYS,mask:0},L,255,g.KEEP,g.KEEP,g.REPLACE),Qr.disabled,ur.disabled,Ih(T.posMatrix),k,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const a=this.nextStencilID++,f=this.context.gl;return new br({func:f.NOTEQUAL,mask:255},a,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(a){const f=this.context.gl;return new br({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[a.key],0,f.KEEP,f.KEEP,f.REPLACE)}stencilConfigForOverlap(a){const f=this.context.gl,m=a.sort((T,L)=>L.overscaledZ-T.overscaledZ),g=m[m.length-1].overscaledZ,b=m[0].overscaledZ-g+1;if(b>1){this.currentStencilSource=void 0,this.nextStencilID+b>256&&this.clearStencil();const T={};for(let L=0;L=0;this.currentLayer--){const k=this.style._layers[m[this.currentLayer]],z=g[k.source],j=b[k.source];this._renderTileClippingMasks(k,j),this.renderLayer(this,z,k,j)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerre.source&&!re.isHidden(j)?[z.sourceCaches[re.source]]:[]),he=$.filter(re=>re.getSource().type==="vector"),ce=$.filter(re=>re.getSource().type!=="vector"),ye=re=>{(!q||q.getSource().maxzoomye(re)),q||ce.forEach(re=>ye(re)),q}(this.style,this.transform.zoom);k&&function(z,j,q){for(let $=0;$0),g&&(l.a_(f,m),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(b,T){const L=b.context,k=L.gl,z=Qr.unblended,j=new zn(k.LEQUAL,zn.ReadWrite,[0,1]),q=T.getTerrainMesh(),$=T.sourceCache.getRenderableTiles(),he=b.useProgram("terrainDepth");L.bindFramebuffer.set(T.getFramebuffer("depth").framebuffer),L.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),L.clear({color:l.aO.transparent,depth:1});for(const ce of $){const ye=T.getTerrainData(ce.tileID),re={u_matrix:b.transform.calculatePosMatrix(ce.tileID.toUnwrapped()),u_ele_delta:T.getMeshFrameDelta(b.transform.zoom)};he.draw(L,k.TRIANGLES,j,br.disabled,z,ur.backCCW,re,ye,"terrain",q.vertexBuffer,q.indexBuffer,q.segments)}L.bindFramebuffer.set(null),L.viewport.set([0,0,b.width,b.height])}(this,this.style.map.terrain),function(b,T){const L=b.context,k=L.gl,z=Qr.unblended,j=new zn(k.LEQUAL,zn.ReadWrite,[0,1]),q=T.getTerrainMesh(),$=T.getCoordsTexture(),he=T.sourceCache.getRenderableTiles(),ce=b.useProgram("terrainCoords");L.bindFramebuffer.set(T.getFramebuffer("coords").framebuffer),L.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),L.clear({color:l.aO.transparent,depth:1}),T.coordsIndex=[];for(const ye of he){const re=T.getTerrainData(ye.tileID);L.activeTexture.set(k.TEXTURE0),k.bindTexture(k.TEXTURE_2D,$.texture);const Ie={u_matrix:b.transform.calculatePosMatrix(ye.tileID.toUnwrapped()),u_terrain_coords_id:(255-T.coordsIndex.length)/255,u_texture:0,u_ele_delta:T.getMeshFrameDelta(b.transform.zoom)};ce.draw(L,k.TRIANGLES,j,br.disabled,z,ur.backCCW,Ie,re,"terrain",q.vertexBuffer,q.indexBuffer,q.segments),T.coordsIndex.push(ye.tileID.key)}L.bindFramebuffer.set(null),L.viewport.set([0,0,b.width,b.height])}(this,this.style.map.terrain))}renderLayer(a,f,m,g){if(!m.isHidden(this.transform.zoom)&&(m.type==="background"||m.type==="custom"||(g||[]).length))switch(this.id=m.id,m.type){case"symbol":(function(b,T,L,k,z){if(b.renderPass!=="translucent")return;const j=br.disabled,q=b.colorModeForRenderPass();(L._unevaluatedLayout.hasValue("text-variable-anchor")||L._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function($,he,ce,ye,re,Ie,Ue){const xe=he.transform,De=re==="map",qe=Ie==="map";for(const He of $){const $e=ye.getTile(He),it=$e.getBucket(ce);if(!it||!it.text||!it.text.segments.get().length)continue;const tt=l.ag(it.textSizeData,xe.zoom),ct=un($e,1,he.transform.zoom),dt=fn(He.posMatrix,qe,De,he.transform,ct),gn=ce.layout.get("icon-text-fit")!=="none"&&it.hasIconData();if(tt){const _t=Math.pow(2,xe.zoom-$e.tileID.overscaledZ);zh(it,De,qe,Ue,xe,dt,He.posMatrix,_t,tt,gn,he.style.map.terrain?(en,_n)=>he.style.map.terrain.getElevation(He,en,_n):null)}}}(k,b,L,T,L.layout.get("text-rotation-alignment"),L.layout.get("text-pitch-alignment"),z),L.paint.get("icon-opacity").constantOr(1)!==0&&Bh(b,T,L,k,!1,L.paint.get("icon-translate"),L.paint.get("icon-translate-anchor"),L.layout.get("icon-rotation-alignment"),L.layout.get("icon-pitch-alignment"),L.layout.get("icon-keep-upright"),j,q),L.paint.get("text-opacity").constantOr(1)!==0&&Bh(b,T,L,k,!0,L.paint.get("text-translate"),L.paint.get("text-translate-anchor"),L.layout.get("text-rotation-alignment"),L.layout.get("text-pitch-alignment"),L.layout.get("text-keep-upright"),j,q),T.map.showCollisionBoxes&&(Oh(b,T,L,k,L.paint.get("text-translate"),L.paint.get("text-translate-anchor"),!0),Oh(b,T,L,k,L.paint.get("icon-translate"),L.paint.get("icon-translate-anchor"),!1))})(a,f,m,g,this.style.placement.variableOffsets);break;case"circle":(function(b,T,L,k){if(b.renderPass!=="translucent")return;const z=L.paint.get("circle-opacity"),j=L.paint.get("circle-stroke-width"),q=L.paint.get("circle-stroke-opacity"),$=!L.layout.get("circle-sort-key").isConstant();if(z.constantOr(1)===0&&(j.constantOr(1)===0||q.constantOr(1)===0))return;const he=b.context,ce=he.gl,ye=b.depthModeForSublayer(0,zn.ReadOnly),re=br.disabled,Ie=b.colorModeForRenderPass(),Ue=[];for(let xe=0;xexe.sortKey-De.sortKey);for(const xe of Ue){const{programConfiguration:De,program:qe,layoutVertexBuffer:He,indexBuffer:$e,uniformValues:it,terrainData:tt}=xe.state;qe.draw(he,ce.TRIANGLES,ye,re,Ie,ur.disabled,it,tt,L.id,He,$e,xe.segments,L.paint,b.transform.zoom,De)}})(a,f,m,g);break;case"heatmap":(function(b,T,L,k){if(L.paint.get("heatmap-opacity")!==0)if(b.renderPass==="offscreen"){const z=b.context,j=z.gl,q=br.disabled,$=new Qr([j.ONE,j.ONE],l.aO.transparent,[!0,!0,!0,!0]);(function(he,ce,ye){const re=he.gl;he.activeTexture.set(re.TEXTURE1),he.viewport.set([0,0,ce.width/4,ce.height/4]);let Ie=ye.heatmapFbo;if(Ie)re.bindTexture(re.TEXTURE_2D,Ie.colorAttachment.get()),he.bindFramebuffer.set(Ie.framebuffer);else{const Ue=re.createTexture();re.bindTexture(re.TEXTURE_2D,Ue),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_WRAP_S,re.CLAMP_TO_EDGE),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_WRAP_T,re.CLAMP_TO_EDGE),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_MIN_FILTER,re.LINEAR),re.texParameteri(re.TEXTURE_2D,re.TEXTURE_MAG_FILTER,re.LINEAR),Ie=ye.heatmapFbo=he.createFramebuffer(ce.width/4,ce.height/4,!1,!1),function(xe,De,qe,He){var $e,it;const tt=xe.gl,ct=($e=xe.HALF_FLOAT)!==null&&$e!==void 0?$e:tt.UNSIGNED_BYTE,dt=(it=xe.RGBA16F)!==null&&it!==void 0?it:tt.RGBA;tt.texImage2D(tt.TEXTURE_2D,0,dt,De.width/4,De.height/4,0,tt.RGBA,ct,null),He.colorAttachment.set(qe)}(he,ce,Ue,Ie)}})(z,b,L),z.clear({color:l.aO.transparent});for(let he=0;he{const xe=l.F();l.aN(xe,0,ye.width,ye.height,0,0,1);const De=ye.context.gl;return{u_matrix:xe,u_world:[De.drawingBufferWidth,De.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:re.paint.get("heatmap-opacity")}})(z,j),null,j.id,z.viewportBuffer,z.quadTriangleIndexBuffer,z.viewportSegments,j.paint,z.transform.zoom)}(b,L))})(a,f,m,g);break;case"line":(function(b,T,L,k){if(b.renderPass!=="translucent")return;const z=L.paint.get("line-opacity"),j=L.paint.get("line-width");if(z.constantOr(1)===0||j.constantOr(1)===0)return;const q=b.depthModeForSublayer(0,zn.ReadOnly),$=b.colorModeForRenderPass(),he=L.paint.get("line-dasharray"),ce=L.paint.get("line-pattern"),ye=ce.constantOr(1),re=L.paint.get("line-gradient"),Ie=L.getCrossfadeParameters(),Ue=ye?"linePattern":he?"lineSDF":re?"lineGradient":"line",xe=b.context,De=xe.gl;let qe=!0;for(const He of k){const $e=T.getTile(He);if(ye&&!$e.patternsLoaded())continue;const it=$e.getBucket(L);if(!it)continue;const tt=it.programConfigurations.get(L.id),ct=b.context.program.get(),dt=b.useProgram(Ue,tt),gn=qe||dt.program!==ct,_t=b.style.map.terrain&&b.style.map.terrain.getTerrainData(He),en=ce.constantOr(null);if(en&&$e.imageAtlas){const on=$e.imageAtlas,bn=on.patternPositions[en.to.toString()],Cn=on.patternPositions[en.from.toString()];bn&&Cn&&tt.setConstantPatternPositions(bn,Cn)}const _n=_t?He:null,Fn=ye?ql(b,$e,L,Ie,_n):he?Th(b,$e,L,he,Ie,_n):re?Vm(b,$e,L,it.lineClipsArray.length,_n):Ch(b,$e,L,_n);if(ye)xe.activeTexture.set(De.TEXTURE0),$e.imageAtlasTexture.bind(De.LINEAR,De.CLAMP_TO_EDGE),tt.updatePaintBuffers(Ie);else if(he&&(gn||b.lineAtlas.dirty))xe.activeTexture.set(De.TEXTURE0),b.lineAtlas.bind(xe);else if(re){const on=it.gradients[L.id];let bn=on.texture;if(L.gradientVersion!==on.version){let Cn=256;if(L.stepInterpolant){const Br=T.getSource().maxzoom,tr=He.canonical.z===Br?Math.ceil(1<0?f.pop():null}isPatternMissing(a){if(!a)return!1;if(!a.from||!a.to)return!0;const f=this.imageManager.getPattern(a.from.toString()),m=this.imageManager.getPattern(a.to.toString());return!f||!m}useProgram(a,f){this.cache=this.cache||{};const m=a+(f?f.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[m]||(this.cache[m]=new ul(this.context,wc[a],f,Um[a],this._showOverdrawInspector,this.style.map.terrain)),this.cache[m]}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 a=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(a.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new K(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:a,drawingBufferHeight:f}=this.context.gl;return this.width!==a||this.height!==f}}class hl{constructor(a,f){this.points=a,this.planes=f}static fromInvProjectionMatrix(a,f,m){const g=Math.pow(2,m),b=[[-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(L=>{const k=1/(L=l.af([],L,a))[3]/f*g;return l.a$(L,L,[k,k,1/L[3],k])}),T=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(L=>{const k=function($,he){var ce=he[0],ye=he[1],re=he[2],Ie=ce*ce+ye*ye+re*re;return Ie>0&&(Ie=1/Math.sqrt(Ie)),$[0]=he[0]*Ie,$[1]=he[1]*Ie,$[2]=he[2]*Ie,$}([],function($,he,ce){var ye=he[0],re=he[1],Ie=he[2],Ue=ce[0],xe=ce[1],De=ce[2];return $[0]=re*De-Ie*xe,$[1]=Ie*Ue-ye*De,$[2]=ye*xe-re*Ue,$}([],se([],b[L[0]],b[L[1]]),se([],b[L[2]],b[L[1]]))),z=-((j=k)[0]*(q=b[L[1]])[0]+j[1]*q[1]+j[2]*q[2]);var j,q;return k.concat(z)});return new hl(b,T)}}class fl{constructor(a,f){this.min=a,this.max=f,this.center=function(m,g,b){return m[0]=.5*g[0],m[1]=.5*g[1],m[2]=.5*g[2],m}([],function(m,g,b){return m[0]=g[0]+b[0],m[1]=g[1]+b[1],m[2]=g[2]+b[2],m}([],this.min,this.max))}quadrant(a){const f=[a%2==0,a<2],m=ue(this.min),g=ue(this.max);for(let b=0;b=0&&T++;if(T===0)return 0;T!==f.length&&(m=!1)}if(m)return 2;for(let g=0;g<3;g++){let b=Number.MAX_VALUE,T=-Number.MAX_VALUE;for(let L=0;Lthis.max[g]-this.min[g])return 0}return 1}}class Au{constructor(a=0,f=0,m=0,g=0){if(isNaN(a)||a<0||isNaN(f)||f<0||isNaN(m)||m<0||isNaN(g)||g<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=a,this.bottom=f,this.left=m,this.right=g}interpolate(a,f,m){return f.top!=null&&a.top!=null&&(this.top=l.z.number(a.top,f.top,m)),f.bottom!=null&&a.bottom!=null&&(this.bottom=l.z.number(a.bottom,f.bottom,m)),f.left!=null&&a.left!=null&&(this.left=l.z.number(a.left,f.left,m)),f.right!=null&&a.right!=null&&(this.right=l.z.number(a.right,f.right,m)),this}getCenter(a,f){const m=l.ac((this.left+a-this.right)/2,0,a),g=l.ac((this.top+f-this.bottom)/2,0,f);return new l.P(m,g)}equals(a){return this.top===a.top&&this.bottom===a.bottom&&this.left===a.left&&this.right===a.right}clone(){return new Au(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Bp=85.051129;class Wh{constructor(a,f,m,g,b){this.tileSize=512,this._renderWorldCopies=b===void 0||!!b,this._minZoom=a||0,this._maxZoom=f||22,this._minPitch=m??0,this._maxPitch=g??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Au,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){const a=new Wh(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return a.apply(this),a}apply(a){this.tileSize=a.tileSize,this.latRange=a.latRange,this.width=a.width,this.height=a.height,this._center=a._center,this._elevation=a._elevation,this.minElevationForCurrentTile=a.minElevationForCurrentTile,this.zoom=a.zoom,this.angle=a.angle,this._fov=a._fov,this._pitch=a._pitch,this._unmodified=a._unmodified,this._edgeInsets=a._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(a){this._minZoom!==a&&(this._minZoom=a,this.zoom=Math.max(this.zoom,a))}get maxZoom(){return this._maxZoom}set maxZoom(a){this._maxZoom!==a&&(this._maxZoom=a,this.zoom=Math.min(this.zoom,a))}get minPitch(){return this._minPitch}set minPitch(a){this._minPitch!==a&&(this._minPitch=a,this.pitch=Math.max(this.pitch,a))}get maxPitch(){return this._maxPitch}set maxPitch(a){this._maxPitch!==a&&(this._maxPitch=a,this.pitch=Math.min(this.pitch,a))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(a){a===void 0?a=!0:a===null&&(a=!1),this._renderWorldCopies=a}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(a){const f=-l.b1(a,-180,180)*Math.PI/180;this.angle!==f&&(this._unmodified=!1,this.angle=f,this._calcMatrices(),this.rotationMatrix=function(){var m=new l.A(4);return l.A!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m}(),function(m,g,b){var T=g[0],L=g[1],k=g[2],z=g[3],j=Math.sin(b),q=Math.cos(b);m[0]=T*q+k*j,m[1]=L*q+z*j,m[2]=T*-j+k*q,m[3]=L*-j+z*q}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(a){const f=l.ac(a,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==f&&(this._unmodified=!1,this._pitch=f,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(a){a=Math.max(.01,Math.min(60,a)),this._fov!==a&&(this._unmodified=!1,this._fov=a/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(a){const f=Math.min(Math.max(a,this.minZoom),this.maxZoom);this._zoom!==f&&(this._unmodified=!1,this._zoom=f,this.tileZoom=Math.max(0,Math.floor(f)),this.scale=this.zoomScale(f),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(a){a.lat===this._center.lat&&a.lng===this._center.lng||(this._unmodified=!1,this._center=a,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(a){a!==this._elevation&&(this._elevation=a,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(a){this._edgeInsets.equals(a)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,a,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(a){return this._edgeInsets.equals(a)}interpolatePadding(a,f,m){this._unmodified=!1,this._edgeInsets.interpolate(a,f,m),this._constrain(),this._calcMatrices()}coveringZoomLevel(a){const f=(a.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/a.tileSize));return Math.max(0,f)}getVisibleUnwrappedCoordinates(a){const f=[new l.b2(0,a)];if(this._renderWorldCopies){const m=this.pointCoordinate(new l.P(0,0)),g=this.pointCoordinate(new l.P(this.width,0)),b=this.pointCoordinate(new l.P(this.width,this.height)),T=this.pointCoordinate(new l.P(0,this.height)),L=Math.floor(Math.min(m.x,g.x,b.x,T.x)),k=Math.floor(Math.max(m.x,g.x,b.x,T.x)),z=1;for(let j=L-z;j<=k+z;j++)j!==0&&f.push(new l.b2(j,a))}return f}coveringTiles(a){var f,m;let g=this.coveringZoomLevel(a);const b=g;if(a.minzoom!==void 0&&ga.maxzoom&&(g=a.maxzoom);const T=this.pointCoordinate(this.getCameraPoint()),L=l.Y.fromLngLat(this.center),k=Math.pow(2,g),z=[k*T.x,k*T.y,0],j=[k*L.x,k*L.y,0],q=hl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g);let $=a.minzoom||0;!a.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&($=g);const he=a.terrain?2/Math.min(this.tileSize,a.tileSize)*this.tileSize:3,ce=xe=>({aabb:new fl([xe*k,0,0],[(xe+1)*k,k,0]),zoom:0,x:0,y:0,wrap:xe,fullyVisible:!1}),ye=[],re=[],Ie=g,Ue=a.reparseOverscaled?b:g;if(this._renderWorldCopies)for(let xe=1;xe<=3;xe++)ye.push(ce(-xe)),ye.push(ce(xe));for(ye.push(ce(0));ye.length>0;){const xe=ye.pop(),De=xe.x,qe=xe.y;let He=xe.fullyVisible;if(!He){const dt=xe.aabb.intersects(q);if(dt===0)continue;He=dt===2}const $e=a.terrain?z:j,it=xe.aabb.distanceX($e),tt=xe.aabb.distanceY($e),ct=Math.max(Math.abs(it),Math.abs(tt));if(xe.zoom===Ie||ct>he+(1<=$){const dt=Ie-xe.zoom,gn=z[0]-.5-(De<>1),en=xe.zoom+1;let _n=xe.aabb.quadrant(dt);if(a.terrain){const Fn=new l.Q(en,xe.wrap,en,gn,_t),on=a.terrain.getMinMaxElevation(Fn),bn=(f=on.minElevation)!==null&&f!==void 0?f:this.elevation,Cn=(m=on.maxElevation)!==null&&m!==void 0?m:this.elevation;_n=new fl([_n.min[0],_n.min[1],bn],[_n.max[0],_n.max[1],Cn])}ye.push({aabb:_n,zoom:en,x:gn,y:_t,wrap:xe.wrap,fullyVisible:He})}}return re.sort((xe,De)=>xe.distanceSq-De.distanceSq).map(xe=>xe.tileID)}resize(a,f){this.width=a,this.height=f,this.pixelsToGLUnits=[2/a,-2/f],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(a){return Math.pow(2,a)}scaleZoom(a){return Math.log(a)/Math.LN2}project(a){const f=l.ac(a.lat,-85.051129,Bp);return new l.P(l.N(a.lng)*this.worldSize,l.O(f)*this.worldSize)}unproject(a){return new l.Y(a.x/this.worldSize,a.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(a){const f=this.elevation,m=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,g=this.pointLocation(this.centerPoint,a),b=a.getElevationForLngLatZoom(g,this.tileZoom);if(!(this.elevation-b))return;const T=m+f-b,L=Math.cos(this._pitch)*this.cameraToCenterDistance/T/l.b3(1,g.lat),k=this.scaleZoom(L/this.tileSize);this._elevation=b,this._center=g,this.zoom=k}setLocationAtPoint(a,f){const m=this.pointCoordinate(f),g=this.pointCoordinate(this.centerPoint),b=this.locationCoordinate(a),T=new l.Y(b.x-(m.x-g.x),b.y-(m.y-g.y));this.center=this.coordinateLocation(T),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(a,f){return f?this.coordinatePoint(this.locationCoordinate(a),f.getElevationForLngLatZoom(a,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(a))}pointLocation(a,f){return this.coordinateLocation(this.pointCoordinate(a,f))}locationCoordinate(a){return l.Y.fromLngLat(a)}coordinateLocation(a){return a&&a.toLngLat()}pointCoordinate(a,f){if(f){const $=f.pointCoordinate(a);if($!=null)return $}const m=[a.x,a.y,0,1],g=[a.x,a.y,1,1];l.af(m,m,this.pixelMatrixInverse),l.af(g,g,this.pixelMatrixInverse);const b=m[3],T=g[3],L=m[1]/b,k=g[1]/T,z=m[2]/b,j=g[2]/T,q=z===j?0:(0-z)/(j-z);return new l.Y(l.z.number(m[0]/b,g[0]/T,q)/this.worldSize,l.z.number(L,k,q)/this.worldSize)}coordinatePoint(a,f=0,m=this.pixelMatrix){const g=[a.x*this.worldSize,a.y*this.worldSize,f,1];return l.af(g,g,m),new l.P(g[0]/g[3],g[1]/g[3])}getBounds(){const a=Math.max(0,this.height/2-this.getHorizon());return new rt().extend(this.pointLocation(new l.P(0,a))).extend(this.pointLocation(new l.P(this.width,a))).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 rt([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(a){a?(this.lngRange=[a.getWest(),a.getEast()],this.latRange=[a.getSouth(),a.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Bp])}calculatePosMatrix(a,f=!1){const m=a.key,g=f?this._alignedPosMatrixCache:this._posMatrixCache;if(g[m])return g[m];const b=a.canonical,T=this.worldSize/this.zoomScale(b.z),L=b.x+Math.pow(2,b.z)*a.wrap,k=l.an(new Float64Array(16));return l.H(k,k,[L*T,b.y*T,0]),l.J(k,k,[T/l.W,T/l.W,1]),l.K(k,f?this.alignedProjMatrix:this.projMatrix,k),g[m]=new Float32Array(k),g[m]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(a,f){f=l.ac(+f,this.minZoom,this.maxZoom);const m={center:new l.M(a.lng,a.lat),zoom:f};let g=this.lngRange;if(!this._renderWorldCopies&&g===null){const xe=179.9999999999;g=[-xe,xe]}const b=this.tileSize*this.zoomScale(m.zoom);let T=0,L=b,k=0,z=b,j=0,q=0;const{x:$,y:he}=this.size;if(this.latRange){const xe=this.latRange;T=l.O(xe[1])*b,L=l.O(xe[0])*b,L-TL&&(Ie=L-xe)}if(g){const xe=(k+z)/2;let De=ce;this._renderWorldCopies&&(De=l.b1(ce,xe-b/2,xe+b/2));const qe=$/2;De-qez&&(re=z-qe)}if(re!==void 0||Ie!==void 0){const xe=new l.P(re??ce,Ie??ye);m.center=this.unproject.call({worldSize:b},xe).wrap()}return m}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const a=this._unmodified,{center:f,zoom:m}=this.getConstrained(this.center,this.zoom);this.center=f,this.zoom=m,this._unmodified=a,this._constraining=!1}_calcMatrices(){if(!this.height)return;const a=this.centerOffset,f=this.point.x,m=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=l.b3(1,this.center.lat)*this.worldSize;let g=l.an(new Float64Array(16));l.J(g,g,[this.width/2,-this.height/2,1]),l.H(g,g,[1,-1,0]),this.labelPlaneMatrix=g,g=l.an(new Float64Array(16)),l.J(g,g,[1,-1,1]),l.H(g,g,[-1,-1,0]),l.J(g,g,[2/this.width,2/this.height,1]),this.glCoordMatrix=g;const b=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),T=Math.min(this.elevation,this.minElevationForCurrentTile),L=b-T*this._pixelPerMeter/Math.cos(this._pitch),k=T<0?L:b,z=Math.PI/2+this._pitch,j=this._fov*(.5+a.y/this.height),q=Math.sin(j)*k/Math.sin(l.ac(Math.PI-z-j,.01,Math.PI-.01)),$=this.getHorizon(),he=2*Math.atan($/this.cameraToCenterDistance)*(.5+a.y/(2*$)),ce=Math.sin(he)*k/Math.sin(l.ac(Math.PI-z-he,.01,Math.PI-.01)),ye=Math.min(q,ce),re=1.01*(Math.cos(Math.PI/2-this._pitch)*ye+k),Ie=this.height/50;g=new Float64Array(16),l.b4(g,this._fov,this.width/this.height,Ie,re),g[8]=2*-a.x/this.width,g[9]=2*a.y/this.height,l.J(g,g,[1,-1,1]),l.H(g,g,[0,0,-this.cameraToCenterDistance]),l.b5(g,g,this._pitch),l.ad(g,g,this.angle),l.H(g,g,[-f,-m,0]),this.mercatorMatrix=l.J([],g,[this.worldSize,this.worldSize,this.worldSize]),l.J(g,g,[1,1,this._pixelPerMeter]),this.pixelMatrix=l.K(new Float64Array(16),this.labelPlaneMatrix,g),l.H(g,g,[0,0,-this.elevation]),this.projMatrix=g,this.invProjMatrix=l.ar([],g),this.pixelMatrix3D=l.K(new Float64Array(16),this.labelPlaneMatrix,g);const Ue=this.width%2/2,xe=this.height%2/2,De=Math.cos(this.angle),qe=Math.sin(this.angle),He=f-Math.round(f)+De*Ue+qe*xe,$e=m-Math.round(m)+De*xe+qe*Ue,it=new Float64Array(g);if(l.H(it,it,[He>.5?He-1:He,$e>.5?$e-1:$e,0]),this.alignedProjMatrix=it,g=l.ar(new Float64Array(16),this.pixelMatrix),!g)throw new Error("failed to invert matrix");this.pixelMatrixInverse=g,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const a=this.pointCoordinate(new l.P(0,0)),f=[a.x*this.worldSize,a.y*this.worldSize,0,1];return l.af(f,f,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const a=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.P(0,a))}getCameraQueryGeometry(a){const f=this.getCameraPoint();if(a.length===1)return[a[0],f];{let m=f.x,g=f.y,b=f.x,T=f.y;for(const L of a)m=Math.min(m,L.x),g=Math.min(g,L.y),b=Math.max(b,L.x),T=Math.max(T,L.y);return[new l.P(m,g),new l.P(b,g),new l.P(b,T),new l.P(m,T),new l.P(m,g)]}}lngLatToCameraDepth(a,f){const m=this.locationCoordinate(a),g=[m.x*this.worldSize,m.y*this.worldSize,f,1];return l.af(g,g,this.projMatrix),g[2]/g[3]}}function Vp(v,a){let f,m=!1,g=null,b=null;const T=()=>{g=null,m&&(v.apply(b,f),g=setTimeout(T,a),m=!1)};return(...L)=>(m=!0,b=this,f=L,g||T(),g)}class Up{constructor(a){this._getCurrentHash=()=>{const f=window.location.hash.replace("#","");if(this._hashName){let m;return f.split("&").map(g=>g.split("=")).forEach(g=>{g[0]===this._hashName&&(m=g)}),(m&&m[1]||"").split("/")}return f.split("/")},this._onHashChange=()=>{const f=this._getCurrentHash();if(f.length>=3&&!f.some(m=>isNaN(m))){const m=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(f[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+f[2],+f[1]],zoom:+f[0],bearing:m,pitch:+(f[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const f=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,f)}catch{}},this._updateHash=Vp(this._updateHashUnthrottled,300),this._hashName=a&&encodeURIComponent(a)}addTo(a){return this._map=a,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(a){const f=this._map.getCenter(),m=Math.round(100*this._map.getZoom())/100,g=Math.ceil((m*Math.LN2+Math.log(512/360/.5))/Math.LN10),b=Math.pow(10,g),T=Math.round(f.lng*b)/b,L=Math.round(f.lat*b)/b,k=this._map.getBearing(),z=this._map.getPitch();let j="";if(j+=a?`/${T}/${L}/${m}`:`${m}/${L}/${T}`,(k||z)&&(j+="/"+Math.round(10*k)/10),z&&(j+=`/${Math.round(z)}`),this._hashName){const q=this._hashName;let $=!1;const he=window.location.hash.slice(1).split("&").map(ce=>{const ye=ce.split("=")[0];return ye===q?($=!0,`${ye}=${j}`):ce}).filter(ce=>ce);return $||he.push(`${q}=${j}`),`#${he.join("&")}`}return`#${j}`}}const Mc={linearity:.3,easing:l.b6(0,0,.3,1)},Xl=l.e({deceleration:2500,maxSpeed:1400},Mc),ng=l.e({deceleration:20,maxSpeed:1400},Mc),rg=l.e({deceleration:1e3,maxSpeed:360},Mc),ig=l.e({deceleration:1e3,maxSpeed:90},Mc);class og{constructor(a){this._map=a,this.clear()}clear(){this._inertiaBuffer=[]}record(a){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:E.now(),settings:a})}_drainInertiaBuffer(){const a=this._inertiaBuffer,f=E.now();for(;a.length>0&&f-a[0].time>160;)a.shift()}_onMoveEnd(a){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const f={zoom:0,bearing:0,pitch:0,pan:new l.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:b}of this._inertiaBuffer)f.zoom+=b.zoomDelta||0,f.bearing+=b.bearingDelta||0,f.pitch+=b.pitchDelta||0,b.panDelta&&f.pan._add(b.panDelta),b.around&&(f.around=b.around),b.pinchAround&&(f.pinchAround=b.pinchAround);const m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,g={};if(f.pan.mag()){const b=Ac(f.pan.mag(),m,l.e({},Xl,a||{}));g.offset=f.pan.mult(b.amount/f.pan.mag()),g.center=this._map.transform.center,kc(g,b)}if(f.zoom){const b=Ac(f.zoom,m,ng);g.zoom=this._map.transform.zoom+b.amount,kc(g,b)}if(f.bearing){const b=Ac(f.bearing,m,rg);g.bearing=this._map.transform.bearing+l.ac(b.amount,-179,179),kc(g,b)}if(f.pitch){const b=Ac(f.pitch,m,ig);g.pitch=this._map.transform.pitch+b.amount,kc(g,b)}if(g.zoom||g.bearing){const b=f.pinchAround===void 0?f.around:f.pinchAround;g.around=b?this._map.unproject(b):this._map.getCenter()}return this.clear(),l.e(g,{noMoveStart:!0})}}function kc(v,a){(!v.duration||v.durationf.unproject(k)),L=b.reduce((k,z,j,q)=>k.add(z.div(q.length)),new l.P(0,0));super(a,{points:b,point:L,lngLats:T,lngLat:f.unproject(L),originalEvent:m}),this._defaultPrevented=!1}}class jp extends l.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(a,f,m){super(a,{originalEvent:m}),this._defaultPrevented=!1}}class Ms{constructor(a,f){this._map=a,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(a){return this._firePreventable(new jp(a.type,this._map,a))}mousedown(a,f){return this._mousedownPos=f,this._firePreventable(new Po(a.type,this._map,a))}mouseup(a){this._map.fire(new Po(a.type,this._map,a))}click(a,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||this._map.fire(new Po(a.type,this._map,a))}dblclick(a){return this._firePreventable(new Po(a.type,this._map,a))}mouseover(a){this._map.fire(new Po(a.type,this._map,a))}mouseout(a){this._map.fire(new Po(a.type,this._map,a))}touchstart(a){return this._firePreventable(new ta(a.type,this._map,a))}touchmove(a){this._map.fire(new ta(a.type,this._map,a))}touchend(a){this._map.fire(new ta(a.type,this._map,a))}touchcancel(a){this._map.fire(new ta(a.type,this._map,a))}_firePreventable(a){if(this._map.fire(a),a.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class na{constructor(a){this._map=a}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(a){this._map.fire(new Po(a.type,this._map,a))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Po("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(a){this._delayContextMenu?this._contextMenuEvent=a:this._ignoreContextMenu||this._map.fire(new Po(a.type,this._map,a)),this._map.listens("contextmenu")&&a.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Du{constructor(a){this._map=a}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(a){return this.transform.pointLocation(l.P.convert(a),this._map.terrain)}}class ks{constructor(a,f){this._map=a,this._tr=new Du(a),this._el=a.getCanvasContainer(),this._container=a.getContainer(),this._clickTolerance=f.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(a,f){this.isEnabled()&&a.shiftKey&&a.button===0&&(C.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(a,f){if(!this._active)return;const m=f;if(this._lastPos.equals(m)||!this._box&&m.dist(this._startPos)b.fitScreenCoordinates(m,g,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",a)}keydown(a){this._active&&a.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",a))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(C.remove(this._box),this._box=null),C.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(a,f){return this._map.fire(new l.k(a,{originalEvent:f}))}}function Yl(v,a){if(v.length!==a.length)throw new Error(`The number of touches and points are not equal - touches ${v.length}, points ${a.length}`);const f={};for(let m=0;mthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=a.timeStamp),m.length===this.numTouches&&(this.centroid=function(g){const b=new l.P(0,0);for(const T of g)b._add(T);return b.div(g.length)}(f),this.touches=Yl(m,f)))}touchmove(a,f,m){if(this.aborted||!this.centroid)return;const g=Yl(m,f);for(const b in this.touches){const T=g[b];(!T||T.dist(this.touches[b])>30)&&(this.aborted=!0)}}touchend(a,f,m){if((!this.centroid||a.timeStamp-this.startTime>500)&&(this.aborted=!0),m.length===0){const g=!this.aborted&&this.centroid;if(this.reset(),g)return g}}}class Gp{constructor(a){this.singleTap=new jy(a),this.numTaps=a.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(a,f,m){this.singleTap.touchstart(a,f,m)}touchmove(a,f,m){this.singleTap.touchmove(a,f,m)}touchend(a,f,m){const g=this.singleTap.touchend(a,f,m);if(g){const b=a.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(g)<30;if(b&&T||this.reset(),this.count++,this.lastTime=a.timeStamp,this.lastTap=g,this.count===this.numTaps)return this.reset(),g}}}class Gy{constructor(a){this._tr=new Du(a),this._zoomIn=new Gp({numTouches:1,numTaps:2}),this._zoomOut=new Gp({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(a,f,m){this._zoomIn.touchstart(a,f,m),this._zoomOut.touchstart(a,f,m)}touchmove(a,f,m){this._zoomIn.touchmove(a,f,m),this._zoomOut.touchmove(a,f,m)}touchend(a,f,m){const g=this._zoomIn.touchend(a,f,m),b=this._zoomOut.touchend(a,f,m),T=this._tr;return g?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:T.zoom+1,around:T.unproject(g)},{originalEvent:a})}):b?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:L=>L.easeTo({duration:300,zoom:T.zoom-1,around:T.unproject(b)},{originalEvent:a})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ru{constructor(a){this._enabled=!!a.enable,this._moveStateManager=a.moveStateManager,this._clickTolerance=a.clickTolerance||1,this._moveFunction=a.move,this._activateOnStart=!!a.activateOnStart,a.assignEvents(this),this.reset()}reset(a){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(a)}_move(...a){const f=this._moveFunction(...a);if(f.bearingDelta||f.pitchDelta||f.around||f.panDelta)return this._active=!0,f}dragStart(a,f){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(a)&&(this._moveStateManager.startMove(a),this._lastPoint=f.length?f[0]:f,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(a,f){if(!this.isEnabled())return;const m=this._lastPoint;if(!m)return;if(a.preventDefault(),!this._moveStateManager.isValidMoveEvent(a))return void this.reset(a);const g=f.length?f[0]:f;return!this._moved&&g.dist(m){v.mousedown=v.dragStart,v.mousemoveWindow=v.dragMove,v.mouseup=v.dragEnd,v.contextmenu=function(a){a.preventDefault()}},Nu=({enable:v,clickTolerance:a,bearingDegreesPerPixelMoved:f=.8})=>{const m=new ra({checkCorrectEvent:g=>C.mouseButton(g)===0&&g.ctrlKey||C.mouseButton(g)===2});return new Ru({clickTolerance:a,move:(g,b)=>({bearingDelta:(b.x-g.x)*f}),moveStateManager:m,enable:v,assignEvents:Hh})},Ou=({enable:v,clickTolerance:a,pitchDegreesPerPixelMoved:f=-.5})=>{const m=new ra({checkCorrectEvent:g=>C.mouseButton(g)===0&&g.ctrlKey||C.mouseButton(g)===2});return new Ru({clickTolerance:a,move:(g,b)=>({pitchDelta:(b.y-g.y)*f}),moveStateManager:m,enable:v,assignEvents:Hh})};class sg{constructor(a,f){this._clickTolerance=a.clickTolerance||1,this._map=f,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new l.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(a,f,m){return this._calculateTransform(a,f,m)}touchmove(a,f,m){if(this._active&&!(m.length0&&(this._active=!0);const g=Yl(m,f),b=new l.P(0,0),T=new l.P(0,0);let L=0;for(const z in g){const j=g[z],q=this._touches[z];q&&(b._add(j),T._add(j.sub(q)),L++,g[z]=j)}if(this._touches=g,LMath.abs(v.x)}class ug extends Et{constructor(a){super(),this._currentTouchCount=0,this._map=a}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(a,f,m){super.touchstart(a,f,m),this._currentTouchCount=m.length}_start(a){this._lastPoints=a,Xh(a[0].sub(a[1]))&&(this._valid=!1)}_move(a,f,m){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const g=a[0].sub(this._lastPoints[0]),b=a[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(g,b,m.timeStamp),this._valid?(this._lastPoints=a,this._active=!0,{pitchDelta:(g.y+b.y)/2*-.5}):void 0}gestureBeginsVertically(a,f,m){if(this._valid!==void 0)return this._valid;const g=a.mag()>=2,b=f.mag()>=2;if(!g&&!b)return;if(!g||!b)return this._firstMove===void 0&&(this._firstMove=m),m-this._firstMove<100&&void 0;const T=a.y>0==f.y>0;return Xh(a)&&Xh(f)&&T}}const qy={panStep:100,bearingStep:15,pitchStep:10};class pl{constructor(a){this._tr=new Du(a);const f=qy;this._panStep=f.panStep,this._bearingStep=f.bearingStep,this._pitchStep=f.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(a){if(a.altKey||a.ctrlKey||a.metaKey)return;let f=0,m=0,g=0,b=0,T=0;switch(a.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:a.shiftKey?m=-1:(a.preventDefault(),b=-1);break;case 39:a.shiftKey?m=1:(a.preventDefault(),b=1);break;case 38:a.shiftKey?g=1:(a.preventDefault(),T=-1);break;case 40:a.shiftKey?g=-1:(a.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(m=0,g=0),{cameraAnimation:L=>{const k=this._tr;L.easeTo({duration:300,easeId:"keyboardHandler",easing:Er,zoom:f?Math.round(k.zoom)+f*(a.shiftKey?2:1):k.zoom,bearing:k.bearing+m*this._bearingStep,pitch:k.pitch+g*this._pitchStep,offset:[-b*this._panStep,-T*this._panStep],center:k.center},{originalEvent:a})}}}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 Er(v){return v*(2-v)}const Rc=4.000244140625;class Yh{constructor(a,f){this._onTimeout=m=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(m)},this._map=a,this._tr=new Du(a),this._triggerRenderFrame=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(a){this._defaultZoomRate=a}setWheelZoomRate(a){this._wheelZoomRate=a}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(a){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!a&&a.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(a){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!a[this._map.cooperativeGestures._bypassKey])return;let f=a.deltaMode===WheelEvent.DOM_DELTA_LINE?40*a.deltaY:a.deltaY;const m=E.now(),g=m-(this._lastWheelEventTime||0);this._lastWheelEventTime=m,f!==0&&f%Rc==0?this._type="wheel":f!==0&&Math.abs(f)<4?this._type="trackpad":g>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,a)):this._type||(this._type=Math.abs(g*f)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),a.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=a,this._delta-=f,this._active||this._start(a)),a.preventDefault()}_start(a){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 f=C.mousePos(this._map.getCanvas(),a),m=this._tr;this._around=f.y>m.transform.height/2-m.transform.getHorizon()?l.M.convert(this._aroundCenter?m.center:m.unproject(f)):l.M.convert(m.center),this._aroundPoint=m.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const a=this._tr.transform;if(this._delta!==0){const L=this._type==="wheel"&&Math.abs(this._delta)>Rc?this._wheelZoomRate:this._defaultZoomRate;let k=2/(1+Math.exp(-Math.abs(this._delta*L)));this._delta<0&&k!==0&&(k=1/k);const z=typeof this._targetZoom=="number"?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(z*k))),this._type==="wheel"&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const f=typeof this._targetZoom=="number"?this._targetZoom:a.zoom,m=this._startZoom,g=this._easing;let b,T=!1;if(this._type==="wheel"&&m&&g){const L=Math.min((E.now()-this._lastWheelEventTime)/200,1),k=g(L);b=l.z.number(m,f,k),L<1?this._frameId||(this._frameId=!0):T=!0}else b=f,T=!0;return this._active=!0,T&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!T,zoomDelta:b-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(a){let f=l.b7;if(this._prevEase){const m=this._prevEase,g=(E.now()-m.start)/m.duration,b=m.easing(g+.01)-m.easing(g),T=.27/Math.sqrt(b*b+1e-4)*.01,L=Math.sqrt(.0729-T*T);f=l.b6(T,L,.25,1)}return this._prevEase={start:E.now(),duration:a,easing:f},f}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Wp{constructor(a,f){this._clickZoom=a,this._tapZoom=f}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 cg{constructor(a){this._tr=new Du(a),this.reset()}reset(){this._active=!1}dblclick(a,f){return a.preventDefault(),{cameraAnimation:m=>{m.easeTo({duration:300,zoom:this._tr.zoom+(a.shiftKey?-1:1),around:this._tr.unproject(f)},{originalEvent:a})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hg{constructor(){this._tap=new Gp({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(a,f,m){if(!this._swipePoint)if(this._tapTime){const g=f[0],b=a.timeStamp-this._tapTime<500,T=this._tapPoint.dist(g)<30;b&&T?m.length>0&&(this._swipePoint=g,this._swipeTouch=m[0].identifier):this.reset()}else this._tap.touchstart(a,f,m)}touchmove(a,f,m){if(this._tapTime){if(this._swipePoint){if(m[0].identifier!==this._swipeTouch)return;const g=f[0],b=g.y-this._swipePoint.y;return this._swipePoint=g,a.preventDefault(),this._active=!0,{zoomDelta:b/128}}}else this._tap.touchmove(a,f,m)}touchend(a,f,m){if(this._tapTime)this._swipePoint&&m.length===0&&this.reset();else{const g=this._tap.touchend(a,f,m);g&&(this._tapTime=a.timeStamp,this._tapPoint=g)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fg{constructor(a,f,m){this._el=a,this._mousePan=f,this._touchPan=m}enable(a){this._inertiaOptions=a||{},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 As{constructor(a,f,m){this._pitchWithRotate=a.pitchWithRotate,this._mouseRotate=f,this._mousePitch=m}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 Nc{constructor(a,f,m,g){this._el=a,this._touchZoom=f,this._touchRotate=m,this._tapDragZoom=g,this._rotationDisabled=!1,this._enabled=!0}enable(a){this._touchZoom.enable(a),this._rotationDisabled||this._touchRotate.enable(a),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class jt{constructor(a,f){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=a,this._options=f,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const a=this._map.getCanvasContainer();a.classList.add("maplibregl-cooperative-gestures"),this._container=C.create("div","maplibregl-cooperative-gesture-screen",a);let f=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(f=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const m=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),g=document.createElement("div");g.className="maplibregl-desktop-message",g.textContent=f,this._container.appendChild(g);const b=document.createElement("div");b.className="maplibregl-mobile-message",b.textContent=m,this._container.appendChild(b),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(C.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(a){this._onCooperativeGesture(a.touches.length===1)}wheel(a){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!a[this._bypassKey])}_onCooperativeGesture(a){this._enabled&&a&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const $t=v=>v.zoom||v.drag||v.pitch||v.rotate;class $h extends l.k{}function Oc(v){return v.panDelta&&v.panDelta.mag()||v.zoomDelta||v.bearingDelta||v.pitchDelta}class Hp{constructor(a,f){this.handleWindowEvent=g=>{this.handleEvent(g,`${g.type}Window`)},this.handleEvent=(g,b)=>{if(g.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const T=g.type==="renderFrame"?void 0:g,L={needsRenderFrame:!1},k={},z={},j=g.touches,q=j?this._getMapTouches(j):void 0,$=q?C.touchPos(this._map.getCanvas(),q):C.mousePos(this._map.getCanvas(),g);for(const{handlerName:ye,handler:re,allowed:Ie}of this._handlers){if(!re.isEnabled())continue;let Ue;this._blockedByActive(z,Ie,ye)?re.reset():re[b||g.type]&&(Ue=re[b||g.type](g,$,q),this.mergeHandlerResult(L,k,Ue,ye,T),Ue&&Ue.needsRenderFrame&&this._triggerRenderFrame()),(Ue||re.isActive())&&(z[ye]=re)}const he={};for(const ye in this._previousActiveHandlers)z[ye]||(he[ye]=T);this._previousActiveHandlers=z,(Object.keys(he).length||Oc(L))&&(this._changes.push([L,k,he]),this._triggerRenderFrame()),(Object.keys(z).length||Oc(L))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ce}=L;ce&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ce(this._map))},this._map=a,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new og(a),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(f);const m=this._el;this._listeners=[[m,"touchstart",{passive:!0}],[m,"touchmove",{passive:!1}],[m,"touchend",void 0],[m,"touchcancel",void 0],[m,"mousedown",void 0],[m,"mousemove",void 0],[m,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[m,"mouseover",void 0],[m,"mouseout",void 0],[m,"dblclick",void 0],[m,"click",void 0],[m,"keydown",{capture:!1}],[m,"keyup",void 0],[m,"wheel",{passive:!1}],[m,"contextmenu",void 0],[window,"blur",void 0]];for(const[g,b,T]of this._listeners)C.addEventListener(g,b,g===document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[a,f,m]of this._listeners)C.removeEventListener(a,f,a===document?this.handleWindowEvent:this.handleEvent,m)}_addDefaultHandlers(a){const f=this._map,m=f.getCanvasContainer();this._add("mapEvent",new Ms(f,a));const g=f.boxZoom=new ks(f,a);this._add("boxZoom",g),a.interactive&&a.boxZoom&&g.enable();const b=f.cooperativeGestures=new jt(f,a.cooperativeGestures);this._add("cooperativeGestures",b),a.cooperativeGestures&&b.enable();const T=new Gy(f),L=new cg(f);f.doubleClickZoom=new Wp(L,T),this._add("tapZoom",T),this._add("clickZoom",L),a.interactive&&a.doubleClickZoom&&f.doubleClickZoom.enable();const k=new hg;this._add("tapDragZoom",k);const z=f.touchPitch=new ug(f);this._add("touchPitch",z),a.interactive&&a.touchPitch&&f.touchPitch.enable(a.touchPitch);const j=Nu(a),q=Ou(a);f.dragRotate=new As(a,j,q),this._add("mouseRotate",j,["mousePitch"]),this._add("mousePitch",q,["mouseRotate"]),a.interactive&&a.dragRotate&&f.dragRotate.enable();const $=(({enable:Ue,clickTolerance:xe})=>{const De=new ra({checkCorrectEvent:qe=>C.mouseButton(qe)===0&&!qe.ctrlKey});return new Ru({clickTolerance:xe,move:(qe,He)=>({around:He,panDelta:He.sub(qe)}),activateOnStart:!0,moveStateManager:De,enable:Ue,assignEvents:Hh})})(a),he=new sg(a,f);f.dragPan=new fg(m,$,he),this._add("mousePan",$),this._add("touchPan",he,["touchZoom","touchRotate"]),a.interactive&&a.dragPan&&f.dragPan.enable(a.dragPan);const ce=new qp,ye=new lg;f.touchZoomRotate=new Nc(m,ye,ce,k),this._add("touchRotate",ce,["touchPan","touchZoom"]),this._add("touchZoom",ye,["touchPan","touchRotate"]),a.interactive&&a.touchZoomRotate&&f.touchZoomRotate.enable(a.touchZoomRotate);const re=f.scrollZoom=new Yh(f,()=>this._triggerRenderFrame());this._add("scrollZoom",re,["mousePan"]),a.interactive&&a.scrollZoom&&f.scrollZoom.enable(a.scrollZoom);const Ie=f.keyboard=new pl(f);this._add("keyboard",Ie),a.interactive&&a.keyboard&&f.keyboard.enable(),this._add("blockableMapEvent",new na(f))}_add(a,f,m){this._handlers.push({handlerName:a,handler:f,allowed:m}),this._handlersById[a]=f}stop(a){if(!this._updatingCamera){for(const{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},a),this._changes=[]}}isActive(){for(const{handler:a}of this._handlers)if(a.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$t(this._eventsInProgress)||this.isZooming()}_blockedByActive(a,f,m){for(const g in a)if(g!==m&&(!f||f.indexOf(g)<0))return!0;return!1}_getMapTouches(a){const f=[];for(const m of a)this._el.contains(m.target)&&f.push(m);return f}mergeHandlerResult(a,f,m,g,b){if(!m)return;l.e(a,m);const T={handlerName:g,originalEvent:m.originalEvent||b};m.zoomDelta!==void 0&&(f.zoom=T),m.panDelta!==void 0&&(f.drag=T),m.pitchDelta!==void 0&&(f.pitch=T),m.bearingDelta!==void 0&&(f.rotate=T)}_applyChanges(){const a={},f={},m={};for(const[g,b,T]of this._changes)g.panDelta&&(a.panDelta=(a.panDelta||new l.P(0,0))._add(g.panDelta)),g.zoomDelta&&(a.zoomDelta=(a.zoomDelta||0)+g.zoomDelta),g.bearingDelta&&(a.bearingDelta=(a.bearingDelta||0)+g.bearingDelta),g.pitchDelta&&(a.pitchDelta=(a.pitchDelta||0)+g.pitchDelta),g.around!==void 0&&(a.around=g.around),g.pinchAround!==void 0&&(a.pinchAround=g.pinchAround),g.noInertia&&(a.noInertia=g.noInertia),l.e(f,b),l.e(m,T);this._updateMapTransform(a,f,m),this._changes=[]}_updateMapTransform(a,f,m){const g=this._map,b=g._getTransformForUpdate(),T=g.terrain;if(!(Oc(a)||T&&this._terrainMovement))return this._fireEvents(f,m,!0);let{panDelta:L,zoomDelta:k,bearingDelta:z,pitchDelta:j,around:q,pinchAround:$}=a;$!==void 0&&(q=$),g._stop(!0),q=q||g.transform.centerPoint;const he=b.pointLocation(L?q.sub(L):q);z&&(b.bearing+=z),j&&(b.pitch+=j),k&&(b.zoom+=k),T?this._terrainMovement||!f.drag&&!f.zoom?f.drag&&this._terrainMovement?b.center=b.pointLocation(b.centerPoint.sub(L)):b.setLocationAtPoint(he,q):(this._terrainMovement=!0,this._map._elevationFreeze=!0,b.setLocationAtPoint(he,q),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,b.recalculateZoom(g.terrain)})):b.setLocationAtPoint(he,q),g._applyUpdatedTransform(b),this._map._update(),a.noInertia||this._inertia.record(a),this._fireEvents(f,m,!0)}_fireEvents(a,f,m){const g=$t(this._eventsInProgress),b=$t(a),T={};for(const j in a){const{originalEvent:q}=a[j];this._eventsInProgress[j]||(T[`${j}start`]=q),this._eventsInProgress[j]=a[j]}!g&&b&&this._fireEvent("movestart",b.originalEvent);for(const j in T)this._fireEvent(j,T[j]);b&&this._fireEvent("move",b.originalEvent);for(const j in a){const{originalEvent:q}=a[j];this._fireEvent(j,q)}const L={};let k;for(const j in this._eventsInProgress){const{handlerName:q,originalEvent:$}=this._eventsInProgress[j];this._handlersById[q].isActive()||(delete this._eventsInProgress[j],k=f[q]||$,L[`${j}end`]=k)}for(const j in L)this._fireEvent(j,L[j]);const z=$t(this._eventsInProgress);if(m&&(g||b)&&!z){this._updatingCamera=!0;const j=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),q=$=>$!==0&&-this._bearingSnap<$&&${delete this._frameId,this.handleEvent(new $h("renderFrame",{timeStamp:a})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Mo extends l.E{constructor(a,f){super(),this._renderFrameCallback=()=>{const m=Math.min((E.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(m)),m<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=a,this._bearingSnap=f.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new l.M(this.transform.center.lng,this.transform.center.lat)}setCenter(a,f){return this.jumpTo({center:a},f)}panBy(a,f,m){return a=l.P.convert(a).mult(-1),this.panTo(this.transform.center,l.e({offset:a},f),m)}panTo(a,f,m){return this.easeTo(l.e({center:a},f),m)}getZoom(){return this.transform.zoom}setZoom(a,f){return this.jumpTo({zoom:a},f),this}zoomTo(a,f,m){return this.easeTo(l.e({zoom:a},f),m)}zoomIn(a,f){return this.zoomTo(this.getZoom()+1,a,f),this}zoomOut(a,f){return this.zoomTo(this.getZoom()-1,a,f),this}getBearing(){return this.transform.bearing}setBearing(a,f){return this.jumpTo({bearing:a},f),this}getPadding(){return this.transform.padding}setPadding(a,f){return this.jumpTo({padding:a},f),this}rotateTo(a,f,m){return this.easeTo(l.e({bearing:a},f),m)}resetNorth(a,f){return this.rotateTo(0,l.e({duration:1e3},a),f),this}resetNorthPitch(a,f){return this.easeTo(l.e({bearing:0,pitch:0,duration:1e3},a),f),this}snapToNorth(a,f){return Math.abs(this.getBearing()){if(this._zooming&&(g.zoom=l.z.number(b,re,$e)),this._rotating&&(g.bearing=l.z.number(T,z,$e)),this._pitching&&(g.pitch=l.z.number(L,j,$e)),this._padding&&(g.interpolatePadding(k,q,$e),he=g.centerPoint.add($)),this.terrain&&!a.freezeElevation&&this._updateElevation($e),De)g.setLocationAtPoint(De,qe);else{const it=g.zoomScale(g.zoom-b),tt=re>b?Math.min(2,xe):Math.max(.5,xe),ct=Math.pow(tt,1-$e),dt=g.unproject(Ie.add(Ue.mult($e*ct)).mult(it));g.setLocationAtPoint(g.renderWorldCopies?dt.wrap():dt,he)}this._applyUpdatedTransform(g),this._fireMoveEvents(f)},$e=>{this.terrain&&this._finalizeElevation(),this._afterEase(f,$e)},a),this}_prepareEase(a,f,m={}){this._moving=!0,f||m.moving||this.fire(new l.k("movestart",a)),this._zooming&&!m.zooming&&this.fire(new l.k("zoomstart",a)),this._rotating&&!m.rotating&&this.fire(new l.k("rotatestart",a)),this._pitching&&!m.pitching&&this.fire(new l.k("pitchstart",a))}_prepareElevation(a){this._elevationCenter=a,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(a,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(a){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const f=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(a<1&&f!==this._elevationTarget){const m=this._elevationTarget-this._elevationStart;this._elevationStart+=a*(m-(f-(m*a+this._elevationStart))/(1-a)),this._elevationTarget=f}this.transform.elevation=l.z.number(this._elevationStart,this._elevationTarget,a)}_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(a){if(!this.transformCameraUpdate)return;const f=a.clone(),{center:m,zoom:g,pitch:b,bearing:T,elevation:L}=this.transformCameraUpdate(f);m&&(f.center=m),g!==void 0&&(f.zoom=g),b!==void 0&&(f.pitch=b),T!==void 0&&(f.bearing=T),L!==void 0&&(f.elevation=L),this.transform.apply(f)}_fireMoveEvents(a){this.fire(new l.k("move",a)),this._zooming&&this.fire(new l.k("zoom",a)),this._rotating&&this.fire(new l.k("rotate",a)),this._pitching&&this.fire(new l.k("pitch",a))}_afterEase(a,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId;const m=this._zooming,g=this._rotating,b=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,m&&this.fire(new l.k("zoomend",a)),g&&this.fire(new l.k("rotateend",a)),b&&this.fire(new l.k("pitchend",a)),this.fire(new l.k("moveend",a))}flyTo(a,f){var m;if(!a.essential&&E.prefersReducedMotion){const Fn=l.L(a,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Fn,f)}this.stop(),a=l.e({offset:[0,0],speed:1.2,curve:1.42,easing:l.b7},a);const g=this._getTransformForUpdate(),b=this.getZoom(),T=this.getBearing(),L=this.getPitch(),k=this.getPadding(),z="bearing"in a?this._normalizeBearing(a.bearing,T):T,j="pitch"in a?+a.pitch:L,q="padding"in a?a.padding:g.padding,$=l.P.convert(a.offset);let he=g.centerPoint.add($);const ce=g.pointLocation(he),{center:ye,zoom:re}=g.getConstrained(l.M.convert(a.center||ce),(m=a.zoom)!==null&&m!==void 0?m:b);this._normalizeCenter(ye);const Ie=g.zoomScale(re-b),Ue=g.project(ce),xe=g.project(ye).sub(Ue);let De=a.curve;const qe=Math.max(g.width,g.height),He=qe/Ie,$e=xe.mag();if("minZoom"in a){const Fn=l.ac(Math.min(a.minZoom,b,re),g.minZoom,g.maxZoom),on=qe/g.zoomScale(Fn-b);De=Math.sqrt(on/$e*2)}const it=De*De;function tt(Fn){const on=(He*He-qe*qe+(Fn?-1:1)*it*it*$e*$e)/(2*(Fn?He:qe)*it*$e);return Math.log(Math.sqrt(on*on+1)-on)}function ct(Fn){return(Math.exp(Fn)-Math.exp(-Fn))/2}function dt(Fn){return(Math.exp(Fn)+Math.exp(-Fn))/2}const gn=tt(!1);let _t=function(Fn){return dt(gn)/dt(gn+De*Fn)},en=function(Fn){return qe*((dt(gn)*(ct(on=gn+De*Fn)/dt(on))-ct(gn))/it)/$e;var on},_n=(tt(!0)-gn)/De;if(Math.abs($e)<1e-6||!isFinite(_n)){if(Math.abs(qe-He)<1e-6)return this.easeTo(a,f);const Fn=Hea.maxDuration&&(a.duration=0),this._zooming=!0,this._rotating=T!==z,this._pitching=j!==L,this._padding=!g.isPaddingEqual(q),this._prepareEase(f,!1),this.terrain&&this._prepareElevation(ye),this._ease(Fn=>{const on=Fn*_n,bn=1/_t(on);g.zoom=Fn===1?re:b+g.scaleZoom(bn),this._rotating&&(g.bearing=l.z.number(T,z,Fn)),this._pitching&&(g.pitch=l.z.number(L,j,Fn)),this._padding&&(g.interpolatePadding(k,q,Fn),he=g.centerPoint.add($)),this.terrain&&!a.freezeElevation&&this._updateElevation(Fn);const Cn=Fn===1?ye:g.unproject(Ue.add(xe.mult(en(on))).mult(bn));g.setLocationAtPoint(g.renderWorldCopies?Cn.wrap():Cn,he),this._applyUpdatedTransform(g),this._fireMoveEvents(f)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(f)},a),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(a,f){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,f)}if(!a){const m=this.handlers;m&&m.stop(!1)}return this}_ease(a,f,m){m.animate===!1||m.duration===0?(a(1),f()):(this._easeStart=E.now(),this._easeOptions=m,this._onEaseFrame=a,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(a,f){a=l.b1(a,-180,180);const m=Math.abs(a-f);return Math.abs(a-360-f)180?-360:m<-180?360:0}queryTerrainElevation(a){return this.terrain?this.terrain.getElevationForLngLatZoom(l.M.convert(a),this.transform.tileZoom)-this.transform.elevation:null}}const Zp={compact:!0,customAttribution:'MapLibre'};class Ds{constructor(a=Zp){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=f=>{!f||f.sourceDataType!=="metadata"&&f.sourceDataType!=="visibility"&&f.dataType!=="style"&&f.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=a}getDefaultPosition(){return"bottom-right"}onAdd(a){return this._map=a,this._compact=this.options.compact,this._container=C.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=C.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=C.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(){C.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(a,f){const m=this._map._getUIString(`AttributionControl.${f}`);a.title=m,a.setAttribute("aria-label",m)}_updateAttributions(){if(!this._map.style)return;let a=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?a=a.concat(this.options.customAttribution.map(g=>typeof g!="string"?"":g)):typeof this.options.customAttribution=="string"&&a.push(this.options.customAttribution)),this._map.style.stylesheet){const g=this._map.style.stylesheet;this.styleOwner=g.owner,this.styleId=g.id}const f=this._map.style.sourceCaches;for(const g in f){const b=f[g];if(b.used||b.usedForTerrain){const T=b.getSource();T.attribution&&a.indexOf(T.attribution)<0&&a.push(T.attribution)}}a=a.filter(g=>String(g).trim()),a.sort((g,b)=>g.length-b.length),a=a.filter((g,b)=>{for(let T=b+1;T=0)return!1;return!0});const m=a.join(" | ");m!==this._attribHTML&&(this._attribHTML=m,a.length?(this._innerContainer.innerHTML=m,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class pg{constructor(a={}){this._updateCompact=()=>{const f=this._container.children;if(f.length){const m=f[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&m.classList.add("maplibregl-compact"):m.classList.remove("maplibregl-compact")}},this.options=a}getDefaultPosition(){return"bottom-left"}onAdd(a){this._map=a,this._compact=this.options&&this.options.compact,this._container=C.create("div","maplibregl-ctrl");const f=C.create("a","maplibregl-ctrl-logo");return f.target="_blank",f.rel="noopener nofollow",f.href="https://maplibre.org/",f.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),f.setAttribute("rel","noopener nofollow"),this._container.appendChild(f),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){C.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class zc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(a){const f=++this._id;return this._queue.push({callback:a,id:f,cancelled:!1}),f}remove(a){const f=this._currentlyRunning,m=f?this._queue.concat(f):this._queue;for(const g of m)if(g.id===a)return void(g.cancelled=!0)}run(a=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const f=this._currentlyRunning=this._queue;this._queue=[];for(const m of f)if(!m.cancelled&&(m.callback(a),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Fr=l.X([{name:"a_pos3d",type:"Int16",components:3}]);class ei extends l.E{constructor(a){super(),this.sourceCache=a,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,a.usedForTerrain=!0,a.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(a,f){this.sourceCache.update(a,f),this._renderableTilesKeys=[];const m={};for(const g of a.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:f}))m[g.key]=!0,this._renderableTilesKeys.push(g.key),this._tiles[g.key]||(g.posMatrix=new Float64Array(16),l.aN(g.posMatrix,0,l.W,0,l.W,0,1),this._tiles[g.key]=new hs(g,this.tileSize));for(const g in this._tiles)m[g]||delete this._tiles[g]}freeRtt(a){for(const f in this._tiles){const m=this._tiles[f];(!a||m.tileID.equals(a)||m.tileID.isChildOf(a)||a.isChildOf(m.tileID))&&(m.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(a=>this.getTileByID(a))}getTileByID(a){return this._tiles[a]}getTerrainCoords(a){const f={};for(const m of this._renderableTilesKeys){const g=this._tiles[m].tileID;if(g.canonical.equals(a.canonical)){const b=a.clone();b.posMatrix=new Float64Array(16),l.aN(b.posMatrix,0,l.W,0,l.W,0,1),f[m]=b}else if(g.canonical.isChildOf(a.canonical)){const b=a.clone();b.posMatrix=new Float64Array(16);const T=g.canonical.z-a.canonical.z,L=g.canonical.x-(g.canonical.x>>T<>T<>T;l.aN(b.posMatrix,0,z,0,z,0,1),l.H(b.posMatrix,b.posMatrix,[-L*z,-k*z,0]),f[m]=b}else if(a.canonical.isChildOf(g.canonical)){const b=a.clone();b.posMatrix=new Float64Array(16);const T=a.canonical.z-g.canonical.z,L=a.canonical.x-(a.canonical.x>>T<>T<>T;l.aN(b.posMatrix,0,l.W,0,l.W,0,1),l.H(b.posMatrix,b.posMatrix,[L*z,k*z,0]),l.J(b.posMatrix,b.posMatrix,[1/2**T,1/2**T,0]),f[m]=b}}return f}getSourceTile(a,f){const m=this.sourceCache._source;let g=a.overscaledZ-this.deltaZoom;if(g>m.maxzoom&&(g=m.maxzoom),g=m.minzoom&&(!b||!b.dem);)b=this.sourceCache.getTileByID(a.scaledTo(g--).key);return b}tilesAfterTime(a=Date.now()){return Object.values(this._tiles).filter(f=>f.timeAdded>=a)}}class dg{constructor(a,f,m){this.painter=a,this.sourceCache=new ei(f),this.options=m,this.exaggeration=typeof m.exaggeration=="number"?m.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(a,f,m,g=l.W){var b;if(!(f>=0&&f=0&&ma.canonical.z&&(a.canonical.z>=g?b=a.canonical.z-g:l.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const T=a.canonical.x-(a.canonical.x>>b<>b<>8<<4|b>>8,f[T+3]=0;const m=new l.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(f.buffer)),g=new K(a,m,a.gl.RGBA,{premultiply:!1});return g.bind(a.gl.NEAREST,a.gl.CLAMP_TO_EDGE),this._coordsTexture=g,g}pointCoordinate(a){this.painter.maybeDrawDepthAndCoords(!0);const f=new Uint8Array(4),m=this.painter.context,g=m.gl,b=Math.round(a.x*this.painter.pixelRatio/devicePixelRatio),T=Math.round(a.y*this.painter.pixelRatio/devicePixelRatio),L=Math.round(this.painter.height/devicePixelRatio);m.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),g.readPixels(b,L-T-1,1,1,g.RGBA,g.UNSIGNED_BYTE,f),m.bindFramebuffer.set(null);const k=f[0]+(f[2]>>4<<8),z=f[1]+((15&f[2])<<8),j=this.coordsIndex[255-f[3]],q=j&&this.sourceCache.getTileByID(j);if(!q)return null;const $=this._coordsTextureSize,he=(1<a.id!==f),this._recentlyUsed.push(a.id)}stampObject(a){a.stamp=++this._stamp}getOrCreateFreeObject(){for(const f of this._recentlyUsed)if(!this._objects[f].inUse)return this._objects[f];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const a=this._createObject(this._objects.length);return this._objects.push(a),a}freeObject(a){a.inUse=!1}freeAllObjects(){for(const a of this._objects)this.freeObject(a)}isFull(){return!(this._objects.length!a.inUse)===!1}}const Fa={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Xp{constructor(a,f){this.painter=a,this.terrain=f,this.pool=new Fc(a.context,30,f.sourceCache.tileSize*f.qualityFactor)}destruct(){this.pool.destruct()}getTexture(a){return this.pool.getObjectForId(a.rtt[this._stacks.length-1].id).texture}prepareForRender(a,f){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=a._order.filter(m=>!a._layers[m].isHidden(f)),this._coordsDescendingInv={};for(const m in a.sourceCaches){this._coordsDescendingInv[m]={};const g=a.sourceCaches[m].getVisibleCoordinates();for(const b of g){const T=this.terrain.sourceCache.getTerrainCoords(b);for(const L in T)this._coordsDescendingInv[m][L]||(this._coordsDescendingInv[m][L]=[]),this._coordsDescendingInv[m][L].push(T[L])}}this._coordsDescendingInvStr={};for(const m of a._order){const g=a._layers[m],b=g.source;if(Fa[g.type]&&!this._coordsDescendingInvStr[b]){this._coordsDescendingInvStr[b]={};for(const T in this._coordsDescendingInv[b])this._coordsDescendingInvStr[b][T]=this._coordsDescendingInv[b][T].map(L=>L.key).sort().join()}}for(const m of this._renderableTiles)for(const g in this._coordsDescendingInvStr){const b=this._coordsDescendingInvStr[g][m.tileID.key];b&&b!==m.rttCoords[g]&&(m.rtt=[])}}renderLayer(a){if(a.isHidden(this.painter.transform.zoom))return!1;const f=a.type,m=this.painter,g=this._renderableLayerIds[this._renderableLayerIds.length-1]===a.id;if(Fa[f]&&(this._prevType&&Fa[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(a.id),!g))return!0;if(Fa[this._prevType]||Fa[f]&&g){this._prevType=f;const b=this._stacks.length-1,T=this._stacks[b]||[];for(const L of this._renderableTiles){if(this.pool.isFull()&&(qh(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(L),L.rtt[b]){const z=this.pool.getObjectForId(L.rtt[b].id);if(z.stamp===L.rtt[b].stamp){this.pool.useObject(z);continue}}const k=this.pool.getOrCreateFreeObject();this.pool.useObject(k),this.pool.stampObject(k),L.rtt[b]={id:k.id,stamp:k.stamp},m.context.bindFramebuffer.set(k.fbo.framebuffer),m.context.clear({color:l.aO.transparent,stencil:0}),m.currentStencilSource=void 0;for(let z=0;z{v.touchstart=v.dragStart,v.touchmoveWindow=v.dragMove,v.touchend=v.dragEnd},Kp={showCompass:!0,showZoom:!0,visualizePitch:!1};class Jp{constructor(a,f,m=!1){this.mousedown=T=>{this.startMouse(l.e({},T,{ctrlKey:!0,preventDefault:()=>T.preventDefault()}),C.mousePos(this.element,T)),C.addEventListener(window,"mousemove",this.mousemove),C.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=T=>{this.moveMouse(T,C.mousePos(this.element,T))},this.mouseup=T=>{this.mouseRotate.dragEnd(T),this.mousePitch&&this.mousePitch.dragEnd(T),this.offTemp()},this.touchstart=T=>{T.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=C.touchPos(this.element,T.targetTouches)[0],this.startTouch(T,this._startPos),C.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),C.addEventListener(window,"touchend",this.touchend))},this.touchmove=T=>{T.targetTouches.length!==1?this.reset():(this._lastPos=C.touchPos(this.element,T.targetTouches)[0],this.moveTouch(T,this._lastPos))},this.touchend=T=>{T.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 g=a.dragRotate._mouseRotate.getClickTolerance(),b=a.dragRotate._mousePitch.getClickTolerance();this.element=f,this.mouseRotate=Nu({clickTolerance:g,enable:!0}),this.touchRotate=(({enable:T,clickTolerance:L,bearingDegreesPerPixelMoved:k=.8})=>{const z=new Pt;return new Ru({clickTolerance:L,move:(j,q)=>({bearingDelta:(q.x-j.x)*k}),moveStateManager:z,enable:T,assignEvents:Kh})})({clickTolerance:g,enable:!0}),this.map=a,m&&(this.mousePitch=Ou({clickTolerance:b,enable:!0}),this.touchPitch=(({enable:T,clickTolerance:L,pitchDegreesPerPixelMoved:k=-.5})=>{const z=new Pt;return new Ru({clickTolerance:L,move:(j,q)=>({pitchDelta:(q.y-j.y)*k}),moveStateManager:z,enable:T,assignEvents:Kh})})({clickTolerance:b,enable:!0})),C.addEventListener(f,"mousedown",this.mousedown),C.addEventListener(f,"touchstart",this.touchstart,{passive:!1}),C.addEventListener(f,"touchcancel",this.reset)}startMouse(a,f){this.mouseRotate.dragStart(a,f),this.mousePitch&&this.mousePitch.dragStart(a,f),C.disableDrag()}startTouch(a,f){this.touchRotate.dragStart(a,f),this.touchPitch&&this.touchPitch.dragStart(a,f),C.disableDrag()}moveMouse(a,f){const m=this.map,{bearingDelta:g}=this.mouseRotate.dragMove(a,f)||{};if(g&&m.setBearing(m.getBearing()+g),this.mousePitch){const{pitchDelta:b}=this.mousePitch.dragMove(a,f)||{};b&&m.setPitch(m.getPitch()+b)}}moveTouch(a,f){const m=this.map,{bearingDelta:g}=this.touchRotate.dragMove(a,f)||{};if(g&&m.setBearing(m.getBearing()+g),this.touchPitch){const{pitchDelta:b}=this.touchPitch.dragMove(a,f)||{};b&&m.setPitch(m.getPitch()+b)}}off(){const a=this.element;C.removeEventListener(a,"mousedown",this.mousedown),C.removeEventListener(a,"touchstart",this.touchstart,{passive:!1}),C.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),C.removeEventListener(window,"touchend",this.touchend),C.removeEventListener(a,"touchcancel",this.reset),this.offTemp()}offTemp(){C.enableDrag(),C.removeEventListener(window,"mousemove",this.mousemove),C.removeEventListener(window,"mouseup",this.mouseup),C.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),C.removeEventListener(window,"touchend",this.touchend)}}let Ba;function Jh(v,a,f){const m=new l.M(v.lng,v.lat);if(v=new l.M(v.lng,v.lat),a){const g=new l.M(v.lng-360,v.lat),b=new l.M(v.lng+360,v.lat),T=f.locationPoint(v).distSqr(a);f.locationPoint(g).distSqr(a)180;){const g=f.locationPoint(v);if(g.x>=0&&g.y>=0&&g.x<=f.width&&g.y<=f.height)break;v.lng>f.center.lng?v.lng-=360:v.lng+=360}return v.lng!==m.lng&&f.locationPoint(v).y>f.height/2-f.getHorizon()?v:m}const Vc={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 Qh(v,a,f){const m=v.classList;for(const g in Vc)m.remove(`maplibregl-${f}-anchor-${g}`);m.add(`maplibregl-${f}-anchor-${a}`)}class Uc extends l.E{constructor(a){if(super(),this._onKeyPress=f=>{const m=f.code,g=f.charCode||f.keyCode;m!=="Space"&&m!=="Enter"&&g!==32&&g!==13||this.togglePopup()},this._onMapClick=f=>{const m=f.originalEvent.target,g=this._element;this._popup&&(m===g||g.contains(m))&&this.togglePopup()},this._update=f=>{var m;if(!this._map)return;const g=this._map.loaded()&&!this._map.isMoving();((f==null?void 0:f.type)==="terrain"||(f==null?void 0:f.type)==="render"&&!g)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Jh(this._lngLat,this._flatPos,this._map.transform):(m=this._lngLat)===null||m===void 0?void 0:m.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let b="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?b=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(b=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let T="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?T="rotateX(0deg)":this._pitchAlignment==="map"&&(T=`rotateX(${this._map.getPitch()}deg)`),f&&f.type!=="moveend"||(this._pos=this._pos.round()),C.setTransform(this._element,`${Vc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${T} ${b}`),E.frameAsync(new AbortController).then(()=>{this._updateOpacity(f&&f.type==="moveend")}).catch(()=>{})},this._onMove=f=>{if(!this._isDragging){const m=this._clickTolerance||this._map._clickTolerance;this._isDragging=f.point.dist(this._pointerdownPos)>=m}this._isDragging&&(this._pos=f.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=f=>{this._element.contains(f.originalEvent.target)&&(f.preventDefault(),this._positionDelta=f.point.sub(this._pos).add(this._offset),this._pointerdownPos=f.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=a&&a.anchor||"center",this._color=a&&a.color||"#3FB1CE",this._scale=a&&a.scale||1,this._draggable=a&&a.draggable||!1,this._clickTolerance=a&&a.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=a&&a.rotation||0,this._rotationAlignment=a&&a.rotationAlignment||"auto",this._pitchAlignment=a&&a.pitchAlignment&&a.pitchAlignment!=="auto"?a.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(a==null?void 0:a.opacity,a==null?void 0:a.opacityWhenCovered),a&&a.element)this._element=a.element,this._offset=l.P.convert(a&&a.offset||[0,0]);else{this._defaultMarker=!0,this._element=C.create("div"),this._element.setAttribute("aria-label","Map marker");const f=C.createNS("http://www.w3.org/2000/svg","svg"),m=41,g=27;f.setAttributeNS(null,"display","block"),f.setAttributeNS(null,"height",`${m}px`),f.setAttributeNS(null,"width",`${g}px`),f.setAttributeNS(null,"viewBox",`0 0 ${g} ${m}`);const b=C.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"stroke","none"),b.setAttributeNS(null,"stroke-width","1"),b.setAttributeNS(null,"fill","none"),b.setAttributeNS(null,"fill-rule","evenodd");const T=C.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill-rule","nonzero");const L=C.createNS("http://www.w3.org/2000/svg","g");L.setAttributeNS(null,"transform","translate(3.0, 29.0)"),L.setAttributeNS(null,"fill","#000000");const k=[{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 Ie of k){const Ue=C.createNS("http://www.w3.org/2000/svg","ellipse");Ue.setAttributeNS(null,"opacity","0.04"),Ue.setAttributeNS(null,"cx","10.5"),Ue.setAttributeNS(null,"cy","5.80029008"),Ue.setAttributeNS(null,"rx",Ie.rx),Ue.setAttributeNS(null,"ry",Ie.ry),L.appendChild(Ue)}const z=C.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"fill",this._color);const j=C.createNS("http://www.w3.org/2000/svg","path");j.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"),z.appendChild(j);const q=C.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"opacity","0.25"),q.setAttributeNS(null,"fill","#000000");const $=C.createNS("http://www.w3.org/2000/svg","path");$.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"),q.appendChild($);const he=C.createNS("http://www.w3.org/2000/svg","g");he.setAttributeNS(null,"transform","translate(6.0, 7.0)"),he.setAttributeNS(null,"fill","#FFFFFF");const ce=C.createNS("http://www.w3.org/2000/svg","g");ce.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ye=C.createNS("http://www.w3.org/2000/svg","circle");ye.setAttributeNS(null,"fill","#000000"),ye.setAttributeNS(null,"opacity","0.25"),ye.setAttributeNS(null,"cx","5.5"),ye.setAttributeNS(null,"cy","5.5"),ye.setAttributeNS(null,"r","5.4999962");const re=C.createNS("http://www.w3.org/2000/svg","circle");re.setAttributeNS(null,"fill","#FFFFFF"),re.setAttributeNS(null,"cx","5.5"),re.setAttributeNS(null,"cy","5.5"),re.setAttributeNS(null,"r","5.4999962"),ce.appendChild(ye),ce.appendChild(re),T.appendChild(L),T.appendChild(z),T.appendChild(q),T.appendChild(he),T.appendChild(ce),f.appendChild(T),f.setAttributeNS(null,"height",m*this._scale+"px"),f.setAttributeNS(null,"width",g*this._scale+"px"),this._element.appendChild(f),this._offset=l.P.convert(a&&a.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",f=>{f.preventDefault()}),this._element.addEventListener("mousedown",f=>{f.preventDefault()}),Qh(this._element,this._anchor,"marker"),a&&a.className)for(const f of a.className.split(" "))this._element.classList.add(f);this._popup=null}addTo(a){return this.remove(),this._map=a,a.getCanvasContainer().appendChild(this._element),a.on("move",this._update),a.on("moveend",this._update),a.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),C.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(a){return this._lngLat=l.M.convert(a),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(a){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),a){if(!("offset"in a.options)){const g=Math.abs(13.5)/Math.SQRT2;a.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[g,-1*(38.1-13.5+g)],"bottom-right":[-g,-1*(38.1-13.5+g)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=a,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 a=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:a?(a.isOpen()?a.remove():(a.setLngLat(this._lngLat),a.addTo(this._map)),this):this}_updateOpacity(a=!1){var f,m;if(!(!((f=this._map)===null||f===void 0)&&f.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(a)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const g=this._map,b=g.terrain.depthAtPoint(this._pos),T=g.terrain.getElevationForLngLatZoom(this._lngLat,g.transform.tileZoom);if(g.transform.lngLatToCameraDepth(this._lngLat,T)-b<.006)return void(this._element.style.opacity=this._opacity);const L=-this._offset.y/g.transform._pixelPerMeter,k=Math.sin(g.getPitch()*Math.PI/180)*L,z=g.terrain.depthAtPoint(new l.P(this._pos.x,this._pos.y-this._offset.y)),j=g.transform.lngLatToCameraDepth(this._lngLat,T+k)-z>.006;!((m=this._popup)===null||m===void 0)&&m.isOpen()&&j&&this._popup.remove(),this._element.style.opacity=j?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(a){return this._offset=l.P.convert(a),this._update(),this}addClassName(a){this._element.classList.add(a)}removeClassName(a){this._element.classList.remove(a)}toggleClassName(a){return this._element.classList.toggle(a)}setDraggable(a){return this._draggable=!!a,this._map&&(a?(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(a){return this._rotation=a||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(a){return this._rotationAlignment=a||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(a){return this._pitchAlignment=a&&a!=="auto"?a:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(a,f){return a===void 0&&f===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),a!==void 0&&(this._opacity=a),f!==void 0&&(this._opacityWhenCovered=f),this._map&&this._updateOpacity(!0),this}}const ef={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Fu=0,$l=!1;const tf={maxWidth:100,unit:"metric"};function nf(v,a,f){const m=f&&f.maxWidth||100,g=v._container.clientHeight/2,b=v.unproject([0,g]),T=v.unproject([m,g]),L=b.distanceTo(T);if(f&&f.unit==="imperial"){const k=3.2808*L;k>5280?Kl(a,m,k/5280,v._getUIString("ScaleControl.Miles")):Kl(a,m,k,v._getUIString("ScaleControl.Feet"))}else f&&f.unit==="nautical"?Kl(a,m,L/1852,v._getUIString("ScaleControl.NauticalMiles")):L>=1e3?Kl(a,m,L/1e3,v._getUIString("ScaleControl.Kilometers")):Kl(a,m,L,v._getUIString("ScaleControl.Meters"))}function Kl(v,a,f,m){const g=function(b){const T=Math.pow(10,`${Math.floor(b)}`.length-1);let L=b/T;return L=L>=10?10:L>=5?5:L>=3?3:L>=2?2:L>=1?1:function(k){const z=Math.pow(10,Math.ceil(-Math.log(k)/Math.LN10));return Math.round(k*z)/z}(L),T*L}(f);v.style.width=a*(g/f)+"px",v.innerHTML=`${g} ${m}`}const Qp={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},ed=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function rf(v){if(v){if(typeof v=="number"){const a=Math.round(Math.abs(v)/Math.SQRT2);return{center:new l.P(0,0),top:new l.P(0,v),"top-left":new l.P(a,a),"top-right":new l.P(-a,a),bottom:new l.P(0,-v),"bottom-left":new l.P(a,-a),"bottom-right":new l.P(-a,-a),left:new l.P(v,0),right:new l.P(-v,0)}}if(v instanceof l.P||Array.isArray(v)){const a=l.P.convert(v);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:l.P.convert(v.center||[0,0]),top:l.P.convert(v.top||[0,0]),"top-left":l.P.convert(v["top-left"]||[0,0]),"top-right":l.P.convert(v["top-right"]||[0,0]),bottom:l.P.convert(v.bottom||[0,0]),"bottom-left":l.P.convert(v["bottom-left"]||[0,0]),"bottom-right":l.P.convert(v["bottom-right"]||[0,0]),left:l.P.convert(v.left||[0,0]),right:l.P.convert(v.right||[0,0])}}return rf(new l.P(0,0))}const mg=d;c.AJAXError=l.be,c.Evented=l.E,c.LngLat=l.M,c.MercatorCoordinate=l.Y,c.Point=l.P,c.addProtocol=l.bf,c.config=l.a,c.removeProtocol=l.bg,c.AttributionControl=Ds,c.BoxZoomHandler=ks,c.CanvasSource=Ls,c.CooperativeGesturesHandler=jt,c.DoubleClickZoomHandler=Wp,c.DragPanHandler=fg,c.DragRotateHandler=As,c.EdgeInsets=Au,c.FullscreenControl=class extends l.E{constructor(v={}){super(),this._onFullscreenChange=()=>{var a;let f=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((a=f==null?void 0:f.shadowRoot)===null||a===void 0)&&a.fullscreenElement;)f=f.shadowRoot.fullscreenElement;f===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,v&&v.container&&(v.container instanceof HTMLElement?this._container=v.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(v){return this._map=v,this._container||(this._container=this._map.getContainer()),this._controlContainer=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){C.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const v=this._fullscreenButton=C.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);C.create("span","maplibregl-ctrl-icon",v).setAttribute("aria-hidden","true"),v.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const v=this._getTitle();this._fullscreenButton.setAttribute("aria-label",v),this._fullscreenButton.title=v}_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._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new l.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},c.GeoJSONSource=Xe,c.GeolocateControl=class extends l.E{constructor(v){super(),this._onSuccess=a=>{if(this._map){if(this._isOutOfMapMaxBounds(a))return this._setErrorState(),this.fire(new l.k("outofmaxbounds",a)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=a,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(a),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(a),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new l.k("geolocate",a)),this._finish()}},this._updateCamera=a=>{const f=new l.M(a.coords.longitude,a.coords.latitude),m=a.coords.accuracy,g=this._map.getBearing(),b=l.e({bearing:g},this.options.fitBoundsOptions),T=rt.fromLngLat(f,m);this._map.fitBounds(T,b,{geolocateSource:!0})},this._updateMarker=a=>{if(a){const f=new l.M(a.coords.longitude,a.coords.latitude);this._accuracyCircleMarker.setLngLat(f).addTo(this._map),this._userLocationDotMarker.setLngLat(f).addTo(this._map),this._accuracy=a.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=a=>{if(this._map){if(this.options.trackUserLocation)if(a.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 f=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(a.code===3&&$l)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new l.k("error",a)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=a=>{if(this._map){if(this._container.addEventListener("contextmenu",f=>f.preventDefault()),this._geolocateButton=C.create("button","maplibregl-ctrl-geolocate",this._container),C.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",a===!1){l.w("Geolocation support is not available so the GeolocateControl will be disabled.");const f=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}else{const f=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=f,this._geolocateButton.setAttribute("aria-label",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=C.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Uc({element:this._dotElement}),this._circleElement=C.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Uc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",f=>{f.geolocateSource||this._watchState!=="ACTIVE_LOCK"||f.originalEvent&&f.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({},ef,v)}onAdd(v){return this._map=v,this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(){return l._(this,arguments,void 0,function*(a=!1){if(Ba!==void 0&&!a)return Ba;if(window.navigator.permissions===void 0)return Ba=!!window.navigator.geolocation,Ba;try{Ba=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Ba=!!window.navigator.geolocation}return Ba})}().then(a=>this._setupUI(a)),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(),C.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fu=0,$l=!1}_isOutOfMapMaxBounds(v){const a=this._map.getMaxBounds(),f=v.coords;return a&&(f.longitudea.getEast()||f.latitudea.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 v=this._map.getBounds(),a=v.getSouthEast(),f=v.getNorthEast(),m=a.distanceTo(f),g=Math.ceil(this._accuracy/(m/this._map._container.clientHeight)*2);this._circleElement.style.width=`${g}px`,this._circleElement.style.height=`${g}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":Fu--,$l=!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 v;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Fu++,Fu>1?(v={maximumAge:6e5,timeout:0},$l=!0):(v=this.options.positionOptions,$l=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,v)}}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)}},c.Hash=Up,c.ImageSource=hn,c.KeyboardHandler=pl,c.LngLatBounds=rt,c.LogoControl=pg,c.Map=class extends Mo{constructor(v){if(l.bc.mark(l.bd.create),(v=l.e({},Bc,v)).minZoom!=null&&v.maxZoom!=null&&v.minZoom>v.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(v.minPitch!=null&&v.maxPitch!=null&&v.minPitch>v.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(v.minPitch!=null&&v.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(v.maxPitch!=null&&v.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Wh(v.minZoom,v.maxZoom,v.minPitch,v.maxPitch,v.renderWorldCopies),{bearingSnap:v.bearingSnap}),this._contextLost=a=>{a.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new l.k("webglcontextlost",{originalEvent:a}))},this._contextRestored=a=>{this._setupPainter(),this.resize(),this._update(),this.fire(new l.k("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=v.interactive,this._maxTileCacheSize=v.maxTileCacheSize,this._maxTileCacheZoomLevels=v.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=v.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=v.preserveDrawingBuffer,this._antialias=v.antialias,this._trackResize=v.trackResize,this._bearingSnap=v.bearingSnap,this._refreshExpiredTiles=v.refreshExpiredTiles,this._fadeDuration=v.fadeDuration,this._crossSourceCollisions=v.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=v.collectResourceTiming,this._renderTaskQueue=new zc,this._controls=[],this._mapId=l.a3(),this._locale=l.e({},Yp,v.locale),this._clickTolerance=v.clickTolerance,this._overridePixelRatio=v.pixelRatio,this._maxCanvasSize=v.maxCanvasSize,this.transformCameraUpdate=v.transformCameraUpdate,this._imageQueueHandle=G.addThrottleControl(()=>this.isMoving()),this._requestManager=new U(v.transformRequest),typeof v.container=="string"){if(this._container=document.getElementById(v.container),!this._container)throw new Error(`Container '${v.container}' not found.`)}else{if(!(v.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=v.container}if(v.maxBounds&&this.setMaxBounds(v.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 a=!1;const f=Vp(m=>{this._trackResize&&!this._removed&&this.resize(m)._update()},50);this._resizeObserver=new ResizeObserver(m=>{a?f(m):a=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Hp(this,v),this._hash=v.hash&&new Up(typeof v.hash=="string"&&v.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:v.center,zoom:v.zoom,bearing:v.bearing,pitch:v.pitch}),v.bounds&&(this.resize(),this.fitBounds(v.bounds,l.e({},v.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=v.localIdeographFontFamily,this._validateStyle=v.validateStyle,v.style&&this.setStyle(v.style,{localIdeographFontFamily:v.localIdeographFontFamily}),v.attributionControl&&this.addControl(new Ds(typeof v.attributionControl=="boolean"?void 0:v.attributionControl)),v.maplibreLogo&&this.addControl(new pg,v.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(new l.k(`${a.dataType}data`,a))}),this.on("dataloading",a=>{this.fire(new l.k(`${a.dataType}dataloading`,a))}),this.on("dataabort",a=>{this.fire(new l.k("sourcedataabort",a))})}_getMapId(){return this._mapId}addControl(v,a){if(a===void 0&&(a=v.getDefaultPosition?v.getDefaultPosition():"top-right"),!v||!v.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 f=v.onAdd(this);this._controls.push(v);const m=this._controlPositions[a];return a.indexOf("bottom")!==-1?m.insertBefore(f,m.firstChild):m.appendChild(f),this}removeControl(v){if(!v||!v.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 a=this._controls.indexOf(v);return a>-1&&this._controls.splice(a,1),v.onRemove(this),this}hasControl(v){return this._controls.indexOf(v)>-1}calculateCameraOptionsFromTo(v,a,f,m){return m==null&&this.terrain&&(m=this.terrain.getElevationForLngLatZoom(f,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(v,a,f,m)}resize(v){var a;const f=this._containerDimensions(),m=f[0],g=f[1],b=this._getClampedPixelRatio(m,g);if(this._resizeCanvas(m,g,b),this.painter.resize(m,g,b),this.painter.overLimit()){const L=this.painter.context.gl;this._maxCanvasSize=[L.drawingBufferWidth,L.drawingBufferHeight];const k=this._getClampedPixelRatio(m,g);this._resizeCanvas(m,g,k),this.painter.resize(m,g,k)}this.transform.resize(m,g),(a=this._requestedCameraState)===null||a===void 0||a.resize(m,g);const T=!this._moving;return T&&(this.stop(),this.fire(new l.k("movestart",v)).fire(new l.k("move",v))),this.fire(new l.k("resize",v)),T&&this.fire(new l.k("moveend",v)),this}_getClampedPixelRatio(v,a){const{0:f,1:m}=this._maxCanvasSize,g=this.getPixelRatio(),b=v*g,T=a*g;return Math.min(b>f?f/b:1,T>m?m/T:1)*g}getPixelRatio(){var v;return(v=this._overridePixelRatio)!==null&&v!==void 0?v:devicePixelRatio}setPixelRatio(v){this._overridePixelRatio=v,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(v){return this.transform.setMaxBounds(rt.convert(v)),this._update()}setMinZoom(v){if((v=v??-2)>=-2&&v<=this.transform.maxZoom)return this.transform.minZoom=v,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=v,this._update(),this.getZoom()>v&&this.setZoom(v),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(v){if((v=v??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(v>=0&&v<=this.transform.maxPitch)return this.transform.minPitch=v,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(v>=this.transform.minPitch)return this.transform.maxPitch=v,this._update(),this.getPitch()>v&&this.setPitch(v),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(v){return this.transform.renderWorldCopies=v,this._update()}project(v){return this.transform.locationPoint(l.M.convert(v),this.style&&this.terrain)}unproject(v){return this.transform.pointLocation(l.P.convert(v),this.terrain)}isMoving(){var v;return this._moving||((v=this.handlers)===null||v===void 0?void 0:v.isMoving())}isZooming(){var v;return this._zooming||((v=this.handlers)===null||v===void 0?void 0:v.isZooming())}isRotating(){var v;return this._rotating||((v=this.handlers)===null||v===void 0?void 0:v.isRotating())}_createDelegatedListener(v,a,f){if(v==="mouseenter"||v==="mouseover"){let m=!1;return{layer:a,listener:f,delegates:{mousemove:b=>{const T=this.getLayer(a)?this.queryRenderedFeatures(b.point,{layers:[a]}):[];T.length?m||(m=!0,f.call(this,new Po(v,this,b.originalEvent,{features:T}))):m=!1},mouseout:()=>{m=!1}}}}if(v==="mouseleave"||v==="mouseout"){let m=!1;return{layer:a,listener:f,delegates:{mousemove:T=>{(this.getLayer(a)?this.queryRenderedFeatures(T.point,{layers:[a]}):[]).length?m=!0:m&&(m=!1,f.call(this,new Po(v,this,T.originalEvent)))},mouseout:T=>{m&&(m=!1,f.call(this,new Po(v,this,T.originalEvent)))}}}}{const m=g=>{const b=this.getLayer(a)?this.queryRenderedFeatures(g.point,{layers:[a]}):[];b.length&&(g.features=b,f.call(this,g),delete g.features)};return{layer:a,listener:f,delegates:{[v]:m}}}}on(v,a,f){if(f===void 0)return super.on(v,a);const m=this._createDelegatedListener(v,a,f);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[v]=this._delegatedListeners[v]||[],this._delegatedListeners[v].push(m);for(const g in m.delegates)this.on(g,m.delegates[g]);return this}once(v,a,f){if(f===void 0)return super.once(v,a);const m=this._createDelegatedListener(v,a,f);for(const g in m.delegates)this.once(g,m.delegates[g]);return this}off(v,a,f){return f===void 0?super.off(v,a):(this._delegatedListeners&&this._delegatedListeners[v]&&(m=>{const g=this._delegatedListeners[v];for(let b=0;bthis._updateStyle(v,a));const f=this.style&&a.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!v)),v?(this.style=new Ho(this,a||{}),this.style.setEventedParent(this,{style:this.style}),typeof v=="string"?this.style.loadURL(v,a,f):this.style.loadJSON(v,a,f),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ho(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(v,a){if(typeof v=="string"){const f=this._requestManager.transformRequest(v,"Style");l.h(f,new AbortController).then(m=>{this._updateDiff(m.data,a)}).catch(m=>{m&&this.fire(new l.j(m))})}else typeof v=="object"&&this._updateDiff(v,a)}_updateDiff(v,a){try{this.style.setState(v,a)&&this._update(!0)}catch(f){l.w(`Unable to perform style diff: ${f.message||f.error||f}. Rebuilding the style from scratch.`),this._updateStyle(v,a)}}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(v,a){return this._lazyInitEmptyStyle(),this.style.addSource(v,a),this._update(!0)}isSourceLoaded(v){const a=this.style&&this.style.sourceCaches[v];if(a!==void 0)return a.loaded();this.fire(new l.j(new Error(`There is no source with ID '${v}'`)))}setTerrain(v){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),v){const a=this.style.sourceCaches[v.source];if(!a)throw new Error(`cannot load terrain, because there exists no source with ID: ${v.source}`);this.terrain===null&&a.reload();for(const f in this.style._layers){const m=this.style._layers[f];m.type==="hillshade"&&m.source===v.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 dg(this.painter,a,v),this.painter.renderToTexture=new Xp(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=f=>{f.dataType==="style"?this.terrain.sourceCache.freeRtt():f.dataType==="source"&&f.tile&&(f.sourceId!==v.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(f.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new l.k("terrain",{terrain:v})),this}getTerrain(){var v,a;return(a=(v=this.terrain)===null||v===void 0?void 0:v.options)!==null&&a!==void 0?a:null}areTilesLoaded(){const v=this.style&&this.style.sourceCaches;for(const a in v){const f=v[a]._tiles;for(const m in f){const g=f[m];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0}removeSource(v){return this.style.removeSource(v),this._update(!0)}getSource(v){return this.style.getSource(v)}addImage(v,a,f={}){const{pixelRatio:m=1,sdf:g=!1,stretchX:b,stretchY:T,content:L}=f;if(this._lazyInitEmptyStyle(),!(a instanceof HTMLImageElement||l.b(a))){if(a.width===void 0||a.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:k,height:z,data:j}=a,q=a;return this.style.addImage(v,{data:new l.R({width:k,height:z},new Uint8Array(j)),pixelRatio:m,stretchX:b,stretchY:T,content:L,sdf:g,version:0,userImage:q}),q.onAdd&&q.onAdd(this,v),this}}{const{width:k,height:z,data:j}=E.getImageData(a);this.style.addImage(v,{data:new l.R({width:k,height:z},j),pixelRatio:m,stretchX:b,stretchY:T,content:L,sdf:g,version:0})}}updateImage(v,a){const f=this.style.getImage(v);if(!f)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 m=a instanceof HTMLImageElement||l.b(a)?E.getImageData(a):a,{width:g,height:b,data:T}=m;if(g===void 0||b===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(g!==f.data.width||b!==f.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 L=!(a instanceof HTMLImageElement||l.b(a));return f.data.replace(T,L),this.style.updateImage(v,f),this}getImage(v){return this.style.getImage(v)}hasImage(v){return v?!!this.style.getImage(v):(this.fire(new l.j(new Error("Missing required image id"))),!1)}removeImage(v){this.style.removeImage(v)}loadImage(v){return G.getImage(this._requestManager.transformRequest(v,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(v,a){return this._lazyInitEmptyStyle(),this.style.addLayer(v,a),this._update(!0)}moveLayer(v,a){return this.style.moveLayer(v,a),this._update(!0)}removeLayer(v){return this.style.removeLayer(v),this._update(!0)}getLayer(v){return this.style.getLayer(v)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(v,a,f){return this.style.setLayerZoomRange(v,a,f),this._update(!0)}setFilter(v,a,f={}){return this.style.setFilter(v,a,f),this._update(!0)}getFilter(v){return this.style.getFilter(v)}setPaintProperty(v,a,f,m={}){return this.style.setPaintProperty(v,a,f,m),this._update(!0)}getPaintProperty(v,a){return this.style.getPaintProperty(v,a)}setLayoutProperty(v,a,f,m={}){return this.style.setLayoutProperty(v,a,f,m),this._update(!0)}getLayoutProperty(v,a){return this.style.getLayoutProperty(v,a)}setGlyphs(v,a={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(v,a),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(v,a,f={}){return this._lazyInitEmptyStyle(),this.style.addSprite(v,a,f,m=>{m||this._update(!0)}),this}removeSprite(v){return this._lazyInitEmptyStyle(),this.style.removeSprite(v),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(v,a={}){return this._lazyInitEmptyStyle(),this.style.setSprite(v,a,f=>{f||this._update(!0)}),this}setLight(v,a={}){return this._lazyInitEmptyStyle(),this.style.setLight(v,a),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(v,a){return this.style.setFeatureState(v,a),this._update()}removeFeatureState(v,a){return this.style.removeFeatureState(v,a),this._update()}getFeatureState(v){return this.style.getFeatureState(v)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let v=0,a=0;return this._container&&(v=this._container.clientWidth||400,a=this._container.clientHeight||300),[v,a]}_setupContainer(){const v=this._container;v.classList.add("maplibregl-map");const a=this._canvasContainer=C.create("div","maplibregl-canvas-container",v);this._interactive&&a.classList.add("maplibregl-interactive"),this._canvas=C.create("canvas","maplibregl-canvas",a),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 f=this._containerDimensions(),m=this._getClampedPixelRatio(f[0],f[1]);this._resizeCanvas(f[0],f[1],m);const g=this._controlContainer=C.create("div","maplibregl-control-container",v),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(T=>{b[T]=C.create("div",`maplibregl-ctrl-${T} `,g)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(v,a,f){this._canvas.width=Math.floor(f*v),this._canvas.height=Math.floor(f*a),this._canvas.style.width=`${v}px`,this._canvas.style.height=`${a}px`}_setupPainter(){const v={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let a=null;this._canvas.addEventListener("webglcontextcreationerror",m=>{a={requestedAttributes:v},m&&(a.statusMessage=m.statusMessage,a.type=m.type)},{once:!0});const f=this._canvas.getContext("webgl2",v)||this._canvas.getContext("webgl",v);if(!f){const m="Failed to initialize WebGL";throw a?(a.message=m,new Error(JSON.stringify(a))):new Error(m)}this.painter=new tg(f,this.transform),A.testSupport(f)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(v){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||v,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(v){return this._update(),this._renderTaskQueue.add(v)}_cancelRenderFrame(v){this._renderTaskQueue.remove(v)}_render(v){const a=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(v),this._removed)return;let f=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const g=this.transform.zoom,b=E.now();this.style.zoomHistory.update(g,b);const T=new l.a8(g,{now:b,fadeDuration:a,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),L=T.crossFadingFactor();L===1&&L===this._crossFadingFactor||(f=!0,this._crossFadingFactor=L),this.style.update(T)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,a,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:a,showPadding:this.showPadding}),this.fire(new l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bc.mark(l.bd.load),this.fire(new l.k("load"))),this.style&&(this.style.hasTransitions()||f)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const m=this._sourcesDirty||this._styleDirty||this._placementDirty;return m||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.k("idle")),!this._loaded||this._fullyLoaded||m||(this._fullyLoaded=!0,l.bc.mark(l.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var v;this._hash&&this._hash.remove();for(const f of this._controls)f.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),G.removeThrottleControl(this._imageQueueHandle),(v=this._resizeObserver)===null||v===void 0||v.disconnect();const a=this.painter.context.gl.getExtension("WEBGL_lose_context");a&&a.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),C.remove(this._canvasContainer),C.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),l.bc.clearMetrics(),this._removed=!0,this.fire(new l.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,E.frameAsync(this._frameRequest).then(v=>{l.bc.frame(v),this._frameRequest=null,this._render(v)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(v){this._showTileBoundaries!==v&&(this._showTileBoundaries=v,this._update())}get showPadding(){return!!this._showPadding}set showPadding(v){this._showPadding!==v&&(this._showPadding=v,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(v){this._showCollisionBoxes!==v&&(this._showCollisionBoxes=v,v?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(v){this._showOverdrawInspector!==v&&(this._showOverdrawInspector=v,this._update())}get repaint(){return!!this._repaint}set repaint(v){this._repaint!==v&&(this._repaint=v,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(v){this._vertices=v,this._update()}get version(){return $p}getCameraTargetElevation(){return this.transform.elevation}},c.MapMouseEvent=Po,c.MapTouchEvent=ta,c.MapWheelEvent=jp,c.Marker=Uc,c.NavigationControl=class{constructor(v){this._updateZoomButtons=()=>{const a=this._map.getZoom(),f=a===this._map.getMaxZoom(),m=a===this._map.getMinZoom();this._zoomInButton.disabled=f,this._zoomOutButton.disabled=m,this._zoomInButton.setAttribute("aria-disabled",f.toString()),this._zoomOutButton.setAttribute("aria-disabled",m.toString())},this._rotateCompassArrow=()=>{const a=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=a},this._setButtonTitle=(a,f)=>{const m=this._map._getUIString(`NavigationControl.${f}`);a.title=m,a.setAttribute("aria-label",m)},this.options=l.e({},Kp,v),this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",a=>a.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",a=>this._map.zoomIn({},{originalEvent:a})),C.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",a=>this._map.zoomOut({},{originalEvent:a})),C.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",a=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:a}):this._map.resetNorth({},{originalEvent:a})}),this._compassIcon=C.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(v){return this._map=v,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 Jp(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){C.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(v,a){const f=C.create("button",v,this._container);return f.type="button",f.addEventListener("click",a),f}},c.Popup=class extends l.E{constructor(v){super(),this.remove=()=>(this._content&&C.remove(this._content),this._container&&(C.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new l.k("close"))),this),this._onMouseUp=a=>{this._update(a.point)},this._onMouseMove=a=>{this._update(a.point)},this._onDrag=a=>{this._update(a.point)},this._update=a=>{var f;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=C.create("div","maplibregl-popup",this._map.getContainer()),this._tip=C.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const L of this.options.className.split(" "))this._container.classList.add(L);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Jh(this._lngLat,this._flatPos,this._map.transform):(f=this._lngLat)===null||f===void 0?void 0:f.wrap(),this._trackPointer&&!a)return;const m=this._flatPos=this._pos=this._trackPointer&&a?a:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&a?a:this._map.transform.locationPoint(this._lngLat));let g=this.options.anchor;const b=rf(this.options.offset);if(!g){const L=this._container.offsetWidth,k=this._container.offsetHeight;let z;z=m.y+b.bottom.ythis._map.transform.height-k?["bottom"]:[],m.xthis._map.transform.width-L/2&&z.push("right"),g=z.length===0?"bottom":z.join("-")}let T=m.add(b[g]);this.options.subpixelPositioning||(T=T.round()),C.setTransform(this._container,`${Vc[g]} translate(${T.x}px,${T.y}px)`),Qh(this._container,g,"popup")},this._onClose=()=>{this.remove()},this.options=l.e(Object.create(Qp),v)}addTo(v){return this._map&&this.remove(),this._map=v,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(v){return this._lngLat=l.M.convert(v),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(v){return this.setDOMContent(document.createTextNode(v))}setHTML(v){const a=document.createDocumentFragment(),f=document.createElement("body");let m;for(f.innerHTML=v;m=f.firstChild,m;)a.appendChild(m);return this.setDOMContent(a)}getMaxWidth(){var v;return(v=this._container)===null||v===void 0?void 0:v.style.maxWidth}setMaxWidth(v){return this.options.maxWidth=v,this._update(),this}setDOMContent(v){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=C.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(v),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(v){this._container&&this._container.classList.add(v)}removeClassName(v){this._container&&this._container.classList.remove(v)}setOffset(v){return this.options.offset=v,this._update(),this}toggleClassName(v){if(this._container)return this._container.classList.toggle(v)}setSubpixelPositioning(v){this.options.subpixelPositioning=v}_createCloseButton(){this.options.closeButton&&(this._closeButton=C.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 v=this._container.querySelector(ed);v&&v.focus()}},c.RasterDEMTileSource=tn,c.RasterTileSource=me,c.ScaleControl=class{constructor(v){this._onMove=()=>{nf(this._map,this._container,this.options)},this.setUnit=a=>{this.options.unit=a,nf(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},tf),v)}getDefaultPosition(){return"bottom-left"}onAdd(v){return this._map=v,this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-scale",v.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){C.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},c.ScrollZoomHandler=Yh,c.Style=Ho,c.TerrainControl=class{constructor(v){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=v}onAdd(v){return this._map=v,this._container=C.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=C.create("button","maplibregl-ctrl-terrain",this._container),C.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(){C.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},c.TwoFingersTouchPitchHandler=ug,c.TwoFingersTouchRotateHandler=qp,c.TwoFingersTouchZoomHandler=lg,c.TwoFingersTouchZoomRotateHandler=Nc,c.VectorTileSource=Nt,c.VideoSource=Ai,c.addSourceType=(v,a)=>l._(void 0,void 0,void 0,function*(){if(al(v))throw new Error(`A source type called "${v}" already exists.`);((f,m)=>{Js[f]=m})(v,a)}),c.clearPrewarmedResources=function(){const v=an;v&&(v.isPreloaded()&&v.numActive()===1?(v.release(Ot),an=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()"))},c.getMaxParallelImageRequests=function(){return l.a.MAX_PARALLEL_IMAGE_REQUESTS},c.getRTLTextPluginStatus=function(){return lt().getRTLTextPluginStatus()},c.getVersion=function(){return mg},c.getWorkerCount=function(){return ln.workerCount},c.getWorkerUrl=function(){return l.a.WORKER_URL},c.importScriptInWorkers=function(v){return rr().broadcast("IS",v)},c.prewarm=function(){En().acquire(Ot)},c.setMaxParallelImageRequests=function(v){l.a.MAX_PARALLEL_IMAGE_REQUESTS=v},c.setRTLTextPlugin=function(v,a){return lt().setRTLTextPlugin(v,a)},c.setWorkerCount=function(v){ln.workerCount=v},c.setWorkerUrl=function(v){l.a.WORKER_URL=v}});var o=n;return o})})(KE);var Q_=KE.exports;const Vs=d1(Q_),yf=[];function D0(t,e){return{subscribe:Gn(t,e).subscribe}}function Gn(t,e=Mt){let n;const r=new Set;function i(l){if(Ht(t,l)&&(t=l,n)){const d=!yf.length;for(const y of r)y[1](),yf.push(y,t);if(d){for(let y=0;y{r.delete(y),r.size===0&&n&&(n(),n=null)}}return{set:i,update:o,subscribe:c}}let Gt;const QE=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&QE.decode();let Nd=null;function qd(){return(Nd===null||Nd.byteLength===0)&&(Nd=new Uint8Array(Gt.memory.buffer)),Nd}function fa(t,e){return t=t>>>0,QE.decode(qd().subarray(t,t+e))}const lu=new Array(128).fill(void 0);lu.push(void 0,null,!0,!1);let Wd=lu.length;function mi(t){Wd===lu.length&&lu.push(lu.length+1);const e=Wd;return Wd=lu[e],lu[e]=t,e}function Bn(t){return lu[t]}function pM(t){t<132||(lu[t]=Wd,Wd=t)}function Cf(t){const e=Bn(t);return pM(t),e}function R0(t){return t==null}let Od=null;function dM(){return(Od===null||Od.byteLength===0)&&(Od=new Float64Array(Gt.memory.buffer)),Od}let zd=null;function Yn(){return(zd===null||zd.byteLength===0)&&(zd=new Int32Array(Gt.memory.buffer)),zd}let Ku=0;const Qg=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},mM=typeof Qg.encodeInto=="function"?function(t,e){return Qg.encodeInto(t,e)}:function(t,e){const n=Qg.encode(t);return e.set(n),{read:t.length,written:n.length}};function Bg(t,e,n){if(n===void 0){const l=Qg.encode(t),d=e(l.length,1)>>>0;return qd().subarray(d,d+l.length).set(l),Ku=l.length,d}let r=t.length,i=e(r,1)>>>0;const o=qd();let c=0;for(;c127)break;o[i+c]=l}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;const l=qd().subarray(i+c,i+r),d=mM(t,l);c+=d.written}return Ku=c,i}function mv(t){const e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){const i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){const i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){const i=t.length;let o="[";i>0&&(o+=mv(t[0]));for(let c=1;c1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}function gM(t,e){const n=e(t.length*1,1)>>>0;return qd().set(t,n/1),Ku=t.length,n}function N0(t,e){try{return t.apply(this,e)}catch(n){Gt.__wbindgen_exn_store(mi(n))}}class m_{static __wrap(e){e=e>>>0;const n=Object.create(m_.prototype);return n.__wbg_ptr=e,n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,e}free(){const e=this.__destroy_into_raw();Gt.__wbg_jsroutesnapper_free(e)}constructor(e){try{const o=Gt.__wbindgen_add_to_stack_pointer(-16),c=gM(e,Gt.__wbindgen_malloc),l=Ku;Gt.jsroutesnapper_new(o,c,l);var n=Yn()[o/4+0],r=Yn()[o/4+1],i=Yn()[o/4+2];if(i)throw Cf(r);return m_.__wrap(n)}finally{Gt.__wbindgen_add_to_stack_pointer(16)}}setRouteConfig(e){Gt.jsroutesnapper_setRouteConfig(this.__wbg_ptr,mi(e))}setAreaMode(){Gt.jsroutesnapper_setAreaMode(this.__wbg_ptr)}getConfig(){let e,n;try{const o=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_getConfig(o,this.__wbg_ptr);var r=Yn()[o/4+0],i=Yn()[o/4+1];return e=r,n=i,fa(r,i)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(e,n,1)}}toFinalFeature(){try{const r=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_toFinalFeature(r,this.__wbg_ptr);var e=Yn()[r/4+0],n=Yn()[r/4+1];let i;return e!==0&&(i=fa(e,n).slice(),Gt.__wbindgen_free(e,n*1)),i}finally{Gt.__wbindgen_add_to_stack_pointer(16)}}renderGeojson(){let e,n;try{const o=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_renderGeojson(o,this.__wbg_ptr);var r=Yn()[o/4+0],i=Yn()[o/4+1];return e=r,n=i,fa(r,i)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(e,n,1)}}toggleSnapMode(){Gt.jsroutesnapper_toggleSnapMode(this.__wbg_ptr)}onMouseMove(e,n,r){return Gt.jsroutesnapper_onMouseMove(this.__wbg_ptr,e,n,r)!==0}onClick(){Gt.jsroutesnapper_onClick(this.__wbg_ptr)}onDragStart(){return Gt.jsroutesnapper_onDragStart(this.__wbg_ptr)!==0}onMouseUp(){return Gt.jsroutesnapper_onMouseUp(this.__wbg_ptr)!==0}clearState(){Gt.jsroutesnapper_clearState(this.__wbg_ptr)}editExisting(e){try{const i=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_editExisting(i,this.__wbg_ptr,mi(e));var n=Yn()[i/4+0],r=Yn()[i/4+1];if(r)throw Cf(n)}finally{Gt.__wbindgen_add_to_stack_pointer(16)}}debugRenderGraph(){let e,n;try{const o=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_debugRenderGraph(o,this.__wbg_ptr);var r=Yn()[o/4+0],i=Yn()[o/4+1];return e=r,n=i,fa(r,i)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(e,n,1)}}debugSnappableNodes(){let e,n;try{const o=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_debugSnappableNodes(o,this.__wbg_ptr);var r=Yn()[o/4+0],i=Yn()[o/4+1];return e=r,n=i,fa(r,i)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(e,n,1)}}routeNameForWaypoints(e){let n,r;try{const S=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_routeNameForWaypoints(S,this.__wbg_ptr,mi(e));var i=Yn()[S/4+0],o=Yn()[S/4+1],c=Yn()[S/4+2],l=Yn()[S/4+3],d=i,y=o;if(l)throw d=0,y=0,Cf(c);return n=d,r=y,fa(d,y)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(n,r,1)}}addSnappedWaypoint(e,n){Gt.jsroutesnapper_addSnappedWaypoint(this.__wbg_ptr,e,n)}undo(){Gt.jsroutesnapper_undo(this.__wbg_ptr)}calculateRoute(e){let n,r;try{const S=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_calculateRoute(S,this.__wbg_ptr,mi(e));var i=Yn()[S/4+0],o=Yn()[S/4+1],c=Yn()[S/4+2],l=Yn()[S/4+3],d=i,y=o;if(l)throw d=0,y=0,Cf(c);return n=d,r=y,fa(d,y)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(n,r,1)}}getExtraNodes(e,n){let r,i;try{const E=Gt.__wbindgen_add_to_stack_pointer(-16);Gt.jsroutesnapper_getExtraNodes(E,this.__wbg_ptr,mi(e),mi(n));var o=Yn()[E/4+0],c=Yn()[E/4+1],l=Yn()[E/4+2],d=Yn()[E/4+3],y=o,S=c;if(d)throw y=0,S=0,Cf(l);return r=y,i=S,fa(y,S)}finally{Gt.__wbindgen_add_to_stack_pointer(16),Gt.__wbindgen_free(r,i,1)}}}async function _M(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{const n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function yM(){const t={};return t.wbg={},t.wbg.__wbindgen_string_new=function(e,n){const r=fa(e,n);return mi(r)},t.wbg.__wbindgen_object_drop_ref=function(e){Cf(e)},t.wbg.__wbindgen_error_new=function(e,n){const r=new Error(fa(e,n));return mi(r)},t.wbg.__wbindgen_number_get=function(e,n){const r=Bn(n),i=typeof r=="number"?r:void 0;dM()[e/8+1]=R0(i)?0:i,Yn()[e/4+0]=!R0(i)},t.wbg.__wbindgen_is_object=function(e){const n=Bn(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_undefined=function(e){return Bn(e)===void 0},t.wbg.__wbindgen_in=function(e,n){return Bn(e)in Bn(n)},t.wbg.__wbindgen_boolean_get=function(e){const n=Bn(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return Bn(e)==Bn(n)},t.wbg.__wbindgen_string_get=function(e,n){const r=Bn(n),i=typeof r=="string"?r:void 0;var o=R0(i)?0:Bg(i,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),c=Ku;Yn()[e/4+1]=c,Yn()[e/4+0]=o},t.wbg.__wbg_String_4370c5505c674d30=function(e,n){const r=String(Bn(n)),i=Bg(r,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),o=Ku;Yn()[e/4+1]=o,Yn()[e/4+0]=i},t.wbg.__wbindgen_object_clone_ref=function(e){const n=Bn(e);return mi(n)},t.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea=function(e,n){const r=Bn(e)[Bn(n)];return mi(r)},t.wbg.__wbg_new_abda76e883ba8a5f=function(){const e=new Error;return mi(e)},t.wbg.__wbg_stack_658279fe44541cf6=function(e,n){const r=Bn(n).stack,i=Bg(r,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),o=Ku;Yn()[e/4+1]=o,Yn()[e/4+0]=i},t.wbg.__wbg_error_f851667af71bcfc6=function(e,n){let r,i;try{r=e,i=n,console.error(fa(e,n))}finally{Gt.__wbindgen_free(r,i,1)}},t.wbg.__wbg_debug_9a6b3243fbbebb61=function(e){console.debug(Bn(e))},t.wbg.__wbg_error_788ae33f81d3b84b=function(e){console.error(Bn(e))},t.wbg.__wbg_info_2e30e8204b29d91d=function(e){console.info(Bn(e))},t.wbg.__wbg_log_1d3ae0273d8f4f8a=function(e){console.log(Bn(e))},t.wbg.__wbg_warn_d60e832f9882c1b2=function(e){console.warn(Bn(e))},t.wbg.__wbg_get_44be0491f933a435=function(e,n){const r=Bn(e)[n>>>0];return mi(r)},t.wbg.__wbg_length_fff51ee6522a1a18=function(e){return Bn(e).length},t.wbg.__wbindgen_is_function=function(e){return typeof Bn(e)=="function"},t.wbg.__wbg_next_526fc47e980da008=function(e){const n=Bn(e).next;return mi(n)},t.wbg.__wbg_next_ddb3312ca1c4e32a=function(){return N0(function(e){const n=Bn(e).next();return mi(n)},arguments)},t.wbg.__wbg_done_5c1f01fb660d73b5=function(e){return Bn(e).done},t.wbg.__wbg_value_1695675138684bd5=function(e){const n=Bn(e).value;return mi(n)},t.wbg.__wbg_iterator_97f0c81209c6c35a=function(){return mi(Symbol.iterator)},t.wbg.__wbg_get_97b561fb56f034b5=function(){return N0(function(e,n){const r=Reflect.get(Bn(e),Bn(n));return mi(r)},arguments)},t.wbg.__wbg_call_cb65541d95d71282=function(){return N0(function(e,n){const r=Bn(e).call(Bn(n));return mi(r)},arguments)},t.wbg.__wbg_isArray_4c24b343cb13cfb1=function(e){return Array.isArray(Bn(e))},t.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb=function(e){let n;try{n=Bn(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_buffer_085ec1f694018c4f=function(e){const n=Bn(e).buffer;return mi(n)},t.wbg.__wbg_new_8125e318e6245eed=function(e){const n=new Uint8Array(Bn(e));return mi(n)},t.wbg.__wbg_set_5cf90238115182c3=function(e,n,r){Bn(e).set(Bn(n),r>>>0)},t.wbg.__wbg_length_72e2208bbc0efc61=function(e){return Bn(e).length},t.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4=function(e){let n;try{n=Bn(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbindgen_debug_string=function(e,n){const r=mv(Bn(n)),i=Bg(r,Gt.__wbindgen_malloc,Gt.__wbindgen_realloc),o=Ku;Yn()[e/4+1]=o,Yn()[e/4+0]=i},t.wbg.__wbindgen_throw=function(e,n){throw new Error(fa(e,n))},t.wbg.__wbindgen_memory=function(){const e=Gt.memory;return mi(e)},t}function vM(t,e){return Gt=t.exports,eI.__wbindgen_wasm_module=e,Od=null,zd=null,Nd=null,Gt}async function eI(t){if(Gt!==void 0)return Gt;typeof t>"u"&&(t="/ltn/assets/route_snapper_bg.wasm");const e=yM();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await _M(await t,e);return vM(n,r)}var zo=63710088e-1,m1={centimeters:zo*100,centimetres:zo*100,degrees:zo/111325,feet:zo*3.28084,inches:zo*39.37,kilometers:zo/1e3,kilometres:zo/1e3,meters:zo,metres:zo,miles:zo/1609.344,millimeters:zo*1e3,millimetres:zo*1e3,nauticalmiles:zo/1852,radians:1,yards:zo*1.0936},bM={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/zo,yards:1.0936133},gv={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function wa(t,e,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function xM(t,e,n){switch(t){case"Point":return vs(e).geometry;case"LineString":return ma(e).geometry;case"Polygon":return g1(e).geometry;case"MultiPoint":return nI(e).geometry;case"MultiLineString":return tI(e).geometry;case"MultiPolygon":return rI(e).geometry;default:throw new Error(t+" is invalid")}}function vs(t,e,n){if(n===void 0&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g_(t[0])||!g_(t[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:t};return wa(r,e,n)}function wM(t,e,n){return n===void 0&&(n={}),$c(t.map(function(r){return vs(r,e)}),n)}function g1(t,e,n){n===void 0&&(n={});for(var r=0,i=t;r=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function _1(t,e){e===void 0&&(e="kilometers");var n=m1[e];if(!n)throw new Error(e+" units is invalid");return t*n}function ey(t,e){e===void 0&&(e="kilometers");var n=m1[e];if(!n)throw new Error(e+" units is invalid");return t/n}function TM(t,e){return Qd(ey(t,e))}function LM(t){var e=t%360;return e<0&&(e+=360),e}function Qd(t){var e=t%(2*Math.PI);return e*180/Math.PI}function ga(t){var e=t%360;return e*Math.PI/180}function PM(t,e,n){if(e===void 0&&(e="kilometers"),n===void 0&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return _1(ey(t,e),n)}function MM(t,e,n){if(e===void 0&&(e="meters"),n===void 0&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=gv[e];if(!r)throw new Error("invalid original units");var i=gv[n];if(!i)throw new Error("invalid final units");return t/r*i}function g_(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function y1(t){return!!t&&t.constructor===Object}function kM(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!g_(e))throw new Error("bbox must only contain numbers")})}function AM(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const DM=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:gv,bearingToAzimuth:LM,convertArea:MM,convertLength:PM,degreesToRadians:ga,earthRadius:zo,factors:m1,feature:wa,featureCollection:$c,geometry:xM,geometryCollection:IM,isNumber:g_,isObject:y1,lengthToDegrees:TM,lengthToRadians:ey,lineString:ma,lineStrings:EM,multiLineString:tI,multiPoint:nI,multiPolygon:rI,point:vs,points:wM,polygon:g1,polygons:SM,radiansToDegrees:Qd,radiansToLength:_1,round:CM,unitsFactors:bM,validateBBox:kM,validateId:AM},Symbol.toStringTag,{value:"Module"}));function em(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Of(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Sd(t,e,n){n===void 0&&(n={});var r=em(t),i=em(e),o=ga(i[1]-r[1]),c=ga(i[0]-r[0]),l=ga(r[1]),d=ga(i[1]),y=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(c/2),2)*Math.cos(l)*Math.cos(d);return _1(2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y)),n.units)}function wm(t,e,n){if(t!==null)for(var r,i,o,c,l,d,y,S=0,E=0,C,A=t.type,M=A==="FeatureCollection",R=A==="Feature",N=M?t.features.length:1,B=0;Bd||M>y||R>S){l=E,d=r,y=M,S=R,o=0;return}var N=ma([l,E],n.properties);if(e(N,r,i,R,o)===!1)return!1;o++,l=E})===!1)return!1}}})}function VM(t,e,n){var r=n,i=!1;return oI(t,function(o,c,l,d,y){i===!1&&n===void 0?r=o:r=e(r,o,c,l,d,y),i=!0}),r}function sI(t,e){if(!t)throw new Error("geojson is required");pp(t,function(n,r,i){if(n.geometry!==null){var o=n.geometry.type,c=n.geometry.coordinates;switch(o){case"LineString":if(e(n,r,i,0,0)===!1)return!1;break;case"Polygon":for(var l=0;li?n:i,y=r>o?r:o;return[c,l,d,y]}var b1={exports:{}},lI={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(xm,function(){function n(O,G,U,Z,ue){(function ae(se,fe,ke,K,oe){for(;K>ke;){if(K-ke>600){var Ge=K-ke+1,Te=fe-ke+1,ot=Math.log(Ge),ft=.5*Math.exp(2*ot/3),At=.5*Math.sqrt(ot*ft*(Ge-ft)/Ge)*(Te-Ge/2<0?-1:1),Ke=Math.max(ke,Math.floor(fe-Te*ft/Ge+At)),Ft=Math.min(K,Math.floor(fe+(Ge-Te)*ft/Ge+At));ae(se,fe,Ke,Ft,oe)}var bt=se[fe],Rt=ke,Ot=K;for(r(se,ke,fe),oe(se[K],bt)>0&&r(se,ke,K);Rt0;)Ot--}oe(se[ke],bt)===0?r(se,ke,Ot):r(se,++Ot,K),Ot<=fe&&(ke=Ot+1),fe<=Ot&&(K=Ot-1)}})(O,G,U||0,Z||O.length-1,ue||i)}function r(O,G,U){var Z=O[G];O[G]=O[U],O[U]=Z}function i(O,G){return OG?1:0}var o=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function c(O,G,U){if(!U)return G.indexOf(O);for(var Z=0;Z=O.minX&&G.maxY>=O.minY}function N(O){return{children:O,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function B(O,G,U,Z,ue){for(var ae=[G,U];ae.length;)if(!((U=ae.pop())-(G=ae.pop())<=Z)){var se=G+Math.ceil((U-G)/Z/2)*Z;n(O,se,G,U,ue),ae.push(G,se,se,U)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(O){var G=this.data,U=[];if(!R(O,G))return U;for(var Z=this.toBBox,ue=[];G;){for(var ae=0;ae=0&&ue[G].children.length>this._maxEntries;)this._split(ue,G),G--;this._adjustParentBBoxes(Z,ue,G)},o.prototype._split=function(O,G){var U=O[G],Z=U.children.length,ue=this._minEntries;this._chooseSplitAxis(U,ue,Z);var ae=this._chooseSplitIndex(U,ue,Z),se=N(U.children.splice(ae,U.children.length-ae));se.height=U.height,se.leaf=U.leaf,l(U,this.toBBox),l(se,this.toBBox),G?O[G-1].children.push(se):this._splitRoot(U,se)},o.prototype._splitRoot=function(O,G){this.data=N([O,G]),this.data.height=O.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(O,G,U){for(var Z,ue,ae,se,fe,ke,K,oe=1/0,Ge=1/0,Te=G;Te<=U-G;Te++){var ot=d(O,0,Te,this.toBBox),ft=d(O,Te,U,this.toBBox),At=(ue=ot,ae=ft,se=void 0,fe=void 0,ke=void 0,K=void 0,se=Math.max(ue.minX,ae.minX),fe=Math.max(ue.minY,ae.minY),ke=Math.min(ue.maxX,ae.maxX),K=Math.min(ue.maxY,ae.maxY),Math.max(0,ke-se)*Math.max(0,K-fe)),Ke=C(ot)+C(ft);At=G;oe--){var Ge=O.children[oe];y(se,O.leaf?ue(Ge):Ge),fe+=A(se)}return fe},o.prototype._adjustParentBBoxes=function(O,G,U){for(var Z=U;Z>=0;Z--)y(G[Z],O)},o.prototype._condense=function(O){for(var G=O.length-1,U=void 0;G>=0;G--)O[G].children.length===0?G>0?(U=O[G-1].children).splice(U.indexOf(O[G]),1):this.clear():l(O[G],this.toBBox)},o})})(lI);var YM=lI.exports;const $M=J_(DM),KM=J_(qM);var Qx=Object.prototype.toString,uI=function(e){var n=Qx.call(e),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Qx.call(e.callee)==="[object Function]"),r},O0,ew;function JM(){if(ew)return O0;ew=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=uI,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),c=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(C){var A=C.constructor;return A&&A.prototype===C},y={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},S=function(){if(typeof window>"u")return!1;for(var C in window)try{if(!y["$"+C]&&e.call(window,C)&&window[C]!==null&&typeof window[C]=="object")try{d(window[C])}catch{return!0}}catch{return!0}return!1}(),E=function(C){if(typeof window>"u"||!S)return d(C);try{return d(C)}catch{return!1}};t=function(A){var M=A!==null&&typeof A=="object",R=n.call(A)==="[object Function]",N=r(A),B=M&&n.call(A)==="[object String]",O=[];if(!M&&!R&&!N)throw new TypeError("Object.keys called on a non-object");var G=c&&R;if(B&&A.length>0&&!e.call(A,0))for(var U=0;U0)for(var Z=0;Z"u"||!to?Xn:to(Uint8Array),Yc={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Xn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Xn:ArrayBuffer,"%ArrayIteratorPrototype%":vf&&to?to([][Symbol.iterator]()):Xn,"%AsyncFromSyncIteratorPrototype%":Xn,"%AsyncFunction%":Tf,"%AsyncGenerator%":Tf,"%AsyncGeneratorFunction%":Tf,"%AsyncIteratorPrototype%":Tf,"%Atomics%":typeof Atomics>"u"?Xn:Atomics,"%BigInt%":typeof BigInt>"u"?Xn:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Xn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Xn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Xn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":bk,"%eval%":eval,"%EvalError%":xk,"%Float32Array%":typeof Float32Array>"u"?Xn:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Xn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Xn:FinalizationRegistry,"%Function%":fI,"%GeneratorFunction%":Tf,"%Int8Array%":typeof Int8Array>"u"?Xn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Xn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Xn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":vf&&to?to(to([][Symbol.iterator]())):Xn,"%JSON%":typeof JSON=="object"?JSON:Xn,"%Map%":typeof Map>"u"?Xn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!vf||!to?Xn:to(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Xn:Promise,"%Proxy%":typeof Proxy>"u"?Xn:Proxy,"%RangeError%":wk,"%ReferenceError%":Sk,"%Reflect%":typeof Reflect>"u"?Xn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Xn:Set,"%SetIteratorPrototype%":typeof Set>"u"||!vf||!to?Xn:to(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Xn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":vf&&to?to(""[Symbol.iterator]()):Xn,"%Symbol%":vf?Symbol:Xn,"%SyntaxError%":zf,"%ThrowTypeError%":Ik,"%TypedArray%":Tk,"%TypeError%":Df,"%Uint8Array%":typeof Uint8Array>"u"?Xn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Xn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Xn:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Xn:Uint32Array,"%URIError%":Ek,"%WeakMap%":typeof WeakMap>"u"?Xn:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Xn:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Xn:WeakSet};if(to)try{null.error}catch(t){var Lk=to(to(t));Yc["%Error.prototype%"]=Lk}var Pk=function t(e){var n;if(e==="%AsyncFunction%")n=F0("async function () {}");else if(e==="%GeneratorFunction%")n=F0("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=F0("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&to&&(n=to(i.prototype))}return Yc[e]=n,n},ow={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Sm=S1,y_=hI,Mk=Sm.call(Function.call,Array.prototype.concat),kk=Sm.call(Function.apply,Array.prototype.splice),sw=Sm.call(Function.call,String.prototype.replace),v_=Sm.call(Function.call,String.prototype.slice),Ak=Sm.call(Function.call,RegExp.prototype.exec),Dk=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rk=/\\(\\)?/g,Nk=function(e){var n=v_(e,0,1),r=v_(e,-1);if(n==="%"&&r!=="%")throw new zf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new zf("invalid intrinsic syntax, expected opening `%`");var i=[];return sw(e,Dk,function(o,c,l,d){i[i.length]=l?sw(d,Rk,"$1"):c||o}),i},Ok=function(e,n){var r=e,i;if(y_(ow,r)&&(i=ow[r],r="%"+i[0]+"%"),y_(Yc,r)){var o=Yc[r];if(o===Tf&&(o=Pk(r)),typeof o>"u"&&!n)throw new Df("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new zf("intrinsic "+e+" does not exist!")},Fl=function(e,n){if(typeof e!="string"||e.length===0)throw new Df("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Df('"allowMissing" argument must be a boolean');if(Ak(/^%?[^%]*%?$/,e)===null)throw new zf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Nk(e),i=r.length>0?r[0]:"",o=Ok("%"+i+"%",n),c=o.name,l=o.value,d=!1,y=o.alias;y&&(i=y[0],kk(r,Mk([0,1],y)));for(var S=1,E=!0;S=r.length){var R=Xc(l,C);E=!!R,E&&"get"in R&&!("originalValue"in R.get)?l=R.get:l=l[C]}else E=y_(l,C),l=l[C];E&&!d&&(Yc[c]=l)}}return l},V0,aw;function E1(){if(aw)return V0;aw=1;var t=Fl,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return V0=e,V0}var zk=Fl,t_=zk("%Object.getOwnPropertyDescriptor%",!0);if(t_)try{t_([],"length")}catch{t_=null}var I1=t_,lw=E1(),Fk=cI,bf=pc,uw=I1,C1=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new bf("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new bf("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new bf("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new bf("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new bf("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new bf("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,d=!!uw&&uw(e,n);if(lw)lw(e,n,{configurable:c===null&&d?d.configurable:!c,enumerable:i===null&&d?d.enumerable:!i,value:r,writable:o===null&&d?d.writable:!o});else if(l||!i&&!o&&!c)e[n]=r;else throw new Fk("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},_v=E1(),pI=function(){return!!_v};pI.hasArrayLengthDefineBug=function(){if(!_v)return null;try{return _v([],"length",{value:1}).length!==1}catch{return!0}};var T1=pI,Bk=x1,Vk=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Uk=Object.prototype.toString,jk=Array.prototype.concat,cw=C1,Gk=function(t){return typeof t=="function"&&Uk.call(t)==="[object Function]"},dI=T1(),qk=function(t,e,n,r){if(e in t){if(r===!0){if(t[e]===n)return}else if(!Gk(r)||!r())return}dI?cw(t,e,n,!0):cw(t,e,n)},mI=function(t,e){var n=arguments.length>2?arguments[2]:{},r=Bk(e);Vk&&(r=jk.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i4294967295||Zk(n)!==n)throw new pw("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&fw){var c=fw(e,"length");c&&!c.configurable&&(i=!1),c&&!c.writable&&(o=!1)}return(i||o||!r)&&(Hk?hw(e,"length",n,!0,!0):hw(e,"length",n)),e};(function(t){var e=S1,n=Fl,r=Xk,i=pc,o=n("%Function.prototype.apply%"),c=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(c,o),d=E1(),y=n("%Math.max%");t.exports=function(C){if(typeof C!="function")throw new i("a function is required");var A=l(e,c,arguments);return r(A,1+y(0,C.length-(arguments.length-1)),!0)};var S=function(){return l(e,o,arguments)};d?d(t.exports,"apply",{value:S}):t.exports.apply=S})(gI);var dp=gI.exports,_I=Fl,yI=dp,Yk=yI(_I("String.prototype.indexOf")),Da=function(e,n){var r=_I(e,!!n);return typeof r=="function"&&Yk(e,".prototype.")>-1?yI(r):r},$k=x1,vI=ty(),bI=Da,dw=Object,Kk=bI("Array.prototype.push"),mw=bI("Object.prototype.propertyIsEnumerable"),Jk=vI?Object.getOwnPropertySymbols:null,xI=function(e,n){if(e==null)throw new TypeError("target must be an object");var r=dw(e);if(arguments.length===1)return r;for(var i=1;i2&&!!arguments[2];return(!r||pA)&&(fA?gw(e,"name",n,!0,!0):gw(e,"name",n)),e},gA=mA,_A=pc,yA=Object,II=gA(function(){if(this==null||this!==yA(this))throw new _A("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),vA=II,bA=hh.supportsDescriptors,xA=Object.getOwnPropertyDescriptor,CI=function(){if(bA&&/a/mig.flags==="gim"){var e=xA(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),n==="dy")return e.get}}return vA},wA=hh.supportsDescriptors,SA=CI,EA=Object.getOwnPropertyDescriptor,IA=Object.defineProperty,CA=TypeError,_w=Object.getPrototypeOf,TA=/a/,LA=function(){if(!wA||!_w)throw new CA("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=SA(),n=_w(TA),r=EA(n,"flags");return(!r||r.get!==e)&&IA(n,"flags",{configurable:!0,enumerable:!1,get:e}),e},PA=hh,MA=dp,kA=II,TI=CI,AA=LA,LI=MA(TI());PA(LI,{getPolyfill:TI,implementation:kA,shim:AA});var DA=LI,n_={exports:{}},RA=ty,fh=function(){return RA()&&!!Symbol.toStringTag},NA=fh(),OA=Da,yv=OA("Object.prototype.toString"),ny=function(e){return NA&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:yv(e)==="[object Arguments]"},PI=function(e){return ny(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&yv(e)!=="[object Array]"&&yv(e.callee)==="[object Function]"},zA=function(){return ny(arguments)}();ny.isLegacyArguments=PI;var MI=zA?ny:PI;const FA={},BA=Object.freeze(Object.defineProperty({__proto__:null,default:FA},Symbol.toStringTag,{value:"Module"})),VA=J_(BA);var L1=typeof Map=="function"&&Map.prototype,j0=Object.getOwnPropertyDescriptor&&L1?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,b_=L1&&j0&&typeof j0.get=="function"?j0.get:null,yw=L1&&Map.prototype.forEach,P1=typeof Set=="function"&&Set.prototype,G0=Object.getOwnPropertyDescriptor&&P1?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,x_=P1&&G0&&typeof G0.get=="function"?G0.get:null,vw=P1&&Set.prototype.forEach,UA=typeof WeakMap=="function"&&WeakMap.prototype,Zd=UA?WeakMap.prototype.has:null,jA=typeof WeakSet=="function"&&WeakSet.prototype,Xd=jA?WeakSet.prototype.has:null,GA=typeof WeakRef=="function"&&WeakRef.prototype,bw=GA?WeakRef.prototype.deref:null,qA=Boolean.prototype.valueOf,WA=Object.prototype.toString,HA=Function.prototype.toString,ZA=String.prototype.match,M1=String.prototype.slice,Ju=String.prototype.replace,XA=String.prototype.toUpperCase,xw=String.prototype.toLowerCase,kI=RegExp.prototype.test,ww=Array.prototype.concat,Il=Array.prototype.join,YA=Array.prototype.slice,Sw=Math.floor,vv=typeof BigInt=="function"?BigInt.prototype.valueOf:null,q0=Object.getOwnPropertySymbols,bv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ff=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Vo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ff||"symbol")?Symbol.toStringTag:null,AI=Object.prototype.propertyIsEnumerable,Ew=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Iw(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||kI.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Sw(-t):Sw(t);if(r!==t){var i=String(r),o=M1.call(e,i.length+1);return Ju.call(i,n,"$&_")+"."+Ju.call(Ju.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ju.call(e,n,"$&_")}var xv=VA,Cw=xv.custom,Tw=RI(Cw)?Cw:null,$A=function t(e,n,r,i){var o=n||{};if(Yu(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Yu(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=Yu(o,"customInspect")?o.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Yu(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Yu(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return OI(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var d=String(e);return l?Iw(e,d):d}if(typeof e=="bigint"){var y=String(e)+"n";return l?Iw(e,y):y}var S=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=S&&S>0&&typeof e=="object")return wv(e)?"[Array]":"[Object]";var E=d3(o,r);if(typeof i>"u")i=[];else if(NI(i,e)>=0)return"[Circular]";function C(Ge,Te,ot){if(Te&&(i=YA.call(i),i.push(Te)),ot){var ft={depth:o.depth};return Yu(o,"quoteStyle")&&(ft.quoteStyle=o.quoteStyle),t(Ge,ft,r+1,i)}return t(Ge,o,r+1,i)}if(typeof e=="function"&&!Lw(e)){var A=o3(e),M=Vg(e,C);return"[Function"+(A?": "+A:" (anonymous)")+"]"+(M.length>0?" { "+Il.call(M,", ")+" }":"")}if(RI(e)){var R=Ff?Ju.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):bv.call(e);return typeof e=="object"&&!Ff?Ed(R):R}if(h3(e)){for(var N="<"+xw.call(String(e.nodeName)),B=e.attributes||[],O=0;O",N}if(wv(e)){if(e.length===0)return"[]";var G=Vg(e,C);return E&&!p3(G)?"["+Sv(G,E)+"]":"[ "+Il.call(G,", ")+" ]"}if(QA(e)){var U=Vg(e,C);return!("cause"in Error.prototype)&&"cause"in e&&!AI.call(e,"cause")?"{ ["+String(e)+"] "+Il.call(ww.call("[cause]: "+C(e.cause),U),", ")+" }":U.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Il.call(U,", ")+" }"}if(typeof e=="object"&&c){if(Tw&&typeof e[Tw]=="function"&&xv)return xv(e,{depth:S-r});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(s3(e)){var Z=[];return yw&&yw.call(e,function(Ge,Te){Z.push(C(Te,e,!0)+" => "+C(Ge,e))}),Pw("Map",b_.call(e),Z,E)}if(u3(e)){var ue=[];return vw&&vw.call(e,function(Ge){ue.push(C(Ge,e))}),Pw("Set",x_.call(e),ue,E)}if(a3(e))return W0("WeakMap");if(c3(e))return W0("WeakSet");if(l3(e))return W0("WeakRef");if(t3(e))return Ed(C(Number(e)));if(r3(e))return Ed(C(vv.call(e)));if(n3(e))return Ed(qA.call(e));if(e3(e))return Ed(C(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===xm)return"{ [object globalThis] }";if(!JA(e)&&!Lw(e)){var ae=Vg(e,C),se=Ew?Ew(e)===Object.prototype:e instanceof Object||e.constructor===Object,fe=e instanceof Object?"":"null prototype",ke=!se&&Vo&&Object(e)===e&&Vo in e?M1.call(dc(e),8,-1):fe?"Object":"",K=se||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",oe=K+(ke||fe?"["+Il.call(ww.call([],ke||[],fe||[]),": ")+"] ":"");return ae.length===0?oe+"{}":E?oe+"{"+Sv(ae,E)+"}":oe+"{ "+Il.call(ae,", ")+" }"}return String(e)};function DI(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function KA(t){return Ju.call(String(t),/"/g,""")}function wv(t){return dc(t)==="[object Array]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function JA(t){return dc(t)==="[object Date]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function Lw(t){return dc(t)==="[object RegExp]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function QA(t){return dc(t)==="[object Error]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function e3(t){return dc(t)==="[object String]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function t3(t){return dc(t)==="[object Number]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function n3(t){return dc(t)==="[object Boolean]"&&(!Vo||!(typeof t=="object"&&Vo in t))}function RI(t){if(Ff)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!bv)return!1;try{return bv.call(t),!0}catch{}return!1}function r3(t){if(!t||typeof t!="object"||!vv)return!1;try{return vv.call(t),!0}catch{}return!1}var i3=Object.prototype.hasOwnProperty||function(t){return t in this};function Yu(t,e){return i3.call(t,e)}function dc(t){return WA.call(t)}function o3(t){if(t.name)return t.name;var e=ZA.call(HA.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function NI(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;ne.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return OI(M1.call(t,0,e.maxStringLength),e)+r}var i=Ju.call(Ju.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,f3);return DI(i,"single",e)}function f3(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+XA.call(e.toString(16))}function Ed(t){return"Object("+t+")"}function W0(t){return t+" { ? }"}function Pw(t,e,n,r){var i=r?Sv(n,r):Il.call(n,", ");return t+" ("+e+") {"+i+"}"}function p3(t){for(var e=0;e=0)return!1;return!0}function d3(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=Il.call(Array(t.indent+1)," ");else return null;return{base:n,prev:Il.call(Array(e+1),n)}}function Sv(t,e){if(t.length===0)return"";var n=` -`+e.prev+e.base;return n+Il.call(t,","+n)+` -`+e.prev}function Vg(t,e){var n=wv(t),r=[];if(n){r.length=t.length;for(var i=0;i=r)return n+1;var i=zw(e,n);if(i<55296||i>56319)return n+1;var o=zw(e,n+1);return o<56320||o>57343?n+1:n+2},Z0=function(e){var n=0;return{next:function(){var i=n>=e.length,o;return i||(o=e[n],n+=1),{done:i,value:o}}}},Fw=function(e,n){if(F3(e)||Dw(e))return Z0(e);if(B3(e)){var r=0;return{next:function(){var o=G3(e,r),c=j3(e,r,o);return r=o,{done:o>e.length,value:c}}}}if(n&&typeof e["_es6-shim iterator_"]<"u")return e["_es6-shim iterator_"]()};if(!V3&&!U3)n_.exports=function(e){if(e!=null)return Fw(e,!0)};else{var q3=jI,W3=qI,Bw=qa("Map.prototype.forEach",!0),Vw=qa("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var Uw=qa("Map.prototype.iterator",!0),jw=qa("Set.prototype.iterator",!0);var Gw=qa("Map.prototype.@@iterator",!0)||qa("Map.prototype._es6-shim iterator_",!0),qw=qa("Set.prototype.@@iterator",!0)||qa("Set.prototype._es6-shim iterator_",!0),H3=function(e){if(q3(e)){if(Uw)return Rw(Uw(e));if(Gw)return Gw(e);if(Bw){var n=[];return Bw(e,function(i,o){Ow(n,[o,i])}),Z0(n)}}if(W3(e)){if(jw)return Rw(jw(e));if(qw)return qw(e);if(Vw){var r=[];return Vw(e,function(i){Ow(r,i)}),Z0(r)}}};n_.exports=function(e){return H3(e)||Fw(e)}}}var Z3=n_.exports,Ww=function(t){return t!==t},WI=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||Ww(e)&&Ww(n))},X3=WI,HI=function(){return typeof Object.is=="function"?Object.is:X3},Y3=HI,$3=hh,K3=function(){var e=Y3();return $3(Object,{is:e},{is:function(){return Object.is!==e}}),e},J3=hh,Q3=dp,e4=WI,ZI=HI,t4=K3,XI=Q3(ZI(),Object);J3(XI,{getPolyfill:ZI,implementation:e4,shim:t4});var n4=XI,r4=dp,YI=Da,i4=Fl,Ev=i4("%ArrayBuffer%",!0),r_=YI("ArrayBuffer.prototype.byteLength",!0),o4=YI("Object.prototype.toString"),Hw=!!Ev&&!r_&&new Ev(0).slice,Zw=!!Hw&&r4(Hw),$I=r_||Zw?function(e){if(!e||typeof e!="object")return!1;try{return r_?r_(e):Zw(e,0),!0}catch{return!1}}:Ev?function(e){return o4(e)==="[object ArrayBuffer]"}:function(e){return!1},s4=Date.prototype.getDay,a4=function(e){try{return s4.call(e),!0}catch{return!1}},l4=Object.prototype.toString,u4="[object Date]",c4=fh(),h4=function(e){return typeof e!="object"||e===null?!1:c4?a4(e):l4.call(e)===u4},Iv=Da,KI=fh(),JI,QI,Cv,Tv;if(KI){JI=Iv("Object.prototype.hasOwnProperty"),QI=Iv("RegExp.prototype.exec"),Cv={};var X0=function(){throw Cv};Tv={toString:X0,valueOf:X0},typeof Symbol.toPrimitive=="symbol"&&(Tv[Symbol.toPrimitive]=X0)}var f4=Iv("Object.prototype.toString"),p4=Object.getOwnPropertyDescriptor,d4="[object RegExp]",m4=KI?function(e){if(!e||typeof e!="object")return!1;var n=p4(e,"lastIndex"),r=n&&JI(n,"value");if(!r)return!1;try{QI(e,Tv)}catch(i){return i===Cv}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:f4(e)===d4},g4=Da,Xw=g4("SharedArrayBuffer.prototype.byteLength",!0),_4=Xw?function(e){if(!e||typeof e!="object")return!1;try{return Xw(e),!0}catch{return!1}}:function(e){return!1},y4=Number.prototype.toString,v4=function(e){try{return y4.call(e),!0}catch{return!1}},b4=Object.prototype.toString,x4="[object Number]",w4=fh(),S4=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:w4?v4(e):b4.call(e)===x4},eC=Da,E4=eC("Boolean.prototype.toString"),I4=eC("Object.prototype.toString"),C4=function(e){try{return E4(e),!0}catch{return!1}},T4="[object Boolean]",L4=fh(),P4=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:L4&&Symbol.toStringTag in e?C4(e):I4(e)===T4},Lv={exports:{}},M4=Object.prototype.toString,k4=w1();if(k4){var A4=Symbol.prototype.toString,D4=/^Symbol\(.*\)$/,R4=function(e){return typeof e.valueOf()!="symbol"?!1:D4.test(A4.call(e))};Lv.exports=function(e){if(typeof e=="symbol")return!0;if(M4.call(e)!=="[object Symbol]")return!1;try{return R4(e)}catch{return!1}}}else Lv.exports=function(e){return!1};var N4=Lv.exports,Pv={exports:{}},Yw=typeof BigInt<"u"&&BigInt,O4=function(){return typeof Yw=="function"&&typeof BigInt=="function"&&typeof Yw(42)=="bigint"&&typeof BigInt(42)=="bigint"},z4=O4();if(z4){var F4=BigInt.prototype.valueOf,B4=function(e){try{return F4.call(e),!0}catch{}return!1};Pv.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:B4(e)}}else Pv.exports=function(e){return!1};var V4=Pv.exports,U4=VI,j4=S4,G4=P4,q4=N4,W4=V4,H4=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(U4(e))return"String";if(j4(e))return"Number";if(G4(e))return"Boolean";if(q4(e))return"Symbol";if(W4(e))return"BigInt"},E_=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,$w=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,I_;E_||(I_=function(e){return!1});var Mv=E_?E_.prototype.has:null,Y0=$w?$w.prototype.has:null;!I_&&!Mv&&(I_=function(e){return!1});var Z4=I_||function(e){if(!e||typeof e!="object")return!1;try{if(Mv.call(e,Mv),Y0)try{Y0.call(e,Y0)}catch{return!0}return e instanceof E_}catch{}return!1},kv={exports:{}},X4=Fl,tC=Da,Y4=X4("%WeakSet%",!0),$0=tC("WeakSet.prototype.has",!0);if($0){var K0=tC("WeakMap.prototype.has",!0);kv.exports=function(e){if(!e||typeof e!="object")return!1;try{if($0(e,$0),K0)try{K0(e,K0)}catch{return!0}return e instanceof Y4}catch{}return!1}}else kv.exports=function(e){return!1};var $4=kv.exports,K4=jI,J4=qI,Q4=Z4,eD=$4,tD=function(e){if(e&&typeof e=="object"){if(K4(e))return"Map";if(J4(e))return"Set";if(Q4(e))return"WeakMap";if(eD(e))return"WeakSet"}return!1},nC=Function.prototype.toString,Pf=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Av,i_;if(typeof Pf=="function"&&typeof Object.defineProperty=="function")try{Av=Object.defineProperty({},"length",{get:function(){throw i_}}),i_={},Pf(function(){throw 42},null,Av)}catch(t){t!==i_&&(Pf=null)}else Pf=null;var nD=/^\s*class\b/,Dv=function(e){try{var n=nC.call(e);return nD.test(n)}catch{return!1}},J0=function(e){try{return Dv(e)?!1:(nC.call(e),!0)}catch{return!1}},o_=Object.prototype.toString,rD="[object Object]",iD="[object Function]",oD="[object GeneratorFunction]",sD="[object HTMLAllCollection]",aD="[object HTML document.all class]",lD="[object HTMLCollection]",uD=typeof Symbol=="function"&&!!Symbol.toStringTag,cD=!(0 in[,]),Rv=function(){return!1};if(typeof document=="object"){var hD=document.all;o_.call(hD)===o_.call(document.all)&&(Rv=function(e){if((cD||!e)&&(typeof e>"u"||typeof e=="object"))try{var n=o_.call(e);return(n===sD||n===aD||n===lD||n===rD)&&e("")==null}catch{}return!1})}var fD=Pf?function(e){if(Rv(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Pf(e,null,Av)}catch(n){if(n!==i_)return!1}return!Dv(e)&&J0(e)}:function(e){if(Rv(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(uD)return J0(e);if(Dv(e))return!1;var n=o_.call(e);return n!==iD&&n!==oD&&!/^\[object HTML/.test(n)?!1:J0(e)},pD=fD,dD=Object.prototype.toString,rC=Object.prototype.hasOwnProperty,mD=function(e,n,r){for(var i=0,o=e.length;i=3&&(i=r),dD.call(e)==="[object Array]"?mD(e,n,i):typeof e=="string"?gD(e,n,i):_D(e,n,i)},vD=yD,bD=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Q0=bD,xD=typeof globalThis>"u"?xm:globalThis,wD=function(){for(var e=[],n=0;n"u"?xm:globalThis,Nv=SD(),O1=N1("String.prototype.slice"),ev=Object.getPrototypeOf,ID=N1("Array.prototype.indexOf",!0)||function(e,n){for(var r=0;r-1?n:n!=="Object"?!1:TD(e)}return s_?CD(e):null},PD=Da,Qw=PD("ArrayBuffer.prototype.byteLength",!0),MD=$I,kD=function(e){return MD(e)?Qw?Qw(e):e.byteLength:NaN},oC=uA,Bl=Da,e2=DA,AD=Fl,Bf=Z3,DD=FI,t2=n4,n2=MI,r2=BI,i2=$I,o2=h4,s2=m4,a2=_4,l2=x1,u2=H4,c2=tD,h2=LD,f2=kD,p2=Bl("SharedArrayBuffer.prototype.byteLength",!0),d2=Bl("Date.prototype.getTime"),tv=Object.getPrototypeOf,m2=Bl("Object.prototype.toString"),L_=AD("%Set%",!0),Ov=Bl("Map.prototype.has",!0),P_=Bl("Map.prototype.get",!0),g2=Bl("Map.prototype.size",!0),M_=Bl("Set.prototype.add",!0),sC=Bl("Set.prototype.delete",!0),k_=Bl("Set.prototype.has",!0),a_=Bl("Set.prototype.size",!0);function _2(t,e,n,r){for(var i=Bf(t),o;(o=i.next())&&!o.done;)if(Xa(e,o.value,n,r))return sC(t,o.value),!0;return!1}function aC(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function RD(t,e,n,r,i,o){var c=aC(n);if(c!=null)return c;var l=P_(e,c),d=oC({},i,{strict:!1});return typeof l>"u"&&!Ov(e,c)||!Xa(r,l,d,o)?!1:!Ov(t,c)&&Xa(r,l,d,o)}function ND(t,e,n){var r=aC(n);return r??(k_(e,r)&&!k_(t,r))}function y2(t,e,n,r,i,o){for(var c=Bf(t),l,d;(l=c.next())&&!l.done;)if(d=l.value,Xa(n,d,i,o)&&Xa(r,P_(e,d),i,o))return sC(t,d),!0;return!1}function Xa(t,e,n,r){var i=n||{};if(i.strict?t2(t,e):t===e)return!0;var o=u2(t),c=u2(e);if(o!==c)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return i.strict?t2(t,e):t==e;var l=r.has(t),d=r.has(e),y;if(l&&d){if(r.get(t)===r.get(e))return!0}else y={};return l||r.set(t,y),d||r.set(e,y),FD(t,e,i,r)}function v2(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function OD(t,e,n,r){if(a_(t)!==a_(e))return!1;for(var i=Bf(t),o=Bf(e),c,l,d;(c=i.next())&&!c.done;)if(c.value&&typeof c.value=="object")d||(d=new L_),M_(d,c.value);else if(!k_(e,c.value)){if(n.strict||!ND(t,e,c.value))return!1;d||(d=new L_),M_(d,c.value)}if(d){for(;(l=o.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!_2(d,l.value,n.strict,r))return!1}else if(!n.strict&&!k_(t,l.value)&&!_2(d,l.value,n.strict,r))return!1;return a_(d)===0}return!0}function zD(t,e,n,r){if(g2(t)!==g2(e))return!1;for(var i=Bf(t),o=Bf(e),c,l,d,y,S,E;(c=i.next())&&!c.done;)if(y=c.value[0],S=c.value[1],y&&typeof y=="object")d||(d=new L_),M_(d,y);else if(E=P_(e,y),typeof E>"u"&&!Ov(e,y)||!Xa(S,E,n,r)){if(n.strict||!RD(t,e,y,S,n,r))return!1;d||(d=new L_),M_(d,y)}if(d){for(;(l=o.next())&&!l.done;)if(y=l.value[0],E=l.value[1],y&&typeof y=="object"){if(!y2(d,t,y,E,n,r))return!1}else if(!n.strict&&(!t.has(y)||!Xa(P_(t,y),E,n,r))&&!y2(d,t,y,E,oC({},n,{strict:!1}),r))return!1;return a_(d)===0}return!0}function FD(t,e,n,r){var i,o;if(typeof t!=typeof e||t==null||e==null||m2(t)!==m2(e)||n2(t)!==n2(e))return!1;var c=r2(t),l=r2(e);if(c!==l)return!1;var d=t instanceof Error,y=e instanceof Error;if(d!==y||(d||y)&&(t.name!==e.name||t.message!==e.message))return!1;var S=s2(t),E=s2(e);if(S!==E||(S||E)&&(t.source!==e.source||e2(t)!==e2(e)))return!1;var C=o2(t),A=o2(e);if(C!==A||(C||A)&&d2(t)!==d2(e)||n.strict&&tv&&tv(t)!==tv(e))return!1;var M=h2(t),R=h2(e);if(M!==R)return!1;if(M||R){if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(ue[i]!=ae[i])return!1;for(i=ue.length-1;i>=0;i--)if(o=ue[i],!Xa(t[o],e[o],n,r))return!1;var se=c2(t),fe=c2(e);return se!==fe?!1:se==="Set"||fe==="Set"?OD(t,e,n,r):se==="Map"?zD(t,e,n,r):!0}var BD=function(e,n,r){return Xa(e,n,r,DD())};const lC=d1(BD);var VD=Object.defineProperty,yr=(t,e)=>VD(t,"name",{value:e,configurable:!0}),UD=class{constructor(e){this.direction=!1,this.compareProperties=!0;var n,r,i;this.precision=10**-((n=e==null?void 0:e.precision)!=null?n:17),this.direction=(r=e==null?void 0:e.direction)!=null?r:!1,this.compareProperties=(i=e==null?void 0:e.compareProperties)!=null?i:!0}compare(e,n){if(e.type!==n.type||!Fd(e,n))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,n.coordinates);case"LineString":return this.compareLine(e.coordinates,n.coordinates);case"Polygon":return this.comparePolygon(e,n);case"GeometryCollection":return this.compareGeometryCollection(e,n);case"Feature":return this.compareFeature(e,n);case"FeatureCollection":return this.compareFeatureCollection(e,n);default:if(e.type.startsWith("Multi")){const r=zv(e),i=zv(n);return r.every(o=>i.some(c=>this.compare(o,c)))}}return!1}compareCoord(e,n){return e.length===n.length&&e.every((r,i)=>Math.abs(r-n[i])=0&&(r=[].concat(e.slice(i,e.length),e.slice(1,i+1))),r}comparePath(e,n){return e.every((r,i)=>this.compareCoord(r,n[i]))}comparePolygon(e,n){if(this.compareLine(e.coordinates[0],n.coordinates[0],1,!0)){const r=e.coordinates.slice(1,e.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length);return r.every(o=>i.some(c=>this.compareLine(o,c,1,!0)))}return!1}compareGeometryCollection(e,n){return Fd(e.geometries,n.geometries)&&this.compareBBox(e,n)&&e.geometries.every((r,i)=>this.compare(r,n.geometries[i]))}compareFeature(e,n){return e.id===n.id&&(this.compareProperties?lC(e.properties,n.properties):!0)&&this.compareBBox(e,n)&&this.compare(e.geometry,n.geometry)}compareFeatureCollection(e,n){return Fd(e.features,n.features)&&this.compareBBox(e,n)&&e.features.every((r,i)=>this.compare(r,n.features[i]))}compareBBox(e,n){return!e.bbox&&!n.bbox||(e.bbox&&n.bbox?this.compareCoord(e.bbox,n.bbox):!1)}};yr(UD,"GeojsonEquality");function Fd(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length}yr(Fd,"sameLength");function zv(t){return t.coordinates.map(e=>({type:t.type.replace("Multi",""),coordinates:e}))}yr(zv,"explode");var Fs=63710088e-1,uC={centimeters:Fs*100,centimetres:Fs*100,degrees:360/(2*Math.PI),feet:Fs*3.28084,inches:Fs*39.37,kilometers:Fs/1e3,kilometres:Fs/1e3,meters:Fs,metres:Fs,miles:Fs/1609.344,millimeters:Fs*1e3,millimetres:Fs*1e3,nauticalmiles:Fs/1852,radians:1,yards:Fs*1.0936},b2={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ll(t,e,n={}){const r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}yr(Ll,"feature");function jD(t,e,n={}){switch(t){case"Point":return su(e).geometry;case"LineString":return uu(e).geometry;case"Polygon":return z1(e).geometry;case"MultiPoint":return hC(e).geometry;case"MultiLineString":return cC(e).geometry;case"MultiPolygon":return fC(e).geometry;default:throw new Error(t+" is invalid")}}yr(jD,"geometry");function su(t,e,n={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!A_(t[0])||!A_(t[1]))throw new Error("coordinates must contain numbers");return Ll({type:"Point",coordinates:t},e,n)}yr(su,"point");function GD(t,e,n={}){return ry(t.map(r=>su(r,e)),n)}yr(GD,"points");function z1(t,e,n={}){for(const i of t){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;oz1(r,e)),n)}yr(qD,"polygons");function uu(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return Ll({type:"LineString",coordinates:t},e,n)}yr(uu,"lineString");function WD(t,e,n={}){return ry(t.map(r=>uu(r,e)),n)}yr(WD,"lineStrings");function ry(t,e={}){const n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}yr(ry,"featureCollection");function cC(t,e,n={}){return Ll({type:"MultiLineString",coordinates:t},e,n)}yr(cC,"multiLineString");function hC(t,e,n={}){return Ll({type:"MultiPoint",coordinates:t},e,n)}yr(hC,"multiPoint");function fC(t,e,n={}){return Ll({type:"MultiPolygon",coordinates:t},e,n)}yr(fC,"multiPolygon");function HD(t,e,n={}){return Ll({type:"GeometryCollection",geometries:t},e,n)}yr(HD,"geometryCollection");function ZD(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,e||0);return Math.round(t*n)/n}yr(ZD,"round");function pC(t,e="kilometers"){const n=uC[e];if(!n)throw new Error(e+" units is invalid");return t*n}yr(pC,"radiansToLength");function F1(t,e="kilometers"){const n=uC[e];if(!n)throw new Error(e+" units is invalid");return t/n}yr(F1,"lengthToRadians");function XD(t,e){return dC(F1(t,e))}yr(XD,"lengthToDegrees");function YD(t){let e=t%360;return e<0&&(e+=360),e}yr(YD,"bearingToAzimuth");function dC(t){return t%(2*Math.PI)*180/Math.PI}yr(dC,"radiansToDegrees");function $D(t){return t%360*Math.PI/180}yr($D,"degreesToRadians");function KD(t,e="kilometers",n="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return pC(F1(t,e),n)}yr(KD,"convertLength");function JD(t,e="meters",n="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");const r=b2[e];if(!r)throw new Error("invalid original units");const i=b2[n];if(!i)throw new Error("invalid final units");return t/r*i}yr(JD,"convertArea");function A_(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}yr(A_,"isNumber");function B1(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}yr(B1,"isObject");function QD(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(e=>{if(!A_(e))throw new Error("bbox must only contain numbers")})}yr(QD,"validateBBox");function eR(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}yr(eR,"validateId");var tR=Object.defineProperty,Co=(t,e)=>tR(t,"name",{value:e,configurable:!0});function gp(t,e,n){if(t!==null)for(var r,i,o,c,l,d,y,S=0,E=0,C,A=t.type,M=A==="FeatureCollection",R=A==="Feature",N=M?t.features.length:1,B=0;Bd||M>y||R>S){l=E,d=r,y=M,S=R,o=0;return}var N=uu([l,E],n.properties);if(e(N,r,i,R,o)===!1)return!1;o++,l=E})===!1)return!1}}})}Co(_C,"segmentEach");function lR(t,e,n){var r=n,i=!1;return _C(t,function(o,c,l,d,y){i===!1&&n===void 0?r=o:r=e(r,o,c,l,d,y),i=!0}),r}Co(lR,"segmentReduce");function yC(t,e){if(!t)throw new Error("geojson is required");iy(t,function(n,r,i){if(n.geometry!==null){var o=n.geometry.type,c=n.geometry.coordinates;switch(o){case"LineString":if(e(n,r,i,0,0)===!1)return!1;break;case"Polygon":for(var l=0;lfR(t,"name",{value:e,configurable:!0});function U1(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return gp(t,r=>{n[0]>r[0]&&(n[0]=r[0]),n[1]>r[1]&&(n[1]=r[1]),n[2] line1 must only contain 2 coordinates");if(r.length!==2)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],c=n[1][0],l=n[1][1],d=r[0][0],y=r[0][1],S=r[1][0],E=r[1][1],C=(E-y)*(c-i)-(S-d)*(l-o),A=(S-d)*(o-y)-(E-y)*(i-d),M=(c-i)*(o-y)-(l-o)*(i-d);if(C===0)return null;var R=A/C,N=M/C;if(R>=0&&R<=1&&N>=0&&N<=1){var B=i+R*(c-i),O=o+R*(l-o);return vs([B,O])}return null}function xR(t,e,n){n===void 0&&(n={});var r=vs([1/0,1/0],{dist:1/0}),i=0;return pp(t,function(o){for(var c=Of(o),l=0;l0&&(N=R.features[0],N.properties.dist=Sd(e,N,n),N.properties.location=i+Sd(d,N,n)),d.properties.dist{if(!this.active)return;const l=[c.point.x-wR,c.point.y],d=this.map.unproject(c.point).distanceTo(this.map.unproject(l));this.inner.onMouseMove(c.lngLat.lng,c.lngLat.lat,d)&&(this.redraw(),this.dataUpdated())},this.onClick=()=>{this.active&&(this.inner.onClick(),this.redraw(),this.dataUpdated())},this.onDoubleClick=c=>{this.active&&(c.preventDefault(),this.inner.onClick(),this.finish())},this.onDragStart=()=>{this.active&&this.inner.onDragStart()&&this.map.dragPan.disable()},this.onMouseUp=()=>{this.active&&this.inner.onMouseUp()&&this.map.dragPan.enable()},this.onKeyDown=c=>{if(!this.active)return;let l=c.target.tagName;l=="INPUT"||l=="TEXTAREA"||c.key=="Escape"&&(c.stopPropagation(),this.cancel())},this.onKeyPress=c=>{if(!this.active)return;let l=c.target.tagName;l=="INPUT"||l=="TEXTAREA"||(c.key=="Enter"?(c.stopPropagation(),this.finish()):c.key=="s"||c.key=="S"?(c.stopPropagation(),this.inner.toggleSnapMode(),this.redraw()):c.key=="z"&&c.ctrlKey&&this.undo())},this.map=e,console.time("Deserialize and setup JsRouteSnapper"),this.inner=new m_(n),console.timeEnd("Deserialize and setup JsRouteSnapper"),this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.routeToolGj=r,this.snapMode=i,this.undoLength=o,this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("dragstart",this.onDragStart),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keypress",this.onKeyPress)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("dragstart",this.onDragStart),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keypress",this.onKeyPress)}startRoute(){this.active||(this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}startArea(){this.active||(this.inner.setAreaMode(),this.active=!0,this.map.boxZoom.disable(),this.map.doubleClickZoom.disable())}stop(){this.active=!1,this.inner.clearState(),this.redraw(),this.map.boxZoom.enable(),this.map.doubleClickZoom.enable()}editExistingRoute(e){this.active&&window.alert("Bug: editExistingRoute called when tool is already active"),e.properties.waypoints||(e.properties.waypoints=[{lon:e.geometry.coordinates[0][0],lat:e.geometry.coordinates[0][1],snapped:!0},{lon:e.geometry.coordinates[e.geometry.coordinates.length-1][0],lat:e.geometry.coordinates[e.geometry.coordinates.length-1][1],snapped:!0}]),this.startRoute(),this.inner.editExisting(e.properties.waypoints),this.redraw()}editExistingArea(e){this.active&&window.alert("Bug: editExistingArea called when tool is already active"),e.properties.waypoints||window.alert("Bug: editExistingArea called for a polygon not produced by the route-snapper"),this.startArea(),this.inner.editExisting(e.properties.waypoints),this.redraw()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}isActive(){return this.active}finish(){let e=this.inner.toFinalFeature();if(e)for(let n of this.eventListenersSuccess)n(JSON.parse(e));else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){this.inner.clearState(),this.finish()}setRouteConfig(e){this.inner.setRouteConfig(e),this.redraw()}addSnappedWaypoint(e){this.inner.addSnappedWaypoint(e[0],e[1]),this.redraw()}undo(){this.inner.undo(),this.redraw()}toggleSnapMode(){this.inner.toggleSnapMode(),this.redraw()}redraw(){let e=JSON.parse(this.inner.renderGeojson());this.routeToolGj.set(e),this.map.getCanvas().style.cursor=e.cursor,this.snapMode.set(e.snap_mode),this.undoLength.set(e.undo_length)}dataUpdated(){let e=this.inner.toFinalFeature();if(e)for(let n of this.eventListenersUpdated)n(JSON.parse(e))}}const Fv="MZEJTanw3WpxRvt7qDfo";let Pl=Gn(null),Bv=Gn("streets-v2"),nm=Gn(!1),nc=Gn(""),D_=Gn(!0),Zi=Gn(null),Vv=Gn(new Q_.LngLat(0,0)),Uv=Gn(new Q_.LngLat(0,0)),S2=Gn(1),Xu=Gn(1),Tn=Gn({mode:"title"}),jv=Gn("walk_cycle_only"),E2=Gn(!1);function Vf(){let t=rs(nc);t||window.alert("Autosave failed; no projectName set?!"),window.localStorage.setItem(t,rs(Zi).toSavefile())}function I2(t){let e,n;return e=new $_({props:{$$slots:{default:[ER,({dialog:r})=>({3:r}),({dialog:r})=>r?8:0]},$$scope:{ctx:t}}}),e.$on("close",t[2]),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&24&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function ER(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M;function R(){return t[1](t[3])}return{c(){e=pe("h1"),e.textContent="The low-traffic neighbourhood (LTN) tool, v2",n=je(),r=pe("p"),r.innerHTML=`This is an experimental - version of the - A/B Street LTN tool - . Most parts of it do not work yet, and you should probably use the other version - of the tool instead.`,i=je(),o=pe("p"),o.textContent="To use this tool, you need to:",c=je(),l=pe("ol"),l.innerHTML=`
  • Choose your study area to analyze
  • Define one or more neighbourhood boundaries
  • Optionally, fix the basemap data on existing modal filters, turn - restrictions, one-ways, etc
  • Create one or more proposals with new modal filters, and explore their - effects
  • `,d=je(),y=pe("p"),y.innerHTML=`This tool is created by Dustin Carlino - and relies heavily on - OpenStreetMap - data.`,S=je(),E=pe("center"),C=pe("button"),C.textContent="Start!"},m(N,B){be(N,e,B),be(N,n,B),be(N,r,B),be(N,i,B),be(N,o,B),be(N,c,B),be(N,l,B),be(N,d,B),be(N,y,B),be(N,S,B),be(N,E,B),te(E,C),A||(M=Lt(C,"click",R),A=!0)},p(N,B){t=N},d(N){N&&(ve(e),ve(n),ve(r),ve(i),ve(o),ve(c),ve(l),ve(d),ve(y),ve(S),ve(E)),A=!1,M()}}}function IR(t){let e,n,r=t[0]&&I2(t);return{c(){r&&r.c(),e=ki()},m(i,o){r&&r.m(i,o),be(i,e,o),n=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&ne(r,1)):(r=I2(i),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function CR(t,e,n){let r;return wt(t,D_,c=>n(0,r=c)),[r,c=>Vr(c).close(),()=>Ut(D_,r=!1,r)]}class TR extends Qt{constructor(e){super(),Jt(this,e,CR,IR,Ht,{})}}const LR="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAk0lEQVRIS+3U0Q2AIAwEUNjMUXQydRJH0zZB0wjGuwJfSsKfuWfO1hg6n9g5P3wPWKTSXe6EVstUNEjoloIVghAG0OxR7swgLEAjHoBCvACM1AAQUgJ0DL0nm67WwJom7XrBlhVl4arUAHYniuE1ABTuBeBwD0CFs4D92T12fp9v9iPrnJ8LBu0KC0Ch9qEfeK3sAPceHxk8hJ17AAAAAElFTkSuQmCC",PR="/ltn/assets/logo-97f2d067.svg";let MR=Date.now();function _p(t){return`${t}-${MR++}`}const j1=Symbol.for("svelte-maplibre");function ph(){return UE(j1)}function kR(t){let e=new WeakMap;return n=>{var c;let r=e.get(n.originalEvent);if(r!==void 0)return r;let o=(c=n.target.queryRenderedFeatures(n.point).find(l=>{var d;return(d=t.get(l.layer.id))==null?void 0:d.interactive}))==null?void 0:c.layer.id;return e.set(n.originalEvent,o),o}}function AR(){let t=new Map;return p1(j1,{map:Gn(null),source:D0(null),layer:D0(null),popupTarget:D0(null),cluster:Gn(),loadedImages:Gn(new Set),minzoom:Gn(0),maxzoom:Gn(24),layerEvent:Gn(null),layerInfo:t,eventTopMost:kR(t),markerClickManager:new zR})}function C2(t){return{subscribe:t.subscribe}}function G1({key:t,setPopupTarget:e=!1,setCluster:n=!1,setMouseEvent:r=!1}){let i=ph(),o=Gn(null),c=C2(o),l={...i,[t]:C2(o)};if(e&&(l.popupTarget=c),r){let d=Gn(null);l.layerEvent=d,i.layerEvent=d}return n&&(l.cluster=Gn()),p1(j1,l),{...i,self:o}}function DR(){return G1({key:"source",setCluster:!0})}function RR(t=!0){return G1({key:"layer",setPopupTarget:t,setMouseEvent:t})}function NR(){return G1({key:"popupTarget",setPopupTarget:!0,setMouseEvent:!0})}function OR(t){return"layerType"in t&&t.layerType==="deckgl"}class zR{constructor(){Ci(this,"_handlers",new Set)}add(e){this._handlers.add(e)}remove(e){this._handlers.delete(e)}handleClick(e){for(const n of this._handlers)n(e)}}function T2(t){let e;return n=>{if(n)for(let r in n){let i=e==null?void 0:e[r],o=n[r];i!==o&&t(r,o,i)}else if(e)for(let r in e)t(r,void 0,e[r]);e=n}}function FR(t,...e){let n=[t];for(let r of e)if(r)Array.isArray(r)&&r[0]===t?n.push(...r.slice(1)):n.push(r);else continue;if(n.length!==1)return n.length===2?n[1]:n}function BR(t){return t===!0?["has","point_count"]:t===!1?["!",["has","point_count"]]:void 0}function Uf(t,e){return["case",["boolean",["feature-state","hover"],!1],e,t]}var Kc=VR;function VR(t){var e,n,r;if(t){if(Array.isArray(t)){for(e=[],n=t.length,r=0;r{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function jR(t,e,n){let r,i,o,c,l,d,y,S,E,C,A,M,{$$slots:R={},$$scope:N}=e,{id:B=_p("layer")}=e,{source:O=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:U=void 0}=e,{beforeLayerType:Z=void 0}=e,{type:ue}=e,{paint:ae=void 0}=e,{layout:se=void 0}=e,{filter:fe=void 0}=e,{applyToClusters:ke=void 0}=e,{minzoom:K=void 0}=e,{maxzoom:oe=void 0}=e,{manageHoverState:Ge=!1}=e,{hovered:Te=null}=e,{interactive:ot=!0}=e,{hoverCursor:ft=void 0}=e,{eventsIfTopMost:At=!1}=e;const Ke=zl(),{map:Ft,source:bt,self:Rt,minzoom:Ot,maxzoom:ln,eventTopMost:Ln,layerInfo:an}=RR();wt(t,Ft,Le=>n(31,E=Le)),wt(t,bt,Le=>n(32,C=Le)),wt(t,Rt,Le=>n(0,S=Le)),wt(t,Ot,Le=>n(34,M=Le)),wt(t,ln,Le=>n(33,A=Le)),Hi(()=>{S&&E&&(an.delete(S),E==null||E.removeLayer(S))});let Xt;function En(Le){var me,tn;if(!ot||!S||!E||At&&Ln(Le)!==S)return;let rt=Le.features??[],gt=(tn=(me=rt[0])==null?void 0:me.properties)==null?void 0:tn.cluster_id,Nt={event:Le,map:E,clusterId:gt,layer:S,source:l,features:rt};Ke(Le.type,Nt)}function In(Le){var me,tn;if(!ot||!S||!E||At&&Ln(Le)!==S)return;ft&&(E.getCanvas().style.cursor=ft);let rt=Le.features??[];n(6,Te=rt[0]??null);let gt=(tn=(me=rt[0])==null?void 0:me.properties)==null?void 0:tn.cluster_id;Ke("mouseenter",{event:Le,map:E,clusterId:gt,layer:S,source:l,features:rt})}function rr(Le){var me,tn,Xe;if(!ot||!E)return;if(At&&Ln(Le)!==S){n(6,Te=null),Ge&&Xt!==void 0&&(E==null||E.setFeatureState({source:l,sourceLayer:G,id:Xt},{hover:!1}),Xt=void 0);return}E.getCanvas().style.cursor=ft;let rt=Le.features??[],gt=(tn=(me=rt[0])==null?void 0:me.properties)==null?void 0:tn.cluster_id,Nt=(Xe=rt[0])==null?void 0:Xe.id;Nt!==Xt&&(Ge&&(Xt!==void 0&&(E==null||E.setFeatureState({source:l,id:Xt,sourceLayer:G},{hover:!1})),E==null||E.setFeatureState({source:l,id:Nt,sourceLayer:G},{hover:!0})),Xt=Nt,n(6,Te=rt[0]??null)),Ke("mousemove",{event:Le,map:E,clusterId:gt,layer:S,source:l,features:rt})}function mt(Le){if(!(!ot||!S||!E)){if(ft&&(E.getCanvas().style.cursor=""),n(6,Te=null),Ge&&Xt!==void 0){const rt={source:l,id:Xt,sourceLayer:G};E==null||E.setFeatureState(rt,{hover:!1}),Xt=void 0}Ke("mouseleave",{map:E,layer:S,source:l})}}let Dt=!0;function Sn(Le){E&&(E.off("click",Le,En),E.off("dblclick",Le,En),E.off("contextmenu",Le,En),E.off("mouseenter",Le,In),E.off("mousemove",Le,rr),E.off("mouseleave",Le,mt))}return Hi(()=>{E&&S&&Sn(S)}),t.$$set=Le=>{"id"in Le&&n(7,B=Le.id),"source"in Le&&n(8,O=Le.source),"sourceLayer"in Le&&n(9,G=Le.sourceLayer),"beforeId"in Le&&n(10,U=Le.beforeId),"beforeLayerType"in Le&&n(11,Z=Le.beforeLayerType),"type"in Le&&n(12,ue=Le.type),"paint"in Le&&n(13,ae=Le.paint),"layout"in Le&&n(14,se=Le.layout),"filter"in Le&&n(15,fe=Le.filter),"applyToClusters"in Le&&n(16,ke=Le.applyToClusters),"minzoom"in Le&&n(17,K=Le.minzoom),"maxzoom"in Le&&n(18,oe=Le.maxzoom),"manageHoverState"in Le&&n(19,Ge=Le.manageHoverState),"hovered"in Le&&n(6,Te=Le.hovered),"interactive"in Le&&n(20,ot=Le.interactive),"hoverCursor"in Le&&n(21,ft=Le.hoverCursor),"eventsIfTopMost"in Le&&n(22,At=Le.eventsIfTopMost),"$$scope"in Le&&n(35,N=Le.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&65536&&n(30,r=BR(ke)),t.$$.dirty[0]&1073774592&&n(24,i=FR("all",r,fe)),t.$$.dirty[0]&131072|t.$$.dirty[1]&8&&n(26,o=K??M),t.$$.dirty[0]&262144|t.$$.dirty[1]&4&&n(25,c=oe??A),t.$$.dirty[0]&256|t.$$.dirty[1]&2&&n(29,l=O||C),t.$$.dirty[0]&654343809|t.$$.dirty[1]&1&&E&&S!==B&&l){S&&(Sn(S),an.delete(S));let Le=U;if(!U&&Z){let rt=E.getStyle().layers,gt=typeof Z=="function"?Z:me=>me.type===Z,Nt=rt==null?void 0:rt.find(gt);Nt&&(Le=Nt.id)}Ut(Rt,S=B,S),E.addLayer(Kc({id:S,type:ue,source:l,"source-layer":G,filter:i,paint:ae,layout:se,minzoom:o,maxzoom:c}),Le),n(23,Dt=!0),E.on("click",S,En),E.on("dblclick",S,En),E.on("contextmenu",S,En),E.on("mouseenter",S,In),E.on("mousemove",S,rr),E.on("mouseleave",S,mt)}t.$$.dirty[0]&1048577&&S&&an.set(S,{interactive:ot}),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(28,d=S?T2((Le,rt)=>{E!=null&&E.style._loaded?E.setPaintProperty(S,Le,rt):E==null||E.once("styledata",()=>E==null?void 0:E.setPaintProperty(S,Le,rt))}):void 0),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(27,y=S?T2((Le,rt)=>{E!=null&&E.style._loaded?E.setLayoutProperty(S,Le,rt):E==null||E.once("styledata",()=>E==null?void 0:E.setLayoutProperty(S,Le,rt))}):void 0),t.$$.dirty[0]&268443648&&(d==null||d(ae)),t.$$.dirty[0]&134234112&&(y==null||y(se)),t.$$.dirty[0]&100663297|t.$$.dirty[1]&1&&S&&(E==null||E.setLayerZoomRange(S,o,c)),t.$$.dirty[0]&25165825|t.$$.dirty[1]&1&&S&&(Dt?n(23,Dt=!1):E==null||E.setFilter(S,i))},[S,Ft,bt,Rt,Ot,ln,Te,B,O,G,U,Z,ue,ae,se,fe,ke,K,oe,Ge,ot,ft,At,Dt,i,c,o,y,d,l,r,E,C,A,M,N,R]}let oy=class extends Qt{constructor(e){super(),Jt(this,e,jR,UR,Ht,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}};function GR(t){let e;const n=t[16].default,r=hr(n,t,t[24],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&16777216)&&pr(r,n,i,i[24],e?fr(n,i[24],o,null):dr(i[24]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function qR(t){let e,n,r;function i(c){t[17](c)}let o={id:t[1],type:"circle",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],applyToClusters:t[9],minzoom:t[10],maxzoom:t[11],hoverCursor:t[12],manageHoverState:t[13],eventsIfTopMost:t[14],interactive:t[15],$$slots:{default:[GR]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new oy({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[18]),e.$on("dblclick",t[19]),e.$on("contextmenu",t[20]),e.$on("mouseenter",t[21]),e.$on("mousemove",t[22]),e.$on("mouseleave",t[23]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.applyToClusters=c[9]),l&1024&&(d.minzoom=c[10]),l&2048&&(d.maxzoom=c[11]),l&4096&&(d.hoverCursor=c[12]),l&8192&&(d.manageHoverState=c[13]),l&16384&&(d.eventsIfTopMost=c[14]),l&32768&&(d.interactive=c[15]),l&16777216&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function WR(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=_p("circle")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{applyToClusters:A=void 0}=e,{minzoom:M=void 0}=e,{maxzoom:R=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:B=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:U=!0}=e;function Z(oe){O=oe,n(0,O)}function ue(oe){xn.call(this,t,oe)}function ae(oe){xn.call(this,t,oe)}function se(oe){xn.call(this,t,oe)}function fe(oe){xn.call(this,t,oe)}function ke(oe){xn.call(this,t,oe)}function K(oe){xn.call(this,t,oe)}return t.$$set=oe=>{"id"in oe&&n(1,o=oe.id),"source"in oe&&n(2,c=oe.source),"sourceLayer"in oe&&n(3,l=oe.sourceLayer),"beforeId"in oe&&n(4,d=oe.beforeId),"beforeLayerType"in oe&&n(5,y=oe.beforeLayerType),"paint"in oe&&n(6,S=oe.paint),"layout"in oe&&n(7,E=oe.layout),"filter"in oe&&n(8,C=oe.filter),"applyToClusters"in oe&&n(9,A=oe.applyToClusters),"minzoom"in oe&&n(10,M=oe.minzoom),"maxzoom"in oe&&n(11,R=oe.maxzoom),"hoverCursor"in oe&&n(12,N=oe.hoverCursor),"manageHoverState"in oe&&n(13,B=oe.manageHoverState),"hovered"in oe&&n(0,O=oe.hovered),"eventsIfTopMost"in oe&&n(14,G=oe.eventsIfTopMost),"interactive"in oe&&n(15,U=oe.interactive),"$$scope"in oe&&n(24,i=oe.$$scope)},[O,o,c,l,d,y,S,E,C,A,M,R,N,B,G,U,r,Z,ue,ae,se,fe,ke,K,i]}let q1=class extends Qt{constructor(e){super(),Jt(this,e,WR,qR,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}};function HR(t){let e;const n=t[15].default,r=hr(n,t,t[23],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&8388608)&&pr(r,n,i,i[23],e?fr(n,i[23],o,null):dr(i[23]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function ZR(t){let e,n,r;function i(c){t[16](c)}let o={id:t[1],type:"fill",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[HR]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new oy({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.minzoom=c[9]),l&1024&&(d.maxzoom=c[10]),l&2048&&(d.hoverCursor=c[11]),l&4096&&(d.manageHoverState=c[12]),l&8192&&(d.eventsIfTopMost=c[13]),l&16384&&(d.interactive=c[14]),l&8388608&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function XR(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=_p("fill")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{minzoom:A=void 0}=e,{maxzoom:M=void 0}=e,{hoverCursor:R=void 0}=e,{manageHoverState:N=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(K){B=K,n(0,B)}function Z(K){xn.call(this,t,K)}function ue(K){xn.call(this,t,K)}function ae(K){xn.call(this,t,K)}function se(K){xn.call(this,t,K)}function fe(K){xn.call(this,t,K)}function ke(K){xn.call(this,t,K)}return t.$$set=K=>{"id"in K&&n(1,o=K.id),"source"in K&&n(2,c=K.source),"sourceLayer"in K&&n(3,l=K.sourceLayer),"beforeId"in K&&n(4,d=K.beforeId),"beforeLayerType"in K&&n(5,y=K.beforeLayerType),"paint"in K&&n(6,S=K.paint),"layout"in K&&n(7,E=K.layout),"filter"in K&&n(8,C=K.filter),"minzoom"in K&&n(9,A=K.minzoom),"maxzoom"in K&&n(10,M=K.maxzoom),"hoverCursor"in K&&n(11,R=K.hoverCursor),"manageHoverState"in K&&n(12,N=K.manageHoverState),"hovered"in K&&n(0,B=K.hovered),"eventsIfTopMost"in K&&n(13,O=K.eventsIfTopMost),"interactive"in K&&n(14,G=K.interactive),"$$scope"in K&&n(23,i=K.$$scope)},[B,o,c,l,d,y,S,E,C,A,M,R,N,O,G,r,U,Z,ue,ae,se,fe,ke,i]}let mc=class extends Qt{constructor(e){super(),Jt(this,e,XR,ZR,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}};function YR(t,e,n){let r;const{map:i}=ph();wt(t,i,d=>n(4,r=d));let{position:o="top-left"}=e,{container:c=void 0}=e,l=null;return Hi(()=>{r!=null&&r.loaded()&&l&&r.removeControl(l)}),t.$$set=d=>{"position"in d&&n(1,o=d.position),"container"in d&&n(2,c=d.container)},t.$$.update=()=>{if(t.$$.dirty&30&&r&&!l){let d;typeof c=="string"?d=document.querySelector(c)??void 0:d=c,n(3,l=new Vs.FullscreenControl({container:d})),r.addControl(l,o)}},[i,o,c,l,r]}class $R extends Qt{constructor(e){super(),Jt(this,e,YR,null,Ht,{position:1,container:2})}}function KR(t,e,n,r,i){let o=!1;t.getSource(e)&&(o=!0,t.removeSource(e));const c=()=>{r(e)&&(t.addSource(e,n),i())};if(o){const l=()=>{e&&(t.getSource(e)?setTimeout(l,1):c())};l()}else c()}function JR(t,e,n){qE().then(()=>{let r=rs(t);if(!r)return;r.getSource(e)===n&&r.removeSource(e)})}function M2(t){let e=t[0],n,r,i=k2(t);return{c(){i.c(),n=ki()},m(o,c){i.m(o,c),be(o,n,c),r=!0},p(o,c){c&1&&Ht(e,e=o[0])?(Rn(),de(i,1,1,Mt),Nn(),i=k2(o),i.c(),ne(i,1),i.m(n.parentNode,n)):i.p(o,c)},i(o){r||(ne(i),r=!0)},o(o){de(i),r=!1},d(o){o&&ve(n),i.d(o)}}}function k2(t){let e;const n=t[19].default,r=hr(n,t,t[18],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&262144)&&pr(r,n,i,i[18],e?fr(n,i[18],o,null):dr(i[18]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function QR(t){let e,n,r=t[0]&&M2(t);return{c(){r&&r.c(),e=ki()},m(i,o){r&&r.m(i,o),be(i,e,o),n=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&ne(r,1)):(r=M2(i),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function eN(t,e,n){let r,i,o,{$$slots:c={},$$scope:l}=e,{id:d=_p("geojson")}=e,{data:y}=e,{generateId:S=!1}=e,{promoteId:E=void 0}=e,{filter:C=void 0}=e,{lineMetrics:A=void 0}=e,{cluster:M=void 0}=e,{maxzoom:R=void 0}=e,{attribution:N=void 0}=e,{buffer:B=void 0}=e,{tolerance:O=void 0}=e;const{map:G,cluster:U,self:Z}=DR();wt(t,G,se=>n(17,i=se)),wt(t,U,se=>n(20,o=se)),wt(t,Z,se=>n(0,r=se));let ue,ae=!0;return Hi(()=>{r&&ue&&i&&(JR(G,r,ue),Ut(Z,r=null,r),n(15,ue=void 0))}),t.$$set=se=>{"id"in se&&n(4,d=se.id),"data"in se&&n(5,y=se.data),"generateId"in se&&n(6,S=se.generateId),"promoteId"in se&&n(7,E=se.promoteId),"filter"in se&&n(8,C=se.filter),"lineMetrics"in se&&n(9,A=se.lineMetrics),"cluster"in se&&n(10,M=se.cluster),"maxzoom"in se&&n(11,R=se.maxzoom),"attribution"in se&&n(12,N=se.attribution),"buffer"in se&&n(13,B=se.buffer),"tolerance"in se&&n(14,O=se.tolerance),"$$scope"in se&&n(18,l=se.$$scope)},t.$$.update=()=>{t.$$.dirty&1024&&Ut(U,o=M,o),t.$$.dirty&196593&&i&&r!==d&&(Ut(Z,r=d,r),KR(i,r,Kc({type:"geojson",data:y,filter:C,lineMetrics:A,generateId:S,promoteId:E,cluster:!!M,clusterMinPoints:M==null?void 0:M.minPoints,clusterMaxZoom:M==null?void 0:M.maxZoom,clusterRadius:M==null?void 0:M.radius,clusterProperties:M==null?void 0:M.properties,maxzoom:R,attribution:N,buffer:B,tolerance:O}),se=>i&&se===r,()=>{r&&(n(15,ue=i==null?void 0:i.getSource(r)),n(16,ae=!0))})),t.$$.dirty&131088&&(i==null||i.on("style.load",()=>{n(15,ue=i==null?void 0:i.getSource(d))})),t.$$.dirty&98336&&ue&&(ae?n(16,ae=!1):ue.setData(y)),t.$$.dirty&33792&&(ue==null||ue.setClusterOptions(Kc({cluster:!!M,clusterMaxZoom:M==null?void 0:M.maxZoom,clusterRadius:M==null?void 0:M.radius})))},[r,G,U,Z,d,y,S,E,C,A,M,R,N,B,O,ue,ae,i,l,c]}let Fo=class extends Qt{constructor(e){super(),Jt(this,e,eN,QR,Ht,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10,maxzoom:11,attribution:12,buffer:13,tolerance:14})}};function tN(t,e,n){let r;const{map:i}=ph();wt(t,i,C=>n(8,r=C));let{position:o="top-left"}=e,{positionOptions:c=void 0}=e,{fitBoundsOptions:l=void 0}=e,{trackUserLocation:d=!1}=e,{showAccuracyCircle:y=!0}=e,{showUserLocation:S=!0}=e,{control:E=null}=e;return Hi(()=>{r!=null&&r.loaded()&&E&&r.removeControl(E)}),t.$$set=C=>{"position"in C&&n(2,o=C.position),"positionOptions"in C&&n(3,c=C.positionOptions),"fitBoundsOptions"in C&&n(4,l=C.fitBoundsOptions),"trackUserLocation"in C&&n(5,d=C.trackUserLocation),"showAccuracyCircle"in C&&n(6,y=C.showAccuracyCircle),"showUserLocation"in C&&n(7,S=C.showUserLocation),"control"in C&&n(1,E=C.control)},t.$$.update=()=>{t.$$.dirty&510&&r&&!E&&(n(1,E=new Vs.GeolocateControl({positionOptions:c,fitBoundsOptions:l,trackUserLocation:d,showAccuracyCircle:y,showUserLocation:S})),r.addControl(E,o))},[i,E,o,c,l,d,y,S,r]}class nN extends Qt{constructor(e){super(),Jt(this,e,tN,null,Ht,{position:2,positionOptions:3,fitBoundsOptions:4,trackUserLocation:5,showAccuracyCircle:6,showUserLocation:7,control:1})}}function rN(t){let e;const n=t[15].default,r=hr(n,t,t[23],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&8388608)&&pr(r,n,i,i[23],e?fr(n,i[23],o,null):dr(i[23]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function iN(t){let e,n,r;function i(c){t[16](c)}let o={id:t[1],type:"line",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[rN]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new oy({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.minzoom=c[9]),l&1024&&(d.maxzoom=c[10]),l&2048&&(d.hoverCursor=c[11]),l&4096&&(d.manageHoverState=c[12]),l&8192&&(d.eventsIfTopMost=c[13]),l&16384&&(d.interactive=c[14]),l&8388608&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function oN(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=_p("line")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{minzoom:A=void 0}=e,{maxzoom:M=void 0}=e,{hoverCursor:R=void 0}=e,{manageHoverState:N=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(K){B=K,n(0,B)}function Z(K){xn.call(this,t,K)}function ue(K){xn.call(this,t,K)}function ae(K){xn.call(this,t,K)}function se(K){xn.call(this,t,K)}function fe(K){xn.call(this,t,K)}function ke(K){xn.call(this,t,K)}return t.$$set=K=>{"id"in K&&n(1,o=K.id),"source"in K&&n(2,c=K.source),"sourceLayer"in K&&n(3,l=K.sourceLayer),"beforeId"in K&&n(4,d=K.beforeId),"beforeLayerType"in K&&n(5,y=K.beforeLayerType),"paint"in K&&n(6,S=K.paint),"layout"in K&&n(7,E=K.layout),"filter"in K&&n(8,C=K.filter),"minzoom"in K&&n(9,A=K.minzoom),"maxzoom"in K&&n(10,M=K.maxzoom),"hoverCursor"in K&&n(11,R=K.hoverCursor),"manageHoverState"in K&&n(12,N=K.manageHoverState),"hovered"in K&&n(0,B=K.hovered),"eventsIfTopMost"in K&&n(13,O=K.eventsIfTopMost),"interactive"in K&&n(14,G=K.interactive),"$$scope"in K&&n(23,i=K.$$scope)},[B,o,c,l,d,y,S,E,C,A,M,R,N,O,G,r,U,Z,ue,ae,se,fe,ke,i]}let Ml=class extends Qt{constructor(e){super(),Jt(this,e,oN,iN,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}};function sN(t,e,n){let r;const i=zl();let{layer:o=void 0}=e;const{map:c}=ph();wt(t,c,S=>n(2,r=S));function l(S){i(S.type,{...S,map:c})}const d=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","contextmenu","mouseover","mouseout"],y=["click","dblclick","contextmenu","mousemove","movestart","moveend","zoomstart","zoom","zoomend"];return Hi(()=>{if(r)if(o)for(const S of d)r.off(S,o,l);else for(const S of y)r.off(S,l)}),t.$$set=S=>{"layer"in S&&n(1,o=S.layer)},t.$$.update=()=>{if(t.$$.dirty&6&&r)if(o)for(const S of d)r.on(S,o,l);else for(const S of y)r.on(S,l)},[c,o,r]}class aN extends Qt{constructor(e){super(),Jt(this,e,sN,null,Ht,{layer:1})}}function lN(t){let e=t.getCenter(),n=Math.round(t.getZoom()*100)/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,r),o=Math.round(e.lat*i)/i,c=Math.round(e.lng*i)/i,l=`${n}/${o}/${c}`,d=t.getBearing(),y=t.getPitch();return(d||y)&&(l+=`/${Math.round(d*10)/10}`),y&&(l+=`/${Math.round(y)}`),`#${l}`}function uN(t){return t.replace("#","").split("/").map(parseFloat)}var wf=W1;function W1(t,e){return t===e||t!==t&&e!==e?!0:typeof t!=typeof e||{}.toString.call(t)!={}.toString.call(e)||t!==Object(t)||!t?!1:Array.isArray(t)?A2(t,e):{}.toString.call(t)=="[object Set]"?A2(Array.from(t),Array.from(e)):{}.toString.call(t)=="[object Object]"?hN(t,e):cN(t,e)}function cN(t,e){return t.toString()===e.toString()}function A2(t,e){var n=t.length;if(n!=e.length)return!1;for(var r=0;rn(6,r=S));let{position:o="top-left"}=e,{showCompass:c=!0}=e,{showZoom:l=!0}=e,{visualizePitch:d=!1}=e,y=null;return Hi(()=>{r!=null&&r.loaded()&&y&&r.removeControl(y)}),t.$$set=S=>{"position"in S&&n(1,o=S.position),"showCompass"in S&&n(2,c=S.showCompass),"showZoom"in S&&n(3,l=S.showZoom),"visualizePitch"in S&&n(4,d=S.visualizePitch)},t.$$.update=()=>{t.$$.dirty&126&&r&&!y&&(n(5,y=new Vs.NavigationControl({showCompass:c,showZoom:l,visualizePitch:d})),r.addControl(y,o))},[i,o,c,l,d,y,r]}class pN extends Qt{constructor(e){super(),Jt(this,e,fN,null,Ht,{position:1,showCompass:2,showZoom:3,visualizePitch:4})}}function dN(t,e,n){let r;const{map:i}=ph();wt(t,i,y=>n(5,r=y));let{position:o="bottom-left"}=e,{maxWidth:c=void 0}=e,{unit:l="metric"}=e,d=null;return Hi(()=>{r!=null&&r.loaded()&&d&&r.removeControl(d)}),t.$$set=y=>{"position"in y&&n(1,o=y.position),"maxWidth"in y&&n(2,c=y.maxWidth),"unit"in y&&n(3,l=y.unit)},t.$$.update=()=>{t.$$.dirty&62&&r&&!d&&(n(4,d=new Vs.ScaleControl({maxWidth:c,unit:l})),r.addControl(d,o))},[i,o,c,l,d,r]}class mN extends Qt{constructor(e){super(),Jt(this,e,dN,null,Ht,{position:1,maxWidth:2,unit:3})}}const{window:gN}=X_,_N=t=>({map:t[0]&16,loadedImages:t[0]&32,allImagesLoaded:t[0]&64}),D2=t=>({map:t[4],loadedImages:t[5],allImagesLoaded:t[6]});function R2(t){let e,n,r=t[3]&&N2(t);const i=t[46].default,o=hr(i,t,t[45],D2);return{c(){r&&r.c(),e=je(),o&&o.c()},m(c,l){r&&r.m(c,l),be(c,e,l),o&&o.m(c,l),n=!0},p(c,l){c[3]?r?(r.p(c,l),l[0]&8&&ne(r,1)):(r=N2(c),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn()),o&&o.p&&(!n||l[0]&112|l[1]&16384)&&pr(o,i,c,c[45],n?fr(i,c[45],l,_N):dr(c[45]),D2)},i(c){n||(ne(r),ne(o,c),n=!0)},o(c){de(r),de(o,c),n=!1},d(c){c&&ve(e),r&&r.d(c),o&&o.d(c)}}}function N2(t){let e,n,r,i,o,c,l,d;return e=new pN({props:{position:t[7]}}),r=new nN({props:{position:t[7],fitBoundsOptions:{maxZoom:12}}}),o=new $R({props:{position:t[7]}}),l=new mN({props:{position:t[7]}}),{c(){Ve(e.$$.fragment),n=je(),Ve(r.$$.fragment),i=je(),Ve(o.$$.fragment),c=je(),Ve(l.$$.fragment)},m(y,S){Fe(e,y,S),be(y,n,S),Fe(r,y,S),be(y,i,S),Fe(o,y,S),be(y,c,S),Fe(l,y,S),d=!0},p(y,S){const E={};S[0]&128&&(E.position=y[7]),e.$set(E);const C={};S[0]&128&&(C.position=y[7]),r.$set(C);const A={};S[0]&128&&(A.position=y[7]),o.$set(A);const M={};S[0]&128&&(M.position=y[7]),l.$set(M)},i(y){d||(ne(e.$$.fragment,y),ne(r.$$.fragment,y),ne(o.$$.fragment,y),ne(l.$$.fragment,y),d=!0)},o(y){de(e.$$.fragment,y),de(r.$$.fragment,y),de(o.$$.fragment,y),de(l.$$.fragment,y),d=!1},d(y){y&&(ve(n),ve(i),ve(c)),Be(e,y),Be(r,y),Be(o,y),Be(l,y)}}}function yN(t){let e,n,r,i,o,c=t[4]&&t[0]&&R2(t);return{c(){e=pe("div"),c&&c.c(),Ce(e,"class",n=f_(t[2])+" svelte-p00lfq"),Ce(e,"data-testid","map-container"),no(e,"expand-map",!t[2])},m(l,d){be(l,e,d),c&&c.m(e,null),t[47](e),r=!0,i||(o=[Lt(gN,"hashchange",t[11]),cv(t[10].call(null,e))],i=!0)},p(l,d){l[4]&&l[0]?c?(c.p(l,d),d[0]&17&&ne(c,1)):(c=R2(l),c.c(),ne(c,1),c.m(e,null)):c&&(Rn(),de(c,1,1,()=>{c=null}),Nn()),(!r||d[0]&4&&n!==(n=f_(l[2])+" svelte-p00lfq"))&&Ce(e,"class",n),(!r||d[0]&4)&&no(e,"expand-map",!l[2])},i(l){r||(ne(c),r=!0)},o(l){de(c),r=!1},d(l){l&&ve(e),c&&c.d(),t[47](null),i=!1,Hr(o)}}}function vN(t,e,n){let r,i,o,c,{$$slots:l={},$$scope:d}=e,{map:y=null}=e,{mapContainer:S=void 0}=e,{class:E=void 0}=e,{style:C}=e,{diffStyleUpdates:A=!1}=e,{center:M=void 0}=e,{zoom:R=void 0}=e,{pitch:N=0}=e,{bearing:B=0}=e,{bounds:O=void 0}=e,{hash:G=!1}=e,{updateHash:U=Xe=>{window.history.replaceState(window.history.state,"",Xe)}}=e,{loaded:Z=!1}=e,{minZoom:ue=0}=e,{maxZoom:ae=22}=e,{minPitch:se=0}=e,{maxPitch:fe=60}=e,{renderWorldCopies:ke=void 0}=e,{dragPan:K=void 0}=e,{dragRotate:oe=void 0}=e,{pitchWithRotate:Ge=void 0}=e,{antialias:Te=void 0}=e,{zoomOnDoubleClick:ot=!0}=e,{locale:ft=void 0}=e,{interactive:At=!0}=e,{attributionControl:Ke=!0}=e,{cooperativeGestures:Ft=!1}=e,{preserveDrawingBuffer:bt=!1}=e,{maxBounds:Rt=void 0}=e,{images:Ot=[]}=e,{standardControls:ln=!1}=e,{filterLayers:Ln=void 0}=e,{transformRequest:an=void 0}=e;const Xt=zl(),{map:En,loadedImages:In}=AR();wt(t,En,Xe=>n(4,o=Xe)),wt(t,In,Xe=>n(5,c=Xe));let rr=new Set;async function mt(Xe,St=!1){if(o&&!(!o.loaded()&&!St))if("url"in Xe){rr.add(Xe.id);try{let hn=await o.loadImage(Xe.url);o==null||o.addImage(Xe.id,hn.data,Xe.options),c.add(Xe.id),In.set(c)}catch(hn){Xt("error",hn)}finally{rr.delete(Xe.id)}}else o.addImage(Xe.id,Xe.data,Xe.options),c.add(Xe.id),In.set(c)}let Dt,Sn,Le,rt;function gt(Xe){return me(),Ut(En,o=new Vs.Map(Kc({container:Xe,style:C,locale:ft,center:M,zoom:R,pitch:N,bearing:B,minZoom:ue,maxZoom:ae,minPitch:se,maxPitch:fe,renderWorldCopies:ke,dragPan:K,dragRotate:oe,pitchWithRotate:Ge,antialias:Te,interactive:At,preserveDrawingBuffer:bt,maxBounds:Rt,bounds:O,attributionControl:Ke,transformRequest:an,cooperativeGestures:Ft})),o),o.on("load",St=>{St.target.getContainer().setAttribute("data-testid","map"),St.target.getCanvas().setAttribute("data-testid","map-canvas"),n(0,Z=!0),Xt("load",o)}),o.on("error",St=>Xt("error",{...St,map:o})),o.on("movestart",St=>Xt("movestart",{...St,map:o})),o.on("moveend",St=>{if(n(12,M=St.target.getCenter()),n(13,R=St.target.getZoom()),n(14,N=St.target.getPitch()),n(15,B=St.target.getBearing()),n(16,O=St.target.getBounds()),Xt("moveend",{...St,map:o}),G){let hn=new URL(window.location.href.replace(/(#.+)?$/,lN(o)));U(hn)}}),o.on("click",St=>Xt("click",{...St,map:o})),o.on("dblclick",St=>Xt("dblclick",{...St,map:o})),o.on("contextmenu",St=>Xt("contextmenu",{...St,map:o})),o.on("zoomstart",St=>Xt("zoomstart",{...St,map:o})),o.on("zoom",St=>{Xt("zoom",{...St,map:o})}),o.on("zoomend",St=>{Xt("zoomend",{...St,map:o})}),o.on("style.load",()=>{if(o){const St=o.getStyle();if(n(42,Dt=St.layers.map(hn=>hn.id)),n(43,Sn=Object.keys(St.sources)),rt)for(const[hn,Ai]of Object.entries(rt))o.addSource(hn,Ai);if(Le)for(const hn of Le)o.addLayer(hn);for(const hn of Ot)mt(hn,!0)}}),o.on("styledata",St=>{if(o&&Ln){const hn=o.getStyle().layers;if(hn)for(let Ai of hn)Ln(Ai)||o.setLayoutProperty(Ai.id,"visibility","none")}Xt("styledata",{...St,map:o})}),{destroy(){n(0,Z=!1),o==null||o.remove(),Ut(En,o=null,o)}}}let Nt=C;function me(){if(G){let Xe=uN(window.location.hash);Xe.length>=3&&(n(13,R=Xe[0]),n(12,M=[Xe[2],Xe[1]])),Xe.length==5&&(n(15,B=Xe[3]),n(14,N=Xe[4]))}}function tn(Xe){Gr[Xe?"unshift":"push"](()=>{S=Xe,n(1,S)})}return t.$$set=Xe=>{"map"in Xe&&n(17,y=Xe.map),"mapContainer"in Xe&&n(1,S=Xe.mapContainer),"class"in Xe&&n(2,E=Xe.class),"style"in Xe&&n(18,C=Xe.style),"diffStyleUpdates"in Xe&&n(19,A=Xe.diffStyleUpdates),"center"in Xe&&n(12,M=Xe.center),"zoom"in Xe&&n(13,R=Xe.zoom),"pitch"in Xe&&n(14,N=Xe.pitch),"bearing"in Xe&&n(15,B=Xe.bearing),"bounds"in Xe&&n(16,O=Xe.bounds),"hash"in Xe&&n(20,G=Xe.hash),"updateHash"in Xe&&n(21,U=Xe.updateHash),"loaded"in Xe&&n(0,Z=Xe.loaded),"minZoom"in Xe&&n(22,ue=Xe.minZoom),"maxZoom"in Xe&&n(23,ae=Xe.maxZoom),"minPitch"in Xe&&n(24,se=Xe.minPitch),"maxPitch"in Xe&&n(25,fe=Xe.maxPitch),"renderWorldCopies"in Xe&&n(26,ke=Xe.renderWorldCopies),"dragPan"in Xe&&n(27,K=Xe.dragPan),"dragRotate"in Xe&&n(28,oe=Xe.dragRotate),"pitchWithRotate"in Xe&&n(29,Ge=Xe.pitchWithRotate),"antialias"in Xe&&n(30,Te=Xe.antialias),"zoomOnDoubleClick"in Xe&&n(31,ot=Xe.zoomOnDoubleClick),"locale"in Xe&&n(32,ft=Xe.locale),"interactive"in Xe&&n(33,At=Xe.interactive),"attributionControl"in Xe&&n(34,Ke=Xe.attributionControl),"cooperativeGestures"in Xe&&n(35,Ft=Xe.cooperativeGestures),"preserveDrawingBuffer"in Xe&&n(36,bt=Xe.preserveDrawingBuffer),"maxBounds"in Xe&&n(37,Rt=Xe.maxBounds),"images"in Xe&&n(38,Ot=Xe.images),"standardControls"in Xe&&n(3,ln=Xe.standardControls),"filterLayers"in Xe&&n(39,Ln=Xe.filterLayers),"transformRequest"in Xe&&n(40,an=Xe.transformRequest),"$$scope"in Xe&&n(45,d=Xe.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&8&&n(7,r=typeof ln=="boolean"?void 0:ln),t.$$.dirty[0]&16&&n(17,y=o),t.$$.dirty[0]&786448|t.$$.dirty[1]&14336&&o&&!wf(C,Nt)){const Xe=o.getStyle();if(Dt&&(Le=Xe.layers.filter(St=>!Dt.includes(St.id))),Sn){const St=Object.keys(Xe.sources).filter(hn=>!Sn.includes(hn));rt={};for(const hn of St)rt[hn]=Xe.sources[hn]}n(44,Nt=C),o.setStyle(C,{diff:A}),Ut(In,c=new Set,c),n(41,rr=new Set)}if(t.$$.dirty[0]&49|t.$$.dirty[1]&1152&&Z&&o!=null&&o.loaded())for(let Xe of Ot)!c.has(Xe.id)&&!rr.has(Xe.id)&&!o.hasImage(Xe.id)&&mt(Xe);if(t.$$.dirty[0]&32|t.$$.dirty[1]&128&&n(6,i=Ot.every(Xe=>c.has(Xe.id))),t.$$.dirty[0]&61456&&o){let Xe={};M!=null&&!wf(M,o==null?void 0:o.getCenter())&&(Xe.center=M),R!=null&&!wf(R,o==null?void 0:o.getZoom())&&(Xe.zoom=R),B!=null&&!wf(B,o==null?void 0:o.getBearing())&&(Xe.bearing=B),N!=null&&!wf(N,o==null?void 0:o.getPitch())&&(Xe.pitch=N),Object.keys(Xe).length&&o.easeTo(Xe)}t.$$.dirty[0]&65552&&O&&!wf(O,o==null?void 0:o.getBounds())&&(o==null||o.fitBounds(O)),t.$$.dirty[0]&16|t.$$.dirty[1]&1&&(ot?o==null||o.doubleClickZoom.enable():o==null||o.doubleClickZoom.disable())},[Z,S,E,ln,o,c,i,r,En,In,gt,me,M,R,N,B,O,y,C,A,G,U,ue,ae,se,fe,ke,K,oe,Ge,Te,ot,ft,At,Ke,Ft,bt,Rt,Ot,Ln,an,rr,Dt,Sn,Nt,d,l,tn]}class bN extends Qt{constructor(e){super(),Jt(this,e,vN,yN,Ht,{map:17,mapContainer:1,class:2,style:18,diffStyleUpdates:19,center:12,zoom:13,pitch:14,bearing:15,bounds:16,hash:20,updateHash:21,loaded:0,minZoom:22,maxZoom:23,minPitch:24,maxPitch:25,renderWorldCopies:26,dragPan:27,dragRotate:28,pitchWithRotate:29,antialias:30,zoomOnDoubleClick:31,locale:32,interactive:33,attributionControl:34,cooperativeGestures:35,preserveDrawingBuffer:36,maxBounds:37,images:38,standardControls:3,filterLayers:39,transformRequest:40},null,[-1,-1])}}const xN=t=>({marker:t&8}),O2=t=>({marker:t[3]});function wN(t){let e,n,r,i,o,c,l;const d=t[19].default,y=hr(d,t,t[18],O2);return{c(){e=pe("div"),y&&y.c(),Ce(e,"tabindex",n=t[1]?0:void 0),Ce(e,"role",r=t[1]?"button":void 0),gr(e,"z-index",t[2])},m(S,E){be(S,e,E),y&&y.m(e,null),o=!0,c||(l=[cv(t[7].call(null,e)),cv(i=SN.call(null,e,t[0])),Lt(e,"click",k0(t[20])),Lt(e,"dblclick",k0(t[21])),Lt(e,"contextmenu",k0(h1(t[22]))),Lt(e,"mouseenter",t[23]),Lt(e,"mouseleave",t[24]),Lt(e,"mousemove",t[25]),Lt(e,"keydown",t[8])],c=!0)},p(S,[E]){y&&y.p&&(!o||E&262152)&&pr(y,d,S,S[18],o?fr(d,S[18],E,xN):dr(S[18]),O2),(!o||E&2&&n!==(n=S[1]?0:void 0))&&Ce(e,"tabindex",n),(!o||E&2&&r!==(r=S[1]?"button":void 0))&&Ce(e,"role",r),i&&Nf(i.update)&&E&1&&i.update.call(null,S[0]),E&4&&gr(e,"z-index",S[2])},i(S){o||(ne(y,S),o=!0)},o(S){de(y,S),o=!1},d(S){S&&ve(e),y&&y.d(S),c=!1,Hr(l)}}}function SN(t,e){const n=t.className;function r(i){i?t.className=`${n} ${i}`:t.className=n}return r(e),{update:r}}function EN(t,e,n){let r,i,o,{$$slots:c={},$$scope:l}=e,{marker:d=void 0}=e,{lngLat:y}=e,{class:S=void 0}=e,{interactive:E=!0}=e,{asButton:C=!1}=e,{draggable:A=!1}=e,{feature:M=null}=e,{offset:R=void 0}=e,{zIndex:N=void 0}=e,{rotation:B=0}=e,{opacity:O=1}=e;const G=zl(),{map:U,layerEvent:Z,self:ue,markerClickManager:ae}=NR();wt(t,U,Ke=>n(27,o=Ke)),wt(t,Z,Ke=>n(26,r=Ke)),wt(t,ue,Ke=>n(3,i=Ke));function se(Ke){Ut(ue,i=new Vs.Marker({element:Ke,rotation:B,draggable:A,offset:R,opacity:O.toString()}).setLngLat(y).addTo(o),i),n(11,d=i);const Ft=()=>K("dragstart"),bt=()=>{fe(),K("drag")},Rt=()=>{fe(),K("dragend")};return A&&(i.on("dragstart",Ft),i.on("drag",bt),i.on("dragend",Rt)),{destroy(){A&&(i==null||i.off("dragstart",Ft),i==null||i.off("drag",bt),i==null||i.off("dragend",Rt)),n(11,d=void 0),i==null||i.remove()}}}function fe(){let Ke=i==null?void 0:i.getLngLat();Ke&&(Array.isArray(y)?n(10,y=[Ke.lng,Ke.lat]):y&&"lon"in y?n(10,y={lon:Ke.lng,lat:Ke.lat}):n(10,y=Ke))}function ke(Ke){Ke.key===" "&&(Ke.preventDefault(),Ke.stopPropagation(),K("click"))}function K(Ke){if(!E)return;let Ft=i==null?void 0:i.getLngLat();if(!Ft)return;const bt=[Ft.lng,Ft.lat];let Rt={map:o,marker:i,lngLat:bt,features:[{type:"Feature",properties:(M==null?void 0:M.properties)??{},geometry:{type:"Point",coordinates:bt}}]};(Ke==="click"||Ke==="contextmenu")&&ae.handleClick(Rt),Ut(Z,r={...Rt,layerType:"marker",type:Ke},r),G(Ke,Rt)}const oe=()=>K("click"),Ge=()=>K("dblclick"),Te=()=>{K("contextmenu")},ot=()=>{K("mouseenter")},ft=()=>{K("mouseleave")},At=()=>K("mousemove");return t.$$set=Ke=>{"marker"in Ke&&n(11,d=Ke.marker),"lngLat"in Ke&&n(10,y=Ke.lngLat),"class"in Ke&&n(0,S=Ke.class),"interactive"in Ke&&n(12,E=Ke.interactive),"asButton"in Ke&&n(1,C=Ke.asButton),"draggable"in Ke&&n(13,A=Ke.draggable),"feature"in Ke&&n(14,M=Ke.feature),"offset"in Ke&&n(15,R=Ke.offset),"zIndex"in Ke&&n(2,N=Ke.zIndex),"rotation"in Ke&&n(16,B=Ke.rotation),"opacity"in Ke&&n(17,O=Ke.opacity),"$$scope"in Ke&&n(18,l=Ke.$$scope)},t.$$.update=()=>{t.$$.dirty&1032&&(i==null||i.setLngLat(y)),t.$$.dirty&32776&&(i==null||i.setOffset(R??[0,0])),t.$$.dirty&65544&&(i==null||i.setRotation(B)),t.$$.dirty&131080&&(i==null||i.setOpacity(O.toString()))},[S,C,N,i,U,Z,ue,se,ke,K,y,d,E,A,M,R,B,O,l,c,oe,Ge,Te,ot,ft,At]}class R_ extends Qt{constructor(e){super(),Jt(this,e,EN,wN,Ht,{marker:11,lngLat:10,class:0,interactive:12,asButton:1,draggable:13,feature:14,offset:15,zIndex:2,rotation:16,opacity:17})}}const IN=t=>({features:t[0]&16,data:t[0]&16,map:t[0]&4,close:t[0]&1}),z2=t=>{var e;return{features:t[4],data:((e=t[4])==null?void 0:e[0])??null,map:t[2],close:t[31]}};function F2(t){var i;let e,n,r=(((i=t[4])==null?void 0:i.length)||t[3]instanceof Vs.Marker)&&B2(t);return{c(){e=pe("div"),r&&r.c()},m(o,c){be(o,e,c),r&&r.m(e,null),t[32](e),n=!0},p(o,c){var l;(l=o[4])!=null&&l.length||o[3]instanceof Vs.Marker?r?(r.p(o,c),c[0]&24&&ne(r,1)):(r=B2(o),r.c(),ne(r,1),r.m(e,null)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(o){n||(ne(r),n=!0)},o(o){de(r),n=!1},d(o){o&&ve(e),r&&r.d(),t[32](null)}}}function B2(t){let e;const n=t[30].default,r=hr(n,t,t[29],z2);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o[0]&536870933)&&pr(r,n,i,i[29],e?fr(n,i[29],o,IN):dr(i[29]),z2)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function CN(t){let e,n,r=t[9].default&&F2(t);return{c(){r&&r.c(),e=ki()},m(i,o){r&&r.m(i,o),be(i,e,o),n=!0},p(i,o){i[9].default?r?(r.p(i,o),o[0]&512&&ne(r,1)):(r=F2(i),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function TN(t,e,n){let r,i,o,c,l,d,{$$slots:y={},$$scope:S}=e;const E=jP(y);let{closeButton:C=void 0}=e,{closeOnClickOutside:A=!0}=e,{closeOnClickInside:M=!1}=e,{closeOnMove:R=!1}=e,{openOn:N="click"}=e,{openIfTopMost:B=!0}=e,{focusAfterOpen:O=!0}=e,{anchor:G=void 0}=e,{offset:U=void 0}=e,{popupClass:Z=void 0}=e,{maxWidth:ue=void 0}=e,{lngLat:ae=void 0}=e,{html:se=void 0}=e,{open:fe=!1}=e;const ke=zl(),{map:K,popupTarget:oe,layerEvent:Ge,layer:Te,eventTopMost:ot,markerClickManager:ft}=ph();wt(t,K,me=>n(2,o=me)),wt(t,oe,me=>n(3,l=me)),wt(t,Ge,me=>n(28,c=me)),wt(t,Te,me=>n(35,d=me));const At=["click","dblclick","contextmenu"];let Ke,Ft=!1,bt;function Rt(){if(!Ke)return;let me=Ke.getElement();!me||me===bt||(bt=me,N==="hover"&&(bt.style.pointerEvents="none"),bt.addEventListener("mouseenter",()=>{n(24,Ft=!0)},{passive:!0}),bt.addEventListener("mouseleave",()=>{n(24,Ft=!1)},{passive:!0}),bt.addEventListener("click",()=>{M&&n(0,fe=!1)},{passive:!0}))}Y_(()=>{if(o)return o.on("click",Sn),o.on("contextmenu",Sn),ft.add(Le),typeof l=="string"&&(o.on("click",l,Xt),o.on("dblclick",l,Xt),o.on("contextmenu",l,Xt),o.on("mousemove",l,Dt),o.on("mouseleave",l,mt),o.on("touchstart",l,In),o.on("touchend",l,rr)),()=>{o!=null&&o.loaded()&&(Ke==null||Ke.remove(),o.off("click",Sn),o.off("contextmenu",Sn),ft.remove(Le),l instanceof Vs.Marker?l.getPopup()===Ke&&l.setPopup(void 0):typeof l=="string"&&(o.off("click",l,Xt),o.off("dblclick",l,Xt),o.off("contextmenu",l,Xt),o.off("mousemove",l,Dt),o.off("mouseleave",l,mt),o.off("touchstart",l,In),o.off("touchend",l,rr)))}});function Ot(me){return B?!("marker"in me)&&!OR(me)&&ot(me)!==d:!1}let ln=null,Ln="normal";function an(me){"layerType"in me&&me.layerType==="deckgl"?(n(10,ae=me.coordinate),n(4,ln=me.object?[me.object]:null)):(n(10,ae=me.lngLat),n(4,ln=me.features??[]))}function Xt(me){me.type!==N||Ot(me)||(an(me),setTimeout(()=>n(0,fe=!0)))}let En=null;function In(me){En=me.point}function rr(me){if(!En||N!=="hover")return;let tn=En.dist(me.point);En=null,tn<3&&(n(10,ae=me.lngLat),n(4,ln=me.features??[]),Ke.isOpen()?n(25,Ln="justOpened"):(n(25,Ln="opening"),n(0,fe=!0)))}function mt(me){N!=="hover"||En||Ln!=="normal"||(n(0,fe=!1),n(4,ln=null))}function Dt(me){if(!(N!=="hover"||En||Ln!=="normal")){if(Ot(me)){n(0,fe=!1),n(4,ln=null);return}n(0,fe=!0),n(4,ln=me.features??[]),n(10,ae=me.lngLat)}}function Sn(me){if(Ln==="justOpened"){n(25,Ln="normal");return}if(!A)return;let tn=[bt,l instanceof Vs.Marker?l==null?void 0:l.getElement():null];fe&&Ke.isOpen()&&!tn.some(Xe=>Xe==null?void 0:Xe.contains(me.originalEvent.target))&&(me.type==="contextmenu"&&N==="contextmenu"||me.type!=="contextmenu")&&n(0,fe=!1)}function Le(me){A&&fe&&Ke.isOpen()&&me.marker!==l&&n(0,fe=!1)}Hi(()=>{o&&(Ke!=null&&Ke.isOpen())&&Ke.remove()});let rt;const gt=()=>n(0,fe=!1);function Nt(me){Gr[me?"unshift":"push"](()=>{rt=me,n(1,rt)})}return t.$$set=me=>{"closeButton"in me&&n(11,C=me.closeButton),"closeOnClickOutside"in me&&n(12,A=me.closeOnClickOutside),"closeOnClickInside"in me&&n(13,M=me.closeOnClickInside),"closeOnMove"in me&&n(14,R=me.closeOnMove),"openOn"in me&&n(15,N=me.openOn),"openIfTopMost"in me&&n(16,B=me.openIfTopMost),"focusAfterOpen"in me&&n(17,O=me.focusAfterOpen),"anchor"in me&&n(18,G=me.anchor),"offset"in me&&n(19,U=me.offset),"popupClass"in me&&n(20,Z=me.popupClass),"maxWidth"in me&&n(21,ue=me.maxWidth),"lngLat"in me&&n(10,ae=me.lngLat),"html"in me&&n(22,se=me.html),"open"in me&&n(0,fe=me.open),"$$scope"in me&&n(29,S=me.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&14336&&n(27,r=C??(!A&&!M)),t.$$.dirty[0]&146685952&&(Ke||(n(23,Ke=new Vs.Popup({closeButton:r,closeOnClick:!1,closeOnMove:R,focusAfterOpen:O,maxWidth:ue,className:Z,anchor:G,offset:U})),bt=Ke.getElement(),Ke.on("open",()=>{n(0,fe=!0),Rt(),ke("open",Ke)}),Ke.on("close",()=>{n(0,fe=!1),ke("close",Ke)}),Ke.on("hover",()=>{ke("hover",Ke)}))),t.$$.dirty[0]&8421384&&Ke&&l instanceof Vs.Marker&&(N==="click"?l.setPopup(Ke):l.getPopup()===Ke&&l.setPopup(void 0)),t.$$.dirty[0]&268468224&&At.includes(N)&&(c==null?void 0:c.type)===N&&(Xt(c),Ut(Ge,c=null,c)),t.$$.dirty[0]&268468224&&n(26,i=N==="hover"&&((c==null?void 0:c.type)==="mousemove"||(c==null?void 0:c.type)==="mouseenter")),t.$$.dirty[0]&352354304&&N==="hover"&&Ge&&(i&&c&&an(c),n(0,fe=(i||Ft)??!1)),t.$$.dirty[0]&12582914&&(rt?Ke.setDOMContent(rt):se&&Ke.setHTML(se)),t.$$.dirty[0]&8389632&&ae&&Ke.setLngLat(ae),t.$$.dirty[0]&41943045&&o){let me=Ke.isOpen();fe&&!me?(Ke.addTo(o),Ln==="opening"&&n(25,Ln="justOpened")):!fe&&me&&Ke.remove()}},[fe,rt,o,l,ln,K,oe,Ge,Te,E,ae,C,A,M,R,N,B,O,G,U,Z,ue,se,Ke,Ft,Ln,i,r,c,S,y,gt,Nt]}class LN extends Qt{constructor(e){super(),Jt(this,e,TN,CN,Ht,{closeButton:11,closeOnClickOutside:12,closeOnClickInside:13,closeOnMove:14,openOn:15,openIfTopMost:16,focusAfterOpen:17,anchor:18,offset:19,popupClass:20,maxWidth:21,lngLat:10,html:22,open:0},null,[-1,-1])}}var Em=Uint8Array,wC=Uint16Array,PN=Int32Array,MN=new Em([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),kN=new Em([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),SC=function(t,e){for(var n=new wC(31),r=0;r<31;++r)n[r]=e+=1<>1|(lr&21845)<<1,ou=(ou&52428)>>2|(ou&13107)<<2,ou=(ou&61680)>>4|(ou&3855)<<4,RN[lr]=((ou&65280)>>8|(ou&255)<<8)>>1;var ou,lr,sy=new Em(288);for(lr=0;lr<144;++lr)sy[lr]=8;var lr;for(lr=144;lr<256;++lr)sy[lr]=9;var lr;for(lr=256;lr<280;++lr)sy[lr]=7;var lr;for(lr=280;lr<288;++lr)sy[lr]=8;var lr,NN=new Em(32);for(lr=0;lr<32;++lr)NN[lr]=5;var lr,ON=new Em(0),zN=typeof TextDecoder<"u"&&new TextDecoder,FN=0;try{zN.decode(ON,{stream:!0}),FN=1}catch{}function BN(t){let e;const n=t[16].default,r=hr(n,t,t[24],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&16777216)&&pr(r,n,i,i[24],e?fr(n,i[24],o,null):dr(i[24]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function VN(t){let e,n,r;function i(c){t[17](c)}let o={id:t[1],type:"symbol",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],applyToClusters:t[9],minzoom:t[10],maxzoom:t[11],hoverCursor:t[12],manageHoverState:t[13],eventsIfTopMost:t[14],interactive:t[15],$$slots:{default:[BN]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new oy({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[18]),e.$on("dblclick",t[19]),e.$on("contextmenu",t[20]),e.$on("mouseenter",t[21]),e.$on("mousemove",t[22]),e.$on("mouseleave",t[23]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.applyToClusters=c[9]),l&1024&&(d.minzoom=c[10]),l&2048&&(d.maxzoom=c[11]),l&4096&&(d.hoverCursor=c[12]),l&8192&&(d.manageHoverState=c[13]),l&16384&&(d.eventsIfTopMost=c[14]),l&32768&&(d.interactive=c[15]),l&16777216&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function UN(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=_p("symbol")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S=void 0}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{applyToClusters:A=void 0}=e,{minzoom:M=void 0}=e,{maxzoom:R=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:B=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:U=!0}=e;function Z(oe){O=oe,n(0,O)}function ue(oe){xn.call(this,t,oe)}function ae(oe){xn.call(this,t,oe)}function se(oe){xn.call(this,t,oe)}function fe(oe){xn.call(this,t,oe)}function ke(oe){xn.call(this,t,oe)}function K(oe){xn.call(this,t,oe)}return t.$$set=oe=>{"id"in oe&&n(1,o=oe.id),"source"in oe&&n(2,c=oe.source),"sourceLayer"in oe&&n(3,l=oe.sourceLayer),"beforeId"in oe&&n(4,d=oe.beforeId),"beforeLayerType"in oe&&n(5,y=oe.beforeLayerType),"paint"in oe&&n(6,S=oe.paint),"layout"in oe&&n(7,E=oe.layout),"filter"in oe&&n(8,C=oe.filter),"applyToClusters"in oe&&n(9,A=oe.applyToClusters),"minzoom"in oe&&n(10,M=oe.minzoom),"maxzoom"in oe&&n(11,R=oe.maxzoom),"hoverCursor"in oe&&n(12,N=oe.hoverCursor),"manageHoverState"in oe&&n(13,B=oe.manageHoverState),"hovered"in oe&&n(0,O=oe.hovered),"eventsIfTopMost"in oe&&n(14,G=oe.eventsIfTopMost),"interactive"in oe&&n(15,U=oe.interactive),"$$scope"in oe&&n(24,i=oe.$$scope)},[O,o,c,l,d,y,S,E,C,A,M,R,N,B,G,U,r,Z,ue,ae,se,fe,ke,K,i]}class IC extends Qt{constructor(e){super(),Jt(this,e,UN,VN,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}var jN=Object.defineProperty,GN=(t,e,n)=>e in t?jN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V2=(t,e,n)=>(GN(t,typeof e!="symbol"?e+"":e,n),n);function rm(){}function CC(t){return t()}function U2(){return Object.create(null)}function ay(t){t.forEach(CC)}function TC(t){return typeof t=="function"}function qN(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function WN(t){return Object.keys(t).length===0}function HN(t,e){t.appendChild(e)}function ZN(t,e,n){t.insertBefore(e,n||null)}function LC(t){t.parentNode&&t.parentNode.removeChild(t)}function j2(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Wu(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function XN(t){return Array.from(t.childNodes)}function Gg(t,e,n){t.classList.toggle(e,!!n)}let H1;function Yd(t){H1=t}const Lf=[],G2=[];let Rf=[];const q2=[],YN=Promise.resolve();let Gv=!1;function $N(){Gv||(Gv=!0,YN.then(PC))}function qv(t){Rf.push(t)}const nv=new Set;let Sf=0;function PC(){if(Sf!==0)return;const t=H1;do{try{for(;Sft.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),Rf=e}const QN=new Set;function eO(t,e){t&&t.i&&(QN.delete(t),t.i(e))}function tO(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),qv(()=>{const o=t.$$.on_mount.map(CC).filter(TC);t.$$.on_destroy?t.$$.on_destroy.push(...o):ay(o),t.$$.on_mount=[]}),i.forEach(qv)}function nO(t,e){const n=t.$$;n.fragment!==null&&(JN(n.after_update),ay(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function rO(t,e){t.$$.dirty[0]===-1&&(Lf.push(t),$N(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const M=A.length?A[0]:C;return y.ctx&&i(y.ctx[E],y.ctx[E]=M)&&(!y.skip_bound&&y.bound[E]&&y.bound[E](M),S&&rO(t,E)),C}):[],y.update(),S=!0,ay(y.before_update),y.fragment=r?r(y.ctx):!1,e.target){if(e.hydrate){const E=XN(e.target);y.fragment&&y.fragment.l(E),E.forEach(LC)}else y.fragment&&y.fragment.c();e.intro&&eO(t.$$.fragment),tO(t,e.target,e.anchor),PC()}Yd(d)}class oO{constructor(){V2(this,"$$"),V2(this,"$$set")}$destroy(){nO(this,1),this.$destroy=rm}$on(e,n){if(!TC(n))return rm;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!WN(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const sO="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(sO);function aO(t){let e,n,r;return{c(){e=j2("svg"),n=j2("path"),Wu(n,"stroke-width","4"),Wu(n,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),Wu(n,"class","svelte-gzo3ar"),Wu(e,"width",r=t[0]==="list"?20:void 0),Wu(e,"viewBox","0 0 70 85"),Wu(e,"fill","none"),Wu(e,"class","svelte-gzo3ar"),Gg(e,"in-map",t[0]!=="list"),Gg(e,"list-icon",t[0]==="list")},m(i,o){ZN(i,e,o),HN(e,n)},p(i,[o]){o&1&&r!==(r=i[0]==="list"?20:void 0)&&Wu(e,"width",r),o&1&&Gg(e,"in-map",i[0]!=="list"),o&1&&Gg(e,"list-icon",i[0]==="list")},i:rm,o:rm,d(i){i&&LC(e)}}}function lO(t,e,n){let{displayIn:r}=e;return t.$$set=i=>{"displayIn"in i&&n(0,r=i.displayIn)},[r]}class uO extends oO{constructor(e){super(),iO(this,e,lO,aO,qN,{displayIn:0})}}const cO=[{verbatimCoordinates:"40.123, -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:"40.123° N 74.123° W",verbatimLatitude:"40.123° N",verbatimLongitude:"74.123° W"},{verbatimCoordinates:'40° 7´ 22.8" N 74° 7´ 22.8" W',verbatimLatitude:'40° 7´ 22.8" N',verbatimLongitude:'74° 7´ 22.8" W'},{verbatimCoordinates:"40° 7.38’ , -74° 7.38’",verbatimLatitude:"40° 7.38’",verbatimLongitude:"-74° 7.38’"},{verbatimCoordinates:"N40°7’22.8’’, W74°7’22.8’’",verbatimLatitude:"N40°7’22.8’’",verbatimLongitude:"W74°7’22.8’’"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:`40°7'22.8"N, 74°7'22.8"W`,verbatimLatitude:`40°7'22.8"N`,verbatimLongitude:`74°7'22.8"W`},{verbatimCoordinates:"40 7 22.8, -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"},{verbatimCoordinates:"40.123 -74.123",verbatimLatitude:"40.123",verbatimLongitude:"-74.123"},{verbatimCoordinates:"40.123°,-74.123°",verbatimLatitude:"40.123°",verbatimLongitude:"-74.123°"},{verbatimCoordinates:"40.123N74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"4007.38N7407.38W",verbatimLatitude:"4007.38N",verbatimLongitude:"7407.38W"},{verbatimCoordinates:'40°7’22.8"N, 74°7’22.8"W',verbatimLatitude:'40°7’22.8"N',verbatimLongitude:'74°7’22.8"W'},{verbatimCoordinates:"400722.8N740722.8W",verbatimLatitude:"400722.8N",verbatimLongitude:"740722.8W"},{verbatimCoordinates:"N 40 7.38 W 74 7.38",verbatimLatitude:"N 40 7.38",verbatimLongitude:"W 74 7.38"},{verbatimCoordinates:"40:7:22.8N 74:7:22.8W",verbatimLatitude:"40:7:22.8N",verbatimLongitude:"74:7:22.8W"},{verbatimCoordinates:"40:7:23N,74:7:23W",verbatimLatitude:"40:7:23N",verbatimLongitude:"74:7:23W",decimalLatitude:40.1230555555,decimalLongitude:-74.1230555555},{verbatimCoordinates:'40°7’23"N 74°7’23"W',verbatimLatitude:'40°7’23"N',verbatimLongitude:'74°7’23"W',decimalLatitude:40.1230555555,decimalLongitude:-74.12305555555555},{verbatimCoordinates:'40°7’23"S 74°7’23"E',verbatimLatitude:'40°7’23"S',verbatimLongitude:'74°7’23"E',decimalLatitude:-40.1230555555,decimalLongitude:74.12305555555555},{verbatimCoordinates:'40°7’23" -74°7’23"',verbatimLatitude:'40°7’23"',verbatimLongitude:'-74°7’23"',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:'40d 7’ 23" N 74d 7’ 23" W',verbatimLatitude:'40d 7’ 23" N',verbatimLongitude:'74d 7’ 23" W',decimalLatitude:40.1230555555,decimalLongitude:-74.123055555},{verbatimCoordinates:"40.123N 74.123W",verbatimLatitude:"40.123N",verbatimLongitude:"74.123W"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40° 7.38, -74° 7.38",verbatimLatitude:"40° 7.38",verbatimLongitude:"-74° 7.38"},{verbatimCoordinates:"40 7 22.8; -74 7 22.8",verbatimLatitude:"40 7 22.8",verbatimLongitude:"-74 7 22.8"}],hO={decimalLatitude:40.123,decimalLongitude:-74.123},fO=[{verbatimCoordinates:`50°4'17.698"south, 14°24'2.826"east`,verbatimLatitude:`50°4'17.698"south`,verbatimLongitude:`14°24'2.826"east`,decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"50d4m17.698S 14d24m2.826E",verbatimLatitude:"50d4m17.698S",verbatimLongitude:"14d24m2.826E",decimalLatitude:-50.07158277777778,decimalLongitude:14.400785},{verbatimCoordinates:"40:26:46N,79:56:55W",verbatimLatitude:"40:26:46N",verbatimLongitude:"79:56:55W",decimalLatitude:40.44611111111111,decimalLongitude:-79.9486111111111},{verbatimCoordinates:"40:26:46.302N 79:56:55.903W",verbatimLatitude:"40:26:46.302N",verbatimLongitude:"79:56:55.903W",decimalLatitude:40.446195,decimalLongitude:-79.94886194444445},{verbatimCoordinates:"40°26′47″N 79°58′36″W",verbatimLatitude:"40°26′47″N",verbatimLongitude:"79°58′36″W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40d 26′ 47″ N 79d 58′ 36″ W",verbatimLatitude:"40d 26′ 47″ N",verbatimLongitude:"79d 58′ 36″ W",decimalLatitude:40.44638888888889,decimalLongitude:-79.97666666666667},{verbatimCoordinates:"40.446195N 79.948862W",verbatimLatitude:"40.446195N",verbatimLongitude:"79.948862W",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40,446195° 79,948862°",verbatimLatitude:"40,446195°",verbatimLongitude:"79,948862°",decimalLatitude:40.446195,decimalLongitude:79.948862},{verbatimCoordinates:"40° 26.7717, -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.446195, -79.948862",verbatimLatitude:"40.446195",verbatimLongitude:"-79.948862",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"40.123256; -74.123256",verbatimLatitude:"40.123256",verbatimLongitude:"-74.123256",decimalLatitude:40.123256,decimalLongitude:-74.123256},{verbatimCoordinates:"18°24S 22°45E",verbatimLatitude:"18°24S",verbatimLongitude:"22°45E",decimalLatitude:-18.4,decimalLongitude:22.75}],pO=[{verbatimCoordinates:"10.432342S 10.6345345E",verbatimLatitude:"10.432342S",verbatimLongitude:"10.6345345E",decimalLatitude:-10.432342,decimalLongitude:10.6345345},{verbatimCoordinates:"10.00S 10.00E",verbatimLatitude:"10.00S",verbatimLongitude:"10.00E",decimalLatitude:-10,decimalLongitude:10},{verbatimCoordinates:"00.00S 01.00E",verbatimLatitude:"00.00S",verbatimLongitude:"01.00E",decimalLatitude:0,decimalLongitude:1},{verbatimCoordinates:"18.24S 22.45E",verbatimLatitude:"18.24S",verbatimLongitude:"22.45E",decimalLatitude:-18.4,decimalLongitude:22.75},{verbatimCoordinates:"27deg 15min 45.2sec S 18deg 32min 53.7sec E",verbatimLatitude:"27deg 15min 45.2sec S",verbatimLongitude:"18deg 32min 53.7sec E",decimalLatitude:-27.262555555555554,decimalLongitude:18.54825},{verbatimCoordinates:"-23.3245° S / 28.2344° E",verbatimLatitude:"-23.3245° S",verbatimLongitude:"28.2344° E",decimalLatitude:-23.3245,decimalLongitude:28.2344},{verbatimCoordinates:"40° 26.7717 -79° 56.93172",verbatimLatitude:"40° 26.7717",verbatimLongitude:"-79° 56.93172",decimalLatitude:40.446195,decimalLongitude:-79.948862},{verbatimCoordinates:"27.15.45S 18.32.53E",verbatimLatitude:"27.15.45S",verbatimLongitude:"18.32.53E",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"-27.15.45 18.32.53",verbatimLatitude:"-27.15.45",verbatimLongitude:"18.32.53",decimalLatitude:-27.2625,decimalLongitude:18.548055},{verbatimCoordinates:"27.15.45.2S 18.32.53.4E",verbatimLatitude:"27.15.45.2S",verbatimLongitude:"18.32.53.4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"27.15.45,2S 18.32.53,4E",verbatimLatitude:"27.15.45,2S",verbatimLongitude:"18.32.53,4E",decimalLatitude:-27.262556,decimalLongitude:18.548167},{verbatimCoordinates:"S23.43563 ° E22.45634 °",verbatimLatitude:"S23.43563 °",verbatimLongitude:"E22.45634 °",decimalLatitude:-23.43563,decimalLongitude:22.45634},{verbatimCoordinates:"27,71372° S 23,07771° E",verbatimLatitude:"27,71372° S",verbatimLongitude:"23,07771° E",decimalLatitude:-27.71372,decimalLongitude:23.07771},{verbatimCoordinates:"27.45.34 S 23.23.23 E",verbatimLatitude:"27.45.34 S",verbatimLongitude:"23.23.23 E",decimalLatitude:-27.759444,decimalLongitude:23.38972222},{verbatimCoordinates:"S 27.45.34 E 23.23.23",verbatimLatitude:"S 27.45.34",verbatimLongitude:"E 23.23.23",decimalLatitude:-27.759444,decimalLongitude:23.38972222}];function dO(){const t=[];return cO.forEach(e=>{e.decimalLatitude?t.push(e):t.push({...e,...hO})}),[...t,...fO,...pO]}const mO=dO();mO.map(t=>t.verbatimCoordinates);/** - * splaytree v3.1.2 - * Fast Splay tree for Node and browser - * - * @author Alexander Milevski - * @license MIT - * @preserve - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */function gO(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(y){return function(S){return d([y,S])}}function d(y){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=y[0]&2?i.return:y[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,y[1])).done)return o;switch(i=0,o&&(y=[y[0]&2,o.value]),y[0]){case 0:case 1:o=y;break;case 4:return n.label++,{value:y[1],done:!1};case 5:n.label++,i=y[1],y=[0];continue;case 7:y=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(y[0]===6||y[0]===2)){n=0;continue}if(y[0]===3&&(!o||y[1]>o[0]&&y[1]e?1:t0){if(e.right===null)break;if(n(t,e.right.key)>0){var l=e.right;if(e.right=l.left,l.left=e,e=l,e.right===null)break}i.right=e,i=e,e=e.right}else break}return i.right=e.left,o.left=e.right,e.left=r.right,e.right=r.left,e}function rv(t,e,n,r){var i=new rc(t,e);if(n===null)return i.left=i.right=null,i;n=$u(t,n,r);var o=r(t,n.key);return o<0?(i.left=n.left,i.right=n,n.left=null):o>=0&&(i.right=n.right,i.left=n,n.right=null),i}function W2(t,e,n){var r=null,i=null;if(e){e=$u(t,e,n);var o=n(e.key,t);o===0?(r=e.left,i=e.right):o<0?(i=e.right,e.right=null,r=e):(r=e.left,e.left=null,i=e)}return{left:r,right:i}}function yO(t,e,n){return e===null?t:(t===null||(e=$u(t.key,e,n),e.left=t),e)}function Wv(t,e,n,r,i){if(t){r(""+e+(n?"└── ":"├── ")+i(t)+` -`);var o=e+(n?" ":"│ ");t.left&&Wv(t.left,o,!1,r,i),t.right&&Wv(t.right,o,!0,r,i)}}var Z1=function(){function t(e){e===void 0&&(e=_O),this._root=null,this._size=0,this._comparator=e}return t.prototype.insert=function(e,n){return this._size++,this._root=rv(e,n,this._root,this._comparator)},t.prototype.add=function(e,n){var r=new rc(e,n);this._root===null&&(r.left=r.right=null,this._size++,this._root=r);var i=this._comparator,o=$u(e,this._root,i),c=i(e,o.key);return c===0?this._root=o:(c<0?(r.left=o.left,r.right=o,o.left=null):c>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},t.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},t.prototype._remove=function(e,n,r){var i;if(n===null)return null;n=$u(e,n,r);var o=r(e,n.key);return o===0?(n.left===null?i=n.right:(i=$u(e,n.left,r),i.right=n.right),this._size--,i):n},t.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=$u(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},t.prototype.findStatic=function(e){for(var n=this._root,r=this._comparator;n;){var i=r(e,n.key);if(i===0)return n;i<0?n=n.left:n=n.right}return null},t.prototype.find=function(e){return this._root&&(this._root=$u(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root},t.prototype.contains=function(e){for(var n=this._root,r=this._comparator;n;){var i=r(e,n.key);if(i===0)return!0;i<0?n=n.left:n=n.right}return!1},t.prototype.forEach=function(e,n){for(var r=this._root,i=[],o=!1;!o;)r!==null?(i.push(r),r=r.left):i.length!==0?(r=i.pop(),e.call(n,r),r=r.right):o=!0;return this},t.prototype.range=function(e,n,r,i){for(var o=[],c=this._comparator,l=this._root,d;o.length!==0||l;)if(l)o.push(l),l=l.left;else{if(l=o.pop(),d=c(l.key,n),d>0)break;if(c(l.key,e)>=0&&r.call(i,l))return this;l=l.right}return this},t.prototype.keys=function(){var e=[];return this.forEach(function(n){var r=n.key;return e.push(r)}),e},t.prototype.values=function(){var e=[];return this.forEach(function(n){var r=n.data;return e.push(r)}),e},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.left;)e=e.left;return e},t.prototype.maxNode=function(e){if(e===void 0&&(e=this._root),e)for(;e.right;)e=e.right;return e},t.prototype.at=function(e){for(var n=this._root,r=!1,i=0,o=[];!r;)if(n)o.push(n),n=n.left;else if(o.length>0){if(n=o.pop(),i===e)return n;i++,n=n.right}else r=!0;return null},t.prototype.next=function(e){var n=this._root,r=null;if(e.right){for(r=e.right;r.left;)r=r.left;return r}for(var i=this._comparator;n;){var o=i(e.key,n.key);if(o===0)break;o<0?(r=n,n=n.left):n=n.right}return r},t.prototype.prev=function(e){var n=this._root,r=null;if(e.left!==null){for(r=e.left;r.right;)r=r.right;return r}for(var i=this._comparator;n;){var o=i(e.key,n.key);if(o===0)break;o<0?n=n.left:(r=n,n=n.right)}return r},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return bO(this._root)},t.prototype.load=function(e,n,r){n===void 0&&(n=[]),r===void 0&&(r=!1);var i=e.length,o=this._comparator;if(r&&Xv(e,n,0,i-1,o),this._root===null)this._root=Hv(e,n,0,i),this._size=i;else{var c=xO(this.toList(),vO(e,n),o);i=this._size+i,this._root=Zv({head:c},0,i)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(e){e===void 0&&(e=function(r){return String(r.key)});var n=[];return Wv(this._root,"",!0,function(r){return n.push(r)},e),n.join("")},t.prototype.update=function(e,n,r){var i=this._comparator,o=W2(e,this._root,i),c=o.left,l=o.right;i(e,n)<0?l=rv(n,r,l,i):c=rv(n,r,c,i),this._root=yO(c,l,i)},t.prototype.split=function(e){return W2(e,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var e,n,r;return gO(this,function(i){switch(i.label){case 0:e=this._root,n=[],r=!1,i.label=1;case 1:return r?[3,6]:e===null?[3,2]:(n.push(e),e=e.left,[3,5]);case 2:return n.length===0?[3,4]:(e=n.pop(),[4,e]);case 3:return i.sent(),e=e.right,[3,5];case 4:r=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Hv(t,e,n,r){var i=r-n;if(i>0){var o=n+Math.floor(i/2),c=t[o],l=e[o],d=new rc(c,l);return d.left=Hv(t,e,n,o),d.right=Hv(t,e,o+1,r),d}return null}function vO(t,e){for(var n=new rc(null,null),r=n,i=0;i0?(e=o=o.next=n.pop(),e=e.right):r=!0;return o.next=null,i.next}function Zv(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=Zv(t,e,i),c=t.head;return c.left=o,t.head=t.head.next,c.right=Zv(t,i+1,n),c}return null}function xO(t,e,n){for(var r=new rc(null,null),i=r,o=t,c=e;o!==null&&c!==null;)n(o.key,c.key)<0?(i.next=o,o=o.next):(i.next=c,c=c.next),i=i.next;return o!==null?i.next=o:c!==null&&(i.next=c),r.next}function Xv(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],c=n-1,l=r+1;;){do c++;while(i(t[c],o)<0);do l--;while(i(t[l],o)>0);if(c>=l)break;var d=t[c];t[c]=t[l],t[l]=d,d=e[c],e[c]=e[l],e[l]=d}Xv(t,e,n,l,i),Xv(t,e,l+1,r,i)}}function Ra(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H2(t,e){for(var n=0;nn.x?1:e.yn.y?1:0}}]);function t(e,n){Ra(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return os(t,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var n=e.point.events,r=0,i=n.length;r=0&&E>=0?yC?-1:0:d<0&&E<0?yC?1:0:Ed?1:0}}}]),t}(),TO=0,O_=function(){os(t,null,[{key:"compare",value:function(e,n){var r=e.leftSE.point.x,i=n.leftSE.point.x,o=e.rightSE.point.x,c=n.rightSE.point.x;if(cl&&d>y)return-1;var E=e.comparePoint(n.leftSE.point);if(E<0)return 1;if(E>0)return-1;var C=n.comparePoint(e.rightSE.point);return C!==0?C:-1}if(r>i){if(ld&&l>S)return 1;var A=n.comparePoint(e.leftSE.point);if(A!==0)return A;var M=e.comparePoint(n.rightSE.point);return M<0?1:M>0?-1:1}if(ld)return 1;if(oc){var N=e.comparePoint(n.rightSE.point);if(N<0)return 1;if(N>0)return-1}if(o!==c){var B=y-l,O=o-r,G=S-d,U=c-i;if(B>O&&GU)return-1}return o>c?1:oS?1:e.idn.id?1:0}}]);function t(e,n,r,i){Ra(this,t),this.id=++TO,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=r,this.windings=i}return os(t,[{key:"replaceRightSE",value:function(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,n=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:en?e:n}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var n=this.leftSE.point,r=this.rightSE.point,i=this.vector();if(n.x===r.x)return e.x===n.x?0:e.x0&&l.swapEvents(),Sl.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var n=0,r=this.windings.length;n0){var o=n;n=r,r=o}if(n.prev===r){var c=n;n=r,r=c}for(var l=0,d=r.rings.length;l0)i=n,o=e,c=-1;else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var d=new Sl(i,!0),y=new Sl(o,!1);return new t(d,y,[r],[c])}}]),t}(),K2=function(){function t(e,n,r){if(Ra(this,t),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var i=im.round(e[0][0],e[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};for(var o=i,c=1,l=e.length;cthis.bbox.ur.x&&(this.bbox.ur.x=d.x),d.y>this.bbox.ur.y&&(this.bbox.ur.y=d.y),o=d)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(O_.fromRing(o,i,this))}return os(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,r=this.segments.length;nthis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=n}return os(t,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),n=0,r=this.interiorRings.length;nthis.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=n}return os(t,[{key:"getSweepEvents",value:function(){for(var e=[],n=0,r=this.polys.length;n0&&(e=i)}for(var o=e.segment.prevInResult(),c=o?o.prevInResult():null;;){if(!o)return null;if(!c)return o.ringOut;if(c.ringOut!==o.ringOut)return c.ringOut.enclosingRing()!==o.ringOut?o.ringOut:o.ringOut.enclosingRing();o=c.prevInResult(),c=o?o.prevInResult():null}}}]),t}(),Q2=function(){function t(e){Ra(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return os(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var n=0,r=this.interiorRings.length;n1&&arguments[1]!==void 0?arguments[1]:O_.compare;Ra(this,t),this.queue=e,this.tree=new Z1(n),this.segments=[]}return os(t,[{key:"process",value:function(e){var n=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(n),r;var i=e.isLeft?this.tree.insert(n):this.tree.find(n);if(!i)throw new Error("Unable to find segment #".concat(n.id," ")+"[".concat(n.leftSE.point.x,", ").concat(n.leftSE.point.y,"] -> ")+"[".concat(n.rightSE.point.x,", ").concat(n.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var o=i,c=i,l=void 0,d=void 0;l===void 0;)o=this.tree.prev(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);for(;d===void 0;)c=this.tree.next(c),c===null?d=null:c.key.consumedBy===void 0&&(d=c.key);if(e.isLeft){var y=null;if(l){var S=l.getIntersection(n);if(S!==null&&(n.isAnEndpoint(S)||(y=S),!l.isAnEndpoint(S)))for(var E=this._splitSafely(l,S),C=0,A=E.length;C0?(this.tree.remove(n),r.push(e)):(this.segments.push(n),n.prev=l)}else{if(l&&d){var se=l.getIntersection(d);if(se!==null){if(!l.isAnEndpoint(se))for(var fe=this._splitSafely(l,se),ke=0,K=fe.length;keeS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var U=new kO(M),Z=M.size,ue=M.pop();ue;){var ae=ue.key;if(M.size===Z){var se=ae.segment;throw new Error("Unable to pop() ".concat(ae.isLeft?"left":"right"," SweepEvent ")+"[".concat(ae.point.x,", ").concat(ae.point.y,"] from segment #").concat(se.id," ")+"[".concat(se.leftSE.point.x,", ").concat(se.leftSE.point.y,"] -> ")+"[".concat(se.rightSE.point.x,", ").concat(se.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(M.size>eS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(U.segments.length>AO)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var fe=U.process(ae),ke=0,K=fe.length;ke1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;rn[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]e.x?1:this.ye.y?1:0};Oe.prototype.clone=function(){};Oe.prototype.copy=function(){return new Oe(this)};Oe.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};Oe.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)};Oe.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)};Oe.prototype.hashCode=function(){var t=17;return t=37*t+Oe.hashCode(this.x),t=37*t+Oe.hashCode(this.y),t};Oe.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z};Oe.prototype.interfaces_=function(){return[Cs,uy,Ts]};Oe.prototype.getClass=function(){return Oe};Oe.hashCode=function(){if(arguments.length===1){var t=arguments[0],e=cn.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}};dh.DimensionalComparator.get=function(){return cu};dh.serialVersionUID.get=function(){return 6683108902428367e3};dh.NULL_ORDINATE.get=function(){return cn.NaN};dh.X.get=function(){return 0};dh.Y.get=function(){return 1};dh.Z.get=function(){return 2};Object.defineProperties(Oe,dh);var cu=function(t){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var e=arguments[0];if(e!==2&&e!==3)throw new wr("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};cu.prototype.compare=function(t,e){var n=t,r=e,i=cu.compare(n.x,r.x);if(i!==0)return i;var o=cu.compare(n.y,r.y);if(o!==0)return o;if(this._dimensionsToTest<=2)return 0;var c=cu.compare(n.z,r.z);return c};cu.prototype.interfaces_=function(){return[jf]};cu.prototype.getClass=function(){return cu};cu.compare=function(t,e){return te?1:cn.isNaN(t)?cn.isNaN(e)?0:-1:cn.isNaN(e)?1:0};var Gf=function(){};Gf.prototype.create=function(){};Gf.prototype.interfaces_=function(){return[]};Gf.prototype.getClass=function(){return Gf};var ze=function(){},Im={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};ze.prototype.interfaces_=function(){return[]};ze.prototype.getClass=function(){return ze};ze.toLocationSymbol=function(t){switch(t){case ze.EXTERIOR:return"e";case ze.BOUNDARY:return"b";case ze.INTERIOR:return"i";case ze.NONE:return"-"}throw new wr("Unknown location value: "+t)};Im.INTERIOR.get=function(){return 0};Im.BOUNDARY.get=function(){return 1};Im.EXTERIOR.get=function(){return 2};Im.NONE.get=function(){return-1};Object.defineProperties(ze,Im);var rn=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},ss=function(){},FC={LOG_10:{configurable:!0}};ss.prototype.interfaces_=function(){return[]};ss.prototype.getClass=function(){return ss};ss.log10=function(t){var e=Math.log(t);return cn.isInfinite(e)||cn.isNaN(e)?e:e/ss.LOG_10};ss.min=function(t,e,n,r){var i=t;return en?n:t}else if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}};ss.wrap=function(t,e){return t<0?e- -t%e:t%e};ss.max=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}else if(arguments.length===4){var i=arguments[0],o=arguments[1],c=arguments[2],l=arguments[3],d=i;return o>d&&(d=o),c>d&&(d=c),l>d&&(d=l),d}};ss.average=function(t,e){return(t+e)/2};FC.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(ss,FC);var Na=function(t){this.str=t};Na.prototype.append=function(t){this.str+=t};Na.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)};Na.prototype.toString=function(t){return this.str};var Sa=function(t){this.value=t};Sa.prototype.intValue=function(){return this.value};Sa.prototype.compareTo=function(t){return this.valuet?1:0};Sa.isNaN=function(t){return Number.isNaN(t)};var om=function(){};om.isWhitespace=function(t){return t<=32&&t>=0||t===127};om.toUpperCase=function(t){return t.toUpperCase()};var Ze=function t(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if(typeof arguments[0]=="string"){var r=arguments[0];t.call(this,t.parse(r))}}else if(arguments.length===2){var i=arguments[0],o=arguments[1];this.init(i,o)}},$s={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Ze.prototype.le=function(t){return(this._hi9?(S=!0,E="9"):E="0"+y,c.append(E),n=n.subtract(Ze.valueOf(y)).multiply(Ze.TEN),S&&n.selfAdd(Ze.TEN);var C=!0,A=Ze.magnitude(n._hi);if(A<0&&Math.abs(A)>=l-d&&(C=!1),!C)break}return e[0]=r,c.toString()};Ze.prototype.sqr=function(){return this.multiply(this)};Ze.prototype.doubleValue=function(){return this._hi+this._lo};Ze.prototype.subtract=function(){if(arguments[0]instanceof Ze){var t=arguments[0];return this.add(t.negate())}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.add(-e)}};Ze.prototype.equals=function(){if(arguments.length===1){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}};Ze.prototype.isZero=function(){return this._hi===0&&this._lo===0};Ze.prototype.selfSubtract=function(){if(arguments[0]instanceof Ze){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}};Ze.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};Ze.prototype.min=function(t){return this.le(t)?this:t};Ze.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Ze){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfDivide(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=null,o=null,c=null,l=null,d=null,y=null,S=null,E=null;return d=this._hi/n,y=Ze.SPLIT*d,i=y-d,E=Ze.SPLIT*n,i=y-i,o=d-i,c=E-n,S=d*n,c=E-c,l=n-c,E=i*c-S+i*l+o*c+o*l,y=(this._hi-S-E+this._lo-d*r)/n,E=d+y,this._hi=E,this._lo=d-E+y,this}};Ze.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};Ze.prototype.divide=function(){if(arguments[0]instanceof Ze){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,c=null,l=null,d=null;o=this._hi/t._hi,c=Ze.SPLIT*o,e=c-o,d=Ze.SPLIT*t._hi,e=c-e,n=o-e,r=d-t._hi,l=o*t._hi,r=d-r,i=t._hi-r,d=e*r-l+e*i+n*r+n*i,c=(this._hi-l-d+this._lo-o*t._lo)/t._hi,d=o+c;var y=d,S=o-d+c;return new Ze(y,S)}else if(typeof arguments[0]=="number"){var E=arguments[0];return cn.isNaN(E)?Ze.createNaN():Ze.copy(this).selfDivide(E,0)}};Ze.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo};Ze.prototype.pow=function(t){if(t===0)return Ze.valueOf(1);var e=new Ze(this),n=Ze.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2===1&&n.selfMultiply(e),r/=2,r>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n};Ze.prototype.ceil=function(){if(this.isNaN())return Ze.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new Ze(t,e)};Ze.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0};Ze.prototype.rint=function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()};Ze.prototype.setValue=function(){if(arguments[0]instanceof Ze){var t=arguments[0];return this.init(t),this}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.init(e),this}};Ze.prototype.max=function(t){return this.ge(t)?this:t};Ze.prototype.sqrt=function(){if(this.isZero())return Ze.valueOf(0);if(this.isNegative())return Ze.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Ze.valueOf(e),r=this.subtract(n.sqr()),i=r._hi*(t*.5);return n.add(i)};Ze.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Ze){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0],n=null,r=null,i=null,o=null,c=null,l=null;return i=this._hi+e,c=i-this._hi,o=i-c,o=e-c+(this._hi-o),l=o+this._lo,n=i+l,r=l+(i-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(arguments.length===2){var d=arguments[0],y=arguments[1],S=null,E=null,C=null,A=null,M=null,R=null,N=null,B=null;M=this._hi+d,C=this._lo+y,N=M-this._hi,B=C-this._lo,R=M-N,A=C-B,R=d-N+(this._hi-R),A=y-B+(this._lo-A),N=R+C,S=M+N,E=N+(M-S),N=A+E;var O=S+N,G=N+(S-O);return this._hi=O,this._lo=G,this}};Ze.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Ze){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}else if(typeof arguments[0]=="number"){var e=arguments[0];return this.selfMultiply(e,0)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=null,o=null,c=null,l=null,d=null,y=null;d=Ze.SPLIT*this._hi,i=d-this._hi,y=Ze.SPLIT*n,i=d-i,o=this._hi-i,c=y-n,d=this._hi*n,c=y-c,l=n-c,y=i*c-d+i*l+o*c+o*l+(this._hi*r+this._lo*n);var S=d+y;i=d-S;var E=y+i;return this._hi=S,this._lo=E,this}};Ze.prototype.selfSqr=function(){return this.selfMultiply(this)};Ze.prototype.floor=function(){if(this.isNaN())return Ze.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Ze(t,e)};Ze.prototype.negate=function(){return this.isNaN()?this:new Ze(-this._hi,-this._lo)};Ze.prototype.clone=function(){};Ze.prototype.multiply=function(){if(arguments[0]instanceof Ze){var t=arguments[0];return t.isNaN()?Ze.createNaN():Ze.copy(this).selfMultiply(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return cn.isNaN(e)?Ze.createNaN():Ze.copy(this).selfMultiply(e,0)}};Ze.prototype.isNaN=function(){return cn.isNaN(this._hi)};Ze.prototype.intValue=function(){return Math.trunc(this._hi)};Ze.prototype.toString=function(){var t=Ze.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()};Ze.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if(n.charAt(0)===".")i="0"+n;else if(r<0)i="0."+Ze.stringOfChar("0",-r)+n;else if(n.indexOf(".")===-1){var o=r-n.length,c=Ze.stringOfChar("0",o);i=n+c+".0"}return this.isNegative()?"-"+i:i};Ze.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,c=null,l=null;i=1/this._hi,o=Ze.SPLIT*i,t=o-i,l=Ze.SPLIT*this._hi,t=o-t,e=i-t,n=l-this._hi,c=i*this._hi,n=l-n,r=this._hi-n,l=t*n-c+t*r+e*n+e*r,o=(1-c-l-i*this._lo)/this._hi;var d=i+o,y=i-d+o;return new Ze(d,y)};Ze.prototype.toSciNotation=function(){if(this.isZero())return Ze.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(t!==null)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=Ze.SCI_NOT_EXPONENT_CHAR+e[0];if(n.charAt(0)==="0")throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r};Ze.prototype.abs=function(){return this.isNaN()?Ze.NaN:this.isNegative()?this.negate():new Ze(this)};Ze.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0};Ze.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo};Ze.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0};Ze.prototype.trunc=function(){return this.isNaN()?Ze.NaN:this.isPositive()?this.floor():this.ceil()};Ze.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};Ze.prototype.interfaces_=function(){return[Ts,Cs,uy]};Ze.prototype.getClass=function(){return Ze};Ze.sqr=function(t){return Ze.valueOf(t).selfMultiply(t)};Ze.valueOf=function(){if(typeof arguments[0]=="string"){var t=arguments[0];return Ze.parse(t)}else if(typeof arguments[0]=="number"){var e=arguments[0];return new Ze(e)}};Ze.sqrt=function(t){return Ze.valueOf(t).sqrt()};Ze.parse=function(t){for(var e=0,n=t.length;om.isWhitespace(t.charAt(e));)e++;var r=!1;if(e=n);){var y=t.charAt(e);if(e++,om.isDigit(y)){var S=y-"0";o.selfMultiply(Ze.TEN),o.selfAdd(S),c++;continue}if(y==="."){l=c;continue}if(y==="e"||y==="E"){var E=t.substring(e);try{d=Sa.parseInt(E)}catch(N){throw N instanceof Error?new Error("Invalid exponent "+E+" in string "+t):N}finally{}break}throw new Error("Unexpected character '"+y+"' at position "+e+" in string "+t)}var C=o,A=c-l-d;if(A===0)C=o;else if(A>0){var M=Ze.TEN.pow(A);C=o.divide(M)}else if(A<0){var R=Ze.TEN.pow(-A);C=o.multiply(R)}return r?C.negate():C};Ze.createNaN=function(){return new Ze(cn.NaN,cn.NaN)};Ze.copy=function(t){return new Ze(t)};Ze.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n)),i=Math.pow(10,r);return i*10<=e&&(r+=1),r};Ze.stringOfChar=function(t,e){for(var n=new Na,r=0;r0){if(o<=0)return wo.signum(c);r=i+o}else if(i<0){if(o>=0)return wo.signum(c);r=-i-o}else return wo.signum(c);var l=wo.DP_SAFE_EPSILON*r;return c>=l||-c>=l?wo.signum(c):2};wo.signum=function(t){return t>0?1:t<0?-1:0};BC.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(wo,BC);var Vn=function(){},Cm={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Cm.X.get=function(){return 0};Cm.Y.get=function(){return 1};Cm.Z.get=function(){return 2};Cm.M.get=function(){return 3};Vn.prototype.setOrdinate=function(t,e,n){};Vn.prototype.size=function(){};Vn.prototype.getOrdinate=function(t,e){};Vn.prototype.getCoordinate=function(){};Vn.prototype.getCoordinateCopy=function(t){};Vn.prototype.getDimension=function(){};Vn.prototype.getX=function(t){};Vn.prototype.clone=function(){};Vn.prototype.expandEnvelope=function(t){};Vn.prototype.copy=function(){};Vn.prototype.getY=function(t){};Vn.prototype.toCoordinateArray=function(){};Vn.prototype.interfaces_=function(){return[uy]};Vn.prototype.getClass=function(){return Vn};Object.defineProperties(Vn,Cm);var VC=function(){},yp=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(VC),Fi=function(){};Fi.arraycopy=function(t,e,n,r,i){for(var o=0,c=e;ct._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.isNull()?!1:n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}};Wt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Wt){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}};Wt.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0};Wt.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)};Wt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};Wt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1};Wt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};Wt.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e};Wt.prototype.expandBy=function(){if(arguments.length===1){var t=arguments[0];this.expandBy(t,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};Wt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Wt){var t=arguments[0];return this.covers(t)}else if(arguments[0]instanceof Oe){var e=arguments[0];return this.covers(e)}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];return this.covers(n,r)}};Wt.prototype.centre=function(){return this.isNull()?null:new Oe((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};Wt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof Oe){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Wt){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],c=arguments[2],l=arguments[3];it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),e===0?n:n===0?e:Math.sqrt(e*e+n*n)};Wt.prototype.hashCode=function(){var t=17;return t=37*t+Oe.hashCode(this._minx),t=37*t+Oe.hashCode(this._maxx),t=37*t+Oe.hashCode(this._miny),t=37*t+Oe.hashCode(this._maxy),t};Wt.prototype.interfaces_=function(){return[Cs,Ts]};Wt.prototype.getClass=function(){return Wt};Wt.intersects=function(){if(arguments.length===3){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}else if(arguments.length===4){var r=arguments[0],i=arguments[1],o=arguments[2],c=arguments[3],l=Math.min(o.x,c.x),d=Math.max(o.x,c.x),y=Math.min(r.x,i.x),S=Math.max(r.x,i.x);return!(y>d||Sd)||Sn?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}};Tr.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};Tr.prototype.setPrecisionModel=function(t){this._precisionModel=t};Tr.prototype.isInteriorIntersection=function(){var t=this;if(arguments.length===0)return!!(this.isInteriorIntersection(0)||this.isInteriorIntersection(1));if(arguments.length===1){for(var e=arguments[0],n=0;ni?o=r:o=i;else{var c=Math.abs(t.x-e.x),l=Math.abs(t.y-e.y);r>i?o=c:o=l,o===0&&!t.equals(e)&&(o=Math.max(c,l))}return yn.isTrue(!(o===0&&!t.equals(e)),"Bad distance calculation"),o};Tr.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return yn.isTrue(!(o===0&&!t.equals(e)),"Invalid distance calculation"),o};mh.DONT_INTERSECT.get=function(){return 0};mh.DO_INTERSECT.get=function(){return 1};mh.COLLINEAR.get=function(){return 2};mh.NO_INTERSECTION.get=function(){return 0};mh.POINT_INTERSECTION.get=function(){return 1};mh.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(Tr,mh);var gc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(n){var r=new Wt(this._inputLines[0][0],this._inputLines[0][1]),i=new Wt(this._inputLines[1][0],this._inputLines[1][1]);return r.contains(n)&&i.contains(n)},e.prototype.computeIntersection=function(){if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];if(this._isProper=!1,Wt.intersects(r,i,n)&&Tt.orientationIndex(r,i,n)===0&&Tt.orientationIndex(i,r,n)===0)return this._isProper=!0,(n.equals(r)||n.equals(i))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION}else return t.prototype.computeIntersection.apply(this,arguments)},e.prototype.normalizeToMinimum=function(n,r,i,o,c){c.x=this.smallestInAbsValue(n.x,r.x,i.x,o.x),c.y=this.smallestInAbsValue(n.y,r.y,i.y,o.y),n.x-=c.x,n.y-=c.y,r.x-=c.x,r.y-=c.y,i.x-=c.x,i.y-=c.y,o.x-=c.x,o.y-=c.y},e.prototype.safeHCoordinateIntersection=function(n,r,i,o){var c=null;try{c=Us.intersection(n,r,i,o)}catch(l){if(l instanceof yp)c=e.nearestEndpoint(n,r,i,o);else throw l}finally{}return c},e.prototype.intersection=function(n,r,i,o){var c=this.intersectionWithNormalization(n,r,i,o);return this.isInSegmentEnvelopes(c)||(c=new Oe(e.nearestEndpoint(n,r,i,o))),this._precisionModel!==null&&this._precisionModel.makePrecise(c),c},e.prototype.smallestInAbsValue=function(n,r,i,o){var c=n,l=Math.abs(c);return Math.abs(r)1e-4&&Fi.out.println("Distance = "+c.distance(l))},e.prototype.intersectionWithNormalization=function(n,r,i,o){var c=new Oe(n),l=new Oe(r),d=new Oe(i),y=new Oe(o),S=new Oe;this.normalizeToEnvCentre(c,l,d,y,S);var E=this.safeHCoordinateIntersection(c,l,d,y);return E.x+=S.x,E.y+=S.y,E},e.prototype.computeCollinearIntersection=function(n,r,i,o){var c=Wt.intersects(n,r,i),l=Wt.intersects(n,r,o),d=Wt.intersects(i,o,n),y=Wt.intersects(i,o,r);return c&&l?(this._intPt[0]=i,this._intPt[1]=o,t.COLLINEAR_INTERSECTION):d&&y?(this._intPt[0]=n,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):c&&d?(this._intPt[0]=i,this._intPt[1]=n,i.equals(n)&&!l&&!y?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):c&&y?(this._intPt[0]=i,this._intPt[1]=r,i.equals(r)&&!l&&!d?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):l&&d?(this._intPt[0]=o,this._intPt[1]=n,o.equals(n)&&!c&&!y?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):l&&y?(this._intPt[0]=o,this._intPt[1]=r,o.equals(r)&&!c&&!d?t.POINT_INTERSECTION:t.COLLINEAR_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(n,r,i,o,c){var l=n.xr.x?n.x:r.x,S=n.y>r.y?n.y:r.y,E=i.xo.x?i.x:o.x,M=i.y>o.y?i.y:o.y,R=l>E?l:E,N=yC?d:C,O=S0&&l>0||c<0&&l<0)return t.NO_INTERSECTION;var d=Tt.orientationIndex(i,o,n),y=Tt.orientationIndex(i,o,r);if(d>0&&y>0||d<0&&y<0)return t.NO_INTERSECTION;var S=c===0&&l===0&&d===0&&y===0;return S?this.computeCollinearIntersection(n,r,i,o):(c===0||l===0||d===0||y===0?(this._isProper=!1,n.equals2D(i)||n.equals2D(o)?this._intPt[0]=n:r.equals2D(i)||r.equals2D(o)?this._intPt[0]=r:c===0?this._intPt[0]=new Oe(i):l===0?this._intPt[0]=new Oe(o):d===0?this._intPt[0]=new Oe(n):y===0&&(this._intPt[0]=new Oe(r))):(this._isProper=!0,this._intPt[0]=this.intersection(n,r,i,o)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(n,r,i,o){var c=n,l=Tt.distancePointLine(n,i,o),d=Tt.distancePointLine(r,i,o);return d0?n>0?-i:i:n>0?i:-i;if(e===0||n===0)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0)if(n>0){if(!(t<=n))return i}else return i;else{if(n>0)return-i;if(t>=n)i=-i,t=-t,n=-n;else return-i}for(;;){if(c=Math.floor(n/t),n=n-c*t,r=r-c*e,r<0)return-i;if(r>e)return i;if(t>n+n){if(er+r)return-i;n=t-n,r=e-r,i=-i}if(r===0)return n===0?0:-i;if(n===0||(c=Math.floor(t/n),t=t-c*n,e=e-c*r,e<0))return i;if(e>r)return-i;if(n>t+t){if(re+e)return i;t=n-t,e=r-e,i=-i}if(e===0)return t===0?0:i;if(t===0)return-i}};var ya=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ya.prototype.countSegment=function(t,e){if(t.xr&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,c=e.x-this._p.x,l=e.y-this._p.y,d=Qc.signOfDet2x2(i,o,c,l);if(d===0)return this._isPointOnSegment=!0,null;l0&&this._crossingCount++}};ya.prototype.isPointInPolygon=function(){return this.getLocation()!==ze.EXTERIOR};ya.prototype.getLocation=function(){return this._isPointOnSegment?ze.BOUNDARY:this._crossingCount%2===1?ze.INTERIOR:ze.EXTERIOR};ya.prototype.isOnSegment=function(){return this._isPointOnSegment};ya.prototype.interfaces_=function(){return[]};ya.prototype.getClass=function(){return ya};ya.locatePointInRing=function(){if(arguments[0]instanceof Oe&&rn(arguments[1],Vn)){for(var t=arguments[0],e=arguments[1],n=new ya(t),r=new Oe,i=new Oe,o=1;o1||d<0||d>1)&&(i=!0)}}return i?ss.min(Tt.distancePointLine(t,n,r),Tt.distancePointLine(e,n,r),Tt.distancePointLine(n,t,e),Tt.distancePointLine(r,t,e)):0};Tt.isPointInRing=function(t,e){return Tt.locatePointInRing(t,e)!==ze.EXTERIOR};Tt.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new Oe;t.getCoordinate(0,r);for(var i=r.x,o=r.y,c=1;cn.y&&(n=o,r=i)}var c=r;do c=c-1,c<0&&(c=e);while(t[c].equals2D(n)&&c!==r);var l=r;do l=(l+1)%e;while(t[l].equals2D(n)&&l!==r);var d=t[c],y=t[l];if(d.equals2D(n)||y.equals2D(n)||d.equals2D(y))return!1;var S=Tt.computeOrientation(d,n,y),E=!1;return S===0?E=d.x>y.x:E=S>0,E};Tt.locatePointInRing=function(t,e){return ya.locatePointInRing(t,e)};Tt.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)};Tt.computeOrientation=function(t,e,n){return Tt.orientationIndex(t,e,n)};Tt.distancePointLine=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];if(e.length===0)throw new wr("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r=1)return o.distance(l);var S=((c.y-o.y)*(l.x-c.x)-(c.x-o.x)*(l.y-c.y))/d;return Math.abs(S)*Math.sqrt(d)}};Tt.isOnLine=function(t,e){for(var n=new gc,r=1;r0};Wf.prototype.interfaces_=function(){return[Ss]};Wf.prototype.getClass=function(){return Wf};var Hf=function(){};Hf.prototype.isInBoundary=function(t){return t>1};Hf.prototype.interfaces_=function(){return[Ss]};Hf.prototype.getClass=function(){return Hf};var Zf=function(){};Zf.prototype.isInBoundary=function(t){return t===1};Zf.prototype.interfaces_=function(){return[Ss]};Zf.prototype.getClass=function(){return Zf};var ni=function(){};ni.prototype.add=function(){};ni.prototype.addAll=function(){};ni.prototype.isEmpty=function(){};ni.prototype.iterator=function(){};ni.prototype.size=function(){};ni.prototype.toArray=function(){};ni.prototype.remove=function(){};function Y1(t){this.message=t||""}Y1.prototype=new Error;Y1.prototype.name="IndexOutOfBoundsException";var vp=function(){};vp.prototype.hasNext=function(){};vp.prototype.next=function(){};vp.prototype.remove=function(){};var js=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(ni);function bp(t){this.message=t||""}bp.prototype=new Error;bp.prototype.name="NoSuchElementException";var vt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof ni&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,ni]},e.prototype.add=function(n){return arguments.length===1?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(n){for(var r=this,i=n.iterator();i.hasNext();)r.add(i.next());return!0},e.prototype.set=function(n,r){var i=this.array_[n];return this.array_[n]=r,i},e.prototype.iterator=function(){return new GO(this)},e.prototype.get=function(n){if(n<0||n>=this.size())throw new Y1;return this.array_[n]},e.prototype.isEmpty=function(){return this.array_.length===0},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var n=this,r=[],i=0,o=this.array_.length;i=1){var y=this.get(this.size()-1);if(y.equals2D(l))return null}t.prototype.add.call(this,l)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var S=arguments[0],E=arguments[1];return this.add(S,E),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var C=arguments[0],A=arguments[1],M=arguments[2];if(M)for(var R=0;R=0;N--)r.add(C[N],A);return!0}else if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof Oe){var B=arguments[0],O=arguments[1],G=arguments[2];if(!G){var U=this.size();if(U>0){if(B>0){var Z=this.get(B-1);if(Z.equals2D(O))return null}if(Bke&&(K=-1);for(var oe=fe;oe!==ke;oe+=K)r.add(ae[oe],se);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new Oe(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(vt),kn=function(){},hy={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};hy.ForwardComparator.get=function(){return sm};hy.BidirectionalComparator.get=function(){return Xf};hy.coordArrayType.get=function(){return new Array(0).fill(null)};kn.prototype.interfaces_=function(){return[]};kn.prototype.getClass=function(){return kn};kn.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))};kn.ptNotInList=function(t,e){for(var n=0;n=t?e:[]};kn.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e};kn.extract=function(t,e,n){e=ss.clamp(e,0,t.length),n=ss.clamp(n,-1,t.length);var r=n-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(n.length===0)return 0;var i=kn.compare(n,r),o=kn.isEqualReversed(n,r);return o?0:i};Xf.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(n.length===0)return 0;for(var i=kn.increasingDirection(n),o=kn.increasingDirection(r),c=i>0?0:n.length-1,l=o>0?0:n.length-1,d=0;d0)e=e.right;else return e.value}return null};Xi.prototype.put=function(t,e){if(this.root_===null)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:El,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n=this.root_,r,i;do if(r=n,i=t.compareTo(n.key),i<0)n=n.left;else if(i>0)n=n.right;else{var o=n.value;return n.value=e,o}while(n!==null);var c={key:t,left:null,right:null,value:e,parent:r,color:El,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?r.left=c:r.right=c,this.fixAfterInsertion(c),this.size_++,null};Xi.prototype.fixAfterInsertion=function(t){var e=this;for(t.color=Hu;t!=null&&t!==this.root_&&t.parent.color===Hu;)if(sr(t)===iv(sr(sr(t)))){var n=iS(sr(sr(t)));rS(n)===Hu?(bl(sr(t),El),bl(n,El),bl(sr(sr(t)),Hu),t=sr(sr(t))):(t===iS(sr(t))&&(t=sr(t),e.rotateLeft(t)),bl(sr(t),El),bl(sr(sr(t)),Hu),e.rotateRight(sr(sr(t))))}else{var r=iv(sr(sr(t)));rS(r)===Hu?(bl(sr(t),El),bl(r,El),bl(sr(sr(t)),Hu),t=sr(sr(t))):(t===iv(sr(t))&&(t=sr(t),e.rotateRight(t)),bl(sr(t),El),bl(sr(sr(t)),Hu),e.rotateLeft(sr(sr(t))))}this.root_.color=El};Xi.prototype.values=function(){var t=new vt,e=this.getFirstEntry();if(e!==null)for(t.add(e.value);(e=Xi.successor(e))!==null;)t.add(e.value);return t};Xi.prototype.entrySet=function(){var t=new $1,e=this.getFirstEntry();if(e!==null)for(t.add(e);(e=Xi.successor(e))!==null;)t.add(e);return t};Xi.prototype.rotateLeft=function(t){if(t!=null){var e=t.right;t.right=e.left,e.left!=null&&(e.left.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}};Xi.prototype.rotateRight=function(t){if(t!=null){var e=t.left;t.left=e.right,e.right!=null&&(e.right.parent=t),e.parent=t.parent,t.parent===null?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}};Xi.prototype.getFirstEntry=function(){var t=this.root_;if(t!=null)for(;t.left!=null;)t=t.left;return t};Xi.successor=function(t){if(t===null)return null;if(t.right!==null){for(var e=t.right;e.left!==null;)e=e.left;return e}else{for(var n=t.parent,r=t;n!==null&&r===n.right;)r=n,n=n.parent;return n}};Xi.prototype.size=function(){return this.size_};var am=function(){};am.prototype.interfaces_=function(){return[]};am.prototype.getClass=function(){return am};function jC(){}jC.prototype=new fy;function Ea(){this.array_=[],arguments[0]instanceof ni&&this.addAll(arguments[0])}Ea.prototype=new jC;Ea.prototype.contains=function(t){for(var e=this,n=0,r=this.array_.length;n=0;){var c=i.substring(0,o);r.add(c),i=i.substring(o+n),o=i.indexOf(e)}i.length>0&&r.add(i);for(var l=new Array(r.size()).fill(null),d=0;d0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(xs.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}};qr.ensureValidRing=function(t,e){var n=e.size();if(n===0)return e;if(n<=3)return qr.createClosedRing(t,e,4);var r=e.getOrdinate(0,Vn.X)===e.getOrdinate(n-1,Vn.X)&&e.getOrdinate(0,Vn.Y)===e.getOrdinate(n-1,Vn.Y);return r?e:qr.createClosedRing(t,e,n+1)};qr.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();qr.copy(e,0,r,0,i);for(var o=i;o0&&qr.reverse(r._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jn.FALSE:0},e.prototype.isClosed=function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Tt.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var r=this._points.copy();qr.reverse(r);var i=this.getFactory().createLineString(r);return i},e.prototype.compareToSameClass=function(){var r=this;if(arguments.length===1){for(var i=arguments[0],o=i,c=0,l=0;c= 2)");this._points=r},e.prototype.isCoordinate=function(r){for(var i=this,o=0;o=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Rr),Ya=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return nn.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.isEquivalentClass(r)?t.prototype.equalsExact.call(this,r,i):!1}else return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var r=this,i=this._geometries.length,o=new Array(i).fill(null),c=0;c0?e.createPoint(n[0]):e.createPoint():t};cm.prototype.interfaces_=function(){return[Es.GeometryEditorOperation]};cm.prototype.getClass=function(){return cm};var hm=function(){};hm.prototype.edit=function(t,e){return t instanceof Ja?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Rr?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Uo?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t};hm.prototype.interfaces_=function(){return[Es.GeometryEditorOperation]};hm.prototype.getClass=function(){return hm};var Ur=function(){var t=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var n=0;n0){var e=new Na(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var n=1;n3&&(r=3),r<2?new Ur(n):new Ur(n,r)}};Qa.prototype.interfaces_=function(){return[Gf,Ts]};Qa.prototype.getClass=function(){return Qa};Qa.instance=function(){return Qa.instanceObject};J1.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};J1.instanceObject.get=function(){return new Qa};Object.defineProperties(Qa,J1);var qC=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(n){return this.map_.get(n)||null},e.prototype.put=function(n,r){return this.map_.set(n,r),r},e.prototype.values=function(){for(var n=new vt,r=this.map_.values(),i=r.next();!i.done;)n.add(i.value),i=r.next();return n},e.prototype.entrySet=function(){var n=new $1;return this.map_.entries().forEach(function(r){return n.add(r)}),n},e.prototype.size=function(){return this.map_.size()},e}(_h),Wn=function t(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=t.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Ca){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}}},Q1={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Wn.prototype.equals=function(t){if(!(t instanceof Wn))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale};Wn.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new Sa(n).compareTo(new Sa(r))};Wn.prototype.getScale=function(){return this._scale};Wn.prototype.isFloating=function(){return this._modelType===Wn.FLOATING||this._modelType===Wn.FLOATING_SINGLE};Wn.prototype.getType=function(){return this._modelType};Wn.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Wn.FLOATING?t="Floating":this._modelType===Wn.FLOATING_SINGLE?t="Floating-Single":this._modelType===Wn.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t};Wn.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var t=arguments[0];if(cn.isNaN(t))return t;if(this._modelType===Wn.FLOATING_SINGLE){var e=t;return e}return this._modelType===Wn.FIXED?Math.round(t*this._scale)/this._scale:t}else if(arguments[0]instanceof Oe){var n=arguments[0];if(this._modelType===Wn.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}};Wn.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Wn.FLOATING?t=16:this._modelType===Wn.FLOATING_SINGLE?t=6:this._modelType===Wn.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t};Wn.prototype.setScale=function(t){this._scale=Math.abs(t)};Wn.prototype.interfaces_=function(){return[Ts,Cs]};Wn.prototype.getClass=function(){return Wn};Wn.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e};Q1.serialVersionUID.get=function(){return 7777263578777804e3};Q1.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(Wn,Q1);var Ca=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},eb={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Ca.prototype.readResolve=function(){return Ca.nameToTypeMap.get(this._name)};Ca.prototype.toString=function(){return this._name};Ca.prototype.interfaces_=function(){return[Ts]};Ca.prototype.getClass=function(){return Ca};eb.serialVersionUID.get=function(){return-552860263173159e4};eb.nameToTypeMap.get=function(){return new qC};Object.defineProperties(Ca,eb);Wn.Type=Ca;Wn.FIXED=new Ca("FIXED");Wn.FLOATING=new Ca("FLOATING");Wn.FLOATING_SINGLE=new Ca("FLOATING SINGLE");var Mn=function t(){this._precisionModel=new Wn,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?rn(arguments[0],Gf)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Wn&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},WC={serialVersionUID:{configurable:!0}};Mn.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Oe(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Oe(t.getMinX(),t.getMinY()),new Oe(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Oe(t.getMinX(),t.getMinY()),new Oe(t.getMinX(),t.getMaxY()),new Oe(t.getMaxX(),t.getMaxY()),new Oe(t.getMaxX(),t.getMinY()),new Oe(t.getMinX(),t.getMinY())]),null)};Mn.prototype.createLineString=function(t){if(t){if(t instanceof Array)return new Rr(this.getCoordinateSequenceFactory().create(t),this);if(rn(t,Vn))return new Rr(t,this)}else return new Rr(this.getCoordinateSequenceFactory().create([]),this)};Mn.prototype.createMultiLineString=function(){if(arguments.length===0)return new ic(null,this);if(arguments.length===1){var t=arguments[0];return new ic(t,this)}};Mn.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),c=o.getClass();e===null&&(e=c),c!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(e===null)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(Mn.toGeometryArray(t));var l=t.iterator().next(),d=t.size()>1;if(d){if(l instanceof ai)return this.createMultiPolygon(Mn.toPolygonArray(t));if(l instanceof Rr)return this.createMultiLineString(Mn.toLineStringArray(t));if(l instanceof Uo)return this.createMultiPoint(Mn.toPointArray(t));yn.shouldNeverReachHere("Unhandled class: "+l.getClass().getName())}return l};Mn.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(t!==null?this.getCoordinateSequenceFactory().create(t):null)};Mn.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Oe){var t=arguments[0];return this.createPoint(t!==null?this.getCoordinateSequenceFactory().create([t]):null)}else if(rn(arguments[0],Vn)){var e=arguments[0];return new Uo(e,this)}}};Mn.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};Mn.prototype.createPolygon=function(){if(arguments.length===0)return new ai(null,null,this);if(arguments.length===1){if(rn(arguments[0],Vn)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}else if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}else if(arguments[0]instanceof Ja){var n=arguments[0];return this.createPolygon(n,null)}}else if(arguments.length===2){var r=arguments[0],i=arguments[1];return new ai(r,i,this)}};Mn.prototype.getSRID=function(){return this._SRID};Mn.prototype.createGeometryCollection=function(){if(arguments.length===0)return new lo(null,this);if(arguments.length===1){var t=arguments[0];return new lo(t,this)}};Mn.prototype.createGeometry=function(t){var e=new Es(this);return e.edit(t,{edit:function(){if(arguments.length===2){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};Mn.prototype.getPrecisionModel=function(){return this._precisionModel};Mn.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(t!==null?this.getCoordinateSequenceFactory().create(t):null)}else if(rn(arguments[0],Vn)){var e=arguments[0];return new Ja(e,this)}}};Mn.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Ya(null,this);if(arguments.length===1){var t=arguments[0];return new Ya(t,this)}};Mn.prototype.createMultiPoint=function(){var t=this;if(arguments.length===0)return new Yf(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var e=arguments[0];return new Yf(e,this)}else if(arguments[0]instanceof Array){var n=arguments[0];return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)}else if(rn(arguments[0],Vn)){var r=arguments[0];if(r===null)return this.createMultiPoint(new Array(0).fill(null));for(var i=new Array(r.size()).fill(null),o=0;o=this.size())throw new Error;return this.array_[t]};Oa.prototype.push=function(t){return this.array_.push(t),t};Oa.prototype.pop=function(t){if(this.array_.length===0)throw new _y;return this.array_.pop()};Oa.prototype.peek=function(){if(this.array_.length===0)throw new _y;return this.array_[this.array_.length-1]};Oa.prototype.empty=function(){return this.array_.length===0};Oa.prototype.isEmpty=function(){return this.empty()};Oa.prototype.search=function(t){return this.array_.indexOf(t)};Oa.prototype.size=function(){return this.array_.length};Oa.prototype.toArray=function(){for(var t=this,e=[],n=0,r=this.array_.length;n0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===Tt.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)};Ta.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge(),r=n.getCoordinates();if(e<0||e+1>=r.length||r[e].y===r[e+1].y)return-1;var i=ut.LEFT;return r[e].ye._minCoord.x)&&(e._minDe=t,e._minIndex=r,e._minCoord=n[r])};Ta.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode(),e=t.getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};Ta.prototype.findEdge=function(t){for(var e=this,n=t.iterator();n.hasNext();){var r=n.next();r.isForward()&&e.checkForRightmostCoordinate(r)}yn.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;var i=this.getRightmostSide(this._minDe,this._minIndex);i===ut.LEFT&&(this._orientedDe=this._minDe.getSym())};Ta.prototype.interfaces_=function(){return[]};Ta.prototype.getClass=function(){return Ta};var Dl=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new Oe(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(n,r){return r?n:n+" [ "+r+" ]"},e}(kl),yy=function(){this.array_=[]};yy.prototype.addLast=function(t){this.array_.push(t)};yy.prototype.removeFirst=function(){return this.array_.shift()};yy.prototype.isEmpty=function(){return this.array_.length===0};var uo=function(){this._finder=null,this._dirEdgeList=new vt,this._nodes=new vt,this._rightMostCoord=null,this._env=null,this._finder=new Ta};uo.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}};uo.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};uo.prototype.computeNodeDepth=function(t){for(var e=this,n=null,r=t.getEdges().iterator();r.hasNext();){var i=r.next();if(i.isVisited()||i.getSym().isVisited()){n=i;break}}if(n===null)throw new Dl("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(n);for(var o=t.getEdges().iterator();o.hasNext();){var c=o.next();c.setVisited(!0),e.copySymDepths(c)}};uo.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(ut.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)};uo.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()};uo.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(ut.RIGHT)>=1&&e.getDepth(ut.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}};uo.prototype.computeDepths=function(t){var e=this,n=new $1,r=new yy,i=t.getNode();for(r.addLast(i),n.add(i),t.setVisited(!0);!r.isEmpty();){var o=r.removeFirst();n.add(o),e.computeNodeDepth(o);for(var c=o.getEdges().iterator();c.hasNext();){var l=c.next(),d=l.getSym();if(!d.isVisited()){var y=d.getNode();n.contains(y)||(r.addLast(y),n.add(y))}}}};uo.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0};uo.prototype.getEnvelope=function(){if(this._env===null){for(var t=new Wt,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),r=n.getEdge().getCoordinates(),i=0;ithis.location.length){var n=new Array(3).fill(null);n[ut.ON]=this.location[ut.ON],n[ut.LEFT]=ze.NONE,n[ut.RIGHT]=ze.NONE,this.location=n}for(var r=0;r1&&t.append(ze.toLocationSymbol(this.location[ut.LEFT])),t.append(ze.toLocationSymbol(this.location[ut.ON])),this.location.length>1&&t.append(ze.toLocationSymbol(this.location[ut.RIGHT])),t.toString()};ar.prototype.setLocations=function(t,e,n){this.location[ut.ON]=t,this.location[ut.LEFT]=e,this.location[ut.RIGHT]=n};ar.prototype.get=function(t){return t1};ar.prototype.isAnyNull=function(){for(var t=this,e=0;et._maxNodeDegree&&(t._maxNodeDegree=r),e=t.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2};Kr.prototype.addPoints=function(t,e,n){var r=this,i=t.getCoordinates();if(e){var o=1;n&&(o=0);for(var c=o;c=0;d--)r._pts.add(i[d])}};Kr.prototype.isHole=function(){return this._isHole};Kr.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)};Kr.prototype.containsPoint=function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t)||!Tt.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();){var i=r.next();if(i.containsPoint(t))return!1}return!0};Kr.prototype.addHole=function(t){this._holes.add(t)};Kr.prototype.isShell=function(){return this._shell===null};Kr.prototype.getLabel=function(){return this._label};Kr.prototype.getEdges=function(){return this._edges};Kr.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};Kr.prototype.getShell=function(){return this._shell};Kr.prototype.mergeLabel=function(){if(arguments.length===1){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=e.getLocation(n,ut.RIGHT);if(r===ze.NONE)return null;if(this._label.getLocation(n)===ze.NONE)return this._label.setLocation(n,r),null}};Kr.prototype.setShell=function(t){this._shell=t,t!==null&&t.addHole(this)};Kr.prototype.toPolygon=function(t){for(var e=this,n=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)};as.prototype.isInResult=function(){return this._isInResult};as.prototype.isVisited=function(){return this._isVisited};as.prototype.interfaces_=function(){return[]};as.prototype.getClass=function(){return as};var vy=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var n=arguments[0],r=arguments[1];this._coord=n,this._edges=r,this._label=new $n(0,ze.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();){var r=n.next();if(r.getEdge().isInResult())return!0}return!1},e.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(n){},e.prototype.computeMergedLocation=function(n,r){var i=ze.NONE;if(i=this._label.getLocation(r),!n.isNull(r)){var o=n.getLocation(r);i!==ze.BOUNDARY&&(i=o)}return i},e.prototype.setLabel=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1];this._label===null?this._label=new $n(n,r):this._label.setLocation(n,r)}else return t.prototype.setLabel.apply(this,arguments)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){var n=this;if(arguments[0]instanceof e){var r=arguments[0];this.mergeLabel(r._label)}else if(arguments[0]instanceof $n)for(var i=arguments[0],o=0;o<2;o++){var c=n.computeMergedLocation(i,o),l=n._label.getLocation(o);l===ze.NONE&&n._label.setLocation(o,c)}},e.prototype.add=function(n){this._edges.insert(n),n.setNode(this)},e.prototype.setLabelBoundary=function(n){if(this._label===null)return null;var r=ze.NONE;this._label!==null&&(r=this._label.getLocation(n));var i=null;switch(r){case ze.BOUNDARY:i=ze.INTERIOR;break;case ze.INTERIOR:i=ze.BOUNDARY;break;default:i=ze.BOUNDARY;break}this._label.setLocation(n,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(as),La=function(){this.nodeMap=new Xi,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};La.prototype.find=function(t){return this.nodeMap.get(t)};La.prototype.addNode=function(){if(arguments[0]instanceof Oe){var t=arguments[0],e=this.nodeMap.get(t);return e===null&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}else if(arguments[0]instanceof vy){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return r===null?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}};La.prototype.print=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};La.prototype.iterator=function(){return this.nodeMap.values().iterator()};La.prototype.values=function(){return this.nodeMap.values()};La.prototype.getBoundaryNodes=function(t){for(var e=new vt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===ze.BOUNDARY&&e.add(r)}return e};La.prototype.add=function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)};La.prototype.interfaces_=function(){return[]};La.prototype.getClass=function(){return La};var Jn=function(){},Pm={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Jn.prototype.interfaces_=function(){return[]};Jn.prototype.getClass=function(){return Jn};Jn.isNorthern=function(t){return t===Jn.NE||t===Jn.NW};Jn.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return n===2};Jn.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(n===2)return-1;var r=te?t:e;return r===0&&i===3?3:r};Jn.isInHalfPlane=function(t,e){return e===Jn.SE?t===Jn.SE||t===Jn.SW:t===e||t===e+1};Jn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];if(t===0&&e===0)throw new wr("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Jn.NE:Jn.SE:e>=0?Jn.NW:Jn.SW}else if(arguments[0]instanceof Oe&&arguments[1]instanceof Oe){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new wr("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Jn.NE:Jn.SE:r.y>=n.y?Jn.NW:Jn.SW}};Pm.NE.get=function(){return 0};Pm.NW.get=function(){return 1};Pm.SW.get=function(){return 2};Pm.SE.get=function(){return 3};Object.defineProperties(Jn,Pm);var Yi=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var t=arguments[0];this._edge=t}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],i=null;this._edge=e,this.init(n,r),this._label=i}else if(arguments.length===4){var o=arguments[0],c=arguments[1],l=arguments[2],d=arguments[3];this._edge=o,this.init(c,l),this._label=d}};Yi.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){c.linkDirectedEdgesForMinimalEdgeRings();var l=c.buildMinimalRings(),d=r.findShell(l);d!==null?(r.placePolygonHoles(d,l),e.add(d)):n.addAll(l)}else i.add(c)}return i};jo.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1};jo.prototype.buildMaximalEdgeRings=function(t){for(var e=this,n=new vt,r=t.iterator();r.hasNext();){var i=r.next();if(i.isInResult()&&i.getLabel().isArea()&&i.getEdgeRing()===null){var o=new e5(i,e._geometryFactory);n.add(o),o.setInResult()}}return n};jo.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}};jo.prototype.getPolygons=function(){var t=this.computePolygons(this._shellList);return t};jo.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,c=null,l=e.iterator();l.hasNext();){var d=l.next(),y=d.getLinearRing(),S=y.getEnvelopeInternal();o!==null&&(c=o.getLinearRing().getEnvelopeInternal());var E=!1;S.contains(r)&&Tt.isPointInRing(i,y.getCoordinates())&&(E=!0),E&&(o===null||c.contains(S))&&(o=d)}return o};jo.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return yn.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n};jo.prototype.add=function(){if(arguments.length===1){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(arguments.length===2){var e=arguments[0],n=arguments[1];Lr.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new vt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}};jo.prototype.interfaces_=function(){return[]};jo.prototype.getClass=function(){return jo};var Kf=function(){};Kf.prototype.getBounds=function(){};Kf.prototype.interfaces_=function(){return[]};Kf.prototype.getClass=function(){return Kf};var Ws=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Ws.prototype.getItem=function(){return this._item};Ws.prototype.getBounds=function(){return this._bounds};Ws.prototype.interfaces_=function(){return[Kf,Ts]};Ws.prototype.getClass=function(){return Ws};var Rl=function(){this._size=null,this._items=null,this._size=0,this._items=new vt,this._items.add(null)};Rl.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t};Rl.prototype.size=function(){return this._size};Rl.prototype.reorder=function(t){for(var e=this,n=null,r=this._items.get(t);t*2<=this._size&&(n=t*2,n!==e._size&&e._items.get(n+1).compareTo(e._items.get(n))<0&&n++,e._items.get(n).compareTo(r)<0);t=n)e._items.set(t,e._items.get(n));this._items.set(t,r)};Rl.prototype.clear=function(){this._size=0,this._items.clear()};Rl.prototype.isEmpty=function(){return this._size===0};Rl.prototype.add=function(t){var e=this;this._items.add(null),this._size+=1;var n=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(n/2)))<0;n/=2)e._items.set(n,e._items.get(Math.trunc(n/2)));this._items.set(n,t)};Rl.prototype.interfaces_=function(){return[]};Rl.prototype.getClass=function(){return Rl};var gu=function(){};gu.prototype.visitItem=function(t){};gu.prototype.interfaces_=function(){return[]};gu.prototype.getClass=function(){return gu};var eh=function(){};eh.prototype.insert=function(t,e){};eh.prototype.remove=function(t,e){};eh.prototype.query=function(){};eh.prototype.interfaces_=function(){return[]};eh.prototype.getClass=function(){return eh};var oi=function(){if(this._childBoundables=new vt,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var t=arguments[0];this._level=t}},ZC={serialVersionUID:{configurable:!0}};oi.prototype.getLevel=function(){return this._level};oi.prototype.size=function(){return this._childBoundables.size()};oi.prototype.getChildBoundables=function(){return this._childBoundables};oi.prototype.addChildBoundable=function(t){yn.isTrue(this._bounds===null),this._childBoundables.add(t)};oi.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};oi.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds};oi.prototype.interfaces_=function(){return[Kf,Ts]};oi.prototype.getClass=function(){return oi};ZC.serialVersionUID.get=function(){return 6493722185909574e3};Object.defineProperties(oi,ZC);var Hs=function(){};Hs.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}};Hs.min=function(t){return Hs.sort(t),t.get(0)};Hs.sort=function(t,e){var n=t.toArray();e?ec.sort(n,e):ec.sort(n);for(var r=t.iterator(),i=0,o=n.length;iYr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new wr("neither boundable is composite")};Yr.prototype.isLeaves=function(){return!(Yr.isComposite(this._boundable1)||Yr.isComposite(this._boundable2))};Yr.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0};Yr.prototype.expand=function(t,e,n,r){for(var i=this,o=t.getChildBoundables(),c=o.iterator();c.hasNext();){var l=c.next(),d=new Yr(l,e,i._itemDistance);d.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},by={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Li.prototype.getNodeCapacity=function(){return this._nodeCapacity};Li.prototype.lastNode=function(t){return t.get(t.size()-1)};Li.prototype.size=function(){var t=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var e=arguments[0],n=0,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof oi?n+=t.size(i):i instanceof Ws&&(n+=1)}return n}};Li.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Ws&&i.getItem()===e&&(n=i)}return n!==null?(t.getChildBoundables().remove(n),!0):!1};Li.prototype.itemsTree=function(){var t=this;if(arguments.length===0){this.build();var e=this.itemsTree(this._root);return e===null?new vt:e}else if(arguments.length===1){for(var n=arguments[0],r=new vt,i=n.getChildBoundables().iterator();i.hasNext();){var o=i.next();if(o instanceof oi){var c=t.itemsTree(o);c!==null&&r.add(c)}else o instanceof Ws?r.add(o.getItem()):yn.shouldNeverReachHere()}return r.size()<=0?null:r}};Li.prototype.insert=function(t,e){yn.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ws(t,e))};Li.prototype.boundablesAtLevel=function(){var t=this;if(arguments.length===1){var e=arguments[0],n=new vt;return this.boundablesAtLevel(e,this._root,n),n}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];if(yn.isTrue(r>-2),i.getLevel()===r)return o.add(i),null;for(var c=i.getChildBoundables().iterator();c.hasNext();){var l=c.next();l instanceof oi?t.boundablesAtLevel(r,l,o):(yn.isTrue(l instanceof Ws),r===-1&&o.add(l))}return null}};Li.prototype.query=function(){var t=this;if(arguments.length===1){var e=arguments[0];this.build();var n=new vt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,n),n}else if(arguments.length===2){var r=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,i)}else if(arguments.length===3){if(rn(arguments[2],gu)&&arguments[0]instanceof Object&&arguments[1]instanceof oi)for(var o=arguments[0],c=arguments[1],l=arguments[2],d=c.getChildBoundables(),y=0;yn&&(n=o)}}return n+1}};Li.prototype.createParentBoundables=function(t,e){var n=this;yn.isTrue(!t.isEmpty());var r=new vt;r.add(this.createNode(e));var i=new vt(t);Hs.sort(i,this.getComparator());for(var o=i.iterator();o.hasNext();){var c=o.next();n.lastNode(r).getChildBoundables().size()===n.getNodeCapacity()&&r.add(n.createNode(e)),n.lastNode(r).addChildBoundable(c)}return r};Li.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};Li.prototype.interfaces_=function(){return[Ts]};Li.prototype.getClass=function(){return Li};Li.compareDoubles=function(t,e){return t>e?1:t0);for(var c=new vt,l=0;l0;){var M=A.poll(),R=M.getDistance();if(R>=E)break;M.isLeaves()?(E=R,C=M):M.expandToQueue(A,E)}return[C.getBoundable(0).getItem(),C.getBoundable(1).getItem()]}}else if(arguments.length===3){var N=arguments[0],B=arguments[1],O=arguments[2],G=new Ws(N,B),U=new Yr(this.getRoot(),G,O);return this.nearestNeighbour(U)[0]}},e.prototype.interfaces_=function(){return[eh,Ts]},e.prototype.getClass=function(){return e},e.centreX=function(r){return e.avg(r.getMinX(),r.getMaxX())},e.avg=function(r,i){return(r+i)/2},e.centreY=function(r){return e.avg(r.getMinY(),r.getMaxY())},n.STRtreeNode.get=function(){return oS},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[jf]},compare:function(r,i){return t.compareDoubles(e.centreX(r.getBounds()),e.centreX(i.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[jf]},compare:function(r,i){return t.compareDoubles(e.centreY(r.getBounds()),e.centreY(i.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(r,i){return r.intersects(i)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(Li),oS=function(t){function e(){var n=arguments[0];t.call(this,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var n=null,r=this.getChildBoundables().iterator();r.hasNext();){var i=r.next();n===null?n=new Wt(i.getBounds()):n.expandToInclude(i.getBounds())}return n},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(oi),xo=function(){};xo.prototype.interfaces_=function(){return[]};xo.prototype.getClass=function(){return xo};xo.relativeSign=function(t,e){return te?1:0};xo.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=xo.relativeSign(e.x,n.x),i=xo.relativeSign(e.y,n.y);switch(t){case 0:return xo.compareValue(r,i);case 1:return xo.compareValue(i,r);case 2:return xo.compareValue(i,-r);case 3:return xo.compareValue(-r,i);case 4:return xo.compareValue(-r,-i);case 5:return xo.compareValue(-i,-r);case 6:return xo.compareValue(-i,r);case 7:return xo.compareValue(r,-i)}return yn.shouldNeverReachHere("invalid octant value"),0};xo.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var _u=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new Oe(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};_u.prototype.getCoordinate=function(){return this.coord};_u.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)};_u.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:xo.compare(this._segmentOctant,this.coord,e.coord)};_u.prototype.isEndPoint=function(t){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===t};_u.prototype.isInterior=function(){return this._isInterior};_u.prototype.interfaces_=function(){return[Cs]};_u.prototype.getClass=function(){return _u};var co=function(){this._nodeMap=new Xi,this._edge=null;var t=arguments[0];this._edge=t};co.prototype.getSplitCoordinates=function(){var t=this,e=new Tm;this.addEndpoints();for(var n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();t.addEdgeCoordinates(r,i,e),r=i}return e.toCoordinateArray()};co.prototype.addCollapsedNodes=function(){var t=this,e=new vt;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var n=e.iterator();n.hasNext();){var r=n.next().intValue();t.add(t._edge.getCoordinate(r),r)}};co.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}};co.prototype.findCollapsesFromExistingVertices=function(t){for(var e=this,n=0;n=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}else if(arguments[0]instanceof Oe&&arguments[1]instanceof Oe){var i=arguments[0],o=arguments[1],c=o.x-i.x,l=o.y-i.y;if(c===0&&l===0)throw new wr("Cannot compute the octant for two identical points "+i);return th.octant(c,l)}};var el=function(){};el.prototype.getCoordinates=function(){};el.prototype.size=function(){};el.prototype.getCoordinate=function(t){};el.prototype.isClosed=function(){};el.prototype.setData=function(t){};el.prototype.getData=function(){};el.prototype.interfaces_=function(){return[]};el.prototype.getClass=function(){return el};var fm=function(){};fm.prototype.addIntersection=function(t,e){};fm.prototype.interfaces_=function(){return[el]};fm.prototype.getClass=function(){return fm};var Wr=function(){this._nodeList=new co(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Wr.prototype.getCoordinates=function(){return this._pts};Wr.prototype.size=function(){return this._pts.length};Wr.prototype.getCoordinate=function(t){return this._pts[t]};Wr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};Wr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))};Wr.prototype.setData=function(t){this._data=t};Wr.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:th.octant(t,e)};Wr.prototype.getData=function(){return this._data};Wr.prototype.addIntersection=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(arguments.length===4){var n=arguments[0],r=arguments[1],i=arguments[3],o=new Oe(n.getIntersection(i));this.addIntersection(o,r)}};Wr.prototype.toString=function(){return Gs.toLineString(new Ur(this._pts))};Wr.prototype.getNodeList=function(){return this._nodeList};Wr.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}else if(arguments[0]instanceof Oe){var r=arguments[0];return Tt.orientationIndex(this.p0,this.p1,r)}};Zt.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])};Zt.prototype.isVertical=function(){return this.p0.x===this.p1.x};Zt.prototype.equals=function(t){if(!(t instanceof Zt))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)};Zt.prototype.intersection=function(t){var e=new gc;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null};Zt.prototype.project=function(){if(arguments[0]instanceof Oe){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Oe(t);var e=this.projectionFactor(t),n=new Oe;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}else if(arguments[0]instanceof Zt){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1||i<=0&&o<=0)return null;var c=this.project(r.p0);i<0&&(c=this.p0),i>1&&(c=this.p1);var l=this.project(r.p1);return o<0&&(l=this.p0),o>1&&(l=this.p1),new Zt(c,l)}};Zt.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};Zt.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};Zt.prototype.getCoordinate=function(t){return t===0?this.p0:this.p1};Zt.prototype.distancePerpendicular=function(t){return Tt.distancePointLinePerpendicular(t,this.p0,this.p1)};Zt.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};Zt.prototype.midPoint=function(){return Zt.midPoint(this.p0,this.p1)};Zt.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;if(r<=0)return cn.NaN;var i=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r;return i};Zt.prototype.closestPoints=function(t){var e=this.intersection(t);if(e!==null)return[e,e];var n=new Array(2).fill(null),r=cn.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var c=this.closestPoint(t.p1);i=c.distance(t.p1),i0&&e<1)return this.project(t);var n=this.p0.distance(t),r=this.p1.distance(t);return n1||cn.isNaN(e))&&(e=1),e};Zt.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};Zt.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};Zt.prototype.distance=function(){if(arguments[0]instanceof Zt){var t=arguments[0];return Tt.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}else if(arguments[0]instanceof Oe){var e=arguments[0];return Tt.distancePointLine(e,this.p0,this.p1)}};Zt.prototype.pointAlong=function(t){var e=new Oe;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e};Zt.prototype.hashCode=function(){var t=cn.doubleToLongBits(this.p0.x);t^=cn.doubleToLongBits(this.p0.y)*31;var e=Math.trunc(t)^Math.trunc(t>>32),n=cn.doubleToLongBits(this.p1.x);n^=cn.doubleToLongBits(this.p1.y)*31;var r=Math.trunc(n)^Math.trunc(n>>32);return e^r};Zt.prototype.interfaces_=function(){return[Cs,Ts]};Zt.prototype.getClass=function(){return Zt};Zt.midPoint=function(t,e){return new Oe((t.x+e.x)/2,(t.y+e.y)/2)};YC.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(Zt,YC);var pm=function(){this.tempEnv1=new Wt,this.tempEnv2=new Wt,this._overlapSeg1=new Zt,this._overlapSeg2=new Zt};pm.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}};pm.prototype.interfaces_=function(){return[]};pm.prototype.getClass=function(){return pm};var Go=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Go.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]};Go.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e===1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var c=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=Jn.quadrant(t[n],t[n+1]),i=e+1;ic.getId()&&(c.computeOverlaps(y,i),r._nOverlaps++),r._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return sS},Object.defineProperties(e,n),e}(dm),sS=function(t){function e(){t.call(this),this._si=null;var n=arguments[0];this._si=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(arguments.length===4){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3],c=n.getContext(),l=i.getContext();this._si.processIntersections(c,r,l,o)}else return t.prototype.overlap.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pm),qn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var e=arguments[0];this.setQuadrantSegments(e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(arguments.length===4){var i=arguments[0],o=arguments[1],c=arguments[2],l=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(c),this.setMitreLimit(l)}}},Ul={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};qn.prototype.getEndCapStyle=function(){return this._endCapStyle};qn.prototype.isSingleSided=function(){return this._isSingleSided};qn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,this._quadrantSegments===0&&(this._joinStyle=qn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=qn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==qn.JOIN_ROUND&&(this._quadrantSegments=qn.DEFAULT_QUADRANT_SEGMENTS)};qn.prototype.getJoinStyle=function(){return this._joinStyle};qn.prototype.setJoinStyle=function(t){this._joinStyle=t};qn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t};qn.prototype.getSimplifyFactor=function(){return this._simplifyFactor};qn.prototype.getQuadrantSegments=function(){return this._quadrantSegments};qn.prototype.setEndCapStyle=function(t){this._endCapStyle=t};qn.prototype.getMitreLimit=function(){return this._mitreLimit};qn.prototype.setMitreLimit=function(t){this._mitreLimit=t};qn.prototype.setSingleSided=function(t){this._isSingleSided=t};qn.prototype.interfaces_=function(){return[]};qn.prototype.getClass=function(){return qn};qn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)};Ul.CAP_ROUND.get=function(){return 1};Ul.CAP_FLAT.get=function(){return 2};Ul.CAP_SQUARE.get=function(){return 3};Ul.JOIN_ROUND.get=function(){return 1};Ul.JOIN_MITRE.get=function(){return 2};Ul.JOIN_BEVEL.get=function(){return 3};Ul.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};Ul.DEFAULT_MITRE_LIMIT.get=function(){return 5};Ul.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01};Object.defineProperties(qn,Ul);var Nr=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Tt.COUNTERCLOCKWISE,this._inputLine=t||null},Mm={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Nr.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],c=this._inputLine[n];return!this.isConcave(i,o,c)||!this.isShallow(i,o,c,r)?!1:this.isShallowSampled(i,o,t,n,r)};Nr.prototype.deleteShallowConcavities=function(){for(var t=this,e=1,n=this.findNextNonDeletedIndex(e),r=this.findNextNonDeletedIndex(n),i=!1;r=0;i--)n.addPt(t[i])};ls.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1),n=t.distance(e);return nMath.PI;)t-=Dn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Dn.PI_TIMES_2;return t};Dn.angle=function(){if(arguments.length===1){var t=arguments[0];return Math.atan2(t.y,t.x)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}};Dn.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=n.x-e.x,c=n.y-e.y,l=r*o+i*c;return l>0};Dn.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=n.x-e.x,c=n.y-e.y,l=r*o+i*c;return l<0};Dn.interiorAngle=function(t,e,n){var r=Dn.angle(e,t),i=Dn.angle(e,n);return Math.abs(i-r)};Dn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Dn.PI_TIMES_2;t>=Dn.PI_TIMES_2&&(t=0)}else{for(;t>=Dn.PI_TIMES_2;)t-=Dn.PI_TIMES_2;t<0&&(t=0)}return t};Dn.angleBetween=function(t,e,n){var r=Dn.angle(e,t),i=Dn.angle(e,n);return Dn.diff(r,i)};Dn.diff=function(t,e){var n=null;return tMath.PI&&(n=2*Math.PI-n),n};Dn.toRadians=function(t){return t*Math.PI/180};Dn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Dn.COUNTERCLOCKWISE:n<0?Dn.CLOCKWISE:Dn.NONE};Dn.angleBetweenOriented=function(t,e,n){var r=Dn.angle(e,t),i=Dn.angle(e,n),o=i-r;return o<=-Math.PI?o+Dn.PI_TIMES_2:o>Math.PI?o-Dn.PI_TIMES_2:o};yh.PI_TIMES_2.get=function(){return 2*Math.PI};yh.PI_OVER_2.get=function(){return Math.PI/2};yh.PI_OVER_4.get=function(){return Math.PI/4};yh.COUNTERCLOCKWISE.get=function(){return Tt.COUNTERCLOCKWISE};yh.CLOCKWISE.get=function(){return Tt.CLOCKWISE};yh.NONE.get=function(){return Tt.COLLINEAR};Object.defineProperties(Dn,yh);var _r=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Zt,this._seg1=new Zt,this._offset0=new Zt,this._offset1=new Zt,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new gc,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===qn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},km={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};_r.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=Tt.computeOrientation(this._s0,this._s1,this._s2),r=n===Tt.CLOCKWISE&&this._side===ut.LEFT||n===Tt.COUNTERCLOCKWISE&&this._side===ut.RIGHT;n===0?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)};_r.prototype.addLineEndCap=function(t,e){var n=new Zt(t,e),r=new Zt;this.computeOffsetSegment(n,ut.LEFT,this._distance,r);var i=new Zt;this.computeOffsetSegment(n,ut.RIGHT,this._distance,i);var o=e.x-t.x,c=e.y-t.y,l=Math.atan2(c,o);switch(this._bufParams.getEndCapStyle()){case qn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,l+Math.PI/2,l-Math.PI/2,Tt.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case qn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case qn.CAP_SQUARE:var d=new Oe;d.x=Math.abs(this._distance)*Math.cos(l),d.y=Math.abs(this._distance)*Math.sin(l);var y=new Oe(r.p1.x+d.x,r.p1.y+d.y),S=new Oe(i.p1.x+d.x,i.p1.y+d.y);this._segList.addPt(y),this._segList.addPt(S);break}};_r.prototype.getCoordinates=function(){var t=this._segList.getCoordinates();return t};_r.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Us.intersection(e.p0,e.p1,n.p0,n.p1);var c=r<=0?1:o.distance(t)/Math.abs(r);c>this._bufParams.getMitreLimit()&&(i=!1)}catch(l){if(l instanceof yp)o=new Oe(0,0),i=!1;else throw l}finally{}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())};_r.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,c=e.y-t.y,l=Math.atan2(c,o),d=n.x-t.x,y=n.y-t.y,S=Math.atan2(y,d);r===Tt.CLOCKWISE?l<=S&&(l+=2*Math.PI):l>=S&&(l-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,l,S,r,i),this._segList.addPt(n)};_r.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new Oe((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new Oe((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}};_r.prototype.createCircle=function(t){var e=new Oe(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()};_r.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)};_r.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new ls,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*_r.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};_r.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);var e=this._li.getIntersectionNum();e>=2&&(this._bufParams.getJoinStyle()===qn.JOIN_BEVEL||this._bufParams.getJoinStyle()===qn.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Tt.CLOCKWISE,this._distance))};_r.prototype.closeRing=function(){this._segList.closeRing()};_r.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};_r.prototype.interfaces_=function(){return[]};_r.prototype.getClass=function(){return _r};km.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001};km.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001};km.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};km.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(_r,km);var So=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};So.prototype.getOffsetCurve=function(t,e){if(this._distance=e,e===0)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&kn.reverse(o),o};So.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Nr.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],ut.LEFT),n.addFirstSegment();for(var c=o-2;c>=0;c--)n.addNextSegment(i[c],!0)}else{n.addSegments(t,!1);var l=Nr.simplify(t,r),d=l.length-1;n.initSideSegments(l[0],l[1],ut.LEFT),n.addFirstSegment();for(var y=2;y<=d;y++)n.addNextSegment(l[y],!0)}n.addLastSegment(),n.closeRing()};So.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===ut.RIGHT&&(r=-r);var i=Nr.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var c=1;c<=o;c++){var l=c!==1;n.addNextSegment(i[c],l)}n.closeRing()};So.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Nr.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],ut.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var c=Nr.simplify(t,-n),l=c.length-1;e.initSideSegments(c[l],c[l-1],ut.LEFT);for(var d=l-2;d>=0;d--)e.addNextSegment(c[d],!0);e.addLastSegment(),e.addLineEndCap(c[1],c[0]),e.closeRing()};So.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case qn.CAP_ROUND:e.createCircle(t);break;case qn.CAP_SQUARE:e.createSquare(t);break}};So.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided()||e===0)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);var o=r.getCoordinates();return o};So.prototype.getBufferParameters=function(){return this._bufParams};So.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()};So.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(n===0)return So.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()};So.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Nr.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],ut.LEFT),n.addFirstSegment();for(var c=o-2;c>=0;c--)n.addNextSegment(i[c],!0)}else{var l=Nr.simplify(t,r),d=l.length-1;n.initSideSegments(l[0],l[1],ut.LEFT),n.addFirstSegment();for(var y=2;y<=d;y++)n.addNextSegment(l[y],!0)}n.addLastSegment()};So.prototype.getSegGen=function(t){return new _r(this._precisionModel,this._bufParams,t)};So.prototype.interfaces_=function(){return[]};So.prototype.getClass=function(){return So};So.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;no.getMaxY()||t.findStabbedSegments(e,i.getDirectedEdges(),n)}return n}else if(arguments.length===3){if(rn(arguments[2],js)&&arguments[0]instanceof Oe&&arguments[1]instanceof Qv)for(var c=arguments[0],l=arguments[1],d=arguments[2],y=l.getEdge().getCoordinates(),S=0;St._seg.p1.y&&t._seg.reverse();var E=Math.max(t._seg.p0.x,t._seg.p1.x);if(!(Et._seg.p1.y)&&Tt.computeOrientation(t._seg.p0,t._seg.p1,c)!==Tt.RIGHT){var C=l.getDepth(ut.LEFT);t._seg.p0.equals(y[S])||(C=l.getDepth(ut.RIGHT));var A=new sc(t._seg,C);d.add(A)}}else if(rn(arguments[2],js)&&arguments[0]instanceof Oe&&rn(arguments[1],js))for(var M=arguments[0],R=arguments[1],N=arguments[2],B=R.iterator();B.hasNext();){var O=B.next();O.isForward()&&t.findStabbedSegments(M,O,N)}}};nh.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);if(e.size()===0)return 0;var n=Hs.min(e);return n._leftDepth};nh.prototype.interfaces_=function(){return[]};nh.prototype.getClass=function(){return nh};KC.DepthSegment.get=function(){return sc};Object.defineProperties(nh,KC);var sc=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Zt(t),this._leftDepth=e};sc.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return n!==0||(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg),n!==0)?n:this._upwardSeg.compareTo(e._upwardSeg)};sc.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return n!==0?n:t.p1.compareTo(e.p1)};sc.prototype.toString=function(){return this._upwardSeg.toString()};sc.prototype.interfaces_=function(){return[Cs]};sc.prototype.getClass=function(){return sc};var Hn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Hn.prototype.area=function(){return Hn.area(this.p0,this.p1,this.p2)};Hn.prototype.signedArea=function(){return Hn.signedArea(this.p0,this.p1,this.p2)};Hn.prototype.interpolateZ=function(t){if(t===null)throw new wr("Supplied point is null.");return Hn.interpolateZ(t,this.p0,this.p1,this.p2)};Hn.prototype.longestSideLength=function(){return Hn.longestSideLength(this.p0,this.p1,this.p2)};Hn.prototype.isAcute=function(){return Hn.isAcute(this.p0,this.p1,this.p2)};Hn.prototype.circumcentre=function(){return Hn.circumcentre(this.p0,this.p1,this.p2)};Hn.prototype.area3D=function(){return Hn.area3D(this.p0,this.p1,this.p2)};Hn.prototype.centroid=function(){return Hn.centroid(this.p0,this.p1,this.p2)};Hn.prototype.inCentre=function(){return Hn.inCentre(this.p0,this.p1,this.p2)};Hn.prototype.interfaces_=function(){return[]};Hn.prototype.getClass=function(){return Hn};Hn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)};Hn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2};Hn.det=function(t,e,n,r){return t*r-e*n};Hn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,c=n.x-i,l=r.x-i,d=n.y-o,y=r.y-o,S=c*y-l*d,E=t.x-i,C=t.y-o,A=(y*E-l*C)/S,M=(-d*E+c*C)/S,R=e.z+A*(n.z-e.z)+M*(r.z-e.z);return R};Hn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),c=r;return i>c&&(c=i),o>c&&(c=o),c};Hn.isAcute=function(t,e,n){return!(!Dn.isAcute(t,e,n)||!Dn.isAcute(e,n,t)||!Dn.isAcute(n,t,e))};Hn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,c=t.y-i,l=e.x-r,d=e.y-i,y=2*Hn.det(o,c,l,d),S=Hn.det(c,o*o+c*c,d,l*l+d*d),E=Hn.det(o,o*o+c*c,l,l*l+d*d),C=r-S/y,A=i+E/y;return new Oe(C,A)};Hn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Us(t.x+n/2,t.y+r/2,1),o=new Us(t.x-r+n/2,t.y+n+r/2,1);return new Us(i,o)};Hn.angleBisector=function(t,e,n){var r=e.distance(t),i=e.distance(n),o=r/(r+i),c=n.x-t.x,l=n.y-t.y,d=new Oe(t.x+o*c,t.y+o*l);return d};Hn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,c=n.x-t.x,l=n.y-t.y,d=n.z-t.z,y=i*d-o*l,S=o*c-r*d,E=r*l-i*c,C=y*y+S*S+E*E,A=Math.sqrt(C)/2;return A};Hn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new Oe(r,i)};Hn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),c=r+i+o,l=(r*t.x+i*e.x+o*n.x)/c,d=(r*t.y+i*e.y+o*n.y)/c;return new Oe(l,d)};var Is=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new vt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Is.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,ze.EXTERIOR,ze.INTERIOR)};Is.prototype.addPolygon=function(t){var e=this,n=this._distance,r=ut.LEFT;this._distance<0&&(n=-this._distance,r=ut.RIGHT);var i=t.getExteriorRing(),o=kn.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance)||this._distance<=0&&o.length<3)return null;this.addPolygonRing(o,n,r,ze.EXTERIOR,ze.INTERIOR);for(var c=0;c0&&e.isErodedCompletely(l,-e._distance)||e.addPolygonRing(d,n,ut.opposite(r),ze.INTERIOR,ze.EXTERIOR)}};Is.prototype.isTriangleErodedCompletely=function(t,e){var n=new Hn(t[0],t[1],t[2]),r=n.inCentre(),i=Tt.distancePointLine(r,n.p0,n.p1);return i=Ja.MINIMUM_VALID_SIZE&&Tt.isCCW(t)&&(o=i,c=r,n=ut.opposite(n));var l=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(l,o,c)};Is.prototype.add=function(t){if(t.isEmpty())return null;t instanceof ai?this.addPolygon(t):t instanceof Rr?this.addLineString(t):t instanceof Uo?this.addPoint(t):t instanceof Yf?this.addCollection(t):t instanceof ic?this.addCollection(t):t instanceof Ya?this.addCollection(t):t instanceof lo&&this.addCollection(t)};Is.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(n.length===4)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i};Is.prototype.addCollection=function(t){for(var e=this,n=0;n=this._max)throw new bp;var t=this._parent.getGeometryN(this._index++);return t instanceof lo?(this._subcollectionIterator=new $a(t),this._subcollectionIterator.next()):t};$a.prototype.remove=function(){throw new Error(this.getClass().getName())};$a.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)};$a.prototype.interfaces_=function(){return[vp]};$a.prototype.getClass=function(){return $a};$a.isAtomic=function(t){return!(t instanceof lo)};var is=function(){this._geom=null;var t=arguments[0];this._geom=t};is.prototype.locate=function(t){return is.locate(t,this._geom)};is.prototype.interfaces_=function(){return[Qf]};is.prototype.getClass=function(){return is};is.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?Tt.isPointInRing(t,e.getCoordinates()):!1};is.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!is.isPointInRing(t,n))return!1;for(var r=0;r=0;o--){var c=n._edgeList.get(o),l=c.getSym();i===null&&(i=l),r!==null&&l.setNext(r),r=c}i.setNext(r)},e.prototype.computeDepths=function(){var n=this;if(arguments.length===1){var r=arguments[0],i=this.findIndex(r),o=r.getDepth(ut.LEFT),c=r.getDepth(ut.RIGHT),l=this.computeDepths(i+1,this._edgeList.size(),o),d=this.computeDepths(0,i,l);if(d!==c)throw new Dl("depth mismatch at "+r.getCoordinate())}else if(arguments.length===3){for(var y=arguments[0],S=arguments[1],E=arguments[2],C=E,A=y;A=0;l--){var d=r._resultAreaEdgeList.get(l),y=d.getSym();switch(i===null&&d.getEdgeRing()===n&&(i=d),c){case r._SCANNING_FOR_INCOMING:if(y.getEdgeRing()!==n)continue;o=y,c=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(d.getEdgeRing()!==n)continue;o.setNextMin(d),c=r._SCANNING_FOR_INCOMING;break}}c===this._LINKING_TO_OUTGOING&&(yn.isTrue(i!==null,"found null for first outgoing dirEdge"),yn.isTrue(i.getEdgeRing()===n,"unable to link last incoming dirEdge"),o.setNextMin(i))},e.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var n=0,r=this.iterator();r.hasNext();){var i=r.next();i.isInResult()&&n++}return n}else if(arguments.length===1){for(var o=arguments[0],c=0,l=this.iterator();l.hasNext();){var d=l.next();d.getEdgeRing()===o&&c++}return c}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var n=ze.NONE,r=this.iterator();r.hasNext();){var i=r.next(),o=i.getSym();if(!i.isLineEdge()){if(i.isInResult()){n=ze.INTERIOR;break}if(o.isInResult()){n=ze.EXTERIOR;break}}}if(n===ze.NONE)return null;for(var c=n,l=this.iterator();l.hasNext();){var d=l.next(),y=d.getSym();d.isLineEdge()?d.getEdge().setCovered(c===ze.INTERIOR):(d.isInResult()&&(c=ze.EXTERIOR),y.isInResult()&&(c=ze.INTERIOR))}},e.prototype.computeLabelling=function(n){var r=this;t.prototype.computeLabelling.call(this,n),this._label=new $n(ze.NONE);for(var i=this.iterator();i.hasNext();)for(var o=i.next(),c=o.getEdge(),l=c.getLabel(),d=0;d<2;d++){var y=l.getLocation(d);(y===ze.INTERIOR||y===ze.BOUNDARY)&&r._label.setLocation(d,ze.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($i),JC=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(n){return new vy(n,new n5)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($f),yu=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};yu.prototype.compareTo=function(t){var e=t,n=yu.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return n};yu.prototype.interfaces_=function(){return[Cs]};yu.prototype.getClass=function(){return yu};yu.orientation=function(t){return kn.increasingDirection(t)===1};yu.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,c=e?t.length:-1,l=r?n.length:-1,d=e?0:t.length-1,y=r?0:n.length-1;;){var S=t[d].compareTo(n[y]);if(S!==0)return S;d+=i,y+=o;var E=d===c,C=y===l;if(E&&!C)return-1;if(!E&&C)return 1;if(E&&C)return 0}};var Zs=function(){this._edges=new vt,this._ocaMap=new Xi};Zs.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var n=0;n0&&t.print(","),t.print("(");for(var i=r.getCoordinates(),o=0;o0&&t.print(","),t.print(i[o].x+" "+i[o].y);t.println(")")}t.print(") ")};Zs.prototype.addAll=function(t){for(var e=this,n=t.iterator();n.hasNext();)e.add(n.next())};Zs.prototype.findEdgeIndex=function(t){for(var e=this,n=0;n0||!e.coord.equals2D(i);o||r--;var c=new Array(r).fill(null),l=0;c[l++]=new Oe(t.coord);for(var d=t.segmentIndex+1;d<=e.segmentIndex;d++)c[l++]=n.edge.pts[d];return o&&(c[l]=e.coord),new V_(c,new $n(this.edge._label))};tl.prototype.add=function(t,e,n){var r=new Pa(t,e,n),i=this._nodeMap.get(r);return i!==null?i:(this._nodeMap.put(r,r),r)};tl.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1};tl.prototype.interfaces_=function(){return[]};tl.prototype.getClass=function(){return tl};var lc=function(){};lc.prototype.getChainStartIndices=function(t){var e=this,n=0,r=new vt;r.add(new Sa(n));do{var i=e.findChainEnd(t,n);r.add(new Sa(i)),n=i}while(nn?e:n};Nl.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return en&&(i=1),t._depth[e][r]=i}}};zi.prototype.getDelta=function(t){return this._depth[t][ut.RIGHT]-this._depth[t][ut.LEFT]};zi.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?ze.EXTERIOR:ze.INTERIOR};zi.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};zi.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=e.getLocation(n,r);(i===ze.EXTERIOR||i===ze.INTERIOR)&&(t.isNull(n,r)?t._depth[n][r]=zi.depthAtLocation(i):t._depth[n][r]+=zi.depthAtLocation(i))}else if(arguments.length===3){var o=arguments[0],c=arguments[1],l=arguments[2];l===ze.INTERIOR&&this._depth[o][c]++}};zi.prototype.interfaces_=function(){return[]};zi.prototype.getClass=function(){return zi};zi.depthAtLocation=function(t){return t===ze.EXTERIOR?0:t===ze.INTERIOR?1:zi.NULL_VALUE};QC.NULL_VALUE.get=function(){return-1};Object.defineProperties(zi,QC);var V_=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new tl(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zi,this._depthDelta=0,arguments.length===1){var n=arguments[0];e.call(this,n,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);n[0]=this.pts[0],n[1]=this.pts[1];var r=new e(n,$n.toLineLabel(this._label));return r},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(n){this._isIsolated=n},e.prototype.setName=function(n){this._name=n},e.prototype.equals=function(n){var r=this;if(!(n instanceof e))return!1;var i=n;if(this.pts.length!==i.pts.length)return!1;for(var o=!0,c=!0,l=this.pts.length,d=0;d0?this.pts[0]:null;if(arguments.length===1){var n=arguments[0];return this.pts[n]}},e.prototype.print=function(n){var r=this;n.print("edge "+this._name+": "),n.print("LINESTRING (");for(var i=0;i0&&n.print(","),n.print(r.pts[i].x+" "+r.pts[i].y);n.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(n){e.updateIM(this._label,n)},e.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(n){var r=this;n.print("edge "+this._name+": ");for(var i=this.pts.length-1;i>=0;i--)n.print(r.pts[i]+" ");n.println("")},e.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Nl(this)),this._mce},e.prototype.getEnvelope=function(){var n=this;if(this._env===null){this._env=new Wt;for(var r=0;r0&&r.append(","),r.append(n.pts[i].x+" "+n.pts[i].y);return r.append(") "+this._label+" "+this._depthDelta),r.toString()},e.prototype.isPointwiseEqual=function(n){var r=this;if(this.pts.length!==n.pts.length)return!1;for(var i=0;ir||this._maxyo;if(c)return!1;var l=this.intersectsToleranceSquare(t,e);return yn.isTrue(!(c&&l),"Found bad envelope test"),l};Eo.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new Oe(this._maxx,this._maxy),this._corner[1]=new Oe(this._minx,this._maxy),this._corner[2]=new Oe(this._minx,this._miny),this._corner[3]=new Oe(this._maxx,this._miny)};Eo.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};Eo.prototype.scale=function(t){return Math.round(t*this._scaleFactor)};Eo.prototype.getCoordinate=function(){return this._originalPt};Eo.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)};Eo.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=Eo.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Wt(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv};Eo.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection())||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))};Eo.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper())||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper())||n&&r||t.equals(this._pt)||e.equals(this._pt))};Eo.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return this.intersects(n,r)?(t.addIntersection(this.getCoordinate(),e),!0):!1};Eo.prototype.interfaces_=function(){return[]};Eo.prototype.getClass=function(){return Eo};tT.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75};Object.defineProperties(Eo,tT);var mm=function(){this.tempEnv1=new Wt,this.selectedSegment=new Zt};mm.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}};mm.prototype.interfaces_=function(){return[]};mm.prototype.getClass=function(){return mm};var ep=function(){this._index=null;var t=arguments[0];this._index=t},nT={HotPixelSnapAction:{configurable:!0}};ep.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new rT(e,n,r);return this._index.query(i,{interfaces_:function(){return[gu]},visitItem:function(c){var l=c;l.select(i,o)}}),o.isNodeAdded()}};ep.prototype.interfaces_=function(){return[]};ep.prototype.getClass=function(){return ep};nT.HotPixelSnapAction.get=function(){return rT};Object.defineProperties(ep,nT);var rT=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var n=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=n,this._parentEdge=r,this._hotPixelVertexIndex=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(arguments.length===2){var n=arguments[0],r=arguments[1],i=n.getContext();if(this._parentEdge!==null&&i===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(i,r)}else return t.prototype.select.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(mm),rh=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new vt};rh.prototype.processIntersections=function(t,e,n,r){var i=this;if(t===n&&e===r)return null;var o=t.getCoordinates()[e],c=t.getCoordinates()[e+1],l=n.getCoordinates()[r],d=n.getCoordinates()[r+1];if(this._li.computeIntersection(o,c,l,d),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var y=0;y=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Dl)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var n=arguments[0],r=Ni.precisionScaleFactor(this._argGeom,this._distance,n),i=new Wn(r);this.bufferFixedPrecision(i)}};Ni.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Wn.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()};Ni.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)};Ni.prototype.bufferOriginalPrecision=function(){try{var t=new ao(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof kl)this._saveException=e;else throw e}finally{}};Ni.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry};Ni.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)};Ni.prototype.interfaces_=function(){return[]};Ni.prototype.getClass=function(){return Ni};Ni.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new Ni(t),r=n.getResultGeometry(e);return r}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof nn&&typeof arguments[1]=="number"){var i=arguments[0],o=arguments[1],c=arguments[2],l=new Ni(i);l.setQuadrantSegments(c);var d=l.getResultGeometry(o);return d}else if(arguments[2]instanceof qn&&arguments[0]instanceof nn&&typeof arguments[1]=="number"){var y=arguments[0],S=arguments[1],E=arguments[2],C=new Ni(y,E),A=C.getResultGeometry(S);return A}}else if(arguments.length===4){var M=arguments[0],R=arguments[1],N=arguments[2],B=arguments[3],O=new Ni(M);O.setQuadrantSegments(N),O.setEndCapStyle(B);var G=O.getResultGeometry(R);return G}};Ni.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=ss.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),o=e>0?e:0,c=i+2*o,l=Math.trunc(Math.log(c)/Math.log(10)+1),d=n-l,y=Math.pow(10,d);return y};xp.CAP_ROUND.get=function(){return qn.CAP_ROUND};xp.CAP_BUTT.get=function(){return qn.CAP_FLAT};xp.CAP_FLAT.get=function(){return qn.CAP_FLAT};xp.CAP_SQUARE.get=function(){return qn.CAP_SQUARE};xp.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(Ni,xp);var io=function(){this._pt=[new Oe,new Oe],this._distance=cn.NaN,this._isNull=!0};io.prototype.getCoordinates=function(){return this._pt};io.prototype.getCoordinate=function(t){return this._pt[t]};io.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);rthis._distance&&this.initialize(e,n,r)}};io.prototype.interfaces_=function(){return[]};io.prototype.getClass=function(){return io};var Ha=function(){};Ha.prototype.interfaces_=function(){return[]};Ha.prototype.getClass=function(){return Ha};Ha.computeDistance=function(){if(arguments[2]instanceof io&&arguments[0]instanceof Rr&&arguments[1]instanceof Oe)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new Zt,o=0;o0||this._isIn?ze.INTERIOR:ze.EXTERIOR)};Xs.prototype.interfaces_=function(){return[]};Xs.prototype.getClass=function(){return Xs};var oo=function t(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},iT={INSIDE_AREA:{configurable:!0}};oo.prototype.isInsideArea=function(){return this._segIndex===oo.INSIDE_AREA};oo.prototype.getCoordinate=function(){return this._pt};oo.prototype.getGeometryComponent=function(){return this._component};oo.prototype.getSegmentIndex=function(){return this._segIndex};oo.prototype.interfaces_=function(){return[]};oo.prototype.getClass=function(){return oo};iT.INSIDE_AREA.get=function(){return-1};Object.defineProperties(oo,iT);var fu=function(t){this._pts=t||null};fu.prototype.filter=function(t){t instanceof Uo&&this._pts.add(t)};fu.prototype.interfaces_=function(){return[Ia]};fu.prototype.getClass=function(){return fu};fu.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof Uo?Hs.singletonList(t):fu.getPoints(t,new vt)}else if(arguments.length===2){var e=arguments[0],n=arguments[1];return e instanceof Uo?n.add(e):e instanceof lo&&e.apply(new fu(n)),n}};var oh=function(){this._locations=null;var t=arguments[0];this._locations=t};oh.prototype.filter=function(t){(t instanceof Uo||t instanceof Rr||t instanceof ai)&&this._locations.add(new oo(t,0,t.getCoordinate()))};oh.prototype.interfaces_=function(){return[Ia]};oh.prototype.getClass=function(){return oh};oh.getLocations=function(t){var e=new vt;return t.apply(new oh(e)),e};var Bi=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Xs,this._minDistanceLocation=null,this._minDistance=cn.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Bi.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var n=arguments[0],r=arguments[1],i=1-n,o=Tl.getPolygons(this._geom[n]);if(o.size()>0){var c=oh.getLocations(this._geom[i]);if(this.computeContainmentDistance(c,o,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=r[0],this._minDistanceLocation[n]=r[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&rn(arguments[0],js)&&rn(arguments[1],js)){for(var l=arguments[0],d=arguments[1],y=arguments[2],S=0;Sthis._minDistance)return null;for(var i=e.getCoordinates(),o=n.getCoordinate(),c=0;cthis._minDistance)return null;for(var A=S.getCoordinates(),M=E.getCoordinates(),R=0;Rthis._distance&&this.initialize(e,n,r)}};Wi.prototype.interfaces_=function(){return[]};Wi.prototype.getClass=function(){return Wi};var da=function(){};da.prototype.interfaces_=function(){return[]};da.prototype.getClass=function(){return da};da.computeDistance=function(){if(arguments[2]instanceof Wi&&arguments[0]instanceof Rr&&arguments[1]instanceof Oe)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new Zt,i=t.getCoordinates(),o=0;o1||t<=0)throw new wr("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t};ws.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)};ws.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};ws.prototype.computeOrientedDistance=function(t,e,n){var r=new sh(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new xu(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}};ws.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};ws.prototype.interfaces_=function(){return[]};ws.prototype.getClass=function(){return ws};ws.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],n=new ws(t,e);return n.distance()}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2],c=new ws(r,i);return c.setDensifyFraction(o),c.distance()}};ib.MaxPointDistanceFilter.get=function(){return sh};ib.MaxDensifiedByFractionDistanceFilter.get=function(){return xu};Object.defineProperties(ws,ib);var sh=function(){this._maxPtDist=new Wi,this._minPtDist=new Wi,this._euclideanDist=new da,this._geom=null;var t=arguments[0];this._geom=t};sh.prototype.filter=function(t){this._minPtDist.initialize(),da.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)};sh.prototype.getMaxPointDistance=function(){return this._maxPtDist};sh.prototype.interfaces_=function(){return[Ka]};sh.prototype.getClass=function(){return sh};var xu=function(){this._maxPtDist=new Wi,this._minPtDist=new Wi,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};xu.prototype.filter=function(t,e){var n=this;if(e===0)return null;for(var r=t.getCoordinate(e-1),i=t.getCoordinate(e),o=(i.x-r.x)/this._numSubSegs,c=(i.y-r.y)/this._numSubSegs,l=0;ln){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Gs.toLineString(i[0],i[1])+")"}};Bo.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Bo.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Bo.VERBOSE&&Fi.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};Bo.prototype.checkNegativeValid=function(){if(!(this._input instanceof ai||this._input instanceof Ya||this._input instanceof lo))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)};Bo.prototype.getErrorIndicator=function(){return this._errorIndicator};Bo.prototype.checkMinimumDistance=function(t,e,n){var r=new Bi(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")};Vi.prototype.report=function(t){if(!Vi.VERBOSE)return null;Fi.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))};Vi.prototype.getErrorMessage=function(){return this._errorMsg};Vi.prototype.interfaces_=function(){return[]};Vi.prototype.getClass=function(){return Vi};Vi.isValidMsg=function(t,e,n){var r=new Vi(t,e,n);return r.isValid()?null:r.getErrorMessage()};Vi.isValid=function(t,e,n){var r=new Vi(t,e,n);return!!r.isValid()};sb.VERBOSE.get=function(){return!1};sb.MAX_ENV_DIFF_FRAC.get=function(){return .012};Object.defineProperties(Vi,sb);var ka=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};ka.prototype.getCoordinates=function(){return this._pts};ka.prototype.size=function(){return this._pts.length};ka.prototype.getCoordinate=function(t){return this._pts[t]};ka.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};ka.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:th.octant(this.getCoordinate(t),this.getCoordinate(t+1))};ka.prototype.setData=function(t){this._data=t};ka.prototype.getData=function(){return this._data};ka.prototype.toString=function(){return Gs.toLineString(new Ur(this._pts))};ka.prototype.interfaces_=function(){return[el]};ka.prototype.getClass=function(){return ka};var Pi=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new vt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Pi.prototype.getInteriorIntersection=function(){return this._interiorIntersection};Pi.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t};Pi.prototype.getIntersectionSegments=function(){return this._intSegments};Pi.prototype.count=function(){return this._intersectionCount};Pi.prototype.getIntersections=function(){return this._intersections};Pi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};Pi.prototype.setKeepIntersections=function(t){this._keepIntersections=t};Pi.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection()||t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly){var i=this.isEndSegment(t,e)||this.isEndSegment(n,r);if(!i)return null}var o=t.getCoordinates()[e],c=t.getCoordinates()[e+1],l=n.getCoordinates()[r],d=n.getCoordinates()[r+1];this._li.computeIntersection(o,c,l,d),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=c,this._intSegments[2]=l,this._intSegments[3]=d,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};Pi.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2};Pi.prototype.hasIntersection=function(){return this._interiorIntersection!==null};Pi.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null};Pi.prototype.interfaces_=function(){return[ac]};Pi.prototype.getClass=function(){return Pi};Pi.createAllIntersectionsFinder=function(t){var e=new Pi(t);return e.setFindAllIntersections(!0),e};Pi.createAnyIntersectionFinder=function(t){return new Pi(t)};Pi.createIntersectionCounter=function(t){var e=new Pi(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Ys=function(){this._li=new gc,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Ys.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()};Ys.prototype.getIntersections=function(){return this._segInt.getIntersections()};Ys.prototype.isValid=function(){return this.execute(),this._isValid};Ys.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t};Ys.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Pi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new nb;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};Ys.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Dl(this.getErrorMessage(),this._segInt.getInteriorIntersection())};Ys.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Gs.toLineString(t[0],t[1])+" and "+Gs.toLineString(t[2],t[3])};Ys.prototype.interfaces_=function(){return[]};Ys.prototype.getClass=function(){return Ys};Ys.computeIntersections=function(t){var e=new Ys(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var cc=function t(){this._nv=null;var e=arguments[0];this._nv=new Ys(t.toSegmentStrings(e))};cc.prototype.checkValid=function(){this._nv.checkValid()};cc.prototype.interfaces_=function(){return[]};cc.prototype.getClass=function(){return cc};cc.toSegmentStrings=function(t){for(var e=new vt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new ka(r.getCoordinates(),r))}return e};cc.checkValid=function(t){var e=new cc(t);e.checkValid()};var ah=function(t){this._mapOp=t};ah.prototype.map=function(t){for(var e=this,n=new vt,r=0;r0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)};Io.prototype.interfaces_=function(){return[]};Io.prototype.getClass=function(){return Io};var rl=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Zt,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Rr&&typeof arguments[1]=="number"){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};rl.prototype.snapVertices=function(t,e){for(var n=this,r=this._isClosed?t.size()-1:t.size(),i=0;i=0&&t.add(c+1,new Oe(o),!1)}};rl.prototype.findSegmentIndexToSnap=function(t,e){for(var n=this,r=cn.MAX_VALUE,i=-1,o=0;oe&&(e=r)}return e}else if(arguments.length===2){var i=arguments[0],o=arguments[1];return Math.min(jr.computeOverlaySnapTolerance(i),jr.computeOverlaySnapTolerance(o))}};jr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),r=n*jr.SNAP_PRECISION_FACTOR;return r};jr.snapToSelf=function(t,e,n){var r=new jr(t);return r.snapToSelf(e,n)};oT.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(jr,oT);var sT=function(t){function e(n,r,i){t.call(this),this._snapTolerance=n||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(n,r){var i=new rl(n,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(r)},e.prototype.transformCoordinates=function(n,r){var i=n.toCoordinateArray(),o=this.snapLine(i,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Io),ro=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};ro.prototype.getCommon=function(){return cn.longBitsToDouble(this._commonBits)};ro.prototype.add=function(t){var e=cn.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=ro.signExpBits(this._commonBits),this._isFirst=!1,null;var n=ro.signExpBits(e);if(n!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=ro.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=ro.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};ro.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=cn.longBitsToDouble(t),n=cn.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,i=r.substring(r.length-64),o=i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]";return o}};ro.prototype.interfaces_=function(){return[]};ro.prototype.getClass=function(){return ro};ro.getBit=function(t,e){var n=1<>52};ro.zeroLowerBits=function(t,e){var n=(1<=0;r--){if(ro.getBit(t,r)!==ro.getBit(e,r))return n;n++}return 52};var wu=function(){this._commonCoord=null,this._ccFilter=new uh},ab={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};wu.prototype.addCommonBits=function(t){var e=new Su(this._commonCoord);t.apply(e),t.geometryChanged()};wu.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new Oe(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Su(e);return t.apply(n),t.geometryChanged(),t};wu.prototype.getCommonCoordinate=function(){return this._commonCoord};wu.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()};wu.prototype.interfaces_=function(){return[]};wu.prototype.getClass=function(){return wu};ab.CommonCoordinateFilter.get=function(){return uh};ab.Translater.get=function(){return Su};Object.defineProperties(wu,ab);var uh=function(){this._commonBitsX=new ro,this._commonBitsY=new ro};uh.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)};uh.prototype.getCommonCoordinate=function(){return new Oe(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};uh.prototype.interfaces_=function(){return[Ka]};uh.prototype.getClass=function(){return uh};var Su=function(){this.trans=null;var t=arguments[0];this.trans=t};Su.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)};Su.prototype.isDone=function(){return!1};Su.prototype.isGeometryChanged=function(){return!0};Su.prototype.interfaces_=function(){return[qs]};Su.prototype.getClass=function(){return Su};var Mi=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Mi.prototype.selfSnap=function(t){var e=new jr(t),n=e.snapTo(t,this._snapTolerance);return n};Mi.prototype.removeCommonBits=function(t){this._cbr=new wu,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e};Mi.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t};Mi.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=dn.overlayOp(e[0],e[1],t);return this.prepareResult(n)};Mi.prototype.checkValid=function(t){t.isValid()||Fi.out.println("Snapped geometry is invalid")};Mi.prototype.computeSnapTolerance=function(){this._snapTolerance=jr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};Mi.prototype.snap=function(t){var e=this.removeCommonBits(t),n=jr.snap(e[0],e[1],this._snapTolerance);return n};Mi.prototype.interfaces_=function(){return[]};Mi.prototype.getClass=function(){return Mi};Mi.overlayOp=function(t,e,n){var r=new Mi(t,e);return r.getResultGeometry(n)};Mi.union=function(t,e){return Mi.overlayOp(t,e,dn.UNION)};Mi.intersection=function(t,e){return Mi.overlayOp(t,e,dn.INTERSECTION)};Mi.symDifference=function(t,e){return Mi.overlayOp(t,e,dn.SYMDIFFERENCE)};Mi.difference=function(t,e){return Mi.overlayOp(t,e,dn.DIFFERENCE)};var ho=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ho.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=dn.overlayOp(this._geom[0],this._geom[1],t);var i=!0;i&&(n=!0)}catch(o){if(o instanceof kl)r=o;else throw o}finally{}if(!n)try{e=Mi.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof kl?r:o}finally{}return e};ho.prototype.interfaces_=function(){return[]};ho.prototype.getClass=function(){return ho};ho.overlayOp=function(t,e,n){var r=new ho(t,e);return r.getResultGeometry(n)};ho.union=function(t,e){return ho.overlayOp(t,e,dn.UNION)};ho.intersection=function(t,e){return ho.overlayOp(t,e,dn.INTERSECTION)};ho.symDifference=function(t,e){return ho.overlayOp(t,e,dn.SYMDIFFERENCE)};ho.difference=function(t,e){return ho.overlayOp(t,e,dn.DIFFERENCE)};var gm=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};gm.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)};gm.prototype.interfaces_=function(){return[]};gm.prototype.getClass=function(){return gm};var qo=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(arguments.length===3){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},lb={INSERT:{configurable:!0},DELETE:{configurable:!0}};qo.prototype.isDelete=function(){return this._eventType===qo.DELETE};qo.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t};qo.prototype.getObject=function(){return this._obj};qo.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0};qo.prototype.getInsertEvent=function(){return this._insertEvent};qo.prototype.isInsert=function(){return this._eventType===qo.INSERT};qo.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label};qo.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};qo.prototype.interfaces_=function(){return[Cs]};qo.prototype.getClass=function(){return qo};lb.INSERT.get=function(){return 1};lb.DELETE.get=function(){return 2};Object.defineProperties(qo,lb);var U_=function(){};U_.prototype.interfaces_=function(){return[]};U_.prototype.getClass=function(){return U_};var Ui=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Ui.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&this._li.getIntersectionNum()===1){if(Ui.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(e===0&&r===i||r===0&&e===i)return!0}}return!1};Ui.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};Ui.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t};Ui.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};Ui.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next(),i=r.getCoordinate();if(t.isIntersection(i))return!0}return!1};Ui.prototype.hasProperIntersection=function(){return this._hasProper};Ui.prototype.hasIntersection=function(){return this._hasIntersection};Ui.prototype.isDone=function(){return this._isDone};Ui.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))};Ui.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e};Ui.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],c=n.getCoordinates()[r],l=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,c,l),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};Ui.prototype.interfaces_=function(){return[]};Ui.prototype.getClass=function(){return Ui};Ui.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var r5=function(t){function e(){t.call(this),this.events=new vt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){var n=this;Hs.sort(this.events);for(var r=0;re||this._maxo?1:0};_m.prototype.interfaces_=function(){return[jf]};_m.prototype.getClass=function(){return _m};var i5=function(t){function e(){t.call(this),this._item=null;var n=arguments[0],r=arguments[1],i=arguments[2];this._min=n,this._max=r,this._item=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(n,r,i){if(!this.intersects(n,r))return null;i.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(il),o5=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var n=arguments[0],r=arguments[1];this._node1=n,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(n,r){this._min=Math.min(n._min,r._min),this._max=Math.max(n._max,r._max)},e.prototype.query=function(n,r,i){if(!this.intersects(n,r))return null;this._node1!==null&&this._node1.query(n,r,i),this._node2!==null&&this._node2.query(n,r,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(il),ol=function(){this._leaves=new vt,this._root=null,this._level=0};ol.prototype.buildTree=function(){var t=this;Hs.sort(this._leaves,new il.NodeComparator);for(var e=this._leaves,n=null,r=new vt;;){if(t.buildLevel(e,r),r.size()===1)return r.get(0);n=e,e=r,r=n}};ol.prototype.insert=function(t,e,n){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new i5(t,e,n))};ol.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)};ol.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()};ol.prototype.printNode=function(t){Fi.out.println(Gs.toLineString(new Oe(t._min,this._level),new Oe(t._max,this._level)))};ol.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()};ol.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,r[0]),this.insertBoundaryPoint(this._argIndex,r[r.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var n=this.getBoundaryNodes(),r=new Array(n.size()).fill(null),i=0,o=n.iterator();o.hasNext();){var c=o.next();r[i++]=c.getCoordinate().copy()}return r},e.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(n,r,i){if(this.isBoundaryNode(n,r))return null;i===ze.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,r):this.insertPoint(n,r,i)},e.prototype.addPolygonRing=function(n,r,i){if(n.isEmpty())return null;var o=kn.removeRepeatedPoints(n.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var c=r,l=i;Tt.isCCW(o)&&(c=i,l=r);var d=new V_(o,new $n(this._argIndex,ze.BOUNDARY,c,l));this._lineEdgeMap.put(n,d),this.insertEdge(d),this.insertPoint(this._argIndex,o[0],ze.BOUNDARY)},e.prototype.insertPoint=function(n,r,i){var o=this._nodes.addNode(r),c=o.getLabel();c===null?o._label=new $n(n,i):c.setLocation(n,i)},e.prototype.createEdgeSetIntersector=function(){return new r5},e.prototype.addSelfIntersectionNodes=function(n){for(var r=this,i=this._edges.iterator();i.hasNext();)for(var o=i.next(),c=o.getLabel().getLocation(n),l=o.eiList.iterator();l.hasNext();){var d=l.next();r.addSelfIntersectionNode(n,d.coord,c)}},e.prototype.add=function(){if(arguments.length===1){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Ya&&(this._useBoundaryDeterminationRule=!1),n instanceof ai)this.addPolygon(n);else if(n instanceof Rr)this.addLineString(n);else if(n instanceof Uo)this.addPoint(n);else if(n instanceof Yf)this.addCollection(n);else if(n instanceof ic)this.addCollection(n);else if(n instanceof Ya)this.addCollection(n);else if(n instanceof lo)this.addCollection(n);else throw new Error(n.getClass().getName())}else return t.prototype.add.apply(this,arguments)},e.prototype.addCollection=function(n){for(var r=this,i=0;i50?(this._areaPtLocator===null&&(this._areaPtLocator=new np(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},e.prototype.findEdge=function(){if(arguments.length===1){var n=arguments[0];return this._lineEdgeMap.get(n)}else return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(n,r){return n.isInBoundary(r)?ze.BOUNDARY:ze.INTERIOR},e}(Lr),ip=function(){if(this._li=new gc,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ld(0,t)}else if(arguments.length===2){var e=arguments[0],n=arguments[1],r=Ss.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ld(0,e,r),this._arg[1]=new Ld(1,n,r)}else if(arguments.length===3){var i=arguments[0],o=arguments[1],c=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ld(0,i,c),this._arg[1]=new Ld(1,o,c)}};ip.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()};ip.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)};ip.prototype.interfaces_=function(){return[]};ip.prototype.getClass=function(){return ip};var tc=function(){};tc.prototype.interfaces_=function(){return[]};tc.prototype.getClass=function(){return tc};tc.map=function(){if(arguments[0]instanceof nn&&rn(arguments[1],tc.MapOp)){for(var t=arguments[0],e=arguments[1],n=new vt,r=0;r=t.size()?null:t.get(e)};$r.union=function(t){var e=new $r(t);return e.union()};uT.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties($r,uT);var j_=function(){};j_.prototype.interfaces_=function(){return[]};j_.prototype.getClass=function(){return j_};j_.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return dn.createEmptyResult(dn.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ho.overlayOp(t,e,dn.UNION)};function _c(){return new G_}function G_(){this.reset()}G_.prototype={constructor:G_,reset:function(){this.s=this.t=0},add:function(t){aS(qg,t,this.t),aS(this,qg.s,this.s),this.s?this.t+=qg.t:this.s=qg.t},valueOf:function(){return this.s}};var qg=new G_;function aS(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}var Dr=1e-6,nr=Math.PI,Cl=nr/2,lS=nr/4,Ol=nr*2,Zu=180/nr,ca=nr/180,so=Math.abs,s5=Math.atan,sp=Math.atan2,ri=Math.cos,ii=Math.sin,wp=Math.sqrt;function cT(t){return t>1?0:t<-1?nr:Math.acos(t)}function ch(t){return t>1?Cl:t<-1?-Cl:Math.asin(t)}function Bd(){}function q_(t,e){t&&cS.hasOwnProperty(t.type)&&cS[t.type](t,e)}var uS={Feature:function(t,e){q_(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rnr?t-Ol:t<-nr?t+Ol:t,e]}r1.invert=r1;function l5(t,e,n){return(t%=Ol)?e||n?hT(pS(t),dS(e,n)):pS(t):e||n?dS(e,n):r1}function fS(t){return function(e,n){return e+=t,[e>nr?e-Ol:e<-nr?e+Ol:e,n]}}function pS(t){var e=fS(t);return e.invert=fS(-t),e}function dS(t,e){var n=ri(t),r=ii(t),i=ri(e),o=ii(e);function c(l,d){var y=ri(d),S=ri(l)*y,E=ii(l)*y,C=ii(d),A=C*n+S*r;return[sp(E*i-A*o,S*n-C*r),ch(A*i+E*o)]}return c.invert=function(l,d){var y=ri(d),S=ri(l)*y,E=ii(l)*y,C=ii(d),A=C*i-E*o;return[sp(E*i+C*o,S*n+A*r),ch(A*n-S*r)]},c}function u5(t,e,n,r,i,o){if(n){var c=ri(e),l=ii(e),d=r*n;i==null?(i=e+r*Ol,o=e-d/2):(i=mS(c,i),o=mS(c,o),(r>0?io)&&(i+=r*Ol));for(var y,S=i;r>0?S>o:S1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function c5(t,e,n,r,i,o){var c=t[0],l=t[1],d=e[0],y=e[1],S=0,E=1,C=d-c,A=y-l,M;if(M=n-c,!(!C&&M>0)){if(M/=C,C<0){if(M0){if(M>E)return;M>S&&(S=M)}if(M=i-c,!(!C&&M<0)){if(M/=C,C<0){if(M>E)return;M>S&&(S=M)}else if(C>0){if(M0)){if(M/=A,A<0){if(M0){if(M>E)return;M>S&&(S=M)}if(M=o-l,!(!A&&M<0)){if(M/=A,A<0){if(M>E)return;M>S&&(S=M)}else if(A>0){if(M0&&(t[0]=c+S*C,t[1]=l+S*A),E<1&&(e[0]=c+E*C,e[1]=l+E*A),!0}}}}}function l_(t,e){return so(t[0]-e[0])=0;--l)i.point((E=S[l])[0],E[1]);else r(C.x,C.p.x,-1,i);C=C.p}C=C.o,S=C.z,A=!A}while(!C.v);i.lineEnd()}}}function gS(t){if(e=t.length){for(var e,n=0,r=t[0],i;++ne?1:t>=e?0:NaN}function h5(t){return t.length===1&&(t=f5(t)),{left:function(e,n,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(r==null&&(r=0),i==null&&(i=e.length);r>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function f5(t){return function(e,n){return dT(t(e),n)}}h5(dT);function mT(t){for(var e=t.length,n,r=-1,i=0,o,c;++r=0;)for(c=t[e],n=c.length;--n>=0;)o[--i]=c[n];return o}var Vd=1e9,Xg=-Vd;function p5(t,e,n,r){function i(y,S){return t<=y&&y<=n&&e<=S&&S<=r}function o(y,S,E,C){var A=0,M=0;if(y==null||(A=c(y,E))!==(M=c(S,E))||d(y,S)<0^E>0)do C.point(A===0||A===3?t:n,A>1?r:e);while((A=(A+E+4)%4)!==M);else C.point(S[0],S[1])}function c(y,S){return so(y[0]-t)0?0:3:so(y[0]-n)0?2:1:so(y[1]-e)0?1:0:S>0?3:2}function l(y,S){return d(y.x,S.x)}function d(y,S){var E=c(y,1),C=c(S,1);return E!==C?E-C:E===0?S[1]-y[1]:E===1?y[0]-S[0]:E===2?y[1]-S[1]:S[0]-y[0]}return function(y){var S=y,E=fT(),C,A,M,R,N,B,O,G,U,Z,ue,ae={point:se,lineStart:oe,lineEnd:Ge,polygonStart:ke,polygonEnd:K};function se(ot,ft){i(ot,ft)&&S.point(ot,ft)}function fe(){for(var ot=0,ft=0,At=A.length;ftr&&(Ln-Ot)*(r-ln)>(an-ln)*(t-Ot)&&++ot:an<=r&&(Ln-Ot)*(r-ln)<(an-ln)*(t-Ot)&&--ot;return ot}function ke(){S=E,C=[],A=[],ue=!0}function K(){var ot=fe(),ft=ue&&ot,At=(C=mT(C)).length;(ft||At)&&(y.polygonStart(),ft&&(y.lineStart(),o(null,null,1,y),y.lineEnd()),At&&pT(C,l,ot,o,y),y.polygonEnd()),S=y,C=A=M=null}function oe(){ae.point=Te,A&&A.push(M=[]),Z=!0,U=!1,O=G=NaN}function Ge(){C&&(Te(R,N),B&&U&&E.rejoin(),C.push(E.result())),ae.point=se,U&&S.lineEnd()}function Te(ot,ft){var At=i(ot,ft);if(A&&M.push([ot,ft]),Z)R=ot,N=ft,B=At,Z=!1,At&&(S.lineStart(),S.point(ot,ft));else if(At&&U)S.point(ot,ft);else{var Ke=[O=Math.max(Xg,Math.min(Vd,O)),G=Math.max(Xg,Math.min(Vd,G))],Ft=[ot=Math.max(Xg,Math.min(Vd,ot)),ft=Math.max(Xg,Math.min(Vd,ft))];c5(Ke,Ft,t,e,n,r)?(U||(S.lineStart(),S.point(Ke[0],Ke[1])),S.point(Ft[0],Ft[1]),At||S.lineEnd(),ue=!1):At&&(S.lineStart(),S.point(ot,ft),ue=!1)}O=ot,G=ft,U=At}return ae}}var sv=_c();function d5(t,e){var n=e[0],r=e[1],i=[ii(n),-ri(n),0],o=0,c=0;sv.reset();for(var l=0,d=t.length;l=0?1:-1,se=ae*ue,fe=se>nr,ke=M*U;if(sv.add(sp(ke*ae*ii(se),R*Z+ke*ri(se))),o+=fe?ue+ae*Ol:ue,fe^C>=n^O>=n){var K=W_(ap(E),ap(B));n1(K);var oe=W_(i,K);n1(oe);var Ge=(fe^ue>=0?-1:1)*ch(oe[2]);(r>Ge||r===Ge&&(K[0]||K[1]))&&(c+=fe^ue>=0?1:-1)}}return(o<-Dr||oym&&(ym=t),eZ_&&(Z_=e)}_c();function gT(t,e,n,r){return function(i,o){var c=e(o),l=i.invert(r[0],r[1]),d=fT(),y=e(d),S=!1,E,C,A,M={point:R,lineStart:B,lineEnd:O,polygonStart:function(){M.point=G,M.lineStart=U,M.lineEnd=Z,C=[],E=[]},polygonEnd:function(){M.point=R,M.lineStart=B,M.lineEnd=O,C=mT(C);var ue=d5(E,l);C.length?(S||(o.polygonStart(),S=!0),pT(C,_5,ue,n,o)):ue&&(S||(o.polygonStart(),S=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),S&&(o.polygonEnd(),S=!1),C=E=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function R(ue,ae){var se=i(ue,ae);t(ue=se[0],ae=se[1])&&o.point(ue,ae)}function N(ue,ae){var se=i(ue,ae);c.point(se[0],se[1])}function B(){M.point=N,c.lineStart()}function O(){M.point=R,c.lineEnd()}function G(ue,ae){A.push([ue,ae]);var se=i(ue,ae);y.point(se[0],se[1])}function U(){y.lineStart(),A=[]}function Z(){G(A[0][0],A[0][1]),y.lineEnd();var ue=y.clean(),ae=d.result(),se,fe=ae.length,ke,K,oe;if(A.pop(),E.push(A),A=null,!!fe){if(ue&1){if(K=ae[0],(ke=K.length-1)>0){for(S||(o.polygonStart(),S=!0),o.lineStart(),se=0;se1&&ue&2&&ae.push(ae.pop().concat(ae.shift())),C.push(ae.filter(g5))}}return M}}function g5(t){return t.length>1}function _5(t,e){return((t=t.x)[0]<0?t[1]-Cl-Dr:Cl-t[1])-((e=e.x)[0]<0?e[1]-Cl-Dr:Cl-e[1])}const vS=gT(function(){return!0},y5,b5,[-nr,-Cl]);function y5(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,c){var l=o>0?nr:-nr,d=so(o-e);so(d-nr)0?Cl:-Cl),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(l,n),t.point(o,n),i=0):r!==l&&d>=nr&&(so(e-r)Dr?s5((ii(e)*(o=ri(r))*ii(n)-ii(r)*(i=ri(e))*ii(t))/(i*o*c)):(e+r)/2}function b5(t,e,n,r){var i;if(t==null)i=n*Cl,r.point(-nr,i),r.point(0,i),r.point(nr,i),r.point(nr,0),r.point(nr,-i),r.point(0,-i),r.point(-nr,-i),r.point(-nr,0),r.point(-nr,i);else if(so(t[0]-e[0])>Dr){var o=t[0]0,i=so(n)>Dr;function o(S,E,C,A){u5(A,t,e,C,S,E)}function c(S,E){return ri(S)*ri(E)>n}function l(S){var E,C,A,M,R;return{lineStart:function(){M=A=!1,R=1},point:function(N,B){var O=[N,B],G,U=c(N,B),Z=r?U?0:y(N,B):U?y(N+(N<0?nr:-nr),B):0;if(!E&&(M=A=U)&&S.lineStart(),U!==A&&(G=d(E,O),(!G||l_(E,G)||l_(O,G))&&(O[0]+=Dr,O[1]+=Dr,U=c(O[0],O[1]))),U!==A)R=0,U?(S.lineStart(),G=d(O,E),S.point(G[0],G[1])):(G=d(E,O),S.point(G[0],G[1]),S.lineEnd()),E=G;else if(i&&E&&r^U){var ue;!(Z&C)&&(ue=d(O,E,!0))&&(R=0,r?(S.lineStart(),S.point(ue[0][0],ue[0][1]),S.point(ue[1][0],ue[1][1]),S.lineEnd()):(S.point(ue[1][0],ue[1][1]),S.lineEnd(),S.lineStart(),S.point(ue[0][0],ue[0][1])))}U&&(!E||!l_(E,O))&&S.point(O[0],O[1]),E=O,A=U,C=Z},lineEnd:function(){A&&S.lineEnd(),E=null},clean:function(){return R|(M&&A)<<1}}}function d(S,E,C){var A=ap(S),M=ap(E),R=[1,0,0],N=W_(A,M),B=Wg(N,N),O=N[0],G=B-O*O;if(!G)return!C&&S;var U=n*B/G,Z=-n*O/G,ue=W_(R,N),ae=Hg(R,U),se=Hg(N,Z);ov(ae,se);var fe=ue,ke=Wg(ae,fe),K=Wg(fe,fe),oe=ke*ke-K*(Wg(ae,ae)-1);if(!(oe<0)){var Ge=wp(oe),Te=Hg(fe,(-ke-Ge)/K);if(ov(Te,ae),Te=t1(Te),!C)return Te;var ot=S[0],ft=E[0],At=S[1],Ke=E[1],Ft;ft0^Te[1]<(so(Te[0]-ot)nr^(ot<=Te[0]&&Te[0]<=ft)){var ln=Hg(fe,(-ke+Ge)/K);return ov(ln,ae),[Te,t1(ln)]}}}function y(S,E){var C=r?t:nr-t,A=0;return S<-C?A|=1:S>C&&(A|=2),E<-C?A|=4:E>C&&(A|=8),A}return gT(c,l,o,r?[0,-t]:[-nr,t-nr])}function _T(t){return function(e){var n=new i1;for(var r in t)n[r]=t[r];return n.stream=e,n}}function i1(){}i1.prototype={constructor:i1,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function yT(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),o!=null&&t.clipExtent(null),a5(n,t.stream(yS));var c=yS.result(),l=Math.min(r/(c[1][0]-c[0][0]),i/(c[1][1]-c[0][1])),d=+e[0][0]+(r-l*(c[1][0]+c[0][0]))/2,y=+e[0][1]+(i-l*(c[1][1]+c[0][1]))/2;return o!=null&&t.clipExtent(o),t.scale(l*150).translate([d,y])}function w5(t,e,n){return yT(t,[[0,0],e],n)}var bS=16,S5=ri(30*ca);function xS(t,e){return+e?I5(t,e):E5(t)}function E5(t){return _T({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function I5(t,e){function n(r,i,o,c,l,d,y,S,E,C,A,M,R,N){var B=y-r,O=S-i,G=B*B+O*O;if(G>4*e&&R--){var U=c+C,Z=l+A,ue=d+M,ae=wp(U*U+Z*Z+ue*ue),se=ch(ue/=ae),fe=so(so(ue)-1)e||so((B*Ge+O*Te)/G-.5)>.3||c*C+l*A+d*M2?Te[2]%360*ca:0,oe()):[y*Zu,S*Zu,E*Zu]},fe.precision=function(Te){return arguments.length?(ue=xS(K,Z=Te*Te),Ge()):wp(Z)},fe.fitExtent=function(Te,ot){return yT(fe,Te,ot)},fe.fitSize=function(Te,ot){return w5(fe,Te,ot)};function oe(){A=hT(C=l5(y,S,E),e);var Te=e(l,d);return o=r-Te[0]*n,c=i+Te[1]*n,Ge()}function Ge(){return ae=se=null,fe}return function(){return e=t.apply(this,arguments),fe.invert=e.invert&&ke,oe()}}function vT(t){return function(e,n){var r=ri(e),i=ri(n),o=t(r*i);return[o*i*ii(e),o*ii(n)]}}function bT(t){return function(e,n){var r=wp(e*e+n*n),i=t(r),o=ii(i),c=ri(i);return[sp(e*o,r*c),ch(r&&n*o/r)]}}var P5=vT(function(t){return wp(2/(1+t))});P5.invert=bT(function(t){return 2*ch(t/2)});var xT=vT(function(t){return(t=cT(t))&&t/ii(t)});xT.invert=bT(function(t){return t});function M5(){return T5(xT).scale(79.4188).clipAngle(180-.001)}function wS(t,e){return[t,e]}wS.invert=wS;function k5(t,e,n){n=n||{};var r=n.units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if(typeof n!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(e===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return OC(t,function(c){var l=u_(c,e,r,i);l&&o.push(l)}),Kv(o);case"FeatureCollection":return nS(t,function(c){var l=u_(c,e,r,i);l&&nS(l,function(d){d&&o.push(d)})}),Kv(o)}return u_(t,e,r,i)}function u_(t,e,n,r){var i=t.properties||{},o=t.type==="Feature"?t.geometry:t;if(o.type==="GeometryCollection"){var c=[];return OC(t,function(R){var N=u_(R,e,n,r);N&&c.push(N)}),Kv(c)}var l=A5(o),d={type:o.type,coordinates:ST(o.coordinates,l)},y=new tb,S=y.read(d),E=BO(VO(e,n),"meters"),C=Ni.bufferOp(S,E,r),A=new HC;if(C=A.write(C),!wT(C.coordinates)){var M={type:C.type,coordinates:ET(C.coordinates,l)};return ly(M,i)}}function wT(t){return Array.isArray(t[0])?wT(t[0]):isNaN(t[0])}function ST(t,e){return typeof t[0]!="object"?e(t):t.map(function(n){return ST(n,e)})}function ET(t,e){return typeof t[0]!="object"?e.invert(t):t.map(function(n){return ET(n,e)})}function A5(t){var e=jO(t).geometry.coordinates,n=[-e[0],-e[1]];return M5().rotate(n).scale(es)}function D5(t,e){var n=z_(t),r=z_(e),i=t.properties||{},o=kC.difference(n.coordinates,r.coordinates);return o.length===0?null:o.length===1?DC(o[0],i):RC(o,i)}function SS(t){let e;for(const n of t)e&&n[0]-e[0]>=180?n[0]-=360:e&&n[0]-e[0]<-180&&(n[0]+=360),e=n}function ES(t,e){const n=D5({type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]},t);if(!n)return;n.properties={isMask:"y"};const r=k5(t,0);if(r.geometry.type==="Polygon")for(const i of r.geometry.coordinates)SS(i);else for(const i of r.geometry.coordinates)for(const o of i)SS(o);e({type:"FeatureCollection",features:[r,n]})}let IS={type:"FeatureCollection",features:[]};function R5(t,e,n=!0,r=!0,i={},o={},c={fill:{paint:{"fill-color":"#000","fill-opacity":.1},filter:["all",["==",["geometry-type"],"Polygon"],["has","isMask"]]},line:{layout:{"line-cap":"square"},paint:{"line-width":["case",["==",["geometry-type"],"Polygon"],2,3],"line-dasharray":[1,1],"line-color":"#3170fe"},filter:["!",["has","isMask"]]}}){let l,d=[],y,S;function E(){(c!=null&&c.fill||c!=null&&c.line)&&t.addSource("full-geom",{type:"geojson",data:IS}),c!=null&&c.fill&&t.addLayer({...c==null?void 0:c.fill,id:"full-geom-fill",type:"fill",source:"full-geom"}),c!=null&&c.line&&t.addLayer({...c==null?void 0:c.line,id:"full-geom-line",type:"line",source:"full-geom"})}t.loaded()?E():t.once("load",()=>{E()});const C=M=>{l==null||l({type:"mapClick",coordinates:[M.lngLat.lng,M.lngLat.lat]})};function A(M=!1){if(!e)throw new Error;const R=document.createElement("div");return M&&R.classList.add("marker-interactive"),new uO({props:{displayIn:"maplibre"},target:R}),new e.Marker({element:R,offset:[1,-13]})}return{setEventHandler(M){M?(l=M,t.on("click",C)):(l=void 0,t.off("click",C))},flyTo(M,R){t.flyTo({center:M,zoom:R,...i})},fitBounds(M,R,N){t.fitBounds([[M[0],M[1]],[M[2],M[3]]],{padding:R,maxZoom:N,...o})},indicateReverse(M){t.getCanvasContainer().style.cursor=M?"crosshair":""},setReverseMarker(M){!e||!n||(S?M?S.setLngLat(M):(S.remove(),S=void 0):M&&(S=(typeof n=="object"?new e.Marker(n):A()).setLngLat(M).addTo(t),S.getElement().classList.add("marker-reverse")))},setMarkers(M,R){if(!n)return;function N(B){var O;(O=t.getSource("full-geom"))==null||O.setData(B)}for(const B of d)B.remove();if(d.length=0,N(IS),!!e){if(R){let B=!1;if(R.geometry.type==="GeometryCollection"){const O=R.geometry.geometries.filter(G=>G.type==="Polygon"||G.type==="MultiPolygon");if(O.length>0){let G=O.pop();for(const U of O)G=UO(G,U);ES({...R,geometry:G},N),B=!0}else{const G=R.geometry.geometries.filter(U=>U.type==="LineString"||U.type==="MultiLineString");G.length>0&&(N({...R,geometry:{type:"GeometryCollection",geometries:G}}),B=!0)}}if(!B){if(R.geometry.type==="Polygon"||R.geometry.type==="MultiPolygon")ES(R,N);else if(R.geometry.type==="LineString"||R.geometry.type==="MultiLineString"){N(R);return}}n&&d.push((typeof n=="object"?new e.Marker(n):A()).setLngLat(R.center).addTo(t))}if(r)for(const B of M??[]){if(B===R)continue;const O=(typeof r=="object"?new e.Marker(r):A(!0)).setLngLat(B.center).setPopup(new e.Popup({offset:[1,-27],closeButton:!1,closeOnMove:!0,className:"maptiler-gc-popup"}).setText(B.place_type[0]==="reverse"?B.place_name:B.place_name.replace(/,.*/,""))).addTo(t),G=O.getElement();G.addEventListener("click",U=>{U.stopPropagation(),l==null||l({type:"markerClick",id:B.id})}),G.addEventListener("mouseenter",()=>{l==null||l({type:"markerMouseEnter",id:B.id}),O.togglePopup()}),G.addEventListener("mouseleave",()=>{l==null||l({type:"markerMouseLeave",id:B.id}),O.togglePopup()}),d.push(O)}}},setSelectedMarker(M){y&&y.getElement().classList.toggle("marker-selected",!1),y=M>-1?d[M]:void 0,y==null||y.getElement().classList.toggle("marker-selected",!0)},getCenterAndZoom(){const M=t.getCenter();return[t.getZoom(),M.lng,M.lat]}}}function N5(t){let e,n;return{c(){e=hu("svg"),n=hu("path"),Ce(n,"d","M13.12.706a.982.982 0 0 0-1.391 0L6.907 5.517 2.087.696a.982.982 0 1 0-1.391 1.39l4.821 4.821L.696 11.73a.982.982 0 1 0 1.39 1.39l4.821-4.821 4.822 4.821a.982.982 0 1 0 1.39-1.39L8.298 6.908l4.821-4.822a.988.988 0 0 0 0-1.38Z"),Ce(e,"viewBox","0 0 14 14"),Ce(e,"width","13"),Ce(e,"height","13"),Ce(e,"class","svelte-en2qvf")},m(r,i){be(r,e,i),te(e,n)},p:Mt,i:Mt,o:Mt,d(r){r&&ve(e)}}}class IT extends Qt{constructor(e){super(),Jt(this,e,null,N5,Ht,{})}}function O5(t){let e,n;return{c(){e=hu("svg"),n=hu("path"),Ce(n,"d","M15 0C6.705 0 0 6.705 0 15C0 23.295 6.705 30 15 30C23.295 30 30 23.295 30 15C30 6.705 23.295 0 15 0ZM22.5 20.385L20.385 22.5L15 17.115L9.615 22.5L7.5 20.385L12.885 15L7.5 9.615L9.615 7.5L15 12.885L20.385 7.5L22.5 9.615L17.115 15L22.5 20.385Z"),Ce(e,"viewBox","0 0 30 30"),Ce(e,"fill","none"),Ce(e,"xmlns","http://www.w3.org/2000/svg"),Ce(e,"class","svelte-d2loi5")},m(r,i){be(r,e,i),te(e,n)},p:Mt,i:Mt,o:Mt,d(r){r&&ve(e)}}}class CT extends Qt{constructor(e){super(),Jt(this,e,null,O5,Ht,{})}}function z5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"area.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"area.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function F5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"reverse.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"reverse.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function B5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"poi.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"poi.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function V5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"postal_code.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"postal_code.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function U5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"street.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"street.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function j5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"road.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"road.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function G5(t){let e,n;return{c(){e=pe("img"),si(e.src,n=t[3]+"housenumber.svg")||Ce(e,"src",n),Ce(e,"alt",t[6]),Ce(e,"class","svelte-ltkwvy")},m(r,i){be(r,e,i)},p(r,i){i&8&&!si(e.src,n=r[3]+"housenumber.svg")&&Ce(e,"src",n),i&64&&Ce(e,"alt",r[6])},d(r){r&&ve(e)}}}function q5(t){let e,n,r,i;return{c(){e=pe("img"),si(e.src,n=t[5])||Ce(e,"src",n),Ce(e,"alt",t[4]),Ce(e,"class","svelte-ltkwvy")},m(o,c){be(o,e,c),r||(i=Lt(e,"error",t[14]),r=!0)},p(o,c){c&32&&!si(e.src,n=o[5])&&Ce(e,"src",n),c&16&&Ce(e,"alt",o[4])},d(o){o&&ve(e),r=!1,i()}}}function CS(t){let e,n;return{c(){e=pe("span"),n=nt(t[6]),Ce(e,"class","secondary svelte-ltkwvy")},m(r,i){be(r,e,i),te(e,n)},p(r,i){i&64&&Kn(n,r[6])},d(r){r&&ve(e)}}}function W5(t){var ae,se;let e,n,r,i,o,c,l,d,y=(t[7]?t[0].place_name:t[0].place_name.replace(/,.*/,""))+"",S,E,C=t[2]==="always"||t[2]&&!t[0].address&&((ae=t[0].properties)==null?void 0:ae.kind)!=="road"&&((se=t[0].properties)==null?void 0:se.kind)!=="road_relation"&&!t[0].id.startsWith("address.")&&!t[0].id.startsWith("postal_code.")&&(!t[0].id.startsWith("poi.")||!t[5])&&!t[7],A,M,R=(t[7]?"":t[0].place_name.replace(/[^,]*,?\s*/,""))+"",N,B,O;function G(fe,ke){var K,oe;return ke&1&&(n=null),ke&1&&(r=null),ke&1&&(i=null),fe[5]?q5:fe[0].address?G5:((K=fe[0].properties)==null?void 0:K.kind)==="road"||((oe=fe[0].properties)==null?void 0:oe.kind)==="road_relation"?j5:(n==null&&(n=!!fe[0].id.startsWith("address.")),n?U5:(r==null&&(r=!!fe[0].id.startsWith("postal_code.")),r?V5:(i==null&&(i=!!fe[0].id.startsWith("poi.")),i?B5:fe[7]?F5:z5)))}let U=G(t,-1),Z=U(t),ue=C&&CS(t);return{c(){e=pe("li"),Z.c(),o=je(),c=pe("span"),l=pe("span"),d=pe("span"),S=nt(y),E=je(),ue&&ue.c(),A=je(),M=pe("span"),N=nt(R),Ce(d,"class","primary svelte-ltkwvy"),Ce(l,"class","svelte-ltkwvy"),Ce(M,"class","line2 svelte-ltkwvy"),Ce(c,"class","texts svelte-ltkwvy"),Ce(e,"tabindex","0"),Ce(e,"data-selected",t[1]),Ce(e,"class","svelte-ltkwvy"),no(e,"selected",t[1])},m(fe,ke){be(fe,e,ke),Z.m(e,null),te(e,o),te(e,c),te(c,l),te(l,d),te(d,S),te(l,E),ue&&ue.m(l,null),te(c,A),te(c,M),te(M,N),B||(O=[Lt(e,"mouseenter",t[12]),Lt(e,"focus",t[13])],B=!0)},p(fe,[ke]){var K,oe;U===(U=G(fe,ke))&&Z?Z.p(fe,ke):(Z.d(1),Z=U(fe),Z&&(Z.c(),Z.m(e,o))),ke&1&&y!==(y=(fe[7]?fe[0].place_name:fe[0].place_name.replace(/,.*/,""))+"")&&Kn(S,y),ke&37&&(C=fe[2]==="always"||fe[2]&&!fe[0].address&&((K=fe[0].properties)==null?void 0:K.kind)!=="road"&&((oe=fe[0].properties)==null?void 0:oe.kind)!=="road_relation"&&!fe[0].id.startsWith("address.")&&!fe[0].id.startsWith("postal_code.")&&(!fe[0].id.startsWith("poi.")||!fe[5])&&!fe[7]),C?ue?ue.p(fe,ke):(ue=CS(fe),ue.c(),ue.m(l,null)):ue&&(ue.d(1),ue=null),ke&1&&R!==(R=(fe[7]?"":fe[0].place_name.replace(/[^,]*,?\s*/,""))+"")&&Kn(N,R),ke&2&&Ce(e,"data-selected",fe[1]),ke&2&&no(e,"selected",fe[1])},i:Mt,o:Mt,d(fe){fe&&ve(e),Z.d(),ue&&ue.d(),B=!1,Hr(O)}}}function H5(t,e,n){var G;let r,i,{feature:o}=e,{selected:c=!1}=e,{showPlaceType:l}=e,{missingIconsCache:d}=e,{iconsBaseUrl:y}=e;const S=(G=o.properties)==null?void 0:G.categories;let E,C,A=0,M=o.place_type[0]==="reverse";function R(U){C&&d.add(C),n(10,A++,A)}function N(U){xn.call(this,t,U)}function B(U){xn.call(this,t,U)}const O=U=>R(U.currentTarget);return t.$$set=U=>{"feature"in U&&n(0,o=U.feature),"selected"in U&&n(1,c=U.selected),"showPlaceType"in U&&n(2,l=U.showPlaceType),"missingIconsCache"in U&&n(9,d=U.missingIconsCache),"iconsBaseUrl"in U&&n(3,y=U.iconsBaseUrl)},t.$$.update=()=>{var U,Z,ue,ae;if(t.$$.dirty&3640)do n(11,r--,r),n(4,E=S==null?void 0:S[r]),n(5,C=E?y+E.replace(/ /g,"_")+".svg":void 0);while(r>-1&&(!C||d.has(C)));t.$$.dirty&1&&n(6,i=o.id.startsWith("poi.")?(Z=(U=o.properties)==null?void 0:U.categories)==null?void 0:Z.join(", "):((ae=(ue=o.properties)==null?void 0:ue.place_type_name)==null?void 0:ae[0])??o.place_type[0])},n(11,r=(S==null?void 0:S.length)??0),[o,c,l,y,E,C,i,M,R,d,A,r,N,B,O]}class Z5 extends Qt{constructor(e){super(),Jt(this,e,H5,W5,Ht,{feature:0,selected:1,showPlaceType:2,missingIconsCache:9,iconsBaseUrl:3})}}function X5(t){let e;return{c(){e=pe("div"),e.innerHTML='',Ce(e,"class","svelte-7cmwmc")},m(n,r){be(n,e,r)},p:Mt,i:Mt,o:Mt,d(n){n&&ve(e)}}}class Y5 extends Qt{constructor(e){super(),Jt(this,e,null,X5,Ht,{})}}function $5(t){let e,n;return{c(){e=hu("svg"),n=hu("path"),Ce(n,"d","M30.003-26.765C13.46-26.765 0-14.158 0 1.337c0 23.286 24.535 42.952 28.39 46.04.24.192.402.316.471.376.323.282.732.424 1.142.424.41 0 .82-.142 1.142-.424.068-.06.231-.183.471-.376 3.856-3.09 28.39-22.754 28.39-46.04 0-15.495-13.46-28.102-30.003-28.102Zm1.757 12.469c4.38 0 7.858 1.052 10.431 3.158 2.595 2.105 3.89 4.913 3.89 8.422 0 2.34-.53 4.362-1.593 6.063-1.063 1.702-3.086 3.616-6.063 5.742-2.042 1.51-3.337 2.659-3.89 3.446-.532.787-.8 1.82-.8 3.096v1.914h-8.449V15.18c0-2.041.434-3.815 1.306-5.325.872-1.51 2.467-3.118 4.785-4.82 2.233-1.594 3.7-2.89 4.402-3.889a5.582 5.582 0 0 0 1.087-3.35c0-1.382-.51-2.435-1.531-3.158-1.02-.723-2.45-1.087-4.28-1.087-3.19 0-6.826 1.047-10.91 3.131l-3.472-6.986c4.742-2.659 9.77-3.992 15.087-3.992Zm-1.88 37.324c1.765 0 3.124.472 4.08 1.408.98.936 1.47 2.276 1.47 4.02 0 1.68-.49 3.007-1.47 3.985-.977.957-2.336 1.435-4.08 1.435-1.787 0-3.171-.465-4.15-1.4-.978-.958-1.47-2.298-1.47-4.02 0-1.787.48-3.14 1.436-4.054.957-.915 2.355-1.374 4.184-1.374Z"),Ce(e,"viewBox","0 0 60.006 21.412"),Ce(e,"width","14"),Ce(e,"height","20"),Ce(e,"class","svelte-en2qvf")},m(r,i){be(r,e,i),te(e,n)},p:Mt,i:Mt,o:Mt,d(r){r&&ve(e)}}}class K5 extends Qt{constructor(e){super(),Jt(this,e,null,$5,Ht,{})}}function J5(t){let e,n,r;return{c(){e=hu("svg"),n=hu("circle"),r=hu("path"),Ce(n,"cx","4.789"),Ce(n,"cy","4.787"),Ce(n,"r","3.85"),gr(n,"stroke-width","1.875"),gr(n,"fill","none"),Ce(r,"d","M12.063 12.063 7.635 7.635"),gr(r,"stroke-width","1.875"),gr(r,"stroke-linecap","round"),Ce(e,"xmlns","http://www.w3.org/2000/svg"),Ce(e,"width","13"),Ce(e,"height","13"),Ce(e,"viewBox","0 0 13 13"),Ce(e,"class","svelte-1bpbt60")},m(i,o){be(i,e,o),te(e,n),te(e,r)},p:Mt,i:Mt,o:Mt,d(i){i&&ve(e)}}}class Q5 extends Qt{constructor(e){super(),Jt(this,e,null,J5,Ht,{})}}function ez(t,e,n){const r=e[1],i=e[0],o=r-i;return t===r&&n?t:((t-i)%o+o)%o+i}function TS(t){const e=[...t];return e[2]r[0]||i.maxZoom!=null&&i.maxZoomDate.now()){if(!Pd.coords)break e;return Pd.coords}let o;try{return o=await new Promise((c,l)=>{n.signal.addEventListener("abort",()=>{l(Error("aborted"))}),navigator.geolocation.getCurrentPosition(d=>{c([d.coords.longitude,d.coords.latitude].map(y=>y.toFixed(6)).join(","))},d=>{l(d)},i)}),o}catch{}finally{i.cachedLocationExpiry&&(Pd={time:Date.now(),coords:o})}if(n.signal.aborted)return}if(i.type==="server-geolocation")return"ip";if(r&&i.type==="map-center")return r[1].toFixed(6)+","+r[2].toFixed(6)}}const LS=/(NORTH|SOUTH|[NS])?[\s]*([+-]?[0-8]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(NORTH|SOUTH|[NS])?[\s]*[,/;]?[\s]*(EAST|WEST|[EW])?[\s]*([+-]?[0-1]?[0-9]?[0-9](?:[\.,]\d{3,}))[\s]*([•º°]?)[\s]*(EAST|WEST|[EW])?/i,PS=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(\.)\s*([0-5]?[0-9])\s*(\.)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(EAST|WEST|[EW])?/i,MS=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*(D(?:EG)?(?:REES)?)\s*([0-5]?[0-9])\s*(M(?:IN)?(?:UTES)?)\s*((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(S(?:EC)?(?:ONDS)?)\s*(EAST|WEST|[EW])?/i,kS=/(NORTH|SOUTH|[NS])?\s*([+-]?[0-8]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|’’|´´|["″”\.])?\s*(NORTH|SOUTH|[NS])?(?:\s*[,/;]\s*|\s*)(EAST|WEST|[EW])?\s*([+-]?[0-1]?[0-9]?[0-9])\s*([•º°\.:]|D(?:EG)?(?:REES)?)?\s*,?([0-5]?[0-9](?:[\.,]\d{1,})?)?\s*(['′´’\.:]|M(?:IN)?(?:UTES)?)?\s*,?((?:[0-5]?[0-9])(?:[\.,]\d{1,3})?)?\s*(''|′′|´´|’’|["″”\.])?\s*(EAST|WEST|[EW])?/i;function nz(t){if(!["DMS","DM","DD"].includes(t))throw new Error("invalid format specified");if(this.decimalCoordinates&&this.decimalCoordinates.trim()){if(t=="DD")return this.decimalCoordinates;const e=this.decimalCoordinates.split(",").map(c=>Number(c.trim()));let n=AS(e[0],t),r=AS(e[1],t);n.endsWith('.0"')&&r.endsWith('.0"')&&(n=n.replace(/\.0"$/,'"'),r=r.replace(/\.0"$/,'"'));const i=e[0]>=0?" N":" S",o=e[1]>=0?" E":" W";return`${n+i}, ${r+o}`}else throw new Error("no decimal coordinates to convert")}function AS(t,e){const n=Math.abs(t),r=Math.floor(n),i=(n-r)*60;if(e=="DM"){let l=rz(i,3).toFixed(3).padStart(6,"0");return`${r}° ${l}'`}let o=Math.floor(i),c=((i-o)*60).toFixed(1).padStart(4,"0");return o=o.toString().padStart(2,"0"),`${r}° ${o}' ${c}"`}function rz(t,e){const n=Math.pow(10,e);return Math.round((t+Number.EPSILON)*n)/n}function cb(t,e){e||(e=5),t=t.replace(/\s+/g," ").trim();let n=null,r=null,i="",o="",c=[],l=!1;if(LS.test(t))if(c=LS.exec(t),l=Yg(c),l){if(n=c[2],r=c[6],n.includes(",")&&(n=n.replace(",",".")),r.includes(",")&&(r=r.replace(",",".")),Number(Math.round(n))==Number(n))throw new Error("integer only coordinate provided");if(Number(Math.round(r))==Number(r))throw new Error("integer only coordinate provided");c[1]?(i=c[1],o=c[5]):c[4]&&(i=c[4],o=c[8])}else throw new Error("invalid decimal coordinate format");else if(PS.test(t))if(c=PS.exec(t),l=Yg(c),l)n=Math.abs(parseInt(c[2])),c[4]&&(n+=c[4]/60),c[6]&&(n+=c[6].replace(",",".")/3600),parseInt(c[2])<0&&(n=-1*n),r=Math.abs(parseInt(c[9])),c[11]&&(r+=c[11]/60),c[13]&&(r+=c[13].replace(",",".")/3600),parseInt(c[9])<0&&(r=-1*r),c[1]?(i=c[1],o=c[8]):c[7]&&(i=c[7],o=c[14]);else throw new Error("invalid DMS coordinates format");else if(MS.test(t))if(c=MS.exec(t),l=Yg(c),l)n=Math.abs(parseInt(c[2])),c[4]&&(n+=c[4]/60),c[6]&&(n+=c[6]/3600),parseInt(c[2])<0&&(n=-1*n),r=Math.abs(parseInt(c[10])),c[12]&&(r+=c[12]/60),c[14]&&(r+=c[14]/3600),parseInt(c[10])<0&&(r=-1*r),c[1]?(i=c[1],o=c[9]):c[8]&&(i=c[8],o=c[16]);else throw new Error("invalid DMS coordinates format");else if(kS.test(t))if(c=kS.exec(t),l=Yg(c),l)n=Math.abs(parseInt(c[2])),c[4]&&(n+=c[4]/60),c[6]&&(n+=c[6]/3600),parseInt(c[2])<0&&(n=-1*n),r=Math.abs(parseInt(c[10])),c[12]&&(r+=c[12]/60),c[14]&&(r+=c[14]/3600),parseInt(c[10])<0&&(r=-1*r),c[1]?(i=c[1],o=c[9]):c[8]&&(i=c[8],o=c[16]);else throw new Error("invalid coordinates format");if(l){if(Math.abs(r)>=180)throw new Error("invalid longitude value");if(Math.abs(n)>=90)throw new Error("invalid latitude value");if((i||o)&&(!i||!o))throw new Error("invalid coordinates format");if(i&&i==o)throw new Error("invalid coordinates format");let d=/S|SOUTH/i;d.test(i)&&n>0&&(n=-1*n),d=/W|WEST/i,d.test(o)&&r>0&&(r=-1*r);const y=c[0].trim();let S,E;const C=/[,/;\u0020]/g,A=y.match(C);if(A==null){const N=Math.floor(t.length/2);S=y.substring(0,N).trim(),E=y.substring(N).trim()}else{let N;A.length%2==1?N=Math.floor(A.length/2):N=A.length/2-1;let B=0;if(N==0)B=y.indexOf(A[0]),S=y.substring(0,B).trim(),E=y.substring(B+1).trim();else{let O=0,G=0;for(;O<=N;)B=y.indexOf(A[O],G),G=B+1,O++;S=y.substring(0,B).trim(),E=y.substring(B+1).trim()}}const M=S.split(".");if(M.length==2&&M[1]==0&&M[1].length!=2)throw new Error("invalid coordinates format");const R=E.split(".");if(R.length==2&&R[1]==0&&R[1].length!=2)throw new Error("invalid coordinates format");if(/^\d+$/.test(S)||/^\d+$/.test(E))throw new Error("degree only coordinate/s provided");return isNaN(n)&&n.includes(",")&&(n=n.replace(",",".")),n=Number(Number(n).toFixed(e)),isNaN(r)&&r.includes(",")&&(r=r.replace(",",".")),r=Number(Number(r).toFixed(e)),Object.freeze({verbatimCoordinates:y,verbatimLatitude:S,verbatimLongitude:E,decimalLatitude:n,decimalLongitude:r,decimalCoordinates:`${n},${r}`,closeEnough:iz,toCoordinateFormat:nz})}else throw new Error("coordinates pattern match failed")}function Yg(t){if(!isNaN(t[0]))return!1;const e=[...t];if(e.shift(),e.length%2>0)return!1;const n=/^[-+]?\d+([\.,]\d+)?$/,r=/[eastsouthnorthwest]+/i,i=e.length/2;for(let o=0;o{e.decimalLatitude?t.push(e):t.push({...e,...az})}),[...t,...lz,...uz]}const hz=cz();cb.formats=hz.map(t=>t.verbatimCoordinates);const fz=cb;function RS(t,e,n){const r=t.slice();return r[81]=e[n],r[83]=n,r}function NS(t){let e,n;return e=new Y5({}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function OS(t){let e,n,r,i,o;return n=new K5({}),{c(){e=pe("button"),Ve(n.$$.fragment),Ce(e,"type","button"),Ce(e,"title",t[9]),Ce(e,"class","svelte-zh3kmv"),no(e,"active",t[0])},m(c,l){be(c,e,l),Fe(n,e,null),r=!0,i||(o=Lt(e,"click",t[67]),i=!0)},p(c,l){(!r||l[0]&512)&&Ce(e,"title",c[9]),(!r||l[0]&1)&&no(e,"active",c[0])},i(c){r||(ne(n.$$.fragment,c),r=!0)},o(c){de(n.$$.fragment,c),r=!1},d(c){c&&ve(e),Be(n),i=!1,o()}}}function pz(t){let e,n=[],r=new Map,i,o,c,l=Oi(t[14]);const d=y=>y[81].id+(y[81].address?","+y[81].address:"");for(let y=0;y{ae=null}),Nn()),(!G||ot[0]&2)&&no(y,"displayable",Te[1]!==""),Te[5]===!0?se?(se.p(Te,ot),ot[0]&32&&ne(se,1)):(se=OS(Te),se.c(),ne(se,1),se.m(r,M)):se&&(Rn(),de(se,1,1,()=>{se=null}),Nn()),ke&&ke.p&&(!G||ot[1]&134217728)&&pr(ke,fe,Te,Te[58],G?fr(fe,Te[58],ot,null):dr(Te[58]),null);let ft=N;N=Ge(Te),N===ft?~N&&oe[N].p(Te,ot):(B&&(Rn(),de(oe[ft],1,1,()=>{oe[ft]=null}),Nn()),~N?(B=oe[N],B?B.p(Te,ot):(B=oe[N]=K[N](Te),B.c()),ne(B,1),B.m(n,null)):B=null),(!G||ot[0]&4&&O!==(O=f_(Te[2])+" svelte-zh3kmv"))&&Ce(n,"class",O),(!G||ot[0]&22)&&no(n,"can-collapse",Te[4]&&Te[1]==="")},i(Te){G||(ne(ue),ne(o.$$.fragment,Te),ne(E.$$.fragment,Te),ne(ae),ne(se),ne(ke,Te),ne(B),G=!0)},o(Te){de(ue),de(o.$$.fragment,Te),de(E.$$.fragment,Te),de(ae),de(se),de(ke,Te),de(B),G=!1},d(Te){Te&&(ve(e),ve(n)),Be(o),t[61](null),Be(E),ae&&ae.d(),se&&se.d(),ke&&ke.d(Te),~N&&oe[N].d(),U=!1,Hr(Z)}}}function yz(t,e,n){let r,{$$slots:i={},$$scope:o}=e,{class:c=void 0}=e,{apiKey:l}=e,{bbox:d=void 0}=e,{clearButtonTitle:y="clear"}=e,{clearOnBlur:S=!1}=e,{collapsed:E=!1}=e,{country:C=void 0}=e,{debounceSearch:A=200}=e,{enableReverse:M=!1}=e,{errorMessage:R="Something went wrong…"}=e,{filter:N=()=>!0}=e,{flyTo:B=!0}=e,{fuzzyMatch:O=!0}=e,{language:G=void 0}=e,{limit:U=void 0}=e,{mapController:Z=void 0}=e,{minLength:ue=2}=e,{noResultsMessage:ae="Oops! Looks like you're trying to predict something that's not quite right. We can't seem to find what you're looking for. Maybe try double-checking your spelling or try a different search term. Keep on typing - we'll do our best to get you where you need to go!"}=e,{placeholder:se="Search"}=e,{proximity:fe=[{type:"server-geolocation"}]}=e,{reverseActive:ke=M==="always"}=e,{reverseButtonTitle:K="toggle reverse geocoding"}=e,{searchValue:oe=""}=e,{showFullGeometry:Ge=!0}=e,{showPlaceType:Te="ifNeeded"}=e,{showResultsWhileTyping:ot=!0}=e,{selectFirst:ft=!0}=e,{flyToSelected:At=!1}=e,{markerOnSelected:Ke=!0}=e,{types:Ft=void 0}=e,{excludeTypes:bt=!1}=e,{zoom:Rt=16}=e,{maxZoom:Ot=18}=e,{apiUrl:ln="https://api.maptiler.com/geocoding"}=e,{fetchParameters:Ln={}}=e,{iconsBaseUrl:an="https://cdn.maptiler.com/maptiler-geocoding-control/v1.2.2/icons/"}=e,{adjustUrlQuery:Xt=ee=>{}}=e;function En(){me.focus()}function In(){me.blur()}function rr(ee,Me=!0){n(1,oe=ee),Me?(n(15,tn=-1),jl()):(li(),setTimeout(()=>{me.focus(),me.select()}))}function mt(){n(14,Le=void 0),n(55,gt=void 0),n(15,tn=-1)}function Dt(){n(54,rt=[]),n(55,gt=void 0)}let Sn=!1,Le,rt,gt,Nt="",me,tn=-1,Xe,St=[],hn,Ai,Ls,Js;const al=new Set,ji=zl();Hi(()=>{Z&&(Z.setEventHandler(void 0),Z.indicateReverse(!1),Z.setSelectedMarker(-1),Z.setMarkers(void 0,void 0))});function jl(ee){if(Ai&&(clearTimeout(Ai),Ai=void 0),tn>-1&&Le)n(55,gt=Le[tn]),n(1,oe=gt.place_type[0]==="reverse"?gt.place_name:gt.place_name.replace(/,.*/,"")),n(18,Xe=void 0),n(54,rt=void 0),n(15,tn=-1);else if(oe){const Me=ee||!Ps(oe);lt(oe,{exact:!0}).then(()=>{n(54,rt=Le),n(55,gt=void 0),Me&&hs()}).catch(Se=>n(18,Xe=Se))}}function Ps(ee){try{return fz(ee,6)}catch{return!1}}async function lt(ee,{byId:Me=!1,exact:Se=!1}={}){n(18,Xe=void 0),hn==null||hn.abort();const Re=new AbortController;n(19,hn=Re);try{const We=Ps(ee),Ye=new URLSearchParams;if(G!==void 0&&Ye.set("language",Array.isArray(G)?G.join(","):G??""),Ft&&Ye.set("types",Ft.join(",")),bt&&Ye.set("excludeTypes",String(bt)),d&&Ye.set("bbox",d.map(sn=>sn.toFixed(6)).join(",")),C&&Ye.set("country",Array.isArray(C)?C.join(","):C),!Me&&!We){const sn=await tz(Z,fe,Re);sn&&Ye.set("proximity",sn),(Se||!ot)&&Ye.set("autocomplete","false"),Ye.set("fuzzyMatch",String(O))}U!==void 0&&(!We||(Ft==null?void 0:Ft.length)===1)&&Ye.set("limit",String(U)),Ye.set("key",l),Xt(Ye);const Je=ln+"/"+encodeURIComponent(We?We.decimalLongitude+","+We.decimalLatitude:ee)+".json?"+Ye.toString();if(Je===Nt){Me?(n(14,Le=void 0),n(55,gt=St[0])):n(14,Le=St);return}Nt=Je;const Bt=await fetch(Je,{signal:Re.signal,...Ln});if(!Bt.ok)throw new Error(await Bt.text());const qt=await Bt.json();ji("response",{url:Je,featureCollection:qt}),Me?(n(14,Le=void 0),n(55,gt=qt.features[0]),St=[gt]):(n(14,Le=qt.features.filter(N)),We&&Le.unshift({type:"Feature",properties:{},id:"reverse_"+We.decimalLongitude+"_"+We.decimalLatitude,text:We.decimalLatitude+", "+We.decimalLongitude,place_name:We.decimalLatitude+", "+We.decimalLongitude,place_type:["reverse"],center:[We.decimalLongitude,We.decimalLatitude],bbox:[We.decimalLongitude,We.decimalLatitude,We.decimalLongitude,We.decimalLatitude],geometry:{type:"Point",coordinates:[We.decimalLongitude,We.decimalLatitude]}}),St=Le,We&&me.focus())}catch(We){if(We&&typeof We=="object"&&"name"in We&&We.name==="AbortError")return;throw We}finally{Re===hn&&n(19,hn=void 0)}}function hs(){var Se;if(!(rt!=null&&rt.length)||!B)return;const ee=[180,90,-180,-90],Me=!rt.some(Re=>!Re.matching_text);for(const Re of rt)if(Me||!Re.matching_text)for(const We of[0,1,2,3])ee[We]=Math[We<2?"min":"max"](ee[We],((Se=Re.bbox)==null?void 0:Se[We])??Re.center[We%2]);Z&&rt.length>0&&(gt&&ee[0]===ee[2]&&ee[1]===ee[3]?Z.flyTo(gt.center,Rt):Z.fitBounds(TS(ee),50,Ot))}function fo(ee){n(0,ke=M==="always"),n(14,Le=void 0),n(55,gt=void 0),n(15,tn=-1),rr(ee[1].toFixed(6)+", "+ez(ee[0],[-180,180],!0).toFixed(6),!1)}function Gl(ee){if(!Le)return;let Me=ee.key==="ArrowDown"?1:ee.key==="ArrowUp"?-1:0;Me&&(tn===(ft?0:-1)&&Me===-1&&n(15,tn=Le.length),n(15,tn+=Me),tn>=Le.length&&n(15,tn=-1),tn<0&&ft&&n(15,tn=0),ee.preventDefault())}function li(ee=!0){if(n(18,Xe=void 0),ot){if(Ai&&clearTimeout(Ai),oe.length{lt(Me).catch(Se=>n(18,Xe=Se))},ee?A:0)}else n(14,Le=void 0),n(18,Xe=void 0)}function pt(ee){n(55,gt=ee),n(1,oe=ee.place_name),n(15,tn=-1)}const mn=()=>me.focus();function pn(ee){Gr[ee?"unshift":"push"](()=>{me=ee,n(17,me)})}function Zr(){oe=this.value,n(1,oe),n(13,Sn),n(27,S)}const fs=()=>n(13,Sn=!0),fn=()=>n(13,Sn=!1),za=()=>li(),Jr=()=>{n(1,oe=""),me.focus()},_e=()=>n(0,ke=!ke),W=()=>n(18,Xe=void 0),X=ee=>n(15,tn=ee),Q=ee=>pt(ee),le=()=>{ft||n(15,tn=-1)},Pe=()=>{};return t.$$set=ee=>{"class"in ee&&n(2,c=ee.class),"apiKey"in ee&&n(25,l=ee.apiKey),"bbox"in ee&&n(26,d=ee.bbox),"clearButtonTitle"in ee&&n(3,y=ee.clearButtonTitle),"clearOnBlur"in ee&&n(27,S=ee.clearOnBlur),"collapsed"in ee&&n(4,E=ee.collapsed),"country"in ee&&n(28,C=ee.country),"debounceSearch"in ee&&n(29,A=ee.debounceSearch),"enableReverse"in ee&&n(5,M=ee.enableReverse),"errorMessage"in ee&&n(6,R=ee.errorMessage),"filter"in ee&&n(30,N=ee.filter),"flyTo"in ee&&n(31,B=ee.flyTo),"fuzzyMatch"in ee&&n(32,O=ee.fuzzyMatch),"language"in ee&&n(33,G=ee.language),"limit"in ee&&n(34,U=ee.limit),"mapController"in ee&&n(35,Z=ee.mapController),"minLength"in ee&&n(36,ue=ee.minLength),"noResultsMessage"in ee&&n(7,ae=ee.noResultsMessage),"placeholder"in ee&&n(8,se=ee.placeholder),"proximity"in ee&&n(37,fe=ee.proximity),"reverseActive"in ee&&n(0,ke=ee.reverseActive),"reverseButtonTitle"in ee&&n(9,K=ee.reverseButtonTitle),"searchValue"in ee&&n(1,oe=ee.searchValue),"showFullGeometry"in ee&&n(38,Ge=ee.showFullGeometry),"showPlaceType"in ee&&n(10,Te=ee.showPlaceType),"showResultsWhileTyping"in ee&&n(39,ot=ee.showResultsWhileTyping),"selectFirst"in ee&&n(11,ft=ee.selectFirst),"flyToSelected"in ee&&n(40,At=ee.flyToSelected),"markerOnSelected"in ee&&n(41,Ke=ee.markerOnSelected),"types"in ee&&n(42,Ft=ee.types),"excludeTypes"in ee&&n(43,bt=ee.excludeTypes),"zoom"in ee&&n(44,Rt=ee.zoom),"maxZoom"in ee&&n(45,Ot=ee.maxZoom),"apiUrl"in ee&&n(46,ln=ee.apiUrl),"fetchParameters"in ee&&n(47,Ln=ee.fetchParameters),"iconsBaseUrl"in ee&&n(12,an=ee.iconsBaseUrl),"adjustUrlQuery"in ee&&n(48,Xt=ee.adjustUrlQuery),"$$scope"in ee&&n(58,o=ee.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&134225920&&setTimeout(()=>{n(16,Ls=Sn),S&&!Sn&&n(1,oe="")}),t.$$.dirty[0]&16386|t.$$.dirty[1]&32&&oe.lengthn(18,Xe=ee)),t.$$.dirty[1]&50356241&&(Z&>&>.id!==Js&&B&&(!gt.bbox||gt.bbox[0]===gt.bbox[2]&>.bbox[1]===gt.bbox[3]?Z.flyTo(gt.center,gt.id.startsWith("poi.")||gt.id.startsWith("address.")?Ot:Rt):Z.fitBounds(TS(gt.bbox),50,Ot),n(14,Le=void 0),n(54,rt=void 0),n(15,tn=-1)),n(56,Js=gt==null?void 0:gt.id)),t.$$.dirty[0]&18432&&ft&&Le!=null&&Le.length&&n(15,tn=0),t.$$.dirty[0]&2050&&(ft||n(15,tn=-1)),t.$$.dirty[0]&16384|t.$$.dirty[1]&8388608&&rt!==Le&&n(54,rt=void 0),t.$$.dirty[0]&81921|t.$$.dirty[1]&8388624&&Z&&Z.setEventHandler(ee=>{switch(ee.type){case"mapClick":ke&&fo(ee.coordinates);break;case"markerClick":{const Me=Le==null?void 0:Le.find(Se=>Se.id===ee.id);Me&&pt(Me)}break;case"markerMouseEnter":rt&&n(15,tn=Ls?(Le==null?void 0:Le.findIndex(Me=>Me.id===ee.id))??-1:-1);break;case"markerMouseLeave":rt&&n(15,tn=-1);break}}),t.$$.dirty[0]&49152&&n(57,r=Le==null?void 0:Le[tn]),t.$$.dirty[1]&67133969&&Z&&r&&B&&At&&Z.flyTo(r.center,r.id.startsWith("poi.")||r.id.startsWith("address.")?Ot:Rt),t.$$.dirty[1]&1040&&(Ke||Z==null||Z.setMarkers(void 0,void 0)),t.$$.dirty[1]&75498512&&Z&&Ke&&!rt&&(Z.setMarkers(r?[r]:void 0,void 0),Z.setSelectedMarker(r?0:-1)),t.$$.dirty[1]&25165840&&Z&&Z.setMarkers(rt,gt),t.$$.dirty[0]&32768|t.$$.dirty[1]&8388624&&rt&&Z&&Z.setSelectedMarker(tn),t.$$.dirty[0]&2|t.$$.dirty[1]&16&&Z){const ee=Ps(oe);Z.setReverseMarker(ee?[ee.decimalLongitude,ee.decimalLatitude]:void 0)}t.$$.dirty[1]&67108864&&ji("select",r),t.$$.dirty[1]&16777216&&ji("pick",gt),t.$$.dirty[0]&81920&&ji("optionsVisibilityChange",Ls&&!!Le),t.$$.dirty[0]&16384&&ji("featuresListed",Le),t.$$.dirty[1]&8388608&&ji("featuresMarked",rt),t.$$.dirty[0]&1&&ji("reverseToggle",ke),t.$$.dirty[0]&2&&ji("queryChange",oe),t.$$.dirty[0]&1|t.$$.dirty[1]&16&&Z&&Z.indicateReverse(ke)},[ke,oe,c,y,E,M,R,ae,se,K,Te,ft,an,Sn,Le,tn,Ls,me,Xe,hn,al,jl,Gl,li,pt,l,d,S,C,A,N,B,O,G,U,Z,ue,fe,Ge,ot,At,Ke,Ft,bt,Rt,Ot,ln,Ln,Xt,En,In,rr,mt,Dt,rt,gt,Js,r,o,i,mn,pn,Zr,fs,fn,za,Jr,_e,W,X,Q,le,Pe]}class vz extends Qt{constructor(e){super(),Jt(this,e,yz,_z,Ht,{class:2,apiKey:25,bbox:26,clearButtonTitle:3,clearOnBlur:27,collapsed:4,country:28,debounceSearch:29,enableReverse:5,errorMessage:6,filter:30,flyTo:31,fuzzyMatch:32,language:33,limit:34,mapController:35,minLength:36,noResultsMessage:7,placeholder:8,proximity:37,reverseActive:0,reverseButtonTitle:9,searchValue:1,showFullGeometry:38,showPlaceType:10,showResultsWhileTyping:39,selectFirst:11,flyToSelected:40,markerOnSelected:41,types:42,excludeTypes:43,zoom:44,maxZoom:45,apiUrl:46,fetchParameters:47,iconsBaseUrl:12,adjustUrlQuery:48,focus:49,blur:50,setQuery:51,clearList:52,clearMap:53},null,[-1,-1,-1])}get focus(){return this.$$.ctx[49]}get blur(){return this.$$.ctx[50]}get setQuery(){return this.$$.ctx[51]}get clearList(){return this.$$.ctx[52]}get clearMap(){return this.$$.ctx[53]}}function FS(t){let e,n,r;return n=new vz({props:{mapController:t[1],apiKey:t[0]}}),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"class","svelte-ixhnie")},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p(i,o){const c={};o&2&&(c.mapController=i[1]),o&1&&(c.apiKey=i[0]),n.$set(c)},i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function bz(t){let e,n,r=t[1]&&FS(t);return{c(){r&&r.c(),e=ki()},m(i,o){r&&r.m(i,o),be(i,e,o),n=!0},p(i,[o]){i[1]?r?(r.p(i,o),o&2&&ne(r,1)):(r=FS(i),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function xz(t,e,n){let r,{apiKey:i}=e,{map:o}=e;return t.$$set=c=>{"apiKey"in c&&n(0,i=c.apiKey),"map"in c&&n(2,o=c.map)},t.$$.update=()=>{t.$$.dirty&4&&n(1,r=o?R5(o,Vs):null)},[i,r,o]}class wz extends Qt{constructor(e){super(),Jt(this,e,xz,bz,Ht,{apiKey:0,map:2})}}const Sz=["==",["geometry-type"],"Polygon"],Ez=["==",["geometry-type"],"LineString"];function Iz(t,e,n){let r=["match",t];for(let[i,o]of Object.entries(e))r.push(i),r.push(o);return r.push(n),r}function c_(){return{type:"FeatureCollection",features:[]}}const Cz=t=>({}),BS=t=>({}),Tz=t=>({}),VS=t=>({}),Lz=t=>({}),US=t=>({});function Pz(t){let e,n,r,i,o,c;const l=t[1].top,d=hr(l,t,t[0],US),y=t[1].left,S=hr(y,t,t[0],VS),E=t[1].main,C=hr(E,t,t[0],BS);return{c(){e=pe("div"),d&&d.c(),n=je(),r=pe("div"),S&&S.c(),i=je(),o=pe("div"),C&&C.c(),Ce(e,"class","top svelte-mpick2"),Ce(r,"class","left svelte-mpick2"),Ce(o,"class","main svelte-mpick2")},m(A,M){be(A,e,M),d&&d.m(e,null),be(A,n,M),be(A,r,M),S&&S.m(r,null),be(A,i,M),be(A,o,M),C&&C.m(o,null),c=!0},p(A,[M]){d&&d.p&&(!c||M&1)&&pr(d,l,A,A[0],c?fr(l,A[0],M,Lz):dr(A[0]),US),S&&S.p&&(!c||M&1)&&pr(S,y,A,A[0],c?fr(y,A[0],M,Tz):dr(A[0]),VS),C&&C.p&&(!c||M&1)&&pr(C,E,A,A[0],c?fr(E,A[0],M,Cz):dr(A[0]),BS)},i(A){c||(ne(d,A),ne(S,A),ne(C,A),c=!0)},o(A){de(d,A),de(S,A),de(C,A),c=!1},d(A){A&&(ve(e),ve(n),ve(r),ve(i),ve(o)),d&&d.d(A),S&&S.d(A),C&&C.d(A)}}}function Mz(t,e,n){let{$$slots:r={},$$scope:i}=e;return t.$$set=o=>{"$$scope"in o&&n(0,i=o.$$scope)},[i,r]}class kz extends Qt{constructor(e){super(),Jt(this,e,Mz,Pz,Ht,{})}}const Az=t=>({}),jS=t=>({}),Dz=t=>({}),GS=t=>({}),Rz=t=>({}),qS=t=>({});function Nz(t){let e,n,r,i,o,c;const l=t[4].top,d=hr(l,t,t[3],qS),y=t[4].sidebar,S=hr(y,t,t[3],GS),E=t[4].map,C=hr(E,t,t[3],jS);return{c(){e=pe("div"),d&&d.c(),n=je(),r=pe("div"),S&&S.c(),i=je(),o=pe("div"),C&&C.c()},m(A,M){be(A,e,M),d&&d.m(e,null),t[5](e),be(A,n,M),be(A,r,M),S&&S.m(r,null),t[6](r),be(A,i,M),be(A,o,M),C&&C.m(o,null),t[7](o),c=!0},p(A,[M]){d&&d.p&&(!c||M&8)&&pr(d,l,A,A[3],c?fr(l,A[3],M,Rz):dr(A[3]),qS),S&&S.p&&(!c||M&8)&&pr(S,y,A,A[3],c?fr(y,A[3],M,Dz):dr(A[3]),GS),C&&C.p&&(!c||M&8)&&pr(C,E,A,A[3],c?fr(E,A[3],M,Az):dr(A[3]),jS)},i(A){c||(ne(d,A),ne(S,A),ne(C,A),c=!0)},o(A){de(d,A),de(S,A),de(C,A),c=!1},d(A){A&&(ve(e),ve(n),ve(r),ve(i),ve(o)),d&&d.d(A),t[5](null),S&&S.d(A),t[6](null),C&&C.d(A),t[7](null)}}}function Oz(t,e,n){let r,i,o;wt(t,o1,E=>n(0,r=E)),wt(t,s1,E=>n(1,i=E)),wt(t,a1,E=>n(2,o=E));let{$$slots:c={},$$scope:l}=e;function d(E){Gr[E?"unshift":"push"](()=>{r=E,o1.set(r)})}function y(E){Gr[E?"unshift":"push"](()=>{i=E,s1.set(i)})}function S(E){Gr[E?"unshift":"push"](()=>{o=E,a1.set(o)})}return t.$$set=E=>{"$$scope"in E&&n(3,l=E.$$scope)},[r,i,o,l,c,d,y,S]}class Eu extends Qt{constructor(e){super(),Jt(this,e,Oz,Nz,Ht,{})}}let o1=Gn(null),s1=Gn(null),a1=Gn(null);function zz(t){let e,n,r,i,o,c,l,d,y;return{c(){e=pe("label"),n=nt(`Basemap: - `),r=pe("select"),i=pe("option"),i.textContent="MapTiler Dataviz",o=pe("option"),o.textContent="MapTiler Streets",c=pe("option"),c.textContent="MapTiler Satellite",l=pe("option"),l.textContent="OS Open Zoomstack",i.__value="dataviz",qi(i,i.__value),o.__value="streets-v2",qi(o,o.__value),c.__value="hybrid",qi(c,c.__value),l.__value="uk-openzoomstack-light",qi(l,l.__value),t[0]===void 0&&Jd(()=>t[1].call(r))},m(S,E){be(S,e,E),te(e,n),te(e,r),te(r,i),te(r,o),te(r,c),te(r,l),p_(r,t[0],!0),d||(y=Lt(r,"change",t[1]),d=!0)},p(S,[E]){E&1&&p_(r,S[0])},i:Mt,o:Mt,d(S){S&&ve(e),d=!1,y()}}}function Fz(t,e,n){let r;wt(t,Bv,o=>n(0,r=o));function i(){r=VE(this),Bv.set(r)}return[r,i]}class Bz extends Qt{constructor(e){super(),Jt(this,e,Fz,zz,Ht,{})}}let h_=Gn(!0);function Vz(t){let e,n;return e=new mc({props:{paint:{"fill-color":"black","fill-opacity":0},layout:{visibility:t[0]?"none":"visible"}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&1&&(o.layout={visibility:r[0]?"none":"visible"}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function Uz(t){let e,n;return e=new Fo({props:{data:t[1],$$slots:{default:[Vz]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&5&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function jz(t,e,n){let r;return wt(t,h_,o=>n(0,r=o)),[r,{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]}}]}class Gz extends Qt{constructor(e){super(),Jt(this,e,jz,Uz,Ht,{})}}const qz="/ltn/assets/help-d011708a.svg";function WS(t){let e,n;return e=new $_({props:{$$slots:{default:[Wz]},$$scope:{ctx:t}}}),e.$on("close",t[3]),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&16&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function Wz(t){let e,n,r;const i=t[1].default,o=hr(i,t,t[4],null);return{c(){e=pe("h2"),e.textContent="Help",n=je(),o&&o.c()},m(c,l){be(c,e,l),be(c,n,l),o&&o.m(c,l),r=!0},p(c,l){o&&o.p&&(!r||l&16)&&pr(o,i,c,c[4],r?fr(i,c[4],l,null):dr(c[4]),null)},i(c){r||(ne(o,c),r=!0)},o(c){de(o,c),r=!1},d(c){c&&(ve(e),ve(n)),o&&o.d(c)}}}function Hz(t){let e,n,r,i,o,c,l=t[0]&&WS(t);return{c(){e=pe("button"),e.innerHTML=`Help`,n=je(),l&&l.c(),r=ki(),Ce(e,"class","svelte-gb6dzm")},m(d,y){be(d,e,y),be(d,n,y),l&&l.m(d,y),be(d,r,y),i=!0,o||(c=Lt(e,"click",t[2]),o=!0)},p(d,[y]){d[0]?l?(l.p(d,y),y&1&&ne(l,1)):(l=WS(d),l.c(),ne(l,1),l.m(r.parentNode,r)):l&&(Rn(),de(l,1,1,()=>{l=null}),Nn())},i(d){i||(ne(l),i=!0)},o(d){de(l),i=!1},d(d){d&&(ve(e),ve(n),ve(r)),l&&l.d(d),o=!1,c()}}}function Zz(t,e,n){let{$$slots:r={},$$scope:i}=e,o=!1;const c=()=>n(0,o=!0),l=()=>n(0,o=!1);return t.$$set=d=>{"$$scope"in d&&n(4,i=d.$$scope)},[o,r,c,l,i]}class hb extends Qt{constructor(e){super(),Jt(this,e,Zz,Hz,Ht,{})}}function Xz(t){let e,n,r,i;const o=t[1].default,c=hr(o,t,t[0],null);return{c(){e=pe("a"),c&&c.c(),Ce(e,"href","#")},m(l,d){be(l,e,d),c&&c.m(e,null),n=!0,r||(i=Lt(e,"click",h1(t[2])),r=!0)},p(l,[d]){c&&c.p&&(!n||d&1)&&pr(c,o,l,l[0],n?fr(o,l[0],d,null):dr(l[0]),null)},i(l){n||(ne(c,l),n=!0)},o(l){de(c,l),n=!1},d(l){l&&ve(e),c&&c.d(l),r=!1,i()}}}function Yz(t,e,n){let{$$slots:r={},$$scope:i}=e;function o(c){xn.call(this,t,c)}return t.$$set=c=>{"$$scope"in c&&n(0,i=c.$$scope)},[i,r,o]}class mr extends Qt{constructor(e){super(),Jt(this,e,Yz,Xz,Ht,{})}}const $z=t=>({props:t&8}),HS=t=>({props:Qz(t[3])});function Kz(t){let e;const n=t[1].default,r=hr(n,t,t[2],HS);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&12)&&pr(r,n,i,i[2],e?fr(n,i[2],o,$z):dr(i[2]),HS)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function Jz(t){let e,n;return e=new LN({props:{openOn:t[0],popupClass:"popup",$$slots:{default:[Kz,({features:r})=>({3:r}),({features:r})=>r?8:0]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&1&&(o.openOn=r[0]),i&12&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function Qz(t){return t?t[0].properties??{}:(console.log("A Popup with null features should be impossible"),{})}function e6(t,e,n){let{$$slots:r={},$$scope:i}=e,{openOn:o="hover"}=e;return t.$$set=c=>{"openOn"in c&&n(0,o=c.openOn),"$$scope"in c&&n(2,i=c.$$scope)},[o,r,i]}class Iu extends Qt{constructor(e){super(),Jt(this,e,e6,Jz,Ht,{openOn:0})}}function t6(t,e){let n=new Set(t.getStyle().layers.filter(r=>r.type=="line").map(r=>r.id));return e=="dataviz"?["Road network","Path"].filter(r=>n.has(r)):e=="hybrid"?["Path","Road","Tunnel"].filter(r=>n.has(r)):e=="streets-v2"?t.getStyle().layers.filter(r=>r["source-layer"]=="transportation"&&r.type=="line").map(r=>r.id):e=="uk-openzoomstack-light"?t.getStyle().layers.filter(r=>r["source-layer"]=="roads"&&r.type=="line").map(r=>r.id):[]}const{window:n6}=X_;function r6(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R;return A=BE(t[8][0]),{c(){e=pe("button"),e.textContent="Stop StreetView",n=je(),r=pe("fieldset"),i=pe("legend"),i.textContent="Source:",o=je(),c=pe("label"),l=pe("input"),d=nt(` - Google Street View`),y=je(),S=pe("label"),E=pe("input"),C=nt(` - Bing Streetside`),Ce(e,"class","secondary"),Ce(l,"type","radio"),l.__value="google",qi(l,l.__value),Ce(E,"type","radio"),E.__value="bing",qi(E,E.__value),A.p(l,E)},m(N,B){be(N,e,B),be(N,n,B),be(N,r,B),te(r,i),te(r,o),te(r,c),te(c,l),l.checked=l.__value===t[0],te(c,d),te(r,y),te(r,S),te(S,E),E.checked=E.__value===t[0],te(S,C),M||(R=[Lt(e,"click",t[3]),Lt(l,"change",t[7]),Lt(E,"change",t[9])],M=!0)},p(N,B){B&1&&(l.checked=l.__value===N[0]),B&1&&(E.checked=E.__value===N[0])},d(N){N&&(ve(e),ve(n),ve(r)),A.r(),M=!1,Hr(R)}}}function i6(t){let e,n,r;return{c(){e=pe("button"),e.textContent="StreetView",Ce(e,"class","secondary")},m(i,o){be(i,e,o),n||(r=Lt(e,"click",t[2]),n=!0)},p:Mt,d(i){i&&ve(e),n=!1,r()}}}function o6(t){let e,n,r;function i(l,d){return l[1]?i6:r6}let o=i(t),c=o(t);return{c(){c.c(),e=ki()},m(l,d){c.m(l,d),be(l,e,d),n||(r=Lt(n6,"keydown",t[4]),n=!0)},p(l,[d]){o===(o=i(l))&&c?c.p(l,d):(c.d(1),c=o(l),c&&(c.c(),c.m(e.parentNode,e)))},i:Mt,o:Mt,d(l){l&&ve(e),c.d(l),n=!1,r()}}}function s6(t,e,n){let r;wt(t,h_,R=>n(1,r=R));let{map:i}=e,{maptilerBasemap:o}=e,c="google",l=[];function d(){Ut(h_,r=!1,r),i.on("click",S),i.getCanvas().style.cursor="crosshair";for(let R of t6(i,o))l.push([R,i.getPaintProperty(R,"line-color")]),i.setPaintProperty(R,"line-color","cyan")}function y(){Ut(h_,r=!0,r),i.off("click",S),i.getCanvas().style.cursor="inherit";for(let[R,N]of l)i.setPaintProperty(R,"line-color",N);l=[]}Hi(y);function S(R){let N=R.lngLat.lng,B=R.lngLat.lat;c=="google"?window.open(`http://maps.google.com/maps?q=&layer=c&cbll=${B},${N}&cbp=11,0,0,0,0`,"_blank"):c=="bing"&&window.open(`https://www.bing.com/maps?cp=${B}~${N}&style=x`,"_blank")}function E(R){!r&&R.key=="Escape"&&(R.stopPropagation(),y())}const C=[[]];function A(){c=this.__value,n(0,c)}function M(){c=this.__value,n(0,c)}return t.$$set=R=>{"map"in R&&n(5,i=R.map),"maptilerBasemap"in R&&n(6,o=R.maptilerBasemap)},[c,r,d,y,E,i,o,A,C,M]}class a6 extends Qt{constructor(e){super(),Jt(this,e,s6,o6,Ht,{map:5,maptilerBasemap:6})}}function Ti(t){return{id:t,beforeId:l6(t)}}function l6(t){let e=rs(Pl);if(!e){console.warn(`getBeforeId(${t}) called before map is ready. Z-ordering may be incorrect.`);return}let n,r=!1;for(let i=ZS.length-1;i>=0;i--){let o=ZS[i];if(o==t){r=!0;break}e.getLayer(o)&&(n=o)}if(!r)throw new Error(`Layer ID ${t} not defined in layerZorder`);return n}let av=t=>t,lv=t=>t;const ZS=[av(lv("Background")),"neighbourhood-boundaries",av("Ferry line"),"debug-borders","debug-crosses","debug-filters","cells","interior-roads-outlines","interior-roads","compare-route","shortcuts","shortcuts-focus",lv("Building"),"draw-area-lines","draw-area-preview","one-ways",lv("Road labels"),av("road_label"),"animate-shortcuts","modal-filters","boundary","neighbourhood-boundary","auto-boundaries-areas","auto-boundaries-severances","freehand-line","edit-polygon-fill","edit-polygon-lines","edit-polygon-vertices"];function u6(t){let e;return{c(){e=nt("Back")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function c6(t){let e,n,r,i;return e=new mr({props:{$$slots:{default:[u6]},$$scope:{ctx:t}}}),e.$on("click",t[2]),{c(){Ve(e.$$.fragment)},m(o,c){Fe(e,o,c),n=!0,r||(i=Lt(window,"keydown",t[1]),r=!0)},p(o,[c]){const l={};c&8&&(l.$$scope={dirty:c,ctx:o}),e.$set(l)},i(o){n||(ne(e.$$.fragment,o),n=!0)},o(o){de(e.$$.fragment,o),n=!1},d(o){Be(e,o),r=!1,i()}}}function h6(t){let e=zl();function n(i){i.key=="Escape"&&(i.stopPropagation(),e("click"))}return[e,n,()=>e("click")]}class xy extends Qt{constructor(e){super(),Jt(this,e,h6,c6,Ht,{})}}function f6(t){let e,n;const r=[Ti("one-ways"),{filter:["all",["==",["get","kind"],"interior_road"],["!=",["get","direction"],"both"]]},{layout:{"icon-image":"oneway-arrow","icon-size":1,"symbol-placement":"line","symbol-spacing":50,"icon-allow-overlap":!0,"icon-rotate":["case",["==",["get","direction"],"forwards"],0,180]}},{paint:{"icon-opacity":["case",["get","direction_edited"],1,.5]}}];let i={};for(let o=0;o({}),XS=t=>({}),m6=t=>({}),YS=t=>({});function g6(t){let e,n;const r=[Ti("neighbourhood-boundary"),{paint:{"fill-color":"black","fill-opacity":.3}}];let i={};for(let o=0;o{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function y6(t){let e,n,r,i,o,c,l,d,y,S,E;e=new Fo({props:{data:KS(t[3]),$$slots:{default:[g6]},$$scope:{ctx:t}}});const C=[Ti("cells"),{filter:["==",["get","kind"],"cell"]},{paint:{"fill-color":["get","color"],"fill-opacity":.8}}];let A={};for(let U=0;Un.properties.kind=="boundary");return{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]],e.geometry.coordinates[0]]}}}function b6(t,e,n){let r,i,o,{$$slots:c={},$$scope:l}=e,{gjInput:d}=e,{interactive:y=!0}=e,{onClickLine:S=(C,A)=>{}}=e;const E=C=>y&&S(C.detail.features[0],C.detail.event.lngLat);return t.$$set=C=>{"gjInput"in C&&n(4,d=C.gjInput),"interactive"in C&&n(0,y=C.interactive),"onClickLine"in C&&n(1,S=C.onClickLine),"$$scope"in C&&n(8,l=C.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&n(3,r=l1(d)),t.$$.dirty&16&&n(5,i=Math.max(...d.features.map(C=>C.properties.kind=="interior_road"?C.properties.shortcuts:0))),t.$$.dirty&32&&n(2,o=Uf(["interpolate-hcl",["linear"],["get","shortcuts"],0,"white",1,"#F19A93",i,"#A32015"],"blue"))},[y,S,o,r,d,i,c,E,l]}class wy extends Qt{constructor(e){super(),Jt(this,e,b6,v6,Ht,{gjInput:4,interactive:0,onClickLine:1})}}function x6(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function w6(t){let e;return{c(){e=nt("Pick neighbourhood")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function S6(t){let e;return{c(){e=nt("Editing")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function E6(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M;return o=new mr({props:{$$slots:{default:[x6]},$$scope:{ctx:t}}}),o.$on("click",t[4]),d=new mr({props:{$$slots:{default:[w6]},$$scope:{ctx:t}}}),d.$on("click",t[5]),E=new mr({props:{$$slots:{default:[S6]},$$scope:{ctx:t}}}),E.$on("click",t[6]),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),Ve(d.$$.fragment),y=je(),S=pe("li"),Ve(E.$$.fragment),C=je(),A=pe("li"),A.textContent="Debug mode",Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top")},m(R,N){be(R,e,N),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),Fe(d,l,null),te(r,y),te(r,S),Fe(E,S,null),te(r,C),te(r,A),M=!0},p(R,N){const B={};N&256&&(B.$$scope={dirty:N,ctx:R}),o.$set(B);const O={};N&256&&(O.$$scope={dirty:N,ctx:R}),d.$set(O);const G={};N&256&&(G.$$scope={dirty:N,ctx:R}),E.$set(G)},i(R){M||(ne(o.$$.fragment,R),ne(d.$$.fragment,R),ne(E.$$.fragment,R),M=!0)},o(R){de(o.$$.fragment,R),de(d.$$.fragment,R),de(E.$$.fragment,R),M=!1},d(R){R&&ve(e),Be(o),Be(d),Be(E)}}}function I6(t){let e,n,r;return n=new xy({}),n.$on("click",t[3]),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"slot","sidebar")},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p:Mt,i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function C6(t){let e,n;return e=new K_({props:{properties:t[7]}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&128&&(o.properties=r[7]),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function T6(t){let e,n,r;return n=new Iu({props:{openOn:"hover",$$slots:{default:[C6,({props:i})=>({7:i}),({props:i})=>i?128:0]},$$scope:{ctx:t}}}),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"slot","line-popup")},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p(i,o){const c={};o&384&&(c.$$scope={dirty:o,ctx:i}),n.$set(c)},i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function L6(t){let e,n;return e=new K_({props:{properties:t[7]}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&128&&(o.properties=r[7]),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function P6(t){let e,n;return e=new Iu({props:{openOn:"hover",$$slots:{default:[L6,({props:r})=>({7:r}),({props:r})=>r?128:0]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&384&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function M6(t){let e,n;return e=new K_({props:{properties:t[7]}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&128&&(o.properties=r[7]),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function k6(t){let e,n;return e=new Iu({props:{openOn:"hover",$$slots:{default:[M6,({props:r})=>({7:r}),({props:r})=>r?128:0]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&384&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function A6(t){let e,n,r,i;const o=[Ti("debug-borders"),{filter:["==",["get","kind"],"border_intersection"]},{paint:{"circle-radius":15,"circle-color":"green"}}];let c={$$slots:{default:[P6]},$$scope:{ctx:t}};for(let y=0;y({7:r}),({props:r})=>r?128:0]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&384&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function N6(t){let e,n;const r=[Ti("debug-filters"),{paint:{"circle-radius":15,"circle-color":"black"}}];let i={$$slots:{default:[R6]},$$scope:{ctx:t}};for(let o=0;on(0,r=S)),wt(t,Tn,S=>n(1,i=S)),[r,i,(S,E)=>window.open(Vr(S.properties).way,"_blank"),()=>Ut(Tn,i={mode:"neighbourhood"},i),()=>Ut(Tn,i={mode:"title"},i),()=>Ut(Tn,i={mode:"network"},i),()=>Ut(Tn,i={mode:"neighbourhood"},i)]}class B6 extends Qt{constructor(e){super(),Jt(this,e,F6,z6,Ht,{})}}function JS(t,e,n){const r=t.slice();return r[7]=e[n][0],r[8]=e[n][1],r[9]=e[n][2],r}function QS(t){let e,n,r,i,o,c,l=t[8]+"",d,y,S,E,C;function A(){return t[3](t[7])}return{c(){e=pe("button"),n=pe("img"),i=je(),o=pe("br"),c=je(),d=nt(l),y=je(),si(n.src,r=`/ltn//filters/${t[7]}_icon.gif`)||Ce(n,"src",r),Ce(n,"width","80"),Ce(n,"alt",t[8]),Ce(e,"class","outline"),gr(e,"width","100%"),e.disabled=S=t[0]==t[7]},m(M,R){be(M,e,R),te(e,n),te(e,i),te(e,o),te(e,c),te(e,d),te(e,y),E||(C=Lt(e,"click",A),E=!0)},p(M,R){t=M,R&1&&S!==(S=t[0]==t[7])&&(e.disabled=S)},d(M){M&&ve(e),E=!1,C()}}}function V6(t){let e,n,r,i,o,c,l,d,y,S,E,C,A=t[1][2]+"",M,R,N,B,O,G,U=Oi(t[2]),Z=[];for(let ae=0;ae({6:r}),({dialog:r})=>r?64:0]},$$scope:{ctx:t}}}),e.$on("close",t[5]),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&4163&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function j6(t,e,n){let r,i;wt(t,jv,y=>n(0,i=y));let o=[["walk_cycle_only","Walking/cycling only","A physical barrier that only allows people walking, cycling, and rolling to pass. Often planters or bollards. Larger vehicles cannot enter."],["no_entry","No entry","An alternative sign to indicate vehicles are not allowed to enter the street. Only people walking, cycling, and rolling may pass through."],["bus_gate","Bus gate","A bus gate sign and traffic cameras are installed to allow buses, pedestrians, and cyclists to pass. There is no physical barrier."],["school_street","School street","A closure during school hours only. The barrier usually allows teachers and staff to access the school."]];const c=y=>Ut(jv,i=y,i),l=y=>Vr(y).close();function d(y){xn.call(this,t,y)}return t.$$.update=()=>{t.$$.dirty&1&&n(1,r=o.find(y=>y[0]==i))},[i,r,o,c,l,d]}class G6 extends Qt{constructor(e){super(),Jt(this,e,j6,U6,Ht,{})}}function eE(t){let e,n;return e=new Fo({props:{data:t[0],$$slots:{default:[q6]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&1&&(o.data=r[0]),i&64&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function q6(t){let e,n;const r=[Ti("freehand-line"),{paint:{"line-width":5,"line-color":"red"}}];let i={};for(let o=0;o{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function H6(t,e,n){let{map:r}=e,i=null;const o=zl();r.on("dragstart",c),r.on("mousemove",l),r.on("mouseup",d),Hi(()=>{r.dragPan.enable(),r.off("dragstart",c),r.off("mousemove",l),r.off("mouseup",d)});function c(){r.dragPan.disable(),n(0,i={type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}})}function l(y){i&&(i.geometry.coordinates.push(y.lngLat.toArray()),n(0,i))}function d(){i&&(o("done",i),n(0,i=null))}return t.$$set=y=>{"map"in y&&n(1,r=y.map)},[i,r]}class Z6 extends Qt{constructor(e){super(),Jt(this,e,H6,W6,Ht,{map:1})}}function X6(t){let e;const n=t[3].default,r=hr(n,t,t[5],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&32)&&pr(r,n,i,i[5],e?fr(n,i[5],o,null):dr(i[5]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function Y6(t){let e,n;const r=[Ti("modal-filters"),{layout:{"icon-image":["get","filter_kind"],"icon-allow-overlap":!0,"icon-size":.1}},{paint:{"icon-opacity":["case",["get","edited"],1,.5]}}];let i={$$slots:{default:[X6]},$$scope:{ctx:t}};for(let o=0;on(1,i=y)),wt(t,Xu,y=>n(2,o=y));let{$$slots:c={},$$scope:l}=e;function d(y){xn.call(this,t,y)}return t.$$set=y=>{"$$scope"in y&&n(5,l=y.$$scope)},t.$$.update=()=>{t.$$.dirty&6&&n(0,r=o>0?JSON.parse(i.renderModalFilters()):null)},[r,i,o,c,d,l]}class Sy extends Qt{constructor(e){super(),Jt(this,e,K6,$6,Ht,{})}}var J6=Object.defineProperty,vr=(t,e)=>J6(t,"name",{value:e,configurable:!0}),Q6=class{constructor(e){this.direction=!1,this.compareProperties=!0;var n,r,i;this.precision=10**-((n=e==null?void 0:e.precision)!=null?n:17),this.direction=(r=e==null?void 0:e.direction)!=null?r:!1,this.compareProperties=(i=e==null?void 0:e.compareProperties)!=null?i:!0}compare(e,n){if(e.type!==n.type||!Ud(e,n))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,n.coordinates);case"LineString":return this.compareLine(e.coordinates,n.coordinates);case"Polygon":return this.comparePolygon(e,n);case"GeometryCollection":return this.compareGeometryCollection(e,n);case"Feature":return this.compareFeature(e,n);case"FeatureCollection":return this.compareFeatureCollection(e,n);default:if(e.type.startsWith("Multi")){const r=u1(e),i=u1(n);return r.every(o=>i.some(c=>this.compare(o,c)))}}return!1}compareCoord(e,n){return e.length===n.length&&e.every((r,i)=>Math.abs(r-n[i])=0&&(r=[].concat(e.slice(i,e.length),e.slice(1,i+1))),r}comparePath(e,n){return e.every((r,i)=>this.compareCoord(r,n[i]))}comparePolygon(e,n){if(this.compareLine(e.coordinates[0],n.coordinates[0],1,!0)){const r=e.coordinates.slice(1,e.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length);return r.every(o=>i.some(c=>this.compareLine(o,c,1,!0)))}return!1}compareGeometryCollection(e,n){return Ud(e.geometries,n.geometries)&&this.compareBBox(e,n)&&e.geometries.every((r,i)=>this.compare(r,n.geometries[i]))}compareFeature(e,n){return e.id===n.id&&(this.compareProperties?lC(e.properties,n.properties):!0)&&this.compareBBox(e,n)&&this.compare(e.geometry,n.geometry)}compareFeatureCollection(e,n){return Ud(e.features,n.features)&&this.compareBBox(e,n)&&e.features.every((r,i)=>this.compare(r,n.features[i]))}compareBBox(e,n){return!e.bbox&&!n.bbox||(e.bbox&&n.bbox?this.compareCoord(e.bbox,n.bbox):!1)}};vr(Q6,"GeojsonEquality");function Ud(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length}vr(Ud,"sameLength");function u1(t){return t.coordinates.map(e=>({type:t.type.replace("Multi",""),coordinates:e}))}vr(u1,"explode");var Bs=63710088e-1,TT={centimeters:Bs*100,centimetres:Bs*100,degrees:360/(2*Math.PI),feet:Bs*3.28084,inches:Bs*39.37,kilometers:Bs/1e3,kilometres:Bs/1e3,meters:Bs,metres:Bs,miles:Bs/1609.344,millimeters:Bs*1e3,millimetres:Bs*1e3,nauticalmiles:Bs/1852,radians:1,yards:Bs*1.0936},tE={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function yc(t,e,n={}){const r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}vr(yc,"feature");function eF(t,e,n={}){switch(t){case"Point":return up(e).geometry;case"LineString":return pb(e).geometry;case"Polygon":return fb(e).geometry;case"MultiPoint":return PT(e).geometry;case"MultiLineString":return LT(e).geometry;case"MultiPolygon":return MT(e).geometry;default:throw new Error(t+" is invalid")}}vr(eF,"geometry");function up(t,e,n={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!cp(t[0])||!cp(t[1]))throw new Error("coordinates must contain numbers");return yc({type:"Point",coordinates:t},e,n)}vr(up,"point");function tF(t,e,n={}){return Ey(t.map(r=>up(r,e)),n)}vr(tF,"points");function fb(t,e,n={}){for(const i of t){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;ofb(r,e)),n)}vr(nF,"polygons");function pb(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return yc({type:"LineString",coordinates:t},e,n)}vr(pb,"lineString");function rF(t,e,n={}){return Ey(t.map(r=>pb(r,e)),n)}vr(rF,"lineStrings");function Ey(t,e={}){const n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}vr(Ey,"featureCollection");function LT(t,e,n={}){return yc({type:"MultiLineString",coordinates:t},e,n)}vr(LT,"multiLineString");function PT(t,e,n={}){return yc({type:"MultiPoint",coordinates:t},e,n)}vr(PT,"multiPoint");function MT(t,e,n={}){return yc({type:"MultiPolygon",coordinates:t},e,n)}vr(MT,"multiPolygon");function iF(t,e,n={}){return yc({type:"GeometryCollection",geometries:t},e,n)}vr(iF,"geometryCollection");function oF(t,e=0){if(e&&!(e>=0))throw new Error("precision must be a positive number");const n=Math.pow(10,e||0);return Math.round(t*n)/n}vr(oF,"round");function db(t,e="kilometers"){const n=TT[e];if(!n)throw new Error(e+" units is invalid");return t*n}vr(db,"radiansToLength");function Iy(t,e="kilometers"){const n=TT[e];if(!n)throw new Error(e+" units is invalid");return t/n}vr(Iy,"lengthToRadians");function sF(t,e){return vm(Iy(t,e))}vr(sF,"lengthToDegrees");function aF(t){let e=t%360;return e<0&&(e+=360),e}vr(aF,"bearingToAzimuth");function vm(t){return t%(2*Math.PI)*180/Math.PI}vr(vm,"radiansToDegrees");function _a(t){return t%360*Math.PI/180}vr(_a,"degreesToRadians");function lF(t,e="kilometers",n="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return db(Iy(t,e),n)}vr(lF,"convertLength");function uF(t,e="meters",n="kilometers"){if(!(t>=0))throw new Error("area must be a positive number");const r=tE[e];if(!r)throw new Error("invalid original units");const i=tE[n];if(!i)throw new Error("invalid final units");return t/r*i}vr(uF,"convertArea");function cp(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}vr(cp,"isNumber");function cF(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}vr(cF,"isObject");function hF(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(e=>{if(!cp(e))throw new Error("bbox must only contain numbers")})}vr(hF,"validateBBox");function fF(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}vr(fF,"validateId");var pF=Object.defineProperty,vc=(t,e)=>pF(t,"name",{value:e,configurable:!0});function hp(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return[...t.geometry.coordinates];if(t.type==="Point")return[...t.coordinates]}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}vc(hp,"getCoord");function dF(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}vc(dF,"getCoords");function kT(t){if(t.length>1&&cp(t[0])&&cp(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return kT(t[0]);throw new Error("coordinates must only contain numbers")}vc(kT,"containsNumber");function mF(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}vc(mF,"geojsonType");function gF(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||t.type!=="Feature"||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}vc(gF,"featureOf");function _F(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+n+", FeatureCollection required");for(const r of t.features){if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!r.geometry||r.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+r.geometry.type)}}vc(_F,"collectionOf");function AT(t){return t.type==="Feature"?t.geometry:t}vc(AT,"getGeom");function yF(t,e){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}vc(yF,"getType");var vF=Object.defineProperty,DT=(t,e)=>vF(t,"name",{value:e,configurable:!0});function mb(t,e,n={}){if(n.final===!0)return RT(t,e);const r=hp(t),i=hp(e),o=_a(r[0]),c=_a(i[0]),l=_a(r[1]),d=_a(i[1]),y=Math.sin(c-o)*Math.cos(d),S=Math.cos(l)*Math.sin(d)-Math.sin(l)*Math.cos(d)*Math.cos(c-o);return vm(Math.atan2(y,S))}DT(mb,"bearing");function RT(t,e){let n=mb(e,t);return n=(n+180)%360,n}DT(RT,"calculateFinalBearing");var bF=Object.defineProperty,xF=(t,e)=>bF(t,"name",{value:e,configurable:!0});function NT(t,e,n,r={}){const i=hp(t),o=_a(i[0]),c=_a(i[1]),l=_a(n),d=Iy(e,r.units),y=Math.asin(Math.sin(c)*Math.cos(d)+Math.cos(c)*Math.sin(d)*Math.cos(l)),S=o+Math.atan2(Math.sin(l)*Math.sin(d)*Math.cos(c),Math.cos(d)-Math.sin(c)*Math.sin(y)),E=vm(S),C=vm(y);return up([E,C],r.properties)}xF(NT,"destination");var wF=Object.defineProperty,SF=(t,e)=>wF(t,"name",{value:e,configurable:!0});function OT(t,e,n={}){var r=hp(t),i=hp(e),o=_a(i[1]-r[1]),c=_a(i[0]-r[0]),l=_a(r[1]),d=_a(i[1]),y=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(c/2),2)*Math.cos(l)*Math.cos(d);return db(2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y)),n.units)}SF(OT,"distance");var EF=Object.defineProperty,IF=(t,e)=>EF(t,"name",{value:e,configurable:!0});function zT(t,e,n={}){const i=AT(t).coordinates;let o=0;for(let c=0;c=o&&c===i.length-1);c++)if(o>=e){const l=e-o;if(l){const d=mb(i[c],i[c-1])-180;return NT(i[c],l,d,n)}else return up(i[c])}else o+=OT(i[c],i[c+1],n);return up(i[i.length-1])}IF(zT,"along");var CF=zT;function TF(t){let e,n;const r=[Ti("animate-shortcuts"),{paint:{"circle-radius":10,"circle-color":"purple","circle-stroke-color":"black","circle-stroke-width":1}}];let i={};for(let o=0;oclearInterval(l));function d(){return r.features.map(A=>1/A.properties.directness).reduce((A,M)=>A+M,0)}function y(){return r.features.length==0?[]:Array.from({length:PF},S)}function S(){let A=Math.random()*i,M=0;for(let[R,N]of r.features.entries())if(M+=1/N.properties.directness,ACF(r.features[A],M,{units:"kilometers"}))}}function C(){for(let[A,M]of o.entries())M.distance+=kF,M.distance>=r.features[M.idx].properties.length_meters/1e3&&(o[A]=S());n(0,c=E())}return t.$$set=A=>{"paths"in A&&n(1,r=A.paths)},t.$$.update=()=>{t.$$.dirty&2&&r&&(i=d(),o=y())},[c,r]}class DF extends Qt{constructor(e){super(),Jt(this,e,AF,LF,Ht,{paths:1})}}function RF(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function NF(t){let e;return{c(){e=nt("Pick neighbourhood")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function OF(t){let e;return{c(){e=pe("p"),e.textContent=`Now that you've defined a neighbourhood boundary, you can see the - possible shortcuts that vehicles are currently able to take - through it. You can add a new modal filter to try and solve this. - The colored "cell" areas show what's reachable for drivers without - leaving the boundary you've drawn.`},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function zF(t){let e;return{c(){e=nt("View shortcuts")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function FF(t){let e;return{c(){e=nt("Route")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function BF(t){let e;return{c(){e=nt("Change this boundary")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function VF(t){let e;return{c(){e=nt("Debug")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function UF(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R,N,B,O,G,U,Z,ue,ae,se,fe,ke,K;return o=new mr({props:{$$slots:{default:[RF]},$$scope:{ctx:t}}}),o.$on("click",t[25]),d=new mr({props:{$$slots:{default:[NF]},$$scope:{ctx:t}}}),d.$on("click",t[26]),C=new hb({props:{$$slots:{default:[OF]},$$scope:{ctx:t}}}),B=new mr({props:{$$slots:{default:[zF]},$$scope:{ctx:t}}}),B.$on("click",t[27]),U=new mr({props:{$$slots:{default:[FF]},$$scope:{ctx:t}}}),U.$on("click",t[28]),ae=new mr({props:{$$slots:{default:[BF]},$$scope:{ctx:t}}}),ae.$on("click",t[29]),ke=new mr({props:{$$slots:{default:[VF]},$$scope:{ctx:t}}}),ke.$on("click",t[30]),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),Ve(d.$$.fragment),y=je(),S=pe("li"),E=nt(`Editing - `),Ve(C.$$.fragment),A=je(),M=pe("nav"),R=pe("ul"),N=pe("li"),Ve(B.$$.fragment),O=je(),G=pe("li"),Ve(U.$$.fragment),Z=je(),ue=pe("li"),Ve(ae.$$.fragment),se=je(),fe=pe("li"),Ve(ke.$$.fragment),Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top"),gr(e,"display","flex"),gr(e,"justify-content","space-between")},m(oe,Ge){be(oe,e,Ge),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),Fe(d,l,null),te(r,y),te(r,S),te(S,E),Fe(C,S,null),te(e,A),te(e,M),te(M,R),te(R,N),Fe(B,N,null),te(R,O),te(R,G),Fe(U,G,null),te(R,Z),te(R,ue),Fe(ae,ue,null),te(R,se),te(R,fe),Fe(ke,fe,null),K=!0},p(oe,Ge){const Te={};Ge[1]&8&&(Te.$$scope={dirty:Ge,ctx:oe}),o.$set(Te);const ot={};Ge[1]&8&&(ot.$$scope={dirty:Ge,ctx:oe}),d.$set(ot);const ft={};Ge[1]&8&&(ft.$$scope={dirty:Ge,ctx:oe}),C.$set(ft);const At={};Ge[1]&8&&(At.$$scope={dirty:Ge,ctx:oe}),B.$set(At);const Ke={};Ge[1]&8&&(Ke.$$scope={dirty:Ge,ctx:oe}),U.$set(Ke);const Ft={};Ge[1]&8&&(Ft.$$scope={dirty:Ge,ctx:oe}),ae.$set(Ft);const bt={};Ge[1]&8&&(bt.$$scope={dirty:Ge,ctx:oe}),ke.$set(bt)},i(oe){K||(ne(o.$$.fragment,oe),ne(d.$$.fragment,oe),ne(C.$$.fragment,oe),ne(B.$$.fragment,oe),ne(U.$$.fragment,oe),ne(ae.$$.fragment,oe),ne(ke.$$.fragment,oe),K=!0)},o(oe){de(o.$$.fragment,oe),de(d.$$.fragment,oe),de(C.$$.fragment,oe),de(B.$$.fragment,oe),de(U.$$.fragment,oe),de(ae.$$.fragment,oe),de(ke.$$.fragment,oe),K=!1},d(oe){oe&&ve(e),Be(o),Be(d),Be(C),Be(B),Be(U),Be(ae),Be(ke)}}}function nE(t){let e;return{c(){e=pe("mark"),e.textContent=`Some parts of the neighbourhood aren't reachable by drivers, shown in - red`},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function jF(t){let e,n,r;return{c(){e=nt("Undo ("),n=nt(t[4]),r=nt(")")},m(i,o){be(i,e,o),be(i,n,o),be(i,r,o)},p(i,o){o[0]&16&&Kn(n,i[4])},d(i){i&&(ve(e),ve(n),ve(r))}}}function GF(t){let e;return{c(){e=nt("Undo")},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function qF(t){let e,n,r;return{c(){e=nt("Redo ("),n=nt(t[5]),r=nt(")")},m(i,o){be(i,e,o),be(i,n,o),be(i,r,o)},p(i,o){o[0]&32&&Kn(n,i[5])},d(i){i&&(ve(e),ve(n),ve(r))}}}function WF(t){let e;return{c(){e=nt("Redo")},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function rE(t){let e,n;return e=new G6({}),e.$on("close",t[24]),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p:Mt,i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function HF(t){let e,n,r,i,o=Vr(t[6]).properties.name+"",c,l,d=t[1].area_km2.toFixed(1)+"",y,S,E,C,A,M,R,N,B,O,G,U,Z,ue,ae,se,fe,ke,K,oe,Ge,Te,ot,ft,At,Ke,Ft,bt,Rt,Ot,ln,Ln,an,Xt,En,In=t[8]>0&&nE();function rr(Nt,me){return Nt[4]==0?GF:jF}let mt=rr(t),Dt=mt(t);function Sn(Nt,me){return Nt[5]==0?WF:qF}let Le=Sn(t),rt=Le(t),gt=t[3]&&rE(t);return{c(){e=pe("div"),n=pe("p"),r=nt("Editing neighbourhood "),i=pe("u"),c=nt(o),l=nt(` - , with an area of `),y=nt(d),S=nt(" km²"),E=je(),In&&In.c(),C=je(),A=pe("div"),M=pe("button"),R=pe("img"),B=nt(` - Add a modal filter`),G=je(),U=pe("button"),Z=nt("Add many modal filters along line"),ae=je(),se=pe("button"),fe=nt("Reverse directions"),K=je(),oe=pe("button"),oe.textContent="Change modal filter type",Ge=je(),Te=pe("label"),ot=pe("input"),ft=nt(` - Animate shortcuts`),At=je(),Ke=pe("div"),Ft=pe("button"),Dt.c(),Rt=je(),Ot=pe("button"),rt.c(),Ln=je(),gt&>.c(),si(R.src,N=`/ltn//filters/${t[9]}_icon.gif`)||Ce(R,"src",N),Ce(R,"width","30"),Ce(R,"alt","Add a modal filter"),M.disabled=O=t[0]=="filter",Ce(M,"data-tooltip","hotkey 1"),U.disabled=ue=t[0]=="freehand-filters",Ce(U,"data-tooltip","hotkey 2"),se.disabled=ke=t[0]=="oneway",Ce(se,"data-tooltip","hotkey 3"),gr(A,"display","flex"),gr(A,"justify-content","space-between"),Ce(ot,"type","checkbox"),Ft.disabled=bt=t[4]==0,Ce(Ft,"data-tooltip","Ctrl+Z"),Ot.disabled=ln=t[5]==0,Ce(Ot,"data-tooltip","Ctrl+Y"),gr(Ke,"display","flex"),gr(Ke,"justify-content","space-between"),Ce(e,"slot","sidebar")},m(Nt,me){be(Nt,e,me),te(e,n),te(n,r),te(n,i),te(i,c),te(n,l),te(n,y),te(n,S),te(e,E),In&&In.m(e,null),te(e,C),te(e,A),te(A,M),te(M,R),te(M,B),te(A,G),te(A,U),te(U,Z),te(A,ae),te(A,se),te(se,fe),te(e,K),te(e,oe),te(e,Ge),te(e,Te),te(Te,ot),ot.checked=t[10],te(Te,ft),te(e,At),te(e,Ke),te(Ke,Ft),Dt.m(Ft,null),te(Ke,Rt),te(Ke,Ot),rt.m(Ot,null),te(e,Ln),gt&>.m(e,null),an=!0,Xt||(En=[Lt(M,"click",t[19]),Lt(U,"click",t[20]),Lt(se,"click",t[21]),Lt(oe,"click",t[22]),Lt(ot,"change",t[23]),Lt(Ft,"click",t[15]),Lt(Ot,"click",t[16])],Xt=!0)},p(Nt,me){(!an||me[0]&64)&&o!==(o=Vr(Nt[6]).properties.name+"")&&Kn(c,o),(!an||me[0]&2)&&d!==(d=Nt[1].area_km2.toFixed(1)+"")&&Kn(y,d),Nt[8]>0?In||(In=nE(),In.c(),In.m(e,C)):In&&(In.d(1),In=null),(!an||me[0]&512&&!si(R.src,N=`/ltn//filters/${Nt[9]}_icon.gif`))&&Ce(R,"src",N),(!an||me[0]&1&&O!==(O=Nt[0]=="filter"))&&(M.disabled=O),(!an||me[0]&1&&ue!==(ue=Nt[0]=="freehand-filters"))&&(U.disabled=ue),(!an||me[0]&1&&ke!==(ke=Nt[0]=="oneway"))&&(se.disabled=ke),me[0]&1024&&(ot.checked=Nt[10]),mt===(mt=rr(Nt))&&Dt?Dt.p(Nt,me):(Dt.d(1),Dt=mt(Nt),Dt&&(Dt.c(),Dt.m(Ft,null))),(!an||me[0]&16&&bt!==(bt=Nt[4]==0))&&(Ft.disabled=bt),Le===(Le=Sn(Nt))&&rt?rt.p(Nt,me):(rt.d(1),rt=Le(Nt),rt&&(rt.c(),rt.m(Ot,null))),(!an||me[0]&32&&ln!==(ln=Nt[5]==0))&&(Ot.disabled=ln),Nt[3]?gt?(gt.p(Nt,me),me[0]&8&&ne(gt,1)):(gt=rE(Nt),gt.c(),ne(gt,1),gt.m(e,null)):gt&&(Rn(),de(gt,1,1,()=>{gt=null}),Nn())},i(Nt){an||(ne(gt),an=!0)},o(Nt){de(gt),an=!1},d(Nt){Nt&&ve(e),In&&In.d(),Dt.d(),rt.d(),gt&>.d(),Xt=!1,Hr(En)}}}function ZF(t){let e;return{c(){e=pe("p"),e.textContent="Click to change direction"},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function XF(t){let e,n,r,i;return{c(){e=pe("div"),n=pe("img"),i=nt(` - Click to add modal filter`),si(n.src,r=`/ltn//filters/${t[9]}_icon.gif`)||Ce(n,"src",r),Ce(n,"width","20"),Ce(n,"alt","Add modal filter")},m(o,c){be(o,e,c),te(e,n),te(e,i)},p(o,c){c[0]&512&&!si(n.src,r=`/ltn//filters/${o[9]}_icon.gif`)&&Ce(n,"src",r)},d(o){o&&ve(e)}}}function YF(t){let e,n=t[33].shortcuts+"",r,i,o=(t[33].name??"unnamed road")+"",c,l,d;function y(C,A){return C[0]=="filter"?XF:ZF}let S=y(t),E=S(t);return{c(){e=pe("p"),r=nt(n),i=nt(" shortcuts through "),c=nt(o),l=je(),E.c(),d=ki()},m(C,A){be(C,e,A),te(e,r),te(e,i),te(e,c),be(C,l,A),E.m(C,A),be(C,d,A)},p(C,A){A[1]&4&&n!==(n=C[33].shortcuts+"")&&Kn(r,n),A[1]&4&&o!==(o=(C[33].name??"unnamed road")+"")&&Kn(c,o),S===(S=y(C))&&E?E.p(C,A):(E.d(1),E=S(C),E&&(E.c(),E.m(d.parentNode,d)))},d(C){C&&(ve(e),ve(l),ve(d)),E.d(C)}}}function $F(t){let e,n,r;return n=new Iu({props:{openOn:"hover",$$slots:{default:[YF,({props:i})=>({33:i}),({props:i})=>[0,i?4:0]]},$$scope:{ctx:t}}}),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"slot","line-popup")},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p(i,o){const c={};o[0]&513|o[1]&12&&(c.$$scope={dirty:o,ctx:i}),n.$set(c)},i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function iE(t){let e,n;return e=new DF({props:{paths:t[7]}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i[0]&128&&(o.paths=r[7]),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function KF(t){let e;return{c(){e=nt("Click to delete")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function JF(t){let e,n;return e=new Iu({props:{openOn:"hover",$$slots:{default:[KF]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i[1]&8&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function oE(t){let e,n;return e=new Z6({props:{map:Vr(t[2])}}),e.$on("done",t[17]),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i[0]&4&&(o.map=Vr(r[2])),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function QF(t){let e,n,r,i,o,c,l;n=new wy({props:{gjInput:t[1],interactive:t[0]=="filter"||t[0]=="oneway",onClickLine:t[12],$$slots:{"line-popup":[$F]},$$scope:{ctx:t}}});let d=t[10]&&iE(t);o=new Sy({props:{$$slots:{default:[JF]},$$scope:{ctx:t}}}),o.$on("click",t[13]);let y=t[0]=="freehand-filters"&&oE(t);return{c(){e=pe("div"),Ve(n.$$.fragment),r=je(),d&&d.c(),i=je(),Ve(o.$$.fragment),c=je(),y&&y.c(),Ce(e,"slot","map")},m(S,E){be(S,e,E),Fe(n,e,null),te(e,r),d&&d.m(e,null),te(e,i),Fe(o,e,null),te(e,c),y&&y.m(e,null),l=!0},p(S,E){const C={};E[0]&2&&(C.gjInput=S[1]),E[0]&1&&(C.interactive=S[0]=="filter"||S[0]=="oneway"),E[0]&513|E[1]&8&&(C.$$scope={dirty:E,ctx:S}),n.$set(C),S[10]?d?(d.p(S,E),E[0]&1024&&ne(d,1)):(d=iE(S),d.c(),ne(d,1),d.m(e,i)):d&&(Rn(),de(d,1,1,()=>{d=null}),Nn());const A={};E[1]&8&&(A.$$scope={dirty:E,ctx:S}),o.$set(A),S[0]=="freehand-filters"?y?(y.p(S,E),E[0]&1&&ne(y,1)):(y=oE(S),y.c(),ne(y,1),y.m(e,null)):y&&(Rn(),de(y,1,1,()=>{y=null}),Nn())},i(S){l||(ne(n.$$.fragment,S),ne(d),ne(o.$$.fragment,S),ne(y),l=!0)},o(S){de(n.$$.fragment,S),de(d),de(o.$$.fragment,S),de(y),l=!1},d(S){S&&ve(e),Be(n),d&&d.d(),Be(o),y&&y.d()}}}function eB(t){let e,n,r,i;return e=new Eu({props:{$$slots:{map:[QF],sidebar:[HF],top:[UF]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(o,c){Fe(e,o,c),n=!0,r||(i=Lt(window,"keydown",t[14]),r=!0)},p(o,c){const l={};c[0]&4095|c[1]&8&&(l.$$scope={dirty:c,ctx:o}),e.$set(l)},i(o){n||(ne(e.$$.fragment,o),n=!0)},o(o){de(e.$$.fragment,o),n=!1},d(o){Be(e,o),r=!1,i()}}}function tB(t,e,n){let r,i,o,c,l,d,y;wt(t,Xu,bt=>n(18,i=bt)),wt(t,jv,bt=>n(9,o=bt)),wt(t,Zi,bt=>n(31,c=bt)),wt(t,Pl,bt=>n(2,l=bt)),wt(t,E2,bt=>n(10,d=bt)),wt(t,Tn,bt=>n(11,y=bt));let S="filter",E=!1,C=0,A=0,M,R,N=JSON.parse(c.getAllShortcuts());Hi(()=>{l.doubleClickZoom.enable()});function B(bt){n(1,R=JSON.parse(c.renderNeighbourhood())),n(6,M=R.features.find(Rt=>Rt.properties.kind=="boundary")),n(4,C=R.undo_length),n(5,A=R.redo_length),n(7,N=JSON.parse(c.getAllShortcuts())),Vf()}function O(bt,Rt){S=="filter"?(c.addModalFilter(Rt,o),Ut(Xu,i++,i)):S=="oneway"&&(c.toggleDirection(bt.properties.road),Ut(Xu,i++,i))}function G(bt){let Rt=bt.detail.features[0];c.deleteModalFilter(Rt.properties.road),Ut(Xu,i++,i)}function U(bt){bt.target.tagName!="INPUT"&&(bt.ctrlKey&&bt.key=="z"&&Z(),bt.ctrlKey&&bt.key=="y"&&ue(),bt.key=="1"&&n(0,S="filter"),bt.key=="2"&&n(0,S="freehand-filters"),bt.key=="3"&&n(0,S="oneway"))}function Z(){c.undo(),Ut(Xu,i++,i)}function ue(){c.redo(),Ut(Xu,i++,i)}function ae(bt){let Rt=bt.detail;Rt&&(c.addManyModalFilters(Rt,o),Ut(Xu,i++,i)),n(0,S="filter")}const se=()=>n(0,S="filter"),fe=()=>n(0,S="freehand-filters"),ke=()=>n(0,S="oneway"),K=()=>n(3,E=!0);function oe(){d=this.checked,E2.set(d)}const Ge=()=>n(3,E=!1),Te=()=>Ut(Tn,y={mode:"title"},y),ot=()=>Ut(Tn,y={mode:"network"},y),ft=()=>Ut(Tn,y={mode:"view-shortcuts"},y),At=()=>Ut(Tn,y={mode:"route",prevMode:"neighbourhood"},y),Ke=()=>Ut(Tn,y={mode:"set-boundary",name:Vr(M).properties.name,existing:M},y),Ft=()=>Ut(Tn,y={mode:"debug"},y);return t.$$.update=()=>{t.$$.dirty[0]&5&&(S=="oneway"?l.doubleClickZoom.disable():l.doubleClickZoom.enable()),t.$$.dirty[0]&262144&&B(),t.$$.dirty[0]&2&&n(8,r=R.features.filter(bt=>bt.properties.kind=="cell"&&bt.properties.cell_color=="disconnected").length)},[S,R,l,E,C,A,M,N,r,o,d,y,O,G,U,Z,ue,ae,i,se,fe,ke,K,oe,Ge,Te,ot,ft,At,Ke,Ft]}class nB extends Qt{constructor(e){super(),Jt(this,e,tB,eB,Ht,{},null,[-1,-1])}}const FT="/ltn/assets/delete-ec75e756.svg",BT="/ltn/assets/edit-f3f51206.svg";function sE(t,e,n){const r=t.slice();return r[19]=e[n],r}function rB(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function iB(t){let e;return{c(){e=pe("p"),e.textContent=`Inside the neighbourhood you define, the goal is to eliminate (or - deliberately permit) through-traffic. An appropriate neighbourhood - boundary depends on many factors. The simplest approach is to find - the area bounded on all sides by "main" roads, which are designed - for higher traffic volumes. There are many other considerations, - though -- maybe severances like rivers or rail should be part of a - boundary. Bridges and tunnels near a boundary may be confusing as - well. And note that your boundary may not match the conventional - definition of "neighbourhood."`},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function oB(t){let e;return{c(){e=nt("Route")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function sB(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R;return o=new mr({props:{$$slots:{default:[rB]},$$scope:{ctx:t}}}),o.$on("click",t[16]),y=new hb({props:{$$slots:{default:[iB]},$$scope:{ctx:t}}}),M=new mr({props:{$$slots:{default:[oB]},$$scope:{ctx:t}}}),M.$on("click",t[17]),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),d=nt(`Pick neighbourhood - `),Ve(y.$$.fragment),S=je(),E=pe("nav"),C=pe("ul"),A=pe("li"),Ve(M.$$.fragment),Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top"),gr(e,"display","flex"),gr(e,"justify-content","space-between")},m(N,B){be(N,e,B),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),te(l,d),Fe(y,l,null),te(e,S),te(e,E),te(E,C),te(C,A),Fe(M,A,null),R=!0},p(N,B){const O={};B&4194304&&(O.$$scope={dirty:B,ctx:N}),o.$set(O);const G={};B&4194304&&(G.$$scope={dirty:B,ctx:N}),y.$set(G);const U={};B&4194304&&(U.$$scope={dirty:B,ctx:N}),M.$set(U)},i(N){R||(ne(o.$$.fragment,N),ne(y.$$.fragment,N),ne(M.$$.fragment,N),R=!0)},o(N){de(o.$$.fragment,N),de(y.$$.fragment,N),de(M.$$.fragment,N),R=!1},d(N){N&&ve(e),Be(o),Be(y),Be(M)}}}function aB(t){let e;return{c(){e=nt("Draw a new boundary")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function lB(t){let e;return{c(){e=nt("Use an auto-generated boundary")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function uB(t){let e=t[19]+"",n;return{c(){n=nt(e)},m(r,i){be(r,n,i)},p(r,i){i&2&&e!==(e=r[19]+"")&&Kn(n,e)},d(r){r&&ve(n)}}}function aE(t){let e,n,r,i,o,c,l,d,y,S,E;function C(){return t[13](t[19])}r=new mr({props:{$$slots:{default:[uB]},$$scope:{ctx:t}}}),r.$on("click",C);function A(){return t[14](t[19])}function M(){return t[15](t[19])}return{c(){e=pe("li"),n=pe("span"),Ve(r.$$.fragment),i=je(),o=pe("button"),o.innerHTML=`Rename neighbourhood`,c=je(),l=pe("button"),l.innerHTML=`Delete neighbourhood`,d=je(),Ce(o,"class","secondary"),Ce(l,"class","secondary"),gr(n,"display","flex"),gr(n,"justify-content","space-between")},m(R,N){be(R,e,N),te(e,n),Fe(r,n,null),te(n,i),te(n,o),te(n,c),te(n,l),te(e,d),y=!0,S||(E=[Lt(o,"click",A),Lt(l,"click",M)],S=!0)},p(R,N){t=R;const B={};N&4194306&&(B.$$scope={dirty:N,ctx:t}),r.$set(B)},i(R){y||(ne(r.$$.fragment,R),y=!0)},o(R){de(r.$$.fragment,R),y=!1},d(R){R&&ve(e),Be(r),S=!1,Hr(E)}}}function cB(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R,N,B,O,G,U,Z;r=new mr({props:{$$slots:{default:[aB]},$$scope:{ctx:t}}}),r.$on("click",t[7]),c=new mr({props:{$$slots:{default:[lB]},$$scope:{ctx:t}}}),c.$on("click",t[12]);let ue=Oi(t[1]),ae=[];for(let fe=0;fede(ae[fe],1,1,()=>{ae[fe]=null});return{c(){e=pe("div"),n=pe("div"),Ve(r.$$.fragment),i=je(),o=pe("div"),Ve(c.$$.fragment),l=je(),d=pe("ul");for(let fe=0;fe({18:r}),({props:r})=>r?262144:0]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&4456448&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function pB(t){let e,n;const r=[Ti("neighbourhood-boundaries"),{filter:["==",["get","kind"],"boundary"]},{paint:{"fill-color":"red","fill-opacity":Uf(.3,.5)}},{eventsIfTopMost:!0},{manageHoverState:!0},{hoverCursor:"pointer"}];let i={$$slots:{default:[fB]},$$scope:{ctx:t}};for(let o=0;on(10,o=Z)),wt(t,nc,Z=>n(2,c=Z)),wt(t,Tn,Z=>n(3,l=Z));function d(Z){o.setCurrentNeighbourhood(Z),Ut(Tn,l={mode:"neighbourhood"},l)}function y(Z){window.confirm(`Really delete neighbourhood ${Z}? You can't undo this.`)&&(o.deleteNeighbourhoodBoundary(Z),Vf(),n(0,r=JSON.parse(o.toSavefile())))}function S(Z){let ue=window.prompt(`Rename neighbourhood ${Z} to what?`,Z);ue&&(o.renameNeighbourhoodBoundary(Z,ue),Vf(),n(0,r=JSON.parse(o.toSavefile())))}function E(){let Z=window.prompt("What do you want to name the neighbourhood?");Z&&Ut(Tn,l={mode:"set-boundary",name:Z,existing:null},l)}function C(){d_(c+".geojson",o.toSavefile())}function A(){d_("debug_route_snapper.geojson",o.toRouteSnapperGj())}const M=Z=>d(Vr(Z.detail.features[0].properties).name),R=()=>Ut(Tn,l={mode:"auto-boundaries"},l),N=Z=>d(Z),B=Z=>S(Z),O=Z=>y(Z),G=()=>Ut(Tn,l={mode:"title"},l),U=()=>Ut(Tn,l={mode:"route",prevMode:"network"},l);return t.$$.update=()=>{t.$$.dirty&1024&&n(0,r=JSON.parse(o.toSavefile())),t.$$.dirty&1&&n(1,i=r.features.filter(Z=>Z.properties.kind=="boundary").map(Z=>Z.properties.name))},[r,i,c,l,d,y,S,E,C,A,o,M,R,N,B,O,G,U]}class _B extends Qt{constructor(e){super(),Jt(this,e,gB,mB,Ht,{})}}function yB(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function vB(t){let e;return{c(){e=nt("Pick neighbourhood")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function lE(t){let e,n,r;return n=new mr({props:{$$slots:{default:[bB]},$$scope:{ctx:t}}}),n.$on("click",t[13]),{c(){e=pe("li"),Ve(n.$$.fragment)},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p(i,o){const c={};o&16384&&(c.$$scope={dirty:o,ctx:i}),n.$set(c)},i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function bB(t){let e;return{c(){e=nt("Editing")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function xB(t){let e,n,r,i,o,c,l,d,y,S,E,C;o=new mr({props:{$$slots:{default:[yB]},$$scope:{ctx:t}}}),o.$on("click",t[11]),d=new mr({props:{$$slots:{default:[vB]},$$scope:{ctx:t}}}),d.$on("click",t[12]);let A=t[0]=="neighbourhood"&&lE(t);return{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),Ve(d.$$.fragment),y=je(),A&&A.c(),S=je(),E=pe("li"),E.textContent="Routing",Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top")},m(M,R){be(M,e,R),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),Fe(d,l,null),te(r,y),A&&A.m(r,null),te(r,S),te(r,E),C=!0},p(M,R){const N={};R&16384&&(N.$$scope={dirty:R,ctx:M}),o.$set(N);const B={};R&16384&&(B.$$scope={dirty:R,ctx:M}),d.$set(B),M[0]=="neighbourhood"?A?(A.p(M,R),R&1&&ne(A,1)):(A=lE(M),A.c(),ne(A,1),A.m(r,S)):A&&(Rn(),de(A,1,1,()=>{A=null}),Nn())},i(M){C||(ne(o.$$.fragment,M),ne(d.$$.fragment,M),ne(A),C=!0)},o(M){de(o.$$.fragment,M),de(d.$$.fragment,M),de(A),C=!1},d(M){M&&ve(e),Be(o),Be(d),A&&A.d()}}}function wB(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R,N,B;return n=new xy({}),n.$on("click",t[7]),{c(){e=pe("div"),Ve(n.$$.fragment),r=je(),i=pe("p"),i.textContent="Drag markers for a route",o=je(),c=pe("p"),c.innerHTML=`Route before - , - route after`,l=je(),d=pe("label"),y=nt("Slow-down factor for main roads: "),S=nt(t[1]),E=je(),C=pe("input"),A=je(),M=pe("i"),M.textContent=`Increase to see how drivers may detour in heavy traffic. 1 means - free-flow.`,Ce(C,"type","range"),Ce(C,"min","1.0"),Ce(C,"max","5.0"),Ce(C,"step","0.1"),Ce(e,"slot","sidebar")},m(O,G){be(O,e,G),Fe(n,e,null),te(e,r),te(e,i),te(e,o),te(e,c),te(e,l),te(e,d),te(d,y),te(d,S),te(d,E),te(d,C),qi(C,t[1]),te(e,A),te(e,M),R=!0,N||(B=[Lt(C,"change",t[10]),Lt(C,"input",t[10])],N=!0)},p(O,G){(!R||G&2)&&Kn(S,O[1]),G&2&&qi(C,O[1])},i(O){R||(ne(n.$$.fragment,O),R=!0)},o(O){de(n.$$.fragment,O),R=!1},d(O){O&&ve(e),Be(n),N=!1,Hr(B)}}}function uE(t){let e,n;return e=new wy({props:{gjInput:JSON.parse(Vr(t[4]).renderNeighbourhood()),interactive:!1}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&16&&(o.gjInput=JSON.parse(Vr(r[4]).renderNeighbourhood())),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function SB(t){let e,n;const r=[Ti("compare-route"),{paint:{"line-width":10,"line-color":Iz(["get","kind"],{before:"red",after:"blue"},"red")}}];let i={};for(let o=0;oxa(l,"lngLat",M));function N(O){t[9](O)}let B={draggable:!0,$$slots:{default:[IB]},$$scope:{ctx:t}};return t[2]!==void 0&&(B.lngLat=t[2]),S=new R_({props:B}),Gr.push(()=>xa(S,"lngLat",N)),{c(){e=pe("div"),A&&A.c(),n=je(),Ve(r.$$.fragment),i=je(),Ve(o.$$.fragment),c=je(),Ve(l.$$.fragment),y=je(),Ve(S.$$.fragment),Ce(e,"slot","map")},m(O,G){be(O,e,G),A&&A.m(e,null),te(e,n),Fe(r,e,null),te(e,i),Fe(o,e,null),te(e,c),Fe(l,e,null),te(e,y),Fe(S,e,null),C=!0},p(O,G){O[0]=="neighbourhood"?A?(A.p(O,G),G&1&&ne(A,1)):(A=uE(O),A.c(),ne(A,1),A.m(e,n)):A&&(Rn(),de(A,1,1,()=>{A=null}),Nn());const U={};G&32&&(U.data=O[5]),G&16384&&(U.$$scope={dirty:G,ctx:O}),o.$set(U);const Z={};G&16384&&(Z.$$scope={dirty:G,ctx:O}),!d&&G&8&&(d=!0,Z.lngLat=O[3],ba(()=>d=!1)),l.$set(Z);const ue={};G&16384&&(ue.$$scope={dirty:G,ctx:O}),!E&&G&4&&(E=!0,ue.lngLat=O[2],ba(()=>E=!1)),S.$set(ue)},i(O){C||(ne(A),ne(r.$$.fragment,O),ne(o.$$.fragment,O),ne(l.$$.fragment,O),ne(S.$$.fragment,O),C=!0)},o(O){de(A),de(r.$$.fragment,O),de(o.$$.fragment,O),de(l.$$.fragment,O),de(S.$$.fragment,O),C=!1},d(O){O&&ve(e),A&&A.d(),Be(r),Be(o),Be(l),Be(S)}}}function TB(t){let e,n;return e=new Eu({props:{$$slots:{map:[CB],sidebar:[wB],top:[xB]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&16511&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function LB(t,e,n){let r,i,o,c,l,d;wt(t,Tn,B=>n(6,i=B)),wt(t,S2,B=>n(1,o=B)),wt(t,Uv,B=>n(2,c=B)),wt(t,Vv,B=>n(3,l=B)),wt(t,Zi,B=>n(4,d=B));let{prevMode:y}=e;function S(){Ut(Tn,i={mode:y},i)}function E(B){l=B,Vv.set(l)}function C(B){c=B,Uv.set(c)}function A(){o=f1(this.value),S2.set(o)}const M=()=>Ut(Tn,i={mode:"title"},i),R=()=>Ut(Tn,i={mode:"network"},i),N=()=>Ut(Tn,i={mode:"neighbourhood"},i);return t.$$set=B=>{"prevMode"in B&&n(0,y=B.prevMode)},t.$$.update=()=>{t.$$.dirty&30&&n(5,r=JSON.parse(d.compareRoute(l.lng,l.lat,c.lng,c.lat,o)))},[y,o,c,l,d,r,i,S,E,C,A,M,R,N]}class PB extends Qt{constructor(e){super(),Jt(this,e,LB,TB,Ht,{prevMode:0})}}const MB="/ltn/assets/settings-342fb430.svg";function cE(t){let e,n;return e=new $_({props:{$$slots:{default:[kB]},$$scope:{ctx:t}}}),e.$on("close",t[3]),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&17&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function kB(t){let e,n,r,i,o,c,l,d,y;return r=new Bz({}),{c(){e=pe("h1"),e.textContent="Settings",n=je(),Ve(r.$$.fragment),i=je(),o=pe("center"),c=pe("button"),c.textContent="Confirm"},m(S,E){be(S,e,E),be(S,n,E),Fe(r,S,E),be(S,i,E),be(S,o,E),te(o,c),l=!0,d||(y=Lt(c,"click",t[2]),d=!0)},p:Mt,i(S){l||(ne(r.$$.fragment,S),l=!0)},o(S){de(r.$$.fragment,S),l=!1},d(S){S&&(ve(e),ve(n),ve(i),ve(o)),Be(r,S),d=!1,y()}}}function AB(t){let e,n,r,i,o,c,l=t[0]&&cE(t);return{c(){e=pe("button"),e.innerHTML=`Settings`,n=je(),l&&l.c(),r=ki(),Ce(e,"class","outline")},m(d,y){be(d,e,y),be(d,n,y),l&&l.m(d,y),be(d,r,y),i=!0,o||(c=Lt(e,"click",t[1]),o=!0)},p(d,[y]){d[0]?l?(l.p(d,y),y&1&&ne(l,1)):(l=cE(d),l.c(),ne(l,1),l.m(r.parentNode,r)):l&&(Rn(),de(l,1,1,()=>{l=null}),Nn())},i(d){i||(ne(l),i=!0)},o(d){de(l),i=!1},d(d){d&&(ve(e),ve(n),ve(r)),l&&l.d(d),o=!1,c()}}}function DB(t,e,n){let r=!1;return[r,()=>n(0,r=!0),()=>n(0,r=!1),()=>n(0,r=!1)]}class RB extends Qt{constructor(e){super(),Jt(this,e,DB,AB,Ht,{})}}let fp=Gn(null);const ha=Gn([]);function VT(t){if(t.length<3)return JSON.parse(rs(fp).inner.calculateRoute(t));let e=JSON.parse(JSON.stringify(t));e.push(e[0]);let n=JSON.parse(rs(fp).inner.calculateRoute(e));return n.properties.waypoints.pop(),n.geometry.type="Polygon",n.geometry.coordinates=[n.geometry.coordinates],n}const{window:NB}=X_,OB=t=>({}),hE=t=>({}),zB=t=>({}),fE=t=>({});function pE(t,e,n){const r=t.slice();return r[43]=e[n],r[44]=e,r[45]=n,r}function dE(t,e,n){const r=t.slice();return r[46]=e[n],r[47]=e,r[48]=n,r}function FB(t){let e,n;const r=t[24]["extra-top"],i=hr(r,t,t[37],hE);return{c(){e=pe("div"),i&&i.c(),Ce(e,"slot","top")},m(o,c){be(o,e,c),i&&i.m(e,null),n=!0},p(o,c){i&&i.p&&(!n||c[1]&64)&&pr(i,r,o,o[37],n?fr(r,o[37],c,OB):dr(o[37]),hE)},i(o){n||(ne(i,o),n=!0)},o(o){de(i,o),n=!1},d(o){o&&ve(e),i&&i.d(o)}}}function BB(t){let e,n,r,i,o;return{c(){e=pe("ul"),e.innerHTML=`
  • Click - the map to add new points, until there are at least 3 points
  • Click and drag - any point to move it
  • Click - a waypoint to toggle snapping
  • Right click - a waypoint to delete it
  • `,n=je(),r=pe("p"),r.textContent="Keyboard shortcuts:",i=je(),o=pe("ul"),o.innerHTML=`
  • s - to switch between snapping to roads and drawing anywhere
  • Control+Z - to undo your last change
  • Enter - or - Escape - to finish
  • From the main mode, 3 - to draw a new area
  • `},m(c,l){be(c,e,l),be(c,n,l),be(c,r,l),be(c,i,l),be(c,o,l)},p:Mt,d(c){c&&(ve(e),ve(n),ve(r),ve(i),ve(o))}}}function VB(t){let e,n=t[8].length+"",r,i;return{c(){e=nt("Undo ("),r=nt(n),i=nt(")")},m(o,c){be(o,e,c),be(o,r,c),be(o,i,c)},p(o,c){c[0]&256&&n!==(n=o[8].length+"")&&Kn(r,n)},d(o){o&&(ve(e),ve(r),ve(i))}}}function UB(t){let e;return{c(){e=nt("Undo")},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function jB(t){let e;return{c(){e=pe("p"),e.textContent="Drag to adjust. Click to toggle snapped. Right click to delete."},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function GB(t){let e,n,r,i,o,c,l,d,y,S,E,C,A;return E=BE(t[35][0]),{c(){e=pe("fieldset"),n=pe("label"),r=pe("input"),i=nt(` - Snap to roads`),o=je(),c=pe("label"),l=pe("input"),d=nt(` - Draw anywhere`),y=je(),S=pe("p"),S.textContent="Click to add at least 3 points",Ce(r,"type","radio"),r.__value="snap",qi(r,r.__value),Ce(l,"type","radio"),l.__value="free",qi(l,l.__value),E.p(r,l)},m(M,R){be(M,e,R),te(e,n),te(n,r),r.checked=r.__value===t[7],te(n,i),te(e,o),te(e,c),te(c,l),l.checked=l.__value===t[7],te(c,d),be(M,y,R),be(M,S,R),C||(A=[Lt(r,"change",t[34]),Lt(l,"change",t[36])],C=!0)},p(M,R){R[0]&128&&(r.checked=r.__value===M[7]),R[0]&128&&(l.checked=l.__value===M[7])},d(M){M&&(ve(e),ve(y),ve(S)),E.r(),C=!1,Hr(A)}}}function qB(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R,N,B;const O=t[24]["extra-sidebar"],G=hr(O,t,t[37],fE);S=new hb({props:{$$slots:{default:[BB]},$$scope:{ctx:t}}});function U(ke,K){return ke[8].length==0?UB:VB}let Z=U(t),ue=Z(t);function ae(ke,K){return ke[5].length<3?GB:jB}let se=ae(t),fe=se(t);return{c(){e=pe("div"),G&&G.c(),n=je(),r=pe("div"),i=pe("button"),o=nt("Finish"),l=je(),d=pe("button"),d.textContent="Cancel",y=je(),Ve(S.$$.fragment),E=je(),C=pe("button"),ue.c(),M=je(),fe.c(),i.disabled=c=t[5].length<3,Ce(d,"class","secondary"),gr(r,"display","flex"),Ce(C,"class","secondary"),C.disabled=A=t[8].length==0,Ce(e,"slot","sidebar")},m(ke,K){be(ke,e,K),G&&G.m(e,null),te(e,n),te(e,r),te(r,i),te(i,o),te(r,l),te(r,d),te(r,y),Fe(S,r,null),te(e,E),te(e,C),ue.m(C,null),te(e,M),fe.m(e,null),R=!0,N||(B=[Lt(i,"click",function(){Nf(t[0])&&t[0].apply(this,arguments)}),Lt(d,"click",function(){Nf(t[1])&&t[1].apply(this,arguments)}),Lt(C,"click",t[11])],N=!0)},p(ke,K){t=ke,G&&G.p&&(!R||K[1]&64)&&pr(G,O,t,t[37],R?fr(O,t[37],K,zB):dr(t[37]),fE),(!R||K[0]&32&&c!==(c=t[5].length<3))&&(i.disabled=c);const oe={};K[1]&64&&(oe.$$scope={dirty:K,ctx:t}),S.$set(oe),Z===(Z=U(t))&&ue?ue.p(t,K):(ue.d(1),ue=Z(t),ue&&(ue.c(),ue.m(C,null))),(!R||K[0]&256&&A!==(A=t[8].length==0))&&(C.disabled=A),se===(se=ae(t))&&fe?fe.p(t,K):(fe.d(1),fe=se(t),fe&&(fe.c(),fe.m(e,null)))},i(ke){R||(ne(G,ke),ne(S.$$.fragment,ke),R=!0)},o(ke){de(G,ke),de(S.$$.fragment,ke),R=!1},d(ke){ke&&ve(e),G&&G.d(ke),Be(S),ue.d(),fe.d(),N=!1,Hr(B)}}}function WB(t){let e;return{c(){e=pe("span"),Ce(e,"class","dot svelte-1cj4rwq"),no(e,"snapped-node",t[46].snapped),no(e,"free-node",!t[46].snapped),no(e,"hide",t[4])},m(n,r){be(n,e,r)},p(n,r){r[0]&512&&no(e,"snapped-node",n[46].snapped),r[0]&512&&no(e,"free-node",!n[46].snapped),r[0]&16&&no(e,"hide",n[4])},d(n){n&&ve(e)}}}function mE(t){let e,n,r;function i(d){t[25](d,t[46])}function o(){return t[26](t[46])}function c(){return t[27](t[46])}let l={draggable:!0,zIndex:0,$$slots:{default:[WB]},$$scope:{ctx:t}};return t[46].point!==void 0&&(l.lngLat=t[46].point),e=new R_({props:l}),Gr.push(()=>xa(e,"lngLat",i)),e.$on("dragstart",o),e.$on("drag",c),e.$on("dragend",t[19]),{c(){Ve(e.$$.fragment)},m(d,y){Fe(e,d,y),r=!0},p(d,y){t=d;const S={};y[0]&528|y[1]&64&&(S.$$scope={dirty:y,ctx:t}),!n&&y[0]&512&&(n=!0,S.lngLat=t[46].point,ba(()=>n=!1)),e.$set(S)},i(d){r||(ne(e.$$.fragment,d),r=!0)},o(d){de(e.$$.fragment,d),r=!1},d(d){Be(e,d)}}}function HB(t){let e;return{c(){e=pe("span"),e.textContent=`${t[45]+1}`,Ce(e,"class","dot svelte-1cj4rwq"),no(e,"snapped",t[43].snapped)},m(n,r){be(n,e,r)},p(n,r){r[0]&32&&no(e,"snapped",n[43].snapped)},d(n){n&&ve(e)}}}function gE(t){let e,n,r;function i(d){t[28](d,t[43])}function o(){return t[29](t[45])}function c(){return t[30](t[45])}let l={draggable:!0,zIndex:1,$$slots:{default:[HB]},$$scope:{ctx:t}};return t[43].point!==void 0&&(l.lngLat=t[43].point),e=new R_({props:l}),Gr.push(()=>xa(e,"lngLat",i)),e.$on("click",o),e.$on("contextmenu",c),e.$on("mouseenter",t[31]),e.$on("mouseleave",t[32]),e.$on("dragstart",t[21]),e.$on("dragend",t[33]),{c(){Ve(e.$$.fragment)},m(d,y){Fe(e,d,y),r=!0},p(d,y){t=d;const S={};y[0]&32|y[1]&64&&(S.$$scope={dirty:y,ctx:t}),!n&&y[0]&32&&(n=!0,S.lngLat=t[43].point,ba(()=>n=!1)),e.$set(S)},i(d){r||(ne(e.$$.fragment,d),r=!0)},o(d){de(e.$$.fragment,d),r=!1},d(d){Be(e,d)}}}function ZB(t){let e,n,r,i;const o=[Ti("draw-area-lines"),{paint:{"line-color":"black","line-width":10}}];let c={};for(let y=0;yde(E[N],1,1,()=>{E[N]=null});let A=Oi(t[5]),M=[];for(let N=0;Nde(M[N],1,1,()=>{M[N]=null});return c=new Fo({props:{data:t[16](t[6],t[5]),generateId:!0,$$slots:{default:[ZB]},$$scope:{ctx:t}}}),d=new Fo({props:{data:t[10],$$slots:{default:[XB]},$$scope:{ctx:t}}}),{c(){e=pe("div"),Ve(n.$$.fragment),r=je();for(let N=0;Nn(5,i=mt)),wt(t,fp,mt=>n(6,o=mt));let{$$slots:c={},$$scope:l}=e,{map:d}=e,{finish:y}=e,{cancel:S}=e;Hi(()=>{Ut(ha,i=[],i),o==null||o.stop(),d.getCanvas().style.cursor="inherit"});let E="snap",C=[],A=[],M=null,R=!1,N=!1,B=!1;function O(mt){let Dt=mt.length==0?"crosshair":"inherit";d.getCanvas().style.cursor=Dt}function G(){let mt=C.pop();n(8,C),mt&&Ut(ha,i=mt,i)}function U(){C.length==100&&C.shift(),n(8,C=[...C,JSON.parse(JSON.stringify(i))])}function Z(){n(7,E=E=="snap"?"free":"snap"),M&&n(23,M.snapped=E=="snap",M)}function ue(mt){i.length>=3||(U(),ha.update(Dt=>(Dt.push({point:mt.detail.lngLat.toArray(),snapped:E=="snap"}),Dt)))}function ae(mt){n(23,M={point:mt.detail.lngLat.toArray(),snapped:E=="snap"})}function se(mt){U(),ha.update(Dt=>(Dt[mt].snapped=!Dt[mt].snapped,Dt))}function fe(mt){U(),ha.update(Dt=>(Dt.splice(mt,1),Dt)),n(2,R=!1)}function ke(mt,Dt){try{if(mt)return VT(Dt)}catch{}return c_()}function K(mt,Dt,Sn,Le){if(Le||Dt.length>=3)return c_();try{if(mt&&Dt.length>0&&Sn)return JSON.parse(mt.inner.calculateRoute([Dt[Dt.length-1],Sn]))}catch{}return c_()}function oe(mt,Dt,Sn){if(Sn)return;if(!mt||Dt.length<3){n(9,A=[]);return}let Le=[],rt=1,gt=JSON.parse(JSON.stringify(Dt));gt.push(gt[0]);for(let Nt=0;Nt(Dt.splice(mt.insertIdx,0,{point:mt.point,snapped:mt.snapped}),Dt)),n(4,B=!0)}function Te(mt){ha.update(Dt=>(Dt[mt.insertIdx].point=mt.point,Dt))}function ot(){n(4,B=!1)}function ft(mt){let Dt=mt.target.tagName,Sn=Dt=="INPUT"||Dt=="TEXTAREA";mt.key=="Enter"&&!Sn||mt.key=="Escape"?(mt.stopPropagation(),i.length>=3?y():window.alert("You can't save this area unless it has at least three points. Press 'Cancel' to discard these changes.")):mt.key=="s"&&!Sn?Z():mt.key=="z"&&mt.ctrlKey&&(mt.stopPropagation(),G())}function At(){U(),n(3,N=!0)}const Ke=[[]];function Ft(mt,Dt){t.$$.not_equal(Dt.point,mt)&&(Dt.point=mt,n(9,A))}const bt=mt=>Ge(mt),Rt=mt=>Te(mt);function Ot(mt,Dt){t.$$.not_equal(Dt.point,mt)&&(Dt.point=mt,ha.set(i))}const ln=mt=>se(mt),Ln=mt=>fe(mt),an=()=>n(2,R=!0),Xt=()=>n(2,R=!1),En=()=>n(3,N=!1);function In(){E=this.__value,n(7,E)}function rr(){E=this.__value,n(7,E)}return t.$$set=mt=>{"map"in mt&&n(22,d=mt.map),"finish"in mt&&n(0,y=mt.finish),"cancel"in mt&&n(1,S=mt.cancel),"$$scope"in mt&&n(37,l=mt.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&112&&oe(o,i,B),t.$$.dirty[0]&8388716&&n(10,r=K(o,i,M,R||N)),t.$$.dirty[0]&32&&O(i)},[y,S,R,N,B,i,o,E,C,A,r,G,ue,ae,se,fe,ke,Ge,Te,ot,ft,At,d,M,c,Ft,bt,Rt,Ot,ln,Ln,an,Xt,En,In,Ke,rr,l]}class JB extends Qt{constructor(e){super(),Jt(this,e,KB,$B,Ht,{map:22,finish:0,cancel:1},null,[-1,-1])}}function QB(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function e8(t){let e;return{c(){e=nt("Pick neighbourhood")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function t8(t){let e;return{c(){e=pe("li"),e.textContent="Creating new neighbourhood boundary"},m(n,r){be(n,e,r)},p:Mt,i:Mt,o:Mt,d(n){n&&ve(e)}}}function n8(t){let e,n,r,i,o;return n=new mr({props:{$$slots:{default:[r8]},$$scope:{ctx:t}}}),n.$on("click",t[8]),{c(){e=pe("li"),Ve(n.$$.fragment),r=je(),i=pe("li"),i.textContent="Changing neighbourhood boundary"},m(c,l){be(c,e,l),Fe(n,e,null),be(c,r,l),be(c,i,l),o=!0},p(c,l){const d={};l&2048&&(d.$$scope={dirty:l,ctx:c}),n.$set(d)},i(c){o||(ne(n.$$.fragment,c),o=!0)},o(c){de(n.$$.fragment,c),o=!1},d(c){c&&(ve(e),ve(r),ve(i)),Be(n)}}}function r8(t){let e;return{c(){e=nt("Editing")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function i8(t){let e,n,r,i,o,c,l,d,y,S,E,C;o=new mr({props:{$$slots:{default:[QB]},$$scope:{ctx:t}}}),o.$on("click",t[6]),d=new mr({props:{$$slots:{default:[e8]},$$scope:{ctx:t}}}),d.$on("click",t[7]);const A=[n8,t8],M=[];function R(N,B){return N[1]?0:1}return S=R(t),E=M[S]=A[S](t),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),Ve(d.$$.fragment),y=je(),E.c(),Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","extra-top")},m(N,B){be(N,e,B),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),Fe(d,l,null),te(r,y),M[S].m(r,null),C=!0},p(N,B){const O={};B&2048&&(O.$$scope={dirty:B,ctx:N}),o.$set(O);const G={};B&2048&&(G.$$scope={dirty:B,ctx:N}),d.$set(G);let U=S;S=R(N),S===U?M[S].p(N,B):(Rn(),de(M[U],1,1,()=>{M[U]=null}),Nn(),E=M[S],E?E.p(N,B):(E=M[S]=A[S](N),E.c()),ne(E,1),E.m(r,null))},i(N){C||(ne(o.$$.fragment,N),ne(d.$$.fragment,N),ne(E),C=!0)},o(N){de(o.$$.fragment,N),de(d.$$.fragment,N),de(E),C=!1},d(N){N&&ve(e),Be(o),Be(d),M[S].d()}}}function o8(t){let e,n,r,i;return{c(){e=pe("div"),n=pe("h1"),r=nt("Draw your neighbourhood boundary for "),i=nt(t[0]),Ce(e,"slot","extra-sidebar")},m(o,c){be(o,e,c),te(e,n),te(n,r),te(n,i)},p(o,c){c&1&&Kn(i,o[0])},d(o){o&&ve(e)}}}function s8(t){let e,n;return e=new JB({props:{map:Vr(t[3]),finish:t[4],cancel:t[5],$$slots:{"extra-sidebar":[o8],"extra-top":[i8]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&8&&(o.map=Vr(r[3])),i&2055&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function a8(t,e,n){let r,i,o,c;wt(t,Tn,M=>n(2,r=M)),wt(t,Zi,M=>n(9,i=M)),wt(t,ha,M=>n(10,o=M)),wt(t,Pl,M=>n(3,c=M));let{name:l}=e,{existing:d}=e;d&&(d.properties.waypoints?Ut(ha,o=d.properties.waypoints.map(M=>({point:[M.lon,M.lat],snapped:M.snapped})),o):Ut(ha,o=d.geometry.coordinates[0].slice(1).map(M=>({point:M,snapped:!1})),o));function y(){if(o.length>=3)try{let M=VT(o);i.setNeighbourhoodBoundary(l,M),Vf(),i.setCurrentNeighbourhood(l),Ut(Tn,r={mode:"neighbourhood"},r)}catch{window.alert("Known georust bug hit, sorry. You may need to just refresh the page now."),S()}}function S(){d?Ut(Tn,r={mode:"neighbourhood"},r):Ut(Tn,r={mode:"network"},r)}const E=()=>Ut(Tn,r={mode:"title"},r),C=()=>Ut(Tn,r={mode:"network"},r),A=()=>Ut(Tn,r={mode:"neighbourhood"},r);return t.$$set=M=>{"name"in M&&n(0,l=M.name),"existing"in M&&n(1,d=M.existing)},[l,d,r,c,y,S,E,C,A]}class l8 extends Qt{constructor(e){super(),Jt(this,e,a8,s8,Ht,{name:0,existing:1})}}function u8(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function c8(t){let e;return{c(){e=nt("Pick neighbourhood")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function h8(t){let e,n,r,i,o,c,l,d,y,S,E;return o=new mr({props:{$$slots:{default:[u8]},$$scope:{ctx:t}}}),o.$on("click",t[10]),d=new mr({props:{$$slots:{default:[c8]},$$scope:{ctx:t}}}),d.$on("click",t[11]),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),Ve(d.$$.fragment),y=je(),S=pe("li"),S.textContent="Use an auto-generated boundary",Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top")},m(C,A){be(C,e,A),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),Fe(d,l,null),te(r,y),te(r,S),E=!0},p(C,A){const M={};A&16384&&(M.$$scope={dirty:A,ctx:C}),o.$set(M);const R={};A&16384&&(R.$$scope={dirty:A,ctx:C}),d.$set(R)},i(C){E||(ne(o.$$.fragment,C),ne(d.$$.fragment,C),E=!0)},o(C){de(o.$$.fragment,C),de(d.$$.fragment,C),E=!1},d(C){C&&ve(e),Be(o),Be(d)}}}function f8(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M,R,N,B;return n=new xy({}),n.$on("click",t[7]),{c(){e=pe("div"),Ve(n.$$.fragment),r=je(),i=pe("p"),i.textContent=`Click an area to use it as a neighbourhood. These are generated by finding - roads, railways, and water that form severances. There are many bugs; this - is experimental. The colors are arbitrary, just to distinguish better.`,o=je(),c=pe("button"),c.textContent="Export to GeoJSON",l=je(),d=pe("label"),y=nt(`Minimum area (km²) - `),S=pe("input"),E=je(),C=pe("label"),A=pe("input"),M=nt(` - Remove areas not touching a big road`),Ce(c,"class","secondary"),Ce(S,"type","number"),Ce(S,"min","0"),Ce(S,"max","1"),Ce(S,"step","0.01"),Ce(A,"type","checkbox"),Ce(e,"slot","sidebar")},m(O,G){be(O,e,G),Fe(n,e,null),te(e,r),te(e,i),te(e,o),te(e,c),te(e,l),te(e,d),te(d,y),te(d,S),qi(S,t[0]),te(e,E),te(e,C),te(C,A),A.checked=t[1],te(C,M),R=!0,N||(B=[Lt(c,"click",t[5]),Lt(S,"input",t[8]),Lt(A,"change",t[9])],N=!0)},p(O,G){G&1&&f1(S.value)!==O[0]&&qi(S,O[0]),G&2&&(A.checked=O[1])},i(O){R||(ne(n.$$.fragment,O),R=!0)},o(O){de(n.$$.fragment,O),R=!1},d(O){O&&ve(e),Be(n),N=!1,Hr(B)}}}function p8(t){let e,n,r=t[13].area_km2.toFixed(1)+"",i,o,c,l,d,y=t[13].touches_big_road+"",S,E,C=t[13].touches_railway+"",A,M,R=t[13].touches_waterway+"",N;return{c(){e=pe("p"),n=nt("Area: "),i=nt(r),o=nt(" km²"),c=je(),l=pe("p"),d=nt("Borders roads = "),S=nt(y),E=nt(", railway = "),A=nt(C),M=nt(`, - water = `),N=nt(R)},m(B,O){be(B,e,O),te(e,n),te(e,i),te(e,o),be(B,c,O),be(B,l,O),te(l,d),te(l,S),te(l,E),te(l,A),te(l,M),te(l,N)},p(B,O){O&8192&&r!==(r=B[13].area_km2.toFixed(1)+"")&&Kn(i,r),O&8192&&y!==(y=B[13].touches_big_road+"")&&Kn(S,y),O&8192&&C!==(C=B[13].touches_railway+"")&&Kn(A,C),O&8192&&R!==(R=B[13].touches_waterway+"")&&Kn(N,R)},d(B){B&&(ve(e),ve(c),ve(l))}}}function d8(t){let e,n;return e=new Iu({props:{openOn:"hover",$$slots:{default:[p8,({props:r})=>({13:r}),({props:r})=>r?8192:0]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&24576&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function m8(t){let e,n,r,i;const o=[Ti("auto-boundaries-areas"),{filter:t[6](t[0],t[1])},{manageHoverState:!0},{paint:{"fill-color":["match",["%",["id"],5],0,"blue",1,"yellow",2,"green",3,"purple",4,"orange","black"],"fill-opacity":Uf(.3,.7)}},{hoverCursor:"pointer"}];let c={$$slots:{default:[d8]},$$scope:{ctx:t}};for(let y=0;yn(2,r=N)),wt(t,Zi,N=>n(12,i=N));let o=JSON.parse(i.renderAutoBoundaries()),c=0,l=!0;function d(N){let B=window.prompt("What do you want to name the neighbourhood?");if(B)try{let O={type:"Feature",properties:{},geometry:o.features[N.detail.features[0].id].geometry};i.setNeighbourhoodBoundary(B,O),Vf(),i.setCurrentNeighbourhood(B),Ut(Tn,r={mode:"neighbourhood"},r)}catch(O){console.log(O),window.alert("Known georust bug hit, sorry. You may need to just refresh the page now.")}}function y(){d_("auto_boundaries.geojson",JSON.stringify(o,null," "))}function S(N,B){let O=["all",Sz,[">=",["get","area_km2"],N]];return B&&O.push(["get","touches_big_road"]),O}const E=()=>Ut(Tn,r={mode:"network"},r);function C(){c=f1(this.value),n(0,c)}function A(){l=this.checked,n(1,l)}return[c,l,r,o,d,y,S,E,C,A,()=>Ut(Tn,r={mode:"title"},r),()=>Ut(Tn,r={mode:"network"},r)]}class v8 extends Qt{constructor(e){super(),Jt(this,e,y8,_8,Ht,{})}}const b8=["==",["geometry-type"],"Polygon"],x8=["==",["geometry-type"],"LineString"],w8=["==",["geometry-type"],"Point"];function UT(){return{type:"FeatureCollection",features:[]}}function uv(t){return{type:"Feature",properties:{},geometry:{type:"Point",coordinates:jT(t)}}}function jT(t){return[Math.round(t[0]*1e7)/1e7,Math.round(t[1]*1e7)/1e7]}const GT=Gn(UT()),qT=Gn(0),S8=100;class E8{constructor(e){Ci(this,"map");Ci(this,"active");Ci(this,"eventListenersSuccess");Ci(this,"eventListenersUpdated");Ci(this,"eventListenersFailure");Ci(this,"points");Ci(this,"cursor");Ci(this,"hover");Ci(this,"dragFrom");Ci(this,"previousStates");Ci(this,"onMouseMove",e=>{if(this.active&&!this.dragFrom)this.recalculateHovering(e);else if(this.active&&this.dragFrom){if(this.hover=="polygon"){let n=this.dragFrom[0]-e.lngLat.lng,r=this.dragFrom[1]-e.lngLat.lat;for(let i of this.points)i[0]-=n,i[1]-=r}else this.points[this.hover]=e.lngLat.toArray();this.dragFrom=e.lngLat.toArray(),this.redraw()}});Ci(this,"onClick",e=>{if(this.beforeUpdate(),this.active&&this.cursor){let n=[];if(_E(this.points).forEach((r,i)=>{n.push([i+1,xR(r,this.cursor).properties.dist])}),n.sort((r,i)=>r[1]-i[1]),n.length>0){let r=n[0][0];this.points.splice(r,0,this.cursor.geometry.coordinates),this.hover=r}else this.points.push(this.cursor.geometry.coordinates),this.hover=this.points.length-1;this.redraw(),this.pointsUpdated()}else this.active&&typeof this.hover=="number"&&(this.points.splice(this.hover,1),this.hover=null,this.redraw(),this.pointsUpdated(),this.recalculateHovering(e))});Ci(this,"onDoubleClick",e=>{this.active&&(e.preventDefault(),this.cursor=uv(e.lngLat.toArray()),this.onClick(e),this.finish())});Ci(this,"onMouseDown",e=>{this.active&&!this.dragFrom&&this.hover!=null&&(e.preventDefault(),this.cursor=null,this.dragFrom=e.lngLat.toArray(),this.beforeUpdate(),this.redraw())});Ci(this,"onMouseUp",()=>{this.active&&this.dragFrom&&(this.dragFrom=null,this.redraw(),this.pointsUpdated())});Ci(this,"onKeypress",e=>{this.active&&(e.key=="Enter"?(e.stopPropagation(),this.finish()):e.key=="z"&&e.ctrlKey&&this.undo())});Ci(this,"onKeyDown",e=>{this.active&&e.key=="Escape"&&(e.stopPropagation(),this.cancel())});this.map=e,this.active=!1,this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[],this.points=[],this.cursor=null,this.hover=null,this.dragFrom=null,this.previousStates=[],this.map.on("mousemove",this.onMouseMove),this.map.on("click",this.onClick),this.map.on("dblclick",this.onDoubleClick),this.map.on("mousedown",this.onMouseDown),this.map.on("mouseup",this.onMouseUp),document.addEventListener("keypress",this.onKeypress),document.addEventListener("keydown",this.onKeyDown)}tearDown(){this.map.off("mousemove",this.onMouseMove),this.map.off("click",this.onClick),this.map.off("dblclick",this.onDoubleClick),this.map.off("mousedown",this.onMouseDown),this.map.off("mouseup",this.onMouseUp),document.removeEventListener("keypress",this.onKeypress),document.removeEventListener("keydown",this.onKeyDown)}finish(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersSuccess)n(e);else for(let n of this.eventListenersFailure)n();this.stop()}cancel(){for(let e of this.eventListenersFailure)e();this.stop()}addEventListenerSuccess(e){this.eventListenersSuccess.push(e)}addEventListenerUpdated(e){this.eventListenersUpdated.push(e)}addEventListenerFailure(e){this.eventListenersFailure.push(e)}clearEventListeners(){this.eventListenersSuccess=[],this.eventListenersUpdated=[],this.eventListenersFailure=[]}startNew(){this.active=!0,this.map.doubleClickZoom.disable()}editExisting(e){this.active=!0,this.map.doubleClickZoom.disable(),this.points=JSON.parse(JSON.stringify(e.geometry.coordinates[0])),this.points.pop(),this.redraw()}stop(){this.map.doubleClickZoom.enable(),this.points=[],this.cursor=null,this.active=!1,this.hover=null,this.dragFrom=null,this.previousStates=[],this.redraw(),this.map.getCanvas().style.cursor="inherit"}undo(){this.dragFrom!=null||this.previousStates.length==0||(this.points=this.previousStates.pop(),this.hover=null,this.redraw())}redraw(){let e=UT();this.points.forEach((i,o)=>{let c=uv(i);c.properties.hover=this.hover==o,c.properties.idx=o,e.features.push(c)}),e.features=e.features.concat(_E(this.points));let n=this.polygonFeature();n&&(n.properties.hover=this.hover=="polygon",e.features.push(n)),GT.set(e);let r="crosshair";this.hover!=null&&(r=this.dragFrom?"grabbing":"pointer"),this.map.getCanvas().style.cursor=r,qT.set(this.previousStates.length)}pointsUpdated(){let e=this.polygonFeature();if(e)for(let n of this.eventListenersUpdated)n(e)}recalculateHovering(e){this.cursor=null,this.hover=null;for(let n of this.map.queryRenderedFeatures(e.point,{layers:["edit-polygon-fill","edit-polygon-vertices"]}))if(n.geometry.type=="Polygon"){this.hover="polygon";break}else if(n.geometry.type=="Point"&&Object.hasOwn(n.properties,"idx")){this.hover=n.properties.idx;break}this.hover==null&&(this.cursor=uv(e.lngLat.toArray())),this.redraw()}polygonFeature(){if(this.points.length<3)return null;let e=this.points.map(jT),n=[JSON.parse(JSON.stringify(e))];return n[0].push(JSON.parse(JSON.stringify(n[0][0]))),{type:"Feature",geometry:{type:"Polygon",coordinates:n},properties:{}}}beforeUpdate(){this.previousStates.push(JSON.parse(JSON.stringify(this.points))),this.previousStates.length>S8&&this.previousStates.shift()}}function _E(t){let e=[];for(let n=0;n=3&&e.push({type:"Feature",geometry:{type:"LineString",coordinates:[t[t.length-1],t[0]]},properties:{}}),e}function I8(t){let e,n,r;return{c(){e=nt("Undo ("),n=nt(t[1]),r=nt(")")},m(i,o){be(i,e,o),be(i,n,o),be(i,r,o)},p(i,o){o&2&&Kn(n,i[1])},d(i){i&&(ve(e),ve(n),ve(r))}}}function C8(t){let e;return{c(){e=nt("Undo")},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function T8(t){let e,n,r,i,o,c,l,d,y,S,E;function C(R,N){return R[1]==0?C8:I8}let A=C(t),M=A(t);return{c(){e=pe("div"),n=pe("button"),n.textContent="Finish",r=je(),i=pe("button"),i.textContent="Cancel",o=je(),c=pe("button"),M.c(),d=je(),y=pe("ul"),y.innerHTML=`
  • Click - the map to add a vertex
  • Click - a vertex to delete it
  • Drag - a vertex or the polygon to move it
  • Press Control+Z - to undo your last change
  • Press Enter - or - double click - to finish
  • Press Escape - to cancel
  • `,c.disabled=l=t[1]==0,gr(e,"display","flex"),gr(e,"justify-content","space-between")},m(R,N){be(R,e,N),te(e,n),te(e,r),te(e,i),te(e,o),te(e,c),M.m(c,null),be(R,d,N),be(R,y,N),S||(E=[Lt(n,"click",t[2]),Lt(i,"click",t[3]),Lt(c,"click",t[4])],S=!0)},p(R,[N]){A===(A=C(R))&&M?M.p(R,N):(M.d(1),M=A(R),M&&(M.c(),M.m(c,null))),N&2&&l!==(l=R[1]==0)&&(c.disabled=l)},i:Mt,o:Mt,d(R){R&&(ve(e),ve(d),ve(y)),M.d(),S=!1,Hr(E)}}}function L8(t,e,n){let r;wt(t,qT,d=>n(1,r=d));let{polygonTool:i}=e;const o=()=>i.finish(),c=()=>i.cancel(),l=()=>i.undo();return t.$$set=d=>{"polygonTool"in d&&n(0,i=d.polygonTool)},[i,r,o,c,l]}class P8 extends Qt{constructor(e){super(),Jt(this,e,L8,T8,Ht,{polygonTool:0})}}let M8=Date.now();function Am(t){return`${t}-${M8++}`}const WT=Symbol.for("svelte-maplibre");function k8(){return UE(WT)}function yE(t){return{subscribe:t.subscribe}}function HT({key:t,setPopupTarget:e=!1,setCluster:n=!1,setMouseEvent:r=!1}){let i=k8(),o=Gn(null),c=yE(o),l={...i,[t]:yE(o)};if(e&&(l.popupTarget=c),r){let d=Gn(null);l.layerEvent=d,i.layerEvent=d}return n&&(l.cluster=Gn()),p1(WT,l),{...i,self:o}}function A8(){return HT({key:"source",setCluster:!0})}function D8(t=!0){return HT({key:"layer",setPopupTarget:t,setMouseEvent:t})}function vE(t){let e;return n=>{if(n)for(let r in n){let i=e==null?void 0:e[r],o=n[r];i!==o&&t(r,o,i)}else if(e)for(let r in e)t(r,void 0,e[r]);e=n}}function R8(t,...e){let n=[t];for(let r of e)if(r)Array.isArray(r)&&r[0]===t?n.push(...r.slice(1)):n.push(r);else continue;if(n.length!==1)return n.length===2?n[1]:n}function N8(t){return t===!0?["has","point_count"]:t===!1?["!",["has","point_count"]]:void 0}function bE(t){let e=t[0],n,r,i=xE(t);return{c(){i.c(),n=ki()},m(o,c){i.m(o,c),be(o,n,c),r=!0},p(o,c){c[0]&1&&Ht(e,e=o[0])?(Rn(),de(i,1,1,Mt),Nn(),i=xE(o),i.c(),ne(i,1),i.m(n.parentNode,n)):i.p(o,c)},i(o){r||(ne(i),r=!0)},o(o){de(i),r=!1},d(o){o&&ve(n),i.d(o)}}}function xE(t){let e;const n=t[36].default,r=hr(n,t,t[35],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o[1]&16)&&pr(r,n,i,i[35],e?fr(n,i[35],o,null):dr(i[35]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function O8(t){let e,n,r=t[0]&&bE(t);return{c(){r&&r.c(),e=ki()},m(i,o){r&&r.m(i,o),be(i,e,o),n=!0},p(i,o){i[0]?r?(r.p(i,o),o[0]&1&&ne(r,1)):(r=bE(i),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function z8(t,e,n){let r,i,o,c,l,d,y,S,E,C,A,M,{$$slots:R={},$$scope:N}=e,{id:B=Am("layer")}=e,{source:O=void 0}=e,{sourceLayer:G=void 0}=e,{beforeId:U=void 0}=e,{beforeLayerType:Z=void 0}=e,{type:ue}=e,{paint:ae=void 0}=e,{layout:se=void 0}=e,{filter:fe=void 0}=e,{applyToClusters:ke=void 0}=e,{minzoom:K=void 0}=e,{maxzoom:oe=void 0}=e,{manageHoverState:Ge=!1}=e,{hovered:Te=null}=e,{interactive:ot=!0}=e,{hoverCursor:ft=void 0}=e,{eventsIfTopMost:At=!1}=e;const Ke=zl(),{map:Ft,source:bt,self:Rt,minzoom:Ot,maxzoom:ln,eventTopMost:Ln,layerInfo:an}=D8();wt(t,Ft,Le=>n(31,E=Le)),wt(t,bt,Le=>n(32,C=Le)),wt(t,Rt,Le=>n(0,S=Le)),wt(t,Ot,Le=>n(34,M=Le)),wt(t,ln,Le=>n(33,A=Le)),Hi(()=>{S&&E&&(an.delete(S),E==null||E.removeLayer(S))});let Xt;function En(Le){var me,tn;if(!ot||!S||!E||At&&Ln(Le)!==S)return;let rt=Le.features??[],gt=(tn=(me=rt[0])==null?void 0:me.properties)==null?void 0:tn.cluster_id,Nt={event:Le,map:E,clusterId:gt,layer:S,source:l,features:rt};Ke(Le.type,Nt)}function In(Le){var me,tn;if(!ot||!S||!E||At&&Ln(Le)!==S)return;ft&&(E.getCanvas().style.cursor=ft);let rt=Le.features??[];n(6,Te=rt[0]??null);let gt=(tn=(me=rt[0])==null?void 0:me.properties)==null?void 0:tn.cluster_id;Ke("mouseenter",{event:Le,map:E,clusterId:gt,layer:S,source:l,features:rt})}function rr(Le){var me,tn,Xe;if(!ot||!E)return;if(At&&Ln(Le)!==S){n(6,Te=null),Ge&&Xt!==void 0&&(E==null||E.setFeatureState({source:l,sourceLayer:G,id:Xt},{hover:!1}),Xt=void 0);return}E.getCanvas().style.cursor=ft;let rt=Le.features??[],gt=(tn=(me=rt[0])==null?void 0:me.properties)==null?void 0:tn.cluster_id,Nt=(Xe=rt[0])==null?void 0:Xe.id;Nt!==Xt&&(Ge&&(Xt!==void 0&&(E==null||E.setFeatureState({source:l,id:Xt,sourceLayer:G},{hover:!1})),E==null||E.setFeatureState({source:l,id:Nt,sourceLayer:G},{hover:!0})),Xt=Nt,n(6,Te=rt[0]??null)),Ke("mousemove",{event:Le,map:E,clusterId:gt,layer:S,source:l,features:rt})}function mt(Le){if(!(!ot||!S||!E)){if(ft&&(E.getCanvas().style.cursor=""),n(6,Te=null),Ge&&Xt!==void 0){const rt={source:l,id:Xt,sourceLayer:G};E==null||E.setFeatureState(rt,{hover:!1}),Xt=void 0}Ke("mouseleave",{map:E,layer:S,source:l})}}let Dt=!0;function Sn(Le){E&&(E.off("click",Le,En),E.off("dblclick",Le,En),E.off("contextmenu",Le,En),E.off("mouseenter",Le,In),E.off("mousemove",Le,rr),E.off("mouseleave",Le,mt))}return Hi(()=>{E&&S&&Sn(S)}),t.$$set=Le=>{"id"in Le&&n(7,B=Le.id),"source"in Le&&n(8,O=Le.source),"sourceLayer"in Le&&n(9,G=Le.sourceLayer),"beforeId"in Le&&n(10,U=Le.beforeId),"beforeLayerType"in Le&&n(11,Z=Le.beforeLayerType),"type"in Le&&n(12,ue=Le.type),"paint"in Le&&n(13,ae=Le.paint),"layout"in Le&&n(14,se=Le.layout),"filter"in Le&&n(15,fe=Le.filter),"applyToClusters"in Le&&n(16,ke=Le.applyToClusters),"minzoom"in Le&&n(17,K=Le.minzoom),"maxzoom"in Le&&n(18,oe=Le.maxzoom),"manageHoverState"in Le&&n(19,Ge=Le.manageHoverState),"hovered"in Le&&n(6,Te=Le.hovered),"interactive"in Le&&n(20,ot=Le.interactive),"hoverCursor"in Le&&n(21,ft=Le.hoverCursor),"eventsIfTopMost"in Le&&n(22,At=Le.eventsIfTopMost),"$$scope"in Le&&n(35,N=Le.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&65536&&n(30,r=N8(ke)),t.$$.dirty[0]&1073774592&&n(24,i=R8("all",r,fe)),t.$$.dirty[0]&131072|t.$$.dirty[1]&8&&n(26,o=K??M),t.$$.dirty[0]&262144|t.$$.dirty[1]&4&&n(25,c=oe??A),t.$$.dirty[0]&256|t.$$.dirty[1]&2&&n(29,l=O||C),t.$$.dirty[0]&654343809|t.$$.dirty[1]&1&&E&&S!==B&&l){S&&(Sn(S),an.delete(S));let Le=U;if(!U&&Z){let rt=E.getStyle().layers,gt=typeof Z=="function"?Z:me=>me.type===Z,Nt=rt==null?void 0:rt.find(gt);Nt&&(Le=Nt.id)}Ut(Rt,S=B,S),E.addLayer(Kc({id:S,type:ue,source:l,"source-layer":G,filter:i,paint:ae,layout:se,minzoom:o,maxzoom:c}),Le),n(23,Dt=!0),E.on("click",S,En),E.on("dblclick",S,En),E.on("contextmenu",S,En),E.on("mouseenter",S,In),E.on("mousemove",S,rr),E.on("mouseleave",S,mt)}t.$$.dirty[0]&1048577&&S&&an.set(S,{interactive:ot}),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(28,d=S?vE((Le,rt)=>E==null?void 0:E.setPaintProperty(S,Le,rt)):void 0),t.$$.dirty[0]&1|t.$$.dirty[1]&1&&n(27,y=S?vE((Le,rt)=>E==null?void 0:E.setLayoutProperty(S,Le,rt)):void 0),t.$$.dirty[0]&268443648&&(d==null||d(ae)),t.$$.dirty[0]&134234112&&(y==null||y(se)),t.$$.dirty[0]&100663297|t.$$.dirty[1]&1&&S&&(E==null||E.setLayerZoomRange(S,o,c)),t.$$.dirty[0]&25165825|t.$$.dirty[1]&1&&S&&(Dt?n(23,Dt=!1):E==null||E.setFilter(S,i))},[S,Ft,bt,Rt,Ot,ln,Te,B,O,G,U,Z,ue,ae,se,fe,ke,K,oe,Ge,ot,ft,At,Dt,i,c,o,y,d,l,r,E,C,A,M,N,R]}class gb extends Qt{constructor(e){super(),Jt(this,e,z8,O8,Ht,{id:7,source:8,sourceLayer:9,beforeId:10,beforeLayerType:11,type:12,paint:13,layout:14,filter:15,applyToClusters:16,minzoom:17,maxzoom:18,manageHoverState:19,hovered:6,interactive:20,hoverCursor:21,eventsIfTopMost:22},null,[-1,-1])}}function F8(t){let e;const n=t[16].default,r=hr(n,t,t[24],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&16777216)&&pr(r,n,i,i[24],e?fr(n,i[24],o,null):dr(i[24]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function B8(t){let e,n,r;function i(c){t[17](c)}let o={id:t[1],type:"circle",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],applyToClusters:t[9],minzoom:t[10],maxzoom:t[11],hoverCursor:t[12],manageHoverState:t[13],eventsIfTopMost:t[14],interactive:t[15],$$slots:{default:[F8]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new gb({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[18]),e.$on("dblclick",t[19]),e.$on("contextmenu",t[20]),e.$on("mouseenter",t[21]),e.$on("mousemove",t[22]),e.$on("mouseleave",t[23]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.applyToClusters=c[9]),l&1024&&(d.minzoom=c[10]),l&2048&&(d.maxzoom=c[11]),l&4096&&(d.hoverCursor=c[12]),l&8192&&(d.manageHoverState=c[13]),l&16384&&(d.eventsIfTopMost=c[14]),l&32768&&(d.interactive=c[15]),l&16777216&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function V8(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=Am("circle")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{applyToClusters:A=void 0}=e,{minzoom:M=void 0}=e,{maxzoom:R=void 0}=e,{hoverCursor:N=void 0}=e,{manageHoverState:B=!1}=e,{hovered:O=null}=e,{eventsIfTopMost:G=!1}=e,{interactive:U=!0}=e;function Z(oe){O=oe,n(0,O)}function ue(oe){xn.call(this,t,oe)}function ae(oe){xn.call(this,t,oe)}function se(oe){xn.call(this,t,oe)}function fe(oe){xn.call(this,t,oe)}function ke(oe){xn.call(this,t,oe)}function K(oe){xn.call(this,t,oe)}return t.$$set=oe=>{"id"in oe&&n(1,o=oe.id),"source"in oe&&n(2,c=oe.source),"sourceLayer"in oe&&n(3,l=oe.sourceLayer),"beforeId"in oe&&n(4,d=oe.beforeId),"beforeLayerType"in oe&&n(5,y=oe.beforeLayerType),"paint"in oe&&n(6,S=oe.paint),"layout"in oe&&n(7,E=oe.layout),"filter"in oe&&n(8,C=oe.filter),"applyToClusters"in oe&&n(9,A=oe.applyToClusters),"minzoom"in oe&&n(10,M=oe.minzoom),"maxzoom"in oe&&n(11,R=oe.maxzoom),"hoverCursor"in oe&&n(12,N=oe.hoverCursor),"manageHoverState"in oe&&n(13,B=oe.manageHoverState),"hovered"in oe&&n(0,O=oe.hovered),"eventsIfTopMost"in oe&&n(14,G=oe.eventsIfTopMost),"interactive"in oe&&n(15,U=oe.interactive),"$$scope"in oe&&n(24,i=oe.$$scope)},[O,o,c,l,d,y,S,E,C,A,M,R,N,B,G,U,r,Z,ue,ae,se,fe,ke,K,i]}class U8 extends Qt{constructor(e){super(),Jt(this,e,V8,B8,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,applyToClusters:9,minzoom:10,maxzoom:11,hoverCursor:12,manageHoverState:13,hovered:0,eventsIfTopMost:14,interactive:15})}}function j8(t){let e;const n=t[15].default,r=hr(n,t,t[23],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&8388608)&&pr(r,n,i,i[23],e?fr(n,i[23],o,null):dr(i[23]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function G8(t){let e,n,r;function i(c){t[16](c)}let o={id:t[1],type:"fill",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[j8]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new gb({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.minzoom=c[9]),l&1024&&(d.maxzoom=c[10]),l&2048&&(d.hoverCursor=c[11]),l&4096&&(d.manageHoverState=c[12]),l&8192&&(d.eventsIfTopMost=c[13]),l&16384&&(d.interactive=c[14]),l&8388608&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function q8(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=Am("fill")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{minzoom:A=void 0}=e,{maxzoom:M=void 0}=e,{hoverCursor:R=void 0}=e,{manageHoverState:N=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(K){B=K,n(0,B)}function Z(K){xn.call(this,t,K)}function ue(K){xn.call(this,t,K)}function ae(K){xn.call(this,t,K)}function se(K){xn.call(this,t,K)}function fe(K){xn.call(this,t,K)}function ke(K){xn.call(this,t,K)}return t.$$set=K=>{"id"in K&&n(1,o=K.id),"source"in K&&n(2,c=K.source),"sourceLayer"in K&&n(3,l=K.sourceLayer),"beforeId"in K&&n(4,d=K.beforeId),"beforeLayerType"in K&&n(5,y=K.beforeLayerType),"paint"in K&&n(6,S=K.paint),"layout"in K&&n(7,E=K.layout),"filter"in K&&n(8,C=K.filter),"minzoom"in K&&n(9,A=K.minzoom),"maxzoom"in K&&n(10,M=K.maxzoom),"hoverCursor"in K&&n(11,R=K.hoverCursor),"manageHoverState"in K&&n(12,N=K.manageHoverState),"hovered"in K&&n(0,B=K.hovered),"eventsIfTopMost"in K&&n(13,O=K.eventsIfTopMost),"interactive"in K&&n(14,G=K.interactive),"$$scope"in K&&n(23,i=K.$$scope)},[B,o,c,l,d,y,S,E,C,A,M,R,N,O,G,r,U,Z,ue,ae,se,fe,ke,i]}class W8 extends Qt{constructor(e){super(),Jt(this,e,q8,G8,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function H8(t,e,n,r,i){let o=!1;t.getSource(e)&&(o=!0,t.removeSource(e));const c=()=>{r(e)&&(t.addSource(e,n),i())};if(o){const l=()=>{e&&(t.getSource(e)?setTimeout(l,1):c())};l()}else c()}function Z8(t,e,n){qE().then(()=>{let r=rs(t);if(!r)return;r.getSource(e)===n&&r.removeSource(e)})}function wE(t){let e=t[0],n,r,i=SE(t);return{c(){i.c(),n=ki()},m(o,c){i.m(o,c),be(o,n,c),r=!0},p(o,c){c&1&&Ht(e,e=o[0])?(Rn(),de(i,1,1,Mt),Nn(),i=SE(o),i.c(),ne(i,1),i.m(n.parentNode,n)):i.p(o,c)},i(o){r||(ne(i),r=!0)},o(o){de(i),r=!1},d(o){o&&ve(n),i.d(o)}}}function SE(t){let e;const n=t[15].default,r=hr(n,t,t[14],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&16384)&&pr(r,n,i,i[14],e?fr(n,i[14],o,null):dr(i[14]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function X8(t){let e,n,r=t[0]&&wE(t);return{c(){r&&r.c(),e=ki()},m(i,o){r&&r.m(i,o),be(i,e,o),n=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&ne(r,1)):(r=wE(i),r.c(),ne(r,1),r.m(e.parentNode,e)):r&&(Rn(),de(r,1,1,()=>{r=null}),Nn())},i(i){n||(ne(r),n=!0)},o(i){de(r),n=!1},d(i){i&&ve(e),r&&r.d(i)}}}function Y8(t,e,n){let r,i,o,{$$slots:c={},$$scope:l}=e,{id:d=Am("geojson")}=e,{data:y}=e,{generateId:S=!1}=e,{promoteId:E=void 0}=e,{filter:C=void 0}=e,{lineMetrics:A=void 0}=e,{cluster:M=void 0}=e;const{map:R,cluster:N,self:B}=A8();wt(t,R,U=>n(13,i=U)),wt(t,N,U=>n(16,o=U)),wt(t,B,U=>n(0,r=U));let O,G=!0;return Hi(()=>{r&&O&&i&&(Z8(R,r,O),Ut(B,r=null,r),n(11,O=void 0))}),t.$$set=U=>{"id"in U&&n(4,d=U.id),"data"in U&&n(5,y=U.data),"generateId"in U&&n(6,S=U.generateId),"promoteId"in U&&n(7,E=U.promoteId),"filter"in U&&n(8,C=U.filter),"lineMetrics"in U&&n(9,A=U.lineMetrics),"cluster"in U&&n(10,M=U.cluster),"$$scope"in U&&n(14,l=U.$$scope)},t.$$.update=()=>{t.$$.dirty&1024&&Ut(N,o=M,o),t.$$.dirty&12273&&i&&r!==d&&(Ut(B,r=d,r),H8(i,r,Kc({type:"geojson",data:y,filter:C,lineMetrics:A,generateId:S,promoteId:E,cluster:!!M,clusterMinPoints:M==null?void 0:M.minPoints,clusterMaxZoom:M==null?void 0:M.maxZoom,clusterRadius:M==null?void 0:M.radius,clusterProperties:M==null?void 0:M.properties}),U=>i&&U===r,()=>{r&&(n(11,O=i==null?void 0:i.getSource(r)),n(12,G=!0))})),t.$$.dirty&8208&&(i==null||i.on("style.load",()=>{n(11,O=i==null?void 0:i.getSource(d))})),t.$$.dirty&6176&&O&&(G?n(12,G=!1):O.setData(y)),t.$$.dirty&3072&&(O==null||O.setClusterOptions(Kc({cluster:!!M,clusterMaxZoom:M==null?void 0:M.maxZoom,clusterRadius:M==null?void 0:M.radius})))},[r,R,N,B,d,y,S,E,C,A,M,O,G,i,l,c]}class $8 extends Qt{constructor(e){super(),Jt(this,e,Y8,X8,Ht,{id:4,data:5,generateId:6,promoteId:7,filter:8,lineMetrics:9,cluster:10})}}function K8(t){let e;const n=t[15].default,r=hr(n,t,t[23],null);return{c(){r&&r.c()},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&8388608)&&pr(r,n,i,i[23],e?fr(n,i[23],o,null):dr(i[23]),null)},i(i){e||(ne(r,i),e=!0)},o(i){de(r,i),e=!1},d(i){r&&r.d(i)}}}function J8(t){let e,n,r;function i(c){t[16](c)}let o={id:t[1],type:"line",source:t[2],sourceLayer:t[3],beforeId:t[4],beforeLayerType:t[5],paint:t[6],layout:t[7],filter:t[8],minzoom:t[9],maxzoom:t[10],hoverCursor:t[11],manageHoverState:t[12],eventsIfTopMost:t[13],interactive:t[14],$$slots:{default:[K8]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.hovered=t[0]),e=new gb({props:o}),Gr.push(()=>xa(e,"hovered",i)),e.$on("click",t[17]),e.$on("dblclick",t[18]),e.$on("contextmenu",t[19]),e.$on("mouseenter",t[20]),e.$on("mousemove",t[21]),e.$on("mouseleave",t[22]),{c(){Ve(e.$$.fragment)},m(c,l){Fe(e,c,l),r=!0},p(c,[l]){const d={};l&2&&(d.id=c[1]),l&4&&(d.source=c[2]),l&8&&(d.sourceLayer=c[3]),l&16&&(d.beforeId=c[4]),l&32&&(d.beforeLayerType=c[5]),l&64&&(d.paint=c[6]),l&128&&(d.layout=c[7]),l&256&&(d.filter=c[8]),l&512&&(d.minzoom=c[9]),l&1024&&(d.maxzoom=c[10]),l&2048&&(d.hoverCursor=c[11]),l&4096&&(d.manageHoverState=c[12]),l&8192&&(d.eventsIfTopMost=c[13]),l&16384&&(d.interactive=c[14]),l&8388608&&(d.$$scope={dirty:l,ctx:c}),!n&&l&1&&(n=!0,d.hovered=c[0],ba(()=>n=!1)),e.$set(d)},i(c){r||(ne(e.$$.fragment,c),r=!0)},o(c){de(e.$$.fragment,c),r=!1},d(c){Be(e,c)}}}function Q8(t,e,n){let{$$slots:r={},$$scope:i}=e,{id:o=Am("line")}=e,{source:c=void 0}=e,{sourceLayer:l=void 0}=e,{beforeId:d=void 0}=e,{beforeLayerType:y=void 0}=e,{paint:S}=e,{layout:E=void 0}=e,{filter:C=void 0}=e,{minzoom:A=void 0}=e,{maxzoom:M=void 0}=e,{hoverCursor:R=void 0}=e,{manageHoverState:N=!1}=e,{hovered:B=null}=e,{eventsIfTopMost:O=!1}=e,{interactive:G=!0}=e;function U(K){B=K,n(0,B)}function Z(K){xn.call(this,t,K)}function ue(K){xn.call(this,t,K)}function ae(K){xn.call(this,t,K)}function se(K){xn.call(this,t,K)}function fe(K){xn.call(this,t,K)}function ke(K){xn.call(this,t,K)}return t.$$set=K=>{"id"in K&&n(1,o=K.id),"source"in K&&n(2,c=K.source),"sourceLayer"in K&&n(3,l=K.sourceLayer),"beforeId"in K&&n(4,d=K.beforeId),"beforeLayerType"in K&&n(5,y=K.beforeLayerType),"paint"in K&&n(6,S=K.paint),"layout"in K&&n(7,E=K.layout),"filter"in K&&n(8,C=K.filter),"minzoom"in K&&n(9,A=K.minzoom),"maxzoom"in K&&n(10,M=K.maxzoom),"hoverCursor"in K&&n(11,R=K.hoverCursor),"manageHoverState"in K&&n(12,N=K.manageHoverState),"hovered"in K&&n(0,B=K.hovered),"eventsIfTopMost"in K&&n(13,O=K.eventsIfTopMost),"interactive"in K&&n(14,G=K.interactive),"$$scope"in K&&n(23,i=K.$$scope)},[B,o,c,l,d,y,S,E,C,A,M,R,N,O,G,r,U,Z,ue,ae,se,fe,ke,i]}class e7 extends Qt{constructor(e){super(),Jt(this,e,Q8,J8,Ht,{id:1,source:2,sourceLayer:3,beforeId:4,beforeLayerType:5,paint:6,layout:7,filter:8,minzoom:9,maxzoom:10,hoverCursor:11,manageHoverState:12,hovered:0,eventsIfTopMost:13,interactive:14})}}function t7(t){let e,n,r,i,o,c;return e=new W8({props:{id:"edit-polygon-fill",filter:b8,paint:{"fill-color":"red","fill-opacity":["case",["boolean",["get","hover"],"false"],1,.5]}}}),r=new e7({props:{id:"edit-polygon-lines",filter:x8,paint:{"line-color":"black","line-width":8,"line-opacity":.5}}}),o=new U8({props:{id:"edit-polygon-vertices",filter:w8,paint:{"circle-color":"black","circle-opacity":["case",["has","hovered"],1,.5],"circle-radius":10}}}),{c(){Ve(e.$$.fragment),n=je(),Ve(r.$$.fragment),i=je(),Ve(o.$$.fragment)},m(l,d){Fe(e,l,d),be(l,n,d),Fe(r,l,d),be(l,i,d),Fe(o,l,d),c=!0},p:Mt,i(l){c||(ne(e.$$.fragment,l),ne(r.$$.fragment,l),ne(o.$$.fragment,l),c=!0)},o(l){de(e.$$.fragment,l),de(r.$$.fragment,l),de(o.$$.fragment,l),c=!1},d(l){l&&(ve(n),ve(i)),Be(e,l),Be(r,l),Be(o,l)}}}function n7(t){let e,n;return e=new $8({props:{data:t[0],$$slots:{default:[t7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&1&&(o.data=r[0]),i&2&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function r7(t,e,n){let r;return wt(t,GT,i=>n(0,r=i)),[r]}class i7 extends Qt{constructor(e){super(),Jt(this,e,r7,n7,Ht,{})}}function o7(t){let e,n,r,i,o,c,l;return{c(){e=pe("button"),e.textContent="Import current view",n=je(),r=pe("i"),r.textContent="or...",i=je(),o=pe("button"),o.textContent="Draw an area to import on the map",Ce(e,"type","button"),Ce(o,"type","button")},m(d,y){be(d,e,y),be(d,n,y),be(d,r,y),be(d,i,y),be(d,o,y),c||(l=[Lt(e,"click",t[2]),Lt(o,"click",t[3])],c=!0)},p:Mt,i:Mt,o:Mt,d(d){d&&(ve(e),ve(n),ve(r),ve(i),ve(o)),c=!1,Hr(l)}}}function s7(t){let e,n;return e=new P8({props:{polygonTool:t[0]}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&1&&(o.polygonTool=r[0]),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function a7(t){let e,n,r,i,o,c,l,d,y;const S=[s7,o7],E=[];function C(A,M){return A[0]?0:1}return e=C(t),n=E[e]=S[e](t),{c(){n.c(),r=je(),i=pe("label"),o=pe("input"),c=nt(`Save a copy of the osm.xml - after importing`),Ce(o,"type","checkbox")},m(A,M){E[e].m(A,M),be(A,r,M),be(A,i,M),te(i,o),o.checked=t[1],te(i,c),l=!0,d||(y=Lt(o,"change",t[5]),d=!0)},p(A,[M]){let R=e;e=C(A),e===R?E[e].p(A,M):(Rn(),de(E[R],1,1,()=>{E[R]=null}),Nn(),n=E[e],n?n.p(A,M):(n=E[e]=S[e](A),n.c()),ne(n,1),n.m(r.parentNode,r)),M&2&&(o.checked=A[1])},i(A){l||(ne(n),l=!0)},o(A){de(n),l=!1},d(A){A&&(ve(r),ve(i)),E[e].d(A),d=!1,y()}}}function Md(t){return[t.lng,t.lat]}function l7(t,e,n){let{map:r}=e;const i=zl();let o=null,c=!1;async function l(C){try{i("loading","Loading from Overpass");let M=await(await fetch(ZT(C))).text();c&&d_("osm.xml",M),i("gotXml",{xml:M,boundary:C})}catch(A){i("error",A.toString())}}function d(){let C=r.getBounds();return{type:"Feature",properties:{},geometry:{coordinates:[[Md(C.getSouthWest()),Md(C.getNorthWest()),Md(C.getNorthEast()),Md(C.getSouthEast()),Md(C.getSouthWest())]],type:"Polygon"}}}async function y(){if(r){if(r.getZoom()<13){i("error","Zoom in more to import");return}await l(d())}}function S(){r&&(n(0,o=new E8(r)),o.startNew(),o.addEventListenerSuccess(async C=>{n(0,o=null),await l(C)}),o.addEventListenerFailure(()=>{n(0,o=null)}))}function E(){c=this.checked,n(1,c)}return t.$$set=C=>{"map"in C&&n(4,r=C.map)},[o,c,y,S,r,E]}class u7 extends Qt{constructor(e){super(),Jt(this,e,l7,a7,Ht,{map:4})}}function ZT(t){let e='poly:"';for(let[r,i]of t.geometry.coordinates[0])e+=`${i} ${r} `;return e=e.slice(0,-1)+'"',`https://overpass-api.de/api/interpreter?data=${`(nwr(${e}); node(w)->.x; <;); out meta;`}`}async function c1(t){nc.set(t);try{let e=JSON.parse(window.localStorage.getItem(t));console.time("get OSM input");let[n,r]=await c7(e);console.timeEnd("get OSM input"),console.time("load"),Zi.set(new YE(new Uint8Array(n),r,e.study_area_name||void 0)),rs(Zi).loadSavefile(e),console.timeEnd("load"),XT()}catch(e){window.alert(`Couldn't open project: ${e}`),nc.set("")}}async function c7(t){if(t.study_area_name){let e=rs(nm)?`/osm/${t.study_area_name}.pbf`:`https://assets.od2net.org/severance_pbfs/${t.study_area_name}.pbf`;console.log(`Grabbing ${e}`);let r=await(await fetch(e)).arrayBuffer(),i=rs(nm)?`/boundaries/${t.study_area_name}.geojson`:`https://assets.od2net.org/boundaries/${t.study_area_name}.geojson`,c=await(await fetch(i)).json();return[r,c]}else{console.log("Grabbing from Overpass");let e=t.features.find(i=>i.properties.kind=="study_area_boundary");return[await(await fetch(ZT(e))).arrayBuffer(),e]}}function XT(){Tn.set({mode:"network"}),fp.set(new SR(rs(Pl),rs(Zi).toRouteSnapper(),Gn(c_()),Gn(!0),Gn(0))),rs(Pl).fitBounds(Array.from(rs(Zi).getBounds()),{animate:!1}),Vv.set(EE()),Uv.set(EE())}function EE(){let t=rs(Zi).getBounds(),e=t[0]+Math.random()*(t[2]-t[0]),n=t[1]+Math.random()*(t[3]-t[1]);return new Q_.LngLat(e,n)}function IE(t,e,n){const r=t.slice();return r[18]=e[n][0],r[19]=e[n][1],r}function CE(t,e,n){const r=t.slice();return r[22]=e[n],r}function h7(t){let e;return{c(){e=pe("div"),e.innerHTML='',Ce(e,"slot","top")},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function f7(t){let e;return{c(){e=pe("p"),e.textContent="Waiting for MapLibre and WASM to load..."},m(n,r){be(n,e,r)},p:Mt,i:Mt,o:Mt,d(n){n&&ve(e)}}}function p7(t){let e,n,r,i,o,c,l,d,y,S,E,C,A;n=new mr({props:{$$slots:{default:[d7]},$$scope:{ctx:t}}}),n.$on("click",t[10]);let M=Oi(t[2].entries()),R=[];for(let B=0;Bde(R[B],1,1,()=>{R[B]=null});return{c(){e=pe("div"),Ve(n.$$.fragment),r=je(),i=pe("p"),i.textContent="Load a saved project:",o=je(),c=pe("ul");for(let B=0;B`,c=je(),l=pe("button"),l.innerHTML=`Delete project`,d=je(),Ce(o,"class","secondary"),Ce(l,"class","secondary"),gr(n,"display","flex"),gr(n,"justify-content","space-between")},m(R,N){be(R,e,N),te(e,n),Fe(r,n,null),te(n,i),te(n,o),te(n,c),te(n,l),te(e,d),y=!0,S||(E=[Lt(o,"click",A),Lt(l,"click",M)],S=!0)},p(R,N){t=R;const B={};N&33554436&&(B.$$scope={dirty:N,ctx:t}),r.$set(B)},i(R){y||(ne(r.$$.fragment,R),y=!0)},o(R){de(r.$$.fragment,R),y=!1},d(R){R&&ve(e),Be(r),S=!1,Hr(E)}}}function LE(t){let e,n=(t[18]??"custom area")+"",r,i,o,c,l=Oi(t[19]),d=[];for(let S=0;Sde(d[S],1,1,()=>{d[S]=null});return{c(){e=pe("u"),r=nt(n),i=je();for(let S=0;S{c[S]=null}),Nn(),r=c[n],r?r.p(d,y):(r=c[n]=o[n](d),r.c()),ne(r,1),r.m(e,null))},i(d){i||(ne(r),i=!0)},o(d){de(r),i=!1},d(d){d&&ve(e),c[n].d()}}}function _7(t){let e,n,r,i;return e=new HE({props:{loading:t[1]}}),r=new Eu({props:{$$slots:{sidebar:[g7],top:[h7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment),n=je(),Ve(r.$$.fragment)},m(o,c){Fe(e,o,c),be(o,n,c),Fe(r,o,c),i=!0},p(o,[c]){const l={};c&2&&(l.loading=o[1]),e.$set(l);const d={};c&33554493&&(d.$$scope={dirty:c,ctx:o}),r.$set(d)},i(o){i||(ne(e.$$.fragment,o),ne(r.$$.fragment,o),i=!0)},o(o){de(e.$$.fragment,o),de(r.$$.fragment,o),i=!1},d(o){o&&ve(n),Be(e,o),Be(r,o)}}}function $g(){let t=new Map;for(let e=0;en(15,r=Z)),wt(t,fp,Z=>n(16,i=Z)),wt(t,Zi,Z=>n(17,o=Z)),wt(t,Pl,Z=>n(4,c=Z)),wt(t,Tn,Z=>n(5,l=Z));let{wasmReady:d}=e,y="";Ut(Zi,o=null,o),Ut(fp,i=null,i),Ut(nc,r="",r);let S=$g(),E;async function C(Z){let ue="ltn_"+E.files[0].name;n(1,y=`Loading from file ${ue}`),window.localStorage.setItem(ue,await E.files[0].text()),n(2,S=$g()),await c1(ue),n(1,y="")}function A(Z){window.confirm(`Really delete project ${Z}? You can't undo this.`)&&(window.localStorage.removeItem(Z),n(2,S=$g()))}function M(Z){let ue=window.prompt(`Rename project ${Z} to what?`,Z);if(ue){ue.startsWith("ltn_")||(ue=`ltn_${ue}`);let ae=window.localStorage.getItem(Z);window.localStorage.setItem(ue,ae),window.localStorage.removeItem(Z),n(2,S=$g())}}async function R(Z){n(1,y=`Loading project ${Z}`),await c1(Z),n(1,y="")}const N=()=>Ut(Tn,l={mode:"new-project"},l),B=Z=>R(Z),O=Z=>M(Z),G=Z=>A(Z);function U(Z){Gr[Z?"unshift":"push"](()=>{E=Z,n(3,E)})}return t.$$set=Z=>{"wasmReady"in Z&&n(0,d=Z.wasmReady)},[d,y,S,E,c,l,C,A,M,R,N,B,O,G,U]}class v7 extends Qt{constructor(e){super(),Jt(this,e,y7,_7,Ht,{wasmReady:0})}}function PE(t,e,n){const r=t.slice();return r[17]=e[n][0],r[18]=e[n][1],r}function ME(t,e,n){const r=t.slice();return r[21]=e[n][0],r[22]=e[n][1],r}function b7(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function x7(t){let e,n,r,i,o,c,l,d;return o=new mr({props:{$$slots:{default:[b7]},$$scope:{ctx:t}}}),o.$on("click",t[13]),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),l.textContent="New project",Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top")},m(y,S){be(y,e,S),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),d=!0},p(y,S){const E={};S&33554432&&(E.$$scope={dirty:S,ctx:y}),o.$set(E)},i(y){d||(ne(o.$$.fragment,y),d=!0)},o(y){de(o.$$.fragment,y),d=!1},d(y){y&&ve(e),Be(o)}}}function kE(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M;e=new HE({props:{loading:t[4]}});let R=Oi(t[3]),N=[];for(let B=0;Bt[9].call(o))},m(B,O){Fe(e,B,O),be(B,n,O),be(B,r,O),te(r,i),te(r,o),te(o,c);for(let G=0;G{S=null}),Nn())},i(E){l||(ne(S),l=!0)},o(E){de(S),l=!1},d(E){E&&ve(e),S&&S.d(),d=!1,y()}}}function S7(t){let e,n,r;return n=new i7({}),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"slot","map")},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p:Mt,i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function E7(t){let e,n;return e=new Eu({props:{$$slots:{map:[S7],sidebar:[w7],top:[x7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,[i]){const o={};i&33554558&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function I7(t,e,n){let r,i,o,c,l;wt(t,nc,U=>n(14,r=U)),wt(t,Zi,U=>n(15,i=U)),wt(t,nm,U=>n(16,o=U)),wt(t,Pl,U=>n(5,c=U)),wt(t,Tn,U=>n(6,l=U));let d="",y="",S=[],E="";Y_(async()=>{let U=await fetch(o?"/osm/areas.json":"https://assets.od2net.org/severance_pbfs/areas.json");n(3,S=await U.json())});function C(U){n(4,E="Loading OSM");try{Ut(Zi,i=new YE(new TextEncoder().encode(U.detail.xml),U.detail.boundary,void 0),i),Ut(nc,r=`ltn_${d}`,r),XT(),Vf()}catch(Z){window.alert(`Couldn't import from Overpass: ${Z}`)}n(4,E="")}async function A(){if(y=="")return;let U=`ltn_${d}`;window.localStorage.setItem(U,JSON.stringify({type:"FeatureCollection",features:[],study_area_name:y})),n(4,E=`Loading pre-clipped OSM area ${y}`),await c1(U),n(4,E="")}function M(){d=this.value,n(1,d)}function R(){y=VE(this),n(2,y),n(3,S)}return[A,d,y,S,E,c,l,C,M,R,()=>A(),U=>n(4,E=U.detail),U=>window.alert(U.detail),()=>Ut(Tn,l={mode:"title"},l)]}class C7 extends Qt{constructor(e){super(),Jt(this,e,I7,E7,Ht,{loadExample:0})}get loadExample(){return this.$$.ctx[0]}}const{window:T7}=X_;function L7(t){let e;return{c(){e=nt("Choose project")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function P7(t){let e;return{c(){e=nt("Pick neighbourhood")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function M7(t){let e;return{c(){e=nt("Editing")},m(n,r){be(n,e,r)},d(n){n&&ve(e)}}}function k7(t){let e,n,r,i,o,c,l,d,y,S,E,C,A,M;return o=new mr({props:{$$slots:{default:[L7]},$$scope:{ctx:t}}}),o.$on("click",t[9]),d=new mr({props:{$$slots:{default:[P7]},$$scope:{ctx:t}}}),d.$on("click",t[10]),E=new mr({props:{$$slots:{default:[M7]},$$scope:{ctx:t}}}),E.$on("click",t[5]),{c(){e=pe("div"),n=pe("nav"),r=pe("ul"),i=pe("li"),Ve(o.$$.fragment),c=je(),l=pe("li"),Ve(d.$$.fragment),y=je(),S=pe("li"),Ve(E.$$.fragment),C=je(),A=pe("li"),A.textContent="Viewing shortcuts",Ce(n,"aria-label","breadcrumb"),Ce(e,"slot","top")},m(R,N){be(R,e,N),te(e,n),te(n,r),te(r,i),Fe(o,i,null),te(r,c),te(r,l),Fe(d,l,null),te(r,y),te(r,S),Fe(E,S,null),te(r,C),te(r,A),M=!0},p(R,N){const B={};N&8192&&(B.$$scope={dirty:N,ctx:R}),o.$set(B);const O={};N&8192&&(O.$$scope={dirty:N,ctx:R}),d.$set(O);const G={};N&8192&&(G.$$scope={dirty:N,ctx:R}),E.$set(G)},i(R){M||(ne(o.$$.fragment,R),ne(d.$$.fragment,R),ne(E.$$.fragment,R),M=!0)},o(R){de(o.$$.fragment,R),de(d.$$.fragment,R),de(E.$$.fragment,R),M=!1},d(R){R&&ve(e),Be(o),Be(d),Be(E)}}}function A7(t){let e,n,r,i,o,c,l,d,y,S=t[0].shortcutIndex+1+"",E,C,A=t[0].gj.features.length+"",M,R,N,B,O,G,U,Z,ue,ae=Vr(t[0].gj.features[t[0].shortcutIndex].properties).directness.toFixed(1)+"",se,fe,ke,K,oe;return{c(){e=pe("p"),e.textContent=`This shows all possible shortcuts crossing the blue road you've chosen. - A shortcut is defined as a route starting and ending outside the - neighbourhood, but cutting through it. It might not actually be - considered a "good shortcut" in practice -- this tool doesn't know any - real traffic patterns; it's just looking for any possible path. This - view lets you understand the limits of this assumption.`,n=je(),r=pe("button"),r.textContent="Pick a different road",i=je(),o=pe("div"),c=pe("button"),l=nt("Previous"),y=je(),E=nt(S),C=nt(" / "),M=nt(A),R=je(),N=pe("button"),B=nt("Next"),G=je(),U=pe("p"),Z=nt("This shortcut is "),ue=pe("b"),se=nt(ae),fe=nt("x"),ke=nt(` - the length of the shortest route using all roads, not just this neighbourhood`),c.disabled=d=t[0].shortcutIndex==0,Ce(c,"data-tooltip","Left"),N.disabled=O=t[0].shortcutIndex==t[0].gj.features.length-1,Ce(N,"data-tooltip","Right"),gr(o,"display","flex"),gr(o,"justify-content","space-between")},m(Ge,Te){be(Ge,e,Te),be(Ge,n,Te),be(Ge,r,Te),be(Ge,i,Te),be(Ge,o,Te),te(o,c),te(c,l),te(o,y),te(o,E),te(o,C),te(o,M),te(o,R),te(o,N),te(N,B),be(Ge,G,Te),be(Ge,U,Te),te(U,Z),te(U,ue),te(ue,se),te(ue,fe),te(U,ke),K||(oe=[Lt(r,"click",t[8]),Lt(c,"click",t[6]),Lt(N,"click",t[7])],K=!0)},p(Ge,Te){Te&1&&d!==(d=Ge[0].shortcutIndex==0)&&(c.disabled=d),Te&1&&S!==(S=Ge[0].shortcutIndex+1+"")&&Kn(E,S),Te&1&&A!==(A=Ge[0].gj.features.length+"")&&Kn(M,A),Te&1&&O!==(O=Ge[0].shortcutIndex==Ge[0].gj.features.length-1)&&(N.disabled=O),Te&1&&ae!==(ae=Vr(Ge[0].gj.features[Ge[0].shortcutIndex].properties).directness.toFixed(1)+"")&&Kn(se,ae)},d(Ge){Ge&&(ve(e),ve(n),ve(r),ve(i),ve(o),ve(G),ve(U)),K=!1,Hr(oe)}}}function D7(t){let e;return{c(){e=pe("p"),e.textContent="Click a road to see shortcuts"},m(n,r){be(n,e,r)},p:Mt,d(n){n&&ve(e)}}}function R7(t){let e,n,r,i;n=new xy({}),n.$on("click",t[5]);function o(d,y){if(d[0].state=="neutral")return D7;if(d[0].state=="chose-road")return A7}let c=o(t),l=c&&c(t);return{c(){e=pe("div"),Ve(n.$$.fragment),r=je(),l&&l.c(),Ce(e,"slot","sidebar")},m(d,y){be(d,e,y),Fe(n,e,null),te(e,r),l&&l.m(e,null),i=!0},p(d,y){c===(c=o(d))&&l?l.p(d,y):(l&&l.d(1),l=c&&c(d),l&&(l.c(),l.m(e,null)))},i(d){i||(ne(n.$$.fragment,d),i=!0)},o(d){de(n.$$.fragment,d),i=!1},d(d){d&&ve(e),Be(n),l&&l.d()}}}function N7(t){let e,n,r,i,o,c;return e=new Fo({props:{data:l1(JSON.parse(Vr(t[2]).renderNeighbourhood())),$$slots:{default:[z7]},$$scope:{ctx:t}}}),r=new Fo({props:{data:t[0].gj.features[t[0].shortcutIndex],$$slots:{default:[F7]},$$scope:{ctx:t}}}),o=new Fo({props:{data:t[0].roadGj,$$slots:{default:[B7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment),n=je(),Ve(r.$$.fragment),i=je(),Ve(o.$$.fragment)},m(l,d){Fe(e,l,d),be(l,n,d),Fe(r,l,d),be(l,i,d),Fe(o,l,d),c=!0},p(l,d){const y={};d&4&&(y.data=l1(JSON.parse(Vr(l[2]).renderNeighbourhood()))),d&8192&&(y.$$scope={dirty:d,ctx:l}),e.$set(y);const S={};d&1&&(S.data=l[0].gj.features[l[0].shortcutIndex]),d&8192&&(S.$$scope={dirty:d,ctx:l}),r.$set(S);const E={};d&1&&(E.data=l[0].roadGj),d&8192&&(E.$$scope={dirty:d,ctx:l}),o.$set(E)},i(l){c||(ne(e.$$.fragment,l),ne(r.$$.fragment,l),ne(o.$$.fragment,l),c=!0)},o(l){de(e.$$.fragment,l),de(r.$$.fragment,l),de(o.$$.fragment,l),c=!1},d(l){l&&(ve(n),ve(i)),Be(e,l),Be(r,l),Be(o,l)}}}function O7(t){let e,n;return e=new wy({props:{gjInput:JSON.parse(Vr(t[2]).renderNeighbourhood()),onClickLine:t[3],$$slots:{"line-popup":[U7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&4&&(o.gjInput=JSON.parse(Vr(r[2]).renderNeighbourhood())),i&8192&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function z7(t){let e,n;const r=[Ti("cells"),{filter:["==",["get","kind"],"cell"]},{paint:{"fill-color":["get","color"],"fill-opacity":.3}}];let i={};for(let o=0;o({12:i}),({props:i})=>i?4096:0]},$$scope:{ctx:t}}}),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"slot","line-popup")},m(i,o){be(i,e,o),Fe(n,e,null),r=!0},p(i,o){const c={};o&12288&&(c.$$scope={dirty:o,ctx:i}),n.$set(c)},i(i){r||(ne(n.$$.fragment,i),r=!0)},o(i){de(n.$$.fragment,i),r=!1},d(i){i&&ve(e),Be(n)}}}function j7(t){let e,n,r,i,o,c;const l=[O7,N7],d=[];function y(S,E){return S[0].state=="neutral"?0:S[0].state=="chose-road"?1:-1}return~(n=y(t))&&(r=d[n]=l[n](t)),o=new Sy({}),{c(){e=pe("div"),r&&r.c(),i=je(),Ve(o.$$.fragment),Ce(e,"slot","map")},m(S,E){be(S,e,E),~n&&d[n].m(e,null),te(e,i),Fe(o,e,null),c=!0},p(S,E){let C=n;n=y(S),n===C?~n&&d[n].p(S,E):(r&&(Rn(),de(d[C],1,1,()=>{d[C]=null}),Nn()),~n?(r=d[n],r?r.p(S,E):(r=d[n]=l[n](S),r.c()),ne(r,1),r.m(e,i)):r=null)},i(S){c||(ne(r),ne(o.$$.fragment,S),c=!0)},o(S){de(r),de(o.$$.fragment,S),c=!1},d(S){S&&ve(e),~n&&d[n].d(),Be(o)}}}function G7(t){let e,n,r,i;return e=new Eu({props:{$$slots:{map:[j7],sidebar:[R7],top:[k7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment)},m(o,c){Fe(e,o,c),n=!0,r||(i=Lt(T7,"keydown",t[4]),r=!0)},p(o,[c]){const l={};c&8199&&(l.$$scope={dirty:c,ctx:o}),e.$set(l)},i(o){n||(ne(e.$$.fragment,o),n=!0)},o(o){de(e.$$.fragment,o),n=!1},d(o){Be(e,o),r=!1,i()}}}function q7(t,e,n){let r,i,o;wt(t,Tn,R=>n(1,r=R)),wt(t,Pl,R=>n(11,i=R)),wt(t,Zi,R=>n(2,o=R));let c={state:"neutral"};function l(R,N){let B=JSON.parse(o.getShortcutsCrossingRoad(R.properties.id));if(B.features.length==0){window.alert("No shortcuts here");return}n(0,c={state:"chose-road",roadGj:R,gj:B,shortcutIndex:0})}Y_(()=>{i==null||i.keyboard.disable()}),Hi(()=>{i==null||i.keyboard.enable()});function d(R){c.state=="chose-road"&&(R.key=="ArrowLeft"&&c.shortcutIndex>0&&(R.stopPropagation(),n(0,c.shortcutIndex--,c)),R.key=="ArrowRight"&&(R.stopPropagation(),c.shortcutIndex!=c.gj.features.length-1&&n(0,c.shortcutIndex++,c)))}function y(){Ut(Tn,r={mode:"neighbourhood"},r)}function S(){c.state=="chose-road"&&n(0,c.shortcutIndex--,c)}function E(){c.state=="chose-road"&&n(0,c.shortcutIndex++,c)}return[c,r,o,l,d,y,S,E,()=>n(0,c={state:"neutral"}),()=>Ut(Tn,r={mode:"title"},r),()=>Ut(Tn,r={mode:"network"},r)]}class W7 extends Qt{constructor(e){super(),Jt(this,e,q7,G7,Ht,{})}}function H7(t){let e,n,r,i,o,c,l,d,y;return i=new RB({}),{c(){e=pe("div"),n=pe("button"),n.innerHTML=`A/B Street logo`,r=je(),Ve(i.$$.fragment),o=je(),c=pe("span"),Ce(n,"class","outline"),gr(c,"width","100%"),Ce(e,"slot","top"),gr(e,"display","flex")},m(S,E){be(S,e,E),te(e,n),te(e,r),Fe(i,e,null),te(e,o),te(e,c),t[19](c),l=!0,d||(y=Lt(n,"click",t[18]),d=!0)},p:Mt,i(S){l||(ne(i.$$.fragment,S),l=!0)},o(S){de(i.$$.fragment,S),l=!1},d(S){S&&ve(e),Be(i),t[19](null),d=!1,y()}}}function RE(t){let e,n,r,i,o,c;return r=new a6({props:{map:Vr(t[6]),maptilerBasemap:t[7]}}),{c(){e=pe("button"),e.textContent="Zoom to fit study area",n=je(),Ve(r.$$.fragment),Ce(e,"class","secondary")},m(l,d){be(l,e,d),be(l,n,d),Fe(r,l,d),i=!0,o||(c=Lt(e,"click",t[10]),o=!0)},p(l,d){const y={};d&64&&(y.map=Vr(l[6])),d&128&&(y.maptilerBasemap=l[7]),r.$set(y)},i(l){i||(ne(r.$$.fragment,l),i=!0)},o(l){de(r.$$.fragment,l),i=!1},d(l){l&&(ve(e),ve(n)),Be(r,l),o=!1,c()}}}function Z7(t){let e,n,r,i,o,c,l=t[5]&&RE(t);return{c(){e=pe("div"),n=pe("div"),r=je(),i=pe("hr"),o=je(),l&&l.c(),Ce(e,"slot","left")},m(d,y){be(d,e,y),te(e,n),t[17](n),te(e,r),te(e,i),te(e,o),l&&l.m(e,null),c=!0},p(d,y){d[5]?l?(l.p(d,y),y&32&&ne(l,1)):(l=RE(d),l.c(),ne(l,1),l.m(e,null)):l&&(Rn(),de(l,1,1,()=>{l=null}),Nn())},i(d){c||(ne(l),c=!0)},o(d){de(l),c=!1},d(d){d&&ve(e),t[17](null),l&&l.d()}}}function X7(t){let e,n;return e=new C7({}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p:Mt,i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function Y7(t){let e,n;return e=new v7({props:{wasmReady:t[4]}}),{c(){Ve(e.$$.fragment)},m(r,i){Fe(e,r,i),n=!0},p(r,i){const o={};i&16&&(o.wasmReady=r[4]),e.$set(o)},i(r){n||(ne(e.$$.fragment,r),n=!0)},o(r){de(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function NE(t){let e,n,r,i,o,c;e=new Fo({props:{data:JSON.parse(t[5].getInvertedBoundary()),$$slots:{default:[$7]},$$scope:{ctx:t}}});const l=[r9,n9,t9,e9,Q7,J7,K7],d=[];function y(S,E){return S[8].mode=="network"?0:S[8].mode=="set-boundary"?1:S[8].mode=="auto-boundaries"?2:S[8].mode=="neighbourhood"?3:S[8].mode=="view-shortcuts"?4:S[8].mode=="route"?5:S[8].mode=="debug"?6:-1}return~(r=y(t))&&(i=d[r]=l[r](t)),{c(){Ve(e.$$.fragment),n=je(),i&&i.c(),o=ki()},m(S,E){Fe(e,S,E),be(S,n,E),~r&&d[r].m(S,E),be(S,o,E),c=!0},p(S,E){const C={};E&32&&(C.data=JSON.parse(S[5].getInvertedBoundary())),E&2097152&&(C.$$scope={dirty:E,ctx:S}),e.$set(C);let A=r;r=y(S),r===A?~r&&d[r].p(S,E):(i&&(Rn(),de(d[A],1,1,()=>{d[A]=null}),Nn()),~r?(i=d[r],i?i.p(S,E):(i=d[r]=l[r](S),i.c()),ne(i,1),i.m(o.parentNode,o)):i=null)},i(S){c||(ne(e.$$.fragment,S),ne(i),c=!0)},o(S){de(e.$$.fragment,S),de(i),c=!1},d(S){S&&(ve(n),ve(o)),Be(e,S),~r&&d[r].d(S)}}}function $7(t){let e,n;const r=[Ti("boundary"),{paint:{"fill-color":"black","fill-opacity":.3}}];let i={};for(let o=0;o{C[O]=null}),Nn()),~o?(c=C[o],c?c.p(R,N):(c=C[o]=E[o](R),c.c()),ne(c,1),c.m(l.parentNode,l)):c=null),R[5]?M?(M.p(R,N),N&32&&ne(M,1)):(M=NE(R),M.c(),ne(M,1),M.m(d.parentNode,d)):M&&(Rn(),de(M,1,1,()=>{M=null}),Nn())},i(R){S||(ne(e.$$.fragment,R),ne(c),ne(M),ne(y.$$.fragment,R),S=!0)},o(R){de(e.$$.fragment,R),de(c),de(M),de(y.$$.fragment,R),S=!1},d(R){R&&(ve(n),ve(r),ve(i),ve(l),ve(d)),Be(e,R),t[14](null),~o&&C[o].d(R),M&&M.d(R),Be(y,R)}}}function o9(t){let e,n,r,i;function o(l){t[15](l)}let c={style:`https://api.maptiler.com/maps/${t[7]}/style.json?key=${Fv}`,standardControls:!0,hash:!0,images:[{id:"walk_cycle_only",url:"/ltn//filters/walk_cycle_only_icon.gif"},{id:"no_entry",url:"/ltn//filters/no_entry_icon.gif"},{id:"bus_gate",url:"/ltn//filters/bus_gate_icon.gif"},{id:"school_street",url:"/ltn//filters/school_street_icon.gif"},{id:"oneway-arrow",url:LR}],$$slots:{default:[i9]},$$scope:{ctx:t}};return t[0]!==void 0&&(c.map=t[0]),n=new bN({props:c}),Gr.push(()=>xa(n,"map",o)),n.$on("error",t[16]),{c(){e=pe("div"),Ve(n.$$.fragment),Ce(e,"slot","main"),gr(e,"position","relative"),gr(e,"width","100%"),gr(e,"height","100%")},m(l,d){be(l,e,d),Fe(n,e,null),i=!0},p(l,d){const y={};d&128&&(y.style=`https://api.maptiler.com/maps/${l[7]}/style.json?key=${Fv}`),d&2097465&&(y.$$scope={dirty:d,ctx:l}),!r&&d&1&&(r=!0,y.map=l[0],ba(()=>r=!1)),n.$set(y)},i(l){i||(ne(n.$$.fragment,l),i=!0)},o(l){de(n.$$.fragment,l),i=!1},d(l){l&&ve(e),Be(n)}}}function s9(t){let e,n,r,i;return e=new TR({}),r=new kz({props:{$$slots:{main:[o9],left:[Z7],top:[H7]},$$scope:{ctx:t}}}),{c(){Ve(e.$$.fragment),n=je(),Ve(r.$$.fragment)},m(o,c){Fe(e,o,c),be(o,n,c),Fe(r,o,c),i=!0},p(o,[c]){const l={};c&2098175&&(l.$$scope={dirty:c,ctx:o}),r.$set(l)},i(o){i||(ne(e.$$.fragment,o),ne(r.$$.fragment,o),i=!0)},o(o){de(e.$$.fragment,o),de(r.$$.fragment,o),i=!1},d(o){o&&ve(n),Be(e,o),Be(r,o)}}}function a9(t,e,n){let r,i,o,c,l,d,y,S,E;wt(t,a1,se=>n(11,r=se)),wt(t,s1,se=>n(12,i=se)),wt(t,o1,se=>n(13,o=se)),wt(t,Zi,se=>n(5,c=se)),wt(t,Pl,se=>n(6,l=se)),wt(t,nm,se=>n(20,d=se)),wt(t,Bv,se=>n(7,y=se)),wt(t,Tn,se=>n(8,S=se)),wt(t,D_,se=>n(9,E=se));let C=!1;Y_(async()=>{await $E(),await eI(),n(4,C=!0);try{(await fetch("/osm/areas.json")).ok&&(Ut(nm,d=!0,d),console.log("Using local cache, not od2net.org"))}catch{}});let A;function M(){l.fitBounds(Array.from(c.getBounds()),{animate:!1})}let R,N,B;function O(se){Gr[se?"unshift":"push"](()=>{B=se,n(3,B),n(11,r)})}function G(se){A=se,n(0,A)}const U=se=>{console.log(se.detail.error)};function Z(se){Gr[se?"unshift":"push"](()=>{N=se,n(2,N),n(12,i)})}const ue=()=>Ut(D_,E=!0,E);function ae(se){Gr[se?"unshift":"push"](()=>{R=se,n(1,R),n(13,o)})}return t.$$.update=()=>{t.$$.dirty&1&&A&&Pl.set(A),t.$$.dirty&8194&&R&&o&&(n(1,R.innerHTML="",R),R.appendChild(o)),t.$$.dirty&4100&&N&&i&&(n(2,N.innerHTML="",N),N.appendChild(i)),t.$$.dirty&2056&&B&&r&&(n(3,B.innerHTML="",B),B.appendChild(r))},[A,R,N,B,C,c,l,y,S,E,M,r,i,o,O,G,U,Z,ue,ae]}class l9 extends Qt{constructor(e){super(),Jt(this,e,a9,s9,Ht,{})}}new l9({target:document.getElementById("app")}); diff --git a/index.html b/index.html index 2400f7e..6b51a90 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ The low-traffic neighbourhood (LTN) tool, v2 - - + +