ogm-viewer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  4. package/dist/cjs/index-DQQaalxf.js +1421 -0
  5. package/dist/cjs/index-DQQaalxf.js.map +1 -0
  6. package/dist/cjs/index.cjs.js +5 -0
  7. package/dist/cjs/index.cjs.js.map +1 -0
  8. package/dist/cjs/loader.cjs.js +16 -0
  9. package/dist/cjs/loader.cjs.js.map +1 -0
  10. package/dist/cjs/ogm-menubar.ogm-metadata.ogm-sidebar.ogm-viewer.entry.cjs.js.map +1 -0
  11. package/dist/cjs/ogm-menubar_4.cjs.entry.js +3573 -0
  12. package/dist/cjs/ogm-menubar_4.cjs.entry.js.map +1 -0
  13. package/dist/cjs/ogm-viewer.cjs.js +28 -0
  14. package/dist/cjs/ogm-viewer.cjs.js.map +1 -0
  15. package/dist/collection/assets/icons/braces.svg +3 -0
  16. package/dist/collection/assets/icons/c-circle.svg +3 -0
  17. package/dist/collection/assets/icons/info-circle-fill.svg +3 -0
  18. package/dist/collection/assets/icons/link-45deg.svg +4 -0
  19. package/dist/collection/assets/icons/list.svg +3 -0
  20. package/dist/collection/collection-manifest.json +15 -0
  21. package/dist/collection/components/ogm-menubar/ogm-menubar.css +26 -0
  22. package/dist/collection/components/ogm-menubar/ogm-menubar.js +70 -0
  23. package/dist/collection/components/ogm-menubar/ogm-menubar.js.map +1 -0
  24. package/dist/collection/components/ogm-metadata/ogm-metadata.css +505 -0
  25. package/dist/collection/components/ogm-metadata/ogm-metadata.js +136 -0
  26. package/dist/collection/components/ogm-metadata/ogm-metadata.js.map +1 -0
  27. package/dist/collection/components/ogm-sidebar/ogm-sidebar.css +538 -0
  28. package/dist/collection/components/ogm-sidebar/ogm-sidebar.js +92 -0
  29. package/dist/collection/components/ogm-sidebar/ogm-sidebar.js.map +1 -0
  30. package/dist/collection/components/ogm-viewer/ogm-viewer.css +516 -0
  31. package/dist/collection/components/ogm-viewer/ogm-viewer.js +155 -0
  32. package/dist/collection/components/ogm-viewer/ogm-viewer.js.map +1 -0
  33. package/dist/collection/index.js +2 -0
  34. package/dist/collection/index.js.map +1 -0
  35. package/dist/collection/utils/record.js +186 -0
  36. package/dist/collection/utils/record.js.map +1 -0
  37. package/dist/collection/utils/references.js +80 -0
  38. package/dist/collection/utils/references.js.map +1 -0
  39. package/dist/collection/utils/sources.js +121 -0
  40. package/dist/collection/utils/sources.js.map +1 -0
  41. package/dist/collection/utils/utils.js +15 -0
  42. package/dist/collection/utils/utils.js.map +1 -0
  43. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  44. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  45. package/dist/esm/index-ChIbGKue.js +1411 -0
  46. package/dist/esm/index-ChIbGKue.js.map +1 -0
  47. package/dist/esm/index.js +4 -0
  48. package/dist/esm/index.js.map +1 -0
  49. package/dist/esm/loader.js +14 -0
  50. package/dist/esm/loader.js.map +1 -0
  51. package/dist/esm/ogm-menubar.ogm-metadata.ogm-sidebar.ogm-viewer.entry.js.map +1 -0
  52. package/dist/esm/ogm-menubar_4.entry.js +3568 -0
  53. package/dist/esm/ogm-menubar_4.entry.js.map +1 -0
  54. package/dist/esm/ogm-viewer.js +24 -0
  55. package/dist/esm/ogm-viewer.js.map +1 -0
  56. package/dist/index.cjs.js +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/ogm-viewer/index.esm.js +2 -0
  59. package/dist/ogm-viewer/index.esm.js.map +1 -0
  60. package/dist/ogm-viewer/loader.esm.js.map +1 -0
  61. package/dist/ogm-viewer/ogm-menubar.ogm-metadata.ogm-sidebar.ogm-viewer.entry.esm.js.map +1 -0
  62. package/dist/ogm-viewer/ogm-viewer.esm.js +2 -0
  63. package/dist/ogm-viewer/ogm-viewer.esm.js.map +1 -0
  64. package/dist/ogm-viewer/p-601c9fec.entry.js +769 -0
  65. package/dist/ogm-viewer/p-601c9fec.entry.js.map +1 -0
  66. package/dist/ogm-viewer/p-ChIbGKue.js +3 -0
  67. package/dist/ogm-viewer/p-ChIbGKue.js.map +1 -0
  68. package/dist/ogm-viewer/p-DQuL1Twl.js +2 -0
  69. package/dist/ogm-viewer/p-DQuL1Twl.js.map +1 -0
  70. package/dist/types/components/ogm-menubar/ogm-menubar.d.ts +7 -0
  71. package/dist/types/components/ogm-metadata/ogm-metadata.d.ts +17 -0
  72. package/dist/types/components/ogm-sidebar/ogm-sidebar.d.ts +16 -0
  73. package/dist/types/components/ogm-viewer/ogm-viewer.d.ts +19 -0
  74. package/dist/types/components.d.ts +122 -0
  75. package/dist/types/index.d.ts +10 -0
  76. package/dist/types/stencil-public-runtime.d.ts +1702 -0
  77. package/dist/types/utils/record.d.ts +153 -0
  78. package/dist/types/utils/references.d.ts +47 -0
  79. package/dist/types/utils/sources.d.ts +3 -0
  80. package/dist/types/utils/utils.d.ts +1 -0
  81. package/loader/cdn.js +1 -0
  82. package/loader/index.cjs.js +1 -0
  83. package/loader/index.d.ts +24 -0
  84. package/loader/index.es2017.js +1 -0
  85. package/loader/index.js +2 -0
  86. package/package.json +54 -0
  87. package/readme.md +4 -0
@@ -0,0 +1,769 @@
1
+ import{r as t,c as e,h as i,H as r,g as s,a as o}from"./p-ChIbGKue.js";const n=".menubar{display:flex;align-items:center;padding:var(--sl-spacing-x-small);background-color:var(--sl-panel-background-color);border-top:calc(var(--sl-panel-border-width) * 2) solid var(--accent-color);border-bottom:var(--sl-panel-border-width) solid var(--sl-panel-border-color);position:relative;z-index:701;box-shadow:0 2px 6px 0px var(--sl-overlay-background-color)}.title{font-size:var(--sl-font-size-large);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.menu-button{font-size:var(--sl-font-size-x-large);margin-right:var(--sl-spacing-x-small)}";const a=class{constructor(i){t(this,i);this.sidebarToggled=e(this,"sidebarToggled")}record;sidebarToggled;render(){if(!this.record)return;return i("div",{class:"menubar"},i("sl-icon-button",{name:"list",label:"Open sidebar",class:"menu-button",onclick:this.sidebarToggled.emit}),i("div",{class:"title"},this.record.title))}};a.style=n;function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}var A={exports:{}};
2
+ /**
3
+ * MapLibre GL JS
4
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.6.0/LICENSE.txt
5
+ */var h=A.exports;var c;function u(){if(c)return A.exports;c=1;(function(t,e){(function(e,i){t.exports=i()})(h,(function(){var t={};var e={};function i(i,r,s){e[i]=s;if(i!=="index"){return}var o="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);";var n={};e.shared(n);e.index(t,n);if(typeof window!=="undefined"){t.setWorkerUrl(window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}return t}i("shared",["exports"],(function(t){function e(t,e,i,r){return new(i||(i=Promise))((function(s,o){function n(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,a)}l((r=r.apply(t,e||[])).next())}))}function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r,s;function o(){if(s)return r;function t(t,e){this.x=t,this.y=e}return s=1,r=t,t.prototype={clone:function(){return new t(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),s=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e},r}"function"==typeof SuppressedError&&SuppressedError;var n,a,l=i(o()),A=function(){if(a)return n;function t(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}return a=1,n=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var s=this.sampleCurveX(i)-t;if(Math.abs(s)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=s/o}var n=0,a=1;for(i=t,r=0;r<20&&(s=this.sampleCurveX(i),!(Math.abs(s-t)<e));r++)t>s?n=i:a=i,i=.5*(a-n)+n;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},n}(),h=i(A);let c,u;function f(){return null==c&&(c="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),c}function d(){if(null==u&&(u=false,f())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:true});if(e){for(let i=0;i<t*t;i++){const r=4*i;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(i%t,Math.floor(i/t),1,1)}const i=e.getImageData(0,0,t,t).data;for(let e=0;e<t*t*4;e++)if(e%4!=3&&i[e]!==e){u=true;break}}}return u||false}var g=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array;function m(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function w(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function I(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function v(t){return Math.hypot(t[0],t[1],t[2])}function b(t,e,i){var r=new p(3);return r[0]=t,r[1]=e,r[2]=i,r}function y(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function B(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function C(t,e,i){var r=e[0],s=e[1],o=e[2],n=i[0],a=i[1],l=i[2];return t[0]=s*l-o*a,t[1]=o*n-r*l,t[2]=r*a-s*n,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var E,_=v;function Q(t,e,i){var r=e[0],s=e[1],o=e[2],n=e[3];return t[0]=i[0]*r+i[4]*s+i[8]*o+i[12]*n,t[1]=i[1]*r+i[5]*s+i[9]*o+i[13]*n,t[2]=i[2]*r+i[6]*s+i[10]*o+i[14]*n,t[3]=i[3]*r+i[7]*s+i[11]*o+i[15]*n,t}function x(){var t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function M(t,e,i,r){var s=.5*Math.PI/180;e*=s,i*=s,r*=s;var o=Math.sin(e),n=Math.cos(e),a=Math.sin(i),l=Math.cos(i),A=Math.sin(r),h=Math.cos(r);return t[0]=o*l*h-n*a*A,t[1]=n*a*h+o*l*A,t[2]=n*l*A-o*a*h,t[3]=n*l*h+o*a*A,t}function k(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function D(t,e){var i=new p(2);return i[0]=t,i[1]=e,i}I(),E=new p(4),p!=Float32Array&&(E[0]=0,E[1]=0,E[2]=0,E[3]=0),I(),b(1,0,0),b(0,1,0),x(),x(),m(),k();const S=8192;function G(t,e,i){return e*(S/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}function F(t,e){return(t%e+e)%e}function R(t,e,i){return t*(1-i)+e*i}function L(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function z(t,e,i,r){const s=new h(t,e,i,r);return t=>s.solve(t)}const U=z(.25,.1,.25,1);function P(t,e,i){return Math.min(i,Math.max(e,t))}function N(t,e,i){const r=i-e,s=((t-e)%r+r)%r+e;return s===e?i:s}function T(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let q=1;function O(t,e,i){const r={};for(const i in t)r[i]=e.call(this,t[i],i,t);return r}function j(t,e,i){const r={};for(const i in t)e.call(this,t[i],i,t)&&(r[i]=t[i]);return r}function J(t){return Array.isArray(t)?t.map(J):"object"==typeof t&&t?O(t,J):t}const H={};function Y(t){H[t]||("undefined"!=typeof console&&console.warn(t),H[t]=true)}function $(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function V(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let K=null;function Z(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function X(t,i,r,s,o){return e(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const n=null==e?void 0:e.format;if(!n||!n.startsWith("BGR")&&!n.startsWith("RGB"))throw new Error(`Unrecognized format ${n}`);const a=n.startsWith("BGR"),l=new Uint8ClampedArray(s*o*4);if(yield e.copyTo(l,function(t,e,i,r,s){const o=4*Math.max(1,0),n=(Math.max(0,i)-i)*r*4+o,a=4*r,l=Math.max(0,e),A=Math.max(0,i);return{rect:{x:l,y:A,width:Math.min(t.width,e+r)-l,height:Math.min(t.height,i+s)-A},layout:[{offset:n,stride:a}]}}(t,i,r,s,o)),a)for(let t=0;t<l.length;t+=4){const e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}}))}let tt,et;function it(t,e,i,r){return t.addEventListener(e,i,r),{unsubscribe:()=>{t.removeEventListener(e,i,r)}}}function rt(t){return t*Math.PI/180}function st(t){return t/Math.PI*180}const ot={touchstart:true,touchmove:true,touchmoveWindow:true,touchend:true,touchcancel:true},nt={dblclick:true,click:true,mouseover:true,mouseout:true,mousedown:true,mousemove:true,mousemoveWindow:true,mouseup:true,mouseupWindow:true,contextmenu:true,wheel:true},at="AbortError";function lt(){return new Error(at)}const At={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ht(t){return At.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const ct="global-dispatcher";class ut extends Error{constructor(t,e,i,r){super(`AJAXError: ${e} (${t}): ${i}`),this.status=t,this.statusText=e,this.url=i,this.body=r}}const ft=()=>V(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,dt=function(t,i){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=ht(t.url);if(e)return e(t,i);if(V(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:ct},i)}if(!(/^file:/.test(r=t.url)||/^file:/.test(ft())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,i){return e(this,void 0,void 0,(function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:ft(),signal:i.signal});let r,s;"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");try{r=yield fetch(e)}catch(e){throw new ut(0,e.message,t.url,new Blob)}if(!r.ok){const e=yield r.blob();throw new ut(r.status,r.statusText,t.url,e)}s="arrayBuffer"===t.type||"image"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text();const o=yield s;if(i.signal.aborted)throw lt();return{data:o,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires")}}))}(t,i);if(V(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:true,targetMapId:ct},i)}var r;return function(t,e){return new Promise(((i,r)=>{var s;const o=new XMLHttpRequest;o.open(t.method||"GET",t.url,true),"arrayBuffer"!==t.type&&"image"!==t.type||(o.responseType="arraybuffer");for(const e in t.headers)o.setRequestHeader(e,t.headers[e]);"json"===t.type&&(o.responseType="text",(null===(s=t.headers)||void 0===s?void 0:s.Accept)||o.setRequestHeader("Accept","application/json")),o.withCredentials="include"===t.credentials,o.onerror=()=>{r(new Error(o.statusText))},o.onload=()=>{if(!e.signal.aborted)if((o.status>=200&&o.status<300||0===o.status)&&null!==o.response){let e=o.response;if("json"===t.type)try{e=JSON.parse(o.response)}catch(t){return void r(t)}i({data:e,cacheControl:o.getResponseHeader("Cache-Control"),expires:o.getResponseHeader("Expires")})}else{const e=new Blob([o.response],{type:o.getResponseHeader("Content-Type")});r(new ut(o.status,o.statusText,t.url,e))}},e.signal.addEventListener("abort",(()=>{o.abort(),r(lt())})),o.send(t.body)}))}(t,i)};function gt(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return true;const e=new URL(t),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function pt(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function mt(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}class wt{constructor(t,e={}){T(this,e),this.type=t}}class It extends wt{constructor(t,e={}){super("error",T({error:t},e))}}class vt{on(t,e){return this._listeners=this._listeners||{},pt(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return mt(t,e,this._listeners),mt(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},pt(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new wt(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const r=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of r)mt(i,e,this._oneTimeListeners),e.call(this,t);const s=this._eventedParent;s&&(T(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(t))}else t instanceof It&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var bt={$version:8,$root:{version:{required:true,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:true,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:true,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:true,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:false},"*":{type:"*"}},source_raster:{type:{required:true,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:false},"*":{type:"*"}},source_raster_dem:{type:{required:true,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:false},"*":{type:"*"}},source_geojson:{type:{required:true,type:"enum",values:{geojson:{}}},data:{required:true,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:false},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:false},generateId:{type:"boolean",default:false},promoteId:{type:"promoteId"}},source_video:{type:{required:true,type:"enum",values:{video:{}}},urls:{required:true,type:"array",value:"string"},coordinates:{required:true,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:true,type:"enum",values:{image:{}}},url:{required:true,type:"string"},coordinates:{required:true,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:true},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:true},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:false,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:false,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:false,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:false,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:false,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:false,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:false,expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:false,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:false,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:false,requires:["icon-image"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:false,requires:["icon-image","text-field"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:false,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:true,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:false,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:true,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:true,expression:{interpolated:false,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:false,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:true,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:false,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:true,expression:{interpolated:false,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:false,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:false,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:true,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:false,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:true,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:false,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:true,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:true,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:false,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:true,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:false,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:false,requires:["text-field"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:false,requires:["text-field","icon-image"],expression:{interpolated:false,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"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:false}},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:false,expression:{interpolated:false,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:true,expression:{interpolated:true,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:true,parameters:["zoom"]},transition:true},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:true,parameters:["zoom"]},transition:true}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:true,parameters:["zoom"]},transition:true},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:true,parameters:["zoom"]},transition:true},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:true,parameters:["zoom"]},transition:true},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:true,parameters:["zoom"]},transition:true},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:true,parameters:["zoom"]},transition:true},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:true,parameters:["zoom"]},transition:true},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:true,parameters:["zoom"]},transition:true}},terrain:{source:{type:"string",required:true},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:false,expression:{interpolated:true,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:true,expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:true,requires:[{"!":"fill-pattern"}],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:true,requires:[{"!":"fill-pattern"},{"fill-antialias":true}],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:true,expression:{interpolated:false,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:true,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:true,expression:{interpolated:false,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:true,requires:["fill-extrusion-height"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:true,transition:false,expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:true,requires:[{"!":"line-pattern"}],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:true,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:false,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:true,expression:{interpolated:false,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:false,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:true}}],expression:{interpolated:true,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:true,units:"pixels",expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:false,expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:true,expression:{interpolated:true,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:false,expression:{interpolated:true,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:true,requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:true,requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:true,units:"pixels",requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:true,units:"pixels",requires:["icon-image"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:true,units:"pixels",requires:["icon-image"],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:true,overridable:true,requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:true,requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:true,units:"pixels",requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:true,units:"pixels",requires:["text-field"],expression:{interpolated:true,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:true,units:"pixels",requires:["text-field"],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:true,units:"degrees",expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:false,units:"milliseconds",expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:false,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:false,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:false,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:false,expression:{interpolated:true,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:true,requires:[{"!":"background-pattern"}],expression:{interpolated:true,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:true,expression:{interpolated:false,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:true,expression:{interpolated:true,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 yt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Bt(t,e){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return yt.forEach((t=>{t in e&&(i[t]=e[t])})),i}function Ct(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return false;for(let i=0;i<t.length;i++)if(!Ct(t[i],e[i]))return false;return true}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return false;if(Object.keys(t).length!==Object.keys(e).length)return false;for(const i in t)if(!Ct(t[i],e[i]))return false;return true}return t===e}function Et(t,e){t.push(e)}function _t(t,e,i){Et(i,{command:"addSource",args:[t,e[t]]})}function Qt(t,e,i){Et(e,{command:"removeSource",args:[t]}),i[t]=true}function xt(t,e,i,r){Qt(t,i,r),_t(t,e,i)}function Mt(t,e,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!Ct(t[i][r],e[i][r]))return false;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&"data"!==r&&!Ct(t[i][r],e[i][r]))return false;return true}function kt(t,e,i,r,s,o){t=t||{},e=e||{};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(Ct(t[n],e[n])||i.push({command:o,args:[r,n,e[n],s]}));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&!Object.prototype.hasOwnProperty.call(t,n)&&(Ct(t[n],e[n])||i.push({command:o,args:[r,n,e[n],s]}))}function Dt(t){return t.id}function St(t,e){return t[e.id]=e,t}class Gt{constructor(t,e,i,r){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)}}function Ft(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}class Rt extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Lt{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new Lt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const zt={kind:"null"},Ut={kind:"number"},Pt={kind:"string"},Nt={kind:"boolean"},Tt={kind:"color"},qt={kind:"projectionDefinition"},Ot={kind:"object"},jt={kind:"value"},Jt={kind:"collator"},Ht={kind:"formatted"},Yt={kind:"padding"},$t={kind:"colorArray"},Vt={kind:"numberArray"},Kt={kind:"resolvedImage"},Zt={kind:"variableAnchorOffsetCollection"};function Wt(t,e){return{kind:"array",itemType:t,N:e}}function Xt(t){if("array"===t.kind){const e=Xt(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const te=[zt,Ut,Pt,Nt,Tt,qt,Ht,Ot,Wt(jt),Yt,Vt,$t,Kt,Zt];function ee(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ee(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of te)if(!ee(t,e))return null}return`Expected ${Xt(t)} but found ${Xt(e)} instead.`}function ie(t,e){return e.some((e=>e.kind===t.kind))}function re(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function se(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const oe=.96422,ne=.82521,ae=4/29,le=6/29,Ae=3*le*le,he=le*le*le,ce=Math.PI/180,ue=180/Math.PI;function fe(t){return(t%=360)<0&&(t+=360),t}function de([t,e,i,r]){let s,o;const n=pe((.2225045*(t=ge(t))+.7168786*(e=ge(e))+.0606169*(i=ge(i)))/1);t===e&&e===i?s=o=n:(s=pe((.4360747*t+.3850649*e+.1430804*i)/oe),o=pe((.0139322*t+.0971045*e+.7141733*i)/ne));const a=116*n-16;return[a<0?0:a,500*(s-n),200*(n-o),r]}function ge(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function pe(t){return t>he?Math.pow(t,1/3):t/Ae+ae}function me([t,e,i,r]){let s=(t+16)/116,o=isNaN(e)?s:s+e/500,n=isNaN(i)?s:s-i/200;return s=1*Ie(s),o=oe*Ie(o),n=ne*Ie(n),[we(3.1338561*o-1.6168667*s-.4906146*n),we(-.9787684*o+1.9161415*s+.033454*n),we(.0719453*o-.2289914*s+1.4052427*n),r]}function we(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Ie(t){return t>le?t*t*t:Ae*(t-ae)}const ve=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function be(t,e){return ve(t,e)?t[e]:void 0}function ye(t){return parseInt(t.padEnd(2,t),16)/255}function Be(t,e){return Ce(e?t/100:t,0,1)}function Ce(t,e,i){return Math.min(Math.max(e,t),i)}function Ee(t){return!t.some(Number.isNaN)}const _e={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]};function Qe(t,e,i){return t+i*(e-t)}function xe(t,e,i){return t.map(((t,r)=>Qe(t,e[r],i)))}class Me{constructor(t,e,i,r=1,s=true){this.r=t,this.g=e,this.b=i,this.a=r,s||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,e,i,r]))}static parse(t){if(t instanceof Me)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=be(_e,t);if(e){const[t,i,r]=e;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let i=1;return[ye(t.slice(i,i+=e)),ye(t.slice(i,i+=e)),ye(t.slice(i,i+=e)),ye(t.slice(i,i+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,i,r,s,o,n,a,l,A,h,c,u]=e,f=[s||" ",a||" ",h].join("");if(" "===f||" /"===f||",,"===f||",,,"===f){const t=[r,n,A].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[Ce(+i/e,0,1),Ce(+o/e,0,1),Ce(+l/e,0,1),c?Be(+c,u):1];if(Ee(t))return t}}return}}const i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[t,e,r,s,o,n,a,l,A]=i,h=[r||" ",o||" ",a].join("");if(" "===h||" /"===h||",,"===h||",,,"===h){const t=[+e,Ce(+s,0,100),Ce(+n,0,100),l?Be(+l,A):1];if(Ee(t))return function([t,e,i,r]){function s(r){const s=(r+t/30)%12,o=e*Math.min(i,1-i);return i-o*Math.max(-1,Math.min(s-3,9-s,1))}return t=fe(t),e/=100,i/=100,[s(0),s(8),s(4),r]}(t)}}}(t);return e?new Me(...e,false):void 0}get rgb(){const{r:t,g:e,b:i,a:r}=this,s=r||1/0;return this.overwriteGetter("rgb",[t/s,e/s,i/s,r])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,i,r,s]=de(t),o=Math.sqrt(i*i+r*r);return[Math.round(1e4*o)?fe(Math.atan2(r,i)*ue):NaN,o,e,s]}(this.rgb))}get lab(){return this.overwriteGetter("lab",de(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,i,r]=this.rgb;return`rgba(${[t,e,i].map((t=>Math.round(255*t))).join(",")},${r})`}static interpolate(t,e,i,r="rgb"){switch(r){case"rgb":{const[r,s,o,n]=xe(t.rgb,e.rgb,i);return new Me(r,s,o,n,false)}case"hcl":{const[r,s,o,n]=t.hcl,[a,l,A,h]=e.hcl;let c,u;if(isNaN(r)||isNaN(a))isNaN(r)?isNaN(a)?c=NaN:(c=a,1!==o&&0!==o||(u=l)):(c=r,1!==A&&0!==A||(u=s));else{let t=a-r;a>r&&t>180?t-=360:a<r&&r-a>180&&(t+=360),c=r+i*t}const[f,d,g,p]=function([t,e,i,r]){return t=isNaN(t)?0:t*ce,me([i,Math.cos(t)*e,Math.sin(t)*e,r])}([c,null!=u?u:Qe(s,l,i),Qe(o,A,i),Qe(n,h,i)]);return new Me(f,d,g,p,false)}case"lab":{const[r,s,o,n]=me(xe(t.lab,e.lab,i));return new Me(r,s,o,n,false)}}}}Me.black=new Me(0,0,0,1),Me.white=new Me(1,1,1,1),Me.transparent=new Me(0,0,0,0),Me.red=new Me(1,0,0,1);class ke{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const De=["bottom","center","top"];class Se{constructor(t,e,i,r,s,o){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=s,this.verticalAlign=o}}class Ge{constructor(t){this.sections=t}static fromString(t){return new Ge([new Se(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Ge?t:Ge.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class Fe{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Fe)return t;if("number"==typeof t)return new Fe([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Fe(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){return new Fe(xe(t.values,e.values,i))}}class Re{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Re)return t;if("number"==typeof t)return new Re([t]);if(Array.isArray(t)){for(const e of t)if("number"!=typeof e)return;return new Re(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){return new Re(xe(t.values,e.values,i))}}class Le{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Le)return t;if("string"==typeof t){const e=Me.parse(t);if(!e)return;return new Le([e])}if(!Array.isArray(t))return;const e=[];for(const i of t){if("string"!=typeof i)return;const t=Me.parse(i);if(!t)return;e.push(t)}return new Le(e)}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i,r="rgb"){const s=[];if(t.values.length!=e.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${e.values.length}), cannot interpolate.`);for(let o=0;o<t.values.length;o++)s.push(Me.interpolate(t.values[o],e.values[o],i,r));return new Le(s)}}class ze extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const Ue=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Pe{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Pe)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const i=t[e],r=t[e+1];if("string"!=typeof i||!Ue.has(i))return;if(!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new Pe(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){const r=t.values,s=e.values;if(r.length!==s.length)throw new ze(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const o=[];for(let t=0;t<r.length;t+=2){if(r[t]!==s[t])throw new ze(`Cannot interpolate values containing mismatched anchors. from[${t}]: ${r[t]}, to[${t}]: ${s[t]}`);o.push(r[t]);const[e,n]=r[t+1],[a,l]=s[t+1];o.push([Qe(e,a,i),Qe(n,l,i)])}return new Pe(o)}}class Ne{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Ne({name:t,available:false}):null}}class Te{constructor(t,e,i){this.from=t,this.to=e,this.transition=i}static interpolate(t,e,i){return new Te(t,e,i)}static parse(t){return t instanceof Te?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new Te(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new Te(t.from,t.to,t.transition):"string"==typeof t?new Te(t,t,1):void 0}}function qe(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oe(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Te||t instanceof Me||t instanceof ke||t instanceof Ge||t instanceof Fe||t instanceof Re||t instanceof Le||t instanceof Pe||t instanceof Ne)return true;if(Array.isArray(t)){for(const e of t)if(!Oe(e))return false;return true}if("object"==typeof t){for(const e in t)if(!Oe(t[e]))return false;return true}return false}function je(t){if(null===t)return zt;if("string"==typeof t)return Pt;if("boolean"==typeof t)return Nt;if("number"==typeof t)return Ut;if(t instanceof Me)return Tt;if(t instanceof Te)return qt;if(t instanceof ke)return Jt;if(t instanceof Ge)return Ht;if(t instanceof Fe)return Yt;if(t instanceof Re)return Vt;if(t instanceof Le)return $t;if(t instanceof Pe)return Zt;if(t instanceof Ne)return Kt;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=je(e);if(i){if(i===t)continue;i=jt;break}i=t}return Wt(i||jt,e)}return Ot}function Je(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Me||t instanceof Te||t instanceof Ge||t instanceof Fe||t instanceof Re||t instanceof Le||t instanceof Pe||t instanceof Ne?t.toString():JSON.stringify(t)}class He{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Oe(t[1]))return e.error("invalid value");const i=t[1];let r=je(i);const s=e.expectedType;return"array"!==r.kind||0!==r.N||!s||"array"!==s.kind||"number"==typeof s.N&&0!==s.N||(r=s),new He(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return true}}const Ye={string:Pt,number:Ut,boolean:Nt,object:Ot};class $e{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,r=1;const s=t[0];if("array"===s){let s,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in Ye)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);s=Ye[i],r++}else s=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],r++}i=Wt(s,o)}else{if(!Ye[s])throw new Error(`Types doesn't contain name = ${s}`);i=Ye[s]}const o=[];for(;r<t.length;r++){const i=e.parse(t[r],r,jt);if(!i)return null;o.push(i)}return new $e(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!ee(this.type,je(i)))return i;if(e===this.args.length-1)throw new ze(`Expected value to be of type ${Xt(this.type)}, but found ${Xt(je(i))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const Ve={"to-boolean":Nt,"to-color":Tt,"to-number":Ut,"to-string":Pt};class Ke{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(!Ve[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const r=Ve[i],s=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],i,jt);if(!r)return null;s.push(r)}return new Ke(r,s)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,i;for(const r of this.args){if(e=r.evaluate(t),i=null,e instanceof Me)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rgba value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:qe(e[0],e[1],e[2],e[3]),!i))return new Me(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ze(i||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const i of this.args){e=i.evaluate(t);const r=Fe.parse(e);if(r)return r}throw new ze(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"numberArray":{let e;for(const i of this.args){e=i.evaluate(t);const r=Re.parse(e);if(r)return r}throw new ze(`Could not parse numberArray from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"colorArray":{let e;for(const i of this.args){e=i.evaluate(t);const r=Le.parse(e);if(r)return r}throw new ze(`Could not parse colorArray from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const i of this.args){e=i.evaluate(t);const r=Pe.parse(e);if(r)return r}throw new ze(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new ze(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return Ge.fromString(Je(this.args[0].evaluate(t)));case"resolvedImage":return Ne.fromString(Je(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return Je(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const Ze=["Unknown","Point","LineString","Polygon"];class We{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Ze[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(t){let e=this._parseColorCache.get(t);return e||(e=Me.parse(t),this._parseColorCache.set(t,e)),e}}class Xe{constructor(t,e,i=[],r,s=new Lt,o=[]){this.registry=t,this.path=i,this.key=i.map((t=>`[${t}]`)).join(""),this.scope=s,this.errors=o,this.expectedType=r,this._isConstant=e}parse(t,e,i,r,s={}){return e?this.concat(e,i,r)._parse(t,s):this._parse(t,s)}_parse(t,e){function i(t,e,i){return"assert"===i?new $e(e,[t]):"coerce"===i?new Ke(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let r=s.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,s=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==s.kind){if("projectionDefinition"===t.kind&&["string","array"].includes(s.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(s.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(s.kind)||"colorArray"===t.kind&&["value","string","array"].includes(s.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(s.kind))r=i(r,t,e.typeAnnotation||"coerce");else if(this.checkSubtype(t,s))return null}else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof He)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){const e=new We;try{r=new He(r.type,r.evaluate(e))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const r="number"==typeof t?this.path.concat(t):this.path,s=i?this.scope.concat(i):this.scope;return new Xe(this.registry,this._isConstant,r,e||null,s,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Rt(i,t))}checkSubtype(t,e){const i=ee(t,e);return i&&this.error(i),i}}class ti{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const s=t[r];if("string"!=typeof s)return e.error(`Expected string, but found ${typeof s} instead.`,r);if(/[^a-zA-Z0-9_]/.test(s))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([s,o])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return r?new ti(i,r):null}outputDefined(){return this.result.outputDefined()}}class ei{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new ei(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return false}}class ii{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Ut),r=e.parse(t[2],2,Wt(e.expectedType||jt));return i&&r?new ii(r.type.itemType,i,r):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new ze(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new ze(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new ze(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return false}}class ri{constructor(t,e){this.type=Nt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jt),r=e.parse(t[2],2,jt);return i&&r?ie(i.type,[Nt,Pt,Ut,zt,jt])?new ri(i,r):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return false;if(!re(e,["boolean","string","number","null"]))throw new ze(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(je(e))} instead.`);if(!re(i,["string","array"]))throw new ze(`Expected second argument to be of type array or string, but found ${Xt(je(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return true}}class si{constructor(t,e,i){this.type=Ut,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jt),r=e.parse(t[2],2,jt);if(!i||!r)return null;if(!ie(i.type,[Nt,Pt,Ut,zt,jt]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(i.type)} instead`);if(4===t.length){const s=e.parse(t[3],3,Ut);return s?new si(i,r,s):null}return new si(i,r)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!re(e,["boolean","string","number","null"]))throw new ze(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(je(e))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(t)),re(i,["string"])){const t=i.indexOf(e,r);return-1===t?-1:[...i.slice(0,t)].length}if(re(i,["array"]))return i.indexOf(e,r);throw new ze(`Expected second argument to be of type array or string, but found ${Xt(je(i))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return false}}class oi{constructor(t,e,i,r,s,o){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=s,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const s={},o=[];for(let n=2;n<t.length-1;n+=2){let a=t[n];const l=t[n+1];Array.isArray(a)||(a=[a]);const A=e.concat(n);if(0===a.length)return A.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return A.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return A.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return A.error("Numeric branch labels must be integer values.");if(i){if(A.checkSubtype(i,je(t)))return null}else i=je(t);if(void 0!==s[String(t)])return A.error("Branch labels must be unique.");s[String(t)]=o.length}const h=e.parse(l,n,r);if(!h)return null;r=r||h.type,o.push(h)}const n=e.parse(t[1],1,jt);if(!n)return null;const a=e.parse(t[t.length-1],t.length-1,r);return a?"value"!==n.type.kind&&e.concat(1).checkSubtype(i,n.type)?null:new oi(i,r,n,s,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(je(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class ni{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const r=[];for(let s=1;s<t.length-1;s+=2){const o=e.parse(t[s],s,Nt);if(!o)return null;const n=e.parse(t[s+1],s+1,i);if(!n)return null;r.push([o,n]),i=i||n.type}const s=e.parse(t[t.length-1],t.length-1,i);if(!s)return null;if(!i)throw new Error("Can't infer output type");return new ni(i,r,s)}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}}class ai{constructor(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jt),r=e.parse(t[2],2,Ut);if(!i||!r)return null;if(!ie(i.type,[Wt(jt),Pt,jt]))return e.error(`Expected first argument to be of type array or string, but found ${Xt(i.type)} instead`);if(4===t.length){const s=e.parse(t[3],3,Ut);return s?new ai(i.type,i,r,s):null}return new ai(i.type,i,r)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);let r;if(this.endIndex&&(r=this.endIndex.evaluate(t)),re(e,["string"]))return[...e].slice(i,r).join("");if(re(e,["array"]))return e.slice(i,r);throw new ze(`Expected first argument to be of type array or string, but found ${Xt(je(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return false}}function li(t,e){const i=t.length-1;let r,s,o=0,n=i,a=0;for(;o<=n;)if(a=Math.floor((o+n)/2),r=t[a],s=t[a+1],r<=e){if(a===i||e<s)return a;o=a+1}else{if(!(r>e))throw new ze("Input is not a number.");n=a-1}return 0}class Ai{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,Ut);if(!i)return null;const r=[];let s=null;e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let i=1;i<t.length;i+=2){const o=1===i?-1/0:t[i],n=t[i+1],a=i,l=i+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(r.length&&r[r.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const A=e.parse(n,l,s);if(!A)return null;s=s||A.type,r.push([o,A])}return new Ai(s,i,r)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const s=e.length;return r>=e[s-1]?i[s-1].evaluate(t):i[li(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function hi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ci,ui,fi=function(){if(ui)return ci;function t(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}return ui=1,ci=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var s=this.sampleCurveX(i)-t;if(Math.abs(s)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=s/o}var n=0,a=1;for(i=t,r=0;r<20&&(s=this.sampleCurveX(i),!(Math.abs(s-t)<e));r++)t>s?n=i:a=i,i=.5*(a-n)+n;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},ci}(),di=hi(fi);class gi{constructor(t,e,i,r,s){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[t,e]of s)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,r){let s=0;if("exponential"===t.name)s=pi(e,t.base,i,r);else if("linear"===t.name)s=pi(e,1,i,r);else if("cubic-bezier"===t.name){const o=t.controlPoints;s=new di(o[0],o[1],o[2],o[3]).solve(pi(e,1,i,r))}return s}static parse(t,e){let[i,r,s,...o]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const t=r.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(s=e.parse(s,2,Ut),!s)return null;const n=[];let a=null;"interpolate-hcl"!==i&&"interpolate-lab"!==i||e.expectedType==$t?e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType):a=Tt;for(let t=0;t<o.length;t+=2){const i=o[t],r=o[t+1],s=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',s);const A=e.parse(r,l,a);if(!A)return null;a=a||A.type,n.push([i,A])}return se(a,Ut)||se(a,qt)||se(a,Tt)||se(a,Yt)||se(a,Vt)||se(a,$t)||se(a,Zt)||se(a,Wt(Ut))?new gi(a,i,r,s,n):e.error(`Type ${Xt(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const s=e.length;if(r>=e[s-1])return i[s-1].evaluate(t);const o=li(e,r),n=gi.interpolationFactor(this.interpolation,r,e[o],e[o+1]),a=i[o].evaluate(t),l=i[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Qe(a,l,n);case"color":return Me.interpolate(a,l,n);case"padding":return Fe.interpolate(a,l,n);case"colorArray":return Le.interpolate(a,l,n);case"numberArray":return Re.interpolate(a,l,n);case"variableAnchorOffsetCollection":return Pe.interpolate(a,l,n);case"array":return xe(a,l,n);case"projectionDefinition":return Te.interpolate(a,l,n)}case"interpolate-hcl":switch(this.type.kind){case"color":return Me.interpolate(a,l,n,"hcl");case"colorArray":return Le.interpolate(a,l,n,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Me.interpolate(a,l,n,"lab");case"colorArray":return Le.interpolate(a,l,n,"lab")}}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function pi(t,e,i,r){const s=r-i,o=t-i;return 0===s?0:1===e?o/s:(Math.pow(e,o)-1)/(Math.pow(e,s)-1)}const mi={color:Me.interpolate,number:Qe,padding:Fe.interpolate,numberArray:Re.interpolate,colorArray:Le.interpolate,variableAnchorOffsetCollection:Pe.interpolate,array:xe};class wi{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i=null;const r=e.expectedType;r&&"value"!==r.kind&&(i=r);const s=[];for(const r of t.slice(1)){const t=e.parse(r,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,s.push(t)}if(!i)throw new Error("No output type");const o=r&&s.some((t=>ee(r,t.type)));return new wi(o?jt:i,s)}evaluate(t){let e,i=null,r=0;for(const s of this.args)if(r++,i=s.evaluate(t),i&&i instanceof Ne&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function Ii(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function vi(t,e,i,r){return 0===r.compare(e,i)}function bi(t,e,i){const r="=="!==t&&"!="!==t;return class s{constructor(t,e,i){this.type=Nt,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,jt);if(!o)return null;if(!Ii(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Xt(o.type)}'.`);let n=e.parse(t[2],2,jt);if(!n)return null;if(!Ii(i,n.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Xt(n.type)}'.`);if(o.type.kind!==n.type.kind&&"value"!==o.type.kind&&"value"!==n.type.kind)return e.error(`Cannot compare types '${Xt(o.type)}' and '${Xt(n.type)}'.`);r&&("value"===o.type.kind&&"value"!==n.type.kind?o=new $e(n.type,[o]):"value"!==o.type.kind&&"value"===n.type.kind&&(n=new $e(o.type,[n])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==n.type.kind&&"value"!==o.type.kind&&"value"!==n.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Jt),!a)return null}return new s(o,n,a)}evaluate(s){const o=this.lhs.evaluate(s),n=this.rhs.evaluate(s);if(r&&this.hasUntypedArgument){const e=je(o),i=je(n);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new ze(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=je(o),i=je(n);if("string"!==t.kind||"string"!==i.kind)return e(s,o,n)}return this.collator?i(s,o,n,this.collator.evaluate(s)):e(s,o,n)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return true}}}const yi=bi("==",(function(t,e,i){return e===i}),vi),Bi=bi("!=",(function(t,e,i){return e!==i}),(function(t,e,i,r){return!vi(0,e,i,r)})),Ci=bi("<",(function(t,e,i){return e<i}),(function(t,e,i,r){return r.compare(e,i)<0})),Ei=bi(">",(function(t,e,i){return e>i}),(function(t,e,i,r){return r.compare(e,i)>0})),_i=bi("<=",(function(t,e,i){return e<=i}),(function(t,e,i,r){return r.compare(e,i)<=0})),Qi=bi(">=",(function(t,e,i){return e>=i}),(function(t,e,i,r){return r.compare(e,i)>=0}));class xi{constructor(t,e,i){this.type=Jt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Nt);if(!r)return null;const s=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Nt);if(!s)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Pt),!o)?null:new xi(r,s,o)}evaluate(t){return new ke(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return false}}class Mi{constructor(t,e,i,r,s){this.type=Pt,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Ut);if(!i)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let s=null;if(r.locale&&(s=e.parse(r.locale,1,Pt),!s))return null;let o=null;if(r.currency&&(o=e.parse(r.currency,1,Pt),!o))return null;let n=null;if(r["min-fraction-digits"]&&(n=e.parse(r["min-fraction-digits"],1,Ut),!n))return null;let a=null;return r["max-fraction-digits"]&&(a=e.parse(r["max-fraction-digits"],1,Ut),!a)?null:new Mi(i,s,o,n,a)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return false}}class ki{constructor(t){this.type=Ht,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const r=[];let s=false;for(let i=1;i<=t.length-1;++i){const o=t[i];if(s&&"object"==typeof o&&!Array.isArray(o)){s=false;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,Ut),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,Wt(Pt)),!i))return null;let n=null;if(o["text-color"]&&(n=e.parse(o["text-color"],1,Tt),!n))return null;let a=null;if(o["vertical-align"]){if("string"==typeof o["vertical-align"]&&!De.includes(o["vertical-align"]))return e.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${o["vertical-align"]}' instead.`);if(a=e.parse(o["vertical-align"],1,Pt),!a)return null}const l=r[r.length-1];l.scale=t,l.font=i,l.textColor=n,l.verticalAlign=a}else{const o=e.parse(t[i],1,jt);if(!o)return null;const n=o.type.kind;if("string"!==n&&"value"!==n&&"null"!==n&&"resolvedImage"!==n)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=true,r.push({content:o,scale:null,font:null,textColor:null,verticalAlign:null})}}return new ki(r)}evaluate(t){return new Ge(this.sections.map((e=>{const i=e.content.evaluate(t);return je(i)===Kt?new Se("",i,null,null,null,e.verticalAlign?e.verticalAlign.evaluate(t):null):new Se(Je(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null,e.verticalAlign?e.verticalAlign.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor),e.verticalAlign&&t(e.verticalAlign)}outputDefined(){return false}}class Di{constructor(t){this.type=Kt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Pt);return i?new Di(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Ne.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return false}}class Si{constructor(t){this.type=Ut,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${Xt(i.type)} instead.`):new Si(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new ze(`Expected value to be of type string or array, but found ${Xt(je(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return false}}const Gi=8192;function Fi(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,s=Math.pow(2,e.z);return[Math.round(i*s*Gi),Math.round(r*s*Gi)]}function Ri(t,e){const i=Math.pow(2,e.z);return[(s=(t[0]/Gi+e.x)/i,360*s-180),(r=(t[1]/Gi+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,s}function Li(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function zi(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ui(t,e,i){const r=t[0]-e[0],s=t[1]-e[1],o=t[0]-i[0],n=t[1]-i[1];return r*n-o*s==0&&r*o<=0&&s*n<=0}function Pi(t,e,i,r){return 0!=(s=[r[0]-i[0],r[1]-i[1]])[0]*(o=[e[0]-t[0],e[1]-t[1]])[1]-s[1]*o[0]&&!(!Ji(t,e,i,r)||!Ji(i,r,t,e));var s,o}function Ni(t,e,i){for(const r of i)for(let i=0;i<r.length-1;++i)if(Pi(t,e,r[i],r[i+1]))return true;return false}function Ti(t,e,i=false){let r=false;for(const a of e)for(let e=0;e<a.length-1;e++){if(Ui(t,a[e],a[e+1]))return i;(o=a[e])[1]>(s=t)[1]!=(n=a[e+1])[1]>s[1]&&s[0]<(n[0]-o[0])*(s[1]-o[1])/(n[1]-o[1])+o[0]&&(r=!r)}var s,o,n;return r}function qi(t,e){for(const i of e)if(Ti(t,i))return true;return false}function Oi(t,e){for(const i of t)if(!Ti(i,e))return false;for(let i=0;i<t.length-1;++i)if(Ni(t[i],t[i+1],e))return false;return true}function ji(t,e){for(const i of e)if(Oi(t,i))return true;return false}function Ji(t,e,i,r){const s=r[0]-i[0],o=r[1]-i[1],n=(t[0]-i[0])*o-s*(t[1]-i[1]),a=(e[0]-i[0])*o-s*(e[1]-i[1]);return n>0&&a<0||n<0&&a>0}function Hi(t,e,i){const r=[];for(let s=0;s<t.length;s++){const o=[];for(let r=0;r<t[s].length;r++){const n=Fi(t[s][r],i);Li(e,n),o.push(n)}r.push(o)}return r}function Yi(t,e,i){const r=[];for(let s=0;s<t.length;s++){const o=Hi(t[s],e,i);r.push(o)}return r}function $i(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const e=.5*r;let s=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===s&&(s=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=s}Li(e,t)}function Vi(t,e,i,r){const s=Math.pow(2,r.z)*Gi,o=[r.x*Gi,r.y*Gi],n=[];for(const r of t)for(const t of r){const r=[t.x+o[0],t.y+o[1]];$i(r,e,i,s),n.push(r)}return n}function Ki(t,e,i,r){const s=Math.pow(2,r.z)*Gi,o=[r.x*Gi,r.y*Gi],n=[];for(const i of t){const t=[];for(const r of i){const i=[r.x+o[0],r.y+o[1]];Li(e,i),t.push(i)}n.push(t)}if(e[2]-e[0]<=s/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of n)for(const r of t)$i(r,e,i,s)}var a;return n}class Zi{constructor(t,e){this.type=Nt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Oe(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const i of e.features){const{type:e,coordinates:r}=i.geometry;"Polygon"===e&&t.push(r),"MultiPolygon"===e&&t.push(...r)}if(t.length)return new Zi(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Zi(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Zi(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],s=t.canonicalID();if("Polygon"===e.type){const o=Hi(e.coordinates,r,s),n=Vi(t.geometry(),i,r,s);if(!zi(i,r))return false;for(const t of n)if(!Ti(t,o))return false}if("MultiPolygon"===e.type){const o=Yi(e.coordinates,r,s),n=Vi(t.geometry(),i,r,s);if(!zi(i,r))return false;for(const t of n)if(!qi(t,o))return false}return true}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],s=t.canonicalID();if("Polygon"===e.type){const o=Hi(e.coordinates,r,s),n=Ki(t.geometry(),i,r,s);if(!zi(i,r))return false;for(const t of n)if(!Oi(t,o))return false}if("MultiPolygon"===e.type){const o=Yi(e.coordinates,r,s),n=Ki(t.geometry(),i,r,s);if(!zi(i,r))return false;for(const t of n)if(!ji(t,o))return false}return true}(t,this.geometries)}return false}eachChild(){}outputDefined(){return true}}let Wi=class{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const s=t-1>>1,o=e[s];if(i(r,o)>=0)break;e[t]=o,t=s}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,s=e[t];for(;t<r;){let r=1+(t<<1);const o=r+1;if(o<this.length&&i(e[o],e[r])<0&&(r=o),i(e[r],s)>=0)break;e[t]=e[r],t=r}e[t]=s}};function Xi(t,e,i=0,r=t.length-1,s=er){for(;r>i;){if(r-i>600){const o=r-i+1,n=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),A=.5*Math.sqrt(a*l*(o-l)/o)*(n-o/2<0?-1:1);Xi(t,e,Math.max(i,Math.floor(e-n*l/o+A)),Math.min(r,Math.floor(e+(o-n)*l/o+A)),s)}const o=t[e];let n=i,a=r;for(tr(t,i,e),s(t[r],o)>0&&tr(t,i,r);n<a;){for(tr(t,n,a),n++,a--;s(t[n],o)<0;)n++;for(;s(t[a],o)>0;)a--}0===s(t[i],o)?tr(t,i,a):(a++,tr(t,a,r)),a<=e&&(i=a+1),e<=a&&(r=a-1)}}function tr(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function er(t,e){return t<e?-1:t>e?1:0}function ir(t,e){if(t.length<=1)return[t];const i=[];let r,s;for(const e of t){const t=sr(e);0!==t&&(e.area=Math.abs(t),void 0===s&&(s=t<0),s===t<0?(r&&i.push(r),r=[e]):r.push(e))}if(r&&i.push(r),e>1)for(let t=0;t<i.length;t++)i[t].length<=e||(Xi(i[t],e,1,i[t].length-1,rr),i[t]=i[t].slice(0,e));return i}function rr(t,e){return e.area-t.area}function sr(t){let e=0;for(let i,r,s=0,o=t.length,n=o-1;s<o;n=s++)i=t[s],r=t[n],e+=(r.x-i.x)*(i.y+r.y);return e}const or=1/298.257223563,nr=or*(2-or),ar=Math.PI/180;class lr{constructor(t){const e=6378.137*ar*1e3,i=Math.cos(t*ar),r=1/(1-nr*(1-i*i)),s=Math.sqrt(r);this.kx=e*s*i,this.ky=e*s*r*(1-nr)}distance(t,e){const i=this.wrap(t[0]-e[0])*this.kx,r=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,e){let i,r,s,o,n=1/0;for(let a=0;a<t.length-1;a++){let l=t[a][0],A=t[a][1],h=this.wrap(t[a+1][0]-l)*this.kx,c=(t[a+1][1]-A)*this.ky,u=0;0===h&&0===c||(u=(this.wrap(e[0]-l)*this.kx*h+(e[1]-A)*this.ky*c)/(h*h+c*c),u>1?(l=t[a+1][0],A=t[a+1][1]):u>0&&(l+=h/this.kx*u,A+=c/this.ky*u)),h=this.wrap(e[0]-l)*this.kx,c=(e[1]-A)*this.ky;const f=h*h+c*c;f<n&&(n=f,i=l,r=A,s=a,o=u)}return{point:[i,r],index:s,t:Math.max(0,Math.min(1,o))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Ar(t,e){return e[0]-t[0]}function hr(t){return t[1]-t[0]+1}function cr(t,e){return t[1]>=t[0]&&t[1]<e}function ur(t,e){if(t[0]>t[1])return[null,null];const i=hr(t);if(e){if(2===i)return[t,null];const e=Math.floor(i/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===i)return[t,null];const r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function fr(t,e){if(!cr(e,t.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Li(i,t[r]);return i}function dr(t){const e=[1/0,1/0,-1/0,-1/0];for(const i of t)for(const t of i)Li(e,t);return e}function gr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function pr(t,e,i){if(!gr(t)||!gr(e))return NaN;let r=0,s=0;return t[2]<e[0]&&(r=e[0]-t[2]),t[0]>e[2]&&(r=t[0]-e[2]),t[1]>e[3]&&(s=t[1]-e[3]),t[3]<e[1]&&(s=e[1]-t[3]),i.distance([0,0],[r,s])}function mr(t,e,i){const r=i.pointOnLine(e,t);return i.distance(t,r.point)}function wr(t,e,i,r,s){const o=Math.min(mr(t,[i,r],s),mr(e,[i,r],s)),n=Math.min(mr(i,[t,e],s),mr(r,[t,e],s));return Math.min(o,n)}function Ir(t,e,i,r,s){if(!cr(e,t.length)||!cr(r,i.length))return 1/0;let o=1/0;for(let n=e[0];n<e[1];++n){const e=t[n],a=t[n+1];for(let t=r[0];t<r[1];++t){const r=i[t],n=i[t+1];if(Pi(e,a,r,n))return 0;o=Math.min(o,wr(e,a,r,n,s))}}return o}function vr(t,e,i,r,s){if(!cr(e,t.length)||!cr(r,i.length))return NaN;let o=1/0;for(let n=e[0];n<=e[1];++n)for(let e=r[0];e<=r[1];++e)if(o=Math.min(o,s.distance(t[n],i[e])),0===o)return o;return o}function br(t,e,i){if(Ti(t,e,true))return 0;let r=1/0;for(const s of e){const e=s[0],o=s[s.length-1];if(e!==o&&(r=Math.min(r,mr(t,[o,e],i)),0===r))return r;const n=i.pointOnLine(s,t);if(r=Math.min(r,i.distance(t,n.point)),0===r)return r}return r}function yr(t,e,i,r){if(!cr(e,t.length))return NaN;for(let r=e[0];r<=e[1];++r)if(Ti(t[r],i,true))return 0;let s=1/0;for(let o=e[0];o<e[1];++o){const e=t[o],n=t[o+1];for(const t of i)for(let i=0,o=t.length,a=o-1;i<o;a=i++){const o=t[a],l=t[i];if(Pi(e,n,o,l))return 0;s=Math.min(s,wr(e,n,o,l,r))}}return s}function Br(t,e){for(const i of t)for(const t of i)if(Ti(t,e,true))return true;return false}function Cr(t,e,i,r=1/0){const s=dr(t),o=dr(e);if(r!==1/0&&pr(s,o,i)>=r)return r;if(zi(s,o)){if(Br(t,e))return 0}else if(Br(e,t))return 0;let n=1/0;for(const r of t)for(let t=0,s=r.length,o=s-1;t<s;o=t++){const s=r[o],a=r[t];for(const t of e)for(let e=0,r=t.length,o=r-1;e<r;o=e++){const r=t[o],l=t[e];if(Pi(s,a,r,l))return 0;n=Math.min(n,wr(s,a,r,l,i))}}return n}function Er(t,e,i,r,s,o){if(!o)return;const n=pr(fr(r,o),s,i);n<e&&t.push([n,o,[0,0]])}function _r(t,e,i,r,s,o,n){if(!o||!n)return;const a=pr(fr(r,o),fr(s,n),i);a<e&&t.push([a,o,n])}function Qr(t,e,i,r,s=1/0){let o=Math.min(r.distance(t[0],i[0][0]),s);if(0===o)return o;const n=new Wi([[0,[0,t.length-1],[0,0]]],Ar),a=dr(i);for(;n.length>0;){const s=n.pop();if(s[0]>=o)continue;const l=s[1],A=e?50:100;if(hr(l)<=A){if(!cr(l,t.length))return NaN;if(e){const e=yr(t,l,i,r);if(isNaN(e)||0===e)return e;o=Math.min(o,e)}else for(let e=l[0];e<=l[1];++e){const s=br(t[e],i,r);if(o=Math.min(o,s),0===o)return 0}}else{const i=ur(l,e);Er(n,o,r,t,a,i[0]),Er(n,o,r,t,a,i[1])}}return o}function xr(t,e,i,r,s,o=1/0){let n=Math.min(o,s.distance(t[0],i[0]));if(0===n)return n;const a=new Wi([[0,[0,t.length-1],[0,i.length-1]]],Ar);for(;a.length>0;){const o=a.pop();if(o[0]>=n)continue;const l=o[1],A=o[2],h=e?50:100,c=r?50:100;if(hr(l)<=h&&hr(A)<=c){if(!cr(l,t.length)&&cr(A,i.length))return NaN;let o;if(e&&r)o=Ir(t,l,i,A,s),n=Math.min(n,o);else if(e&&!r){const e=t.slice(l[0],l[1]+1);for(let t=A[0];t<=A[1];++t)if(o=mr(i[t],e,s),n=Math.min(n,o),0===n)return n}else if(!e&&r){const e=i.slice(A[0],A[1]+1);for(let i=l[0];i<=l[1];++i)if(o=mr(t[i],e,s),n=Math.min(n,o),0===n)return n}else o=vr(t,l,i,A,s),n=Math.min(n,o)}else{const o=ur(l,e),h=ur(A,r);_r(a,n,s,t,i,o[0],h[0]),_r(a,n,s,t,i,o[0],h[1]),_r(a,n,s,t,i,o[1],h[0]),_r(a,n,s,t,i,o[1],h[1])}}return n}function Mr(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class kr{constructor(t,e){this.type=Ut,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Oe(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new kr(e,e.features.map((t=>Mr(t.geometry))).flat());if("Feature"===e.type)return new kr(e,Mr(e.geometry));if("type"in e&&"coordinates"in e)return new kr(e,Mr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map((e=>Ri([e.x,e.y],t.canonical)));if(0===i.length)return NaN;const s=new lr(r[0][1]);let o=1/0;for(const t of e){switch(t.type){case"Point":o=Math.min(o,xr(r,false,[t.coordinates],false,s,o));break;case"LineString":o=Math.min(o,xr(r,false,t.coordinates,true,s,o));break;case"Polygon":o=Math.min(o,Qr(r,false,t.coordinates,s,o))}if(0===o)return o}return o}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map((e=>Ri([e.x,e.y],t.canonical)));if(0===i.length)return NaN;const s=new lr(r[0][1]);let o=1/0;for(const t of e){switch(t.type){case"Point":o=Math.min(o,xr(r,true,[t.coordinates],false,s,o));break;case"LineString":o=Math.min(o,xr(r,true,t.coordinates,true,s,o));break;case"Polygon":o=Math.min(o,Qr(r,true,t.coordinates,s,o))}if(0===o)return o}return o}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const i=t.geometry();if(0===i.length||0===i[0].length)return NaN;const r=ir(i,0).map((e=>e.map((e=>e.map((e=>Ri([e.x,e.y],t.canonical))))))),s=new lr(r[0][0][0][1]);let o=1/0;for(const t of e)for(const e of r){switch(t.type){case"Point":o=Math.min(o,Qr([t.coordinates],false,e,s,o));break;case"LineString":o=Math.min(o,Qr(t.coordinates,true,e,s,o));break;case"Polygon":o=Math.min(o,Cr(e,t.coordinates,s,o))}if(0===o)return o}return o}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return true}}class Dr{constructor(t){this.type=jt,this.key=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=t[1];return null==i?e.error("Global state property must be defined."):"string"!=typeof i?e.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new Dr(i)}evaluate(t){var e;const i=null===(e=t.globals)||void 0===e?void 0:e.globalState;return i&&0!==Object.keys(i).length?be(i,this.key):null}eachChild(){}outputDefined(){return false}}const Sr={"==":yi,"!=":Bi,">":Ei,"<":Ci,">=":Qi,"<=":_i,array:$e,at:ii,boolean:$e,case:ni,coalesce:wi,collator:xi,format:ki,image:Di,in:ri,"index-of":si,interpolate:gi,"interpolate-hcl":gi,"interpolate-lab":gi,length:Si,let:ti,literal:He,match:oi,number:$e,"number-format":Mi,object:$e,slice:ai,step:Ai,string:$e,"to-boolean":Ke,"to-color":Ke,"to-number":Ke,"to-string":Ke,var:ei,within:Zi,distance:kr,"global-state":Dr};class Gr{constructor(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return false}static parse(t,e){const i=t[0],r=Gr.definitions[i];if(!r)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,n=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[r,o]of n){a=new Xe(e.registry,Ur,e.path,null,e.scope);const n=[];let l=false;for(let e=1;e<t.length;e++){const i=t[e],s=Array.isArray(r)?r[e-1]:r.type,o=a.parse(i,1+n.length,s);if(!o){l=true;break}n.push(o)}if(!l)if(Array.isArray(r)&&r.length!==n.length)a.error(`Expected ${r.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(r)?r[t]:r.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new Gr(i,s,o,n)}}if(1===n.length)e.errors.push(...a.errors);else{const i=(n.length?n:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(Xt).join(", ")})`:`(${Xt(e.type)}...)`;var e})).join(" | "),r=[];for(let i=1;i<t.length;i++){const s=e.parse(t[i],1+r.length);if(!s)return null;r.push(Xt(s.type))}e.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,e){Gr.definitions=e;for(const i in e)t[i]=Gr}}function Fr(t,[e,i,r,s]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const o=s?s.evaluate(t):1,n=qe(e,i,r,o);if(n)throw new ze(n);return new Me(e/255,i/255,r/255,o,false)}function Rr(t,e){return t in e}function Lr(t,e){const i=e[t];return void 0===i?null:i}function zr(t){return{type:t}}function Ur(t){if(t instanceof ei)return Ur(t.boundExpression);if(t instanceof Gr&&"error"===t.name)return false;if(t instanceof xi)return false;if(t instanceof Zi)return false;if(t instanceof kr)return false;if(t instanceof Dr)return false;const e=t instanceof Ke||t instanceof $e;let i=true;return t.eachChild((t=>{i=e?i&&Ur(t):i&&t instanceof He})),!!i&&Pr(t)&&Tr(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Pr(t){if(t instanceof Gr){if("get"===t.name&&1===t.args.length)return false;if("feature-state"===t.name)return false;if("has"===t.name&&1===t.args.length)return false;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return false;if(/^filter-/.test(t.name))return false}if(t instanceof Zi)return false;if(t instanceof kr)return false;let e=true;return t.eachChild((t=>{e&&!Pr(t)&&(e=false)})),e}function Nr(t){if(t instanceof Gr&&"feature-state"===t.name)return false;let e=true;return t.eachChild((t=>{e&&!Nr(t)&&(e=false)})),e}function Tr(t,e){if(t instanceof Gr&&e.indexOf(t.name)>=0)return false;let i=true;return t.eachChild((t=>{i&&!Tr(t,e)&&(i=false)})),i}function qr(t){return{result:"success",value:t}}function Or(t){return{result:"error",value:t}}function jr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Jr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Hr(t){return!!t.expression&&t.expression.interpolated}function Yr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function $r(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&je(t)===Ot}function Vr(t){return t}function Kr(t,e){const i=t.stops&&"object"==typeof t.stops[0][0],r=i||!(i||void 0!==t.property),s=t.type||(Hr(e)?"exponential":"interval"),o=function(t){switch(t.type){case"color":return Me.parse;case"padding":return Fe.parse;case"numberArray":return Re.parse;case"colorArray":return Le.parse;default:return null}}(e);if(o&&((t=Ft({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],o(t[1])]))),t.default=o(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==(n=t.colorSpace)&&"hcl"!==n&&"lab"!==n)throw new Error(`Unknown color space: "${t.colorSpace}"`);var n;const a=function(t){switch(t){case"exponential":return ts;case"interval":return Xr;case"categorical":return Wr;case"identity":return es;default:throw new Error(`Unknown function type "${t}"`)}}(s);let l,A;if("categorical"===s){l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];A=typeof t.stops[0][0]}if(i){const i={},r=[];for(let e=0;e<t.stops.length;e++){const s=t.stops[e],o=s[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},r.push(o)),i[o].stops.push([s[0].value,s[1]])}const s=[];for(const t of r)s.push([i[t].zoom,Kr(i[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:gi.interpolationFactor.bind(void 0,o),zoomStops:s.map((t=>t[0])),evaluate:({zoom:i},r)=>ts({stops:s,base:t.base},e,i).evaluate(i,r)}}if(r){const i="exponential"===s?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:gi.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:i})=>a(t,e,i,l,A)}}return{kind:"source",evaluate(i,r){const s=r&&r.properties?r.properties[t.property]:void 0;return void 0===s?Zr(t.default,e.default):a(t,e,s,l,A)}}}function Zr(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Wr(t,e,i,r,s){return Zr(typeof i===s?r[i]:void 0,t.default,e.default)}function Xr(t,e,i){if("number"!==Yr(i))return Zr(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const s=li(t.stops.map((t=>t[0])),i);return t.stops[s][1]}function ts(t,e,i){const r=void 0!==t.base?t.base:1;if("number"!==Yr(i))return Zr(t.default,e.default);const s=t.stops.length;if(1===s)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[s-1][0])return t.stops[s-1][1];const o=li(t.stops.map((t=>t[0])),i),n=function(t,e,i,r){const s=r-i,o=t-i;return 0===s?0:1===e?o/s:(Math.pow(e,o)-1)/(Math.pow(e,s)-1)}(i,r,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],A=mi[e.type]||Vr;return"function"==typeof a.evaluate?{evaluate(...e){const i=a.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==i&&void 0!==r)return A(i,r,n,t.colorSpace)}}:A(a,l,n,t.colorSpace)}function es(t,e,i){switch(e.type){case"color":i=Me.parse(i);break;case"formatted":i=Ge.fromString(i.toString());break;case"resolvedImage":i=Ne.fromString(i.toString());break;case"padding":i=Fe.parse(i);break;case"colorArray":i=Le.parse(i);break;case"numberArray":i=Re.parse(i);break;default:Yr(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0)}return Zr(i,t.default,e.default)}Gr.register(Sr,{error:[{kind:"error"},[Pt],(t,[e])=>{throw new ze(e.evaluate(t))}],typeof:[Pt,[jt],(t,[e])=>Xt(je(e.evaluate(t)))],"to-rgba":[Wt(Ut,4),[Tt],(t,[e])=>{const[i,r,s,o]=e.evaluate(t).rgb;return[255*i,255*r,255*s,o]}],rgb:[Tt,[Ut,Ut,Ut],Fr],rgba:[Tt,[Ut,Ut,Ut,Ut],Fr],has:{type:Nt,overloads:[[[Pt],(t,[e])=>Rr(e.evaluate(t),t.properties())],[[Pt,Ot],(t,[e,i])=>Rr(e.evaluate(t),i.evaluate(t))]]},get:{type:jt,overloads:[[[Pt],(t,[e])=>Lr(e.evaluate(t),t.properties())],[[Pt,Ot],(t,[e,i])=>Lr(e.evaluate(t),i.evaluate(t))]]},"feature-state":[jt,[Pt],(t,[e])=>Lr(e.evaluate(t),t.featureState||{})],properties:[Ot,[],t=>t.properties()],"geometry-type":[Pt,[],t=>t.geometryType()],id:[jt,[],t=>t.id()],zoom:[Ut,[],t=>t.globals.zoom],"heatmap-density":[Ut,[],t=>t.globals.heatmapDensity||0],elevation:[Ut,[],t=>t.globals.elevation||0],"line-progress":[Ut,[],t=>t.globals.lineProgress||0],accumulated:[jt,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Ut,zr(Ut),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[Ut,zr(Ut),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:Ut,overloads:[[[Ut,Ut],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Ut],(t,[e])=>-e.evaluate(t)]]},"/":[Ut,[Ut,Ut],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Ut,[Ut,Ut],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Ut,[],()=>Math.LN2],pi:[Ut,[],()=>Math.PI],e:[Ut,[],()=>Math.E],"^":[Ut,[Ut,Ut],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Ut,[Ut],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Ut,[Ut],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Ut,[Ut],(t,[e])=>Math.log(e.evaluate(t))],log2:[Ut,[Ut],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Ut,[Ut],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Ut,[Ut],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Ut,[Ut],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Ut,[Ut],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Ut,[Ut],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Ut,[Ut],(t,[e])=>Math.atan(e.evaluate(t))],min:[Ut,zr(Ut),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Ut,zr(Ut),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Ut,[Ut],(t,[e])=>Math.abs(e.evaluate(t))],round:[Ut,[Ut],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Ut,[Ut],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Ut,[Ut],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Nt,[Pt,jt],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Nt,[jt],(t,[e])=>t.id()===e.value],"filter-type-==":[Nt,[Pt],(t,[e])=>t.geometryType()===e.value],"filter-<":[Nt,[Pt,jt],(t,[e,i])=>{const r=t.properties()[e.value],s=i.value;return typeof r==typeof s&&r<s}],"filter-id-<":[Nt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[Nt,[Pt,jt],(t,[e,i])=>{const r=t.properties()[e.value],s=i.value;return typeof r==typeof s&&r>s}],"filter-id->":[Nt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}],"filter-<=":[Nt,[Pt,jt],(t,[e,i])=>{const r=t.properties()[e.value],s=i.value;return typeof r==typeof s&&r<=s}],"filter-id-<=":[Nt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[Nt,[Pt,jt],(t,[e,i])=>{const r=t.properties()[e.value],s=i.value;return typeof r==typeof s&&r>=s}],"filter-id->=":[Nt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[Nt,[jt],(t,[e])=>e.value in t.properties()],"filter-has-id":[Nt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Nt,[Wt(Pt)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Nt,[Wt(jt)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Nt,[Pt,Wt(jt)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Nt,[Pt,Wt(jt)],(t,[e,i])=>function(t,e,i,r){for(;i<=r;){const s=i+r>>1;if(e[s]===t)return true;e[s]>t?r=s-1:i=s+1}return false}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Nt,overloads:[[[Nt,Nt],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[zr(Nt),(t,e)=>{for(const i of e)if(!i.evaluate(t))return false;return true}]]},any:{type:Nt,overloads:[[[Nt,Nt],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[zr(Nt),(t,e)=>{for(const i of e)if(i.evaluate(t))return true;return false}]]},"!":[Nt,[Nt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Nt,[Pt],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Pt,[Pt],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Pt,[Pt],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Pt,zr(jt),(t,e)=>e.map((e=>Je(e.evaluate(t)))).join("")],"resolved-locale":[Pt,[Jt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class is{constructor(t,e){this.expression=t,this._warningHistory={},this._evaluator=new We,this._defaultValue=e?function(t){if("color"===t.type&&$r(t.default))return new Me(0,0,0,0);switch(t.type){case"color":return Me.parse(t.default)||null;case"padding":return Fe.parse(t.default)||null;case"numberArray":return Re.parse(t.default)||null;case"colorArray":return Le.parse(t.default)||null;case"variableAnchorOffsetCollection":return Pe.parse(t.default)||null;case"projectionDefinition":return Te.parse(t.default)||null;default:return void 0===t.default?null:t.default}}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,r,s,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,s,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new ze(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=true,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function rs(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Sr}function ss(t,e){const i=new Xe(Sr,Ur,[],e?function(t){const e={color:Tt,string:Pt,number:Ut,enum:Pt,boolean:Nt,formatted:Ht,padding:Yt,numberArray:Vt,colorArray:$t,projectionDefinition:qt,resolvedImage:Kt,variableAnchorOffsetCollection:Zt};return"array"===t.type?Wt(e[t.value]||jt,t.length):e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?qr(new is(r,e)):Or(i.errors)}class os{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Nr(e.expression),this.globalStateRefs=hs(e.expression)}evaluateWithoutErrorHandling(t,e,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,s,o)}evaluate(t,e,i,r,s,o){return this._styleExpression.evaluate(t,e,i,r,s,o)}}class ns{constructor(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Nr(e.expression),this.globalStateRefs=hs(e.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,e,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,s,o)}evaluate(t,e,i,r,s,o){return this._styleExpression.evaluate(t,e,i,r,s,o)}interpolationFactor(t,e,i){return this.interpolationType?gi.interpolationFactor(this.interpolationType,t,e,i):0}}function as(t,e){const i=ss(t,e);if("error"===i.result)return i;const r=i.value.expression,s=Pr(r);if(!s&&!jr(e))return Or([new Rt("","data expressions not supported")]);const o=Tr(r,["zoom"]);if(!o&&!Jr(e))return Or([new Rt("","zoom expressions not supported")]);const n=As(r);return n||o?n instanceof Rt?Or([n]):n instanceof gi&&!Hr(e)?Or([new Rt("",'"interpolate" expressions cannot be used with this property')]):qr(n?new ns(s?"camera":"composite",i.value,n.labels,n instanceof gi?n.interpolation:void 0):new os(s?"constant":"source",i.value)):Or([new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ls{constructor(t,e){this._parameters=t,this._specification=e,Ft(this,Kr(this._parameters,this._specification))}static deserialize(t){return new ls(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function As(t){let e=null;if(t instanceof ti)e=As(t.result);else if(t instanceof wi){for(const i of t.args)if(e=As(i),e)break}else(t instanceof Ai||t instanceof gi)&&t.input instanceof Gr&&"zoom"===t.input.name&&(e=t);return e instanceof Rt||t.eachChild((t=>{const i=As(t);i instanceof Rt?e=i:!e&&i?e=new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function hs(t,e=new Set){return t instanceof Dr&&e.add(t.key),t.eachChild((t=>{hs(t,e)})),e}function cs(t){if(true===t||false===t)return true;if(!Array.isArray(t)||0===t.length)return false;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return false;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!cs(e)&&"boolean"!=typeof e)return false;return true;default:return true}}const us={type:"boolean",default:false,transition:false,"property-type":"data-driven",expression:{interpolated:false,parameters:["zoom","feature"]}};function fs(t){if(null==t)return{filter:()=>true,needGeometry:false,getGlobalStateRefs:()=>new Set};cs(t)||(t=ps(t));const e=ss(t,us);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,r)=>e.value.evaluate(t,i,{},r),needGeometry:gs(t),getGlobalStateRefs:()=>hs(e.value.expression)}}function ds(t,e){return t<e?-1:t>e?1:0}function gs(t){if(!Array.isArray(t))return false;if("within"===t[0]||"distance"===t[0])return true;for(let e=1;e<t.length;e++)if(gs(t[e]))return true;return false}function ps(t){if(!t)return true;const e=t[0];return t.length<=1?"any"!==e:"=="===e?ms(t[1],t[2],"=="):"!="===e?vs(ms(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?ms(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(ps))):"all"===e?["all"].concat(t.slice(1).map(ps)):"none"===e?["all"].concat(t.slice(1).map(ps).map(vs)):"in"===e?ws(t[1],t.slice(2)):"!in"===e?vs(ws(t[1],t.slice(2))):"has"===e?Is(t[1]):"!has"!==e||vs(Is(t[1]));var i}function ms(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function ws(t,e){if(0===e.length)return false;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(ds)]]:["filter-in-small",t,["literal",e]]}}function Is(t){switch(t){case"$type":return true;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function vs(t){return["!",t]}function bs(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const i of t)e+=`${bs(i)},`;return`${e}]`}const i=Object.keys(t).sort();let r="{";for(let e=0;e<i.length;e++)r+=`${JSON.stringify(i[e])}:${bs(t[i[e]])},`;return`${r}}`}function ys(t){let e="";for(const i of yt)e+=`/${bs(t[i])}`;return e}function Bs(t){const e=t.value;return e?[new Gt(t.key,e,"constants have been deprecated as of v8")]:[]}function Cs(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Es(t){if(Array.isArray(t))return t.map(Es);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Es(t[i]);return e}return Cs(t)}function _s(t){const e=t.key,i=t.value,r=t.valueSpec||{},s=t.objectElementValidators||{},o=t.style,n=t.styleSpec,a=t.validateSpec;let l=[];const A=Yr(i);if("object"!==A)return[new Gt(e,i,`object expected, ${A} found`)];for(const t in i){const A=t.split(".")[0],h=be(r,A)||r["*"];let c;if(be(s,A))c=s[A];else if(be(r,A))c=a;else if(s["*"])c=s["*"];else{if(!r["*"]){l.push(new Gt(e,i[t],`unknown property "${t}"`));continue}c=a}l=l.concat(c({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:h,style:o,styleSpec:n,object:i,objectKey:t,validateSpec:a},i))}for(const t in r)s[t]||r[t].required&&void 0===r[t].default&&void 0===i[t]&&l.push(new Gt(e,i,`missing required property "${t}"`));return l}function Qs(t){const e=t.value,i=t.valueSpec,r=t.style,s=t.styleSpec,o=t.key,n=t.arrayElementValidator||t.validateSpec;if("array"!==Yr(e))return[new Gt(o,e,`array expected, ${Yr(e)} found`)];if(i.length&&e.length!==i.length)return[new Gt(o,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new Gt(o,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let a={type:i.value,values:i.values};s.$version<7&&(a.function=i.function),"object"===Yr(i.value)&&(a=i.value);let l=[];for(let i=0;i<e.length;i++)l=l.concat(n({array:e,arrayIndex:i,value:e[i],valueSpec:a,validateSpec:t.validateSpec,style:r,styleSpec:s,key:`${o}[${i}]`}));return l}function xs(t){const e=t.key,i=t.value,r=t.valueSpec;let s=Yr(i);return"number"===s&&i!=i&&(s="NaN"),"number"!==s?[new Gt(e,i,`number expected, ${s} found`)]:"minimum"in r&&i<r.minimum?[new Gt(e,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new Gt(e,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]}function Ms(t){const e=t.valueSpec,i=Cs(t.value.type);let r,s,o,n={};const a="categorical"!==i&&void 0===t.value.property,l=!a,A="array"===Yr(t.value.stops)&&"array"===Yr(t.value.stops[0])&&"object"===Yr(t.value.stops[0][0]),h=_s({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new Gt(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const r=t.value;return e=e.concat(Qs({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Yr(r)&&0===r.length&&e.push(new Gt(t.key,r,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&a&&h.push(new Gt(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||h.push(new Gt(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Hr(t.valueSpec)&&h.push(new Gt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!jr(t.valueSpec)?h.push(new Gt(t.key,t.value,"property functions not supported")):a&&!Jr(t.valueSpec)&&h.push(new Gt(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!A||void 0!==t.value.property||h.push(new Gt(t.key,t.value,'"property" property is required')),h;function c(t){let i=[];const r=t.value,a=t.key;if("array"!==Yr(r))return[new Gt(a,r,`array expected, ${Yr(r)} found`)];if(2!==r.length)return[new Gt(a,r,`array length 2 expected, length ${r.length} found`)];if(A){if("object"!==Yr(r[0]))return[new Gt(a,r,`object expected, ${Yr(r[0])} found`)];if(void 0===r[0].zoom)return[new Gt(a,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new Gt(a,r,"object stop key must have value")];if(o&&o>Cs(r[0].zoom))return[new Gt(a,r[0].zoom,"stop zoom values must appear in ascending order")];Cs(r[0].zoom)!==o&&(o=Cs(r[0].zoom),s=void 0,n={}),i=i.concat(_s({key:`${a}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:xs,value:u}}))}else i=i.concat(u({key:`${a}[0]`,value:r[0]},r));return rs(Es(r[1]))?i.concat([new Gt(`${a}[1]`,r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${a}[1]`,value:r[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function u(t,o){const a=Yr(t.value),l=Cs(t.value),A=null!==t.value?t.value:o;if(r){if(a!==r)return[new Gt(t.key,A,`${a} stop domain type must match previous stop domain type ${r}`)]}else r=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new Gt(t.key,A,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==i){let r=`number expected, ${a} found`;return jr(e)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Gt(t.key,A,r)]}return"categorical"!==i||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===a&&void 0!==s&&l<s?[new Gt(t.key,A,"stop domain values must appear in ascending order")]:(s=l,"categorical"===i&&l in n?[new Gt(t.key,A,"stop domain values must be unique")]:(n[l]=true,[])):[new Gt(t.key,A,`integer expected, found ${l}`)]}}function ks(t){const e=("property"===t.expressionContext?as:ss)(Es(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new Gt(`${t.key}${e.key}`,t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new Gt(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Nr(i))return[new Gt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Nr(i))return[new Gt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Tr(i,["zoom","feature-state"]))return[new Gt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Pr(i))return[new Gt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ds(t){const e=t.key,i=t.value,r=Yr(i);return"string"!==r?[new Gt(e,i,`color expected, ${r} found`)]:Me.parse(String(i))?[]:[new Gt(e,i,`color expected, "${i}" found`)]}function Ss(t){const e=t.key,i=t.value,r=t.valueSpec,s=[];return Array.isArray(r.values)?-1===r.values.indexOf(Cs(i))&&s.push(new Gt(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(Cs(i))&&s.push(new Gt(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),s}function Gs(t){return cs(Es(t.value))?ks(Ft({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Fs(t)}function Fs(t){const e=t.value,i=t.key;if("array"!==Yr(e))return[new Gt(i,e,`array expected, ${Yr(e)} found`)];const r=t.styleSpec;let s,o=[];if(e.length<1)return[new Gt(i,e,"filter array must have at least 1 element")];switch(o=o.concat(Ss({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator})),Cs(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Cs(e[1])&&o.push(new Gt(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&o.push(new Gt(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(s=Yr(e[1]),"string"!==s&&o.push(new Gt(`${i}[1]`,e[1],`string expected, ${s} found`)));for(let t=2;t<e.length;t++)s=Yr(e[t]),"$type"===Cs(e[1])?o=o.concat(Ss({key:`${i}[${t}]`,value:e[t],valueSpec:r.geometry_type})):"string"!==s&&"number"!==s&&"boolean"!==s&&o.push(new Gt(`${i}[${t}]`,e[t],`string, number, or boolean expected, ${s} found`));break;case"any":case"all":case"none":for(let r=1;r<e.length;r++)o=o.concat(Fs({key:`${i}[${r}]`,value:e[r],styleSpec:t.styleSpec}));break;case"has":case"!has":s=Yr(e[1]),2!==e.length?o.push(new Gt(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==s&&o.push(new Gt(`${i}[1]`,e[1],`string expected, ${s} found`))}return o}function Rs(t,e){const i=t.key,r=t.validateSpec,s=t.style,o=t.styleSpec,n=t.value,a=t.objectKey,l=o[`${e}_${t.layerType}`];if(!l)return[];const A=a.match(/^(.*)-transition$/);if("paint"===e&&A&&l[A[1]]&&l[A[1]].transition)return r({key:i,value:n,valueSpec:o.transition,style:s,styleSpec:o});const h=t.valueSpec||l[a];if(!h)return[new Gt(i,n,`unknown property "${a}"`)];let c;if("string"===Yr(n)&&jr(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(n)))return[new Gt(i,n,`"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];const u=[];return"symbol"===t.layerType&&("text-field"===a&&s&&!s.glyphs&&u.push(new Gt(i,n,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&$r(Es(n))&&"identity"===Cs(n.type)&&u.push(new Gt(i,n,'"text-font" does not support identity functions'))),u.concat(r({key:t.key,value:n,valueSpec:h,style:s,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:a}))}function Ls(t){return Rs(t,"paint")}function zs(t){return Rs(t,"layout")}function Us(t){let e=[];const i=t.value,r=t.key,s=t.style,o=t.styleSpec;if("object"!==Yr(i))return[new Gt(r,i,`object expected, ${Yr(i)} found`)];i.type||i.ref||e.push(new Gt(r,i,'either "type" or "ref" is required'));let n=Cs(i.type);const a=Cs(i.ref);if(i.id){const o=Cs(i.id);for(let n=0;n<t.arrayIndex;n++){const t=s.layers[n];Cs(t.id)===o&&e.push(new Gt(r,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in i&&e.push(new Gt(r,i[t],`"${t}" is prohibited for ref layers`))})),s.layers.forEach((e=>{Cs(e.id)===a&&(t=e)})),t?t.ref?e.push(new Gt(r,i.ref,"ref cannot reference another ref layer")):n=Cs(t.type):e.push(new Gt(r,i.ref,`ref layer "${a}" not found`))}else if("background"!==n)if(i.source){const t=s.sources&&s.sources[i.source],o=t&&Cs(t.type);t?"vector"===o&&"raster"===n?e.push(new Gt(r,i.source,`layer "${i.id}" requires a raster source`)):"raster-dem"!==o&&"hillshade"===n||"raster-dem"!==o&&"color-relief"===n?e.push(new Gt(r,i.source,`layer "${i.id}" requires a raster-dem source`)):"raster"===o&&"raster"!==n?e.push(new Gt(r,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==o||i["source-layer"]?"raster-dem"===o&&"hillshade"!==n&&"color-relief"!==n?e.push(new Gt(r,i.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"!==n||!i.paint||!i.paint["line-gradient"]||"geojson"===o&&t.lineMetrics||e.push(new Gt(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Gt(r,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new Gt(r,i.source,`source "${i.source}" not found`))}else e.push(new Gt(r,i,'missing required property "source"'));return e=e.concat(_s({key:r,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${r}.type`,value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:i,objectKey:"type"}),filter:Gs,layout:t=>_s({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>zs(Ft({layerType:n},t))}}),paint:t=>_s({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Ls(Ft({layerType:n},t))}})}})),e}function Ps(t){const e=t.value,i=t.key,r=Yr(e);return"string"!==r?[new Gt(i,e,`string expected, ${r} found`)]:[]}const Ns={promoteId:function({key:t,value:e}){if("string"===Yr(e))return Ps({key:t,value:e});{const i=[];for(const r in e)i.push(...Ps({key:`${t}.${r}`,value:e[r]}));return i}}};function Ts(t){const e=t.value,i=t.key,r=t.styleSpec,s=t.style,o=t.validateSpec;if(!e.type)return[new Gt(i,e,'"type" is required')];const n=Cs(e.type);let a;switch(n){case"vector":case"raster":return a=_s({key:i,value:e,valueSpec:r[`source_${n.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:Ns,validateSpec:o}),a;case"raster-dem":return a=function(t){var e;const i=null!==(e=t.sourceName)&&void 0!==e?e:"",r=t.value,s=t.styleSpec,o=s.source_raster_dem,n=t.style;let a=[];const l=Yr(r);if(void 0===r)return a;if("object"!==l)return a.push(new Gt("source_raster_dem",r,`object expected, ${l} found`)),a;const A="custom"===Cs(r.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],c=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const e in r)!A&&h.includes(e)?a.push(new Gt(e,r[e],`In "${i}": "${e}" is only valid when "encoding" is set to "custom". ${c} encoding found`)):o[e]?a=a.concat(t.validateSpec({key:e,value:r[e],valueSpec:o[e],validateSpec:t.validateSpec,style:n,styleSpec:s})):a.push(new Gt(e,r[e],`unknown property "${e}"`));return a}({sourceName:i,value:e,style:t.style,styleSpec:r,validateSpec:o}),a;case"geojson":if(a=_s({key:i,value:e,valueSpec:r.source_geojson,style:s,styleSpec:r,validateSpec:o,objectElementValidators:Ns}),e.cluster)for(const t in e.clusterProperties){const[r,s]=e.clusterProperties[t],o="string"==typeof r?[r,["accumulated"],["get",t]]:r;a.push(...ks({key:`${i}.${t}.map`,value:s,expressionContext:"cluster-map"})),a.push(...ks({key:`${i}.${t}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return _s({key:i,value:e,valueSpec:r.source_video,style:s,validateSpec:o,styleSpec:r});case"image":return _s({key:i,value:e,valueSpec:r.source_image,style:s,validateSpec:o,styleSpec:r});case"canvas":return[new Gt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ss({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function qs(t){const e=t.value,i=t.styleSpec,r=i.light,s=t.style;let o=[];const n=Yr(e);if(void 0===e)return o;if("object"!==n)return o=o.concat([new Gt("light",e,`object expected, ${n} found`)]),o;for(const n in e){const a=n.match(/^(.*)-transition$/);o=o.concat(a&&r[a[1]]&&r[a[1]].transition?t.validateSpec({key:n,value:e[n],valueSpec:i.transition,validateSpec:t.validateSpec,style:s,styleSpec:i}):r[n]?t.validateSpec({key:n,value:e[n],valueSpec:r[n],validateSpec:t.validateSpec,style:s,styleSpec:i}):[new Gt(n,e[n],`unknown property "${n}"`)])}return o}function Os(t){const e=t.value,i=t.styleSpec,r=i.sky,s=t.style,o=Yr(e);if(void 0===e)return[];if("object"!==o)return[new Gt("sky",e,`object expected, ${o} found`)];let n=[];for(const o in e)n=n.concat(r[o]?t.validateSpec({key:o,value:e[o],valueSpec:r[o],style:s,styleSpec:i}):[new Gt(o,e[o],`unknown property "${o}"`)]);return n}function js(t){const e=t.value,i=t.styleSpec,r=i.terrain,s=t.style;let o=[];const n=Yr(e);if(void 0===e)return o;if("object"!==n)return o=o.concat([new Gt("terrain",e,`object expected, ${n} found`)]),o;for(const n in e)o=o.concat(r[n]?t.validateSpec({key:n,value:e[n],valueSpec:r[n],validateSpec:t.validateSpec,style:s,styleSpec:i}):[new Gt(n,e[n],`unknown property "${n}"`)]);return o}function Js(t){let e=[];const i=t.value,r=t.key;if(Array.isArray(i)){const s=[],o=[];for(const n in i)i[n].id&&s.includes(i[n].id)&&e.push(new Gt(r,i,`all the sprites' ids must be unique, but ${i[n].id} is duplicated`)),s.push(i[n].id),i[n].url&&o.includes(i[n].url)&&e.push(new Gt(r,i,`all the sprites' URLs must be unique, but ${i[n].url} is duplicated`)),o.push(i[n].url),e=e.concat(_s({key:`${r}[${n}]`,value:i[n],valueSpec:{id:{type:"string",required:true},url:{type:"string",required:true}},validateSpec:t.validateSpec}));return e}return Ps({key:r,value:i})}function Hs(t){return e=t.value,Boolean(e)&&e.constructor===Object?[]:[new Gt(t.key,t.value,`object expected, ${Yr(t.value)} found`)];var e}const Ys={"*":()=>[],array:Qs,boolean:function(t){const e=t.value,i=t.key,r=Yr(e);return"boolean"!==r?[new Gt(i,e,`boolean expected, ${r} found`)]:[]},number:xs,color:Ds,constants:Bs,enum:Ss,filter:Gs,function:Ms,layer:Us,object:_s,source:Ts,light:qs,sky:Os,terrain:js,projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,s=t.style,o=Yr(e);if(void 0===e)return[];if("object"!==o)return[new Gt("projection",e,`object expected, ${o} found`)];let n=[];for(const o in e)n=n.concat(r[o]?t.validateSpec({key:o,value:e[o],valueSpec:r[o],style:s,styleSpec:i}):[new Gt(o,e[o],`unknown property "${o}"`)]);return n},projectionDefinition:function(t){const e=t.key;let i=t.value;i=i instanceof String?i.valueOf():i;const r=Yr(i);return"array"!==r||function(t){return Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]}(i)||function(t){return!!["interpolate","step","literal"].includes(t[0])}(i)?["array","string"].includes(r)?[]:[new Gt(e,i,`projection expected, invalid type "${r}" found`)]:[new Gt(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:Ps,formatted:function(t){return 0===Ps(t).length?[]:ks(t)},resolvedImage:function(t){return 0===Ps(t).length?[]:ks(t)},padding:function(t){const e=t.key,i=t.value;if("array"===Yr(i)){if(i.length<1||i.length>4)return[new Gt(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];const r={type:"number"};let s=[];for(let o=0;o<i.length;o++)s=s.concat(t.validateSpec({key:`${e}[${o}]`,value:i[o],validateSpec:t.validateSpec,valueSpec:r}));return s}return xs({key:e,value:i,valueSpec:{}})},numberArray:function(t){const e=t.key,i=t.value;if("array"===Yr(i)){const r={type:"number"};if(i.length<1)return[new Gt(e,i,"array length at least 1 expected, length 0 found")];let s=[];for(let o=0;o<i.length;o++)s=s.concat(t.validateSpec({key:`${e}[${o}]`,value:i[o],validateSpec:t.validateSpec,valueSpec:r}));return s}return xs({key:e,value:i,valueSpec:{}})},colorArray:function(t){const e=t.key,i=t.value;if("array"===Yr(i)){if(i.length<1)return[new Gt(e,i,"array length at least 1 expected, length 0 found")];let t=[];for(let r=0;r<i.length;r++)t=t.concat(Ds({key:`${e}[${r}]`,value:i[r]}));return t}return Ds({key:e,value:i})},variableAnchorOffsetCollection:function(t){const e=t.key,i=t.value,r=Yr(i),s=t.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new Gt(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let r=0;r<i.length;r+=2)o=o.concat(Ss({key:`${e}[${r}]`,value:i[r],valueSpec:s.layout_symbol["text-anchor"]})),o=o.concat(Qs({key:`${e}[${r+1}]`,value:i[r+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:s}));return o},sprite:Js,state:Hs};function $s(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=$s,i.expression&&$r(Cs(e))?Ms(t):i.expression&&rs(Es(e))?ks(t):i.type&&Ys[i.type]?Ys[i.type](t):_s(Ft({},t,{valueSpec:i.type?r[i.type]:i}))}function Vs(t){const e=t.value,i=t.key,r=Ps(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Gt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Gt(i,e,'"glyphs" url must include a "{range}" token'))),r}function Ks(t,e=bt){let i=[];return i=i.concat($s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:$s,objectElementValidators:{glyphs:Vs,"*":()=>[]}})),t.constants&&(i=i.concat(Bs({key:"constants",value:t.constants}))),Ws(i)}function Zs(t){return function(e){return t({...e,validateSpec:$s})}}function Ws(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function Xs(t){return function(...e){return Ws(t.apply(this,e))}}Ks.source=Xs(Zs(Ts)),Ks.sprite=Xs(Zs(Js)),Ks.glyphs=Xs(Zs(Vs)),Ks.light=Xs(Zs(qs)),Ks.sky=Xs(Zs(Os)),Ks.terrain=Xs(Zs(js)),Ks.state=Xs(Zs(Hs)),Ks.layer=Xs(Zs(Us)),Ks.filter=Xs(Zs(Gs)),Ks.paintProperty=Xs(Zs(Ls)),Ks.layoutProperty=Xs(Zs(zs));const to=Ks,eo=to.light,io=to.sky,ro=to.paintProperty,so=to.layoutProperty;function oo(t,e){let i=false;if(e&&e.length)for(const r of e)t.fire(new It(new Error(r.message))),i=true;return i}class no{constructor(t,e,i){const r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const s=new Int32Array(this.arrayBuffer);t=s[0],this.d=(e=s[1])+2*(i=s[2]);for(let t=0;t<this.d*this.d;t++){const e=s[3+t],i=s[3+t+1];r.push(e===i?null:s.subarray(e,i))}const o=s[3+r.length+1];this.keys=s.subarray(s[3+r.length],o),this.bboxes=s.subarray(o),this.insert=this._insertReadonly}else{this.d=e+2*i;for(let t=0;t<this.d*this.d;t++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;const s=i/e*t;this.min=-s,this.max=t+s}insert(t,e,i,r,s){this._forEachCell(e,i,r,s,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(s)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,i,r,s,o){this.cells[s].push(o)}query(t,e,i,r,s){const o=this.min,n=this.max;if(t<=o&&e<=o&&n<=i&&n<=r&&!s)return Array.prototype.slice.call(this.keys);{const o=[];return this._forEachCell(t,e,i,r,this._queryCell,o,{},s),o}}_queryCell(t,e,i,r,s,o,n,a){const l=this.cells[s];if(null!==l){const s=this.keys,A=this.bboxes;for(let h=0;h<l.length;h++){const c=l[h];if(void 0===n[c]){const l=4*c;(a?a(A[l+0],A[l+1],A[l+2],A[l+3]):t<=A[l+2]&&e<=A[l+3]&&i>=A[l+0]&&r>=A[l+1])?(n[c]=true,o.push(s[c])):n[c]=false}}}}_forEachCell(t,e,i,r,s,o,n,a){const l=this._convertToCellCoord(t),A=this._convertToCellCoord(e),h=this._convertToCellCoord(i),c=this._convertToCellCoord(r);for(let u=l;u<=h;u++)for(let l=A;l<=c;l++){const A=this.d*l+u;if((!a||a(this._convertFromCellCoord(u),this._convertFromCellCoord(l),this._convertFromCellCoord(u+1),this._convertFromCellCoord(l+1)))&&s.call(this,t,e,i,r,A,o,n,a))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let i=0;for(let t=0;t<this.cells.length;t++)i+=this.cells[t].length;const r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let s=e;for(let e=0;e<t.length;e++){const i=t[e];r[3+e]=s,r.set(i,s),s+=i.length}return r[3+t.length]=s,r.set(this.keys,s),s+=this.keys.length,r[3+t.length+1]=s,r.set(this.bboxes,s),s+=this.bboxes.length,r.buffer}static serialize(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}}static deserialize(t){return new no(t.buffer)}}const ao={};function lo(t,e,i={}){if(ao[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:false}),ao[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}lo("Object",Object),lo("Set",Set),lo("TransferableGridIndex",no),lo("Color",Me),lo("Error",Error),lo("AJAXError",ut),lo("ResolvedImage",Ne),lo("StylePropertyFunction",ls),lo("StyleExpression",is,{omit:["_evaluator"]}),lo("ZoomDependentExpression",ns),lo("ZoomConstantExpression",os),lo("CompoundExpression",Gr,{omit:["_evaluate"]});for(const t in Sr)Sr[t]._classRegistryKey||lo(`Expression_${t}`,Sr[t]);function Ao(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function ho(t){return t.$name||t.constructor._classRegistryKey}function co(t){return!function(t){if(null===t||"object"!=typeof t)return false;const e=ho(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||Ao(t)||Z(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function uo(t,e){if(co(t))return(Ao(t)||Z(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(uo(r,e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);const i=ho(t);if(!i)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!ao[i])throw new Error(`${i} is not registered.`);const{klass:r}=ao[i],s=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&s===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const r in t){if(!t.hasOwnProperty(r))continue;if(ao[i].omit.indexOf(r)>=0)continue;const o=t[r];s[r]=ao[i].shallow.indexOf(r)>=0?o:uo(o,e)}t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(s.$name=i),s}function fo(t){if(co(t))return t;if(Array.isArray(t))return t.map(fo);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=ho(t)||"Object";if(!ao[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:i}=ao[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const i of Object.keys(t)){if("$name"===i)continue;const s=t[i];r[i]=ao[e].shallow.indexOf(i)>=0?s:fo(s)}return r}class go{constructor(){this.first=true}update(t,e){const i=Math.floor(t);return this.first?(this.first=false,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,true):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,true))}}const po={"Latin-1 Supplement":t=>t>=128&&t<=255,"Hangul Jamo":t=>t>=4352&&t<=4607,Khmer:t=>t>=6016&&t<=6143,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Kanbun:t=>t>=12688&&t<=12703,"CJK Strokes":t=>t>=12736&&t<=12783,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Hangul Syllables":t=>t>=44032&&t<=55215,"Private Use Area":t=>t>=57344&&t<=63743,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function mo(t){for(const e of t)if(Bo(e.charCodeAt(0)))return true;return false}function wo(t){for(const e of t)if(!bo(e.charCodeAt(0)))return false;return true}function Io(t){const e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}const vo=Io(["Arab","Dupl","Mong","Ougr","Syrc"]);function bo(t){return!vo.test(String.fromCodePoint(t))}const yo=Io(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Bo(t){return!(746!==t&&747!==t&&(t<4352||!(po["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||po["CJK Compatibility"](t)||po["CJK Strokes"](t)||!(!po["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||po["Enclosed CJK Letters and Months"](t)||po["Ideographic Description Characters"](t)||po.Kanbun(t)||po.Katakana(t)&&12540!==t||!(!po["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!po["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||po["Vertical Forms"](t)||po["Yijing Hexagram Symbols"](t)||/\p{sc=Cans}/u.test(String.fromCodePoint(t))||/\p{sc=Hang}/u.test(String.fromCodePoint(t))||yo.test(String.fromCodePoint(t)))))}function Co(t){return!(Bo(t)||function(t){return!!(po["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||po["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||po["Letterlike Symbols"](t)||po["Number Forms"](t)||po["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||po["Control Pictures"](t)&&9251!==t||po["Optical Character Recognition"](t)||po["Enclosed Alphanumerics"](t)||po["Geometric Shapes"](t)||po["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||po["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||po["CJK Symbols and Punctuation"](t)||po.Katakana(t)||po["Private Use Area"](t)||po["CJK Compatibility Forms"](t)||po["Small Form Variants"](t)||po["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}const Eo=Io(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function _o(t){return Eo.test(String.fromCodePoint(t))}function Qo(t,e){return!(!e&&_o(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||po.Khmer(t))}function xo(t){for(const e of t)if(_o(e.charCodeAt(0)))return true;return false}const Mo=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Mo.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,i){return e(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if("loading"!==t.pluginStatus)return this.setState(t),t;const e=t.pluginURL,r=new Promise((t=>{this.loadScriptResolve=t}));i(e);const s=new Promise((t=>setTimeout((()=>t()),this.TIMEOUT)));if(yield Promise.race([r,s]),this.isParsed()){const t={pluginStatus:"loaded",pluginURL:e};return this.setState(t),t}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)}))}};class ko{constructor(t,e){this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new go,this.transition=e.transition||{},this.globalState=e.globalState||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new go,this.transition={},this.globalState={})}isSupportedScript(t){return function(t,e){for(const i of t)if(!Qo(i.charCodeAt(0),e))return false;return true}(t,"loaded"===Mo.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}class Do{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if($r(t))return new ls(t,e);if(rs(t)){const i=as(t,e);if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return i.value}{let i=t;return"color"===e.type&&"string"==typeof t?i=Me.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"numberArray"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"colorArray"!==e.type||"string"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)?i=Pe.parse(t):"projectionDefinition"===e.type&&"string"==typeof t&&(i=Te.parse(t)):i=Le.parse(t):i=Re.parse(t):i=Fe.parse(t),{globalStateRefs:new Set,kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class So{constructor(t){this.property=t,this.value=new Do(t,void 0)}transitioned(t,e){return new Fo(this.property,this.value,e,T({},t.transition,this.transition),t.now)}untransitioned(){return new Fo(this.property,this.value,null,{},0)}}class Go{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return J(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new So(this._values[t].property)),this._values[t].value=new Do(this._values[t].property,null===e?void 0:J(e))}getTransition(t){return J(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new So(this._values[t].property)),this._values[t].transition=J(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const r=this.getTransition(e);void 0!==r&&(t[`${e}-transition`]=r)}return t}transitioned(t,e){const i=new Ro(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,e._values[r]);return i}untransitioned(){const t=new Ro(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Fo{constructor(t,e,i,r,s){this.property=t,this.value=e,this.begin=s+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const r=t.now||0,s=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(r>this.end)return this.prior=null,s;if(this.value.isDataDriven())return this.prior=null,s;if(r<this.begin)return o.possiblyEvaluate(t,e,i);{const n=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),s,L(n))}}return s}}class Ro{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const r=new Uo(this._properties);for(const s of Object.keys(this._values))r._values[s]=this._values[s].possiblyEvaluate(t,e,i);return r}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return true;return false}}class Lo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return J(this._values[t].value)}setValue(t,e){this._values[t]=new Do(this._values[t].property,null===e?void 0:J(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const r=new Uo(this._properties);for(const s of Object.keys(this._values))r._values[s]=this._values[s].possiblyEvaluate(t,e,i);return r}}class zo{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)}}class Uo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Po{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,i){const r=mi[this.specification.type];return r?r(t,e,i):t}}class No{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,r){return new zo(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new zo(this,{kind:"constant",value:void 0},t.parameters);const r=mi[this.specification.type];if(r){const s=r(t.value.value,e.value.value,i);return new zo(this,{kind:"constant",value:s},t.parameters)}return t}evaluate(t,e,i,r,s,o){return"constant"===t.kind?t.value:t.evaluate(e,i,r,s,o)}}class To extends No{possiblyEvaluate(t,e,i,r){if(void 0===t.value)return new zo(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const s=t.expression.evaluate(e,null,{},i,r),o="resolvedImage"===t.property.specification.type&&"string"!=typeof s?s.name:s,n=this._calculate(o,o,o,e);return new zo(this,{kind:"constant",value:n},e)}if("camera"===t.expression.kind){const i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new zo(this,{kind:"constant",value:i},e)}return new zo(this,t.expression,e)}evaluate(t,e,i,r,s,o){if("source"===t.kind){const n=t.evaluate(e,i,r,s,o);return this._calculate(n,n,n,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class qo{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){const s=t.expression.evaluate(e,null,{},i,r);return this._calculate(s,s,s,e)}return this._calculate(t.expression.evaluate(new ko(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ko(Math.floor(e.zoom),e)),t.expression.evaluate(new ko(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Oo{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)}interpolate(){return false}}class jo{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const r=this.defaultPropertyValues[e]=new Do(i,void 0),s=this.defaultTransitionablePropertyValues[e]=new So(i);this.defaultTransitioningPropertyValues[e]=s.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}}lo("DataDrivenProperty",No),lo("DataConstantProperty",Po),lo("CrossFadedDataDrivenProperty",To),lo("CrossFadedProperty",qo),lo("ColorRampProperty",Oo);const Jo="-transition";class Ho extends vt{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>true,needGeometry:false,getGlobalStateRefs:()=>new Set},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=fs(t.filter)),e.layout&&(this._unevaluatedLayout=new Lo(e.layout)),e.paint)){this._transitionablePaint=new Go(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:false});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:false});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Uo(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=fs(t)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){const t=new Set;if(this._unevaluatedLayout)for(const e in this._unevaluatedLayout._values){const i=this._unevaluatedLayout._values[e];for(const e of i.getGlobalStateRefs())t.add(e)}for(const e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}setLayoutProperty(t,e,i={}){null!=e&&this._validate(so,`layers.${this.id}.layout.${t}`,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(Jo)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate(ro,`layers.${this.id}.paint.${t}`,t,e,i))return false;if(t.endsWith(Jo))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),false;{const i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],s=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const n=this._transitionablePaint._values[t].value;return n.isDataDriven()||s||r||this._handleOverridablePaintPropertyUpdate(t,o,n)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,i){return false}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),j(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,r,s={}){return(!s||false!==s.validate)&&oo(this,t.call(to,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:bt,style:{glyphs:true,sprite:true}}))}is3D(){return false}isTileClipped(){return false}hasOffscreenPass(){return false}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof zo&&jr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return true}return false}}const Yo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class $o{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Vo{constructor(){this.isTransferred=false,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=true,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ko(t,e=1){let i=0,r=0;return{members:t.map((t=>{const s=Yo[t.type].BYTES_PER_ELEMENT,o=i=Zo(i,Math.max(e,s)),n=t.components||1;return r=Math.max(r,s),i+=s*n,{name:t.name,type:t.type,components:n,offset:o}})),size:Zo(i,Math.max(r,e)),alignment:e}}function Zo(t,e){return Math.ceil(t/e)*e}class Wo extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t}}Wo.prototype.bytesPerElement=4,lo("StructArrayLayout2i4",Wo);class Xo extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const s=3*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,t}}Xo.prototype.bytesPerElement=6,lo("StructArrayLayout3i6",Xo);class tn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r)}emplace(t,e,i,r,s){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=s,t}}tn.prototype.bytesPerElement=8,lo("StructArrayLayout4i8",tn);class en extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s,o){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r,s,o)}emplace(t,e,i,r,s,o,n){const a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=r,this.int16[a+3]=s,this.int16[a+4]=o,this.int16[a+5]=n,t}}en.prototype.bytesPerElement=12,lo("StructArrayLayout2i4i12",en);class rn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s,o){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r,s,o)}emplace(t,e,i,r,s,o,n){const a=4*t,l=8*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=s,this.uint8[l+6]=o,this.uint8[l+7]=n,t}}rn.prototype.bytesPerElement=8,lo("StructArrayLayout2i4ub8",rn);class sn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t}}sn.prototype.bytesPerElement=8,lo("StructArrayLayout2f8",sn);class on extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s,o,n,a,l,A){const h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,s,o,n,a,l,A)}emplace(t,e,i,r,s,o,n,a,l,A,h){const c=10*t;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=r,this.uint16[c+3]=s,this.uint16[c+4]=o,this.uint16[c+5]=n,this.uint16[c+6]=a,this.uint16[c+7]=l,this.uint16[c+8]=A,this.uint16[c+9]=h,t}}on.prototype.bytesPerElement=20,lo("StructArrayLayout10ui20",on);class nn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s,o,n,a,l,A,h,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,r,s,o,n,a,l,A,h,c)}emplace(t,e,i,r,s,o,n,a,l,A,h,c,u){const f=12*t;return this.int16[f+0]=e,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=s,this.uint16[f+4]=o,this.uint16[f+5]=n,this.uint16[f+6]=a,this.uint16[f+7]=l,this.int16[f+8]=A,this.int16[f+9]=h,this.int16[f+10]=c,this.int16[f+11]=u,t}}nn.prototype.bytesPerElement=24,lo("StructArrayLayout4i4ui4i24",nn);class an extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const s=3*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=r,t}}an.prototype.bytesPerElement=12,lo("StructArrayLayout3f12",an);class ln extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}ln.prototype.bytesPerElement=4,lo("StructArrayLayout1ul4",ln);class An extends Vo{_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(t,e,i,r,s,o,n,a,l){const A=this.length;return this.resize(A+1),this.emplace(A,t,e,i,r,s,o,n,a,l)}emplace(t,e,i,r,s,o,n,a,l,A){const h=10*t,c=5*t;return this.int16[h+0]=e,this.int16[h+1]=i,this.int16[h+2]=r,this.int16[h+3]=s,this.int16[h+4]=o,this.int16[h+5]=n,this.uint32[c+3]=a,this.uint16[h+8]=l,this.uint16[h+9]=A,t}}An.prototype.bytesPerElement=20,lo("StructArrayLayout6i1ul2ui20",An);class hn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s,o){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r,s,o)}emplace(t,e,i,r,s,o,n){const a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=r,this.int16[a+3]=s,this.int16[a+4]=o,this.int16[a+5]=n,t}}hn.prototype.bytesPerElement=12,lo("StructArrayLayout2i2i2i12",hn);class cn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,s)}emplace(t,e,i,r,s,o){const n=4*t,a=8*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,this.int16[a+6]=s,this.int16[a+7]=o,t}}cn.prototype.bytesPerElement=16,lo("StructArrayLayout2f1f2i16",cn);class un extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,s,o){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r,s,o)}emplace(t,e,i,r,s,o,n){const a=16*t,l=4*t,A=8*t;return this.uint8[a+0]=e,this.uint8[a+1]=i,this.float32[l+1]=r,this.float32[l+2]=s,this.int16[A+6]=o,this.int16[A+7]=n,t}}un.prototype.bytesPerElement=16,lo("StructArrayLayout2ub2f2i16",un);class fn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const s=3*t;return this.uint16[s+0]=e,this.uint16[s+1]=i,this.uint16[s+2]=r,t}}fn.prototype.bytesPerElement=6,lo("StructArrayLayout3ui6",fn);class dn extends Vo{_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(t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p){const m=this.length;return this.resize(m+1),this.emplace(m,t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p)}emplace(t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m){const w=24*t,I=12*t,v=48*t;return this.int16[w+0]=e,this.int16[w+1]=i,this.uint16[w+2]=r,this.uint16[w+3]=s,this.uint32[I+2]=o,this.uint32[I+3]=n,this.uint32[I+4]=a,this.uint16[w+10]=l,this.uint16[w+11]=A,this.uint16[w+12]=h,this.float32[I+7]=c,this.float32[I+8]=u,this.uint8[v+36]=f,this.uint8[v+37]=d,this.uint8[v+38]=g,this.uint32[I+10]=p,this.int16[w+22]=m,t}}dn.prototype.bytesPerElement=48,lo("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",dn);class gn extends Vo{_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(t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v,b,y,B,C,E,_,Q){const x=this.length;return this.resize(x+1),this.emplace(x,t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v,b,y,B,C,E,_,Q)}emplace(t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v,b,y,B,C,E,_,Q,x){const M=32*t,k=16*t;return this.int16[M+0]=e,this.int16[M+1]=i,this.int16[M+2]=r,this.int16[M+3]=s,this.int16[M+4]=o,this.int16[M+5]=n,this.int16[M+6]=a,this.int16[M+7]=l,this.uint16[M+8]=A,this.uint16[M+9]=h,this.uint16[M+10]=c,this.uint16[M+11]=u,this.uint16[M+12]=f,this.uint16[M+13]=d,this.uint16[M+14]=g,this.uint16[M+15]=p,this.uint16[M+16]=m,this.uint16[M+17]=w,this.uint16[M+18]=I,this.uint16[M+19]=v,this.uint16[M+20]=b,this.uint16[M+21]=y,this.uint16[M+22]=B,this.uint32[k+12]=C,this.float32[k+13]=E,this.float32[k+14]=_,this.uint16[M+30]=Q,this.uint16[M+31]=x,t}}gn.prototype.bytesPerElement=64,lo("StructArrayLayout8i15ui1ul2f2ui64",gn);class pn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}pn.prototype.bytesPerElement=4,lo("StructArrayLayout1f4",pn);class mn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const s=3*t;return this.uint16[6*t+0]=e,this.float32[s+1]=i,this.float32[s+2]=r,t}}mn.prototype.bytesPerElement=12,lo("StructArrayLayout1ui2f12",mn);class wn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const s=4*t;return this.uint32[2*t+0]=e,this.uint16[s+2]=i,this.uint16[s+3]=r,t}}wn.prototype.bytesPerElement=8,lo("StructArrayLayout1ul2ui8",wn);class In extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t}}In.prototype.bytesPerElement=4,lo("StructArrayLayout2ui4",In);class vn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}vn.prototype.bytesPerElement=2,lo("StructArrayLayout1ui2",vn);class bn extends Vo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r)}emplace(t,e,i,r,s){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=s,t}}bn.prototype.bytesPerElement=16,lo("StructArrayLayout4f16",bn);class yn extends $o{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 l(this.anchorPointX,this.anchorPointY)}}yn.prototype.size=20;class Bn extends An{get(t){return new yn(this,t)}}lo("CollisionBoxArray",Bn);class Cn extends $o{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Cn.prototype.size=48;class En extends dn{get(t){return new Cn(this,t)}}lo("PlacedSymbolArray",En);class _n extends $o{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(t){this._structArray.uint32[this._pos4+12]=t}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]}}_n.prototype.size=64;class Qn extends gn{get(t){return new _n(this,t)}}lo("SymbolInstanceArray",Qn);class xn extends pn{getoffsetX(t){return this.float32[1*t+0]}}lo("GlyphOffsetArray",xn);class Mn extends Xo{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}lo("SymbolLineVertexArray",Mn);class kn extends $o{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]}}kn.prototype.size=12;class Dn extends mn{get(t){return new kn(this,t)}}lo("TextAnchorOffsetArray",Dn);class Sn extends $o{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]}}Sn.prototype.size=8;class Gn extends wn{get(t){return new Sn(this,t)}}lo("FeatureIndexArray",Gn);class Fn extends Wo{}class Rn extends Wo{}class Ln extends Wo{}class zn extends en{}class Un extends rn{}class Pn extends sn{}class Nn extends on{}class Tn extends nn{}class qn extends an{}class On extends ln{}class jn extends hn{}class Jn extends un{}class Hn extends fn{}class Yn extends In{}const $n=Ko([{name:"a_pos",components:2,type:"Int16"}],4),{members:Vn}=$n;class Kn{constructor(t=[]){this._forceNewSegmentOnNextPrepare=false,this.segments=t}prepareSegment(t,e,i,r){const s=this.segments[this.segments.length-1];return t>Kn.MAX_VERTEX_ARRAY_LENGTH&&Y(`Max vertices per segment is ${Kn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${Kn.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!s||s.vertexLength+t>Kn.MAX_VERTEX_ARRAY_LENGTH||s.sortKey!==r?this.createNewSegment(e,i,r):s}createNewSegment(t,e,i){const r={vertexOffset:t.length,primitiveOffset:e.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==i&&(r.sortKey=i),this._forceNewSegmentOnNextPrepare=false,this.segments.push(r),r}getOrCreateLatestSegment(t,e,i){return this.prepareSegment(0,t,e,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=true}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,r){return new Kn([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function Zn(t,e){return 256*(t=P(Math.floor(t),0,255))+P(Math.floor(e),0,255)}Kn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,lo("SegmentVector",Kn);const Wn=Ko([{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 Xn,ta,ea,ia={exports:{}},ra={exports:{}},sa={exports:{}},oa=function(){if(ea)return ia.exports;ea=1;var t=(Xn||(Xn=1,ra.exports=function(t,e){var i,r,s,o,n,a,l,A;for(r=t.length-(i=3&t.length),s=e,n=3432918353,a=461845907,A=0;A<r;)l=255&t.charCodeAt(A)|(255&t.charCodeAt(++A))<<8|(255&t.charCodeAt(++A))<<16|(255&t.charCodeAt(++A))<<24,++A,s=27492+(65535&(o=5*(65535&(s=(s^=l=(65535&(l=(l=(65535&l)*n+(((l>>>16)*n&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(A+2))<<16;case 2:l^=(255&t.charCodeAt(A+1))<<8;case 1:s^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(A)))*n+(((l>>>16)*n&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return s^=t.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,(s^=s>>>16)>>>0}),ra.exports),e=(ta||(ta=1,sa.exports=function(t,e){for(var i,r=t.length,s=e^r,o=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),s=1540483477*(65535&s)+((1540483477*(s>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:s^=(255&t.charCodeAt(o+2))<<16;case 2:s^=(255&t.charCodeAt(o+1))<<8;case 1:s=1540483477*(65535&(s^=255&t.charCodeAt(o)))+((1540483477*(s>>>16)&65535)<<16)}return s=1540483477*(65535&(s^=s>>>13))+((1540483477*(s>>>16)&65535)<<16),(s^=s>>>15)>>>0}),sa.exports);return ia.exports=t,ia.exports.murmur3=t,ia.exports.murmur2=e,ia.exports}(),na=i(oa);class aa{constructor(){this.ids=[],this.positions=[],this.indexed=false}add(t,e,i,r){this.ids.push(la(t)),this.positions.push(e,i,r)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=la(t);let i=0,r=this.ids.length-1;for(;i<r;){const t=i+r>>1;this.ids[t]>=e?r=t:i=t+1}const s=[];for(;this.ids[i]===e;)s.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return s}static serialize(t,e){const i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return Aa(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){const e=new aa;return e.ids=t.ids,e.positions=t.positions,e.indexed=true,e}}function la(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:na(String(t))}function Aa(t,e,i,r){for(;i<r;){const s=t[i+r>>1];let o=i-1,n=r+1;for(;;){do{o++}while(t[o]<s);do{n--}while(t[n]>s);if(o>=n)break;ha(t,o,n),ha(e,3*o,3*n),ha(e,3*o+1,3*n+1),ha(e,3*o+2,3*n+2)}n-i<r-n?(Aa(t,e,i,n),i=n+1):(Aa(t,e,n+1,r),r=n)}}function ha(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}lo("FeaturePositionMap",aa);class ca{constructor(t,e){this.gl=t.gl,this.location=e}}class ua extends ca{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class fa extends ca{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class da extends ca{constructor(t,e){super(t,e),this.current=Me.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const ga=new Float32Array(16);function pa(t){return[Zn(255*t.r,255*t.g),Zn(255*t.b,255*t.a)]}class ma{constructor(t,e,i){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new da(t,e):new ua(t,e)}}class wa{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,i,r){const s="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;s&&t.set(s)}getBinding(t,e,i){return"u_pattern"===i.substr(0,9)?new fa(t,e):new ua(t,e)}}class Ia{constructor(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(t,e,i,r,s){const o=this.paintVertexArray.length,n=this.expression.evaluate(new ko(0),e,{},r,[],s);this.paintVertexArray.resize(t),this._setPaintValue(o,t,n)}updatePaintArray(t,e,i,r){const s=this.expression.evaluate({zoom:0},i,r);this._setPaintValue(t,e,s)}_setPaintValue(t,e,i){if("color"===this.type){const r=pa(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class va{constructor(t,e,i,r,s,o){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=i,this.useIntegerZoom=r,this.zoom=s,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,i,r,s){const o=this.expression.evaluate(new ko(this.zoom),e,{},r,[],s),n=this.expression.evaluate(new ko(this.zoom+1),e,{},r,[],s),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,o,n)}updatePaintArray(t,e,i,r){const s=this.expression.evaluate({zoom:this.zoom},i,r),o=this.expression.evaluate({zoom:this.zoom+1},i,r);this._setPaintValue(t,e,s,o)}_setPaintValue(t,e,i,r){if("color"===this.type){const s=pa(i),o=pa(r);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,s[0],s[1],o[0],o[1])}else{for(let s=t;s<e;s++)this.paintVertexArray.emplace(s,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=P(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,e,i){return new ua(t,e)}}class ba{constructor(t,e,i,r,s,o){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=o,this.zoomInPaintVertexArray=new s,this.zoomOutPaintVertexArray=new s}populatePaintArray(t,e,i){const r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],i)}updatePaintArray(t,e,i,r,s){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],s)}_setPaintValues(t,e,i,r){if(!r||!i)return;const{min:s,mid:o,max:n}=i,a=r[s],l=r[o],A=r[n];if(a&&l&&A)for(let i=t;i<e;i++)this.zoomInPaintVertexArray.emplace(i,l.tl[0],l.tl[1],l.br[0],l.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],l.pixelRatio,a.pixelRatio),this.zoomOutPaintVertexArray.emplace(i,l.tl[0],l.tl[1],l.br[0],l.br[1],A.tl[0],A.tl[1],A.br[0],A.br[1],l.pixelRatio,A.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Wn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Wn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class ya{constructor(t,e,i){this.binders={},this._buffers=[];const r=[];for(const s in t.paint._values){if(!i(s))continue;const o=t.paint.get(s);if(!(o instanceof zo&&jr(o.property.specification)))continue;const n=Ca(s,t.type),a=o.value,l=o.property.specification.type,A=o.property.useIntegerZoom,h=o.property.specification["property-type"],c="cross-faded"===h||"cross-faded-data-driven"===h;if("constant"===a.kind)this.binders[s]=c?new wa(a.value,n):new ma(a.value,n,l),r.push(`/u_${s}`);else if("source"===a.kind||c){const i=Ea(s,l,"source");this.binders[s]=c?new ba(a,l,A,e,i,t.id):new Ia(a,n,l,i),r.push(`/a_${s}`)}else{const t=Ea(s,l,"composite");this.binders[s]=new va(a,n,l,A,e,t),r.push(`/z_${s}`)}}this.cacheKey=r.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Ia||e instanceof va?e.maxValue:0}populatePaintArrays(t,e,i,r,s){for(const o in this.binders){const n=this.binders[o];(n instanceof Ia||n instanceof va||n instanceof ba)&&n.populatePaintArray(t,e,i,r,s)}}setConstantPatternPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof wa&&r.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,i,r,s){let o=false;for(const n in t){const a=e.getPositions(n);for(const e of a){const a=i.feature(e.index);for(const i in this.binders){const l=this.binders[i];if((l instanceof Ia||l instanceof va||l instanceof ba)&&true===l.expression.isStateDependent){const A=r.paint.get(i);l.expression=A.value,l.updatePaintArray(e.start,e.end,a,t[n],s),o=true}}}}return o}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof ma||i instanceof wa)&&t.push(...i.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ia||i instanceof va)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name);else if(i instanceof ba)for(let e=0;e<Wn.members.length;e++)t.push(Wn.members[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof ma||i instanceof wa||i instanceof va)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const i=[];for(const r in this.binders){const s=this.binders[r];if(s instanceof ma||s instanceof wa||s instanceof va)for(const o of s.uniformNames)if(e[o]){const n=s.getBinding(t,e[o],o);i.push({name:o,property:r,binding:n})}}return i}setUniforms(t,e,i,r){for(const{name:t,property:s,binding:o}of e)this.binders[s].setUniform(o,r,i.get(s),t)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const i=this.binders[e];if(t&&i instanceof ba){const e=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(i instanceof Ia||i instanceof va)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Ia||i instanceof va||i instanceof ba)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Ia||e instanceof va||e instanceof ba)&&e.destroy()}}}class Ba{constructor(t,e,i=()=>true){this.programConfigurations={};for(const r of t)this.programConfigurations[r.id]=new ya(r,e,i);this.needsUpload=false,this._featureMap=new aa,this._bufferOffset=0}populatePaintArrays(t,e,i,r,s,o){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,r,s,o);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=true}updatePaintArrays(t,e,i,r){for(const s of i)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(t,this._featureMap,e,s,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=false}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Ca(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function Ea(t,e,i){const r={color:{source:sn,composite:bn},number:{source:pn,composite:sn}},s=function(t){return{"line-pattern":{source:Nn,composite:Nn},"fill-pattern":{source:Nn,composite:Nn},"fill-extrusion-pattern":{source:Nn,composite:Nn}}[t]}(t);return s&&s[i]||r[e][i]}lo("ConstantBinder",ma),lo("CrossFadedConstantBinder",wa),lo("SourceExpressionBinder",Ia),lo("CrossFadedCompositeBinder",ba),lo("CompositeExpressionBinder",va),lo("ProgramConfiguration",ya,{omit:["_buffers"]}),lo("ProgramConfigurationSet",Ba);const _a=Math.pow(2,14)-1,Qa=-_a-1;function xa(t){const e=S/t.extent,i=t.loadGeometry();for(let t=0;t<i.length;t++){const r=i[t];for(let t=0;t<r.length;t++){const i=r[t],s=Math.round(i.x*e),o=Math.round(i.y*e);i.x=P(s,Qa,_a),i.y=P(o,Qa,_a),(s<i.x||s>i.x+1||o<i.y||o>i.y+1)&&Y("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function Ma(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?xa(t):[]}}const ka=-32768;function Da(t,e,i,r,s){t.emplaceBack(ka+8*e+r,ka+8*i+s)}class Sa{constructor(t){this.zoom=t.zoom,this.globalState=t.globalState,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=false,this.layoutVertexArray=new Rn,this.indexArray=new Hn,this.segments=new Kn,this.programConfigurations=new Ba(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){const r=this.layers[0],s=[];let o=null,n=false,a="heatmap"===r.type;if("circle"===r.type){const t=r;o=t.layout.get("circle-sort-key"),n=!o.isConstant(),a=a||"map"===t.paint.get("circle-pitch-alignment")}const l=a?e.subdivisionGranularity.circle:1;for(const{feature:e,id:r,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,A=Ma(e,t);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom,{globalState:this.globalState}),A,i))continue;const h=n?o.evaluate(A,{},i):void 0,c={id:r,properties:e.properties,type:e.type,sourceLayerIndex:l,index:a,geometry:t?A.geometry:xa(e),patterns:{},sortKey:h};s.push(c)}n&&s.sort(((t,e)=>t.sortKey-e.sortKey));for(const r of s){const{geometry:s,index:o,sourceLayerIndex:n}=r,a=t[o].feature;this.addFeature(r,s,o,i,l),e.featureIndex.insert(a,s,o,n,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Vn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,r,s=1){let o;switch(s){case 1:o=[0,7];break;case 3:o=[0,2,5,7];break;case 5:o=[0,1,3,4,6,7];break;case 7:o=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${s}; valid values are 1, 3, 5, 7.`)}const n=o.length;for(const i of e)for(const e of i){const i=e.x,r=e.y;if(i<0||i>=S||r<0||r>=S)continue;const s=this.segments.prepareSegment(n*n,this.layoutVertexArray,this.indexArray,t.sortKey),a=s.vertexLength;for(let t=0;t<n;t++)for(let e=0;e<n;e++)Da(this.layoutVertexArray,i,r,o[e],o[t]);for(let t=0;t<n-1;t++)for(let e=0;e<n-1;e++){const i=a+t*n+e,r=a+(t+1)*n+e;this.indexArray.emplaceBack(i,r+1,i+1),this.indexArray.emplaceBack(i,r,r+1)}s.vertexLength+=n*n,s.primitiveLength+=(n-1)*(n-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},r)}}function Ga(t,e){for(let i=0;i<t.length;i++)if(qa(e,t[i]))return true;for(let i=0;i<e.length;i++)if(qa(t,e[i]))return true;return!!za(t,e)}function Fa(t,e,i){return!!qa(t,e)||!!Pa(e,t,i)}function Ra(t,e){if(1===t.length)return Ta(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let e=0;e<r.length;e++)if(qa(t,r[e]))return true}for(let i=0;i<t.length;i++)if(Ta(e,t[i]))return true;for(let i=0;i<e.length;i++)if(za(t,e[i]))return true;return false}function La(t,e,i){if(t.length>1){if(za(t,e))return true;for(let r=0;r<e.length;r++)if(Pa(e[r],t,i))return true}for(let r=0;r<t.length;r++)if(Pa(t[r],e,i))return true;return false}function za(t,e){if(0===t.length||0===e.length)return false;for(let i=0;i<t.length-1;i++){const r=t[i],s=t[i+1];for(let t=0;t<e.length-1;t++)if(Ua(r,s,e[t],e[t+1]))return true}return false}function Ua(t,e,i,r){return $(t,i,r)!==$(e,i,r)&&$(t,e,i)!==$(t,e,r)}function Pa(t,e,i){const r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(let i=1;i<e.length;i++)if(Na(t,e[i-1],e[i])<r)return true;return false}function Na(t,e,i){const r=e.distSqr(i);if(0===r)return t.distSqr(e);const s=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(s<0?e:s>1?i:i.sub(e)._mult(s)._add(e))}function Ta(t,e){let i,r,s,o=false;for(let n=0;n<t.length;n++){i=t[n];for(let t=0,n=i.length-1;t<i.length;n=t++)r=i[t],s=i[n],r.y>e.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(o=!o)}return o}function qa(t,e){let i=false;for(let r=0,s=t.length-1;r<t.length;s=r++){const o=t[r],n=t[s];o.y>e.y!=n.y>e.y&&e.x<(n.x-o.x)*(e.y-o.y)/(n.y-o.y)+o.x&&(i=!i)}return i}function Oa(t,e,i){const r=i[0],s=i[2];if(t.x<r.x&&e.x<r.x||t.x>s.x&&e.x>s.x||t.y<r.y&&e.y<r.y||t.y>s.y&&e.y>s.y)return false;const o=$(t,e,i[0]);return o!==$(t,e,i[1])||o!==$(t,e,i[2])||o!==$(t,e,i[3])}function ja(t,e,i){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Ja(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ha(t,e,i,r,s){if(!e[0]&&!e[1])return t;const o=l.convert(e)._mult(s);"viewport"===i&&o._rotate(-r);const n=[];for(let e=0;e<t.length;e++)n.push(t[e].sub(o));return n}let Ya,$a;lo("CircleBucket",Sa,{omit:["layers"]});var Va={get paint(){return $a=$a||new jo({"circle-radius":new No(bt.paint_circle["circle-radius"]),"circle-color":new No(bt.paint_circle["circle-color"]),"circle-blur":new No(bt.paint_circle["circle-blur"]),"circle-opacity":new No(bt.paint_circle["circle-opacity"]),"circle-translate":new Po(bt.paint_circle["circle-translate"]),"circle-translate-anchor":new Po(bt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Po(bt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Po(bt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new No(bt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new No(bt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new No(bt.paint_circle["circle-stroke-opacity"])})},get layout(){return Ya=Ya||new jo({"circle-sort-key":new No(bt.layout_circle["circle-sort-key"])})}};class Ka extends Ho{constructor(t){super(t,Va)}createBucket(t){return new Sa(t)}queryRadius(t){const e=t;return ja("circle-radius",this,e)+ja("circle-stroke-width",this,e)+Ja(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:s,pixelsToTileUnits:o,unwrappedTileID:n,getElevation:a}){const l=Ha(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-s.bearingInRadians,o),A=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),h="map"===this.paint.get("circle-pitch-alignment"),c=h?l:function(t,e,i,r){return t.map((t=>Za(t,e,i,r)))}(l,s,n,a),u=h?A*o:A;for(const t of r)for(const e of t){const t=h?e:Za(e,s,n,a);let i=u;const r=s.projectTileCoordinates(e.x,e.y,n,a).signedDistanceFromCamera;if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?i*=r/s.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(i*=s.cameraToCenterDistance/r),Fa(c,t,i))return true}return false}}function Za(t,e,i,r){const s=e.projectTileCoordinates(t.x,t.y,i,r).point;return new l((.5*s.x+.5)*e.width,(.5*-s.y+.5)*e.height)}class Wa extends Sa{}let Xa;lo("HeatmapBucket",Wa,{omit:["layers"]});var tl={get paint(){return Xa=Xa||new jo({"heatmap-radius":new No(bt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new No(bt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Po(bt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Oo(bt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Po(bt.paint_heatmap["heatmap-opacity"])})}};function el(t,{width:e,height:i},r,s){if(s){if(s instanceof Uint8ClampedArray)s=new Uint8Array(s.buffer);else if(s.length!==e*i*r)throw new RangeError(`mismatched image size. expected: ${s.length} but got: ${e*i*r}`)}else s=new Uint8Array(e*i*r);return t.width=e,t.height=i,t.data=s,t}function il(t,{width:e,height:i},r){if(e===t.width&&i===t.height)return;const s=el({},{width:e,height:i},r);rl(t,s,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},r),t.width=e,t.height=i,t.data=s.data}function rl(t,e,i,r,s,o){if(0===s.width||0===s.height)return e;if(s.width>t.width||s.height>t.height||i.x>t.width-s.width||i.y>t.height-s.height)throw new RangeError("out of range source coordinates for image copy");if(s.width>e.width||s.height>e.height||r.x>e.width-s.width||r.y>e.height-s.height)throw new RangeError("out of range destination coordinates for image copy");const n=t.data,a=e.data;if(n===a)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<s.height;l++){const A=((i.y+l)*t.width+i.x)*o,h=((r.y+l)*e.width+r.x)*o;for(let t=0;t<s.width*o;t++)a[h+t]=n[A+t]}return e}class sl{constructor(t,e){el(this,t,1,e)}resize(t){il(this,t,1)}clone(){return new sl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,s){rl(t,e,i,r,s,1)}}class ol{constructor(t,e){el(this,t,4,e)}resize(t){il(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ol({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,s){rl(t,e,i,r,s,4)}setPixel(t,e,i){const r=4*(t*this.width+e);this.data[r+0]=Math.round(255*i.r/i.a),this.data[r+1]=Math.round(255*i.g/i.a),this.data[r+2]=Math.round(255*i.b/i.a),this.data[r+3]=Math.round(255*i.a)}}function nl(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,s=t.image||new ol({width:i,height:r});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const o=(r,o,n)=>{e[t.evaluationKey]=n;const a=t.expression.evaluate(e);s.setPixel(r/4/i,o/4,a)};if(t.clips)for(let e=0,s=0;e<r;++e,s+=4*i)for(let r=0,n=0;r<i;r++,n+=4){const a=r/(i-1),{start:l,end:A}=t.clips[e];o(s,n,l*(1-a)+A*a)}else for(let t=0,e=0;t<i;t++,e+=4)o(0,e,t/(i-1));return s}lo("AlphaImage",sl),lo("RGBAImage",ol);const al="big-fb";class ll extends Ho{createBucket(t){return new Wa(t)}constructor(t){super(t,tl),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=nl({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(al)&&this.heatmapFbos.delete(al)}queryRadius(){return 0}queryIntersectsFeature(){return false}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let Al;var hl={get paint(){return Al=Al||new jo({"hillshade-illumination-direction":new Po(bt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Po(bt.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Po(bt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Po(bt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Po(bt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Po(bt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Po(bt.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Po(bt.paint_hillshade["hillshade-method"])})}};class cl extends Ho{constructor(t){super(t,hl),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,r=this.paint.get("hillshade-shadow-color").values;const s=Math.max(t.length,e.length,i.length,r.length);t=t.concat(Array(s-t.length).fill(t.at(-1))),e=e.concat(Array(s-e.length).fill(e.at(-1))),i=i.concat(Array(s-i.length).fill(i.at(-1))),r=r.concat(Array(s-r.length).fill(r.at(-1)));const o=e.map(rt);return{directionRadians:t.map(rt),altitudeRadians:o,shadowColor:r,highlightColor:i}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}let ul;var fl={get paint(){return ul=ul||new jo({"color-relief-opacity":new Po(bt["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Oo(bt["paint_color-relief"]["color-relief-color"])})}};class dl{constructor(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,r)}update(t,e,i){const{width:r,height:s}=t,o=!(this.size&&this.size[0]===r&&this.size[1]===s||i),{context:n}=this,{gl:a}=n;if(this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),n.pixelStoreUnpackFlipY.set(false),n.pixelStoreUnpack.set(1),n.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!e||false!==e.premultiply)),o)this.size=[r,s],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||Z(t)?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,r,s,0,this.format,a.UNSIGNED_BYTE,t.data);else{const{x:e,y:o}=i||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||Z(t)?a.texSubImage2D(a.TEXTURE_2D,0,e,o,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,e,o,r,s,a.RGBA,a.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D),n.pixelStoreUnpackFlipY.setDefault(),n.pixelStoreUnpack.setDefault(),n.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(t,e,i){const{context:r}=this,{gl:s}=r;s.bindTexture(s.TEXTURE_2D,this.texture),i!==s.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=s.LINEAR),t!==this.filter&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,t),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,e),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}class gl{constructor(t,e,i,r=1,s=1,o=1,n=0){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void Y(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=e.height;const a=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=s,this.blueFactor=o,this.baseShift=n;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let t=0;t<a;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(a,t)]=this.data[this._idx(a-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,a)]=this.data[this._idx(t,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let t=0;t<a;t++)for(let e=0;e<a;e++){const i=this.get(t,e);i>this.max&&(this.max=i),i<this.min&&(this.min=i)}}get(t,e){const i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return this.unpack(i[r],i[r+1],i[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,i){return t*this.redFactor+e*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return pl(t,this.getUnpackVector())}getPixels(){return new ol({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let r=e*this.dim,s=e*this.dim+this.dim,o=i*this.dim,n=i*this.dim+this.dim;switch(e){case-1:r=s-1;break;case 1:s=r+1}switch(i){case-1:o=n-1;break;case 1:n=o+1}const a=-e*this.dim,l=-i*this.dim;for(let e=o;e<n;e++)for(let i=r;i<s;i++)this.data[this._idx(i,e)]=t.data[this._idx(i+a,e+l)]}}function pl(t,e){const i=e[0],r=e[1],s=e[2],o=e[3],n=Math.min(i,r,s),a=Math.round((t+o)/n);return{r:Math.floor(a*n/i)%256,g:Math.floor(a*n/r)%256,b:Math.floor(a*n/s)%256}}lo("DEMData",gl);class ml extends Ho{constructor(t){super(t,fl)}_createColorRamp(t){const e={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof os&&i._styleExpression.expression instanceof gi){this.colorRampExpression=i;const t=i._styleExpression.expression;e.elevationStops=t.labels,e.colorStops=[];for(const i of e.elevationStops)e.colorStops.push(t.evaluate({globals:{elevation:i}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[Me.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;const r={elevationStops:[],colorStops:[]},s=(e.elevationStops.length-1)/(t-1);for(let t=0;t<e.elevationStops.length-.5;t+=s)r.elevationStops.push(e.elevationStops[Math.round(t)]),r.colorStops.push(e.colorStops[Math.round(t)]);return Y(`Too many colors in specification of ${this.id} color-relief layer, may not render properly.`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,e,i){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const r=this._createColorRamp(e),s=new ol({width:r.colorStops.length,height:1}),o=new ol({width:r.colorStops.length,height:1});for(let t=0;t<r.elevationStops.length;t++){const e=pl(r.elevationStops[t],i);o.setPixel(0,t,new Me(e.r/255,e.g/255,e.b/255,1)),s.setPixel(0,t,r.colorStops[t])}return this.colorRampTextures={elevationTexture:new dl(t,o,t.gl.RGBA),colorTexture:new dl(t,s,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return"none"!==this.visibility&&!!this.colorRampTextures}}const wl=Ko([{name:"a_pos",components:2,type:"Int16"}],4),{members:Il}=wl;function vl(t,e,i){const r=i.patternDependencies;let s=false;for(const i of e){const e=i.paint.get(`${t}-pattern`);e.isConstant()||(s=true);const o=e.constantOr(null);o&&(s=true,r[o.to]=true,r[o.from]=true)}return s}function bl(t,e,i,r,s){const o=s.patternDependencies;for(const n of e){const e=n.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:r-1},i,{},s.availableImages),a=e.evaluate({zoom:r},i,{},s.availableImages),l=e.evaluate({zoom:r+1},i,{},s.availableImages);t=t&&t.name?t.name:t,a=a&&a.name?a.name:a,l=l&&l.name?l.name:l,o[t]=true,o[a]=true,o[l]=true,i.patterns[n.id]={min:t,mid:a,max:l}}}return i}function yl(t,e,i,r,s){let o;if(s===function(t,e,i,r){let s=0;for(let o=e,n=i-r;o<i;o+=r)s+=(t[n]-t[o])*(t[o+1]+t[n+1]),n=o;return s}(t,e,i,r)>0)for(let s=e;s<i;s+=r)o=jl(s/r|0,t[s],t[s+1],o);else for(let s=i-r;s>=e;s-=r)o=jl(s/r|0,t[s],t[s+1],o);return o&&Ul(o,o.next)&&(Jl(o),o=o.next),o}function Bl(t,e){if(!t)return t;e||(e=t);let i,r=t;do{if(i=false,r.steiner||!Ul(r,r.next)&&0!==zl(r.prev,r,r.next))r=r.next;else{if(Jl(r),r=e=r.prev,r===r.next)break;i=true}}while(i||r!==e);return e}function Cl(t,e,i,r,s,o,n){if(!t)return;!n&&o&&function(t,e,i,r){let s=t;do{0===s.z&&(s.z=Sl(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){let e,i=1;do{let r,s=t;t=null;let o=null;for(e=0;s;){e++;let n=s,a=0;for(let t=0;t<i&&(a++,n=n.nextZ,n);t++);let l=i;for(;a>0||l>0&&n;)0!==a&&(0===l||!n||s.z<=n.z)?(r=s,s=s.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;s=n}o.nextZ=null,i*=2}while(e>1)}(s)}(t,r,s,o);let a=t;for(;t.prev!==t.next;){const l=t.prev,A=t.next;if(o?_l(t,r,s,o):El(t))e.push(l.i,t.i,A.i),Jl(t),t=A.next,a=A.next;else if((t=A)===a){n?1===n?Cl(t=Ql(Bl(t),e),e,i,r,s,o,2):2===n&&xl(t,e,i,r,s,o):Cl(Bl(t),e,i,r,s,o,1);break}}}function El(t){const e=t.prev,i=t,r=t.next;if(zl(e,i,r)>=0)return false;const s=e.x,o=i.x,n=r.x,a=e.y,l=i.y,A=r.y,h=Math.min(s,o,n),c=Math.min(a,l,A),u=Math.max(s,o,n),f=Math.max(a,l,A);let d=r.next;for(;d!==e;){if(d.x>=h&&d.x<=u&&d.y>=c&&d.y<=f&&Rl(s,a,o,l,n,A,d.x,d.y)&&zl(d.prev,d,d.next)>=0)return false;d=d.next}return true}function _l(t,e,i,r){const s=t.prev,o=t,n=t.next;if(zl(s,o,n)>=0)return false;const a=s.x,l=o.x,A=n.x,h=s.y,c=o.y,u=n.y,f=Math.min(a,l,A),d=Math.min(h,c,u),g=Math.max(a,l,A),p=Math.max(h,c,u),m=Sl(f,d,e,i,r),w=Sl(g,p,e,i,r);let I=t.prevZ,v=t.nextZ;for(;I&&I.z>=m&&v&&v.z<=w;){if(I.x>=f&&I.x<=g&&I.y>=d&&I.y<=p&&I!==s&&I!==n&&Rl(a,h,l,c,A,u,I.x,I.y)&&zl(I.prev,I,I.next)>=0)return false;if(I=I.prevZ,v.x>=f&&v.x<=g&&v.y>=d&&v.y<=p&&v!==s&&v!==n&&Rl(a,h,l,c,A,u,v.x,v.y)&&zl(v.prev,v,v.next)>=0)return false;v=v.nextZ}for(;I&&I.z>=m;){if(I.x>=f&&I.x<=g&&I.y>=d&&I.y<=p&&I!==s&&I!==n&&Rl(a,h,l,c,A,u,I.x,I.y)&&zl(I.prev,I,I.next)>=0)return false;I=I.prevZ}for(;v&&v.z<=w;){if(v.x>=f&&v.x<=g&&v.y>=d&&v.y<=p&&v!==s&&v!==n&&Rl(a,h,l,c,A,u,v.x,v.y)&&zl(v.prev,v,v.next)>=0)return false;v=v.nextZ}return true}function Ql(t,e){let i=t;do{const r=i.prev,s=i.next.next;!Ul(r,s)&&Pl(r,i,i.next,s)&&ql(r,s)&&ql(s,r)&&(e.push(r.i,i.i,s.i),Jl(i),Jl(i.next),i=t=s),i=i.next}while(i!==t);return Bl(i)}function xl(t,e,i,r,s,o){let n=t;do{let t=n.next.next;for(;t!==n.prev;){if(n.i!==t.i&&Ll(n,t)){let a=Ol(n,t);return n=Bl(n,n.next),a=Bl(a,a.next),Cl(n,e,i,r,s,o,0),void Cl(a,e,i,r,s,o,0)}t=t.next}n=n.next}while(n!==t)}function Ml(t,e){let i=t.x-e.x;return 0===i&&(i=t.y-e.y,0===i)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function kl(t,e){const i=function(t,e){let i=e;const r=t.x,s=t.y;let o,n=-1/0;if(Ul(t,i))return i;do{if(Ul(t,i.next))return i.next;if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){const t=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>n&&(n=t,o=i.x<i.next.x?i:i.next,t===r))return o}i=i.next}while(i!==e);if(!o)return null;const a=o,l=o.x,A=o.y;let h=1/0;i=o;do{if(r>=i.x&&i.x>=l&&r!==i.x&&Fl(s<A?r:n,s,l,A,s<A?n:r,s,i.x,i.y)){const e=Math.abs(s-i.y)/(r-i.x);ql(i,t)&&(e<h||e===h&&(i.x>o.x||i.x===o.x&&Dl(o,i)))&&(o=i,h=e)}i=i.next}while(i!==a);return o}(t,e);if(!i)return e;const r=Ol(i,t);return Bl(r,r.next),Bl(i,i.next)}function Dl(t,e){return zl(t.prev,t,e.prev)<0&&zl(e.next,t,t.next)<0}function Sl(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Gl(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Fl(t,e,i,r,s,o,n,a){return(s-n)*(e-a)>=(t-n)*(o-a)&&(t-n)*(r-a)>=(i-n)*(e-a)&&(i-n)*(o-a)>=(s-n)*(r-a)}function Rl(t,e,i,r,s,o,n,a){return!(t===n&&e===a)&&Fl(t,e,i,r,s,o,n,a)}function Ll(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Pl(i,i.next,t,e))return true;i=i.next}while(i!==t);return false}(t,e)&&(ql(t,e)&&ql(e,t)&&function(t,e){let i=t,r=false;const s=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&s<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(zl(t.prev,t,e.prev)||zl(t,e.prev,e))||Ul(t,e)&&zl(t.prev,t,t.next)>0&&zl(e.prev,e,e.next)>0)}function zl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ul(t,e){return t.x===e.x&&t.y===e.y}function Pl(t,e,i,r){const s=Tl(zl(t,e,i)),o=Tl(zl(t,e,r)),n=Tl(zl(i,r,t)),a=Tl(zl(i,r,e));return s!==o&&n!==a||!(0!==s||!Nl(t,i,e))||!(0!==o||!Nl(t,r,e))||!(0!==n||!Nl(i,t,r))||!(0!==a||!Nl(i,e,r))}function Nl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Tl(t){return t>0?1:t<0?-1:0}function ql(t,e){return zl(t.prev,t,t.next)<0?zl(t,e,t.next)>=0&&zl(t,t.prev,e)>=0:zl(t,e,t.prev)<0||zl(t,t.next,e)<0}function Ol(t,e){const i=Hl(t.i,t.x,t.y),r=Hl(e.i,e.x,e.y),s=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function jl(t,e,i,r){const s=Hl(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function Jl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Hl(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}class Yl{constructor(t,e){if(e>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class $l{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}$l.noSubdivision=new $l({fill:new Yl(0,0),line:new Yl(0,0),tile:new Yl(0,0),stencil:new Yl(0,0),circle:1}),lo("SubdivisionGranularityExpression",Yl),lo("SubdivisionGranularitySetting",$l);const Vl=-32768,Kl=32767;class Zl{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=false,this._granularity=t,this._granularityCellSize=S/t,this._canonical=e}_getKey(t,e){return(t+=32768)<<16|e+32768}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const i=0|Math.round(t),r=0|Math.round(e),s=this._getKey(i,r);if(this._vertexDictionary.has(s))return this._vertexDictionary.get(s);const o=this._vertexBuffer.length/2;return this._vertexDictionary.set(s,o),this._vertexBuffer.push(i,r),o}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,e){const i=[];for(let r=0;r<e.length;r+=3){const s=e[r],o=e[r+1],n=e[r+2],a=t[2*s],l=t[2*s+1];(t[2*o]-a)*(t[2*n+1]-l)-(t[2*o+1]-l)*(t[2*n]-a)>0?(i.push(s),i.push(n),i.push(o)):(i.push(s),i.push(o),i.push(n))}return i}(this._vertexBuffer,t);const e=[],i=t.length;for(let r=0;r<i;r+=3){const i=[t[r+0],t[r+1],t[r+2]],s=[this._vertexBuffer[2*t[r+0]+0],this._vertexBuffer[2*t[r+0]+1],this._vertexBuffer[2*t[r+1]+0],this._vertexBuffer[2*t[r+1]+1],this._vertexBuffer[2*t[r+2]+0],this._vertexBuffer[2*t[r+2]+1]];let o=1/0,n=1/0,a=-1/0,l=-1/0;for(let t=0;t<3;t++){const e=s[2*t],i=s[2*t+1];o=Math.min(o,e),a=Math.max(a,e),n=Math.min(n,i),l=Math.max(l,i)}if(o===a||n===l)continue;const A=Math.floor(o/this._granularityCellSize),h=Math.ceil(a/this._granularityCellSize),c=Math.floor(n/this._granularityCellSize),u=Math.ceil(l/this._granularityCellSize);if(A!==h||c!==u)for(let t=c;t<u;t++){const r=this._scanlineGenerateVertexRingForCellRow(t,s,i);tA(this._vertexBuffer,r,e)}else e.push(...i)}return e}_scanlineGenerateVertexRingForCellRow(t,e,i){const r=t*this._granularityCellSize,s=r+this._granularityCellSize,o=[];for(let t=0;t<3;t++){const n=e[2*t],a=e[2*t+1],l=e[2*(t+1)%6],A=e[(2*(t+1)+1)%6],h=e[2*(t+2)%6],c=e[(2*(t+2)+1)%6],u=l-n,f=A-a,d=0===u,g=0===f,p=(r-a)/f,m=(s-a)/f,w=Math.min(p,m),I=Math.max(p,m);if(!g&&(w>=1||I<=0)||g&&(a<r||a>s)){A>=r&&A<=s&&o.push(i[(t+1)%3]);continue}!g&&w>0&&o.push(this._vertexToIndex(n+u*w,a+f*w));const v=n+u*Math.max(w,0),b=n+u*Math.min(I,1);d||this._generateIntraEdgeVertices(o,n,a,l,A,v,b),!g&&I<1&&o.push(this._vertexToIndex(n+u*I,a+f*I)),(g||A>=r&&A<=s)&&o.push(i[(t+1)%3]),!g&&(A<=r||A>=s)&&this._generateInterEdgeVertices(o,n,a,l,A,h,c,b,r,s)}return o}_generateIntraEdgeVertices(t,e,i,r,s,o,n){const a=r-e,l=s-i,A=0===l,h=A?Math.min(e,r):Math.min(o,n),c=A?Math.max(e,r):Math.max(o,n),u=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;if(A?e<r:o<n)for(let r=u;r<=f;r++){const s=r*this._granularityCellSize;t.push(this._vertexToIndex(s,i+l*(s-e)/a))}else for(let r=f;r>=u;r--){const s=r*this._granularityCellSize;t.push(this._vertexToIndex(s,i+l*(s-e)/a))}}_generateInterEdgeVertices(t,e,i,r,s,o,n,a,l,A){const h=s-i,c=o-r,u=n-s,f=(l-s)/u,d=(A-s)/u,g=Math.min(f,d),p=Math.max(f,d),m=r+c*g;let w=Math.floor(Math.min(m,a)/this._granularityCellSize)+1,I=Math.ceil(Math.max(m,a)/this._granularityCellSize)-1,v=a<m;const b=0===u;if(b&&(n===l||n===A))return;if(b||g>=1||p<=0){const t=i-n,r=o+(e-o)*Math.min((l-n)/t,(A-n)/t);w=Math.floor(Math.min(r,a)/this._granularityCellSize)+1,I=Math.ceil(Math.max(r,a)/this._granularityCellSize)-1,v=a<r}const y=h>0?A:l;if(v)for(let e=w;e<=I;e++)t.push(this._vertexToIndex(e*this._granularityCellSize,y));else for(let e=I;e>=w;e--)t.push(this._vertexToIndex(e*this._granularityCellSize,y))}_generateOutline(t){const e=[];for(const i of t){const t=Xl(i,this._granularity,true),r=this._pointArrayToIndices(t),s=[];for(let t=1;t<r.length;t++)s.push(r[t-1]),s.push(r[t]);e.push(s)}return e}_handlePoles(t){let e=false,i=false;this._canonical&&(0===this._canonical.y&&(e=true),this._canonical.y===(1<<this._canonical.z)-1&&(i=true)),(e||i)&&this._fillPoles(t,e,i)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){const i=t[e+1];i===Vl&&(t[e+1]=-32767),i===Kl&&(t[e+1]=32766)}}_generatePoleQuad(t,e,i,r,s,o){r>s!=(o===Vl)?(t.push(e),t.push(i),t.push(this._vertexToIndex(r,o)),t.push(i),t.push(this._vertexToIndex(s,o)),t.push(this._vertexToIndex(r,o))):(t.push(i),t.push(e),t.push(this._vertexToIndex(r,o)),t.push(this._vertexToIndex(s,o)),t.push(i),t.push(this._vertexToIndex(r,o)))}_fillPoles(t,e,i){const r=this._vertexBuffer,s=S,o=t.length;for(let n=2;n<o;n+=3){const o=t[n-2],a=t[n-1],l=t[n],A=r[2*o],h=r[2*o+1],c=r[2*a],u=r[2*a+1],f=r[2*l],d=r[2*l+1];e&&(0===h&&0===u&&this._generatePoleQuad(t,o,a,A,c,Vl),0===u&&0===d&&this._generatePoleQuad(t,a,l,c,f,Vl),0===d&&0===h&&this._generatePoleQuad(t,l,o,f,A,Vl)),i&&(h===s&&u===s&&this._generatePoleQuad(t,o,a,A,c,Kl),u===s&&d===s&&this._generatePoleQuad(t,a,l,c,f,Kl),d===s&&h===s&&this._generatePoleQuad(t,l,o,f,A,Kl))}}_initializeVertices(t){for(let e=0;e<t.length;e+=2)this._vertexToIndex(t[e],t[e+1])}subdividePolygonInternal(t,e){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=true;const{flattened:i,holeIndices:r}=function(t){const e=[],i=[];for(const r of t)if(0!==r.length){r!==t[0]&&e.push(i.length/2);for(let t=0;t<r.length;t++)i.push(r[t].x),i.push(r[t].y)}return{flattened:i,holeIndices:e}}(t);let s;this._initializeVertices(i);try{const t=function(t,e,i=2){const r=e&&e.length,s=r?e[0]*i:t.length;let o=yl(t,0,s,i,true);const n=[];if(!o||o.next===o.prev)return n;let a,l,A;if(r&&(o=function(t,e,i,r){const s=[];for(let i=0,o=e.length;i<o;i++){const n=yl(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,false);n===n.next&&(n.steiner=true),s.push(Gl(n))}s.sort(Ml);for(let t=0;t<s.length;t++)i=kl(s[t],i);return i}(t,e,o,i)),t.length>80*i){a=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=i;o<s;o+=i){const i=t[o],s=t[o+1];i<a&&(a=i),s<l&&(l=s),i>e&&(e=i),s>r&&(r=s)}A=Math.max(e-a,r-l),A=0!==A?32767/A:0}return Cl(o,n,i,a,l,A,0),n}(i,r),e=this._convertIndices(i,t);s=this._subdivideTrianglesScanline(e)}catch(t){console.error(t)}let o=[];return e&&(o=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(s),{verticesFlattened:this._vertexBuffer,indicesTriangles:s,indicesLineList:o}}_convertIndices(t,e){const i=[];for(let r=0;r<e.length;r++)i.push(this._vertexToIndex(t[2*e[r]],t[2*e[r]+1]));return i}_pointArrayToIndices(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i];e.push(this._vertexToIndex(r.x,r.y))}return e}}function Wl(t,e,i,r=true){return new Zl(i,e).subdividePolygonInternal(t,r)}function Xl(t,e,i=false){if(!t||t.length<1)return[];if(t.length<2)return[];const r=t[0],s=t[t.length-1],o=i&&(r.x!==s.x||r.y!==s.y);if(e<2)return o?[...t,t[0]]:[...t];const n=Math.floor(S/e),a=[];a.push(new l(t[0].x,t[0].y));const A=t.length,h=o?A:A-1;for(let e=0;e<h;e++){const i=t[e],r=e<A-1?t[e+1]:t[0],s=i.x,o=i.y,h=r.x,c=r.y,u=s!==h,f=o!==c;if(!u&&!f)continue;const d=h-s,g=c-o,p=Math.abs(d),m=Math.abs(g);let w=s,I=o;for(;;){const t=d>0?(Math.floor(w/n)+1)*n:(Math.ceil(w/n)-1)*n,e=g>0?(Math.floor(I/n)+1)*n:(Math.ceil(I/n)-1)*n,i=Math.abs(w-t),r=Math.abs(I-e),s=Math.abs(w-h),o=Math.abs(I-c),A=u?i/p:Number.POSITIVE_INFINITY,v=f?r/m:Number.POSITIVE_INFINITY;if((s<=i||!u)&&(o<=r||!f))break;if(A<v&&u||!f){w=t,I+=g*A;const e=new l(w,Math.round(I));a[a.length-1].x===e.x&&a[a.length-1].y===e.y||a.push(e)}else{w+=d*v,I=e;const t=new l(Math.round(w),I);a[a.length-1].x===t.x&&a[a.length-1].y===t.y||a.push(t)}}const v=new l(h,c);a[a.length-1].x===v.x&&a[a.length-1].y===v.y||a.push(v)}return a}function tA(t,e,i){if(0===e.length)throw new Error("Subdivision vertex ring is empty.");let r=0,s=t[2*e[0]];for(let i=1;i<e.length;i++){const o=t[2*e[i]];o<s&&(s=o,r=i)}const o=e.length;let n=r,a=(n+1)%o;for(;;){const r=n-1>=0?n-1:o-1,s=(a+1)%o,l=t[2*e[r]],A=t[2*e[s]],h=t[2*e[n]],c=t[2*e[n]+1],u=t[2*e[a]+1];let f=false;if(l<A)f=true;else if(l>A)f=false;else{const i=u-c,o=-(t[2*e[a]]-h),n=c<u?1:-1;((l-h)*i+(t[2*e[r]+1]-c)*o)*n>((A-h)*i+(t[2*e[s]+1]-c)*o)*n&&(f=true)}if(f){const t=e[r],s=e[n],l=e[a];t!==s&&t!==l&&s!==l&&i.push(l,s,t),n--,n<0&&(n=o-1)}else{const t=e[s],r=e[n],l=e[a];t!==r&&t!==l&&r!==l&&i.push(l,r,t),a++,a>=o&&(a=0)}if(r===s)break}}function eA(t,e,i,r,s,o,n,a,l){const A=s.length/2,h=n&&a&&l;if(A<Kn.MAX_VERTEX_ARRAY_LENGTH){const c=e.prepareSegment(A,i,r),u=c.vertexLength;for(let t=0;t<o.length;t+=3)r.emplaceBack(u+o[t],u+o[t+1],u+o[t+2]);let f,d;c.vertexLength+=A,c.primitiveLength+=o.length/3,h&&(d=n.prepareSegment(A,i,a),f=d.vertexLength,d.vertexLength+=A);for(let e=0;e<s.length;e+=2)t(s[e],s[e+1]);if(h)for(let t=0;t<l.length;t++){const e=l[t];for(let t=1;t<e.length;t+=2)a.emplaceBack(f+e[t-1],f+e[t]);d.primitiveLength+=e.length/2}}else!function(t,e,i,r,s,o){const n=[];for(let t=0;t<r.length/2;t++)n.push(-1);const a={count:0};let l=0,A=t.getOrCreateLatestSegment(e,i),h=A.vertexLength;for(let c=2;c<s.length;c+=3){const u=s[c-2],f=s[c-1],d=s[c];let g=n[u]<l,p=n[f]<l,m=n[d]<l;A.vertexLength+((g?1:0)+(p?1:0)+(m?1:0))>Kn.MAX_VERTEX_ARRAY_LENGTH&&(A=t.createNewSegment(e,i),l=a.count,g=true,p=true,m=true,h=0);const w=iA(n,r,o,a,u,g,A),I=iA(n,r,o,a,f,p,A),v=iA(n,r,o,a,d,m,A);i.emplaceBack(h+w-l,h+I-l,h+v-l),A.primitiveLength++}}(e,i,r,s,o,t),h&&function(t,e,i,r,s,o){const n=[];for(let t=0;t<r.length/2;t++)n.push(-1);const a={count:0};let l=0,A=t.getOrCreateLatestSegment(e,i),h=A.vertexLength;for(let c=0;c<s.length;c++){const u=s[c];for(let f=1;f<s[c].length;f+=2){const s=u[f-1],c=u[f];let d=n[s]<l,g=n[c]<l;A.vertexLength+((d?1:0)+(g?1:0))>Kn.MAX_VERTEX_ARRAY_LENGTH&&(A=t.createNewSegment(e,i),l=a.count,d=true,g=true,h=0);const p=iA(n,r,o,a,s,d,A),m=iA(n,r,o,a,c,g,A);i.emplaceBack(h+p-l,h+m-l),A.primitiveLength++}}}(n,i,a,s,l,t),e.forceNewSegmentOnNextPrepare(),null==n||n.forceNewSegmentOnNextPrepare()}function iA(t,e,i,r,s,o,n){if(o){const o=r.count;return i(e[2*s],e[2*s+1]),t[s]=r.count,r.count++,n.vertexLength++,o}return t[s]}class rA{constructor(t){this.zoom=t.zoom,this.globalState=t.globalState,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=false,this.patternFeatures=[],this.layoutVertexArray=new Ln,this.indexArray=new Hn,this.indexArray2=new Yn,this.programConfigurations=new Ba(t.layers,t.zoom),this.segments=new Kn,this.segments2=new Kn,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasPattern=vl("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),s=!r.isConstant(),o=[];for(const{feature:n,id:a,index:l,sourceLayerIndex:A}of t){const t=this.layers[0]._featureFilter.needGeometry,h=Ma(n,t);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom,{globalState:this.globalState}),h,i))continue;const c=s?r.evaluate(h,{},i,e.availableImages):void 0,u={id:a,properties:n.properties,type:n.type,sourceLayerIndex:A,index:l,geometry:t?h.geometry:xa(n),patterns:{},sortKey:c};o.push(u)}s&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const r of o){const{geometry:s,index:o,sourceLayerIndex:n}=r;if(this.hasPattern){const t=bl("fill",this.layers,r,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(r,s,o,i,{},e.subdivisionGranularity);e.featureIndex.insert(t[o].feature,s,o,n,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,e,i,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Il),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,r,s,o){for(const t of ir(e,500)){const e=Wl(t,r,o.fill.getGranularityForZoomLevel(r.z)),i=this.layoutVertexArray;eA(((t,e)=>{i.emplaceBack(t,e)}),this.segments,this.layoutVertexArray,this.indexArray,e.verticesFlattened,e.indicesTriangles,this.segments2,this.indexArray2,e.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,s,r)}}let sA,oA;lo("FillBucket",rA,{omit:["layers","patternFeatures"]});var nA={get paint(){return oA=oA||new jo({"fill-antialias":new Po(bt.paint_fill["fill-antialias"]),"fill-opacity":new No(bt.paint_fill["fill-opacity"]),"fill-color":new No(bt.paint_fill["fill-color"]),"fill-outline-color":new No(bt.paint_fill["fill-outline-color"]),"fill-translate":new Po(bt.paint_fill["fill-translate"]),"fill-translate-anchor":new Po(bt.paint_fill["fill-translate-anchor"]),"fill-pattern":new To(bt.paint_fill["fill-pattern"])})},get layout(){return sA=sA||new jo({"fill-sort-key":new No(bt.layout_fill["fill-sort-key"])})}};class aA extends Ho{constructor(t){super(t,nA)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new rA(t)}queryRadius(){return Ja(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:i,pixelsToTileUnits:r}){return Ra(Ha(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-i.bearingInRadians,r),e)}isTileClipped(){return true}}const lA=Ko([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),AA=Ko([{name:"a_centroid",components:2,type:"Int16"}],4),{members:hA}=lA;var cA,uA,fA,dA,gA,pA,mA,wA={};function IA(){if(uA)return cA;uA=1;var t=o();function e(t,e,r,s,o){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=s,this._values=o,t.readFields(i,this,e)}function i(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e._keys[t.readVarint()],s=e._values[t.readVarint()];e.properties[r]=s}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function r(t){for(var e,i,r=0,s=0,o=t.length,n=o-1;s<o;n=s++)r+=((i=t[n]).x-(e=t[s]).x)*(e.y+i.y);return r}return cA=e,e.types=["Unknown","Point","LineString","Polygon"],e.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var i,r=e.readVarint()+e.pos,s=1,o=0,n=0,a=0,l=[];e.pos<r;){if(o<=0){var A=e.readVarint();s=7&A,o=A>>3}if(o--,1===s||2===s)n+=e.readSVarint(),a+=e.readSVarint(),1===s&&(i&&l.push(i),i=[]),i.push(new t(n,a));else{if(7!==s)throw new Error("unknown command "+s);i&&i.push(i[0].clone())}}return i&&l.push(i),l},e.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,s=0,o=0,n=1/0,a=-1/0,l=1/0,A=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();i=7&h,r=h>>3}if(r--,1===i||2===i)(s+=t.readSVarint())<n&&(n=s),s>a&&(a=s),(o+=t.readSVarint())<l&&(l=o),o>A&&(A=o);else if(7!==i)throw new Error("unknown command "+i)}return[n,l,a,A]},e.prototype.toGeoJSON=function(t,i,s){var o,n,a=this.extent*Math.pow(2,s),l=this.extent*t,A=this.extent*i,h=this.loadGeometry(),c=e.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+l)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+A)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var f=[];for(o=0;o<h.length;o++)f[o]=h[o][0];u(h=f);break;case 2:for(o=0;o<h.length;o++)u(h[o]);break;case 3:for(h=function(t){var e=t.length;if(e<=1)return[t];for(var i,s,o=[],n=0;n<e;n++){var a=r(t[n]);0!==a&&(void 0===s&&(s=a<0),s===a<0?(i&&o.push(i),i=[t[n]]):i.push(t[n]))}return i&&o.push(i),o}(h),o=0;o<h.length;o++)for(n=0;n<h[o].length;n++)u(h[o][n])}1===h.length?h=h[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:h},properties:this.properties};return"id"in this&&(d.id=this.id),d},cA}function vA(){if(dA)return fA;dA=1;var t=IA();function e(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(i,this,e),this.length=this._features.length}function i(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}return fA=e,e.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var i=this._pbf.readVarint()+this._pbf.pos;return new t(this._pbf,i,this.extent,this._keys,this._values)},fA}function bA(){return mA||(mA=1,wA.VectorTile=function(){if(pA)return gA;pA=1;var t=vA();function e(e,i,r){if(3===e){var s=new t(r,r.readVarint()+r.pos);s.length&&(i[s.name]=s)}}return gA=function(t,i){this.layers=t.readFields(e,{},i)},gA}(),wA.VectorTileFeature=IA(),wA.VectorTileLayer=vA()),wA}var yA=i(bA());const BA=yA.VectorTileFeature.types,CA=Math.pow(2,13);function EA(t,e,i,r,s,o,n,a){t.emplaceBack(e,i,2*Math.floor(r*CA)+n,s*CA*2,o*CA*2,Math.round(a))}class _A{constructor(t){this.zoom=t.zoom,this.globalState=t.globalState,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=false,this.layoutVertexArray=new zn,this.centroidVertexArray=new Fn,this.indexArray=new Hn,this.programConfigurations=new Ba(t.layers,t.zoom),this.segments=new Kn,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.features=[],this.hasPattern=vl("fill-extrusion",this.layers,e);for(const{feature:r,id:s,index:o,sourceLayerIndex:n}of t){const t=this.layers[0]._featureFilter.needGeometry,a=Ma(r,t);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom,{globalState:this.globalState}),a,i))continue;const l={id:s,sourceLayerIndex:n,index:o,geometry:t?a.geometry:xa(r),properties:r.properties,type:r.type,patterns:{}};this.hasPattern?this.features.push(bl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,o,i,{},e.subdivisionGranularity),e.featureIndex.insert(r,l.geometry,o,n,this.index,true)}}addFeatures(t,e,i){for(const r of this.features){const{geometry:s}=r;this.addFeature(r,s,r.index,e,i,t.subdivisionGranularity)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hA),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,AA.members,true),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,i,r,s,o){for(const i of ir(e,500)){const e={x:0,y:0,sampleCount:0},s=this.layoutVertexArray.length;this.processPolygon(e,r,t,i,o);const n=this.layoutVertexArray.length-s,a=Math.floor(e.x/e.sampleCount),l=Math.floor(e.y/e.sampleCount);for(let t=0;t<n;t++)this.centroidVertexArray.emplaceBack(a,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,s,r)}processPolygon(t,e,i,r,s){if(r.length<1)return;if(MA(r[0]))return;for(const e of r)0!==e.length&&QA(t,e);const o={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},n=s.fill.getGranularityForZoomLevel(e.z),a="Polygon"===BA[i.type];for(const t of r){if(0===t.length)continue;if(MA(t))continue;const e=Xl(t,n,a);this._generateSideFaces(e,o)}if(!a)return;const l=Wl(r,e,n,false),A=this.layoutVertexArray;eA(((t,e)=>{EA(A,t,e,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let i=0;for(let r=1;r<t.length;r++){const s=t[r],o=t[r-1];if(xA(s,o))continue;e.segment.vertexLength+4>Kn.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const n=s.sub(o)._perp()._unit(),a=o.dist(s);i+a>32768&&(i=0),EA(this.layoutVertexArray,s.x,s.y,n.x,n.y,0,0,i),EA(this.layoutVertexArray,s.x,s.y,n.x,n.y,0,1,i),i+=a,EA(this.layoutVertexArray,o.x,o.y,n.x,n.y,0,0,i),EA(this.layoutVertexArray,o.x,o.y,n.x,n.y,0,1,i);const l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}}function QA(t,e){for(let i=0;i<e.length;i++){const r=e[i];i===e.length-1&&e[0].x===r.x&&e[0].y===r.y||(t.x+=r.x,t.y+=r.y,t.sampleCount++)}}function xA(t,e){return t.x===e.x&&(t.x<0||t.x>S)||t.y===e.y&&(t.y<0||t.y>S)}function MA(t){return t.every((t=>t.x<0))||t.every((t=>t.x>S))||t.every((t=>t.y<0))||t.every((t=>t.y>S))}let kA;lo("FillExtrusionBucket",_A,{omit:["layers","features"]});var DA={get paint(){return kA=kA||new jo({"fill-extrusion-opacity":new Po(bt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new No(bt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Po(bt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Po(bt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new To(bt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new No(bt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new No(bt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Po(bt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class SA extends Ho{constructor(t){super(t,DA)}createBucket(t){return new _A(t)}queryRadius(){return Ja(this.paint.get("fill-extrusion-translate"))}is3D(){return true}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:s,pixelsToTileUnits:o,pixelPosMatrix:n}){const a=Ha(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-s.bearingInRadians,o),A=this.paint.get("fill-extrusion-height").evaluate(e,i),h=this.paint.get("fill-extrusion-base").evaluate(e,i),c=function(t,e){const i=[];for(const r of t){const t=[r.x,r.y,0,1];Q(t,t,e),i.push(new l(t[0]/t[3],t[1]/t[3]))}return i}(a,n),u=function(t,e,i,r){const s=[],o=[],n=r[8]*e,a=r[9]*e,A=r[10]*e,h=r[11]*e,c=r[8]*i,u=r[9]*i,f=r[10]*i,d=r[11]*i;for(const e of t){const t=[],i=[];for(const s of e){const e=s.x,o=s.y,g=r[0]*e+r[4]*o+r[12],p=r[1]*e+r[5]*o+r[13],m=r[2]*e+r[6]*o+r[14],w=r[3]*e+r[7]*o+r[15],I=m+A,v=w+h,b=g+c,y=p+u,B=m+f,C=w+d,E=new l((g+n)/v,(p+a)/v);E.z=I/v,t.push(E);const _=new l(b/C,y/C);_.z=B/C,i.push(_)}s.push(t),o.push(i)}return[s,o]}(r,h,A,n);return function(t,e,i){let r=1/0;Ra(i,e)&&(r=FA(i,e[0]));for(let s=0;s<e.length;s++){const o=e[s],n=t[s];for(let t=0;t<o.length-1;t++){const e=o[t],s=[e,o[t+1],n[t+1],n[t],e];Ga(i,s)&&(r=Math.min(r,FA(i,s)))}}return r!==1/0&&r}(u[0],u[1],c)}}function GA(t,e){return t.x*e.x+t.y*e.y}function FA(t,e){if(1===t.length){let i=0;const r=e[i++];let s;for(;!s||r.equals(s);)if(s=e[i++],!s)return 1/0;for(;i<e.length;i++){const o=e[i],n=t[0],a=s.sub(r),l=o.sub(r),A=n.sub(r),h=GA(a,a),c=GA(a,l),u=GA(l,l),f=GA(A,a),d=GA(A,l),g=h*u-c*c,p=(u*f-c*d)/g,m=(h*d-c*f)/g,w=r.z*(1-p-m)+s.z*p+o.z*m;if(isFinite(w))return w}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}const RA=Ko([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:LA}=RA,zA=Ko([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:UA}=zA,PA=yA.VectorTileFeature.types,NA=Math.cos(Math.PI/180*37.5),TA=Math.pow(2,14)/.5;class qA{constructor(t){this.zoom=t.zoom,this.globalState=t.globalState,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=false,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Un,this.layoutVertexArray2=new Pn,this.indexArray=new Hn,this.programConfigurations=new Ba(t.layers,t.zoom),this.segments=new Kn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasPattern=vl("line",this.layers,e);const r=this.layers[0].layout.get("line-sort-key"),s=!r.isConstant(),o=[];for(const{feature:e,id:n,index:a,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,A=Ma(e,t);if(!this.layers[0]._featureFilter.filter(new ko(this.zoom,{globalState:this.globalState}),A,i))continue;const h=s?r.evaluate(A,{},i):void 0,c={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:a,geometry:t?A.geometry:xa(e),patterns:{},sortKey:h};o.push(c)}s&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const r of o){const{geometry:s,index:o,sourceLayerIndex:n}=r;if(this.hasPattern){const t=bl("line",this.layers,r,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(r,s,o,i,{},e.subdivisionGranularity);e.featureIndex.insert(t[o].feature,s,o,n,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,e,i,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,UA)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,LA),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,r,s,o){const n=this.layers[0].layout,a=n.get("line-join").evaluate(t,{}),l=n.get("line-cap"),A=n.get("line-miter-limit"),h=n.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,a,l,A,h,r,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,s,r)}addLine(t,e,i,r,s,o,n,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=Xl(t,n?a.line.getGranularityForZoomLevel(n.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const l="Polygon"===PA[e.type];let A=t.length;for(;A>=2&&t[A-1].equals(t[A-2]);)A--;let h=0;for(;h<A-1&&t[h].equals(t[h+1]);)h++;if(A<(l?3:2))return;"bevel"===i&&(s=1.05);const c=this.overscaling<=16?122880/(512*this.overscaling):0,u=this.segments.prepareSegment(10*A,this.layoutVertexArray,this.indexArray);let f,d,g,p,m;this.e1=this.e2=-1,l&&(f=t[A-2],m=t[h].sub(f)._unit()._perp());for(let e=h;e<A;e++){if(g=e===A-1?l?t[h+1]:void 0:t[e+1],g&&t[e].equals(g))continue;m&&(p=m),f&&(d=f),f=t[e],m=g?g.sub(f)._unit()._perp():p,p=p||m;let n=p.add(m);0===n.x&&0===n.y||n._unit();const a=p.x*m.x+p.y*m.y,w=n.x*m.x+n.y*m.y,I=0!==w?1/w:1/0,v=2*Math.sqrt(2-2*w),b=w<NA&&d&&g,y=p.x*m.y-p.y*m.x>0;if(b&&e>h){const t=f.dist(d);if(t>2*c){const e=f.sub(f.sub(d)._mult(c/t)._round());this.updateDistance(d,e),this.addCurrentVertex(e,p,0,0,u),d=e}}const B=d&&g;let C=B?i:l?"butt":r;if(B&&"round"===C&&(I<o?C="miter":I<=2&&(C="fakeround")),"miter"===C&&I>s&&(C="bevel"),"bevel"===C&&(I>2&&(C="flipbevel"),I<s&&(C="miter")),d&&this.updateDistance(d,f),"miter"===C)n._mult(I),this.addCurrentVertex(f,n,0,0,u);else if("flipbevel"===C){if(I>100)n=m.mult(-1);else{const t=I*p.add(m).mag()/p.sub(m).mag();n._perp()._mult(t*(y?-1:1))}this.addCurrentVertex(f,n,0,0,u),this.addCurrentVertex(f,n.mult(-1),0,0,u)}else if("bevel"===C||"fakeround"===C){const t=-Math.sqrt(I*I-1),e=y?t:0,i=y?0:t;if(d&&this.addCurrentVertex(f,p,e,i,u),"fakeround"===C){const t=Math.round(180*v/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+a*(a*(3.55645-1.43519*a)-3.2452))*t*t+(.848013+a*(.215638*a-1.06021)))}const r=m.sub(p)._mult(i)._add(p)._unit()._mult(y?-1:1);this.addHalfVertex(f,r.x,r.y,false,y,0,u)}}g&&this.addCurrentVertex(f,m,-e,-i,u)}else if("butt"===C)this.addCurrentVertex(f,n,0,0,u);else if("square"===C){const t=d?1:-1;this.addCurrentVertex(f,n,t,t,u)}else"round"===C&&(d&&(this.addCurrentVertex(f,p,0,0,u),this.addCurrentVertex(f,p,1,1,u,true)),g&&(this.addCurrentVertex(f,m,-1,-1,u,true),this.addCurrentVertex(f,m,0,0,u)));if(b&&e<A-1){const t=f.dist(g);if(t>2*c){const e=f.add(g.sub(f)._mult(c/t)._round());this.updateDistance(f,e),this.addCurrentVertex(e,m,0,0,u),f=e}}}}addCurrentVertex(t,e,i,r,s,o=false){const n=e.y*r-e.x,a=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,false,i,s),this.addHalfVertex(t,n,a,o,true,-r,s),this.distance>TA/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,r,s,o))}addHalfVertex({x:t,y:e},i,r,s,o,n,a){const l=.5*(this.lineClips?this.scaledDistance*(TA-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(s?1:0),(e<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*r)+128,1+(0===n?0:n<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 A=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,A,this.e2),a.primitiveLength++),o?this.e2=A:this.e1=A}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}let OA,jA;lo("LineBucket",qA,{omit:["layers","patternFeatures"]});var JA={get paint(){return jA=jA||new jo({"line-opacity":new No(bt.paint_line["line-opacity"]),"line-color":new No(bt.paint_line["line-color"]),"line-translate":new Po(bt.paint_line["line-translate"]),"line-translate-anchor":new Po(bt.paint_line["line-translate-anchor"]),"line-width":new No(bt.paint_line["line-width"]),"line-gap-width":new No(bt.paint_line["line-gap-width"]),"line-offset":new No(bt.paint_line["line-offset"]),"line-blur":new No(bt.paint_line["line-blur"]),"line-dasharray":new qo(bt.paint_line["line-dasharray"]),"line-pattern":new To(bt.paint_line["line-pattern"]),"line-gradient":new Oo(bt.paint_line["line-gradient"])})},get layout(){return OA=OA||new jo({"line-cap":new Po(bt.layout_line["line-cap"]),"line-join":new No(bt.layout_line["line-join"]),"line-miter-limit":new Po(bt.layout_line["line-miter-limit"]),"line-round-limit":new Po(bt.layout_line["line-round-limit"]),"line-sort-key":new No(bt.layout_line["line-sort-key"])})}};class HA extends No{possiblyEvaluate(t,e){return e=new ko(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=T({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}let YA;class $A extends Ho{constructor(t){super(t,JA),this.gradientVersion=0,YA||(YA=new HA(JA.paint.properties["line-width"].specification),YA.useIntegerZoom=true)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!!function(t){return void 0!==t._styleExpression}(t)&&t._styleExpression.expression instanceof Ai,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=YA.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new qA(t)}queryRadius(t){const e=t,i=VA(ja("line-width",this,e),ja("line-gap-width",this,e)),r=ja("line-offset",this,e);return i/2+Math.abs(r)+Ja(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:s,pixelsToTileUnits:o}){const n=Ha(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-s.bearingInRadians,o),a=o/2*VA(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),A=this.paint.get("line-offset").evaluate(e,i);return A&&(r=function(t,e){const i=[];for(let r=0;r<t.length;r++){const s=t[r],o=[];for(let t=0;t<s.length;t++){const i=s[t-1],r=s[t],n=s[t+1],a=0===t?new l(0,0):r.sub(i)._unit()._perp(),A=t===s.length-1?new l(0,0):n.sub(r)._unit()._perp(),h=a._add(A)._unit(),c=h.x*A.x+h.y*A.y;0!==c&&h._mult(1/c),o.push(h._mult(e)._add(r))}i.push(o)}return i}(r,A*o)),function(t,e,i){for(let r=0;r<e.length;r++){const s=e[r];if(t.length>=3)for(let e=0;e<s.length;e++)if(qa(t,s[e]))return true;if(La(t,s,i))return true}return false}(n,r,a)}isTileClipped(){return true}}function VA(t,e){return e>0?e+2*t:t}const KA=Ko([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ZA=Ko([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ko([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const WA=Ko([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ko([{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 XA=Ko([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),th=Ko([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function eh(t,e,i){return t.sections.forEach((t=>{t.text=function(t,e,i){const r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),Mo.applyArabicShaping&&(t=Mo.applyArabicShaping(t)),t}(t.text,e,i)})),t}Ko([{name:"triangle",components:3,type:"Uint16"}]),Ko([{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"}]),Ko([{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"}]),Ko([{type:"Float32",name:"offsetX"}]),Ko([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ko([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const ih={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var rh,sh,oh,nh=24,ah={};function lh(){return rh||(rh=1,ah.read=function(t,e,i,r,s){var o,n,a=8*s-r-1,l=(1<<a)-1,A=l>>1,h=-7,c=i?s-1:0,u=i?-1:1,f=t[e+c];for(c+=u,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=u,h-=8);for(n=o&(1<<-h)-1,o>>=-h,h+=r;h>0;n=256*n+t[e+c],c+=u,h-=8);if(0===o)o=1-A;else{if(o===l)return n?NaN:1/0*(f?-1:1);n+=Math.pow(2,r),o-=A}return(f?-1:1)*n*Math.pow(2,o-r)},ah.write=function(t,e,i,r,s,o){var n,a,l,A=8*o-s-1,h=(1<<A)-1,c=h>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,n=h):(n=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-n))<1&&(n--,l*=2),(e+=n+c>=1?u/l:u*Math.pow(2,1-c))*l>=2&&(n++,l/=2),n+c>=h?(a=0,n=h):n+c>=1?(a=(e*l-1)*Math.pow(2,s),n+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,s),n=0));s>=8;t[i+f]=255&a,f+=d,a/=256,s-=8);for(n=n<<s|a,A+=s;A>0;t[i+f]=255&n,f+=d,n/=256,A-=8);t[i+f-d]|=128*g}),ah}function Ah(){if(oh)return sh;oh=1,sh=e;var t=lh();function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var i=4294967296,r=1/i,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function o(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function n(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function a(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var s=i.pos-1;s>=t;s--)i.buf[s+r]=i.buf[s]}function l(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function A(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function h(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function c(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function f(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function d(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function m(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function I(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}return e.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),s=r>>3,o=this.pos;this.type=7&r,t(s,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=m(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=I(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=m(this.buf,this.pos)+m(this.buf,this.pos+4)*i;return this.pos+=8,t},readSFixed64:function(){var t=m(this.buf,this.pos)+I(this.buf,this.pos+4)*i;return this.pos+=8,t},readFloat:function(){var e=t.read(this.buf,this.pos,true,23,4);return this.pos+=4,e},readDouble:function(){var e=t.read(this.buf,this.pos,true,52,8);return this.pos+=8,e},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,s,o=i.buf;if(r=(112&(s=o[i.pos++]))>>4,s<128)return n(t,r,e);if(r|=(127&(s=o[i.pos++]))<<3,s<128)return n(t,r,e);if(r|=(127&(s=o[i.pos++]))<<10,s<128)return n(t,r,e);if(r|=(127&(s=o[i.pos++]))<<17,s<128)return n(t,r,e);if(r|=(127&(s=o[i.pos++]))<<24,s<128)return n(t,r,e);if(r|=(1&(s=o[i.pos++]))<<31,s<128)return n(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(true)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&s?function(t,e,i){return s.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",s=e;s<i;){var o,n,a,l=t[s],A=null,h=l>239?4:l>223?3:l>191?2:1;if(s+h>i)break;1===h?l<128&&(A=l):2===h?128==(192&(o=t[s+1]))&&(A=(31&l)<<6|63&o)<=127&&(A=null):3===h?(n=t[s+2],128==(192&(o=t[s+1]))&&128==(192&n)&&((A=(15&l)<<12|(63&o)<<6|63&n)<=2047||A>=55296&&A<=57343)&&(A=null)):4===h&&(n=t[s+2],a=t[s+3],128==(192&(o=t[s+1]))&&128==(192&n)&&128==(192&a)&&((A=(15&l)<<18|(63&o)<<12|(63&n)<<6|63&a)<=65535||A>=1114112)&&(A=null)),null===A?(A=65533,h=1):A>65535&&(A-=65536,r+=String.fromCharCode(A>>>10&1023|55296),A=56320|1023&A),r+=String.fromCharCode(A),s+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,i){if(this.type!==e.Bytes)return t.push(this.readVarint(i));var r=o(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(i));return t},readPackedSVarint:function(t){if(this.type!==e.Bytes)return t.push(this.readSVarint());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==e.Bytes)return t.push(this.readBoolean());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==e.Bytes)return t.push(this.readFloat());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==e.Bytes)return t.push(this.readDouble());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed32());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed32());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed64());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed64());var i=o(this);for(t=t||[];this.pos<i;)t.push(this.readSFixed64());return t},skip:function(t){var i=7&t;if(i===e.Varint)for(;this.buf[this.pos++]>127;);else if(i===e.Bytes)this.pos=this.readVarint()+this.pos;else if(i===e.Fixed32)this.pos+=4;else{if(i!==e.Fixed64)throw new Error("Unimplemented type: "+i);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*r),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*r),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var r,s,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!s){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):s=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(t[i++]=239,t[i++]=191,t[i++]=189,s=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&a(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),t.write(this.buf,e,this.pos,true,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),t.write(this.buf,e,this.pos,true,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&a(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,i,r){this.writeTag(t,e.Bytes),this.writeRawMessage(i,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,p,e)},writeBytesField:function(t,i){this.writeTag(t,e.Bytes),this.writeBytes(i)},writeFixed32Field:function(t,i){this.writeTag(t,e.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(t,i){this.writeTag(t,e.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(t,i){this.writeTag(t,e.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(t,i){this.writeTag(t,e.Fixed64),this.writeSFixed64(i)},writeVarintField:function(t,i){this.writeTag(t,e.Varint),this.writeVarint(i)},writeSVarintField:function(t,i){this.writeTag(t,e.Varint),this.writeSVarint(i)},writeStringField:function(t,i){this.writeTag(t,e.Bytes),this.writeString(i)},writeFloatField:function(t,i){this.writeTag(t,e.Fixed32),this.writeFloat(i)},writeDoubleField:function(t,i){this.writeTag(t,e.Fixed64),this.writeDouble(i)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}},sh}var hh,ch=i(Ah());function uh(t,e,i){1===t&&i.readMessage(fh,e)}function fh(t,e,i){if(3===t){const{id:t,bitmap:r,width:s,height:o,left:n,top:a,advance:l}=i.readMessage(dh,{});e.push({id:t,bitmap:new sl({width:s+6,height:o+6},r),metrics:{width:s,height:o,left:n,top:a,advance:l}})}}function dh(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function gh(t){let e=0,i=0;for(const r of t)e+=r.w*r.h,i=Math.max(i,r.w);t.sort(((t,e)=>e.h-t.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let s=0,o=0;for(const e of t)for(let t=r.length-1;t>=0;t--){const i=r[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,o=Math.max(o,e.y+e.h),s=Math.max(s,e.x+e.w),e.w===i.w&&e.h===i.h){const e=r.pop();t<r.length&&(r[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(r.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:s,h:o,fill:e/(s*o)||0}}class ph{constructor(t,{pixelRatio:e,version:i,stretchX:r,stretchY:s,content:o,textFitWidth:n,textFitHeight:a}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=r,this.stretchY=s,this.content=o,this.version=i,this.textFitWidth=n,this.textFitHeight=a}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class mh{constructor(t,e){const i={},r={};this.haveRenderCallbacks=[];const s=[];this.addImages(t,i,s),this.addImages(e,r,s);const{w:o,h:n}=gh(s),a=new ol({width:o||1,height:n||1});for(const e in t){const r=t[e],s=i[e].paddedRect;ol.copy(r.data,a,{x:0,y:0},{x:s.x+1,y:s.y+1},r.data)}for(const t in e){const i=e[t],s=r[t].paddedRect,o=s.x+1,n=s.y+1,l=i.data.width,A=i.data.height;ol.copy(i.data,a,{x:0,y:0},{x:o,y:n},i.data),ol.copy(i.data,a,{x:0,y:A-1},{x:o,y:n-1},{width:l,height:1}),ol.copy(i.data,a,{x:0,y:0},{x:o,y:n+A},{width:l,height:1}),ol.copy(i.data,a,{x:l-1,y:0},{x:o-1,y:n},{width:1,height:A}),ol.copy(i.data,a,{x:0,y:0},{x:o+l,y:n},{width:1,height:A})}this.image=a,this.iconPositions=i,this.patternPositions=r}addImages(t,e,i){for(const r in t){const s=t[r],o={x:0,y:0,w:s.data.width+2,h:s.data.height+2};i.push(o),e[r]=new ph(o,s),s.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[r,s]=t.tl;i.update(e.data,void 0,{x:r,y:s})}}lo("ImagePosition",ph),lo("ImageAtlas",mh),t.an=void 0,(hh=t.an||(t.an={}))[hh.none=0]="none",hh[hh.horizontal=1]="horizontal",hh[hh.vertical=2]="vertical",hh[hh.horizontalOnly=3]="horizontalOnly";class wh{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(t,e,i){const r=new wh;return r.scale=t||1,r.fontStack=e,r.verticalAlign=i||"bottom",r}static forImage(t,e){const i=new wh;return i.imageName=t,i.verticalAlign=e||"bottom",i}}class Ih{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new Ih;for(let r=0;r<t.sections.length;r++){const s=t.sections[r];s.image?i.addImageSection(s):i.addTextSection(s,e)}return i}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let i=0;i<t.length;i++){const r=t.charCodeAt(i+1)||null,s=t.charCodeAt(i-1)||null;e+=r&&Co(r)&&!ih[t[i+1]]||s&&Co(s)&&!ih[t[i-1]]||!ih[t[i]]?t[i]:ih[t[i]]}return e}(this.text)}trim(){let t=0;for(let e=0;e<this.text.length&&bh[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let i=this.text.length-1;i>=0&&i>=t&&bh[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new Ih;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}getMaxImageSize(t){let e=0,i=0;for(let r=0;r<this.length();r++){const s=this.getSection(r);if(s.imageName){const r=t[s.imageName];if(!r)continue;const o=r.displaySize;e=Math.max(e,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:e,maxImageHeight:i}}addTextSection(t,e){this.text+=t.text,this.sections.push(wh.forText(t.scale,t.fontStack||e,t.verticalAlign));const i=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(i)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void Y("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(wh.forImage(e,t.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):Y("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function vh(e,i,r,s,o,n,a,l,A,h,c,u,f,d,g){const p=Ih.fromFeature(e,o);let m;u===t.an.vertical&&p.verticalizePunctuation();const{processBidirectionalText:w,processStyledBidirectionalText:I}=Mo;if(w&&1===p.sections.length){m=[];const t=w(p.toString(),Mh(p,h,n,i,s,d));for(const e of t){const t=new Ih;t.text=e,t.sections=p.sections;for(let i=0;i<e.length;i++)t.sectionIndex.push(0);m.push(t)}}else if(I){m=[];const t=I(p.text,p.sectionIndex,Mh(p,h,n,i,s,d));for(const e of t){const t=new Ih;t.text=e[0],t.sectionIndex=e[1],t.sections=p.sections,m.push(t)}}else m=function(t,e){const i=[],r=t.text;let s=0;for(const r of e)i.push(t.substring(s,r)),s=r;return s<r.length&&i.push(t.substring(s,r.length)),i}(p,Mh(p,h,n,i,s,d));const v=[],b={positionedLines:v,text:p.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:u,iconsInText:false,verticalizable:false};return function(t,e,i,r,s,o,n,a,l,A,h,c){let u=0,f=0,d=0,g=0;const p="right"===a?1:"left"===a?0:.5,m=nh/c;let w=0;for(const n of s){n.trim();const s=n.getMaxScale(),a={positionedGlyphs:[],lineOffset:0};t.positionedLines[w]=a;const c=a.positionedGlyphs;let I=0;if(!n.length()){f+=o,++w;continue}const v=Dh(r,n,m);for(let o=0;o<n.length();o++){const a=n.getSection(o),d=n.getSectionIndex(o),g=n.getCharCode(o),p=Gh(l,h,g);let w;if(a.imageName){if(t.iconsInText=true,a.scale=a.scale*m,w=Rh(a,p,s,v,r),!w)continue;I=Math.max(I,w.imageOffset)}else if(w=Fh(a,g,p,v,e,i),!w)continue;const{rect:b,metrics:y,baselineOffset:B}=w;c.push({glyph:g,imageName:a.imageName,x:u,y:f+B+-17,vertical:p,scale:a.scale,fontStack:a.fontStack,sectionIndex:d,metrics:y,rect:b}),p?(t.verticalizable=true,u+=(a.imageName?y.advance:nh)*a.scale+A):u+=y.advance*a.scale+A}0!==c.length&&(d=Math.max(u-A,d),Lh(c,0,c.length-1,p)),u=0,a.lineOffset=Math.max(I,(s-1)*nh);const b=o*s+I;f+=b,g=Math.max(b,g),++w}const{horizontalAlign:I,verticalAlign:v}=kh(n);(function(t,e,i,r,s,o,n,a,l){const A=(e-i)*s;let h=0;h=o!==n?-a*r- -17:-r*l*n+.5*n;for(const e of t)for(const t of e.positionedGlyphs)t.x+=A,t.y+=h})(t.positionedLines,p,I,v,d,g,o,f,s.length),t.top+=-v*f,t.bottom=t.top+f,t.left+=-I*d,t.right=t.left+d}(b,i,r,s,m,a,l,A,u,h,f,g),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return false;return true}(v)&&b}const bh={9:true,10:true,11:true,12:true,13:true,32:true},yh={10:true,32:true,38:true,41:true,43:true,45:true,47:true,173:true,183:true,8203:true,8208:true,8211:true,8231:true},Bh={40:true};function Ch(t,e,i,r,s,o){if(e.imageName){const t=r[e.imageName];return t?t.displaySize[0]*e.scale*nh/o+s:0}{const r=i[e.fontStack],o=r&&r[t];return o?o.metrics.advance*e.scale+s:0}}function Eh(t,e,i,r){const s=Math.pow(t-e,2);return r?t<e?s/2:2*s:s+Math.abs(i)*i}function _h(t,e,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Qh(t,e,i,r,s,o){let n=null,a=Eh(e,i,s,o);for(const t of r){const r=Eh(e-t.x,i,s,o)+t.badness;r<=a&&(n=t,a=r)}return{index:t,x:e,priorBreak:n,badness:a}}function xh(t){return t?xh(t.priorBreak).concat(t.index):[]}function Mh(t,e,i,r,s,o){if(!t)return[];const n=[],a=function(t,e,i,r,s,o){let n=0;for(let i=0;i<t.length();i++){const a=t.getSection(i);n+=Ch(t.getCharCode(i),a,r,s,e,o)}return n/Math.max(1,Math.ceil(n/i))}(t,e,i,r,s,o),l=t.text.indexOf("​")>=0;let A=0;for(let i=0;i<t.length();i++){const c=t.getSection(i),u=t.getCharCode(i);if(bh[u]||(A+=Ch(u,c,r,s,e,o)),i<t.length()-1){const e=!((h=u)<11904)&&(!!po["CJK Compatibility Forms"](h)||!!po["CJK Compatibility"](h)||!!po["CJK Strokes"](h)||!!po["CJK Symbols and Punctuation"](h)||!!po["Enclosed CJK Letters and Months"](h)||!!po["Halfwidth and Fullwidth Forms"](h)||!!po["Ideographic Description Characters"](h)||!!po["Vertical Forms"](h)||yo.test(String.fromCodePoint(h)));(yh[u]||e||c.imageName||i!==t.length()-2&&Bh[t.getCharCode(i+1)])&&n.push(Qh(i+1,A,a,n,_h(u,t.getCharCode(i+1),e&&l),false))}}var h;return xh(Qh(t.length(),A,a,n,0,true))}function kh(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Dh(t,e,i){const r=e.getMaxScale()*nh,{maxImageWidth:s,maxImageHeight:o}=e.getMaxImageSize(t),n=Math.max(r,o*i);return{verticalLineContentWidth:Math.max(r,s*i),horizontalLineContentHeight:n}}function Sh(t){switch(t){case"top":return 0;case"center":return.5;default:return 1}}function Gh(e,i,r){return!(e===t.an.horizontal||!i&&!Bo(r)||i&&(bh[r]||(s=r,/\p{sc=Arab}/u.test(String.fromCodePoint(s)))));var s}function Fh(t,e,i,r,s,o){const n=o[t.fontStack],a=function(t,e,i,r){if(t&&t.rect)return t;const s=e[i.fontStack],o=s&&s[r];return o?{rect:null,metrics:o.metrics}:null}(n&&n[e],s,t,e);if(null===a)return null;let l;if(i)l=r.verticalLineContentWidth-t.scale*nh;else{const e=Sh(t.verticalAlign);l=(r.horizontalLineContentHeight-t.scale*nh)*e}return{rect:a.rect,metrics:a.metrics,baselineOffset:l}}function Rh(t,e,i,r,s){const o=s[t.imageName];if(!o)return null;const n=o.paddedRect,a=o.displaySize,l={width:a[0],height:a[1],left:1,top:-3,advance:e?a[1]:a[0]};let A;if(e)A=r.verticalLineContentWidth-a[1]*t.scale;else{const e=Sh(t.verticalAlign);A=(r.horizontalLineContentHeight-a[1]*t.scale)*e}return{rect:n,metrics:l,baselineOffset:A,imageOffset:(e?a[0]:a[1])*t.scale-nh*i}}function Lh(t,e,i,r){if(0===r)return;const s=t[i],o=(t[i].x+s.metrics.advance*s.scale)*r;for(let r=e;r<=i;r++)t[r].x-=o}function zh(t,e,i){const{horizontalAlign:r,verticalAlign:s}=kh(i),o=e[0]-t.displaySize[0]*r,n=e[1]-t.displaySize[1]*s;return{image:t,top:n,bottom:n+t.displaySize[1],left:o,right:o+t.displaySize[0]}}function Uh(t){var e,i;let r=t.left,s=t.top,o=t.right-r,n=t.bottom-s;const a=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(i=t.image.textFitHeight)&&void 0!==i?i:"stretchOrShrink",A=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===a&&o/n<A||"proportional"===a){const t=Math.ceil(n*A);r*=t/o,o=t}}else if("proportional"===a&&"stretchOnly"===l&&0!==A&&o/n>A){const t=Math.ceil(o/A);s*=t/n,n=t}return{x1:r,y1:s,x2:r+o,y2:s+n}}function Ph(t,e,i,r,s,o){const n=t.image;let a;if(n.content){const t=n.content,e=n.pixelRatio||1;a=[t[0]/e,t[1]/e,n.displaySize[0]-t[2]/e,n.displaySize[1]-t[3]/e]}const l=e.left*o,A=e.right*o;let h,c,u,f;"width"===i||"both"===i?(f=s[0]+l-r[3],c=s[0]+A+r[1]):(f=s[0]+(l+A-n.displaySize[0])/2,c=f+n.displaySize[0]);const d=e.top*o,g=e.bottom*o;return"height"===i||"both"===i?(h=s[1]+d-r[0],u=s[1]+g+r[2]):(h=s[1]+(d+g-n.displaySize[1])/2,u=h+n.displaySize[1]),{image:n,top:h,right:c,bottom:u,left:f,collisionPadding:a}}const Nh=128,Th=32640;function qh(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new ko(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:r}=i;let s=0;for(;s<e.length&&e[s]<=t;)s++;s=Math.max(0,s-1);let o=s;for(;o<e.length&&e[o]<t+1;)o++;o=Math.min(e.length-1,o);const n=e[s],a=e[o];return"composite"===i.kind?{kind:"composite",minZoom:n,maxZoom:a,interpolationType:r}:{kind:"camera",minZoom:n,maxZoom:a,minSize:i.evaluate(new ko(n)),maxSize:i.evaluate(new ko(a)),interpolationType:r}}}function Oh(t,e,i){let r="never";const s=t.get(e);return s?r=s:t.get(i)&&(r="always"),r}const jh=yA.VectorTileFeature.types,Jh=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hh(t,e,i,r,s,o,n,a,l,A,h,c,u){const f=a?Math.min(Th,Math.round(a[0])):0,d=a?Math.min(Th,Math.round(a[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*s),o,n,(f<<1)+(l?1:0),d,16*A,16*h,256*c,256*u)}function Yh(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function $h(t){for(const e of t.sections)if(xo(e.text))return true;return false}class Vh{constructor(t){this.layoutVertexArray=new Tn,this.indexArray=new Hn,this.programConfigurations=t,this.segments=new Kn,this.dynamicLayoutVertexArray=new qn,this.opacityVertexArray=new On,this.hasVisibleVertices=false,this.placedSymbolArray=new En}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,KA.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,ZA.members,true),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Jh,true),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}lo("SymbolBuffers",Vh);class Kh{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new Kn,this.collisionVertexArray=new Jn}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,WA.members,true)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}lo("CollisionBuffers",Kh);class Zh{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=false,this.hasRTLText=false,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qh(this.zoom,i["text-size"]),this.iconSizeData=qh(this.zoom,i["icon-size"]);const r=this.layers[0].layout,s=r.get("symbol-sort-key"),o=r.get("symbol-z-order");this.canOverlap="never"!==Oh(r,"text-overlap","text-allow-overlap")||"never"!==Oh(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&!s.isConstant(),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((e=>t.an[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new Vh(new Ba(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Vh(new Ba(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new xn,this.lineVertexArray=new Mn,this.symbolInstances=new Qn,this.textAnchorOffsets=new Dn}calculateGlyphDependencies(t,e,i,r,s){for(let o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=true,(i||r)&&s){const i=ih[t.charAt(o)];i&&(e[i.charCodeAt(0)]=true)}}populate(e,i,r){const s=this.layers[0],o=s.layout,n=o.get("text-font"),a=o.get("text-field"),l=o.get("icon-image"),A=("constant"!==a.value.kind||a.value.value instanceof Ge&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==n.value.kind||n.value.value.length>0),h="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,c=o.get("symbol-sort-key");if(this.features=[],!A&&!h)return;const u=i.iconDependencies,f=i.glyphDependencies,d=i.availableImages,g=new ko(this.zoom,{globalState:this.globalState});for(const{feature:i,id:a,index:l,sourceLayerIndex:p}of e){const e=s._featureFilter.needGeometry,m=Ma(i,e);if(!s._featureFilter.filter(g,m,r))continue;let w,I;if(e||(m.geometry=xa(i)),A){const t=s.getValueAndResolveTokens("text-field",m,r,d),e=Ge.factory(t),i=this.hasRTLText=this.hasRTLText||$h(e);(!i||"unavailable"===Mo.getRTLTextPluginStatus()||i&&Mo.isParsed())&&(w=eh(e,s,m))}if(h){const t=s.getValueAndResolveTokens("icon-image",m,r,d);I=t instanceof Ne?t:Ne.fromString(t)}if(!w&&!I)continue;const v=this.sortFeaturesByKey?c.evaluate(m,{},r):void 0;if(this.features.push({id:a,text:w,icon:I,index:l,sourceLayerIndex:p,geometry:m.geometry,properties:i.properties,type:jh[i.type],sortKey:v}),I&&(u[I.name]=true),w){const e=n.evaluate(m,{},r).join(","),i="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.an.vertical)>=0;for(const t of w.sections)if(t.image)u[t.image.name]=true;else{const r=mo(w.toString()),s=t.fontStack||e,o=f[s]=f[s]||{};this.calculateGlyphDependencies(t.text,o,i,this.allowVerticalPlacement,r)}}}"line"===o.get("symbol-placement")&&(this.features=function(t){const e={},i={},r=[];let s=0;function o(e){r.push(t[e]),s++}function n(t,e,s){const o=i[t];return delete i[t],i[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(s[0]),o}function a(t,i,s){const o=e[i];return delete e[i],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=s[0].concat(r[o].geometry[0]),o}function l(t,e,i){const r=i?e[0][e[0].length-1]:e[0][0];return`${t}:${r.x}:${r.y}`}for(let A=0;A<t.length;A++){const h=t[A],c=h.geometry,u=h.text?h.text.toString():null;if(!u){o(A);continue}const f=l(u,c),d=l(u,c,true);if(f in i&&d in e&&i[f]!==e[d]){const t=a(f,d,c),s=n(f,d,r[t].geometry);delete e[f],delete i[d],i[l(u,r[s].geometry,true)]=s,r[t].geometry=null}else f in i?n(f,d,c):d in e?a(f,d,c):(o(A),e[f]=s-1,i[d]=s-1)}return r.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=true}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]);const s={};for(let r=t.segment+1;r<e.length;r++)s[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:i},r<e.length-1&&(i+=e[r+1].dist(e[r]));for(let i=t.segment||0;i>=0;i--)s[i]={x:e[i].x,y:e[i].y,tileUnitDistanceFromAnchor:r},i>0&&(r+=e[i-1].dist(e[i]));for(let t=0;t<e.length;t++){const e=s[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,i,r,s,o,n,a,l,A,h,c,u){const f=e.indexArray,d=e.layoutVertexArray,g=e.segments.prepareSegment(4*i.length,d,f,this.canOverlap?n.sortKey:void 0),p=this.glyphOffsetArray.length,m=g.vertexLength,w=this.allowVerticalPlacement&&a===t.an.vertical?Math.PI/2:0,I=n.text&&n.text.sections;for(let t=0;t<i.length;t++){const{tl:s,tr:o,bl:a,br:A,tex:h,pixelOffsetTL:c,pixelOffsetBR:p,minFontScaleX:m,minFontScaleY:v,glyphOffset:b,isSDF:y,sectionIndex:B}=i[t],C=g.vertexLength,E=b[1];Hh(d,l.x,l.y,s.x,E+s.y,h.x,h.y,r,y,c.x,c.y,m,v),Hh(d,l.x,l.y,o.x,E+o.y,h.x+h.w,h.y,r,y,p.x,c.y,m,v),Hh(d,l.x,l.y,a.x,E+a.y,h.x,h.y+h.h,r,y,c.x,p.y,m,v),Hh(d,l.x,l.y,A.x,E+A.y,h.x+h.w,h.y+h.h,r,y,p.x,p.y,m,v),Yh(e.dynamicLayoutVertexArray,l,w),f.emplaceBack(C,C+2,C+1),f.emplaceBack(C+1,C+2,C+3),g.vertexLength+=4,g.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),t!==i.length-1&&B===i[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(d.length,n,n.index,{},u,I&&I[B])}e.placedSymbolArray.emplaceBack(l.x,l.y,p,this.glyphOffsetArray.length-p,m,A,h,l.segment,r?r[0]:0,r?r[1]:0,s[0],s[1],a,0,false,0,c)}_addCollisionDebugVertex(t,e,i,r,s,o){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,s,Math.round(o.x),Math.round(o.y))}addCollisionDebugVertices(t,e,i,r,s,o,n){const a=s.segments.prepareSegment(4,s.layoutVertexArray,s.indexArray),A=a.vertexLength,h=s.layoutVertexArray,c=s.collisionVertexArray,u=n.anchorX,f=n.anchorY;this._addCollisionDebugVertex(h,c,o,u,f,new l(t,e)),this._addCollisionDebugVertex(h,c,o,u,f,new l(i,e)),this._addCollisionDebugVertex(h,c,o,u,f,new l(i,r)),this._addCollisionDebugVertex(h,c,o,u,f,new l(t,r)),a.vertexLength+=4;const d=s.indexArray;d.emplaceBack(A,A+1),d.emplaceBack(A+1,A+2),d.emplaceBack(A+2,A+3),d.emplaceBack(A+3,A),a.primitiveLength+=4}addDebugCollisionBoxes(t,e,i,r){for(let s=t;s<e;s++){const t=this.collisionBoxArray.get(s);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,r?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Kh(jn,XA.members,Yn),this.iconCollisionBox=new Kh(jn,XA.members,Yn);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,true),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,true),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,false),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,false)}}_deserializeCollisionBoxesForSymbol(t,e,i,r,s,o,n,a,l){const A={};for(let r=e;r<i;r++){const e=t.get(r);A.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},A.textFeatureIndex=e.featureIndex;break}for(let e=r;e<s;e++){const i=t.get(e);A.verticalTextBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},A.verticalTextFeatureIndex=i.featureIndex;break}for(let e=o;e<n;e++){const i=t.get(e);A.iconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},A.iconFeatureIndex=i.featureIndex;break}for(let e=a;e<l;e++){const i=t.get(e);A.verticalIconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},A.verticalIconFeatureIndex=i.featureIndex;break}return A}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}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(t,e){const i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;e<r;e+=4)t.indexArray.emplaceBack(e,e+2,e+1),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),r=[],s=[],o=[];for(let t=0;t<this.symbolInstances.length;++t){o.push(t);const n=this.symbolInstances.get(t);r.push(0|Math.round(e*n.anchorX+i*n.anchorY)),s.push(n.featureIndex)}return o.sort(((t,e)=>r[t]-r[e]||s[e]-s[t])),o}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Wh,Xh;lo("SymbolBucket",Zh,{omit:["layers","collisionBoxArray","features","compareText"]}),Zh.MAX_GLYPHS=65535,Zh.addDynamicAttributes=Yh;var tc={get paint(){return Xh=Xh||new jo({"icon-opacity":new No(bt.paint_symbol["icon-opacity"]),"icon-color":new No(bt.paint_symbol["icon-color"]),"icon-halo-color":new No(bt.paint_symbol["icon-halo-color"]),"icon-halo-width":new No(bt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new No(bt.paint_symbol["icon-halo-blur"]),"icon-translate":new Po(bt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Po(bt.paint_symbol["icon-translate-anchor"]),"text-opacity":new No(bt.paint_symbol["text-opacity"]),"text-color":new No(bt.paint_symbol["text-color"],{runtimeType:Tt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new No(bt.paint_symbol["text-halo-color"]),"text-halo-width":new No(bt.paint_symbol["text-halo-width"]),"text-halo-blur":new No(bt.paint_symbol["text-halo-blur"]),"text-translate":new Po(bt.paint_symbol["text-translate"]),"text-translate-anchor":new Po(bt.paint_symbol["text-translate-anchor"])})},get layout(){return Wh=Wh||new jo({"symbol-placement":new Po(bt.layout_symbol["symbol-placement"]),"symbol-spacing":new Po(bt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Po(bt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new No(bt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Po(bt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Po(bt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Po(bt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Po(bt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Po(bt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Po(bt.layout_symbol["icon-rotation-alignment"]),"icon-size":new No(bt.layout_symbol["icon-size"]),"icon-text-fit":new Po(bt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Po(bt.layout_symbol["icon-text-fit-padding"]),"icon-image":new No(bt.layout_symbol["icon-image"]),"icon-rotate":new No(bt.layout_symbol["icon-rotate"]),"icon-padding":new No(bt.layout_symbol["icon-padding"]),"icon-keep-upright":new Po(bt.layout_symbol["icon-keep-upright"]),"icon-offset":new No(bt.layout_symbol["icon-offset"]),"icon-anchor":new No(bt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Po(bt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Po(bt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Po(bt.layout_symbol["text-rotation-alignment"]),"text-field":new No(bt.layout_symbol["text-field"]),"text-font":new No(bt.layout_symbol["text-font"]),"text-size":new No(bt.layout_symbol["text-size"]),"text-max-width":new No(bt.layout_symbol["text-max-width"]),"text-line-height":new Po(bt.layout_symbol["text-line-height"]),"text-letter-spacing":new No(bt.layout_symbol["text-letter-spacing"]),"text-justify":new No(bt.layout_symbol["text-justify"]),"text-radial-offset":new No(bt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Po(bt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new No(bt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new No(bt.layout_symbol["text-anchor"]),"text-max-angle":new Po(bt.layout_symbol["text-max-angle"]),"text-writing-mode":new Po(bt.layout_symbol["text-writing-mode"]),"text-rotate":new No(bt.layout_symbol["text-rotate"]),"text-padding":new Po(bt.layout_symbol["text-padding"]),"text-keep-upright":new Po(bt.layout_symbol["text-keep-upright"]),"text-transform":new No(bt.layout_symbol["text-transform"]),"text-offset":new No(bt.layout_symbol["text-offset"]),"text-allow-overlap":new Po(bt.layout_symbol["text-allow-overlap"]),"text-overlap":new Po(bt.layout_symbol["text-overlap"]),"text-ignore-placement":new Po(bt.layout_symbol["text-ignore-placement"]),"text-optional":new Po(bt.layout_symbol["text-optional"])})}};class ec{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:zt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return false}serialize(){return null}}lo("FormatSectionOverride",ec,{omit:["defaultValue"]});class ic extends Ho{constructor(t){super(t,tc)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const i of t)e.indexOf(i)<0&&e.push(i);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,r){const s=this.layout.get(t).evaluate(e,{},i,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||rs(o.value)||!s?s:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>t&&i in t?String(t[i]):""))}(e.properties,s)}createBucket(t){return new Zh(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of tc.paint.overridableProperties){if(!ic.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new ec(e),r=new is(i,e.property.specification);let s=null;s="constant"===e.value.kind||"source"===e.value.kind?new os("source",r):new ns("composite",r,e.value.zoomStops),this.paint._values[t]=new zo(e.property,s,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&ic.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),r=tc.paint.properties[e];let s=false;const o=t=>{for(const e of t)if(r.overrides&&r.overrides.hasOverride(e))return void(s=true)};if("constant"===i.value.kind&&i.value.value instanceof Ge)o(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{s||(e instanceof He&&je(e.value)===Ht?o(e.value.sections):e instanceof ki?o(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return s}}let rc;var sc={get paint(){return rc=rc||new jo({"background-color":new Po(bt.paint_background["background-color"]),"background-pattern":new qo(bt.paint_background["background-pattern"]),"background-opacity":new Po(bt.paint_background["background-opacity"])})}};class oc extends Ho{constructor(t){super(t,sc)}}let nc;var ac={get paint(){return nc=nc||new jo({"raster-opacity":new Po(bt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Po(bt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Po(bt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Po(bt.paint_raster["raster-brightness-max"]),"raster-saturation":new Po(bt.paint_raster["raster-saturation"]),"raster-contrast":new Po(bt.paint_raster["raster-contrast"]),"raster-resampling":new Po(bt.paint_raster["raster-resampling"]),"raster-fade-duration":new Po(bt.paint_raster["raster-fade-duration"])})}};class lc extends Ho{constructor(t){super(t,ac)}}class Ac extends Ho{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return false}serialize(){throw new Error("Custom layers cannot be serialized")}}class hc{constructor(t){this._methodToThrottle=t,this._triggered=false,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=false,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=true,this._channel?this._channel.port1.postMessage(true):setTimeout((()=>{this._triggered=false,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const cc={once:true},uc=6371008.8;class fc{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fc(N(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,r=t.lat*e,s=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return uc*Math.acos(Math.min(s,1))}static convert(t){if(t instanceof fc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new fc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new fc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const dc=2*Math.PI*uc;function gc(t){return dc*Math.cos(t*Math.PI/180)}function pc(t){return(180+t)/360}function mc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function wc(t,e){return t/gc(e)}function Ic(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function vc(t,e){return t*gc(Ic(e))}class bc{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=fc.convert(t);return new bc(pc(i.lng),mc(i.lat),wc(e,i.lat))}toLngLat(){return new fc(360*this.x-180,Ic(this.y))}toAltitude(){return vc(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/dc*(t=Ic(this.y),1/Math.cos(t*Math.PI/180));var t}}function yc(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class Bc{constructor(t,e,i){if(!function(t,e,i){return!(t<0||t>25||i<0||i>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}(t,e,i))throw new Error(`x=${e}, y=${i}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=e,this.y=i,this.key=_c(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){const r=(o=this.y,n=this.z,a=yc(256*(s=this.x),256*(o=Math.pow(2,n)-o-1),n),l=yc(256*(s+1),256*(o+1),n),a[0]+","+a[1]+","+l[0]+","+l[1]);var s,o,n,a,l;const A=function(t,e,i){let r,s="";for(let o=t;o>0;o--)r=1<<o-1,s+=(e&r?1:0)+(i&r?2:0);return s}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,A).replace(/{bbox-epsg-3857}/g,r)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new l((t.x*e-this.x)*S,(t.y*e-this.y)*S)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Cc{constructor(t,e){this.wrap=t,this.canonical=e,this.key=_c(t,e.z,e.z,e.x,e.y)}}class Ec{constructor(t,e,i,r,s){if(this.terrainRttPosMatrix32f=null,t<i)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=e,this.canonical=new Bc(i,+r,+s),this.key=_c(e,t,i,r,s)}clone(){return new Ec(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new Ec(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ec(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-t;return t>this.canonical.z?_c(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):_c(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap)return false;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new Ec(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new Ec(e,this.wrap,e,i,r),new Ec(e,this.wrap,e,i+1,r),new Ec(e,this.wrap,e,i,r+1),new Ec(e,this.wrap,e,i+1,r+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new Ec(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Ec(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Cc(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new bc(t.x-this.wrap,t.y))}}function _c(t,e,i,r,s){(t*=2)<0&&(t=-1*t-1);const o=1<<i;return(o*o*t+o*s+r).toString(36)+i.toString(36)+e.toString(36)}lo("CanonicalTileID",Bc),lo("OverscaledTileID",Ec,{omit:["terrainRttPosMatrix32f"]});class Qc{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){const e=new Qc;return e.extend(t(new l(this.minX,this.minY))),e.extend(t(new l(this.maxX,this.minY))),e.extend(t(new l(this.minX,this.maxY))),e.extend(t(new l(this.maxX,this.maxY))),e}static fromPoints(t){const e=new Qc;for(const i of t)e.extend(i);return e}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class xc{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Mc{constructor(t,e,i,r,s){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=r,this.properties=t.properties,this.id=s}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class kc{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new no(S,16,0),this.grid3D=new no(S,16,0),this.featureIndexArray=new Gn,this.promoteId=e}insert(t,e,i,r,s,o){const n=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,s);const a=o?this.grid3D:this.grid;for(let t=0;t<e.length;t++){const i=e[t],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){const e=i[t];r[0]=Math.min(r[0],e.x),r[1]=Math.min(r[1],e.y),r[2]=Math.max(r[2],e.x),r[3]=Math.max(r[3],e.y)}r[0]<S&&r[1]<S&&r[2]>=0&&r[3]>=0&&a.insert(n,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new yA.VectorTile(new ch(this.rawTileData)).layers,this.sourceLayerCoder=new xc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,i,r){this.loadVTLayers();const s=t.params,o=S/t.tileSize/t.scale,n=fs(s.filter),a=t.queryGeometry,A=t.queryPadding*o,h=Qc.fromPoints(a),c=this.grid.query(h.minX-A,h.minY-A,h.maxX+A,h.maxY+A),u=Qc.fromPoints(t.cameraQueryGeometry).expandBy(A),f=this.grid3D.query(u.minX,u.minY,u.maxX,u.maxY,((e,i,r,s)=>function(t,e,i,r,s){for(const o of t)if(e<=o.x&&i<=o.y&&r>=o.x&&s>=o.y)return true;const o=[new l(e,i),new l(e,s),new l(r,s),new l(r,i)];if(t.length>2)for(const e of o)if(qa(t,e))return true;for(let e=0;e<t.length-1;e++)if(Oa(t[e],t[e+1],o))return true;return false}(t.cameraQueryGeometry,e-A,i-A,r+A,s+A)));for(const t of f)c.push(t);c.sort(Sc);const d={};let g;for(let l=0;l<c.length;l++){const A=c[l];if(A===g)continue;g=A;const h=this.featureIndexArray.get(A);let u=null;this.loadMatchingFeature(d,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,n,s.layers,s.availableImages,e,i,r,((e,i,r)=>(u||(u=xa(e)),i.queryIntersectsFeature({queryGeometry:a,feature:e,featureState:r,geometry:u,zoom:this.z,transform:t.transform,pixelsToTileUnits:o,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation}))))}return d}loadMatchingFeature(t,e,i,r,s,o,n,a,l,A,h){const c=this.bucketLayerIDs[e];if(o&&!c.some((t=>o.has(t))))return;const u=this.sourceLayerCoder.decode(i),f=this.vtLayers[u].feature(r);if(s.needGeometry){const t=Ma(f,true);if(!s.filter(new ko(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!s.filter(new ko(this.tileID.overscaledZ),f))return;const d=this.getId(f,u);for(let e=0;e<c.length;e++){const i=c[e];if(o&&!o.has(i))continue;const s=a[i];if(!s)continue;let u={};d&&A&&(u=A.getState(s.sourceLayer||"_geojsonTileLayer",d));const g=T({},l[i]);g.paint=Dc(g.paint,s.paint,f,u,n),g.layout=Dc(g.layout,s.layout,f,u,n);const p=!h||h(f,s,u);if(!p)continue;const m=new Mc(f,this.z,this.x,this.y,d);m.layer=g;let w=t[i];void 0===w&&(w=t[i]=[]),w.push({featureIndex:r,feature:m,intersectionZ:p})}}lookupSymbolFeatures(t,e,i,r,s,o,n,a){const l={};this.loadVTLayers();const A=fs(s);for(const s of t)this.loadMatchingFeature(l,i,r,s,A,o,n,a,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return true;return false}getId(t,e){var i;let r=t.id;return this.promoteId&&(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof r&&(r=Number(r)),void 0===r&&(null===(i=t.properties)||void 0===i?void 0:i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))),r}}function Dc(t,e,i,r,s){return O(t,((t,o)=>{const n=e instanceof Uo?e.get(o):null;return n&&n.evaluate?n.evaluate(i,r,s):n}))}function Sc(t,e){return e-t}function Gc(t,e,i,r,s){const o=[];for(let n=0;n<t.length;n++){const a=t[n];let A;for(let t=0;t<a.length-1;t++){let n=a[t],h=a[t+1];n.x<e&&h.x<e||(n.x<e?n=new l(e,n.y+(e-n.x)/(h.x-n.x)*(h.y-n.y))._round():h.x<e&&(h=new l(e,n.y+(e-n.x)/(h.x-n.x)*(h.y-n.y))._round()),n.y<i&&h.y<i||(n.y<i?n=new l(n.x+(i-n.y)/(h.y-n.y)*(h.x-n.x),i)._round():h.y<i&&(h=new l(n.x+(i-n.y)/(h.y-n.y)*(h.x-n.x),i)._round()),n.x>=r&&h.x>=r||(n.x>=r?n=new l(r,n.y+(r-n.x)/(h.x-n.x)*(h.y-n.y))._round():h.x>=r&&(h=new l(r,n.y+(r-n.x)/(h.x-n.x)*(h.y-n.y))._round()),n.y>=s&&h.y>=s||(n.y>=s?n=new l(n.x+(s-n.y)/(h.y-n.y)*(h.x-n.x),s)._round():h.y>=s&&(h=new l(n.x+(s-n.y)/(h.y-n.y)*(h.x-n.x),s)._round()),A&&n.equals(A[A.length-1])||(A=[n],o.push(A)),A.push(h)))))}}return o}lo("FeatureIndex",kc,{omit:["rawTileData","sourceLayerCoder"]});class Fc extends l{constructor(t,e,i,r){super(t,e),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new Fc(this.x,this.y,this.angle,this.segment)}}function Rc(t,e,i,r,s){if(void 0===e.segment||0===i)return true;let o=e,n=e.segment+1,a=0;for(;a>-i/2;){if(n--,n<0)return false;a-=t[n].dist(o),o=t[n]}a+=t[n].dist(t[n+1]),n++;const l=[];let A=0;for(;a<i/2;){const e=t[n],i=t[n+1];if(!i)return false;let o=t[n-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),A+=o;a-l[0].distance>r;)A-=l.shift().angleDelta;if(A>s)return false;n++,a+=e.dist(i)}return true}function Lc(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function zc(t,e,i){return t?.6*e*i:0}function Uc(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Pc(t,e,i,r,s,o){const n=zc(i,s,o),a=Uc(i,r)*o;let l=0;const A=Lc(t)/2;for(let i=0;i<t.length-1;i++){const r=t[i],s=t[i+1],o=r.dist(s);if(l+o>A){const h=(A-l)/o,c=mi.number(r.x,s.x,h),u=mi.number(r.y,s.y,h),f=new Fc(c,u,s.angleTo(r),i);return f._round(),!n||Rc(t,f,a,n,e)?f:void 0}l+=o}}function Nc(t,e,i,r,s,o,n,a,l){const A=zc(r,o,n),h=Uc(r,s),c=h*n,u=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-c<e/4&&(e=c+e/4),Tc(t,u?e/2*a%e:(h/2+2*o)*n*a%e,e,A,i,c,u,false,l)}function Tc(t,e,i,r,s,o,n,a,l){const A=o/2,h=Lc(t);let c=0,u=e-i,f=[];for(let e=0;e<t.length-1;e++){const n=t[e],a=t[e+1],d=n.dist(a),g=a.angleTo(n);for(;u+i<c+d;){u+=i;const p=(u-c)/d,m=mi.number(n.x,a.x,p),w=mi.number(n.y,a.y,p);if(m>=0&&m<l&&w>=0&&w<l&&u-A>=0&&u+A<=h){const i=new Fc(m,w,g,e);i._round(),r&&!Rc(t,i,o,r,s)||f.push(i)}}c+=d}return a||f.length||n||(f=Tc(t,c/2,i,r,s,o,n,true,l)),f}function qc(t,e,i,r){const s=[],o=t.image,n=o.pixelRatio,a=o.paddedRect.w-2,A=o.paddedRect.h-2;let h={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const c=o.stretchX||[[0,a]],u=o.stretchY||[[0,A]],f=(t,e)=>t+e[1]-e[0],d=c.reduce(f,0),g=u.reduce(f,0),p=a-d,m=A-g;let w=0,I=d,v=0,b=g,y=0,B=p,C=0,E=m;if(o.content&&r){const e=o.content,i=e[2]-e[0],r=e[3]-e[1];(o.textFitWidth||o.textFitHeight)&&(h=Uh(t)),w=Oc(c,0,e[0]),v=Oc(u,0,e[1]),I=Oc(c,e[0],e[2]),b=Oc(u,e[1],e[3]),y=e[0]-w,C=e[1]-v,B=i-I,E=r-b}const _=h.x1,Q=h.y1,x=h.x2-_,M=h.y2-Q,k=(t,r,s,a)=>{const A=Jc(t.stretch-w,I,x,_),h=Hc(t.fixed-y,B,t.stretch,d),c=Jc(r.stretch-v,b,M,Q),u=Hc(r.fixed-C,E,r.stretch,g),f=Jc(s.stretch-w,I,x,_),p=Hc(s.fixed-y,B,s.stretch,d),m=Jc(a.stretch-v,b,M,Q),k=Hc(a.fixed-C,E,a.stretch,g),D=new l(A,c),S=new l(f,c),G=new l(f,m),F=new l(A,m),R=new l(h/n,u/n),L=new l(p/n,k/n),z=e*Math.PI/180;if(z){const t=Math.sin(z),e=Math.cos(z),i=[e,-t,t,e];D._matMult(i),S._matMult(i),F._matMult(i),G._matMult(i)}const U=t.stretch+t.fixed,P=r.stretch+r.fixed;return{tl:D,tr:S,bl:F,br:G,tex:{x:o.paddedRect.x+1+U,y:o.paddedRect.y+1+P,w:s.stretch+s.fixed-U,h:a.stretch+a.fixed-P},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:L,minFontScaleX:B/n/x,minFontScaleY:E/n/M,isSDF:i}};if(r&&(o.stretchX||o.stretchY)){const t=jc(c,p,d),e=jc(u,m,g);for(let i=0;i<t.length-1;i++){const r=t[i],o=t[i+1];for(let t=0;t<e.length-1;t++)s.push(k(r,e[t],o,e[t+1]))}}else s.push(k({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:a+1},{fixed:0,stretch:A+1}));return s}function Oc(t,e,i){let r=0;for(const s of t)r+=Math.max(e,Math.min(i,s[1]))-Math.max(e,Math.min(i,s[0]));return r}function jc(t,e,i){const r=[{fixed:-1,stretch:0}];for(const[e,i]of t){const t=r[r.length-1];r.push({fixed:e-t.stretch,stretch:t.stretch}),r.push({fixed:e-t.stretch,stretch:t.stretch+(i-e)})}return r.push({fixed:e+1,stretch:i}),r}function Jc(t,e,i,r){return t/e*i+r}function Hc(t,e,i,r){return t-e*i/r}lo("Anchor",Fc);class Yc{constructor(t,e,i,r,s,o,n,a,A,h){var c;if(this.boxStartIndex=t.length,A){let t=o.top,e=o.bottom;const i=o.collisionPadding;i&&(t-=i[1],e+=i[3]);let r=e-t;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{const A=(null===(c=o.image)||void 0===c?void 0:c.content)&&(o.image.textFitWidth||o.image.textFitHeight)?Uh(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};A.y1=A.y1*n-a[0],A.y2=A.y2*n+a[2],A.x1=A.x1*n-a[3],A.x2=A.x2*n+a[1];const u=o.collisionPadding;if(u&&(A.x1-=u[0]*n,A.y1-=u[1]*n,A.x2+=u[2]*n,A.y2+=u[3]*n),h){const t=new l(A.x1,A.y1),e=new l(A.x2,A.y1),i=new l(A.x1,A.y2),r=new l(A.x2,A.y2),s=h*Math.PI/180;t._rotate(s),e._rotate(s),i._rotate(s),r._rotate(s),A.x1=Math.min(t.x,e.x,i.x,r.x),A.x2=Math.max(t.x,e.x,i.x,r.x),A.y1=Math.min(t.y,e.y,i.y,r.y),A.y2=Math.max(t.y,e.y,i.y,r.y)}t.emplaceBack(e.x,e.y,A.x1,A.y1,A.x2,A.y2,i,r,s)}this.boxEndIndex=t.length}}class $c{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const s=t-1>>1,o=e[s];if(i(r,o)>=0)break;e[t]=o,t=s}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,s=e[t];for(;t<r;){let r=1+(t<<1);const o=r+1;if(o<this.length&&i(e[o],e[r])<0&&(r=o),i(e[r],s)>=0)break;e[t]=e[r],t=r}e[t]=s}}function Vc(t,e=1,i=false){const r=Qc.fromPoints(t[0]),s=Math.min(r.width(),r.height());let o=s/2;const n=new $c([],Kc),{minX:a,minY:A,maxX:h,maxY:c}=r;if(0===s)return new l(a,A);for(let e=a;e<h;e+=s)for(let i=A;i<c;i+=s)n.push(new Zc(e+o,i+o,o,t));let u=function(t){let e=0,i=0,r=0;const s=t[0];for(let t=0,o=s.length,n=o-1;t<o;n=t++){const o=s[t],a=s[n],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,r+=(o.y+a.y)*l,e+=3*l}return new Zc(i/e,r/e,0,t)}(t),f=n.length;for(;n.length;){const r=n.pop();(r.d>u.d||!u.d)&&(u=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,f)),r.max-u.d<=e||(o=r.h/2,n.push(new Zc(r.p.x-o,r.p.y-o,o,t)),n.push(new Zc(r.p.x+o,r.p.y-o,o,t)),n.push(new Zc(r.p.x-o,r.p.y+o,o,t)),n.push(new Zc(r.p.x+o,r.p.y+o,o,t)),f+=4)}return i&&(console.log(`num probes: ${f}`),console.log(`best distance: ${u.d}`)),u.p}function Kc(t,e){return e.max-t.max}function Zc(t,e,i,r){this.p=new l(t,e),this.h=i,this.d=function(t,e){let i=false,r=1/0;for(let s=0;s<e.length;s++){const o=e[s];for(let e=0,s=o.length,n=s-1;e<s;n=e++){const s=o[e],a=o[n];s.y>t.y!=a.y>t.y&&t.x<(a.x-s.x)*(t.y-s.y)/(a.y-s.y)+s.x&&(i=!i),r=Math.min(r,Na(t,s,a))}}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}var Wc;t.aD=void 0,(Wc=t.aD||(t.aD={}))[Wc.center=1]="center",Wc[Wc.left=2]="left",Wc[Wc.right=3]="right",Wc[Wc.top=4]="top",Wc[Wc.bottom=5]="bottom",Wc[Wc["top-left"]=6]="top-left",Wc[Wc["top-right"]=7]="top-right",Wc[Wc["bottom-left"]=8]="bottom-left",Wc[Wc["bottom-right"]=9]="bottom-right";const Xc=Number.POSITIVE_INFINITY;function tu(t,e){return e[1]!==Xc?function(t,e,i){let r=0,s=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":s=i-7;break;case"bottom-right":case"bottom-left":case"bottom":s=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,s]}(t,e[0],e[1]):function(t,e){let i=0,r=0;e<0&&(e=0);const s=e/Math.SQRT2;switch(t){case"top-right":case"top-left":r=s-7;break;case"bottom-right":case"bottom-left":r=7-s;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":i=-s;break;case"top-left":case"bottom-left":i=s;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}function eu(t,e,i){var r;const s=t.layout,o=null===(r=s.get("text-variable-anchor-offset"))||void 0===r?void 0:r.evaluate(e,{},i);if(o){const t=o.values,e=[];for(let i=0;i<t.length;i+=2){const r=e[i]=t[i],s=t[i+1].map((t=>t*nh));r.startsWith("top")?s[1]-=7:r.startsWith("bottom")&&(s[1]+=7),e[i+1]=s}return new Pe(e)}const n=s.get("text-variable-anchor");if(n){let r;r=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[s.get("text-radial-offset").evaluate(e,{},i)*nh,Xc]:s.get("text-offset").evaluate(e,{},i).map((t=>t*nh));const o=[];for(const t of n)o.push(t,tu(t,r));return new Pe(o)}return null}function iu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ru(e,i,r,s,o,n,a,l,A,h,c,u){let f=n.textMaxSize.evaluate(i,{});void 0===f&&(f=a);const d=e.layers[0].layout,g=d.get("icon-offset").evaluate(i,{},c),p=ou(r.horizontal),m=a/24,w=e.tilePixelRatio*m,I=e.tilePixelRatio*f/24,v=e.tilePixelRatio*l,b=e.tilePixelRatio*d.get("symbol-spacing"),y=d.get("text-padding")*e.tilePixelRatio,B=function(t,e,i,r=1){const s=t.get("icon-padding").evaluate(e,{},i),o=s&&s.values;return[o[0]*r,o[1]*r,o[2]*r,o[3]*r]}(d,i,c,e.tilePixelRatio),C=d.get("text-max-angle")/180*Math.PI,E="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),_="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),Q=d.get("symbol-placement"),x=b/2,M=d.get("icon-text-fit");let k;s&&"none"!==M&&(e.allowVerticalPlacement&&r.vertical&&(k=Ph(s,r.vertical,M,d.get("icon-text-fit-padding"),g,m)),p&&(s=Ph(s,p,M,d.get("icon-text-fit-padding"),g,m)));const D=c?u.line.getGranularityForZoomLevel(c.z):1,G=(l,u)=>{u.x<0||u.x>=S||u.y<0||u.y>=S||function(e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v,b,y,B,C,E){const _=e.addToLineVertexArray(i,r);let Q,x,M,k,D=0,S=0,G=0,F=0,R=-1,L=-1;const z={};let U=na("");if(e.allowVerticalPlacement&&s.vertical){const t=l.layout.get("text-rotate").evaluate(b,{},C)+90;M=new Yc(A,i,h,c,u,s.vertical,f,d,g,t),a&&(k=new Yc(A,i,h,c,u,a,m,w,g,t))}if(o){const r=l.layout.get("icon-rotate").evaluate(b,{}),s="none"!==l.layout.get("icon-text-fit"),n=qc(o,r,B,s),f=a?qc(a,r,B,s):void 0;x=new Yc(A,i,h,c,u,o,m,w,false,r),D=4*n.length;const d=e.iconSizeData;let g=null;"source"===d.kind?(g=[Nh*l.layout.get("icon-size").evaluate(b,{})],g[0]>Th&&Y(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===d.kind&&(g=[Nh*y.compositeIconSizes[0].evaluate(b,{},C),Nh*y.compositeIconSizes[1].evaluate(b,{},C)],(g[0]>Th||g[1]>Th)&&Y(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,n,g,v,I,b,t.an.none,i,_.lineStartIndex,_.lineLength,-1,C),R=e.icon.placedSymbolArray.length-1,f&&(S=4*f.length,e.addSymbols(e.icon,f,g,v,I,b,t.an.vertical,i,_.lineStartIndex,_.lineLength,-1,C),L=e.icon.placedSymbolArray.length-1)}const P=Object.keys(s.horizontal);for(const r of P){const o=s.horizontal[r];if(!Q){U=na(o.text);const t=l.layout.get("text-rotate").evaluate(b,{},C);Q=new Yc(A,i,h,c,u,o,f,d,g,t)}const a=1===o.positionedLines.length;if(G+=su(e,i,o,n,l,g,b,p,_,s.vertical?t.an.horizontal:t.an.horizontalOnly,a?P:[r],z,R,y,C),a)break}s.vertical&&(F+=su(e,i,s.vertical,n,l,g,b,p,_,t.an.vertical,["vertical"],z,L,y,C));const N=Q?Q.boxStartIndex:e.collisionBoxArray.length,T=Q?Q.boxEndIndex:e.collisionBoxArray.length,q=M?M.boxStartIndex:e.collisionBoxArray.length,O=M?M.boxEndIndex:e.collisionBoxArray.length,j=x?x.boxStartIndex:e.collisionBoxArray.length,J=x?x.boxEndIndex:e.collisionBoxArray.length,H=k?k.boxStartIndex:e.collisionBoxArray.length,$=k?k.boxEndIndex:e.collisionBoxArray.length;let V=-1;const K=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;V=K(Q,V),V=K(M,V),V=K(x,V),V=K(k,V);const Z=V>-1?1:0;Z&&(V*=E/nh),e.glyphOffsetArray.length>=Zh.MAX_GLYPHS&&Y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);const W=eu(l,b,C),[X,tt]=function(e,i){const r=e.length,s=null==i?void 0:i.values;if((null==s?void 0:s.length)>0)for(let i=0;i<s.length;i+=2){const r=s[i+1];e.emplaceBack(t.aD[s[i]],r[0],r[1])}return[r,e.length]}(e.textAnchorOffsets,W);e.symbolInstances.emplaceBack(i.x,i.y,z.right>=0?z.right:-1,z.center>=0?z.center:-1,z.left>=0?z.left:-1,z.vertical||-1,R,L,U,N,T,q,O,j,J,H,$,h,G,F,D,S,Z,0,f,V,X,tt)}(e,u,l,r,s,o,k,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,w,[y,y,y,y],E,A,v,B,_,g,i,n,h,c,a)};if("line"===Q)for(const t of Gc(i.geometry,0,0,S,S)){const i=Xl(t,D),o=Nc(i,b,C,r.vertical||p,s,24,I,e.overscaling,S);for(const t of o)p&&nu(e,p.text,x,t)||G(i,t)}else if("line-center"===Q){for(const t of i.geometry)if(t.length>1){const e=Xl(t,D),i=Pc(e,C,r.vertical||p,s,24,I);i&&G(e,i)}}else if("Polygon"===i.type)for(const t of ir(i.geometry,0)){const e=Vc(t,16);G(Xl(t[0],D,true),new Fc(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry){const e=Xl(t,D);G(e,new Fc(e[0].x,e[0].y,0))}else if("Point"===i.type)for(const t of i.geometry)for(const e of t)G([e],new Fc(e.x,e.y,0))}function su(t,e,i,r,s,o,n,a,A,h,c,u,f,d,g){const p=function(t,e,i,r,s,o,n,a){const A=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,h=[];for(const t of e.positionedLines)for(const r of t.positionedGlyphs){if(!r.rect)continue;const o=r.rect||{};let c=4,u=true,f=1,d=0;const g=(s||a)&&r.vertical,p=r.metrics.advance*r.scale/2;if(a&&e.verticalizable&&(d=t.lineOffset/2-(r.imageName?-(nh-r.metrics.width*r.scale)/2:(r.scale-1)*nh)),r.imageName){const t=n[r.imageName];u=t.sdf,f=t.pixelRatio,c=1/f}const m=s?[r.x+p,r.y]:[0,0];let w=s?[0,0]:[r.x+p+i[0],r.y+i[1]-d],I=[0,0];g&&(I=w,w=[0,0]);const v=r.metrics.isDoubleResolution?2:1,b=(r.metrics.left-c)*r.scale-p+w[0],y=(-r.metrics.top-c)*r.scale+w[1],B=b+o.w/v*r.scale/f,C=y+o.h/v*r.scale/f,E=new l(b,y),_=new l(B,y),Q=new l(b,C),x=new l(B,C);if(g){const t=new l(-p,p- -17),e=-Math.PI/2,i=12-p,s=new l(22-i,-(r.imageName?i:0)),o=new l(...I);E._rotateAround(e,t)._add(s)._add(o),_._rotateAround(e,t)._add(s)._add(o),Q._rotateAround(e,t)._add(s)._add(o),x._rotateAround(e,t)._add(s)._add(o)}if(A){const t=Math.sin(A),e=Math.cos(A),i=[e,-t,t,e];E._matMult(i),_._matMult(i),Q._matMult(i),x._matMult(i)}const M=new l(0,0),k=new l(0,0);h.push({tl:E,tr:_,bl:Q,br:x,tex:o,writingMode:e.writingMode,glyphOffset:m,sectionIndex:r.sectionIndex,isSDF:u,pixelOffsetTL:M,pixelOffsetBR:k,minFontScaleX:0,minFontScaleY:0})}return h}(0,i,a,s,o,n,r,t.allowVerticalPlacement),m=t.textSizeData;let w=null;"source"===m.kind?(w=[Nh*s.layout.get("text-size").evaluate(n,{})],w[0]>Th&&Y(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===m.kind&&(w=[Nh*d.compositeTextSizes[0].evaluate(n,{},g),Nh*d.compositeTextSizes[1].evaluate(n,{},g)],(w[0]>Th||w[1]>Th)&&Y(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,p,w,a,o,n,h,e,A.lineStartIndex,A.lineLength,f,g);for(const e of c)u[e]=t.text.placedSymbolArray.length-1;return 4*p.length}function ou(t){for(const e in t)return t[e];return null}function nu(t,e,i,r){const s=t.compareText;if(e in s){const t=s[e];for(let e=t.length-1;e>=0;e--)if(r.dist(t[e])<i)return true}else s[e]=[];return s[e].push(r),false}const au=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class lu{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const s=au[15&i];if(!s)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[n]=new Uint32Array(t,4,1);return new lu(n,o,s,t)}constructor(t,e=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const s=au.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,n=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-n%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=2*t,this._finished=true):(this.data=new ArrayBuffer(8+o+n+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+n+a,2*t),this._pos=0,this._finished=false,new Uint8Array(this.data,0,2).set([219,16+s]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Au(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=true,this}range(t,e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:o,nodeSize:n}=this,a=[0,s.length-1,0],l=[];for(;a.length;){const A=a.pop()||0,h=a.pop()||0,c=a.pop()||0;if(h-c<=n){for(let n=c;n<=h;n++){const a=o[2*n],A=o[2*n+1];a>=t&&a<=i&&A>=e&&A<=r&&l.push(s[n])}continue}const u=c+h>>1,f=o[2*u],d=o[2*u+1];f>=t&&f<=i&&d>=e&&d<=r&&l.push(s[u]),(0===A?t<=f:e<=d)&&(a.push(c),a.push(u-1),a.push(1-A)),(0===A?i>=f:r>=d)&&(a.push(u+1),a.push(h),a.push(1-A))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:s,nodeSize:o}=this,n=[0,r.length-1,0],a=[],l=i*i;for(;n.length;){const A=n.pop()||0,h=n.pop()||0,c=n.pop()||0;if(h-c<=o){for(let i=c;i<=h;i++)fu(s[2*i],s[2*i+1],t,e)<=l&&a.push(r[i]);continue}const u=c+h>>1,f=s[2*u],d=s[2*u+1];fu(f,d,t,e)<=l&&a.push(r[u]),(0===A?t-i<=f:e-i<=d)&&(n.push(c),n.push(u-1),n.push(1-A)),(0===A?t+i>=f:e+i>=d)&&(n.push(u+1),n.push(h),n.push(1-A))}return a}}function Au(t,e,i,r,s,o){if(s-r<=i)return;const n=r+s>>1;hu(t,e,n,r,s,o),Au(t,e,i,r,n-1,1-o),Au(t,e,i,n+1,s,1-o)}function hu(t,e,i,r,s,o){for(;s>r;){if(s-r>600){const n=s-r+1,a=i-r+1,l=Math.log(n),A=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*A*(n-A)/n)*(a-n/2<0?-1:1);hu(t,e,i,Math.max(r,Math.floor(i-a*A/n+h)),Math.min(s,Math.floor(i+(n-a)*A/n+h)),o)}const n=e[2*i+o];let a=r,l=s;for(cu(t,e,r,i),e[2*s+o]>n&&cu(t,e,r,s);a<l;){for(cu(t,e,a,l),a++,l--;e[2*a+o]<n;)a++;for(;e[2*l+o]>n;)l--}e[2*r+o]===n?cu(t,e,r,l):(l++,cu(t,e,l,s)),l<=i&&(r=l+1),i<=l&&(s=l-1)}}function cu(t,e,i,r){uu(t,i,r),uu(e,2*i,2*r),uu(e,2*i+1,2*r+1)}function uu(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function fu(t,e,i,r){const s=t-i,o=e-r;return s*s+o*o}var du;t.cw=void 0,(du=t.cw||(t.cw={})).create="create",du.load="load",du.fullLoad="fullLoad";let gu=null,pu=[];const mu=1e3/60,wu="loadTime",Iu="fullLoadTime",vu={mark(t){performance.mark(t)},frame(t){const e=t;null!=gu&&pu.push(e-gu),gu=e},clearMetrics(){gu=null,pu=[],performance.clearMeasures(wu),performance.clearMeasures(Iu);for(const e in t.cw)performance.clearMarks(t.cw[e])},getPerformanceMetrics(){performance.measure(wu,t.cw.create,t.cw.load),performance.measure(Iu,t.cw.create,t.cw.fullLoad);const e=performance.getEntriesByName(wu)[0].duration,i=performance.getEntriesByName(Iu)[0].duration,r=pu.length,s=1/(pu.reduce(((t,e)=>t+e),0)/r/1e3),o=pu.filter((t=>t>mu)).reduce(((t,e)=>t+(e-mu)/mu),0);return{loadTime:e,fullLoadTime:i,fps:s,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};t.$=S,t.A=p,t.B=function([t,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(i),y:t*Math.sin(e)*Math.sin(i),z:t*Math.cos(i)}},t.C=mi,t.D=Po,t.E=vt,t.F=ko,t.G=io,t.H=function(t){if(null==K){const e=t.navigator?t.navigator.userAgent:null;K=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return K},t.I=ph,t.J=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new hc((()=>this.process())),this.subscription=it(this.target,"message",(t=>this.receive(t)),false),this.globalScope=V(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise(((i,r)=>{const s=Math.round(1e18*Math.random()).toString(36).substring(0,10),o=e?it(e.signal,"abort",(()=>{null==o||o.unsubscribe(),delete this.resolveRejects[s];const e={id:s,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),cc):null;this.resolveRejects[s]={resolve:t=>{null==o||o.unsubscribe(),i(t)},reject:t=>{null==o||o.unsubscribe(),r(t)}};const n=[],a=Object.assign(Object.assign({},t),{id:s,sourceMapId:this.mapId,origin:location.origin,data:uo(t.data,n)});this.target.postMessage(a,{transfer:n})}))}receive(t){const e=t.data,i=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[i];const t=this.abortControllers[i];return delete this.abortControllers[i],void(t&&t.abort())}if(V(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,i){return e(this,void 0,void 0,(function*(){if("<response>"===i.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(i.error?e.reject(fo(i.error)):e.resolve(fo(i.data)))}if(!this.messageHandlers[i.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${i.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const e=fo(i.data),r=new AbortController;this.abortControllers[t]=r;try{const s=yield this.messageHandlers[i.type](i.sourceMapId,e,r);this.completeTask(t,null,s)}catch(e){this.completeTask(t,e)}}))}completeTask(t,e,i){const r=[];delete this.abortControllers[t];const s={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?uo(e):null,data:uo(i,r)};this.target.postMessage(s,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.K=ct,t.L=function(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.M=function(t,e,i){var r,s,o,n,a,l,A,h,c,u,f,d,g=i[0],p=i[1],m=i[2];return e===t?(t[12]=e[0]*g+e[4]*p+e[8]*m+e[12],t[13]=e[1]*g+e[5]*p+e[9]*m+e[13],t[14]=e[2]*g+e[6]*p+e[10]*m+e[14],t[15]=e[3]*g+e[7]*p+e[11]*m+e[15]):(s=e[1],o=e[2],n=e[3],a=e[4],l=e[5],A=e[6],h=e[7],c=e[8],u=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=s,t[2]=o,t[3]=n,t[4]=a,t[5]=l,t[6]=A,t[7]=h,t[8]=c,t[9]=u,t[10]=f,t[11]=d,t[12]=r*g+a*p+c*m+e[12],t[13]=s*g+l*p+u*m+e[13],t[14]=o*g+A*p+f*m+e[14],t[15]=n*g+h*p+d*m+e[15]),t},t.N=function(t,e,i){var r=i[0],s=i[1],o=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.O=function(t,e,i){var r=e[0],s=e[1],o=e[2],n=e[3],a=e[4],l=e[5],A=e[6],h=e[7],c=e[8],u=e[9],f=e[10],d=e[11],g=e[12],p=e[13],m=e[14],w=e[15],I=i[0],v=i[1],b=i[2],y=i[3];return t[0]=I*r+v*a+b*c+y*g,t[1]=I*s+v*l+b*u+y*p,t[2]=I*o+v*A+b*f+y*m,t[3]=I*n+v*h+b*d+y*w,t[4]=(I=i[4])*r+(v=i[5])*a+(b=i[6])*c+(y=i[7])*g,t[5]=I*s+v*l+b*u+y*p,t[6]=I*o+v*A+b*f+y*m,t[7]=I*n+v*h+b*d+y*w,t[8]=(I=i[8])*r+(v=i[9])*a+(b=i[10])*c+(y=i[11])*g,t[9]=I*s+v*l+b*u+y*p,t[10]=I*o+v*A+b*f+y*m,t[11]=I*n+v*h+b*d+y*w,t[12]=(I=i[12])*r+(v=i[13])*a+(b=i[14])*c+(y=i[15])*g,t[13]=I*s+v*l+b*u+y*p,t[14]=I*o+v*A+b*f+y*m,t[15]=I*n+v*h+b*d+y*w,t},t.P=l,t.Q=function(t,e){const i={};for(let r=0;r<e.length;r++){const s=e[r];s in t&&(i[s]=t[s])}return i},t.R=ol,t.S=fc,t.T=dl,t.U=mc,t.V=pc,t.W=f,t.X=d,t.Y=X,t.Z=Ec,t._=e,t.a=At,t.a$=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},t.a0=bc,t.a1=Qc,t.a2=25,t.a3=Bc,t.a4=t=>{const e=window.document.createElement("video");return e.muted=true,new Promise((i=>{e.onloadstart=()=>{i(e)};for(const i of t){const t=window.document.createElement("source");gt(i)||(e.crossOrigin="Anonymous"),t.src=i,e.appendChild(t)}}))},t.a5=Gt,t.a6=function(){return q++},t.a7=Bn,t.a8=Zh,t.a9=fs,t.aA=nh,t.aB=G,t.aC=function(t,e,i,r,s=false){if(!i[0]&&!i[1])return[0,0];const o=s?"map"===r?-t.bearingInRadians:0:"viewport"===r?t.bearingInRadians:0;if(o){const t=Math.sin(o),e=Math.cos(o);i=[i[0]*e-i[1]*t,i[0]*t+i[1]*e]}return[s?i[0]:G(e,i[0],t.zoom),s?i[1]:G(e,i[1],t.zoom)]},t.aE=Oh,t.aF=iu,t.aG=kh,t.aH=lu,t.aI=Ko,t.aJ=$l,t.aK=Fn,t.aL=Kn,t.aM=Hn,t.aN=N,t.aO=st,t.aP=vc,t.aQ=B,t.aR=y,t.aS=function(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.aT=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},t.aU=function(t,e){var i=e[0],r=e[1],s=e[2],o=i*i+r*r+s*s;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.aV=C,t.aW=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.aX=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},t.aY=v,t.aZ=function(t,e,i){const r=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return 0===r?null:(-(t[0]*i[0]+t[1]*i[1]+t[2]*i[2])-i[3])/r},t.a_=_,t.aa=Ma,t.ab=Mc,t.ac=function(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,r,s)=>{const o=r||s;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ad=rt,t.ae=function(t){return Math.pow(2,t)},t.af=w,t.ag=P,t.ah=85.051129,t.ai=wc,t.aj=function(t){return Math.log(t)/Math.LN2},t.ak=function(t){var e=t[0],i=t[1];return e*e+i*i},t.al=function(t,e){const i=[];for(const r in t)r in e||i.push(r);return i},t.am=function(t,e){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:s,minZoom:o,maxZoom:n}=t,a=s?P(gi.interpolationFactor(s,e,o,n),0,1):0;"camera"===t.kind?r=mi.number(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:r}},t.ao=function(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:s}){return"source"===t.kind?r/Nh:"composite"===t.kind?mi.number(r/Nh,s/Nh,i):e},t.ap=function(t,e){var i=e[0],r=e[1],s=e[2],o=e[3],n=e[4],a=e[5],l=e[6],A=e[7],h=e[8],c=e[9],u=e[10],f=e[11],d=e[12],g=e[13],p=e[14],m=e[15],w=i*a-r*n,I=i*l-s*n,v=i*A-o*n,b=r*l-s*a,y=r*A-o*a,B=s*A-o*l,C=h*g-c*d,E=h*p-u*d,_=h*m-f*d,Q=c*p-u*g,x=c*m-f*g,M=u*m-f*p,k=w*M-I*x+v*Q+b*_-y*E+B*C;return k?(t[0]=(a*M-l*x+A*Q)*(k=1/k),t[1]=(s*x-r*M-o*Q)*k,t[2]=(g*B-p*y+m*b)*k,t[3]=(u*y-c*B-f*b)*k,t[4]=(l*_-n*M-A*E)*k,t[5]=(i*M-s*_+o*E)*k,t[6]=(p*v-d*B-m*I)*k,t[7]=(h*B-u*v+f*I)*k,t[8]=(n*x-a*_+A*C)*k,t[9]=(r*_-i*x-o*C)*k,t[10]=(d*y-g*v+m*w)*k,t[11]=(c*v-h*y-f*w)*k,t[12]=(a*E-n*Q-l*C)*k,t[13]=(i*Q-r*E+s*C)*k,t[14]=(g*I-d*b-p*w)*k,t[15]=(h*b-c*I+u*w)*k,t):null},t.aq=k,t.ar=function(t){return Math.hypot(t[0],t[1])},t.as=function(t){return t[0]=0,t[1]=0,t},t.at=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},t.au=Yh,t.av=Q,t.aw=function(t,e,i,r){const s=e.y-t.y,o=e.x-t.x,n=r.y-i.y,a=r.x-i.x,A=n*o-a*s;if(0===A)return null;const h=(a*(t.y-i.y)-n*(t.x-i.x))/A;return new l(t.x+h*o,t.y+h*s)},t.ax=Gc,t.ay=Ga,t.az=function(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const o of t)e=Math.min(e,o.x),i=Math.min(i,o.y),r=Math.max(r,o.x),s=Math.max(s,o.y);return[e,i,r,s]},t.b=Z,t.b$=th,t.b0=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]},t.b1=Cc,t.b2=_c,t.b3=function(t,e,i,r,s){var o,n=1/Math.tan(e/2);return t[0]=n/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=s&&s!==1/0?(t[10]=(s+r)*(o=1/(r-s)),t[14]=2*s*r*o):(t[10]=-1,t[14]=-2*r),t},t.b4=function(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.b5=function(t,e,i){var r=Math.sin(i),s=Math.cos(i),o=e[0],n=e[1],a=e[2],l=e[3],A=e[4],h=e[5],c=e[6],u=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*s+A*r,t[1]=n*s+h*r,t[2]=a*s+c*r,t[3]=l*s+u*r,t[4]=A*s-o*r,t[5]=h*s-n*r,t[6]=c*s-a*r,t[7]=u*s-l*r,t},t.b6=function(t,e,i){var r=Math.sin(i),s=Math.cos(i),o=e[4],n=e[5],a=e[6],l=e[7],A=e[8],h=e[9],c=e[10],u=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*s+A*r,t[5]=n*s+h*r,t[6]=a*s+c*r,t[7]=l*s+u*r,t[8]=A*s-o*r,t[9]=h*s-n*r,t[10]=c*s-a*r,t[11]=u*s-l*r,t},t.b7=function(){const t=new Float32Array(16);return w(t),t},t.b8=function(){const t=new Float64Array(16);return w(t),t},t.b9=function(){return new Float64Array(16)},t.bA=function(t){return t[0]=0,t[1]=0,t[2]=0,t},t.bB=function(t,e,i,r){const s=Math.sqrt(t*t+e*e),o=Math.sqrt(i*i+r*r);t/=s,e/=s,i/=o,r/=o;const n=Math.acos(t*i+e*r);return-e*i+t*r>0?n:-n},t.bC=function(t,e){const i=F(t,2*Math.PI),r=F(e,2*Math.PI);return Math.min(Math.abs(i-r),Math.abs(i-r+2*Math.PI),Math.abs(i-r-2*Math.PI))},t.bD=function(){const t={},e=bt.$version;for(const i in bt.$root){const r=bt.$root[i];if(r.required){let s=null;s="version"===i?e:"array"===r.type?[]:{},null!=s&&(t[i]=s)}}return t},t.bE=go,t.bF=ft,t.bG=function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return false;for(let r=0;r<e.length;r++)if(!t(e[r],i[r]))return false;return true}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return false;if(Object.keys(e).length!==Object.keys(i).length)return false;for(const r in e)if(!t(e[r],i[r]))return false;return true}return e===i},t.bH=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Bt(t[i],e[t[i].ref]));return t},t.bI=function(t){if("custom"===t.type)return new Ac(t);switch(t.type){case"background":return new oc(t);case"circle":return new Ka(t);case"color-relief":return new ml(t);case"fill":return new aA(t);case"fill-extrusion":return new SA(t);case"heatmap":return new ll(t);case"hillshade":return new cl(t);case"line":return new $A(t);case"raster":return new lc(t);case"symbol":return new ic(t)}},t.bJ=J,t.bK=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let i=[];try{if(!Ct(t.version,e.version))return[{command:"setStyle",args:[e]}];Ct(t.center,e.center)||i.push({command:"setCenter",args:[e.center]}),Ct(t.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),Ct(t.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),Ct(t.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),Ct(t.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),Ct(t.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),Ct(t.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),Ct(t.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),Ct(t.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),Ct(t.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),Ct(t.light,e.light)||i.push({command:"setLight",args:[e.light]}),Ct(t.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),Ct(t.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),Ct(t.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const r={},s=[];!function(t,e,i,r){let s;for(s in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,s)&&(Object.prototype.hasOwnProperty.call(e,s)||Qt(s,i,r));for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&(Object.prototype.hasOwnProperty.call(t,s)?Ct(t[s],e[s])||("geojson"===t[s].type&&"geojson"===e[s].type&&Mt(t,e,s)?Et(i,{command:"setGeoJSONSourceData",args:[s,e[s].data]}):xt(s,e,i,r)):_t(s,e,i))}(t.sources,e.sources,s,r);const o=[];t.layers&&t.layers.forEach((t=>{"source"in t&&r[t.source]?i.push({command:"removeLayer",args:[t.id]}):o.push(t)})),i=i.concat(s),function(t,e,i){e=e||[];const r=(t=t||[]).map(Dt),s=e.map(Dt),o=t.reduce(St,{}),n=e.reduce(St,{}),a=r.slice(),l=Object.create(null);let A,h,c,u,f;for(let t=0,e=0;t<r.length;t++)A=r[t],Object.prototype.hasOwnProperty.call(n,A)?e++:(Et(i,{command:"removeLayer",args:[A]}),a.splice(a.indexOf(A,e),1));for(let t=0,e=0;t<s.length;t++)A=s[s.length-1-t],a[a.length-1-t]!==A&&(Object.prototype.hasOwnProperty.call(o,A)?(Et(i,{command:"removeLayer",args:[A]}),a.splice(a.lastIndexOf(A,a.length-e),1)):e++,u=a[a.length-t],Et(i,{command:"addLayer",args:[n[A],u]}),a.splice(a.length-t,0,A),l[A]=true);for(let t=0;t<s.length;t++)if(A=s[t],h=o[A],c=n[A],!l[A]&&!Ct(h,c))if(Ct(h.source,c.source)&&Ct(h["source-layer"],c["source-layer"])&&Ct(h.type,c.type)){for(f in kt(h.layout,c.layout,i,A,null,"setLayoutProperty"),kt(h.paint,c.paint,i,A,null,"setPaintProperty"),Ct(h.filter,c.filter)||Et(i,{command:"setFilter",args:[A,c.filter]}),Ct(h.minzoom,c.minzoom)&&Ct(h.maxzoom,c.maxzoom)||Et(i,{command:"setLayerZoomRange",args:[A,c.minzoom,c.maxzoom]}),h)Object.prototype.hasOwnProperty.call(h,f)&&"layout"!==f&&"paint"!==f&&"filter"!==f&&"metadata"!==f&&"minzoom"!==f&&"maxzoom"!==f&&(0===f.indexOf("paint.")?kt(h[f],c[f],i,A,f.slice(6),"setPaintProperty"):Ct(h[f],c[f])||Et(i,{command:"setLayerProperty",args:[A,f,c[f]]}));for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&!Object.prototype.hasOwnProperty.call(h,f)&&"layout"!==f&&"paint"!==f&&"filter"!==f&&"metadata"!==f&&"minzoom"!==f&&"maxzoom"!==f&&(0===f.indexOf("paint.")?kt(h[f],c[f],i,A,f.slice(6),"setPaintProperty"):Ct(h[f],c[f])||Et(i,{command:"setLayerProperty",args:[A,f,c[f]]}))}else Et(i,{command:"removeLayer",args:[A]}),u=a[a.lastIndexOf(A)+1],Et(i,{command:"addLayer",args:[c,u]})}(o,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:"setStyle",args:[e]}]}return i},t.bL=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},t.bM=O,t.bN=j,t.bO=class extends ca{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.bP=da,t.bQ=class extends ca{constructor(t,e){super(t,e),this.current=ga}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,false,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,false,t);break}}},t.bR=fa,t.bS=class extends ca{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.bT=class extends ca{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.bU=m,t.bV=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.bW=function(t,e,i){var r=e[0],s=e[1],o=e[2];return t[0]=r*i[0]+s*i[3]+o*i[6],t[1]=r*i[1]+s*i[4]+o*i[7],t[2]=r*i[2]+s*i[5]+o*i[8],t},t.bX=function(t,e,i,r,s,o,n){var a=1/(e-i),l=1/(r-s),A=1/(o-n);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*A,t[11]=0,t[12]=(e+i)*a,t[13]=(s+r)*l,t[14]=(n+o)*A,t[15]=1,t},t.bY=class extends ca{constructor(t,e){super(t,e),this.current=new Array}set(t){if(t!=this.current){this.current=t;const e=new Float32Array(4*t.length);for(let i=0;i<t.length;i++)e[4*i]=t[i].r,e[4*i+1]=t[i].g,e[4*i+2]=t[i].b,e[4*i+3]=t[i].a;this.gl.uniform4fv(this.location,e)}}},t.bZ=class extends ca{constructor(t,e){super(t,e),this.current=new Array}set(t){if(t!=this.current){this.current=t;const e=new Float32Array(t);this.gl.uniform1fv(this.location,e)}}},t.b_=class extends cn{},t.ba=function(t,e,i){const r=new Float64Array(4);return M(r,t,e-90,i),r},t.bb=function(t,e,i,r){var s,o,n,a,l,A=e[0],h=e[1],c=e[2],u=e[3],f=i[0],d=i[1],p=i[2],m=i[3];return(o=A*f+h*d+c*p+u*m)<0&&(o=-o,f=-f,d=-d,p=-p,m=-m),1-o>g?(s=Math.acos(o),n=Math.sin(s),a=Math.sin((1-r)*s)/n,l=Math.sin(r*s)/n):(a=1-r,l=r),t[0]=a*A+l*f,t[1]=a*h+l*d,t[2]=a*c+l*p,t[3]=a*u+l*m,t},t.bc=function(t){const e=new Float64Array(9);var i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I;c=(s=(r=t)[0])*(l=s+s),u=(o=r[1])*l,d=(n=r[2])*l,g=n*(A=o+o),m=(a=r[3])*l,w=a*A,I=a*(h=n+n),(i=e)[0]=1-(f=o*A)-(p=n*h),i[3]=u-I,i[6]=d+w,i[1]=u+I,i[4]=1-c-p,i[7]=g-m,i[2]=d-w,i[5]=g+m,i[8]=1-c-f;const v=st(-Math.asin(P(e[2],-1,1)));let b,y;return Math.hypot(e[5],e[8])<.001?(b=0,y=-st(Math.atan2(e[3],e[4]))):(b=st(0===e[5]&&0===e[8]?0:Math.atan2(e[5],e[8])),y=st(0===e[1]&&0===e[0]?0:Math.atan2(e[1],e[0]))),{roll:b,pitch:v+90,bearing:y}},t.bd=function(t,e){return t.roll==e.roll&&t.pitch==e.pitch&&t.bearing==e.bearing},t.be=Me,t.bf=ua,t.bg=Vl,t.bh=Kl,t.bi=Yl,t.bj=R,t.bk=L,t.bl=Te,t.bm=function(t,e,i,r,s){return R(r,s,P((t-e)/(i-e),0,1))},t.bn=F,t.bo=function(){return new Float64Array(3)},t.bp=function(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t},t.bq=M,t.br=function(t,e,i){var r=i[0],s=i[1],o=i[2],n=e[0],a=e[1],l=e[2],A=s*l-o*a,h=o*n-r*l,c=r*a-s*n,u=s*c-o*h,f=o*A-r*c,d=r*h-s*A,g=2*i[3];return h*=g,c*=g,f*=2,d*=2,t[0]=n+(A*=g)+(u*=2),t[1]=a+h+f,t[2]=l+c+d,t},t.bs=function(t,e,i){const r=(s=[t[0],t[1],t[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((h=s[8])*(n=s[4])-(a=s[5])*(A=s[7]))+s[1]*(-h*(o=s[3])+a*(l=s[6]))+s[2]*(A*o-n*l);var s,o,n,a,l,A,h;if(0===r)return null;const c=C([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),u=C([],[i[0],i[1],i[2]],[t[0],t[1],t[2]]),f=C([],[t[0],t[1],t[2]],[e[0],e[1],e[2]]),d=B([],c,-t[3]);return y(d,d,B([],u,-e[3])),y(d,d,B([],f,-i[3])),B(d,d,1/r),d},t.bt=uc,t.bu=function(){return new Float64Array(4)},t.bv=function(t,e,i,r){var s=[],o=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],o[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),o[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),o[2]=s[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},t.bw=function(t,e,i,r){var s=[],o=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],o[0]=s[0],o[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),o[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},t.bx=function(t,e,i,r){var s=[],o=[];return s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],o[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),o[1]=s[1],o[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},t.by=function(t,e,i){var r=Math.sin(i),s=Math.cos(i),o=e[0],n=e[1],a=e[2],l=e[3],A=e[8],h=e[9],c=e[10],u=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*s-A*r,t[1]=n*s-h*r,t[2]=a*s-c*r,t[3]=l*s-u*r,t[8]=o*r+A*s,t[9]=n*r+h*s,t[10]=a*r+c*s,t[11]=l*r+u*s,t},t.bz=function(t,e){const i=F(t,360),r=F(e,360),s=r-i,o=r>i?s-360:s+360;return Math.abs(s)<Math.abs(o)?s:o},t.c=lt,t.c0=class extends fn{},t.c1=al,t.c2=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.c3=nl,t.c4=function(t,e,i){var r=e[0],s=e[1],o=e[2],n=i[3]*r+i[7]*s+i[11]*o+i[15];return t[0]=(i[0]*r+i[4]*s+i[8]*o+i[12])/(n=n||1),t[1]=(i[1]*r+i[5]*s+i[9]*o+i[13])/n,t[2]=(i[2]*r+i[6]*s+i[10]*o+i[14])/n,t},t.c5=class extends tn{},t.c6=class extends vn{},t.c7=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.c8=function(t,e){var i=t[0],r=t[1],s=t[2],o=t[3],n=t[4],a=t[5],l=t[6],A=t[7],h=t[8],c=t[9],u=t[10],f=t[11],d=t[12],p=t[13],m=t[14],w=t[15],I=e[0],v=e[1],b=e[2],y=e[3],B=e[4],C=e[5],E=e[6],_=e[7],Q=e[8],x=e[9],M=e[10],k=e[11],D=e[12],S=e[13],G=e[14],F=e[15];return Math.abs(i-I)<=g*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(r-v)<=g*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(s-b)<=g*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(o-y)<=g*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(n-B)<=g*Math.max(1,Math.abs(n),Math.abs(B))&&Math.abs(a-C)<=g*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(l-E)<=g*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(A-_)<=g*Math.max(1,Math.abs(A),Math.abs(_))&&Math.abs(h-Q)<=g*Math.max(1,Math.abs(h),Math.abs(Q))&&Math.abs(c-x)<=g*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(u-M)<=g*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-k)<=g*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(d-D)<=g*Math.max(1,Math.abs(d),Math.abs(D))&&Math.abs(p-S)<=g*Math.max(1,Math.abs(p),Math.abs(S))&&Math.abs(m-G)<=g*Math.max(1,Math.abs(m),Math.abs(G))&&Math.abs(w-F)<=g*Math.max(1,Math.abs(w),Math.abs(F))},t.c9=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.cA=function(t){delete At.REGISTERED_PROTOCOLS[t]},t.cB=function(t,e){const i={};for(let r=0;r<t.length;r++){const s=e&&e[t[r].id]||ys(t[r]);e&&(e[t[r].id]=s);let o=i[s];o||(o=i[s]=[]),o.push(t[r])}const r=[];for(const t in i)r.push(i[t]);return r},t.cC=lo,t.cD=xc,t.cE=kc,t.cF=mh,t.cG=function(e){e.bucket.createArrays(),e.bucket.tilePixelRatio=S/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=false;const i=e.bucket.layers[0],r=i.layout,s=i._unevaluatedLayout._values,o={layoutIconSize:s["icon-size"].possiblyEvaluate(new ko(e.bucket.zoom+1),e.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new ko(e.bucket.zoom+1),e.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new ko(18))};if("composite"===e.bucket.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.textSizeData;o.compositeTextSizes=[s["text-size"].possiblyEvaluate(new ko(t),e.canonical),s["text-size"].possiblyEvaluate(new ko(i),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.iconSizeData;o.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new ko(t),e.canonical),s["icon-size"].possiblyEvaluate(new ko(i),e.canonical)]}const n=r.get("text-line-height")*nh,a="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),l=r.get("text-keep-upright"),A=r.get("text-size");for(const s of e.bucket.features){const h=r.get("text-font").evaluate(s,{},e.canonical).join(","),c=A.evaluate(s,{},e.canonical),u=o.layoutTextSize.evaluate(s,{},e.canonical),f=o.layoutIconSize.evaluate(s,{},e.canonical),d={horizontal:{},vertical:void 0},g=s.text;let p,m=[0,0];if(g){const o=g.toString(),A=r.get("text-letter-spacing").evaluate(s,{},e.canonical)*nh,f=wo(o)?A:0,p=r.get("text-anchor").evaluate(s,{},e.canonical),w=eu(i,s,e.canonical);if(!w){const t=r.get("text-radial-offset").evaluate(s,{},e.canonical);m=t?tu(p,[t*nh,Xc]):r.get("text-offset").evaluate(s,{},e.canonical).map((t=>t*nh))}let I=a?"center":r.get("text-justify").evaluate(s,{},e.canonical);const v="point"===r.get("symbol-placement")?r.get("text-max-width").evaluate(s,{},e.canonical)*nh:1/0,b=()=>{e.bucket.allowVerticalPlacement&&mo(o)&&(d.vertical=vh(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,n,p,"left",f,m,t.an.vertical,true,u,c))};if(!a&&w){const i=new Set;if("auto"===I)for(let t=0;t<w.values.length;t+=2)i.add(iu(w.values[t]));else i.add(I);let r=false;for(const s of i)if(!d.horizontal[s])if(r)d.horizontal[s]=d.horizontal[0];else{const i=vh(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,n,"center",s,f,m,t.an.horizontal,false,u,c);i&&(d.horizontal[s]=i,r=1===i.positionedLines.length)}b()}else{"auto"===I&&(I=iu(p));const i=vh(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,n,p,I,f,m,t.an.horizontal,false,u,c);i&&(d.horizontal[I]=i),b(),mo(o)&&a&&l&&(d.vertical=vh(g,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,n,p,I,f,m,t.an.vertical,false,u,c))}}let w=false;if(s.icon&&s.icon.name){const t=e.imageMap[s.icon.name];t&&(p=zh(e.imagePositions[s.icon.name],r.get("icon-offset").evaluate(s,{},e.canonical),r.get("icon-anchor").evaluate(s,{},e.canonical)),w=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=w:e.bucket.sdfIcons!==w&&Y("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=true))}const I=ou(d.horizontal)||d.vertical;e.bucket.iconsInText=!!I&&I.iconsInText,(I||p)&&ru(e.bucket,s,d,p,e.imageMap,o,u,f,m,w,e.canonical,e.subdivisionGranularity)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.cH=qA,t.cI=rA,t.cJ=_A,t.cK=yA,t.cL=ch,t.cM=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return 0===t.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}},t.cN=function(t,i,r,s,o){return e(this,void 0,void 0,(function*(){if(d())try{return yield X(t,i,r,s,o)}catch(t){}return function(t,e,i,r,s){const o=t.width,n=t.height;tt&&et||(tt=new OffscreenCanvas(o,n),et=tt.getContext("2d",{willReadFrequently:true})),tt.width=o,tt.height=n,et.drawImage(t,0,0,o,n);const a=et.getImageData(e,i,r,s);return et.clearRect(0,0,o,n),a.data}(t,i,r,s,o)}))},t.cO=gl,t.cP=i,t.cQ=o,t.cR=bA,t.cS=Ah,t.cT=ss,t.cU=Mo,t.ca=t=>"symbol"===t.type,t.cb=t=>"circle"===t.type,t.cc=t=>"heatmap"===t.type,t.cd=t=>"line"===t.type,t.ce=t=>"fill"===t.type,t.cf=t=>"fill-extrusion"===t.type,t.cg=t=>"hillshade"===t.type,t.ch=t=>"color-relief"===t.type,t.ci=t=>"raster"===t.type,t.cj=t=>"background"===t.type,t.ck=t=>"custom"===t.type,t.cl=z,t.cm=function(t,e,i){const r=D(e.x-i.x,e.y-i.y),s=D(t.x-i.x,t.y-i.y);var o,n;return st(Math.atan2(r[0]*s[1]-r[1]*s[0],(o=r)[0]*(n=s)[0]+o[1]*n[1]))},t.cn=U,t.co=function(t,e){return nt[e]&&(t instanceof MouseEvent||t instanceof WheelEvent)},t.cp=function(t,e){return ot[e]&&"touches"in t},t.cq=function(t){return ot[t]||nt[t]},t.cr=function(t,e,i){var r=e[0],s=e[1];return t[0]=i[0]*r+i[4]*s+i[12],t[1]=i[1]*r+i[5]*s+i[13],t},t.cs=function(t,e){const{x:i,y:r}=bc.fromLngLat(e);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)},t.ct=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.cu=class extends Xo{},t.cv=vu,t.cx=function(t){return t.message===at},t.cy=ut,t.cz=function(t,e){At.REGISTERED_PROTOCOLS[t]=e},t.d=gt,t.e=T,t.f=t=>e(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),t.g=ht,t.h=t=>new Promise(((e,i)=>{const r=new Image;r.onload=()=>{e(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>{r.src=W}))},r.onerror=()=>i(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 s=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(s):W})),t.i=V,t.j=(t,e)=>dt(T(t,{type:"json"}),e),t.k=It,t.l=wt,t.m=dt,t.n=(t,e)=>dt(T(t,{type:"arrayBuffer"}),e),t.o=function(t){return new ch(t).readFields(uh,[])},t.p=gh,t.q=sl,t.r=jo,t.s=it,t.t=Go,t.u=po,t.v=bt,t.w=Y,t.x=eo,t.y=oo,t.z=to}));i("worker",["./shared"],(function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,i){for(const i of e){this._layerConfigs[i.id]=i;const e=this._layers[i.id]=t.bI(i);e._featureFilter=t.a9(e.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const t of i)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const r=t.cB(Object.values(this._layerConfigs),this.keyCache);for(const t of r){const e=t.map((t=>this._layers[t.id])),i=e[0];if("none"===i.visibility)continue;const r=i.source||"";let s=this.familiesBySource[r];s||(s=this.familiesBySource[r]={});const o=i.sourceLayer||"_geojsonTileLayer";let n=s[o];n||(n=s[o]=[]),n.push(e)}}}class i{constructor(e){const i={},r=[];for(const t in e){const s=e[t],o=i[t]={};for(const t in s){const e=s[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};r.push(i),o[t]={rect:i,metrics:e.metrics}}}const{w:s,h:o}=t.p(r),n=new t.q({width:s||1,height:o||1});for(const r in e){const s=e[r];for(const e in s){const o=s[+e];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const a=i[r][e].rect;t.q.copy(o.bitmap,n,{x:0,y:0},{x:a.x+1,y:a.y+1},o.bitmap)}}this.image=n,this.positions=i}}t.cC("GlyphAtlas",i);class r{constructor(e){this.tileID=new t.Z(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.globalState=e.globalState}parse(e,r,o,n,a){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a7;const l=new t.cD(Object.keys(e.layers).sort()),A=new t.cE(this.tileID,this.promoteId);A.bucketLayerIDs=[];const h={},c={featureIndex:A,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:o,subdivisionGranularity:a},u=r.familiesBySource[this.source];for(const i in u){const r=e.layers[i];if(!r)continue;1===r.version&&t.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const n=l.encode(i),a=[];for(let t=0;t<r.length;t++){const e=r.feature(t),s=A.getId(e,i);a.push({feature:e,id:s,index:t,sourceLayerIndex:n})}for(const e of u[i]){const i=e[0];i.source!==this.source&&t.w(`layer.source = ${i.source} does not equal this.source = ${this.source}`),i.minzoom&&this.zoom<Math.floor(i.minzoom)||i.maxzoom&&this.zoom>=i.maxzoom||"none"!==i.visibility&&(s(e,this.zoom,o),(h[i.id]=i.createBucket({index:A.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:n,sourceID:this.source,globalState:this.globalState})).populate(a,c,this.tileID.canonical),A.bucketLayerIDs.push(e.map((t=>t.id))))}}const f=t.bM(c.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>null==t?void 0:t.abort())),this.inFlightDependencies=[];let d=Promise.resolve({});if(Object.keys(f).length){const t=new AbortController;this.inFlightDependencies.push(t),d=n.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const g=Object.keys(c.iconDependencies);let p=Promise.resolve({});if(g.length){const t=new AbortController;this.inFlightDependencies.push(t),p=n.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"icons"}},t)}const m=Object.keys(c.patternDependencies);let w=Promise.resolve({});if(m.length){const t=new AbortController;this.inFlightDependencies.push(t),w=n.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const[I,v,b]=yield Promise.all([d,p,w]),y=new i(I),B=new t.cF(v,b);for(const e in h){const i=h[e];i instanceof t.a8?(s(i.layers,this.zoom,o),t.cG({bucket:i,glyphMap:I,glyphPositions:y.positions,imageMap:v,imagePositions:B.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:c.subdivisionGranularity})):i.hasPattern&&(i instanceof t.cH||i instanceof t.cI||i instanceof t.cJ)&&(s(i.layers,this.zoom,o),i.addFeatures(c,this.tileID.canonical,B.patternPositions))}return this.status="done",{buckets:Object.values(h).filter((t=>!t.isEmpty())),featureIndex:A,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:y.image,imageAtlas:B,glyphMap:this.returnDependencies?I:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?y.positions:null}}))}}function s(e,i,r){const s=new t.F(i);for(const t of e)t.recalculate(s,r)}class o{constructor(t,e,i){this.actor=t,this.layerIndex=e,this.availableImages=i,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,i){return t._(this,void 0,void 0,(function*(){const r=yield t.n(e.request,i);try{return{vectorTile:new t.cK.VectorTile(new t.cL(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires}}catch(t){const i=new Uint8Array(r.data);let s=`Unable to parse the tile at ${e.request.url}, `;throw s+=31===i[0]&&139===i[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(s)}}))}loadTile(e){return t._(this,void 0,void 0,(function*(){const i=e.uid,s=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.cM(e.request),o=new r(e);this.loading[i]=o;const n=new AbortController;o.abort=n;try{const r=yield this.loadVectorTile(e,n);if(delete this.loading[i],!r)return null;const a=r.rawData,l={};r.expires&&(l.expires=r.expires),r.cacheControl&&(l.cacheControl=r.cacheControl);const A={};if(s){const t=s.finish();t&&(A.resourceTiming=JSON.parse(JSON.stringify(t)))}o.vectorTile=r.vectorTile;const h=o.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);this.loaded[i]=o,this.fetching[i]={rawTileData:a,cacheControl:l,resourceTiming:A};try{const e=yield h;return t.e({rawTileData:a.slice(0)},e,l,A)}finally{delete this.fetching[i]}}catch(t){throw delete this.loading[i],o.status="done",this.loaded[i]=o,t}}))}reloadTile(e){return t._(this,void 0,void 0,(function*(){const i=e.uid;if(!this.loaded||!this.loaded[i])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const r=this.loaded[i];if(r.showCollisionBoxes=e.showCollisionBoxes,r.globalState=e.globalState,"parsing"===r.status){const s=yield r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);let o;if(this.fetching[i]){const{rawTileData:e,cacheControl:r,resourceTiming:n}=this.fetching[i];delete this.fetching[i],o=t.e({rawTileData:e.slice(0)},s,r,n)}else o=s;return o}if("done"===r.status&&r.vectorTile)return r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){const t=this.loading,i=e.uid;t&&t[i]&&t[i].abort&&(t[i].abort.abort(),delete t[i])}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}))}}class n{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:i,encoding:r,rawImageData:s,redFactor:o,greenFactor:n,blueFactor:a,baseShift:l}=e,A=s.width+2,h=s.height+2,c=t.b(s)?new t.R({width:A,height:h},yield t.cN(s,-1,-1,A,h)):s,u=new t.cO(i,c,r,o,n,a,l);return this.loaded=this.loaded||{},this.loaded[i]=u,u}))}removeTile(t){const e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]}}var a,l,A=function(){if(l)return a;function t(t,i){if(0!==t.length){e(t[0],i);for(var r=1;r<t.length;r++)e(t[r],!i)}}function e(t,e){for(var i=0,r=0,s=0,o=t.length,n=o-1;s<o;n=s++){var a=(t[s][0]-t[n][0])*(t[n][1]+t[s][1]),l=i+a;r+=Math.abs(i)>=Math.abs(a)?i-l+a:a-l+i,i=l}i+r>=0!=!!e&&t.reverse()}return l=1,a=function e(i,r){var s,o=i&&i.type;if("FeatureCollection"===o)for(s=0;s<i.features.length;s++)e(i.features[s],r);else if("GeometryCollection"===o)for(s=0;s<i.geometries.length;s++)e(i.geometries[s],r);else if("Feature"===o)e(i.geometry,r);else if("Polygon"===o)t(i.coordinates,r);else if("MultiPolygon"===o)for(s=0;s<i.coordinates.length;s++)t(i.coordinates[s],r);return i}}(),h=t.cP(A);const c=t.cK.VectorTileFeature.prototype.toGeoJSON;class u{constructor(e){this._feature=e,this.extent=t.$,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.P(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const r=[];for(const e of i)r.push(new t.P(e[0],e[1]));e.push(r)}return e}}toGeoJSON(t,e,i){return c.call(this,t,e,i)}}class f{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.$,this.length=e.length,this._features=e}feature(t){return new u(this._features[t])}}var d,g,p,m={exports:{}},w=function(){if(p)return m.exports;p=1;var e=t.cS(),i=function(){if(g)return d;g=1;var e=t.cQ(),i=t.cR().VectorTileFeature;function r(t,e){this.options=e||{},this.features=t,this.length=t.length}function s(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}return d=r,r.prototype.feature=function(t){return new s(this.features[t],this.options.extent)},s.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var i=0;i<t.length;i++){for(var r=t[i],s=[],o=0;o<r.length;o++)s.push(new e(r[o][0],r[o][1]));this.geometry.push(s)}return this.geometry},s.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,r=1/0,s=-1/0,o=0;o<t.length;o++)for(var n=t[o],a=0;a<n.length;a++){var l=n[a];e=Math.min(e,l.x),i=Math.max(i,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y)}return[e,r,i,s]},s.prototype.toGeoJSON=i.prototype.toGeoJSON,d}();function r(t){var i=new e;return function(t,e){for(var i in t.layers)e.writeMessage(3,s,t.layers[i])}(t,i),i.finish()}function s(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,o,r);var s=r.keys;for(i=0;i<s.length;i++)e.writeStringField(3,s[i]);var n=r.values;for(i=0;i<n.length;i++)e.writeMessage(4,h,n[i])}function o(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,n,t),e.writeVarintField(3,i.type),e.writeMessage(4,A,i)}function n(t,e){var i=t.feature,r=t.keys,s=t.values,o=t.keycache,n=t.valuecache;for(var a in i.properties){var l=i.properties[a],A=o[a];if(null!==l){void 0===A&&(r.push(a),o[a]=A=r.length-1),e.writeVarint(A);var h=typeof l;"string"!==h&&"boolean"!==h&&"number"!==h&&(l=JSON.stringify(l));var c=h+":"+l,u=n[c];void 0===u&&(s.push(l),n[c]=u=s.length-1),e.writeVarint(u)}}}function a(t,e){return(e<<3)+(7&t)}function l(t){return t<<1^t>>31}function A(t,e){for(var i=t.loadGeometry(),r=t.type,s=0,o=0,n=i.length,A=0;A<n;A++){var h=i[A],c=1;1===r&&(c=h.length),e.writeVarint(a(1,c));for(var u=3===r?h.length-1:h.length,f=0;f<u;f++){1===f&&1!==r&&e.writeVarint(a(2,u-1));var d=h[f].x-s,g=h[f].y-o;e.writeVarint(l(d)),e.writeVarint(l(g)),s+=d,o+=g}3===r&&e.writeVarint(a(7,1))}}function h(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}return m.exports=r,m.exports.fromVectorTileJs=r,m.exports.fromGeojsonVt=function(t,e){e=e||{};var s={};for(var o in t)s[o]=new i(t[o].features,e),s[o].name=o,s[o].version=e.version,s[o].extent=e.extent;return r({layers:s})},m.exports.GeoJSONWrapper=i,m.exports}(),I=t.cP(w);const v={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:false,generateId:false,reduce:null,map:t=>t},b=Math.fround||(y=new Float32Array(1),t=>(y[0]=+t,y[0]));var y;class B{constructor(t){this.options=Object.assign(Object.create(v),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:i,maxZoom:r}=this.options;e&&console.time("total time");const s=`prepare ${t.length} points`;e&&console.time(s),this.points=t;const o=[];for(let e=0;e<t.length;e++){const i=t[e];if(!i.geometry)continue;const[r,s]=i.geometry.coordinates,n=b(_(r)),a=b(Q(s));o.push(n,a,1/0,e,-1,1),this.options.reduce&&o.push(0)}let n=this.trees[r+1]=this._createTree(o);e&&console.timeEnd(s);for(let t=r;t>=i;t--){const i=+Date.now();n=this.trees[t]=this._createTree(this._cluster(n,t)),e&&console.log("z%d: %d clusters in %dms",t,n.numItems,+Date.now()-i)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let s=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,s=180;else if(i>s){const t=this.getClusters([i,r,180,o],e),n=this.getClusters([-180,r,s,o],e);return t.concat(n)}const n=this.trees[this._limitZoom(e)],a=n.range(_(i),Q(o),_(s),Q(r)),l=n.data,A=[];for(const t of a){const e=this.stride*t;A.push(l[e+5]>1?C(l,e,this.clusterProps):this.points[l[e+3]])}return A}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),r="No cluster with the specified id.",s=this.trees[i];if(!s)throw new Error(r);const o=s.data;if(e*this.stride>=o.length)throw new Error(r);const n=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=s.within(o[e*this.stride],o[e*this.stride+1],n),l=[];for(const e of a){const i=e*this.stride;o[i+4]===t&&l.push(o[i+5]>1?C(o,i,this.clusterProps):this.points[o[i+3]])}if(0===l.length)throw new Error(r);return l}getLeaves(t,e,i){const r=[];return this._appendLeaves(r,t,e=e||10,i=i||0,0),r}getTile(t,e,i){const r=this.trees[this._limitZoom(t)],s=Math.pow(2,t),{extent:o,radius:n}=this.options,a=n/o,l=(i-a)/s,A=(i+1+a)/s,h={features:[]};return this._addTileFeatures(r.range((e-a)/s,l,(e+1+a)/s,A),r.data,e,i,s,h),0===e&&this._addTileFeatures(r.range(1-a/s,l,1,A),r.data,s,i,s,h),e===s-1&&this._addTileFeatures(r.range(0,l,a/s,A),r.data,-1,i,s,h),h.features.length?h:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,r,s){const o=this.getChildren(e);for(const e of o){const o=e.properties;if(o&&o.cluster?s+o.point_count<=r?s+=o.point_count:s=this._appendLeaves(t,o.cluster_id,i,r,s):s<r?s++:t.push(e),t.length===i)break}return s}_createTree(e){const i=new t.aH(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)i.add(e[t],e[t+1]);return i.finish(),i.data=e,i}_addTileFeatures(t,e,i,r,s,o){for(const n of t){const t=n*this.stride,a=e[t+5]>1;let l,A,h;if(a)l=E(e,t,this.clusterProps),A=e[t],h=e[t+1];else{const i=this.points[e[t+3]];l=i.properties;const[r,s]=i.geometry.coordinates;A=_(r),h=Q(s)}const c={type:1,geometry:[[Math.round(this.options.extent*(A*s-i)),Math.round(this.options.extent*(h*s-r))]],tags:l};let u;u=a||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==u&&(c.id=u),o.features.push(c)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:i,extent:r,reduce:s,minPoints:o}=this.options,n=i/(r*Math.pow(2,e)),a=t.data,l=[],A=this.stride;for(let i=0;i<a.length;i+=A){if(a[i+2]<=e)continue;a[i+2]=e;const r=a[i],h=a[i+1],c=t.within(a[i],a[i+1],n),u=a[i+5];let f=u;for(const t of c){const i=t*A;a[i+2]>e&&(f+=a[i+5])}if(f>u&&f>=o){let t,o=r*u,n=h*u,d=-1;const g=(i/A<<5)+(e+1)+this.points.length;for(const r of c){const l=r*A;if(a[l+2]<=e)continue;a[l+2]=e;const h=a[l+5];o+=a[l]*h,n+=a[l+1]*h,a[l+4]=g,s&&(t||(t=this._map(a,i,true),d=this.clusterProps.length,this.clusterProps.push(t)),s(t,this._map(a,l)))}a[i+4]=g,l.push(o/f,n/f,1/0,g,-1,f),s&&l.push(d)}else{for(let t=0;t<A;t++)l.push(a[i+t]);if(f>1)for(const t of c){const i=t*A;if(!(a[i+2]<=e)){a[i+2]=e;for(let t=0;t<A;t++)l.push(a[i+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,i){if(t[e+5]>1){const r=this.clusterProps[t[e+6]];return i?Object.assign({},r):r}const r=this.points[t[e+3]].properties,s=this.options.map(r);return i&&s===r?Object.assign({},s):s}}function C(t,e,i){return{type:"Feature",id:t[e+3],properties:E(t,e,i),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),x(t[e+1])]}};var r}function E(t,e,i){const r=t[e+5],s=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,o=t[e+6],n=-1===o?{}:Object.assign({},i[o]);return Object.assign(n,{cluster:true,cluster_id:t[e+3],point_count:r,point_count_abbreviated:s})}function _(t){return t/360+.5}function Q(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function x(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function M(t,e,i,r){let s=r;const o=e+(i-e>>1);let n,a=i-e;const l=t[e],A=t[e+1],h=t[i],c=t[i+1];for(let r=e+3;r<i;r+=3){const e=k(t[r],t[r+1],l,A,h,c);if(e>s)n=r,s=e;else if(e===s){const t=Math.abs(r-o);t<a&&(n=r,a=t)}}s>r&&(n-e>3&&M(t,e,n,r),t[n+2]=s,i-n>3&&M(t,n,i,r))}function k(t,e,i,r,s,o){let n=s-i,a=o-r;if(0!==n||0!==a){const l=((t-i)*n+(e-r)*a)/(n*n+a*a);l>1?(i=s,r=o):l>0&&(i+=n*l,r+=a*l)}return n=t-i,a=e-r,n*n+a*a}function D(t,e,i,r){const s={id:null==t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)S(s,i);else if("Polygon"===e)S(s,i[0]);else if("MultiLineString"===e)for(const t of i)S(s,t);else if("MultiPolygon"===e)for(const t of i)S(s,t[0]);return s}function S(t,e){for(let i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function G(t,e,i,r){if(!e.geometry)return;const s=e.geometry.coordinates;if(s&&0===s.length)return;const o=e.geometry.type,n=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=r||0),"Point"===o)F(s,a);else if("MultiPoint"===o)for(const t of s)F(t,a);else if("LineString"===o)R(s,a,n,false);else if("MultiLineString"===o){if(i.lineMetrics){for(const i of s)a=[],R(i,a,n,false),t.push(D(l,"LineString",a,e.properties));return}L(s,a,n,false)}else if("Polygon"===o)L(s,a,n,true);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const s of e.geometry.geometries)G(t,{id:l,geometry:s,properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of s){const e=[];L(t,e,n,true),a.push(e)}}t.push(D(l,o,a,e.properties))}function F(t,e){e.push(z(t[0]),U(t[1]),0)}function R(t,e,i,r){let s,o,n=0;for(let i=0;i<t.length;i++){const a=z(t[i][0]),l=U(t[i][1]);e.push(a,l,0),i>0&&(n+=r?(s*l-a*o)/2:Math.sqrt(Math.pow(a-s,2)+Math.pow(l-o,2))),s=a,o=l}const a=e.length-3;e[2]=1,M(e,0,a,i),e[a+2]=1,e.size=Math.abs(n),e.start=0,e.end=e.size}function L(t,e,i,r){for(let s=0;s<t.length;s++){const o=[];R(t[s],o,i,r),e.push(o)}}function z(t){return t/360+.5}function U(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function P(t,e,i,r,s,o,n,a){if(r/=e,o>=(i/=e)&&n<r)return t;if(n<i||o>=r)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const n=0===s?e.minX:e.minY,A=0===s?e.maxX:e.maxY;if(n>=i&&A<r){l.push(e);continue}if(A<i||n>=r)continue;let h=[];if("Point"===o||"MultiPoint"===o)N(t,h,i,r,s);else if("LineString"===o)T(t,h,i,r,s,false,a.lineMetrics);else if("MultiLineString"===o)O(t,h,i,r,s,false);else if("Polygon"===o)O(t,h,i,r,s,true);else if("MultiPolygon"===o)for(const e of t){const t=[];O(e,t,i,r,s,true),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&"LineString"===o){for(const t of h)l.push(D(e.id,o,t,e.tags));continue}"LineString"!==o&&"MultiLineString"!==o||(1===h.length?(o="LineString",h=h[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===h.length?"Point":"MultiPoint"),l.push(D(e.id,o,h,e.tags))}}return l.length?l:null}function N(t,e,i,r,s){for(let o=0;o<t.length;o+=3){const n=t[o+s];n>=i&&n<=r&&j(e,t[o],t[o+1],t[o+2])}}function T(t,e,i,r,s,o,n){let a=q(t);const l=0===s?J:H;let A,h,c=t.start;for(let u=0;u<t.length-3;u+=3){const f=t[u],d=t[u+1],g=t[u+2],p=t[u+3],m=t[u+4],w=0===s?f:d,I=0===s?p:m;let v=false;n&&(A=Math.sqrt(Math.pow(f-p,2)+Math.pow(d-m,2))),w<i?I>i&&(h=l(a,f,d,p,m,i),n&&(a.start=c+A*h)):w>r?I<r&&(h=l(a,f,d,p,m,r),n&&(a.start=c+A*h)):j(a,f,d,g),I<i&&w>=i&&(h=l(a,f,d,p,m,i),v=true),I>r&&w<=r&&(h=l(a,f,d,p,m,r),v=true),!o&&v&&(n&&(a.end=c+A*h),e.push(a),a=q(t)),n&&(c+=A)}let u=t.length-3;const f=t[u],d=t[u+1],g=0===s?f:d;g>=i&&g<=r&&j(a,f,d,t[u+2]),u=a.length-3,o&&u>=3&&(a[u]!==a[0]||a[u+1]!==a[1])&&j(a,a[0],a[1],a[2]),a.length&&e.push(a)}function q(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function O(t,e,i,r,s,o){for(const n of t)T(n,e,i,r,s,o,false)}function j(t,e,i,r){t.push(e,i,r)}function J(t,e,i,r,s,o){const n=(o-e)/(r-e);return j(t,o,i+(s-i)*n,1),n}function H(t,e,i,r,s,o){const n=(o-i)/(s-i);return j(t,e+(r-e)*n,o,1),n}function Y(t,e){const i=[];for(let r=0;r<t.length;r++){const s=t[r],o=s.type;let n;if("Point"===o||"MultiPoint"===o||"LineString"===o)n=$(s.geometry,e);else if("MultiLineString"===o||"Polygon"===o){n=[];for(const t of s.geometry)n.push($(t,e))}else if("MultiPolygon"===o){n=[];for(const t of s.geometry){const i=[];for(const r of t)i.push($(r,e));n.push(i)}}i.push(D(s.id,o,n,s.tags))}return i}function $(t,e){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(let r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function V(t,e){if(t.transformed)return t;const i=1<<t.z,r=t.x,s=t.y;for(const o of t.features){const t=o.geometry,n=o.type;if(o.geometry=[],1===n)for(let n=0;n<t.length;n+=2)o.geometry.push(K(t[n],t[n+1],e,i,r,s));else for(let n=0;n<t.length;n++){const a=[];for(let o=0;o<t[n].length;o+=2)a.push(K(t[n][o],t[n][o+1],e,i,r,s));o.geometry.push(a)}}return t.transformed=true,t}function K(t,e,i,r,s,o){return[Math.round(i*(t*r-s)),Math.round(i*(e*r-o))]}function Z(t,e,i,r,s){const o=e===s.maxZoom?0:s.tolerance/((1<<e)*s.extent),n={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:r,z:e,transformed:false,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)W(n,e,o,s);return n}function W(t,e,i,r){const s=e.geometry,o=e.type,n=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===o||"MultiPoint"===o)for(let e=0;e<s.length;e+=3)n.push(s[e],s[e+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)X(n,s,t,i,false,false);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<s.length;e++)X(n,s[e],t,i,"Polygon"===o,0===e);else if("MultiPolygon"===o)for(let e=0;e<s.length;e++){const r=s[e];for(let e=0;e<r.length;e++)X(n,r[e],t,i,true,0===e)}if(n.length){let i=e.tags||null;if("LineString"===o&&r.lineMetrics){i={};for(const t in e.tags)i[t]=e.tags[t];i.mapbox_clip_start=s.start/s.size,i.mapbox_clip_end=s.end/s.size}const a={geometry:n,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:i};null!==e.id&&(a.id=e.id),t.features.push(a)}}function X(t,e,i,r,s,o){const n=r*r;if(r>0&&e.size<(s?n:r))return void(i.numPoints+=e.length/3);const a=[];for(let t=0;t<e.length;t+=3)(0===r||e[t+2]>n)&&(i.numSimplified++,a.push(e[t],e[t+1])),i.numPoints++;s&&function(t,e){let i=0;for(let e=0,r=t.length,s=r-2;e<r;s=e,e+=2)i+=(t[e]-t[s])*(t[e+1]+t[s+1]);if(i>0===e)for(let e=0,i=t.length;e<i/2;e+=2){const r=t[e],s=t[e+1];t[e]=t[i-2-e],t[e+1]=t[i-1-e],t[i-2-e]=r,t[i-1-e]=s}}(a,o),t.push(a)}const tt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:false,promoteId:null,generateId:false,debug:0};class et{constructor(t,e){const i=(e=this.options=function(t,e){for(const i in e)t[i]=e[i];return t}(Object.create(tt),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const i=[];if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)G(i,t.features[r],e,r);else G(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const i=e.buffer/e.extent;let r=t;const s=P(t,1,-1-i,i,0,-1,2,e),o=P(t,1,1-i,2+i,0,-1,2,e);return(s||o)&&(r=P(t,1,-i,1+i,0,-1,2,e)||[],s&&(r=Y(s,1).concat(r)),o&&(r=r.concat(Y(o,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,i,r,s,o,n){const a=[t,e,i,r],l=this.options,A=l.debug;for(;a.length;){r=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();const h=1<<e,c=it(e,i,r);let u=this.tiles[c];if(!u&&(A>1&&console.time("creation"),u=this.tiles[c]=Z(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),A)){A>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,u.numFeatures,u.numPoints,u.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(u.source=t,null==s){if(e===l.indexMaxZoom||u.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===s)continue;if(null!=s){const t=s-e;if(i!==o>>t||r!==n>>t)continue}}if(u.source=null,0===t.length)continue;A>1&&console.time("clipping");const f=.5*l.buffer/l.extent,d=.5-f,g=.5+f,p=1+f;let m=null,w=null,I=null,v=null,b=P(t,h,i-f,i+g,0,u.minX,u.maxX,l),y=P(t,h,i+d,i+p,0,u.minX,u.maxX,l);t=null,b&&(m=P(b,h,r-f,r+g,1,u.minY,u.maxY,l),w=P(b,h,r+d,r+p,1,u.minY,u.maxY,l),b=null),y&&(I=P(y,h,r-f,r+g,1,u.minY,u.maxY,l),v=P(y,h,r+d,r+p,1,u.minY,u.maxY,l),y=null),A>1&&console.timeEnd("clipping"),a.push(m||[],e+1,2*i,2*r),a.push(w||[],e+1,2*i,2*r+1),a.push(I||[],e+1,2*i+1,2*r),a.push(v||[],e+1,2*i+1,2*r+1)}}getTile(t,e,i){t=+t,e=+e,i=+i;const r=this.options,{extent:s,debug:o}=r;if(t<0||t>24)return null;const n=1<<t,a=it(t,e=e+n&n-1,i);if(this.tiles[a])return V(this.tiles[a],s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let l,A=t,h=e,c=i;for(;!l&&A>0;)A--,h>>=1,c>>=1,l=this.tiles[it(A,h,c)];return l&&l.source?(o>1&&(console.log("found parent tile z%d-%d-%d",A,h,c),console.time("drilling down")),this.splitTile(l.source,A,h,c,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?V(this.tiles[a],s):null):null}}function it(t,e,i){return 32*((1<<t)*i+e)+t}function rt(t,e){return e?t.properties[e]:t.id}function st(t,e){if(null==t)return true;if("Feature"===t.type)return null!=rt(t,e);if("FeatureCollection"===t.type){const i=new Set;for(const r of t.features){const t=rt(r,e);if(null==t)return false;if(i.has(t))return false;i.add(t)}return true}return false}function ot(t,e){const i=new Map;if(null==t);else if("Feature"===t.type)i.set(rt(t,e),t);else for(const r of t.features)i.set(rt(r,e),r);return i}class nt extends o{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(e,i){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const i=this._geoJSONIndex.getTile(t.z,t.x,t.y);if(!i)return null;const r=new f(i.features);let s=I(r);return 0===s.byteOffset&&s.byteLength===s.buffer.byteLength||(s=new Uint8Array(s)),{vectorTile:r,rawData:s.buffer}}))}loadData(e){return t._(this,void 0,void 0,(function*(){var i;null===(i=this._pendingRequest)||void 0===i||i.abort();const r=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.cM(e.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(e,this._pendingRequest),this._geoJSONIndex=e.cluster?new B(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const r={},s={},o={accumulated:null,zoom:0},n={properties:null},a=Object.keys(i);for(const e of a){const[o,n]=i[e],a=t.cT(n),l=t.cT("string"==typeof o?[o,["accumulated"],["get",e]]:o);r[e]=a.value,s[e]=l.value}return e.map=t=>{n.properties=t;const e={};for(const t of a)e[t]=r[t].evaluate(o,n);return e},e.reduce=(t,e)=>{n.properties=e;for(const e of a)o.accumulated=t[e],t[e]=s[e].evaluate(o,n)},e}(e)).load((yield this._pendingData).features):(s=yield this._pendingData,new et(s,e.geojsonVtOptions)),this.loaded={};const i={};if(r){const t=r.finish();t&&(i.resourceTiming={},i.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return i}catch(e){if(delete this._pendingRequest,t.cx(e))return{abandoned:true};throw e}var s}))}getData(){return t._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(t){const e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,i){return t._(this,void 0,void 0,(function*(){let r=yield this.loadGeoJSON(e,i);if(delete this._pendingRequest,"object"!=typeof r)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(h(r,true),e.filter){const i=t.cT(e.filter,{type:"boolean","property-type":"data-driven",overridable:false,transition:false});if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const s=r.features.filter((t=>i.value.evaluate({zoom:0},t)));r={type:"FeatureCollection",features:s}}return r}))}loadGeoJSON(e,i){return t._(this,void 0,void 0,(function*(){const{promoteId:r}=e;if(e.request){const s=yield t.j(e.request,i);return this._dataUpdateable=st(s.data,r)?ot(s.data,r):void 0,s.data}if("string"==typeof e.data)try{const t=JSON.parse(e.data);return this._dataUpdateable=st(t,r)?ot(t,r):void 0,t}catch(t){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,i){var r,s,o,n;if(e.removeAll&&t.clear(),e.remove)for(const i of e.remove)t.delete(i);if(e.add)for(const r of e.add){const e=rt(r,i);null!=e&&t.set(e,r)}if(e.update)for(const i of e.update){let e=t.get(i.id);if(null==e)continue;const a=!i.removeAllProperties&&((null===(r=i.removeProperties)||void 0===r?void 0:r.length)>0||(null===(s=i.addOrUpdateProperties)||void 0===s?void 0:s.length)>0);if((i.newGeometry||i.removeAllProperties||a)&&(e=Object.assign({},e),t.set(i.id,e),a&&(e.properties=Object.assign({},e.properties))),i.newGeometry&&(e.geometry=i.newGeometry),i.removeAllProperties)e.properties={};else if((null===(o=i.removeProperties)||void 0===o?void 0:o.length)>0)for(const t of i.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(n=i.addOrUpdateProperties)||void 0===n?void 0:n.length)>0)for(const{key:t,value:r}of i.addOrUpdateProperties)e.properties[t]=r}}(this._dataUpdateable,e.dataDiff,r),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(e){return t._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class at{constructor(e){this.self=e,this.actor=new t.J(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.cz,this.self.removeProtocol=t.cA,this.self.registerRTLTextPlugin=e=>{t.cU.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,i)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,i.source).removeTile(i)})))),this.actor.registerMessageHandler("GCEZ",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterExpansionZoom(i)})))),this.actor.registerMessageHandler("GCC",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterChildren(i)})))),this.actor.registerMessageHandler("GCL",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterLeaves(i)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("GD",((t,e)=>this._getWorkerSource(t,e.type,e.source).getData())),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,i)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][i.type]||!this.workerSources[e][i.type][i.source])return;const t=this.workerSources[e][i.type][i.source];delete this.workerSources[e][i.type][i.source],void 0!==t.removeSource&&t.removeSource(i)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})))),this.actor.registerMessageHandler("SR",((e,i)=>t._(this,void 0,void 0,(function*(){this.referrer=i})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,i)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(i)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,i)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(i.layers,i.removedIds)})))),this.actor.registerMessageHandler("SL",((e,i)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(i)}))))}_setImages(e,i){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=i;for(const t in this.workerSources[e]){const r=this.workerSources[e][t];for(const t in r)r[t].availableImages=i}}))}_syncRTLPluginState(e,i){return t._(this,void 0,void 0,(function*(){return yield t.cU.syncState(i,this.self.importScripts)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let i=this.layerIndexes[t];return i||(i=this.layerIndexes[t]=new e),i}_getWorkerSource(t,e,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][i]){const r={sendAsync:(e,i)=>(e.targetMapId=t,this.actor.sendAsync(e,i))};switch(e){case"vector":this.workerSources[t][e][i]=new o(r,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][i]=new nt(r,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][i]=new this.externalWorkerSourceTypes[e](r,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][i]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new n),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new at(self)),at}));i("index",["exports","./shared"],(function(t,e){var i="5.6.0";function r(){var t=new e.A(4);return e.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}let s,o;const n={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(t,i,r){const s=requestAnimationFrame((t=>{o(),i(t)})),{unsubscribe:o}=e.s(t.signal,"abort",(()=>{o(),cancelAnimationFrame(s),r(e.c())}),false)},frameAsync(t){return new Promise(((e,i)=>{this.frame(t,e,i)}))},getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const e=window.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:true});if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i},resolveURL:t=>(s||(s=document.createElement("a")),s.href=t,s.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==o&&(o=matchMedia("(prefers-reduced-motion: reduce)")),o.matches)}};class a{static testProp(t){if(!a.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in a.docStyle)return t[e];return t[0]}static create(t,e,i){const r=window.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){a.docStyle&&a.selectProp&&(a.userSelect=a.docStyle[a.selectProp],a.docStyle[a.selectProp]="none")}static enableDrag(){a.docStyle&&a.selectProp&&(a.docStyle[a.selectProp]=a.userSelect)}static setTransform(t,e){t.style[a.transformProp]=e}static addEventListener(t,e,i,r={}){t.addEventListener(e,i,"passive"in r?r:r.capture)}static removeEventListener(t,e,i,r={}){t.removeEventListener(e,i,"passive"in r?r:r.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",a.suppressClickInternal,true)}static suppressClick(){window.addEventListener("click",a.suppressClickInternal,true),window.setTimeout((()=>{window.removeEventListener("click",a.suppressClickInternal,true)}),0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,i,r){const s=i.boundingClientRect;return new e.P((r.clientX-s.left)/i.x-t.clientLeft,(r.clientY-s.top)/i.y-t.clientTop)}static mousePos(t,e){const i=a.getScale(t);return a.getPoint(t,i,e)}static touchPos(t,e){const i=[],r=a.getScale(t);for(let s=0;s<e.length;s++)i.push(a.getPoint(t,r,e[s]));return i}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}static sanitize(t){const e=(new DOMParser).parseFromString(t,"text/html").body||document.createElement("body"),i=e.querySelectorAll("script");for(const t of i)t.remove();return a.clean(e),e.innerHTML}static isPossiblyDangerous(t,e){const i=e.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!i.includes("javascript:")&&!i.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){const e=t.children;for(const t of e)a.removeAttributes(t),a.clean(t)}static removeAttributes(t){for(const{name:e,value:i}of t.attributes)a.isPossiblyDangerous(e,i)&&t.removeAttribute(e)}}a.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,a.selectProp=a.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a.transformProp=a.testProp(["transform","WebkitTransform"]);const l={supported:false,testSupport:function(t){!c&&h&&(u?f(t):A=t)}};let A,h,c=false,u=false;function f(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,h),t.isContextLost())return;l.supported=true}catch(t){}t.deleteTexture(e),c=true}var d;"undefined"!=typeof document&&(h=document.createElement("img"),h.onload=()=>{A&&f(A),A=null,u=true},h.onerror=()=>{c=true,A=null},h.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let i,r,s,o;t.resetRequestQueue=()=>{i=[],r=0,s=0,o={}},t.addThrottleControl=t=>{const e=s++;return o[e]=t,e},t.removeThrottleControl=t=>{delete o[t],a()},t.getImage=(t,r,s=true)=>new Promise(((o,n)=>{l.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),i.push({abortController:r,requestParameters:t,supportImageRefresh:s,state:"queued",onError:t=>{n(t)},onSuccess:t=>{o(t)}}),a()}));const n=t=>e._(this,void 0,void 0,(function*(){t.state="running";const{requestParameters:i,supportImageRefresh:s,onError:o,onSuccess:n,abortController:l}=t,h=false===s&&!e.i(self)&&!e.g(i.url)&&(!i.headers||Object.keys(i.headers).reduce(((t,e)=>t&&"accept"===e),true));r++;const c=h?A(i,l):e.m(i,l);try{const i=yield c;delete t.abortController,t.state="completed",i.data instanceof HTMLImageElement||e.b(i.data)?n(i):i.data&&n({data:yield(u=i.data,"function"==typeof createImageBitmap?e.f(u):e.h(u)),cacheControl:i.cacheControl,expires:i.expires})}catch(e){delete t.abortController,o(e)}finally{r--,a()}var u})),a=()=>{const t=(()=>{for(const t of Object.keys(o))if(o[t]())return true;return false})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=r;e<t&&i.length>0;e++){const t=i.shift();t.abortController.signal.aborted?e--:n(t)}},A=(t,i)=>new Promise(((r,s)=>{const o=new Image,n=t.url,a=t.credentials;a&&"include"===a?o.crossOrigin="use-credentials":(a&&"same-origin"===a||!e.d(n))&&(o.crossOrigin="anonymous"),i.signal.addEventListener("abort",(()=>{o.src="",s(e.c())})),o.fetchPriority="high",o.onload=()=>{o.onerror=o.onload=null,r({data:o})},o.onerror=()=>{o.onerror=o.onload=null,i.signal.aborted||s(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},o.src=n}))}(d||(d={})),d.resetRequestQueue();class g{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function p(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const i=[];for(const{id:r,url:s}of t){const t=`${r}${s}`;-1===i.indexOf(t)&&(i.push(t),e.push({id:r,url:s}))}}return e}function m(t,e,i){try{const r=new URL(t);return r.pathname+=`${e}${i}`,r.toString()}catch(e){throw new Error(`Invalid sprite URL "${t}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function w(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),true)}class I extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=false,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=true}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const i=this.images[t];if(i&&!i.data&&i.spriteData){const t=i.spriteData;i.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),i.spriteData=null}return i}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,i){let r=true;const s=i.data||i.spriteData;return this._validateStretch(i.stretchX,s&&s.width)||(this.fire(new e.k(new Error(`Image "${t}" has invalid "stretchX" value`))),r=false),this._validateStretch(i.stretchY,s&&s.height)||(this.fire(new e.k(new Error(`Image "${t}" has invalid "stretchY" value`))),r=false),this._validateContent(i.content,i)||(this.fire(new e.k(new Error(`Image "${t}" has invalid "content" value`))),r=false),r}_validateStretch(t,e){if(!t)return true;let i=0;for(const r of t){if(r[0]<i||r[1]<r[0]||e<r[1])return false;i=r[1]}return true}_validateContent(t,e){if(!t)return true;if(4!==t.length)return false;const i=e.spriteData,r=i&&i.width||e.data.width,s=i&&i.height||e.data.height;return!(t[0]<0||r<t[0]||t[1]<0||s<t[1]||t[2]<0||r<t[2]||t[3]<0||s<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e,i=true){const r=this.getImage(t);if(i&&(r.data.width!==e.data.width||r.data.height!==e.data.height))throw new Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${e.data.width}x${e.data.height}).`);e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=true}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((e,i)=>{let r=true;if(!this.isLoaded())for(const e of t)this.images[e]||(r=false);this.isLoaded()||r?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){const i={};for(const r of t){let t=this.getImage(r);t||(this.fire(new e.l("styleimagemissing",{id:r})),t=this.getImage(r)),t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${r}" 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 i}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const i=this.patterns[t],r=this.getImage(t);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{const i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},s=new e.I(i,r);this.patterns[t]={bin:i,position:s}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const i=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=false):this.atlasTexture=new e.T(t,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:i,h:r}=e.p(t),s=this.atlasImage;s.resize({width:i||1,height:r||1});for(const t in this.patterns){const{bin:i}=this.patterns[t],r=i.x+1,o=i.y+1,n=this.getImage(t).data,a=n.width,l=n.height;e.R.copy(n,s,{x:0,y:0},{x:r,y:o},{width:a,height:l}),e.R.copy(n,s,{x:0,y:l-1},{x:r,y:o-1},{width:a,height:1}),e.R.copy(n,s,{x:0,y:0},{x:r,y:o+l},{width:a,height:1}),e.R.copy(n,s,{x:a-1,y:0},{x:r-1,y:o},{width:1,height:l}),e.R.copy(n,s,{x:0,y:0},{x:r+a,y:o},{width:1,height:l})}this.dirty=true}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=true;const t=this.getImage(i);t||e.w(`Image with ID: "${i}" was not found`),w(t)&&this.updateImage(i,t)}}}const v=1e20;function b(t,e,i,r,s,o,n,a,l){for(let A=e;A<e+r;A++)y(t,i*o+A,o,s,n,a,l);for(let A=i;A<i+s;A++)y(t,A*o+e,1,r,n,a,l)}function y(t,e,i,r,s,o,n){o[0]=0,n[0]=-1e20,n[1]=v,s[0]=t[e];for(let a=1,l=0,A=0;a<r;a++){s[a]=t[e+a*i];const r=a*a;do{const t=o[l];A=(s[a]-s[t]+r-t*t)/(a-t)/2}while(A<=n[l]&&--l>-1);l++,o[l]=a,n[l]=A,n[l+1]=v}for(let a=0,l=0;a<r;a++){for(;n[l+1]<a;)l++;const r=o[l],A=a-r;t[e+a*i]=s[r]+A*A}}class B{constructor(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,(function*(){const e=[];for(const i in t)for(const r of t[i])e.push(this._getAndCacheGlyphsPromise(i,r));const i=yield Promise.all(e),r={};for(const{stack:t,id:e,glyph:s}of i)r[t]||(r[t]={}),r[t][e]=s&&{id:s.id,bitmap:s.bitmap.clone(),metrics:s.metrics};return r}))}_getAndCacheGlyphsPromise(t,i){return e._(this,void 0,void 0,(function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=e.glyphs[i];if(void 0!==r)return{stack:t,id:i,glyph:r};if(r=this._tinySDF(e,t,i),r)return e.glyphs[i]=r,{stack:t,id:i,glyph:r};const s=Math.floor(i/256);if(256*s>65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[s])return{stack:t,id:i,glyph:r};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[s]){const i=B.loadGlyphRange(t,s,this.url,this.requestManager);e.requests[s]=i}const o=yield e.requests[s];for(const t in o)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=o[+t]);return e.ranges[s]=true,{stack:t,id:i,glyph:o[i]||null}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(t))||e.u["CJK Unified Ideographs"](t)||e.u["Hangul Syllables"](t)||e.u.Hiragana(t)||e.u.Katakana(t)||e.u["CJK Symbols and Punctuation"](t)||e.u["Halfwidth and Fullwidth Forms"](t))}_tinySDF(t,i,r){const s=this.localIdeographFontFamily;if(!s)return;if(!this._doesCharSupportLocalGlyph(r))return;let o=t.tinySDF;if(!o){let e="400";/bold/i.test(i)?e="900":/medium/i.test(i)?e="500":/light/i.test(i)&&(e="200"),o=t.tinySDF=new B.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:s,fontWeight:e})}const n=o.draw(String.fromCharCode(r));return{id:r,bitmap:new e.q({width:n.width||60,height:n.height||60},n.data),metrics:{width:n.glyphWidth/2||24,height:n.glyphHeight/2||24,left:n.glyphLeft/2+.5||0,top:n.glyphTop/2-27.5||-8,advance:n.glyphAdvance/2||24,isDoubleResolution:true}}}}B.loadGlyphRange=function(t,i,r,s){return e._(this,void 0,void 0,(function*(){const o=256*i,n=o+255,a=s.transformRequest(r.replace("{fontstack}",t).replace("{range}",`${o}-${n}`),"Glyphs"),l=yield e.n(a,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${i}, ${o}-${n}`);const A={};for(const t of e.o(l.data))A[t.id]=t;return A}))},B.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:s="sans-serif",fontWeight:o="normal",fontStyle:n="normal"}={}){this.buffer=e,this.cutoff=r,this.radius=i;const a=this.size=t+4*e,l=this._createCanvas(a),A=this.ctx=l.getContext("2d",{willReadFrequently:true});A.font=`${n} ${o} ${t}px ${s}`,A.textBaseline="alphabetic",A.textAlign="left",A.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:s,actualBoundingBoxRight:o}=this.ctx.measureText(t),n=Math.ceil(i),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-s))),l=Math.min(this.size-this.buffer,n+Math.ceil(r)),A=a+2*this.buffer,h=l+2*this.buffer,c=Math.max(A*h,0),u=new Uint8ClampedArray(c),f={data:u,width:A,height:h,glyphWidth:a,glyphHeight:l,glyphTop:n,glyphLeft:0,glyphAdvance:e};if(0===a||0===l)return f;const{ctx:d,buffer:g,gridInner:p,gridOuter:m}=this;d.clearRect(g,g,a,l),d.fillText(t,g,g+n);const w=d.getImageData(g,g,a,l);m.fill(v,0,c),p.fill(0,0,c);for(let t=0;t<l;t++)for(let e=0;e<a;e++){const i=w.data[4*(t*a+e)+3]/255;if(0===i)continue;const r=(t+g)*A+e+g;if(1===i)m[r]=0,p[r]=v;else{const t=.5-i;m[r]=t>0?t*t:0,p[r]=t<0?t*t:0}}b(m,0,0,A,h,A,this.f,this.v,this.z),b(p,g,g,a,l,A,this.f,this.v,this.z);for(let t=0;t<c;t++){const e=Math.sqrt(m[t])-Math.sqrt(p[t]);u[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return f}};class C{constructor(){this.specification=e.v.light.position}possiblyEvaluate(t,i){return e.B(t.expression.evaluate(i))}interpolate(t,i,r){return{x:e.C.number(t.x,i.x,r),y:e.C.number(t.y,i.y,r),z:e.C.number(t.z,i.z,r)}}}let E;class _ extends e.E{constructor(t){super(),E=E||new e.r({anchor:new e.D(e.v.light.anchor),position:new C,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.t(E),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,i={}){if(!this._validate(e.x,t,i))for(const e in t){const i=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),i):this._transitionable.setValue(e,i)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r){return(!r||false!==r.validate)&&e.y(this,t.call(e.z,{value:i,style:{glyphs:true,sprite:true},styleSpec:e.v}))}}const Q=new e.r({"sky-color":new e.D(e.v.sky["sky-color"]),"horizon-color":new e.D(e.v.sky["horizon-color"]),"fog-color":new e.D(e.v.sky["fog-color"]),"fog-ground-blend":new e.D(e.v.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.v.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.v.sky["atmosphere-blend"])});class x extends e.E{constructor(t){super(),this._transitionable=new e.t(Q),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.F(0))}setSky(t,i={}){if(!this._validate(e.G,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const e in t){const i=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),i):this._transitionable.setValue(e,i)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r={}){return false!==(null==r?void 0:r.validate)&&e.y(this,t.call(e.z,e.e({value:i,style:{glyphs:true,sprite:true},styleSpec:e.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class M{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){const i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const r=[];let s=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,n=true;r.push({left:s,right:o,isDash:n,zeroLength:0===t[0]});let a=t[0];for(let e=1;e<t.length;e++){n=!n;const l=t[e];s=a*i,a+=l,o=a*i,r.push({left:s,right:o,isDash:n,zeroLength:0===l})}return r}addRoundDash(t,e,i){const r=e/2;for(let e=-i;e<=i;e++){const s=this.width*(this.nextRow+i+e);let o=0,n=t[o];for(let a=0;a<this.width;a++){a/n.right>1&&(n=t[++o]);const l=Math.abs(a-n.left),A=Math.abs(a-n.right),h=Math.min(l,A);let c;const u=e/i*(r+1);if(n.isDash){const t=r-Math.abs(u);c=Math.sqrt(h*h+t*t)}else c=r-Math.sqrt(h*h+u*u);this.data[s+a]=Math.max(0,Math.min(255,c+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){const i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1))}const e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);const r=this.width*this.nextRow;let s=0,o=t[s];for(let e=0;e<this.width;e++){e/o.right>1&&(o=t[++s]);const i=Math.abs(e-o.left),n=Math.abs(e-o.right),a=Math.min(i,n);this.data[r+e]=Math.max(0,Math.min(255,(o.isDash?a:-a)+128))}}addDash(t,i){const r=i?7:0,s=2*r+1;if(this.nextRow+s>this.height)return e.w("LineAtlas out of space"),null;let o=0;for(let e=0;e<t.length;e++)o+=t[e];if(0!==o){const e=this.width/o,s=this.getDashRanges(t,this.width,e);i?this.addRoundDash(s,e,r):this.addRegularDash(s)}const n={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=s,this.dirty=true,n}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=false,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}const k="maplibre_preloaded_worker_pool";class D{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<D.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[t]=true,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[k]}numActive(){return Object.keys(this.active).length}}const S=Math.floor(n.hardwareConcurrency/2);let G,F;function R(){return G||(G=new D),G}D.workerCount=e.H(globalThis)?Math.max(Math.min(S,3),1):1;class L{constructor(t,i){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i;const r=this.workerPool.acquire(i);for(let t=0;t<r.length;t++){const s=new e.J(r[t],i);s.name=`Worker ${t}`,this.actors.push(s)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){const i=[];for(const r of this.actors)i.push(r.sendAsync({type:t,data:e}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=true){this.actors.forEach((t=>{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const i of this.actors)i.registerMessageHandler(t,e)}}function z(){return F||(F=new L(R(),e.K),F.registerMessageHandler("GR",((t,i,r)=>e.m(i,r)))),F}function U(t,i){const r=e.L();return e.M(r,r,[1,1,0]),e.N(r,r,[.5*t.width,.5*t.height,1]),t.calculatePosMatrix?e.O(r,r,t.calculatePosMatrix(i.toUnwrapped())):r}function P(t,e,i,r,s,o,n){var a;const l=function(t,e,i){if(t)for(const r of t){const t=e[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return true}else for(const t in e){const r=e[t];if(r.source===i&&"fill-extrusion"===r.type)return true}return false}(null!==(a=null==s?void 0:s.layers)&&void 0!==a?a:null,e,t.id),A=o.maxPitchScaleFactor(),h=t.tilesIn(r,A,l);h.sort(N);const c=[];for(const r of h)c.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(e,i,t._state,r.queryGeometry,r.cameraQueryGeometry,r.scale,s,o,A,U(t.transform,r.tileID),n?(t,e)=>n(r.tileID,t,e):void 0)});return function(t,e){for(const i in t)for(const r of t[i])T(r,e);return t}(function(t){const e={},i={};for(const r of t){const t=r.queryResults,s=r.wrappedTileID,o=i[s]=i[s]||{};for(const i in t){const r=t[i],s=o[i]=o[i]||{},n=e[i]=e[i]||[];for(const t of r)s[t.featureIndex]||(s[t.featureIndex]=true,n.push(t))}}return e}(c),t)}function N(t,e){const i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function T(t,e){const i=t.feature,r=e.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}function q(t,i,r){return e._(this,void 0,void 0,(function*(){let s=t;if(t.url?s=(yield e.j(i.transformRequest(t.url,"Source"),r)).data:yield n.frameAsync(r),!s)return null;const o=e.Q(e.e(s,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in s&&s.vector_layers&&(o.vectorLayerIds=s.vector_layers.map((t=>t.id))),o}))}class O{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof e.S?new e.S(t.lng,t.lat):e.S.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.S?new e.S(t.lng,t.lat):e.S.convert(t),this}extend(t){const i=this._sw,r=this._ne;let s,o;if(t instanceof e.S)s=t,o=t;else{if(!(t instanceof O))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(O.convert(t)):this.extend(e.S.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.S.convert(t)):this;if(s=t._sw,o=t._ne,!s||!o)return this}return i||r?(i.lng=Math.min(s.lng,i.lng),i.lat=Math.min(s.lat,i.lat),r.lng=Math.max(o.lng,r.lng),r.lat=Math.max(o.lat,r.lat)):(this._sw=new e.S(s.lng,s.lat),this._ne=new e.S(o.lng,o.lat)),this}getCenter(){return new e.S((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 e.S(this.getWest(),this.getNorth())}getSouthEast(){return new e.S(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:i,lat:r}=e.S.convert(t);let s=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(s=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&s}static convert(t){return t instanceof O?t:t?new O(t):t}static fromLngLat(t,i=0){const r=360*i/40075017,s=r/Math.cos(Math.PI/180*t.lat);return new O(new e.S(t.lng-s,t.lat-r),new e.S(t.lng+s,t.lat+r))}adjustAntiMeridian(){const t=new e.S(this._sw.lng,this._sw.lat),i=new e.S(this._ne.lng,this._ne.lat);return new O(t,t.lng>i.lng?new e.S(i.lng+360,i.lat):i)}}class j{constructor(t,e,i){this.bounds=O.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const i=Math.pow(2,t.z),r=Math.floor(e.V(this.bounds.getWest())*i),s=Math.floor(e.U(this.bounds.getNorth())*i),o=Math.ceil(e.V(this.bounds.getEast())*i),n=Math.ceil(e.U(this.bounds.getSouth())*i);return t.x>=r&&t.x<o&&t.y>=s&&t.y<n}}class J extends e.E{constructor(t,i,r,s){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=true,this.isTileClipped=true,this._loaded=false,e.e(this,e.Q(i,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(s)}load(){return e._(this,void 0,void 0,(function*(){this._loaded=false,this.fire(new e.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield q(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=true,this.map.style.sourceCaches[this.id].clearTiles(),t&&(e.e(this,t),t.bounds&&(this.tileBounds=new j(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.l("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.k(t))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,globalState:this.map.getGlobalState()};i.request.collectResourceTiming=this._collectResourceTiming;let r="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,i)=>{t.reloadPromise={resolve:e,reject:i}}))}else t.actor=this.dispatcher.getActor(),r="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}}))}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return false}}class H extends e.E{constructor(t,i,r,s){super(),this.id=t,this.dispatcher=r,this.setEventedParent(s),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=true,this.scheme="xyz",this.tileSize=512,this._loaded=false,this._options=e.e({type:"raster"},i),e.e(this,e.Q(i,["url","scheme","tileSize"]))}load(){return e._(this,arguments,void 0,(function*(t=false){this._loaded=false,this.fire(new e.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield q(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=true,i&&(e.e(this,i),i.bounds&&(this.tileBounds=new j(i.bounds,this.minzoom,this.maxzoom)),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(t){this._tileJSONRequest=null,this.fire(new e.k(t))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(true)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const r=yield d.getImage(this.map._requestManager.transformRequest(i,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=this.map.painter.context,s=i.gl,o=r.data;t.texture=this.map.painter.getTileTexture(o.width),t.texture?t.texture.update(o,{useMipmap:true}):(t.texture=new e.T(i,o,s.RGBA,{useMipmap:true}),t.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return false}}class Y extends H{constructor(t,i,r,s){super(t,i,r,s),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox",this.redFactor=i.redFactor,this.greenFactor=i.greenFactor,this.blueFactor=i.blueFactor,this.baseShift=i.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=this.map._requestManager.transformRequest(i,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const i=yield d.getImage(r,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){const r=i.data;this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const s=e.b(r)&&e.W()?r:yield this.readImageNow(r),o={type:this.type,uid:t.uid,source:this.id,rawImageData:s,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:o});t.dem=e,t.needsHillshadePrepare=true,t.needsTerrainPrepare=true,t.state="loaded"}}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.X()){const i=t.width+2,r=t.height+2;try{return new e.R({width:i,height:r},yield e.Y(t,-1,-1,i,r))}catch(t){}}return n.getImageData(t,1)}))}_getNeighboringTiles(t){const i=t.canonical,r=Math.pow(2,i.z),s=(i.x-1+r)%r,o=0===i.x?t.wrap-1:t.wrap,n=(i.x+1+r)%r,a=i.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.Z(t.overscaledZ,o,i.z,s,i.y).key]={backfilled:false},l[new e.Z(t.overscaledZ,a,i.z,n,i.y).key]={backfilled:false},i.y>0&&(l[new e.Z(t.overscaledZ,o,i.z,s,i.y-1).key]={backfilled:false},l[new e.Z(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:false},l[new e.Z(t.overscaledZ,a,i.z,n,i.y-1).key]={backfilled:false}),i.y+1<r&&(l[new e.Z(t.overscaledZ,o,i.z,s,i.y+1).key]={backfilled:false},l[new e.Z(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:false},l[new e.Z(t.overscaledZ,a,i.z,n,i.y+1).key]={backfilled:false}),l}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}class $ extends e.E{constructor(t,i,r,s){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=true,this.reparseOverscaled=true,this._removed=false,this._pendingLoads=0,this.actor=r.getActor(),this.setEventedParent(s),this._data=i.data,this._options=e.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId,void 0!==i.clusterMaxZoom&&this.maxzoom<=i.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${i.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:i.cluster||false,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0!==i.buffer?i.buffer:128),tolerance:this._pixelsToTileUnits(void 0!==i.tolerance?i.tolerance:.375),extent:e.$,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||false,generateId:i.generateId||false},superclusterOptions:{maxZoom:this._getClusterMaxZoom(i.clusterMaxZoom),minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.$,radius:this._pixelsToTileUnits(i.clusterRadius||50),log:false,generateId:i.generateId||false},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(t){return t*(e.$/this.tileSize)}_getClusterMaxZoom(t){const i=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||void 0===t||e.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${i}"`),i}load(){return e._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}getData(){return e._(this,void 0,void 0,(function*(){const t=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})}))}getCoordinatesFromGeometry(t){return"GeometryCollection"===t.type?t.geometries.map((t=>t.coordinates)).flat(1/0):t.coordinates.flat(1/0)}getBounds(){return e._(this,void 0,void 0,(function*(){const t=new O,e=yield this.getData();let i;switch(e.type){case"FeatureCollection":i=e.features.map((t=>this.getCoordinatesFromGeometry(t.geometry))).flat(1/0);break;case"Feature":i=this.getCoordinatesFromGeometry(e.geometry);break;default:i=this.getCoordinatesFromGeometry(e)}if(0==i.length)return t;for(let e=0;e<i.length-1;e+=2)t.extend([i[e],i[e+1]]);return t}))}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom))),this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:i}})}_updateWorkerData(t){return e._(this,void 0,void 0,(function*(){const i=e.e({type:this.type},this.workerOptions);t?i.dataDiff=t:"string"==typeof this._data?(i.request=this.map._requestManager.transformRequest(n.resolveURL(this._data),"Source"),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.l("dataloading",{dataType:"source"}));try{const t=yield this.actor.sendAsync({type:"LD",data:i});if(this._pendingLoads--,this._removed||t.abandoned)return void this.fire(new e.l("dataabort",{dataType:"source"}));let r=null;t.resourceTiming&&t.resourceTiming[this.id]&&(r=t.resourceTiming[this.id].slice(0));const s={dataType:"source"};this._collectResourceTiming&&r&&r.length>0&&e.e(s,{resourceTiming:r}),this.fire(new e.l("data",Object.assign(Object.assign({},s),{sourceDataType:"metadata"}))),this.fire(new e.l("data",Object.assign(Object.assign({},s),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.l("dataabort",{dataType:"source"}));this.fire(new e.k(t))}}))}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,globalState:this.map.getGlobalState()};t.abortController=new AbortController;const r=yield this.actor.sendAsync({type:e,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=true}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=true,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return false}}class V extends e.E{constructor(t,e,i,r){super(),this.flippedWindingOrder=false,this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=false,this.setEventedParent(r),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=false,this.fire(new e.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield d.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=true,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=true,this.fire(new e.k(t))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const i=t.map(e.a0.fromLngLat);var r;return this.tileID=function(t){const i=e.a1.fromPoints(t),r=i.width(),s=i.height(),o=Math.max(r,s),n=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),a=Math.pow(2,n);return new e.a3(n,Math.floor((i.minX+i.maxX)/2*a),Math.floor((i.minY+i.maxY)/2*a))}(i),this.terrainTileRanges=this._getOverlappingTileRanges(i),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=i.map((t=>this.tileID.getTilePoint(t)._round())),this.flippedWindingOrder=((r=this.tileCoords)[1].x-r[0].x)*(r[2].y-r[0].y)-(r[1].y-r[0].y)*(r[2].x-r[0].x)<0,this.fire(new e.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,i=t.gl;this.texture||(this.texture=new e.T(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=false;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,r=true)}r&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return false}_getOverlappingTileRanges(t){const{minX:i,minY:r,maxX:s,maxY:o}=e.a1.fromPoints(t),n={};for(let t=0;t<=e.a2;t++){const e=Math.pow(2,t),a=Math.floor(i*e),l=Math.floor(r*e),A=Math.floor(s*e),h=Math.floor(o*e);n[t]={minTileX:a,minTileY:l,maxTileX:A,maxTileY:h}}return n}}class K extends V{constructor(t,e,i,r){super(t,e,i,r),this.roundZoom=true,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=false;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.a4(this.urls);if(this._loaded=true,!t)return;this.video=t,this.video.loop=true,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.k(t))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.k(new e.a5(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=false;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,r=true)}r&&this.fire(new e.l("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 Z extends V{constructor(t,i,r,s){super(t,i,r,s),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.k(new e.a5(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.k(new e.a5(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.k(new e.a5(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.k(new e.a5(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.k(new e.a5(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){return e._(this,void 0,void 0,(function*(){this._loaded=true,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 e.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=true,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=false)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=false;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=true),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=true),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,r=i.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:true}):this.texture=new e.T(i,this.canvas,r.RGBA,{premultiply:true});let s=false;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,s=true)}s&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return true;return false}}const W={},X=t=>{switch(t){case"geojson":return $;case"image":return V;case"raster":return H;case"raster-dem":return Y;case"vector":return J;case"video":return K;case"canvas":return Z}return W[t]},tt="RTLPluginLoaded";class et extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=z()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function*(t,e=false){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=n.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.l(tt))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let it=null;function rt(){return it||(it=new et),it}class st{constructor(t,i){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a6(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=false,this.hasRTLText=false,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const e=t+this.timeAdded;e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,i,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const r of t){const t=r.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){r.layers=t,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=r}}return i}(t.buckets,null==i?void 0:i.style),this.hasSymbolBuckets=false;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.a8){if(this.hasSymbolBuckets=true,!r)break;i.justReloaded=true}}if(this.hasRTLText=false,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.a8&&i.hasRTLText){this.hasRTLText=true,rt().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a7}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new e.T(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=true),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,r,s,o,n,a,l,A,h){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:s,scale:o,tileSize:this.tileSize,pixelPosMatrix:A,transform:a,params:n,queryPadding:this.queryPadding*l,getElevation:h},t,e,i):{}}querySourceFeatures(t,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const s=r.loadVTLayers(),o=i&&i.sourceLayer?i.sourceLayer:"",n=s._geojsonTileLayer||s[o];if(!n)return;const a=e.a9(i&&i.filter),{z:l,x:A,y:h}=this.tileID.canonical,c={z:l,x:A,y:h};for(let i=0;i<n.length;i++){const s=n.feature(i);if(a.needGeometry){const t=e.aa(s,true);if(!a.filter(new e.F(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!a.filter(new e.F(this.tileID.overscaledZ),s))continue;const u=r.getId(s,o),f=new e.ab(s,l,A,h,u);f.tile=c,t.push(f)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.ac(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let e=false;if(this.expirationTime>t)e=false;else if(i)if(this.expirationTime<i)e=true;else{const r=this.expirationTime-i;r?this.expirationTime=t+Math.max(r,3e4):e=true}else e=true;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const i=this.latestFeatureIndex.loadVTLayers();for(const r in this.buckets){if(!e.style.hasLayer(r))continue;const s=this.buckets[r],o=s.layers[0].sourceLayer||"_geojsonTileLayer",n=i[o],a=t[o];if(!n||!a||0===Object.keys(a).length)continue;s.update(a,n,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=e&&e.style&&e.style.getLayer(r);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(s)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<n.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=n.now()+t}setDependencies(t,e){const i={};for(const t of e)i[t]=true;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return true}return false}}class ot{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const s={value:e,timeout:void 0};if(void 0!==i&&(s.timeout=setTimeout((()=>{this.remove(t,s)}),i)),this.data[r].push(s),this.order.push(r),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),s=this.data[i][r];return this.data[i].splice(r,1),s.timeout&&clearTimeout(s.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(s.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const r of this.data[i])t(r.value)||e.push(r);for(const t of e)this.remove(t.value.tileID,t)}}class nt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,i,r){const s=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][s]=this.stateChanges[t][s]||{},e.e(this.stateChanges[t][s],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==s&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][s]){this.deletedStates[t][s]={};for(const e in this.state[t][s])r[e]||(this.deletedStates[t][s][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][s]&&null===this.deletedStates[t][s][e]&&delete this.deletedStates[t][s][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,i){const r=String(i),s=e.e({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][i];if(null===e)return{};for(const t in e)delete s[t]}return s}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,i){const r={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const i={};for(const r in this.stateChanges[t])this.state[t][r]||(this.state[t][r]={}),e.e(this.state[t][r],this.stateChanges[t][r]),i[r]=this.state[t][r];r[t]=i}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const i={};if(null===this.deletedStates[t])for(const e in this.state[t])i[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(const i of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][i];i[e]=this.state[t][e]}r[t]=r[t]||{},e.e(r[t],i)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const e in t)t[e].setFeatureState(r,i)}}const at=89.25;function lt(t,i){const r=e.ag(i.lat,-85.051129,e.ah);return new e.P(e.V(i.lng)*t,e.U(r)*t)}function At(t,i){return new e.a0(i.x/t,i.y/t).toLngLat()}function ht(t){return t.cameraToCenterDistance*Math.min(.85*Math.tan(e.ad(90-t.pitch)),Math.tan(e.ad(at-t.pitch)))}function ct(t,i){const r=t.canonical,s=i/e.ae(r.z),o=r.x+Math.pow(2,r.z)*t.wrap,n=e.af(new Float64Array(16));return e.M(n,n,[o*s,r.y*s,0]),e.N(n,n,[s/e.$,s/e.$,1]),n}function ut(t,i,r,s,o){const n=e.a0.fromLngLat(t,i),a=o*e.ai(1,t.lat),l=a*Math.cos(e.ad(r)),A=Math.sqrt(a*a-l*l),h=A*Math.sin(e.ad(-s)),c=A*Math.cos(e.ad(-s));return new e.a0(n.x+h,n.y+c,n.z+l)}function ft(t,e,i){const r=e.intersectsFrustum(t);if(!i||0===r)return r;const s=e.intersectsPlane(i);return 0===s?0:2===r&&2===s?2:1}function dt(t,e,i){let r=0;const s=(i-e)/10;for(let o=0;o<10;o++)r+=s*Math.pow(Math.cos(e+(o+.5)/10*(i-e)),t);return r}function gt(t,i){return function(r,s,o,n,a){const l=2*((t-1)/e.aj(Math.cos(e.ad(at-a))/Math.cos(e.ad(at)))-1),A=Math.acos(o/n),h=2*dt(l-1,0,e.ad(a/2)),c=Math.min(e.ad(at),A+e.ad(a/2)),u=dt(l-1,Math.min(c,A-e.ad(a/2)),c),f=Math.atan(s/o),d=Math.hypot(s,o);let g=r;return g+=e.aj(n/d/Math.max(.5,Math.cos(e.ad(a/2)))),g+=l*e.aj(Math.cos(f))/2,g-=e.aj(Math.max(1,u/h/i))/2,g}}const pt=gt(9.314,3);function mt(t,i){const r=(i.roundZoom?Math.round:Math.floor)(t.zoom+e.aj(t.tileSize/i.tileSize));return Math.max(0,r)}function wt(t,i){const r=t.getCameraFrustum(),s=t.getClippingPlane(),o=t.screenPointToMercatorCoordinate(t.getCameraPoint()),n=e.a0.fromLngLat(t.center,t.elevation);o.z=n.z+Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.worldSize;const a=t.getCoveringTilesDetailsProvider(),l=a.allowVariableZoom(t,i),A=mt(t,i),h=i.minzoom||0,c=void 0!==i.maxzoom?i.maxzoom:t.maxZoom,u=Math.min(Math.max(0,A),c),f=Math.pow(2,u),d=[f*o.x,f*o.y,0],g=[f*n.x,f*n.y,0],p=Math.hypot(n.x-o.x,n.y-o.y),m=Math.abs(n.z-o.z),w=Math.hypot(p,m),I=t=>({zoom:0,x:0,y:0,wrap:t,fullyVisible:false}),v=[],b=[];if(t.renderWorldCopies&&a.allowWorldCopies())for(let t=1;t<=3;t++)v.push(I(-t)),v.push(I(t));for(v.push(I(0));v.length>0;){const f=v.pop(),p=f.x,I=f.y;let y=f.fullyVisible;const B={x:p,y:I,z:f.zoom},C=a.getTileBoundingVolume(B,f.wrap,t.elevation,i);if(!y){const t=ft(r,C,s);if(0===t)continue;y=2===t}const E=a.distanceToTile2d(o.x,o.y,B,C);let _=A;l&&(_=(i.calculateTileZoom||pt)(t.zoom+e.aj(t.tileSize/i.tileSize),E,m,w,t.fov)),_=(i.roundZoom?Math.round:Math.floor)(_),_=Math.max(0,_);const Q=Math.min(_,c);if(f.wrap=a.getWrap(n,B,f.wrap),f.zoom>=Q){if(f.zoom<h)continue;const t=u-f.zoom,r=d[0]-.5-(p<<t),s=d[1]-.5-(I<<t),o=i.reparseOverscaled?Math.max(f.zoom,_):f.zoom;b.push({tileID:new e.Z(f.zoom===c?o:f.zoom,f.wrap,f.zoom,p,I),distanceSq:e.ak([g[0]-.5-p,g[1]-.5-I]),tileDistanceToCamera:Math.sqrt(r*r+s*s)})}else for(let t=0;t<4;t++)v.push({zoom:f.zoom+1,x:(p<<1)+t%2,y:(I<<1)+(t>>1),wrap:f.wrap,fullyVisible:y})}return b.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}const It=e.a1.fromPoints([new e.P(0,0),new e.P(e.$,e.$)]);class vt extends e.E{constructor(t,e,i){super(),this.id=t,this.dispatcher=i,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=false})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,i,r)=>{const s=new(X(e.type))(t,e,i,r);if(s.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${s.id}`);return s})(t,e,i,this),this._tiles={},this._cache=new ot(0,(t=>this._unloadTile(t))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new nt,this._didEmitContent=false,this._updated=false}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return true;if(!this._sourceLoaded)return false;if(!this._source.loaded())return false;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return true;if(!this._updated)return false;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return false}return true}getSource(){return this._source}pause(){this._paused=true}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=false,this._shouldReloadOnResume=false,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,i,r){return e._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,i,r)}catch(i){t.state="errored",404!==i.status?this._source.fire(new e.k(i,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.l("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(bt).map((t=>t.key))}getRenderableIds(t){const i=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&i.push(this._tiles[e]);return t?i.sort(((t,i)=>{const r=t.tileID,s=i.tileID,o=new e.P(r.canonical.x,r.canonical.y)._rotate(-this.transform.bearingInRadians),n=new e.P(s.canonical.x,s.canonical.y)._rotate(-this.transform.bearingInRadians);return r.overscaledZ-s.overscaledZ||n.y-o.y||n.x-o.x})).map((t=>t.tileID.key)):i.map((t=>t.tileID)).sort(bt).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(t){if(this._paused)this._shouldReloadOnResume=true;else{this._cache.reset();for(const e in this._tiles)t?this._reloadTile(e,"expired"):"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(t,i){return e._(this,void 0,void 0,(function*(){const e=this._tiles[t];e&&("loading"!==e.state&&(e.state=i),yield this._loadTile(e,t,i))}))}_tileLoaded(t,i,r){t.timeAdded=n.now(),"expired"===r&&(t.refreshedUponExpiration=true),this._setTileReloadTimer(i,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.l("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const e=this.getRenderableIds();for(let r=0;r<e.length;r++){const s=e[r];if(t.neighboringTiles&&t.neighboringTiles[s]){const e=this.getTileByID(s);i(t,e),i(e,t)}}function i(t,e){t.needsHillshadePrepare=true,t.needsTerrainPrepare=true;let i=e.tileID.canonical.x-t.tileID.canonical.x;const r=e.tileID.canonical.y-t.tileID.canonical.y,s=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+s)?i+=s:1===Math.abs(i-s)&&(i-=s)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=true)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,r){for(const s in this._tiles){let o=this._tiles[s];if(r[s]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)continue;let n=o.tileID;for(;o&&o.tileID.overscaledZ>e+1;){const t=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[t.key],o&&o.hasData()&&(n=t)}let a=n;for(;a.overscaledZ>e;)if(a=a.scaledTo(a.overscaledZ-1),t[a.key]||t[a.canonical.key]){r[n.key]=n;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),r=this._getLoadedTile(e);if(r)return r}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const i=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,s=Math.floor(i*r*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,s):s;this._cache.setMaxSize(o)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),t[r.tileID.key]=r}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(t,e,i,r,s,o){const a={},l={},A=Object.keys(t),h=n.now();for(const i of A){const r=t[i],s=this._tiles[i];if(!s||0!==s.fadeEndTime&&s.fadeEndTime<=h)continue;const o=this.findLoadedParent(r,e),n=this.findLoadedSibling(r),A=o||n||null;A&&(this._addTile(A.tileID),a[A.tileID.key]=A.tileID),l[i]=r}this._retainLoadedChildren(l,r,i,t);for(const e in a)t[e]||(this._coveredTiles[e]=true,t[e]=a[e]);if(o){const e={},i={};for(const t of s)this._tiles[t.key].hasData()?e[t.key]=t:i[t.key]=t;for(const r in i){const s=i[r].children(this._source.maxzoom);this._tiles[s[0].key]&&this._tiles[s[1].key]&&this._tiles[s[2].key]&&this._tiles[s[3].key]&&(e[s[0].key]=t[s[0].key]=s[0],e[s[1].key]=t[s[1].key]=s[1],e[s[2].key]=t[s[2].key]=s[2],e[s[3].key]=t[s[3].key]=s[3],delete i[r])}for(const r in i){const s=i[r],o=this.findLoadedParent(s,this._source.minzoom),n=this.findLoadedSibling(s),a=o||n||null;if(a){e[a.tileID.key]=t[a.tileID.key]=a.tileID;for(const t in e)e[t].isChildOf(a.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=true)}}update(t,i){if(!this._sourceLoaded||this._paused)return;let r;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.Z(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(r=wt(t,{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:i,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(r=r.filter((t=>this._source.hasTile(t))))):r=[];const s=mt(t,this._source),o=Math.max(s-vt.maxOverzooming,this._source.minzoom),n=Math.max(s+vt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const t={};for(const e of r)if(e.canonical.z>this._source.minzoom){const i=e.scaledTo(e.canonical.z-1);t[i.key]=i;const r=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[r.key]=r}r=r.concat(Object.values(t))}const a=0===r.length&&!this._updated&&this._didEmitContent;this._updated=true,a&&this.fire(new e.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(r,s);yt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,o,n,s,r,i);for(const t in l)this._tiles[t].clearFadeHold();const A=e.al(this._tiles,l);for(const t of A){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var i;const r={},s={},o=Math.max(e-vt.maxOverzooming,this._source.minzoom),n=Math.max(e+vt.maxUnderzooming,this._source.minzoom),a={};for(const i of t){const t=this._addTile(i);r[i.key]=i,t.hasData()||e<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,e,n,r);for(const n of t){let t=this._tiles[n.key];if(t.hasData())continue;if(e+1>this._source.maxzoom){const t=n.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){r[t.key]=t;continue}}else{const t=n.children(this._source.maxzoom);if(r[t[0].key]&&r[t[1].key]&&r[t[2].key]&&r[t[3].key])continue}let a=t.wasRequested();for(let e=n.overscaledZ-1;e>=o;--e){const o=n.scaledTo(e);if(s[o.key])break;if(s[o.key]=true,t=this.getTile(o),!t&&a&&(t=this._addTile(o)),t){const e=t.hasData();if((e||!(null===(i=this.map)||void 0===i?void 0:i.cancelPendingTileRequestsWhileZooming)||a)&&(r[o.key]=o),a=t.wasRequested(),e)break}}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,r=this._tiles[t].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);const t=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;r=t}for(const t of e)this._loadedParentTiles[t]=i}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const e=this._tiles[t].tileID,i=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=i}}_addTile(t){let i=this._tiles[t.key];if(i)return i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const r=i;return i||(i=new st(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._tiles[t.key]=i,r||this._source.fire(new e.l("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}refreshTiles(t){for(const e in this._tiles)(this._isIdRenderable(e)||"errored"==this._tiles[e].state)&&t.some((t=>t.equals(this._tiles[e].tileID.canonical)))&&this._reloadTile(e,"expired")}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=true,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){const e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=true),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(t.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=true)}clearTiles(){this._shouldReloadOnResume=false,this._paused=false;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,i,r){const s=[],o=this.transform;if(!o)return s;const n=o.getCoveringTilesDetailsProvider().allowWorldCopies(),a=r?o.getCameraQueryGeometry(t):t,l=t=>o.screenPointToMercatorCoordinate(t,this.terrain),A=this.transformBbox(t,l,!n),h=this.transformBbox(a,l,!n),c=this.getIds(),u=e.a1.fromPoints(h);for(let t=0;t<c.length;t++){const r=this._tiles[c[t]];if(r.holdingForFade())continue;const a=n?[r.tileID]:[r.tileID.unwrapTo(-1),r.tileID.unwrapTo(0)],l=Math.pow(2,o.zoom-r.tileID.overscaledZ),f=i*r.queryPadding*e.$/r.tileSize/l;for(const t of a){const i=u.map((i=>t.getTilePoint(new e.a0(i.x,i.y))));if(i.expandBy(f),i.intersects(It)){const e=A.map((e=>t.getTilePoint(e))),i=h.map((e=>t.getTilePoint(e)));s.push({tile:r,tileID:n?t:t.unwrapTo(0),queryGeometry:e,cameraQueryGeometry:i,scale:l})}}}return s}transformBbox(t,i,r){let s=t.map(i);if(r){const r=e.a1.fromPoints(t);r.shrinkBy(.001*Math.min(r.width(),r.height()));const o=r.map(i);e.a1.fromPoints(s).covers(o)||(s=s.map((t=>t.x>.5?new e.a0(t.x-1,t.y,t.z):t)))}return s}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));return this.transform&&this.transform.populateCache(e),e}hasTransition(){if(this._source.hasTransition())return true;if(yt(this._source.type)){const t=n.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return true}return false}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const r=this._tiles[t];r&&r.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)))}}function bt(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function yt(t){return"raster"===t||"image"===t||"video"===t}vt.maxOverzooming=10,vt.maxUnderzooming=3;class Bt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ag(t,0,1);let i=1,r=this._distances[i];const s=t*this.paddedLength+this.padding;for(;r<s&&i<this._distances.length;)r=this._distances[++i];const o=i-1,n=this._distances[o],a=r-n,l=a>0?(s-n)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}function Ct(t,e){let i=true;return"always"===t||"never"!==t&&"never"!==e||(i=false),i}class Et{constructor(t,e,i){const r=this.boxCells=[],s=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)r.push([]),s.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,r,s){this._forEachCell(e,i,r,s,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(s)}insertCircle(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,e,i,r,s,o){this.boxCells[s].push(o)}_insertCircleCell(t,e,i,r,s,o){this.circleCells[s].push(o)}_query(t,e,i,r,s,o,n){if(i<0||t>this.width||r<0||e>this.height)return[];const a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(s)return[{key:null,x1:t,y1:e,x2:i,y2:r}];for(let t=0;t<this.boxKeys.length;t++)a.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],r=this.circles[3*t+2];a.push({key:this.circleKeys[t],x1:e-r,y1:i-r,x2:e+r,y2:i+r})}}else this._forEachCell(t,e,i,r,this._queryCell,a,{hitTest:s,overlapMode:o,seenUids:{box:{},circle:{}}},n);return a}query(t,e,i,r){return this._query(t,e,i,r,false,null)}hitTest(t,e,i,r,s,o){return this._query(t,e,i,r,true,s,o).length>0}hitTestCircle(t,e,i,r,s){const o=t-i,n=t+i,a=e-i,l=e+i;if(n<0||o>this.width||l<0||a>this.height)return false;const A=[];return this._forEachCell(o,a,n,l,this._queryCellCircle,A,{hitTest:true,overlapMode:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},s),A.length>0}_queryCell(t,e,i,r,s,o,n,a){const{seenUids:l,hitTest:A,overlapMode:h}=n,c=this.boxCells[s];if(null!==c){const s=this.bboxes;for(const n of c)if(!l.box[n]){l.box[n]=true;const c=4*n,u=this.boxKeys[n];if(t<=s[c+2]&&e<=s[c+3]&&i>=s[c+0]&&r>=s[c+1]&&(!a||a(u))&&(!A||!Ct(h,u.overlapMode))&&(o.push({key:u,x1:s[c],y1:s[c+1],x2:s[c+2],y2:s[c+3]}),A))return true}}const u=this.circleCells[s];if(null!==u){const s=this.circles;for(const n of u)if(!l.circle[n]){l.circle[n]=true;const c=3*n,u=this.circleKeys[n];if(this._circleAndRectCollide(s[c],s[c+1],s[c+2],t,e,i,r)&&(!a||a(u))&&(!A||!Ct(h,u.overlapMode))){const t=s[c],e=s[c+1],i=s[c+2];if(o.push({key:u,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),A)return true}}}return false}_queryCellCircle(t,e,i,r,s,o,n,a){const{circle:l,seenUids:A,overlapMode:h}=n,c=this.boxCells[s];if(null!==c){const t=this.bboxes;for(const e of c)if(!A.box[e]){A.box[e]=true;const i=4*e,r=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!a||a(r))&&!Ct(h,r.overlapMode))return o.push(true),true}}const u=this.circleCells[s];if(null!==u){const t=this.circles;for(const e of u)if(!A.circle[e]){A.circle[e]=true;const i=3*e,r=this.circleKeys[e];if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!a||a(r))&&!Ct(h,r.overlapMode))return o.push(true),true}}}_forEachCell(t,e,i,r,s,o,n,a){const l=this._convertToXCellCoord(t),A=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),c=this._convertToYCellCoord(r);for(let u=l;u<=h;u++)for(let l=A;l<=c;l++)if(s.call(this,t,e,i,r,this.xCellCount*l+u,o,n,a))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,r,s,o){const n=r-t,a=s-e,l=i+o;return l*l>n*n+a*a}_circleAndRectCollide(t,e,i,r,s,o,n){const a=(o-r)/2,l=Math.abs(t-(r+a));if(l>a+i)return false;const A=(n-s)/2,h=Math.abs(e-(s+A));if(h>A+i)return false;if(l<=a||h<=A)return true;const c=l-a,u=h-A;return c*c+u*u<=i*i}}function _t(t,i,s){const o=e.L();if(!t){const{vecSouth:t,vecEast:e}=xt(i),s=r();s[0]=e[0],s[1]=e[1],s[2]=t[0],s[3]=t[1],n=s,(u=(l=(a=s)[0])*(c=a[3])-(h=a[2])*(A=a[1]))&&(n[0]=c*(u=1/u),n[1]=-A*u,n[2]=-h*u,n[3]=l*u),o[0]=s[0],o[1]=s[1],o[4]=s[2],o[5]=s[3]}var n,a,l,A,h,c,u;return e.N(o,o,[1/s,1/s,1]),o}function Qt(t,i,r,s){if(t){const t=e.L();if(!i){const{vecSouth:e,vecEast:i}=xt(r);t[0]=i[0],t[1]=i[1],t[4]=e[0],t[5]=e[1]}return e.N(t,t,[s,s,1]),t}return r.pixelsToClipSpaceMatrix}function xt(t){const i=Math.cos(t.rollInRadians),r=Math.sin(t.rollInRadians),s=Math.cos(t.pitchInRadians),o=Math.cos(t.bearingInRadians),n=Math.sin(t.bearingInRadians),a=e.aq();a[0]=-o*s*r-n*i,a[1]=-n*s*r+o*i;const l=e.ar(a);l<1e-9?e.as(a):e.at(a,a,1/l);const A=e.aq();A[0]=o*s*i-n*r,A[1]=n*s*i+o*r;const h=e.ar(A);return h<1e-9?e.as(A):e.at(A,A,1/h),{vecEast:A,vecSouth:a}}function Mt(t,i,r,s){let o;s?(o=[t,i,s(t,i),1],e.av(o,o,r)):(o=[t,i,0,1],Ht(o,o,r));const n=o[3];return{point:new e.P(o[0]/n,o[1]/n),signedDistanceFromCamera:n,isOccluded:false}}function kt(t,e){return.5+t/e*.5}function Dt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function St(t,i,r,s,o,n,a,l,A,h,c,u,f){const d=r?t.textSizeData:t.iconSizeData,g=e.am(d,i.transform.zoom),p=[256/i.width*2+1,256/i.height*2+1],m=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;m.clear();const w=t.lineVertexArray,I=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=i.transform.width/i.transform.height;let b=false;for(let r=0;r<I.length;r++){const y=I.get(r);if(y.hidden||y.writingMode===e.an.vertical&&!b){Jt(y.numGlyphs,m);continue}b=false;const B=new e.P(y.anchorX,y.anchorY),C={getElevation:f,pitchedLabelPlaneMatrix:s,lineVertexArray:w,pitchWithMap:n,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:false},transform:i.transform,tileAnchorPoint:B,unwrappedTileID:A,width:h,height:c,translation:u},E=Nt(y.anchorX,y.anchorY,C);if(!Dt(E.point,p)){Jt(y.numGlyphs,m);continue}const _=kt(i.transform.cameraToCenterDistance,E.signedDistanceFromCamera),Q=e.ao(d,g,y),x=n?Q*i.transform.getPitchedTextCorrection(y.anchorX,y.anchorY,A)/_:Q*_,M=Rt({projectionContext:C,pitchedLabelPlaneMatrixInverse:o,symbol:y,fontSize:x,flip:false,keepUpright:a,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l});b=M.useVertical,(M.notEnoughRoom||b||M.needsFlipping&&Rt({projectionContext:C,pitchedLabelPlaneMatrixInverse:o,symbol:y,fontSize:x,flip:true,keepUpright:a,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l}).notEnoughRoom)&&Jt(y.numGlyphs,m)}r?t.text.dynamicLayoutVertexBuffer.updateData(m):t.icon.dynamicLayoutVertexBuffer.updateData(m)}function Gt(t,e,i,r,s,o,n,a){const l=o.glyphStartIndex+o.numGlyphs,A=o.lineStartIndex,h=o.lineStartIndex+o.lineLength,c=e.getoffsetX(o.glyphStartIndex),u=e.getoffsetX(l-1),f=Ot(t*c,i,r,s,o.segment,A,h,a,n);if(!f)return null;const d=Ot(t*u,i,r,s,o.segment,A,h,a,n);return d?a.projectionCache.anyProjectionOccluded?null:{first:f,last:d}:null}function Ft(t,i,r,s){return t===e.an.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*s?{useVertical:true}:(t===e.an.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:true}:null}function Rt(t){const{projectionContext:i,pitchedLabelPlaneMatrixInverse:r,symbol:s,fontSize:o,flip:n,keepUpright:a,glyphOffsetArray:l,dynamicLayoutVertexArray:A,aspectRatio:h,rotateToLine:c}=t,u=o/24,f=s.lineOffsetX*u,d=s.lineOffsetY*u;let g;if(s.numGlyphs>1){const t=s.glyphStartIndex+s.numGlyphs,e=s.lineStartIndex,o=s.lineStartIndex+s.lineLength,A=Gt(u,l,f,d,n,s,c,i);if(!A)return{notEnoughRoom:true};const p=Pt(A.first.point.x,A.first.point.y,i,r),m=Pt(A.last.point.x,A.last.point.y,i,r);if(a&&!n){const t=Ft(s.writingMode,p,m,h);if(t)return t}g=[A.first];for(let r=s.glyphStartIndex+1;r<t-1;r++){const t=Ot(u*l.getoffsetX(r),f,d,n,s.segment,e,o,i,c);if(!t)return{notEnoughRoom:true};g.push(t)}g.push(A.last)}else{if(a&&!n){const t=Ut(i.tileAnchorPoint.x,i.tileAnchorPoint.y,i).point,o=s.lineStartIndex+s.segment+1,n=new e.P(i.lineVertexArray.getx(o),i.lineVertexArray.gety(o)),a=Ut(n.x,n.y,i),l=a.signedDistanceFromCamera>0?a.point:Lt(i.tileAnchorPoint,n,t,1,i),A=Pt(t.x,t.y,i,r),c=Pt(l.x,l.y,i,r),u=Ft(s.writingMode,A,c,h);if(u)return u}const t=Ot(u*l.getoffsetX(s.glyphStartIndex),f,d,n,s.segment,s.lineStartIndex,s.lineStartIndex+s.lineLength,i,c);if(!t||i.projectionCache.anyProjectionOccluded)return{notEnoughRoom:true};g=[t]}for(const t of g)e.au(A,t.point,t.angle);return{}}function Lt(t,e,i,r,s){const o=t.add(t.sub(e)._unit()),n=Ut(o.x,o.y,s).point,a=i.sub(n);return i.add(a._mult(r/a.mag()))}function zt(t,i,r){const s=i.projectionCache;if(s.projections[t])return s.projections[t];const o=new e.P(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),n=Ut(o.x,o.y,i);if(n.signedDistanceFromCamera>0)return s.projections[t]=n.point,s.anyProjectionOccluded=s.anyProjectionOccluded||n.isOccluded,n.point;const a=t-r.direction;return Lt(0===r.distanceFromAnchor?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(a),i.lineVertexArray.gety(a)),o,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,i)}function Ut(t,e,i){const r=t+i.translation[0],s=e+i.translation[1];let o;return i.pitchWithMap?(o=Mt(r,s,i.pitchedLabelPlaneMatrix,i.getElevation),o.isOccluded=false):(o=i.transform.projectTileCoordinates(r,s,i.unwrappedTileID,i.getElevation),o.point.x=(.5*o.point.x+.5)*i.width,o.point.y=(.5*-o.point.y+.5)*i.height),o}function Pt(t,i,r,s){if(r.pitchWithMap){const o=[t,i,0,1];return e.av(o,o,s),r.transform.projectTileCoordinates(o[0]/o[3],o[1]/o[3],r.unwrappedTileID,r.getElevation).point}return{x:t/r.width*2-1,y:i/r.height*2-1}}function Nt(t,e,i){return i.transform.projectTileCoordinates(t,e,i.unwrappedTileID,i.getElevation)}function Tt(t,e,i){return t._unit()._perp()._mult(e*i)}function qt(t,i,r,s,o,n,a,l,A){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const h=r.add(i);if(t+A.direction<s||t+A.direction>=o)return l.projectionCache.offsets[t]=h,h;const c=zt(t+A.direction,l,A),u=Tt(c.sub(r),a,A.direction),f=r.add(u),d=c.add(u);return l.projectionCache.offsets[t]=e.aw(n,h,f,d)||h,l.projectionCache.offsets[t]}function Ot(t,e,i,r,s,o,n,a,l){const A=r?t-e:t+e;let h=A>0?1:-1,c=0;r&&(h*=-1,c=Math.PI),h<0&&(c+=Math.PI);let u,f=h>0?o+s:o+s+1;a.projectionCache.cachedAnchorPoint?u=a.projectionCache.cachedAnchorPoint:(u=Ut(a.tileAnchorPoint.x,a.tileAnchorPoint.y,a).point,a.projectionCache.cachedAnchorPoint=u);let d,g,p=u,m=u,w=0,I=0;const v=Math.abs(A),b=[];let y;for(;w+I<=v;){if(f+=h,f<o||f>=n)return null;w+=I,m=p,g=d;const t={absOffsetX:v,direction:h,distanceFromAnchor:w,previousVertex:m};if(p=zt(f,a,t),0===i)b.push(m),y=p.sub(m);else{let e;const r=p.sub(m);e=0===r.mag()?Tt(zt(f+h,a,t).sub(p),i,h):Tt(r,i,h),g||(g=m.add(e)),d=qt(f,e,p,o,n,g,i,a,t),b.push(g),y=d.sub(g)}I=y.mag()}const B=y._mult((v-w)/I)._add(g||m),C=c+Math.atan2(p.y-m.y,p.x-m.x);return b.push(B),{point:B,angle:l?C:0,path:b}}const jt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Jt(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(jt,3*t)}}function Ht(t,e,i){const r=e[0],s=e[1];return t[0]=i[0]*r+i[4]*s+i[12],t[1]=i[1]*r+i[5]*s+i[13],t[3]=i[3]*r+i[7]*s+i[15],t}const Yt=100;class $t{constructor(t,e=new Et(t.width+200,t.height+200,25),i=new Et(t.width+200,t.height+200,25)){this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Yt,this.screenBottomBoundary=t.height+Yt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,i,r,s,o,n,a,l,A,h,c){const u=this.projectAndGetPerspectiveRatio(t.anchorPointX+a[0],t.anchorPointY+a[1],s,A,c),f=i*u.perspectiveRatio;let d;if(o||n)d=this._projectCollisionBox(t,f,r,s,o,n,a,u,A,h,c);else{const e=u.x+(h?h.x*f:0),i=u.y+(h?h.y*f:0);d={allPointsOccluded:false,box:[e+t.x1*f,i+t.y1*f,e+t.x2*f,i+t.y2*f]}}const[g,p,m,w]=d.box,I=o?d.allPointsOccluded:u.isOccluded;let v=I;return v||(v=u.perspectiveRatio<this.perspectiveRatioCutoff),v||(v=!this.isInsideGrid(g,p,m,w)),v||"always"!==e&&this.grid.hitTest(g,p,m,w,e,l)?{box:[g,p,m,w],placeable:false,offscreen:false,occluded:I}:{box:[g,p,m,w],placeable:true,offscreen:this.isOffscreen(g,p,m,w),occluded:I}}placeCollisionCircles(t,i,r,s,o,n,a,l,A,h,c,u,f,d){const g=[],p=new e.P(i.anchorX,i.anchorY),m=this.getPerspectiveRatio(p.x,p.y,n,d),w=(A?o*this.transform.getPitchedTextCorrection(i.anchorX,i.anchorY,n)/m:o*m)/e.aA,I={getElevation:d,pitchedLabelPlaneMatrix:a,lineVertexArray:r,pitchWithMap:A,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:false},transform:this.transform,tileAnchorPoint:p,unwrappedTileID:n,width:this.transform.width,height:this.transform.height,translation:f},v=Gt(w,s,i.lineOffsetX*w,i.lineOffsetY*w,false,i,false,I);let b=false,y=false,B=true;if(v){const i=.5*c*m+u,r=new e.P(-100,-100),s=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new Bt,n=v.first,a=v.last;let f=[];for(let t=n.path.length-1;t>=1;t--)f.push(n.path[t]);for(let t=1;t<a.path.length;t++)f.push(a.path[t]);const d=2.5*i;if(A){const t=this.projectPathToScreenSpace(f,I);f=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let p=[];if(f.length>0){const t=f[0].clone(),i=f[0].clone();for(let e=1;e<f.length;e++)t.x=Math.min(t.x,f[e].x),t.y=Math.min(t.y,f[e].y),i.x=Math.max(i.x,f[e].x),i.y=Math.max(i.y,f[e].y);p=t.x>=r.x&&i.x<=s.x&&t.y>=r.y&&i.y<=s.y?[f]:i.x<r.x||t.x>s.x||i.y<r.y||t.y>s.y?[]:e.ax([f],r.x,r.y,s.x,s.y)}for(const e of p){o.reset(e,.25*i);let r=0;r=o.length<=.5*i?1:Math.ceil(o.paddedLength/d)+1;for(let e=0;e<r;e++){const s=e/Math.max(r-1,1),n=o.lerp(s),a=n.x+Yt,A=n.y+Yt;g.push(a,A,i,0);const c=a-i,u=A-i,f=a+i,d=A+i;if(B=B&&this.isOffscreen(c,u,f,d),y=y||this.isInsideGrid(c,u,f,d),"always"!==t&&this.grid.hitTestCircle(a,A,i,t,h)&&(b=true,!l))return{circles:[],offscreen:false,collisionDetected:b}}}}return{circles:!l&&b||!y||m<this.perspectiveRatioCutoff?[]:g,offscreen:B,collisionDetected:b}}projectPathToScreenSpace(t,i){const r=function(t,i){const r=e.L();return e.ap(r,i.pitchedLabelPlaneMatrix),t.map((t=>{const e=Mt(t.x,t.y,r,i.getElevation),s=i.transform.projectTileCoordinates(e.point.x,e.point.y,i.unwrappedTileID,i.getElevation);return s.point.x=(.5*s.point.x+.5)*i.width,s.point.y=(.5*-s.point.y+.5)*i.height,s}))}(t,i);return function(t){let e=0,i=0,r=0,s=0;for(let o=0;o<t.length;o++)t[o].isOccluded?(r=o+1,s=0):(s++,s>i&&(i=s,e=r));return t.slice(e,e+i)}(r)}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[],r=new e.a1;for(const s of t){const t=new e.P(s.x+Yt,s.y+Yt);r.extend(t),i.push(t)}const{minX:s,minY:o,maxX:n,maxY:a}=r,l=this.grid.query(s,o,n,a).concat(this.ignoredGrid.query(s,o,n,a)),A={},h={};for(const t of l){const r=t.key;if(void 0===A[r.bucketInstanceId]&&(A[r.bucketInstanceId]={}),A[r.bucketInstanceId][r.featureIndex])continue;const s=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.ay(i,s)&&(A[r.bucketInstanceId][r.featureIndex]=true,void 0===h[r.bucketInstanceId]&&(h[r.bucketInstanceId]=[]),h[r.bucketInstanceId].push(r.featureIndex))}return h}insertCollisionBox(t,e,i,r,s,o){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:s,collisionGroupID:o,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,r,s,o){const n=i?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:s,collisionGroupID:o,overlapMode:e};for(let e=0;e<t.length;e+=4)n.insertCircle(a,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(t,i,r,s,o){if(o){let r;s?(r=[t,i,s(t,i),1],e.av(r,r,o)):(r=[t,i,0,1],Ht(r,r,o));const n=r[3];return{x:(r[0]/n+1)/2*this.transform.width+Yt,y:(-r[1]/n+1)/2*this.transform.height+Yt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/n*.5,isOccluded:false,signedDistanceFromCamera:n}}{const e=this.transform.projectTileCoordinates(t,i,r,s);return{x:(e.point.x+1)/2*this.transform.width+Yt,y:(1-e.point.y)/2*this.transform.height+Yt,perspectiveRatio:.5+this.transform.cameraToCenterDistance/e.signedDistanceFromCamera*.5,isOccluded:e.isOccluded,signedDistanceFromCamera:e.signedDistanceFromCamera}}}getPerspectiveRatio(t,e,i,r){const s=this.transform.projectTileCoordinates(t,e,i,r);return.5+this.transform.cameraToCenterDistance/s.signedDistanceFromCamera*.5}isOffscreen(t,e,i,r){return i<Yt||t>=this.screenRightBoundary||r<Yt||e>this.screenBottomBoundary}isInsideGrid(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=e.af([]);return e.M(t,t,[-100,-100,0]),t}_projectCollisionBox(t,i,r,s,o,n,a,l,A,h,c){let u=1,f=0,d=0,g=1;const p=t.anchorPointX+a[0],m=t.anchorPointY+a[1];if(n&&!o){const t=this.projectAndGetPerspectiveRatio(p+1,m,s,A,c),e=t.x-l.x,i=Math.atan((t.y-l.y)/e)+(e<0?Math.PI:0),r=Math.sin(i),o=Math.cos(i);u=o,f=r,d=-r,g=o}else if(!n&&o){const t=xt(this.transform);u=t.vecEast[0],f=t.vecEast[1],d=t.vecSouth[0],g=t.vecSouth[1]}let w=l.x,I=l.y,v=i;o&&(w=p,I=m,v=Math.pow(2,-(this.transform.zoom-r.overscaledZ)),v*=this.transform.getPitchedTextCorrection(p,m,s),h||(v*=e.ag(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),h&&(w+=u*h.x*v+d*h.y*v,I+=f*h.x*v+g*h.y*v);const b=t.x1*v,y=t.x2*v,B=(b+y)/2,C=t.y1*v,E=t.y2*v,_=(C+E)/2,Q=[{offsetX:b,offsetY:C},{offsetX:B,offsetY:C},{offsetX:y,offsetY:C},{offsetX:y,offsetY:_},{offsetX:y,offsetY:E},{offsetX:B,offsetY:E},{offsetX:b,offsetY:E},{offsetX:b,offsetY:_}];let x=[];for(const{offsetX:t,offsetY:i}of Q)x.push(new e.P(w+u*t+d*i,I+f*t+g*i));let M=false;if(o){const t=x.map((t=>this.projectAndGetPerspectiveRatio(t.x,t.y,s,A,c)));M=t.some((t=>!t.isOccluded)),x=t.map((t=>new e.P(t.x,t.y)))}else M=true;return{box:e.az(x),allPointsOccluded:!M}}}class Vt{constructor(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class Kt{constructor(t,e,i,r,s){this.text=new Vt(t?t.text:null,e,i,s),this.icon=new Vt(t?t.icon:null,e,r,s)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Zt{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}}class Wt{constructor(t,e,i,r,s){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=s}}class Xt{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function te(t,i,r,s,o){const{horizontalAlign:n,verticalAlign:a}=e.aG(t);return new e.P(-(n-.5)*i+s[0]*o,-(a-.5)*r+s[1]*o)}class ee{constructor(t,e,i,r,s){this.transform=t.clone(),this.terrain=e,this.collisionIndex=new $t(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=false,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new Xt(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(i,r)=>e.getElevation(t,i,r):null}getBucketParts(t,i,r,s){const o=r.getBucket(i),n=r.latestFeatureIndex;if(!o||!n||i.id!==o.layerIds[0])return;const a=r.collisionBoxArray,l=o.layers[0].layout,A=o.layers[0].paint,h=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/e.$,u=r.tileID.toUnwrapped(),f="map"===l.get("text-rotation-alignment"),d=e.aB(r,1,this.transform.zoom),g=e.aC(this.collisionIndex.transform,r,A.get("text-translate"),A.get("text-translate-anchor")),p=e.aC(this.collisionIndex.transform,r,A.get("icon-translate"),A.get("icon-translate-anchor")),m=_t(f,this.transform,d);this.retainedQueryData[o.bucketInstanceId]=new Wt(o.bucketInstanceId,n,o.sourceLayerIndex,o.index,r.tileID);const w={bucket:o,layout:l,translationText:g,translationIcon:p,unwrappedTileID:u,pitchedLabelPlaneMatrix:m,scale:h,textPixelRatio:c,holdingForFade:r.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:e.am(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(s)for(const e of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:s}=e;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:s,parameters:w})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:w})}attemptAnchorPlacement(t,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v){const b=e.aD[t.textAnchor],y=[t.textOffset0,t.textOffset1],B=te(b,r,s,y,o),C=this.collisionIndex.placeCollisionBox(i,u,l,A,h,a,n,p,c.predicate,I,B,v);if((!w||this.collisionIndex.placeCollisionBox(w,u,l,A,h,a,n,m,c.predicate,I,B,v).placeable)&&C.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(t=this.prevPlacement.variableOffsets[f.crossTileID].anchor),0===f.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[f.crossTileID]={textOffset:y,width:r,height:s,anchor:b,textBoxScale:o,prevAnchor:t},this.markUsedJustification(d,b,f,g),d.allowVerticalPlacement&&(this.markUsedOrientation(d,g,f),this.placedOrientations[f.crossTileID]=g),{shift:B,placedGlyphBoxes:C}}}placeLayerBucketPart(t,i,r){const{bucket:s,layout:o,translationText:n,translationIcon:a,unwrappedTileID:l,pitchedLabelPlaneMatrix:A,textPixelRatio:h,holdingForFade:c,collisionBoxArray:u,partiallyEvaluatedTextSize:f,collisionGroup:d}=t.parameters,g=o.get("text-optional"),p=o.get("icon-optional"),m=e.aE(o,"text-overlap","text-allow-overlap"),w="always"===m,I=e.aE(o,"icon-overlap","icon-allow-overlap"),v="always"===I,b="map"===o.get("text-rotation-alignment"),y="map"===o.get("text-pitch-alignment"),B="none"!==o.get("icon-text-fit"),C="viewport-y"===o.get("symbol-z-order"),E=w&&(v||!s.hasIconData()||p),_=v&&(w||!s.hasTextData()||g);!s.collisionArrays&&u&&s.deserializeCollisionBoxes(u);const Q=this.retainedQueryData[s.bucketInstanceId].tileID,x=this._getTerrainElevationFunc(Q),M=this.transform.getFastPathSimpleProjectionMatrix(Q),k=(t,u,v)=>{var C,k;if(i[t.crossTileID])return;if(c)return void(this.placements[t.crossTileID]=new Zt(false,false,false));let D=false,S=false,G=true,F=null,R={box:null,placeable:false,offscreen:null,occluded:false},L={placeable:false},z=null,U=null,P=null,N=0,T=0,q=0;u.textFeatureIndex?N=u.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),u.verticalTextFeatureIndex&&(T=u.verticalTextFeatureIndex);const O=u.textBox;if(O){const i=i=>{let r=e.an.horizontal;if(s.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,r=e,this.markUsedOrientation(s,r,t))}return r},o=(i,r)=>{if(s.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&u.verticalTextBox){for(const t of s.writingModes)if(t===e.an.vertical?(R=r(),L=R):R=i(),R&&R.placeable)break}else R=i()},A=t.textAnchorOffsetStartIndex,c=t.textAnchorOffsetEndIndex;if(c===A){const r=(e,i)=>{const r=this.collisionIndex.placeCollisionBox(e,m,h,Q,l,y,b,n,d.predicate,x,void 0,M);return r&&r.placeable&&(this.markUsedOrientation(s,i,t),this.placedOrientations[t.crossTileID]=i),r};o((()=>r(O,e.an.horizontal)),(()=>{const i=u.verticalTextBox;return s.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?r(i,e.an.vertical):{box:null,offscreen:null}})),i(R&&R.placeable)}else{let f=e.aD[null===(k=null===(C=this.prevPlacement)||void 0===C?void 0:C.variableOffsets[t.crossTileID])||void 0===k?void 0:k.anchor];const g=(e,i,o)=>{const u=e.x2-e.x1,g=e.y2-e.y1,p=t.textBoxScale,w=B&&"never"===I?i:null;let v=null,C="never"===m?1:2,E="never";f&&C++;for(let i=0;i<C;i++){for(let i=A;i<c;i++){const r=s.textAnchorOffsets.get(i);if(f&&r.textAnchor!==f)continue;const A=this.attemptAnchorPlacement(r,e,u,g,p,b,y,h,Q,l,d,E,t,s,o,n,a,w,x);if(A&&(v=A.placedGlyphBoxes,v&&v.placeable))return D=true,F=A.shift,v}f?f=null:E=m}return r&&!v&&(v={box:this.collisionIndex.placeCollisionBox(O,"always",h,Q,l,y,b,n,d.predicate,x,void 0,M).box,offscreen:false,placeable:false,occluded:false}),v};o((()=>g(O,u.iconBox,e.an.horizontal)),(()=>{const i=u.verticalTextBox;return s.allowVerticalPlacement&&(!R||!R.placeable)&&t.numVerticalGlyphVertices>0&&i?g(i,u.verticalIconBox,e.an.vertical):{box:null,occluded:true,offscreen:null}})),R&&(D=R.placeable,G=R.offscreen);const p=i(R&&R.placeable);if(!D&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(s,e.anchor,t,p))}}}if(z=R,D=z&&z.placeable,G=z&&z.offscreen,t.useRuntimeCollisionCircles){const i=s.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),a=e.ao(s.textSizeData,f,i),h=o.get("text-padding");U=this.collisionIndex.placeCollisionCircles(m,i,s.lineVertexArray,s.glyphOffsetArray,a,l,A,r,y,d.predicate,t.collisionCircleDiameter,h,n,x),U.circles.length&&U.collisionDetected&&!r&&e.w("Collisions detected, but collision boxes are not shown"),D=w||U.circles.length>0&&!U.collisionDetected,G=G&&U.offscreen}if(u.iconFeatureIndex&&(q=u.iconFeatureIndex),u.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,I,h,Q,l,y,b,a,d.predicate,x,B&&F?F:void 0,M);L&&L.placeable&&u.verticalIconBox?(P=t(u.verticalIconBox),S=P.placeable):(P=t(u.iconBox),S=P.placeable),G=G&&P.offscreen}const j=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,J=p||0===t.numIconVertices;j||J?J?j||(S=S&&D):D=S&&D:S=D=S&&D;const H=S&&P.placeable;if(D&&z.placeable&&this.collisionIndex.insertCollisionBox(z.box,m,o.get("text-ignore-placement"),s.bucketInstanceId,L&&L.placeable&&T?T:N,d.ID),H&&this.collisionIndex.insertCollisionBox(P.box,I,o.get("icon-ignore-placement"),s.bucketInstanceId,q,d.ID),U&&D&&this.collisionIndex.insertCollisionCircles(U.circles,m,o.get("text-ignore-placement"),s.bucketInstanceId,N,d.ID),r&&this.storeCollisionData(s.bucketInstanceId,v,u,z,P,U),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===s.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Zt((D||E)&&!(null==z?void 0:z.occluded),(S||_)&&!(null==P?void 0:P.occluded),G||s.justReloaded),i[t.crossTileID]=true};if(C){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=s.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let t=e.length-1;t>=0;--t){const i=e[t];k(s.symbolInstances.get(i),s.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)k(s.symbolInstances.get(e),s.collisionArrays[e],e);s.justReloaded=false}storeCollisionData(t,e,i,r,s,o){if(i.textBox||i.iconBox){let o,n;this.collisionBoxArrays.has(t)?o=this.collisionBoxArrays.get(t):(o=new Map,this.collisionBoxArrays.set(t,o)),o.has(e)?n=o.get(e):(n={text:null,icon:null},o.set(e,n)),i.textBox&&(n.text=r.box),i.iconBox&&(n.icon=s.box)}if(o){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=[]);for(let t=0;t<o.circles.length;t+=4)e.push(o.circles[t+0]-Yt),e.push(o.circles[t+1]-Yt),e.push(o.circles[t+2]),e.push(o.collisionDetected?1:0)}}markUsedJustification(t,i,r,s){let o;o=s===e.an.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[e.aF(i)];const n=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(const e of n)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=o>=0&&e!==o?0:r.crossTileID)}markUsedOrientation(t,i,r){const s=i===e.an.horizontal||i===e.an.horizontalOnly?i:0,o=i===e.an.vertical?i:0,n=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(const e of n)t.text.placedSymbolArray.get(e).placedOrientation=s;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=o)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=false;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const r=e?e.symbolFadeChange(t):1,s=e?e.opacities:{},o=e?e.variableOffsets:{},n=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],o=s[t];o?(this.opacities[t]=new Kt(o,r,e.text,e.icon),i=i||e.text!==o.text.placed||e.icon!==o.icon.placed):(this.opacities[t]=new Kt(null,r,e.text,e.icon,e.skipFade),i=i||e.text||e.icon)}for(const t in s){const e=s[t];if(!this.opacities[t]){const s=new Kt(e,r,false,false);s.isHidden()||(this.opacities[t]=s,i=i||e.text.placed||e.icon.placed)}}for(const t in o)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=o[t]);for(const t in n)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=n[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const r of e){const e=r.getBucket(t);e&&r.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,i,r,s){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=false),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=false),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const o=t.layers[0],n=o.layout,a=new Kt(null,0,false,false,true),l=n.get("text-allow-overlap"),A=n.get("icon-allow-overlap"),h=o._unevaluatedLayout.hasValue("text-variable-anchor")||o._unevaluatedLayout.hasValue("text-variable-anchor-offset"),c="map"===n.get("text-rotation-alignment"),u="map"===n.get("text-pitch-alignment"),f="none"!==n.get("icon-text-fit"),d=new Kt(null,0,l&&(A||!t.hasIconData()||n.get("icon-optional")),A&&(l||!t.hasTextData()||n.get("text-optional")),true);!t.collisionArrays&&s&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(s);const g=(t,e,i)=>{for(let r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);t.hasVisibleVertices=t.hasVisibleVertices||i!==ce},p=this.collisionBoxArrays.get(t.bucketInstanceId);for(let i=0;i<t.symbolInstances.length;i++){const s=t.symbolInstances.get(i),{numHorizontalGlyphVertices:o,numVerticalGlyphVertices:n,crossTileID:l}=s;let A=this.opacities[l];r[l]?A=a:A||(A=d,this.opacities[l]=A),r[l]=true;const m=s.numIconVertices>0,w=this.placedOrientations[s.crossTileID],I=w===e.an.vertical,v=w===e.an.horizontal||w===e.an.horizontalOnly;if(o>0||n>0){const e=he(A.text);g(t.text,o,I?ce:e),g(t.text,n,v?ce:e);const i=A.text.isHidden();[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=i||I?1:0)})),s.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).hidden=i||v?1:0);const r=this.variableOffsets[s.crossTileID];r&&this.markUsedJustification(t,r.anchor,s,w);const a=this.placedOrientations[s.crossTileID];a&&(this.markUsedJustification(t,"left",s,a),this.markUsedOrientation(t,a,s))}if(m){const e=he(A.icon),i=!(f&&s.verticalPlacedIconSymbolIndex&&I);s.placedIconSymbolIndex>=0&&(g(t.icon,s.numIconVertices,i?e:ce),t.icon.placedSymbolArray.get(s.placedIconSymbolIndex).hidden=A.icon.isHidden()),s.verticalPlacedIconSymbolIndex>=0&&(g(t.icon,s.numVerticalIconVertices,i?ce:e),t.icon.placedSymbolArray.get(s.verticalPlacedIconSymbolIndex).hidden=A.icon.isHidden())}const b=p&&p.has(i)?p.get(i):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[i];if(r){let i=new e.P(0,0);if(r.textBox||r.verticalTextBox){let e=true;if(h){const t=this.variableOffsets[l];t?(i=te(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),c&&i._rotate(u?-this.transform.bearingInRadians:this.transform.bearingInRadians)):e=false}if(r.textBox||r.verticalTextBox){let s;r.textBox&&(s=I),r.verticalTextBox&&(s=v),ie(t.textCollisionBox.collisionVertexArray,A.text.placed,!e||s,b.text,i.x,i.y)}}if(r.iconBox||r.verticalIconBox){const e=Boolean(!v&&r.verticalIconBox);let s;r.iconBox&&(s=e),r.verticalIconBox&&(s=!e),ie(t.iconCollisionBox.collisionVertexArray,A.icon.placed,s,b.icon,f?i.x:0,f?i.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=true}}function ie(t,e,i,r,s,o){r&&0!==r.length||(r=[0,0,0,0]);const n=r[0]-Yt,a=r[1]-Yt,l=r[2]-Yt,A=r[3]-Yt;t.emplaceBack(e?1:0,i?1:0,s||0,o||0,n,a),t.emplaceBack(e?1:0,i?1:0,s||0,o||0,l,a),t.emplaceBack(e?1:0,i?1:0,s||0,o||0,l,A),t.emplaceBack(e?1:0,i?1:0,s||0,o||0,n,A)}const re=Math.pow(2,25),se=Math.pow(2,24),oe=Math.pow(2,17),ne=Math.pow(2,16),ae=Math.pow(2,9),le=Math.pow(2,8),Ae=Math.pow(2,1);function he(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*re+e*se+i*oe+e*ne+i*ae+e*le+i*Ae+e}const ce=0;class ue{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,r,s){const o=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(o,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,s())return true;for(this._sortAcrossTiles&&(this._sortAcrossTiles=false,o.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,s())return true;return false}}class fe{constructor(t,e,i,r,s,o,n,a){this.placement=new ee(t,e,o,n,a),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=s,this._done=false}isDone(){return this._done}continuePlacement(t,e,i){const r=n.now(),s=()=>!this._forceFullPlacement&&n.now()-r>2;for(;this._currentPlacementIndex>=0;){const r=e[t[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if("symbol"===r.type&&(!r.minzoom||r.minzoom<=o)&&(!r.maxzoom||r.maxzoom>o)){if(this._inProgressLayer||(this._inProgressLayer=new ue(r)),this._inProgressLayer.continuePlacement(i[r.source],this.placement,this._showCollisionBoxes,r,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=true}commit(t){return this.placement.commit(t),this.placement}}const de=512/e.$/2;class ge{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};const s=new Map;for(let t=0;t<i.length;t++){const e=i.get(t),r=e.key,o=s.get(r);o?o.push(e):s.set(r,[e])}for(const[t,i]of s){const r={positions:i.map((t=>({x:Math.floor(t.anchorX*de),y:Math.floor(t.anchorY*de)}))),crossTileIDs:i.map((t=>t.crossTileID))};if(r.positions.length>128){const t=new e.aH(r.positions.length,16,Uint16Array);for(const{x:e,y:i}of r.positions)t.add(e,i);t.finish(),delete r.positions,r.index=t}this._symbolsByKey[t]=r}}getScaledCoordinates(t,i){const{x:r,y:s,z:o}=this.tileID.canonical,{x:n,y:a,z:l}=i.canonical,A=de/Math.pow(2,l-o),h=(a*e.$+t.anchorY)*A,c=s*e.$*de;return{x:Math.floor((n*e.$+t.anchorX)*A-r*e.$*de),y:Math.floor(h-c)}}findMatches(t,e,i){const r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let s=0;s<t.length;s++){const o=t.get(s);if(o.crossTileID)continue;const n=this._symbolsByKey[o.key];if(!n)continue;const a=this.getScaledCoordinates(o,e);if(n.index){const t=n.index.range(a.x-r,a.y-r,a.x+r,a.y+r).sort();for(const e of t){const t=n.crossTileIDs[e];if(!i[t]){i[t]=true,o.crossTileID=t;break}}}else if(n.positions)for(let t=0;t<n.positions.length;t++){const e=n.positions[t],s=n.crossTileIDs[t];if(Math.abs(e.x-a.x)<=r&&Math.abs(e.y-a.y)<=r&&!i[s]){i[s]=true,o.crossTileID=s;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class pe{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class me{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],r={};for(const t in i){const s=i[t];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+e),r[s.tileID.key]=s}this.indexes[t]=r}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return false;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const r=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const s=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in s){const o=s[i];o.tileID.isChildOf(t)&&o.findMatches(e.symbolInstances,t,r)}else{const o=s[t.scaledTo(Number(i)).key];o&&o.findMatches(e.symbolInstances,t,r)}}for(let t=0;t<e.symbolInstances.length;t++){const s=e.symbolInstances.get(t);s.crossTileID||(s.crossTileID=i.generate(),r[s.crossTileID]=true)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new ge(t,e.symbolInstances,e.bucketInstanceId),true}removeBucketCrossTileIDs(t,e){for(const i of e.getCrossTileIDsLists())for(const e of i)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=false;for(const i in this.indexes){const r=this.indexes[i];for(const s in r)t[r[s].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[s]),delete r[s],e=true)}return e}}class we{constructor(){this.layerIndexes={},this.crossTileIDs=new pe,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new me);let s=false;const o={};r.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,e,this.crossTileIDs)&&(s=true),o[e.bucketInstanceId]=true)}return r.removeStaleBuckets(o)&&(s=true),s}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=true}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}var Ie="void main() {fragColor=vec4(1.0);}";const ve={prelude:be("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c\n);}\n#ifdef TERRAIN3D\nuniform 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;\n#endif\nconst 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) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 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;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 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;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:be("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:be("","#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}"),background:be("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:be("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;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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:be("in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;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));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}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;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:be(Ie,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:be("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.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;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:be("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out 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:be("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:be("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:be("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(textureSize(u_elevation_stops,0)[0]);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int num_elevation_stops=textureSize(u_elevation_stops,0)[0];int r=(num_elevation_stops-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(textureSize(u_color_stops,0)[0]);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:be("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:be(Ie,"in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:be("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}"),fillOutline:be("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:be("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=projectTile(a_pos+u_fill_translate,a_pos);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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillPattern:be("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=projectTile(a_pos+u_fill_translate,a_pos);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:be("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat 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;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=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:be("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*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:be("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;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))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:be("uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;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_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;switch(u_method){case BASIC:\nbasic_hillshade(deriv);break;case COMBINED:\ncombined_hillshade(deriv);break;case IGOR:\nigor_hillshade(deriv);break;case MULTIDIRECTIONAL:\nmultidirectional_hillshade(deriv);break;case STANDARD:\ndefault:\nstandard_hillshade(deriv);break;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:be("uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:be("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:be("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:be("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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=texture(u_image,v_tex_a).a;float sdfdist_b=texture(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);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;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;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_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:be("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in 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=texture(u_image0,v_pos0);vec4 color1=texture(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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:be("uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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:be("#define SDF_PX 8.0\nuniform 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;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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=texture(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);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:be("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}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=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in 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_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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:be("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:be("in 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() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:be("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:be("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:be("in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}","in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:be("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function be(t,e){const i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/in ([\w]+) ([\w]+)/g),s=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),n=o?o.concat(s):s,a={};return{fragmentSource:t=t.replace(i,((t,e,i,r,s)=>(a[s]=true,"define"===e?`\n#ifndef HAS_UNIFORM_u_${s}\nin ${i} ${r} ${s};\n#else\nuniform ${i} ${r} u_${s};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${s}\n ${i} ${r} ${s} = u_${s};\n#endif\n`))),vertexSource:e=e.replace(i,((t,e,i,r,s)=>{const o="float"===r?"vec2":"vec4",n=s.match(/color/)?"color":o;return a[s]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${s}\nuniform lowp float u_${s}_t;\nin ${i} ${o} a_${s};\nout ${i} ${r} ${s};\n#else\nuniform ${i} ${r} u_${s};\n#endif\n`:"vec4"===n?`\n#ifndef HAS_UNIFORM_u_${s}\n ${s} = a_${s};\n#else\n ${i} ${r} ${s} = u_${s};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${s}\n ${s} = unpack_mix_${n}(a_${s}, u_${s}_t);\n#else\n ${i} ${r} ${s} = u_${s};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${s}\nuniform lowp float u_${s}_t;\nin ${i} ${o} a_${s};\n#else\nuniform ${i} ${r} u_${s};\n#endif\n`:"vec4"===n?`\n#ifndef HAS_UNIFORM_u_${s}\n ${i} ${r} ${s} = a_${s};\n#else\n ${i} ${r} ${s} = u_${s};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${s}\n ${i} ${r} ${s} = unpack_mix_${n}(a_${s}, u_${s}_t);\n#else\n ${i} ${r} ${s} = u_${s};\n#endif\n`})),staticAttributes:r,staticUniforms:n}}class ye{constructor(t,e,i){this.vertexBuffer=t,this.indexBuffer=e,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Be=e.aI([{name:"a_pos",type:"Int16",components:2}]);const Ce="#define PROJECTION_MERCATOR",Ee="mercator";class _e{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return false}get shaderVariantName(){return Ee}get shaderDefine(){return Ce}get shaderPreludeCode(){return ve.projectionMercator}get vertexShaderPreludeCode(){return ve.projectionMercator.vertexSource}get subdivisionGranularity(){return e.aJ.noSubdivision}get useGlobeControls(){return false}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,i,r,s,o){if(this._cachedMesh)return this._cachedMesh;const n=new e.aK;n.emplaceBack(0,0),n.emplaceBack(e.$,0),n.emplaceBack(0,e.$),n.emplaceBack(e.$,e.$);const a=t.createVertexBuffer(n,Be.members),l=e.aL.simpleSegment(0,0,4,2),A=new e.aM;A.emplaceBack(1,0,2),A.emplaceBack(1,2,3);const h=t.createIndexBuffer(A);return this._cachedMesh=new ye(a,h,l),this._cachedMesh}recalculate(){}hasTransition(){return false}setErrorQueryLatitudeDegrees(t){}}class Qe{constructor(t=0,e=0,i=0,r=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=e.C.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.C.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=e.C.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=e.C.number(t.right,i.right,r)),this}getCenter(t,i){const r=e.ag((this.left+t-this.right)/2,0,t),s=e.ag((this.top+i-this.bottom)/2,0,i);return new e.P(r,s)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Qe(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function xe(t,e){if(!t.renderWorldCopies||t.lngRange)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}function Me(t){return Math.max(0,Math.floor(t))}class ke{constructor(t,i,r,s,o,n){this._callbacks=t,this._tileSize=512,this._renderWorldCopies=void 0===n||!!n,this._minZoom=i||0,this._maxZoom=r||22,this._minPitch=null==s?0:s,this._maxPitch=null==o?60:o,this.setMaxBounds(),this._width=0,this._height=0,this._center=new e.S(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Me(this._zoom),this._scale=e.ae(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=true,this._edgeInsets=new Qe,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=true}apply(t,i,r){this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=Me(this._zoom),this._scale=e.ae(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Qe(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!r&&t.autoCalculateNearFarZ,i&&this._constrain(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){void 0===t?t=true:null===t&&(t=false),this._renderWorldCopies=t}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){const i=e.aN(t,-180,180)*Math.PI/180;var s,o,n,a,l,A,h,c,u;this._bearingInRadians!==i&&(this._unmodified=false,this._bearingInRadians=i,this._calcMatrices(),this._rotationMatrix=r(),s=this._rotationMatrix,n=-this._bearingInRadians,a=(o=this._rotationMatrix)[0],l=o[1],A=o[2],h=o[3],c=Math.sin(n),u=Math.cos(n),s[0]=a*u+A*c,s[1]=l*u+h*c,s[2]=a*-c+A*u,s[3]=l*-c+h*u)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){const i=e.ag(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==i&&(this._unmodified=false,this._pitchInRadians=i,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){const e=t/180*Math.PI;this._rollInRadians!==e&&(this._unmodified=false,this._rollInRadians=e,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return e.aO(this._fovInRadians)}setFov(t){t=e.ag(t,.1,150),this.fov!==t&&(this._unmodified=false,this._fovInRadians=e.ad(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){const i=this.getConstrained(this._center,t).zoom;this._zoom!==i&&(this._unmodified=false,this._zoom=i,this._tileZoom=Math.max(0,Math.floor(i)),this._scale=e.ae(i),this._constrain(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=false,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=false,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,e){this._autoCalculateNearFarZ=false,this._nearZ=t,this._farZ=e,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=true,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=false,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}resize(t,e,i=true){this._width=t,this._height=e,i&&this._constrain(),this._calcMatrices()}getMaxBounds(){return this._latRange&&2===this._latRange.length&&this._lngRange&&2===this._lngRange.length?new O([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this._lngRange=null,this._latRange=[-85.051129,e.ah])}getConstrained(t,e){return this._callbacks.getConstrained(t,e)}getCameraQueryGeometry(t,i){if(1===i.length)return[i[0],t];{const{minX:r,minY:s,maxX:o,maxY:n}=e.a1.fromPoints(i).extend(t);return[new e.P(r,s),new e.P(o,s),new e.P(o,n),new e.P(r,n),new e.P(r,s)]}}_constrain(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=true;const t=this._unmodified,{center:e,zoom:i}=this.getConstrained(this.center,this.zoom);this.setCenter(e),this.setZoom(i),this._unmodified=t,this._constraining=false}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=e.af(new Float64Array(16));e.N(t,t,[this._width/2,-this._height/2,1]),e.M(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=e.af(new Float64Array(16)),e.N(t,t,[1,-1,1]),e.M(t,t,[-1,-1,0]),e.N(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,i,r,s){const o=void 0!==r?r:this.bearing,n=s=void 0!==s?s:this.pitch,a=e.a0.fromLngLat(t,i),l=-Math.cos(e.ad(n)),A=Math.sin(e.ad(n)),h=A*Math.sin(e.ad(o)),c=-A*Math.cos(e.ad(o));let u=this.elevation;const f=i-u;let d;l*f>=0||Math.abs(l)<.1?(d=1e4,u=i+d*l):d=-f/l;let g,p,m=e.aP(1,a.y),w=0;do{if(w+=1,w>10)break;p=d/m,g=new e.a0(a.x+h*p,a.y+c*p),m=1/g.meterInMercatorCoordinateUnits()}while(Math.abs(d-p*m)>1e-12);return{center:g.toLngLat(),elevation:u,zoom:e.aj(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;const i=e.ai(1,this.center.lat)*this.worldSize,r=this.cameraToCenterDistance/i,s=e.a0.fromLngLat(this.center,this.elevation),o=ut(this.center,this.elevation,this.pitch,this.bearing,r);this._elevation=t;const n=this.calculateCenterFromCameraLngLatAlt(o.toLngLat(),e.aP(o.z,s.y),this.bearing,this.pitch);this._elevation=n.elevation,this._center=n.center,this.setZoom(n.zoom)}getCameraPoint(){const t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const t=e.ai(1,this.center.lat)*this.worldSize;return ut(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];const i=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/i,t.canonical.y/i,1/i/e.$,1/i/e.$]}}class De{constructor(t,i){this.min=t,this.max=i,this.center=e.aQ([],e.aR([],this.min,this.max),.5)}quadrant(t){const i=[t%2==0,t<2],r=e.aS(this.min),s=e.aS(this.max);for(let t=0;t<i.length;t++)r[t]=i[t]?this.min[t]:this.center[t],s[t]=i[t]?this.center[t]:this.max[t];return s[2]=this.max[2],new De(r,s)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let e=true;for(let i=0;i<t.planes.length;i++){const r=this.intersectsPlane(t.planes[i]);if(0===r)return 0;1===r&&(e=false)}return e?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let e=t[3],i=t[3];for(let r=0;r<3;r++)t[r]>0?(e+=t[r]*this.min[r],i+=t[r]*this.max[r]):(i+=t[r]*this.min[r],e+=t[r]*this.max[r]);return e>=0?2:i<0?0:1}}class Se{distanceToTile2d(t,e,i,r){const s=r.distanceX([t,e]),o=r.distanceY([t,e]);return Math.hypot(s,o)}getWrap(t,e,i){return i}getTileBoundingVolume(t,i,r,s){var o,n;let a=r,l=r;if(null==s?void 0:s.terrain){const A=new e.Z(t.z,i,t.z,t.x,t.y),h=s.terrain.getMinMaxElevation(A);a=null!==(o=h.minElevation)&&void 0!==o?o:r,l=null!==(n=h.maxElevation)&&void 0!==n?n:r}const A=1<<t.z;return new De([i+t.x/A,t.y/A,a],[i+(t.x+1)/A,(t.y+1)/A,l])}allowVariableZoom(t,i){const r=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,s=e.ag(78.5-r/2,0,60);return!!i.terrain||t.pitch>s}allowWorldCopies(){return true}prepareNextFrame(){}}class Ge{constructor(t,e,i){this.points=t,this.planes=e,this.aabb=i}static fromInvProjectionMatrix(t,i=1,r=0,s,o){const n=o?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],a=Math.pow(2,r),l=[[-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((r=>function(t,i,r,s){const o=e.av([],t,i),n=1/o[3]/r*s;return e.aX(o,o,[n,n,1/o[3],n])}(r,t,i,a)));s&&function(t,i,r,s){const o=s?4:0,n=s?0:4;let a=0;const l=[],A=[];for(let i=0;i<4;i++){const r=e.aT([],t[i+n],t[i+o]),s=e.aY(r);e.aQ(r,r,1/s),l.push(s),A.push(r)}for(let i=0;i<4;i++){const s=e.aZ(t[i+o],A[i],r);a=null!==s&&s>=0?Math.max(a,s):Math.max(a,l[i])}const h=function(t,i){const r=e.aT([],t[i[0]],t[i[1]]),s=e.aT([],t[i[2]],t[i[1]]),o=[0,0,0,0];return e.aU(o,e.aV([],r,s)),o[3]=-e.aW(o,t[i[0]]),o}(t,i),c=function(t,i){const r=e.a_(t),s=e.a$([],t,1/r),o=e.aT([],i,e.aQ([],s,e.aW(i,s))),n=e.a_(o);if(n>0){const t=Math.sqrt(1-s[3]*s[3]),r=e.aQ([],s,-s[3]),a=e.aR([],r,e.aQ([],o,t/n));return e.b0(i,a)}return null}(r,h);if(null!==c){const t=c/e.aW(A[0],h);a=Math.min(a,t)}for(let e=0;e<4;e++){const i=Math.min(a,l[e]);t[e+n]=[t[e+o][0]+A[e][0]*i,t[e+o][1]+A[e][1]*i,t[e+o][2]+A[e][2]*i,1]}}(l,n[0],s,o);const A=n.map((t=>{const i=e.aT([],l[t[0]],l[t[1]]),r=e.aT([],l[t[2]],l[t[1]]),s=e.aU([],e.aV([],i,r)),o=-e.aW(s,l[t[1]]);return s.concat(o)})),h=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],c=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const t of l)for(let e=0;e<3;e++)h[e]=Math.min(h[e],t[e]),c[e]=Math.max(c[e],t[e]);return new Ge(l,A,new De(h,c))}}class Fe{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e,i=true){this._helper.resize(t,e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,e){}constructor(t,e,i,r,s){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this._helper=new ke({calcMatrices:()=>{this._calcMatrices()},getConstrained:(t,e)=>this.getConstrained(t,e)},t,e,i,r,s),this._coveringTilesDetailsProvider=new Se}clone(){const t=new Fe;return t.apply(this),t}apply(t,e,i){this._helper.apply(t,e,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){const i=[new e.b1(0,t)];if(this._helper._renderWorldCopies){const r=this.screenPointToMercatorCoordinate(new e.P(0,0)),s=this.screenPointToMercatorCoordinate(new e.P(this._helper._width,0)),o=this.screenPointToMercatorCoordinate(new e.P(this._helper._width,this._helper._height)),n=this.screenPointToMercatorCoordinate(new e.P(0,this._helper._height)),a=Math.floor(Math.min(r.x,s.x,o.x,n.x)),l=Math.floor(Math.max(r.x,s.x,o.x,n.x)),A=1;for(let r=a-A;r<=l+A;r++)0!==r&&i.push(new e.b1(r,t))}return i}getCameraFrustum(){return Ge.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){const e=this.screenPointToLocation(this.centerPoint,t),i=t?t.getElevationForLngLatZoom(e,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(t,i){const r=e.ai(this.elevation,this.center.lat),s=this.screenPointToMercatorCoordinateAtZ(i,r),o=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),n=e.a0.fromLngLat(t),a=new e.a0(n.x-(s.x-o.x),n.y-(s.y-o.y));this.setCenter(null==a?void 0:a.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,i){return i?this.coordinatePoint(e.a0.fromLngLat(t),i.getElevationForLngLatZoom(t,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(e.a0.fromLngLat(t))}screenPointToLocation(t,e){var i;return null===(i=this.screenPointToMercatorCoordinate(t,e))||void 0===i?void 0:i.toLngLat()}screenPointToMercatorCoordinate(t,e){if(e){const i=e.pointCoordinate(t);if(null!=i)return i}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,i){const r=i||0,s=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.av(s,s,this._pixelMatrixInverse),e.av(o,o,this._pixelMatrixInverse);const n=s[3],a=o[3],l=s[1]/n,A=o[1]/a,h=s[2]/n,c=o[2]/a,u=h===c?0:(r-h)/(c-h);return new e.a0(e.C.number(s[0]/n,o[0]/a,u)/this.worldSize,e.C.number(l,A,u)/this.worldSize,r)}coordinatePoint(t,i=0,r=this._pixelMatrix){const s=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.av(s,s,r),new e.P(s[0]/s[3],s[1]/s[3])}getBounds(){const t=Math.max(0,this._helper._height/2-ht(this));return(new O).extend(this.screenPointToLocation(new e.P(0,t))).extend(this.screenPointToLocation(new e.P(this._helper._width,t))).extend(this.screenPointToLocation(new e.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new e.P(0,this._helper._height)))}isPointOnMapSurface(t,e){return e?null!=e.pointCoordinate(t):t.y>this.height/2-ht(this)}calculatePosMatrix(t,i=false,r){var s;const o=null!==(s=t.key)&&void 0!==s?s:e.b2(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),n=i?this._alignedPosMatrixCache:this._posMatrixCache;if(n.has(o)){const t=n.get(o);return r?t.f32:t.f64}const a=ct(t,this.worldSize);e.O(a,i?this._alignedProjMatrix:this._viewProjMatrix,a);const l={f64:a,f32:new Float32Array(a)};return n.set(o,l),r?l.f32:l.f64}calculateFogMatrix(t){const i=t.key,r=this._fogMatrixCacheF32;if(r.has(i))return r.get(i);const s=ct(t,this.worldSize);return e.O(s,this._fogMatrix,s),r.set(i,new Float32Array(s)),r.get(i)}getConstrained(t,i){i=e.ag(+i,this.minZoom,this.maxZoom);const r={center:new e.S(t.lng,t.lat),zoom:i};let s=this._helper._lngRange;this._helper._renderWorldCopies||null!==s||(s=[-179.9999999999,180-1e-10]);const o=this.tileSize*e.ae(r.zoom);let n=0,a=o,l=0,A=o,h=0,c=0;const{x:u,y:f}=this.size;if(this._helper._latRange){const t=this._helper._latRange;n=e.U(t[1])*o,a=e.U(t[0])*o,a-n<f&&(h=f/(a-n))}s&&(l=e.aN(e.V(s[0])*o,0,o),A=e.aN(e.V(s[1])*o,0,o),A<l&&(A+=o),A-l<u&&(c=u/(A-l)));const{x:d,y:g}=lt(o,t);let p,m;const w=Math.max(c||0,h||0);if(w){const t=new e.P(c?(A+l)/2:d,h?(a+n)/2:g);return r.center=At(o,t).wrap(),r.zoom+=e.aj(w),r}if(this._helper._latRange){const t=f/2;g-t<n&&(m=n+t),g+t>a&&(m=a-t)}if(s){const t=(l+A)/2;let i=d;this._helper._renderWorldCopies&&(i=e.aN(d,t-o/2,t+o/2));const r=u/2;i-r<l&&(p=l+r),i+r>A&&(p=A-r)}if(void 0!==p||void 0!==m){const t=new e.P(null!=p?p:d,null!=m?m:g);r.center=At(o,t).wrap()}return r}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}_calculateNearFarZIfNeeded(t,i,r){if(!this._helper.autoCalculateNearFarZ)return;const s=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),o=t-s*this._helper._pixelPerMeter/Math.cos(i),n=s<0?o:t,a=Math.PI/2+this.pitchInRadians,l=e.ad(this.fov)*(Math.abs(Math.cos(e.ad(this.roll)))*this.height+Math.abs(Math.sin(e.ad(this.roll)))*this.width)/this.height*(.5+r.y/this.height),A=Math.sin(l)*n/Math.sin(e.ag(Math.PI-a-l,.01,Math.PI-.01)),h=ht(this),c=Math.atan(h/this._helper.cameraToCenterDistance),u=e.ad(.75),f=c>u?2*c*(.5+r.y/(2*h)):u,d=Math.sin(f)*n/Math.sin(e.ag(Math.PI-a-f,.01,Math.PI-.01)),g=Math.min(A,d);this._helper._farZ=1.01*(Math.cos(Math.PI/2-i)*g+n),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const t=this.centerOffset,i=lt(this.worldSize,this.center),r=i.x,s=i.y;this._helper._pixelPerMeter=e.ai(1,this.center.lat)*this.worldSize;const o=e.ad(Math.min(this.pitch,at)),n=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(o));let a;this._calculateNearFarZIfNeeded(n,o,t),a=new Float64Array(16),e.b3(a,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),e.ap(this._invProjMatrix,a),a[8]=2*-t.x/this._helper._width,a[9]=2*t.y/this._helper._height,this._projectionMatrix=e.b4(a),e.N(a,a,[1,-1,1]),e.M(a,a,[0,0,-this._helper.cameraToCenterDistance]),e.b5(a,a,-this.rollInRadians),e.b6(a,a,this.pitchInRadians),e.b5(a,a,-this.bearingInRadians),e.M(a,a,[-r,-s,0]),this._mercatorMatrix=e.N([],a,[this.worldSize,this.worldSize,this.worldSize]),e.N(a,a,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=e.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,a),e.M(a,a,[0,0,-this.elevation]),this._viewProjMatrix=a,this._invViewProjMatrix=e.ap([],a);const l=[0,0,-1,1];e.av(l,l,this._invViewProjMatrix),this._cameraPosition=[l[0]/l[3],l[1]/l[3],l[2]/l[3]],this._fogMatrix=new Float64Array(16),e.b3(this._fogMatrix,this.fovInRadians,this.width/this.height,n,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,e.N(this._fogMatrix,this._fogMatrix,[1,-1,1]),e.M(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b5(this._fogMatrix,this._fogMatrix,-this.rollInRadians),e.b6(this._fogMatrix,this._fogMatrix,this.pitchInRadians),e.b5(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),e.M(this._fogMatrix,this._fogMatrix,[-r,-s,0]),e.N(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),e.M(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=e.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,a);const A=this._helper._width%2/2,h=this._helper._height%2/2,c=Math.cos(this.bearingInRadians),u=Math.sin(-this.bearingInRadians),f=r-Math.round(r)+c*A+u*h,d=s-Math.round(s)+c*h+u*A,g=new Float64Array(a);if(e.M(g,g,[f>.5?f-1:f,d>.5?d-1:d,0]),this._alignedProjMatrix=g,a=e.ap(new Float64Array(16),this._pixelMatrix),!a)throw new Error("failed to invert matrix");this._pixelMatrixInverse=a,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const t=this.screenPointToMercatorCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.av(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const t=e.ai(1,this.center.lat)*this.worldSize;return ut(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,i){const r=e.a0.fromLngLat(t),s=[r.x*this.worldSize,r.y*this.worldSize,i,1];return e.av(s,s,this._viewProjMatrix),s[2]/s[3]}getProjectionData(t){const{overscaledTileID:i,aligned:r,applyTerrainMatrix:s}=t,o=this._helper.getMercatorTileCoordinates(i),n=i?this.calculatePosMatrix(i,r,true):null;let a;return a=i&&i.terrainRttPosMatrix32f&&s?i.terrainRttPosMatrix32f:n||e.b7(),{mainMatrix:a,tileMercatorCoords:o,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:a}}isLocationOccluded(t){return false}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,e,i){return 1}transformLightDirection(t){return e.aS(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,i,r,s){const o=this.calculatePosMatrix(r);let n;s?(n=[t,i,s(t,i),1],e.av(n,n,o)):(n=[t,i,0,1],Ht(n,n,o));const a=n[3];return{point:new e.P(n[0]/a,n[1]/a),signedDistanceFromCamera:a,isOccluded:false}}populateCache(t){for(const e of t)this.calculatePosMatrix(e)}getMatrixForModel(t,i){const r=e.a0.fromLngLat(t,i),s=r.meterInMercatorCoordinateUnits(),o=e.b8();return e.M(o,o,[r.x,r.y,r.z]),e.b5(o,o,Math.PI),e.b6(o,o,Math.PI/2),e.N(o,o,[-s,s,s]),o}getProjectionDataForCustomLayer(t=true){const i=new e.Z(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:t}),s=ct(i,this.worldSize);e.O(s,this._viewProjMatrix,s),r.tileMercatorCoords=[0,0,1,1];const o=[e.$,e.$,this.worldSize/this._helper.pixelsPerMeter],n=e.b9();return e.N(n,s,o),r.fallbackMatrix=n,r.mainMatrix=n,r}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function Re(){e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Le(t){if(t.useSlerp)if(t.k<1){const i=e.ba(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),r=e.ba(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),s=new Float64Array(4);e.bb(s,i,r,t.k);const o=e.bc(s);t.tr.setRoll(o.roll),t.tr.setPitch(o.pitch),t.tr.setBearing(o.bearing)}else t.tr.setRoll(t.endEulerAngles.roll),t.tr.setPitch(t.endEulerAngles.pitch),t.tr.setBearing(t.endEulerAngles.bearing);else t.tr.setRoll(e.C.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(e.C.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(e.C.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}function ze(t,i,r,s,o){const n=o.padding,a=lt(o.worldSize,r.getNorthWest()),l=lt(o.worldSize,r.getNorthEast()),A=lt(o.worldSize,r.getSouthEast()),h=lt(o.worldSize,r.getSouthWest()),c=e.ad(-s),u=a.rotate(c),f=l.rotate(c),d=A.rotate(c),g=h.rotate(c),p=new e.P(Math.max(u.x,f.x,g.x,d.x),Math.max(u.y,f.y,g.y,d.y)),m=new e.P(Math.min(u.x,f.x,g.x,d.x),Math.min(u.y,f.y,g.y,d.y)),w=p.sub(m),I=(o.width-(n.left+n.right+i.left+i.right))/w.x,v=(o.height-(n.top+n.bottom+i.top+i.bottom))/w.y;if(v<0||I<0)return void Re();const b=Math.min(e.aj(o.scale*Math.min(I,v)),t.maxZoom),y=e.P.convert(t.offset),B=new e.P((i.left-i.right)/2,(i.top-i.bottom)/2).rotate(e.ad(s)),C=y.add(B).mult(o.scale/e.ae(b));return{center:At(o.worldSize,a.add(A).div(2).sub(C)),zoom:b,bearing:s}}class Ue{get useGlobeControls(){return false}handlePanInertia(t,e){return{easingOffset:t,easingCenter:e.center}}handleMapControlsRollPitchBearingZoom(t,e){t.bearingDelta&&e.setBearing(e.bearing+t.bearingDelta),t.pitchDelta&&e.setPitch(e.pitch+t.pitchDelta),t.rollDelta&&e.setRoll(e.roll+t.rollDelta),t.zoomDelta&&e.setZoom(e.zoom+t.zoomDelta)}handleMapControlsPan(t,e,i){t.around.distSqr(e.centerPoint)<.01||e.setLocationAtPoint(i,t.around)}cameraForBoxAndBearing(t,e,i,r,s){return ze(t,e,i,r,s)}handleJumpToCenterZoom(t,i){t.zoom!==(void 0!==i.zoom?+i.zoom:t.zoom)&&t.setZoom(+i.zoom),void 0!==i.center&&t.setCenter(e.S.convert(i.center))}handleEaseTo(t,i){const r=t.zoom,s=t.padding,o={roll:t.roll,pitch:t.pitch,bearing:t.bearing},n={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},a=void 0!==i.zoom,l=!t.isPaddingEqual(i.padding);let A=false;const h=a?+i.zoom:t.zoom;let c=t.centerPoint.add(i.offsetAsPoint);const u=t.screenPointToLocation(c),{center:f,zoom:d}=t.getConstrained(e.S.convert(i.center||u),null!=h?h:r);xe(t,f);const g=lt(t.worldSize,u),p=lt(t.worldSize,f).sub(g),m=e.ae(d-r);return A=d!==r,{easeFunc:a=>{if(A&&t.setZoom(e.C.number(r,d,a)),e.bd(o,n)||Le({startEulerAngles:o,endEulerAngles:n,tr:t,k:a,useSlerp:o.roll!=n.roll}),l&&(t.interpolatePadding(s,i.padding,a),c=t.centerPoint.add(i.offsetAsPoint)),i.around)t.setLocationAtPoint(i.around,i.aroundPoint);else{const i=e.ae(t.zoom-r),s=d>r?Math.min(2,m):Math.max(.5,m),o=Math.pow(s,1-a),n=At(t.worldSize,g.add(p.mult(a*o)).mult(i));t.setLocationAtPoint(t.renderWorldCopies?n.wrap():n,c)}},isZooming:A,elevationCenter:f}}handleFlyTo(t,i){const r=void 0!==i.zoom,s=t.zoom,o=t.getConstrained(e.S.convert(i.center||i.locationAtOffset),r?+i.zoom:s),n=o.center,a=o.zoom;xe(t,n);const l=lt(t.worldSize,i.locationAtOffset),A=lt(t.worldSize,n).sub(l),h=A.mag(),c=e.ae(a-s);let u;if(void 0!==i.minZoom){const r=Math.min(+i.minZoom,s,a),o=t.getConstrained(n,r).zoom;u=e.ae(o-s)}return{easeFunc:(i,r,o,h)=>{t.setZoom(1===i?a:s+e.aj(r));const c=1===i?n:At(t.worldSize,l.add(A.mult(o)).mult(r));t.setLocationAtPoint(t.renderWorldCopies?c.wrap():c,h)},scaleOfZoom:c,targetCenter:n,scaleOfMinZoom:u,pixelPathLength:h}}}class Pe{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}Pe.Replace=[1,0],Pe.disabled=new Pe(Pe.Replace,e.be.transparent,[false,false,false,false]),Pe.unblended=new Pe(Pe.Replace,e.be.transparent,[true,true,true,true]),Pe.alphaBlended=new Pe([1,771],e.be.transparent,[true,true,true,true]);const Ne=2305;class Te{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}Te.disabled=new Te(false,1029,Ne),Te.backCCW=new Te(true,1029,Ne),Te.frontCCW=new Te(true,1028,Ne);class qe{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}qe.ReadOnly=false,qe.ReadWrite=true,qe.disabled=new qe(519,qe.ReadOnly,[0,1]);const Oe=7680;class je{constructor(t,e,i,r,s,o){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=s,this.pass=o}}je.disabled=new je({func:519,mask:0},0,0,Oe,Oe,Oe);const Je=new WeakMap;function He(t){var e;if(Je.has(t))return Je.get(t);{const i=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return Je.set(t,i),i}}class Ye{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;const i=t.context,r=i.gl;this._texFormat=r.RGBA,this._texType=r.UNSIGNED_BYTE;const s=new e.aK;s.emplaceBack(-1,-1),s.emplaceBack(2,-1),s.emplaceBack(-1,2);const o=new e.aM;o.emplaceBack(0,1,2),this._fullscreenTriangle=new ye(i.createVertexBuffer(s,Be.members),i.createIndexBuffer(o),e.aL.simpleSegment(0,0,s.length,o.length)),this._resultBuffer=new Uint8Array(4),i.activeTexture.set(r.TEXTURE1);const n=r.createTexture();r.bindTexture(r.TEXTURE_2D,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=i.createFramebuffer(this._texWidth,this._texHeight,false,false),this._fbo.colorAttachment.set(n),He(r)&&(this._pbo=r.createBuffer(),r.bindBuffer(r.PIXEL_PACK_BUFFER,this._pbo),r.bufferData(r.PIXEL_PACK_BUFFER,4,r.STREAM_READ),r.bindBuffer(r.PIXEL_PACK_BUFFER,null))}destroy(){const t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,e){const i=this._updateCount;return this._readbackQueue?i>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():i>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,e),this._updateCount++,this._measuredError}_bindFramebuffer(){const t=this._cachedRenderContext.context,e=t.gl;t.activeTexture.set(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,i){const r=this._cachedRenderContext.context,s=r.gl;if(this._bindFramebuffer(),r.viewport.set([0,0,this._texWidth,this._texHeight]),r.clear({color:e.be.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(r,s.TRIANGLES,qe.disabled,je.disabled,Pe.unblended,Te.disabled,((t,e)=>({u_input:t,u_output_expected:e}))(t,i),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&He(s)){s.bindBuffer(s.PIXEL_PACK_BUFFER,this._pbo),s.readBuffer(s.COLOR_ATTACHMENT0),s.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),s.bindBuffer(s.PIXEL_PACK_BUFFER,null);const t=s.fenceSync(s.SYNC_GPU_COMMANDS_COMPLETE,0);s.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:t}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&He(t)){const i=t.clientWaitSync(this._readbackQueue.sync,0,0);if(i===t.WAIT_FAILED)return e.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(i===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=Ye._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let e=0;return e+=t[0]/256,e+=t[1]/65536,e+=t[2]/16777216,t[3]<127&&(e=-e),e/128}}const $e=e.$/128;function Ve(t,i){const r=void 0!==t.granularity?Math.max(t.granularity,1):1,s=r+(t.generateBorders?2:0),o=r+(t.extendToNorthPole||t.generateBorders?1:0)+(t.extendToSouthPole||t.generateBorders?1:0),n=s+1,a=o+1,l=t.generateBorders?-1:0,A=t.generateBorders||t.extendToNorthPole?-1:0,h=r+(t.generateBorders?1:0),c=r+(t.generateBorders||t.extendToSouthPole?1:0),u=n*a,f=s*o*6,d=n*a>65536;if(d&&"16bit"===i)throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const g=d||"32bit"===i,p=new Int16Array(2*u);let m=0;for(let i=A;i<=c;i++)for(let s=l;s<=h;s++){let o=s/r*e.$;-1===s&&(o=-64),s===r+1&&(o=e.$+$e);let n=i/r*e.$;-1===i&&(n=t.extendToNorthPole?e.bg:-64),i===r+1&&(n=t.extendToSouthPole?e.bh:e.$+$e),p[m++]=o,p[m++]=n}const w=g?new Uint32Array(f):new Uint16Array(f);let I=0;for(let t=0;t<o;t++)for(let e=0;e<s;e++){const i=e+1+t*n,r=e+(t+1)*n,s=e+1+(t+1)*n;w[I++]=e+t*n,w[I++]=r,w[I++]=i,w[I++]=i,w[I++]=r,w[I++]=s}return{vertices:p.buffer.slice(0),indices:w.buffer.slice(0),uses32bitIndices:g}}const Ke=new e.aJ({fill:new e.bi(128,2),line:new e.bi(512,0),tile:new e.bi(128,32),stencil:new e.bi(128,1),circle:3});class Ze{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return true}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return ve.projectionGlobe}get vertexShaderPreludeCode(){return ve.projectionMercator.vertexSource}get subdivisionGranularity(){return Ke}get useGlobeControls(){return true}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new Ye(t));const i=e.U(this._errorQueryLatitudeDegrees),r=2*Math.atan(Math.exp(Math.PI-i*Math.PI*2))-.5*Math.PI,s=this._errorMeasurement.updateErrorLoop(i,r),o=n.now();s!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=s,this._errorMeasurementLastChangeTime=o);const a=Math.min(Math.max((o-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=e.bj(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,e.bk(a))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,e,i,r,s){const o=("stencil"===s?Ke.stencil:Ke.tile).getGranularityForZoomLevel(e.z);return this._getMesh(t,{granularity:o,generateBorders:i,extendToNorthPole:0===e.y&&r,extendToSouthPole:e.y===(1<<e.z)-1&&r})}_getMesh(t,i){const r=this._getMeshKey(i);if(r in this._tileMeshCache)return this._tileMeshCache[r];const s=function(t,i){const r=Ve(i,"16bit"),s=e.aK.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),o=e.aM.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new ye(t.createVertexBuffer(s,Be.members),t.createIndexBuffer(o),e.aL.simpleSegment(0,0,s.length,o.length))}(t,i);return this._tileMeshCache[r]=s,s}recalculate(t){}hasTransition(){const t=n.now();let e=false;return e=e||(t-this._errorMeasurementLastChangeTime)/1e3<.7,e=e||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,e}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}const We=new e.r({type:new e.D(e.v.projection.type)});class Xe extends e.E{constructor(t){super(),this._transitionable=new e.t(We),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.F(0)),this._mercatorProjection=new _e,this._verticalPerspectiveProjection=new Ze}get transitionState(){const t=this.properties.get("type");if("string"==typeof t&&"mercator"===t)return 0;if("string"==typeof t&&"vertical-perspective"===t)return 1;if(t instanceof e.bl){if("vertical-perspective"===t.from&&"mercator"===t.to)return 1-t.transition;if("mercator"===t.from&&"vertical-perspective"===t.to)return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,e,i,r,s){return this.currentProjection.getMeshFromTileID(t,e,i,r,s)}setProjection(t){this._transitionable.setValue("type",(null==t?void 0:t.type)||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function ti(t){const e=ri(t.worldSize,t.center.lat);return 2*Math.PI*e}function ei(t,i,r,s,o){const n=1/(1<<o),a=i/e.$*n+s*n,l=e.bn((t/e.$*n+r*n)*Math.PI*2+Math.PI,2*Math.PI),A=2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI,h=Math.cos(A),c=new Float64Array(3);return c[0]=Math.sin(l)*h,c[1]=Math.sin(A),c[2]=Math.cos(l)*h,c}function ii(t){return function(t,e){const i=Math.cos(e),r=new Float64Array(3);return r[0]=Math.sin(t)*i,r[1]=Math.sin(e),r[2]=Math.cos(t)*i,r}(t.lng*Math.PI/180,t.lat*Math.PI/180)}function ri(t,e){return t/(2*Math.PI)/Math.cos(e*Math.PI/180)}function si(t){const i=Math.asin(t[1])/Math.PI*180,r=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(r>1e-6){const s=t[0]/r,o=Math.acos(t[2]/r),n=(s>0?o:-o)/Math.PI*180;return new e.S(e.aN(n,-180,180),i)}return new e.S(0,i)}function oi(t){return Math.cos(t*Math.PI/180)}function ni(t,i){const r=oi(t),s=oi(i);return e.aj(s/r)}function ai(t,i){const r=t.rotate(i.bearingInRadians),s=i.zoom+ni(i.center.lat,0),o=e.bj(1/oi(i.center.lat),1/oi(Math.min(Math.abs(i.center.lat),60)),e.bm(s,7,3,0,1)),n=360/ti({worldSize:i.worldSize,center:{lat:i.center.lat}});return new e.S(i.center.lng-r.x*n*o,e.ag(i.center.lat+r.y*n,-85.051129,e.ah))}function li(t){const e=.5*t,i=Math.sin(e),r=Math.cos(e);return Math.log(i+r)-Math.log(r-i)}function Ai(t,i,r,s){const o=t.lat+r*s;if(Math.abs(r)>1){const n=(Math.sign(t.lat+r)!==Math.sign(t.lat)?-Math.abs(t.lat):Math.abs(t.lat))*Math.PI/180,a=Math.abs(t.lat+r)*Math.PI/180,l=li(n+s*(a-n)),A=li(n),h=li(a);return new e.S(t.lng+i*((l-A)/(h-A)),o)}return new e.S(t.lng+i*s,o)}class hi{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=false,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;const t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=false}getTileBoundingVolume(t,e,i,r){const s=`${t.z}_${t.x}_${t.y}_${(null==r?void 0:r.terrain)?"t":""}`,o=this._cache.get(s);if(o)return o;const n=this._cachePrevious.get(s);if(n)return this._cache.set(s,n),n;const a=this._boundingVolumeFactory(t,e,i,r);return this._cache.set(s,a),this._hadAnyChanges=true,a}}class ci{constructor(t,e,i,r){this.min=i,this.max=r,this.points=t,this.planes=e}static fromAabb(t,e){const i=[];for(let r=0;r<8;r++)i.push([1&~r?t[0]:e[0],1==(r>>1&1)?e[1]:t[1],1==(r>>2&1)?e[2]:t[2]]);return new ci(i,[[-1,0,0,e[0]],[1,0,0,-t[0]],[0,-1,0,e[1]],[0,1,0,-t[1]],[0,0,-1,e[2]],[0,0,1,-t[2]]],t,e)}static fromCenterSizeAngles(t,i,r){const s=e.bq([],r[0],r[1],r[2]),o=e.br([],[i[0],0,0],s),n=e.br([],[0,i[1],0],s),a=e.br([],[0,0,i[2]],s),l=[...t],A=[...t];for(let e=0;e<8;e++)for(let i=0;i<3;i++){const r=t[i]+o[i]*(1&~e?-1:1)+n[i]*(1==(e>>1&1)?1:-1)+a[i]*(1==(e>>2&1)?1:-1);l[i]=Math.min(l[i],r),A[i]=Math.max(A[i],r)}const h=[];for(let i=0;i<8;i++){const r=[...t];e.aR(r,r,e.aQ([],o,1&~i?-1:1)),e.aR(r,r,e.aQ([],n,1==(i>>1&1)?1:-1)),e.aR(r,r,e.aQ([],a,1==(i>>2&1)?1:-1)),h.push(r)}return new ci(h,[[...o,-e.aW(o,h[0])],[...n,-e.aW(n,h[0])],[...a,-e.aW(a,h[0])],[-o[0],-o[1],-o[2],-e.aW(o,h[7])],[-n[0],-n[1],-n[2],-e.aW(n,h[7])],[-a[0],-a[1],-a[2],-e.aW(a,h[7])]],l,A)}intersectsFrustum(t){let e=true;const i=this.points.length,r=this.planes.length,s=t.planes.length,o=t.points.length;for(let r=0;r<s;r++){const s=t.planes[r];let o=0;for(let t=0;t<i;t++){const e=this.points[t];s[0]*e[0]+s[1]*e[1]+s[2]*e[2]+s[3]>=0&&o++}if(0===o)return 0;o<i&&(e=false)}if(e)return 2;for(let e=0;e<r;e++){const i=this.planes[e];let r=0;for(let e=0;e<o;e++){const s=t.points[e];i[0]*s[0]+i[1]*s[1]+i[2]*s[2]+i[3]>=0&&r++}if(0===r)return 0}return 1}intersectsPlane(t){const e=this.points.length;let i=0;for(let r=0;r<e;r++){const e=this.points[r];t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0&&i++}return i===e?2:0===i?0:1}}function ui(t,e,i){const r=t-e;return r<0?-r:Math.max(0,r-i)}function fi(t,e,i,r,s){const o=t-i;let n;return n=o<0?Math.min(-o,1+o-s):o>1?Math.min(Math.max(o-s,0),1-o):0,Math.max(n,ui(e,r,s))}class di{constructor(){this._boundingVolumeCache=new hi(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,e,i,r){const s=1<<i.z,o=1/s,n=i.x/s,a=i.y/s;let l=2;return l=Math.min(l,fi(t,e,n,a,o)),l=Math.min(l,fi(t,e,n+.5,-a-o,o)),l=Math.min(l,fi(t,e,n+.5,2-a-o,o)),l}getWrap(t,e,i){const r=1<<e.z,s=1/r,o=e.x/r,n=ui(t.x,o,s),a=ui(t.x,o-1,s),l=ui(t.x,o+1,s),A=Math.min(n,a,l);return A===l?1:A===a?-1:0}allowVariableZoom(t,e){return mt(t,e)>4}allowWorldCopies(){return false}getTileBoundingVolume(t,e,i,r){return this._boundingVolumeCache.getTileBoundingVolume(t,e,i,r)}_computeTileBoundingVolume(t,i,r,s){var o,n;let a=r,l=r;if(null==s?void 0:s.terrain){const A=new e.Z(t.z,i,t.z,t.x,t.y),h=s.terrain.getMinMaxElevation(A);a=null!==(o=h.minElevation)&&void 0!==o?o:r,l=null!==(n=h.maxElevation)&&void 0!==n?n:r}if(a/=e.bt,l/=e.bt,a+=1,l+=1,t.z<=0)return ci.fromAabb([-l,-l,-l],[l,l,l]);if(1===t.z)return ci.fromAabb([0===t.x?-l:0,0===t.y?0:-l,-l],[0===t.x?0:l,0===t.y?l:0,l]);{const i=[ei(0,0,t.x,t.y,t.z),ei(e.$,0,t.x,t.y,t.z),ei(e.$,e.$,t.x,t.y,t.z),ei(0,e.$,t.x,t.y,t.z)],r=[];for(const t of i)r.push(e.aQ([],t,l));if(l!==a)for(const t of i)r.push(e.aQ([],t,a));0===t.y&&r.push([0,1,0]),t.y===(1<<t.z)-1&&r.push([0,-1,0]);const s=[1,1,1],o=[-1,-1,-1];for(const t of r)for(let e=0;e<3;e++)s[e]=Math.min(s[e],t[e]),o[e]=Math.max(o[e],t[e]);const n=ei(e.$/2,e.$/2,t.x,t.y,t.z),A=e.aV([],[0,1,0],n);e.aU(A,A);const h=e.aV([],n,A);e.aU(h,h);const c=e.aV([],i[2],i[1]);e.aU(c,c);const u=e.aV([],i[0],i[3]);e.aU(u,u),r.push(e.aQ([],n,l)),t.y>=(1<<t.z)/2&&r.push(e.aQ([],ei(e.$/2,0,t.x,t.y,t.z),l)),t.y<(1<<t.z)/2&&r.push(e.aQ([],ei(e.$/2,e.$,t.x,t.y,t.z),l));const f=gi(n,r),d=gi(h,r),g=[-n[0],-n[1],-n[2],f.max],p=[n[0],n[1],n[2],-f.min],m=[-h[0],-h[1],-h[2],d.max],w=[h[0],h[1],h[2],-d.min],I=[...c,0],v=[...u,0],b=[];return 0===t.y?b.push(e.bs(v,I,g),e.bs(v,I,p)):b.push(e.bs(m,I,g),e.bs(m,I,p),e.bs(m,v,g),e.bs(m,v,p)),t.y===(1<<t.z)-1?b.push(e.bs(v,I,g),e.bs(v,I,p)):b.push(e.bs(w,I,g),e.bs(w,I,p),e.bs(w,v,g),e.bs(w,v,p)),new ci(b,[g,p,m,w,I,v],s,o)}}}function gi(t,i){let r=1/0,s=-1/0;for(const o of i){const i=e.aW(t,o);r=Math.min(r,i),s=Math.max(s,i)}return{min:r,max:s}}class pi{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e){this._helper.resize(t,e)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(){this._cachedClippingPlane=e.bu(),this._projectionMatrix=e.b8(),this._globeViewProjMatrix32f=e.b7(),this._globeViewProjMatrixNoCorrection=e.b8(),this._globeViewProjMatrixNoCorrectionInverted=e.b8(),this._globeProjMatrixInverted=e.b8(),this._cameraPosition=e.bo(),this._globeLatitudeErrorCorrectionRadians=0,this._helper=new ke({calcMatrices:()=>{this._calcMatrices()},getConstrained:(t,e)=>this.getConstrained(t,e)}),this._coveringTilesDetailsProvider=new di}clone(){const t=new pi;return t.apply(this),t}apply(t,e){this._globeLatitudeErrorCorrectionRadians=e||0,this._helper.apply(t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const t=e.bo();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){const{overscaledTileID:e,applyGlobeMatrix:i}=t,r=this._helper.getMercatorTileCoordinates(e);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:i?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){const i=this.pitchInRadians,r=this.cameraToCenterDistance/t,s=Math.sin(i)*r,o=Math.cos(i)*r+1,n=1/Math.sqrt(s*s+o*o)*1;let a=-s,l=o;const A=Math.sqrt(a*a+l*l);a/=A,l/=A;const h=[0,a,l];e.bv(h,h,[0,0,0],-this.bearingInRadians),e.bw(h,h,[0,0,0],-1*this.center.lat*Math.PI/180),e.bx(h,h,[0,0,0],this.center.lng*Math.PI/180);const c=1/e.aY(h);return e.aQ(h,h,c),[...h,-n*c]}isLocationOccluded(t){return!this.isSurfacePointVisible(ii(t))}transformLightDirection(t){const i=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,s=Math.cos(r),o=[Math.sin(i)*s,Math.sin(r),Math.cos(i)*s],n=[o[2],0,-o[0]],a=[0,0,0];e.aV(a,n,o),e.aU(n,n),e.aU(a,a);const l=[0,0,0];return e.aU(l,[n[0]*t[0]+a[0]*t[1]+o[0]*t[2],n[1]*t[0]+a[1]*t[1]+o[1]*t[2],n[2]*t[0]+a[2]*t[1]+o[2]*t[2]]),l}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,i,r){const s=function(t,i,r){const s=1/(1<<r.z);return new e.a0(t/e.$*s+r.x*s,i/e.$*s+r.y*s)}(t,i,r.canonical),o=(n=s.y,[e.bn(s.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI]);var n;return this.getCircleRadiusCorrection()/Math.cos(o[1])}projectTileCoordinates(t,i,r,s){const o=r.canonical,n=ei(t,i,o.x,o.y,o.z),a=1+(s?s(t,i):0)/e.bt,l=[n[0]*a,n[1]*a,n[2]*a,1];e.av(l,l,this._globeViewProjMatrixNoCorrection);const A=this._cachedClippingPlane,h=A[0]*n[0]+A[1]*n[1]+A[2]*n[2]+A[3]<0;return{point:new e.P(l[0]/l[3],l[1]/l[3]),signedDistanceFromCamera:l[3],isOccluded:h}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const t=ri(this.worldSize,this.center.lat),i=e.b9(),r=e.b9();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),e.b3(i,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const s=this.centerOffset;i[8]=2*-s.x/this._helper._width,i[9]=2*s.y/this._helper._height,this._projectionMatrix=e.b4(i),this._globeProjMatrixInverted=e.b9(),e.ap(this._globeProjMatrixInverted,i),e.M(i,i,[0,0,-this.cameraToCenterDistance]),e.b5(i,i,this.rollInRadians),e.b6(i,i,-this.pitchInRadians),e.b5(i,i,this.bearingInRadians),e.M(i,i,[0,0,-t]);const o=e.bo();o[0]=t,o[1]=t,o[2]=t,e.b6(r,i,this.center.lat*Math.PI/180),e.by(r,r,-this.center.lng*Math.PI/180),e.N(r,r,o),this._globeViewProjMatrixNoCorrection=r,e.b6(i,i,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),e.by(i,i,-this.center.lng*Math.PI/180),e.N(i,i,o),this._globeViewProjMatrix32f=new Float32Array(i),this._globeViewProjMatrixNoCorrectionInverted=e.b9(),e.ap(this._globeViewProjMatrixNoCorrectionInverted,r);const n=e.bo();this._cameraPosition=e.bo(),this._cameraPosition[2]=this.cameraToCenterDistance/t,e.bv(this._cameraPosition,this._cameraPosition,n,-this.rollInRadians),e.bw(this._cameraPosition,this._cameraPosition,n,this.pitchInRadians),e.bv(this._cameraPosition,this._cameraPosition,n,-this.bearingInRadians),e.aR(this._cameraPosition,this._cameraPosition,[0,0,1]),e.bw(this._cameraPosition,this._cameraPosition,n,-this.center.lat*Math.PI/180),e.bx(this._cameraPosition,this._cameraPosition,n,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);const a=e.b4(this._globeViewProjMatrixNoCorrectionInverted);e.N(a,a,[1,1,-1]),this._cachedFrustum=Ge.fromInvProjectionMatrix(a,1,0,this._cachedClippingPlane,true)}calculateFogMatrix(t){e.w("calculateFogMatrix is not supported on globe projection.");const i=e.b9();return e.af(i),i}getVisibleUnwrappedCoordinates(t){return[new e.b1(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&e.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,i){if(!this._globeViewProjMatrixNoCorrection)return 1;const r=ii(t);e.aQ(r,r,1+i/e.bt);const s=e.bu();return e.av(s,[r[0],r[1],r[2],1],this._globeViewProjMatrixNoCorrection),s[2]/s[3]}populateCache(t){}getBounds(){const t=.5*this.width,i=.5*this.height,r=[new e.P(0,0),new e.P(t,0),new e.P(this.width,0),new e.P(this.width,i),new e.P(this.width,this.height),new e.P(t,this.height),new e.P(0,this.height),new e.P(0,i)],s=[];for(const t of r)s.push(this.unprojectScreenPoint(t));let o=0,n=0,a=0,l=0;const A=this.center;for(const t of s){const i=e.bz(A.lng,t.lng),r=e.bz(A.lat,t.lat);i<n&&(n=i),i>o&&(o=i),r<l&&(l=r),r>a&&(a=r)}const h=[A.lng+n,A.lat+l,A.lng+o,A.lat+a];return this.isSurfacePointOnScreen([0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new O(h)}getConstrained(t,i){const r=e.ag(t.lat,-85.051129,e.ah),s=e.ag(+i,this.minZoom+ni(0,r),this.maxZoom);return{center:new e.S(t.lng,r),zoom:s}}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}setLocationAtPoint(t,i){const r=ii(this.unprojectScreenPoint(i)),s=ii(t),o=e.bo();e.bA(o);const n=e.bo();e.bx(n,r,o,-this.center.lng*Math.PI/180),e.bw(n,n,o,this.center.lat*Math.PI/180);const a=s[0]*s[0]+s[2]*s[2],l=n[0]*n[0];if(a<l)return;const A=Math.sqrt(a-l),h=-A,c=e.bB(s[0],s[2],n[0],A),u=e.bB(s[0],s[2],n[0],h),f=e.bo();e.bx(f,s,o,-c);const d=e.bB(f[1],f[2],n[1],n[2]),g=e.bo();e.bx(g,s,o,-u);const p=e.bB(g[1],g[2],n[1],n[2]),m=.5*Math.PI,w=d>=-m&&d<=m,I=p>=-m&&p<=m;let v,b;if(w&&I){const t=this.center.lng*Math.PI/180,i=this.center.lat*Math.PI/180;e.bC(c,t)+e.bC(d,i)<e.bC(u,t)+e.bC(p,i)?(v=c,b=d):(v=u,b=p)}else if(w)v=c,b=d;else{if(!I)return;v=u,b=p}const y=v/Math.PI*180,B=b/Math.PI*180,C=this.center.lat;this.setCenter(new e.S(y,e.ag(B,-90,90))),this.setZoom(this.zoom+ni(C,this.center.lat))}locationToScreenPoint(t,i){const r=ii(t);if(i){const s=i.getElevationForLngLatZoom(t,this._helper._tileZoom);e.aQ(r,r,1+s/e.bt)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(t){const i=e.bu();return e.av(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],new e.P((.5*i[0]+.5)*this.width,(.5*-i[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,i){if(i){const e=i.pointCoordinate(t);if(e)return e}return e.a0.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,e){var i;return null===(i=this.screenPointToMercatorCoordinate(t,e))||void 0===i?void 0:i.toLngLat()}isPointOnMapSurface(t,e){const i=this._cameraPosition,r=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(i,r)}getRayDirectionFromPixel(t){const i=e.bu();i[0]=t.x/this.width*2-1,i[1]=-1*(t.y/this.height*2-1),i[2]=1,i[3]=1,e.av(i,i,this._globeViewProjMatrixNoCorrectionInverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];const r=e.bo();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];const s=e.bo();return e.aU(s,r),s}isSurfacePointVisible(t){const e=this._cachedClippingPlane;return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return false;const i=e.bu();return e.av(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3],i[0]>-1&&i[0]<1&&i[1]>-1&&i[1]<1&&i[2]>-1&&i[2]<1}rayPlanetIntersection(t,i){const r=e.aW(t,i),s=e.bo(),o=e.bo();e.aQ(o,i,r),e.aT(s,t,o);const n=1-e.aW(s,s);if(n<0)return null;const a=e.aW(t,t)-1,l=-r+(r<0?1:-1)*Math.sqrt(n),A=a/l,h=l;return{tMin:Math.min(A,h),tMax:Math.max(A,h)}}unprojectScreenPoint(t){const i=this._cameraPosition,r=this.getRayDirectionFromPixel(t),s=this.rayPlanetIntersection(i,r);if(s){const t=e.bo();e.aR(t,i,[r[0]*s.tMin,r[1]*s.tMin,r[2]*s.tMin]);const o=e.bo();return e.aU(o,t),si(o)}const o=this._cachedClippingPlane,n=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=-e.b0(o,i)/n,l=e.bo();if(a>0)e.aR(l,i,[r[0]*a,r[1]*a,r[2]*a]);else{const t=e.bo();e.aR(t,i,[2*r[0],2*r[1],2*r[2]]);const s=e.b0(this._cachedClippingPlane,t);e.aT(l,t,[this._cachedClippingPlane[0]*s,this._cachedClippingPlane[1]*s,this._cachedClippingPlane[2]*s])}const A=function(t){const i=e.bo();return i[0]=t[0]*-t[3],i[1]=t[1]*-t[3],i[2]=t[2]*-t[3],{center:i,radius:Math.sqrt(1-t[3]*t[3])}}(o);return si(function(t,i,r){const s=e.bo();e.aT(s,r,t);const o=e.bo();return e.bp(o,t,s,i/e.a_(s)),o}(A.center,A.radius,l))}getMatrixForModel(t,i){const r=e.S.convert(t),s=1/e.bt,o=e.b8();return e.by(o,o,r.lng/180*Math.PI),e.b6(o,o,-r.lat/180*Math.PI),e.M(o,o,[0,0,1+i/e.bt]),e.b6(o,o,.5*Math.PI),e.N(o,o,[s,s,s]),o}getProjectionDataForCustomLayer(t=true){const i=this.getProjectionData({overscaledTileID:new e.Z(0,0,0,0,0),applyGlobeMatrix:t});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(t){}}class mi{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e,i=true){this._helper.resize(t,e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,e){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this._helper=new ke({calcMatrices:()=>{this._calcMatrices()},getConstrained:(t,e)=>this.getConstrained(t,e)}),this._globeness=1,this._mercatorTransform=new Fe,this._verticalPerspectiveTransform=new pi}clone(){const t=new mi;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this),t}apply(t){this._helper.apply(t),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){const e=this._mercatorTransform.getProjectionData(t),i=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:e.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:e.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return e.bj(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return e.bj(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,i,r){const s=this._mercatorTransform.getPitchedTextCorrection(t,i,r),o=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,i,r);return e.bj(s,o,this._globeness)}projectTileCoordinates(t,e,i,r){return this.currentTransform.projectTileCoordinates(t,e,i,r)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,true,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,e){return this.currentTransform.lngLatToCameraDepth(t,e)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}getConstrained(t,e){return this.currentTransform.getConstrained(t,e)}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}setLocationAtPoint(t,e){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,e),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(t,e),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(t,e){return this.currentTransform.locationToScreenPoint(t,e)}screenPointToMercatorCoordinate(t,e){return this.currentTransform.screenPointToMercatorCoordinate(t,e)}screenPointToLocation(t,e){return this.currentTransform.screenPointToLocation(t,e)}isPointOnMapSurface(t,e){return this.currentTransform.isPointOnMapSurface(t,e)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,e){return this.currentTransform.getMatrixForModel(t,e)}getProjectionDataForCustomLayer(t=true){const e=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return e;const i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return i.fallbackMatrix=e.mainMatrix,i}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class wi{get useGlobeControls(){return true}handlePanInertia(t,i){const r=ai(t,i);return Math.abs(r.lng-i.center.lng)>180&&(r.lng=i.center.lng+179.5*Math.sign(r.lng-i.center.lng)),{easingCenter:r,easingOffset:new e.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,i){const r=t.around,s=i.screenPointToLocation(r);t.bearingDelta&&i.setBearing(i.bearing+t.bearingDelta),t.pitchDelta&&i.setPitch(i.pitch+t.pitchDelta),t.rollDelta&&i.setRoll(i.roll+t.rollDelta);const o=i.zoom;t.zoomDelta&&i.setZoom(i.zoom+t.zoomDelta);const n=i.zoom-o;if(0===n)return;const a=e.bz(i.center.lng,s.lng),l=a/(Math.abs(a/180)+1),A=e.bz(i.center.lat,s.lat),h=i.getRayDirectionFromPixel(r),c=i.cameraPosition,u=-1*e.aW(c,h),f=e.bo();e.aR(f,c,[h[0]*u,h[1]*u,h[2]*u]);const d=e.aY(f)-1,g=Math.exp(.5*-Math.max(d-.3,0)),p=ri(i.worldSize,i.center.lat)/Math.min(i.width,i.height),m=e.bm(p,.9,.5,1,.25),w=(1-e.ae(-n))*Math.min(g,m),I=i.center.lat,v=i.zoom,b=new e.S(i.center.lng+l*w,e.ag(i.center.lat+A*w,-85.051129,e.ah));i.setLocationAtPoint(s,r);const y=i.center,B=e.bm(Math.abs(a),45,85,0,1),C=e.bm(p,.75,.35,0,1),E=Math.pow(Math.max(B,C),.25),_=e.bz(y.lng,b.lng),Q=e.bz(y.lat,b.lat);i.setCenter(new e.S(y.lng+_*E,y.lat+Q*E).wrap()),i.setZoom(v+ni(I,i.center.lat))}handleMapControlsPan(t,e,i){if(!t.panDelta)return;const r=e.center.lat,s=e.zoom;e.setCenter(ai(t.panDelta,e).wrap()),e.setZoom(s+ni(r,e.center.lat))}cameraForBoxAndBearing(t,i,r,s,o){const n=ze(t,i,r,s,o),a=i.left/o.width*2-1,l=(o.width-i.right)/o.width*2-1,A=i.top/o.height*-2+1,h=(o.height-i.bottom)/o.height*-2+1,c=e.bz(r.getWest(),r.getEast())<0,u=c?r.getEast():r.getWest(),f=c?r.getWest():r.getEast(),d=Math.max(r.getNorth(),r.getSouth()),g=Math.min(r.getNorth(),r.getSouth()),p=u+.5*e.bz(u,f),m=d+.5*e.bz(d,g),w=o.clone();w.setCenter(n.center),w.setBearing(n.bearing),w.setPitch(0),w.setRoll(0),w.setZoom(n.zoom);const I=w.modelViewProjectionMatrix,v=[ii(r.getNorthWest()),ii(r.getNorthEast()),ii(r.getSouthWest()),ii(r.getSouthEast()),ii(new e.S(f,m)),ii(new e.S(u,m)),ii(new e.S(p,d)),ii(new e.S(p,g))],b=ii(n.center);let y=Number.POSITIVE_INFINITY;for(const t of v)a<0&&(y=wi.getLesserNonNegativeNonNull(y,wi.solveVectorScale(t,b,I,"x",a))),l>0&&(y=wi.getLesserNonNegativeNonNull(y,wi.solveVectorScale(t,b,I,"x",l))),A>0&&(y=wi.getLesserNonNegativeNonNull(y,wi.solveVectorScale(t,b,I,"y",A))),h<0&&(y=wi.getLesserNonNegativeNonNull(y,wi.solveVectorScale(t,b,I,"y",h)));if(Number.isFinite(y)&&0!==y)return n.zoom=w.zoom+e.aj(y),n;Re()}handleJumpToCenterZoom(t,i){const r=t.center.lat,s=t.getConstrained(i.center?e.S.convert(i.center):t.center,t.zoom).center;t.setCenter(s.wrap());const o=void 0!==i.zoom?+i.zoom:t.zoom+ni(r,s.lat);t.zoom!==o&&t.setZoom(o)}handleEaseTo(t,i){const r=t.zoom,s=t.center,o=t.padding,n={roll:t.roll,pitch:t.pitch,bearing:t.bearing},a={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},l=void 0!==i.zoom,A=!t.isPaddingEqual(i.padding);let h=false;const c=i.center?e.S.convert(i.center):s,u=t.getConstrained(c,r).center;xe(t,u);const f=t.clone();f.setCenter(u),f.setZoom(l?+i.zoom:r+ni(s.lat,c.lat)),f.setBearing(i.bearing);const d=new e.P(e.ag(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),e.ag(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));f.setLocationAtPoint(u,d);const g=(i.offset&&i.offsetAsPoint.mag())>0?f.center:u,p=l?+i.zoom:r+ni(s.lat,g.lat),m=r+ni(s.lat,0),w=p+ni(g.lat,0),I=e.bz(s.lng,g.lng),v=e.bz(s.lat,g.lat),b=e.ae(w-m);return h=p!==r,{easeFunc:r=>{if(e.bd(n,a)||Le({startEulerAngles:n,endEulerAngles:a,tr:t,k:r,useSlerp:n.roll!=a.roll}),A&&t.interpolatePadding(o,i.padding,r),i.around)e.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(i.around,i.aroundPoint);else{const e=w>m?Math.min(2,b):Math.max(.5,b),i=Math.pow(e,1-r),o=Ai(s,I,v,r*i);t.setCenter(o.wrap())}if(h){const i=e.C.number(m,w,r)+ni(0,t.center.lat);t.setZoom(i)}},isZooming:h,elevationCenter:g}}handleFlyTo(t,i){const r=void 0!==i.zoom,s=t.center,o=t.zoom,n=t.padding,a=!t.isPaddingEqual(i.padding),l=t.getConstrained(e.S.convert(i.center||i.locationAtOffset),o).center,A=r?+i.zoom:t.zoom+ni(t.center.lat,l.lat),h=t.clone();h.setCenter(l),h.setZoom(A),h.setBearing(i.bearing);const c=new e.P(e.ag(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),e.ag(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));h.setLocationAtPoint(l,c);const u=h.center;xe(t,u);const f=function(t,i,r){const s=ii(i),o=ii(r),n=e.aW(s,o),a=Math.acos(n),l=ti(t);return a/(2*Math.PI)*l}(t,s,u),d=o+ni(s.lat,0),g=A+ni(u.lat,0),p=e.ae(g-d);let m;if("number"==typeof i.minZoom){const r=+i.minZoom+ni(u.lat,0),s=Math.min(r,d,g)+ni(0,u.lat),o=t.getConstrained(u,s).zoom+ni(u.lat,0);m=e.ae(o-d)}const w=e.bz(s.lng,u.lng),I=e.bz(s.lat,u.lat);return{easeFunc:(r,o,l,h)=>{const c=Ai(s,w,I,l);a&&t.interpolatePadding(n,i.padding,r);const f=1===r?u:c;t.setCenter(f.wrap());const g=d+e.aj(o);t.setZoom(1===r?A:g+ni(0,f.lat))},scaleOfZoom:p,targetCenter:u,scaleOfMinZoom:m,pixelPathLength:f}}static solveVectorScale(t,e,i,r,s){const o="x"===r?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],n=[i[3],i[7],i[11],i[15]],a=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],l=t[0]*n[0]+t[1]*n[1]+t[2]*n[2],A=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],h=e[0]*n[0]+e[1]*n[1]+e[2]*n[2];return A+s*l===a+s*h||n[3]*(a-A)+o[3]*(h-l)+a*h==A*l?null:(A+o[3]-s*h-s*n[3])/(A-a-s*h+s*l)}static getLesserNonNegativeNonNull(t,e){return null!==e&&e>=0&&e<t?e:t}}class Ii{constructor(t){this._globe=t,this._mercatorCameraHelper=new Ue,this._verticalPerspectiveCameraHelper=new wi}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,e){return this.currentHelper.handlePanInertia(t,e)}handleMapControlsRollPitchBearingZoom(t,e){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,e)}handleMapControlsPan(t,e,i){this.currentHelper.handleMapControlsPan(t,e,i)}cameraForBoxAndBearing(t,e,i,r,s){return this.currentHelper.cameraForBoxAndBearing(t,e,i,r,s)}handleJumpToCenterZoom(t,e){this.currentHelper.handleJumpToCenterZoom(t,e)}handleEaseTo(t,e){return this.currentHelper.handleEaseTo(t,e)}handleFlyTo(t,e){return this.currentHelper.handleFlyTo(t,e)}}const vi=(t,i)=>e.y(t,i&&i.filter((t=>"source.canvas"!==t.identifier))),bi=e.bD();class yi extends e.E{constructor(t,i={}){super(),this._rtlPluginLoaded=()=>{for(const t in this.sourceCaches){const e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new L(R(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.imageManager=new I,this.imageManager.setEventedParent(this),this.glyphManager=new B(t._requestManager,i.localIdeographFontFamily),this.lineAtlas=new M(256,512),this.crossTileSymbolIndex=new we,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.bE,this._loaded=false,this._availableImages=[],this._globalState={},this._resetUpdates(),this.dispatcher.broadcast("SR",e.bF()),rt().on(tt,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const i=e.getSource();if(i&&i.vectorLayerIds)for(const t in this._layers){const e=this._layers[t];e.source===i.id&&this._validateLayer(e)}}))}setGlobalStateProperty(t,i){var r,s,o;this._checkLoaded();const n=null===i?null!==(o=null===(s=null===(r=this.stylesheet.state)||void 0===r?void 0:r[t])||void 0===s?void 0:s.default)&&void 0!==o?o:null:i;if(e.bG(n,this._globalState[t]))return this;this._globalState[t]=n;const a=this._findGlobalStateAffectedSources([t]);for(const t in this.sourceCaches)a.has(t)&&(this._reloadSource(t),this._changed=true)}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();const i=[];for(const r in t)!e.bG(this._globalState[r],t[r].default)&&(i.push(r),this._globalState[r]=t[r].default);const r=this._findGlobalStateAffectedSources(i);for(const t in this.sourceCaches)r.has(t)&&(this._reloadSource(t),this._changed=true)}_findGlobalStateAffectedSources(t){if(0===t.length)return new Set;const e=new Set;for(const i in this._layers){const r=this._layers[i],s=r.getLayoutAffectingGlobalStateRefs();for(const i of t)s.has(i)&&e.add(r.source)}return e}loadURL(t,i={},r){this.fire(new e.l("dataloading",{dataType:"style"})),i.validate="boolean"!=typeof i.validate||i.validate;const s=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const o=this._loadStyleRequest;e.j(s,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,i,r)})).catch((t=>{this._loadStyleRequest=null,t&&!o.signal.aborted&&this.fire(new e.k(t))}))}loadJSON(t,i={},r){this.fire(new e.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,n.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,i.validate=false!==i.validate,this._load(t,i,r)})).catch((()=>{}))}loadEmpty(){this.fire(new e.l("dataloading",{dataType:"style"})),this._load(bi,{validate:false})}_load(t,i,r){var s,o,n;const a=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!vi(this,e.z(a))){this._loaded=true,this.stylesheet=a;for(const t in a.sources)this.addSource(t,a.sources[t],{validate:false});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(true),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new _(this.stylesheet.light),this._setProjectionInternal((null===(s=this.stylesheet.projection)||void 0===s?void 0:s.type)||"mercator"),this.sky=new x(this.stylesheet.sky),this.map.setTerrain(null!==(o=this.stylesheet.terrain)&&void 0!==o?o:null),this.setGlobalState(null!==(n=this.stylesheet.state)&&void 0!==n?n:null),this.fire(new e.l("data",{dataType:"style"})),this.fire(new e.l("style.load"))}}_createLayers(){const t=e.bH(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(const i of t){const t=e.bI(i);t.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=t}}_loadSprite(t,i=false,r=void 0){let s;this.imageManager.setLoaded(false),this._spriteRequest=new AbortController,function(t,i,r,s){return e._(this,void 0,void 0,(function*(){const o=p(t),a=r>1?"@2x":"",l={},A={};for(const{id:t,url:r}of o){const o=i.transformRequest(m(r,a,".json"),"SpriteJSON");l[t]=e.j(o,s);const n=i.transformRequest(m(r,a,".png"),"SpriteImage");A[t]=d.getImage(n,s)}return yield Promise.all([...Object.values(l),...Object.values(A)]),function(t,i){return e._(this,void 0,void 0,(function*(){const e={};for(const r in t){e[r]={};const s=n.getImageCanvasContext((yield i[r]).data),o=(yield t[r]).data;for(const t in o){const{width:i,height:n,x:a,y:l,sdf:A,pixelRatio:h,stretchX:c,stretchY:u,content:f,textFitWidth:d,textFitHeight:g}=o[t];e[r][t]={data:null,pixelRatio:h,sdf:A,stretchX:c,stretchY:u,content:f,textFitWidth:d,textFitHeight:g,spriteData:{width:i,height:n,x:a,y:l,context:s}}}}return e}))}(l,A)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const r=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(const t of r)this.imageManager.removeImage(t),this._changedImages[t]=true;for(const r in t[e]){const s="default"===e?r:`${e}:${r}`;this._spritesImagesIds[e].push(s),s in this.imageManager.images?this.imageManager.updateImage(s,t[e][r],false):this.imageManager.addImage(s,t[e][r]),i&&(this._changedImages[s]=true)}}})).catch((t=>{this._spriteRequest=null,s=t,this.fire(new e.k(s))})).finally((()=>{this.imageManager.setLoaded(true),this._availableImages=this.imageManager.listImages(),i&&(this._changed=true),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"})),r&&r(s)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=true;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=true,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}_validateLayer(t){const i=this.sourceCaches[t.source];if(!i)return;const r=t.sourceLayer;if(!r)return;const s=i.getSource();("geojson"===s.type||s.vectorLayerIds&&-1===s.vectorLayerIds.indexOf(r))&&this.fire(new e.k(new Error(`Source layer "${r}" does not exist on source "${s.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return false;if(Object.keys(this._updatedSources).length)return false;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return false;return!!this.imageManager.isLoaded()}_serializeByIds(t,i=false){const r=this._serializedAllLayers();if(!t||0===t.length)return Object.values(i?e.bJ(r):r);const s=[];for(const o of t)if(r[o]){const t=i?e.bJ(r[o]):r[o];s.push(t)}return s}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const i of e){const e=this._layers[i];"custom"!==e.type&&(t[i]=e.serialize())}return t}hasTransitions(){var t,e,i;if(null===(t=this.light)||void 0===t?void 0:t.hasTransition())return true;if(null===(e=this.sky)||void 0===e?void 0:e.hasTransition())return true;if(null===(i=this.projection)||void 0===i?void 0:i.hasTransition())return true;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return true;for(const t in this._layers)if(this._layers[t].hasTransition())return true;return false}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const i=this._changed;if(i){const e=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(e.length||i.length)&&this._updateWorkerLayers(e,i);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const r={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];r[t]=e.used,e.used=false}for(const e of this._order){const i=this._layers[e];i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)&&i.source&&(this.sourceCaches[i.source].used=true)}for(const t in r){const i=this.sourceCaches[t];!!r[t]!=!!i.used&&i.fire(new e.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,i&&this.fire(new e.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=false}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,false),removedIds:e})}_resetUpdates(){this._changed=false,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=false}setState(t,i={}){var r;this._checkLoaded();const s=this.serialize();if(t=i.transformStyle?i.transformStyle(s,t):t,(null===(r=i.validate)||void 0===r||r)&&vi(this,e.z(t)))return false;(t=e.bJ(t)).layers=e.bH(t.layers);const o=e.bK(s,t),n=this._getOperationsToPerform(o);if(n.unimplemented.length>0)throw new Error(`Unimplemented: ${n.unimplemented.join(", ")}.`);if(0===n.operations.length)return false;for(const t of n.operations)t();return this.stylesheet=t,this._serializedLayers=null,true}_getOperationsToPerform(t){const e=[],i=[];for(const r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,r.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,r.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,r.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,r.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,r.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,r.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,r.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,r.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,r.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,r.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,r.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,r.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,r.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,r.args)));break;case"setProjection":this.setProjection.apply(this,r.args);break;case"setGlobalState":e.push((()=>this.setGlobalState.apply(this,r.args)));break;case"setTransition":e.push((()=>{}));break;default:i.push(r.command)}return{operations:e,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new e.k(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.k(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=true,this._changed=true,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i,r={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(e.z.source,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=true);const s=this.sourceCaches[t]=new vt(t,i,this.dispatcher);s.style=this,s.setEventedParent(this,(()=>({isSourceLoaded:s.loaded(),source:s.serialize(),sourceId:t}))),s.onAdd(this.map),this._changed=true}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.k(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));const i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new e.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=true}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const i=this.sourceCaches[t].getSource();if("geojson"!==i.type)throw new Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(e),this._changed=true}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,i,r={}){this._checkLoaded();const s=t.id;if(this.getLayer(s))return void this.fire(new e.k(new Error(`Layer "${s}" already exists on this map.`)));let o;if("custom"===t.type){if(vi(this,e.bL(t)))return;o=e.bI(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(s,t.source),t=e.bJ(t),t=e.e(t,{source:s})),this._validate(e.z.layer,`layers.${s}`,t,{arrayIndex:-1},r))return;o=e.bI(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:s}})}const n=i?this._order.indexOf(i):this._order.length;if(i&&-1===n)this.fire(new e.k(new Error(`Cannot add layer "${s}" before non-existing layer "${i}".`)));else{if(this._order.splice(n,0,s),this._layerOrderChanged=true,this._layers[s]=o,this._removedLayers[s]&&o.source&&"custom"!==o.type){const t=this._removedLayers[s];delete this._removedLayers[s],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}moveLayer(t,i){if(this._checkLoaded(),this._changed=true,!this._layers[t])return void this.fire(new e.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);const s=i?this._order.indexOf(i):this._order.length;i&&-1===s?this.fire(new e.k(new Error(`Cannot move layer "${t}" before non-existing layer "${i}".`))):(this._order.splice(s,0,t),this._layerOrderChanged=true)}removeLayer(t){this._checkLoaded();const i=this._layers[t];if(!i)return void this.fire(new e.k(new Error(`Cannot remove non-existing layer "${t}".`)));i.setEventedParent(null);const r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=true,this._changed=true,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,r){this._checkLoaded();const s=this.getLayer(t);s?s.minzoom===i&&s.maxzoom===r||(null!=i&&(s.minzoom=i),null!=r&&(s.maxzoom=r),this._updateLayer(s)):this.fire(new e.k(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,i,r={}){this._checkLoaded();const s=this.getLayer(t);if(s){if(!e.bG(s.filter,i))return null==i?(s.setFilter(void 0),void this._updateLayer(s)):void(this._validate(e.z.filter,`layers.${s.id}.filter`,i,null,r)||(s.setFilter(e.bJ(i)),this._updateLayer(s)))}else this.fire(new e.k(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.bJ(this.getLayer(t).filter)}setLayoutProperty(t,i,r,s={}){this._checkLoaded();const o=this.getLayer(t);o?e.bG(o.getLayoutProperty(i),r)||(o.setLayoutProperty(i,r,s),this._updateLayer(o)):this.fire(new e.k(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,i){const r=this.getLayer(t);if(r)return r.getLayoutProperty(i);this.fire(new e.k(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,i,r,s={}){this._checkLoaded();const o=this.getLayer(t);o?e.bG(o.getPaintProperty(i),r)||(o.setPaintProperty(i,r,s)&&this._updateLayer(o),this._changed=true,this._updatedPaintProps[t]=true,this._serializedLayers=null):this.fire(new e.k(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,i){this._checkLoaded();const r=t.source,s=t.sourceLayer,o=this.sourceCaches[r];if(void 0===o)return void this.fire(new e.k(new Error(`The source '${r}' does not exist in the map's style.`)));const n=o.getSource().type;"geojson"===n&&s?this.fire(new e.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==n||s?(void 0===t.id&&this.fire(new e.k(new Error("The feature id parameter must be provided."))),o.setFeatureState(s,t.id,i)):this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,i){this._checkLoaded();const r=t.source,s=this.sourceCaches[r];if(void 0===s)return void this.fire(new e.k(new Error(`The source '${r}' does not exist in the map's style.`)));const o=s.getSource().type,n="vector"===o?t.sourceLayer:void 0;"vector"!==o||n?i&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.k(new Error("A feature id is required to remove its specific state property."))):s.removeFeatureState(n,t.id,i):this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const i=t.source,r=t.sourceLayer,s=this.sourceCaches[i];if(void 0!==s)return"vector"!==s.getSource().type||r?(void 0===t.id&&this.fire(new e.k(new Error("The feature id parameter must be provided."))),s.getFeatureState(r,t.id)):void this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.k(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.bM(this.sourceCaches,(t=>t.serialize())),i=this._serializeByIds(this._order,true),r=this.map.getTerrain()||void 0,s=this.stylesheet;return e.bN({version:s.version,name:s.name,metadata:s.metadata,light:s.light,sky:s.sky,center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,sprite:s.sprite,glyphs:s.glyphs,transition:s.transition,projection:s.projection,sources:t,layers:i,terrain:r},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=true,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=true}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},r=[];for(let s=this._order.length-1;s>=0;s--){const o=this._order[s];if(e(o)){i[o]=s;for(const e of t){const t=e[o];if(t)for(const e of t)r.push(e)}}}r.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const s=[];for(let o=this._order.length-1;o>=0;o--){const n=this._order[o];if(e(n))for(let t=r.length-1;t>=0;t--){const e=r[t].feature;if(i[e.layer.id]<o)break;s.push(e),r.pop()}else for(const e of t){const t=e[n];if(t)for(const e of t)s.push(e.feature)}}return s}queryRenderedFeatures(t,i,r){i&&i.filter&&this._validate(e.z.filter,"queryRenderedFeatures.filter",i.filter,null,i);const s={};if(i&&i.layers){if(!(Array.isArray(i.layers)||i.layers instanceof Set))return this.fire(new e.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];s[i.source]=true}}const o=[];i.availableImages=this._availableImages;const n=this._serializedAllLayers(),a=i.layers instanceof Set?i.layers:Array.isArray(i.layers)?new Set(i.layers):null,l=Object.assign(Object.assign({},i),{layers:a});for(const e in this.sourceCaches)i.layers&&!s[e]||o.push(P(this.sourceCaches[e],this._layers,n,t,l,r,this.map.terrain?(t,e,i)=>this.map.terrain.getElevation(t,e,i):void 0));return this.placement&&o.push(function(t,e,i,r,s,o,n){const a={},l=o.queryRenderedSymbols(r),A=[];for(const t of Object.keys(l).map(Number))A.push(n[t]);A.sort(N);for(const i of A){const r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,s.filter,s.layers,s.availableImages,t);for(const t in r){const e=a[t]=a[t]||[],s=r[t];s.sort(((t,e)=>{const r=i.featureSortOrder;if(r){const i=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(const t of s)e.push(t)}}return function(t,e,i){for(const r in t)for(const s of t[r])T(s,i[e[r].source]);return t}(a,t,i)}(this._layers,n,this.sourceCaches,t,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,i){i&&i.filter&&this._validate(e.z.filter,"querySourceFeatures.filter",i.filter,null,i);const r=this.sourceCaches[t];return r?function(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),r=[],s={};for(let t=0;t<i.length;t++){const o=i[t],n=o.tileID.canonical.key;s[n]||(s[n]=true,o.querySourceFeatures(r,e))}return r}(r,i):[]}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();const r=this.light.getLight();let s=false;for(const i in t)if(!e.bG(t[i],r[i])){s=true;break}if(!s)return;const o={now:n.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(o)}getProjection(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.projection}setProjection(t){if(this._checkLoaded(),this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=t,this._setProjectionInternal(t.type)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t,i={}){this._checkLoaded();const r=this.getSky();let s=false;if(!t&&!r)return;if(t&&!r)s=true;else if(!t&&r)s=true;else for(const i in t)if(!e.bG(t[i],r[i])){s=true;break}if(!s)return;const o={now:n.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,i),this.sky.updateTransitions(o)}_setProjectionInternal(t){const i=function(t){if(Array.isArray(t)){const e=new Xe({type:t});return{projection:e,transform:new mi,cameraHelper:new Ii(e)}}switch(t){case"mercator":return{projection:new _e,transform:new Fe,cameraHelper:new Ue};case"globe":{const t=new Xe({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:t,transform:new mi,cameraHelper:new Ii(t)}}case"vertical-perspective":return{projection:new Ze,transform:new pi,cameraHelper:new wi};default:return e.w(`Unknown projection name: ${t}. Falling back to mercator projection.`),{projection:new _e,transform:new Fe,cameraHelper:new Ue}}}(t);this.projection=i.projection,this.map.migrateProjection(i.transform,i.cameraHelper);for(const t in this.sourceCaches)this.sourceCaches[t].reload()}_validate(t,i,r,s,o={}){return(!o||false!==o.validate)&&vi(this,t.call(e.z,e.e({key:i,style:this.serialize(),value:r,styleSpec:e.v},s)))}_remove(t=true){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),rt().off(tt,this._rtlPluginLoaded);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches){const e=this.sourceCaches[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const e in this.sourceCaches)this.sourceCaches[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,e,i,r,s=false){let o=false,a=false;const l={};for(const e of this._order){const i=this._layers[e];if("symbol"!==i.type)continue;if(!l[i.source]){const t=this.sourceCaches[i.source];l[i.source]=t.getRenderableIds(true).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const r=this.crossTileSymbolIndex.addLayer(i,l[i.source],t.center.lng);o=o||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((s=s||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(n.now(),t.zoom))&&(this.pauseablePlacement=new fe(t,this.map.terrain,this._order,s,e,i,r,this.placement),this._layerOrderChanged=false),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(n.now()),a=true),o&&this.pauseablePlacement.placement.setStale()),a||o)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(n.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,i){return e._(this,void 0,void 0,(function*(){const t=yield this.imageManager.getImages(i.icons);this._updateTilesForChangedImages();const e=this.sourceCaches[i.source];return e&&e.setDependencies(i.tileID.key,i.type,i.icons),t}))}getGlyphs(t,i){return e._(this,void 0,void 0,(function*(){const t=yield this.glyphManager.getGlyphs(i.stacks),e=this.sourceCaches[i.source];return e&&e.setDependencies(i.tileID.key,i.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,i={}){this._checkLoaded(),t&&this._validate(e.z.glyphs,"glyphs",t,null,i)||(this._glyphsDidChange=true,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,i,r={},s){this._checkLoaded();const o=[{id:t,url:i}],n=[...p(this.stylesheet.sprite),...o];this._validate(e.z.sprite,"sprite",n,null,r)||(this.stylesheet.sprite=n,this._loadSprite(o,true,s))}removeSprite(t){this._checkLoaded();const i=p(this.stylesheet.sprite);if(i.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=true;i.splice(i.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=true,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}else this.fire(new e.k(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return p(this.stylesheet.sprite)}setSprite(t,i={},r){this._checkLoaded(),t&&this._validate(e.z.sprite,"sprite",t,null,i)||(this.stylesheet.sprite=t,t?this._loadSprite(t,true,r):(this._unloadSprite(),r&&r(null)))}}var Bi=e.aI([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ci{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,r,s,o,n,a,l){this.context=t;let A=this.boundPaintVertexBuffers.length!==r.length;for(let t=0;!A&&t<r.length;t++)this.boundPaintVertexBuffers[t]!==r[t]&&(A=true);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||A||this.boundIndexBuffer!==s||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==n||this.boundDynamicVertexBuffer2!==a||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,r,s,o,n,a,l):(t.bindVertexArray.set(this.vao),n&&n.bind(),s&&s.dynamicDraw&&s.bind(),a&&a.bind(),l&&l.bind())}freshBind(t,e,i,r,s,o,n,a){const l=t.numAttributes,A=this.context,h=A.gl;this.vao&&this.destroy(),this.vao=A.createVertexArray(),A.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=s,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=n,this.boundDynamicVertexBuffer3=a,e.enableAttributes(h,t);for(const e of i)e.enableAttributes(h,t);o&&o.enableAttributes(h,t),n&&n.enableAttributes(h,t),a&&a.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,s);for(const e of i)e.bind(),e.setVertexAttribPointers(h,t,s);o&&(o.bind(),o.setVertexAttribPointers(h,t,s)),r&&r.bind(),n&&(n.bind(),n.setVertexAttribPointers(h,t,s)),a&&(a.bind(),a.setVertexAttribPointers(h,t,s)),A.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Ei=(t,i,r,s,o)=>({u_texture:0,u_ele_delta:t,u_fog_matrix:i,u_fog_color:r?r.properties.get("fog-color"):e.be.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:o?0:r?r.calculateFogBlendOpacity(s):0,u_horizon_color:r?r.properties.get("horizon-color"):e.be.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:o?1:0}),_i={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Qi(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const r=t[i].split(" ");e.push(r.pop())}return e}class xi{constructor(t,i,r,s,o,n,a,l,A=[]){const h=t.gl;this.program=h.createProgram();const c=Qi(i.staticAttributes),u=r?r.getBinderAttributes():[],f=c.concat(u),d=ve.prelude.staticUniforms?Qi(ve.prelude.staticUniforms):[],g=a.staticUniforms?Qi(a.staticUniforms):[],p=i.staticUniforms?Qi(i.staticUniforms):[],m=r?r.getBinderUniforms():[],w=d.concat(g).concat(p).concat(m),I=[];for(const t of w)I.indexOf(t)<0&&I.push(t);const v=r?r.defines():[];He(h)&&v.unshift("#version 300 es"),o&&v.push("#define OVERDRAW_INSPECTOR;"),n&&v.push("#define TERRAIN3D;"),l&&v.push(l),A&&v.push(...A);let b=v.concat(ve.prelude.fragmentSource,a.fragmentSource,i.fragmentSource).join("\n"),y=v.concat(ve.prelude.vertexSource,a.vertexSource,i.vertexSource).join("\n");He(h)||(b=function(t){return t.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(b),y=function(t){return t.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(y));const B=h.createShader(h.FRAGMENT_SHADER);if(h.isContextLost())return void(this.failedToCreate=true);if(h.shaderSource(B,b),h.compileShader(B),!h.getShaderParameter(B,h.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${h.getShaderInfoLog(B)}`);h.attachShader(this.program,B);const C=h.createShader(h.VERTEX_SHADER);if(h.isContextLost())return void(this.failedToCreate=true);if(h.shaderSource(C,y),h.compileShader(C),!h.getShaderParameter(C,h.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${h.getShaderInfoLog(C)}`);h.attachShader(this.program,C),this.attributes={};const E={};this.numAttributes=f.length;for(let t=0;t<this.numAttributes;t++)f[t]&&(h.bindAttribLocation(this.program,t,f[t]),this.attributes[f[t]]=t);if(h.linkProgram(this.program),!h.getProgramParameter(this.program,h.LINK_STATUS))throw new Error(`Program failed to link: ${h.getProgramInfoLog(this.program)}`);h.deleteShader(C),h.deleteShader(B);for(let t=0;t<I.length;t++){const e=I[t];if(e&&!E[e]){const t=h.getUniformLocation(this.program,e);t&&(E[e]=t)}}this.fixedUniforms=s(t,E),this.terrainUniforms=((t,i)=>({u_depth:new e.bO(t,i.u_depth),u_terrain:new e.bO(t,i.u_terrain),u_terrain_dim:new e.bf(t,i.u_terrain_dim),u_terrain_matrix:new e.bQ(t,i.u_terrain_matrix),u_terrain_unpack:new e.bR(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.bf(t,i.u_terrain_exaggeration)}))(t,E),this.projectionUniforms=((t,i)=>({u_projection_matrix:new e.bQ(t,i.u_projection_matrix),u_projection_tile_mercator_coords:new e.bR(t,i.u_projection_tile_mercator_coords),u_projection_clipping_plane:new e.bR(t,i.u_projection_clipping_plane),u_projection_transition:new e.bf(t,i.u_projection_transition),u_projection_fallback_matrix:new e.bQ(t,i.u_projection_fallback_matrix)}))(t,E),this.binderUniforms=r?r.getUniforms(t,E):[]}draw(t,e,i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w){const I=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(s),t.setCullFace(o),a){t.activeTexture.set(I.TEXTURE2),I.bindTexture(I.TEXTURE_2D,a.depthTexture),t.activeTexture.set(I.TEXTURE3),I.bindTexture(I.TEXTURE_2D,a.texture);for(const t in this.terrainUniforms)this.terrainUniforms[t].set(a[t])}if(l)for(const t in l)this.projectionUniforms[_i[t]].set(l[t]);if(n)for(const t in this.fixedUniforms)this.fixedUniforms[t].set(n[t]);g&&g.setUniforms(t,this.binderUniforms,f,{zoom:d});let v=0;switch(e){case I.LINES:v=2;break;case I.TRIANGLES:v=3;break;case I.LINE_STRIP:v=1}for(const i of u.get()){const r=i.vaos||(i.vaos={});(r[A]||(r[A]=new Ci)).bind(t,this,h,g?g.getPaintVertexBuffers():[],c,i.vertexOffset,p,m,w),I.drawElements(e,i.primitiveLength*v,I.UNSIGNED_SHORT,i.primitiveOffset*v*2)}}}function Mi(t,i,r){const s=1/e.aB(r,1,i.transform.tileZoom),o=Math.pow(2,r.tileID.overscaledZ),n=r.tileSize*Math.pow(2,i.transform.tileZoom)/o,a=n*(r.tileID.canonical.x+r.tileID.wrap*o),l=n*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[s,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,l>>16],u_pixel_coord_lower:[65535&a,65535&l]}}const ki=(t,i,r,s)=>{const o=t.style.light,n=o.properties.get("position"),a=[n.x,n.y,n.z],l=e.bU();"viewport"===o.properties.get("anchor")&&e.bV(l,t.transform.bearingInRadians),e.bW(a,a,l);const A=t.transform.transformLightDirection(a),h=o.properties.get("color");return{u_lightpos:a,u_lightpos_globe:A,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[h.r,h.g,h.b],u_vertical_gradient:+i,u_opacity:r,u_fill_translate:s}},Di=(t,i,r,s,o,n,a)=>e.e(ki(t,i,r,s),Mi(n,t,a),{u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8}),Si=(t,i,r,s)=>e.e(Mi(i,t,r),{u_fill_translate:s}),Gi=(t,e)=>({u_world:t,u_fill_translate:e}),Fi=(t,i,r,s,o)=>e.e(Si(t,i,r,o),{u_world:s}),Ri=(t,i,r,s,o)=>{const n=t.transform;let a,l,A=0;if("map"===r.paint.get("circle-pitch-alignment")){const t=e.aB(i,1,n.zoom);a=true,l=[t,t],A=t/(e.$*Math.pow(2,i.tileID.overscaledZ))*2*Math.PI*o}else a=false,l=n.pixelsToGLUnits;return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_pitch_with_map:+a,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:l,u_globe_extrude_scale:A,u_translate:s}},Li=t=>({u_pixel_extrude_scale:[1/t.width,1/t.height]}),zi=t=>({u_viewport_size:[t.width,t.height]}),Ui=(t,e=1)=>({u_color:t,u_overlay:0,u_overlay_scale:e}),Pi=(t,i,r,s)=>{const o=e.aB(t,1,i)/(e.$*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*s;return{u_extrude_scale:e.aB(t,1,i),u_intensity:r,u_globe_extrude_scale:o}},Ni=(t,i,r,s)=>{const o=e.L();e.bX(o,0,t.width,t.height,0,0,1);const n=t.context.gl;return{u_matrix:o,u_world:[n.drawingBufferWidth,n.drawingBufferHeight],u_image:r,u_color_ramp:s,u_opacity:i.paint.get("heatmap-opacity")}},Ti=(t,e,i)=>{const r=i.paint.get("hillshade-accent-color");let s;switch(i.paint.get("hillshade-method")){case"basic":s=4;break;case"combined":s=1;break;case"igor":s=2;break;case"multidirectional":s=3;break;default:s=0}const o=i.getIlluminationProperties();for(let e=0;e<o.directionRadians.length;e++)"viewport"===i.paint.get("hillshade-illumination-anchor")&&(o.directionRadians[e]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:Oi(0,e.tileID),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:o.altitudeRadians,u_azimuths:o.directionRadians,u_accent:r,u_method:s,u_highlights:o.highlightColor,u_shadows:o.shadowColor}},qi=(t,i)=>{const r=i.stride,s=e.L();return e.bX(s,0,e.$,-8192,0,0,1),e.M(s,s,[0,-8192,0]),{u_matrix:s,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}};function Oi(t,i){const r=Math.pow(2,i.canonical.z),s=i.canonical.y;return[new e.a0(0,s/r).toLngLat().lat,new e.a0(0,(s+1)/r).toLngLat().lat]}const ji=(t,e)=>({u_image:0,u_unpack:e.getUnpackVector(),u_dimension:[e.stride,e.stride],u_elevation_stops:1,u_color_stops:4,u_opacity:t.paint.get("color-relief-opacity")}),Ji=(t,i,r,s)=>{const o=t.transform;return{u_translation:Ki(t,i,r),u_ratio:s/e.aB(i,1,o.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Hi=(t,i,r,s,o)=>e.e(Ji(t,i,r,s),{u_image:0,u_image_height:o}),Yi=(t,i,r,s,o)=>{const n=t.transform,a=Vi(i,n);return{u_translation:Ki(t,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:s/e.aB(i,1,n.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[a,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},$i=(t,i,r,s,o,n)=>{const a=t.lineAtlas,l=Vi(i,t.transform),A="round"===r.layout.get("line-cap"),h=a.getDash(o.from,A),c=a.getDash(o.to,A),u=h.width*n.fromScale,f=c.width*n.toScale;return e.e(Ji(t,i,r,s),{u_patternscale_a:[l/u,-h.height/2],u_patternscale_b:[l/f,-c.height/2],u_sdfgamma:a.width/(256*Math.min(u,f)*t.pixelRatio)/2,u_image:0,u_tex_y_a:h.y,u_tex_y_b:c.y,u_mix:n.t})};function Vi(t,i){return 1/e.aB(t,1,i.tileZoom)}function Ki(t,i,r){return e.aC(t.transform,i,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Zi=(t,e,i,r,s)=>{return{u_tl_parent:t,u_scale_parent:e,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(n=r.paint.get("raster-saturation"),n>0?1-1/(1.001-n):-n),u_contrast_factor:(o=r.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Wi(r.paint.get("raster-hue-rotate")),u_coords_top:[s[0].x,s[0].y,s[1].x,s[1].y],u_coords_bottom:[s[3].x,s[3].y,s[2].x,s[2].y]};var o,n};function Wi(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const Xi=(t,e,i,r,s,o,n,a,l,A,h,c,u)=>{const f=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:f.width/f.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+h,u_pitch_with_map:+r,u_is_along_line:s,u_is_variable_anchor:o,u_texsize:c,u_texture:0,u_translation:A,u_pitched_scale:u}},tr=(t,i,r,s,o,n,a,l,A,h,c,u,f,d)=>{const g=a.transform;return e.e(Xi(t,i,r,s,o,n,a,l,A,h,c,u,d),{u_gamma_scale:s?Math.cos(g.pitch*Math.PI/180)*g.cameraToCenterDistance:1,u_device_pixel_ratio:a.pixelRatio,u_is_halo:1})},er=(t,i,r,s,o,n,a,l,A,h,c,u,f)=>e.e(tr(t,i,r,s,o,n,a,l,A,h,true,c,0,f),{u_texsize_icon:u,u_texture_icon:1}),ir=(t,e)=>({u_opacity:t,u_color:e}),rr=(t,i,r,s,o)=>e.e(function(t,i,r,s){const o=r.imageManager.getPattern(t.from.toString()),n=r.imageManager.getPattern(t.to.toString()),{width:a,height:l}=r.imageManager.getPixelSize(),A=Math.pow(2,s.tileID.overscaledZ),h=s.tileSize*Math.pow(2,r.transform.tileZoom)/A,c=h*(s.tileID.canonical.x+s.tileID.wrap*A),u=h*s.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[a,l],u_mix:i.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:i.fromScale,u_scale_b:i.toScale,u_tile_units_to_pixels:1/e.aB(s,1,r.transform.tileZoom),u_pixel_coord_upper:[c>>16,u>>16],u_pixel_coord_lower:[65535&c,65535&u]}}(r,o,i,s),{u_opacity:t}),sr=(t,e)=>{},or={fillExtrusion:(t,i)=>({u_lightpos:new e.bS(t,i.u_lightpos),u_lightpos_globe:new e.bS(t,i.u_lightpos_globe),u_lightintensity:new e.bf(t,i.u_lightintensity),u_lightcolor:new e.bS(t,i.u_lightcolor),u_vertical_gradient:new e.bf(t,i.u_vertical_gradient),u_opacity:new e.bf(t,i.u_opacity),u_fill_translate:new e.bT(t,i.u_fill_translate)}),fillExtrusionPattern:(t,i)=>({u_lightpos:new e.bS(t,i.u_lightpos),u_lightpos_globe:new e.bS(t,i.u_lightpos_globe),u_lightintensity:new e.bf(t,i.u_lightintensity),u_lightcolor:new e.bS(t,i.u_lightcolor),u_vertical_gradient:new e.bf(t,i.u_vertical_gradient),u_height_factor:new e.bf(t,i.u_height_factor),u_opacity:new e.bf(t,i.u_opacity),u_fill_translate:new e.bT(t,i.u_fill_translate),u_image:new e.bO(t,i.u_image),u_texsize:new e.bT(t,i.u_texsize),u_pixel_coord_upper:new e.bT(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.bT(t,i.u_pixel_coord_lower),u_scale:new e.bS(t,i.u_scale),u_fade:new e.bf(t,i.u_fade)}),fill:(t,i)=>({u_fill_translate:new e.bT(t,i.u_fill_translate)}),fillPattern:(t,i)=>({u_image:new e.bO(t,i.u_image),u_texsize:new e.bT(t,i.u_texsize),u_pixel_coord_upper:new e.bT(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.bT(t,i.u_pixel_coord_lower),u_scale:new e.bS(t,i.u_scale),u_fade:new e.bf(t,i.u_fade),u_fill_translate:new e.bT(t,i.u_fill_translate)}),fillOutline:(t,i)=>({u_world:new e.bT(t,i.u_world),u_fill_translate:new e.bT(t,i.u_fill_translate)}),fillOutlinePattern:(t,i)=>({u_world:new e.bT(t,i.u_world),u_image:new e.bO(t,i.u_image),u_texsize:new e.bT(t,i.u_texsize),u_pixel_coord_upper:new e.bT(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.bT(t,i.u_pixel_coord_lower),u_scale:new e.bS(t,i.u_scale),u_fade:new e.bf(t,i.u_fade),u_fill_translate:new e.bT(t,i.u_fill_translate)}),circle:(t,i)=>({u_camera_to_center_distance:new e.bf(t,i.u_camera_to_center_distance),u_scale_with_map:new e.bO(t,i.u_scale_with_map),u_pitch_with_map:new e.bO(t,i.u_pitch_with_map),u_extrude_scale:new e.bT(t,i.u_extrude_scale),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_globe_extrude_scale:new e.bf(t,i.u_globe_extrude_scale),u_translate:new e.bT(t,i.u_translate)}),collisionBox:(t,i)=>({u_pixel_extrude_scale:new e.bT(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_viewport_size:new e.bT(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.bP(t,i.u_color),u_overlay:new e.bO(t,i.u_overlay),u_overlay_scale:new e.bf(t,i.u_overlay_scale)}),depth:sr,clippingMask:sr,heatmap:(t,i)=>({u_extrude_scale:new e.bf(t,i.u_extrude_scale),u_intensity:new e.bf(t,i.u_intensity),u_globe_extrude_scale:new e.bf(t,i.u_globe_extrude_scale)}),heatmapTexture:(t,i)=>({u_matrix:new e.bQ(t,i.u_matrix),u_world:new e.bT(t,i.u_world),u_image:new e.bO(t,i.u_image),u_color_ramp:new e.bO(t,i.u_color_ramp),u_opacity:new e.bf(t,i.u_opacity)}),hillshade:(t,i)=>({u_image:new e.bO(t,i.u_image),u_latrange:new e.bT(t,i.u_latrange),u_exaggeration:new e.bf(t,i.u_exaggeration),u_altitudes:new e.bZ(t,i.u_altitudes),u_azimuths:new e.bZ(t,i.u_azimuths),u_accent:new e.bP(t,i.u_accent),u_method:new e.bO(t,i.u_method),u_shadows:new e.bY(t,i.u_shadows),u_highlights:new e.bY(t,i.u_highlights)}),hillshadePrepare:(t,i)=>({u_matrix:new e.bQ(t,i.u_matrix),u_image:new e.bO(t,i.u_image),u_dimension:new e.bT(t,i.u_dimension),u_zoom:new e.bf(t,i.u_zoom),u_unpack:new e.bR(t,i.u_unpack)}),colorRelief:(t,i)=>({u_image:new e.bO(t,i.u_image),u_unpack:new e.bR(t,i.u_unpack),u_dimension:new e.bT(t,i.u_dimension),u_elevation_stops:new e.bO(t,i.u_elevation_stops),u_color_stops:new e.bO(t,i.u_color_stops),u_opacity:new e.bf(t,i.u_opacity)}),line:(t,i)=>({u_translation:new e.bT(t,i.u_translation),u_ratio:new e.bf(t,i.u_ratio),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.bT(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_translation:new e.bT(t,i.u_translation),u_ratio:new e.bf(t,i.u_ratio),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.bT(t,i.u_units_to_pixels),u_image:new e.bO(t,i.u_image),u_image_height:new e.bf(t,i.u_image_height)}),linePattern:(t,i)=>({u_translation:new e.bT(t,i.u_translation),u_texsize:new e.bT(t,i.u_texsize),u_ratio:new e.bf(t,i.u_ratio),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_image:new e.bO(t,i.u_image),u_units_to_pixels:new e.bT(t,i.u_units_to_pixels),u_scale:new e.bS(t,i.u_scale),u_fade:new e.bf(t,i.u_fade)}),lineSDF:(t,i)=>({u_translation:new e.bT(t,i.u_translation),u_ratio:new e.bf(t,i.u_ratio),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.bT(t,i.u_units_to_pixels),u_patternscale_a:new e.bT(t,i.u_patternscale_a),u_patternscale_b:new e.bT(t,i.u_patternscale_b),u_sdfgamma:new e.bf(t,i.u_sdfgamma),u_image:new e.bO(t,i.u_image),u_tex_y_a:new e.bf(t,i.u_tex_y_a),u_tex_y_b:new e.bf(t,i.u_tex_y_b),u_mix:new e.bf(t,i.u_mix)}),raster:(t,i)=>({u_tl_parent:new e.bT(t,i.u_tl_parent),u_scale_parent:new e.bf(t,i.u_scale_parent),u_buffer_scale:new e.bf(t,i.u_buffer_scale),u_fade_t:new e.bf(t,i.u_fade_t),u_opacity:new e.bf(t,i.u_opacity),u_image0:new e.bO(t,i.u_image0),u_image1:new e.bO(t,i.u_image1),u_brightness_low:new e.bf(t,i.u_brightness_low),u_brightness_high:new e.bf(t,i.u_brightness_high),u_saturation_factor:new e.bf(t,i.u_saturation_factor),u_contrast_factor:new e.bf(t,i.u_contrast_factor),u_spin_weights:new e.bS(t,i.u_spin_weights),u_coords_top:new e.bR(t,i.u_coords_top),u_coords_bottom:new e.bR(t,i.u_coords_bottom)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.bO(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bO(t,i.u_is_size_feature_constant),u_size_t:new e.bf(t,i.u_size_t),u_size:new e.bf(t,i.u_size),u_camera_to_center_distance:new e.bf(t,i.u_camera_to_center_distance),u_pitch:new e.bf(t,i.u_pitch),u_rotate_symbol:new e.bO(t,i.u_rotate_symbol),u_aspect_ratio:new e.bf(t,i.u_aspect_ratio),u_fade_change:new e.bf(t,i.u_fade_change),u_label_plane_matrix:new e.bQ(t,i.u_label_plane_matrix),u_coord_matrix:new e.bQ(t,i.u_coord_matrix),u_is_text:new e.bO(t,i.u_is_text),u_pitch_with_map:new e.bO(t,i.u_pitch_with_map),u_is_along_line:new e.bO(t,i.u_is_along_line),u_is_variable_anchor:new e.bO(t,i.u_is_variable_anchor),u_texsize:new e.bT(t,i.u_texsize),u_texture:new e.bO(t,i.u_texture),u_translation:new e.bT(t,i.u_translation),u_pitched_scale:new e.bf(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.bO(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bO(t,i.u_is_size_feature_constant),u_size_t:new e.bf(t,i.u_size_t),u_size:new e.bf(t,i.u_size),u_camera_to_center_distance:new e.bf(t,i.u_camera_to_center_distance),u_pitch:new e.bf(t,i.u_pitch),u_rotate_symbol:new e.bO(t,i.u_rotate_symbol),u_aspect_ratio:new e.bf(t,i.u_aspect_ratio),u_fade_change:new e.bf(t,i.u_fade_change),u_label_plane_matrix:new e.bQ(t,i.u_label_plane_matrix),u_coord_matrix:new e.bQ(t,i.u_coord_matrix),u_is_text:new e.bO(t,i.u_is_text),u_pitch_with_map:new e.bO(t,i.u_pitch_with_map),u_is_along_line:new e.bO(t,i.u_is_along_line),u_is_variable_anchor:new e.bO(t,i.u_is_variable_anchor),u_texsize:new e.bT(t,i.u_texsize),u_texture:new e.bO(t,i.u_texture),u_gamma_scale:new e.bf(t,i.u_gamma_scale),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_is_halo:new e.bO(t,i.u_is_halo),u_translation:new e.bT(t,i.u_translation),u_pitched_scale:new e.bf(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.bO(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bO(t,i.u_is_size_feature_constant),u_size_t:new e.bf(t,i.u_size_t),u_size:new e.bf(t,i.u_size),u_camera_to_center_distance:new e.bf(t,i.u_camera_to_center_distance),u_pitch:new e.bf(t,i.u_pitch),u_rotate_symbol:new e.bO(t,i.u_rotate_symbol),u_aspect_ratio:new e.bf(t,i.u_aspect_ratio),u_fade_change:new e.bf(t,i.u_fade_change),u_label_plane_matrix:new e.bQ(t,i.u_label_plane_matrix),u_coord_matrix:new e.bQ(t,i.u_coord_matrix),u_is_text:new e.bO(t,i.u_is_text),u_pitch_with_map:new e.bO(t,i.u_pitch_with_map),u_is_along_line:new e.bO(t,i.u_is_along_line),u_is_variable_anchor:new e.bO(t,i.u_is_variable_anchor),u_texsize:new e.bT(t,i.u_texsize),u_texsize_icon:new e.bT(t,i.u_texsize_icon),u_texture:new e.bO(t,i.u_texture),u_texture_icon:new e.bO(t,i.u_texture_icon),u_gamma_scale:new e.bf(t,i.u_gamma_scale),u_device_pixel_ratio:new e.bf(t,i.u_device_pixel_ratio),u_is_halo:new e.bO(t,i.u_is_halo),u_translation:new e.bT(t,i.u_translation),u_pitched_scale:new e.bf(t,i.u_pitched_scale)}),background:(t,i)=>({u_opacity:new e.bf(t,i.u_opacity),u_color:new e.bP(t,i.u_color)}),backgroundPattern:(t,i)=>({u_opacity:new e.bf(t,i.u_opacity),u_image:new e.bO(t,i.u_image),u_pattern_tl_a:new e.bT(t,i.u_pattern_tl_a),u_pattern_br_a:new e.bT(t,i.u_pattern_br_a),u_pattern_tl_b:new e.bT(t,i.u_pattern_tl_b),u_pattern_br_b:new e.bT(t,i.u_pattern_br_b),u_texsize:new e.bT(t,i.u_texsize),u_mix:new e.bf(t,i.u_mix),u_pattern_size_a:new e.bT(t,i.u_pattern_size_a),u_pattern_size_b:new e.bT(t,i.u_pattern_size_b),u_scale_a:new e.bf(t,i.u_scale_a),u_scale_b:new e.bf(t,i.u_scale_b),u_pixel_coord_upper:new e.bT(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.bT(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.bf(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_texture:new e.bO(t,i.u_texture),u_ele_delta:new e.bf(t,i.u_ele_delta),u_fog_matrix:new e.bQ(t,i.u_fog_matrix),u_fog_color:new e.bP(t,i.u_fog_color),u_fog_ground_blend:new e.bf(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.bf(t,i.u_fog_ground_blend_opacity),u_horizon_color:new e.bP(t,i.u_horizon_color),u_horizon_fog_blend:new e.bf(t,i.u_horizon_fog_blend),u_is_globe_mode:new e.bf(t,i.u_is_globe_mode)}),terrainDepth:(t,i)=>({u_ele_delta:new e.bf(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_texture:new e.bO(t,i.u_texture),u_terrain_coords_id:new e.bf(t,i.u_terrain_coords_id),u_ele_delta:new e.bf(t,i.u_ele_delta)}),projectionErrorMeasurement:(t,i)=>({u_input:new e.bf(t,i.u_input),u_output_expected:new e.bf(t,i.u_output_expected)}),atmosphere:(t,i)=>({u_sun_pos:new e.bS(t,i.u_sun_pos),u_atmosphere_blend:new e.bf(t,i.u_atmosphere_blend),u_globe_position:new e.bS(t,i.u_globe_position),u_globe_radius:new e.bf(t,i.u_globe_radius),u_inv_proj_matrix:new e.bQ(t,i.u_inv_proj_matrix)}),sky:(t,i)=>({u_sky_color:new e.bP(t,i.u_sky_color),u_horizon_color:new e.bP(t,i.u_horizon_color),u_horizon:new e.bT(t,i.u_horizon),u_horizon_normal:new e.bT(t,i.u_horizon_normal),u_sky_horizon_blend:new e.bf(t,i.u_sky_horizon_blend),u_sky_blend:new e.bf(t,i.u_sky_blend)})};class nr{constructor(t,e,i){this.context=t;const r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const ar={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class lr{constructor(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;const s=t.gl;this.buffer=s.createBuffer(),t.bindVertexBuffer.set(this.buffer),s.bufferData(s.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}}setVertexAttribPointers(t,e,i){for(let r=0;r<this.attributes.length;r++){const s=this.attributes[r],o=e.attributes[s.name];void 0!==o&&t.vertexAttribPointer(o,s.components,t[ar[s.type]],false,this.itemSize,s.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Ar{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=false}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class hr extends Ar{getDefault(){return e.be.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=false)}}class cr extends Ar{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=false)}}class ur extends Ar{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=false)}}class fr extends Ar{getDefault(){return[true,true,true,true]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=false)}}class dr extends Ar{getDefault(){return true}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=false)}}class gr extends Ar{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=false)}}class pr extends Ar{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=false)}}class mr extends Ar{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=false)}}class wr extends Ar{getDefault(){return false}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=false}}class Ir extends Ar{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=false)}}class vr extends Ar{getDefault(){return false}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=false}}class br extends Ar{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=false)}}class yr extends Ar{getDefault(){return false}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=false}}class Br extends Ar{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=false)}}class Cr extends Ar{getDefault(){return e.be.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=false)}}class Er extends Ar{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=false)}}class _r extends Ar{getDefault(){return false}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=false}}class Qr extends Ar{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=false)}}class xr extends Ar{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=false)}}class Mr extends Ar{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=false)}}class kr extends Ar{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=false)}}class Dr extends Ar{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=false)}}class Sr extends Ar{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=false}}class Gr extends Ar{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=false}}class Fr extends Ar{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=false}}class Rr extends Ar{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=false}}class Lr extends Ar{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=false}}class zr extends Ar{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;const i=this.gl;He(i)?i.bindVertexArray(t):null===(e=i.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=false}}class Ur extends Ar{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=false}}class Pr extends Ar{getDefault(){return false}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=false}}class Nr extends Ar{getDefault(){return false}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=false}}class Tr extends Ar{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class qr extends Tr{setDirty(){this.dirty=true}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=false}}class Or extends Tr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=false}}class jr extends Tr{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=false}}const Jr="Framebuffer is not complete";class Hr{constructor(t,e,i,r,s){this.context=t,this.width=e,this.height=i;const o=t.gl,n=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new qr(t,n),r)this.depthAttachment=s?new jr(t,n):new Or(t,n);else if(s)throw new Error("Stencil cannot be set without depth");if(o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE)throw new Error(Jr)}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Yr{constructor(t){var e,i;if(this.gl=t,this.clearColor=new hr(this),this.clearDepth=new cr(this),this.clearStencil=new ur(this),this.colorMask=new fr(this),this.depthMask=new dr(this),this.stencilMask=new gr(this),this.stencilFunc=new pr(this),this.stencilOp=new mr(this),this.stencilTest=new wr(this),this.depthRange=new Ir(this),this.depthTest=new vr(this),this.depthFunc=new br(this),this.blend=new yr(this),this.blendFunc=new Br(this),this.blendColor=new Cr(this),this.blendEquation=new Er(this),this.cullFace=new _r(this),this.cullFaceSide=new Qr(this),this.frontFace=new xr(this),this.program=new Mr(this),this.activeTexture=new kr(this),this.viewport=new Dr(this),this.bindFramebuffer=new Sr(this),this.bindRenderbuffer=new Gr(this),this.bindTexture=new Fr(this),this.bindVertexBuffer=new Rr(this),this.bindElementBuffer=new Lr(this),this.bindVertexArray=new zr(this),this.pixelStoreUnpack=new Ur(this),this.pixelStoreUnpackPremultiplyAlpha=new Pr(this),this.pixelStoreUnpackFlipY=new Nr(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),He(t)){this.HALF_FLOAT=t.HALF_FLOAT;const r=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==r?void 0:r.RGBA16F_EXT,this.RGB16F=null!==(i=t.RGB16F)&&void 0!==i?i:null==r?void 0:r.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=true,this.clearDepth.dirty=true,this.clearStencil.dirty=true,this.colorMask.dirty=true,this.depthMask.dirty=true,this.stencilMask.dirty=true,this.stencilFunc.dirty=true,this.stencilOp.dirty=true,this.stencilTest.dirty=true,this.depthRange.dirty=true,this.depthTest.dirty=true,this.depthFunc.dirty=true,this.blend.dirty=true,this.blendFunc.dirty=true,this.blendColor.dirty=true,this.blendEquation.dirty=true,this.cullFace.dirty=true,this.cullFaceSide.dirty=true,this.frontFace.dirty=true,this.program.dirty=true,this.activeTexture.dirty=true,this.viewport.dirty=true,this.bindFramebuffer.dirty=true,this.bindRenderbuffer.dirty=true,this.bindTexture.dirty=true,this.bindVertexBuffer.dirty=true,this.bindElementBuffer.dirty=true,this.bindVertexArray.dirty=true,this.pixelStoreUnpack.dirty=true,this.pixelStoreUnpackPremultiplyAlpha.dirty=true,this.pixelStoreUnpackFlipY.dirty=true}createIndexBuffer(t,e){return new nr(this,t,e)}createVertexBuffer(t,e,i){return new lr(this,t,e,i)}createRenderbuffer(t,e,i){const r=this.gl,s=r.createRenderbuffer();return this.bindRenderbuffer.set(s),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),s}createFramebuffer(t,e,i,r){return new Hr(this,t,e,i,r)}clear({color:t,depth:e,stencil:i}){const r=this.gl;let s=0;t&&(s|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([true,true,true,true])),void 0!==e&&(s|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(true)),void 0!==i&&(s|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(s)}setCullFace(t){false===t.enable?this.cullFace.set(false):(this.cullFace.set(true),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(true),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(false)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(true),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(false)}setColorMode(t){e.bG(t.blendFunction,Pe.Replace)?this.blend.set(false):(this.blend.set(true),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return He(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return He(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let $r;function Vr(t,i,r,s,o){const n=t.context,a=t.transform,l=n.gl,A=t.useProgram("collisionBox"),h=[];let c=0,u=0;for(let e=0;e<s.length;e++){const f=s[e],d=i.getTile(f).getBucket(r);if(!d)continue;const g=o?d.textCollisionBox:d.iconCollisionBox,p=d.collisionCircleArray;p.length>0&&(h.push({circleArray:p,circleOffset:u,coord:f}),c+=p.length/4,u=c),g&&A.draw(n,l.LINES,qe.disabled,je.disabled,t.colorModeForRenderPass(),Te.disabled,Li(t.transform),t.style.map.terrain&&t.style.map.terrain.getTerrainData(f),a.getProjectionData({overscaledTileID:f,applyGlobeMatrix:true,applyTerrainMatrix:true}),r.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,null,t.transform.zoom,null,null,g.collisionVertexBuffer)}if(!o||!h.length)return;const f=t.useProgram("collisionCircle"),d=new e.b_;d.resize(4*c),d._trim();let g=0;for(const t of h)for(let e=0;e<t.circleArray.length/4;e++){const i=4*e,r=t.circleArray[i+0],s=t.circleArray[i+1],o=t.circleArray[i+2],n=t.circleArray[i+3];d.emplace(g++,r,s,o,n,0),d.emplace(g++,r,s,o,n,1),d.emplace(g++,r,s,o,n,2),d.emplace(g++,r,s,o,n,3)}(!$r||$r.length<2*c)&&($r=function(t){const i=2*t,r=new e.c0;r.resize(i),r._trim();for(let t=0;t<i;t++){const e=6*t;r.uint16[e+0]=4*t+0,r.uint16[e+1]=4*t+1,r.uint16[e+2]=4*t+2,r.uint16[e+3]=4*t+2,r.uint16[e+4]=4*t+3,r.uint16[e+5]=4*t+0}return r}(c));const p=n.createIndexBuffer($r,true),m=n.createVertexBuffer(d,e.b$.members,true);for(const i of h){const s=zi(t.transform);f.draw(n,l.TRIANGLES,qe.disabled,je.disabled,t.colorModeForRenderPass(),Te.disabled,s,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),null,r.id,m,p,e.aL.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}m.destroy(),p.destroy()}const Kr=e.af(new Float32Array(16));function Zr(t,i,r,s,o,n){const{horizontalAlign:a,verticalAlign:l}=e.aG(t);return new e.P((-(a-.5)*i/o+s[0])*n,(-(l-.5)*r/o+s[1])*n)}function Wr(t,i,r,s,o,n){const a=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=s.mult(n);r||(t=t.rotate(-o));const e=a.add(t);return Mt(e.x,e.y,i.pitchedLabelPlaneMatrix,i.getElevation).point}if(r){const e=Ut(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(s.rotate(r))}return t.add(s)}function Xr(t,i,r,s,o,n,a,l,A,h,c,u){const f=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,g=t.icon.dynamicLayoutVertexArray,p={};d.clear();for(let g=0;g<f.length;g++){const m=f.get(g),w=m.hidden||!m.crossTileID||t.allowVerticalPlacement&&!m.placedOrientation?null:s[m.crossTileID];if(w){const s=new e.P(m.anchorX,m.anchorY),f={getElevation:u,width:o.width,height:o.height,pitchedLabelPlaneMatrix:n,pitchWithMap:r,transform:o,tileAnchorPoint:s,translation:h,unwrappedTileID:c},g=r?Nt(s.x,s.y,f):Ut(s.x,s.y,f),I=kt(o.cameraToCenterDistance,g.signedDistanceFromCamera);let v=e.ao(t.textSizeData,l,m)*I/e.aA;r&&(v*=t.tilePixelRatio/a);const{width:b,height:y,anchor:B,textOffset:C,textBoxScale:E}=w,_=Zr(B,b,y,C,E,v),Q=o.getPitchedTextCorrection(s.x+h[0],s.y+h[1],c),x=Wr(g.point,f,i,_,-o.bearingInRadians,Q),M=t.allowVerticalPlacement&&m.placedOrientation===e.an.vertical?Math.PI/2:0;for(let t=0;t<m.numGlyphs;t++)e.au(d,x,M);A&&m.associatedIconIndex>=0&&(p[m.associatedIconIndex]={shiftedAnchor:x,angle:M})}else Jt(m.numGlyphs,d)}if(A){g.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const r=i.get(t);if(r.hidden)Jt(r.numGlyphs,g);else{const i=p[t];if(i)for(let t=0;t<r.numGlyphs;t++)e.au(g,i.shiftedAnchor,i.angle);else Jt(r.numGlyphs,g)}}t.icon.dynamicLayoutVertexBuffer.updateData(g)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function ts(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function es(t,i,r,s,o,n,a,l,A,h,c,u,f){const d=t.context,g=d.gl,p=t.transform,m="map"===l,w="map"===A,I="viewport"!==l&&"point"!==r.layout.get("symbol-placement"),v=m&&!w&&!I,b=!r.layout.get("symbol-sort-key").isConstant();let y=false;const B=t.getDepthModeForSublayer(0,qe.ReadOnly),C=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),E=[],_=p.getCircleRadiusCorrection();for(const l of s){const s=i.getTile(l),A=s.getBucket(r);if(!A)continue;const c=o?A.text:A.icon;if(!c||!c.segments.get().length||!c.hasVisibleVertices)continue;const u=c.programConfigurations.get(r.id),d=o||A.sdfIcons,B=o?A.textSizeData:A.iconSizeData,Q=w||0!==p.pitch,x=t.useProgram(ts(d,o,A),u),M=e.am(B,p.zoom),k=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l);let D,S,G,F,R=[0,0],L=null;if(o)S=s.glyphAtlasTexture,G=g.LINEAR,D=s.glyphAtlasTexture.size,A.iconsInText&&(R=s.imageAtlasTexture.size,L=s.imageAtlasTexture,F=Q||t.options.rotating||t.options.zooming||"composite"===B.kind||"camera"===B.kind?g.LINEAR:g.NEAREST);else{const e=1!==r.layout.get("icon-size").constantOr(0)||A.iconsNeedLinear;S=s.imageAtlasTexture,G=d||t.options.rotating||t.options.zooming||e||Q?g.LINEAR:g.NEAREST,D=s.imageAtlasTexture.size}const z=e.aB(s,1,t.transform.zoom),U=_t(m,t.transform,z),P=e.L();e.ap(P,U);const N=Qt(w,m,t.transform,z),T=e.aC(p,s,n,a),q=p.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!f,applyTerrainMatrix:true}),O=C&&A.hasTextData(),j="none"!==r.layout.get("icon-text-fit")&&O&&A.hasIconData();if(I){const e=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(l,e,i):null,i="map"===r.layout.get("text-rotation-alignment");St(A,t,o,U,P,w,h,i,l.toUnwrapped(),p.width,p.height,T,e)}const J=o&&C||j,H=I||J?Kr:w?U:t.transform.clipSpaceToPixelsMatrix,Y=d&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let $;$=d?A.iconsInText?er(B.kind,M,v,w,I,J,t,H,N,T,D,R,_):tr(B.kind,M,v,w,I,J,t,H,N,T,o,D,0,_):Xi(B.kind,M,v,w,I,J,t,H,N,T,o,D,_);const V={program:x,buffers:c,uniformValues:$,projectionData:q,atlasTexture:S,atlasTextureIcon:L,atlasInterpolation:G,atlasInterpolationIcon:F,isSDF:d,hasHalo:Y};if(b&&A.canOverlap){y=true;const t=c.segments.get();for(const i of t)E.push({segments:new e.aL([i]),sortKey:i.sortKey,state:V,terrainData:k})}else E.push({segments:c.segments,sortKey:0,state:V,terrainData:k})}y&&E.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of E){const i=e.state;if(d.activeTexture.set(g.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,g.CLAMP_TO_EDGE),i.atlasTextureIcon&&(d.activeTexture.set(g.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,g.CLAMP_TO_EDGE)),i.isSDF){const s=i.uniformValues;i.hasHalo&&(s.u_is_halo=1,is(i.buffers,e.segments,r,t,i.program,B,c,u,s,i.projectionData,e.terrainData)),s.u_is_halo=0}is(i.buffers,e.segments,r,t,i.program,B,c,u,i.uniformValues,i.projectionData,e.terrainData)}}function is(t,e,i,r,s,o,n,a,l,A,h){const c=r.context;s.draw(c,c.gl.TRIANGLES,o,n,a,Te.backCCW,l,h,A,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function rs(t,i,r,s,o){const n=t.context,a=n.gl,l=je.disabled,A=new Pe([a.ONE,a.ONE],e.be.transparent,[true,true,true,true]),h=i.getBucket(r);if(!h)return;const c=s.key;let u=r.heatmapFbos.get(c);u||(u=os(n,i.tileSize,i.tileSize),r.heatmapFbos.set(c,u)),n.bindFramebuffer.set(u.framebuffer),n.viewport.set([0,0,i.tileSize,i.tileSize]),n.clear({color:e.be.transparent});const f=h.programConfigurations.get(r.id),d=t.useProgram("heatmap",f,!o),g=t.transform.getProjectionData({overscaledTileID:i.tileID,applyGlobeMatrix:true,applyTerrainMatrix:true}),p=t.style.map.terrain.getTerrainData(s);d.draw(n,a.TRIANGLES,qe.disabled,l,A,Te.disabled,Pi(i,t.transform.zoom,r.paint.get("heatmap-intensity"),1),p,g,r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,t.transform.zoom,f)}function ss(t,e,i,r,s){const o=t.context,n=o.gl,a=t.transform;o.setColorMode(t.colorModeForRenderPass());const l=ns(o,e),A=i.key,h=e.heatmapFbos.get(A);if(!h)return;o.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,h.colorAttachment.get()),o.activeTexture.set(n.TEXTURE1),l.bind(n.LINEAR,n.CLAMP_TO_EDGE);const c=a.getProjectionData({overscaledTileID:i,applyTerrainMatrix:s,applyGlobeMatrix:!r});t.useProgram("heatmapTexture").draw(o,n.TRIANGLES,qe.disabled,je.disabled,t.colorModeForRenderPass(),Te.disabled,Ni(t,e,0,1),null,c,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,a.zoom),h.destroy(),e.heatmapFbos.delete(A)}function os(t,e,i){var r,s;const o=t.gl,n=o.createTexture();o.bindTexture(o.TEXTURE_2D,n),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR);const a=null!==(r=t.HALF_FLOAT)&&void 0!==r?r:o.UNSIGNED_BYTE,l=null!==(s=t.RGBA16F)&&void 0!==s?s:o.RGBA;o.texImage2D(o.TEXTURE_2D,0,l,e,i,0,o.RGBA,a,null);const A=t.createFramebuffer(e,i,false,false);return A.colorAttachment.set(n),A}function ns(t,i){return i.colorRampTexture||(i.colorRampTexture=new e.T(t,i.colorRamp,t.gl.RGBA)),i.colorRampTexture}function as(t,e,i,r,s){if(!i||!r||!r.imageAtlas)return;const o=r.imageAtlas.patternPositions;let n=o[i.to.toString()],a=o[i.from.toString()];if(!n&&a&&(n=a),!a&&n&&(a=n),!n||!a){const t=s.getPaintProperty(e);n=o[t],a=o[t]}n&&a&&t.setConstantPatternPositions(n,a)}function ls(t,i,r,s,o,n,a,l){const A=t.context.gl,h="fill-pattern",c=r.paint.get(h),u=c&&c.constantOr(1),f=r.getCrossfadeParameters();let d,g,p,m,w;const I=t.transform,v=r.paint.get("fill-translate"),b=r.paint.get("fill-translate-anchor");a?(g=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=A.LINES):(g=u?"fillPattern":"fill",d=A.TRIANGLES);const y=c.constantOr(null);for(const c of s){const s=i.getTile(c);if(u&&!s.patternsLoaded())continue;const B=s.getBucket(r);if(!B)continue;const C=B.programConfigurations.get(r.id),E=t.useProgram(g,C),_=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c);u&&(t.context.activeTexture.set(A.TEXTURE0),s.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),C.updatePaintBuffers(f)),as(C,h,y,s,r);const Q=I.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!l,applyTerrainMatrix:true}),x=e.aC(I,s,v,b);if(a){m=B.indexBuffer2,w=B.segments2;const e=[A.drawingBufferWidth,A.drawingBufferHeight];p="fillOutlinePattern"===g&&u?Fi(t,f,s,e,x):Gi(e,x)}else m=B.indexBuffer,w=B.segments,p=u?Si(t,f,s,x):{u_fill_translate:x};const M=t.stencilModeForClipping(c);E.draw(t.context,d,o,M,n,Te.backCCW,p,_,Q,r.id,B.layoutVertexBuffer,m,w,r.paint,t.transform.zoom,C)}}function As(t,i,r,s,o,n,a,l){const A=t.context,h=A.gl,c="fill-extrusion-pattern",u=r.paint.get(c),f=u.constantOr(1),d=r.getCrossfadeParameters(),g=r.paint.get("fill-extrusion-opacity"),p=u.constantOr(null),m=t.transform;for(const u of s){const s=i.getTile(u),w=s.getBucket(r);if(!w)continue;const I=t.style.map.terrain&&t.style.map.terrain.getTerrainData(u),v=w.programConfigurations.get(r.id),b=t.useProgram(f?"fillExtrusionPattern":"fillExtrusion",v);f&&(t.context.activeTexture.set(h.TEXTURE0),s.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),v.updatePaintBuffers(d));const y=m.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!l,applyTerrainMatrix:true});as(v,c,p,s,r);const B=e.aC(m,s,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),C=r.paint.get("fill-extrusion-vertical-gradient"),E=f?Di(t,C,g,B,u,d,s):ki(t,C,g,B);b.draw(A,A.gl.TRIANGLES,o,n,a,Te.backCCW,E,I,y,r.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,r.paint,t.transform.zoom,v,t.style.map.terrain&&w.centroidVertexBuffer)}}function hs(t,e,i,r,s,o,n,a,l){var A;const h=t.style.projection,c=t.context,u=t.transform,f=c.gl,d=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],g=t.useProgram("hillshade",null,false,d),p=!t.options.moving;for(const d of r){const r=e.getTile(d),m=r.fbo;if(!m)continue;const w=h.getMeshFromTileID(c,d.canonical,a,true,"raster"),I=null===(A=t.style.map.terrain)||void 0===A?void 0:A.getTerrainData(d);c.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,m.colorAttachment.get());const v=u.getProjectionData({overscaledTileID:d,aligned:p,applyGlobeMatrix:!l,applyTerrainMatrix:true});g.draw(c,f.TRIANGLES,o,s[d.overscaledZ],n,Te.backCCW,Ti(t,r,i),I,v,i.id,w.vertexBuffer,w.indexBuffer,w.segments)}}function cs(t,i,r,s,o,n,a,l,A){var h;const c=t.style.projection,u=t.context,f=t.transform,d=u.gl,g=t.useProgram("colorRelief"),p=!t.options.moving;let m=true;for(const w of s){const s=i.getTile(w),I=s.dem;if(m){const t=d.getParameter(d.MAX_TEXTURE_SIZE),{elevationTexture:e,colorTexture:i}=r.getColorRampTextures(u,t,I.getUnpackVector());u.activeTexture.set(d.TEXTURE1),e.bind(d.NEAREST,d.CLAMP_TO_EDGE),u.activeTexture.set(d.TEXTURE4),i.bind(d.LINEAR,d.CLAMP_TO_EDGE),m=false}if(!I||!I.data)continue;const v=I.stride,b=I.getPixels();if(u.activeTexture.set(d.TEXTURE0),u.pixelStoreUnpackPremultiplyAlpha.set(false),s.demTexture=s.demTexture||t.getTileTexture(v),s.demTexture){const t=s.demTexture;t.update(b,{premultiply:false}),t.bind(d.LINEAR,d.CLAMP_TO_EDGE)}else s.demTexture=new e.T(u,b,d.RGBA,{premultiply:false}),s.demTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE);const y=c.getMeshFromTileID(u,w.canonical,l,true,"raster"),B=null===(h=t.style.map.terrain)||void 0===h?void 0:h.getTerrainData(w),C=f.getProjectionData({overscaledTileID:w,aligned:p,applyGlobeMatrix:!A,applyTerrainMatrix:true});g.draw(u,d.TRIANGLES,n,o[w.overscaledZ],a,Te.backCCW,ji(r,s.dem),B,C,r.id,y.vertexBuffer,y.indexBuffer,y.segments)}}const us=[new e.P(0,0),new e.P(e.$,0),new e.P(e.$,e.$),new e.P(0,e.$)];function fs(t,e,i,r,s,o,n,a,l=false,A=false){const h=r[r.length-1].overscaledZ,c=t.context,u=c.gl,f=t.useProgram("raster"),d=t.transform,g=t.style.projection,p=t.colorModeForRenderPass(),m=!t.options.moving;for(const w of r){const r=t.getDepthModeForSublayer(w.overscaledZ-h,1===i.paint.get("raster-opacity")?qe.ReadWrite:qe.ReadOnly,u.LESS),I=e.getTile(w);I.registerFadeDuration(i.paint.get("raster-fade-duration"));const v=e.findLoadedParent(w,0),b=e.findLoadedSibling(w),y=ds(I,v||b||null,e,i,t.transform,t.style.map.terrain);let B,C;const E="nearest"===i.paint.get("raster-resampling")?u.NEAREST:u.LINEAR;c.activeTexture.set(u.TEXTURE0),I.texture.bind(E,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),c.activeTexture.set(u.TEXTURE1),v?(v.texture.bind(E,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),B=Math.pow(2,v.tileID.overscaledZ-I.tileID.overscaledZ),C=[I.tileID.canonical.x*B%1,I.tileID.canonical.y*B%1]):I.texture.bind(E,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST),I.texture.useMipmap&&c.extTextureFilterAnisotropic&&t.transform.pitch>20&&u.texParameterf(u.TEXTURE_2D,c.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,c.extTextureFilterAnisotropicMax);const _=t.style.map.terrain&&t.style.map.terrain.getTerrainData(w),Q=d.getProjectionData({overscaledTileID:w,aligned:m,applyGlobeMatrix:!A,applyTerrainMatrix:true}),x=Zi(C||[0,0],B||1,y,i,a),M=g.getMeshFromTileID(c,w.canonical,o,n,"raster");f.draw(c,u.TRIANGLES,r,s?s[w.overscaledZ]:je.disabled,p,l?Te.frontCCW:Te.backCCW,x,_,Q,i.id,M.vertexBuffer,M.indexBuffer,M.segments)}}function ds(t,i,r,s,o,a){const l=s.paint.get("raster-fade-duration");if(!a&&l>0){const s=n.now(),a=(s-t.timeAdded)/l,A=i?(s-i.timeAdded)/l:-1,h=r.getSource(),c=mt(o,{tileSize:h.tileSize,roundZoom:h.roundZoom}),u=!i||Math.abs(i.tileID.overscaledZ-c)>Math.abs(t.tileID.overscaledZ-c),f=u&&t.refreshedUponExpiration?1:e.ag(u?a:1-A,0,1);return t.refreshedUponExpiration&&a>=1&&(t.refreshedUponExpiration=false),i?{opacity:1,mix:1-f}:{opacity:f,mix:0}}return{opacity:1,mix:0}}const gs=new e.be(1,0,0,1),ps=new e.be(0,1,0,1),ms=new e.be(0,0,1,1),ws=new e.be(1,0,1,1),Is=new e.be(0,1,1,1);function vs(t,e,i,r){ys(t,0,e+i/2,t.transform.width,i,r)}function bs(t,e,i,r){ys(t,e-i/2,0,i,t.transform.height,r)}function ys(t,e,i,r,s,o){const n=t.context,a=n.gl;a.enable(a.SCISSOR_TEST),a.scissor(e*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,s*t.pixelRatio),n.clear({color:o}),a.disable(a.SCISSOR_TEST)}function Bs(t,i,r){const s=t.context,o=s.gl,n=t.useProgram("debug"),a=qe.disabled,l=je.disabled,A=t.colorModeForRenderPass(),h="$debug",c=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);s.activeTexture.set(o.TEXTURE0);const u=i.getTileByID(r.key).latestRawTileData,f=Math.floor((u&&u.byteLength||0)/1024),d=i.getTile(r).tileSize,g=512/Math.min(d,512)*(r.overscaledZ/t.transform.zoom)*.5;let p=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(p+=` => ${r.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,r=t.context.gl,s=t.debugOverlayCanvas.getContext("2d");s.clearRect(0,0,i.width,i.height),s.shadowColor="white",s.shadowBlur=2,s.lineWidth=1.5,s.strokeStyle="white",s.textBaseline="top",s.font="bold 36px Open Sans, sans-serif",s.fillText(e,5,5),s.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${p} ${f}kB`);const m=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:true,applyTerrainMatrix:true});n.draw(s,o.TRIANGLES,a,l,Pe.alphaBlended,Te.disabled,Ui(e.be.transparent,g),null,m,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),n.draw(s,o.LINE_STRIP,a,l,A,Te.disabled,Ui(e.be.red),c,m,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function Cs(t,e,i,r){const{isRenderingGlobe:s}=r,o=t.context,n=o.gl,a=t.transform,l=t.colorModeForRenderPass(),A=t.getDepthModeFor3D(),h=t.useProgram("terrain");o.bindFramebuffer.set(null),o.viewport.set([0,0,t.width,t.height]);for(const r of i){const i=e.getTerrainMesh(r.tileID),c=t.renderToTexture.getTexture(r),u=e.getTerrainData(r.tileID);o.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,c.texture);const f=e.getMeshFrameDelta(a.zoom),d=a.calculateFogMatrix(r.tileID.toUnwrapped()),g=Ei(f,d,t.style.sky,a.pitch,s),p=a.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:false,applyGlobeMatrix:true});h.draw(o,n.TRIANGLES,A,je.disabled,l,Te.backCCW,g,u,p,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}function Es(t,i){if(!i.mesh){const r=new e.aK;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);const s=new e.aM;s.emplaceBack(0,1,2),s.emplaceBack(0,2,3),i.mesh=new ye(t.createVertexBuffer(r,Be.members),t.createIndexBuffer(s),e.aL.simpleSegment(0,0,r.length,s.length))}return i.mesh}class _s{constructor(t,i){this.context=new Yr(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:true,matrix:e.af(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=vt.maxUnderzooming+vt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new we}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style._order)this.style._layers[t].resize()}setup(){const t=this.context,i=new e.aK;i.emplaceBack(0,0),i.emplaceBack(e.$,0),i.emplaceBack(0,e.$),i.emplaceBack(e.$,e.$),this.tileExtentBuffer=t.createVertexBuffer(i,Be.members),this.tileExtentSegments=e.aL.simpleSegment(0,0,4,2);const r=new e.aK;r.emplaceBack(0,0),r.emplaceBack(e.$,0),r.emplaceBack(0,e.$),r.emplaceBack(e.$,e.$),this.debugBuffer=t.createVertexBuffer(r,Be.members),this.debugSegments=e.aL.simpleSegment(0,0,4,5);const s=new e.c5;s.emplaceBack(0,0,0,0),s.emplaceBack(e.$,0,e.$,0),s.emplaceBack(0,e.$,0,e.$),s.emplaceBack(e.$,e.$,e.$,e.$),this.rasterBoundsBuffer=t.createVertexBuffer(s,Bi.members),this.rasterBoundsSegments=e.aL.simpleSegment(0,0,4,2);const o=new e.aK;o.emplaceBack(0,0),o.emplaceBack(e.$,0),o.emplaceBack(0,e.$),o.emplaceBack(e.$,e.$),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(o,Be.members),this.rasterBoundsSegmentsPosOnly=e.aL.simpleSegment(0,0,4,5);const n=new e.aK;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(n,Be.members),this.viewportSegments=e.aL.simpleSegment(0,0,4,2);const a=new e.c6;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(a);const l=new e.aM;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);const A=this.context.gl;this.stencilClearMode=new je({func:A.ALWAYS,mask:0},0,255,A.ZERO,A.ZERO,A.ZERO),this.tileExtentMesh=new ye(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const r=e.L();e.bX(r,0,this.width,this.height,0,0,1),e.N(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]);const s={mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r};this.useProgram("clippingMask",null,true).draw(t,i.TRIANGLES,qe.disabled,this.stencilClearMode,Pe.disabled,Te.disabled,null,null,s,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source,this.nextStencilID+e.length>256&&this.clearStencil();const r=this.context;r.setColorMode(Pe.disabled),r.setDepthMode(qe.disabled);const s={};for(const t of e)s[t.key]=this.nextStencilID++;this._renderTileMasks(s,e,i,true),this._renderTileMasks(s,e,i,false),this._tileClippingMaskIDs=s}_renderTileMasks(t,e,i,r){const s=this.context,o=s.gl,n=this.style.projection,a=this.transform,l=this.useProgram("clippingMask");for(const A of e){const e=t[A.key],h=this.style.map.terrain&&this.style.map.terrain.getTerrainData(A),c=n.getMeshFromTileID(this.context,A.canonical,r,true,"stencil"),u=a.getProjectionData({overscaledTileID:A,applyGlobeMatrix:!i,applyTerrainMatrix:true});l.draw(s,o.TRIANGLES,qe.disabled,new je({func:o.ALWAYS,mask:0},e,255,o.KEEP,o.KEEP,o.REPLACE),Pe.disabled,i?Te.disabled:Te.backCCW,null,h,u,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}_renderTilesDepthBuffer(){const t=this.context,e=t.gl,i=this.style.projection,r=this.transform,s=this.useProgram("depth"),o=this.getDepthModeFor3D(),n=wt(r,{tileSize:r.tileSize});for(const a of n){const n=this.style.map.terrain&&this.style.map.terrain.getTerrainData(a),l=i.getMeshFromTileID(this.context,a.canonical,true,true,"raster"),A=r.getProjectionData({overscaledTileID:a,applyGlobeMatrix:true,applyTerrainMatrix:true});s.draw(t,e.TRIANGLES,o,je.disabled,Pe.disabled,Te.backCCW,null,n,A,"$clipping",l.vertexBuffer,l.indexBuffer,l.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new je({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new je({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){const e=this.context.gl,i=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=i[i.length-1].overscaledZ,s=i[0].overscaledZ-r+1;if(s>1){this.currentStencilSource=void 0,this.nextStencilID+s>256&&this.clearStencil();const t={};for(let i=0;i<s;i++)t[i+r]=new je({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=s,[t,i]}return[{[r]:je.disabled},i]}stencilConfigForOverlapTwoPass(t){const e=this.context.gl,i=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=i[i.length-1].overscaledZ,s=i[0].overscaledZ-r+1;if(this.clearStencil(),s>1){const t={},o={};for(let i=0;i<s;i++)t[i+r]=new je({func:e.GREATER,mask:255},s+1+i,255,e.KEEP,e.KEEP,e.REPLACE),o[i+r]=new je({func:e.GREATER,mask:255},1+i,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID=2*s+1,[t,o,i]}return this.nextStencilID=3,[{[r]:new je({func:e.GREATER,mask:255},2,255,e.KEEP,e.KEEP,e.REPLACE)},{[r]:new je({func:e.GREATER,mask:255},1,255,e.KEEP,e.KEEP,e.REPLACE)},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new Pe([t.CONSTANT_COLOR,t.ONE],new e.be(i,i,i,0),[true,true,true,true])}return"opaque"===this.renderPass?Pe.unblended:Pe.alphaBlended}getDepthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return qe.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new qe(i||this.context.gl.LEQUAL,e,[r,r])}getDepthModeFor3D(){return new qe(this.context.gl.LEQUAL,qe.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){var r,s;this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(n.now()),this.imageManager.beginFrame();const o=this.style._order,a=this.style.sourceCaches,l={},A={},h={},c={isRenderingToTexture:false,isRenderingGlobe:(null===(r=t.projection)||void 0===r?void 0:r.transitionState)>0};for(const t in a){const e=a[t];e.used&&e.prepare(this.context),l[t]=e.getVisibleCoordinates(false),A[t]=l[t].slice().reverse(),h[t]=e.getVisibleCoordinates(true).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<o.length;t++)if(this.style._layers[o[t]].is3D()){this.opaquePassCutoff=t;break}this.maybeDrawDepthAndCoords(false),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const t of o){const e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const i=A[e.source];("custom"===e.type||i.length)&&this.renderLayer(this,a[e.source],e,i,c)}if(null===(s=this.style.projection)||void 0===s||s.updateGPUdependent({context:this.context,useProgram:t=>this.useProgram(t)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.be.black:e.be.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,e){const i=t.context,r=i.gl,s=((t,e,i)=>{const r=Math.cos(e.rollInRadians),s=Math.sin(e.rollInRadians),o=ht(e),n=e.getProjectionData({overscaledTileID:null,applyGlobeMatrix:true,applyTerrainMatrix:true}).projectionTransition;return{u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:[(e.width/2-o*s)*i,(e.height/2+o*r)*i],u_horizon_normal:[-s,r],u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*e.height/2*i,u_sky_blend:n}})(e,t.style.map.transform,t.pixelRatio),o=new qe(r.LEQUAL,qe.ReadWrite,[0,1]),n=je.disabled,a=t.colorModeForRenderPass(),l=t.useProgram("sky"),A=Es(i,e);l.draw(i,r.TRIANGLES,o,n,a,Te.disabled,s,null,void 0,"sky",A.vertexBuffer,A.indexBuffer,A.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[o[this.currentLayer]],e=a[t.source],i=l[t.source];this._renderTileClippingMasks(t,i,false),this.renderLayer(this,e,t,i,c)}this.renderPass="translucent";let u=false;for(this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){const t=this.style._layers[o[this.currentLayer]],e=a[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t,c))continue;this.opaquePassEnabledForLayer()||u||(u=true,c.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const i=("symbol"===t.type?h:A)[t.source];this._renderTileClippingMasks(t,l[t.source],!!this.renderToTexture),this.renderLayer(this,e,t,i,c)}if(c.isRenderingGlobe&&function(t,i,r){const s=t.context,o=s.gl,n=t.useProgram("atmosphere"),a=new qe(o.LEQUAL,qe.ReadOnly,[0,1]),l=t.transform,A=function(t,i){const r=t.properties.get("position"),s=[-r.x,-r.y,-r.z],o=e.af(new Float64Array(16));return"map"===t.properties.get("anchor")&&(e.b5(o,o,i.rollInRadians),e.b6(o,o,-i.pitchInRadians),e.b5(o,o,i.bearingInRadians),e.b6(o,o,i.center.lat*Math.PI/180),e.by(o,o,-i.center.lng*Math.PI/180)),e.c4(s,s,o),s}(r,t.transform),h=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:true,applyTerrainMatrix:true}),c=i.properties.get("atmosphere-blend")*h.projectionTransition;if(0===c)return;const u=ri(l.worldSize,l.center.lat),f=l.inverseProjectionMatrix,d=new Float64Array(4);d[3]=1,e.av(d,d,l.modelViewProjectionMatrix),d[0]/=d[3],d[1]/=d[3],d[2]/=d[3],d[3]=1,e.av(d,d,f),d[0]/=d[3],d[1]/=d[3],d[2]/=d[3],d[3]=1;const g=((t,e,i,r,s)=>({u_sun_pos:t,u_atmosphere_blend:e,u_globe_position:i,u_globe_radius:r,u_inv_proj_matrix:s}))(A,c,[d[0],d[1],d[2]],u,f),p=Es(s,i);n.draw(s,o.TRIANGLES,a,je.disabled,Pe.alphaBlended,Te.disabled,g,null,null,"atmosphere",p.vertexBuffer,p.indexBuffer,p.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const t=function(t,e){let i=null;const r=Object.values(t._layers).flatMap((i=>i.source&&!i.isHidden(e)?[t.sourceCaches[i.source]]:[])),s=r.filter((t=>"vector"===t.getSource().type)),o=r.filter((t=>"vector"!==t.getSource().type)),n=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return s.forEach((t=>n(t))),i||o.forEach((t=>n(t))),i}(this.style,this.transform.zoom);t&&function(t,e,i){for(let r=0;r<i.length;r++)Bs(t,e,i[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;vs(t,t.transform.height-(e.top||0),3,gs),vs(t,e.bottom||0,3,ps),bs(t,e.left||0,3,ms),bs(t,t.transform.width-(e.right||0),3,ws);const i=t.transform.centerPoint;!function(t,e,i,r){ys(t,e-1,i-10,2,20,r),ys(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,Is)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix;let s=this.terrainFacilitator.dirty;s||(s=t?!e.c7(i,r):!e.c8(i,r)),s||(s=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),s&&(e.c9(i,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=false,function(t,i){const r=t.context,s=r.gl,o=t.transform,n=Pe.unblended,a=new qe(s.LEQUAL,qe.ReadWrite,[0,1]),l=i.sourceCache.getRenderableTiles(),A=t.useProgram("terrainDepth");r.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.be.transparent,depth:1});for(const t of l){const e=i.getTerrainMesh(t.tileID),l=i.getTerrainData(t.tileID),h=o.getProjectionData({overscaledTileID:t.tileID,applyTerrainMatrix:false,applyGlobeMatrix:true}),c={u_ele_delta:i.getMeshFrameDelta(o.zoom)};A.draw(r,s.TRIANGLES,a,je.disabled,n,Te.backCCW,c,l,h,"terrain",e.vertexBuffer,e.indexBuffer,e.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){const r=t.context,s=r.gl,o=t.transform,n=Pe.unblended,a=new qe(s.LEQUAL,qe.ReadWrite,[0,1]),l=i.getCoordsTexture(),A=i.sourceCache.getRenderableTiles(),h=t.useProgram("terrainCoords");r.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.be.transparent,depth:1}),i.coordsIndex=[];for(const t of A){const e=i.getTerrainMesh(t.tileID),A=i.getTerrainData(t.tileID);r.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.texture);const c={u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(o.zoom)},u=o.getProjectionData({overscaledTileID:t.tileID,applyTerrainMatrix:false,applyGlobeMatrix:true});h.draw(r,s.TRIANGLES,a,je.disabled,n,Te.backCCW,c,A,u,"terrain",e.vertexBuffer,e.indexBuffer,e.segments),i.coordsIndex.push(t.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,r,s,o){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||(s||[]).length)&&(this.id=r.id,e.ca(r)?function(t,i,r,s,o,n){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:a}=n,l=je.disabled,A=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,s,o,n,a,l,A){const h=i.transform,c=i.style.map.terrain,u="map"===o,f="map"===n;for(const o of t){const t=s.getTile(o),n=t.getBucket(r);if(!n||!n.text||!n.text.segments.get().length)continue;const d=e.am(n.textSizeData,h.zoom),g=e.aB(t,1,i.transform.zoom),p=_t(u,i.transform,g),m="none"!==r.layout.get("icon-text-fit")&&n.hasIconData();if(d){const i=Math.pow(2,h.zoom-t.tileID.overscaledZ),r=c?(t,e)=>c.getElevation(o,t,e):null;Xr(n,u,f,A,h,p,i,d,m,e.aC(h,t,a,l),o.toUnwrapped(),r)}}}(s,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&es(t,i,r,s,false,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),l,A,a),0!==r.paint.get("text-opacity").constantOr(1)&&es(t,i,r,s,true,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),l,A,a),i.map.showCollisionBoxes&&(Vr(t,i,r,s,true),Vr(t,i,r,s,false))}(t,i,r,s,this.style.placement.variableOffsets,o):e.cb(r)?function(t,i,r,s,o){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:n}=o,a=r.paint.get("circle-opacity"),l=r.paint.get("circle-stroke-width"),A=r.paint.get("circle-stroke-opacity"),h=!r.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===l.constantOr(1)||0===A.constantOr(1)))return;const c=t.context,u=c.gl,f=t.transform,d=t.getDepthModeForSublayer(0,qe.ReadOnly),g=je.disabled,p=t.colorModeForRenderPass(),m=[],w=f.getCircleRadiusCorrection();for(let o=0;o<s.length;o++){const a=s[o],l=i.getTile(a),A=l.getBucket(r);if(!A)continue;const c=r.paint.get("circle-translate"),u=r.paint.get("circle-translate-anchor"),d=e.aC(f,l,c,u),g=A.programConfigurations.get(r.id),p=t.useProgram("circle",g),I=A.layoutVertexBuffer,v=A.indexBuffer,b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(a),y={programConfiguration:g,program:p,layoutVertexBuffer:I,indexBuffer:v,uniformValues:Ri(t,l,r,d,w),terrainData:b,projectionData:f.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!n,applyTerrainMatrix:true})};if(h){const t=A.segments.get();for(const i of t)m.push({segments:new e.aL([i]),sortKey:i.sortKey,state:y})}else m.push({segments:A.segments,sortKey:0,state:y})}h&&m.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of m){const{programConfiguration:i,program:s,layoutVertexBuffer:o,indexBuffer:n,uniformValues:a,terrainData:l,projectionData:A}=e.state;s.draw(c,u.TRIANGLES,d,g,p,Te.backCCW,a,l,A,r.id,o,n,e.segments,r.paint,t.transform.zoom,i)}}(t,i,r,s,o):e.cc(r)?function(t,i,r,s,o){if(0===r.paint.get("heatmap-opacity"))return;const n=t.context,{isRenderingToTexture:a,isRenderingGlobe:l}=o;if(t.style.map.terrain){for(const e of s){const s=i.getTile(e);i.hasRenderableParent(e)||("offscreen"===t.renderPass?rs(t,s,r,e,l):"translucent"===t.renderPass&&ss(t,r,e,a,l))}n.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,i,r,s){const o=t.context,n=o.gl,a=t.transform,l=je.disabled,A=new Pe([n.ONE,n.ONE],e.be.transparent,[true,true,true,true]);(function(t,i,r){const s=t.gl;t.activeTexture.set(s.TEXTURE1),t.viewport.set([0,0,i.width/4,i.height/4]);let o=r.heatmapFbos.get(e.c1);o?(s.bindTexture(s.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer)):(o=os(t,i.width/4,i.height/4),r.heatmapFbos.set(e.c1,o))})(o,t,r),o.clear({color:e.be.transparent});for(let e=0;e<s.length;e++){const h=s[e];if(i.hasRenderableParent(h))continue;const c=i.getTile(h),u=c.getBucket(r);if(!u)continue;const f=u.programConfigurations.get(r.id),d=t.useProgram("heatmap",f),g=a.getProjectionData({overscaledTileID:h,applyGlobeMatrix:true,applyTerrainMatrix:false}),p=a.getCircleRadiusCorrection();d.draw(o,n.TRIANGLES,qe.disabled,l,A,Te.backCCW,Pi(c,a.zoom,r.paint.get("heatmap-intensity"),p),null,g,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,a.zoom,f)}o.viewport.set([0,0,t.width,t.height])}(t,i,r,s):"translucent"===t.renderPass&&function(t,i){const r=t.context,s=r.gl;r.setColorMode(t.colorModeForRenderPass());const o=i.heatmapFbos.get(e.c1);o&&(r.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(s.TEXTURE1),ns(r,i).bind(s.LINEAR,s.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,s.TRIANGLES,qe.disabled,je.disabled,t.colorModeForRenderPass(),Te.disabled,Ni(t,i,0,1),null,null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,r)}(t,i,r,s,o):e.cd(r)?function(t,i,r,s,o){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:n}=o,a=r.paint.get("line-opacity"),l=r.paint.get("line-width");if(0===a.constantOr(1)||0===l.constantOr(1))return;const A=t.getDepthModeForSublayer(0,qe.ReadOnly),h=t.colorModeForRenderPass(),c=r.paint.get("line-dasharray"),u=r.paint.get("line-pattern"),f=u.constantOr(1),d=r.paint.get("line-gradient"),g=r.getCrossfadeParameters(),p=f?"linePattern":c?"lineSDF":d?"lineGradient":"line",m=t.context,w=m.gl,I=t.transform;let v=true;for(const o of s){const s=i.getTile(o);if(f&&!s.patternsLoaded())continue;const a=s.getBucket(r);if(!a)continue;const l=a.programConfigurations.get(r.id),b=t.context.program.get(),y=t.useProgram(p,l),B=v||y.program!==b,C=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),E=u.constantOr(null);if(E&&s.imageAtlas){const t=s.imageAtlas,e=t.patternPositions[E.to.toString()],i=t.patternPositions[E.from.toString()];e&&i&&l.setConstantPatternPositions(e,i)}const _=I.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!n,applyTerrainMatrix:true}),Q=I.getPixelScale(),x=f?Yi(t,s,r,Q,g):c?$i(t,s,r,Q,c,g):d?Hi(t,s,r,Q,a.lineClipsArray.length):Ji(t,s,r,Q);if(f)m.activeTexture.set(w.TEXTURE0),s.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),l.updatePaintBuffers(g);else if(c&&(B||t.lineAtlas.dirty))m.activeTexture.set(w.TEXTURE0),t.lineAtlas.bind(m);else if(d){const s=a.gradients[r.id];let n=s.texture;if(r.gradientVersion!==s.version){let l=256;if(r.stepInterpolant){const r=i.getSource().maxzoom,s=o.canonical.z===r?Math.ceil(1<<t.transform.maxZoom-o.canonical.z):1;l=e.ag(e.c2(a.maxLineLength/e.$*1024*s),256,m.maxTextureSize)}s.gradient=e.c3({expression:r.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:s.gradient||void 0,clips:a.lineClipsArray}),s.texture?s.texture.update(s.gradient):s.texture=new e.T(m,s.gradient,w.RGBA),s.version=r.gradientVersion,n=s.texture}m.activeTexture.set(w.TEXTURE0),n.bind(r.stepInterpolant?w.NEAREST:w.LINEAR,w.CLAMP_TO_EDGE)}const M=t.stencilModeForClipping(o);y.draw(m,w.TRIANGLES,A,M,h,Te.disabled,x,C,_,r.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,r.paint,t.transform.zoom,l,a.layoutVertexBuffer2),v=false}}(t,i,r,s,o):e.ce(r)?function(t,i,r,s,o){const n=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0===a.constantOr(1))return;const{isRenderingToTexture:l}=o,A=t.colorModeForRenderPass(),h=r.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!h.constantOr(1)&&1===n.constantOr(e.be.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const e=t.getDepthModeForSublayer(1,"opaque"===t.renderPass?qe.ReadWrite:qe.ReadOnly);ls(t,i,r,s,e,A,false,l)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const e=t.getDepthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,qe.ReadOnly);ls(t,i,r,s,e,A,true,l)}}(t,i,r,s,o):e.cf(r)?function(t,e,i,r,s){const o=i.paint.get("fill-extrusion-opacity");if(0===o)return;const{isRenderingToTexture:n}=s;if("translucent"===t.renderPass){const s=new qe(t.context.gl.LEQUAL,qe.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))As(t,e,i,r,s,je.disabled,Pe.disabled,n),As(t,e,i,r,s,t.stencilModeFor3D(),t.colorModeForRenderPass(),n);else{const o=t.colorModeForRenderPass();As(t,e,i,r,s,je.disabled,o,n)}}}(t,i,r,s,o):e.cg(r)?function(t,i,r,s,o){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const{isRenderingToTexture:n}=o,a=t.context,l=t.style.projection.useSubdivision,A=t.getDepthModeForSublayer(0,qe.ReadOnly),h=t.colorModeForRenderPass();if("offscreen"===t.renderPass)!function(t,i,r,s,o,n,a){const l=t.context,A=l.gl;for(const h of r){const r=i.getTile(h),c=r.dem;if(!c||!c.data)continue;if(!r.needsHillshadePrepare)continue;const u=c.dim,f=c.stride,d=c.getPixels();if(l.activeTexture.set(A.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(false),r.demTexture=r.demTexture||t.getTileTexture(f),r.demTexture){const t=r.demTexture;t.update(d,{premultiply:false}),t.bind(A.NEAREST,A.CLAMP_TO_EDGE)}else r.demTexture=new e.T(l,d,A.RGBA,{premultiply:false}),r.demTexture.bind(A.NEAREST,A.CLAMP_TO_EDGE);l.activeTexture.set(A.TEXTURE0);let g=r.fbo;if(!g){const t=new e.T(l,{width:u,height:u,data:null},A.RGBA);t.bind(A.LINEAR,A.CLAMP_TO_EDGE),g=r.fbo=l.createFramebuffer(u,u,true,false),g.colorAttachment.set(t.texture)}l.bindFramebuffer.set(g.framebuffer),l.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(l,A.TRIANGLES,o,n,a,Te.disabled,qi(r.tileID,c),null,null,s.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=false}}(t,i,s,r,A,je.disabled,h),a.viewport.set([0,0,t.width,t.height]);else if("translucent"===t.renderPass)if(l){const[e,o,a]=t.stencilConfigForOverlapTwoPass(s);hs(t,i,r,a,e,A,h,false,n),hs(t,i,r,a,o,A,h,true,n)}else{const[e,o]=t.getStencilConfigForOverlapAndUpdateStencilID(s);hs(t,i,r,o,e,A,h,false,n)}}(t,i,r,s,o):e.ch(r)?function(t,e,i,r,s){if("translucent"!==t.renderPass)return;if(!r.length)return;const{isRenderingToTexture:o}=s,n=t.style.projection.useSubdivision,a=t.getDepthModeForSublayer(0,qe.ReadOnly),l=t.colorModeForRenderPass();if(n){const[s,n,A]=t.stencilConfigForOverlapTwoPass(r);cs(t,e,i,A,s,a,l,false,o),cs(t,e,i,A,n,a,l,true,o)}else{const[s,n]=t.getStencilConfigForOverlapAndUpdateStencilID(r);cs(t,e,i,n,s,a,l,false,o)}}(t,i,r,s,o):e.ci(r)?function(t,e,i,r,s){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;if(!r.length)return;const{isRenderingToTexture:o}=s,n=e.getSource(),a=t.style.projection.useSubdivision;if(n instanceof V)fs(t,e,i,r,null,false,false,n.tileCoords,n.flippedWindingOrder,o);else if(a){const[s,n,a]=t.stencilConfigForOverlapTwoPass(r);fs(t,e,i,a,s,false,true,us,false,o),fs(t,e,i,a,n,true,true,us,false,o)}else{const[s,n]=t.getStencilConfigForOverlapAndUpdateStencilID(r);fs(t,e,i,n,s,false,true,us,false,o)}}(t,i,r,s,o):e.cj(r)?function(t,e,i,r,s){const o=i.paint.get("background-color"),n=i.paint.get("background-opacity");if(0===n)return;const{isRenderingToTexture:a}=s,l=t.context,A=l.gl,h=t.style.projection,c=t.transform,u=c.tileSize,f=i.paint.get("background-pattern");if(t.isPatternMissing(f))return;const d=!f&&1===o.a&&1===n&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==d)return;const g=je.disabled,p=t.getDepthModeForSublayer(0,"opaque"===d?qe.ReadWrite:qe.ReadOnly),m=t.colorModeForRenderPass(),w=t.useProgram(f?"backgroundPattern":"background"),I=r||wt(c,{tileSize:u,terrain:t.style.map.terrain});f&&(l.activeTexture.set(A.TEXTURE0),t.imageManager.bind(t.context));const v=i.getCrossfadeParameters();for(const e of I){const r=c.getProjectionData({overscaledTileID:e,applyGlobeMatrix:!a,applyTerrainMatrix:true}),s=f?rr(n,t,f,{tileID:e,tileSize:u},v):ir(n,o),d=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e),I=h.getMeshFromTileID(l,e.canonical,false,true,"raster");w.draw(l,A.TRIANGLES,p,g,m,Te.backCCW,s,d,r,i.id,I.vertexBuffer,I.indexBuffer,I.segments)}}(t,0,r,s,o):e.ck(r)&&function(t,e,i,r){const{isRenderingGlobe:s}=r,o=t.context,n=i.implementation,a=t.style.projection,l=t.transform,A=l.getProjectionDataForCustomLayer(s),h={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:a.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${a.shaderPreludeCode.vertexSource}`,define:a.shaderDefine},defaultProjectionData:A},c=n.renderingMode?n.renderingMode:"2d";if("offscreen"===t.renderPass){const e=n.prerender;e&&(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),e.call(n,o.gl,h),o.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(je.disabled);const e="3d"===c?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,qe.ReadOnly);o.setDepthMode(e),n.render(o.gl,h),o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}(t,0,r,o))}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return false;if(!t.from||!t.to)return true;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e,i=false,r=[]){this.cache=this.cache||{};const s=!!this.style.map.terrain,o=this.style.projection,n=i?ve.projectionMercator:o.shaderPreludeCode,a=i?Ce:o.shaderDefine,l=t+(e?e.cacheKey:"")+`/${i?Ee:o.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(s?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[l]||(this.cache[l]=new xi(this.context,ve[t],e,or[t],this._showOverdrawInspector,s,n,a,r)),this.cache[l]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(false),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}function Qs(t,e){let i,r=false,s=null,o=null;const n=()=>{s=null,r&&(t.apply(o,i),s=setTimeout(n,e),r=false)};return(...t)=>(r=true,o=this,i=t,s||n(),s)}class xs{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(!this._isValidHash(t))return false;const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),true},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let i=e;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i=`${this._hashName}=${e}`);let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let s=window.location.href.replace(/(#.+)?$/,r);s=s.replace("&&","&"),window.history.replaceState(window.history.state,null,s)},this._updateHash=Qs(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,false),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,false),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),s=Math.pow(10,r),o=Math.round(e.lng*s)/s,n=Math.round(e.lat*s)/s,a=this._map.getBearing(),l=this._map.getPitch();let A="";if(A+=t?`/${o}/${n}/${i}`:`${i}/${n}/${o}`,(a||l)&&(A+="/"+Math.round(10*a)/10),l&&(A+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=false;const i=window.location.hash.slice(1).split("&").map((i=>{const r=i.split("=")[0];return r===t?(e=true,`${r}=${A}`):i})).filter((t=>t));return e||i.push(`${t}=${A}`),`#${i.join("&")}`}return`#${A}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return false;try{new e.S(+t[2],+t[1])}catch(t){return false}const i=+t[0],r=+(t[3]||0),s=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&s>=this._map.getMinPitch()&&s<=this._map.getMaxPitch()}}const Ms={linearity:.3,easing:e.cl(0,0,.3,1)},ks=e.e({deceleration:2500,maxSpeed:1400},Ms),Ds=e.e({deceleration:20,maxSpeed:1400},Ms),Ss=e.e({deceleration:1e3,maxSpeed:360},Ms),Gs=e.e({deceleration:1e3,maxSpeed:90},Ms),Fs=e.e({deceleration:1e3,maxSpeed:360},Ms);class Rs{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:n.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=n.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,roll:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(i.pan.mag()){const o=zs(i.pan.mag(),r,e.e({},ks,t||{})),n=i.pan.mult(o.amount/i.pan.mag()),a=this._map.cameraHelper.handlePanInertia(n,this._map.transform);s.center=a.easingCenter,s.offset=a.easingOffset,Ls(s,o)}if(i.zoom){const t=zs(i.zoom,r,Ds);s.zoom=this._map.transform.zoom+t.amount,Ls(s,t)}if(i.bearing){const t=zs(i.bearing,r,Ss);s.bearing=this._map.transform.bearing+e.ag(t.amount,-179,179),Ls(s,t)}if(i.pitch){const t=zs(i.pitch,r,Gs);s.pitch=this._map.transform.pitch+t.amount,Ls(s,t)}if(i.roll){const t=zs(i.roll,r,Fs);s.roll=this._map.transform.roll+e.ag(t.amount,-179,179),Ls(s,t)}if(s.zoom||s.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;s.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(s,{noMoveStart:true})}}function Ls(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function zs(t,i,r){const{maxSpeed:s,linearity:o,deceleration:n}=r,a=e.ag(t*o/(i/1e3),-s,s),l=Math.abs(a)/(n*o);return{easing:r.easing,duration:1e3*l,amount:a*(l/2)}}class Us extends e.l{preventDefault(){this._defaultPrevented=true}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r,s={}){r=r instanceof MouseEvent?r:new MouseEvent(t,r);const o=a.mousePos(i.getCanvas(),r),n=i.unproject(o);super(t,e.e({point:o,lngLat:n,originalEvent:r},s)),this._defaultPrevented=false,this.target=i}}class Ps extends e.l{preventDefault(){this._defaultPrevented=true}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const s="touchend"===t?r.changedTouches:r.touches,o=a.touchPos(i.getCanvasContainer(),s),n=o.map((t=>i.unproject(t))),l=o.reduce(((t,e,i,r)=>t.add(e.div(r.length))),new e.P(0,0));super(t,{points:o,point:l,lngLats:n,lngLat:i.unproject(l),originalEvent:r}),this._defaultPrevented=false}}class Ns extends e.l{preventDefault(){this._defaultPrevented=true}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=false}}class Ts{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Ns(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Us(t.type,this._map,t))}mouseup(t){this._map.fire(new Us(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Us(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Us(t.type,this._map,t))}mouseover(t){this._map.fire(new Us(t.type,this._map,t))}mouseout(t){this._map.fire(new Us(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Ps(t.type,this._map,t))}touchmove(t){this._map.fire(new Ps(t.type,this._map,t))}touchend(t){this._map.fire(new Ps(t.type,this._map,t))}touchcancel(t){this._map.fire(new Ps(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return true}isActive(){return false}enable(){}disable(){}}class qs{constructor(t){this._map=t}reset(){this._delayContextMenu=false,this._ignoreContextMenu=true,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Us(t.type,this._map,t))}mousedown(){this._delayContextMenu=true,this._ignoreContextMenu=false}mouseup(){this._delayContextMenu=false,this._contextMenuEvent&&(this._map.fire(new Us("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Us(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return true}isActive(){return false}enable(){}disable(){}}class Os{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(e.P.convert(t),this._map.terrain)}}class js{constructor(t,e){this._map=t,this._tr=new Os(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=true)}disable(){this.isEnabled()&&(this._enabled=false)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(a.disableDrag(),this._startPos=this._lastPos=e,this._active=true)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;const r=this._startPos;this._lastPos=i,this._box||(this._box=a.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const s=Math.min(r.x,i.x),o=Math.max(r.x,i.x),n=Math.min(r.y,i.y),l=Math.max(r.y,i.y);a.setTransform(this._box,`translate(${s}px,${n}px)`),this._box.style.width=o-s+"px",this._box.style.height=l-n+"px"}mouseupWindow(t,i){if(!this._active)return;if(0!==t.button)return;const r=this._startPos,s=i;if(this.reset(),a.suppressClick(),r.x!==s.x||r.y!==s.y)return this._map.fire(new e.l("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(r,s,this._tr.bearing,{linear:true})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=false,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.l(t,{originalEvent:i}))}}function Js(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}class Hs{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=false}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=true),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=Js(r,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const r=Js(i,e);for(const t in this.touches){const e=r[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=true)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=true),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class Ys{constructor(t){this.singleTap=new Hs(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const r=this.singleTap.touchend(t,e,i);if(r){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class $s{constructor(t){this._tr=new Os(t),this._zoomIn=new Ys({numTouches:1,numTaps:2}),this._zoomOut=new Ys({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=false,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const r=this._zoomIn.touchend(t,e,i),s=this._zoomOut.touchend(t,e,i),o=this._tr;return r?(this._active=true,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:o.zoom+1,around:o.unproject(r)},{originalEvent:t})}):s?(this._active=true,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:o.zoom-1,around:o.unproject(s)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Vs{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=false,this._moved=false,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.rollDelta||e.around||e.panDelta)return this._active=true,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(e)?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=true))}dragMove(t,e){if(!this.isEnabled())return;const i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const r=Array.isArray(e)?e[0]:e;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=true,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&a.suppressClick(),this.reset(t))}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Ks=0,Zs=2,Ws={[Ks]:1,[Zs]:2};class Xs{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const e=a.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){const i=Ws[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return a.mouseButton(t)===this._eventButton}}class to{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class eo{constructor(t=new Xs({checkCorrectEvent:()=>true}),e=new to){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=e}_executeRelevantHandler(t,e,i){return t instanceof MouseEvent?e(t):"undefined"!=typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.startMove(t)),(t=>this.oneFingerTouchMoveStateManager.startMove(t)))}endMove(t){this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.endMove(t)),(t=>this.oneFingerTouchMoveStateManager.endMove(t)))}isValidStartEvent(t){return this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.isValidStartEvent(t)),(t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.isValidMoveEvent(t)),(t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.isValidEndEvent(t)),(t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t)))}}const io=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class ro{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=false,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,e,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=true);const s=Js(r,i),o=new e.P(0,0),n=new e.P(0,0);let a=0;for(const t in s){const e=s[t],i=this._touches[t];i&&(o._add(e),n._add(e.sub(i)),a++,s[t]=e)}if(this._touches=s,this._shouldBePrevented(a)||!n.mag())return;const l=n.div(a);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(a),panDelta:l}}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class so{constructor(){this.reset()}reset(){this._active=false,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[r,s]=this._firstTwoTouches,o=oo(i,e,r),n=oo(i,e,s);if(!o||!n)return;const a=this._aroundCenter?null:o.add(n).div(2);return this._move([o,n],a,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[r,s]=this._firstTwoTouches,o=oo(i,e,r),n=oo(i,e,s);o&&n||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=true,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=false,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function oo(t,e,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function no(t,e){return Math.log(t/e)/Math.LN2}class ao extends so{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(no(this._distance,this._startDistance))<.1))return this._active=true,{zoomDelta:no(this._distance,i),pinchAround:e}}}function lo(t,e){return 180*t.angleWith(e)/Math.PI}class Ao extends so{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e,i){const r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=true,{bearingDelta:lo(this._vector,r),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=lo(t,this._startVector);return Math.abs(i)<e}}function ho(t){return Math.abs(t.y)>Math.abs(t.x)}class co extends so{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,ho(t[0].sub(t[1]))&&(this._valid=false)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const r=t[0].sub(this._lastPoints[0]),s=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,s,i.timeStamp),this._valid?(this._lastPoints=t,this._active=true,{pitchDelta:(r.y+s.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const r=t.mag()>=2,s=e.mag()>=2;if(!r&&!s)return;if(!r||!s)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=t.y>0==e.y>0;return ho(t)&&ho(e)&&o}}const uo={panStep:100,bearingStep:15,pitchStep:10};class fo{constructor(t){this._tr=new Os(t);const e=uo;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=false}reset(){this._active=false}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,r=0,s=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),s=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),s=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:n=>{const a=this._tr;n.easeTo({duration:300,easeId:"keyboardHandler",easing:go,zoom:e?Math.round(a.zoom)+e*(t.shiftKey?2:1):a.zoom,bearing:a.bearing+i*this._bearingStep,pitch:a.pitch+r*this._pitchStep,offset:[-s*this._panStep,-o*this._panStep],center:a.center},{originalEvent:t})}}}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=true}enableRotation(){this._rotationDisabled=false}}function go(t){return t*(2-t)}const po=4.000244140625,mo=1/450;class wo{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Os(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=mo}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=true,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=false)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=n.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%po==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=true,this.isZooming()||(this._zooming=true),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const i=a.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(e.S.convert(r.center)):i,this._frameId||(this._frameId=true,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){const e=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=e),"number"==typeof this._targetZoom&&(this._targetZoom+=e)}if(0!==this._delta){const i="wheel"===this._type&&Math.abs(this._delta)>po?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);const s="number"!=typeof this._targetZoom?t.scale:e.ae(this._targetZoom);this._targetZoom=t.getConstrained(t.getCameraLngLat(),e.aj(s*r)).zoom,"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i="number"!=typeof this._targetZoom?t.zoom:this._targetZoom,r=this._startZoom,s=this._easing;let o,a=false;if("wheel"===this._type&&r&&s){const t=n.now()-this._lastWheelEventTime,l=Math.min((t+5)/200,1),A=s(l);o=e.C.number(r,i,A),l<1?this._frameId||(this._frameId=true):a=true}else o=i,a=true;return this._active=true,a&&(this._active=false,this._finishTimeout=setTimeout((()=>{this._zooming=false,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=o,{noInertia:true,needsRenderFrame:!a,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.cn;if(this._prevEase){const t=this._prevEase,r=(n.now()-t.start)/t.duration,s=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(s*s+1e-4)*.01,a=Math.sqrt(.0729-o*o);i=e.cl(o,a,.25,1)}return this._prevEase={start:n.now(),duration:t,easing:i},i}reset(){this._active=false,this._zooming=false,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Io{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 vo{constructor(t){this._tr=new Os(t),this.reset()}reset(){this._active=false}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class bo{constructor(){this._tap=new Ys({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=false,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,i){if(!this._swipePoint)if(this._tapTime){const r=e[0],s=t.timeStamp-this._tapTime<500,o=this._tapPoint.dist(r)<30;s&&o?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const r=e[0],s=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=true,{zoomDelta:s/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{const r=this._tap.touchend(t,e,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yo{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Bo{constructor(t,e,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=e,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Co{constructor(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=false,this._enabled=true}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=true,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=false,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Eo{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=false}isActive(){return false}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=e,this._container.appendChild(r);const s=document.createElement("div");s.className="maplibregl-mobile-message",s.textContent=i,this._container.appendChild(s),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=true}disable(){this._enabled=false,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new e.l("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const _o=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class Qo extends e.l{}function xo(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class Mo{constructor(t,i){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(true);this._updatingCamera=true;const r="renderFrame"===t.type?void 0:t,s={needsRenderFrame:false},o={},n={};for(const{handlerName:l,handler:A,allowed:h}of this._handlers){if(!A.isEnabled())continue;let c;if(this._blockedByActive(n,h,l))A.reset();else if(A[i||t.type]){if(e.co(t,i||t.type)){const e=a.mousePos(this._map.getCanvas(),t);c=A[i||t.type](t,e)}else if(e.cp(t,i||t.type)){const e=this._getMapTouches(t.touches),r=a.touchPos(this._map.getCanvas(),e);c=A[i||t.type](t,r,e)}else e.cq(i||t.type)||(c=A[i||t.type](t));this.mergeHandlerResult(s,o,c,l,r),c&&c.needsRenderFrame&&this._triggerRenderFrame()}(c||A.isActive())&&(n[l]=A)}const l={};for(const t in this._previousActiveHandlers)n[t]||(l[t]=r);this._previousActiveHandlers=n,(Object.keys(l).length||xo(s))&&(this._changes.push([s,o,l]),this._triggerRenderFrame()),(Object.keys(n).length||xo(s))&&this._map._stop(true),this._updatingCamera=false;const{cameraAnimation:A}=s;A&&(this._inertia.clear(),this._fireEvents({},{},true),this._changes=[],A(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rs(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const r=this._el;this._listeners=[[r,"touchstart",{passive:true}],[r,"touchmove",{passive:false}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:true}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:false}],[r,"keyup",void 0],[r,"wheel",{passive:false}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[t,e,i]of this._listeners)a.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(const[t,e,i]of this._listeners)a.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){const i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new Ts(i,t));const s=i.boxZoom=new js(i,t);this._add("boxZoom",s),t.interactive&&t.boxZoom&&s.enable();const o=i.cooperativeGestures=new Eo(i,t.cooperativeGestures);this._add("cooperativeGestures",o),t.cooperativeGestures&&o.enable();const n=new $s(i),l=new vo(i);i.doubleClickZoom=new Io(l,n),this._add("tapZoom",n),this._add("clickZoom",l),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();const A=new bo;this._add("tapDragZoom",A);const h=i.touchPitch=new co(i);this._add("touchPitch",h),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);const c=()=>i.project(i.getCenter()),u=function({enable:t,clickTolerance:i,aroundCenter:r=true,minPixelCenterThreshold:s=100,rotateDegreesPerPixelMoved:o=.8},n){const l=new Xs({checkCorrectEvent:t=>0===a.mouseButton(t)&&t.ctrlKey||2===a.mouseButton(t)&&!t.ctrlKey});return new Vs({clickTolerance:i,move:(t,i)=>{const a=n();if(r&&Math.abs(a.y-t.y)>s)return{bearingDelta:e.cm(new e.P(t.x,i.y),i,a)};let l=(i.x-t.x)*o;return r&&i.y<a.y&&(l=-l),{bearingDelta:l}},moveStateManager:l,enable:t,assignEvents:io})}(t,c),f=function({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5}){const r=new Xs({checkCorrectEvent:t=>0===a.mouseButton(t)&&t.ctrlKey||2===a.mouseButton(t)});return new Vs({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:r,enable:t,assignEvents:io})}(t),d=function({enable:t,clickTolerance:e,rollDegreesPerPixelMoved:i=.3},r){const s=new Xs({checkCorrectEvent:t=>2===a.mouseButton(t)&&t.ctrlKey});return new Vs({clickTolerance:e,move:(t,e)=>{const s=r();let o=(e.x-t.x)*i;return e.y<s.y&&(o=-o),{rollDelta:o}},moveStateManager:s,enable:t,assignEvents:io})}(t,c);i.dragRotate=new Bo(t,u,f,d),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",f,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();const g=function({enable:t,clickTolerance:e}){const i=new Xs({checkCorrectEvent:t=>0===a.mouseButton(t)&&!t.ctrlKey});return new Vs({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:true,moveStateManager:i,enable:t,assignEvents:io})}(t),p=new ro(t,i);i.dragPan=new yo(r,g,p),this._add("mousePan",g),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);const m=new Ao,w=new ao;i.touchZoomRotate=new Co(r,w,m,A),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",w,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate);const I=i.scrollZoom=new wo(i,(()=>this._triggerRenderFrame()));this._add("scrollZoom",I,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);const v=i.keyboard=new fo(i);this._add("keyboard",v),t.interactive&&t.keyboard&&i.keyboard.enable(),this._add("blockableMapEvent",new qs(i))}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return true;return false}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(_o(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const r in t)if(r!==i&&(!e||e.indexOf(r)<0))return true;return false}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,r,s,o){if(!r)return;e.e(t,r);const n={handlerName:s,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(i.zoom=n),void 0!==r.panDelta&&(i.drag=n),void 0!==r.rollDelta&&(i.roll=n),void 0!==r.pitchDelta&&(i.pitch=n),void 0!==r.bearingDelta&&(i.rotate=n)}_applyChanges(){const t={},i={},r={};for(const[s,o,n]of this._changes)s.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(s.panDelta)),s.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+s.pitchDelta),s.rollDelta&&(t.rollDelta=(t.rollDelta||0)+s.rollDelta),void 0!==s.around&&(t.around=s.around),void 0!==s.pinchAround&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),e.e(i,o),e.e(r,n);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,e,i){const r=this._map,s=r._getTransformForUpdate(),o=r.terrain;if(!(xo(t)||o&&this._terrainMovement))return this._fireEvents(e,i,true);r._stop(true);let{panDelta:n,zoomDelta:a,bearingDelta:l,pitchDelta:A,rollDelta:h,around:c,pinchAround:u}=t;void 0!==u&&(c=u),c=c||r.transform.centerPoint,o&&!s.isPointOnMapSurface(c)&&(c=s.centerPoint);const f={panDelta:n,zoomDelta:a,rollDelta:h,pitchDelta:A,bearingDelta:l,around:c};this._map.cameraHelper.useGlobeControls&&!s.isPointOnMapSurface(c)&&(c=s.centerPoint);const d=c.distSqr(s.centerPoint)<.01?s.center:s.screenPointToLocation(n?c.sub(n):c);o?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(f,s),this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?s.setCenter(s.screenPointToLocation(s.centerPoint.sub(n))):this._map.cameraHelper.handleMapControlsPan(f,s,d):(this._terrainMovement=true,this._map._elevationFreeze=true,this._map.cameraHelper.handleMapControlsPan(f,s,d))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(f,s),this._map.cameraHelper.handleMapControlsPan(f,s,d)),r._applyUpdatedTransform(s),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,true)}_fireEvents(t,i,r){const s=_o(this._eventsInProgress),o=_o(t),a={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!s&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in a)this._fireEvent(t,a[t]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const l={};let A;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:r}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],A=i[e]||r,l[`${t}end`]=A)}for(const t in l)this._fireEvent(t,l[t]);const h=_o(this._eventsInProgress),c=(s||o)&&!h;if(c&&this._terrainMovement){this._map._elevationFreeze=false,this._terrainMovement=false;const t=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&c){this._updatingCamera=true;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&n.prefersReducedMotion?(this._map.fire(new e.l("moveend",{originalEvent:A})),i(this._map.getBearing())&&this._map.resetNorth()):(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=true,this._map.easeTo(t,{originalEvent:A})),this._updatingCamera=false}}_fireEvent(t,i){this._map.fire(new e.l(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new Qo("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class ko extends e.E{constructor(t,e,i){super(),this._renderFrameCallback=()=>{const t=Math.min((n.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=false,this._zooming=false,this.transform=t,this._bearingSnap=i.bearingSnap,this.cameraHelper=e,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,e){t.apply(this.transform),this.transform=t,this.cameraHelper=e}getCenter(){return new e.S(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,e){return this.jumpTo({elevation:t},e),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(e.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,r){return this.easeTo(e.e({zoom:t},i),r)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new e.l("movestart",i)).fire(new e.l("move",i)).fire(new e.l("moveend",i))),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,r){return this.easeTo(e.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}getRoll(){return this.transform.roll}setRoll(t,e){return this.jumpTo({roll:t},e),this}cameraForBounds(t,e){t=O.convert(t).adjustAntiMeridian();const i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,r,s){const o={top:0,bottom:0,right:0,left:0};if("number"==typeof(s=e.e({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},s)).padding){const t=s.padding;s.padding={top:t,bottom:t,right:t,left:t}}const n=e.e(o,s.padding);s.padding=n;const a=this.transform,l=new O(t,i);return this.cameraHelper.cameraForBoxAndBearing(s,n,l,r,a)}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,r,s,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(e.P.convert(t)),this.transform.screenPointToLocation(e.P.convert(i)),r,s),s,o)}_fitInternal(t,i,r){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop();const r=this._getTransformForUpdate();let s=false,o=false,n=false;const a=r.zoom;this.cameraHelper.handleJumpToCenterZoom(r,t);const l=r.zoom!==a;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(s=true,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(o=true,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(n=true,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this._applyUpdatedTransform(r),this.fire(new e.l("movestart",i)).fire(new e.l("move",i)),l&&this.fire(new e.l("zoomstart",i)).fire(new e.l("zoom",i)).fire(new e.l("zoomend",i)),s&&this.fire(new e.l("rotatestart",i)).fire(new e.l("rotate",i)).fire(new e.l("rotateend",i)),o&&this.fire(new e.l("pitchstart",i)).fire(new e.l("pitch",i)).fire(new e.l("pitchend",i)),n&&this.fire(new e.l("rollstart",i)).fire(new e.l("roll",i)).fire(new e.l("rollend",i)),this.fire(new e.l("moveend",i))}calculateCameraOptionsFromTo(t,i,r,s=0){const o=e.a0.fromLngLat(t,i),n=e.a0.fromLngLat(r,s),a=n.x-o.x,l=n.y-o.y,A=n.z-o.z,h=Math.hypot(a,l,A);if(0===h)throw new Error("Can't calculate camera options with same From and To");const c=Math.hypot(a,l),u=e.aj(this.transform.cameraToCenterDistance/h/this.transform.tileSize),f=180*Math.atan2(a,-l)/Math.PI;let d=180*Math.acos(c/h)/Math.PI;return d=A<0?90-d:90+d,{center:n.toLngLat(),elevation:s,zoom:u,pitch:d,bearing:f}}calculateCameraOptionsFromCameraLngLatAltRotation(t,e,i,r,s){const o=this.transform.calculateCenterFromCameraLngLatAlt(t,e,i,r);return{center:o.center,elevation:o.elevation,zoom:o.zoom,bearing:i,pitch:r,roll:s}}easeTo(t,i){this._stop(false,t.easeId),(false===(t=e.e({offset:[0,0],duration:500,easing:e.cn},t)).animate||!t.essential&&n.prefersReducedMotion)&&(t.duration=0);const r=this._getTransformForUpdate(),s=this.getBearing(),o=r.pitch,a=r.roll,l="bearing"in t?this._normalizeBearing(t.bearing,s):s,A="pitch"in t?+t.pitch:o,h="roll"in t?this._normalizeBearing(t.roll,a):a,c="padding"in t?t.padding:r.padding,u=e.P.convert(t.offset);let f,d;t.around&&(f=e.S.convert(t.around),d=r.locationToScreenPoint(f));const g={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},p=this.cameraHelper.handleEaseTo(r,{bearing:l,pitch:A,roll:h,padding:c,around:f,aroundPoint:d,offsetAsPoint:u,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||s!==l,this._pitching=this._pitching||A!==o,this._rolling=this._rolling||h!==a,this._padding=!r.isPaddingEqual(c),this._zooming=this._zooming||p.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,g),this.terrain&&this._prepareElevation(p.elevationCenter),this._ease((e=>{p.easeFunc(e),this.terrain&&!t.freezeElevation&&this._updateElevation(e),this._applyUpdatedTransform(r),this._fireMoveEvents(i)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,e)}),t),this}_prepareEase(t,i,r={}){this._moving=true,i||r.moving||this.fire(new e.l("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.l("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.l("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.l("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new e.l("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=true}_updateElevation(t){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.setElevation(e.C.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=false,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};const e=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(e,t.zoom):0;if(i<r){const i=this.calculateCameraOptionsFromTo(e,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}_applyUpdatedTransform(t){const e=[];if(e.push((t=>this._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;const i=t.clone();for(const t of e){const e=i.clone(),{center:r,zoom:s,roll:o,pitch:n,bearing:a,elevation:l}=t(e);r&&e.setCenter(r),void 0!==l&&e.setElevation(l),void 0!==s&&e.setZoom(s),void 0!==o&&e.setRoll(o),void 0!==n&&e.setPitch(n),void 0!==a&&e.setBearing(a),i.apply(e)}this.transform.apply(i)}_fireMoveEvents(t){this.fire(new e.l("move",t)),this._zooming&&this.fire(new e.l("zoom",t)),this._rotating&&this.fire(new e.l("rotate",t)),this._pitching&&this.fire(new e.l("pitch",t)),this._rolling&&this.fire(new e.l("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const r=this._zooming,s=this._rotating,o=this._pitching,n=this._rolling;this._moving=false,this._zooming=false,this._rotating=false,this._pitching=false,this._rolling=false,this._padding=false,r&&this.fire(new e.l("zoomend",t)),s&&this.fire(new e.l("rotateend",t)),o&&this.fire(new e.l("pitchend",t)),n&&this.fire(new e.l("rollend",t)),this.fire(new e.l("moveend",t))}flyTo(t,i){if(!t.essential&&n.prefersReducedMotion){const r=e.Q(t,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(r,i)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.cn},t);const r=this._getTransformForUpdate(),s=r.bearing,o=r.pitch,a=r.roll,l=r.padding,A="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:o,c="roll"in t?this._normalizeBearing(t.roll,a):a,u="padding"in t?t.padding:r.padding,f=e.P.convert(t.offset);let d=r.centerPoint.add(f);const g=r.screenPointToLocation(d),p=this.cameraHelper.handleFlyTo(r,{bearing:A,pitch:h,roll:c,padding:u,locationAtOffset:g,offsetAsPoint:f,center:t.center,minZoom:t.minZoom,zoom:t.zoom});let m=t.curve;const w=Math.max(r.width,r.height),I=w/p.scaleOfZoom,v=p.pixelPathLength;"number"==typeof p.scaleOfMinZoom&&(m=Math.sqrt(w/p.scaleOfMinZoom/v*2));const b=m*m;function y(t){const e=(I*I-w*w+(t?-1:1)*b*b*v*v)/(2*(t?I:w)*b*v);return Math.log(Math.sqrt(e*e+1)-e)}function B(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}const E=y(false);let _=function(t){return C(E)/C(E+m*t)},Q=function(t){return w*((C(E)*(B(e=E+m*t)/C(e))-B(E))/b)/v;var e},x=(y(true)-E)/m;if(Math.abs(v)<2e-6||!isFinite(x)){if(Math.abs(w-I)<1e-6)return this.easeTo(t,i);const e=I<w?-1:1;x=Math.abs(Math.log(I/w))/m,Q=()=>0,_=t=>Math.exp(e*m*t)}return t.duration="duration"in t?+t.duration:1e3*x/("screenSpeed"in t?+t.screenSpeed/m:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=true,this._rotating=s!==A,this._pitching=h!==o,this._rolling=c!==a,this._padding=!r.isPaddingEqual(u),this._prepareEase(i,false),this.terrain&&this._prepareElevation(p.targetCenter),this._ease((n=>{const g=n*x,m=1/_(g),w=Q(g);this._rotating&&r.setBearing(e.C.number(s,A,n)),this._pitching&&r.setPitch(e.C.number(o,h,n)),this._rolling&&r.setRoll(e.C.number(a,c,n)),this._padding&&(r.interpolatePadding(l,u,n),d=r.centerPoint.add(f)),p.easeFunc(n,m,w,d),this.terrain&&!t.freezeElevation&&this._updateElevation(n),this._applyUpdatedTransform(r),this._fireMoveEvents(i)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(i=this.handlers)||void 0===i||i.stop(false),this}_ease(t,e,i){false===i.animate||0===i.duration?(t(1),e()):(this._easeStart=n.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){t=e.aN(t,-180,180);const r=Math.abs(t-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.S.convert(t),this.transform.tileZoom):null}}const Do={compact:true,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class So{constructor(t=Do){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=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?false===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.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(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.sourceCaches;for(const i in e){const r=e[i];if(r.used||r.usedForTerrain){const e=r.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return false;return true}));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=a.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Go{constructor(t={}){this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?false!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const e=a.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Fo{constructor(){this._queue=[],this._id=0,this._cleared=false,this._currentlyRunning=false}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:false}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=true)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=false,this._currentlyRunning=false}clear(){this._currentlyRunning&&(this._cleared=true),this._queue=[]}}var Ro=e.aI([{name:"a_pos3d",type:"Int16",components:3}]);class Lo extends e.E{constructor(t){super(),this._lastTilesetChange=n.now(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=true,t.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=false,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this._renderableTilesKeys=[];const r={};for(const s of wt(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:false,terrain:i,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))r[s.key]=true,this._renderableTilesKeys.push(s.key),this._tiles[s.key]||(s.terrainRttPosMatrix32f=new Float64Array(16),e.bX(s.terrainRttPosMatrix32f,0,e.$,e.$,0,0,1),this._tiles[s.key]=new st(s,this.tileSize),this._lastTilesetChange=n.now());for(const t in this._tiles)r[t]||delete this._tiles[t]}freeRtt(t){for(const e in this._tiles){const i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,e){return e?this._getTerrainCoordsForTileRanges(t,e):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){const i={};for(const r of this._renderableTilesKeys){const s=this._tiles[r].tileID,o=t.clone(),n=e.b9();if(s.canonical.equals(t.canonical))e.bX(n,0,e.$,e.$,0,0,1);else if(s.canonical.isChildOf(t.canonical)){const i=s.canonical.z-t.canonical.z,r=s.canonical.x-(s.canonical.x>>i<<i),o=s.canonical.y-(s.canonical.y>>i<<i),a=e.$>>i;e.bX(n,0,a,a,0,0,1),e.M(n,n,[-r*a,-o*a,0])}else{if(!t.canonical.isChildOf(s.canonical))continue;{const i=t.canonical.z-s.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),o=t.canonical.y-(t.canonical.y>>i<<i),a=e.$>>i;e.bX(n,0,e.$,e.$,0,0,1),e.M(n,n,[r*a,o*a,0]),e.N(n,n,[1/2**i,1/2**i,0])}}o.terrainRttPosMatrix32f=new Float32Array(n),i[r]=o}return i}_getTerrainCoordsForTileRanges(t,i){const r={};for(const s of this._renderableTilesKeys){const o=this._tiles[s].tileID;if(!this._isWithinTileRanges(o,i))continue;const n=t.clone(),a=e.b9();if(o.canonical.z===t.canonical.z){const i=t.canonical.x-o.canonical.x,r=t.canonical.y-o.canonical.y;e.bX(a,0,e.$,e.$,0,0,1),e.M(a,a,[i*e.$,r*e.$,0])}else if(o.canonical.z>t.canonical.z){const i=o.canonical.z-t.canonical.z,r=o.canonical.x-(o.canonical.x>>i<<i),s=o.canonical.y-(o.canonical.y>>i<<i),n=t.canonical.x-(o.canonical.x>>i),l=t.canonical.y-(o.canonical.y>>i),A=e.$>>i;e.bX(a,0,A,A,0,0,1),e.M(a,a,[-r*A+n*e.$,-s*A+l*e.$,0])}else{const i=t.canonical.z-o.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),s=t.canonical.y-(t.canonical.y>>i<<i),n=(t.canonical.x>>i)-o.canonical.x,l=(t.canonical.y>>i)-o.canonical.y,A=e.$<<i;e.bX(a,0,A,A,0,0,1),e.M(a,a,[r*e.$+n*A,s*e.$+l*A,0])}n.terrainRttPosMatrix32f=new Float32Array(a),r[s]=n}return r}getSourceTile(t,e){const i=this.sourceCache._source;let r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let s=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!s||!s.dem)&&e)for(;r>=i.minzoom&&(!s||!s.dem);)s=this.sourceCache.getTileByID(t.scaledTo(r--).key);return s}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,e){return e[t.canonical.z]&&t.canonical.x>=e[t.canonical.z].minTileX&&t.canonical.x<=e[t.canonical.z].maxTileX&&t.canonical.y>=e[t.canonical.z].minTileY&&t.canonical.y<=e[t.canonical.z].maxTileY}}class zo{constructor(t,e,i){this._meshCache={},this.painter=t,this.sourceCache=new Lo(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,r,s=e.$){var o;if(!(i>=0&&i<s&&r>=0&&r<s))return 0;const n=this.getTerrainData(t),a=null===(o=n.tile)||void 0===o?void 0:o.dem;if(!a)return 0;const l=e.cr([],[i/s*e.$,r/s*e.$],n.u_terrain_matrix),A=[l[0]*a.dim,l[1]*a.dim],h=Math.floor(A[0]),c=Math.floor(A[1]),u=A[0]-h,f=A[1]-c;return a.get(h,c)*(1-u)*(1-f)+a.get(h+1,c)*u*(1-f)+a.get(h,c+1)*(1-u)*f+a.get(h+1,c+1)*u*f}getElevationForLngLatZoom(t,i){if(!e.cs(i,t.wrap()))return 0;const{tileID:r,mercatorX:s,mercatorY:o}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,s%e.$,o%e.$,e.$)}getElevation(t,i,r,s=e.$){return this.getDEMElevation(t,i,r,s)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new e.T(t,i,t.gl.RGBA,{premultiply:false}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new e.T(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:false}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.af([])}const i=this.sourceCache.getSourceTile(t,true);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:false}):i.demTexture=new e.T(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:false}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=false}const r=i&&i+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){const r=this.sourceCache.sourceCache._source.maxzoom;let s=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?s=t.canonical.z-r:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const o=t.canonical.x-(t.canonical.x>>s<<s),n=t.canonical.y-(t.canonical.y>>s<<s),a=e.ct(new Float64Array(16),[1/(e.$<<s),1/(e.$<<s),0]);e.M(a,a,[o*e.$,n*e.$,0]),this._demMatrixCache[t.key]={matrix:a,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){const i=this.painter,r=i.width/devicePixelRatio,s=i.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===s||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new e.T(i.context,{width:r,height:s,data:null},i.context.gl.RGBA,{premultiply:false}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new e.T(i.context,{width:r,height:s,data:null},i.context.gl.RGBA,{premultiply:false}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(r,s,true,false),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,r,s))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,e=0;t<this._coordsTextureSize;t++)for(let r=0;r<this._coordsTextureSize;r++,e+=4)i[e+0]=255&r,i[e+1]=255&t,i[e+2]=r>>8<<4|t>>8,i[e+3]=0;const r=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),s=new e.T(t,r,t.gl.RGBA,{premultiply:false});return s.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=s,s}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(true);const i=new Uint8Array(4),r=this.painter.context,s=r.gl,o=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),n=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),a=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),s.readPixels(o,a-n-1,1,1,s.RGBA,s.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);const l=i[0]+(i[2]>>4<<8),A=i[1]+((15&i[2])<<8),h=this.coordsIndex[255-i[3]],c=h&&this.sourceCache.getTileByID(h);if(!c)return null;const u=this._coordsTextureSize,f=(1<<c.tileID.canonical.z)*u;return new e.a0((c.tileID.canonical.x*u+l)/f+c.tileID.wrap,(c.tileID.canonical.y*u+A)/f,this.getElevation(c.tileID,l,A,u))}depthAtPoint(t){const e=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(t){var i;const r=(null===(i=this.painter.style.projection)||void 0===i?void 0:i.transitionState)>0,s=r&&0===t.canonical.y,o=r&&t.canonical.y===(1<<t.canonical.z)-1,n=`m_${s?"n":""}_${o?"s":""}`;if(this._meshCache[n])return this._meshCache[n];const a=this.painter.context,l=new e.cu,A=new e.aM,h=this.meshSize,c=e.$/h,u=h*h;for(let t=0;t<=h;t++)for(let e=0;e<=h;e++)l.emplaceBack(e*c,t*c,0);for(let t=0;t<u;t+=h+1)for(let e=0;e<h;e++)A.emplaceBack(e+t,h+e+t+1,h+e+t+2),A.emplaceBack(e+t,h+e+t+2,e+t+1);const f=l.length,d=f+(h+1),g=(h+1)*h,p=s?e.bg:0,m=s?0:1,w=o?e.bh:e.$,I=o?0:1;for(let t=0;t<=h;t++)l.emplaceBack(t*c,p,m);for(let t=0;t<=h;t++)l.emplaceBack(t*c,w,I);for(let t=0;t<h;t++)A.emplaceBack(g+t,d+t,d+t+1),A.emplaceBack(g+t,d+t+1,g+t+1),A.emplaceBack(0+t,f+t+1,f+t),A.emplaceBack(0+t,0+t+1,f+t+1);const v=l.length,b=v+2*(h+1);for(const t of[0,1])for(let i=0;i<=h;i++)for(const r of[0,1])l.emplaceBack(t*e.$,i*c,r);for(let t=0;t<2*h;t+=2)A.emplaceBack(v+t,v+t+1,v+t+3),A.emplaceBack(v+t,v+t+3,v+t+2),A.emplaceBack(b+t,b+t+3,b+t+1),A.emplaceBack(b+t,b+t+2,b+t+3);const y=new ye(a.createVertexBuffer(l,Ro.members),a.createIndexBuffer(A),e.aL.simpleSegment(0,0,l.length,A.length));return this._meshCache[n]=y,y}getMeshFrameDelta(t){return 2*Math.PI*e.bt/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,e){var i;const{tileID:r}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!==(i=this.getMinMaxElevation(r).minElevation)&&void 0!==i?i:0}getMinMaxElevation(t){const e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){const r=e.a0.fromLngLat(t.wrap()),s=(1<<i)*e.$,o=r.x*s,n=r.y*s,a=Math.floor(o/e.$),l=Math.floor(n/e.$);return{tileID:new e.Z(i,0,i,a,l),mercatorX:o,mercatorY:n}}}class Uo{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const i=this._context.createFramebuffer(this._tileSize,this._tileSize,true,true),r=new e.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(r.texture),{id:t,fbo:i,texture:r,stamp:-1,inUse:false}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=true,this._recentlyUsed=this._recentlyUsed.filter((e=>t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=false}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&false===this._objects.some((t=>!t.inUse))}}const Po={background:true,fill:true,line:true,raster:true,hillshade:true,"color-relief":true};class No{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new Uo(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((i=>!t._layers[i].isHidden(e))),this._coordsAscending={};for(const e in t.sourceCaches){this._coordsAscending[e]={};const i=t.sourceCaches[e].getVisibleCoordinates(),r=t.sourceCaches[e].getSource(),s=r instanceof V?r.terrainTileRanges:null;for(const t of i){const i=this.terrain.sourceCache.getTerrainCoords(t,s);for(const t in i)this._coordsAscending[e][t]||(this._coordsAscending[e][t]=[]),this._coordsAscending[e][t].push(i[t])}}this._coordsAscendingStr={};for(const e of t._order){const i=t._layers[e],r=i.source;if(Po[i.type]&&!this._coordsAscendingStr[r]){this._coordsAscendingStr[r]={};for(const t in this._coordsAscending[r])this._coordsAscendingStr[r][t]=this._coordsAscending[r][t].map((t=>t.key)).sort().join()}}for(const t of this._renderableTiles)for(const e in this._coordsAscendingStr){const i=this._coordsAscendingStr[e][t.tileID.key];i&&i!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return false;const r=Object.assign(Object.assign({},i),{isRenderingToTexture:true}),s=t.type,o=this.painter,n=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Po[s]&&(this._prevType&&Po[this._prevType]||this._stacks.push([]),this._prevType=s,this._stacks[this._stacks.length-1].push(t.id),!n))return true;if(Po[this._prevType]||Po[s]&&n){this._prevType=s;const t=this._stacks.length-1,i=this._stacks[t]||[];for(const s of this._renderableTiles){if(this.pool.isFull()&&(Cs(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(s),s.rtt[t]){const e=this.pool.getObjectForId(s.rtt[t].id);if(e.stamp===s.rtt[t].stamp){this.pool.useObject(e);continue}}const n=this.pool.getOrCreateFreeObject();this.pool.useObject(n),this.pool.stampObject(n),s.rtt[t]={id:n.id,stamp:n.stamp},o.context.bindFramebuffer.set(n.fbo.framebuffer),o.context.clear({color:e.be.transparent,stencil:0}),o.currentStencilSource=void 0;for(let t=0;t<i.length;t++){const e=o.style._layers[i[t]],a=e.source?this._coordsAscending[e.source][s.tileID.key]:[s.tileID];o.context.viewport.set([0,0,n.fbo.width,n.fbo.height]),o._renderTileClippingMasks(e,a,true),o.renderLayer(o,o.style.sourceCaches[e.source],e,a,r),e.source&&(s.rttCoords[e.source]=this._coordsAscendingStr[e.source][s.tileID.key])}}return Cs(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),Po[s]}return false}}const To={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},qo=i,Oo={hash:false,interactive:true,bearingSnap:7,attributionControl:Do,maplibreLogo:false,refreshExpiredTiles:true,canvasContextAttributes:{antialias:false,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false,desynchronized:false,contextType:void 0},scrollZoom:true,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:true,dragRotate:true,dragPan:true,keyboard:true,doubleClickZoom:true,touchZoomRotate:true,touchPitch:true,cooperativeGestures:false,trackResize:true,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:true,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:true,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:true,rollEnabled:false,validateStyle:true,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:true,centerClampedToGround:true},jo={showCompass:true,showZoom:true,visualizePitch:false,visualizeRoll:true};class Jo{constructor(t,i,r=false){this.mousedown=t=>{this.startMove(t,a.mousePos(this.element,t)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,a.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHanlder.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:false}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;const s=new eo;this._rotatePitchHanlder=new Vs({clickTolerance:3,move:(t,s)=>{const o=i.getBoundingClientRect(),n=new e.P((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:e.cm(new e.P(t.x,s.y),s,n),pitchDelta:r?-.5*(s.y-t.y):void 0}},moveStateManager:s,enable:true,assignEvents:()=>{}}),this.map=t,a.addEventListener(i,"mousedown",this.mousedown),a.addEventListener(i,"touchstart",this.touchstart,{passive:false}),a.addEventListener(i,"touchcancel",this.reset)}startMove(t,e){this._rotatePitchHanlder.dragStart(t,e),a.disableDrag()}move(t,e){const i=this.map,{bearingDelta:r,pitchDelta:s}=this._rotatePitchHanlder.dragMove(t,e)||{};r&&i.setBearing(i.getBearing()+r),s&&i.setPitch(i.getPitch()+s)}off(){const t=this.element;a.removeEventListener(t,"mousedown",this.mousedown),a.removeEventListener(t,"touchstart",this.touchstart,{passive:false}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:false}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:false}),a.removeEventListener(window,"touchend",this.touchend)}}let Ho;function Yo(t,i,r,s=false){if(s||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();const o=new e.S(t.lng,t.lat);if(t=new e.S(t.lng,t.lat),i){const s=new e.S(t.lng-360,t.lat),o=new e.S(t.lng+360,t.lat),n=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(s).distSqr(i)<n?t=s:r.locationToScreenPoint(o).distSqr(i)<n&&(t=o)}for(;Math.abs(t.lng-r.center.lng)>180;){const e=r.locationToScreenPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==o.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:o}const $o={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 Vo(t,e,i){const r=t.classList;for(const t in $o)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${e}`)}class Ko extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{if(!this._map)return;const e=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!e)&&this._map.once("render",this._update),this._lngLat=Yo(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),a.setTransform(this._element,`${$o[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),n.frameAsync(new AbortController).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.l("dragstart"))),this.fire(new e.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=false,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.l("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||false,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||false,this._isDragging=false,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=true,this._element=a.create("div");const i=a.createNS("http://www.w3.org/2000/svg","svg"),r=41,s=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${r}px`),i.setAttributeNS(null,"width",`${s}px`),i.setAttributeNS(null,"viewBox",`0 0 ${s} ${r}`);const o=a.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");const n=a.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"fill-rule","nonzero");const l=a.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.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 t of A){const e=a.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const h=a.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill",this._color);const c=a.createNS("http://www.w3.org/2000/svg","path");c.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"),h.appendChild(c);const u=a.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"opacity","0.25"),u.setAttributeNS(null,"fill","#000000");const f=a.createNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),u.appendChild(f);const d=a.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");const g=a.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(8.0, 8.0)");const p=a.createNS("http://www.w3.org/2000/svg","circle");p.setAttributeNS(null,"fill","#000000"),p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"cx","5.5"),p.setAttributeNS(null,"cy","5.5"),p.setAttributeNS(null,"r","5.4999962");const m=a.createNS("http://www.w3.org/2000/svg","circle");m.setAttributeNS(null,"fill","#FFFFFF"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962"),g.appendChild(p),g.appendChild(m),n.appendChild(l),n.appendChild(h),n.appendChild(u),n.appendChild(d),n.appendChild(g),i.appendChild(n),i.setAttributeNS(null,"height",r*this._scale+"px"),i.setAttributeNS(null,"width",s*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),Vo(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",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),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.S.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,r=Math.abs(i)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(e-i+r)],"bottom-right":[-r,-1*(e-i+r)],left:[i,-1*(e-i)],right:[-13.5,-1*(e-i)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=false){var i,r;const s=null===(i=this._map)||void 0===i?void 0:i.terrain,o=this._map.transform.isLocationOccluded(this._lngLat);if(!s||o){const t=o?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==t&&(this._element.style.opacity=t))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const n=this._map,a=n.terrain.depthAtPoint(this._pos),l=n.terrain.getElevationForLngLatZoom(this._lngLat,n.transform.tileZoom);if(n.transform.lngLatToCameraDepth(this._lngLat,l)-a<.006)return void(this._element.style.opacity=this._opacity);const A=-this._offset.y/n.transform.pixelsPerMeter,h=Math.sin(n.getPitch()*Math.PI/180)*A,c=n.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=n.transform.lngLatToCameraDepth(this._lngLat,l+h)-c>.006;(null===(r=this._popup)||void 0===r?void 0:r.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return(void 0===this._opacity||void 0===t&&void 0===e)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(true),this}}const Zo={positionOptions:{enableHighAccuracy:false,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:false,showAccuracyCircle:true,showUserLocation:true};let Wo=0,Xo=false;const tn={maxWidth:100,unit:"metric"};function en(t,e,i){const r=i&&i.maxWidth||100,s=t._container.clientHeight/2,o=t._container.clientWidth/2,n=t.unproject([o-r/2,s]),a=t.unproject([o+r/2,s]),l=Math.round(t.project(a).x-t.project(n).x),A=Math.min(r,l,t._container.clientWidth),h=n.distanceTo(a);if(i&&"imperial"===i.unit){const i=3.2808*h;i>5280?rn(e,A,i/5280,t._getUIString("ScaleControl.Miles")):rn(e,A,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?rn(e,A,h/1852,t._getUIString("ScaleControl.NauticalMiles")):h>=1e3?rn(e,A,h/1e3,t._getUIString("ScaleControl.Kilometers")):rn(e,A,h,t._getUIString("ScaleControl.Meters"))}function rn(t,e,i,r){const s=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i);t.style.width=e*(s/i)+"px",t.innerHTML=`${s}&nbsp;${r}`}const sn={closeButton:true,closeOnClick:true,focusAfterOpen:true,className:"",maxWidth:"240px",subpixelPositioning:false,locationOccludedOpacity:void 0},on=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function nn(t){if(t){if("number"==typeof t){const i=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-t),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const i=e.P.convert(t);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return nn(new e.P(0,0))}const an=i;t.AJAXError=e.cy,t.Event=e.l,t.Evented=e.E,t.LngLat=e.S,t.MercatorCoordinate=e.a0,t.Point=e.P,t.addProtocol=e.cz,t.config=e.a,t.removeProtocol=e.cA,t.AttributionControl=So,t.BoxZoomHandler=js,t.CanvasSource=Z,t.CooperativeGesturesHandler=Eo,t.DoubleClickZoomHandler=Io,t.DragPanHandler=yo,t.DragRotateHandler=Bo,t.EdgeInsets=Qe,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=false,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.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(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 e.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.l("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()}},t.GeoJSONSource=$,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.l("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{const i=new e.S(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,s=this._map.getBearing(),o=e.e({bearing:s},this.options.fitBoundsOptions),n=O.fromLngLat(i,r);this._map.fitBounds(n,o,{geolocateSource:true})},this._updateMarker=t=>{if(t){const i=new e.S(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(1===t.code){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=true;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Xo)return;this.options.trackUserLocation&&this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=true)},this._finishSetupUI=t=>{if(this._map){if(false===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=true,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=false,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ko({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ko({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=true,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.l("trackuserlocationend")),this.fire(new e.l("userlocationlostfocus")))}))}},this.options=e.e({},Zo,t)}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function*(t=false){if(void 0!==Ho&&!t)return Ho;if(void 0===window.navigator.permissions)return Ho=!!window.navigator.geolocation,Ho;try{const t=yield window.navigator.permissions.query({name:"geolocation"});Ho="denied"!==t.state}catch(t){Ho=!!window.navigator.geolocation}return Ho}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Wo=0,Xo=false}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.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 t=this._map.getBounds(),e=t.getSouthEast(),i=t.getNorthEast(),r=e.distanceTo(i),s=Math.ceil(this._accuracy/(r/this._map._container.clientHeight)*2);this._circleElement.style.width=`${s}px`,this._circleElement.style.height=`${s}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),false;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Wo--,Xo=false,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 e.l("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 e.l("trackuserlocationstart")),this.fire(new e.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Wo++,Wo>1?(t={maximumAge:6e5,timeout:0},Xo=true):(t=this.options.positionOptions,Xo=false),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return true}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.GlobeControl=class{constructor(){this._toggleProjection=()=>{var t;const e=null===(t=this._map.getProjection())||void 0===t?void 0:t.type;this._map.setProjection("mercator"!==e&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var t;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),"globe"===(null===(t=this._map.getProjection())||void 0===t?void 0:t.type)?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=a.create("button","maplibregl-ctrl-globe",this._container),a.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){a.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=xs,t.ImageSource=V,t.KeyboardHandler=fo,t.LngLatBounds=O,t.LogoControl=Go,t.Map=class extends ko{constructor(t){var i,r;e.cv.mark(e.cw.create);const s=Object.assign(Object.assign(Object.assign({},Oo),t),{canvasContextAttributes:Object.assign(Object.assign({},Oo.canvasContextAttributes),t.canvasContextAttributes)});if(null!=s.minZoom&&null!=s.maxZoom&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=s.minPitch&&null!=s.maxPitch&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=s.minPitch&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=s.maxPitch&&s.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const o=new Fe,n=new Ue;if(void 0!==s.minZoom&&o.setMinZoom(s.minZoom),void 0!==s.maxZoom&&o.setMaxZoom(s.maxZoom),void 0!==s.minPitch&&o.setMinPitch(s.minPitch),void 0!==s.maxPitch&&o.setMaxPitch(s.maxPitch),void 0!==s.renderWorldCopies&&o.setRenderWorldCopies(s.renderWorldCopies),super(o,n,{bearingSnap:s.bearingSnap}),this._idleTriggered=false,this._crossFadingFactor=1,this._renderTaskQueue=new Fo,this._controls=[],this._mapId=e.a6(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.l("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.l("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,false},this._onWindowOnline=()=>{this._update()},this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._maxTileCacheZoomLevels=s.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},s.canvasContextAttributes),this._trackResize=true===s.trackResize,this._bearingSnap=s.bearingSnap,this._centerClampedToGround=s.centerClampedToGround,this._refreshExpiredTiles=true===s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=true===s.crossSourceCollisions,this._collectResourceTiming=true===s.collectResourceTiming,this._locale=Object.assign(Object.assign({},To),s.locale),this._clickTolerance=s.clickTolerance,this._overridePixelRatio=s.pixelRatio,this._maxCanvasSize=s.maxCanvasSize,this.transformCameraUpdate=s.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=true===s.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=d.addThrottleControl((()=>this.isMoving())),this._requestManager=new g(s.transformRequest),"string"==typeof s.container){if(this._container=document.getElementById(s.container),!this._container)throw new Error(`Container '${s.container}' not found.`)}else{if(!(s.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(false))),this.on("moveend",(()=>this._update(false))),this.on("zoom",(()=>this._update(true))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=true,this._update(true)})),this.once("idle",(()=>{this._idleTriggered=true})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,false);let t=false;const e=Qs((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50);this._resizeObserver=new ResizeObserver((i=>{t?e(i):t=true})),this._resizeObserver.observe(this._container)}this.handlers=new Mo(this,s),this._hash=s.hash&&new xs("string"==typeof s.hash&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,elevation:s.elevation,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,roll:s.roll}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,e.e({},s.fitBoundsOptions,{duration:0}))));const a="string"==typeof s.style||!("globe"===(null===(r=null===(i=s.style)||void 0===i?void 0:i.projection)||void 0===r?void 0:r.type));this.resize(null,a),this._localIdeographFontFamily=s.localIdeographFontFamily,this._validateStyle=s.validateStyle,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new So("boolean"==typeof s.attributionControl?void 0:s.attributionControl)),s.maplibreLogo&&this.addControl(new Go,s.logoPosition),this.on("style.load",(()=>{if(a||this._resizeTransform(),this.transform.unmodified){const t=e.Q(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.l(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.l(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.l("sourcedataabort",t))}))}_getMapId(){return this._mapId}setGlobalStateProperty(t,e){return this.style.setGlobalStateProperty(t,e),this._update(true)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const s=this._controlPositions[i];return-1!==i.indexOf("bottom")?s.insertBefore(r,s.firstChild):s.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,i,r)}resize(t,i=true){const[r,s]=this._containerDimensions(),o=this._getClampedPixelRatio(r,s);if(this._resizeCanvas(r,s,o),this.painter.resize(r,s,o),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const e=this._getClampedPixelRatio(r,s);this._resizeCanvas(r,s,e),this.painter.resize(r,s,e)}this._resizeTransform(i);const n=!this._moving;return n&&(this.stop(),this.fire(new e.l("movestart",t)).fire(new e.l("move",t))),this.fire(new e.l("resize",t)),n&&this.fire(new e.l("moveend",t)),this}_resizeTransform(t=true){var e;const[i,r]=this._containerDimensions();this.transform.resize(i,r,t),null===(e=this._requestedCameraState)||void 0===e||e.resize(i,r,t)}_getClampedPixelRatio(t,e){const{0:i,1:r}=this._maxCanvasSize,s=this.getPixelRatio(),o=t*s,n=e*s;return Math.min(o>i?i/o:1,n>r?r/n:1)*s}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(O.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.setMinZoom(t),this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.setMaxZoom(t),this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.setMinPitch(t),this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>180)throw new Error("maxPitch must be less than or equal to 180");if(t>=this.transform.minPitch)return this.transform.setMaxPitch(t),this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.setRenderWorldCopies(t),this._update()}project(t){return this.transform.locationToScreenPoint(e.S.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.screenPointToLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let r=false;const s=s=>{const o=e.filter((t=>this.getLayer(t))),n=0!==o.length?this.queryRenderedFeatures(s.point,{layers:o}):[];n.length?r||(r=true,i.call(this,new Us(t,this,s.originalEvent,{features:n}))):r=false};return{layers:e,listener:i,delegates:{mousemove:s,mouseout:()=>{r=false}}}}if("mouseleave"===t||"mouseout"===t){let r=false;const s=s=>{const o=e.filter((t=>this.getLayer(t)));(0!==o.length?this.queryRenderedFeatures(s.point,{layers:o}):[]).length?r=true:r&&(r=false,i.call(this,new Us(t,this,s.originalEvent)))},o=e=>{r&&(r=false,i.call(this,new Us(t,this,e.originalEvent)))};return{layers:e,listener:i,delegates:{mousemove:s,mouseout:o}}}{const r=t=>{const r=e.filter((t=>this.getLayer(t))),s=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];s.length&&(t.features=s,i.call(this,t),delete t.features)};return{layers:e,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){const s=r[t];if(s.listener===i&&s.layers.length===e.length&&s.layers.every((t=>e.includes(t)))){for(const t in s.delegates)this.off(t,s.delegates[t]);return void r.splice(t,1)}}}on(t,e,i){if(void 0===i)return super.on(t,e);const r="string"==typeof e?[e]:e,s=this._createDelegatedListener(t,r,i);this._saveDelegatedListener(t,s);for(const t in s.delegates)this.on(t,s.delegates[t]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,e,i){if(void 0===i)return super.once(t,e);const r="string"==typeof e?[e]:e,s=this._createDelegatedListener(t,r,i);for(const e in s.delegates){const o=s.delegates[e];s.delegates[e]=(...e)=>{this._removeDelegatedListener(t,r,i),o(...e)}}this._saveDelegatedListener(t,s);for(const t in s.delegates)this.once(t,s.delegates[t]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,i),this)}queryRenderedFeatures(t,i){if(!this.style)return[];let r;const s=t instanceof e.P||Array.isArray(t),o=s?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(s?{}:t)||{},o instanceof e.P||"number"==typeof o[0])r=[e.P.convert(o)];else{const t=e.P.convert(o[0]),i=e.P.convert(o[1]);r=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return false!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){var i,r;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));const s=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new yi(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,s):this.style.loadJSON(t,e,s),this):(null===(r=null===(i=this.style)||void 0===i?void 0:i.projection)||void 0===r||r.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new yi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){const r=this._requestManager.transformRequest(t,"Style");e.j(r,new AbortController).then((t=>{this._updateDiff(t.data,i)})).catch((t=>{t&&this.fire(new e.k(t))}))}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(true)}catch(r){e.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(true)}isSourceLoaded(t){const i=this.style&&this.style.sourceCaches[t];if(void 0!==i)return i.loaded();this.fire(new e.k(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const i=this.style.sourceCaches[t.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&i.reload();for(const i in this.style._layers){const r=this.style._layers[i];"hillshade"===r.type&&r.source===t.source&&e.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."),"color-relief"===r.type&&r.source===t.source&&e.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new zo(this.painter,i,t),this.painter.renderToTexture=new No(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=e=>{var i;"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),"image"===(null===(i=e.source)||void 0===i?void 0:i.type)?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(e.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.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new e.l("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return false}}return true}removeSource(t){return this.style.removeSource(t),this._update(true)}getSource(t){return this.style.getSource(t)}setSourceTileLodParams(t,e,i){if(i){const r=this.getSource(i);if(!r)throw new Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=gt(Math.max(1,t),Math.max(1,e))}else for(const i in this.style.sourceCaches)this.style.sourceCaches[i].getSource().calculateTileZoom=gt(Math.max(1,t),Math.max(1,e));return this._update(true),this}refreshTiles(t,i){const r=this.style.sourceCaches[t];if(!r)throw new Error(`There is no source cache with ID "${t}", cannot refresh tile`);void 0===i?r.reload(true):r.refreshTiles(i.map((t=>new e.a3(t.z,t.x,t.y))))}addImage(t,i,r={}){const{pixelRatio:s=1,sdf:o=false,stretchX:a,stretchY:l,content:A,textFitWidth:h,textFitHeight:c}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.k(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:r,height:n,data:u}=i,f=i;return this.style.addImage(t,{data:new e.R({width:r,height:n},new Uint8Array(u)),pixelRatio:s,stretchX:a,stretchY:l,content:A,textFitWidth:h,textFitHeight:c,sdf:o,version:0,userImage:f}),f.onAdd&&f.onAdd(this,t),this}}{const{width:r,height:u,data:f}=n.getImageData(i);this.style.addImage(t,{data:new e.R({width:r,height:u},f),pixelRatio:s,stretchX:a,stretchY:l,content:A,textFitWidth:h,textFitHeight:c,sdf:o,version:0})}}updateImage(t,i){const r=this.style.getImage(t);if(!r)return this.fire(new e.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=i instanceof HTMLImageElement||e.b(i)?n.getImageData(i):i,{width:o,height:a,data:l}=s;if(void 0===o||void 0===a)return this.fire(new e.k(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(o!==r.data.width||a!==r.data.height)return this.fire(new e.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const A=!(i instanceof HTMLImageElement||e.b(i));return r.data.replace(l,A),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.k(new Error("Missing required image id"))),false)}removeImage(t){this.style.removeImage(t)}loadImage(t){return d.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(true)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(true)}removeLayer(t){return this.style.removeLayer(t),this._update(true)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(true)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(true)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,r={}){return this.style.setPaintProperty(t,e,i,r),this._update(true)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,r={}){return this.style.setLayoutProperty(t,e,i,r),this._update(true)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(true)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,i,(t=>{t||this._update(true)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(true)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(true)})),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(true)}getLight(){return this.style.getLight()}setSky(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,e),this._update(true)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=a.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,false),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,false),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);const s=this._controlContainer=a.create("div","maplibregl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{o[t]=a.create("div",`maplibregl-ctrl-${t} `,s)})),this._container.addEventListener("scroll",this._onMapScroll,false)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:true,depth:true,stencil:true,premultipliedAlpha:true});let e=null;this._canvas.addEventListener("webglcontextcreationerror",(i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)}),{once:true});let i=null;if(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,t):this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t),!i){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new _s(i,this.transform),l.testSupport(i)}migrateProjection(t,i){super.migrateProjection(t,i),this.painter.transform=t,this.fire(new e.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=true,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){var i,r,s,o,a;const l=this._idleTriggered?this._fadeDuration:0,A=(null===(i=this.style.projection)||void 0===i?void 0:i.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let h=false;if(this.style&&this._styleDirty){this._styleDirty=false;const t=this.transform.zoom,i=n.now();this.style.zoomHistory.update(t,i);const r=new e.F(t,{now:i,fadeDuration:l,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition(),globalState:this.style.getGlobalState()}),s=r.crossFadingFactor();1===s&&s===this._crossFadingFactor||(h=true,this._crossFadingFactor=s),this.style.update(r)}const c=(null===(r=this.style.projection)||void 0===r?void 0:r.transitionState)>0!==A;null===(s=this.style.projection)||void 0===s||s.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(null===(o=this.style.projection)||void 0===o?void 0:o.transitionState,null===(a=this.style.projection)||void 0===a?void 0:a.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||c)&&(this._sourcesDirty=false,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,c),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,showPadding:this.showPadding}),this.fire(new e.l("render")),this.loaded()&&!this._loaded&&(this._loaded=true,e.cv.mark(e.cw.load),this.fire(new e.l("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=true),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const u=this._sourcesDirty||this._styleDirty||this._placementDirty;return u||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.l("idle")),!this._loaded||this._fullyLoaded||u||(this._fullyLoaded=true,e.cv.mark(e.cw.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const t of this._controls)t.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),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,false),d.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,false),this._canvas.removeEventListener("webglcontextlost",this._contextLost,false),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,false),this._container.classList.remove("maplibregl-map"),e.cv.clearMetrics(),this._removed=true,this.fire(new e.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,n.frame(this._frameRequest,(t=>{e.cv.frame(t),this._frameRequest=null;try{this._render(t)}catch(t){if(!e.cx(t)&&!function(t){return t.message===Jr}(t))throw t}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return qo}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(true)}},t.MapMouseEvent=Us,t.MapTouchEvent=Ps,t.MapWheelEvent=Ns,t.Marker=Ko,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,e)=>{const i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},jo,t),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,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.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Jo(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.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.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=a.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:void 0)},this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.l("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Yo(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;const e=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let i=this.options.anchor;const r=nn(this.options.offset);if(!i){const t=this._container.offsetWidth,s=this._container.offsetHeight;let o;o=e.y+r.bottom.y<s?["top"]:e.y>this._map.transform.height-s?["bottom"]:[],e.x<t/2?o.push("left"):e.x>this._map.transform.width-t/2&&o.push("right"),i=0===o.length?"bottom":o.join("-")}let s=e.add(r[i]);this.options.subpixelPositioning||(s=s.round()),a.setTransform(this._container,`${$o[i]} translate(${s.x}px,${s.y}px)`),Vo(this._container,i,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(sn),t)}addTo(t){return this._map&&this.remove(),this._map=t,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 e.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.S.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=false,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=true,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(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body");let r;for(i.innerHTML=t;r=i.firstChild,r;)e.appendChild(r);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(on);t&&t.focus()}},t.RasterDEMTileSource=Y,t.RasterTileSource=H,t.ScaleControl=class{constructor(t){this._onMove=()=>{en(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,en(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},tn),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=wo,t.Style=yi,t.TerrainControl=class{constructor(t){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=t}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.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(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=co,t.TwoFingersTouchRotateHandler=Ao,t.TwoFingersTouchZoomHandler=ao,t.TwoFingersTouchZoomRotateHandler=Co,t.VectorTileSource=J,t.VideoSource=K,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,(function*(){if(X(t))throw new Error(`A source type called "${t}" already exists.`);((t,e)=>{W[t]=e})(t,i)})),t.clearPrewarmedResources=function(){const t=G;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(k),G=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()"))},t.createTileMesh=Ve,t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return rt().getRTLTextPluginStatus()},t.getVersion=function(){return an},t.getWorkerCount=function(){return D.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return z().broadcast("IS",t)},t.prewarm=function(){R().acquire(k)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return rt().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){D.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}}));var r=t;return r}))})(A);return A.exports}var f=u();var d=l(f);const g={"https://github.com/cogeotiff/cog-spec":"COG","http://lccn.loc.gov/sh85035852":"Data dictionary","http://schema.org/downloadUrl":"Download URL","http://geojson.org/geojson-spec.html":"GeoJSON","http://schema.org/url":"Layer description","http://iiif.io/api/image":"IIIF image","http://iiif.io/api/presentation#manifest":"IIIF manifest","http://www.opengis.net/cat/csw/csdgm":"FGDC metadata","http://www.w3.org/1999/xhtml":"HTML metadata","http://www.isotc211.org/schemas/2005/gmd/":"ISO 19139 metadata","http://www.loc.gov/mods/v3":"MODS metadata","https://oembed.com":"OEmbed","https://openindexmaps.org":"Index map","https://github.com/protomaps/PMTiles":"PMTiles","https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification":"TMS","https://github.com/mapbox/tilejson-spec":"TileJSON","http://www.opengis.net/def/serviceType/ogc/wcs":"WCS","http://www.opengis.net/def/serviceType/ogc/wms":"WMS","http://www.opengis.net/def/serviceType/ogc/wfs":"WFS","http://www.opengis.net/def/serviceType/ogc/wmts":"WMTS","https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames":"XYZ tiles"};const p=["http://schema.org/url","http://www.opengis.net/cat/csw/csdgm","http://www.w3.org/1999/xhtml","http://www.isotc211.org/schemas/2005/gmd/","http://www.loc.gov/mods/v3","http://lccn.loc.gov/sh85035852"];class m{references;constructor(t){try{this.references=JSON.parse(t)}catch(t){console.error("Failed to parse references:",t);this.references={}}}get wms(){return this.references["http://www.opengis.net/def/serviceType/ogc/wms"]}get cog(){return this.references["https://github.com/cogeotiff/cog-spec"]}get tms(){return this.references["https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification"]}get xyz(){return this.references["https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames"]}get downloadLinks(){const t=this.references["http://schema.org/downloadUrl"];if(!t)return[];if(Array.isArray(t))return t;return[{url:t,label:null}]}get metadataLinks(){return Object.entries(this.references).filter((([t])=>p.includes(t))).map((([t,e])=>({url:e,label:g[t]})))}}const w=/^ENVELOPE\((?<west>[^,]+),(?<east>[^,]+),(?<north>[^,]+),(?<south>[^,]+)\)$/;const I={id:"ID",title:"Title",description:"Description",resourceType:"Resource Type",resourceClass:"Resource Class",accessRights:"Access Rights",references:"References",identifier:"Identifier",wxsIdentifier:"WxS Identifier",alternativeTitles:"Alternative Title",language:"Language",displayNotes:"Display Notes",creators:"Creator",publishers:"Publisher",provider:"Provider",themes:"Theme",keywords:"Keywords",temporal:"Temporal Coverage",issued:"Date Issued",indexYear:"Index Year",dateRange:"Date Range",spatial:"Spatial Coverage",geometry:"Geometry",bbox:"Bounding Box",centroid:"Centroid",relations:"Relation",memberOf:"Member Of",isPartOf:"Is Part Of",source:"Source",isVersionOf:"Is Version Of",replaces:"Replaces",isReplacedBy:"Is Replaced By",rights:"Rights",rightsHolder:"Rights Holder",license:"License",fileSize:"File Size",mdModified:"Modified",suppressed:"Suppressed",georeferenced:"Georeferenced",subjects:"Subject",mdVersion:"Metadata Version",format:"Format"};class v{json;id;title;resourceClass;accessRights;mdVersion="Aardvark";references;identifier;wxsIdentifier;alternativeTitles;description;language;displayNotes;creators;publishers;provider;resourceType;themes;keywords;temporal;issued;indexYear;dateRange;spatial;geometry;bbox;centroid;relations;memberOf;isPartOf;source;isVersionOf;replaces;isReplacedBy;rights;rightsHolder;license;fileSize;mdModified;suppressed;georeferenced;subjects;format;constructor(t){if(t.gbl_mdVersion_s!=="Aardvark"){throw new Error("Unsupported metadata version: "+t.gbl_mdVersion_s)}this.id=t.id;this.title=t.dct_title_s;this.wxsIdentifier=t.gbl_wxsIdentifier_s;this.subjects=t.dct_subject_sm;this.resourceClass=t.gbl_resourceClass_sm;this.rights=t.dct_rights_sm;this.rightsHolder=t.dct_rightsHolder_sm;this.license=t.dct_license_sm;this.accessRights=t.dct_accessRights_s;this.identifier=t.dct_identifier_sm;this.wxsIdentifier=t.gbl_wxsIdentifier_s;this.alternativeTitles=t.dct_alternative_sm;this.description=t.dct_description_sm;this.language=t.dct_language_sm;this.displayNotes=t.gbl_displayNote_sm;this.creators=t.dct_creator_sm;this.publishers=t.dct_publisher_sm;this.provider=t.schema_provider_s;this.resourceType=t.gbl_resourceType_sm;this.themes=t.dcat_theme_sm;this.keywords=t.dcat_keyword_sm;this.temporal=t.dct_temporal_sm;this.issued=t.dct_issued_s;this.indexYear=t.gbl_indexYear_im;this.dateRange=t.gbl_dateRange_drsim;this.spatial=t.dct_spatial_sm;this.geometry=t.locn_geometry;this.bbox=t.dcat_bbox;this.centroid=t.dcat_centroid;this.format=t.dct_format_s;this.fileSize=t.gbl_fileSize_s;this.references=new m(t.dct_references_s||"{}");this.json=t}get attribution(){if(this.publishers&&this.publishers.length>0)return this.publishers.join(", ");if(this.creators&&this.creators.length>0)return this.creators.join(", ");if(this.provider)return this.provider}get downloadLinks(){return this.references.downloadLinks.map((t=>{if(!t.label)t.label=this.format||"Object";if(this.fileSize)t.label+=` (${this.fileSize})`;return t}))}getBounds(){if(!this.bbox)return null;const t=this.bbox.match(w);if(!t)return null;if(t.length!==5)return null;const e=parseFloat(t.groups.west);const i=parseFloat(t.groups.east);const r=parseFloat(t.groups.north);const s=parseFloat(t.groups.south);return new f.LngLatBounds([e,s,i,r])}}const b=':root,:host,.sl-theme-light{color-scheme:light;--sl-color-gray-50:hsl(0 0% 97.5%);--sl-color-gray-100:hsl(240 4.8% 95.9%);--sl-color-gray-200:hsl(240 5.9% 90%);--sl-color-gray-300:hsl(240 4.9% 83.9%);--sl-color-gray-400:hsl(240 5% 64.9%);--sl-color-gray-500:hsl(240 3.8% 46.1%);--sl-color-gray-600:hsl(240 5.2% 33.9%);--sl-color-gray-700:hsl(240 5.3% 26.1%);--sl-color-gray-800:hsl(240 3.7% 15.9%);--sl-color-gray-900:hsl(240 5.9% 10%);--sl-color-gray-950:hsl(240 7.3% 8%);--sl-color-red-50:hsl(0 85.7% 97.3%);--sl-color-red-100:hsl(0 93.3% 94.1%);--sl-color-red-200:hsl(0 96.3% 89.4%);--sl-color-red-300:hsl(0 93.5% 81.8%);--sl-color-red-400:hsl(0 90.6% 70.8%);--sl-color-red-500:hsl(0 84.2% 60.2%);--sl-color-red-600:hsl(0 72.2% 50.6%);--sl-color-red-700:hsl(0 73.7% 41.8%);--sl-color-red-800:hsl(0 70% 35.3%);--sl-color-red-900:hsl(0 62.8% 30.6%);--sl-color-red-950:hsl(0 60% 19.6%);--sl-color-orange-50:hsl(33.3 100% 96.5%);--sl-color-orange-100:hsl(34.3 100% 91.8%);--sl-color-orange-200:hsl(32.1 97.7% 83.1%);--sl-color-orange-300:hsl(30.7 97.2% 72.4%);--sl-color-orange-400:hsl(27 96% 61%);--sl-color-orange-500:hsl(24.6 95% 53.1%);--sl-color-orange-600:hsl(20.5 90.2% 48.2%);--sl-color-orange-700:hsl(17.5 88.3% 40.4%);--sl-color-orange-800:hsl(15 79.1% 33.7%);--sl-color-orange-900:hsl(15.3 74.6% 27.8%);--sl-color-orange-950:hsl(15.2 69.1% 19%);--sl-color-amber-50:hsl(48 100% 96.1%);--sl-color-amber-100:hsl(48 96.5% 88.8%);--sl-color-amber-200:hsl(48 96.6% 76.7%);--sl-color-amber-300:hsl(45.9 96.7% 64.5%);--sl-color-amber-400:hsl(43.3 96.4% 56.3%);--sl-color-amber-500:hsl(37.7 92.1% 50.2%);--sl-color-amber-600:hsl(32.1 94.6% 43.7%);--sl-color-amber-700:hsl(26 90.5% 37.1%);--sl-color-amber-800:hsl(22.7 82.5% 31.4%);--sl-color-amber-900:hsl(21.7 77.8% 26.5%);--sl-color-amber-950:hsl(22.9 74.1% 16.7%);--sl-color-yellow-50:hsl(54.5 91.7% 95.3%);--sl-color-yellow-100:hsl(54.9 96.7% 88%);--sl-color-yellow-200:hsl(52.8 98.3% 76.9%);--sl-color-yellow-300:hsl(50.4 97.8% 63.5%);--sl-color-yellow-400:hsl(47.9 95.8% 53.1%);--sl-color-yellow-500:hsl(45.4 93.4% 47.5%);--sl-color-yellow-600:hsl(40.6 96.1% 40.4%);--sl-color-yellow-700:hsl(35.5 91.7% 32.9%);--sl-color-yellow-800:hsl(31.8 81% 28.8%);--sl-color-yellow-900:hsl(28.4 72.5% 25.7%);--sl-color-yellow-950:hsl(33.1 69% 13.9%);--sl-color-lime-50:hsl(78.3 92% 95.1%);--sl-color-lime-100:hsl(79.6 89.1% 89.2%);--sl-color-lime-200:hsl(80.9 88.5% 79.6%);--sl-color-lime-300:hsl(82 84.5% 67.1%);--sl-color-lime-400:hsl(82.7 78% 55.5%);--sl-color-lime-500:hsl(83.7 80.5% 44.3%);--sl-color-lime-600:hsl(84.8 85.2% 34.5%);--sl-color-lime-700:hsl(85.9 78.4% 27.3%);--sl-color-lime-800:hsl(86.3 69% 22.7%);--sl-color-lime-900:hsl(87.6 61.2% 20.2%);--sl-color-lime-950:hsl(86.5 60.6% 13.9%);--sl-color-green-50:hsl(138.5 76.5% 96.7%);--sl-color-green-100:hsl(140.6 84.2% 92.5%);--sl-color-green-200:hsl(141 78.9% 85.1%);--sl-color-green-300:hsl(141.7 76.6% 73.1%);--sl-color-green-400:hsl(141.9 69.2% 58%);--sl-color-green-500:hsl(142.1 70.6% 45.3%);--sl-color-green-600:hsl(142.1 76.2% 36.3%);--sl-color-green-700:hsl(142.4 71.8% 29.2%);--sl-color-green-800:hsl(142.8 64.2% 24.1%);--sl-color-green-900:hsl(143.8 61.2% 20.2%);--sl-color-green-950:hsl(144.3 60.7% 12%);--sl-color-emerald-50:hsl(151.8 81% 95.9%);--sl-color-emerald-100:hsl(149.3 80.4% 90%);--sl-color-emerald-200:hsl(152.4 76% 80.4%);--sl-color-emerald-300:hsl(156.2 71.6% 66.9%);--sl-color-emerald-400:hsl(158.1 64.4% 51.6%);--sl-color-emerald-500:hsl(160.1 84.1% 39.4%);--sl-color-emerald-600:hsl(161.4 93.5% 30.4%);--sl-color-emerald-700:hsl(162.9 93.5% 24.3%);--sl-color-emerald-800:hsl(163.1 88.1% 19.8%);--sl-color-emerald-900:hsl(164.2 85.7% 16.5%);--sl-color-emerald-950:hsl(164.3 87.5% 9.4%);--sl-color-teal-50:hsl(166.2 76.5% 96.7%);--sl-color-teal-100:hsl(167.2 85.5% 89.2%);--sl-color-teal-200:hsl(168.4 83.8% 78.2%);--sl-color-teal-300:hsl(170.6 76.9% 64.3%);--sl-color-teal-400:hsl(172.5 66% 50.4%);--sl-color-teal-500:hsl(173.4 80.4% 40%);--sl-color-teal-600:hsl(174.7 83.9% 31.6%);--sl-color-teal-700:hsl(175.3 77.4% 26.1%);--sl-color-teal-800:hsl(176.1 69.4% 21.8%);--sl-color-teal-900:hsl(175.9 60.8% 19%);--sl-color-teal-950:hsl(176.5 58.6% 11.4%);--sl-color-cyan-50:hsl(183.2 100% 96.3%);--sl-color-cyan-100:hsl(185.1 95.9% 90.4%);--sl-color-cyan-200:hsl(186.2 93.5% 81.8%);--sl-color-cyan-300:hsl(187 92.4% 69%);--sl-color-cyan-400:hsl(187.9 85.7% 53.3%);--sl-color-cyan-500:hsl(188.7 94.5% 42.7%);--sl-color-cyan-600:hsl(191.6 91.4% 36.5%);--sl-color-cyan-700:hsl(192.9 82.3% 31%);--sl-color-cyan-800:hsl(194.4 69.6% 27.1%);--sl-color-cyan-900:hsl(196.4 63.6% 23.7%);--sl-color-cyan-950:hsl(196.8 61% 16.1%);--sl-color-sky-50:hsl(204 100% 97.1%);--sl-color-sky-100:hsl(204 93.8% 93.7%);--sl-color-sky-200:hsl(200.6 94.4% 86.1%);--sl-color-sky-300:hsl(199.4 95.5% 73.9%);--sl-color-sky-400:hsl(198.4 93.2% 59.6%);--sl-color-sky-500:hsl(198.6 88.7% 48.4%);--sl-color-sky-600:hsl(200.4 98% 39.4%);--sl-color-sky-700:hsl(201.3 96.3% 32.2%);--sl-color-sky-800:hsl(201 90% 27.5%);--sl-color-sky-900:hsl(202 80.3% 23.9%);--sl-color-sky-950:hsl(202.3 73.8% 16.5%);--sl-color-blue-50:hsl(213.8 100% 96.9%);--sl-color-blue-100:hsl(214.3 94.6% 92.7%);--sl-color-blue-200:hsl(213.3 96.9% 87.3%);--sl-color-blue-300:hsl(211.7 96.4% 78.4%);--sl-color-blue-400:hsl(213.1 93.9% 67.8%);--sl-color-blue-500:hsl(217.2 91.2% 59.8%);--sl-color-blue-600:hsl(221.2 83.2% 53.3%);--sl-color-blue-700:hsl(224.3 76.3% 48%);--sl-color-blue-800:hsl(225.9 70.7% 40.2%);--sl-color-blue-900:hsl(224.4 64.3% 32.9%);--sl-color-blue-950:hsl(226.2 55.3% 18.4%);--sl-color-indigo-50:hsl(225.9 100% 96.7%);--sl-color-indigo-100:hsl(226.5 100% 93.9%);--sl-color-indigo-200:hsl(228 96.5% 88.8%);--sl-color-indigo-300:hsl(229.7 93.5% 81.8%);--sl-color-indigo-400:hsl(234.5 89.5% 73.9%);--sl-color-indigo-500:hsl(238.7 83.5% 66.7%);--sl-color-indigo-600:hsl(243.4 75.4% 58.6%);--sl-color-indigo-700:hsl(244.5 57.9% 50.6%);--sl-color-indigo-800:hsl(243.7 54.5% 41.4%);--sl-color-indigo-900:hsl(242.2 47.4% 34.3%);--sl-color-indigo-950:hsl(243.5 43.6% 22.9%);--sl-color-violet-50:hsl(250 100% 97.6%);--sl-color-violet-100:hsl(251.4 91.3% 95.5%);--sl-color-violet-200:hsl(250.5 95.2% 91.8%);--sl-color-violet-300:hsl(252.5 94.7% 85.1%);--sl-color-violet-400:hsl(255.1 91.7% 76.3%);--sl-color-violet-500:hsl(258.3 89.5% 66.3%);--sl-color-violet-600:hsl(262.1 83.3% 57.8%);--sl-color-violet-700:hsl(263.4 70% 50.4%);--sl-color-violet-800:hsl(263.4 69.3% 42.2%);--sl-color-violet-900:hsl(263.5 67.4% 34.9%);--sl-color-violet-950:hsl(265.1 61.5% 21.4%);--sl-color-purple-50:hsl(270 100% 98%);--sl-color-purple-100:hsl(268.7 100% 95.5%);--sl-color-purple-200:hsl(268.6 100% 91.8%);--sl-color-purple-300:hsl(269.2 97.4% 85.1%);--sl-color-purple-400:hsl(270 95.2% 75.3%);--sl-color-purple-500:hsl(270.7 91% 65.1%);--sl-color-purple-600:hsl(271.5 81.3% 55.9%);--sl-color-purple-700:hsl(272.1 71.7% 47.1%);--sl-color-purple-800:hsl(272.9 67.2% 39.4%);--sl-color-purple-900:hsl(273.6 65.6% 32%);--sl-color-purple-950:hsl(276 59.5% 16.5%);--sl-color-fuchsia-50:hsl(289.1 100% 97.8%);--sl-color-fuchsia-100:hsl(287 100% 95.5%);--sl-color-fuchsia-200:hsl(288.3 95.8% 90.6%);--sl-color-fuchsia-300:hsl(291.1 93.1% 82.9%);--sl-color-fuchsia-400:hsl(292 91.4% 72.5%);--sl-color-fuchsia-500:hsl(292.2 84.1% 60.6%);--sl-color-fuchsia-600:hsl(293.4 69.5% 48.8%);--sl-color-fuchsia-700:hsl(294.7 72.4% 39.8%);--sl-color-fuchsia-800:hsl(295.4 70.2% 32.9%);--sl-color-fuchsia-900:hsl(296.7 63.6% 28%);--sl-color-fuchsia-950:hsl(297.1 56.8% 14.5%);--sl-color-pink-50:hsl(327.3 73.3% 97.1%);--sl-color-pink-100:hsl(325.7 77.8% 94.7%);--sl-color-pink-200:hsl(325.9 84.6% 89.8%);--sl-color-pink-300:hsl(327.4 87.1% 81.8%);--sl-color-pink-400:hsl(328.6 85.5% 70.2%);--sl-color-pink-500:hsl(330.4 81.2% 60.4%);--sl-color-pink-600:hsl(333.3 71.4% 50.6%);--sl-color-pink-700:hsl(335.1 77.6% 42%);--sl-color-pink-800:hsl(335.8 74.4% 35.3%);--sl-color-pink-900:hsl(335.9 69% 30.4%);--sl-color-pink-950:hsl(336.2 65.4% 15.9%);--sl-color-rose-50:hsl(355.7 100% 97.3%);--sl-color-rose-100:hsl(355.6 100% 94.7%);--sl-color-rose-200:hsl(352.7 96.1% 90%);--sl-color-rose-300:hsl(352.6 95.7% 81.8%);--sl-color-rose-400:hsl(351.3 94.5% 71.4%);--sl-color-rose-500:hsl(349.7 89.2% 60.2%);--sl-color-rose-600:hsl(346.8 77.2% 49.8%);--sl-color-rose-700:hsl(345.3 82.7% 40.8%);--sl-color-rose-800:hsl(343.4 79.7% 34.7%);--sl-color-rose-900:hsl(341.5 75.5% 30.4%);--sl-color-rose-950:hsl(341.3 70.1% 17.1%);--sl-color-primary-50:var(--sl-color-sky-50);--sl-color-primary-100:var(--sl-color-sky-100);--sl-color-primary-200:var(--sl-color-sky-200);--sl-color-primary-300:var(--sl-color-sky-300);--sl-color-primary-400:var(--sl-color-sky-400);--sl-color-primary-500:var(--sl-color-sky-500);--sl-color-primary-600:var(--sl-color-sky-600);--sl-color-primary-700:var(--sl-color-sky-700);--sl-color-primary-800:var(--sl-color-sky-800);--sl-color-primary-900:var(--sl-color-sky-900);--sl-color-primary-950:var(--sl-color-sky-950);--sl-color-success-50:var(--sl-color-green-50);--sl-color-success-100:var(--sl-color-green-100);--sl-color-success-200:var(--sl-color-green-200);--sl-color-success-300:var(--sl-color-green-300);--sl-color-success-400:var(--sl-color-green-400);--sl-color-success-500:var(--sl-color-green-500);--sl-color-success-600:var(--sl-color-green-600);--sl-color-success-700:var(--sl-color-green-700);--sl-color-success-800:var(--sl-color-green-800);--sl-color-success-900:var(--sl-color-green-900);--sl-color-success-950:var(--sl-color-green-950);--sl-color-warning-50:var(--sl-color-amber-50);--sl-color-warning-100:var(--sl-color-amber-100);--sl-color-warning-200:var(--sl-color-amber-200);--sl-color-warning-300:var(--sl-color-amber-300);--sl-color-warning-400:var(--sl-color-amber-400);--sl-color-warning-500:var(--sl-color-amber-500);--sl-color-warning-600:var(--sl-color-amber-600);--sl-color-warning-700:var(--sl-color-amber-700);--sl-color-warning-800:var(--sl-color-amber-800);--sl-color-warning-900:var(--sl-color-amber-900);--sl-color-warning-950:var(--sl-color-amber-950);--sl-color-danger-50:var(--sl-color-red-50);--sl-color-danger-100:var(--sl-color-red-100);--sl-color-danger-200:var(--sl-color-red-200);--sl-color-danger-300:var(--sl-color-red-300);--sl-color-danger-400:var(--sl-color-red-400);--sl-color-danger-500:var(--sl-color-red-500);--sl-color-danger-600:var(--sl-color-red-600);--sl-color-danger-700:var(--sl-color-red-700);--sl-color-danger-800:var(--sl-color-red-800);--sl-color-danger-900:var(--sl-color-red-900);--sl-color-danger-950:var(--sl-color-red-950);--sl-color-neutral-50:var(--sl-color-gray-50);--sl-color-neutral-100:var(--sl-color-gray-100);--sl-color-neutral-200:var(--sl-color-gray-200);--sl-color-neutral-300:var(--sl-color-gray-300);--sl-color-neutral-400:var(--sl-color-gray-400);--sl-color-neutral-500:var(--sl-color-gray-500);--sl-color-neutral-600:var(--sl-color-gray-600);--sl-color-neutral-700:var(--sl-color-gray-700);--sl-color-neutral-800:var(--sl-color-gray-800);--sl-color-neutral-900:var(--sl-color-gray-900);--sl-color-neutral-950:var(--sl-color-gray-950);--sl-color-neutral-0:hsl(0, 0%, 100%);--sl-color-neutral-1000:hsl(0, 0%, 0%);--sl-border-radius-small:0.1875rem;--sl-border-radius-medium:0.25rem;--sl-border-radius-large:0.5rem;--sl-border-radius-x-large:1rem;--sl-border-radius-circle:50%;--sl-border-radius-pill:9999px;--sl-shadow-x-small:0 1px 2px hsl(240 3.8% 46.1% / 6%);--sl-shadow-small:0 1px 2px hsl(240 3.8% 46.1% / 12%);--sl-shadow-medium:0 2px 4px hsl(240 3.8% 46.1% / 12%);--sl-shadow-large:0 2px 8px hsl(240 3.8% 46.1% / 12%);--sl-shadow-x-large:0 4px 16px hsl(240 3.8% 46.1% / 12%);--sl-spacing-3x-small:0.125rem;--sl-spacing-2x-small:0.25rem;--sl-spacing-x-small:0.5rem;--sl-spacing-small:0.75rem;--sl-spacing-medium:1rem;--sl-spacing-large:1.25rem;--sl-spacing-x-large:1.75rem;--sl-spacing-2x-large:2.25rem;--sl-spacing-3x-large:3rem;--sl-spacing-4x-large:4.5rem;--sl-transition-x-slow:1000ms;--sl-transition-slow:500ms;--sl-transition-medium:250ms;--sl-transition-fast:150ms;--sl-transition-x-fast:50ms;--sl-font-mono:SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--sl-font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\n Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",\n "Segoe UI Symbol";--sl-font-serif:Georgia, "Times New Roman", serif;--sl-font-size-2x-small:0.625rem;--sl-font-size-x-small:0.75rem;--sl-font-size-small:0.875rem;--sl-font-size-medium:1rem;--sl-font-size-large:1.25rem;--sl-font-size-x-large:1.5rem;--sl-font-size-2x-large:2.25rem;--sl-font-size-3x-large:3rem;--sl-font-size-4x-large:4.5rem;--sl-font-weight-light:300;--sl-font-weight-normal:400;--sl-font-weight-semibold:500;--sl-font-weight-bold:700;--sl-letter-spacing-denser:-0.03em;--sl-letter-spacing-dense:-0.015em;--sl-letter-spacing-normal:normal;--sl-letter-spacing-loose:0.075em;--sl-letter-spacing-looser:0.15em;--sl-line-height-denser:1;--sl-line-height-dense:1.4;--sl-line-height-normal:1.8;--sl-line-height-loose:2.2;--sl-line-height-looser:2.6;--sl-focus-ring-color:var(--sl-color-primary-600);--sl-focus-ring-style:solid;--sl-focus-ring-width:3px;--sl-focus-ring:var(--sl-focus-ring-style) var(--sl-focus-ring-width)\n var(--sl-focus-ring-color);--sl-focus-ring-offset:1px;--sl-button-font-size-small:var(--sl-font-size-x-small);--sl-button-font-size-medium:var(--sl-font-size-small);--sl-button-font-size-large:var(--sl-font-size-medium);--sl-input-height-small:1.875rem;--sl-input-height-medium:2.5rem;--sl-input-height-large:3.125rem;--sl-input-background-color:var(--sl-color-neutral-0);--sl-input-background-color-hover:var(--sl-input-background-color);--sl-input-background-color-focus:var(--sl-input-background-color);--sl-input-background-color-disabled:var(--sl-color-neutral-100);--sl-input-border-color:var(--sl-color-neutral-300);--sl-input-border-color-hover:var(--sl-color-neutral-400);--sl-input-border-color-focus:var(--sl-color-primary-500);--sl-input-border-color-disabled:var(--sl-color-neutral-300);--sl-input-border-width:1px;--sl-input-required-content:"*";--sl-input-required-content-offset:-2px;--sl-input-required-content-color:var(--sl-input-label-color);--sl-input-border-radius-small:var(--sl-border-radius-medium);--sl-input-border-radius-medium:var(--sl-border-radius-medium);--sl-input-border-radius-large:var(--sl-border-radius-medium);--sl-input-font-family:var(--sl-font-sans);--sl-input-font-weight:var(--sl-font-weight-normal);--sl-input-font-size-small:var(--sl-font-size-small);--sl-input-font-size-medium:var(--sl-font-size-medium);--sl-input-font-size-large:var(--sl-font-size-large);--sl-input-letter-spacing:var(--sl-letter-spacing-normal);--sl-input-color:var(--sl-color-neutral-700);--sl-input-color-hover:var(--sl-color-neutral-700);--sl-input-color-focus:var(--sl-color-neutral-700);--sl-input-color-disabled:var(--sl-color-neutral-900);--sl-input-icon-color:var(--sl-color-neutral-500);--sl-input-icon-color-hover:var(--sl-color-neutral-600);--sl-input-icon-color-focus:var(--sl-color-neutral-600);--sl-input-placeholder-color:var(--sl-color-neutral-500);--sl-input-placeholder-color-disabled:var(--sl-color-neutral-600);--sl-input-spacing-small:var(--sl-spacing-small);--sl-input-spacing-medium:var(--sl-spacing-medium);--sl-input-spacing-large:var(--sl-spacing-large);--sl-input-focus-ring-color:hsl(198.6 88.7% 48.4% / 40%);--sl-input-focus-ring-offset:0;--sl-input-filled-background-color:var(--sl-color-neutral-100);--sl-input-filled-background-color-hover:var(--sl-color-neutral-100);--sl-input-filled-background-color-focus:var(--sl-color-neutral-100);--sl-input-filled-background-color-disabled:var(--sl-color-neutral-100);--sl-input-filled-color:var(--sl-color-neutral-800);--sl-input-filled-color-hover:var(--sl-color-neutral-800);--sl-input-filled-color-focus:var(--sl-color-neutral-700);--sl-input-filled-color-disabled:var(--sl-color-neutral-800);--sl-input-label-font-size-small:var(--sl-font-size-small);--sl-input-label-font-size-medium:var(--sl-font-size-medium);--sl-input-label-font-size-large:var(--sl-font-size-large);--sl-input-label-color:inherit;--sl-input-help-text-font-size-small:var(--sl-font-size-x-small);--sl-input-help-text-font-size-medium:var(--sl-font-size-small);--sl-input-help-text-font-size-large:var(--sl-font-size-medium);--sl-input-help-text-color:var(--sl-color-neutral-500);--sl-toggle-size-small:0.875rem;--sl-toggle-size-medium:1.125rem;--sl-toggle-size-large:1.375rem;--sl-overlay-background-color:hsl(240 3.8% 46.1% / 33%);--sl-panel-background-color:var(--sl-color-neutral-0);--sl-panel-border-color:var(--sl-color-neutral-200);--sl-panel-border-width:1px;--sl-tooltip-border-radius:var(--sl-border-radius-medium);--sl-tooltip-background-color:var(--sl-color-neutral-800);--sl-tooltip-color:var(--sl-color-neutral-0);--sl-tooltip-font-family:var(--sl-font-sans);--sl-tooltip-font-weight:var(--sl-font-weight-normal);--sl-tooltip-font-size:var(--sl-font-size-small);--sl-tooltip-line-height:var(--sl-line-height-dense);--sl-tooltip-padding:var(--sl-spacing-2x-small) var(--sl-spacing-x-small);--sl-tooltip-arrow-size:6px;--sl-z-index-drawer:700;--sl-z-index-dialog:800;--sl-z-index-dropdown:900;--sl-z-index-toast:950;--sl-z-index-tooltip:1000}@supports (scrollbar-gutter: stable){.sl-scroll-lock{scrollbar-gutter:var(--sl-scroll-lock-gutter) !important}.sl-scroll-lock body{overflow:hidden !important}}@supports not (scrollbar-gutter: stable){.sl-scroll-lock body{padding-right:var(--sl-scroll-lock-size) !important;overflow:hidden !important}}.sl-toast-stack{position:fixed;top:0;inset-inline-end:0;z-index:var(--sl-z-index-toast);width:28rem;max-width:100%;max-height:100%;overflow:auto}.sl-toast-stack sl-alert{margin:var(--sl-spacing-medium)}.sl-toast-stack sl-alert::part(base){box-shadow:var(--sl-shadow-large)}.record-details{margin:0;word-wrap:break-word;line-height:var(--sl-line-height-dense)}.record-details .field+.field{margin:var(--sl-spacing-medium) 0 0 0}.record-details dt{font-weight:var(--sl-font-weight-bold);font-size:var(--sl-font-size-small)}.record-details dd{margin:var(--sl-spacing-x-small) 0 0 0}';const y=Object.keys(I);const B=class{constructor(e){t(this,e)}record;fieldNames;filteredRecord;get availableFields(){if(!this.fieldNames)return y;return this.fieldNames.filter((t=>t in this.record))}renderMetadata(t){return Object.entries(t).map((([t,e])=>this.renderField(t,e)))}renderField(t,e){if(!e)return;if(Array.isArray(e)&&!e.length)return;if(t==="references")return this.renderReferences();return i("div",{class:`field ${t}`},i("dt",null,I[t]),this.renderFieldValue(e))}renderFieldValue(t){if(Array.isArray(t))return t.map((t=>this.renderFieldValue(t)));return i("dd",null,t)}renderReferences(){const t=this.record.downloadLinks;const e=this.record.references.metadataLinks;if(!t.length&&!e.length)return;return i("div",{class:"references"},this.renderDownloadLinks(t),this.renderMetadataLinks(e))}renderDownloadLinks(t){if(!t.length)return;return i("div",{class:"field downloads"},i("dt",null,"Downloads"),t.map((({url:t,label:e})=>i("dd",null,i("a",{href:t},e)))))}renderMetadataLinks(t){if(!t.length)return;return i("div",{class:"field metadata"},i("dt",null,"Metadata"),t.map((({url:t,label:e})=>i("dd",null,i("a",{href:t},e)))))}render(){if(!this.record)return;const t=this.availableFields.reduce(((t,e)=>{t[e]=this.record[e];return t}),{});return i(r,null,i("dl",{class:"record-details"},this.renderMetadata(t)))}};B.style=b;
6
+ /**
7
+ * @license
8
+ * Copyright 2019 Google LLC
9
+ * SPDX-License-Identifier: BSD-3-Clause
10
+ */const C=globalThis,E=C.ShadowRoot&&(void 0===C.ShadyCSS||C.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_=Symbol(),Q=new WeakMap;let x=class t{constructor(t,e,i){if(this._$cssResult$=true,i!==_)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(E&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Q.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(e,t))}return t}toString(){return this.cssText}};const M=t=>new x("string"==typeof t?t:t+"",void 0,_),k=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,r)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new x(i,t,_)},D=(t,e)=>{if(E)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=C.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}},S=E?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return M(e)})(t):t
11
+ /**
12
+ * @license
13
+ * Copyright 2017 Google LLC
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ */;const{is:G,defineProperty:F,getOwnPropertyDescriptor:R,getOwnPropertyNames:L,getOwnPropertySymbols:z,getPrototypeOf:U}=Object,P=globalThis,N=P.trustedTypes,T=N?N.emptyScript:"",q=P.reactiveElementPolyfillSupport,O=(t,e)=>t,j={toAttribute(t,e){switch(e){case Boolean:t=t?T:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},J=(t,e)=>!G(t,e),H={attribute:true,type:String,converter:j,reflect:false,useDefault:false,hasChanged:J};Symbol.metadata??=Symbol("metadata"),P.litPropertyMetadata??=new WeakMap;let Y=class t extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=H){if(e.state&&(e.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=true),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);void 0!==r&&F(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:s}=R(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const o=r?.call(this);s?.call(this,e),this.requestUpdate(t,o,i)},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??H}static _$Ei(){if(this.hasOwnProperty(O("elementProperties")))return;const t=U(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(O("properties"))){const t=this.properties,e=[...L(t),...z(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(S(t))}else void 0!==t&&e.push(S(t));return e}static _$Eu(t,e){const i=e.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return D(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&true===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:j).toAttribute(e,i.type);this._$Em=t,null==s?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:j;this._$Em=r,this[r]=s.fromAttribute(e,t.type)??this._$Ej?.get(r)??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const r=this.constructor,s=this[t];if(i??=r.getPropertyOptions(t),!((i.hasChanged??J)(s,e)||i.useDefault&&i.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,e,i)}false===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:s},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),true!==s||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),true===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=true;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,r=this[e];true!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,i,r)}}let t=false;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=false,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=false}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};Y.elementStyles=[],Y.shadowRootOptions={mode:"open"},Y[O("elementProperties")]=new Map,Y[O("finalized")]=new Map,q?.({ReactiveElement:Y}),(P.reactiveElementVersions??=[]).push("2.1.0");
16
+ /**
17
+ * @license
18
+ * Copyright 2017 Google LLC
19
+ * SPDX-License-Identifier: BSD-3-Clause
20
+ */const $=globalThis,V=$.trustedTypes,K=V?V.createPolicy("lit-html",{createHTML:t=>t}):void 0,Z="$lit$",W=`lit$${Math.random().toFixed(9).slice(2)}$`,X="?"+W,tt=`<${X}>`,et=document,it=()=>et.createComment(""),rt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,st=Array.isArray,ot=t=>st(t)||"function"==typeof t?.[Symbol.iterator],nt="[ \t\n\f\r]",at=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,At=/>/g,ht=RegExp(`>|${nt}(?:([^\\s"'>=/]+)(${nt}*=${nt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,ut=/"/g,ft=/^(?:script|style|textarea|title)$/i,dt=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),gt=dt(1),pt=Symbol.for("lit-noChange"),mt=Symbol.for("lit-nothing"),wt=new WeakMap,It=et.createTreeWalker(et,129);function vt(t,e){if(!st(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==K?K.createHTML(e):e}const bt=(t,e)=>{const i=t.length-1,r=[];let s,o=2===e?"<svg>":3===e?"<math>":"",n=at;for(let e=0;e<i;e++){const i=t[e];let a,l,A=-1,h=0;for(;h<i.length&&(n.lastIndex=h,l=n.exec(i),null!==l);)h=n.lastIndex,n===at?"!--"===l[1]?n=lt:void 0!==l[1]?n=At:void 0!==l[2]?(ft.test(l[2])&&(s=RegExp("</"+l[2],"g")),n=ht):void 0!==l[3]&&(n=ht):n===ht?">"===l[0]?(n=s??at,A=-1):void 0===l[1]?A=-2:(A=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?ht:'"'===l[3]?ut:ct):n===ut||n===ct?n=ht:n===lt||n===At?n=at:(n=ht,s=void 0);const c=n===ht&&t[e+1].startsWith("/>")?" ":"";o+=n===at?i+tt:A>=0?(r.push(a),i.slice(0,A)+Z+i.slice(A)+W+c):i+W+(-2===A?e:c)}return[vt(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class yt{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let s=0,o=0;const n=t.length-1,a=this.parts,[l,A]=bt(t,e);if(this.el=yt.createElement(l,i),It.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=It.nextNode())&&a.length<n;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(Z)){const e=A[o++],i=r.getAttribute(t).split(W),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:n[2],strings:i,ctor:"."===n[1]?Qt:"?"===n[1]?xt:"@"===n[1]?Mt:_t}),r.removeAttribute(t)}else t.startsWith(W)&&(a.push({type:6,index:s}),r.removeAttribute(t));if(ft.test(r.tagName)){const t=r.textContent.split(W),e=t.length-1;if(e>0){r.textContent=V?V.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],it()),It.nextNode(),a.push({type:2,index:++s});r.append(t[e],it())}}}else if(8===r.nodeType)if(r.data===X)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=r.data.indexOf(W,t+1));)a.push({type:7,index:s}),t+=W.length-1}s++}}static createElement(t,e){const i=et.createElement("template");return i.innerHTML=t,i}}function Bt(t,e,i=t,r){if(e===pt)return e;let s=void 0!==r?i._$Co?.[r]:i._$Cl;const o=rt(e)?void 0:e._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(false),void 0===o?s=void 0:(s=new o(t),s._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=s:i._$Cl=s),void 0!==s&&(e=Bt(t,s._$AS(t,e.values),s,r)),e}class Ct{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??et).importNode(e,true);It.currentNode=r;let s=It.nextNode(),o=0,n=0,a=i[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new Et(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new kt(s,this,t)),this._$AV.push(e),a=i[++n]}o!==a?.index&&(s=It.nextNode(),o++)}return It.currentNode=et,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Et{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=mt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??true}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Bt(this,t,e),rt(t)?t===mt||null==t||""===t?(this._$AH!==mt&&this._$AR(),this._$AH=mt):t!==this._$AH&&t!==pt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):ot(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==mt&&rt(this._$AH)?this._$AA.nextSibling.data=t:this.T(et.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=yt.createElement(vt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new Ct(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=wt.get(t.strings);return void 0===e&&wt.set(t.strings,e=new yt(t)),e}k(t){st(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const s of t)r===e.length?e.push(i=new Et(this.O(it()),this.O(it()),this,this.options)):i=e[r],i._$AI(s),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(false,true,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class _t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,s){this.type=1,this._$AH=mt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=mt}_$AI(t,e=this,i,r){const s=this.strings;let o=false;if(void 0===s)t=Bt(this,t,e,0),o=!rt(t)||t!==this._$AH&&t!==pt,o&&(this._$AH=t);else{const r=t;let n,a;for(t=s[0],n=0;n<s.length-1;n++)a=Bt(this,r[i+n],e,n),a===pt&&(a=this._$AH[n]),o||=!rt(a)||a!==this._$AH[n],a===mt?t=mt:t!==mt&&(t+=(a??"")+s[n+1]),this._$AH[n]=a}o&&!r&&this.j(t)}j(t){t===mt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Qt extends _t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===mt?void 0:t}}class xt extends _t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==mt)}}class Mt extends _t{constructor(t,e,i,r,s){super(t,e,i,r,s),this.type=5}_$AI(t,e=this){if((t=Bt(this,t,e,0)??mt)===pt)return;const i=this._$AH,r=t===mt&&i!==mt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==mt&&(i===mt||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class kt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Bt(this,t)}}const Dt=$.litHtmlPolyfillSupport;Dt?.(yt,Et),($.litHtmlVersions??=[]).push("3.3.0");const St=(t,e,i)=>{const r=i?.renderBefore??e;let s=r._$litPart$;if(void 0===s){const t=i?.renderBefore??null;r._$litPart$=s=new Et(e.insertBefore(it(),t),t,void 0,i??{})}return s._$AI(t),s
21
+ /**
22
+ * @license
23
+ * Copyright 2017 Google LLC
24
+ * SPDX-License-Identifier: BSD-3-Clause
25
+ */};const Gt=globalThis;let Ft=class t extends Y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=St(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false)}render(){return pt}};Ft._$litElement$=true,Ft["finalized"]=true,Gt.litElementHydrateSupport?.({LitElement:Ft});const Rt=Gt.litElementPolyfillSupport;Rt?.({LitElement:Ft});(Gt.litElementVersions??=[]).push("4.2.0");var Lt=k`
26
+ :host {
27
+ --size: 25rem;
28
+ --header-spacing: var(--sl-spacing-large);
29
+ --body-spacing: var(--sl-spacing-large);
30
+ --footer-spacing: var(--sl-spacing-large);
31
+
32
+ display: contents;
33
+ }
34
+
35
+ .drawer {
36
+ top: 0;
37
+ inset-inline-start: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ pointer-events: none;
41
+ overflow: hidden;
42
+ }
43
+
44
+ .drawer--contained {
45
+ position: absolute;
46
+ z-index: initial;
47
+ }
48
+
49
+ .drawer--fixed {
50
+ position: fixed;
51
+ z-index: var(--sl-z-index-drawer);
52
+ }
53
+
54
+ .drawer__panel {
55
+ position: absolute;
56
+ display: flex;
57
+ flex-direction: column;
58
+ z-index: 2;
59
+ max-width: 100%;
60
+ max-height: 100%;
61
+ background-color: var(--sl-panel-background-color);
62
+ box-shadow: var(--sl-shadow-x-large);
63
+ overflow: auto;
64
+ pointer-events: all;
65
+ }
66
+
67
+ .drawer__panel:focus {
68
+ outline: none;
69
+ }
70
+
71
+ .drawer--top .drawer__panel {
72
+ top: 0;
73
+ inset-inline-end: auto;
74
+ bottom: auto;
75
+ inset-inline-start: 0;
76
+ width: 100%;
77
+ height: var(--size);
78
+ }
79
+
80
+ .drawer--end .drawer__panel {
81
+ top: 0;
82
+ inset-inline-end: 0;
83
+ bottom: auto;
84
+ inset-inline-start: auto;
85
+ width: var(--size);
86
+ height: 100%;
87
+ }
88
+
89
+ .drawer--bottom .drawer__panel {
90
+ top: auto;
91
+ inset-inline-end: auto;
92
+ bottom: 0;
93
+ inset-inline-start: 0;
94
+ width: 100%;
95
+ height: var(--size);
96
+ }
97
+
98
+ .drawer--start .drawer__panel {
99
+ top: 0;
100
+ inset-inline-end: auto;
101
+ bottom: auto;
102
+ inset-inline-start: 0;
103
+ width: var(--size);
104
+ height: 100%;
105
+ }
106
+
107
+ .drawer__header {
108
+ display: flex;
109
+ }
110
+
111
+ .drawer__title {
112
+ flex: 1 1 auto;
113
+ font: inherit;
114
+ font-size: var(--sl-font-size-large);
115
+ line-height: var(--sl-line-height-dense);
116
+ padding: var(--header-spacing);
117
+ margin: 0;
118
+ }
119
+
120
+ .drawer__header-actions {
121
+ flex-shrink: 0;
122
+ display: flex;
123
+ flex-wrap: wrap;
124
+ justify-content: end;
125
+ gap: var(--sl-spacing-2x-small);
126
+ padding: 0 var(--header-spacing);
127
+ }
128
+
129
+ .drawer__header-actions sl-icon-button,
130
+ .drawer__header-actions ::slotted(sl-icon-button) {
131
+ flex: 0 0 auto;
132
+ display: flex;
133
+ align-items: center;
134
+ font-size: var(--sl-font-size-medium);
135
+ }
136
+
137
+ .drawer__body {
138
+ flex: 1 1 auto;
139
+ display: block;
140
+ padding: var(--body-spacing);
141
+ overflow: auto;
142
+ -webkit-overflow-scrolling: touch;
143
+ }
144
+
145
+ .drawer__footer {
146
+ text-align: right;
147
+ padding: var(--footer-spacing);
148
+ }
149
+
150
+ .drawer__footer ::slotted(sl-button:not(:last-of-type)) {
151
+ margin-inline-end: var(--sl-spacing-x-small);
152
+ }
153
+
154
+ .drawer:not(.drawer--has-footer) .drawer__footer {
155
+ display: none;
156
+ }
157
+
158
+ .drawer__overlay {
159
+ display: block;
160
+ position: fixed;
161
+ top: 0;
162
+ right: 0;
163
+ bottom: 0;
164
+ left: 0;
165
+ background-color: var(--sl-overlay-background-color);
166
+ pointer-events: all;
167
+ }
168
+
169
+ .drawer--contained .drawer__overlay {
170
+ display: none;
171
+ }
172
+
173
+ @media (forced-colors: active) {
174
+ .drawer__panel {
175
+ border: solid 1px var(--sl-color-neutral-0);
176
+ }
177
+ }
178
+ `;var zt=Object.defineProperty;var Ut=Object.defineProperties;var Pt=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyDescriptors;var Tt=Object.getOwnPropertySymbols;var qt=Object.prototype.hasOwnProperty;var Ot=Object.prototype.propertyIsEnumerable;var jt=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var Jt=t=>{throw TypeError(t)};var Ht=(t,e,i)=>e in t?zt(t,e,{enumerable:true,configurable:true,writable:true,value:i}):t[e]=i;var Yt=(t,e)=>{for(var i in e||(e={}))if(qt.call(e,i))Ht(t,i,e[i]);if(Tt)for(var i of Tt(e)){if(Ot.call(e,i))Ht(t,i,e[i])}return t};var $t=(t,e)=>Ut(t,Nt(e));var Vt=(t,e,i,r)=>{var s=r>1?void 0:r?Pt(e,i):e;for(var o=t.length-1,n;o>=0;o--)if(n=t[o])s=(r?n(e,i,s):n(s))||s;if(r&&s)zt(e,i,s);return s};var Kt=(t,e,i)=>e.has(t)||Jt("Cannot "+i);var Zt=(t,e,i)=>(Kt(t,e,"read from private field"),e.get(t));var Wt=(t,e,i)=>e.has(t)?Jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i);var Xt=(t,e,i,r)=>(Kt(t,e,"write to private field"),e.set(t,i),i);var te=function(t,e){this[0]=t;this[1]=e};var ee=t=>{var e=t[jt("asyncIterator")],i=false,r,s={};if(e==null){e=t[jt("iterator")]();r=t=>s[t]=i=>e[t](i)}else{e=e.call(t);r=t=>s[t]=r=>{if(i){i=false;if(t==="throw")throw r;return r}i=true;return{done:false,value:new te(new Promise((i=>{var s=e[t](r);if(!(s instanceof Object))Jt("Object expected");i(s)})),1)}}}return s[jt("iterator")]=()=>s,r("next"),"throw"in e?r("throw"):s.throw=t=>{throw t},"return"in e&&r("return"),s};function*ie(t=document.activeElement){if(t===null||t===void 0)return;yield t;if("shadowRoot"in t&&t.shadowRoot&&t.shadowRoot.mode!=="closed"){yield*ee(ie(t.shadowRoot.activeElement))}}function re(){return[...ie()].pop()}var se=new WeakMap;function oe(t){let e=se.get(t);if(!e){e=window.getComputedStyle(t,null);se.set(t,e)}return e}function ne(t){if(typeof t.checkVisibility==="function"){return t.checkVisibility({checkOpacity:false,checkVisibilityCSS:true})}const e=oe(t);return e.visibility!=="hidden"&&e.display!=="none"}function ae(t){const e=oe(t);const{overflowY:i,overflowX:r}=e;if(i==="scroll"||r==="scroll"){return true}if(i!=="auto"||r!=="auto"){return false}const s=t.scrollHeight>t.clientHeight;if(s&&i==="auto"){return true}const o=t.scrollWidth>t.clientWidth;if(o&&r==="auto"){return true}return false}function le(t){const e=t.tagName.toLowerCase();const i=Number(t.getAttribute("tabindex"));const r=t.hasAttribute("tabindex");if(r&&(isNaN(i)||i<=-1)){return false}if(t.hasAttribute("disabled")){return false}if(t.closest("[inert]")){return false}if(e==="input"&&t.getAttribute("type")==="radio"){const e=t.getRootNode();const i=`input[type='radio'][name="${t.getAttribute("name")}"]`;const r=e.querySelector(`${i}:checked`);if(r){return r===t}const s=e.querySelector(i);return s===t}if(!ne(t)){return false}if((e==="audio"||e==="video")&&t.hasAttribute("controls")){return true}if(t.hasAttribute("tabindex")){return true}if(t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")!=="false"){return true}const s=["button","input","select","textarea","a","audio","video","summary","iframe"].includes(e);if(s){return true}return ae(t)}function Ae(t,e){var i;return((i=t.getRootNode({composed:true}))==null?void 0:i.host)!==e}function he(t){const e=new WeakMap;const i=[];function r(s){if(s instanceof Element){if(s.hasAttribute("inert")||s.closest("[inert]")){return}if(e.has(s)){return}e.set(s,true);if(!i.includes(s)&&le(s)){i.push(s)}if(s instanceof HTMLSlotElement&&Ae(s,t)){s.assignedElements({flatten:true}).forEach((t=>{r(t)}))}if(s.shadowRoot!==null&&s.shadowRoot.mode==="open"){r(s.shadowRoot)}}for(const t of s.children){r(t)}}r(t);return i.sort(((t,e)=>{const i=Number(t.getAttribute("tabindex"))||0;const r=Number(e.getAttribute("tabindex"))||0;return r-i}))}var ce=[];var ue=class{constructor(t){this.tabDirection="forward";this.handleFocusIn=()=>{if(!this.isActive())return;this.checkFocus()};this.handleKeyDown=t=>{var e;if(t.key!=="Tab"||this.isExternalActivated)return;if(!this.isActive())return;const i=re();this.previousFocus=i;if(this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus)){return}if(t.shiftKey){this.tabDirection="backward"}else{this.tabDirection="forward"}const r=he(this.element);let s=r.findIndex((t=>t===i));this.previousFocus=this.currentFocus;const o=this.tabDirection==="forward"?1:-1;while(true){if(s+o>=r.length){s=0}else if(s+o<0){s=r.length-1}else{s+=o}this.previousFocus=this.currentFocus;const i=r[s];if(this.tabDirection==="backward"){if(this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus)){return}}if(i&&this.possiblyHasTabbableChildren(i)){return}t.preventDefault();this.currentFocus=i;(e=this.currentFocus)==null?void 0:e.focus({preventScroll:false});const n=[...ie()];if(n.includes(this.currentFocus)||!n.includes(this.previousFocus)){break}}setTimeout((()=>this.checkFocus()))};this.handleKeyUp=()=>{this.tabDirection="forward"};this.element=t;this.elementsWithTabbableControls=["iframe"]}activate(){ce.push(this.element);document.addEventListener("focusin",this.handleFocusIn);document.addEventListener("keydown",this.handleKeyDown);document.addEventListener("keyup",this.handleKeyUp)}deactivate(){ce=ce.filter((t=>t!==this.element));this.currentFocus=null;document.removeEventListener("focusin",this.handleFocusIn);document.removeEventListener("keydown",this.handleKeyDown);document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return ce[ce.length-1]===this.element}activateExternal(){this.isExternalActivated=true}deactivateExternal(){this.isExternalActivated=false}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const t=he(this.element);if(!this.element.matches(":focus-within")){const e=t[0];const i=t[t.length-1];const r=this.tabDirection==="forward"?e:i;if(typeof(r==null?void 0:r.focus)==="function"){this.currentFocus=r;r.focus({preventScroll:false})}}}}possiblyHasTabbableChildren(t){return this.elementsWithTabbableControls.includes(t.tagName.toLowerCase())||t.hasAttribute("controls")}};function fe(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}var de=new Set;function ge(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function pe(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));if(isNaN(t)||!t){return 0}return t}function me(t){de.add(t);if(!document.documentElement.classList.contains("sl-scroll-lock")){const t=ge()+pe();let e=getComputedStyle(document.documentElement).scrollbarGutter;if(!e||e==="auto"){e="stable"}if(t<2){e=""}document.documentElement.style.setProperty("--sl-scroll-lock-gutter",e);document.documentElement.classList.add("sl-scroll-lock");document.documentElement.style.setProperty("--sl-scroll-lock-size",`${t}px`)}}function we(t){de.delete(t);if(de.size===0){document.documentElement.classList.remove("sl-scroll-lock");document.documentElement.style.removeProperty("--sl-scroll-lock-size")}}function Ie(t,e,i="vertical",r="smooth"){const s=fe(t,e);const o=s.top+e.scrollTop;const n=s.left+e.scrollLeft;const a=e.scrollLeft;const l=e.scrollLeft+e.offsetWidth;const A=e.scrollTop;const h=e.scrollTop+e.offsetHeight;if(i==="horizontal"||i==="both"){if(n<a){e.scrollTo({left:n,behavior:r})}else if(n+t.clientWidth>l){e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:r})}}if(i==="vertical"||i==="both"){if(o<A){e.scrollTo({top:o,behavior:r})}else if(o+t.clientHeight>h){e.scrollTo({top:o-e.offsetHeight+t.clientHeight,behavior:r})}}}var ve=t=>{var e;const{activeElement:i}=document;if(i&&t.contains(i)){(e=document.activeElement)==null?void 0:e.blur()}};var be=k`
179
+ :host {
180
+ display: inline-block;
181
+ color: var(--sl-color-neutral-600);
182
+ }
183
+
184
+ .icon-button {
185
+ flex: 0 0 auto;
186
+ display: flex;
187
+ align-items: center;
188
+ background: none;
189
+ border: none;
190
+ border-radius: var(--sl-border-radius-medium);
191
+ font-size: inherit;
192
+ color: inherit;
193
+ padding: var(--sl-spacing-x-small);
194
+ cursor: pointer;
195
+ transition: var(--sl-transition-x-fast) color;
196
+ -webkit-appearance: none;
197
+ }
198
+
199
+ .icon-button:hover:not(.icon-button--disabled),
200
+ .icon-button:focus-visible:not(.icon-button--disabled) {
201
+ color: var(--sl-color-primary-600);
202
+ }
203
+
204
+ .icon-button:active:not(.icon-button--disabled) {
205
+ color: var(--sl-color-primary-700);
206
+ }
207
+
208
+ .icon-button:focus {
209
+ outline: none;
210
+ }
211
+
212
+ .icon-button--disabled {
213
+ opacity: 0.5;
214
+ cursor: not-allowed;
215
+ }
216
+
217
+ .icon-button:focus-visible {
218
+ outline: var(--sl-focus-ring);
219
+ outline-offset: var(--sl-focus-ring-offset);
220
+ }
221
+
222
+ .icon-button__icon {
223
+ pointer-events: none;
224
+ }
225
+ `;var ye="";function Be(t){ye=t}function Ce(t=""){if(!ye){const t=[...document.getElementsByTagName("script")];const e=t.find((t=>t.hasAttribute("data-shoelace")));if(e){Be(e.getAttribute("data-shoelace"))}else{const e=t.find((t=>/shoelace(\.min)?\.js($|\?)/.test(t.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(t.src)));let i="";if(e){i=e.getAttribute("src")}Be(i.split("/").slice(0,-1).join("/"))}}return ye.replace(/\/$/,"")+(t?`/${t.replace(/^\//,"")}`:``)}var Ee={name:"default",resolver:t=>Ce(`assets/icons/${t}.svg`)};var _e=Ee;var Qe={caret:`\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>\n `,check:`\n <svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor">\n <g transform="translate(3.428571, 3.428571)">\n <path d="M0,5.71428571 L3.42857143,9.14285714"></path>\n <path d="M9.14285714,0 L3.42857143,9.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n `,"chevron-down":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>\n </svg>\n `,"chevron-left":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>\n </svg>\n `,"chevron-right":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>\n </svg>\n `,copy:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>\n </svg>\n `,eye:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">\n <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>\n <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>\n </svg>\n `,"eye-slash":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">\n <path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>\n <path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>\n <path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>\n </svg>\n `,eyedropper:`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">\n <path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>\n </svg>\n `,"grip-vertical":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">\n <path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>\n </svg>\n `,indeterminate:`\n <svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">\n <g stroke="currentColor" stroke-width="2">\n <g transform="translate(2.285714, 6.857143)">\n <path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>\n </g>\n </g>\n </g>\n </svg>\n `,"person-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">\n <path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>\n </svg>\n `,"play-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">\n <path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>\n </svg>\n `,"pause-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">\n <path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>\n </svg>\n `,radio:`\n <svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <circle cx="8" cy="8" r="3.42857143"></circle>\n </g>\n </g>\n </svg>\n `,"star-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">\n <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>\n </svg>\n `,"x-lg":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">\n <path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>\n </svg>\n `,"x-circle-fill":`\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">\n <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>\n </svg>\n `};var xe={name:"system",resolver:t=>{if(t in Qe){return`data:image/svg+xml,${encodeURIComponent(Qe[t])}`}return""}};var Me=xe;var ke=[_e,Me];var De=[];function Se(t){De.push(t)}function Ge(t){De=De.filter((e=>e!==t))}function Fe(t){return ke.find((e=>e.name===t))}var Re=k`
226
+ :host {
227
+ display: inline-block;
228
+ width: 1em;
229
+ height: 1em;
230
+ box-sizing: content-box !important;
231
+ }
232
+
233
+ svg {
234
+ display: block;
235
+ height: 100%;
236
+ width: 100%;
237
+ }
238
+ `;function Le(t,e){const i=Yt({waitUntilFirstUpdate:false},e);return(e,r)=>{const{update:s}=e;const o=Array.isArray(t)?t:[t];e.update=function(t){o.forEach((e=>{const s=e;if(t.has(s)){const e=t.get(s);const o=this[s];if(e!==o){if(!i.waitUntilFirstUpdate||this.hasUpdated){this[r](e,o)}}}}));s.call(this,t)}}}var ze=k`
239
+ :host {
240
+ box-sizing: border-box;
241
+ }
242
+
243
+ :host *,
244
+ :host *::before,
245
+ :host *::after {
246
+ box-sizing: inherit;
247
+ }
248
+
249
+ [hidden] {
250
+ display: none !important;
251
+ }
252
+ `
253
+ /**
254
+ * @license
255
+ * Copyright 2017 Google LLC
256
+ * SPDX-License-Identifier: BSD-3-Clause
257
+ */;const Ue={attribute:true,type:String,converter:j,reflect:false,hasChanged:J},Pe=(t=Ue,e,i)=>{const{kind:r,metadata:s}=i;let o=globalThis.litPropertyMetadata.get(s);if(void 0===o&&globalThis.litPropertyMetadata.set(s,o=new Map),"setter"===r&&((t=Object.create(t)).wrapped=true),o.set(i.name,t),"accessor"===r){const{name:r}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(r,s,t)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=i;return function(i){const s=this[r];e.call(this,i),this.requestUpdate(r,s,t)}}throw Error("Unsupported decorator location: "+r)};function Ne(t){return(e,i)=>"object"==typeof i?Pe(t,e,i):((t,e,i)=>{const r=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),r?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)
258
+ /**
259
+ * @license
260
+ * Copyright 2017 Google LLC
261
+ * SPDX-License-Identifier: BSD-3-Clause
262
+ */}function Te(t){return Ne({...t,state:true,attribute:false})}
263
+ /**
264
+ * @license
265
+ * Copyright 2017 Google LLC
266
+ * SPDX-License-Identifier: BSD-3-Clause
267
+ */function qe(t){return(e,i)=>{const r="function"==typeof e?e:e[i];Object.assign(r,t)}}
268
+ /**
269
+ * @license
270
+ * Copyright 2017 Google LLC
271
+ * SPDX-License-Identifier: BSD-3-Clause
272
+ */const Oe=(t,e,i)=>(i.configurable=true,i.enumerable=true,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i)
273
+ /**
274
+ * @license
275
+ * Copyright 2017 Google LLC
276
+ * SPDX-License-Identifier: BSD-3-Clause
277
+ */;function je(t,e){return(e,i,r)=>{const s=e=>e.renderRoot?.querySelector(t)??null;return Oe(e,i,{get(){return s(this)}})}}var Je;var He=class extends Ft{constructor(){super();Wt(this,Je,false);this.initialReflectedProperties=new Map;Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}emit(t,e){const i=new CustomEvent(t,Yt({bubbles:true,cancelable:false,composed:true,detail:{}},e));this.dispatchEvent(i);return i}static define(t,e=this,i={}){const r=customElements.get(t);if(!r){try{customElements.define(t,e,i)}catch(r){customElements.define(t,class extends e{},i)}return}let s=" (unknown version)";let o=s;if("version"in e&&e.version){s=" v"+e.version}if("version"in r&&r.version){o=" v"+r.version}if(s&&o&&s===o){return}console.warn(`Attempted to register <${t}>${s}, but <${t}>${o} has already been registered.`)}attributeChangedCallback(t,e,i){if(!Zt(this,Je)){this.constructor.elementProperties.forEach(((t,e)=>{if(t.reflect&&this[e]!=null){this.initialReflectedProperties.set(e,this[e])}}));Xt(this,Je,true)}super.attributeChangedCallback(t,e,i)}willUpdate(t){super.willUpdate(t);this.initialReflectedProperties.forEach(((e,i)=>{if(t.has(i)&&this[i]==null){this[i]=e}}))}};Je=new WeakMap;He.version="2.20.1";He.dependencies={};Vt([Ne()],He.prototype,"dir",2);Vt([Ne()],He.prototype,"lang",2);
278
+ /**
279
+ * @license
280
+ * Copyright 2020 Google LLC
281
+ * SPDX-License-Identifier: BSD-3-Clause
282
+ */const Ye=(t,e)=>void 0!==t?._$litType$;var $e=Symbol();var Ve=Symbol();var Ke;var Ze=new Map;var We=class extends He{constructor(){super(...arguments);this.initialRender=false;this.svg=null;this.label="";this.library="default"}async resolveIcon(t,e){var i;let r;if(e==null?void 0:e.spriteSheet){this.svg=gt`<svg part="svg">
283
+ <use part="use" href="${t}"></use>
284
+ </svg>`;return this.svg}try{r=await fetch(t,{mode:"cors"});if(!r.ok)return r.status===410?$e:Ve}catch(t){return Ve}try{const t=document.createElement("div");t.innerHTML=await r.text();const e=t.firstElementChild;if(((i=e==null?void 0:e.tagName)==null?void 0:i.toLowerCase())!=="svg")return $e;if(!Ke)Ke=new DOMParser;const s=Ke.parseFromString(e.outerHTML,"text/html");const o=s.body.querySelector("svg");if(!o)return $e;o.part.add("svg");return document.adoptNode(o)}catch(t){return $e}}connectedCallback(){super.connectedCallback();Se(this)}firstUpdated(){this.initialRender=true;this.setIcon()}disconnectedCallback(){super.disconnectedCallback();Ge(this)}getIconSource(){const t=Fe(this.library);if(this.name&&t){return{url:t.resolver(this.name),fromLibrary:true}}return{url:this.src,fromLibrary:false}}handleLabelChange(){const t=typeof this.label==="string"&&this.label.length>0;if(t){this.setAttribute("role","img");this.setAttribute("aria-label",this.label);this.removeAttribute("aria-hidden")}else{this.removeAttribute("role");this.removeAttribute("aria-label");this.setAttribute("aria-hidden","true")}}async setIcon(){var t;const{url:e,fromLibrary:i}=this.getIconSource();const r=i?Fe(this.library):void 0;if(!e){this.svg=null;return}let s=Ze.get(e);if(!s){s=this.resolveIcon(e,r);Ze.set(e,s)}if(!this.initialRender){return}const o=await s;if(o===Ve){Ze.delete(e)}if(e!==this.getIconSource().url){return}if(Ye(o)){this.svg=o;if(r){await this.updateComplete;const t=this.shadowRoot.querySelector("[part='svg']");if(typeof r.mutator==="function"&&t){r.mutator(t)}}return}switch(o){case Ve:case $e:this.svg=null;this.emit("sl-error");break;default:this.svg=o.cloneNode(true);(t=r==null?void 0:r.mutator)==null?void 0:t.call(r,this.svg);this.emit("sl-load")}}render(){return this.svg}};We.styles=[ze,Re];Vt([Te()],We.prototype,"svg",2);Vt([Ne({reflect:true})],We.prototype,"name",2);Vt([Ne()],We.prototype,"src",2);Vt([Ne()],We.prototype,"label",2);Vt([Ne({reflect:true})],We.prototype,"library",2);Vt([Le("label")],We.prototype,"handleLabelChange",1);Vt([Le(["name","src","library"])],We.prototype,"setIcon",1);
285
+ /**
286
+ * @license
287
+ * Copyright 2017 Google LLC
288
+ * SPDX-License-Identifier: BSD-3-Clause
289
+ */const Xe={ATTRIBUTE:1},ti=t=>(...e)=>({_$litDirective$:t,values:e});let ei=class t{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
290
+ /**
291
+ * @license
292
+ * Copyright 2018 Google LLC
293
+ * SPDX-License-Identifier: BSD-3-Clause
294
+ */const ii=ti(class extends ei{constructor(t){if(super(t),t.type!==Xe.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const r=!!e[t];r===this.st.has(t)||this.nt?.has(t)||(r?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return pt}});
295
+ /**
296
+ * @license
297
+ * Copyright 2020 Google LLC
298
+ * SPDX-License-Identifier: BSD-3-Clause
299
+ */const ri=Symbol.for(""),si=t=>{if(t?.r===ri)return t?._$litStatic$},oi=(t,...e)=>({_$litStatic$:e.reduce(((e,i,r)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[r+1]),t[0]),r:ri}),ni=new Map,ai=t=>(e,...i)=>{const r=i.length;let s,o;const n=[],a=[];let l,A=0,h=false;for(;A<r;){for(l=e[A];A<r&&void 0!==(o=i[A],s=si(o));)l+=s+e[++A],h=true;A!==r&&a.push(o),n.push(l),A++}if(A===r&&n.push(e[r]),h){const t=n.join("$$lit$$");void 0===(e=ni.get(t))&&(n.raw=n,ni.set(t,e=n)),i=a}return t(e,...i)},li=ai(gt);
300
+ /**
301
+ * @license
302
+ * Copyright 2018 Google LLC
303
+ * SPDX-License-Identifier: BSD-3-Clause
304
+ */const Ai=t=>t??mt;var hi=class extends He{constructor(){super(...arguments);this.hasFocus=false;this.label="";this.disabled=false}handleBlur(){this.hasFocus=false;this.emit("sl-blur")}handleFocus(){this.hasFocus=true;this.emit("sl-focus")}handleClick(t){if(this.disabled){t.preventDefault();t.stopPropagation()}}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t=this.href?true:false;const e=t?oi`a`:oi`button`;return li`
305
+ <${e}
306
+ part="base"
307
+ class=${ii({"icon-button":true,"icon-button--disabled":!t&&this.disabled,"icon-button--focused":this.hasFocus})}
308
+ ?disabled=${Ai(t?void 0:this.disabled)}
309
+ type=${Ai(t?void 0:"button")}
310
+ href=${Ai(t?this.href:void 0)}
311
+ target=${Ai(t?this.target:void 0)}
312
+ download=${Ai(t?this.download:void 0)}
313
+ rel=${Ai(t&&this.target?"noreferrer noopener":void 0)}
314
+ role=${Ai(t?void 0:"button")}
315
+ aria-disabled=${this.disabled?"true":"false"}
316
+ aria-label="${this.label}"
317
+ tabindex=${this.disabled?"-1":"0"}
318
+ @blur=${this.handleBlur}
319
+ @focus=${this.handleFocus}
320
+ @click=${this.handleClick}
321
+ >
322
+ <sl-icon
323
+ class="icon-button__icon"
324
+ name=${Ai(this.name)}
325
+ library=${Ai(this.library)}
326
+ src=${Ai(this.src)}
327
+ aria-hidden="true"
328
+ ></sl-icon>
329
+ </${e}>
330
+ `}};hi.styles=[ze,be];hi.dependencies={"sl-icon":We};Vt([je(".icon-button")],hi.prototype,"button",2);Vt([Te()],hi.prototype,"hasFocus",2);Vt([Ne()],hi.prototype,"name",2);Vt([Ne()],hi.prototype,"library",2);Vt([Ne()],hi.prototype,"src",2);Vt([Ne()],hi.prototype,"href",2);Vt([Ne()],hi.prototype,"target",2);Vt([Ne()],hi.prototype,"download",2);Vt([Ne()],hi.prototype,"label",2);Vt([Ne({type:Boolean,reflect:true})],hi.prototype,"disabled",2);var ci=new Map;var ui=new WeakMap;function fi(t){return t!=null?t:{keyframes:[],options:{duration:0}}}function di(t,e){if(e.toLowerCase()==="rtl"){return{keyframes:t.rtlKeyframes||t.keyframes,options:t.options}}return t}function gi(t,e){ci.set(t,fi(e))}function pi(t,e,i){const r=ui.get(t);if(r==null?void 0:r[e]){return di(r[e],i.dir)}const s=ci.get(e);if(s){return di(s,i.dir)}return{keyframes:[],options:{duration:0}}}function mi(t,e){return new Promise((i=>{function r(s){if(s.target===t){t.removeEventListener(e,r);i()}}t.addEventListener(e,r)}))}function wi(t,e,i){return new Promise((r=>{if((i==null?void 0:i.duration)===Infinity){throw new Error("Promise-based animations must be finite.")}const s=t.animate(e,$t(Yt({},i),{duration:Ii()?0:i.duration}));s.addEventListener("cancel",r,{once:true});s.addEventListener("finish",r,{once:true})}))}function Ii(){const t=window.matchMedia("(prefers-reduced-motion: reduce)");return t.matches}function vi(t){return Promise.all(t.getAnimations().map((t=>new Promise((e=>{t.cancel();requestAnimationFrame(e)})))))}var bi=class{constructor(t,...e){this.slotNames=[];this.handleSlotChange=t=>{const e=t.target;if(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name)){this.host.requestUpdate()}};(this.host=t).addController(this);this.slotNames=e}hasDefaultSlot(){return[...this.host.childNodes].some((t=>{if(t.nodeType===t.TEXT_NODE&&t.textContent.trim()!==""){return true}if(t.nodeType===t.ELEMENT_NODE){const e=t;const i=e.tagName.toLowerCase();if(i==="sl-visually-hidden"){return false}if(!e.hasAttribute("slot")){return true}}return false}))}hasNamedSlot(t){return this.host.querySelector(`:scope > [slot="${t}"]`)!==null}test(t){return t==="[default]"?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}};const yi=new Set;const Bi=new Map;let Ci;let Ei="ltr";let _i="en";const Qi=typeof MutationObserver!=="undefined"&&typeof document!=="undefined"&&typeof document.documentElement!=="undefined";if(Qi){const t=new MutationObserver(Mi);Ei=document.documentElement.dir||"ltr";_i=document.documentElement.lang||navigator.language;t.observe(document.documentElement,{attributes:true,attributeFilter:["dir","lang"]})}function xi(...t){t.map((t=>{const e=t.$code.toLowerCase();if(Bi.has(e)){Bi.set(e,Object.assign(Object.assign({},Bi.get(e)),t))}else{Bi.set(e,t)}if(!Ci){Ci=t}}));Mi()}function Mi(){if(Qi){Ei=document.documentElement.dir||"ltr";_i=document.documentElement.lang||navigator.language}[...yi.keys()].map((t=>{if(typeof t.requestUpdate==="function"){t.requestUpdate()}}))}let ki=class t{constructor(t){this.host=t;this.host.addController(this)}hostConnected(){yi.add(this.host)}hostDisconnected(){yi.delete(this.host)}dir(){return`${this.host.dir||Ei}`.toLowerCase()}lang(){return`${this.host.lang||_i}`.toLowerCase()}getTranslationData(t){var e,i;const r=new Intl.Locale(t.replace(/_/g,"-"));const s=r===null||r===void 0?void 0:r.language.toLowerCase();const o=(i=(e=r===null||r===void 0?void 0:r.region)===null||e===void 0?void 0:e.toLowerCase())!==null&&i!==void 0?i:"";const n=Bi.get(`${s}-${o}`);const a=Bi.get(s);return{locale:r,language:s,region:o,primary:n,secondary:a}}exists(t,e){var i;const{primary:r,secondary:s}=this.getTranslationData((i=e.lang)!==null&&i!==void 0?i:this.lang());e=Object.assign({includeFallback:false},e);if(r&&r[t]||s&&s[t]||e.includeFallback&&Ci&&Ci[t]){return true}return false}term(t,...e){const{primary:i,secondary:r}=this.getTranslationData(this.lang());let s;if(i&&i[t]){s=i[t]}else if(r&&r[t]){s=r[t]}else if(Ci&&Ci[t]){s=Ci[t]}else{console.error(`No translation found for: ${String(t)}`);return String(t)}if(typeof s==="function"){return s(...e)}return s}date(t,e){t=new Date(t);return new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){t=Number(t);return isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,i){return new Intl.RelativeTimeFormat(this.lang(),i).format(t,e)}};var Di={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:t=>{if(t===0)return"No options selected";if(t===1)return"1 option selected";return`${t} options selected`},previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:t=>`Slide ${t}`,toggleColorFormat:"Toggle color format"};xi(Di);var Si=Di;var Gi=class extends ki{};xi(Si);function Fi(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Ri=class extends He{constructor(){super(...arguments);this.hasSlotController=new bi(this,"footer");this.localize=new Gi(this);this.modal=new ue(this);this.open=false;this.label="";this.placement="end";this.contained=false;this.noHeader=false;this.handleDocumentKeyDown=t=>{if(this.contained){return}if(t.key==="Escape"&&this.modal.isActive()&&this.open){t.stopImmediatePropagation();this.requestClose("keyboard")}}}firstUpdated(){this.drawer.hidden=!this.open;if(this.open){this.addOpenListeners();if(!this.contained){this.modal.activate();me(this)}}}disconnectedCallback(){super.disconnectedCallback();we(this);this.removeOpenListeners()}requestClose(t){const e=this.emit("sl-request-close",{cancelable:true,detail:{source:t}});if(e.defaultPrevented){const t=pi(this,"drawer.denyClose",{dir:this.localize.dir()});wi(this.panel,t.keyframes,t.options);return}this.hide()}addOpenListeners(){var t;if("CloseWatcher"in window){(t=this.closeWatcher)==null?void 0:t.destroy();if(!this.contained){this.closeWatcher=new CloseWatcher;this.closeWatcher.onclose=()=>this.requestClose("keyboard")}}else{document.addEventListener("keydown",this.handleDocumentKeyDown)}}removeOpenListeners(){var t;document.removeEventListener("keydown",this.handleDocumentKeyDown);(t=this.closeWatcher)==null?void 0:t.destroy()}async handleOpenChange(){if(this.open){this.emit("sl-show");this.addOpenListeners();this.originalTrigger=document.activeElement;if(!this.contained){this.modal.activate();me(this)}const t=this.querySelector("[autofocus]");if(t){t.removeAttribute("autofocus")}await Promise.all([vi(this.drawer),vi(this.overlay)]);this.drawer.hidden=false;requestAnimationFrame((()=>{const e=this.emit("sl-initial-focus",{cancelable:true});if(!e.defaultPrevented){if(t){t.focus({preventScroll:true})}else{this.panel.focus({preventScroll:true})}}if(t){t.setAttribute("autofocus","")}}));const e=pi(this,`drawer.show${Fi(this.placement)}`,{dir:this.localize.dir()});const i=pi(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([wi(this.panel,e.keyframes,e.options),wi(this.overlay,i.keyframes,i.options)]);this.emit("sl-after-show")}else{ve(this);this.emit("sl-hide");this.removeOpenListeners();if(!this.contained){this.modal.deactivate();we(this)}await Promise.all([vi(this.drawer),vi(this.overlay)]);const t=pi(this,`drawer.hide${Fi(this.placement)}`,{dir:this.localize.dir()});const e=pi(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([wi(this.overlay,e.keyframes,e.options).then((()=>{this.overlay.hidden=true})),wi(this.panel,t.keyframes,t.options).then((()=>{this.panel.hidden=true}))]);this.drawer.hidden=true;this.overlay.hidden=false;this.panel.hidden=false;const i=this.originalTrigger;if(typeof(i==null?void 0:i.focus)==="function"){setTimeout((()=>i.focus()))}this.emit("sl-after-hide")}}handleNoModalChange(){if(this.open&&!this.contained){this.modal.activate();me(this)}if(this.open&&this.contained){this.modal.deactivate();we(this)}}async show(){if(this.open){return void 0}this.open=true;return mi(this,"sl-after-show")}async hide(){if(!this.open){return void 0}this.open=false;return mi(this,"sl-after-hide")}render(){return gt`
331
+ <div
332
+ part="base"
333
+ class=${ii({drawer:true,"drawer--open":this.open,"drawer--top":this.placement==="top","drawer--end":this.placement==="end","drawer--bottom":this.placement==="bottom","drawer--start":this.placement==="start","drawer--contained":this.contained,"drawer--fixed":!this.contained,"drawer--rtl":this.localize.dir()==="rtl","drawer--has-footer":this.hasSlotController.test("footer")})}
334
+ >
335
+ <div part="overlay" class="drawer__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div>
336
+
337
+ <div
338
+ part="panel"
339
+ class="drawer__panel"
340
+ role="dialog"
341
+ aria-modal="true"
342
+ aria-hidden=${this.open?"false":"true"}
343
+ aria-label=${Ai(this.noHeader?this.label:void 0)}
344
+ aria-labelledby=${Ai(!this.noHeader?"title":void 0)}
345
+ tabindex="0"
346
+ >
347
+ ${!this.noHeader?gt`
348
+ <header part="header" class="drawer__header">
349
+ <h2 part="title" class="drawer__title" id="title">
350
+ <!-- If there's no label, use an invisible character to prevent the header from collapsing -->
351
+ <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(65279)} </slot>
352
+ </h2>
353
+ <div part="header-actions" class="drawer__header-actions">
354
+ <slot name="header-actions"></slot>
355
+ <sl-icon-button
356
+ part="close-button"
357
+ exportparts="base:close-button__base"
358
+ class="drawer__close"
359
+ name="x-lg"
360
+ label=${this.localize.term("close")}
361
+ library="system"
362
+ @click=${()=>this.requestClose("close-button")}
363
+ ></sl-icon-button>
364
+ </div>
365
+ </header>
366
+ `:""}
367
+
368
+ <slot part="body" class="drawer__body"></slot>
369
+
370
+ <footer part="footer" class="drawer__footer">
371
+ <slot name="footer"></slot>
372
+ </footer>
373
+ </div>
374
+ </div>
375
+ `}};Ri.styles=[ze,Lt];Ri.dependencies={"sl-icon-button":hi};Vt([je(".drawer")],Ri.prototype,"drawer",2);Vt([je(".drawer__panel")],Ri.prototype,"panel",2);Vt([je(".drawer__overlay")],Ri.prototype,"overlay",2);Vt([Ne({type:Boolean,reflect:true})],Ri.prototype,"open",2);Vt([Ne({reflect:true})],Ri.prototype,"label",2);Vt([Ne({reflect:true})],Ri.prototype,"placement",2);Vt([Ne({type:Boolean,reflect:true})],Ri.prototype,"contained",2);Vt([Ne({attribute:"no-header",type:Boolean,reflect:true})],Ri.prototype,"noHeader",2);Vt([Le("open",{waitUntilFirstUpdate:true})],Ri.prototype,"handleOpenChange",1);Vt([Le("contained",{waitUntilFirstUpdate:true})],Ri.prototype,"handleNoModalChange",1);gi("drawer.showTop",{keyframes:[{opacity:0,translate:"0 -100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}});gi("drawer.hideTop",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 -100%"}],options:{duration:250,easing:"ease"}});gi("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}});gi("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}});gi("drawer.showBottom",{keyframes:[{opacity:0,translate:"0 100%"},{opacity:1,translate:"0 0"}],options:{duration:250,easing:"ease"}});gi("drawer.hideBottom",{keyframes:[{opacity:1,translate:"0 0"},{opacity:0,translate:"0 100%"}],options:{duration:250,easing:"ease"}});gi("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}});gi("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}});gi("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}});gi("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}});gi("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});Ri.define("sl-drawer");We.define("sl-icon");var Li=k`
376
+ :host {
377
+ --indicator-color: var(--sl-color-primary-600);
378
+ --track-color: var(--sl-color-neutral-200);
379
+ --track-width: 2px;
380
+
381
+ display: block;
382
+ }
383
+
384
+ .tab-group {
385
+ display: flex;
386
+ border-radius: 0;
387
+ }
388
+
389
+ .tab-group__tabs {
390
+ display: flex;
391
+ position: relative;
392
+ }
393
+
394
+ .tab-group__indicator {
395
+ position: absolute;
396
+ transition:
397
+ var(--sl-transition-fast) translate ease,
398
+ var(--sl-transition-fast) width ease;
399
+ }
400
+
401
+ .tab-group--has-scroll-controls .tab-group__nav-container {
402
+ position: relative;
403
+ padding: 0 var(--sl-spacing-x-large);
404
+ }
405
+
406
+ .tab-group--has-scroll-controls .tab-group__scroll-button--start--hidden,
407
+ .tab-group--has-scroll-controls .tab-group__scroll-button--end--hidden {
408
+ visibility: hidden;
409
+ }
410
+
411
+ .tab-group__body {
412
+ display: block;
413
+ overflow: auto;
414
+ }
415
+
416
+ .tab-group__scroll-button {
417
+ display: flex;
418
+ align-items: center;
419
+ justify-content: center;
420
+ position: absolute;
421
+ top: 0;
422
+ bottom: 0;
423
+ width: var(--sl-spacing-x-large);
424
+ }
425
+
426
+ .tab-group__scroll-button--start {
427
+ left: 0;
428
+ }
429
+
430
+ .tab-group__scroll-button--end {
431
+ right: 0;
432
+ }
433
+
434
+ .tab-group--rtl .tab-group__scroll-button--start {
435
+ left: auto;
436
+ right: 0;
437
+ }
438
+
439
+ .tab-group--rtl .tab-group__scroll-button--end {
440
+ left: 0;
441
+ right: auto;
442
+ }
443
+
444
+ /*
445
+ * Top
446
+ */
447
+
448
+ .tab-group--top {
449
+ flex-direction: column;
450
+ }
451
+
452
+ .tab-group--top .tab-group__nav-container {
453
+ order: 1;
454
+ }
455
+
456
+ .tab-group--top .tab-group__nav {
457
+ display: flex;
458
+ overflow-x: auto;
459
+
460
+ /* Hide scrollbar in Firefox */
461
+ scrollbar-width: none;
462
+ }
463
+
464
+ /* Hide scrollbar in Chrome/Safari */
465
+ .tab-group--top .tab-group__nav::-webkit-scrollbar {
466
+ width: 0;
467
+ height: 0;
468
+ }
469
+
470
+ .tab-group--top .tab-group__tabs {
471
+ flex: 1 1 auto;
472
+ position: relative;
473
+ flex-direction: row;
474
+ border-bottom: solid var(--track-width) var(--track-color);
475
+ }
476
+
477
+ .tab-group--top .tab-group__indicator {
478
+ bottom: calc(-1 * var(--track-width));
479
+ border-bottom: solid var(--track-width) var(--indicator-color);
480
+ }
481
+
482
+ .tab-group--top .tab-group__body {
483
+ order: 2;
484
+ }
485
+
486
+ .tab-group--top ::slotted(sl-tab-panel) {
487
+ --padding: var(--sl-spacing-medium) 0;
488
+ }
489
+
490
+ /*
491
+ * Bottom
492
+ */
493
+
494
+ .tab-group--bottom {
495
+ flex-direction: column;
496
+ }
497
+
498
+ .tab-group--bottom .tab-group__nav-container {
499
+ order: 2;
500
+ }
501
+
502
+ .tab-group--bottom .tab-group__nav {
503
+ display: flex;
504
+ overflow-x: auto;
505
+
506
+ /* Hide scrollbar in Firefox */
507
+ scrollbar-width: none;
508
+ }
509
+
510
+ /* Hide scrollbar in Chrome/Safari */
511
+ .tab-group--bottom .tab-group__nav::-webkit-scrollbar {
512
+ width: 0;
513
+ height: 0;
514
+ }
515
+
516
+ .tab-group--bottom .tab-group__tabs {
517
+ flex: 1 1 auto;
518
+ position: relative;
519
+ flex-direction: row;
520
+ border-top: solid var(--track-width) var(--track-color);
521
+ }
522
+
523
+ .tab-group--bottom .tab-group__indicator {
524
+ top: calc(-1 * var(--track-width));
525
+ border-top: solid var(--track-width) var(--indicator-color);
526
+ }
527
+
528
+ .tab-group--bottom .tab-group__body {
529
+ order: 1;
530
+ }
531
+
532
+ .tab-group--bottom ::slotted(sl-tab-panel) {
533
+ --padding: var(--sl-spacing-medium) 0;
534
+ }
535
+
536
+ /*
537
+ * Start
538
+ */
539
+
540
+ .tab-group--start {
541
+ flex-direction: row;
542
+ }
543
+
544
+ .tab-group--start .tab-group__nav-container {
545
+ order: 1;
546
+ }
547
+
548
+ .tab-group--start .tab-group__tabs {
549
+ flex: 0 0 auto;
550
+ flex-direction: column;
551
+ border-inline-end: solid var(--track-width) var(--track-color);
552
+ }
553
+
554
+ .tab-group--start .tab-group__indicator {
555
+ right: calc(-1 * var(--track-width));
556
+ border-right: solid var(--track-width) var(--indicator-color);
557
+ }
558
+
559
+ .tab-group--start.tab-group--rtl .tab-group__indicator {
560
+ right: auto;
561
+ left: calc(-1 * var(--track-width));
562
+ }
563
+
564
+ .tab-group--start .tab-group__body {
565
+ flex: 1 1 auto;
566
+ order: 2;
567
+ }
568
+
569
+ .tab-group--start ::slotted(sl-tab-panel) {
570
+ --padding: 0 var(--sl-spacing-medium);
571
+ }
572
+
573
+ /*
574
+ * End
575
+ */
576
+
577
+ .tab-group--end {
578
+ flex-direction: row;
579
+ }
580
+
581
+ .tab-group--end .tab-group__nav-container {
582
+ order: 2;
583
+ }
584
+
585
+ .tab-group--end .tab-group__tabs {
586
+ flex: 0 0 auto;
587
+ flex-direction: column;
588
+ border-left: solid var(--track-width) var(--track-color);
589
+ }
590
+
591
+ .tab-group--end .tab-group__indicator {
592
+ left: calc(-1 * var(--track-width));
593
+ border-inline-start: solid var(--track-width) var(--indicator-color);
594
+ }
595
+
596
+ .tab-group--end.tab-group--rtl .tab-group__indicator {
597
+ right: calc(-1 * var(--track-width));
598
+ left: auto;
599
+ }
600
+
601
+ .tab-group--end .tab-group__body {
602
+ flex: 1 1 auto;
603
+ order: 1;
604
+ }
605
+
606
+ .tab-group--end ::slotted(sl-tab-panel) {
607
+ --padding: 0 var(--sl-spacing-medium);
608
+ }
609
+ `;var zi=k`
610
+ :host {
611
+ display: contents;
612
+ }
613
+ `;var Ui=class extends He{constructor(){super(...arguments);this.observedElements=[];this.disabled=false}connectedCallback(){super.connectedCallback();this.resizeObserver=new ResizeObserver((t=>{this.emit("sl-resize",{detail:{entries:t}})}));if(!this.disabled){this.startObserver()}}disconnectedCallback(){super.disconnectedCallback();this.stopObserver()}handleSlotChange(){if(!this.disabled){this.startObserver()}}startObserver(){const t=this.shadowRoot.querySelector("slot");if(t!==null){const e=t.assignedElements({flatten:true});this.observedElements.forEach((t=>this.resizeObserver.unobserve(t)));this.observedElements=[];e.forEach((t=>{this.resizeObserver.observe(t);this.observedElements.push(t)}))}}stopObserver(){this.resizeObserver.disconnect()}handleDisabledChange(){if(this.disabled){this.stopObserver()}else{this.startObserver()}}render(){return gt` <slot @slotchange=${this.handleSlotChange}></slot> `}};Ui.styles=[ze,zi];Vt([Ne({type:Boolean,reflect:true})],Ui.prototype,"disabled",2);Vt([Le("disabled",{waitUntilFirstUpdate:true})],Ui.prototype,"handleDisabledChange",1);var Pi=class extends He{constructor(){super(...arguments);this.tabs=[];this.focusableTabs=[];this.panels=[];this.localize=new Gi(this);this.hasScrollControls=false;this.shouldHideScrollStartButton=false;this.shouldHideScrollEndButton=false;this.placement="top";this.activation="auto";this.noScrollControls=false;this.fixedScrollControls=false;this.scrollOffset=1}connectedCallback(){const t=Promise.all([customElements.whenDefined("sl-tab"),customElements.whenDefined("sl-tab-panel")]);super.connectedCallback();this.resizeObserver=new ResizeObserver((()=>{this.repositionIndicator();this.updateScrollControls()}));this.mutationObserver=new MutationObserver((t=>{const e=t.filter((({target:t})=>{if(t===this)return true;if(t.closest("sl-tab-group")!==this)return false;const e=t.tagName.toLowerCase();return e==="sl-tab"||e==="sl-tab-panel"}));if(e.length===0){return}if(e.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))){setTimeout((()=>this.setAriaLabels()))}if(e.some((t=>t.attributeName==="disabled"))){this.syncTabsAndPanels()}else if(e.some((t=>t.attributeName==="active"))){const t=e.filter((t=>t.attributeName==="active"&&t.target.tagName.toLowerCase()==="sl-tab")).map((t=>t.target));const i=t.find((t=>t.active));if(i){this.setActiveTab(i)}}}));this.updateComplete.then((()=>{this.syncTabsAndPanels();this.mutationObserver.observe(this,{attributes:true,attributeFilter:["active","disabled","name","panel"],childList:true,subtree:true});this.resizeObserver.observe(this.nav);t.then((()=>{const t=new IntersectionObserver(((t,e)=>{var i;if(t[0].intersectionRatio>0){this.setAriaLabels();this.setActiveTab((i=this.getActiveTab())!=null?i:this.tabs[0],{emitEvents:false});e.unobserve(t[0].target)}}));t.observe(this.tabGroup)}))}))}disconnectedCallback(){var t,e;super.disconnectedCallback();(t=this.mutationObserver)==null?void 0:t.disconnect();if(this.nav){(e=this.resizeObserver)==null?void 0:e.unobserve(this.nav)}}getAllTabs(){const t=this.shadowRoot.querySelector('slot[name="nav"]');return t.assignedElements()}getAllPanels(){return[...this.body.assignedElements()].filter((t=>t.tagName.toLowerCase()==="sl-tab-panel"))}getActiveTab(){return this.tabs.find((t=>t.active))}handleClick(t){const e=t.target;const i=e.closest("sl-tab");const r=i==null?void 0:i.closest("sl-tab-group");if(r!==this){return}if(i!==null){this.setActiveTab(i,{scrollBehavior:"smooth"})}}handleKeyDown(t){const e=t.target;const i=e.closest("sl-tab");const r=i==null?void 0:i.closest("sl-tab-group");if(r!==this){return}if(["Enter"," "].includes(t.key)){if(i!==null){this.setActiveTab(i,{scrollBehavior:"smooth"});t.preventDefault()}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.tabs.find((t=>t.matches(":focus")));const i=this.localize.dir()==="rtl";let r=null;if((e==null?void 0:e.tagName.toLowerCase())==="sl-tab"){if(t.key==="Home"){r=this.focusableTabs[0]}else if(t.key==="End"){r=this.focusableTabs[this.focusableTabs.length-1]}else if(["top","bottom"].includes(this.placement)&&t.key===(i?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&t.key==="ArrowUp"){const t=this.tabs.findIndex((t=>t===e));r=this.findNextFocusableTab(t,"backward")}else if(["top","bottom"].includes(this.placement)&&t.key===(i?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&t.key==="ArrowDown"){const t=this.tabs.findIndex((t=>t===e));r=this.findNextFocusableTab(t,"forward")}if(!r){return}r.tabIndex=0;r.focus({preventScroll:true});if(this.activation==="auto"){this.setActiveTab(r,{scrollBehavior:"smooth"})}else{this.tabs.forEach((t=>{t.tabIndex=t===r?0:-1}))}if(["top","bottom"].includes(this.placement)){Ie(r,this.nav,"horizontal")}t.preventDefault()}}}handleScrollToStart(){this.nav.scroll({left:this.localize.dir()==="rtl"?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:this.localize.dir()==="rtl"?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){e=Yt({emitEvents:true,scrollBehavior:"auto"},e);if(t!==this.activeTab&&!t.disabled){const i=this.activeTab;this.activeTab=t;this.tabs.forEach((t=>{t.active=t===this.activeTab;t.tabIndex=t===this.activeTab?0:-1}));this.panels.forEach((t=>{var e;return t.active=t.name===((e=this.activeTab)==null?void 0:e.panel)}));this.syncIndicator();if(["top","bottom"].includes(this.placement)){Ie(this.activeTab,this.nav,"horizontal",e.scrollBehavior)}if(e.emitEvents){if(i){this.emit("sl-tab-hide",{detail:{name:i.panel}})}this.emit("sl-tab-show",{detail:{name:this.activeTab.panel}})}}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));if(e){t.setAttribute("aria-controls",e.getAttribute("id"));e.setAttribute("aria-labelledby",t.getAttribute("id"))}}))}repositionIndicator(){const t=this.getActiveTab();if(!t){return}const e=t.clientWidth;const i=t.clientHeight;const r=this.localize.dir()==="rtl";const s=this.getAllTabs();const o=s.slice(0,s.indexOf(t));const n=o.reduce(((t,e)=>({left:t.left+e.clientWidth,top:t.top+e.clientHeight})),{left:0,top:0});switch(this.placement){case"top":case"bottom":this.indicator.style.width=`${e}px`;this.indicator.style.height="auto";this.indicator.style.translate=r?`${-1*n.left}px`:`${n.left}px`;break;case"start":case"end":this.indicator.style.width="auto";this.indicator.style.height=`${i}px`;this.indicator.style.translate=`0 ${n.top}px`;break}}syncTabsAndPanels(){this.tabs=this.getAllTabs();this.focusableTabs=this.tabs.filter((t=>!t.disabled));this.panels=this.getAllPanels();this.syncIndicator();this.updateComplete.then((()=>this.updateScrollControls()))}findNextFocusableTab(t,e){let i=null;const r=e==="forward"?1:-1;let s=t+r;while(t<this.tabs.length){i=this.tabs[s]||null;if(i===null){if(e==="forward"){i=this.focusableTabs[0]}else{i=this.focusableTabs[this.focusableTabs.length-1]}break}if(!i.disabled){break}s+=r}return i}updateScrollButtons(){if(this.hasScrollControls&&!this.fixedScrollControls){this.shouldHideScrollStartButton=this.scrollFromStart()<=this.scrollOffset;this.shouldHideScrollEndButton=this.isScrolledToEnd()}}isScrolledToEnd(){return this.scrollFromStart()+this.nav.clientWidth>=this.nav.scrollWidth-this.scrollOffset}scrollFromStart(){return this.localize.dir()==="rtl"?-this.nav.scrollLeft:this.nav.scrollLeft}updateScrollControls(){if(this.noScrollControls){this.hasScrollControls=false}else{this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth+1}this.updateScrollButtons()}syncIndicator(){const t=this.getActiveTab();if(t){this.indicator.style.display="block";this.repositionIndicator()}else{this.indicator.style.display="none"}}show(t){const e=this.tabs.find((e=>e.panel===t));if(e){this.setActiveTab(e,{scrollBehavior:"smooth"})}}render(){const t=this.localize.dir()==="rtl";return gt`
614
+ <div
615
+ part="base"
616
+ class=${ii({"tab-group":true,"tab-group--top":this.placement==="top","tab-group--bottom":this.placement==="bottom","tab-group--start":this.placement==="start","tab-group--end":this.placement==="end","tab-group--rtl":this.localize.dir()==="rtl","tab-group--has-scroll-controls":this.hasScrollControls})}
617
+ @click=${this.handleClick}
618
+ @keydown=${this.handleKeyDown}
619
+ >
620
+ <div class="tab-group__nav-container" part="nav">
621
+ ${this.hasScrollControls?gt`
622
+ <sl-icon-button
623
+ part="scroll-button scroll-button--start"
624
+ exportparts="base:scroll-button__base"
625
+ class=${ii({"tab-group__scroll-button":true,"tab-group__scroll-button--start":true,"tab-group__scroll-button--start--hidden":this.shouldHideScrollStartButton})}
626
+ name=${t?"chevron-right":"chevron-left"}
627
+ library="system"
628
+ tabindex="-1"
629
+ aria-hidden="true"
630
+ label=${this.localize.term("scrollToStart")}
631
+ @click=${this.handleScrollToStart}
632
+ ></sl-icon-button>
633
+ `:""}
634
+
635
+ <div class="tab-group__nav" @scrollend=${this.updateScrollButtons}>
636
+ <div part="tabs" class="tab-group__tabs" role="tablist">
637
+ <div part="active-tab-indicator" class="tab-group__indicator"></div>
638
+ <sl-resize-observer @sl-resize=${this.syncIndicator}>
639
+ <slot name="nav" @slotchange=${this.syncTabsAndPanels}></slot>
640
+ </sl-resize-observer>
641
+ </div>
642
+ </div>
643
+
644
+ ${this.hasScrollControls?gt`
645
+ <sl-icon-button
646
+ part="scroll-button scroll-button--end"
647
+ exportparts="base:scroll-button__base"
648
+ class=${ii({"tab-group__scroll-button":true,"tab-group__scroll-button--end":true,"tab-group__scroll-button--end--hidden":this.shouldHideScrollEndButton})}
649
+ name=${t?"chevron-left":"chevron-right"}
650
+ library="system"
651
+ tabindex="-1"
652
+ aria-hidden="true"
653
+ label=${this.localize.term("scrollToEnd")}
654
+ @click=${this.handleScrollToEnd}
655
+ ></sl-icon-button>
656
+ `:""}
657
+ </div>
658
+
659
+ <slot part="body" class="tab-group__body" @slotchange=${this.syncTabsAndPanels}></slot>
660
+ </div>
661
+ `}};Pi.styles=[ze,Li];Pi.dependencies={"sl-icon-button":hi,"sl-resize-observer":Ui};Vt([je(".tab-group")],Pi.prototype,"tabGroup",2);Vt([je(".tab-group__body")],Pi.prototype,"body",2);Vt([je(".tab-group__nav")],Pi.prototype,"nav",2);Vt([je(".tab-group__indicator")],Pi.prototype,"indicator",2);Vt([Te()],Pi.prototype,"hasScrollControls",2);Vt([Te()],Pi.prototype,"shouldHideScrollStartButton",2);Vt([Te()],Pi.prototype,"shouldHideScrollEndButton",2);Vt([Ne()],Pi.prototype,"placement",2);Vt([Ne()],Pi.prototype,"activation",2);Vt([Ne({attribute:"no-scroll-controls",type:Boolean})],Pi.prototype,"noScrollControls",2);Vt([Ne({attribute:"fixed-scroll-controls",type:Boolean})],Pi.prototype,"fixedScrollControls",2);Vt([qe({passive:true})],Pi.prototype,"updateScrollButtons",1);Vt([Le("noScrollControls",{waitUntilFirstUpdate:true})],Pi.prototype,"updateScrollControls",1);Vt([Le("placement",{waitUntilFirstUpdate:true})],Pi.prototype,"syncIndicator",1);Pi.define("sl-tab-group");var Ni=(t,e)=>{let i=0;return function(...r){window.clearTimeout(i);i=window.setTimeout((()=>{t.call(this,...r)}),e)}};var Ti=(t,e,i)=>{const r=t[e];t[e]=function(...t){r.call(this,...t);i.call(this,r,...t)}};(()=>{if(typeof window==="undefined"){return}const t="onscrollend"in window;if(!t){const t=new Set;const e=new WeakMap;const i=e=>{for(const i of e.changedTouches){t.add(i.identifier)}};const r=e=>{for(const i of e.changedTouches){t.delete(i.identifier)}};document.addEventListener("touchstart",i,true);document.addEventListener("touchend",r,true);document.addEventListener("touchcancel",r,true);Ti(EventTarget.prototype,"addEventListener",(function(i,r){if(r!=="scrollend")return;const s=Ni((()=>{if(!t.size){this.dispatchEvent(new Event("scrollend"))}else{s()}}),100);i.call(this,"scroll",s,{passive:true});e.set(this,s)}));Ti(EventTarget.prototype,"removeEventListener",(function(t,i){if(i!=="scrollend")return;const r=e.get(this);if(r){t.call(this,"scroll",r,{passive:true})}}))}})();var qi=k`
662
+ :host {
663
+ --padding: 0;
664
+
665
+ display: none;
666
+ }
667
+
668
+ :host([active]) {
669
+ display: block;
670
+ }
671
+
672
+ .tab-panel {
673
+ display: block;
674
+ padding: var(--padding);
675
+ }
676
+ `;var Oi=0;var ji=class extends He{constructor(){super(...arguments);this.attrId=++Oi;this.componentId=`sl-tab-panel-${this.attrId}`;this.name="";this.active=false}connectedCallback(){super.connectedCallback();this.id=this.id.length>0?this.id:this.componentId;this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return gt`
677
+ <slot
678
+ part="base"
679
+ class=${ii({"tab-panel":true,"tab-panel--active":this.active})}
680
+ ></slot>
681
+ `}};ji.styles=[ze,qi];Vt([Ne({reflect:true})],ji.prototype,"name",2);Vt([Ne({type:Boolean,reflect:true})],ji.prototype,"active",2);Vt([Le("active")],ji.prototype,"handleActiveChange",1);ji.define("sl-tab-panel");var Ji=k`
682
+ :host {
683
+ display: inline-block;
684
+ }
685
+
686
+ .tab {
687
+ display: inline-flex;
688
+ align-items: center;
689
+ font-family: var(--sl-font-sans);
690
+ font-size: var(--sl-font-size-small);
691
+ font-weight: var(--sl-font-weight-semibold);
692
+ border-radius: var(--sl-border-radius-medium);
693
+ color: var(--sl-color-neutral-600);
694
+ padding: var(--sl-spacing-medium) var(--sl-spacing-large);
695
+ white-space: nowrap;
696
+ user-select: none;
697
+ -webkit-user-select: none;
698
+ cursor: pointer;
699
+ transition:
700
+ var(--transition-speed) box-shadow,
701
+ var(--transition-speed) color;
702
+ }
703
+
704
+ .tab:hover:not(.tab--disabled) {
705
+ color: var(--sl-color-primary-600);
706
+ }
707
+
708
+ :host(:focus) {
709
+ outline: transparent;
710
+ }
711
+
712
+ :host(:focus-visible) {
713
+ color: var(--sl-color-primary-600);
714
+ outline: var(--sl-focus-ring);
715
+ outline-offset: calc(-1 * var(--sl-focus-ring-width) - var(--sl-focus-ring-offset));
716
+ }
717
+
718
+ .tab.tab--active:not(.tab--disabled) {
719
+ color: var(--sl-color-primary-600);
720
+ }
721
+
722
+ .tab.tab--closable {
723
+ padding-inline-end: var(--sl-spacing-small);
724
+ }
725
+
726
+ .tab.tab--disabled {
727
+ opacity: 0.5;
728
+ cursor: not-allowed;
729
+ }
730
+
731
+ .tab__close-button {
732
+ font-size: var(--sl-font-size-small);
733
+ margin-inline-start: var(--sl-spacing-small);
734
+ }
735
+
736
+ .tab__close-button::part(base) {
737
+ padding: var(--sl-spacing-3x-small);
738
+ }
739
+
740
+ @media (forced-colors: active) {
741
+ .tab.tab--active:not(.tab--disabled) {
742
+ outline: solid 1px transparent;
743
+ outline-offset: -3px;
744
+ }
745
+ }
746
+ `;var Hi=0;var Yi=class extends He{constructor(){super(...arguments);this.localize=new Gi(this);this.attrId=++Hi;this.componentId=`sl-tab-${this.attrId}`;this.panel="";this.active=false;this.closable=false;this.disabled=false;this.tabIndex=0}connectedCallback(){super.connectedCallback();this.setAttribute("role","tab")}handleCloseClick(t){t.stopPropagation();this.emit("sl-close")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false");if(this.disabled&&!this.active){this.tabIndex=-1}else{this.tabIndex=0}}render(){this.id=this.id.length>0?this.id:this.componentId;return gt`
747
+ <div
748
+ part="base"
749
+ class=${ii({tab:true,"tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled})}
750
+ >
751
+ <slot></slot>
752
+ ${this.closable?gt`
753
+ <sl-icon-button
754
+ part="close-button"
755
+ exportparts="base:close-button__base"
756
+ name="x-lg"
757
+ library="system"
758
+ label=${this.localize.term("close")}
759
+ class="tab__close-button"
760
+ @click=${this.handleCloseClick}
761
+ tabindex="-1"
762
+ ></sl-icon-button>
763
+ `:""}
764
+ </div>
765
+ `}};Yi.styles=[ze,Ji];Yi.dependencies={"sl-icon-button":hi};Vt([je(".tab")],Yi.prototype,"tab",2);Vt([Ne({reflect:true})],Yi.prototype,"panel",2);Vt([Ne({type:Boolean,reflect:true})],Yi.prototype,"active",2);Vt([Ne({type:Boolean,reflect:true})],Yi.prototype,"closable",2);Vt([Ne({type:Boolean,reflect:true})],Yi.prototype,"disabled",2);Vt([Ne({type:Number,reflect:true})],Yi.prototype,"tabIndex",2);Vt([Le("active")],Yi.prototype,"handleActiveChange",1);Vt([Le("disabled")],Yi.prototype,"handleDisabledChange",1);Yi.define("sl-tab");const $i=':root,:host,.sl-theme-light{color-scheme:light;--sl-color-gray-50:hsl(0 0% 97.5%);--sl-color-gray-100:hsl(240 4.8% 95.9%);--sl-color-gray-200:hsl(240 5.9% 90%);--sl-color-gray-300:hsl(240 4.9% 83.9%);--sl-color-gray-400:hsl(240 5% 64.9%);--sl-color-gray-500:hsl(240 3.8% 46.1%);--sl-color-gray-600:hsl(240 5.2% 33.9%);--sl-color-gray-700:hsl(240 5.3% 26.1%);--sl-color-gray-800:hsl(240 3.7% 15.9%);--sl-color-gray-900:hsl(240 5.9% 10%);--sl-color-gray-950:hsl(240 7.3% 8%);--sl-color-red-50:hsl(0 85.7% 97.3%);--sl-color-red-100:hsl(0 93.3% 94.1%);--sl-color-red-200:hsl(0 96.3% 89.4%);--sl-color-red-300:hsl(0 93.5% 81.8%);--sl-color-red-400:hsl(0 90.6% 70.8%);--sl-color-red-500:hsl(0 84.2% 60.2%);--sl-color-red-600:hsl(0 72.2% 50.6%);--sl-color-red-700:hsl(0 73.7% 41.8%);--sl-color-red-800:hsl(0 70% 35.3%);--sl-color-red-900:hsl(0 62.8% 30.6%);--sl-color-red-950:hsl(0 60% 19.6%);--sl-color-orange-50:hsl(33.3 100% 96.5%);--sl-color-orange-100:hsl(34.3 100% 91.8%);--sl-color-orange-200:hsl(32.1 97.7% 83.1%);--sl-color-orange-300:hsl(30.7 97.2% 72.4%);--sl-color-orange-400:hsl(27 96% 61%);--sl-color-orange-500:hsl(24.6 95% 53.1%);--sl-color-orange-600:hsl(20.5 90.2% 48.2%);--sl-color-orange-700:hsl(17.5 88.3% 40.4%);--sl-color-orange-800:hsl(15 79.1% 33.7%);--sl-color-orange-900:hsl(15.3 74.6% 27.8%);--sl-color-orange-950:hsl(15.2 69.1% 19%);--sl-color-amber-50:hsl(48 100% 96.1%);--sl-color-amber-100:hsl(48 96.5% 88.8%);--sl-color-amber-200:hsl(48 96.6% 76.7%);--sl-color-amber-300:hsl(45.9 96.7% 64.5%);--sl-color-amber-400:hsl(43.3 96.4% 56.3%);--sl-color-amber-500:hsl(37.7 92.1% 50.2%);--sl-color-amber-600:hsl(32.1 94.6% 43.7%);--sl-color-amber-700:hsl(26 90.5% 37.1%);--sl-color-amber-800:hsl(22.7 82.5% 31.4%);--sl-color-amber-900:hsl(21.7 77.8% 26.5%);--sl-color-amber-950:hsl(22.9 74.1% 16.7%);--sl-color-yellow-50:hsl(54.5 91.7% 95.3%);--sl-color-yellow-100:hsl(54.9 96.7% 88%);--sl-color-yellow-200:hsl(52.8 98.3% 76.9%);--sl-color-yellow-300:hsl(50.4 97.8% 63.5%);--sl-color-yellow-400:hsl(47.9 95.8% 53.1%);--sl-color-yellow-500:hsl(45.4 93.4% 47.5%);--sl-color-yellow-600:hsl(40.6 96.1% 40.4%);--sl-color-yellow-700:hsl(35.5 91.7% 32.9%);--sl-color-yellow-800:hsl(31.8 81% 28.8%);--sl-color-yellow-900:hsl(28.4 72.5% 25.7%);--sl-color-yellow-950:hsl(33.1 69% 13.9%);--sl-color-lime-50:hsl(78.3 92% 95.1%);--sl-color-lime-100:hsl(79.6 89.1% 89.2%);--sl-color-lime-200:hsl(80.9 88.5% 79.6%);--sl-color-lime-300:hsl(82 84.5% 67.1%);--sl-color-lime-400:hsl(82.7 78% 55.5%);--sl-color-lime-500:hsl(83.7 80.5% 44.3%);--sl-color-lime-600:hsl(84.8 85.2% 34.5%);--sl-color-lime-700:hsl(85.9 78.4% 27.3%);--sl-color-lime-800:hsl(86.3 69% 22.7%);--sl-color-lime-900:hsl(87.6 61.2% 20.2%);--sl-color-lime-950:hsl(86.5 60.6% 13.9%);--sl-color-green-50:hsl(138.5 76.5% 96.7%);--sl-color-green-100:hsl(140.6 84.2% 92.5%);--sl-color-green-200:hsl(141 78.9% 85.1%);--sl-color-green-300:hsl(141.7 76.6% 73.1%);--sl-color-green-400:hsl(141.9 69.2% 58%);--sl-color-green-500:hsl(142.1 70.6% 45.3%);--sl-color-green-600:hsl(142.1 76.2% 36.3%);--sl-color-green-700:hsl(142.4 71.8% 29.2%);--sl-color-green-800:hsl(142.8 64.2% 24.1%);--sl-color-green-900:hsl(143.8 61.2% 20.2%);--sl-color-green-950:hsl(144.3 60.7% 12%);--sl-color-emerald-50:hsl(151.8 81% 95.9%);--sl-color-emerald-100:hsl(149.3 80.4% 90%);--sl-color-emerald-200:hsl(152.4 76% 80.4%);--sl-color-emerald-300:hsl(156.2 71.6% 66.9%);--sl-color-emerald-400:hsl(158.1 64.4% 51.6%);--sl-color-emerald-500:hsl(160.1 84.1% 39.4%);--sl-color-emerald-600:hsl(161.4 93.5% 30.4%);--sl-color-emerald-700:hsl(162.9 93.5% 24.3%);--sl-color-emerald-800:hsl(163.1 88.1% 19.8%);--sl-color-emerald-900:hsl(164.2 85.7% 16.5%);--sl-color-emerald-950:hsl(164.3 87.5% 9.4%);--sl-color-teal-50:hsl(166.2 76.5% 96.7%);--sl-color-teal-100:hsl(167.2 85.5% 89.2%);--sl-color-teal-200:hsl(168.4 83.8% 78.2%);--sl-color-teal-300:hsl(170.6 76.9% 64.3%);--sl-color-teal-400:hsl(172.5 66% 50.4%);--sl-color-teal-500:hsl(173.4 80.4% 40%);--sl-color-teal-600:hsl(174.7 83.9% 31.6%);--sl-color-teal-700:hsl(175.3 77.4% 26.1%);--sl-color-teal-800:hsl(176.1 69.4% 21.8%);--sl-color-teal-900:hsl(175.9 60.8% 19%);--sl-color-teal-950:hsl(176.5 58.6% 11.4%);--sl-color-cyan-50:hsl(183.2 100% 96.3%);--sl-color-cyan-100:hsl(185.1 95.9% 90.4%);--sl-color-cyan-200:hsl(186.2 93.5% 81.8%);--sl-color-cyan-300:hsl(187 92.4% 69%);--sl-color-cyan-400:hsl(187.9 85.7% 53.3%);--sl-color-cyan-500:hsl(188.7 94.5% 42.7%);--sl-color-cyan-600:hsl(191.6 91.4% 36.5%);--sl-color-cyan-700:hsl(192.9 82.3% 31%);--sl-color-cyan-800:hsl(194.4 69.6% 27.1%);--sl-color-cyan-900:hsl(196.4 63.6% 23.7%);--sl-color-cyan-950:hsl(196.8 61% 16.1%);--sl-color-sky-50:hsl(204 100% 97.1%);--sl-color-sky-100:hsl(204 93.8% 93.7%);--sl-color-sky-200:hsl(200.6 94.4% 86.1%);--sl-color-sky-300:hsl(199.4 95.5% 73.9%);--sl-color-sky-400:hsl(198.4 93.2% 59.6%);--sl-color-sky-500:hsl(198.6 88.7% 48.4%);--sl-color-sky-600:hsl(200.4 98% 39.4%);--sl-color-sky-700:hsl(201.3 96.3% 32.2%);--sl-color-sky-800:hsl(201 90% 27.5%);--sl-color-sky-900:hsl(202 80.3% 23.9%);--sl-color-sky-950:hsl(202.3 73.8% 16.5%);--sl-color-blue-50:hsl(213.8 100% 96.9%);--sl-color-blue-100:hsl(214.3 94.6% 92.7%);--sl-color-blue-200:hsl(213.3 96.9% 87.3%);--sl-color-blue-300:hsl(211.7 96.4% 78.4%);--sl-color-blue-400:hsl(213.1 93.9% 67.8%);--sl-color-blue-500:hsl(217.2 91.2% 59.8%);--sl-color-blue-600:hsl(221.2 83.2% 53.3%);--sl-color-blue-700:hsl(224.3 76.3% 48%);--sl-color-blue-800:hsl(225.9 70.7% 40.2%);--sl-color-blue-900:hsl(224.4 64.3% 32.9%);--sl-color-blue-950:hsl(226.2 55.3% 18.4%);--sl-color-indigo-50:hsl(225.9 100% 96.7%);--sl-color-indigo-100:hsl(226.5 100% 93.9%);--sl-color-indigo-200:hsl(228 96.5% 88.8%);--sl-color-indigo-300:hsl(229.7 93.5% 81.8%);--sl-color-indigo-400:hsl(234.5 89.5% 73.9%);--sl-color-indigo-500:hsl(238.7 83.5% 66.7%);--sl-color-indigo-600:hsl(243.4 75.4% 58.6%);--sl-color-indigo-700:hsl(244.5 57.9% 50.6%);--sl-color-indigo-800:hsl(243.7 54.5% 41.4%);--sl-color-indigo-900:hsl(242.2 47.4% 34.3%);--sl-color-indigo-950:hsl(243.5 43.6% 22.9%);--sl-color-violet-50:hsl(250 100% 97.6%);--sl-color-violet-100:hsl(251.4 91.3% 95.5%);--sl-color-violet-200:hsl(250.5 95.2% 91.8%);--sl-color-violet-300:hsl(252.5 94.7% 85.1%);--sl-color-violet-400:hsl(255.1 91.7% 76.3%);--sl-color-violet-500:hsl(258.3 89.5% 66.3%);--sl-color-violet-600:hsl(262.1 83.3% 57.8%);--sl-color-violet-700:hsl(263.4 70% 50.4%);--sl-color-violet-800:hsl(263.4 69.3% 42.2%);--sl-color-violet-900:hsl(263.5 67.4% 34.9%);--sl-color-violet-950:hsl(265.1 61.5% 21.4%);--sl-color-purple-50:hsl(270 100% 98%);--sl-color-purple-100:hsl(268.7 100% 95.5%);--sl-color-purple-200:hsl(268.6 100% 91.8%);--sl-color-purple-300:hsl(269.2 97.4% 85.1%);--sl-color-purple-400:hsl(270 95.2% 75.3%);--sl-color-purple-500:hsl(270.7 91% 65.1%);--sl-color-purple-600:hsl(271.5 81.3% 55.9%);--sl-color-purple-700:hsl(272.1 71.7% 47.1%);--sl-color-purple-800:hsl(272.9 67.2% 39.4%);--sl-color-purple-900:hsl(273.6 65.6% 32%);--sl-color-purple-950:hsl(276 59.5% 16.5%);--sl-color-fuchsia-50:hsl(289.1 100% 97.8%);--sl-color-fuchsia-100:hsl(287 100% 95.5%);--sl-color-fuchsia-200:hsl(288.3 95.8% 90.6%);--sl-color-fuchsia-300:hsl(291.1 93.1% 82.9%);--sl-color-fuchsia-400:hsl(292 91.4% 72.5%);--sl-color-fuchsia-500:hsl(292.2 84.1% 60.6%);--sl-color-fuchsia-600:hsl(293.4 69.5% 48.8%);--sl-color-fuchsia-700:hsl(294.7 72.4% 39.8%);--sl-color-fuchsia-800:hsl(295.4 70.2% 32.9%);--sl-color-fuchsia-900:hsl(296.7 63.6% 28%);--sl-color-fuchsia-950:hsl(297.1 56.8% 14.5%);--sl-color-pink-50:hsl(327.3 73.3% 97.1%);--sl-color-pink-100:hsl(325.7 77.8% 94.7%);--sl-color-pink-200:hsl(325.9 84.6% 89.8%);--sl-color-pink-300:hsl(327.4 87.1% 81.8%);--sl-color-pink-400:hsl(328.6 85.5% 70.2%);--sl-color-pink-500:hsl(330.4 81.2% 60.4%);--sl-color-pink-600:hsl(333.3 71.4% 50.6%);--sl-color-pink-700:hsl(335.1 77.6% 42%);--sl-color-pink-800:hsl(335.8 74.4% 35.3%);--sl-color-pink-900:hsl(335.9 69% 30.4%);--sl-color-pink-950:hsl(336.2 65.4% 15.9%);--sl-color-rose-50:hsl(355.7 100% 97.3%);--sl-color-rose-100:hsl(355.6 100% 94.7%);--sl-color-rose-200:hsl(352.7 96.1% 90%);--sl-color-rose-300:hsl(352.6 95.7% 81.8%);--sl-color-rose-400:hsl(351.3 94.5% 71.4%);--sl-color-rose-500:hsl(349.7 89.2% 60.2%);--sl-color-rose-600:hsl(346.8 77.2% 49.8%);--sl-color-rose-700:hsl(345.3 82.7% 40.8%);--sl-color-rose-800:hsl(343.4 79.7% 34.7%);--sl-color-rose-900:hsl(341.5 75.5% 30.4%);--sl-color-rose-950:hsl(341.3 70.1% 17.1%);--sl-color-primary-50:var(--sl-color-sky-50);--sl-color-primary-100:var(--sl-color-sky-100);--sl-color-primary-200:var(--sl-color-sky-200);--sl-color-primary-300:var(--sl-color-sky-300);--sl-color-primary-400:var(--sl-color-sky-400);--sl-color-primary-500:var(--sl-color-sky-500);--sl-color-primary-600:var(--sl-color-sky-600);--sl-color-primary-700:var(--sl-color-sky-700);--sl-color-primary-800:var(--sl-color-sky-800);--sl-color-primary-900:var(--sl-color-sky-900);--sl-color-primary-950:var(--sl-color-sky-950);--sl-color-success-50:var(--sl-color-green-50);--sl-color-success-100:var(--sl-color-green-100);--sl-color-success-200:var(--sl-color-green-200);--sl-color-success-300:var(--sl-color-green-300);--sl-color-success-400:var(--sl-color-green-400);--sl-color-success-500:var(--sl-color-green-500);--sl-color-success-600:var(--sl-color-green-600);--sl-color-success-700:var(--sl-color-green-700);--sl-color-success-800:var(--sl-color-green-800);--sl-color-success-900:var(--sl-color-green-900);--sl-color-success-950:var(--sl-color-green-950);--sl-color-warning-50:var(--sl-color-amber-50);--sl-color-warning-100:var(--sl-color-amber-100);--sl-color-warning-200:var(--sl-color-amber-200);--sl-color-warning-300:var(--sl-color-amber-300);--sl-color-warning-400:var(--sl-color-amber-400);--sl-color-warning-500:var(--sl-color-amber-500);--sl-color-warning-600:var(--sl-color-amber-600);--sl-color-warning-700:var(--sl-color-amber-700);--sl-color-warning-800:var(--sl-color-amber-800);--sl-color-warning-900:var(--sl-color-amber-900);--sl-color-warning-950:var(--sl-color-amber-950);--sl-color-danger-50:var(--sl-color-red-50);--sl-color-danger-100:var(--sl-color-red-100);--sl-color-danger-200:var(--sl-color-red-200);--sl-color-danger-300:var(--sl-color-red-300);--sl-color-danger-400:var(--sl-color-red-400);--sl-color-danger-500:var(--sl-color-red-500);--sl-color-danger-600:var(--sl-color-red-600);--sl-color-danger-700:var(--sl-color-red-700);--sl-color-danger-800:var(--sl-color-red-800);--sl-color-danger-900:var(--sl-color-red-900);--sl-color-danger-950:var(--sl-color-red-950);--sl-color-neutral-50:var(--sl-color-gray-50);--sl-color-neutral-100:var(--sl-color-gray-100);--sl-color-neutral-200:var(--sl-color-gray-200);--sl-color-neutral-300:var(--sl-color-gray-300);--sl-color-neutral-400:var(--sl-color-gray-400);--sl-color-neutral-500:var(--sl-color-gray-500);--sl-color-neutral-600:var(--sl-color-gray-600);--sl-color-neutral-700:var(--sl-color-gray-700);--sl-color-neutral-800:var(--sl-color-gray-800);--sl-color-neutral-900:var(--sl-color-gray-900);--sl-color-neutral-950:var(--sl-color-gray-950);--sl-color-neutral-0:hsl(0, 0%, 100%);--sl-color-neutral-1000:hsl(0, 0%, 0%);--sl-border-radius-small:0.1875rem;--sl-border-radius-medium:0.25rem;--sl-border-radius-large:0.5rem;--sl-border-radius-x-large:1rem;--sl-border-radius-circle:50%;--sl-border-radius-pill:9999px;--sl-shadow-x-small:0 1px 2px hsl(240 3.8% 46.1% / 6%);--sl-shadow-small:0 1px 2px hsl(240 3.8% 46.1% / 12%);--sl-shadow-medium:0 2px 4px hsl(240 3.8% 46.1% / 12%);--sl-shadow-large:0 2px 8px hsl(240 3.8% 46.1% / 12%);--sl-shadow-x-large:0 4px 16px hsl(240 3.8% 46.1% / 12%);--sl-spacing-3x-small:0.125rem;--sl-spacing-2x-small:0.25rem;--sl-spacing-x-small:0.5rem;--sl-spacing-small:0.75rem;--sl-spacing-medium:1rem;--sl-spacing-large:1.25rem;--sl-spacing-x-large:1.75rem;--sl-spacing-2x-large:2.25rem;--sl-spacing-3x-large:3rem;--sl-spacing-4x-large:4.5rem;--sl-transition-x-slow:1000ms;--sl-transition-slow:500ms;--sl-transition-medium:250ms;--sl-transition-fast:150ms;--sl-transition-x-fast:50ms;--sl-font-mono:SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--sl-font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,\n Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",\n "Segoe UI Symbol";--sl-font-serif:Georgia, "Times New Roman", serif;--sl-font-size-2x-small:0.625rem;--sl-font-size-x-small:0.75rem;--sl-font-size-small:0.875rem;--sl-font-size-medium:1rem;--sl-font-size-large:1.25rem;--sl-font-size-x-large:1.5rem;--sl-font-size-2x-large:2.25rem;--sl-font-size-3x-large:3rem;--sl-font-size-4x-large:4.5rem;--sl-font-weight-light:300;--sl-font-weight-normal:400;--sl-font-weight-semibold:500;--sl-font-weight-bold:700;--sl-letter-spacing-denser:-0.03em;--sl-letter-spacing-dense:-0.015em;--sl-letter-spacing-normal:normal;--sl-letter-spacing-loose:0.075em;--sl-letter-spacing-looser:0.15em;--sl-line-height-denser:1;--sl-line-height-dense:1.4;--sl-line-height-normal:1.8;--sl-line-height-loose:2.2;--sl-line-height-looser:2.6;--sl-focus-ring-color:var(--sl-color-primary-600);--sl-focus-ring-style:solid;--sl-focus-ring-width:3px;--sl-focus-ring:var(--sl-focus-ring-style) var(--sl-focus-ring-width)\n var(--sl-focus-ring-color);--sl-focus-ring-offset:1px;--sl-button-font-size-small:var(--sl-font-size-x-small);--sl-button-font-size-medium:var(--sl-font-size-small);--sl-button-font-size-large:var(--sl-font-size-medium);--sl-input-height-small:1.875rem;--sl-input-height-medium:2.5rem;--sl-input-height-large:3.125rem;--sl-input-background-color:var(--sl-color-neutral-0);--sl-input-background-color-hover:var(--sl-input-background-color);--sl-input-background-color-focus:var(--sl-input-background-color);--sl-input-background-color-disabled:var(--sl-color-neutral-100);--sl-input-border-color:var(--sl-color-neutral-300);--sl-input-border-color-hover:var(--sl-color-neutral-400);--sl-input-border-color-focus:var(--sl-color-primary-500);--sl-input-border-color-disabled:var(--sl-color-neutral-300);--sl-input-border-width:1px;--sl-input-required-content:"*";--sl-input-required-content-offset:-2px;--sl-input-required-content-color:var(--sl-input-label-color);--sl-input-border-radius-small:var(--sl-border-radius-medium);--sl-input-border-radius-medium:var(--sl-border-radius-medium);--sl-input-border-radius-large:var(--sl-border-radius-medium);--sl-input-font-family:var(--sl-font-sans);--sl-input-font-weight:var(--sl-font-weight-normal);--sl-input-font-size-small:var(--sl-font-size-small);--sl-input-font-size-medium:var(--sl-font-size-medium);--sl-input-font-size-large:var(--sl-font-size-large);--sl-input-letter-spacing:var(--sl-letter-spacing-normal);--sl-input-color:var(--sl-color-neutral-700);--sl-input-color-hover:var(--sl-color-neutral-700);--sl-input-color-focus:var(--sl-color-neutral-700);--sl-input-color-disabled:var(--sl-color-neutral-900);--sl-input-icon-color:var(--sl-color-neutral-500);--sl-input-icon-color-hover:var(--sl-color-neutral-600);--sl-input-icon-color-focus:var(--sl-color-neutral-600);--sl-input-placeholder-color:var(--sl-color-neutral-500);--sl-input-placeholder-color-disabled:var(--sl-color-neutral-600);--sl-input-spacing-small:var(--sl-spacing-small);--sl-input-spacing-medium:var(--sl-spacing-medium);--sl-input-spacing-large:var(--sl-spacing-large);--sl-input-focus-ring-color:hsl(198.6 88.7% 48.4% / 40%);--sl-input-focus-ring-offset:0;--sl-input-filled-background-color:var(--sl-color-neutral-100);--sl-input-filled-background-color-hover:var(--sl-color-neutral-100);--sl-input-filled-background-color-focus:var(--sl-color-neutral-100);--sl-input-filled-background-color-disabled:var(--sl-color-neutral-100);--sl-input-filled-color:var(--sl-color-neutral-800);--sl-input-filled-color-hover:var(--sl-color-neutral-800);--sl-input-filled-color-focus:var(--sl-color-neutral-700);--sl-input-filled-color-disabled:var(--sl-color-neutral-800);--sl-input-label-font-size-small:var(--sl-font-size-small);--sl-input-label-font-size-medium:var(--sl-font-size-medium);--sl-input-label-font-size-large:var(--sl-font-size-large);--sl-input-label-color:inherit;--sl-input-help-text-font-size-small:var(--sl-font-size-x-small);--sl-input-help-text-font-size-medium:var(--sl-font-size-small);--sl-input-help-text-font-size-large:var(--sl-font-size-medium);--sl-input-help-text-color:var(--sl-color-neutral-500);--sl-toggle-size-small:0.875rem;--sl-toggle-size-medium:1.125rem;--sl-toggle-size-large:1.375rem;--sl-overlay-background-color:hsl(240 3.8% 46.1% / 33%);--sl-panel-background-color:var(--sl-color-neutral-0);--sl-panel-border-color:var(--sl-color-neutral-200);--sl-panel-border-width:1px;--sl-tooltip-border-radius:var(--sl-border-radius-medium);--sl-tooltip-background-color:var(--sl-color-neutral-800);--sl-tooltip-color:var(--sl-color-neutral-0);--sl-tooltip-font-family:var(--sl-font-sans);--sl-tooltip-font-weight:var(--sl-font-weight-normal);--sl-tooltip-font-size:var(--sl-font-size-small);--sl-tooltip-line-height:var(--sl-line-height-dense);--sl-tooltip-padding:var(--sl-spacing-2x-small) var(--sl-spacing-x-small);--sl-tooltip-arrow-size:6px;--sl-z-index-drawer:700;--sl-z-index-dialog:800;--sl-z-index-dropdown:900;--sl-z-index-toast:950;--sl-z-index-tooltip:1000}@supports (scrollbar-gutter: stable){.sl-scroll-lock{scrollbar-gutter:var(--sl-scroll-lock-gutter) !important}.sl-scroll-lock body{overflow:hidden !important}}@supports not (scrollbar-gutter: stable){.sl-scroll-lock body{padding-right:var(--sl-scroll-lock-size) !important;overflow:hidden !important}}.sl-toast-stack{position:fixed;top:0;inset-inline-end:0;z-index:var(--sl-z-index-toast);width:28rem;max-width:100%;max-height:100%;overflow:auto}.sl-toast-stack sl-alert{margin:var(--sl-spacing-medium)}.sl-toast-stack sl-alert::part(base){box-shadow:var(--sl-shadow-large)}sl-drawer::part(body){padding:0;overflow-x:hidden}sl-tab-group::part(nav){position:absolute;top:0;height:100%;border-right:var(--sl-panel-border-width) solid var(--sl-panel-border-color)}sl-tab-group::part(body){margin-left:2.8rem;}sl-tab::part(base){padding:var(--sl-spacing-small)}sl-tab sl-icon{font-size:var(--sl-font-size-large)}sl-tab-panel::part(base){padding:0;margin:0}sl-tab-panel .panel-header{padding:var(--sl-spacing-medium);background:var(--sl-color-neutral-100);font-size:var(--sl-font-size-medium);font-weight:var(--sl-font-weight-light)}sl-tab-panel .panel-content{padding:var(--sl-spacing-medium);overflow-x:hidden}.record-json{font-family:var(--sl-font-mono);font-size:var(--sl-font-size-x-small);white-space:pre-wrap;word-break:break-all}';const Vi=class{constructor(e){t(this,e)}get el(){return s(this)}record;open=false;tabs;componentDidLoad(){this.tabs=this.el.shadowRoot.querySelector("sl-tab-group")}get activeTabPanel(){const t=this.el.shadowRoot.querySelector("sl-tab[active]");if(t)return t.getAttribute("panel")}componentDidUpdate(){if(this.open&&!this.activeTabPanel)this.tabs.show("information")}render(){return i(r,{key:"6fbddeb709f3595d11f5266c690c6a1fc96d00f1"},i("sl-drawer",{key:"7b838b38daa8d335e4a22fb64a200251b578ebf0",label:"Sidebar",placement:"start",class:"sidebar",contained:true,"no-header":true,open:this.open},i("sl-tab-group",{key:"1e0d291c16b73d2752940f75183922307fc17adc",placement:"start"},i("sl-tab",{key:"2754e731cd75fccd76cc402a503ab4bf4af5e65d",slot:"nav",panel:"information"},i("sl-icon",{key:"dd3a831ec8f108ea3a478d7443fab923d0b5385e",name:"info-circle-fill",label:"Information"})),i("sl-tab",{key:"9afb53b8a1c11acbe14164fe6ee11540e08319f4",slot:"nav",panel:"rights"},i("sl-icon",{key:"293bf0333737c605ea6630128bc54c9dad123334",name:"c-circle",label:"Rights"})),i("sl-tab",{key:"763042bb04654147737256a7ef264f899c5170f5",slot:"nav",panel:"links"},i("sl-icon",{key:"623e71df449a0affa34a6c18c6d637599deebe33",name:"link-45deg",label:"Links"})),i("sl-tab",{key:"9bdbb573f9c13e0852015b054b8fb59ad16811a8",slot:"nav",panel:"record"},i("sl-icon",{key:"7f393868d7d04433e8175fe0100ee35e32842f86",name:"braces",label:"Record"})),i("sl-tab-panel",{key:"c8b3e0bb37e6d31620a4e553a27e32dcb297c826",name:"information"},i("div",{key:"c6468bcf815f7c036b6526621148320c0c512741",class:"panel-header"},"About this item"),i("div",{key:"969715e7366343c72f96b0fee48518ad3a0b21cb",class:"panel-content"},i("ogm-metadata",{key:"4e5ed3ed585255ab4b0478283107bda4fe690fbb",record:this.record,fieldNames:["title","description","resourceClass","resourceType","format","themes","subjects","spatial","temporal","issued","mdModified"]}))),i("sl-tab-panel",{key:"b03935fb1f77aa3702015c16eb5e25cda6bb24a2",name:"rights"},i("div",{key:"824437f375964d6d49b1ff75eed2885db1a924d9",class:"panel-header"},"Rights"),i("div",{key:"88f7d83c22b3528b6cfa5dd92807158162023b9c",class:"panel-content"},i("ogm-metadata",{key:"6d3aeb3293cf305d01224dd502dc9f1b09325ebb",record:this.record,fieldNames:["creators","publishers","provider","license","rights","accessRights","rightsHolder"]}))),i("sl-tab-panel",{key:"b85ad2e199d0002278cc76ecb5e98b5443c16bc3",name:"links"},i("div",{key:"5a0c0faa87a0d3a0790f8c3ed6267ccfe081854d",class:"panel-header"},"Links"),i("div",{key:"3f2af86a3238a5c7ac15d1b81097eda41d5bcb4d",class:"panel-content"},i("ogm-metadata",{key:"4bc66cf3888700b76bfee0cff96d930f42faa6c6",record:this.record,fieldNames:["references"]}))),i("sl-tab-panel",{key:"bb655f46d276677449765b74e36b9071ecc7183c",name:"record"},i("div",{key:"d1077660933d20495d505b8443ee42a705567b90",class:"panel-header"},"Record view"),i("div",{key:"da5b58e024fa1089fe5143d8df18456b8973b785",class:"panel-content"},i("div",{key:"86fe3ff752e53af487289a43beb099d773a941b6",class:"record-json"},JSON.stringify(this.record?.json,null,2)))))))}};Vi.style=$i;var Ki={exports:{}};var Zi=Ki.exports;var Wi;function Xi(){if(Wi)return Ki.exports;Wi=1;(function(t,e){!function(t,i){i(e)}(Zi,(function(t){function e(t){return(e,...i)=>r(t,e,i)}function i(t,i){return e(s(t,i).get)}const{apply:r,getOwnPropertyDescriptor:s,getPrototypeOf:o,ownKeys:n}=Reflect,{iterator:a,toStringTag:l}=Symbol,A=Object,{create:h,defineProperty:c}=A,u=Array.prototype[a],f=e(u),d=ArrayBuffer;i(d.prototype,"byteLength");const g="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null;g&&i(g.prototype,"byteLength");const p=o(Uint8Array);const m=p.prototype;i(m,"buffer"),i(m,"byteOffset"),i(m,"length"),i(m,l);const w=Uint8Array,I=Uint16Array,v=Uint32Array,b=Float32Array,y=o([][a]()),B=e(y.next),C=e(function*(){}().next),E=o(y),_=e(DataView.prototype.getUint16),Q=WeakMap,x=Q.prototype,M=e(x.get),k=e(x.set),D=new Q,S=h(null,{next:{value:function(){const t=M(D,this);return B(t)}},[a]:{value:function(){return this}}});const G=new Q,F=h(E,{next:{value:function(){const t=M(G,this);return C(t)},writable:true,configurable:true}});for(const t of n(y))"next"!==t&&c(F,t,s(y,t));const R=new d(4),L=new b(R),z=new v(R),U=new I(512),P=new w(512);for(let t=0;t<256;++t){const e=t-127;e<-24?(U[t]=0,U[256|t]=32768,P[t]=24,P[256|t]=24):e<-14?(U[t]=1024>>-e-14,U[256|t]=1024>>-e-14|32768,P[t]=-e-1,P[256|t]=-e-1):e<=15?(U[t]=e+15<<10,U[256|t]=e+15<<10|32768,P[t]=13,P[256|t]=13):e<128?(U[t]=31744,U[256|t]=64512,P[t]=24,P[256|t]=24):(U[t]=31744,U[256|t]=64512,P[t]=13,P[256|t]=13)}const N=new v(2048);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;!(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,N[t]=e|i}for(let t=1024;t<2048;++t)N[t]=939524096+(t-1024<<13);const T=new v(64);for(let t=1;t<31;++t)T[t]=t<<23;T[31]=1199570944,T[32]=2147483648;for(let t=33;t<63;++t)T[t]=2147483648+(t-32<<23);T[63]=3347054592;const q=new I(64);for(let t=1;t<64;++t)32!==t&&(q[t]=1024);function O(t,e,...i){return function(t){const e=t>>10;return z[0]=N[q[e]+(1023&t)]+T[e],L[0]}(_(t,e,...function(t){if(t[a]===u&&y.next===B)return t;const e=h(S);return k(D,e,f(t)),e}(i)))}function j(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var J={exports:{}};function H(t,e,i){const r=i&&i.debug||false;r&&console.log("[xml-utils] getting "+e+" in "+t);const s="object"==typeof t?t.outer:t,o=s.slice(0,s.indexOf(">")+1),n=['"',"'"];for(let t=0;t<n.length;t++){const i=n[t],s=e+"\\="+i+"([^"+i+"]*)"+i;r&&console.log("[xml-utils] pattern:",s);const a=new RegExp(s).exec(o);if(r&&console.log("[xml-utils] match:",a),a)return a[1]}}J.exports=H,J.exports.default=H;var Y=j(J.exports),$={exports:{}},V={exports:{}},K={exports:{}};function Z(t,e,i){const r=new RegExp(e).exec(t.slice(i));return r?i+r.index:-1}K.exports=Z,K.exports.default=Z;var W=K.exports,X={exports:{}};function tt(t,e,i){const r=new RegExp(e).exec(t.slice(i));return r?i+r.index+r[0].length-1:-1}X.exports=tt,X.exports.default=tt;var et=X.exports,it={exports:{}};function rt(t,e){const i=new RegExp(e,"g"),r=t.match(i);return r?r.length:0}it.exports=rt,it.exports.default=rt;var st=it.exports;const ot=W,nt=et,at=st;function lt(t,e,i){const r=i&&i.debug||false,s=!(i&&false===typeof i.nested),o=i&&i.startIndex||0;r&&console.log("[xml-utils] starting findTagByName with",e," and ",i);const n=ot(t,`<${e}[ \n>/]`,o);if(r&&console.log("[xml-utils] start:",n),-1===n)return;const a=t.slice(n+e.length);let l=nt(a,"^[^<]*[ /]>",0);const A=-1!==l&&"/"===a[l-1];if(r&&console.log("[xml-utils] selfClosing:",A),false===A)if(s){let t=0,i=1,r=0;for(;-1!==(l=nt(a,"[ /]"+e+">",t));){const s=a.substring(t,l+1);if(i+=at(s,"<"+e+"[ \n\t>]"),r+=at(s,"</"+e+">"),r>=i)break;t=l}}else l=nt(a,"[ /]"+e+">",0);const h=n+e.length+l+1;if(r&&console.log("[xml-utils] end:",h),-1===h)return;const c=t.slice(n,h);let u;return u=A?null:c.slice(c.indexOf(">")+1,c.lastIndexOf("<")),{inner:u,outer:c,start:n,end:h}}V.exports=lt,V.exports.default=lt;const At=V.exports;function ht(t,e,i){const r=[],s=i&&i.debug||false,o=!i||"boolean"!=typeof i.nested||i.nested;let n,a=i&&i.startIndex||0;for(;n=At(t,e,{debug:s,startIndex:a});)a=o?n.start+1+e.length:n.end,r.push(n);return s&&console.log("findTagsByName found",r.length,"tags"),r}$.exports=ht,$.exports.default=ht;var ct=j($.exports);const ut={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ft={};for(const t in ut)ut.hasOwnProperty(t)&&(ft[ut[t]]=parseInt(t,10));const dt=[ft.BitsPerSample,ft.ExtraSamples,ft.SampleFormat,ft.StripByteCounts,ft.StripOffsets,ft.StripRowCounts,ft.TileByteCounts,ft.TileOffsets,ft.SubIFDs],gt={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},pt={};for(const t in gt)gt.hasOwnProperty(t)&&(pt[gt[t]]=parseInt(t,10));const mt=0,wt=1,It=2,vt=3,bt=5,yt=6,Bt=8,Ct=0,Et=1,_t=0,Qt=1,xt=2,Mt={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};const kt=new Map;function Dt(t,e){Array.isArray(t)||(t=[t]),t.forEach((t=>kt.set(t,e)))}async function St(t){const e=kt.get(t.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${t.Compression}`);return new(await e())(t)}function Gt(t,e,i,r=1){return new(Object.getPrototypeOf(t).constructor)(e*i*r)}function Ft(t,e,i){return(1-i)*t+i*e}function Rt(t,e,i,r,s,o="nearest"){switch(o.toLowerCase()){case"nearest":return function(t,e,i,r,s){const o=e/r,n=i/s;return t.map((t=>{const a=Gt(t,r,s);for(let l=0;l<s;++l){const s=Math.min(Math.round(n*l),i-1);for(let i=0;i<r;++i){const n=Math.min(Math.round(o*i),e-1),A=t[s*e+n];a[l*r+i]=A}}return a}))}(t,e,i,r,s);case"bilinear":case"linear":return function(t,e,i,r,s){const o=e/r,n=i/s;return t.map((t=>{const a=Gt(t,r,s);for(let l=0;l<s;++l){const s=n*l,A=Math.floor(s),h=Math.min(Math.ceil(s),i-1);for(let i=0;i<r;++i){const n=o*i,c=n%1,u=Math.floor(n),f=Math.min(Math.ceil(n),e-1),d=t[A*e+u],g=t[A*e+f],p=t[h*e+u],m=t[h*e+f],w=Ft(Ft(d,g,c),Ft(p,m,c),s%1);a[l*r+i]=w}}return a}))}(t,e,i,r,s);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function Lt(t,e,i,r,s,o,n="nearest"){switch(n.toLowerCase()){case"nearest":return function(t,e,i,r,s,o){const n=e/r,a=i/s,l=Gt(t,r,s,o);for(let A=0;A<s;++A){const s=Math.min(Math.round(a*A),i-1);for(let i=0;i<r;++i){const a=Math.min(Math.round(n*i),e-1);for(let n=0;n<o;++n){const h=t[s*e*o+a*o+n];l[A*r*o+i*o+n]=h}}}return l}(t,e,i,r,s,o);case"bilinear":case"linear":return function(t,e,i,r,s,o){const n=e/r,a=i/s,l=Gt(t,r,s,o);for(let A=0;A<s;++A){const s=a*A,h=Math.floor(s),c=Math.min(Math.ceil(s),i-1);for(let i=0;i<r;++i){const a=n*i,u=a%1,f=Math.floor(a),d=Math.min(Math.ceil(a),e-1);for(let n=0;n<o;++n){const a=t[h*e*o+f*o+n],g=t[h*e*o+d*o+n],p=t[c*e*o+f*o+n],m=t[c*e*o+d*o+n],w=Ft(Ft(a,g,u),Ft(p,m,u),s%1);l[A*r*o+i*o+n]=w}}}return l}(t,e,i,r,s,o);default:throw new Error(`Unsupported resampling method: '${n}'`)}}function zt(t,e,i){let r=0;for(let s=e;s<i;++s)r+=t[s];return r}function Ut(t,e,i){switch(t){case 1:if(e<=8)return new Uint8Array(i);if(e<=16)return new Uint16Array(i);if(e<=32)return new Uint32Array(i);break;case 2:if(8===e)return new Int8Array(i);if(16===e)return new Int16Array(i);if(32===e)return new Int32Array(i);break;case 3:switch(e){case 16:case 32:return new Float32Array(i);case 64:return new Float64Array(i)}}throw Error("Unsupported data format/bitsPerSample")}Dt([void 0,1],(()=>Promise.resolve().then((function(){return Er})).then((t=>t.default)))),Dt(5,(()=>Promise.resolve().then((function(){return Mr})).then((t=>t.default)))),Dt(6,(()=>{throw new Error("old style JPEG compression is not supported.")})),Dt(7,(()=>Promise.resolve().then((function(){return Or})).then((t=>t.default)))),Dt([8,32946],(()=>Promise.resolve().then((function(){return uo})).then((t=>t.default)))),Dt(32773,(()=>Promise.resolve().then((function(){return fo})).then((t=>t.default)))),Dt(34887,(()=>Promise.resolve().then((function(){return Bo})).then((async t=>(await t.zstd.init(),t))).then((t=>t.default)))),Dt(50001,(()=>Promise.resolve().then((function(){return Co})).then((t=>t.default))));class Pt{constructor(t,e,i,r,s,o){this.fileDirectory=t,this.geoKeys=e,this.dataView=i,this.littleEndian=r,this.tiles=s?{}:null,this.isTiled=!t.StripOffsets;const n=t.PlanarConfiguration;if(this.planarConfiguration=void 0===n?1:n,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e<this.fileDirectory.BitsPerSample.length;++e)t+=this.getSampleByteSize(e);return t}getSampleByteSize(t){if(t>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(t,e){return O(this,t,e)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){return Ut(this.getSampleFormat(t),this.getBitsPerSample(t),e)}async getTileOrStrip(t,e,i,r,s){const o=Math.ceil(this.getWidth()/this.getTileWidth()),n=Math.ceil(this.getHeight()/this.getTileHeight());let a;const{tiles:l}=this;let A,h;1===this.planarConfiguration?a=e*o+t:2===this.planarConfiguration&&(a=i*o*n+e*o+t),this.isTiled?(A=this.fileDirectory.TileOffsets[a],h=this.fileDirectory.TileByteCounts[a]):(A=this.fileDirectory.StripOffsets[a],h=this.fileDirectory.StripByteCounts[a]);const c=(await this.source.fetch([{offset:A,length:h}],s))[0];let u;return null!==l&&l[a]?u=l[a]:(u=(async()=>{let t=await r.decode(this.fileDirectory,c);const i=this.getSampleFormat(),s=this.getBitsPerSample();return function(t,e){return(1!==t&&2!==t||!(e<=32)||e%8!=0)&&(3!==t||16!==e&&32!==e&&64!==e)}(i,s)&&(t=function(t,e,i,r,s,o,n){const a=new DataView(t),l=2===i?1:r,A=Ut(e,s,2===i?n*o:n*o*r),h=parseInt("1".repeat(s),2);if(1===e){let t;t=1===i?r*s:s;let e=o*t;7&e&&(e=e+7&-8);for(let t=0;t<n;++t){const i=t*e;for(let e=0;e<o;++e){const r=i+e*l*s;for(let i=0;i<l;++i){const n=r+i*s,c=(t*o+e)*l+i,u=Math.floor(n/8),f=n%8;if(f+s<=8)A[c]=a.getUint8(u)>>8-s-f&h;else if(f+s<=16)A[c]=a.getUint16(u)>>16-s-f&h;else if(f+s<=24){const t=a.getUint16(u)<<8|a.getUint8(u+2);A[c]=t>>24-s-f&h}else A[c]=a.getUint32(u)>>32-s-f&h}}}}return A.buffer}(t,i,this.planarConfiguration,this.getSamplesPerPixel(),s,this.getTileWidth(),this.getBlockHeight(e))),t})(),null!==l&&(l[a]=u)),{x:t,y:e,sample:i,data:await u}}async _readRaster(t,e,i,r,s,o,n,a,l){const A=this.getTileWidth(),h=this.getTileHeight(),c=this.getWidth(),u=this.getHeight(),f=Math.max(Math.floor(t[0]/A),0),d=Math.min(Math.ceil(t[2]/A),Math.ceil(c/A)),g=Math.max(Math.floor(t[1]/h),0),p=Math.min(Math.ceil(t[3]/h),Math.ceil(u/h)),m=t[2]-t[0];let w=this.getBytesPerPixel();const I=[],v=[];for(let t=0;t<e.length;++t)1===this.planarConfiguration?I.push(zt(this.fileDirectory.BitsPerSample,0,e[t])/8):I.push(0),v.push(this.getReaderForSample(e[t]));const b=[],{littleEndian:y}=this;for(let o=g;o<p;++o)for(let n=f;n<d;++n){let a;1===this.planarConfiguration&&(a=this.getTileOrStrip(n,o,0,s,l));for(let f=0;f<e.length;++f){const d=f,g=e[f];2===this.planarConfiguration&&(w=this.getSampleByteSize(g),a=this.getTileOrStrip(n,o,g,s,l));const p=a.then((s=>{const o=s.data,n=new DataView(o),a=this.getBlockHeight(s.y),l=s.y*h,f=s.x*A,g=l+a,p=(s.x+1)*A,b=v[d],B=Math.min(a,a-(g-t[3]),u-l),C=Math.min(A,A-(p-t[2]),c-f);for(let s=Math.max(0,t[1]-l);s<B;++s)for(let o=Math.max(0,t[0]-f);o<C;++o){const a=(s*A+o)*w,h=b.call(n,a+I[d],y);let c;r?(c=(s+l-t[1])*m*e.length+(o+f-t[0])*e.length+d,i[c]=h):(c=(s+l-t[1])*m+o+f-t[0],i[d][c]=h)}}));b.push(p)}}if(await Promise.all(b),o&&t[2]-t[0]!==o||n&&t[3]-t[1]!==n){let s;return s=r?Lt(i,t[2]-t[0],t[3]-t[1],o,n,e.length,a):Rt(i,t[2]-t[0],t[3]-t[1],o,n,a),s.width=o,s.height=n,s}return i.width=o||t[2]-t[0],i.height=n||t[3]-t[1],i}async readRasters({window:t,samples:e=[],interleave:i,pool:r=null,width:s,height:o,resampleMethod:n,fillValue:a,signal:l}={}){const A=t||[0,0,this.getWidth(),this.getHeight()];if(A[0]>A[2]||A[1]>A[3])throw new Error("Invalid subsets");const h=(A[2]-A[0])*(A[3]-A[1]),c=this.getSamplesPerPixel();if(e&&e.length){for(let t=0;t<e.length;++t)if(e[t]>=c)return Promise.reject(new RangeError(`Invalid sample index '${e[t]}'.`))}else for(let t=0;t<c;++t)e.push(t);let u;if(i){u=Ut(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),h*e.length),a&&u.fill(a)}else{u=[];for(let t=0;t<e.length;++t){const i=this.getArrayForSample(e[t],h);Array.isArray(a)&&t<a.length?i.fill(a[t]):a&&!Array.isArray(a)&&i.fill(a),u.push(i)}}const f=r||await St(this.fileDirectory);return await this._readRaster(A,e,u,i,f,s,o,n,l)}async readRGB({window:t,interleave:e=true,pool:i=null,width:r,height:s,resampleMethod:o,enableAlpha:n=false,signal:a}={}){const l=t||[0,0,this.getWidth(),this.getHeight()];if(l[0]>l[2]||l[1]>l[3])throw new Error("Invalid subsets");const A=this.fileDirectory.PhotometricInterpretation;if(A===It){let l=[0,1,2];if(this.fileDirectory.ExtraSamples!==Ct&&n){l=[];for(let t=0;t<this.fileDirectory.BitsPerSample.length;t+=1)l.push(t)}return this.readRasters({window:t,interleave:e,samples:l,pool:i,width:r,height:s,resampleMethod:o,signal:a})}let h;switch(A){case mt:case wt:case vt:h=[0];break;case bt:h=[0,1,2,3];break;case yt:case Bt:h=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const c={window:l,interleave:true,samples:h,pool:i,width:r,height:s,resampleMethod:o,signal:a},{fileDirectory:u}=this,f=await this.readRasters(c),d=2**this.fileDirectory.BitsPerSample[0];let g;switch(A){case mt:g=function(t,e){const{width:i,height:r}=t,s=new Uint8Array(i*r*3);let o;for(let i=0,r=0;i<t.length;++i,r+=3)o=256-t[i]/e*256,s[r]=o,s[r+1]=o,s[r+2]=o;return s}(f,d);break;case wt:g=function(t,e){const{width:i,height:r}=t,s=new Uint8Array(i*r*3);let o;for(let i=0,r=0;i<t.length;++i,r+=3)o=t[i]/e*256,s[r]=o,s[r+1]=o,s[r+2]=o;return s}(f,d);break;case vt:g=function(t,e){const{width:i,height:r}=t,s=new Uint8Array(i*r*3),o=e.length/3,n=e.length/3*2;for(let i=0,r=0;i<t.length;++i,r+=3){const a=t[i];s[r]=e[a]/65536*256,s[r+1]=e[a+o]/65536*256,s[r+2]=e[a+n]/65536*256}return s}(f,u.ColorMap);break;case bt:g=function(t){const{width:e,height:i}=t,r=new Uint8Array(e*i*3);for(let e=0,i=0;e<t.length;e+=4,i+=3){const s=t[e],o=t[e+1],n=t[e+2],a=t[e+3];r[i]=(255-s)/256*255*((255-a)/256),r[i+1]=(255-o)/256*255*((255-a)/256),r[i+2]=(255-n)/256*255*((255-a)/256)}return r}(f);break;case yt:g=function(t){const{width:e,height:i}=t,r=new Uint8ClampedArray(e*i*3);for(let e=0,i=0;e<t.length;e+=3,i+=3){const s=t[e],o=t[e+1],n=t[e+2];r[i]=s+1.402*(n-128),r[i+1]=s-.34414*(o-128)-.71414*(n-128),r[i+2]=s+1.772*(o-128)}return r}(f);break;case Bt:g=function(t){const{width:e,height:i}=t,r=new Uint8Array(e*i*3);for(let e=0,i=0;e<t.length;e+=3,i+=3){let s,o,n,a=(t[e+0]+16)/116,l=(t[e+1]<<24>>24)/500+a,A=a-(t[e+2]<<24>>24)/200;l=.95047*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),A=1.08883*(A*A*A>.008856?A*A*A:(A-16/116)/7.787),s=3.2406*l+-1.5372*a+-.4986*A,o=-.9689*l+1.8758*a+.0415*A,n=.0557*l+-.204*a+1.057*A,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,r[i]=255*Math.max(0,Math.min(1,s)),r[i+1]=255*Math.max(0,Math.min(1,o)),r[i+2]=255*Math.max(0,Math.min(1,n))}return r}(f);break;default:throw new Error("Unsupported photometric interpretation.")}if(!e){const t=new Uint8Array(g.length/3),e=new Uint8Array(g.length/3),i=new Uint8Array(g.length/3);for(let r=0,s=0;r<g.length;r+=3,++s)t[s]=g[r],e[s]=g[r+1],i[s]=g[r+2];g=[t,e,i]}return g.width=f.width,g.height=f.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const t=[];for(let e=0;e<this.fileDirectory.ModelTiepoint.length;e+=6)t.push({i:this.fileDirectory.ModelTiepoint[e],j:this.fileDirectory.ModelTiepoint[e+1],k:this.fileDirectory.ModelTiepoint[e+2],x:this.fileDirectory.ModelTiepoint[e+3],y:this.fileDirectory.ModelTiepoint[e+4],z:this.fileDirectory.ModelTiepoint[e+5]});return t}getGDALMetadata(t=null){const e={};if(!this.fileDirectory.GDAL_METADATA)return null;const i=this.fileDirectory.GDAL_METADATA;let r=ct(i,"Item");r=null===t?r.filter((t=>void 0===Y(t,"sample"))):r.filter((e=>Number(Y(e,"sample"))===t));for(let t=0;t<r.length;++t){const i=r[t];e[Y(i,"name")]=i.inner}return e}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const t=this.fileDirectory.GDAL_NODATA;return Number(t.substring(0,t.length-1))}getOrigin(){const t=this.fileDirectory.ModelTiepoint,e=this.fileDirectory.ModelTransformation;if(t&&6===t.length)return[t[3],t[4],t[5]];if(e)return[e[3],e[7],e[11]];throw new Error("The image does not have an affine transformation.")}getResolution(t=null){const e=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(e)return[e[0],-e[1],e[2]];if(i)return 0===i[1]&&0===i[4]?[i[0],-i[5],i[10]]:[Math.sqrt(i[0]*i[0]+i[4]*i[4]),-Math.sqrt(i[1]*i[1]+i[5]*i[5]),i[10]];if(t){const[e,i,r]=t.getResolution();return[e*t.getWidth()/this.getWidth(),i*t.getHeight()/this.getHeight(),r*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(t=false){const e=this.getHeight(),i=this.getWidth();if(this.fileDirectory.ModelTransformation&&!t){const[t,r,s,o,n,a,l,A]=this.fileDirectory.ModelTransformation,h=[[0,0],[0,e],[i,0],[i,e]].map((([e,i])=>[o+t*e+r*i,A+n*e+a*i])),c=h.map((t=>t[0])),u=h.map((t=>t[1]));return[Math.min(...c),Math.min(...u),Math.max(...c),Math.max(...u)]}{const t=this.getOrigin(),r=this.getResolution(),s=t[0],o=t[1],n=s+r[0]*i,a=o+r[1]*e;return[Math.min(s,n),Math.min(o,a),Math.max(s,n),Math.max(o,a)]}}}class Nt{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const i=this.getUint32(t,e),r=this.getUint32(t+4,e);let s;if(e){if(s=i+2**32*r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*i+r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(t,e){let i=0;const r=(128&this._dataView.getUint8(t+(e?7:0)))>0;let s=true;for(let o=0;o<8;o++){let n=this._dataView.getUint8(t+(e?o:7-o));r&&(s?0!==n&&(n=255&~(n-1),s=false):n=255&~n),i+=n*256**o}return r&&(i=-i),i}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return O(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class Tt{constructor(t,e,i,r){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),i=this.readUint32(t+4);let r;if(this._littleEndian){if(r=e+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*e+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(t){let e=0;const i=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0;let r=true;for(let s=0;s<8;s++){let o=this._dataView.getUint8(t+(this._littleEndian?s:7-s));i&&(r?0!==o&&(o=255&~(o-1),r=false):o=255&~o),e+=o*256**s}return i&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const qt="undefined"!=typeof navigator&&navigator.hardwareConcurrency||2;class Ot{constructor(t=qt,e){this.workers=null,this._awaitingDecoder=null,this.size=t,this.messageId=0,t&&(this._awaitingDecoder=e?Promise.resolve(e):new Promise((t=>{Promise.resolve().then((function(){return _o})).then((e=>{t(e.create)}))})),this._awaitingDecoder.then((e=>{this._awaitingDecoder=null,this.workers=[];for(let i=0;i<t;i++)this.workers.push({worker:e(),idle:true})})))}async decode(t,e){return this._awaitingDecoder&&await this._awaitingDecoder,0===this.size?St(t).then((i=>i.decode(t,e))):new Promise((i=>{const r=this.workers.find((t=>t.idle))||this.workers[Math.floor(Math.random()*this.size)];r.idle=false;const s=this.messageId++,o=t=>{t.data.id===s&&(r.idle=true,i(t.data.decoded),r.worker.removeEventListener("message",o))};r.worker.addEventListener("message",o),r.worker.postMessage({fileDirectory:t,buffer:e,id:s},[e])}))}destroy(){this.workers&&(this.workers.forEach((t=>{t.worker.terminate()})),this.workers=null)}}const jt="\r\n\r\n";function Jt(t){if(void 0!==Object.fromEntries)return Object.fromEntries(t);const e={};for(const[i,r]of t)e[i.toLowerCase()]=r;return e}function Ht(t){return Jt(t.split("\r\n").map((t=>{const e=t.split(":").map((t=>t.trim()));return e[0]=e[0].toLowerCase(),e})))}function Yt(t){let e,i,r;return t&&([,e,i,r]=t.match(/bytes (\d+)-(\d+)\/(\d+)/),e=parseInt(e,10),i=parseInt(i,10),r=parseInt(r,10)),{start:e,end:i,total:r}}class $t{async fetch(t,e=void 0){return Promise.all(t.map((t=>this.fetchSlice(t,e))))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}class Vt extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if("number"==typeof t.maxAge&&0===t.maxAge)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if("function"==typeof this.onEviction)for(const[e,i]of t)this.onEviction(e,i.value)}_deleteIfExpired(t,e){return"number"==typeof e.expiry&&e.expiry<=Date.now()&&("function"==typeof this.onEviction&&this.onEviction(t,e.value),this.delete(t))}_getOrDeleteIfExpired(t,e){if(false===this._deleteIfExpired(t,e))return e.value}_getItemValue(t,e){return e.expiry?this._getOrDeleteIfExpired(t,e):e.value}_peek(t,e){const i=e.get(t);return this._getItemValue(t,i)}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,e){this.oldCache.delete(t),this._set(t,e)}*_entriesAscending(){for(const t of this.oldCache){const[e,i]=t;if(!this.cache.has(e)){false===this._deleteIfExpired(e,i)&&(yield t)}}for(const t of this.cache){const[e,i]=t;false===this._deleteIfExpired(e,i)&&(yield t)}}get(t){if(this.cache.has(t)){const e=this.cache.get(t);return this._getItemValue(t,e)}if(this.oldCache.has(t)){const e=this.oldCache.get(t);if(false===this._deleteIfExpired(t,e))return this._moveToRecent(t,e),e.value}}set(t,e,{maxAge:i=this.maxAge}={}){const r="number"==typeof i&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:r}):this._set(t,{value:e,expiry:r}),this}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):!!this.oldCache.has(t)&&!this._deleteIfExpired(t,this.oldCache.get(t))}peek(t){return this.cache.has(t)?this._peek(t,this.cache):this.oldCache.has(t)?this._peek(t,this.oldCache):void 0}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");const e=[...this._entriesAscending()],i=e.length-t;i<0?(this.cache=new Map(e),this.oldCache=new Map,this._size=e.length):(i>0&&this._emitEvictions(e.slice(0,i)),this.oldCache=new Map(e.slice(i)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache){const[e,i]=t;false===this._deleteIfExpired(e,i)&&(yield[e,i.value])}for(const t of this.oldCache){const[e,i]=t;if(!this.cache.has(e)){false===this._deleteIfExpired(e,i)&&(yield[e,i.value])}}}*entriesDescending(){let t=[...this.cache];for(let e=t.length-1;e>=0;--e){const i=t[e],[r,s]=i;false===this._deleteIfExpired(r,s)&&(yield[r,s.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const i=t[e],[r,s]=i;if(!this.cache.has(r)){false===this._deleteIfExpired(r,s)&&(yield[r,s.value])}}}*entriesAscending(){for(const[t,e]of this._entriesAscending())yield[t,e.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,e=this){for(const[i,r]of this.entriesAscending())t.call(e,r,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}class Kt extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Kt),this.name="AbortError"}}class Zt extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const Wt=Zt;class Xt{constructor(t,e,i=null){this.offset=t,this.length=e,this.data=i}get top(){return this.offset+this.length}}class te{constructor(t,e,i){this.offset=t,this.length=e,this.blockIds=i}}class ee extends $t{constructor(t,{blockSize:e=65536,cacheSize:i=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new Vt({maxSize:i,onEviction:(t,e)=>{this.evictedBlocks.set(t,e)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(t,e){const i=[],r=[],s=[];this.evictedBlocks.clear();for(const{offset:e,length:o}of t){let t=e+o;const{fileSize:n}=this;null!==n&&(t=Math.min(t,n));for(let o=Math.floor(e/this.blockSize)*this.blockSize;o<t;o+=this.blockSize){const t=Math.floor(o/this.blockSize);this.blockCache.has(t)||this.blockRequests.has(t)||(this.blockIdsToFetch.add(t),r.push(t)),this.blockRequests.has(t)&&i.push(this.blockRequests.get(t)),s.push(t)}}await async function(t){return new Promise((e=>setTimeout(e,t)))}(),this.fetchBlocks(e);const o=[];for(const t of r)this.blockRequests.has(t)&&o.push(this.blockRequests.get(t));await Promise.allSettled(i),await Promise.allSettled(o);const n=[],a=s.filter((t=>this.abortedBlockIds.has(t)||!this.blockCache.has(t)));if(a.forEach((t=>this.blockIdsToFetch.add(t))),a.length>0&&e&&!e.aborted){this.fetchBlocks(null);for(const t of a){const e=this.blockRequests.get(t);if(!e)throw new Error(`Block ${t} is not in the block requests`);n.push(e)}await Promise.allSettled(n)}if(e&&e.aborted)throw new Kt("Request was aborted");const l=s.map((t=>this.blockCache.get(t)||this.evictedBlocks.get(t))),A=l.filter((t=>!t));if(A.length)throw new Wt(A,"Request failed");const h=new Map(function(t,e){const i=Array.isArray(t)?t:Array.from(t),r=Array.isArray(e)?e:Array.from(e);return i.map(((t,e)=>[t,r[e]]))}(s,l));return this.readSliceData(t,h)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(e,t);for(let r=0;r<e.length;++r){const s=e[r];for(const e of s.blockIds)this.blockRequests.set(e,(async()=>{try{const t=(await i)[r],s=e*this.blockSize,o=s-t.offset,n=Math.min(o+this.blockSize,t.data.byteLength),a=t.data.slice(o,n),l=new Xt(s,a.byteLength,a,e);this.blockCache.set(e,l),this.abortedBlockIds.delete(e)}catch(i){if("AbortError"!==i.name)throw i;i.signal=t,this.blockCache.delete(e),this.abortedBlockIds.add(e)}finally{this.blockRequests.delete(e)}})())}this.blockIdsToFetch.clear()}}groupBlocks(t){const e=Array.from(t).sort(((t,e)=>t-e));if(0===e.length)return[];let i=[],r=null;const s=[];for(const t of e)null===r||r+1===t?(i.push(t),r=t):(s.push(new te(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[t],r=t);return s.push(new te(i[0]*this.blockSize,i.length*this.blockSize,i)),s}readSliceData(t,e){return t.map((t=>{let i=t.offset+t.length;null!==this.fileSize&&(i=Math.min(this.fileSize,i));const r=Math.floor(t.offset/this.blockSize),s=Math.floor(i/this.blockSize),o=new ArrayBuffer(t.length),n=new Uint8Array(o);for(let o=r;o<=s;++o){const r=e.get(o),s=r.offset-t.offset;let a,l=0,A=0;s<0?l=-s:s>0&&(A=s),a=r.top-i<0?r.length-l:i-r.offset-l;const h=new Uint8Array(r.data,l,a);n.set(h,A)}return o}))}}class ie{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class re{constructor(t){this.url=t}async request({headers:t,signal:e}={}){throw new Error("request is not implemented")}}class se extends ie{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class oe extends re{constructor(t,e){super(t),this.credentials=e}async request({headers:t,signal:e}={}){const i=await fetch(this.url,{headers:t,credentials:this.credentials,signal:e});return new se(i)}}class ne extends ie{constructor(t,e){super(),this.xhr=t,this.data=e}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class ae extends re{constructRequest(t,e){return new Promise(((i,r)=>{const s=new XMLHttpRequest;s.open("GET",this.url),s.responseType="arraybuffer";for(const[e,i]of Object.entries(t))s.setRequestHeader(e,i);s.onload=()=>{const t=s.response;i(new ne(s,t))},s.onerror=r,s.onabort=()=>r(new Kt("Request aborted")),s.send(),e&&(e.aborted&&s.abort(),e.addEventListener("abort",(()=>s.abort())))}))}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}var le={};class Ae extends ie{constructor(t,e){super(),this.response=t,this.dataPromise=e}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class he extends re{constructor(t){super(t),this.parsedUrl=le.parse(this.url),this.httpApi=le}constructRequest(t,e){return new Promise(((i,r)=>{const s=this.httpApi.get({...this.parsedUrl,headers:t},(t=>{const e=new Promise((e=>{const i=[];t.on("data",(t=>{i.push(t)})),t.on("end",(()=>{const t=Buffer.concat(i).buffer;e(t)})),t.on("error",r)}));i(new Ae(t,e))}));s.on("error",r),e&&(e.aborted&&s.destroy(new Kt("Request aborted")),e.addEventListener("abort",(()=>s.destroy(new Kt("Request aborted")))))}))}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class ce extends $t{constructor(t,e,i,r){super(),this.client=t,this.headers=e,this.maxRanges=i,this.allowFullFile=r,this._fileSize=null}async fetch(t,e){return this.maxRanges>=t.length?this.fetchSlices(t,e):Promise.all(t.map((t=>this.fetchSlice(t,e))))}async fetchSlices(t,e){const i=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map((({offset:t,length:e})=>`${t}-${t+e}`)).join(",")}`},signal:e});if(i.ok){if(206===i.status){const{type:r,params:s}=function(t){const[e,...i]=t.split(";").map((t=>t.trim()));return{type:e,params:Jt(i.map((t=>t.split("="))))}}(i.getHeader("content-type"));if("multipart/byteranges"===r){const t=function(t,e){let i=null;const r=new TextDecoder("ascii"),s=[],o=`--${e}`,n=`${o}--`;for(let e=0;e<10;++e)r.decode(new Uint8Array(t,e,o.length))===o&&(i=e);if(null===i)throw new Error("Could not find initial boundary");for(;i<t.byteLength;){const e=r.decode(new Uint8Array(t,i,Math.min(o.length+1024,t.byteLength-i)));if(0===e.length||e.startsWith(n))break;if(!e.startsWith(o))throw new Error("Part does not start with boundary");const a=e.substr(o.length+2);if(0===a.length)break;const l=a.indexOf(jt),A=Ht(a.substr(0,l)),{start:h,end:c,total:u}=Yt(A["content-range"]),f=i+o.length+l+4,d=parseInt(c,10)+1-parseInt(h,10);s.push({headers:A,data:t.slice(f,f+d),offset:h,length:d,fileSize:u}),i=f+d+4}return s}(await i.getData(),s.boundary);return this._fileSize=t[0].fileSize||null,t}const o=await i.getData(),{start:n,end:a,total:l}=Yt(i.getHeader("content-range"));this._fileSize=l||null;const A=[{data:o,offset:n,length:a-n}];if(t.length>1){const i=await Promise.all(t.slice(1).map((t=>this.fetchSlice(t,e))));return A.concat(i)}return A}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await i.getData();return this._fileSize=t.byteLength,[{data:t,offset:0,length:t.byteLength}]}}throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:i,length:r}=t,s=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+r}`},signal:e});if(s.ok){if(206===s.status){const t=await s.getData(),{total:e}=Yt(s.getHeader("content-range"));return this._fileSize=e||null,{data:t,offset:i,length:r}}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await s.getData();return this._fileSize=t.byteLength,{data:t,offset:0,length:t.byteLength}}}throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function ue(t,{blockSize:e,cacheSize:i}){return null===e?t:new ee(t,{blockSize:e,cacheSize:i})}function fe(t,{forceXHR:e=false,...i}={}){return"function"!=typeof fetch||e?"undefined"!=typeof XMLHttpRequest?function(t,{headers:e={},maxRanges:i=0,allowFullFile:r=false,...s}={}){const o=new ae(t);return ue(new ce(o,e,i,r),s)}(t,i):function(t,{headers:e={},maxRanges:i=0,allowFullFile:r=false,...s}={}){const o=new he(t);return ue(new ce(o,e,i,r),s)}(t,i):function(t,{headers:e={},credentials:i,maxRanges:r=0,allowFullFile:s=false,...o}={}){const n=new oe(t,i);return ue(new ce(n,e,r,s),o)}(t,i)}function de(t,e){let i=t.length-e,r=0;do{for(let i=e;i>0;i--)t[r+e]+=t[r],r++;i-=e}while(i>0)}function ge(t,e,i){let r=0,s=t.length;const o=s/i;for(;s>e;){for(let i=e;i>0;--i)t[r+e]+=t[r],++r;s-=e}const n=t.slice();for(let e=0;e<o;++e)for(let r=0;r<i;++r)t[i*e+r]=n[(i-r-1)*o+e]}class pe{async decode(t,e){const i=await this.decodeBlock(e),r=t.Predictor||1;if(1!==r){const e=!t.StripOffsets;return function(t,e,i,r,s,o){if(1===e)return t;for(let t=0;t<s.length;++t){if(s[t]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(s[t]!==s[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const n=s[0]/8,a=2===o?1:s.length;for(let o=0;o<r&&!(o*a*i*n>=t.byteLength);++o){let r;if(2===e){switch(s[0]){case 8:r=new Uint8Array(t,o*a*i*n,a*i*n);break;case 16:r=new Uint16Array(t,o*a*i*n,a*i*n/2);break;case 32:r=new Uint32Array(t,o*a*i*n,a*i*n/4);break;default:throw new Error(`Predictor 2 not allowed with ${s[0]} bits per sample.`)}de(r,a)}else 3===e&&(r=new Uint8Array(t,o*a*i*n,a*i*n),ge(r,a,n))}return t}(i,r,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return i}}function me(t){switch(t){case pt.BYTE:case pt.ASCII:case pt.SBYTE:case pt.UNDEFINED:return 1;case pt.SHORT:case pt.SSHORT:return 2;case pt.LONG:case pt.SLONG:case pt.FLOAT:case pt.IFD:return 4;case pt.RATIONAL:case pt.SRATIONAL:case pt.DOUBLE:case pt.LONG8:case pt.SLONG8:case pt.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function we(t,e,i,r){let s=null,o=null;const n=me(e);switch(e){case pt.BYTE:case pt.ASCII:case pt.UNDEFINED:s=new Uint8Array(i),o=t.readUint8;break;case pt.SBYTE:s=new Int8Array(i),o=t.readInt8;break;case pt.SHORT:s=new Uint16Array(i),o=t.readUint16;break;case pt.SSHORT:s=new Int16Array(i),o=t.readInt16;break;case pt.LONG:case pt.IFD:s=new Uint32Array(i),o=t.readUint32;break;case pt.SLONG:s=new Int32Array(i),o=t.readInt32;break;case pt.LONG8:case pt.IFD8:s=new Array(i),o=t.readUint64;break;case pt.SLONG8:s=new Array(i),o=t.readInt64;break;case pt.RATIONAL:s=new Uint32Array(2*i),o=t.readUint32;break;case pt.SRATIONAL:s=new Int32Array(2*i),o=t.readInt32;break;case pt.FLOAT:s=new Float32Array(i),o=t.readFloat32;break;case pt.DOUBLE:s=new Float64Array(i),o=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e!==pt.RATIONAL&&e!==pt.SRATIONAL)for(let e=0;e<i;++e)s[e]=o.call(t,r+e*n);else for(let e=0;e<i;e+=2)s[e]=o.call(t,r+e*n),s[e+1]=o.call(t,r+(e*n+4));return e===pt.ASCII?new TextDecoder("utf-8").decode(s):s}class Ie{constructor(t,e,i){this.fileDirectory=t,this.geoKeyDirectory=e,this.nextIFDByteOffset=i}}class ve extends Error{constructor(t){super(`No image at index ${t}`),this.index=t}}class be{async readRasters(t={}){const{window:e,width:i,height:r}=t;let{resX:s,resY:o,bbox:n}=t;const a=await this.getImage();let l=a;const A=await this.getImageCount(),h=a.getBoundingBox();if(e&&n)throw new Error('Both "bbox" and "window" passed.');if(i||r){if(e){const[t,i]=a.getOrigin(),[r,s]=a.getResolution();n=[t+e[0]*r,i+e[1]*s,t+e[2]*r,i+e[3]*s]}const t=n||h;if(i){if(s)throw new Error("Both width and resX passed");s=(t[2]-t[0])/i}if(r){if(o)throw new Error("Both width and resY passed");o=(t[3]-t[1])/r}}if(s||o){const t=[];for(let e=0;e<A;++e){const i=await this.getImage(e),{SubfileType:r,NewSubfileType:s}=i.fileDirectory;(0===e||2===r||1&s)&&t.push(i)}t.sort(((t,e)=>t.getWidth()-e.getWidth()));for(let e=0;e<t.length;++e){const i=t[e],r=(h[2]-h[0])/i.getWidth(),n=(h[3]-h[1])/i.getHeight();if(l=i,s&&s>r||o&&o>n)break}}let c=e;if(n){const[t,e]=a.getOrigin(),[i,r]=l.getResolution(a);c=[Math.round((n[0]-t)/i),Math.round((n[1]-e)/r),Math.round((n[2]-t)/i),Math.round((n[3]-e)/r)],c=[Math.min(c[0],c[2]),Math.min(c[1],c[3]),Math.max(c[0],c[2]),Math.max(c[1],c[3])]}return l.readRasters({...t,window:c})}}class ye extends be{constructor(t,e,i,r,s={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=i,this.firstIFDOffset=r,this.cache=s.cache||false,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const i=this.bigTiff?4048:1024;return new Tt((await this.source.fetch([{offset:t,length:void 0!==e?e:i}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(t);const s=this.bigTiff?r.readUint64(t):r.readUint16(t),o=s*e+(this.bigTiff?16:6);r.covers(t,o)||(r=await this.getSlice(t,o));const n={};let a=t+(this.bigTiff?8:2);for(let t=0;t<s;a+=e,++t){const t=r.readUint16(a),e=r.readUint16(a+2),i=this.bigTiff?r.readUint64(a+4):r.readUint32(a+4);let s,o;const l=me(e),A=a+(this.bigTiff?12:8);if(l*i<=(this.bigTiff?8:4))s=we(r,e,i,A);else{const t=r.readOffset(A),o=me(e)*i;if(r.covers(t,o))s=we(r,e,i,t);else{s=we(await this.getSlice(t,o),e,i,t)}}o=1===i&&-1===dt.indexOf(t)&&e!==pt.RATIONAL&&e!==pt.SRATIONAL?s[0]:s,n[ut[t]]=o}const l=function(t){const e=t.GeoKeyDirectory;if(!e)return null;const i={};for(let r=4;r<=4*e[3];r+=4){const s=Mt[e[r]],o=e[r+1]?ut[e[r+1]]:null,n=e[r+2],a=e[r+3];let l=null;if(o){if(l=t[o],null==l)throw new Error(`Could not get value of geoKey '${s}'.`);"string"==typeof l?l=l.substring(a,a+n-1):l.subarray&&(l=l.subarray(a,a+n),1===n&&(l=l[0]))}else l=a;i[s]=l}return i}(n),A=r.readOffset(t+i+e*s);return new Ie(n,l,A)}async requestIFD(t){if(this.ifdRequests[t])return this.ifdRequests[t];if(0===t)return this.ifdRequests[t]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[t];if(!this.ifdRequests[t-1])try{this.ifdRequests[t-1]=this.requestIFD(t-1)}catch(e){if(e instanceof ve)throw new ve(t);throw e}return this.ifdRequests[t]=(async()=>{const e=await this.ifdRequests[t-1];if(0===e.nextIFDByteOffset)throw new ve(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new Pt(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=true;for(;e;)try{await this.requestIFD(t),++t}catch(t){if(!(t instanceof ve))throw t;e=false}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e="GDAL_STRUCTURAL_METADATA_SIZE=";let i=await this.getSlice(t,130);if(e===we(i,pt.ASCII,30,t)){const e=we(i,pt.ASCII,130,t).split("\n")[0],r=Number(e.split("=")[1].split(" ")[0])+e.length;r>130&&(i=await this.getSlice(t,r));const s=we(i,pt.ASCII,r,t);this.ghostValues={},s.split("\n").filter((t=>t.length>0)).map((t=>t.split("="))).forEach((([t,e])=>{this.ghostValues[t]=e}))}return this.ghostValues}static async fromSource(t,e,i){const r=(await t.fetch([{offset:0,length:1024}],i))[0],s=new Nt(r),o=s.getUint16(0,0);let n;if(18761===o)n=true;else{if(19789!==o)throw new TypeError("Invalid byte order value.");n=false}const a=s.getUint16(2,n);let l;if(42===a)l=false;else{if(43!==a)throw new TypeError("Invalid magic number.");l=true;if(8!==s.getUint16(4,n))throw new Error("Unsupported offset byte-size.")}const A=l?s.getUint64(8,n):s.getUint32(4,n);return new ye(t,n,l,A,e)}close(){return"function"==typeof this.source.close&&this.source.close()}}var Be={exports:{}};!function(t,e){var i=function(){var t={},e=Math.PI/180,i=180/Math.PI,r=6378137,s=20037508.342789244;function o(t){return Number(t)===t&&t%1!=0}function n(e){if(e=e||{},this.size=e.size||256,this.expansion=true===e.antimeridian?2:1,!t[this.size]){var i=this.size,r=t[this.size]={};r.Bc=[],r.Cc=[],r.zc=[],r.Ac=[];for(var s=0;s<30;s++)r.Bc.push(i/360),r.Cc.push(i/(2*Math.PI)),r.zc.push(i/2),r.Ac.push(i),i*=2}this.Bc=t[this.size].Bc,this.Cc=t[this.size].Cc,this.zc=t[this.size].zc,this.Ac=t[this.size].Ac}return n.prototype.px=function(t,i){if(o(i)){var r=this.size*Math.pow(2,i),s=r/2,n=r/360,a=r/(2*Math.PI),l=r,A=Math.min(Math.max(Math.sin(e*t[1]),-.9999),.9999),h=s+t[0]*n,c=s+.5*Math.log((1+A)/(1-A))*-a;return h>l*this.expansion&&(h=l*this.expansion),c>l&&(c=l),[h,c]}s=this.zc[i],A=Math.min(Math.max(Math.sin(e*t[1]),-.9999),.9999),h=Math.round(s+t[0]*this.Bc[i]),c=Math.round(s+.5*Math.log((1+A)/(1-A))*-this.Cc[i]);return h>this.Ac[i]*this.expansion&&(h=this.Ac[i]*this.expansion),c>this.Ac[i]&&(c=this.Ac[i]),[h,c]},n.prototype.ll=function(t,e){if(o(e)){var r=this.size*Math.pow(2,e),s=r/360,n=r/(2*Math.PI),a=r/2,l=(t[1]-a)/-n;return[(t[0]-a)/s,i*(2*Math.atan(Math.exp(l))-.5*Math.PI)]}l=(t[1]-this.zc[e])/-this.Cc[e];return[(t[0]-this.zc[e])/this.Bc[e],i*(2*Math.atan(Math.exp(l))-.5*Math.PI)]},n.prototype.bbox=function(t,e,i,r,s){r&&(e=Math.pow(2,i)-1-e);var o=[t*this.size,(+e+1)*this.size],n=[(+t+1)*this.size,e*this.size],a=this.ll(o,i).concat(this.ll(n,i));return"900913"===s?this.convert(a,"900913"):a},n.prototype.xyz=function(t,e,i,r){"900913"===r&&(t=this.convert(t,"WGS84"));var s=[t[0],t[1]],o=[t[2],t[3]],n=this.px(s,e),a=this.px(o,e),l=[Math.floor(n[0]/this.size),Math.floor((a[0]-1)/this.size)],A=[Math.floor(a[1]/this.size),Math.floor((n[1]-1)/this.size)],h={minX:Math.min.apply(Math,l)<0?0:Math.min.apply(Math,l),minY:Math.min.apply(Math,A)<0?0:Math.min.apply(Math,A),maxX:Math.max.apply(Math,l),maxY:Math.max.apply(Math,A)};if(i){var c={minY:Math.pow(2,e)-1-h.maxY,maxY:Math.pow(2,e)-1-h.minY};h.minY=c.minY,h.maxY=c.maxY}return h},n.prototype.convert=function(t,e){return"900913"===e?this.forward(t.slice(0,2)).concat(this.forward(t.slice(2,4))):this.inverse(t.slice(0,2)).concat(this.inverse(t.slice(2,4)))},n.prototype.forward=function(t){var i=[r*t[0]*e,r*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return i[0]>s&&(i[0]=s),i[0]<-20037508.342789244&&(i[0]=-20037508.342789244),i[1]>s&&(i[1]=s),i[1]<-20037508.342789244&&(i[1]=-20037508.342789244),i},n.prototype.inverse=function(t){return[t[0]*i/r,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/r)))*i]},n}();t.exports=i}(Be);const Ce=256,Ee=40075016.68557849,_e=new(j(Be.exports))({size:Ce,antimeridian:true}),Qe=({x:t,y:e,z:i})=>_e.bbox(t,e,i,false,"900913"),xe=36e5;let Me;const ke=new Vt({maxSize:16,maxAge:xe}),De=new Vt({maxSize:16,maxAge:xe}),Se=new Vt({maxSize:1024,maxAge:xe}),Ge=t=>{void 0===Me&&(Me=new Ot);const e=t=>{const e=ke.get(t);if(e)return e;{const e=async function(t,e={},i){return ye.fromSource(fe(t,e),i)}(t);return ke.set(t,e),e}},i=async()=>{const i=De.get(t);if(i)return i;{const i=await e(t),s=await i.getImage(),o=s.getGDALMetadata(0),n=s.fileDirectory,a=s.fileDirectory?.Artist,l=(([t,e,i,r])=>[..._e.inverse([t,e]),..._e.inverse([i,r])])(s.getBoundingBox()),A=[],h=await i.getImageCount();for(let t=0;t<h;t++){const e=await i.getImage(t),o=(r=e.getResolution(s)[0],Math.log2(Ee/(Ce*r))),n=!!(1&e.fileDirectory.NewSubfileType),a=!!(4&e.fileDirectory.NewSubfileType);A.push({zoom:o,isOverview:n,isMask:a})}const c={offset:void 0!==o?.OFFSET?parseFloat(o.OFFSET):0,scale:void 0!==o?.SCALE?parseFloat(o.SCALE):1,noData:s.getGDALNoData()??void 0,photometricInterpretation:n?.PhotometricInterpretation,bitsPerSample:n?.BitsPerSample,colorMap:n?.ColorMap,artist:a,bbox:l,images:A};return De.set(t,c),c}var r};return{getTilejson:async t=>{const{artist:e,images:r,bbox:s}=await i(),o=r.map((t=>t.zoom));return{tilejson:"2.2.0",tiles:[t+"/{z}/{x}/{y}"],attribution:e,minzoom:Math.round(Math.min(...o)),maxzoom:Math.round(Math.max(...o)),bounds:s}},getMetadata:i,getRawTile:async({z:r,x:s,y:o},n=256)=>{const a=`${t}/${n}/${r}/${s}/${o}`,l=Se.get(a);if(l)return l;{const l=await e(t),{noData:A}=await i(),h=void 0===A||isNaN(A)?1/0:A,c=l.readRasters({bbox:Qe({x:s,y:o,z:r}),width:n,height:n,interleave:true,resampleMethod:"nearest",pool:Me,fillValue:h});return Se.set(a,c),c}}}};function Fe(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Re(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Le(t){let e,i,r;function s(t,r,s=0,o=t.length){if(s<o){if(0!==e(r,r))return o;do{const e=s+o>>>1;i(t[e],r)<0?s=e+1:o=e}while(s<o)}return s}return 2!==t.length?(e=Fe,i=(e,i)=>Fe(t(e),i),r=(e,i)=>t(e)-i):(e=t===Fe||t===Re?t:ze,i=t,r=t),{left:s,center:function(t,e,i=0,o=t.length){const n=s(t,e,i,o-1);return n>i&&r(t[n-1],e)>-r(t[n],e)?n-1:n},right:function(t,r,s=0,o=t.length){if(s<o){if(0!==e(r,r))return o;do{const e=s+o>>>1;i(t[e],r)<=0?s=e+1:o=e}while(s<o)}return s}}}function ze(){return 0}const Ue=Le(Fe).right;Le((function(t){return null===t?NaN:+t})).center;const Pe=Math.sqrt(50),Ne=Math.sqrt(10),Te=Math.sqrt(2);function qe(t,e,i){const r=(e-t)/Math.max(0,i),s=Math.floor(Math.log10(r)),o=r/Math.pow(10,s),n=o>=Pe?10:o>=Ne?5:o>=Te?2:1;let a,l,A;return s<0?(A=Math.pow(10,-s)/n,a=Math.round(t*A),l=Math.round(e*A),a/A<t&&++a,l/A>e&&--l,A=-A):(A=Math.pow(10,s)*n,a=Math.round(t/A),l=Math.round(e/A),a*A<t&&++a,l*A>e&&--l),l<a&&.5<=i&&i<2?qe(t,e,2*i):[a,l,A]}function Oe(t,e,i){return qe(t=+t,e=+e,i=+i)[2]}function je(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Je(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function He(t,e){var i=Object.create(t.prototype);for(var r in e)i[r]=e[r];return i}function Ye(){}var $e=.7,Ve=1/$e,Ke="\\s*([+-]?\\d+)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xe=/^#([0-9a-f]{3,8})$/,ti=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),ei=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),ii=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${Ze}\\)$`),ri=new RegExp(`^rgba\\(${We},${We},${We},${Ze}\\)$`),si=new RegExp(`^hsl\\(${Ze},${We},${We}\\)$`),oi=new RegExp(`^hsla\\(${Ze},${We},${We},${Ze}\\)$`),ni={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ai(){return this.rgb().formatHex()}function li(){return this.rgb().formatRgb()}function Ai(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=Xe.exec(t))?(i=e[1].length,e=parseInt(e[1],16),6===i?hi(e):3===i?new fi(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===i?ci(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===i?ci(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ti.exec(t))?new fi(e[1],e[2],e[3],1):(e=ei.exec(t))?new fi(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ii.exec(t))?ci(e[1],e[2],e[3],e[4]):(e=ri.exec(t))?ci(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=si.exec(t))?Ii(e[1],e[2]/100,e[3]/100,1):(e=oi.exec(t))?Ii(e[1],e[2]/100,e[3]/100,e[4]):ni.hasOwnProperty(t)?hi(ni[t]):"transparent"===t?new fi(NaN,NaN,NaN,0):null}function hi(t){return new fi(t>>16&255,t>>8&255,255&t,1)}function ci(t,e,i,r){return r<=0&&(t=e=i=NaN),new fi(t,e,i,r)}function ui(t,e,i,r){return 1===arguments.length?((s=t)instanceof Ye||(s=Ai(s)),s?new fi((s=s.rgb()).r,s.g,s.b,s.opacity):new fi):new fi(t,e,i,null==r?1:r);var s}function fi(t,e,i,r){this.r=+t,this.g=+e,this.b=+i,this.opacity=+r}function di(){return`#${wi(this.r)}${wi(this.g)}${wi(this.b)}`}function gi(){const t=pi(this.opacity);return`${1===t?"rgb(":"rgba("}${mi(this.r)}, ${mi(this.g)}, ${mi(this.b)}${1===t?")":`, ${t})`}`}function pi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function mi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function wi(t){return((t=mi(t))<16?"0":"")+t.toString(16)}function Ii(t,e,i,r){return r<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new bi(t,e,i,r)}function vi(t){if(t instanceof bi)return new bi(t.h,t.s,t.l,t.opacity);if(t instanceof Ye||(t=Ai(t)),!t)return new bi;if(t instanceof bi)return t;var e=(t=t.rgb()).r/255,i=t.g/255,r=t.b/255,s=Math.min(e,i,r),o=Math.max(e,i,r),n=NaN,a=o-s,l=(o+s)/2;return a?(n=e===o?(i-r)/a+6*(i<r):i===o?(r-e)/a+2:(e-i)/a+4,a/=l<.5?o+s:2-o-s,n*=60):a=l>0&&l<1?0:n,new bi(n,a,l,t.opacity)}function bi(t,e,i,r){this.h=+t,this.s=+e,this.l=+i,this.opacity=+r}function yi(t){return(t=(t||0)%360)<0?t+360:t}function Bi(t){return Math.max(0,Math.min(1,t||0))}function Ci(t,e,i){return 255*(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)}Je(Ye,Ai,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ai,formatHex:ai,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return vi(this).formatHsl()},formatRgb:li,toString:li}),Je(fi,ui,He(Ye,{brighter(t){return t=null==t?Ve:Math.pow(Ve,t),new fi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?$e:Math.pow($e,t),new fi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new fi(mi(this.r),mi(this.g),mi(this.b),pi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:di,formatHex:di,formatHex8:function(){return`#${wi(this.r)}${wi(this.g)}${wi(this.b)}${wi(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gi,toString:gi})),Je(bi,(function(t,e,i,r){return 1===arguments.length?vi(t):new bi(t,e,i,null==r?1:r)}),He(Ye,{brighter(t){return t=null==t?Ve:Math.pow(Ve,t),new bi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?$e:Math.pow($e,t),new bi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,r=i+(i<.5?i:1-i)*e,s=2*i-r;return new fi(Ci(t>=240?t-240:t+120,s,r),Ci(t,s,r),Ci(t<120?t+240:t-120,s,r),this.opacity)},clamp(){return new bi(yi(this.h),Bi(this.s),Bi(this.l),pi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=pi(this.opacity);return`${1===t?"hsl(":"hsla("}${yi(this.h)}, ${100*Bi(this.s)}%, ${100*Bi(this.l)}%${1===t?")":`, ${t})`}`}}));var Ei=t=>()=>t;function _i(t){return 1==(t=+t)?Qi:function(e,i){return i-e?function(t,e,i){return t=Math.pow(t,i),e=Math.pow(e,i)-t,i=1/i,function(r){return Math.pow(t+r*e,i)}}(e,i,t):Ei(isNaN(e)?i:e)}}function Qi(t,e){var i=e-t;return i?function(t,e){return function(i){return t+i*e}}(t,i):Ei(isNaN(t)?e:t)}var xi=function t(e){var i=_i(e);function r(t,e){var r=i((t=ui(t)).r,(e=ui(e)).r),s=i(t.g,e.g),o=i(t.b,e.b),n=Qi(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=s(e),t.b=o(e),t.opacity=n(e),t+""}}return r.gamma=t,r}(1);function Mi(t,e){e||(e=[]);var i,r=t?Math.min(e.length,t.length):0,s=e.slice();return function(o){for(i=0;i<r;++i)s[i]=t[i]*(1-o)+e[i]*o;return s}}function ki(t,e){var i,r=e?e.length:0,s=t?Math.min(r,t.length):0,o=new Array(s),n=new Array(r);for(i=0;i<s;++i)o[i]=zi(t[i],e[i]);for(;i<r;++i)n[i]=e[i];return function(t){for(i=0;i<s;++i)n[i]=o[i](t);return n}}function Di(t,e){var i=new Date;return t=+t,e=+e,function(r){return i.setTime(t*(1-r)+e*r),i}}function Si(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}function Gi(t,e){var i,r={},s={};for(i in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)i in t?r[i]=zi(t[i],e[i]):s[i]=e[i];return function(t){for(i in r)s[i]=r[i](t);return s}}var Fi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ri=new RegExp(Fi.source,"g");function Li(t,e){var i,r,s,o=Fi.lastIndex=Ri.lastIndex=0,n=-1,a=[],l=[];for(t+="",e+="";(i=Fi.exec(t))&&(r=Ri.exec(e));)(s=r.index)>o&&(s=e.slice(o,s),a[n]?a[n]+=s:a[++n]=s),(i=i[0])===(r=r[0])?a[n]?a[n]+=r:a[++n]=r:(a[++n]=null,l.push({i:n,x:Si(i,r)})),o=Ri.lastIndex;return o<e.length&&(s=e.slice(o),a[n]?a[n]+=s:a[++n]=s),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var i,r=0;r<e;++r)a[(i=l[r]).i]=i.x(t);return a.join("")})}function zi(t,e){var i,r,s=typeof e;return null==e||"boolean"===s?Ei(e):("number"===s?Si:"string"===s?(i=Ai(e))?(e=i,xi):Li:e instanceof Ai?xi:e instanceof Date?Di:(r=e,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(e)?ki:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Gi:Si:Mi))(t,e)}function Ui(t,e){return t=+t,e=+e,function(i){return Math.round(t*(1-i)+e*i)}}function Pi(t){return+t}var Ni=[0,1];function Ti(t){return t}function qi(t,e){return(e-=t=+t)?function(i){return(i-t)/e}:(i=isNaN(e)?NaN:.5,function(){return i});var i}function Oi(t,e,i){var r=t[0],s=t[1],o=e[0],n=e[1];return s<r?(r=qi(s,r),o=i(n,o)):(r=qi(r,s),o=i(o,n)),function(t){return o(r(t))}}function ji(t,e,i){var r=Math.min(t.length,e.length)-1,s=new Array(r),o=new Array(r),n=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++n<r;)s[n]=qi(t[n],t[n+1]),o[n]=i(e[n],e[n+1]);return function(e){var i=Ue(t,e,1,r)-1;return o[i](s[i](e))}}function Ji(){var t,e,i,r,s,o,n=Ni,a=Ni,l=zi,A=Ti;function h(){var t,e,i,l=Math.min(n.length,a.length);return A!==Ti&&(t=n[0],e=n[l-1],t>e&&(i=t,t=e,e=i),A=function(i){return Math.max(t,Math.min(e,i))}),r=l>2?ji:Oi,s=o=null,c}function c(e){return null==e||isNaN(e=+e)?i:(s||(s=r(n.map(t),a,l)))(t(A(e)))}return c.invert=function(i){return A(e((o||(o=r(a,n.map(t),Si)))(i)))},c.domain=function(t){return arguments.length?(n=Array.from(t,Pi),h()):n.slice()},c.range=function(t){return arguments.length?(a=Array.from(t),h()):a.slice()},c.rangeRound=function(t){return a=Array.from(t),l=Ui,h()},c.clamp=function(t){return arguments.length?(A=!!t||Ti,h()):A!==Ti},c.interpolate=function(t){return arguments.length?(l=t,h()):l},c.unknown=function(t){return arguments.length?(i=t,c):i},function(i,r){return t=i,e=r,h()}}function Hi(t,e){if((i=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var i,r=t.slice(0,i);return[r.length>1?r[0]+r.slice(2):r,+t.slice(i+1)]}function Yi(t){return(t=Hi(Math.abs(t)))?t[1]:NaN}var $i,Vi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ki(t){if(!(e=Vi.exec(t)))throw new Error("invalid format: "+t);var e;return new Zi({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Zi(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Wi(t,e){var i=Hi(t,e);if(!i)return t+"";var r=i[0],s=i[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}Ki.prototype=Zi.prototype,Zi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Xi={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Wi(100*t,e),r:Wi,s:function(t,e){var i=Hi(t,e);if(!i)return t+"";var r=i[0],s=i[1],o=s-($i=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,n=r.length;return o===n?r:o>n?r+new Array(o-n+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Hi(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tr(t){return t}var er,ir,rr,sr=Array.prototype.map,or=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function nr(t){var e,i,r=void 0===t.grouping||void 0===t.thousands?tr:(e=sr.call(t.grouping,Number),i=t.thousands+"",function(t,r){for(var s=t.length,o=[],n=0,a=e[0],l=0;s>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(t.substring(s-=a,s+a)),!((l+=a+1)>r));)a=e[n=(n+1)%e.length];return o.reverse().join(i)}),s=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",n=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?tr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(sr.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",A=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=Ki(t)).fill,i=t.align,c=t.sign,u=t.symbol,f=t.zero,d=t.width,g=t.comma,p=t.precision,m=t.trim,w=t.type;"n"===w?(g=true,w="g"):Xi[w]||(void 0===p&&(p=12),m=true,w="g"),(f||"0"===e&&"="===i)&&(f=true,e="0",i="=");var I="$"===u?s:"#"===u&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",v="$"===u?o:/[%p]/.test(w)?l:"",b=Xi[w],y=/[defgprs%]/.test(w);function B(t){var s,o,l,u=I,B=v;if("c"===w)B=b(t)+B,t="";else{var C=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:b(Math.abs(t),p),m&&(t=function(t){t:for(var e,i=t.length,r=1,s=-1;r<i;++r)switch(t[r]){case".":s=e=r;break;case"0":0===s&&(s=r),e=r;break;default:if(!+t[r])break t;s>0&&(s=0)}return s>0?t.slice(0,s)+t.slice(e+1):t}(t)),C&&0==+t&&"+"!==c&&(C=false),u=(C?"("===c?c:A:"-"===c||"("===c?"":c)+u,B=("s"===w?or[8+$i/3]:"")+B+(C&&"("===c?")":""),y)for(s=-1,o=t.length;++s<o;)if(48>(l=t.charCodeAt(s))||l>57){B=(46===l?n+t.slice(s+1):t.slice(s))+B,t=t.slice(0,s);break}}g&&!f&&(t=r(t,1/0));var E=u.length+t.length+B.length,_=E<d?new Array(d-E+1).join(e):"";switch(g&&f&&(t=r(_+t,_.length?d-B.length:1/0),_=""),i){case"<":t=u+t+B+_;break;case"=":t=u+_+t+B;break;case"^":t=_.slice(0,E=_.length>>1)+u+t+B+_.slice(E);break;default:t=_+u+t+B}return a(t)}return p=void 0===p?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),B.toString=function(){return t+""},B}return{format:c,formatPrefix:function(t,e){var i=c(((t=Ki(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Yi(e)/3))),s=Math.pow(10,-r),o=or[8+r/3];return function(t){return i(s*t)+o}}}}function ar(t,e,i,r){var s,o=function(t,e,i){i=+i;const r=(e=+e)<(t=+t),s=r?Oe(e,t,i):Oe(t,e,i);return(r?-1:1)*(s<0?1/-s:s)}(t,e,i);switch((r=Ki(null==r?",f":r)).type){case"s":var n=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(s=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Yi(e)/3)))-Yi(Math.abs(t)))}(o,n))||(r.precision=s),rr(r,n);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(s=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Yi(e)-Yi(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=s-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(s=function(t){return Math.max(0,-Yi(Math.abs(t)))}(o))||(r.precision=s-2*("%"===r.type))}return ir(r)}function lr(t){var e=t.domain;return t.ticks=function(t){var i=e();return function(t,e,i){if(!((i=+i)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[s,o,n]=r?qe(e,t,i):qe(t,e,i);if(!(o>=s))return[];const a=o-s+1,l=new Array(a);if(r)if(n<0)for(let t=0;t<a;++t)l[t]=(o-t)/-n;else for(let t=0;t<a;++t)l[t]=(o-t)*n;else if(n<0)for(let t=0;t<a;++t)l[t]=(s+t)/-n;else for(let t=0;t<a;++t)l[t]=(s+t)*n;return l}(i[0],i[i.length-1],null==t?10:t)},t.tickFormat=function(t,i){var r=e();return ar(r[0],r[r.length-1],null==t?10:t,i)},t.nice=function(i){null==i&&(i=10);var r,s,o=e(),n=0,a=o.length-1,l=o[n],A=o[a],h=10;for(A<l&&(s=l,l=A,A=s,s=n,n=a,a=s);h-- >0;){if((s=Oe(l,A,i))===r)return o[n]=l,o[a]=A,e(o);if(s>0)l=Math.floor(l/s)*s,A=Math.ceil(A/s)*s;else{if(!(s<0))break;l=Math.ceil(l*s)/s,A=Math.floor(A*s)/s}r=s}return t},t}function Ar(){var t=Ji()(Ti,Ti);return t.copy=function(){return e=t,Ar().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},je.apply(t,arguments),lr(t)}function hr(){var t,e=[.5],i=[0,1],r=1;function s(s){return null!=s&&s<=s?i[Ue(e,s,0,r)]:t}return s.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,i.length-1),s):e.slice()},s.range=function(t){return arguments.length?(i=Array.from(t),r=Math.min(e.length,i.length-1),s):i.slice()},s.invertExtent=function(t){var r=i.indexOf(t);return[e[r-1],e[r]]},s.unknown=function(e){return arguments.length?(t=e,s):t},s.copy=function(){return hr().domain(e).range(i).unknown(t)},je.apply(s,arguments)}er=nr({thousands:",",grouping:[3],currency:["$",""]}),ir=er.format,rr=er.formatPrefix;const cr={BrewerYlGn3:["#f7fcb9","#addd8e","#31a354"],BrewerYlGn4:["#ffffcc","#c2e699","#78c679","#238443"],BrewerYlGn5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],BrewerYlGn6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],BrewerYlGn7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],BrewerYlGn8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],BrewerYlGn9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],BrewerYlGnBu3:["#edf8b1","#7fcdbb","#2c7fb8"],BrewerYlGnBu4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],BrewerYlGnBu5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],BrewerYlGnBu6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],BrewerYlGnBu7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],BrewerYlGnBu8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],BrewerYlGnBu9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],BrewerGnBu3:["#e0f3db","#a8ddb5","#43a2ca"],BrewerGnBu4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],BrewerGnBu5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],BrewerGnBu6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],BrewerGnBu7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],BrewerGnBu8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],BrewerGnBu9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BrewerBuGn3:["#e5f5f9","#99d8c9","#2ca25f"],BrewerBuGn4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],BrewerBuGn5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],BrewerBuGn6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],BrewerBuGn7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],BrewerBuGn8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],BrewerBuGn9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],BrewerPuBuGn3:["#ece2f0","#a6bddb","#1c9099"],BrewerPuBuGn4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],BrewerPuBuGn5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],BrewerPuBuGn6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],BrewerPuBuGn7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],BrewerPuBuGn8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],BrewerPuBuGn9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],BrewerPuBu3:["#ece7f2","#a6bddb","#2b8cbe"],BrewerPuBu4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],BrewerPuBu5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],BrewerPuBu6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],BrewerPuBu7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],BrewerPuBu8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],BrewerPuBu9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BrewerBuPu3:["#e0ecf4","#9ebcda","#8856a7"],BrewerBuPu4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],BrewerBuPu5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],BrewerBuPu6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],BrewerBuPu7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],BrewerBuPu8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],BrewerBuPu9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],BrewerRdPu3:["#fde0dd","#fa9fb5","#c51b8a"],BrewerRdPu4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],BrewerRdPu5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],BrewerRdPu6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],BrewerRdPu7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],BrewerRdPu8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],BrewerRdPu9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],BrewerPuRd3:["#e7e1ef","#c994c7","#dd1c77"],BrewerPuRd4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],BrewerPuRd5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],BrewerPuRd6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],BrewerPuRd7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],BrewerPuRd8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],BrewerPuRd9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],BrewerOrRd3:["#fee8c8","#fdbb84","#e34a33"],BrewerOrRd4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],BrewerOrRd5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],BrewerOrRd6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],BrewerOrRd7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],BrewerOrRd8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],BrewerOrRd9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],BrewerYlOrRd3:["#ffeda0","#feb24c","#f03b20"],BrewerYlOrRd4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],BrewerYlOrRd5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],BrewerYlOrRd6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],BrewerYlOrRd7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],BrewerYlOrRd8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],BrewerYlOrRd9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],BrewerYlOrBr3:["#fff7bc","#fec44f","#d95f0e"],BrewerYlOrBr4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],BrewerYlOrBr5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],BrewerYlOrBr6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],BrewerYlOrBr7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],BrewerYlOrBr8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],BrewerYlOrBr9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],BrewerPurples3:["#efedf5","#bcbddc","#756bb1"],BrewerPurples4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],BrewerPurples5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],BrewerPurples6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],BrewerPurples7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],BrewerPurples8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],BrewerPurples9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],BrewerBlues3:["#deebf7","#9ecae1","#3182bd"],BrewerBlues4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],BrewerBlues5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],BrewerBlues6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],BrewerBlues7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],BrewerBlues8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],BrewerBlues9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],BrewerGreens3:["#e5f5e0","#a1d99b","#31a354"],BrewerGreens4:["#edf8e9","#bae4b3","#74c476","#238b45"],BrewerGreens5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],BrewerGreens6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],BrewerGreens7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],BrewerGreens8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],BrewerGreens9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],BrewerOranges3:["#fee6ce","#fdae6b","#e6550d"],BrewerOranges4:["#feedde","#fdbe85","#fd8d3c","#d94701"],BrewerOranges5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],BrewerOranges6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],BrewerOranges7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],BrewerOranges8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],BrewerOranges9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BrewerReds3:["#fee0d2","#fc9272","#de2d26"],BrewerReds4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],BrewerReds5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],BrewerReds6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],BrewerReds7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],BrewerReds8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],BrewerReds9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],BrewerGreys3:["#f0f0f0","#bdbdbd","#636363"],BrewerGreys4:["#f7f7f7","#cccccc","#969696","#525252"],BrewerGreys5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],BrewerGreys6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],BrewerGreys7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],BrewerGreys8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],BrewerGreys9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],BrewerPuOr3:["#f1a340","#f7f7f7","#998ec3"],BrewerPuOr4:["#e66101","#fdb863","#b2abd2","#5e3c99"],BrewerPuOr5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],BrewerPuOr6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],BrewerPuOr7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],BrewerPuOr8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],BrewerPuOr9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],BrewerPuOr10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrewerPuOr11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrewerBrBG3:["#d8b365","#f5f5f5","#5ab4ac"],BrewerBrBG4:["#a6611a","#dfc27d","#80cdc1","#018571"],BrewerBrBG5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],BrewerBrBG6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],BrewerBrBG7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],BrewerBrBG8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],BrewerBrBG9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],BrewerBrBG10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],BrewerBrBG11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],BrewerPRGn3:["#af8dc3","#f7f7f7","#7fbf7b"],BrewerPRGn4:["#7b3294","#c2a5cf","#a6dba0","#008837"],BrewerPRGn5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],BrewerPRGn6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],BrewerPRGn7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],BrewerPRGn8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],BrewerPRGn9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],BrewerPRGn10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],BrewerPRGn11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],BrewerPiYG3:["#e9a3c9","#f7f7f7","#a1d76a"],BrewerPiYG4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],BrewerPiYG5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],BrewerPiYG6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],BrewerPiYG7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],BrewerPiYG8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],BrewerPiYG9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],BrewerPiYG10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],BrewerPiYG11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],BrewerRdBu3:["#ef8a62","#f7f7f7","#67a9cf"],BrewerRdBu4:["#ca0020","#f4a582","#92c5de","#0571b0"],BrewerRdBu5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],BrewerRdBu6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],BrewerRdBu7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],BrewerRdBu8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],BrewerRdBu9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],BrewerRdBu10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],BrewerRdBu11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],BrewerRdGy3:["#ef8a62","#ffffff","#999999"],BrewerRdGy4:["#ca0020","#f4a582","#bababa","#404040"],BrewerRdGy5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],BrewerRdGy6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],BrewerRdGy7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],BrewerRdGy8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],BrewerRdGy9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],BrewerRdGy10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],BrewerRdGy11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],BrewerRdYlBu3:["#fc8d59","#ffffbf","#91bfdb"],BrewerRdYlBu4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],BrewerRdYlBu5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],BrewerRdYlBu6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],BrewerRdYlBu7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],BrewerRdYlBu8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],BrewerRdYlBu9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],BrewerRdYlBu10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrewerRdYlBu11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrewerSpectral3:["#fc8d59","#ffffbf","#99d594"],BrewerSpectral4:["#d7191c","#fdae61","#abdda4","#2b83ba"],BrewerSpectral5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],BrewerSpectral6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],BrewerSpectral7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],BrewerSpectral8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],BrewerSpectral9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],BrewerSpectral10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],BrewerSpectral11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],BrewerRdYlGn3:["#fc8d59","#ffffbf","#91cf60"],BrewerRdYlGn4:["#d7191c","#fdae61","#a6d96a","#1a9641"],BrewerRdYlGn5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],BrewerRdYlGn6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],BrewerRdYlGn7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],BrewerRdYlGn8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],BrewerRdYlGn9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],BrewerRdYlGn10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],BrewerRdYlGn11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],BrewerAccent3:["#7fc97f","#beaed4","#fdc086"],BrewerAccent4:["#7fc97f","#beaed4","#fdc086","#ffff99"],BrewerAccent5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],BrewerAccent6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],BrewerAccent7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],BrewerAccent8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],BrewerDark23:["#1b9e77","#d95f02","#7570b3"],BrewerDark24:["#1b9e77","#d95f02","#7570b3","#e7298a"],BrewerDark25:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],BrewerDark26:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],BrewerDark27:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],BrewerDark28:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],BrewerPaired3:["#a6cee3","#1f78b4","#b2df8a"],BrewerPaired4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],BrewerPaired5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],BrewerPaired6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],BrewerPaired7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],BrewerPaired8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],BrewerPaired9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],BrewerPaired10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],BrewerPaired11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],BrewerPaired12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],BrewerPastel13:["#fbb4ae","#b3cde3","#ccebc5"],BrewerPastel14:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],BrewerPastel15:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],BrewerPastel16:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],BrewerPastel17:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],BrewerPastel18:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],BrewerPastel19:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"],BrewerPastel23:["#b3e2cd","#fdcdac","#cbd5e8"],BrewerPastel24:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],BrewerPastel25:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],BrewerPastel26:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],BrewerPastel27:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],BrewerPastel28:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],BrewerSet13:["#e41a1c","#377eb8","#4daf4a"],BrewerSet14:["#e41a1c","#377eb8","#4daf4a","#984ea3"],BrewerSet15:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],BrewerSet16:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],BrewerSet17:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],BrewerSet18:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],BrewerSet19:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],BrewerSet23:["#66c2a5","#fc8d62","#8da0cb"],BrewerSet24:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],BrewerSet25:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],BrewerSet26:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],BrewerSet27:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],BrewerSet28:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],BrewerSet33:["#8dd3c7","#ffffb3","#bebada"],BrewerSet34:["#8dd3c7","#ffffb3","#bebada","#fb8072"],BrewerSet35:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],BrewerSet36:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],BrewerSet37:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],BrewerSet38:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],BrewerSet39:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],BrewerSet310:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],BrewerSet311:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],BrewerSet312:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],CartoBurg:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],CartoBurgYl:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],CartoRedOr:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],CartoOrYel:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],CartoPeach:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],CartoPinkYl:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],CartoMint:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],CartoBluGrn:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],CartoDarkMint:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],CartoEmrld:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],CartoBluYl:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],CartoTeal:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],CartoTealGrn:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],CartoPurp:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],CartoPurpOr:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],CartoSunset:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],CartoMagenta:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],CartoSunsetDark:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],CartoBrwnYl:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],CartoArmyRose:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],CartoFall:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],CartoGeyser:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],CartoTemps:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],CartoTealRose:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],CartoTropic:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],CartoEarth:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"]},ur=Object.keys(cr);const fr=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,dr=t=>{const e=fr.exec(t);if(null!==e)return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];throw new Error(`Cannot parse hex color "${t}"`)},gr=({colorScheme:t,customColors:e,min:i,max:r,isReverse:s=false,isContinuous:o=false})=>{let n;if(t){if(a=t,!ur.includes(a))throw new Error(`"${t}" is not a supported color scheme`);n=cr[t]}else{if(!(e&&e.length>=2))throw new Error("You must provide a colorScheme or an array of at least 2 customColors");n=e}var a;const l=n.map(dr),A=s?l.reverse():l;if(o){const t=((t,e,i)=>Array.from({length:i},((r,s)=>t+s*(e-t)/(i-1))))(i,r,A.length);return Ar(t,A).clamp(true)}{const t=((t,e,i)=>Array.from({length:i-1},((r,s)=>t+(s+1)*(e-t)/i)))(i,r,A.length);return hr(t,A)}},pr=256,mr=65536,wr=t=>t.length/mr;var Ir;!function(t){t[t.WhiteIsZero=0]="WhiteIsZero",t[t.BlackIsZero=1]="BlackIsZero",t[t.RGB=2]="RGB",t[t.Palette=3]="Palette",t[t.TransparencyMask=4]="TransparencyMask",t[t.CMYK=5]="CMYK",t[t.YCbCr=6]="YCbCr",t[t.CIELab=8]="CIELab",t[t.ICCLab=9]="ICCLab"}(Ir||(Ir={}));const vr=(t,{noData:e,photometricInterpretation:i,bitsPerSample:r,colorMap:s})=>{const o=r&&r[0]?2**r[0]:NaN,n=e??0;let a;switch(i){case Ir.WhiteIsZero:a=function(t,e,i){const r=new Uint8ClampedArray(262144),s=wr(t);let o;for(let n=0;n<mr;n++)o=255-t[n*s]/e*255,r[4*n]=o,r[4*n+1]=o,r[4*n+2]=o,r[4*n+3]=t[n*s]===i?0:255;return r}(t,o,n);break;case Ir.BlackIsZero:a=function(t,e,i){const r=new Uint8ClampedArray(262144),s=wr(t);let o;for(let n=0;n<mr;n++)o=t[n*s]/e*255,r[4*n]=o,r[4*n+1]=o,r[4*n+2]=o,r[4*n+3]=t[n*s]===i?0:255;return r}(t,o,n);break;case Ir.RGB:a=function(t,e){const i=new Uint8ClampedArray(262144),r=wr(t);for(let s=0;s<mr;s++)i[4*s]=t[s*r],i[4*s+1]=t[s*r+1],i[4*s+2]=t[s*r+2],i[4*s+3]=t[s*r]===e&&t[s*r+1]===e&&t[s*r+2]===e?0:255;return i}(t,n);break;case Ir.Palette:if(!s)throw new Error("colorMap for paletted image not found.");a=function(t,e,i){const r=new Uint8ClampedArray(262144),s=wr(t),o=e.length/3,n=e.length/3*2;for(let a=0;a<mr;a++){const l=t[a*s];r[4*a]=e[l]/65536*256,r[4*a+1]=e[l+o]/65536*256,r[4*a+2]=e[l+n]/65536*256,r[4*a+3]=t[a*s]===i?0:255}return r}(t,s,n);break;case Ir.CMYK:a=function(t,e){const i=new Uint8ClampedArray(262144),r=wr(t);for(let s=0;s<t.length;s++){const o=t[s*r],n=t[s*r+1],a=t[s*r+2],l=t[s*r+3];i[4*s]=(255-o)/256*255*((255-l)/256),i[4*s+1]=(255-n)/256*255*((255-l)/256),i[4*s+2]=(255-a)/256*255*((255-l)/256),i[4*s+3]=o===e&&n===e&&a===e&&l===e?0:255}return i}(t,n);break;case Ir.YCbCr:a=function(t,e){const i=new Uint8ClampedArray(262144),r=wr(t);for(let s=0;s<mr;s++){const o=t[s*r],n=t[s*r+1],a=t[s*r+2];i[4*s]=o+1.402*(a-128),i[4*s+1]=o-.34414*(n-128)-.71414*(a-128),i[4*s+2]=o+1.772*(n-128),i[4*s+3]=o===e&&n==e&&a==e?0:255}return i}(t,n);break;case Ir.CIELab:a=function(t,e){const i=new Uint8ClampedArray(mr),r=wr(t);for(let s=0;s<t.length;s++){const o=t[s*r],n=t[s*r+1]<<24>>24,a=t[s*r+2]<<24>>24;let l,A,h,c=(o+16)/116,u=n/500+c,f=c-a/200;u=.95047*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),c=1*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),f=1.08883*(f*f*f>.008856?f*f*f:(f-16/116)/7.787),l=3.2406*u+-1.5372*c+-.4986*f,A=-.9689*u+1.8758*c+.0415*f,h=.0557*u+-.204*c+1.057*f,l=l>.0031308?1.055*l**(1/2.4)-.055:12.92*l,A=A>.0031308?1.055*A**(1/2.4)-.055:12.92*A,h=h>.0031308?1.055*h**(1/2.4)-.055:12.92*h,i[4*s]=255*Math.max(0,Math.min(1,l)),i[4*s+1]=255*Math.max(0,Math.min(1,A)),i[4*s+2]=255*Math.max(0,Math.min(1,h)),i[4*s+3]=o===e&&n==e&&a==e?0:255}return i}(t,n);break;default:throw new Error("Unsupported photometric interpretation.")}return a},br={};var yr=t=>br[t],Br=(t,e)=>{br[t]=e};const Cr=async t=>{const e=new RegExp(/cog:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),i=t.match(e);if(!i)throw new Error(`Invalid COG protocol URL '${t}'`);const r=i[1].split("#"),s=r[0];r.shift();const o=r.join("#")??"",n=parseInt(i[2]),a=parseInt(i[3]),l=parseInt(i[4]),A=Ge(s),h=await A.getRawTile({z:n,x:a,y:l}),c=await A.getMetadata();let u;const f=yr(s);if(void 0!==f)u=f(h,c);else if(o.startsWith("dem"))u=((t,{offset:e,scale:i,noData:r})=>{const s=65536,o=t.length/s,n=new Uint8ClampedArray(262144);for(let a=0;a<s;a++){const s=e+t[a*o]*i,l=((s==r?0:s)- -1e4)/.1;n[4*a]=Math.floor(l/256/256)%256,n[4*a+1]=Math.floor(l/256)%256,n[4*a+2]=l%256,n[4*a+3]=255}return n})(h,c);else if(o.startsWith("color")){const t=o.split("color").pop()?.substring(1);if(!t)throw new Error("Color params are not defined");{const e=t.match(/\[("#([0-9a-fA-F]{3,6})"(,(\s)?)?)+]/)?.[0];let i,r,s,o="",n=[];e?(n=JSON.parse(e),[i,r,s]=t.replace(`${e},`,"").split(",")):[o,i,r,s]=t.split(",");const a=parseFloat(i),l=parseFloat(r),A=s?.includes("-")||false,f=s?.includes("c")||false;u=((t,{offset:e,scale:i,noData:r,colorScale:s})=>{const o=65536,n=t.length/o,a=new Uint8ClampedArray(262144),l=gr(s);for(let s=0;s<o;s++){const o=e+t[s*n]*i;if(o===r||isNaN(o)||o===1/0)a[4*s]=0,a[4*s+1]=0,a[4*s+2]=0,a[4*s+3]=0;else{const t=l(o);a[4*s]=t[0],a[4*s+1]=t[1],a[4*s+2]=t[2],a[4*s+3]=255}}return a})(h,{...c,colorScale:{colorScheme:o,customColors:n,min:a,max:l,isReverse:A,isContinuous:f}})}}else u=vr(h,c);return await createImageBitmap(new ImageData(u,pr,pr))};var Er=Object.freeze({__proto__:null,default:class extends pe{decodeBlock(t){return t}}});const _r=257;function Qr(t,e){for(let i=e.length-1;i>=0;i--)t.push(e[i]);return t}function xr(t){const e=new Uint16Array(4093),i=new Uint8Array(4093);for(let t=0;t<=257;t++)e[t]=4096,i[t]=t;let r=258,s=9,o=0;function n(){r=258,s=9}function a(t){const e=function(t,e,i){const r=e%8,s=Math.floor(e/8),o=8-r,n=e+i-8*(s+1);let a=8*(s+2)-(e+i);const l=8*(s+2)-e;if(a=Math.max(0,a),s>=t.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),_r;let A=t[s]&2**(8-r)-1;A<<=i-o;let h=A;if(s+1<t.length){let e=t[s+1]>>>a;e<<=Math.max(0,i-l),h+=e}if(n>8&&s+2<t.length){const r=8*(s+3)-(e+i);h+=t[s+2]>>>r}return h}(t,o,s);return o+=s,e}function l(t,s){return i[r]=s,e[r]=t,r++,r-1}function A(t){const r=[];for(let s=t;4096!==s;s=e[s])r.push(i[s]);return r}const h=[];n();const c=new Uint8Array(t);let u,f=a(c);for(;f!==_r;){if(256===f){for(n(),f=a(c);256===f;)f=a(c);if(f===_r)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);Qr(h,A(f)),u=f}else if(f<r){const t=A(f);Qr(h,t),l(u,t[t.length-1]),u=f}else{const t=A(u);if(!t)throw new Error(`Bogus entry. Not in dictionary, ${u} / ${r}, position: ${o}`);Qr(h,t),h.push(t[t.length-1]),l(u,t[t.length-1]),u=f}r+1>=2**s&&(12===s?u=void 0:s++),f=a(c)}return new Uint8Array(h)}var Mr=Object.freeze({__proto__:null,default:class extends pe{decodeBlock(t){return xr(t).buffer}}});const kr=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Dr=4017,Sr=799,Gr=3406,Fr=2276,Rr=1567,Lr=3784,zr=5793,Ur=2896;function Pr(t,e){let i=0;const r=[];let s=16;for(;s>0&&!t[s-1];)--s;r.push({children:[],index:0});let o,n=r[0];for(let a=0;a<s;a++){for(let s=0;s<t[a];s++){for(n=r.pop(),n.children[n.index]=e[i];n.index>0;)n=r.pop();for(n.index++,r.push(n);r.length<=a;)r.push(o={children:[],index:0}),n.children[n.index]=o.children,n=o;i++}a+1<s&&(r.push(o={children:[],index:0}),n.children[n.index]=o.children,n=o)}return r[0].children}function Nr(t,e,i,r,s,o,n,a,l){const{mcusPerLine:A,progressive:h}=i,c=e;let u=e,f=0,d=0;function g(){if(d>0)return d--,f>>d&1;if(f=t[u++],255===f){const e=t[u++];if(e)throw new Error(`unexpected marker: ${(f<<8|e).toString(16)}`)}return d=7,f>>>7}function p(t){let e,i=t;for(;null!==(e=g());){if(i=i[e],"number"==typeof i)return i;if("object"!=typeof i)throw new Error("invalid huffman sequence")}return null}function m(t){let e=t,i=0;for(;e>0;){const t=g();if(null===t)return;i=i<<1|t,--e}return i}function w(t){const e=m(t);return e>=1<<t-1?e:e+(-1<<t)+1}let I=0;let v,b=0;function y(t,e,i,r,s){const o=i%A,n=(i/A|0)*t.v+r,a=o*t.h+s;e(t,t.blocks[n][a])}function B(t,e,i){const r=i/t.blocksPerLine|0,s=i%t.blocksPerLine;e(t,t.blocks[r][s])}const C=r.length;let E,_,Q,x,M,k;k=h?0===o?0===a?function(t,e){const i=p(t.huffmanTableDC),r=0===i?0:w(i)<<l;t.pred+=r,e[0]=t.pred}:function(t,e){e[0]|=g()<<l}:0===a?function(t,e){if(I>0)return void I--;let i=o;const r=n;for(;i<=r;){const r=p(t.huffmanTableAC),s=15&r,o=r>>4;if(0===s){if(o<15){I=m(o)+(1<<o)-1;break}i+=16}else i+=o,e[kr[i]]=w(s)*(1<<l),i++}}:function(t,e){let i=o;const r=n;let s=0;for(;i<=r;){const r=kr[i],o=e[r]<0?-1:1;switch(b){case 0:{const e=p(t.huffmanTableAC),i=15&e;if(s=e>>4,0===i)s<15?(I=m(s)+(1<<s),b=4):(s=16,b=1);else{if(1!==i)throw new Error("invalid ACn encoding");v=w(i),b=s?2:3}continue}case 1:case 2:e[r]?e[r]+=(g()<<l)*o:(s--,0===s&&(b=2===b?3:0));break;case 3:e[r]?e[r]+=(g()<<l)*o:(e[r]=v<<l,b=0);break;case 4:e[r]&&(e[r]+=(g()<<l)*o)}i++}4===b&&(I--,0===I&&(b=0))}:function(t,e){const i=p(t.huffmanTableDC),r=0===i?0:w(i);t.pred+=r,e[0]=t.pred;let s=1;for(;s<64;){const i=p(t.huffmanTableAC),r=15&i,o=i>>4;if(0===r){if(o<15)break;s+=16}else s+=o,e[kr[s]]=w(r),s++}};let D,S,G=0;S=1===C?r[0].blocksPerLine*r[0].blocksPerColumn:A*i.mcusPerColumn;const F=s||S;for(;G<S;){for(_=0;_<C;_++)r[_].pred=0;if(I=0,1===C)for(E=r[0],M=0;M<F;M++)B(E,k,G),G++;else for(M=0;M<F;M++){for(_=0;_<C;_++){E=r[_];const{h:t,v:e}=E;for(Q=0;Q<e;Q++)for(x=0;x<t;x++)y(E,k,G,Q,x)}if(G++,G===S)break}if(d=0,D=t[u]<<8|t[u+1],D<65280)throw new Error("marker was not found");if(!(D>=65488&&D<=65495))break;u+=2}return u-c}function Tr(t,e){const i=[],{blocksPerLine:r,blocksPerColumn:s}=e,o=r<<3,n=new Int32Array(64),a=new Uint8Array(64);function l(t,i,r){const s=e.quantizationTable;let o,n,a,l,A,h,c,u,f;const d=r;let g;for(g=0;g<64;g++)d[g]=t[g]*s[g];for(g=0;g<8;++g){const t=8*g;0!==d[1+t]||0!==d[2+t]||0!==d[3+t]||0!==d[4+t]||0!==d[5+t]||0!==d[6+t]||0!==d[7+t]?(o=zr*d[0+t]+128>>8,n=zr*d[4+t]+128>>8,a=d[2+t],l=d[6+t],A=Ur*(d[1+t]-d[7+t])+128>>8,u=Ur*(d[1+t]+d[7+t])+128>>8,h=d[3+t]<<4,c=d[5+t]<<4,f=o-n+1>>1,o=o+n+1>>1,n=f,f=a*Lr+l*Rr+128>>8,a=a*Rr-l*Lr+128>>8,l=f,f=A-c+1>>1,A=A+c+1>>1,c=f,f=u+h+1>>1,h=u-h+1>>1,u=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=n-a+1>>1,n=n+a+1>>1,a=f,f=A*Fr+u*Gr+2048>>12,A=A*Gr-u*Fr+2048>>12,u=f,f=h*Sr+c*Dr+2048>>12,h=h*Dr-c*Sr+2048>>12,c=f,d[0+t]=o+u,d[7+t]=o-u,d[1+t]=n+c,d[6+t]=n-c,d[2+t]=a+h,d[5+t]=a-h,d[3+t]=l+A,d[4+t]=l-A):(f=zr*d[0+t]+512>>10,d[0+t]=f,d[1+t]=f,d[2+t]=f,d[3+t]=f,d[4+t]=f,d[5+t]=f,d[6+t]=f,d[7+t]=f)}for(g=0;g<8;++g){const t=g;0!==d[8+t]||0!==d[16+t]||0!==d[24+t]||0!==d[32+t]||0!==d[40+t]||0!==d[48+t]||0!==d[56+t]?(o=zr*d[0+t]+2048>>12,n=zr*d[32+t]+2048>>12,a=d[16+t],l=d[48+t],A=Ur*(d[8+t]-d[56+t])+2048>>12,u=Ur*(d[8+t]+d[56+t])+2048>>12,h=d[24+t],c=d[40+t],f=o-n+1>>1,o=o+n+1>>1,n=f,f=a*Lr+l*Rr+2048>>12,a=a*Rr-l*Lr+2048>>12,l=f,f=A-c+1>>1,A=A+c+1>>1,c=f,f=u+h+1>>1,h=u-h+1>>1,u=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=n-a+1>>1,n=n+a+1>>1,a=f,f=A*Fr+u*Gr+2048>>12,A=A*Gr-u*Fr+2048>>12,u=f,f=h*Sr+c*Dr+2048>>12,h=h*Dr-c*Sr+2048>>12,c=f,d[0+t]=o+u,d[56+t]=o-u,d[8+t]=n+c,d[48+t]=n-c,d[16+t]=a+h,d[40+t]=a-h,d[24+t]=l+A,d[32+t]=l-A):(f=zr*r[g+0]+8192>>14,d[0+t]=f,d[8+t]=f,d[16+t]=f,d[24+t]=f,d[32+t]=f,d[40+t]=f,d[48+t]=f,d[56+t]=f)}for(g=0;g<64;++g){const t=128+(d[g]+8>>4);i[g]=t<0?0:t>255?255:t}}for(let t=0;t<s;t++){const s=t<<3;for(let t=0;t<8;t++)i.push(new Uint8Array(o));for(let o=0;o<r;o++){l(e.blocks[t][o],a,n);let r=0;const A=o<<3;for(let t=0;t<8;t++){const e=i[s+t];for(let t=0;t<8;t++)e[A+t]=a[r++]}}}return i}class qr{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(t){let e=0;function i(){const i=t[e]<<8|t[e+1];return e+=2,i}function r(){const r=i(),s=t.subarray(e,e+r-2);return e+=s.length,s}function s(t){let e,i,r=0,s=0;for(i in t.components)t.components.hasOwnProperty(i)&&(e=t.components[i],r<e.h&&(r=e.h),s<e.v&&(s=e.v));const o=Math.ceil(t.samplesPerLine/8/r),n=Math.ceil(t.scanLines/8/s);for(i in t.components)if(t.components.hasOwnProperty(i)){e=t.components[i];const a=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/r),l=Math.ceil(Math.ceil(t.scanLines/8)*e.v/s),A=o*e.h,h=n*e.v,c=[];for(let t=0;t<h;t++){const t=[];for(let e=0;e<A;e++)t.push(new Int32Array(64));c.push(t)}e.blocksPerLine=a,e.blocksPerColumn=l,e.blocks=c}t.maxH=r,t.maxV=s,t.mcusPerLine=o,t.mcusPerColumn=n}let o=i();if(65496!==o)throw new Error("SOI not found");for(o=i();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const t=r();65504===o&&74===t[0]&&70===t[1]&&73===t[2]&&70===t[3]&&0===t[4]&&(this.jfif={version:{major:t[5],minor:t[6]},densityUnits:t[7],xDensity:t[8]<<8|t[9],yDensity:t[10]<<8|t[11],thumbWidth:t[12],thumbHeight:t[13],thumbData:t.subarray(14,14+3*t[12]*t[13])}),65518===o&&65===t[0]&&100===t[1]&&111===t[2]&&98===t[3]&&101===t[4]&&0===t[5]&&(this.adobe={version:t[6],flags0:t[7]<<8|t[8],flags1:t[9]<<8|t[10],transformCode:t[11]});break}case 65499:{const r=i()+e-2;for(;e<r;){const r=t[e++],s=new Int32Array(64);if(r>>4){if(r>>4!=1)throw new Error("DQT: invalid table spec");for(let t=0;t<64;t++){s[kr[t]]=i()}}else for(let i=0;i<64;i++){s[kr[i]]=t[e++]}this.quantizationTables[15&r]=s}break}case 65472:case 65473:case 65474:{i();const r={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:i(),samplesPerLine:i(),components:{},componentsOrder:[]},n=t[e++];let a;for(let i=0;i<n;i++){a=t[e];const i=t[e+1]>>4,s=15&t[e+1],o=t[e+2];r.componentsOrder.push(a),r.components[a]={h:i,v:s,quantizationIdx:o},e+=3}s(r),this.frames.push(r);break}case 65476:{const r=i();for(let i=2;i<r;){const r=t[e++],s=new Uint8Array(16);let o=0;for(let i=0;i<16;i++,e++)s[i]=t[e],o+=s[i];const n=new Uint8Array(o);for(let i=0;i<o;i++,e++)n[i]=t[e];i+=17+o,r>>4?this.huffmanTablesAC[15&r]=Pr(s,n):this.huffmanTablesDC[15&r]=Pr(s,n)}break}case 65501:i(),this.resetInterval=i();break;case 65498:{i();const r=t[e++],s=[],o=this.frames[0];for(let i=0;i<r;i++){const i=o.components[t[e++]],r=t[e++];i.huffmanTableDC=this.huffmanTablesDC[r>>4],i.huffmanTableAC=this.huffmanTablesAC[15&r],s.push(i)}const n=t[e++],a=t[e++],l=t[e++],A=Nr(t,e,o,s,this.resetInterval,n,a,l>>4,15&l);e+=A;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=i()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let t=0;t<this.frames.length;t++){const e=this.frames[t].components;for(const t of Object.keys(e))e[t].quantizationTable=this.quantizationTables[e[t].quantizationIdx],delete e[t].quantizationIdx}const e=t[0],{components:i,componentsOrder:r}=e,s=[],o=e.samplesPerLine,n=e.scanLines;for(let t=0;t<r.length;t++){const o=i[r[t]];s.push({lines:Tr(0,o),scaleX:o.h/e.maxH,scaleY:o.v/e.maxV})}const a=new Uint8Array(o*n*s.length);let l=0;for(let t=0;t<n;++t)for(let e=0;e<o;++e)for(let i=0;i<s.length;++i){const r=s[i];a[l]=r.lines[0|t*r.scaleY][0|e*r.scaleX],++l}return a}}var Or=Object.freeze({__proto__:null,default:class extends pe{constructor(t){super(),this.reader=new qr,t.JPEGTables&&this.reader.parse(t.JPEGTables)}decodeBlock(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}});
766
+ /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function jr(t){let e=t.length;for(;--e>=0;)t[e]=0}const Jr=30,Hr=new Array(576);jr(Hr);const Yr=new Array(60);jr(Yr);const $r=new Array(512);jr($r);const Vr=new Array(256);jr(Vr);const Kr=new Array(29);jr(Kr);const Zr=new Array(Jr);jr(Zr);var Wr=(t,e,i,r)=>{let s=65535&t,o=t>>>16&65535,n=0;for(;0!==i;){n=i>2e3?2e3:i,i-=n;do{s=s+e[r++]|0,o=o+s|0}while(--n);s%=65521,o%=65521}return s|o<<16};const Xr=new Uint32Array((()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e})());var ts=(t,e,i,r)=>{const s=Xr,o=r+i;t^=-1;for(let i=r;i<o;i++)t=t>>>8^s[255&(t^e[i])];return~t},es={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},is={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const rs=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var ss={assign:function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)rs(i,e)&&(t[e]=i[e])}}return t},flattenChunks:t=>{let e=0;for(let i=0,r=t.length;i<r;i++)e+=t[i].length;const i=new Uint8Array(e);for(let e=0,r=0,s=t.length;e<s;e++){let s=t[e];i.set(s,r),r+=s.length}return i}};let os=true;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){os=false}const ns=new Uint8Array(256);for(let t=0;t<256;t++)ns[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;ns[254]=ns[254]=1;var as={string2buf:t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,i,r,s,o,n=t.length,a=0;for(s=0;s<n;s++)i=t.charCodeAt(s),55296==(64512&i)&&s+1<n&&(r=t.charCodeAt(s+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),s++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(a),o=0,s=0;o<a;s++)i=t.charCodeAt(s),55296==(64512&i)&&s+1<n&&(r=t.charCodeAt(s+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),s++)),i<128?e[o++]=i:i<2048?(e[o++]=192|i>>>6,e[o++]=128|63&i):i<65536?(e[o++]=224|i>>>12,e[o++]=128|i>>>6&63,e[o++]=128|63&i):(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63,e[o++]=128|i>>>6&63,e[o++]=128|63&i);return e},buf2string:(t,e)=>{const i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let r,s;const o=new Array(2*i);for(s=0,r=0;r<i;){let e=t[r++];if(e<128){o[s++]=e;continue}let n=ns[e];if(n>4)o[s++]=65533,r+=n-1;else{for(e&=2===n?31:3===n?15:7;n>1&&r<i;)e=e<<6|63&t[r++],n--;n>1?o[s++]=65533:e<65536?o[s++]=e:(e-=65536,o[s++]=55296|e>>10&1023,o[s++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&os)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let r=0;r<e;r++)i+=String.fromCharCode(t[r]);return i})(o,s)},utf8border:(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+ns[t[i]]>e?i:e}};var ls=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const As=16209;var hs=function(t,e){let i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v,b,y,B,C,E;const _=t.state;i=t.next_in,C=t.input,r=i+(t.avail_in-5),s=t.next_out,E=t.output,o=s-(e-t.avail_out),n=s+(t.avail_out-257),a=_.dmax,l=_.wsize,A=_.whave,h=_.wnext,c=_.window,u=_.hold,f=_.bits,d=_.lencode,g=_.distcode,p=(1<<_.lenbits)-1,m=(1<<_.distbits)-1;t:do{f<15&&(u+=C[i++]<<f,f+=8,u+=C[i++]<<f,f+=8),w=d[u&p];e:for(;;){if(I=w>>>24,u>>>=I,f-=I,I=w>>>16&255,0===I)E[s++]=65535&w;else{if(!(16&I)){if(64&I){if(32&I){_.mode=16191;break t}t.msg="invalid literal/length code",_.mode=As;break t}w=d[(65535&w)+(u&(1<<I)-1)];continue e}for(v=65535&w,I&=15,I&&(f<I&&(u+=C[i++]<<f,f+=8),v+=u&(1<<I)-1,u>>>=I,f-=I),f<15&&(u+=C[i++]<<f,f+=8,u+=C[i++]<<f,f+=8),w=g[u&m];;){if(I=w>>>24,u>>>=I,f-=I,I=w>>>16&255,16&I){if(b=65535&w,I&=15,f<I&&(u+=C[i++]<<f,f+=8,f<I&&(u+=C[i++]<<f,f+=8)),b+=u&(1<<I)-1,b>a){t.msg="invalid distance too far back",_.mode=As;break t}if(u>>>=I,f-=I,I=s-o,b>I){if(I=b-I,I>A&&_.sane){t.msg="invalid distance too far back",_.mode=As;break t}if(y=0,B=c,0===h){if(y+=l-I,I<v){v-=I;do{E[s++]=c[y++]}while(--I);y=s-b,B=E}}else if(h<I){if(y+=l+h-I,I-=h,I<v){v-=I;do{E[s++]=c[y++]}while(--I);if(y=0,h<v){I=h,v-=I;do{E[s++]=c[y++]}while(--I);y=s-b,B=E}}}else if(y+=h-I,I<v){v-=I;do{E[s++]=c[y++]}while(--I);y=s-b,B=E}for(;v>2;)E[s++]=B[y++],E[s++]=B[y++],E[s++]=B[y++],v-=3;v&&(E[s++]=B[y++],v>1&&(E[s++]=B[y++]))}else{y=s-b;do{E[s++]=E[y++],E[s++]=E[y++],E[s++]=E[y++],v-=3}while(v>2);v&&(E[s++]=E[y++],v>1&&(E[s++]=E[y++]))}break}if(64&I){t.msg="invalid distance code",_.mode=As;break t}w=g[(65535&w)+(u&(1<<I)-1)]}}break}}while(i<r&&s<n);v=f>>3,i-=v,f-=v<<3,u&=(1<<f)-1,t.next_in=i,t.next_out=s,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=s<n?n-s+257:257-(s-n),_.hold=u,_.bits=f};const cs=15,us=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),fs=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ds=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),gs=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ps=(t,e,i,r,s,o,n,a)=>{const l=a.bits;let A,h,c,u,f,d,g=0,p=0,m=0,w=0,I=0,v=0,b=0,y=0,B=0,C=0,E=null;const _=new Uint16Array(16),Q=new Uint16Array(16);let x,M,k,D=null;for(g=0;g<=cs;g++)_[g]=0;for(p=0;p<r;p++)_[e[i+p]]++;for(I=l,w=cs;w>=1&&0===_[w];w--);if(I>w&&(I=w),0===w)return s[o++]=20971520,s[o++]=20971520,a.bits=1,0;for(m=1;m<w&&0===_[m];m++);for(I<m&&(I=m),y=1,g=1;g<=cs;g++)if(y<<=1,y-=_[g],y<0)return-1;if(y>0&&(0===t||1!==w))return-1;for(Q[1]=0,g=1;g<cs;g++)Q[g+1]=Q[g]+_[g];for(p=0;p<r;p++)0!==e[i+p]&&(n[Q[e[i+p]]++]=p);if(0===t?(E=D=n,d=20):1===t?(E=us,D=fs,d=257):(E=ds,D=gs,d=0),C=0,p=0,g=m,f=o,v=I,b=0,c=-1,B=1<<I,u=B-1,1===t&&B>852||2===t&&B>592)return 1;for(;;){x=g-b,n[p]+1<d?(M=0,k=n[p]):n[p]>=d?(M=D[n[p]-d],k=E[n[p]-d]):(M=96,k=0),A=1<<g-b,h=1<<v,m=h;do{h-=A,s[f+(C>>b)+h]=x<<24|M<<16|k}while(0!==h);for(A=1<<g-1;C&A;)A>>=1;if(0!==A?(C&=A-1,C+=A):C=0,p++,0==--_[g]){if(g===w)break;g=e[i+n[p]]}if(g>I&&(C&u)!==c){for(0===b&&(b=I),f+=m,v=g-b,y=1<<v;v+b<w&&(y-=_[v+b],!(y<=0));)v++,y<<=1;if(B+=1<<v,1===t&&B>852||2===t&&B>592)return 1;c=C&u,s[c]=I<<24|v<<16|f-o}}return 0!==C&&(s[f+C]=g-b<<24|64<<16),a.bits=I,0};const{Z_FINISH:ms,Z_BLOCK:ws,Z_TREES:Is,Z_OK:vs,Z_STREAM_END:bs,Z_NEED_DICT:ys,Z_STREAM_ERROR:Bs,Z_DATA_ERROR:Cs,Z_MEM_ERROR:Es,Z_BUF_ERROR:_s,Z_DEFLATED:Qs}=is,xs=16180,Ms=16190,ks=16191,Ds=16192,Ss=16194,Gs=16199,Fs=16200,Rs=16206,Ls=16209,zs=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Us(){this.strm=null,this.mode=0,this.last=false,this.wrap=0,this.havedict=false,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ps=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<xs||e.mode>16211?1:0},Ns=t=>{if(Ps(t))return Bs;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=xs,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,vs},Ts=t=>{if(Ps(t))return Bs;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ns(t)},qs=(t,e)=>{let i;if(Ps(t))return Bs;const r=t.state;return e<0?(i=0,e=-e):(i=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Bs:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,Ts(t))},Os=(t,e)=>{if(!t)return Bs;const i=new Us;t.state=i,i.strm=t,i.window=null,i.mode=xs;const r=qs(t,e);return r!==vs&&(t.state=null),r};let js,Js,Hs=true;const Ys=t=>{if(Hs){js=new Int32Array(512),Js=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ps(1,t.lens,0,288,js,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ps(2,t.lens,0,32,Js,0,t.work,{bits:5}),Hs=false}t.lencode=js,t.lenbits=9,t.distcode=Js,t.distbits=5},$s=(t,e,i,r)=>{let s;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(e.subarray(i-o.wsize,i),0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>r&&(s=r),o.window.set(e.subarray(i-r,i-r+s),o.wnext),(r-=s)?(o.window.set(e.subarray(i-r,i),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0};var Vs=(t,e)=>{let i,r,s,o,n,a,l,A,h,c,u,f,d,g,p,m,w,I,v,b,y,B,C=0;const E=new Uint8Array(4);let _,Q;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ps(t)||!t.output||!t.input&&0!==t.avail_in)return Bs;i=t.state,i.mode===ks&&(i.mode=Ds),n=t.next_out,s=t.output,l=t.avail_out,o=t.next_in,r=t.input,a=t.avail_in,A=i.hold,h=i.bits,c=a,u=l,B=vs;t:for(;;)switch(i.mode){case xs:if(0===i.wrap){i.mode=Ds;break}for(;h<16;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(2&i.wrap&&35615===A){0===i.wbits&&(i.wbits=15),i.check=0,E[0]=255&A,E[1]=A>>>8&255,i.check=ts(i.check,E,2,0),A=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=false),!(1&i.wrap)||(((255&A)<<8)+(A>>8))%31){t.msg="incorrect header check",i.mode=Ls;break}if((15&A)!==Qs){t.msg="unknown compression method",i.mode=Ls;break}if(A>>>=4,h-=4,y=8+(15&A),0===i.wbits&&(i.wbits=y),y>15||y>i.wbits){t.msg="invalid window size",i.mode=Ls;break}i.dmax=1<<i.wbits,i.flags=0,t.adler=i.check=1,i.mode=512&A?16189:ks,A=0,h=0;break;case 16181:for(;h<16;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(i.flags=A,(255&i.flags)!==Qs){t.msg="unknown compression method",i.mode=Ls;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=Ls;break}i.head&&(i.head.text=A>>8&1),512&i.flags&&4&i.wrap&&(E[0]=255&A,E[1]=A>>>8&255,i.check=ts(i.check,E,2,0)),A=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}i.head&&(i.head.time=A),512&i.flags&&4&i.wrap&&(E[0]=255&A,E[1]=A>>>8&255,E[2]=A>>>16&255,E[3]=A>>>24&255,i.check=ts(i.check,E,4,0)),A=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}i.head&&(i.head.xflags=255&A,i.head.os=A>>8),512&i.flags&&4&i.wrap&&(E[0]=255&A,E[1]=A>>>8&255,i.check=ts(i.check,E,2,0)),A=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}i.length=A,i.head&&(i.head.extra_len=A),512&i.flags&&4&i.wrap&&(E[0]=255&A,E[1]=A>>>8&255,i.check=ts(i.check,E,2,0)),A=0,h=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(f=i.length,f>a&&(f=a),f&&(i.head&&(y=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(o,o+f),y)),512&i.flags&&4&i.wrap&&(i.check=ts(i.check,r,f,o)),a-=f,o+=f,i.length-=f),i.length))break t;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===a)break t;f=0;do{y=r[o+f++],i.head&&y&&i.length<65536&&(i.head.name+=String.fromCharCode(y))}while(y&&f<a);if(512&i.flags&&4&i.wrap&&(i.check=ts(i.check,r,f,o)),a-=f,o+=f,y)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===a)break t;f=0;do{y=r[o+f++],i.head&&y&&i.length<65536&&(i.head.comment+=String.fromCharCode(y))}while(y&&f<a);if(512&i.flags&&4&i.wrap&&(i.check=ts(i.check,r,f,o)),a-=f,o+=f,y)break t}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(4&i.wrap&&A!==(65535&i.check)){t.msg="header crc mismatch",i.mode=Ls;break}A=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=true),t.adler=i.check=0,i.mode=ks;break;case 16189:for(;h<32;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}t.adler=i.check=zs(A),A=0,h=0,i.mode=Ms;case Ms:if(0===i.havedict)return t.next_out=n,t.avail_out=l,t.next_in=o,t.avail_in=a,i.hold=A,i.bits=h,ys;t.adler=i.check=1,i.mode=ks;case ks:if(e===ws||e===Is)break t;case Ds:if(i.last){A>>>=7&h,h-=7&h,i.mode=Rs;break}for(;h<3;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}switch(i.last=1&A,A>>>=1,h-=1,3&A){case 0:i.mode=16193;break;case 1:if(Ys(i),i.mode=Gs,e===Is){A>>>=2,h-=2;break t}break;case 2:i.mode=16196;break;case 3:t.msg="invalid block type",i.mode=Ls}A>>>=2,h-=2;break;case 16193:for(A>>>=7&h,h-=7&h;h<32;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if((65535&A)!=(A>>>16^65535)){t.msg="invalid stored block lengths",i.mode=Ls;break}if(i.length=65535&A,A=0,h=0,i.mode=Ss,e===Is)break t;case Ss:i.mode=16195;case 16195:if(f=i.length,f){if(f>a&&(f=a),f>l&&(f=l),0===f)break t;s.set(r.subarray(o,o+f),n),a-=f,o+=f,l-=f,n+=f,i.length-=f;break}i.mode=ks;break;case 16196:for(;h<14;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(i.nlen=257+(31&A),A>>>=5,h-=5,i.ndist=1+(31&A),A>>>=5,h-=5,i.ncode=4+(15&A),A>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=Ls;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}i.lens[x[i.have++]]=7&A,A>>>=3,h-=3}for(;i.have<19;)i.lens[x[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,_={bits:i.lenbits},B=ps(0,i.lens,0,19,i.lencode,0,i.work,_),i.lenbits=_.bits,B){t.msg="invalid code lengths set",i.mode=Ls;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;C=i.lencode[A&(1<<i.lenbits)-1],p=C>>>24,m=C>>>16&255,w=65535&C,!(p<=h);){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(w<16)A>>>=p,h-=p,i.lens[i.have++]=w;else{if(16===w){for(Q=p+2;h<Q;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(A>>>=p,h-=p,0===i.have){t.msg="invalid bit length repeat",i.mode=Ls;break}y=i.lens[i.have-1],f=3+(3&A),A>>>=2,h-=2}else if(17===w){for(Q=p+3;h<Q;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}A>>>=p,h-=p,y=0,f=3+(7&A),A>>>=3,h-=3}else{for(Q=p+7;h<Q;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}A>>>=p,h-=p,y=0,f=11+(127&A),A>>>=7,h-=7}if(i.have+f>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=Ls;break}for(;f--;)i.lens[i.have++]=y}}if(i.mode===Ls)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=Ls;break}if(i.lenbits=9,_={bits:i.lenbits},B=ps(1,i.lens,0,i.nlen,i.lencode,0,i.work,_),i.lenbits=_.bits,B){t.msg="invalid literal/lengths set",i.mode=Ls;break}if(i.distbits=6,i.distcode=i.distdyn,_={bits:i.distbits},B=ps(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,_),i.distbits=_.bits,B){t.msg="invalid distances set",i.mode=Ls;break}if(i.mode=Gs,e===Is)break t;case Gs:i.mode=Fs;case Fs:if(a>=6&&l>=258){t.next_out=n,t.avail_out=l,t.next_in=o,t.avail_in=a,i.hold=A,i.bits=h,hs(t,u),n=t.next_out,s=t.output,l=t.avail_out,o=t.next_in,r=t.input,a=t.avail_in,A=i.hold,h=i.bits,i.mode===ks&&(i.back=-1);break}for(i.back=0;C=i.lencode[A&(1<<i.lenbits)-1],p=C>>>24,m=C>>>16&255,w=65535&C,!(p<=h);){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(m&&!(240&m)){for(I=p,v=m,b=w;C=i.lencode[b+((A&(1<<I+v)-1)>>I)],p=C>>>24,m=C>>>16&255,w=65535&C,!(I+p<=h);){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}A>>>=I,h-=I,i.back+=I}if(A>>>=p,h-=p,i.back+=p,i.length=w,0===m){i.mode=16205;break}if(32&m){i.back=-1,i.mode=ks;break}if(64&m){t.msg="invalid literal/length code",i.mode=Ls;break}i.extra=15&m,i.mode=16201;case 16201:if(i.extra){for(Q=i.extra;h<Q;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}i.length+=A&(1<<i.extra)-1,A>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;C=i.distcode[A&(1<<i.distbits)-1],p=C>>>24,m=C>>>16&255,w=65535&C,!(p<=h);){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(!(240&m)){for(I=p,v=m,b=w;C=i.distcode[b+((A&(1<<I+v)-1)>>I)],p=C>>>24,m=C>>>16&255,w=65535&C,!(I+p<=h);){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}A>>>=I,h-=I,i.back+=I}if(A>>>=p,h-=p,i.back+=p,64&m){t.msg="invalid distance code",i.mode=Ls;break}i.offset=w,i.extra=15&m,i.mode=16203;case 16203:if(i.extra){for(Q=i.extra;h<Q;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}i.offset+=A&(1<<i.extra)-1,A>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=Ls;break}i.mode=16204;case 16204:if(0===l)break t;if(f=u-l,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=Ls;break}f>i.wnext?(f-=i.wnext,d=i.wsize-f):d=i.wnext-f,f>i.length&&(f=i.length),g=i.window}else g=s,d=n-i.offset,f=i.length;f>l&&(f=l),l-=f,i.length-=f;do{s[n++]=g[d++]}while(--f);0===i.length&&(i.mode=Fs);break;case 16205:if(0===l)break t;s[n++]=i.length,l--,i.mode=Fs;break;case Rs:if(i.wrap){for(;h<32;){if(0===a)break t;a--,A|=r[o++]<<h,h+=8}if(u-=l,t.total_out+=u,i.total+=u,4&i.wrap&&u&&(t.adler=i.check=i.flags?ts(i.check,s,u,n-u):Wr(i.check,s,u,n-u)),u=l,4&i.wrap&&(i.flags?A:zs(A))!==i.check){t.msg="incorrect data check",i.mode=Ls;break}A=0,h=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===a)break t;a--,A+=r[o++]<<h,h+=8}if(4&i.wrap&&A!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=Ls;break}A=0,h=0}i.mode=16208;case 16208:B=bs;break t;case Ls:B=Cs;break t;case 16210:return Es;default:return Bs}return t.next_out=n,t.avail_out=l,t.next_in=o,t.avail_in=a,i.hold=A,i.bits=h,(i.wsize||u!==t.avail_out&&i.mode<Ls&&(i.mode<Rs||e!==ms))&&$s(t,t.output,t.next_out,u-t.avail_out),c-=t.avail_in,u-=t.avail_out,t.total_in+=c,t.total_out+=u,i.total+=u,4&i.wrap&&u&&(t.adler=i.check=i.flags?ts(i.check,s,u,t.next_out-u):Wr(i.check,s,u,t.next_out-u)),t.data_type=i.bits+(i.last?64:0)+(i.mode===ks?128:0)+(i.mode===Gs||i.mode===Ss?256:0),(0===c&&0===u||e===ms)&&B===vs&&(B=_s),B},Ks={inflateReset:Ts,inflateReset2:qs,inflateResetKeep:Ns,inflateInit:t=>Os(t,15),inflateInit2:Os,inflate:Vs,inflateEnd:t=>{if(Ps(t))return Bs;let e=t.state;return e.window&&(e.window=null),t.state=null,vs},inflateGetHeader:(t,e)=>{if(Ps(t))return Bs;const i=t.state;return 2&i.wrap?(i.head=e,e.done=false,vs):Bs},inflateSetDictionary:(t,e)=>{const i=e.length;let r,s,o;return Ps(t)?Bs:(r=t.state,0!==r.wrap&&r.mode!==Ms?Bs:r.mode===Ms&&(s=1,s=Wr(s,e,i,0),s!==r.check)?Cs:(o=$s(t,e,i,i),o?(r.mode=16210,Es):(r.havedict=1,vs)))},inflateInfo:"pako inflate (from Nodeca project)"};var Zs=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=false};const Ws=Object.prototype.toString,{Z_NO_FLUSH:Xs,Z_FINISH:to,Z_OK:eo,Z_STREAM_END:io,Z_NEED_DICT:ro,Z_STREAM_ERROR:so,Z_DATA_ERROR:oo,Z_MEM_ERROR:no}=is;function ao(t){this.options=ss.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=false,this.chunks=[],this.strm=new ls,this.strm.avail_out=0;let i=Ks.inflateInit2(this.strm,e.windowBits);if(i!==eo)throw new Error(es[i]);if(this.header=new Zs,Ks.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=as.string2buf(e.dictionary):"[object ArrayBuffer]"===Ws.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=Ks.inflateSetDictionary(this.strm,e.dictionary),i!==eo)))throw new Error(es[i])}function lo(t,e){const i=new ao(e);if(i.push(t),i.err)throw i.msg||es[i.err];return i.result}ao.prototype.push=function(t,e){const i=this.strm,r=this.options.chunkSize,s=this.options.dictionary;let o,n,a;if(this.ended)return false;for(n=e===~~e?e:true===e?to:Xs,"[object ArrayBuffer]"===Ws.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),o=Ks.inflate(i,n),o===ro&&s&&(o=Ks.inflateSetDictionary(i,s),o===eo?o=Ks.inflate(i,n):o===oo&&(o=ro));i.avail_in>0&&o===io&&i.state.wrap>0&&0!==t[i.next_in];)Ks.inflateReset(i),o=Ks.inflate(i,n);switch(o){case so:case oo:case ro:case no:return this.onEnd(o),this.ended=true,false}if(a=i.avail_out,i.next_out&&(0===i.avail_out||o===io))if("string"===this.options.to){let t=as.utf8border(i.output,i.next_out),e=i.next_out-t,s=as.buf2string(i.output,t);i.next_out=e,i.avail_out=r-e,e&&i.output.set(i.output.subarray(t,t+e),0),this.onData(s)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(o!==eo||0!==a){if(o===io)return o=Ks.inflateEnd(this.strm),this.onEnd(o),this.ended=true,true;if(0===i.avail_in)break}}return true},ao.prototype.onData=function(t){this.chunks.push(t)},ao.prototype.onEnd=function(t){t===eo&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ss.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Ao={inflate:lo};const{inflate:ho}=Ao;var co=ho;var uo=Object.freeze({__proto__:null,default:class extends pe{decodeBlock(t){return co(new Uint8Array(t)).buffer}}});var fo=Object.freeze({__proto__:null,default:class extends pe{decodeBlock(t){const e=new DataView(t),i=[];for(let r=0;r<t.byteLength;++r){let t=e.getInt8(r);if(t<0){const s=e.getUint8(r+1);t=-t;for(let e=0;e<=t;++e)i.push(s);r+=1}else{for(let s=0;s<=t;++s)i.push(e.getUint8(r+s+1));r+=t+1}}return new Uint8Array(i).buffer}}}),go={exports:{}};!function(t){
767
+ /* Copyright 2015-2021 Esri. 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 @preserve */
768
+ !function(){var e,i,r,s,o,n,a,l,A=(e={defaultNoDataValue:-34027999387901484e22,decode:function(t,n){var a=(n=n||{}).encodedMaskData||null===n.encodedMaskData,l=o(t,n.inputOffset||0,a),A=null!==n.noDataValue?n.noDataValue:e.defaultNoDataValue,h=i(l,n.pixelType||Float32Array,n.encodedMaskData,A,n.returnMask),c={width:l.width,height:l.height,pixelData:h.resultPixels,minValue:h.minValue,maxValue:l.pixels.maxValue,noDataValue:A};return h.resultMask&&(c.maskData=h.resultMask),n.returnEncodedMask&&l.mask&&(c.encodedMaskData=l.mask.bitset?l.mask.bitset:null),n.returnFileInfo&&(c.fileInfo=r(l),n.computeUsedBitDepths&&(c.fileInfo.bitDepths=s(l))),c}},i=function(t,e,i,r,s){var o,a,l,A=0,h=t.pixels.numBlocksX,c=t.pixels.numBlocksY,u=Math.floor(t.width/h),f=Math.floor(t.height/c),d=2*t.maxZError,g=Number.MAX_VALUE;i=i||(t.mask?t.mask.bitset:null),a=new e(t.width*t.height),s&&i&&(l=new Uint8Array(t.width*t.height));for(var p,m,w=new Float32Array(u*f),I=0;I<=c;I++){var v=I!==c?f:t.height%c;if(0!==v)for(var b=0;b<=h;b++){var y=b!==h?u:t.width%h;if(0!==y){var B,C,E,_,Q=I*t.width*f+b*u,x=t.width-y,M=t.pixels.blocks[A];if(M.encoding<2?(0===M.encoding?B=M.rawData:(n(M.stuffedData,M.bitsPerPixel,M.numValidPixels,M.offset,d,w,t.pixels.maxValue),B=w),C=0):E=2===M.encoding?0:M.offset,i)for(m=0;m<v;m++){for(7&Q&&(_=i[Q>>3],_<<=7&Q),p=0;p<y;p++)7&Q||(_=i[Q>>3]),128&_?(l&&(l[Q]=1),g=g>(o=M.encoding<2?B[C++]:E)?o:g,a[Q++]=o):(l&&(l[Q]=0),a[Q++]=r),_<<=1;Q+=x}else if(M.encoding<2)for(m=0;m<v;m++){for(p=0;p<y;p++)g=g>(o=B[C++])?o:g,a[Q++]=o;Q+=x}else for(g=g>E?E:g,m=0;m<v;m++){for(p=0;p<y;p++)a[Q++]=E;Q+=x}if(1===M.encoding&&C!==M.numValidPixels)throw"Block and Mask do not match";A++}}}return{resultPixels:a,resultMask:l,minValue:g}},r=function(t){return{fileIdentifierString:t.fileIdentifierString,fileVersion:t.fileVersion,imageType:t.imageType,height:t.height,width:t.width,maxZError:t.maxZError,eofOffset:t.eofOffset,mask:t.mask?{numBlocksX:t.mask.numBlocksX,numBlocksY:t.mask.numBlocksY,numBytes:t.mask.numBytes,maxValue:t.mask.maxValue}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,numBytes:t.pixels.numBytes,maxValue:t.pixels.maxValue,noDataValue:t.noDataValue}}},s=function(t){for(var e=t.pixels.numBlocksX*t.pixels.numBlocksY,i={},r=0;r<e;r++){var s=t.pixels.blocks[r];0===s.encoding?i.float32=true:1===s.encoding?i[s.bitsPerPixel]=true:i[0]=true}return Object.keys(i)},o=function(t,e,i){var r={},s=new Uint8Array(t,e,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,s),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;e+=10;var o=new DataView(t,e,24);if(r.fileVersion=o.getInt32(0,true),r.imageType=o.getInt32(4,true),r.height=o.getUint32(8,true),r.width=o.getUint32(12,true),r.maxZError=o.getFloat64(16,true),e+=24,!i)if(o=new DataView(t,e,16),r.mask={},r.mask.numBlocksY=o.getUint32(0,true),r.mask.numBlocksX=o.getUint32(4,true),r.mask.numBytes=o.getUint32(8,true),r.mask.maxValue=o.getFloat32(12,true),e+=16,r.mask.numBytes>0){var n=new Uint8Array(Math.ceil(r.width*r.height/8)),a=(o=new DataView(t,e,r.mask.numBytes)).getInt16(0,true),l=2,A=0;do{if(a>0)for(;a--;)n[A++]=o.getUint8(l++);else{var h=o.getUint8(l++);for(a=-a;a--;)n[A++]=h}a=o.getInt16(l,true),l+=2}while(l<r.mask.numBytes);if(-32768!==a||A<n.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=n,e+=r.mask.numBytes}else r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue||(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));o=new DataView(t,e,16),r.pixels={},r.pixels.numBlocksY=o.getUint32(0,true),r.pixels.numBlocksX=o.getUint32(4,true),r.pixels.numBytes=o.getUint32(8,true),r.pixels.maxValue=o.getFloat32(12,true),e+=16;var c=r.pixels.numBlocksX,u=r.pixels.numBlocksY,f=c+(r.width%c>0?1:0),d=u+(r.height%u>0?1:0);r.pixels.blocks=new Array(f*d);for(var g=0,p=0;p<d;p++)for(var m=0;m<f;m++){var w=0,I=t.byteLength-e;o=new DataView(t,e,Math.min(10,I));var v={};r.pixels.blocks[g++]=v;var b=o.getUint8(0);if(w++,v.encoding=63&b,v.encoding>3)throw"Invalid block encoding ("+v.encoding+")";if(2!==v.encoding){if(0!==b&&2!==b){if(b>>=6,v.offsetType=b,2===b)v.offset=o.getInt8(1),w++;else if(1===b)v.offset=o.getInt16(1,true),w+=2;else{if(0!==b)throw"Invalid block offset type";v.offset=o.getFloat32(1,true),w+=4}if(1===v.encoding)if(b=o.getUint8(w),w++,v.bitsPerPixel=63&b,b>>=6,v.numValidPixelsType=b,2===b)v.numValidPixels=o.getUint8(w),w++;else if(1===b)v.numValidPixels=o.getUint16(w,true),w+=2;else{if(0!==b)throw"Invalid valid pixel count type";v.numValidPixels=o.getUint32(w,true),w+=4}}var y;if(e+=w,3!==v.encoding)if(0===v.encoding){var B=(r.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";y=new ArrayBuffer(4*B),new Uint8Array(y).set(new Uint8Array(t,e,4*B));var C=new Float32Array(y);v.rawData=C,e+=4*B}else if(1===v.encoding){var E=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),_=Math.ceil(E/4);y=new ArrayBuffer(4*_),new Uint8Array(y).set(new Uint8Array(t,e,E)),v.stuffedData=new Uint32Array(y),e+=E}}else e++}return r.eofOffset=e,r},n=function(t,e,i,r,s,o,n){var a,l,A,h=(1<<e)-1,c=0,u=0,f=Math.ceil((n-r)/s),d=4*t.length-Math.ceil(e*i/8);for(t[t.length-1]<<=8*d,a=0;a<i;a++){if(0===u&&(A=t[c++],u=32),u>=e)l=A>>>u-e&h,u-=e;else{var g=e-u;l=(A&h)<<g&h,l+=(A=t[c++])>>>(u=32-g)}o[a]=l<f?r+l*s:n}return o},e),h=function(){var t=function(t,e,i,r,s,o,n,a){var l,A,h,c,u,f=(1<<i)-1,d=0,g=0,p=4*t.length-Math.ceil(i*r/8);if(t[t.length-1]<<=8*p,s)for(l=0;l<r;l++)0===g&&(h=t[d++],g=32),g>=i?(A=h>>>g-i&f,g-=i):(A=(h&f)<<(c=i-g)&f,A+=(h=t[d++])>>>(g=32-c)),e[l]=s[A];else for(u=Math.ceil((a-o)/n),l=0;l<r;l++)0===g&&(h=t[d++],g=32),g>=i?(A=h>>>g-i&f,g-=i):(A=(h&f)<<(c=i-g)&f,A+=(h=t[d++])>>>(g=32-c)),e[l]=A<u?o+A*n:a},e=function(t,e,i,r,s,o){var n,a=(1<<e)-1,l=0,A=0,h=0,c=0,u=0,f=[],d=4*t.length-Math.ceil(e*i/8);t[t.length-1]<<=8*d;var g=Math.ceil((o-r)/s);for(A=0;A<i;A++)0===c&&(n=t[l++],c=32),c>=e?(u=n>>>c-e&a,c-=e):(u=(n&a)<<(h=e-c)&a,u+=(n=t[l++])>>>(c=32-h)),f[A]=u<g?r+u*s:o;return f.unshift(r),f},i=function(t,e,i,r,s,o,n,a){var l,A,h,c,u=(1<<i)-1,f=0,d=0,g=0;if(s)for(l=0;l<r;l++)0===d&&(h=t[f++],d=32,g=0),d>=i?(A=h>>>g&u,d-=i,g+=i):(A=h>>>g&u,d=32-(c=i-d),A|=((h=t[f++])&(1<<c)-1)<<i-c,g=c),e[l]=s[A];else{var p=Math.ceil((a-o)/n);for(l=0;l<r;l++)0===d&&(h=t[f++],d=32,g=0),d>=i?(A=h>>>g&u,d-=i,g+=i):(A=h>>>g&u,d=32-(c=i-d),A|=((h=t[f++])&(1<<c)-1)<<i-c,g=c),e[l]=A<p?o+A*n:a}return e},r=function(t,e,i,r,s,o){var n,a=(1<<e)-1,l=0,A=0,h=0,c=0,u=0,f=0,d=[],g=Math.ceil((o-r)/s);for(A=0;A<i;A++)0===c&&(n=t[l++],c=32,f=0),c>=e?(u=n>>>f&a,c-=e,f+=e):(u=n>>>f&a,c=32-(h=e-c),u|=((n=t[l++])&(1<<h)-1)<<e-h,f=h),d[A]=u<g?r+u*s:o;return d.unshift(r),d},s=function(t,e,i,r){var s,o,n,a,l=(1<<i)-1,A=0,h=0,c=4*t.length-Math.ceil(i*r/8);for(t[t.length-1]<<=8*c,s=0;s<r;s++)0===h&&(n=t[A++],h=32),h>=i?(o=n>>>h-i&l,h-=i):(o=(n&l)<<(a=i-h)&l,o+=(n=t[A++])>>>(h=32-a)),e[s]=o;return e},o=function(t,e,i,r){var s,o,n,a,l=(1<<i)-1,A=0,h=0,c=0;for(s=0;s<r;s++)0===h&&(n=t[A++],h=32,c=0),h>=i?(o=n>>>c&l,h-=i,c+=i):(o=n>>>c&l,h=32-(a=i-h),o|=((n=t[A++])&(1<<a)-1)<<i-a,c=a),e[s]=o;return e},n={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(t){for(var e=65535,i=65535,r=t.length,s=Math.floor(r/2),o=0;s;){var n=s>=359?359:s;s-=n;do{e+=t[o++]<<8,i+=e+=t[o++]}while(--n);e=(65535&e)+(e>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=e+=t[o]<<8),((i=(65535&i)+(i>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(t,e){var i=e.ptr,r=new Uint8Array(t,i,6),s={};if(s.fileIdentifierString=String.fromCharCode.apply(null,r),0!==s.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+s.fileIdentifierString;i+=6;var o,n=new DataView(t,i,8),a=n.getInt32(0,true);if(s.fileVersion=a,i+=4,a>=3&&(s.checksum=n.getUint32(4,true),i+=4),n=new DataView(t,i,12),s.height=n.getUint32(0,true),s.width=n.getUint32(4,true),i+=8,a>=4?(s.numDims=n.getUint32(8,true),i+=4):s.numDims=1,n=new DataView(t,i,40),s.numValidPixel=n.getUint32(0,true),s.microBlockSize=n.getInt32(4,true),s.blobSize=n.getInt32(8,true),s.imageType=n.getInt32(12,true),s.maxZError=n.getFloat64(16,true),s.zMin=n.getFloat64(24,true),s.zMax=n.getFloat64(32,true),i+=40,e.headerInfo=s,e.ptr=i,a>=3&&(o=a>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(t,i-o,s.blobSize-14))!==s.checksum))throw"Checksum failed.";return true},checkMinMaxRanges:function(t,e){var i=e.headerInfo,r=this.getDataTypeArray(i.imageType),s=i.numDims*this.getDataTypeSize(i.imageType),o=this.readSubArray(t,e.ptr,r,s),n=this.readSubArray(t,e.ptr+s,r,s);e.ptr+=2*s;var a,l=true;for(a=0;a<i.numDims;a++)if(o[a]!==n[a]){l=false;break}return i.minValues=o,i.maxValues=n,l},readSubArray:function(t,e,i,r){var s;if(i===Uint8Array)s=new Uint8Array(t,e,r);else{var o=new ArrayBuffer(r);new Uint8Array(o).set(new Uint8Array(t,e,r)),s=new i(o)}return s},readMask:function(t,e){var i,r,s=e.ptr,o=e.headerInfo,n=o.width*o.height,a=o.numValidPixel,l=new DataView(t,s,4),A={};if(A.numBytes=l.getUint32(0,true),s+=4,(0===a||n===a)&&0!==A.numBytes)throw"invalid mask";if(0===a)i=new Uint8Array(Math.ceil(n/8)),A.bitset=i,r=new Uint8Array(n),e.pixels.resultMask=r,s+=A.numBytes;else if(A.numBytes>0){i=new Uint8Array(Math.ceil(n/8));var h=(l=new DataView(t,s,A.numBytes)).getInt16(0,true),c=2,u=0,f=0;do{if(h>0)for(;h--;)i[u++]=l.getUint8(c++);else for(f=l.getUint8(c++),h=-h;h--;)i[u++]=f;h=l.getInt16(c,true),c+=2}while(c<A.numBytes);if(-32768!==h||u<i.length)throw"Unexpected end of mask RLE encoding";r=new Uint8Array(n);var d=0,g=0;for(g=0;g<n;g++)7&g?(d=i[g>>3],d<<=7&g):d=i[g>>3],128&d&&(r[g]=1);e.pixels.resultMask=r,A.bitset=i,s+=A.numBytes}return e.ptr=s,e.mask=A,true},readDataOneSweep:function(t,e,i,r){var s,o=e.ptr,a=e.headerInfo,l=a.numDims,A=a.width*a.height,h=a.imageType,c=a.numValidPixel*n.getDataTypeSize(h)*l,u=e.pixels.resultMask;if(i===Uint8Array)s=new Uint8Array(t,o,c);else{var f=new ArrayBuffer(c);new Uint8Array(f).set(new Uint8Array(t,o,c)),s=new i(f)}if(s.length===A*l)e.pixels.resultPixels=r?n.swapDimensionOrder(s,A,l,i,true):s;else{e.pixels.resultPixels=new i(A*l);var d=0,g=0,p=0,m=0;if(l>1){if(r){for(g=0;g<A;g++)if(u[g])for(m=g,p=0;p<l;p++,m+=A)e.pixels.resultPixels[m]=s[d++]}else for(g=0;g<A;g++)if(u[g])for(m=g*l,p=0;p<l;p++)e.pixels.resultPixels[m+p]=s[d++]}else for(g=0;g<A;g++)u[g]&&(e.pixels.resultPixels[g]=s[d++])}return o+=c,e.ptr=o,true},readHuffmanTree:function(t,e){var i=this.HUFFMAN_LUT_BITS_MAX,r=new DataView(t,e.ptr,16);if(e.ptr+=16,r.getInt32(0,true)<2)throw"unsupported Huffman version";var s=r.getInt32(4,true),o=r.getInt32(8,true),l=r.getInt32(12,true);if(o>=l)return false;var A=new Uint32Array(l-o);n.decodeBits(t,e,A);var h,c,u,f,d=[];for(h=o;h<l;h++)d[c=h-(h<s?0:s)]={first:A[h-o],second:null};var g=t.byteLength-e.ptr,p=Math.ceil(g/4),m=new ArrayBuffer(4*p);new Uint8Array(m).set(new Uint8Array(t,e.ptr,g));var w,I=new Uint32Array(m),v=0,b=0;for(w=I[0],h=o;h<l;h++)(f=d[c=h-(h<s?0:s)].first)>0&&(d[c].second=w<<v>>>32-f,32-v>=f?32===(v+=f)&&(v=0,w=I[++b]):(v+=f-32,w=I[++b],d[c].second|=w>>>32-v));var y=0,B=0,C=new a;for(h=0;h<d.length;h++)void 0!==d[h]&&(y=Math.max(y,d[h].first));B=y>=i?i:y;var E,_,Q,x,M,k=[];for(h=o;h<l;h++)if((f=d[c=h-(h<s?0:s)].first)>0)if(E=[f,c],f<=B)for(_=d[c].second<<B-f,Q=1<<B-f,u=0;u<Q;u++)k[_|u]=E;else for(_=d[c].second,M=C,x=f-1;x>=0;x--)_>>>x&1?(M.right||(M.right=new a),M=M.right):(M.left||(M.left=new a),M=M.left),0!==x||M.val||(M.val=E[1]);return{decodeLut:k,numBitsLUTQick:B,numBitsLUT:y,tree:C,stuffedData:I,srcPtr:b,bitPos:v}},readHuffman:function(t,e,i,r){var s,o,a,l,A,h,c,u,f,d=e.headerInfo.numDims,g=e.headerInfo.height,p=e.headerInfo.width,m=p*g,w=this.readHuffmanTree(t,e),I=w.decodeLut,v=w.tree,b=w.stuffedData,y=w.srcPtr,B=w.bitPos,C=w.numBitsLUTQick,E=w.numBitsLUT,_=0===e.headerInfo.imageType?128:0,Q=e.pixels.resultMask,x=0;B>0&&(y++,B=0);var M,k=b[y],D=1===e.encodeMode,S=new i(m*d),G=S;if(d<2||D){for(M=0;M<d;M++)if(d>1&&(G=new i(S.buffer,m*M,m),x=0),e.headerInfo.numValidPixel===p*g)for(u=0,h=0;h<g;h++)for(c=0;c<p;c++,u++){if(o=0,A=l=k<<B>>>32-C,32-B<C&&(A=l|=b[y+1]>>>64-B-C),I[A])o=I[A][1],B+=I[A][0];else for(A=l=k<<B>>>32-E,32-B<E&&(A=l|=b[y+1]>>>64-B-E),s=v,f=0;f<E;f++)if(!(s=l>>>E-f-1&1?s.right:s.left).left&&!s.right){o=s.val,B=B+f+1;break}B>=32&&(B-=32,k=b[++y]),a=o-_,D?(a+=c>0?x:h>0?G[u-p]:x,a&=255,G[u]=a,x=a):G[u]=a}else for(u=0,h=0;h<g;h++)for(c=0;c<p;c++,u++)if(Q[u]){if(o=0,A=l=k<<B>>>32-C,32-B<C&&(A=l|=b[y+1]>>>64-B-C),I[A])o=I[A][1],B+=I[A][0];else for(A=l=k<<B>>>32-E,32-B<E&&(A=l|=b[y+1]>>>64-B-E),s=v,f=0;f<E;f++)if(!(s=l>>>E-f-1&1?s.right:s.left).left&&!s.right){o=s.val,B=B+f+1;break}B>=32&&(B-=32,k=b[++y]),a=o-_,D?(c>0&&Q[u-1]?a+=x:h>0&&Q[u-p]?a+=G[u-p]:a+=x,a&=255,G[u]=a,x=a):G[u]=a}}else for(u=0,h=0;h<g;h++)for(c=0;c<p;c++)if(u=h*p+c,!Q||Q[u])for(M=0;M<d;M++,u+=m){if(o=0,A=l=k<<B>>>32-C,32-B<C&&(A=l|=b[y+1]>>>64-B-C),I[A])o=I[A][1],B+=I[A][0];else for(A=l=k<<B>>>32-E,32-B<E&&(A=l|=b[y+1]>>>64-B-E),s=v,f=0;f<E;f++)if(!(s=l>>>E-f-1&1?s.right:s.left).left&&!s.right){o=s.val,B=B+f+1;break}B>=32&&(B-=32,k=b[++y]),a=o-_,G[u]=a}e.ptr=e.ptr+4*(y+1)+(B>0?4:0),e.pixels.resultPixels=S,d>1&&!r&&(e.pixels.resultPixels=n.swapDimensionOrder(S,m,d,i))},decodeBits:function(n,a,l,A,h){var c=a.headerInfo,u=c.fileVersion,f=0,d=n.byteLength-a.ptr>=5?5:n.byteLength-a.ptr,g=new DataView(n,a.ptr,d),p=g.getUint8(0);f++;var m=p>>6,w=0===m?4:3-m,I=(32&p)>0,v=31&p,b=0;if(1===w)b=g.getUint8(f),f++;else if(2===w)b=g.getUint16(f,true),f+=2;else{if(4!==w)throw"Invalid valid pixel count type";b=g.getUint32(f,true),f+=4}var y,B,C,E,_,Q,x,M,k,D=2*c.maxZError,S=c.numDims>1?c.maxValues[h]:c.zMax;if(I){for(a.counter.lut++,M=g.getUint8(f),f++,E=Math.ceil((M-1)*v/8),_=Math.ceil(E/4),B=new ArrayBuffer(4*_),C=new Uint8Array(B),a.ptr+=f,C.set(new Uint8Array(n,a.ptr,E)),x=new Uint32Array(B),a.ptr+=E,k=0;M-1>>>k;)k++;E=Math.ceil(b*k/8),_=Math.ceil(E/4),B=new ArrayBuffer(4*_),(C=new Uint8Array(B)).set(new Uint8Array(n,a.ptr,E)),y=new Uint32Array(B),a.ptr+=E,Q=u>=3?r(x,v,M-1,A,D,S):e(x,v,M-1,A,D,S),u>=3?i(y,l,k,b,Q):t(y,l,k,b,Q)}else a.counter.bitstuffer++,k=v,a.ptr+=f,k>0&&(E=Math.ceil(b*k/8),_=Math.ceil(E/4),B=new ArrayBuffer(4*_),(C=new Uint8Array(B)).set(new Uint8Array(n,a.ptr,E)),y=new Uint32Array(B),a.ptr+=E,u>=3?null==A?o(y,l,k,b):i(y,l,k,b,false,A,D,S):null==A?s(y,l,k,b):t(y,l,k,b,false,A,D,S))},readTiles:function(t,e,i,r){var s=e.headerInfo,o=s.width,a=s.height,l=o*a,A=s.microBlockSize,h=s.imageType,c=n.getDataTypeSize(h),u=Math.ceil(o/A),f=Math.ceil(a/A);e.pixels.numBlocksY=f,e.pixels.numBlocksX=u,e.pixels.ptr=0;var d,g,p,m,w,I,v,b,y,B,C=0,E=0,_=0,Q=0,x=0,M=0,k=0,D=0,S=0,G=0,F=0,R=0,L=0,z=0,U=0,P=new i(A*A),N=a%A||A,T=o%A||A,q=s.numDims,O=e.pixels.resultMask,j=e.pixels.resultPixels,J=s.fileVersion>=5?14:15,H=s.zMax;for(_=0;_<f;_++)for(x=_!==f-1?A:N,Q=0;Q<u;Q++)for(G=_*o*A+Q*A,F=o-(M=Q!==u-1?A:T),b=0;b<q;b++){if(q>1?(B=j,G=_*o*A+Q*A,j=new i(e.pixels.resultPixels.buffer,l*b*c,l),H=s.maxValues[b]):B=null,k=t.byteLength-e.ptr,g={},U=0,D=(d=new DataView(t,e.ptr,Math.min(10,k))).getUint8(0),U++,y=s.fileVersion>=5?4&D:0,S=D>>6&255,(D>>2&J)!==(Q*A>>3&J))throw"integrity issue";if(y&&0===b)throw"integrity issue";if((w=3&D)>3)throw e.ptr+=U,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(y)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=U,R=(R=x*M*c)<(L=t.byteLength-e.ptr)?R:L,p=new ArrayBuffer(R%c==0?R:R+c-R%c),new Uint8Array(p).set(new Uint8Array(t,e.ptr,R)),m=new i(p),z=0,O)for(C=0;C<x;C++){for(E=0;E<M;E++)O[G]&&(j[G]=m[z++]),G++;G+=F}else for(C=0;C<x;C++){for(E=0;E<M;E++)j[G++]=m[z++];G+=F}e.ptr+=z*c}else if(I=n.getDataTypeUsed(y&&h<6?4:h,S),v=n.getOnePixel(g,U,I,d),U+=n.getDataTypeSize(I),3===w)if(e.ptr+=U,e.counter.constantoffset++,O)for(C=0;C<x;C++){for(E=0;E<M;E++)O[G]&&(j[G]=y?Math.min(H,B[G]+v):v),G++;G+=F}else for(C=0;C<x;C++){for(E=0;E<M;E++)j[G]=y?Math.min(H,B[G]+v):v,G++;G+=F}else if(e.ptr+=U,n.decodeBits(t,e,P,v,b),U=0,y)if(O)for(C=0;C<x;C++){for(E=0;E<M;E++)O[G]&&(j[G]=P[U++]+B[G]),G++;G+=F}else for(C=0;C<x;C++){for(E=0;E<M;E++)j[G]=P[U++]+B[G],G++;G+=F}else if(O)for(C=0;C<x;C++){for(E=0;E<M;E++)O[G]&&(j[G]=P[U++]),G++;G+=F}else for(C=0;C<x;C++){for(E=0;E<M;E++)j[G++]=P[U++];G+=F}else{if(y)if(O)for(C=0;C<x;C++)for(E=0;E<M;E++)O[G]&&(j[G]=B[G]),G++;else for(C=0;C<x;C++)for(E=0;E<M;E++)j[G]=B[G],G++;e.counter.constant++,e.ptr+=U}}q>1&&!r&&(e.pixels.resultPixels=n.swapDimensionOrder(e.pixels.resultPixels,l,q,i))},formatFileInfo:function(t){return{fileIdentifierString:t.headerInfo.fileIdentifierString,fileVersion:t.headerInfo.fileVersion,imageType:t.headerInfo.imageType,height:t.headerInfo.height,width:t.headerInfo.width,numValidPixel:t.headerInfo.numValidPixel,microBlockSize:t.headerInfo.microBlockSize,blobSize:t.headerInfo.blobSize,maxZError:t.headerInfo.maxZError,pixelType:n.getPixelType(t.headerInfo.imageType),eofOffset:t.eofOffset,mask:t.mask?{numBytes:t.mask.numBytes}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,maxValue:t.headerInfo.zMax,minValue:t.headerInfo.zMin,noDataValue:t.noDataValue}}},constructConstantSurface:function(t,e){var i=t.headerInfo.zMax,r=t.headerInfo.zMin,s=t.headerInfo.maxValues,o=t.headerInfo.numDims,n=t.headerInfo.height*t.headerInfo.width,a=0,l=0,A=0,h=t.pixels.resultMask,c=t.pixels.resultPixels;if(h)if(o>1){if(e)for(a=0;a<o;a++)for(A=a*n,i=s[a],l=0;l<n;l++)h[l]&&(c[A+l]=i);else for(l=0;l<n;l++)if(h[l])for(A=l*o,a=0;a<o;a++)c[A+o]=s[a]}else for(l=0;l<n;l++)h[l]&&(c[l]=i);else if(o>1&&r!==i)if(e)for(a=0;a<o;a++)for(A=a*n,i=s[a],l=0;l<n;l++)c[A+l]=i;else for(l=0;l<n;l++)for(A=l*o,a=0;a<o;a++)c[A+a]=s[a];else for(l=0;l<n*o;l++)c[l]=i},getDataTypeArray:function(t){var e;switch(t){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:default:e=Float32Array;break;case 7:e=Float64Array}return e},getPixelType:function(t){var e;switch(t){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:default:e="F32";break;case 7:e="F64"}return e},isValidPixelValue:function(t,e){if(null==e)return false;var i;switch(t){case 0:i=e>=-128&&e<=127;break;case 1:i=e>=0&&e<=255;break;case 2:i=e>=-32768&&e<=32767;break;case 3:i=e>=0&&e<=65536;break;case 4:i=e>=-2147483648&&e<=2147483647;break;case 5:i=e>=0&&e<=4294967296;break;case 6:i=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:i=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:i=false}return i},getDataTypeSize:function(t){var e=0;switch(t){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=t}return e},getDataTypeUsed:function(t,e){var i=t;switch(t){case 2:case 4:i=t-e;break;case 3:case 5:i=t-2*e;break;case 6:i=0===e?t:1===e?2:1;break;case 7:i=0===e?t:t-2*e+1;break;default:i=t}return i},getOnePixel:function(t,e,i,r){var s=0;switch(i){case 0:s=r.getInt8(e);break;case 1:s=r.getUint8(e);break;case 2:s=r.getInt16(e,true);break;case 3:s=r.getUint16(e,true);break;case 4:s=r.getInt32(e,true);break;case 5:s=r.getUInt32(e,true);break;case 6:s=r.getFloat32(e,true);break;case 7:s=r.getFloat64(e,true);break;default:throw"the decoder does not understand this pixel type"}return s},swapDimensionOrder:function(t,e,i,r,s){var o=0,n=0,a=0,l=0,A=t;if(i>1)if(A=new r(e*i),s)for(o=0;o<e;o++)for(l=o,a=0;a<i;a++,l+=e)A[l]=t[n++];else for(o=0;o<e;o++)for(l=o,a=0;a<i;a++,l+=e)A[n++]=t[l];return A}},a=function(t,e,i){this.val=t,this.left=e,this.right=i},l={decode:function(t,e){var i=(e=e||{}).noDataValue,r=0,s={};if(s.ptr=e.inputOffset||0,s.pixels={},n.readHeaderInfo(t,s)){var o=s.headerInfo,a=o.fileVersion,l=n.getDataTypeArray(o.imageType);if(a>5)throw"unsupported lerc version 2."+a;n.readMask(t,s),o.numValidPixel===o.width*o.height||s.pixels.resultMask||(s.pixels.resultMask=e.maskData);var A=o.width*o.height;s.pixels.resultPixels=new l(A*o.numDims),s.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var h,c=!e.returnPixelInterleavedDims;if(0!==o.numValidPixel)if(o.zMax===o.zMin)n.constructConstantSurface(s,c);else if(a>=4&&n.checkMinMaxRanges(t,s))n.constructConstantSurface(s,c);else{var u=new DataView(t,s.ptr,2),f=u.getUint8(0);if(s.ptr++,f)n.readDataOneSweep(t,s,l,c);else if(a>1&&o.imageType<=1&&Math.abs(o.maxZError-.5)<1e-5){var d=u.getUint8(1);if(s.ptr++,s.encodeMode=d,d>2||a<4&&d>1)throw"Invalid Huffman flag "+d;d?n.readHuffman(t,s,l,c):n.readTiles(t,s,l,c)}else n.readTiles(t,s,l,c)}s.eofOffset=s.ptr,e.inputOffset?(h=s.headerInfo.blobSize+e.inputOffset-s.ptr,Math.abs(h)>=1&&(s.eofOffset=e.inputOffset+s.headerInfo.blobSize)):(h=s.headerInfo.blobSize-s.ptr,Math.abs(h)>=1&&(s.eofOffset=s.headerInfo.blobSize));var g={width:o.width,height:o.height,pixelData:s.pixels.resultPixels,minValue:o.zMin,maxValue:o.zMax,validPixelCount:o.numValidPixel,dimCount:o.numDims,dimStats:{minValues:o.minValues,maxValues:o.maxValues},maskData:s.pixels.resultMask};if(s.pixels.resultMask&&n.isValidPixelValue(o.imageType,i)){var p=s.pixels.resultMask;for(r=0;r<A;r++)p[r]||(g.pixelData[r]=i);g.noDataValue=i}return s.noDataValue=i,e.returnFileInfo&&(g.fileInfo=n.formatFileInfo(s)),g}},getBandCount:function(t){for(var e=0,i=0,r={ptr:0,pixels:{}};i<t.byteLength-58;)n.readHeaderInfo(t,r),i+=r.headerInfo.blobSize,e++,r.ptr=i;return e}};return l}(),c=(a=new ArrayBuffer(4),l=new Uint8Array(a),new Uint32Array(a)[0]=1,1===l[0]),u={decode:function(t,e){if(!c)throw"Big endian system is not supported.";var i,r,s=(e=e||{}).inputOffset||0,o=new Uint8Array(t,s,10),n=String.fromCharCode.apply(null,o);if("CntZImage"===n.trim())i=A,r=1;else{if("Lerc2"!==n.substring(0,5))throw"Unexpected file identifier string: "+n;i=h,r=2}for(var a,l,u,f,d,g,p=0,m=t.byteLength-10,w=[],I={width:0,height:0,pixels:[],pixelType:e.pixelType,mask:null,statistics:[]},v=0;s<m;){var b=i.decode(t,{inputOffset:s,encodedMaskData:a,maskData:u,returnMask:0===p,returnEncodedMask:0===p,returnFileInfo:true,returnPixelInterleavedDims:e.returnPixelInterleavedDims,pixelType:e.pixelType||null,noDataValue:e.noDataValue||null});s=b.fileInfo.eofOffset,u=b.maskData,0===p&&(a=b.encodedMaskData,I.width=b.width,I.height=b.height,I.dimCount=b.dimCount||1,I.pixelType=b.pixelType||b.fileInfo.pixelType,I.mask=u),r>1&&(u&&w.push(u),b.fileInfo.mask&&b.fileInfo.mask.numBytes>0&&v++),p++,I.pixels.push(b.pixelData),I.statistics.push({minValue:b.minValue,maxValue:b.maxValue,noDataValue:b.noDataValue,dimStats:b.dimStats})}if(r>1&&v>1){for(g=I.width*I.height,I.bandMasks=w,(u=new Uint8Array(g)).set(w[0]),f=1;f<w.length;f++)for(l=w[f],d=0;d<g;d++)u[d]=u[d]&l[d];I.maskData=u}return I}};t.exports?t.exports=u:this.Lerc=u}()}(go);var po=j(go.exports);let mo,wo,Io;const vo={env:{emscripten_notify_memory_growth:function(t){Io=new Uint8Array(wo.exports.memory.buffer)}}};const bo="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",yo=new class{init(){return mo||(mo="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+bo).then((t=>t.arrayBuffer())).then((t=>WebAssembly.instantiate(t,vo))).then(this._init):WebAssembly.instantiate(Buffer.from(bo,"base64"),vo).then(this._init),mo)}_init(t){wo=t.instance,vo.env.emscripten_notify_memory_growth(0)}decode(t,e=0){if(!wo)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=t.byteLength,r=wo.exports.malloc(i);Io.set(t,r),e=e||Number(wo.exports.ZSTD_findDecompressedSize(r,i));const s=wo.exports.malloc(e),o=wo.exports.ZSTD_decompress(s,e,r,i),n=Io.slice(s,s+o);return wo.exports.free(r),wo.exports.free(s),n}};var Bo=Object.freeze({__proto__:null,default:class extends pe{constructor(t){super(),this.planarConfiguration=void 0!==t.PlanarConfiguration?t.PlanarConfiguration:1,this.samplesPerPixel=void 0!==t.SamplesPerPixel?t.SamplesPerPixel:1,this.addCompression=t.LercParameters[Et]}decodeBlock(t){switch(this.addCompression){case _t:break;case Qt:t=co(new Uint8Array(t)).buffer;break;case xt:t=yo.decode(new Uint8Array(t)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return po.decode(t,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}},zstd:yo});var Co=Object.freeze({__proto__:null,default:class extends pe{constructor(){if(super(),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(t,e){const i=new Blob([e]),r=await createImageBitmap(i);let s;"undefined"!=typeof document?(s=document.createElement("canvas"),s.width=r.width,s.height=r.height):s=new OffscreenCanvas(r.width,r.height);const o=s.getContext("2d");return o.drawImage(r,0,0),o.getImageData(0,0,r.width,r.height).data.buffer}}}),Eo=Worker;var _o=Object.freeze({__proto__:null,create:function(){const t='function A(A,e,t,i,r,I,g){try{var n=A[I](g),a=n.value}catch(A){return void t(A)}n.done?e(a):Promise.resolve(a).then(i,r)}function e(e){return function(){var t=this,i=arguments;return new Promise((function(r,I){var g=e.apply(t,i);function n(e){A(g,r,I,n,a,"next",e)}function a(e){A(g,r,I,n,a,"throw",e)}n(void 0)}))}}function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}var i={exports:{}};!function(A){var e=function(A){var e,i=Object.prototype,r=i.hasOwnProperty,I="function"==typeof Symbol?Symbol:{},g=I.iterator||"@@iterator",n=I.asyncIterator||"@@asyncIterator",a=I.toStringTag||"@@toStringTag";function o(A,e,t){return Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),A[e]}try{o({},"")}catch(A){o=function(A,e,t){return A[e]=t}}function B(A,e,t,i){var r=e&&e.prototype instanceof h?e:h,I=Object.create(r.prototype),g=new S(i||[]);return I._invoke=function(A,e,t){var i=Q;return function(r,I){if(i===s)throw new Error("Generator is already running");if(i===f){if("throw"===r)throw I;return R()}for(t.method=r,t.arg=I;;){var g=t.delegate;if(g){var n=m(g,t);if(n){if(n===c)continue;return n}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===Q)throw i=f,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=s;var a=C(A,e,t);if("normal"===a.type){if(i=t.done?f:E,a.arg===c)continue;return{value:a.arg,done:t.done}}"throw"===a.type&&(i=f,t.method="throw",t.arg=a.arg)}}}(A,t,g),I}function C(A,e,t){try{return{type:"normal",arg:A.call(e,t)}}catch(A){return{type:"throw",arg:A}}}A.wrap=B;var Q="suspendedStart",E="suspendedYield",s="executing",f="completed",c={};function h(){}function l(){}function u(){}var w={};o(w,g,(function(){return this}));var d=Object.getPrototypeOf,D=d&&d(d(v([])));D&&D!==i&&r.call(D,g)&&(w=D);var y=u.prototype=h.prototype=Object.create(w);function k(A){["next","throw","return"].forEach((function(e){o(A,e,(function(A){return this._invoke(e,A)}))}))}function p(A,e){function i(I,g,n,a){var o=C(A[I],A,g);if("throw"!==o.type){var B=o.arg,Q=B.value;return Q&&"object"===t(Q)&&r.call(Q,"__await")?e.resolve(Q.__await).then((function(A){i("next",A,n,a)}),(function(A){i("throw",A,n,a)})):e.resolve(Q).then((function(A){B.value=A,n(B)}),(function(A){return i("throw",A,n,a)}))}a(o.arg)}var I;this._invoke=function(A,t){function r(){return new e((function(e,r){i(A,t,e,r)}))}return I=I?I.then(r,r):r()}}function m(A,t){var i=A.iterator[t.method];if(i===e){if(t.delegate=null,"throw"===t.method){if(A.iterator.return&&(t.method="return",t.arg=e,m(A,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return c}var r=C(i,A.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var I=r.arg;return I?I.done?(t[A.resultName]=I.value,t.next=A.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,c):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function G(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function F(A){var e=A.completion||{};e.type="normal",delete e.arg,A.completion=e}function S(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(G,this),this.reset(!0)}function v(A){if(A){var t=A[g];if(t)return t.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var i=-1,I=function t(){for(;++i<A.length;)if(r.call(A,i))return t.value=A[i],t.done=!1,t;return t.value=e,t.done=!0,t};return I.next=I}}return{next:R}}function R(){return{value:e,done:!0}}return l.prototype=u,o(y,"constructor",u),o(u,"constructor",l),l.displayName=o(u,a,"GeneratorFunction"),A.isGeneratorFunction=function(A){var e="function"==typeof A&&A.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},A.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,u):(A.__proto__=u,o(A,a,"GeneratorFunction")),A.prototype=Object.create(y),A},A.awrap=function(A){return{__await:A}},k(p.prototype),o(p.prototype,n,(function(){return this})),A.AsyncIterator=p,A.async=function(e,t,i,r,I){void 0===I&&(I=Promise);var g=new p(B(e,t,i,r),I);return A.isGeneratorFunction(t)?g:g.next().then((function(A){return A.done?A.value:g.next()}))},k(y),o(y,a,"Generator"),o(y,g,(function(){return this})),o(y,"toString",(function(){return"[object Generator]"})),A.keys=function(A){var e=[];for(var t in A)e.push(t);return e.reverse(),function t(){for(;e.length;){var i=e.pop();if(i in A)return t.value=i,t.done=!1,t}return t.done=!0,t}},A.values=v,S.prototype={constructor:S,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(F),!A)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var t=this;function i(i,r){return n.type="throw",n.arg=A,t.next=i,r&&(t.method="next",t.arg=e),!!r}for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I],n=g.completion;if("root"===g.tryLoc)return i("end");if(g.tryLoc<=this.prev){var a=r.call(g,"catchLoc"),o=r.call(g,"finallyLoc");if(a&&o){if(this.prev<g.catchLoc)return i(g.catchLoc,!0);if(this.prev<g.finallyLoc)return i(g.finallyLoc)}else if(a){if(this.prev<g.catchLoc)return i(g.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return i(g.finallyLoc)}}}},abrupt:function(A,e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var I=i;break}}I&&("break"===A||"continue"===A)&&I.tryLoc<=e&&e<=I.finallyLoc&&(I=null);var g=I?I.completion:{};return g.type=A,g.arg=e,I?(this.method="next",this.next=I.finallyLoc,c):this.complete(g)},complete:function(A,e){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&e&&(this.next=e),c},finish:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),F(t),c}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var r=i.arg;F(t)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(A,t,i){return this.delegate={iterator:v(A),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=e),c}},A}(A.exports);try{regeneratorRuntime=e}catch(A){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(i);var r=i.exports,I=new Map;function g(A,e){Array.isArray(A)||(A=[A]),A.forEach((function(A){return I.set(A,e)}))}function n(A){return a.apply(this,arguments)}function a(){return(a=e(r.mark((function A(e){var t,i;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(t=I.get(e.Compression)){A.next=3;break}throw new Error("Unknown compression method identifier: ".concat(e.Compression));case 3:return A.next=5,t();case 5:return i=A.sent,A.abrupt("return",new i(e));case 7:case"end":return A.stop()}}),A)})))).apply(this,arguments)}g([void 0,1],(function(){return Promise.resolve().then((function(){return y})).then((function(A){return A.default}))})),g(5,(function(){return Promise.resolve().then((function(){return F})).then((function(A){return A.default}))})),g(6,(function(){throw new Error("old style JPEG compression is not supported.")})),g(7,(function(){return Promise.resolve().then((function(){return N})).then((function(A){return A.default}))})),g([8,32946],(function(){return Promise.resolve().then((function(){return OA})).then((function(A){return A.default}))})),g(32773,(function(){return Promise.resolve().then((function(){return _A})).then((function(A){return A.default}))})),g(34887,(function(){return Promise.resolve().then((function(){return le})).then(function(){var A=e(r.mark((function A(e){return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,e.zstd.init();case 2:return A.abrupt("return",e);case 3:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}()).then((function(A){return A.default}))})),g(50001,(function(){return Promise.resolve().then((function(){return de})).then((function(A){return A.default}))}));var o=globalThis;function B(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function C(A,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,i.key,i)}}function Q(A,e,t){return e&&C(A.prototype,e),t&&C(A,t),A}function E(A,e){return E=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A},E(A,e)}function s(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&E(A,e)}function f(A,e){if(e&&("object"===t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return A}(A)}function c(A){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},c(A)}function h(A,e){var t=A.length-e,i=0;do{for(var r=e;r>0;r--)A[i+e]+=A[i],i++;t-=e}while(t>0)}function l(A,e,t){for(var i=0,r=A.length,I=r/t;r>e;){for(var g=e;g>0;--g)A[i+e]+=A[i],++i;r-=e}for(var n=A.slice(),a=0;a<I;++a)for(var o=0;o<t;++o)A[t*a+o]=n[(t-o-1)*I+a]}function u(A,e,t,i,r,I){if(!e||1===e)return A;for(var g=0;g<r.length;++g){if(r[g]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[g]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var n=r[0]/8,a=2===I?1:r.length,o=0;o<i&&!(o*a*t*n>=A.byteLength);++o){var B=void 0;if(2===e){switch(r[0]){case 8:B=new Uint8Array(A,o*a*t*n,a*t*n);break;case 16:B=new Uint16Array(A,o*a*t*n,a*t*n/2);break;case 32:B=new Uint32Array(A,o*a*t*n,a*t*n/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(r[0]," bits per sample."))}h(B,a)}else 3===e&&l(B=new Uint8Array(A,o*a*t*n,a*t*n),a,n)}return A}o.addEventListener("message",function(){var A=e(r.mark((function A(e){var t,i,I,g,a,B;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return t=e.data,i=t.id,I=t.fileDirectory,g=t.buffer,A.next=3,n(I);case 3:return a=A.sent,A.next=6,a.decode(I,g);case 6:B=A.sent,o.postMessage({decoded:B,id:i},[B]);case 8:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}());var w=function(){function A(){B(this,A)}var t;return Q(A,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n,a;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.decodeBlock(t);case 2:if(i=A.sent,1===(I=e.Predictor||1)){A.next=9;break}return g=!e.StripOffsets,n=g?e.TileWidth:e.ImageWidth,a=g?e.TileLength:e.RowsPerStrip||e.ImageLength,A.abrupt("return",u(i,I,n,a,e.BitsPerSample,e.PlanarConfiguration));case 9:return A.abrupt("return",i);case 10:case"end":return A.stop()}}),A,this)}))),function(A,e){return t.apply(this,arguments)})}]),A}();function d(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var D=function(A){s(t,w);var e=d(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return A}}]),t}(),y=Object.freeze({__proto__:null,default:D});function k(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}function p(A,e){for(var t=e.length-1;t>=0;t--)A.push(e[t]);return A}function m(A){for(var e=new Uint16Array(4093),t=new Uint8Array(4093),i=0;i<=257;i++)e[i]=4096,t[i]=i;var r=258,I=9,g=0;function n(){r=258,I=9}function a(A){var e=function(A,e,t){var i=e%8,r=Math.floor(e/8),I=8-i,g=e+t-8*(r+1),n=8*(r+2)-(e+t),a=8*(r+2)-e;if(n=Math.max(0,n),r>=A.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var o=A[r]&Math.pow(2,8-i)-1,B=o<<=t-I;if(r+1<A.length){var C=A[r+1]>>>n;B+=C<<=Math.max(0,t-a)}if(g>8&&r+2<A.length){var Q=8*(r+3)-(e+t);B+=A[r+2]>>>Q}return B}(A,g,I);return g+=I,e}function o(A,i){return t[r]=i,e[r]=A,++r-1}function B(A){for(var i=[],r=A;4096!==r;r=e[r])i.push(t[r]);return i}var C=[];n();for(var Q,E=new Uint8Array(A),s=a(E);257!==s;){if(256===s){for(n(),s=a(E);256===s;)s=a(E);if(257===s)break;if(s>256)throw new Error("corrupted code at scanline ".concat(s));p(C,B(s)),Q=s}else if(s<r){var f=B(s);p(C,f),o(Q,f[f.length-1]),Q=s}else{var c=B(Q);if(!c)throw new Error("Bogus entry. Not in dictionary, ".concat(Q," / ").concat(r,", position: ").concat(g));p(C,c),C.push(c[c.length-1]),o(Q,c[c.length-1]),Q=s}r+1>=Math.pow(2,I)&&(12===I?Q=void 0:I++),s=a(E)}return new Uint8Array(C)}var G=function(A){s(t,w);var e=k(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return m(A).buffer}}]),t}(),F=Object.freeze({__proto__:null,default:G});function S(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var v=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function R(A,e){for(var t=0,i=[],r=16;r>0&&!A[r-1];)--r;i.push({children:[],index:0});for(var I,g=i[0],n=0;n<r;n++){for(var a=0;a<A[n];a++){for((g=i.pop()).children[g.index]=e[t];g.index>0;)g=i.pop();for(g.index++,i.push(g);i.length<=n;)i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I;t++}n+1<r&&(i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I)}return i[0].children}function U(A,e,i,r,I,g,n,a,o){var B=i.mcusPerLine,C=i.progressive,Q=e,E=e,s=0,f=0;function c(){if(f>0)return f--,s>>f&1;if(255===(s=A[E++])){var e=A[E++];if(e)throw new Error("unexpected marker: ".concat((s<<8|e).toString(16)))}return f=7,s>>>7}function h(A){for(var e,i=A;null!==(e=c());){if("number"==typeof(i=i[e]))return i;if("object"!==t(i))throw new Error("invalid huffman sequence")}return null}function l(A){for(var e=A,t=0;e>0;){var i=c();if(null===i)return;t=t<<1|i,--e}return t}function u(A){var e=l(A);return e>=1<<A-1?e:e+(-1<<A)+1}var w=0;var d,D=0;function y(A,e,t,i,r){var I=t%B,g=(t/B|0)*A.v+i,n=I*A.h+r;e(A,A.blocks[g][n])}function k(A,e,t){var i=t/A.blocksPerLine|0,r=t%A.blocksPerLine;e(A,A.blocks[i][r])}var p,m,G,F,S,R,U=r.length;R=C?0===g?0===a?function(A,e){var t=h(A.huffmanTableDC),i=0===t?0:u(t)<<o;A.pred+=i,e[0]=A.pred}:function(A,e){e[0]|=c()<<o}:0===a?function(A,e){if(w>0)w--;else for(var t=g,i=n;t<=i;){var r=h(A.huffmanTableAC),I=15&r,a=r>>4;if(0===I){if(a<15){w=l(a)+(1<<a)-1;break}t+=16}else e[v[t+=a]]=u(I)*(1<<o),t++}}:function(A,e){for(var t=g,i=n,r=0;t<=i;){var I=v[t],a=e[I]<0?-1:1;switch(D){case 0:var B=h(A.huffmanTableAC),C=15&B;if(r=B>>4,0===C)r<15?(w=l(r)+(1<<r),D=4):(r=16,D=1);else{if(1!==C)throw new Error("invalid ACn encoding");d=u(C),D=r?2:3}continue;case 1:case 2:e[I]?e[I]+=(c()<<o)*a:0==--r&&(D=2===D?3:0);break;case 3:e[I]?e[I]+=(c()<<o)*a:(e[I]=d<<o,D=0);break;case 4:e[I]&&(e[I]+=(c()<<o)*a)}t++}4===D&&0==--w&&(D=0)}:function(A,e){var t=h(A.huffmanTableDC),i=0===t?0:u(t);A.pred+=i,e[0]=A.pred;for(var r=1;r<64;){var I=h(A.huffmanTableAC),g=15&I,n=I>>4;if(0===g){if(n<15)break;r+=16}else e[v[r+=n]]=u(g),r++}};var L,b,M=0;b=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:B*i.mcusPerColumn;for(var N=I||b;M<b;){for(m=0;m<U;m++)r[m].pred=0;if(w=0,1===U)for(p=r[0],S=0;S<N;S++)k(p,R,M),M++;else for(S=0;S<N;S++){for(m=0;m<U;m++){var x=p=r[m],J=x.h,q=x.v;for(G=0;G<q;G++)for(F=0;F<J;F++)y(p,R,M,G,F)}if(++M===b)break}if(f=0,(L=A[E]<<8|A[E+1])<65280)throw new Error("marker was not found");if(!(L>=65488&&L<=65495))break;E+=2}return E-Q}function L(A,e){var t=[],i=e.blocksPerLine,r=e.blocksPerColumn,I=i<<3,g=new Int32Array(64),n=new Uint8Array(64);function a(A,t,i){var r,I,g,n,a,o,B,C,Q,E,s=e.quantizationTable,f=i;for(E=0;E<64;E++)f[E]=A[E]*s[E];for(E=0;E<8;++E){var c=8*E;0!==f[1+c]||0!==f[2+c]||0!==f[3+c]||0!==f[4+c]||0!==f[5+c]||0!==f[6+c]||0!==f[7+c]?(r=5793*f[0+c]+128>>8,I=5793*f[4+c]+128>>8,g=f[2+c],n=f[6+c],a=2896*(f[1+c]-f[7+c])+128>>8,C=2896*(f[1+c]+f[7+c])+128>>8,o=f[3+c]<<4,Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+128>>8,g=1567*g-3784*n+128>>8,n=Q,Q=a-(B=f[5+c]<<4)+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+c]=r+C,f[7+c]=r-C,f[1+c]=I+B,f[6+c]=I-B,f[2+c]=g+o,f[5+c]=g-o,f[3+c]=n+a,f[4+c]=n-a):(Q=5793*f[0+c]+512>>10,f[0+c]=Q,f[1+c]=Q,f[2+c]=Q,f[3+c]=Q,f[4+c]=Q,f[5+c]=Q,f[6+c]=Q,f[7+c]=Q)}for(E=0;E<8;++E){var h=E;0!==f[8+h]||0!==f[16+h]||0!==f[24+h]||0!==f[32+h]||0!==f[40+h]||0!==f[48+h]||0!==f[56+h]?(r=5793*f[0+h]+2048>>12,I=5793*f[32+h]+2048>>12,g=f[16+h],n=f[48+h],a=2896*(f[8+h]-f[56+h])+2048>>12,C=2896*(f[8+h]+f[56+h])+2048>>12,o=f[24+h],Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+2048>>12,g=1567*g-3784*n+2048>>12,n=Q,Q=a-(B=f[40+h])+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+h]=r+C,f[56+h]=r-C,f[8+h]=I+B,f[48+h]=I-B,f[16+h]=g+o,f[40+h]=g-o,f[24+h]=n+a,f[32+h]=n-a):(Q=5793*i[E+0]+8192>>14,f[0+h]=Q,f[8+h]=Q,f[16+h]=Q,f[24+h]=Q,f[32+h]=Q,f[40+h]=Q,f[48+h]=Q,f[56+h]=Q)}for(E=0;E<64;++E){var l=128+(f[E]+8>>4);t[E]=l<0?0:l>255?255:l}}for(var o=0;o<r;o++){for(var B=o<<3,C=0;C<8;C++)t.push(new Uint8Array(I));for(var Q=0;Q<i;Q++){a(e.blocks[o][Q],n,g);for(var E=0,s=Q<<3,f=0;f<8;f++)for(var c=t[B+f],h=0;h<8;h++)c[s+h]=n[E++]}}return t}var b=function(){function A(){B(this,A),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return Q(A,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(A){var e=0;function t(){var t=A[e]<<8|A[e+1];return e+=2,t}function i(A){var e,t,i=0,r=0;for(t in A.components)A.components.hasOwnProperty(t)&&(i<(e=A.components[t]).h&&(i=e.h),r<e.v&&(r=e.v));var I=Math.ceil(A.samplesPerLine/8/i),g=Math.ceil(A.scanLines/8/r);for(t in A.components)if(A.components.hasOwnProperty(t)){e=A.components[t];for(var n=Math.ceil(Math.ceil(A.samplesPerLine/8)*e.h/i),a=Math.ceil(Math.ceil(A.scanLines/8)*e.v/r),o=I*e.h,B=g*e.v,C=[],Q=0;Q<B;Q++){for(var E=[],s=0;s<o;s++)E.push(new Int32Array(64));C.push(E)}e.blocksPerLine=n,e.blocksPerColumn=a,e.blocks=C}A.maxH=i,A.maxV=r,A.mcusPerLine=I,A.mcusPerColumn=g}var r,I,g=t();if(65496!==g)throw new Error("SOI not found");for(g=t();65497!==g;){switch(g){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var n=(r=void 0,I=void 0,r=t(),I=A.subarray(e,e+r-2),e+=I.length,I);65504===g&&74===n[0]&&70===n[1]&&73===n[2]&&70===n[3]&&0===n[4]&&(this.jfif={version:{major:n[5],minor:n[6]},densityUnits:n[7],xDensity:n[8]<<8|n[9],yDensity:n[10]<<8|n[11],thumbWidth:n[12],thumbHeight:n[13],thumbData:n.subarray(14,14+3*n[12]*n[13])}),65518===g&&65===n[0]&&100===n[1]&&111===n[2]&&98===n[3]&&101===n[4]&&0===n[5]&&(this.adobe={version:n[6],flags0:n[7]<<8|n[8],flags1:n[9]<<8|n[10],transformCode:n[11]});break;case 65499:for(var a=t()+e-2;e<a;){var o=A[e++],B=new Int32Array(64);if(o>>4==0)for(var C=0;C<64;C++){B[v[C]]=A[e++]}else{if(o>>4!=1)throw new Error("DQT: invalid table spec");for(var Q=0;Q<64;Q++){B[v[Q]]=t()}}this.quantizationTables[15&o]=B}break;case 65472:case 65473:case 65474:t();for(var E={extended:65473===g,progressive:65474===g,precision:A[e++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=A[e++],f=void 0,c=0;c<s;c++){f=A[e];var h=A[e+1]>>4,l=15&A[e+1],u=A[e+2];E.componentsOrder.push(f),E.components[f]={h:h,v:l,quantizationIdx:u},e+=3}i(E),this.frames.push(E);break;case 65476:for(var w=t(),d=2;d<w;){for(var D=A[e++],y=new Uint8Array(16),k=0,p=0;p<16;p++,e++)y[p]=A[e],k+=y[p];for(var m=new Uint8Array(k),G=0;G<k;G++,e++)m[G]=A[e];d+=17+k,D>>4==0?this.huffmanTablesDC[15&D]=R(y,m):this.huffmanTablesAC[15&D]=R(y,m)}break;case 65501:t(),this.resetInterval=t();break;case 65498:t();for(var F=A[e++],S=[],L=this.frames[0],b=0;b<F;b++){var M=L.components[A[e++]],N=A[e++];M.huffmanTableDC=this.huffmanTablesDC[N>>4],M.huffmanTableAC=this.huffmanTablesAC[15&N],S.push(M)}var x=A[e++],J=A[e++],q=A[e++],Y=U(A,e,L,S,this.resetInterval,x,J,q>>4,15&q);e+=Y;break;case 65535:255!==A[e]&&e--;break;default:if(255===A[e-3]&&A[e-2]>=192&&A[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(g.toString(16)))}g=t()}}},{key:"getResult",value:function(){var A=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e<this.frames.length;e++)for(var t=this.frames[e].components,i=0,r=Object.keys(t);i<r.length;i++){var I=r[i];t[I].quantizationTable=this.quantizationTables[t[I].quantizationIdx],delete t[I].quantizationIdx}for(var g=A[0],n=g.components,a=g.componentsOrder,o=[],B=g.samplesPerLine,C=g.scanLines,Q=0;Q<a.length;Q++){var E=n[a[Q]];o.push({lines:L(0,E),scaleX:E.h/g.maxH,scaleY:E.v/g.maxV})}for(var s=new Uint8Array(B*C*o.length),f=0,c=0;c<C;++c)for(var h=0;h<B;++h)for(var l=0;l<o.length;++l){var u=o[l];s[f]=u.lines[0|c*u.scaleY][0|h*u.scaleX],++f}return s}}]),A}(),M=function(A){s(t,w);var e=S(t);function t(A){var i;return B(this,t),(i=e.call(this)).reader=new b,A.JPEGTables&&i.reader.parse(A.JPEGTables),i}return Q(t,[{key:"decodeBlock",value:function(A){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(A)),this.reader.getResult().buffer}}]),t}(),N=Object.freeze({__proto__:null,default:M});function x(A){for(var e=A.length;--e>=0;)A[e]=0}x(new Array(576)),x(new Array(60)),x(new Array(512)),x(new Array(256)),x(new Array(29)),x(new Array(30));var J=function(A,e,t,i){for(var r=65535&A|0,I=A>>>16&65535|0,g=0;0!==t;){t-=g=t>2e3?2e3:t;do{I=I+(r=r+e[i++]|0)|0}while(--g);r%=65521,I%=65521}return r|I<<16|0},q=new Uint32Array(function(){for(var A,e=[],t=0;t<256;t++){A=t;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A}return e}()),Y=function(A,e,t,i){var r=q,I=i+t;A^=-1;for(var g=i;g<I;g++)A=A>>>8^r[255&(A^e[g])];return-1^A},K={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},O=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},P=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!==t(i))throw new TypeError(i+"must be non-object");for(var r in i)O(i,r)&&(A[r]=i[r])}}return A},T=function(A){for(var e=0,t=0,i=A.length;t<i;t++)e+=A[t].length;for(var r=new Uint8Array(e),I=0,g=0,n=A.length;I<n;I++){var a=A[I];r.set(a,g),g+=a.length}return r},V=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){V=!1}for(var _=new Uint8Array(256),X=0;X<256;X++)_[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;_[254]=_[254]=1;var Z=function(A){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);var e,t,i,r,I,g=A.length,n=0;for(r=0;r<g;r++)55296==(64512&(t=A.charCodeAt(r)))&&r+1<g&&56320==(64512&(i=A.charCodeAt(r+1)))&&(t=65536+(t-55296<<10)+(i-56320),r++),n+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(n),I=0,r=0;I<n;r++)55296==(64512&(t=A.charCodeAt(r)))&&r+1<g&&56320==(64512&(i=A.charCodeAt(r+1)))&&(t=65536+(t-55296<<10)+(i-56320),r++),t<128?e[I++]=t:t<2048?(e[I++]=192|t>>>6,e[I++]=128|63&t):t<65536?(e[I++]=224|t>>>12,e[I++]=128|t>>>6&63,e[I++]=128|63&t):(e[I++]=240|t>>>18,e[I++]=128|t>>>12&63,e[I++]=128|t>>>6&63,e[I++]=128|63&t);return e},j=function(A,e){var t,i,r=e||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,e));var I=new Array(2*r);for(i=0,t=0;t<r;){var g=A[t++];if(g<128)I[i++]=g;else{var n=_[g];if(n>4)I[i++]=65533,t+=n-1;else{for(g&=2===n?31:3===n?15:7;n>1&&t<r;)g=g<<6|63&A[t++],n--;n>1?I[i++]=65533:g<65536?I[i++]=g:(g-=65536,I[i++]=55296|g>>10&1023,I[i++]=56320|1023&g)}}}return function(A,e){if(e<65534&&A.subarray&&V)return String.fromCharCode.apply(null,A.length===e?A:A.subarray(0,e));for(var t="",i=0;i<e;i++)t+=String.fromCharCode(A[i]);return t}(I,i)},W=function(A,e){(e=e||A.length)>A.length&&(e=A.length);for(var t=e-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?e:t+_[A[t]]>e?t:e};var z=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=A.state;t=A.next_in,k=A.input,i=t+(A.avail_in-5),r=A.next_out,p=A.output,I=r-(e-A.avail_out),g=r+(A.avail_out-257),n=m.dmax,a=m.wsize,o=m.whave,B=m.wnext,C=m.window,Q=m.hold,E=m.bits,s=m.lencode,f=m.distcode,c=(1<<m.lenbits)-1,h=(1<<m.distbits)-1;A:do{E<15&&(Q+=k[t++]<<E,E+=8,Q+=k[t++]<<E,E+=8),l=s[Q&c];e:for(;;){if(Q>>>=u=l>>>24,E-=u,0===(u=l>>>16&255))p[r++]=65535&l;else{if(!(16&u)){if(0==(64&u)){l=s[(65535&l)+(Q&(1<<u)-1)];continue e}if(32&u){m.mode=12;break A}A.msg="invalid literal/length code",m.mode=30;break A}w=65535&l,(u&=15)&&(E<u&&(Q+=k[t++]<<E,E+=8),w+=Q&(1<<u)-1,Q>>>=u,E-=u),E<15&&(Q+=k[t++]<<E,E+=8,Q+=k[t++]<<E,E+=8),l=f[Q&h];t:for(;;){if(Q>>>=u=l>>>24,E-=u,!(16&(u=l>>>16&255))){if(0==(64&u)){l=f[(65535&l)+(Q&(1<<u)-1)];continue t}A.msg="invalid distance code",m.mode=30;break A}if(d=65535&l,E<(u&=15)&&(Q+=k[t++]<<E,(E+=8)<u&&(Q+=k[t++]<<E,E+=8)),(d+=Q&(1<<u)-1)>n){A.msg="invalid distance too far back",m.mode=30;break A}if(Q>>>=u,E-=u,d>(u=r-I)){if((u=d-u)>o&&m.sane){A.msg="invalid distance too far back",m.mode=30;break A}if(D=0,y=C,0===B){if(D+=a-u,u<w){w-=u;do{p[r++]=C[D++]}while(--u);D=r-d,y=p}}else if(B<u){if(D+=a+B-u,(u-=B)<w){w-=u;do{p[r++]=C[D++]}while(--u);if(D=0,B<w){w-=u=B;do{p[r++]=C[D++]}while(--u);D=r-d,y=p}}}else if(D+=B-u,u<w){w-=u;do{p[r++]=C[D++]}while(--u);D=r-d,y=p}for(;w>2;)p[r++]=y[D++],p[r++]=y[D++],p[r++]=y[D++],w-=3;w&&(p[r++]=y[D++],w>1&&(p[r++]=y[D++]))}else{D=r-d;do{p[r++]=p[D++],p[r++]=p[D++],p[r++]=p[D++],w-=3}while(w>2);w&&(p[r++]=p[D++],w>1&&(p[r++]=p[D++]))}break}}break}}while(t<i&&r<g);t-=w=E>>3,Q&=(1<<(E-=w<<3))-1,A.next_in=t,A.next_out=r,A.avail_in=t<i?i-t+5:5-(t-i),A.avail_out=r<g?g-r+257:257-(r-g),m.hold=Q,m.bits=E},AA=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),eA=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tA=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),iA=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),rA=function(A,e,t,i,r,I,g,n){var a,o,B,C,Q,E,s,f,c,h=n.bits,l=0,u=0,w=0,d=0,D=0,y=0,k=0,p=0,m=0,G=0,F=null,S=0,v=new Uint16Array(16),R=new Uint16Array(16),U=null,L=0;for(l=0;l<=15;l++)v[l]=0;for(u=0;u<i;u++)v[e[t+u]]++;for(D=h,d=15;d>=1&&0===v[d];d--);if(D>d&&(D=d),0===d)return r[I++]=20971520,r[I++]=20971520,n.bits=1,0;for(w=1;w<d&&0===v[w];w++);for(D<w&&(D=w),p=1,l=1;l<=15;l++)if(p<<=1,(p-=v[l])<0)return-1;if(p>0&&(0===A||1!==d))return-1;for(R[1]=0,l=1;l<15;l++)R[l+1]=R[l]+v[l];for(u=0;u<i;u++)0!==e[t+u]&&(g[R[e[t+u]]++]=u);if(0===A?(F=U=g,E=19):1===A?(F=AA,S-=257,U=eA,L-=257,E=256):(F=tA,U=iA,E=-1),G=0,u=0,l=w,Q=I,y=D,k=0,B=-1,C=(m=1<<D)-1,1===A&&m>852||2===A&&m>592)return 1;for(;;){s=l-k,g[u]<E?(f=0,c=g[u]):g[u]>E?(f=U[L+g[u]],c=F[S+g[u]]):(f=96,c=0),a=1<<l-k,w=o=1<<y;do{r[Q+(G>>k)+(o-=a)]=s<<24|f<<16|c|0}while(0!==o);for(a=1<<l-1;G&a;)a>>=1;if(0!==a?(G&=a-1,G+=a):G=0,u++,0==--v[l]){if(l===d)break;l=e[t+g[u]]}if(l>D&&(G&C)!==B){for(0===k&&(k=D),Q+=w,p=1<<(y=l-k);y+k<d&&!((p-=v[y+k])<=0);)y++,p<<=1;if(m+=1<<y,1===A&&m>852||2===A&&m>592)return 1;r[B=G&C]=D<<24|y<<16|Q-I|0}}return 0!==G&&(r[Q+G]=l-k<<24|64<<16|0),n.bits=D,0},IA=H.Z_FINISH,gA=H.Z_BLOCK,nA=H.Z_TREES,aA=H.Z_OK,oA=H.Z_STREAM_END,BA=H.Z_NEED_DICT,CA=H.Z_STREAM_ERROR,QA=H.Z_DATA_ERROR,EA=H.Z_MEM_ERROR,sA=H.Z_BUF_ERROR,fA=H.Z_DEFLATED,cA=function(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)};function hA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var lA,uA,wA=function(A){if(!A||!A.state)return CA;var e=A.state;return A.total_in=A.total_out=e.total=0,A.msg="",e.wrap&&(A.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,aA},dA=function(A){if(!A||!A.state)return CA;var e=A.state;return e.wsize=0,e.whave=0,e.wnext=0,wA(A)},DA=function(A,e){var t;if(!A||!A.state)return CA;var i=A.state;return e<0?(t=0,e=-e):(t=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?CA:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,dA(A))},yA=function(A,e){if(!A)return CA;var t=new hA;A.state=t,t.window=null;var i=DA(A,e);return i!==aA&&(A.state=null),i},kA=!0,pA=function(A){if(kA){lA=new Int32Array(512),uA=new Int32Array(32);for(var e=0;e<144;)A.lens[e++]=8;for(;e<256;)A.lens[e++]=9;for(;e<280;)A.lens[e++]=7;for(;e<288;)A.lens[e++]=8;for(rA(1,A.lens,0,288,lA,0,A.work,{bits:9}),e=0;e<32;)A.lens[e++]=5;rA(2,A.lens,0,32,uA,0,A.work,{bits:5}),kA=!1}A.lencode=lA,A.lenbits=9,A.distcode=uA,A.distbits=5},mA=function(A,e,t,i){var r,I=A.state;return null===I.window&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new Uint8Array(I.wsize)),i>=I.wsize?(I.window.set(e.subarray(t-I.wsize,t),0),I.wnext=0,I.whave=I.wsize):((r=I.wsize-I.wnext)>i&&(r=i),I.window.set(e.subarray(t-i,t-i+r),I.wnext),(i-=r)?(I.window.set(e.subarray(t-i,t),0),I.wnext=i,I.whave=I.wsize):(I.wnext+=r,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=r))),0},GA={inflateReset:dA,inflateReset2:DA,inflateResetKeep:wA,inflateInit:function(A){return yA(A,15)},inflateInit2:yA,inflate:function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=0,G=new Uint8Array(4),F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!A||!A.state||!A.output||!A.input&&0!==A.avail_in)return CA;12===(t=A.state).mode&&(t.mode=13),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,C=n,Q=a,y=aA;A:for(;;)switch(t.mode){case 1:if(0===t.wrap){t.mode=13;break}for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(2&t.wrap&&35615===o){t.check=0,G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0),o=0,B=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&o)<<8)+(o>>8))%31){A.msg="incorrect header check",t.mode=30;break}if((15&o)!==fA){A.msg="unknown compression method",t.mode=30;break}if(B-=4,D=8+(15&(o>>>=4)),0===t.wbits)t.wbits=D;else if(D>t.wbits){A.msg="invalid window size",t.mode=30;break}t.dmax=1<<t.wbits,A.adler=t.check=1,t.mode=512&o?10:12,o=0,B=0;break;case 2:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(t.flags=o,(255&t.flags)!==fA){A.msg="unknown compression method",t.mode=30;break}if(57344&t.flags){A.msg="unknown header flags set",t.mode=30;break}t.head&&(t.head.text=o>>8&1),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=3;case 3:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.head&&(t.head.time=o),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,G[2]=o>>>16&255,G[3]=o>>>24&255,t.check=Y(t.check,G,4,0)),o=0,B=0,t.mode=4;case 4:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.head&&(t.head.xflags=255&o,t.head.os=o>>8),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=5;case 5:if(1024&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.length=o,t.head&&(t.head.extra_len=o),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((E=t.length)>n&&(E=n),E&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(I,I+E),D)),512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,t.length-=E),t.length))break A;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D))}while(D&&E<n);if(512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,D)break A}else t.head&&(t.head.name=null);t.length=0,t.mode=8;case 8:if(4096&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.comment+=String.fromCharCode(D))}while(D&&E<n);if(512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,D)break A}else t.head&&(t.head.comment=null);t.mode=9;case 9:if(512&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(o!==(65535&t.check)){A.msg="header crc mismatch",t.mode=30;break}o=0,B=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),A.adler=t.check=0,t.mode=12;break;case 10:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}A.adler=t.check=cA(o),o=0,B=0,t.mode=11;case 11:if(0===t.havedict)return A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,BA;A.adler=t.check=1,t.mode=12;case 12:if(e===gA||e===nA)break A;case 13:if(t.last){o>>>=7&B,B-=7&B,t.mode=27;break}for(;B<3;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}switch(t.last=1&o,B-=1,3&(o>>>=1)){case 0:t.mode=14;break;case 1:if(pA(t),t.mode=20,e===nA){o>>>=2,B-=2;break A}break;case 2:t.mode=17;break;case 3:A.msg="invalid block type",t.mode=30}o>>>=2,B-=2;break;case 14:for(o>>>=7&B,B-=7&B;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if((65535&o)!=(o>>>16^65535)){A.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&o,o=0,B=0,t.mode=15,e===nA)break A;case 15:t.mode=16;case 16:if(E=t.length){if(E>n&&(E=n),E>a&&(E=a),0===E)break A;r.set(i.subarray(I,I+E),g),n-=E,I+=E,a-=E,g+=E,t.length-=E;break}t.mode=12;break;case 17:for(;B<14;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(t.nlen=257+(31&o),o>>>=5,B-=5,t.ndist=1+(31&o),o>>>=5,B-=5,t.ncode=4+(15&o),o>>>=4,B-=4,t.nlen>286||t.ndist>30){A.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have<t.ncode;){for(;B<3;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.lens[F[t.have++]]=7&o,o>>>=3,B-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},y=rA(0,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have<t.nlen+t.ndist;){for(;h=(m=t.lencode[o&(1<<t.lenbits)-1])>>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(l<16)o>>>=c,B-=c,t.lens[t.have++]=l;else{if(16===l){for(p=c+2;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(o>>>=c,B-=c,0===t.have){A.msg="invalid bit length repeat",t.mode=30;break}D=t.lens[t.have-1],E=3+(3&o),o>>>=2,B-=2}else if(17===l){for(p=c+3;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}B-=c,D=0,E=3+(7&(o>>>=c)),o>>>=3,B-=3}else{for(p=c+7;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}B-=c,D=0,E=11+(127&(o>>>=c)),o>>>=7,B-=7}if(t.have+E>t.nlen+t.ndist){A.msg="invalid bit length repeat",t.mode=30;break}for(;E--;)t.lens[t.have++]=D}}if(30===t.mode)break;if(0===t.lens[256]){A.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,k={bits:t.lenbits},y=rA(1,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},y=rA(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,y){A.msg="invalid distances set",t.mode=30;break}if(t.mode=20,e===nA)break A;case 20:t.mode=21;case 21:if(n>=6&&a>=258){A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,$(A,Q),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,12===t.mode&&(t.back=-1);break}for(t.back=0;h=(m=t.lencode[o&(1<<t.lenbits)-1])>>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(h&&0==(240&h)){for(u=c,w=h,d=l;h=(m=t.lencode[d+((o&(1<<u+w)-1)>>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}o>>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,t.length=l,0===h){t.mode=26;break}if(32&h){t.back=-1,t.mode=12;break}if(64&h){A.msg="invalid literal/length code",t.mode=30;break}t.extra=15&h,t.mode=22;case 22:if(t.extra){for(p=t.extra;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.length+=o&(1<<t.extra)-1,o>>>=t.extra,B-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;h=(m=t.distcode[o&(1<<t.distbits)-1])>>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(0==(240&h)){for(u=c,w=h,d=l;h=(m=t.distcode[d+((o&(1<<u+w)-1)>>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}o>>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,64&h){A.msg="invalid distance code",t.mode=30;break}t.offset=l,t.extra=15&h,t.mode=24;case 24:if(t.extra){for(p=t.extra;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.offset+=o&(1<<t.extra)-1,o>>>=t.extra,B-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){A.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(0===a)break A;if(E=Q-a,t.offset>E){if((E=t.offset-E)>t.whave&&t.sane){A.msg="invalid distance too far back",t.mode=30;break}E>t.wnext?(E-=t.wnext,s=t.wsize-E):s=t.wnext-E,E>t.length&&(E=t.length),f=t.window}else f=r,s=g-t.offset,E=t.length;E>a&&(E=a),a-=E,t.length-=E;do{r[g++]=f[s++]}while(--E);0===t.length&&(t.mode=21);break;case 26:if(0===a)break A;r[g++]=t.length,a--,t.mode=21;break;case 27:if(t.wrap){for(;B<32;){if(0===n)break A;n--,o|=i[I++]<<B,B+=8}if(Q-=a,A.total_out+=Q,t.total+=Q,Q&&(A.adler=t.check=t.flags?Y(t.check,r,Q,g-Q):J(t.check,r,Q,g-Q)),Q=a,(t.flags?o:cA(o))!==t.check){A.msg="incorrect data check",t.mode=30;break}o=0,B=0}t.mode=28;case 28:if(t.wrap&&t.flags){for(;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(o!==(4294967295&t.total)){A.msg="incorrect length check",t.mode=30;break}o=0,B=0}t.mode=29;case 29:y=oA;break A;case 30:y=QA;break A;case 31:return EA;default:return CA}return A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,(t.wsize||Q!==A.avail_out&&t.mode<30&&(t.mode<27||e!==IA))&&mA(A,A.output,A.next_out,Q-A.avail_out),C-=A.avail_in,Q-=A.avail_out,A.total_in+=C,A.total_out+=Q,t.total+=Q,t.wrap&&Q&&(A.adler=t.check=t.flags?Y(t.check,r,Q,A.next_out-Q):J(t.check,r,Q,A.next_out-Q)),A.data_type=t.bits+(t.last?64:0)+(12===t.mode?128:0)+(20===t.mode||15===t.mode?256:0),(0===C&&0===Q||e===IA)&&y===aA&&(y=sA),y},inflateEnd:function(A){if(!A||!A.state)return CA;var e=A.state;return e.window&&(e.window=null),A.state=null,aA},inflateGetHeader:function(A,e){if(!A||!A.state)return CA;var t=A.state;return 0==(2&t.wrap)?CA:(t.head=e,e.done=!1,aA)},inflateSetDictionary:function(A,e){var t,i=e.length;return A&&A.state?0!==(t=A.state).wrap&&11!==t.mode?CA:11===t.mode&&J(1,e,i,0)!==t.check?QA:mA(A,e,i,i)?(t.mode=31,EA):(t.havedict=1,aA):CA},inflateInfo:"pako inflate (from Nodeca project)"};var FA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},SA=Object.prototype.toString,vA=H.Z_NO_FLUSH,RA=H.Z_FINISH,UA=H.Z_OK,LA=H.Z_STREAM_END,bA=H.Z_NEED_DICT,MA=H.Z_STREAM_ERROR,NA=H.Z_DATA_ERROR,xA=H.Z_MEM_ERROR;function JA(A){this.options=P({chunkSize:65536,windowBits:15,to:""},A||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||A&&A.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new z,this.strm.avail_out=0;var t=GA.inflateInit2(this.strm,e.windowBits);if(t!==UA)throw new Error(K[t]);if(this.header=new FA,GA.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Z(e.dictionary):"[object ArrayBuffer]"===SA.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=GA.inflateSetDictionary(this.strm,e.dictionary))!==UA))throw new Error(K[t])}function qA(A,e){var t=new JA(e);if(t.push(A),t.err)throw t.msg||K[t.err];return t.result}JA.prototype.push=function(A,e){var t,i,r,I=this.strm,g=this.options.chunkSize,n=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?RA:vA,"[object ArrayBuffer]"===SA.call(A)?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;;){for(0===I.avail_out&&(I.output=new Uint8Array(g),I.next_out=0,I.avail_out=g),(t=GA.inflate(I,i))===bA&&n&&((t=GA.inflateSetDictionary(I,n))===UA?t=GA.inflate(I,i):t===NA&&(t=bA));I.avail_in>0&&t===LA&&I.state.wrap>0&&0!==A[I.next_in];)GA.inflateReset(I),t=GA.inflate(I,i);switch(t){case MA:case NA:case bA:case xA:return this.onEnd(t),this.ended=!0,!1}if(r=I.avail_out,I.next_out&&(0===I.avail_out||t===LA))if("string"===this.options.to){var a=W(I.output,I.next_out),o=I.next_out-a,B=j(I.output,a);I.next_out=o,I.avail_out=g-o,o&&I.output.set(I.output.subarray(a,a+o),0),this.onData(B)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(t!==UA||0!==r){if(t===LA)return t=GA.inflateEnd(this.strm),this.onEnd(t),this.ended=!0,!0;if(0===I.avail_in)break}}return!0},JA.prototype.onData=function(A){this.chunks.push(A)},JA.prototype.onEnd=function(A){A===UA&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=T(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var YA={Inflate:JA,inflate:qA,inflateRaw:function(A,e){return(e=e||{}).raw=!0,qA(A,e)},ungzip:qA,constants:H}.inflate;function KA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var HA=function(A){s(t,w);var e=KA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return YA(new Uint8Array(A)).buffer}}]),t}(),OA=Object.freeze({__proto__:null,default:HA});function PA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var TA,VA=function(A){s(t,w);var e=PA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){for(var e=new DataView(A),t=[],i=0;i<A.byteLength;++i){var r=e.getInt8(i);if(r<0){var I=e.getUint8(i+1);r=-r;for(var g=0;g<=r;++g)t.push(I);i+=1}else{for(var n=0;n<=r;++n)t.push(e.getUint8(i+n+1));i+=r+1}}return new Uint8Array(t).buffer}}]),t}(),_A=Object.freeze({__proto__:null,default:VA}),XA={exports:{}};TA=XA,\n/* Copyright 2015-2021 Esri. 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 @preserve */\nfunction(){var A,e,t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c=(A={defaultNoDataValue:-34027999387901484e22,decode:function(I,g){var n=(g=g||{}).encodedMaskData||null===g.encodedMaskData,a=r(I,g.inputOffset||0,n),o=null!==g.noDataValue?g.noDataValue:A.defaultNoDataValue,B=e(a,g.pixelType||Float32Array,g.encodedMaskData,o,g.returnMask),C={width:a.width,height:a.height,pixelData:B.resultPixels,minValue:B.minValue,maxValue:a.pixels.maxValue,noDataValue:o};return B.resultMask&&(C.maskData=B.resultMask),g.returnEncodedMask&&a.mask&&(C.encodedMaskData=a.mask.bitset?a.mask.bitset:null),g.returnFileInfo&&(C.fileInfo=t(a),g.computeUsedBitDepths&&(C.fileInfo.bitDepths=i(a))),C}},e=function(A,e,t,i,r){var g,n,a,o=0,B=A.pixels.numBlocksX,C=A.pixels.numBlocksY,Q=Math.floor(A.width/B),E=Math.floor(A.height/C),s=2*A.maxZError,f=Number.MAX_VALUE;t=t||(A.mask?A.mask.bitset:null),n=new e(A.width*A.height),r&&t&&(a=new Uint8Array(A.width*A.height));for(var c,h,l=new Float32Array(Q*E),u=0;u<=C;u++){var w=u!==C?E:A.height%C;if(0!==w)for(var d=0;d<=B;d++){var D=d!==B?Q:A.width%B;if(0!==D){var y,k,p,m,G=u*A.width*E+d*Q,F=A.width-D,S=A.pixels.blocks[o];if(S.encoding<2?(0===S.encoding?y=S.rawData:(I(S.stuffedData,S.bitsPerPixel,S.numValidPixels,S.offset,s,l,A.pixels.maxValue),y=l),k=0):p=2===S.encoding?0:S.offset,t)for(h=0;h<w;h++){for(7&G&&(m=t[G>>3],m<<=7&G),c=0;c<D;c++)7&G||(m=t[G>>3]),128&m?(a&&(a[G]=1),f=f>(g=S.encoding<2?y[k++]:p)?g:f,n[G++]=g):(a&&(a[G]=0),n[G++]=i),m<<=1;G+=F}else if(S.encoding<2)for(h=0;h<w;h++){for(c=0;c<D;c++)f=f>(g=y[k++])?g:f,n[G++]=g;G+=F}else for(f=f>p?p:f,h=0;h<w;h++){for(c=0;c<D;c++)n[G++]=p;G+=F}if(1===S.encoding&&k!==S.numValidPixels)throw"Block and Mask do not match";o++}}}return{resultPixels:n,resultMask:a,minValue:f}},t=function(A){return{fileIdentifierString:A.fileIdentifierString,fileVersion:A.fileVersion,imageType:A.imageType,height:A.height,width:A.width,maxZError:A.maxZError,eofOffset:A.eofOffset,mask:A.mask?{numBlocksX:A.mask.numBlocksX,numBlocksY:A.mask.numBlocksY,numBytes:A.mask.numBytes,maxValue:A.mask.maxValue}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,numBytes:A.pixels.numBytes,maxValue:A.pixels.maxValue,noDataValue:A.noDataValue}}},i=function(A){for(var e=A.pixels.numBlocksX*A.pixels.numBlocksY,t={},i=0;i<e;i++){var r=A.pixels.blocks[i];0===r.encoding?t.float32=!0:1===r.encoding?t[r.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},r=function(A,e,t){var i={},r=new Uint8Array(A,e,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,r),"CntZImage"!==i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;e+=10;var I=new DataView(A,e,24);if(i.fileVersion=I.getInt32(0,!0),i.imageType=I.getInt32(4,!0),i.height=I.getUint32(8,!0),i.width=I.getUint32(12,!0),i.maxZError=I.getFloat64(16,!0),e+=24,!t)if(I=new DataView(A,e,16),i.mask={},i.mask.numBlocksY=I.getUint32(0,!0),i.mask.numBlocksX=I.getUint32(4,!0),i.mask.numBytes=I.getUint32(8,!0),i.mask.maxValue=I.getFloat32(12,!0),e+=16,i.mask.numBytes>0){var g=new Uint8Array(Math.ceil(i.width*i.height/8)),n=(I=new DataView(A,e,i.mask.numBytes)).getInt16(0,!0),a=2,o=0;do{if(n>0)for(;n--;)g[o++]=I.getUint8(a++);else{var B=I.getUint8(a++);for(n=-n;n--;)g[o++]=B}n=I.getInt16(a,!0),a+=2}while(a<i.mask.numBytes);if(-32768!==n||o<g.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=g,e+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));I=new DataView(A,e,16),i.pixels={},i.pixels.numBlocksY=I.getUint32(0,!0),i.pixels.numBlocksX=I.getUint32(4,!0),i.pixels.numBytes=I.getUint32(8,!0),i.pixels.maxValue=I.getFloat32(12,!0),e+=16;var C=i.pixels.numBlocksX,Q=i.pixels.numBlocksY,E=C+(i.width%C>0?1:0),s=Q+(i.height%Q>0?1:0);i.pixels.blocks=new Array(E*s);for(var f=0,c=0;c<s;c++)for(var h=0;h<E;h++){var l=0,u=A.byteLength-e;I=new DataView(A,e,Math.min(10,u));var w={};i.pixels.blocks[f++]=w;var d=I.getUint8(0);if(l++,w.encoding=63&d,w.encoding>3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==d&&2!==d){if(d>>=6,w.offsetType=d,2===d)w.offset=I.getInt8(1),l++;else if(1===d)w.offset=I.getInt16(1,!0),l+=2;else{if(0!==d)throw"Invalid block offset type";w.offset=I.getFloat32(1,!0),l+=4}if(1===w.encoding)if(d=I.getUint8(l),l++,w.bitsPerPixel=63&d,d>>=6,w.numValidPixelsType=d,2===d)w.numValidPixels=I.getUint8(l),l++;else if(1===d)w.numValidPixels=I.getUint16(l,!0),l+=2;else{if(0!==d)throw"Invalid valid pixel count type";w.numValidPixels=I.getUint32(l,!0),l+=4}}var D;if(e+=l,3!==w.encoding)if(0===w.encoding){var y=(i.pixels.numBytes-1)/4;if(y!==Math.floor(y))throw"uncompressed block has invalid length";D=new ArrayBuffer(4*y),new Uint8Array(D).set(new Uint8Array(A,e,4*y));var k=new Float32Array(D);w.rawData=k,e+=4*y}else if(1===w.encoding){var p=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),m=Math.ceil(p/4);D=new ArrayBuffer(4*m),new Uint8Array(D).set(new Uint8Array(A,e,p)),w.stuffedData=new Uint32Array(D),e+=p}}else e++}return i.eofOffset=e,i},I=function(A,e,t,i,r,I,g){var n,a,o,B=(1<<e)-1,C=0,Q=0,E=Math.ceil((g-i)/r),s=4*A.length-Math.ceil(e*t/8);for(A[A.length-1]<<=8*s,n=0;n<t;n++){if(0===Q&&(o=A[C++],Q=32),Q>=e)a=o>>>Q-e&B,Q-=e;else{var f=e-Q;a=(o&B)<<f&B,a+=(o=A[C++])>>>(Q=32-f)}I[n]=a<E?i+a*r:g}return I},A),h=(g=function(A,e,t,i,r,I,g,n){var a,o,B,C,Q,E=(1<<t)-1,s=0,f=0,c=4*A.length-Math.ceil(t*i/8);if(A[A.length-1]<<=8*c,r)for(a=0;a<i;a++)0===f&&(B=A[s++],f=32),f>=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=r[o];else for(Q=Math.ceil((n-I)/g),a=0;a<i;a++)0===f&&(B=A[s++],f=32),f>=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=o<Q?I+o*g:n},n=function(A,e,t,i,r,I){var g,n=(1<<e)-1,a=0,o=0,B=0,C=0,Q=0,E=[],s=4*A.length-Math.ceil(e*t/8);A[A.length-1]<<=8*s;var f=Math.ceil((I-i)/r);for(o=0;o<t;o++)0===C&&(g=A[a++],C=32),C>=e?(Q=g>>>C-e&n,C-=e):(Q=(g&n)<<(B=e-C)&n,Q+=(g=A[a++])>>>(C=32-B)),E[o]=Q<f?i+Q*r:I;return E.unshift(i),E},a=function(A,e,t,i,r,I,g,n){var a,o,B,C,Q=(1<<t)-1,E=0,s=0,f=0;if(r)for(a=0;a<i;a++)0===s&&(B=A[E++],s=32,f=0),s>=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<<C)-1)<<t-C,f=C),e[a]=r[o];else{var c=Math.ceil((n-I)/g);for(a=0;a<i;a++)0===s&&(B=A[E++],s=32,f=0),s>=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<<C)-1)<<t-C,f=C),e[a]=o<c?I+o*g:n}return e},o=function(A,e,t,i,r,I){var g,n=(1<<e)-1,a=0,o=0,B=0,C=0,Q=0,E=0,s=[],f=Math.ceil((I-i)/r);for(o=0;o<t;o++)0===C&&(g=A[a++],C=32,E=0),C>=e?(Q=g>>>E&n,C-=e,E+=e):(Q=g>>>E&n,C=32-(B=e-C),Q|=((g=A[a++])&(1<<B)-1)<<e-B,E=B),s[o]=Q<f?i+Q*r:I;return s.unshift(i),s},B=function(A,e,t,i){var r,I,g,n,a=(1<<t)-1,o=0,B=0,C=4*A.length-Math.ceil(t*i/8);for(A[A.length-1]<<=8*C,r=0;r<i;r++)0===B&&(g=A[o++],B=32),B>=t?(I=g>>>B-t&a,B-=t):(I=(g&a)<<(n=t-B)&a,I+=(g=A[o++])>>>(B=32-n)),e[r]=I;return e},C=function(A,e,t,i){var r,I,g,n,a=(1<<t)-1,o=0,B=0,C=0;for(r=0;r<i;r++)0===B&&(g=A[o++],B=32,C=0),B>=t?(I=g>>>C&a,B-=t,C+=t):(I=g>>>C&a,B=32-(n=t-B),I|=((g=A[o++])&(1<<n)-1)<<t-n,C=n),e[r]=I;return e},Q={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(A){for(var e=65535,t=65535,i=A.length,r=Math.floor(i/2),I=0;r;){var g=r>=359?359:r;r-=g;do{e+=A[I++]<<8,t+=e+=A[I++]}while(--g);e=(65535&e)+(e>>>16),t=(65535&t)+(t>>>16)}return 1&i&&(t+=e+=A[I]<<8),((t=(65535&t)+(t>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(A,e){var t=e.ptr,i=new Uint8Array(A,t,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;t+=6;var I,g=new DataView(A,t,8),n=g.getInt32(0,!0);if(r.fileVersion=n,t+=4,n>=3&&(r.checksum=g.getUint32(4,!0),t+=4),g=new DataView(A,t,12),r.height=g.getUint32(0,!0),r.width=g.getUint32(4,!0),t+=8,n>=4?(r.numDims=g.getUint32(8,!0),t+=4):r.numDims=1,g=new DataView(A,t,40),r.numValidPixel=g.getUint32(0,!0),r.microBlockSize=g.getInt32(4,!0),r.blobSize=g.getInt32(8,!0),r.imageType=g.getInt32(12,!0),r.maxZError=g.getFloat64(16,!0),r.zMin=g.getFloat64(24,!0),r.zMax=g.getFloat64(32,!0),t+=40,e.headerInfo=r,e.ptr=t,n>=3&&(I=n>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(A,t-I,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(A,e){var t=e.headerInfo,i=this.getDataTypeArray(t.imageType),r=t.numDims*this.getDataTypeSize(t.imageType),I=this.readSubArray(A,e.ptr,i,r),g=this.readSubArray(A,e.ptr+r,i,r);e.ptr+=2*r;var n,a=!0;for(n=0;n<t.numDims;n++)if(I[n]!==g[n]){a=!1;break}return t.minValues=I,t.maxValues=g,a},readSubArray:function(A,e,t,i){var r;if(t===Uint8Array)r=new Uint8Array(A,e,i);else{var I=new ArrayBuffer(i);new Uint8Array(I).set(new Uint8Array(A,e,i)),r=new t(I)}return r},readMask:function(A,e){var t,i,r=e.ptr,I=e.headerInfo,g=I.width*I.height,n=I.numValidPixel,a=new DataView(A,r,4),o={};if(o.numBytes=a.getUint32(0,!0),r+=4,(0===n||g===n)&&0!==o.numBytes)throw"invalid mask";if(0===n)t=new Uint8Array(Math.ceil(g/8)),o.bitset=t,i=new Uint8Array(g),e.pixels.resultMask=i,r+=o.numBytes;else if(o.numBytes>0){t=new Uint8Array(Math.ceil(g/8));var B=(a=new DataView(A,r,o.numBytes)).getInt16(0,!0),C=2,Q=0,E=0;do{if(B>0)for(;B--;)t[Q++]=a.getUint8(C++);else for(E=a.getUint8(C++),B=-B;B--;)t[Q++]=E;B=a.getInt16(C,!0),C+=2}while(C<o.numBytes);if(-32768!==B||Q<t.length)throw"Unexpected end of mask RLE encoding";i=new Uint8Array(g);var s=0,f=0;for(f=0;f<g;f++)7&f?(s=t[f>>3],s<<=7&f):s=t[f>>3],128&s&&(i[f]=1);e.pixels.resultMask=i,o.bitset=t,r+=o.numBytes}return e.ptr=r,e.mask=o,!0},readDataOneSweep:function(A,e,t,i){var r,I=e.ptr,g=e.headerInfo,n=g.numDims,a=g.width*g.height,o=g.imageType,B=g.numValidPixel*Q.getDataTypeSize(o)*n,C=e.pixels.resultMask;if(t===Uint8Array)r=new Uint8Array(A,I,B);else{var E=new ArrayBuffer(B);new Uint8Array(E).set(new Uint8Array(A,I,B)),r=new t(E)}if(r.length===a*n)e.pixels.resultPixels=i?Q.swapDimensionOrder(r,a,n,t,!0):r;else{e.pixels.resultPixels=new t(a*n);var s=0,f=0,c=0,h=0;if(n>1){if(i){for(f=0;f<a;f++)if(C[f])for(h=f,c=0;c<n;c++,h+=a)e.pixels.resultPixels[h]=r[s++]}else for(f=0;f<a;f++)if(C[f])for(h=f*n,c=0;c<n;c++)e.pixels.resultPixels[h+c]=r[s++]}else for(f=0;f<a;f++)C[f]&&(e.pixels.resultPixels[f]=r[s++])}return I+=B,e.ptr=I,!0},readHuffmanTree:function(A,e){var t=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(A,e.ptr,16);if(e.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var r=i.getInt32(4,!0),I=i.getInt32(8,!0),g=i.getInt32(12,!0);if(I>=g)return!1;var n=new Uint32Array(g-I);Q.decodeBits(A,e,n);var a,o,B,C,s=[];for(a=I;a<g;a++)s[o=a-(a<r?0:r)]={first:n[a-I],second:null};var f=A.byteLength-e.ptr,c=Math.ceil(f/4),h=new ArrayBuffer(4*c);new Uint8Array(h).set(new Uint8Array(A,e.ptr,f));var l,u=new Uint32Array(h),w=0,d=0;for(l=u[0],a=I;a<g;a++)(C=s[o=a-(a<r?0:r)].first)>0&&(s[o].second=l<<w>>>32-C,32-w>=C?32===(w+=C)&&(w=0,l=u[++d]):(w+=C-32,l=u[++d],s[o].second|=l>>>32-w));var D=0,y=0,k=new E;for(a=0;a<s.length;a++)void 0!==s[a]&&(D=Math.max(D,s[a].first));y=D>=t?t:D;var p,m,G,F,S,v=[];for(a=I;a<g;a++)if((C=s[o=a-(a<r?0:r)].first)>0)if(p=[C,o],C<=y)for(m=s[o].second<<y-C,G=1<<y-C,B=0;B<G;B++)v[m|B]=p;else for(m=s[o].second,S=k,F=C-1;F>=0;F--)m>>>F&1?(S.right||(S.right=new E),S=S.right):(S.left||(S.left=new E),S=S.left),0!==F||S.val||(S.val=p[1]);return{decodeLut:v,numBitsLUTQick:y,numBitsLUT:D,tree:k,stuffedData:u,srcPtr:d,bitPos:w}},readHuffman:function(A,e,t,i){var r,I,g,n,a,o,B,C,E,s=e.headerInfo.numDims,f=e.headerInfo.height,c=e.headerInfo.width,h=c*f,l=this.readHuffmanTree(A,e),u=l.decodeLut,w=l.tree,d=l.stuffedData,D=l.srcPtr,y=l.bitPos,k=l.numBitsLUTQick,p=l.numBitsLUT,m=0===e.headerInfo.imageType?128:0,G=e.pixels.resultMask,F=0;y>0&&(D++,y=0);var S,v=d[D],R=1===e.encodeMode,U=new t(h*s),L=U;if(s<2||R){for(S=0;S<s;S++)if(s>1&&(L=new t(U.buffer,h*S,h),F=0),e.headerInfo.numValidPixel===c*f)for(C=0,o=0;o<f;o++)for(B=0;B<c;B++,C++){if(I=0,a=n=v<<y>>>32-k,32-y<k&&(a=n|=d[D+1]>>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<<y>>>32-p,32-y<p&&(a=n|=d[D+1]>>>64-y-p),r=w,E=0;E<p;E++)if(!(r=n>>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(g+=B>0?F:o>0?L[C-c]:F,g&=255,L[C]=g,F=g):L[C]=g}else for(C=0,o=0;o<f;o++)for(B=0;B<c;B++,C++)if(G[C]){if(I=0,a=n=v<<y>>>32-k,32-y<k&&(a=n|=d[D+1]>>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<<y>>>32-p,32-y<p&&(a=n|=d[D+1]>>>64-y-p),r=w,E=0;E<p;E++)if(!(r=n>>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(B>0&&G[C-1]?g+=F:o>0&&G[C-c]?g+=L[C-c]:g+=F,g&=255,L[C]=g,F=g):L[C]=g}}else for(C=0,o=0;o<f;o++)for(B=0;B<c;B++)if(C=o*c+B,!G||G[C])for(S=0;S<s;S++,C+=h){if(I=0,a=n=v<<y>>>32-k,32-y<k&&(a=n|=d[D+1]>>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<<y>>>32-p,32-y<p&&(a=n|=d[D+1]>>>64-y-p),r=w,E=0;E<p;E++)if(!(r=n>>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,L[C]=g}e.ptr=e.ptr+4*(D+1)+(y>0?4:0),e.pixels.resultPixels=U,s>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(U,h,s,t))},decodeBits:function(A,e,t,i,r){var I=e.headerInfo,Q=I.fileVersion,E=0,s=A.byteLength-e.ptr>=5?5:A.byteLength-e.ptr,f=new DataView(A,e.ptr,s),c=f.getUint8(0);E++;var h=c>>6,l=0===h?4:3-h,u=(32&c)>0,w=31&c,d=0;if(1===l)d=f.getUint8(E),E++;else if(2===l)d=f.getUint16(E,!0),E+=2;else{if(4!==l)throw"Invalid valid pixel count type";d=f.getUint32(E,!0),E+=4}var D,y,k,p,m,G,F,S,v,R=2*I.maxZError,U=I.numDims>1?I.maxValues[r]:I.zMax;if(u){for(e.counter.lut++,S=f.getUint8(E),E++,p=Math.ceil((S-1)*w/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),k=new Uint8Array(y),e.ptr+=E,k.set(new Uint8Array(A,e.ptr,p)),F=new Uint32Array(y),e.ptr+=p,v=0;S-1>>>v;)v++;p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,G=Q>=3?o(F,w,S-1,i,R,U):n(F,w,S-1,i,R,U),Q>=3?a(D,t,v,d,G):g(D,t,v,d,G)}else e.counter.bitstuffer++,v=w,e.ptr+=E,v>0&&(p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,Q>=3?null==i?C(D,t,v,d):a(D,t,v,d,!1,i,R,U):null==i?B(D,t,v,d):g(D,t,v,d,!1,i,R,U))},readTiles:function(A,e,t,i){var r=e.headerInfo,I=r.width,g=r.height,n=I*g,a=r.microBlockSize,o=r.imageType,B=Q.getDataTypeSize(o),C=Math.ceil(I/a),E=Math.ceil(g/a);e.pixels.numBlocksY=E,e.pixels.numBlocksX=C,e.pixels.ptr=0;var s,f,c,h,l,u,w,d,D,y,k=0,p=0,m=0,G=0,F=0,S=0,v=0,R=0,U=0,L=0,b=0,M=0,N=0,x=0,J=0,q=new t(a*a),Y=g%a||a,K=I%a||a,H=r.numDims,O=e.pixels.resultMask,P=e.pixels.resultPixels,T=r.fileVersion>=5?14:15,V=r.zMax;for(m=0;m<E;m++)for(F=m!==E-1?a:Y,G=0;G<C;G++)for(L=m*I*a+G*a,b=I-(S=G!==C-1?a:K),d=0;d<H;d++){if(H>1?(y=P,L=m*I*a+G*a,P=new t(e.pixels.resultPixels.buffer,n*d*B,n),V=r.maxValues[d]):y=null,v=A.byteLength-e.ptr,f={},J=0,R=(s=new DataView(A,e.ptr,Math.min(10,v))).getUint8(0),J++,D=r.fileVersion>=5?4&R:0,U=R>>6&255,(R>>2&T)!=(G*a>>3&T))throw"integrity issue";if(D&&0===d)throw"integrity issue";if((l=3&R)>3)throw e.ptr+=J,"Invalid block encoding ("+l+")";if(2!==l)if(0===l){if(D)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=J,M=(M=F*S*B)<(N=A.byteLength-e.ptr)?M:N,c=new ArrayBuffer(M%B==0?M:M+B-M%B),new Uint8Array(c).set(new Uint8Array(A,e.ptr,M)),h=new t(c),x=0,O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=h[x++]),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L++]=h[x++];L+=b}e.ptr+=x*B}else if(u=Q.getDataTypeUsed(D&&o<6?4:o,U),w=Q.getOnePixel(f,J,u,s),J+=Q.getDataTypeSize(u),3===l)if(e.ptr+=J,e.counter.constantoffset++,O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=D?Math.min(V,y[L]+w):w),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L]=D?Math.min(V,y[L]+w):w,L++;L+=b}else if(e.ptr+=J,Q.decodeBits(A,e,q,w,d),J=0,D)if(O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=q[J++]+y[L]),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L]=q[J++]+y[L],L++;L+=b}else if(O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=q[J++]),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L++]=q[J++];L+=b}else{if(D)if(O)for(k=0;k<F;k++)for(p=0;p<S;p++)O[L]&&(P[L]=y[L]),L++;else for(k=0;k<F;k++)for(p=0;p<S;p++)P[L]=y[L],L++;e.counter.constant++,e.ptr+=J}}H>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(e.pixels.resultPixels,n,H,t))},formatFileInfo:function(A){return{fileIdentifierString:A.headerInfo.fileIdentifierString,fileVersion:A.headerInfo.fileVersion,imageType:A.headerInfo.imageType,height:A.headerInfo.height,width:A.headerInfo.width,numValidPixel:A.headerInfo.numValidPixel,microBlockSize:A.headerInfo.microBlockSize,blobSize:A.headerInfo.blobSize,maxZError:A.headerInfo.maxZError,pixelType:Q.getPixelType(A.headerInfo.imageType),eofOffset:A.eofOffset,mask:A.mask?{numBytes:A.mask.numBytes}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,maxValue:A.headerInfo.zMax,minValue:A.headerInfo.zMin,noDataValue:A.noDataValue}}},constructConstantSurface:function(A,e){var t=A.headerInfo.zMax,i=A.headerInfo.zMin,r=A.headerInfo.maxValues,I=A.headerInfo.numDims,g=A.headerInfo.height*A.headerInfo.width,n=0,a=0,o=0,B=A.pixels.resultMask,C=A.pixels.resultPixels;if(B)if(I>1){if(e)for(n=0;n<I;n++)for(o=n*g,t=r[n],a=0;a<g;a++)B[a]&&(C[o+a]=t);else for(a=0;a<g;a++)if(B[a])for(o=a*I,n=0;n<I;n++)C[o+I]=r[n]}else for(a=0;a<g;a++)B[a]&&(C[a]=t);else if(I>1&&i!==t)if(e)for(n=0;n<I;n++)for(o=n*g,t=r[n],a=0;a<g;a++)C[o+a]=t;else for(a=0;a<g;a++)for(o=a*I,n=0;n<I;n++)C[o+n]=r[n];else for(a=0;a<g*I;a++)C[a]=t},getDataTypeArray:function(A){var e;switch(A){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:default:e=Float32Array;break;case 7:e=Float64Array}return e},getPixelType:function(A){var e;switch(A){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:default:e="F32";break;case 7:e="F64"}return e},isValidPixelValue:function(A,e){if(null==e)return!1;var t;switch(A){case 0:t=e>=-128&&e<=127;break;case 1:t=e>=0&&e<=255;break;case 2:t=e>=-32768&&e<=32767;break;case 3:t=e>=0&&e<=65536;break;case 4:t=e>=-2147483648&&e<=2147483647;break;case 5:t=e>=0&&e<=4294967296;break;case 6:t=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:t=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:t=!1}return t},getDataTypeSize:function(A){var e=0;switch(A){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=A}return e},getDataTypeUsed:function(A,e){var t=A;switch(A){case 2:case 4:t=A-e;break;case 3:case 5:t=A-2*e;break;case 6:t=0===e?A:1===e?2:1;break;case 7:t=0===e?A:A-2*e+1;break;default:t=A}return t},getOnePixel:function(A,e,t,i){var r=0;switch(t){case 0:r=i.getInt8(e);break;case 1:r=i.getUint8(e);break;case 2:r=i.getInt16(e,!0);break;case 3:r=i.getUint16(e,!0);break;case 4:r=i.getInt32(e,!0);break;case 5:r=i.getUInt32(e,!0);break;case 6:r=i.getFloat32(e,!0);break;case 7:r=i.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return r},swapDimensionOrder:function(A,e,t,i,r){var I=0,g=0,n=0,a=0,o=A;if(t>1)if(o=new i(e*t),r)for(I=0;I<e;I++)for(a=I,n=0;n<t;n++,a+=e)o[a]=A[g++];else for(I=0;I<e;I++)for(a=I,n=0;n<t;n++,a+=e)o[g++]=A[a];return o}},E=function(A,e,t){this.val=A,this.left=e,this.right=t},{decode:function(A,e){var t=(e=e||{}).noDataValue,i=0,r={};r.ptr=e.inputOffset||0,r.pixels={},Q.readHeaderInfo(A,r);var I=r.headerInfo,g=I.fileVersion,n=Q.getDataTypeArray(I.imageType);if(g>5)throw"unsupported lerc version 2."+g;Q.readMask(A,r),I.numValidPixel===I.width*I.height||r.pixels.resultMask||(r.pixels.resultMask=e.maskData);var a=I.width*I.height;r.pixels.resultPixels=new n(a*I.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o,B=!e.returnPixelInterleavedDims;if(0!==I.numValidPixel)if(I.zMax===I.zMin)Q.constructConstantSurface(r,B);else if(g>=4&&Q.checkMinMaxRanges(A,r))Q.constructConstantSurface(r,B);else{var C=new DataView(A,r.ptr,2),E=C.getUint8(0);if(r.ptr++,E)Q.readDataOneSweep(A,r,n,B);else if(g>1&&I.imageType<=1&&Math.abs(I.maxZError-.5)<1e-5){var s=C.getUint8(1);if(r.ptr++,r.encodeMode=s,s>2||g<4&&s>1)throw"Invalid Huffman flag "+s;s?Q.readHuffman(A,r,n,B):Q.readTiles(A,r,n,B)}else Q.readTiles(A,r,n,B)}r.eofOffset=r.ptr,e.inputOffset?(o=r.headerInfo.blobSize+e.inputOffset-r.ptr,Math.abs(o)>=1&&(r.eofOffset=e.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,Math.abs(o)>=1&&(r.eofOffset=r.headerInfo.blobSize));var f={width:I.width,height:I.height,pixelData:r.pixels.resultPixels,minValue:I.zMin,maxValue:I.zMax,validPixelCount:I.numValidPixel,dimCount:I.numDims,dimStats:{minValues:I.minValues,maxValues:I.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&Q.isValidPixelValue(I.imageType,t)){var c=r.pixels.resultMask;for(i=0;i<a;i++)c[i]||(f.pixelData[i]=t);f.noDataValue=t}return r.noDataValue=t,e.returnFileInfo&&(f.fileInfo=Q.formatFileInfo(r)),f},getBandCount:function(A){for(var e=0,t=0,i={ptr:0,pixels:{}};t<A.byteLength-58;)Q.readHeaderInfo(A,i),t+=i.headerInfo.blobSize,e++,i.ptr=t;return e}}),l=(s=new ArrayBuffer(4),f=new Uint8Array(s),new Uint32Array(s)[0]=1,1===f[0]),u={decode:function(A,e){if(!l)throw"Big endian system is not supported.";var t,i,r=(e=e||{}).inputOffset||0,I=new Uint8Array(A,r,10),g=String.fromCharCode.apply(null,I);if("CntZImage"===g.trim())t=c,i=1;else{if("Lerc2"!==g.substring(0,5))throw"Unexpected file identifier string: "+g;t=h,i=2}for(var n,a,o,B,C,Q,E=0,s=A.byteLength-10,f=[],u={width:0,height:0,pixels:[],pixelType:e.pixelType,mask:null,statistics:[]},w=0;r<s;){var d=t.decode(A,{inputOffset:r,encodedMaskData:n,maskData:o,returnMask:0===E,returnEncodedMask:0===E,returnFileInfo:!0,returnPixelInterleavedDims:e.returnPixelInterleavedDims,pixelType:e.pixelType||null,noDataValue:e.noDataValue||null});r=d.fileInfo.eofOffset,o=d.maskData,0===E&&(n=d.encodedMaskData,u.width=d.width,u.height=d.height,u.dimCount=d.dimCount||1,u.pixelType=d.pixelType||d.fileInfo.pixelType,u.mask=o),i>1&&(o&&f.push(o),d.fileInfo.mask&&d.fileInfo.mask.numBytes>0&&w++),E++,u.pixels.push(d.pixelData),u.statistics.push({minValue:d.minValue,maxValue:d.maxValue,noDataValue:d.noDataValue,dimStats:d.dimStats})}if(i>1&&w>1){for(Q=u.width*u.height,u.bandMasks=f,(o=new Uint8Array(Q)).set(f[0]),B=1;B<f.length;B++)for(a=f[B],C=0;C<Q;C++)o[C]=o[C]&a[C];u.maskData=o}return u}};TA.exports?TA.exports=u:this.Lerc=u}();var ZA,jA,WA,zA=XA.exports,$A={env:{emscripten_notify_memory_growth:function(A){WA=new Uint8Array(jA.exports.memory.buffer)}}},Ae=function(){function A(){B(this,A)}return Q(A,[{key:"init",value:function(){return ZA||(ZA="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+ee).then((function(A){return A.arrayBuffer()})).then((function(A){return WebAssembly.instantiate(A,$A)})).then(this._init):WebAssembly.instantiate(Buffer.from(ee,"base64"),$A).then(this._init))}},{key:"_init",value:function(A){jA=A.instance,$A.env.emscripten_notify_memory_growth(0)}},{key:"decode",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!jA)throw new Error("ZSTDDecoder: Await .init() before decoding.");var t=A.byteLength,i=jA.exports.malloc(t);WA.set(A,i),e=e||Number(jA.exports.ZSTD_findDecompressedSize(i,t));var r=jA.exports.malloc(e),I=jA.exports.ZSTD_decompress(r,e,i,t),g=WA.slice(r,r+I);return jA.exports.free(i),jA.exports.free(r),g}}]),A}(),ee="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",te={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ie={};for(var re in te)te.hasOwnProperty(re)&&(ie[te[re]]=parseInt(re,10));ie.BitsPerSample,ie.ExtraSamples,ie.SampleFormat,ie.StripByteCounts,ie.StripOffsets,ie.StripRowCounts,ie.TileByteCounts,ie.TileOffsets,ie.SubIFDs;var Ie={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ge={};for(var ne in Ie)Ie.hasOwnProperty(ne)&&(ge[Ie[ne]]=parseInt(ne,10));var ae=1,oe=0,Be=1,Ce=2,Qe={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},Ee={};for(var se in Qe)Qe.hasOwnProperty(se)&&(Ee[Qe[se]]=parseInt(se,10));function fe(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var ce=new Ae,he=function(A){s(t,w);var e=fe(t);function t(A){var i;return B(this,t),(i=e.call(this)).planarConfiguration=void 0!==A.PlanarConfiguration?A.PlanarConfiguration:1,i.samplesPerPixel=void 0!==A.SamplesPerPixel?A.SamplesPerPixel:1,i.addCompression=A.LercParameters[ae],i}return Q(t,[{key:"decodeBlock",value:function(A){switch(this.addCompression){case oe:break;case Be:A=YA(new Uint8Array(A)).buffer;break;case Ce:A=ce.decode(new Uint8Array(A)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return zA.decode(A,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),t}(),le=Object.freeze({__proto__:null,zstd:ce,default:he});function ue(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var we=function(A){s(I,w);var t,i=ue(I);function I(){var A;if(B(this,I),A=i.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return A}return Q(I,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return i=new Blob([t]),A.next=3,createImageBitmap(i);case 3:return I=A.sent,"undefined"!=typeof document?((g=document.createElement("canvas")).width=I.width,g.height=I.height):g=new OffscreenCanvas(I.width,I.height),(n=g.getContext("2d")).drawImage(I,0,0),A.abrupt("return",n.getImageData(0,0,I.width,I.height).data.buffer);case 8:case"end":return A.stop()}}),A)}))),function(A,e){return t.apply(this,arguments)})}]),I}(),de=Object.freeze({__proto__:null,default:we});';return new Eo("undefined"!=typeof Buffer?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}});t.cogProtocol=async t=>{if("json"==t.type){const e=t.url.replace("cog://","").split("#")[0];return{data:await Ge(e).getTilejson(t.url)}}if("image"==t.type)return{data:await Cr(t.url)};throw new Error(`Unsupported request type '${t.type}'`)},t.colorScale=gr,t.colorSchemeNames=ur,t.locationValues=async(t,{latitude:e,longitude:i},r)=>{const s=Ge(t),{minzoom:o,maxzoom:n}=await s.getTilejson(t),{noData:a,scale:l,offset:A}=await s.getMetadata(),h=void 0===r?n:Math.max(o,Math.min(n,Math.round(r))),{tileIndex:c,column:u,row:f}=(({latitude:t,longitude:e,zoom:i})=>{const[r,s]=_e.forward([e,t]),o=(r+Ee/2)/Ee*Ce*2**i,n=-(s-Ee/2)/Ee*Ce*2**i;return{tileIndex:{z:i,x:Math.floor(o/Ce),y:Math.floor(n/Ce)},row:Math.floor(n%Ce),column:Math.floor(o%Ce)}})({latitude:e,longitude:i,zoom:h}),d=await s.getRawTile(c),g=d.length/65536,p=f*pr+u;return Array.from(d.subarray(p*g,p*g+g)).map((t=>{const e=A+t*l;return e===a||isNaN(e)||e===1/0?NaN:e}))},t.setColorFunction=(t,e)=>{Br(t,(t=>(e,i)=>{const r=65536,s=e.length/r,o=new Uint8ClampedArray(262144);for(let n=0;n<r;n++)t(e.subarray(n*s,n*s+s),o.subarray(4*n,4*n+4),i);return o})(e))}}))})(Ki,Ki.exports);return Ki.exports}var tr=Xi();const er=()=>{const t=o("").split("/").filter(Boolean).slice(0,-1).join("/");if(t)Be(`${t}/collection`);else Be("")};const ir=t=>{const e=sr(t);if(!e){console.warn(`No suitable preview source found for record ${t.id}`);return}const{id:i,source:r}=e;const s=rr(t,r);return{id:i,type:s,source:r}};const rr=(t,e)=>{if(e.type==="raster")return"raster";else throw new Error(`Unsupported source type: ${e.type}`)};const sr=t=>[ar(t),lr(t),nr(t),or(t)].find(Boolean);const or=t=>{const e=t.references.xyz;if(!e)return null;return{id:t.id,source:{type:"raster",tiles:[e],scheme:"xyz",tileSize:256,attribution:t.attribution}}};const nr=t=>{const e=t.references.tms;if(!e)return null;return{id:t.id,source:{type:"raster",tiles:[e],scheme:"tms",tileSize:256,attribution:t.attribution}}};const ar=t=>{const e=t.references.cog;if(!e)return null;const i=`cog://${e}`;return{id:t.id,source:{type:"raster",url:i,tileSize:256,attribution:t.attribution}}};const lr=t=>{const e=t.references.wms;if(!e)return null;const i=[t.wxsIdentifier];if(!i[0])return null;const r=Ar({wmsUrl:e,layerIds:i,attribution:t.attribution});const s=t.id;return{id:s,source:r}};const Ar=({wmsUrl:t,layerIds:e,bbox:i="{bbox-epsg-3857}",srs:r="EPSG:3857",tileSize:s=256,format:o="image/png",transparent:n=true,attribution:a=""})=>{const l=new URL(t);l.searchParams.set("service","WMS");l.searchParams.set("request","GetMap");l.searchParams.set("layers",e.join(","));l.searchParams.set("width",String(s));l.searchParams.set("height",String(s));l.searchParams.set("transparent",String(n));l.searchParams.set("srs",r);l.searchParams.set("format",o);let A=l.toString();A+=`&bbox=${i}`;return{type:"raster",tiles:[A],tileSize:s,attribution:a}};const hr=".maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .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='none' stroke='%23333' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-globe-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='none' stroke='%2333b5e5' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(pointer:coarse){.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}:root,:host,.sl-theme-light{color-scheme:light;--sl-color-gray-50:hsl(0 0% 97.5%);--sl-color-gray-100:hsl(240 4.8% 95.9%);--sl-color-gray-200:hsl(240 5.9% 90%);--sl-color-gray-300:hsl(240 4.9% 83.9%);--sl-color-gray-400:hsl(240 5% 64.9%);--sl-color-gray-500:hsl(240 3.8% 46.1%);--sl-color-gray-600:hsl(240 5.2% 33.9%);--sl-color-gray-700:hsl(240 5.3% 26.1%);--sl-color-gray-800:hsl(240 3.7% 15.9%);--sl-color-gray-900:hsl(240 5.9% 10%);--sl-color-gray-950:hsl(240 7.3% 8%);--sl-color-red-50:hsl(0 85.7% 97.3%);--sl-color-red-100:hsl(0 93.3% 94.1%);--sl-color-red-200:hsl(0 96.3% 89.4%);--sl-color-red-300:hsl(0 93.5% 81.8%);--sl-color-red-400:hsl(0 90.6% 70.8%);--sl-color-red-500:hsl(0 84.2% 60.2%);--sl-color-red-600:hsl(0 72.2% 50.6%);--sl-color-red-700:hsl(0 73.7% 41.8%);--sl-color-red-800:hsl(0 70% 35.3%);--sl-color-red-900:hsl(0 62.8% 30.6%);--sl-color-red-950:hsl(0 60% 19.6%);--sl-color-orange-50:hsl(33.3 100% 96.5%);--sl-color-orange-100:hsl(34.3 100% 91.8%);--sl-color-orange-200:hsl(32.1 97.7% 83.1%);--sl-color-orange-300:hsl(30.7 97.2% 72.4%);--sl-color-orange-400:hsl(27 96% 61%);--sl-color-orange-500:hsl(24.6 95% 53.1%);--sl-color-orange-600:hsl(20.5 90.2% 48.2%);--sl-color-orange-700:hsl(17.5 88.3% 40.4%);--sl-color-orange-800:hsl(15 79.1% 33.7%);--sl-color-orange-900:hsl(15.3 74.6% 27.8%);--sl-color-orange-950:hsl(15.2 69.1% 19%);--sl-color-amber-50:hsl(48 100% 96.1%);--sl-color-amber-100:hsl(48 96.5% 88.8%);--sl-color-amber-200:hsl(48 96.6% 76.7%);--sl-color-amber-300:hsl(45.9 96.7% 64.5%);--sl-color-amber-400:hsl(43.3 96.4% 56.3%);--sl-color-amber-500:hsl(37.7 92.1% 50.2%);--sl-color-amber-600:hsl(32.1 94.6% 43.7%);--sl-color-amber-700:hsl(26 90.5% 37.1%);--sl-color-amber-800:hsl(22.7 82.5% 31.4%);--sl-color-amber-900:hsl(21.7 77.8% 26.5%);--sl-color-amber-950:hsl(22.9 74.1% 16.7%);--sl-color-yellow-50:hsl(54.5 91.7% 95.3%);--sl-color-yellow-100:hsl(54.9 96.7% 88%);--sl-color-yellow-200:hsl(52.8 98.3% 76.9%);--sl-color-yellow-300:hsl(50.4 97.8% 63.5%);--sl-color-yellow-400:hsl(47.9 95.8% 53.1%);--sl-color-yellow-500:hsl(45.4 93.4% 47.5%);--sl-color-yellow-600:hsl(40.6 96.1% 40.4%);--sl-color-yellow-700:hsl(35.5 91.7% 32.9%);--sl-color-yellow-800:hsl(31.8 81% 28.8%);--sl-color-yellow-900:hsl(28.4 72.5% 25.7%);--sl-color-yellow-950:hsl(33.1 69% 13.9%);--sl-color-lime-50:hsl(78.3 92% 95.1%);--sl-color-lime-100:hsl(79.6 89.1% 89.2%);--sl-color-lime-200:hsl(80.9 88.5% 79.6%);--sl-color-lime-300:hsl(82 84.5% 67.1%);--sl-color-lime-400:hsl(82.7 78% 55.5%);--sl-color-lime-500:hsl(83.7 80.5% 44.3%);--sl-color-lime-600:hsl(84.8 85.2% 34.5%);--sl-color-lime-700:hsl(85.9 78.4% 27.3%);--sl-color-lime-800:hsl(86.3 69% 22.7%);--sl-color-lime-900:hsl(87.6 61.2% 20.2%);--sl-color-lime-950:hsl(86.5 60.6% 13.9%);--sl-color-green-50:hsl(138.5 76.5% 96.7%);--sl-color-green-100:hsl(140.6 84.2% 92.5%);--sl-color-green-200:hsl(141 78.9% 85.1%);--sl-color-green-300:hsl(141.7 76.6% 73.1%);--sl-color-green-400:hsl(141.9 69.2% 58%);--sl-color-green-500:hsl(142.1 70.6% 45.3%);--sl-color-green-600:hsl(142.1 76.2% 36.3%);--sl-color-green-700:hsl(142.4 71.8% 29.2%);--sl-color-green-800:hsl(142.8 64.2% 24.1%);--sl-color-green-900:hsl(143.8 61.2% 20.2%);--sl-color-green-950:hsl(144.3 60.7% 12%);--sl-color-emerald-50:hsl(151.8 81% 95.9%);--sl-color-emerald-100:hsl(149.3 80.4% 90%);--sl-color-emerald-200:hsl(152.4 76% 80.4%);--sl-color-emerald-300:hsl(156.2 71.6% 66.9%);--sl-color-emerald-400:hsl(158.1 64.4% 51.6%);--sl-color-emerald-500:hsl(160.1 84.1% 39.4%);--sl-color-emerald-600:hsl(161.4 93.5% 30.4%);--sl-color-emerald-700:hsl(162.9 93.5% 24.3%);--sl-color-emerald-800:hsl(163.1 88.1% 19.8%);--sl-color-emerald-900:hsl(164.2 85.7% 16.5%);--sl-color-emerald-950:hsl(164.3 87.5% 9.4%);--sl-color-teal-50:hsl(166.2 76.5% 96.7%);--sl-color-teal-100:hsl(167.2 85.5% 89.2%);--sl-color-teal-200:hsl(168.4 83.8% 78.2%);--sl-color-teal-300:hsl(170.6 76.9% 64.3%);--sl-color-teal-400:hsl(172.5 66% 50.4%);--sl-color-teal-500:hsl(173.4 80.4% 40%);--sl-color-teal-600:hsl(174.7 83.9% 31.6%);--sl-color-teal-700:hsl(175.3 77.4% 26.1%);--sl-color-teal-800:hsl(176.1 69.4% 21.8%);--sl-color-teal-900:hsl(175.9 60.8% 19%);--sl-color-teal-950:hsl(176.5 58.6% 11.4%);--sl-color-cyan-50:hsl(183.2 100% 96.3%);--sl-color-cyan-100:hsl(185.1 95.9% 90.4%);--sl-color-cyan-200:hsl(186.2 93.5% 81.8%);--sl-color-cyan-300:hsl(187 92.4% 69%);--sl-color-cyan-400:hsl(187.9 85.7% 53.3%);--sl-color-cyan-500:hsl(188.7 94.5% 42.7%);--sl-color-cyan-600:hsl(191.6 91.4% 36.5%);--sl-color-cyan-700:hsl(192.9 82.3% 31%);--sl-color-cyan-800:hsl(194.4 69.6% 27.1%);--sl-color-cyan-900:hsl(196.4 63.6% 23.7%);--sl-color-cyan-950:hsl(196.8 61% 16.1%);--sl-color-sky-50:hsl(204 100% 97.1%);--sl-color-sky-100:hsl(204 93.8% 93.7%);--sl-color-sky-200:hsl(200.6 94.4% 86.1%);--sl-color-sky-300:hsl(199.4 95.5% 73.9%);--sl-color-sky-400:hsl(198.4 93.2% 59.6%);--sl-color-sky-500:hsl(198.6 88.7% 48.4%);--sl-color-sky-600:hsl(200.4 98% 39.4%);--sl-color-sky-700:hsl(201.3 96.3% 32.2%);--sl-color-sky-800:hsl(201 90% 27.5%);--sl-color-sky-900:hsl(202 80.3% 23.9%);--sl-color-sky-950:hsl(202.3 73.8% 16.5%);--sl-color-blue-50:hsl(213.8 100% 96.9%);--sl-color-blue-100:hsl(214.3 94.6% 92.7%);--sl-color-blue-200:hsl(213.3 96.9% 87.3%);--sl-color-blue-300:hsl(211.7 96.4% 78.4%);--sl-color-blue-400:hsl(213.1 93.9% 67.8%);--sl-color-blue-500:hsl(217.2 91.2% 59.8%);--sl-color-blue-600:hsl(221.2 83.2% 53.3%);--sl-color-blue-700:hsl(224.3 76.3% 48%);--sl-color-blue-800:hsl(225.9 70.7% 40.2%);--sl-color-blue-900:hsl(224.4 64.3% 32.9%);--sl-color-blue-950:hsl(226.2 55.3% 18.4%);--sl-color-indigo-50:hsl(225.9 100% 96.7%);--sl-color-indigo-100:hsl(226.5 100% 93.9%);--sl-color-indigo-200:hsl(228 96.5% 88.8%);--sl-color-indigo-300:hsl(229.7 93.5% 81.8%);--sl-color-indigo-400:hsl(234.5 89.5% 73.9%);--sl-color-indigo-500:hsl(238.7 83.5% 66.7%);--sl-color-indigo-600:hsl(243.4 75.4% 58.6%);--sl-color-indigo-700:hsl(244.5 57.9% 50.6%);--sl-color-indigo-800:hsl(243.7 54.5% 41.4%);--sl-color-indigo-900:hsl(242.2 47.4% 34.3%);--sl-color-indigo-950:hsl(243.5 43.6% 22.9%);--sl-color-violet-50:hsl(250 100% 97.6%);--sl-color-violet-100:hsl(251.4 91.3% 95.5%);--sl-color-violet-200:hsl(250.5 95.2% 91.8%);--sl-color-violet-300:hsl(252.5 94.7% 85.1%);--sl-color-violet-400:hsl(255.1 91.7% 76.3%);--sl-color-violet-500:hsl(258.3 89.5% 66.3%);--sl-color-violet-600:hsl(262.1 83.3% 57.8%);--sl-color-violet-700:hsl(263.4 70% 50.4%);--sl-color-violet-800:hsl(263.4 69.3% 42.2%);--sl-color-violet-900:hsl(263.5 67.4% 34.9%);--sl-color-violet-950:hsl(265.1 61.5% 21.4%);--sl-color-purple-50:hsl(270 100% 98%);--sl-color-purple-100:hsl(268.7 100% 95.5%);--sl-color-purple-200:hsl(268.6 100% 91.8%);--sl-color-purple-300:hsl(269.2 97.4% 85.1%);--sl-color-purple-400:hsl(270 95.2% 75.3%);--sl-color-purple-500:hsl(270.7 91% 65.1%);--sl-color-purple-600:hsl(271.5 81.3% 55.9%);--sl-color-purple-700:hsl(272.1 71.7% 47.1%);--sl-color-purple-800:hsl(272.9 67.2% 39.4%);--sl-color-purple-900:hsl(273.6 65.6% 32%);--sl-color-purple-950:hsl(276 59.5% 16.5%);--sl-color-fuchsia-50:hsl(289.1 100% 97.8%);--sl-color-fuchsia-100:hsl(287 100% 95.5%);--sl-color-fuchsia-200:hsl(288.3 95.8% 90.6%);--sl-color-fuchsia-300:hsl(291.1 93.1% 82.9%);--sl-color-fuchsia-400:hsl(292 91.4% 72.5%);--sl-color-fuchsia-500:hsl(292.2 84.1% 60.6%);--sl-color-fuchsia-600:hsl(293.4 69.5% 48.8%);--sl-color-fuchsia-700:hsl(294.7 72.4% 39.8%);--sl-color-fuchsia-800:hsl(295.4 70.2% 32.9%);--sl-color-fuchsia-900:hsl(296.7 63.6% 28%);--sl-color-fuchsia-950:hsl(297.1 56.8% 14.5%);--sl-color-pink-50:hsl(327.3 73.3% 97.1%);--sl-color-pink-100:hsl(325.7 77.8% 94.7%);--sl-color-pink-200:hsl(325.9 84.6% 89.8%);--sl-color-pink-300:hsl(327.4 87.1% 81.8%);--sl-color-pink-400:hsl(328.6 85.5% 70.2%);--sl-color-pink-500:hsl(330.4 81.2% 60.4%);--sl-color-pink-600:hsl(333.3 71.4% 50.6%);--sl-color-pink-700:hsl(335.1 77.6% 42%);--sl-color-pink-800:hsl(335.8 74.4% 35.3%);--sl-color-pink-900:hsl(335.9 69% 30.4%);--sl-color-pink-950:hsl(336.2 65.4% 15.9%);--sl-color-rose-50:hsl(355.7 100% 97.3%);--sl-color-rose-100:hsl(355.6 100% 94.7%);--sl-color-rose-200:hsl(352.7 96.1% 90%);--sl-color-rose-300:hsl(352.6 95.7% 81.8%);--sl-color-rose-400:hsl(351.3 94.5% 71.4%);--sl-color-rose-500:hsl(349.7 89.2% 60.2%);--sl-color-rose-600:hsl(346.8 77.2% 49.8%);--sl-color-rose-700:hsl(345.3 82.7% 40.8%);--sl-color-rose-800:hsl(343.4 79.7% 34.7%);--sl-color-rose-900:hsl(341.5 75.5% 30.4%);--sl-color-rose-950:hsl(341.3 70.1% 17.1%);--sl-color-primary-50:var(--sl-color-sky-50);--sl-color-primary-100:var(--sl-color-sky-100);--sl-color-primary-200:var(--sl-color-sky-200);--sl-color-primary-300:var(--sl-color-sky-300);--sl-color-primary-400:var(--sl-color-sky-400);--sl-color-primary-500:var(--sl-color-sky-500);--sl-color-primary-600:var(--sl-color-sky-600);--sl-color-primary-700:var(--sl-color-sky-700);--sl-color-primary-800:var(--sl-color-sky-800);--sl-color-primary-900:var(--sl-color-sky-900);--sl-color-primary-950:var(--sl-color-sky-950);--sl-color-success-50:var(--sl-color-green-50);--sl-color-success-100:var(--sl-color-green-100);--sl-color-success-200:var(--sl-color-green-200);--sl-color-success-300:var(--sl-color-green-300);--sl-color-success-400:var(--sl-color-green-400);--sl-color-success-500:var(--sl-color-green-500);--sl-color-success-600:var(--sl-color-green-600);--sl-color-success-700:var(--sl-color-green-700);--sl-color-success-800:var(--sl-color-green-800);--sl-color-success-900:var(--sl-color-green-900);--sl-color-success-950:var(--sl-color-green-950);--sl-color-warning-50:var(--sl-color-amber-50);--sl-color-warning-100:var(--sl-color-amber-100);--sl-color-warning-200:var(--sl-color-amber-200);--sl-color-warning-300:var(--sl-color-amber-300);--sl-color-warning-400:var(--sl-color-amber-400);--sl-color-warning-500:var(--sl-color-amber-500);--sl-color-warning-600:var(--sl-color-amber-600);--sl-color-warning-700:var(--sl-color-amber-700);--sl-color-warning-800:var(--sl-color-amber-800);--sl-color-warning-900:var(--sl-color-amber-900);--sl-color-warning-950:var(--sl-color-amber-950);--sl-color-danger-50:var(--sl-color-red-50);--sl-color-danger-100:var(--sl-color-red-100);--sl-color-danger-200:var(--sl-color-red-200);--sl-color-danger-300:var(--sl-color-red-300);--sl-color-danger-400:var(--sl-color-red-400);--sl-color-danger-500:var(--sl-color-red-500);--sl-color-danger-600:var(--sl-color-red-600);--sl-color-danger-700:var(--sl-color-red-700);--sl-color-danger-800:var(--sl-color-red-800);--sl-color-danger-900:var(--sl-color-red-900);--sl-color-danger-950:var(--sl-color-red-950);--sl-color-neutral-50:var(--sl-color-gray-50);--sl-color-neutral-100:var(--sl-color-gray-100);--sl-color-neutral-200:var(--sl-color-gray-200);--sl-color-neutral-300:var(--sl-color-gray-300);--sl-color-neutral-400:var(--sl-color-gray-400);--sl-color-neutral-500:var(--sl-color-gray-500);--sl-color-neutral-600:var(--sl-color-gray-600);--sl-color-neutral-700:var(--sl-color-gray-700);--sl-color-neutral-800:var(--sl-color-gray-800);--sl-color-neutral-900:var(--sl-color-gray-900);--sl-color-neutral-950:var(--sl-color-gray-950);--sl-color-neutral-0:hsl(0, 0%, 100%);--sl-color-neutral-1000:hsl(0, 0%, 0%);--sl-border-radius-small:0.1875rem;--sl-border-radius-medium:0.25rem;--sl-border-radius-large:0.5rem;--sl-border-radius-x-large:1rem;--sl-border-radius-circle:50%;--sl-border-radius-pill:9999px;--sl-shadow-x-small:0 1px 2px hsl(240 3.8% 46.1% / 6%);--sl-shadow-small:0 1px 2px hsl(240 3.8% 46.1% / 12%);--sl-shadow-medium:0 2px 4px hsl(240 3.8% 46.1% / 12%);--sl-shadow-large:0 2px 8px hsl(240 3.8% 46.1% / 12%);--sl-shadow-x-large:0 4px 16px hsl(240 3.8% 46.1% / 12%);--sl-spacing-3x-small:0.125rem;--sl-spacing-2x-small:0.25rem;--sl-spacing-x-small:0.5rem;--sl-spacing-small:0.75rem;--sl-spacing-medium:1rem;--sl-spacing-large:1.25rem;--sl-spacing-x-large:1.75rem;--sl-spacing-2x-large:2.25rem;--sl-spacing-3x-large:3rem;--sl-spacing-4x-large:4.5rem;--sl-transition-x-slow:1000ms;--sl-transition-slow:500ms;--sl-transition-medium:250ms;--sl-transition-fast:150ms;--sl-transition-x-fast:50ms;--sl-font-mono:SFMono-Regular, Consolas, \"Liberation Mono\", Menlo, monospace;--sl-font-sans:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto,\n Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\",\n \"Segoe UI Symbol\";--sl-font-serif:Georgia, \"Times New Roman\", serif;--sl-font-size-2x-small:0.625rem;--sl-font-size-x-small:0.75rem;--sl-font-size-small:0.875rem;--sl-font-size-medium:1rem;--sl-font-size-large:1.25rem;--sl-font-size-x-large:1.5rem;--sl-font-size-2x-large:2.25rem;--sl-font-size-3x-large:3rem;--sl-font-size-4x-large:4.5rem;--sl-font-weight-light:300;--sl-font-weight-normal:400;--sl-font-weight-semibold:500;--sl-font-weight-bold:700;--sl-letter-spacing-denser:-0.03em;--sl-letter-spacing-dense:-0.015em;--sl-letter-spacing-normal:normal;--sl-letter-spacing-loose:0.075em;--sl-letter-spacing-looser:0.15em;--sl-line-height-denser:1;--sl-line-height-dense:1.4;--sl-line-height-normal:1.8;--sl-line-height-loose:2.2;--sl-line-height-looser:2.6;--sl-focus-ring-color:var(--sl-color-primary-600);--sl-focus-ring-style:solid;--sl-focus-ring-width:3px;--sl-focus-ring:var(--sl-focus-ring-style) var(--sl-focus-ring-width)\n var(--sl-focus-ring-color);--sl-focus-ring-offset:1px;--sl-button-font-size-small:var(--sl-font-size-x-small);--sl-button-font-size-medium:var(--sl-font-size-small);--sl-button-font-size-large:var(--sl-font-size-medium);--sl-input-height-small:1.875rem;--sl-input-height-medium:2.5rem;--sl-input-height-large:3.125rem;--sl-input-background-color:var(--sl-color-neutral-0);--sl-input-background-color-hover:var(--sl-input-background-color);--sl-input-background-color-focus:var(--sl-input-background-color);--sl-input-background-color-disabled:var(--sl-color-neutral-100);--sl-input-border-color:var(--sl-color-neutral-300);--sl-input-border-color-hover:var(--sl-color-neutral-400);--sl-input-border-color-focus:var(--sl-color-primary-500);--sl-input-border-color-disabled:var(--sl-color-neutral-300);--sl-input-border-width:1px;--sl-input-required-content:\"*\";--sl-input-required-content-offset:-2px;--sl-input-required-content-color:var(--sl-input-label-color);--sl-input-border-radius-small:var(--sl-border-radius-medium);--sl-input-border-radius-medium:var(--sl-border-radius-medium);--sl-input-border-radius-large:var(--sl-border-radius-medium);--sl-input-font-family:var(--sl-font-sans);--sl-input-font-weight:var(--sl-font-weight-normal);--sl-input-font-size-small:var(--sl-font-size-small);--sl-input-font-size-medium:var(--sl-font-size-medium);--sl-input-font-size-large:var(--sl-font-size-large);--sl-input-letter-spacing:var(--sl-letter-spacing-normal);--sl-input-color:var(--sl-color-neutral-700);--sl-input-color-hover:var(--sl-color-neutral-700);--sl-input-color-focus:var(--sl-color-neutral-700);--sl-input-color-disabled:var(--sl-color-neutral-900);--sl-input-icon-color:var(--sl-color-neutral-500);--sl-input-icon-color-hover:var(--sl-color-neutral-600);--sl-input-icon-color-focus:var(--sl-color-neutral-600);--sl-input-placeholder-color:var(--sl-color-neutral-500);--sl-input-placeholder-color-disabled:var(--sl-color-neutral-600);--sl-input-spacing-small:var(--sl-spacing-small);--sl-input-spacing-medium:var(--sl-spacing-medium);--sl-input-spacing-large:var(--sl-spacing-large);--sl-input-focus-ring-color:hsl(198.6 88.7% 48.4% / 40%);--sl-input-focus-ring-offset:0;--sl-input-filled-background-color:var(--sl-color-neutral-100);--sl-input-filled-background-color-hover:var(--sl-color-neutral-100);--sl-input-filled-background-color-focus:var(--sl-color-neutral-100);--sl-input-filled-background-color-disabled:var(--sl-color-neutral-100);--sl-input-filled-color:var(--sl-color-neutral-800);--sl-input-filled-color-hover:var(--sl-color-neutral-800);--sl-input-filled-color-focus:var(--sl-color-neutral-700);--sl-input-filled-color-disabled:var(--sl-color-neutral-800);--sl-input-label-font-size-small:var(--sl-font-size-small);--sl-input-label-font-size-medium:var(--sl-font-size-medium);--sl-input-label-font-size-large:var(--sl-font-size-large);--sl-input-label-color:inherit;--sl-input-help-text-font-size-small:var(--sl-font-size-x-small);--sl-input-help-text-font-size-medium:var(--sl-font-size-small);--sl-input-help-text-font-size-large:var(--sl-font-size-medium);--sl-input-help-text-color:var(--sl-color-neutral-500);--sl-toggle-size-small:0.875rem;--sl-toggle-size-medium:1.125rem;--sl-toggle-size-large:1.375rem;--sl-overlay-background-color:hsl(240 3.8% 46.1% / 33%);--sl-panel-background-color:var(--sl-color-neutral-0);--sl-panel-border-color:var(--sl-color-neutral-200);--sl-panel-border-width:1px;--sl-tooltip-border-radius:var(--sl-border-radius-medium);--sl-tooltip-background-color:var(--sl-color-neutral-800);--sl-tooltip-color:var(--sl-color-neutral-0);--sl-tooltip-font-family:var(--sl-font-sans);--sl-tooltip-font-weight:var(--sl-font-weight-normal);--sl-tooltip-font-size:var(--sl-font-size-small);--sl-tooltip-line-height:var(--sl-line-height-dense);--sl-tooltip-padding:var(--sl-spacing-2x-small) var(--sl-spacing-x-small);--sl-tooltip-arrow-size:6px;--sl-z-index-drawer:700;--sl-z-index-dialog:800;--sl-z-index-dropdown:900;--sl-z-index-toast:950;--sl-z-index-tooltip:1000}@supports (scrollbar-gutter: stable){.sl-scroll-lock{scrollbar-gutter:var(--sl-scroll-lock-gutter) !important}.sl-scroll-lock body{overflow:hidden !important}}@supports not (scrollbar-gutter: stable){.sl-scroll-lock body{padding-right:var(--sl-scroll-lock-size) !important;overflow:hidden !important}}.sl-toast-stack{position:fixed;top:0;inset-inline-end:0;z-index:var(--sl-z-index-toast);width:28rem;max-width:100%;max-height:100%;overflow:auto}.sl-toast-stack sl-alert{margin:var(--sl-spacing-medium)}.sl-toast-stack sl-alert::part(base){box-shadow:var(--sl-shadow-large)}:host{--stanford-cardinal-red:#8f1414;--accent-color:var(--sl-color-primary-500);}.container{display:block;position:relative;font-family:var(--sl-font-sans);border:var(--sl-panel-border-width) solid var(--sl-panel-border-color);width:100%;min-height:400px}.map-container{position:relative}#map{width:100%;height:400px;position:relative}canvas{cursor:crosshair}";er();d.addProtocol("cog",tr.cogProtocol);const cr=class{constructor(i){t(this,i);this.recordLoaded=e(this,"recordLoaded")}get el(){return s(this)}recordUrl;sidebarOpen=false;record;recordLoaded;map;previewId;async componentWillLoad(){if(this.recordUrl)return await this.updateRecord()}componentDidLoad(){this.map=new d.Map({container:this.el.shadowRoot.getElementById("map"),style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",center:[0,0],zoom:1});this.map.addControl(new d.NavigationControl);this.map.addControl(new d.FullscreenControl);this.map.addControl(new d.GlobeControl);this.map.once("load",this.addPreview.bind(this))}_toggleSidebar(){this.sidebarOpen=!this.sidebarOpen}async updateRecord(){if(this.recordUrl)this.record=await this.fetchRecord(this.recordUrl)}addPreview(){if(!this.record||!this.map)return;const t=this.record.getBounds();this.clearPreview();const e=ir(this.record);if(e){this.previewId=e.id;this.map.addLayer(e)}this.map.fitBounds(t,{padding:20})}clearPreview(){if(!this.previewId)return;this.map.removeLayer(this.previewId);this.map.removeSource(this.previewId)}async fetchRecord(t){const e=await fetch(t);const i=await e.json();return new v(i)}render(){return i("div",{key:"d1e307410345fb77cf53a0c767e58452d59cba34",class:"container"},i("ogm-menubar",{key:"e8973b341791fe85598c3e6a581288222900979b",record:this.record}),i("div",{key:"03e7fdc35eb390b5b2773324269e08bb533cd6df",class:"map-container"},i("ogm-sidebar",{key:"b6cc82534cc1319a8ee6ef78c7b15261ebad3433",record:this.record,open:this.sidebarOpen}),i("div",{key:"e90fcfebb4ef332266b35fbe6c9ad5a2fb845f4e",id:"map"})))}static get watchers(){return{recordUrl:["updateRecord"],record:["addPreview"]}}};cr.style=hr;export{a as ogm_menubar,B as ogm_metadata,Vi as ogm_sidebar,cr as ogm_viewer};
769
+ //# sourceMappingURL=p-601c9fec.entry.js.map