@quantaroute/checkout 1.0.0 → 1.0.1

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.
@@ -60,7 +60,7 @@ if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized
60
60
  const a=o.startsWith("BGR"),h=new Uint8ClampedArray(n*r*4)
61
61
  if(yield e.copyTo(h,function(t,e,i,s,n){const r=4*Math.max(-e,0),o=(Math.max(0,i)-i)*s*4+r,a=4*s,h=Math.max(0,e),l=Math.max(0,i)
62
62
  return{rect:{x:h,y:l,width:Math.min(t.width,e+s)-h,height:Math.min(t.height,i+n)-l},layout:[{offset:o,stride:a}]}}(t,i,s,n,r)),a)for(let t=0;t<h.length;t+=4){const e=h[t]
63
- h[t]=h[t+2],h[t+2]=e}return h}finally{e.close()}})}let T,C
63
+ h[t]=h[t+2],h[t+2]=e}return h}finally{e.close()}})}let C,T
64
64
  const P="AbortError"
65
65
  function $(){return new Error(P)}const F={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""}
66
66
  function D(t){return F.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const O="global-dispatcher"
@@ -116,13 +116,13 @@ function wt(t,e){return{kind:"array",itemType:t,N:e}}function bt(t){if("array"==
116
116
  return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const xt=[ht,lt,ct,ut,ft,_t,pt,wt(dt),gt,yt,vt]
117
117
  function Mt(t,e){if("error"===e.kind)return null
118
118
  if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Mt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null
119
- if("value"===t.kind)for(const t of xt)if(!Mt(t,e))return null}return`Expected ${bt(t)} but found ${bt(e)} instead.`}function zt(t,e){return e.some(e=>e.kind===t.kind)}function St(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 kt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const At=.96422,Et=.82521,It=4/29,Tt=6/29,Ct=3*Tt*Tt,Pt=Tt*Tt*Tt,$t=Math.PI/180,Ft=180/Math.PI
119
+ if("value"===t.kind)for(const t of xt)if(!Mt(t,e))return null}return`Expected ${bt(t)} but found ${bt(e)} instead.`}function zt(t,e){return e.some(e=>e.kind===t.kind)}function St(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 kt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const At=.96422,Et=.82521,It=4/29,Ct=6/29,Tt=3*Ct*Ct,Pt=Ct*Ct*Ct,$t=Math.PI/180,Ft=180/Math.PI
120
120
  function Dt(t){return(t%=360)<0&&(t+=360),t}function Ot([t,e,i,s]){let n,r
121
121
  const o=Nt((.2225045*(t=Lt(t))+.7168786*(e=Lt(e))+.0606169*(i=Lt(i)))/1)
122
122
  t===e&&e===i?n=r=o:(n=Nt((.4360747*t+.3850649*e+.1430804*i)/At),r=Nt((.0139322*t+.0971045*e+.7141733*i)/Et))
123
123
  const a=116*o-16
124
- return[a<0?0:a,500*(n-o),200*(o-r),s]}function Lt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Nt(t){return t>Pt?Math.pow(t,1/3):t/Ct+It}function jt([t,e,i,s]){let n=(t+16)/116,r=isNaN(e)?n:n+e/500,o=isNaN(i)?n:n-i/200
125
- return n=1*qt(n),r=At*qt(r),o=Et*qt(o),[Rt(3.1338561*r-1.6168667*n-.4906146*o),Rt(-.9787684*r+1.9161415*n+.033454*o),Rt(.0719453*r-.2289914*n+1.4052427*o),s]}function Rt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function qt(t){return t>Tt?t*t*t:Ct*(t-It)}function Bt(t){return parseInt(t.padEnd(2,t),16)/255}function Ut(t,e){return Vt(e?t/100:t,0,1)}function Vt(t,e,i){return Math.min(Math.max(e,t),i)}function Gt(t){return!t.some(Number.isNaN)}const Zt={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]}
124
+ return[a<0?0:a,500*(n-o),200*(o-r),s]}function Lt(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Nt(t){return t>Pt?Math.pow(t,1/3):t/Tt+It}function jt([t,e,i,s]){let n=(t+16)/116,r=isNaN(e)?n:n+e/500,o=isNaN(i)?n:n-i/200
125
+ return n=1*qt(n),r=At*qt(r),o=Et*qt(o),[Rt(3.1338561*r-1.6168667*n-.4906146*o),Rt(-.9787684*r+1.9161415*n+.033454*o),Rt(.0719453*r-.2289914*n+1.4052427*o),s]}function Rt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function qt(t){return t>Ct?t*t*t:Tt*(t-It)}function Bt(t){return parseInt(t.padEnd(2,t),16)/255}function Ut(t,e){return Vt(e?t/100:t,0,1)}function Vt(t,e,i){return Math.min(Math.max(e,t),i)}function Gt(t){return!t.some(Number.isNaN)}const Zt={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]}
126
126
  class Wt{constructor(t,e,i,s=1,n=!0){this.r=t,this.g=e,this.b=i,this.a=s,n||(this.r*=s,this.g*=s,this.b*=s,s||this.overwriteGetter("rgb",[t,e,i,s]))}static parse(t){if(t instanceof Wt)return t
127
127
  if("string"!=typeof t)return
128
128
  const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0]
@@ -343,7 +343,7 @@ i-=n/r}var o=0,a=1
343
343
  for(i=t,s=0;s<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));s++)t>n?o=i:a=i,i=.5*(a-o)+o
344
344
  return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}}
345
345
  var ke,Ae=(ke=ze)&&ke._&&Object.prototype.hasOwnProperty.call(ke,"default")?ke.default:ke
346
- function Ee(t,e,i){return t+i*(e-t)}function Ie(t,e,i){return t.map((t,s)=>Ee(t,e[s],i))}const Te={number:Ee,color:function(t,e,i,s="rgb"){switch(s){case"rgb":{const[s,n,r,o]=Ie(t.rgb,e.rgb,i)
346
+ function Ee(t,e,i){return t+i*(e-t)}function Ie(t,e,i){return t.map((t,s)=>Ee(t,e[s],i))}const Ce={number:Ee,color:function(t,e,i,s="rgb"){switch(s){case"rgb":{const[s,n,r,o]=Ie(t.rgb,e.rgb,i)
347
347
  return new Wt(s,n,r,o,!1)}case"hcl":{const[s,n,r,o]=t.hcl,[a,h,l,c]=e.hcl
348
348
  let u,f
349
349
  if(isNaN(s)||isNaN(a))isNaN(s)?isNaN(a)?u=NaN:(u=a,1!==r&&0!==r||(f=h)):(u=s,1!==l&&0!==l||(f=n))
@@ -357,7 +357,7 @@ for(let o=0;o<s.length;o+=2){if(s[o]!==n[o])throw new oe(`Cannot interpolate val
357
357
  r.push(s[o])
358
358
  const[t,e]=s[o+1],[a,h]=n[o+1]
359
359
  r.push([Ee(t,a,i),Ee(e,h,i)])}return new Qt(r)}}
360
- class Ce{constructor(t,e,i,s,n){this.type=t,this.operator=e,this.interpolation=i,this.input=s,this.labels=[],this.outputs=[]
360
+ class Te{constructor(t,e,i,s,n){this.type=t,this.operator=e,this.interpolation=i,this.input=s,this.labels=[],this.outputs=[]
361
361
  for(const[r,o]of n)this.labels.push(r),this.outputs.push(o)}static interpolationFactor(t,e,i,s){let n=0
362
362
  if("exponential"===t.name)n=Pe(e,t.base,i,s)
363
363
  else if("linear"===t.name)n=Pe(e,1,i,s)
@@ -381,16 +381,16 @@ if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expre
381
381
  if(o.length&&o[o.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',s)
382
382
  const l=e.parse(i,n,a)
383
383
  if(!l)return null
384
- a=a||l.type,o.push([t,l])}return kt(a,lt)||kt(a,ft)||kt(a,gt)||kt(a,vt)||kt(a,wt(lt))?new Ce(a,i,s,n,o):e.error(`Type ${bt(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs
384
+ a=a||l.type,o.push([t,l])}return kt(a,lt)||kt(a,ft)||kt(a,gt)||kt(a,vt)||kt(a,wt(lt))?new Te(a,i,s,n,o):e.error(`Type ${bt(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs
385
385
  if(1===e.length)return i[0].evaluate(t)
386
386
  const s=this.input.evaluate(t)
387
387
  if(s<=e[0])return i[0].evaluate(t)
388
388
  const n=e.length
389
389
  if(s>=e[n-1])return i[n-1].evaluate(t)
390
- const r=xe(e,s),o=Ce.interpolationFactor(this.interpolation,s,e[r],e[r+1]),a=i[r].evaluate(t),h=i[r+1].evaluate(t)
391
- switch(this.operator){case"interpolate":return Te[this.type.kind](a,h,o)
392
- case"interpolate-hcl":return Te.color(a,h,o,"hcl")
393
- case"interpolate-lab":return Te.color(a,h,o,"lab")}}eachChild(t){t(this.input)
390
+ const r=xe(e,s),o=Te.interpolationFactor(this.interpolation,s,e[r],e[r+1]),a=i[r].evaluate(t),h=i[r+1].evaluate(t)
391
+ switch(this.operator){case"interpolate":return Ce[this.type.kind](a,h,o)
392
+ case"interpolate-hcl":return Ce.color(a,h,o,"hcl")
393
+ case"interpolate-lab":return Ce.color(a,h,o,"lab")}}eachChild(t){t(this.input)
394
394
  for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Pe(t,e,i,s){const n=s-i,r=t-i
395
395
  return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}class $e{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.")
396
396
  let i=null
@@ -550,9 +550,9 @@ const s=Math.floor(i/2)-1
550
550
  return[[t[0],t[0]+s],[t[0]+s+1,t[1]]]}function Ii(t,e){if(!Ai(e,t.length))return[1/0,1/0,-1/0,-1/0]
551
551
  const i=[1/0,1/0,-1/0,-1/0]
552
552
  for(let s=e[0];s<=e[1];++s)Ke(i,t[s])
553
- return i}function Ti(t){const e=[1/0,1/0,-1/0,-1/0]
553
+ return i}function Ci(t){const e=[1/0,1/0,-1/0,-1/0]
554
554
  for(const i of t)for(const t of i)Ke(e,t)
555
- return e}function Ci(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Pi(t,e,i){if(!Ci(t)||!Ci(e))return NaN
555
+ return e}function Ti(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Pi(t,e,i){if(!Ti(t)||!Ti(e))return NaN
556
556
  let s=0,n=0
557
557
  return t[2]<e[0]&&(s=e[0]-t[2]),t[0]>e[2]&&(s=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),i.distance([0,0],[s,n])}function $i(t,e,i){const s=i.pointOnLine(e,t)
558
558
  return i.distance(t,s.point)}function Fi(t,e,i,s,n){const r=Math.min($i(t,[i,s],n),$i(e,[i,s],n)),o=Math.min($i(i,[t,e],n),$i(s,[t,e],n))
@@ -576,7 +576,7 @@ for(let r=e[0];r<e[1];++r){const e=t[r],o=t[r+1]
576
576
  for(const t of i)for(let i=0,r=t.length,a=r-1;i<r;a=i++){const r=t[a],h=t[i]
577
577
  if(ti(e,o,r,h))return 0
578
578
  n=Math.min(n,Fi(e,o,r,h,s))}}return n}function ji(t,e){for(const i of t)for(const t of i)if(ii(t,e,!0))return!0
579
- return!1}function Ri(t,e,i,s=1/0){const n=Ti(t),r=Ti(e)
579
+ return!1}function Ri(t,e,i,s=1/0){const n=Ci(t),r=Ci(e)
580
580
  if(s!==1/0&&Pi(n,r,i)>=s)return s
581
581
  if(Ye(n,r)){if(ji(t,e))return 0}else if(ji(e,t))return 0
582
582
  let o=1/0
@@ -589,7 +589,7 @@ o<e&&t.push([o,r,[0,0]])}function Bi(t,e,i,s,n,r,o){if(!r||!o)return
589
589
  const a=Pi(Ii(s,r),Ii(n,o),i)
590
590
  a<e&&t.push([a,r,o])}function Ui(t,e,i,s,n=1/0){let r=Math.min(s.distance(t[0],i[0][0]),n)
591
591
  if(0===r)return r
592
- const o=new pi([[0,[0,t.length-1],[0,0]]],Si),a=Ti(i)
592
+ const o=new pi([[0,[0,t.length-1],[0,0]]],Si),a=Ci(i)
593
593
  for(;o.length>0;){const n=o.pop()
594
594
  if(n[0]>=r)continue
595
595
  const h=n[1],l=e?50:100
@@ -640,7 +640,7 @@ for(const o of e)for(const t of s){switch(o.type){case"Point":r=Math.min(r,Ui([o
640
640
  break
641
641
  case"LineString":r=Math.min(r,Ui(o.coordinates,!0,t,n,r))
642
642
  break
643
- case"Polygon":r=Math.min(r,Ri(t,o.coordinates,n,r))}if(0===r)return r}return r}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Wi={"==":Le,"!=":Ne,">":Re,"<":je,">=":Be,"<=":qe,array:he,at:_e,boolean:he,case:we,coalesce:$e,collator:Ue,format:Ge,image:Ze,in:ge,"index-of":ye,interpolate:Ce,"interpolate-hcl":Ce,"interpolate-lab":Ce,length:We,let:de,literal:re,match:ve,number:he,"number-format":Ve,object:he,slice:be,step:Me,string:he,"to-boolean":ce,"to-color":ce,"to-number":ce,"to-string":ce,var:me,within:fi,distance:Zi}
643
+ case"Polygon":r=Math.min(r,Ri(t,o.coordinates,n,r))}if(0===r)return r}return r}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Wi={"==":Le,"!=":Ne,">":Re,"<":je,">=":Be,"<=":qe,array:he,at:_e,boolean:he,case:we,coalesce:$e,collator:Ue,format:Ge,image:Ze,in:ge,"index-of":ye,interpolate:Te,"interpolate-hcl":Te,"interpolate-lab":Te,length:We,let:de,literal:re,match:ve,number:he,"number-format":Ve,object:he,slice:be,step:Me,string:he,"to-boolean":ce,"to-color":ce,"to-number":ce,"to-string":ce,var:me,within:fi,distance:Zi}
644
644
  class Hi{constructor(t,e,i,s){this.name=t,this.type=e,this.kt=i,this.args=s}evaluate(t){return this.kt(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const i=t[0],s=Hi.definitions[i]
645
645
  if(!s)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)
646
646
  const n=Array.isArray(s)?s[0]:s.type,r=Array.isArray(s)?[[s[1],s[2]]]:s.overloads,o=r.filter(([e])=>!Array.isArray(e)||e.length===t.length-1)
@@ -694,8 +694,8 @@ for(let e=0;e<t.stops.length;e++){const n=t.stops[e],r=n[0].zoom
694
694
  void 0===i[r]&&(i[r]={zoom:r,type:t.type,property:t.property,default:t.default,stops:[]},s.push(r)),i[r].stops.push([n[0].value,n[1]])}const n=[]
695
695
  for(const t of s)n.push([i[t].zoom,us(i[t],e)])
696
696
  const r={name:"linear"}
697
- return{kind:"composite",interpolationType:r,interpolationFactor:Ce.interpolationFactor.bind(void 0,r),zoomStops:n.map(t=>t[0]),evaluate:({zoom:i},s)=>ms({stops:n,base:t.base},e,i).evaluate(i,s)}}if(n){const i="exponential"===r?{name:"exponential",base:void 0!==t.base?t.base:1}:null
698
- return{kind:"camera",interpolationType:i,interpolationFactor:Ce.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:i})=>a(t,e,i,h,l)}}return{kind:"source",evaluate(i,s){const n=s&&s.properties?s.properties[t.property]:void 0
697
+ return{kind:"composite",interpolationType:r,interpolationFactor:Te.interpolationFactor.bind(void 0,r),zoomStops:n.map(t=>t[0]),evaluate:({zoom:i},s)=>ms({stops:n,base:t.base},e,i).evaluate(i,s)}}if(n){const i="exponential"===r?{name:"exponential",base:void 0!==t.base?t.base:1}:null
698
+ return{kind:"camera",interpolationType:i,interpolationFactor:Te.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:i})=>a(t,e,i,h,l)}}return{kind:"source",evaluate(i,s){const n=s&&s.properties?s.properties[t.property]:void 0
699
699
  return void 0===n?fs(t.default,e.default):a(t,e,n,h,l)}}}function fs(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function ps(t,e,i,s,n){return fs(typeof i===n?s[i]:void 0,t.default,e.default)}function ds(t,e,i){if("number"!==hs(i))return fs(t.default,e.default)
700
700
  const s=t.stops.length
701
701
  if(1===s)return t.stops[0][1]
@@ -709,7 +709,7 @@ if(1===n)return t.stops[0][1]
709
709
  if(i<=t.stops[0][0])return t.stops[0][1]
710
710
  if(i>=t.stops[n-1][0])return t.stops[n-1][1]
711
711
  const r=xe(t.stops.map(t=>t[0]),i),o=function(t,e,i,s){const n=s-i,r=t-i
712
- return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}(i,s,t.stops[r][0],t.stops[r+1][0]),a=t.stops[r][1],h=t.stops[r+1][1],l=Te[e.type]||cs
712
+ return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-1)}(i,s,t.stops[r][0],t.stops[r+1][0]),a=t.stops[r][1],h=t.stops[r+1][1],l=Ce[e.type]||cs
713
713
  return"function"==typeof a.evaluate?{evaluate(...e){const i=a.evaluate.apply(void 0,e),s=h.evaluate.apply(void 0,e)
714
714
  if(void 0!==i&&void 0!==s)return l(i,s,o,t.colorSpace)}}:l(a,h,o,t.colorSpace)}function _s(t,e,i){switch(e.type){case"color":i=Wt.parse(i)
715
715
  break
@@ -740,22 +740,22 @@ return!0}]]},any:{type:ut,overloads:[[[ut,ut],(t,[e,i])=>e.evaluate(t)||i.evalua
740
740
  return!1}]]},"!":[ut,[ut],(t,[e])=>!e.evaluate(t)],"is-supported-script":[ut,[ct],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript
741
741
  return!i||i(e.evaluate(t))}],upcase:[ct,[ct],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ct,[ct],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ct,Yi(dt),(t,e)=>e.map(e=>ne(e.evaluate(t))).join("")],"resolved-locale":[ct,[mt],(t,[e])=>e.evaluate(t).resolvedLocale()]})
742
742
  class gs{constructor(t,e){var i
743
- this.expression=t,this.At={},this.Et=new fe,this.It=e?"color"===(i=e).type&&ls(i.default)?new Wt(0,0,0,0):"color"===i.type?Wt.parse(i.default)||null:"padding"===i.type?Kt.parse(i.default)||null:"variableAnchorOffsetCollection"===i.type?Qt.parse(i.default)||null:void 0===i.default?null:i.default:null,this.Tt=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,s,n,r){return this.Et.globals=t,this.Et.feature=e,this.Et.featureState=i,this.Et.canonical=s,this.Et.availableImages=n||null,this.Et.formattedSection=r,this.expression.evaluate(this.Et)}evaluate(t,e,i,s,n,r){this.Et.globals=t,this.Et.feature=e||null,this.Et.featureState=i||null,this.Et.canonical=s,this.Et.availableImages=n||null,this.Et.formattedSection=r||null
743
+ this.expression=t,this.At={},this.Et=new fe,this.It=e?"color"===(i=e).type&&ls(i.default)?new Wt(0,0,0,0):"color"===i.type?Wt.parse(i.default)||null:"padding"===i.type?Kt.parse(i.default)||null:"variableAnchorOffsetCollection"===i.type?Qt.parse(i.default)||null:void 0===i.default?null:i.default:null,this.Ct=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,s,n,r){return this.Et.globals=t,this.Et.feature=e,this.Et.featureState=i,this.Et.canonical=s,this.Et.availableImages=n||null,this.Et.formattedSection=r,this.expression.evaluate(this.Et)}evaluate(t,e,i,s,n,r){this.Et.globals=t,this.Et.feature=e||null,this.Et.featureState=i||null,this.Et.canonical=s,this.Et.availableImages=n||null,this.Et.formattedSection=r||null
744
744
  try{const t=this.expression.evaluate(this.Et)
745
745
  if(null==t||"number"==typeof t&&t!=t)return this.It
746
- if(this.Tt&&!(t in this.Tt))throw new oe(`Expected value to be one of ${Object.keys(this.Tt).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`)
746
+ if(this.Ct&&!(t in this.Ct))throw new oe(`Expected value to be one of ${Object.keys(this.Ct).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`)
747
747
  return t}catch(o){return this.At[o.message]||(this.At[o.message]=!0),this.It}}}function ys(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Wi}function vs(t,e){const i=new pe(Wi,Qi,[],e?function(t){const e={color:ft,string:ct,number:lt,enum:ct,boolean:ut,formatted:_t,padding:gt,resolvedImage:yt,variableAnchorOffsetCollection:vt}
748
748
  return"array"===t.type?wt(e[t.value]||dt,t.length):e[t.type]}(e):void 0),s=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0)
749
- return s?ss(new gs(s,e)):ns(i.errors)}class ws{constructor(t,e){this.kind=t,this.Ct=e,this.isStateDependent="constant"!==t&&!es(e.expression)}evaluateWithoutErrorHandling(t,e,i,s,n,r){return this.Ct.evaluateWithoutErrorHandling(t,e,i,s,n,r)}evaluate(t,e,i,s,n,r){return this.Ct.evaluate(t,e,i,s,n,r)}}class bs{constructor(t,e,i,s){this.kind=t,this.zoomStops=i,this.Ct=e,this.isStateDependent="camera"!==t&&!es(e.expression),this.interpolationType=s}evaluateWithoutErrorHandling(t,e,i,s,n,r){return this.Ct.evaluateWithoutErrorHandling(t,e,i,s,n,r)}evaluate(t,e,i,s,n,r){return this.Ct.evaluate(t,e,i,s,n,r)}interpolationFactor(t,e,i){return this.interpolationType?Ce.interpolationFactor(this.interpolationType,t,e,i):0}}function xs(t,e){const i=vs(t,e)
749
+ return s?ss(new gs(s,e)):ns(i.errors)}class ws{constructor(t,e){this.kind=t,this.Tt=e,this.isStateDependent="constant"!==t&&!es(e.expression)}evaluateWithoutErrorHandling(t,e,i,s,n,r){return this.Tt.evaluateWithoutErrorHandling(t,e,i,s,n,r)}evaluate(t,e,i,s,n,r){return this.Tt.evaluate(t,e,i,s,n,r)}}class bs{constructor(t,e,i,s){this.kind=t,this.zoomStops=i,this.Tt=e,this.isStateDependent="camera"!==t&&!es(e.expression),this.interpolationType=s}evaluateWithoutErrorHandling(t,e,i,s,n,r){return this.Tt.evaluateWithoutErrorHandling(t,e,i,s,n,r)}evaluate(t,e,i,s,n,r){return this.Tt.evaluate(t,e,i,s,n,r)}interpolationFactor(t,e,i){return this.interpolationType?Te.interpolationFactor(this.interpolationType,t,e,i):0}}function xs(t,e){const i=vs(t,e)
750
750
  if("error"===i.result)return i
751
751
  const s=i.value.expression,n=ts(s)
752
752
  if(!n&&!rs(e))return ns([new ot("","data expressions not supported")])
753
753
  const r=is(s,["zoom"])
754
754
  if(!r&&!os(e))return ns([new ot("","zoom expressions not supported")])
755
755
  const o=zs(s)
756
- return o||r?o instanceof ot?ns([o]):o instanceof Ce&&!as(e)?ns([new ot("",'"interpolate" expressions cannot be used with this property')]):ss(o?new bs(n?"camera":"composite",i.value,o.labels,o instanceof Ce?o.interpolation:void 0):new ws(n?"constant":"source",i.value)):ns([new ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ms{constructor(t,e){this.Pt=t,this.$t=e,rt(this,us(this.Pt,this.$t))}static deserialize(t){return new Ms(t.Pt,t.$t)}static serialize(t){return{Pt:t.Pt,$t:t.$t}}}function zs(t){let e=null
756
+ return o||r?o instanceof ot?ns([o]):o instanceof Te&&!as(e)?ns([new ot("",'"interpolate" expressions cannot be used with this property')]):ss(o?new bs(n?"camera":"composite",i.value,o.labels,o instanceof Te?o.interpolation:void 0):new ws(n?"constant":"source",i.value)):ns([new ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ms{constructor(t,e){this.Pt=t,this.$t=e,rt(this,us(this.Pt,this.$t))}static deserialize(t){return new Ms(t.Pt,t.$t)}static serialize(t){return{Pt:t.Pt,$t:t.$t}}}function zs(t){let e=null
757
757
  if(t instanceof de)e=zs(t.result)
758
- else if(t instanceof $e){for(const i of t.args)if(e=zs(i),e)break}else(t instanceof Me||t instanceof Ce)&&t.input instanceof Hi&&"zoom"===t.input.name&&(e=t)
758
+ else if(t instanceof $e){for(const i of t.args)if(e=zs(i),e)break}else(t instanceof Me||t instanceof Te)&&t.input instanceof Hi&&"zoom"===t.input.name&&(e=t)
759
759
  return e instanceof ot||t.eachChild(t=>{const i=zs(t)
760
760
  i instanceof ot?e=i:!e&&i?e=new ot("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new ot("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ss(t){if(!0===t||!1===t)return!0
761
761
  if(!Array.isArray(t)||0===t.length)return!1
@@ -767,16 +767,16 @@ case"any":case"all":for(const e of t.slice(1))if(!Ss(e)&&"boolean"!=typeof e)ret
767
767
  return!0
768
768
  default:return!0}}const ks={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}}
769
769
  function As(t){if(null==t)return{filter:()=>!0,needGeometry:!1}
770
- Ss(t)||(t=Ts(t))
770
+ Ss(t)||(t=Cs(t))
771
771
  const e=vs(t,ks)
772
772
  if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "))
773
773
  return{filter:(t,i,s)=>e.value.evaluate(t,i,{},s),needGeometry:Is(t)}}function Es(t,e){return t<e?-1:t>e?1:0}function Is(t){if(!Array.isArray(t))return!1
774
774
  if("within"===t[0]||"distance"===t[0])return!0
775
775
  for(let e=1;e<t.length;e++)if(Is(t[e]))return!0
776
- return!1}function Ts(t){if(!t)return!0
776
+ return!1}function Cs(t){if(!t)return!0
777
777
  const e=t[0]
778
- return t.length<=1?"any"!==e:"=="===e?Cs(t[1],t[2],"=="):"!="===e?Fs(Cs(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Cs(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Ts))):"all"===e?["all"].concat(t.slice(1).map(Ts)):"none"===e?["all"].concat(t.slice(1).map(Ts).map(Fs)):"in"===e?Ps(t[1],t.slice(2)):"!in"===e?Fs(Ps(t[1],t.slice(2))):"has"===e?$s(t[1]):"!has"!==e||Fs($s(t[1]))
779
- var i}function Cs(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e]
778
+ return t.length<=1?"any"!==e:"=="===e?Ts(t[1],t[2],"=="):"!="===e?Fs(Ts(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Ts(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Cs))):"all"===e?["all"].concat(t.slice(1).map(Cs)):"none"===e?["all"].concat(t.slice(1).map(Cs).map(Fs)):"in"===e?Ps(t[1],t.slice(2)):"!in"===e?Fs(Ps(t[1],t.slice(2))):"has"===e?$s(t[1]):"!has"!==e||Fs($s(t[1]))
779
+ var i}function Ts(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e]
780
780
  case"$id":return[`filter-id-${i}`,e]
781
781
  default:return[`filter-${i}`,t,e]}}function Ps(t,e){if(0===e.length)return!1
782
782
  switch(t){case"$type":return["filter-type-in",["literal",e]]
@@ -839,7 +839,7 @@ if("number"!==a&&"string"!==a&&"boolean"!==a)return[new nt(t.key,l,"stop domain
839
839
  if("number"!==a&&"categorical"!==i){let s=`number expected, ${a} found`
840
840
  return rs(e)&&void 0===i&&(s+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new nt(t.key,l,s)]}return"categorical"!==i||"number"!==a||isFinite(h)&&Math.floor(h)===h?"categorical"!==i&&"number"===a&&void 0!==n&&h<n?[new nt(t.key,l,"stop domain values must appear in ascending order")]:(n=h,"categorical"===i&&h in o?[new nt(t.key,l,"stop domain values must be unique")]:(o[h]=!0,[])):[new nt(t.key,l,`integer expected, found ${h}`)]}}function Vs(t){const e=("property"===t.expressionContext?xs:vs)(js(t.value),t.valueSpec)
841
841
  if("error"===e.result)return e.value.map(e=>new nt(`${t.key}${e.key}`,t.value,e.message))
842
- const i=e.value.expression||e.value.Ct.expression
842
+ const i=e.value.expression||e.value.Tt.expression
843
843
  if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new nt(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)]
844
844
  if("property"===t.expressionContext&&"layout"===t.propertyType&&!es(i))return[new nt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')]
845
845
  if("filter"===t.expressionContext&&!es(i))return[new nt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')]
@@ -1001,13 +1001,13 @@ const s=Object.create(i.prototype)
1001
1001
  for(const n of Object.keys(t)){if("$name"===n)continue
1002
1002
  const i=t[n]
1003
1003
  s[n]=wn[e].shallow.indexOf(n)>=0?i:kn(i)}return s}class An{constructor(){this.first=!0}update(t,e){const i=Math.floor(t)
1004
- return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(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,!0))}}const En=t=>t>=12272&&t<=12287,In=t=>t>=12288&&t<=12351,Tn=t=>t>=12448&&t<=12543,Cn=t=>t>=12736&&t<=12783,Pn=t=>t>=12800&&t<=13055,$n=t=>t>=13056&&t<=13311,Fn=t=>t>=65040&&t<=65055,Dn=t=>t>=65072&&t<=65103,On=t=>t>=65104&&t<=65135,Ln=t=>t>=65280&&t<=65519
1004
+ return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(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,!0))}}const En=t=>t>=12272&&t<=12287,In=t=>t>=12288&&t<=12351,Cn=t=>t>=12448&&t<=12543,Tn=t=>t>=12736&&t<=12783,Pn=t=>t>=12800&&t<=13055,$n=t=>t>=13056&&t<=13311,Fn=t=>t>=65040&&t<=65055,Dn=t=>t>=65072&&t<=65103,On=t=>t>=65104&&t<=65135,Ln=t=>t>=65280&&t<=65519
1005
1005
  function Nn(t){for(const e of t)if(Vn(e.charCodeAt(0)))return!0
1006
1006
  return!1}function jn(t){for(const e of t)if(!Bn(e.charCodeAt(0)))return!1
1007
1007
  return!0}function Rn(t){const e=t.map(t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(e){return null}}).filter(t=>t)
1008
1008
  return new RegExp(e.join("|"),"u")}const qn=Rn(["Arab","Dupl","Mong","Ougr","Syrc"])
1009
1009
  function Bn(t){return!qn.test(String.fromCodePoint(t))}const Un=Rn(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"])
1010
- function Vn(t){return!(746!==t&&747!==t&&(t<4352||!(Dn(t)&&!(t>=65097&&t<=65103)||$n(t)||Cn(t)||!(!In(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Pn(t)||En(t)||(t=>t>=12688&&t<=12703)(t)||Tn(t)&&12540!==t||!(!Ln(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)||!(!On(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Fn(t)||(t=>t>=19904&&t<=19967)(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||Un.test(String.fromCodePoint(t)))))}function Gn(t){return!(Vn(t)||(e=t,(t=>t>=128&&t<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(t=>t>=8192&&t<=8303)(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(t=>t>=8448&&t<=8527)(e)||(t=>t>=8528&&t<=8591)(e)||(t=>t>=8960&&t<=9215)(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(t=>t>=9216&&t<=9279)(e)&&9251!==e||(t=>t>=9280&&t<=9311)(e)||(t=>t>=9312&&t<=9471)(e)||(t=>t>=9632&&t<=9727)(e)||(t=>t>=9728&&t<=9983)(e)&&!(e>=9754&&e<=9759)||(t=>t>=11008&&t<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||In(e)||Tn(e)||(t=>t>=57344&&t<=63743)(e)||Dn(e)||On(e)||Ln(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e))
1010
+ function Vn(t){return!(746!==t&&747!==t&&(t<4352||!(Dn(t)&&!(t>=65097&&t<=65103)||$n(t)||Tn(t)||!(!In(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Pn(t)||En(t)||(t=>t>=12688&&t<=12703)(t)||Cn(t)&&12540!==t||!(!Ln(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)||!(!On(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Fn(t)||(t=>t>=19904&&t<=19967)(t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||Un.test(String.fromCodePoint(t)))))}function Gn(t){return!(Vn(t)||(e=t,(t=>t>=128&&t<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(t=>t>=8192&&t<=8303)(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(t=>t>=8448&&t<=8527)(e)||(t=>t>=8528&&t<=8591)(e)||(t=>t>=8960&&t<=9215)(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(t=>t>=9216&&t<=9279)(e)&&9251!==e||(t=>t>=9280&&t<=9311)(e)||(t=>t>=9312&&t<=9471)(e)||(t=>t>=9632&&t<=9727)(e)||(t=>t>=9728&&t<=9983)(e)&&!(e>=9754&&e<=9759)||(t=>t>=11008&&t<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||In(e)||Cn(e)||(t=>t>=57344&&t<=63743)(e)||Dn(e)||On(e)||Ln(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e))
1011
1011
  var e}const Zn=Rn(["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"])
1012
1012
  function Wn(t){return Zn.test(String.fromCodePoint(t))}function Hn(t,e){return!(!e&&Wn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||(t=>t>=6016&&t<=6143)(t))}function Xn(t){for(const e of t)if(Wn(e.charCodeAt(0)))return!0
1013
1013
  return!1}const Jn=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}}
@@ -1041,10 +1041,10 @@ for(const e of Object.keys(this.Bt)){const i=this.getValue(e)
1041
1041
  void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const s=new rr(this.qt)
1042
1042
  for(const n of Object.keys(this.Bt))s.Bt[n]=this.Bt[n].possiblyEvaluate(t,e,i)
1043
1043
  return s}}class nr{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,s){return this.property.evaluate(this.value,this.parameters,t,e,i,s)}}class rr{constructor(t){this.qt=t,this.Bt=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this.Bt[t]}}class or{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven")
1044
- return t.expression.evaluate(e)}interpolate(t,e,i){const s=Te[this.specification.type]
1044
+ return t.expression.evaluate(e)}interpolate(t,e,i){const s=Ce[this.specification.type]
1045
1045
  return s?s(t,e,i):t}}class ar{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,s){return new nr(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,s)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t
1046
1046
  if(void 0===t.value.value||void 0===e.value.value)return new nr(this,{kind:"constant",value:void 0},t.parameters)
1047
- const s=Te[this.specification.type]
1047
+ const s=Ce[this.specification.type]
1048
1048
  if(s){const n=s(t.value.value,e.value.value,i)
1049
1049
  return new nr(this,{kind:"constant",value:n},t.parameters)}return t}evaluate(t,e,i,s,n,r){return"constant"===t.kind?t.value:t.evaluate(e,i,s,n,r)}}class hr extends ar{possiblyEvaluate(t,e,i,s){if(void 0===t.value)return new nr(this,{kind:"constant",value:void 0},e)
1050
1050
  if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,s),r="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,o=this.Ut(r,r,r,e)
@@ -1105,12 +1105,12 @@ return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]
1105
1105
  class Ir extends _r{ne(){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,s,n,r,o,a,h){const l=this.length
1106
1106
  return this.resize(l+1),this.emplace(l,t,e,i,s,n,r,o,a,h)}emplace(t,e,i,s,n,r,o,a,h,l){const c=10*t,u=5*t
1107
1107
  return this.int16[c+0]=e,this.int16[c+1]=i,this.int16[c+2]=s,this.int16[c+3]=n,this.int16[c+4]=r,this.int16[c+5]=o,this.uint32[u+3]=a,this.uint16[c+8]=h,this.uint16[c+9]=l,t}}Ir.prototype.bytesPerElement=20,bn("StructArrayLayout6i1ul2ui20",Ir)
1108
- class Tr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,s,n,r){const o=this.length
1108
+ class Cr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,s,n,r){const o=this.length
1109
1109
  return this.resize(o+1),this.emplace(o,t,e,i,s,n,r)}emplace(t,e,i,s,n,r,o){const a=6*t
1110
- return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=s,this.int16[a+3]=n,this.int16[a+4]=r,this.int16[a+5]=o,t}}Tr.prototype.bytesPerElement=12,bn("StructArrayLayout2i2i2i12",Tr)
1111
- class Cr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,s,n){const r=this.length
1110
+ return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=s,this.int16[a+3]=n,this.int16[a+4]=r,this.int16[a+5]=o,t}}Cr.prototype.bytesPerElement=12,bn("StructArrayLayout2i2i2i12",Cr)
1111
+ class Tr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,s,n){const r=this.length
1112
1112
  return this.resize(r+1),this.emplace(r,t,e,i,s,n)}emplace(t,e,i,s,n,r){const o=4*t,a=8*t
1113
- return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=s,this.int16[a+6]=n,this.int16[a+7]=r,t}}Cr.prototype.bytesPerElement=16,bn("StructArrayLayout2f1f2i16",Cr)
1113
+ return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=s,this.int16[a+6]=n,this.int16[a+7]=r,t}}Tr.prototype.bytesPerElement=16,bn("StructArrayLayout2f1f2i16",Tr)
1114
1114
  class Pr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,s,n,r){const o=this.length
1115
1115
  return this.resize(o+1),this.emplace(o,t,e,i,s,n,r)}emplace(t,e,i,s,n,r,o){const a=16*t,h=4*t,l=8*t
1116
1116
  return this.uint8[a+0]=e,this.uint8[a+1]=i,this.float32[h+1]=s,this.float32[h+2]=n,this.int16[l+6]=r,this.int16[l+7]=o,t}}Pr.prototype.bytesPerElement=16,bn("StructArrayLayout2ub2f2i16",Pr)
@@ -1121,8 +1121,8 @@ class Fr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=
1121
1121
  return this.resize(g+1),this.emplace(g,t,e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_)}emplace(t,e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g){const y=24*t,v=12*t,w=48*t
1122
1122
  return this.int16[y+0]=e,this.int16[y+1]=i,this.uint16[y+2]=s,this.uint16[y+3]=n,this.uint32[v+2]=r,this.uint32[v+3]=o,this.uint32[v+4]=a,this.uint16[y+10]=h,this.uint16[y+11]=l,this.uint16[y+12]=c,this.float32[v+7]=u,this.float32[v+8]=f,this.uint8[w+36]=p,this.uint8[w+37]=d,this.uint8[w+38]=m,this.uint32[v+10]=_,this.int16[y+22]=g,t}}Fr.prototype.bytesPerElement=48,bn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Fr)
1123
1123
  class Dr extends _r{ne(){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,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,M,z,S,k,A){const E=this.length
1124
- return this.resize(E+1),this.emplace(E,t,e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,M,z,S,k,A)}emplace(t,e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,M,z,S,k,A,E){const I=32*t,T=16*t
1125
- return this.int16[I+0]=e,this.int16[I+1]=i,this.int16[I+2]=s,this.int16[I+3]=n,this.int16[I+4]=r,this.int16[I+5]=o,this.int16[I+6]=a,this.int16[I+7]=h,this.uint16[I+8]=l,this.uint16[I+9]=c,this.uint16[I+10]=u,this.uint16[I+11]=f,this.uint16[I+12]=p,this.uint16[I+13]=d,this.uint16[I+14]=m,this.uint16[I+15]=_,this.uint16[I+16]=g,this.uint16[I+17]=y,this.uint16[I+18]=v,this.uint16[I+19]=w,this.uint16[I+20]=b,this.uint16[I+21]=x,this.uint16[I+22]=M,this.uint32[T+12]=z,this.float32[T+13]=S,this.float32[T+14]=k,this.uint16[I+30]=A,this.uint16[I+31]=E,t}}Dr.prototype.bytesPerElement=64,bn("StructArrayLayout8i15ui1ul2f2ui64",Dr)
1124
+ return this.resize(E+1),this.emplace(E,t,e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,M,z,S,k,A)}emplace(t,e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,M,z,S,k,A,E){const I=32*t,C=16*t
1125
+ return this.int16[I+0]=e,this.int16[I+1]=i,this.int16[I+2]=s,this.int16[I+3]=n,this.int16[I+4]=r,this.int16[I+5]=o,this.int16[I+6]=a,this.int16[I+7]=h,this.uint16[I+8]=l,this.uint16[I+9]=c,this.uint16[I+10]=u,this.uint16[I+11]=f,this.uint16[I+12]=p,this.uint16[I+13]=d,this.uint16[I+14]=m,this.uint16[I+15]=_,this.uint16[I+16]=g,this.uint16[I+17]=y,this.uint16[I+18]=v,this.uint16[I+19]=w,this.uint16[I+20]=b,this.uint16[I+21]=x,this.uint16[I+22]=M,this.uint32[C+12]=z,this.float32[C+13]=S,this.float32[C+14]=k,this.uint16[I+30]=A,this.uint16[I+31]=E,t}}Dr.prototype.bytesPerElement=64,bn("StructArrayLayout8i15ui1ul2f2ui64",Dr)
1126
1126
  class Or extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length
1127
1127
  return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Or.prototype.bytesPerElement=4,bn("StructArrayLayout1f4",Or)
1128
1128
  class Lr extends _r{ne(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const s=this.length
@@ -1151,7 +1151,7 @@ class Jr extends mr{get textAnchor(){return this.Yt.uint16[this.te+0]}get textOf
1151
1151
  class Kr extends Lr{get(t){return new Jr(this,t)}}bn("TextAnchorOffsetArray",Kr)
1152
1152
  class Yr extends mr{get featureIndex(){return this.Yt.uint32[this.ee+0]}get sourceLayerIndex(){return this.Yt.uint16[this.te+2]}get bucketIndex(){return this.Yt.uint16[this.te+3]}}Yr.prototype.size=8
1153
1153
  class Qr extends Nr{get(t){return new Yr(this,t)}}bn("FeatureIndexArray",Qr)
1154
- class to extends vr{}class eo extends vr{}class io extends vr{}class so extends xr{}class no extends Mr{}class ro extends zr{}class oo extends Sr{}class ao extends kr{}class ho extends Ar{}class lo extends Er{}class co extends Tr{}class uo extends Pr{}class fo extends $r{}class po extends jr{}const mo=gr([{name:"a_pos",components:2,type:"Int16"}],4),{members:_o}=mo
1154
+ class to extends vr{}class eo extends vr{}class io extends vr{}class so extends xr{}class no extends Mr{}class ro extends zr{}class oo extends Sr{}class ao extends kr{}class ho extends Ar{}class lo extends Er{}class co extends Cr{}class uo extends Pr{}class fo extends $r{}class po extends jr{}const mo=gr([{name:"a_pos",components:2,type:"Int16"}],4),{members:_o}=mo
1155
1155
  class go{constructor(t=[]){this.segments=t}prepareSegment(t,e,i,s){let n=this.segments[this.segments.length-1]
1156
1156
  return t>go.MAX_VERTEX_ARRAY_LENGTH&&M(`Max vertices per segment is ${go.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!n||n.vertexLength+t>go.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==s)&&(n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==s&&(n.sortKey=s),this.segments.push(n)),n}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,s){return new go([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:s,vaos:{},sortKey:0}])}}function yo(t,e){return 256*(t=m(Math.floor(t),0,255))+m(Math.floor(e),0,255)}go.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,bn("SegmentVector",go)
1157
1157
  const vo=gr([{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"}])
@@ -1183,9 +1183,9 @@ let r=i-1,o=s+1
1183
1183
  for(;;){do{r++}while(t[r]<n)
1184
1184
  do{o--}while(t[o]>n)
1185
1185
  if(r>=o)break
1186
- To(t,r,o),To(e,3*r,3*o),To(e,3*r+1,3*o+1),To(e,3*r+2,3*o+2)}o-i<s-o?(Io(t,e,i,o),i=o+1):(Io(t,e,o+1,s),s=o)}}function To(t,e,i){const s=t[e]
1186
+ Co(t,r,o),Co(e,3*r,3*o),Co(e,3*r+1,3*o+1),Co(e,3*r+2,3*o+2)}o-i<s-o?(Io(t,e,i,o),i=o+1):(Io(t,e,o+1,s),s=o)}}function Co(t,e,i){const s=t[e]
1187
1187
  t[e]=t[i],t[i]=s}bn("FeaturePositionMap",Ao)
1188
- class Co{constructor(t,e){this.gl=t.gl,this.location=e}}class Po extends Co{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class $o extends Co{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 Fo extends Co{constructor(t,e){super(t,e),this.current=Wt.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 Do=new Float32Array(16)
1188
+ class To{constructor(t,e){this.gl=t.gl,this.location=e}}class Po extends To{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class $o extends To{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 Fo extends To{constructor(t,e){super(t,e),this.current=Wt.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 Do=new Float32Array(16)
1189
1189
  function Oo(t){return[yo(255*t.r,255*t.g),yo(255*t.b,255*t.a)]}class Lo{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 Fo(t,e):new Po(t,e)}}class No{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,s){const n="u_pattern_to"===s?this.patternTo:"u_pattern_from"===s?this.patternFrom:"u_pixel_ratio_to"===s?this.pixelRatioTo:"u_pixel_ratio_from"===s?this.pixelRatioFrom:null
1190
1190
  n&&t.set(n)}getBinding(t,e,i){return"u_pattern"===i.substr(0,9)?new $o(t,e):new Po(t,e)}}class jo{constructor(t,e,i,s){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 s}populatePaintArray(t,e,i,s,n){const r=this.paintVertexArray.length,o=this.expression.evaluate(new Kn(0),e,{},s,[],n)
1191
1191
  this.paintVertexArray.resize(t),this.re(r,t,o)}updatePaintArray(t,e,i,s){const n=this.expression.evaluate({zoom:0},i,s)
@@ -1300,20 +1300,20 @@ function Ea(t,{width:e,height:i},s,n){if(n){if(n instanceof Uint8ClampedArray)n=
1300
1300
  else if(n.length!==e*i*s)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${e*i*s}`)}else n=new Uint8Array(e*i*s)
1301
1301
  return t.width=e,t.height=i,t.data=n,t}function Ia(t,{width:e,height:i},s){if(e===t.width&&i===t.height)return
1302
1302
  const n=Ea({},{width:e,height:i},s)
1303
- Ta(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},s),t.width=e,t.height=i,t.data=n.data}function Ta(t,e,i,s,n,r){if(0===n.width||0===n.height)return e
1303
+ Ca(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},s),t.width=e,t.height=i,t.data=n.data}function Ca(t,e,i,s,n,r){if(0===n.width||0===n.height)return e
1304
1304
  if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy")
1305
1305
  if(n.width>e.width||n.height>e.height||s.x>e.width-n.width||s.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy")
1306
1306
  const o=t.data,a=e.data
1307
1307
  if(o===a)throw new Error("srcData equals dstData, so image is already copied")
1308
1308
  for(let h=0;h<n.height;h++){const l=((i.y+h)*t.width+i.x)*r,c=((s.y+h)*e.width+s.x)*r
1309
- for(let t=0;t<n.width*r;t++)a[c+t]=o[l+t]}return e}class Ca{constructor(t,e){Ea(this,t,1,e)}resize(t){Ia(this,t,1)}clone(){return new Ca({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,s,n){Ta(t,e,i,s,n,1)}}class Pa{constructor(t,e){Ea(this,t,4,e)}resize(t){Ia(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Pa({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,s,n){Ta(t,e,i,s,n,4)}}function $a(t){const e={},i=t.resolution||256,s=t.clips?t.clips.length:1,n=t.image||new Pa({width:i,height:s})
1309
+ for(let t=0;t<n.width*r;t++)a[c+t]=o[l+t]}return e}class Ta{constructor(t,e){Ea(this,t,1,e)}resize(t){Ia(this,t,1)}clone(){return new Ta({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,s,n){Ca(t,e,i,s,n,1)}}class Pa{constructor(t,e){Ea(this,t,4,e)}resize(t){Ia(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Pa({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,s,n){Ca(t,e,i,s,n,4)}}function $a(t){const e={},i=t.resolution||256,s=t.clips?t.clips.length:1,n=t.image||new Pa({width:i,height:s})
1310
1310
  if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`)
1311
1311
  const r=(i,s,r)=>{e[t.evaluationKey]=r
1312
1312
  const o=t.expression.evaluate(e)
1313
1313
  n.data[i+s+0]=Math.floor(255*o.r/o.a),n.data[i+s+1]=Math.floor(255*o.g/o.a),n.data[i+s+2]=Math.floor(255*o.b/o.a),n.data[i+s+3]=Math.floor(255*o.a)}
1314
1314
  if(t.clips)for(let o=0,a=0;o<s;++o,a+=4*i)for(let e=0,s=0;e<i;e++,s+=4){const n=e/(i-1),{start:h,end:l}=t.clips[o]
1315
1315
  r(a,s,h*(1-n)+l*n)}else for(let o=0,a=0;o<i;o++,a+=4)r(0,a,o/(i-1))
1316
- return n}bn("AlphaImage",Ca),bn("RGBAImage",Pa)
1316
+ return n}bn("AlphaImage",Ta),bn("RGBAImage",Pa)
1317
1317
  const Fa="big-fb"
1318
1318
  class Da extends pr{createBucket(t){return new Sa(t)}constructor(t){super(t,Aa),this.heatmapFbos=new Map,this.ue()}Jt(t){"heatmap-color"===t&&this.ue()}ue(){this.colorRamp=$a({expression:this.Zt.Bt["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Fa)&&this.heatmapFbos.delete(Fa)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let Oa
1319
1319
  var La={get paint(){return Oa=Oa||new ur({"hillshade-illumination-direction":new or(Z.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new or(Z.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new or(Z.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new or(Z.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new or(Z.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new or(Z.paint_hillshade["hillshade-accent-color"])})}}
@@ -1460,9 +1460,9 @@ for(var i,s,n=[],r=0;r<e;r++){var o=Ah(t[r])
1460
1460
  0!==o&&(void 0===s&&(s=o<0),s===o<0?(i&&n.push(i),i=[t[r]]):i.push(t[r]))}return i&&n.push(i),n}(h),s=0;s<h.length;s++)for(n=0;n<h[s].length;n++)c(h[s][n])}1===h.length?h=h[0]:l="Multi"+l
1461
1461
  var f={type:"Feature",geometry:{type:l,coordinates:h},properties:this.properties}
1462
1462
  return"id"in this&&(f.id=this.id),f}
1463
- var Eh=zh,Ih=Th
1464
- function Th(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.fe=t,this.de=[],this.Bt=[],this.me=[],t.readFields(Ch,this,e),this.length=this.me.length}function Ch(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e.me.push(i.pos):3===t?e.de.push(i.readString()):4===t&&e.Bt.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var s=t.readVarint()>>3
1465
- e=1===s?t.readString():2===s?t.readFloat():3===s?t.readDouble():4===s?t.readVarint64():5===s?t.readVarint():6===s?t.readSVarint():7===s?t.readBoolean():null}return e}(i))}Th.prototype.feature=function(t){if(t<0||t>=this.me.length)throw new Error("feature index out of bounds")
1463
+ var Eh=zh,Ih=Ch
1464
+ function Ch(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.fe=t,this.de=[],this.Bt=[],this.me=[],t.readFields(Th,this,e),this.length=this.me.length}function Th(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e.me.push(i.pos):3===t?e.de.push(i.readString()):4===t&&e.Bt.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var s=t.readVarint()>>3
1465
+ e=1===s?t.readString():2===s?t.readFloat():3===s?t.readDouble():4===s?t.readVarint64():5===s?t.readVarint():6===s?t.readSVarint():7===s?t.readBoolean():null}return e}(i))}Ch.prototype.feature=function(t){if(t<0||t>=this.me.length)throw new Error("feature index out of bounds")
1466
1466
  this.fe.pos=this.me[t]
1467
1467
  var e=this.fe.readVarint()+this.fe.pos
1468
1468
  return new Eh(this.fe,e,this.extent,this.de,this.Bt)}
@@ -1574,7 +1574,7 @@ bn("LineBucket",Yh,{omit:["layers","patternFeatures"]})
1574
1574
  var el={get paint(){return tl=tl||new ur({"line-opacity":new ar(Z.paint_line["line-opacity"]),"line-color":new ar(Z.paint_line["line-color"]),"line-translate":new or(Z.paint_line["line-translate"]),"line-translate-anchor":new or(Z.paint_line["line-translate-anchor"]),"line-width":new ar(Z.paint_line["line-width"]),"line-gap-width":new ar(Z.paint_line["line-gap-width"]),"line-offset":new ar(Z.paint_line["line-offset"]),"line-blur":new ar(Z.paint_line["line-blur"]),"line-dasharray":new lr(Z.paint_line["line-dasharray"]),"line-pattern":new hr(Z.paint_line["line-pattern"]),"line-gradient":new cr(Z.paint_line["line-gradient"])})},get layout(){return Qh=Qh||new ur({"line-cap":new or(Z.layout_line["line-cap"]),"line-join":new ar(Z.layout_line["line-join"]),"line-miter-limit":new or(Z.layout_line["line-miter-limit"]),"line-round-limit":new or(Z.layout_line["line-round-limit"]),"line-sort-key":new ar(Z.layout_line["line-sort-key"])})}}
1575
1575
  class il extends ar{possiblyEvaluate(t,e){return e=new Kn(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,s){return e=g({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,s)}}let sl
1576
1576
  class nl extends pr{constructor(t){super(t,el),this.gradientVersion=0,sl||(sl=new il(el.paint.properties["line-width"].specification),sl.useIntegerZoom=!0)}Jt(t){if("line-gradient"===t){const t=this.gradientExpression()
1577
- this.stepInterpolant=!(void 0===t.Ct)&&t.Ct.expression instanceof Me,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this.Zt.Bt["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint.Bt["line-floorwidth"]=sl.possiblyEvaluate(this.Wt.Bt["line-width"].value,t)}createBucket(t){return new Yh(t)}queryRadius(t){const e=t,i=rl(ca("line-width",this,e),ca("line-gap-width",this,e)),s=ca("line-offset",this,e)
1577
+ this.stepInterpolant=!(void 0===t.Tt)&&t.Tt.expression instanceof Me,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this.Zt.Bt["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint.Bt["line-floorwidth"]=sl.possiblyEvaluate(this.Wt.Bt["line-width"].value,t)}createBucket(t){return new Yh(t)}queryRadius(t){const e=t,i=rl(ca("line-width",this,e),ca("line-gap-width",this,e)),s=ca("line-offset",this,e)
1578
1578
  return i/2+Math.abs(s)+ua(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,s,n,o,a){const h=fa(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,a),l=a/2*rl(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),c=this.paint.get("line-offset").evaluate(e,i)
1579
1579
  return c&&(s=function(t,e){const i=[]
1580
1580
  for(let s=0;s<t.length;s++){const n=t[s],o=[]
@@ -1598,7 +1598,7 @@ function gl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Arr
1598
1598
  var yl=4294967296,vl=1/yl,wl="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8")
1599
1599
  function bl(t){return t.type===gl.Bytes?t.readVarint()+t.pos:t.pos+1}function xl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ml(t,e,i){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2))
1600
1600
  i.realloc(s)
1601
- for(var n=i.pos-1;n>=t;n--)i.buf[n+s]=i.buf[n]}function zl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function kl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Al(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Il(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Pl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function $l(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Fl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Dl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}gl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var s=this.readVarint(),n=s>>3,r=this.pos
1601
+ for(var n=i.pos-1;n>=t;n--)i.buf[n+s]=i.buf[n]}function zl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function kl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Al(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Il(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Pl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function $l(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Fl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Dl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}gl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var s=this.readVarint(),n=s>>3,r=this.pos
1602
1602
  this.type=7&s,t(n,e,this),this.pos===r&&this.skip(s)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=$l(this.buf,this.pos)
1603
1603
  return this.pos+=4,t},readSFixed32:function(){var t=Dl(this.buf,this.pos)
1604
1604
  return this.pos+=4,t},readFixed64:function(){var t=$l(this.buf,this.pos)+$l(this.buf,this.pos+4)*yl
@@ -1667,10 +1667,10 @@ for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){thi
1667
1667
  var i=this.pos
1668
1668
  t(e,this)
1669
1669
  var s=this.pos-i
1670
- s>=128&&Ml(i,s,this),this.pos=i-1,this.writeVarint(s),this.pos+=s},writeMessage:function(t,e,i){this.writeTag(t,gl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,kl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writeBytesField:function(t,e){this.writeTag(t,gl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,gl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,gl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,gl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,gl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,gl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,gl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,gl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,gl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,gl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}
1670
+ s>=128&&Ml(i,s,this),this.pos=i-1,this.writeVarint(s),this.pos+=s},writeMessage:function(t,e,i){this.writeTag(t,gl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,zl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,kl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pl,e)},writeBytesField:function(t,e){this.writeTag(t,gl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,gl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,gl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,gl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,gl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,gl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,gl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,gl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,gl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,gl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}
1671
1671
  var Ol,Ll=i(dl)
1672
1672
  function Nl(t,e,i){1===t&&i.readMessage(jl,e)}function jl(t,e,i){if(3===t){const{id:t,bitmap:s,width:n,height:r,left:o,top:a,advance:h}=i.readMessage(Rl,{})
1673
- e.push({id:t,bitmap:new Ca({width:n+6,height:r+6},s),metrics:{width:n,height:r,left:o,top:a,advance:h}})}}function Rl(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 ql(t){let e=0,i=0
1673
+ e.push({id:t,bitmap:new Ta({width:n+6,height:r+6},s),metrics:{width:n,height:r,left:o,top:a,advance:h}})}}function Rl(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 ql(t){let e=0,i=0
1674
1674
  for(const o of t)e+=o.w*o.h,i=Math.max(i,o.w)
1675
1675
  t.sort((t,e)=>e.h-t.h)
1676
1676
  const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}]
@@ -1768,7 +1768,7 @@ for(let a=0;a<t.length();a++){const i=t.getSection(a)
1768
1768
  o+=Kl(t.getCharCode(a),i,s,n,e,r)}return o/Math.max(1,Math.ceil(o/i))}(t,e,i,s,n,r),h=t.text.indexOf("​")>=0
1769
1769
  let l=0
1770
1770
  for(let u=0;u<t.length();u++){const i=t.getSection(u),f=t.getCharCode(u)
1771
- if(Hl[f]||(l+=Kl(f,i,s,n,e,r)),u<t.length()-1){const e=!((c=f)<11904)&&(!!Dn(c)||!!$n(c)||!!Cn(c)||!!In(c)||!!Pn(c)||!!Ln(c)||!!En(c)||!!Fn(c)||Un.test(String.fromCodePoint(c)));(Xl[f]||e||i.imageName||u!==t.length()-2&&Jl[t.getCharCode(u+1)])&&o.push(tc(u+1,l,a,o,Ql(f,t.getCharCode(u+1),e&&h),!1))}}var c
1771
+ if(Hl[f]||(l+=Kl(f,i,s,n,e,r)),u<t.length()-1){const e=!((c=f)<11904)&&(!!Dn(c)||!!$n(c)||!!Tn(c)||!!In(c)||!!Pn(c)||!!Ln(c)||!!En(c)||!!Fn(c)||Un.test(String.fromCodePoint(c)));(Xl[f]||e||i.imageName||u!==t.length()-2&&Jl[t.getCharCode(u+1)])&&o.push(tc(u+1,l,a,o,Ql(f,t.getCharCode(u+1),e&&h),!1))}}var c
1772
1772
  return ec(tc(t.length(),l,a,o,0,!0))}function sc(t){let e=.5,i=.5
1773
1773
  switch(t){case"right":case"top-right":case"bottom-right":e=1
1774
1774
  break
@@ -1873,7 +1873,7 @@ bn("SymbolBucket",vc,{omit:["layers","collisionBoxArray","features","compareText
1873
1873
  var xc={get paint(){return bc=bc||new ur({"icon-opacity":new ar(Z.paint_symbol["icon-opacity"]),"icon-color":new ar(Z.paint_symbol["icon-color"]),"icon-halo-color":new ar(Z.paint_symbol["icon-halo-color"]),"icon-halo-width":new ar(Z.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ar(Z.paint_symbol["icon-halo-blur"]),"icon-translate":new or(Z.paint_symbol["icon-translate"]),"icon-translate-anchor":new or(Z.paint_symbol["icon-translate-anchor"]),"text-opacity":new ar(Z.paint_symbol["text-opacity"]),"text-color":new ar(Z.paint_symbol["text-color"],{runtimeType:ft,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new ar(Z.paint_symbol["text-halo-color"]),"text-halo-width":new ar(Z.paint_symbol["text-halo-width"]),"text-halo-blur":new ar(Z.paint_symbol["text-halo-blur"]),"text-translate":new or(Z.paint_symbol["text-translate"]),"text-translate-anchor":new or(Z.paint_symbol["text-translate-anchor"])})},get layout(){return wc=wc||new ur({"symbol-placement":new or(Z.layout_symbol["symbol-placement"]),"symbol-spacing":new or(Z.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new or(Z.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ar(Z.layout_symbol["symbol-sort-key"]),"symbol-z-order":new or(Z.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new or(Z.layout_symbol["icon-allow-overlap"]),"icon-overlap":new or(Z.layout_symbol["icon-overlap"]),"icon-ignore-placement":new or(Z.layout_symbol["icon-ignore-placement"]),"icon-optional":new or(Z.layout_symbol["icon-optional"]),"icon-rotation-alignment":new or(Z.layout_symbol["icon-rotation-alignment"]),"icon-size":new ar(Z.layout_symbol["icon-size"]),"icon-text-fit":new or(Z.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new or(Z.layout_symbol["icon-text-fit-padding"]),"icon-image":new ar(Z.layout_symbol["icon-image"]),"icon-rotate":new ar(Z.layout_symbol["icon-rotate"]),"icon-padding":new ar(Z.layout_symbol["icon-padding"]),"icon-keep-upright":new or(Z.layout_symbol["icon-keep-upright"]),"icon-offset":new ar(Z.layout_symbol["icon-offset"]),"icon-anchor":new ar(Z.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new or(Z.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new or(Z.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new or(Z.layout_symbol["text-rotation-alignment"]),"text-field":new ar(Z.layout_symbol["text-field"]),"text-font":new ar(Z.layout_symbol["text-font"]),"text-size":new ar(Z.layout_symbol["text-size"]),"text-max-width":new ar(Z.layout_symbol["text-max-width"]),"text-line-height":new or(Z.layout_symbol["text-line-height"]),"text-letter-spacing":new ar(Z.layout_symbol["text-letter-spacing"]),"text-justify":new ar(Z.layout_symbol["text-justify"]),"text-radial-offset":new ar(Z.layout_symbol["text-radial-offset"]),"text-variable-anchor":new or(Z.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ar(Z.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ar(Z.layout_symbol["text-anchor"]),"text-max-angle":new or(Z.layout_symbol["text-max-angle"]),"text-writing-mode":new or(Z.layout_symbol["text-writing-mode"]),"text-rotate":new ar(Z.layout_symbol["text-rotate"]),"text-padding":new or(Z.layout_symbol["text-padding"]),"text-keep-upright":new or(Z.layout_symbol["text-keep-upright"]),"text-transform":new ar(Z.layout_symbol["text-transform"]),"text-offset":new ar(Z.layout_symbol["text-offset"]),"text-allow-overlap":new or(Z.layout_symbol["text-allow-overlap"]),"text-overlap":new or(Z.layout_symbol["text-overlap"]),"text-ignore-placement":new or(Z.layout_symbol["text-ignore-placement"]),"text-optional":new or(Z.layout_symbol["text-optional"])})}}
1874
1874
  class Mc{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class")
1875
1875
  this.type=t.property.overrides?t.property.overrides.runtimeType:ht,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides
1876
- 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.Ct.expression)}outputDefined(){return!1}serialize(){return null}}bn("FormatSectionOverride",Mc,{omit:["defaultValue"]})
1876
+ 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.Tt.expression)}outputDefined(){return!1}serialize(){return null}}bn("FormatSectionOverride",Mc,{omit:["defaultValue"]})
1877
1877
  class zc extends pr{constructor(t){super(t,xc)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout.Bt["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout.Bt["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout.Bt["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout.Bt["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode")
1878
1878
  if(t){const e=[]
1879
1879
  for(const i of t)e.indexOf(i)<0&&e.push(i)
@@ -1887,11 +1887,11 @@ let n=!1
1887
1887
  const r=t=>{for(const e of t)if(s.overrides&&s.overrides.hasOverride(e))return void(n=!0)}
1888
1888
  if("constant"===i.value.kind&&i.value.value instanceof Jt)r(i.value.value.sections)
1889
1889
  else if("source"===i.value.kind){const t=e=>{n||(e instanceof re&&se(e.value)===_t?r(e.value.sections):e instanceof Ge?r(e.sections):e.eachChild(t))},e=i.value
1890
- e.Ct&&t(e.Ct.expression)}return n}}let Sc
1890
+ e.Tt&&t(e.Tt.expression)}return n}}let Sc
1891
1891
  var kc={get paint(){return Sc=Sc||new ur({"background-color":new or(Z.paint_background["background-color"]),"background-pattern":new lr(Z.paint_background["background-pattern"]),"background-opacity":new or(Z.paint_background["background-opacity"])})}}
1892
1892
  class Ac extends pr{constructor(t){super(t,kc)}}let Ec
1893
1893
  var Ic={get paint(){return Ec=Ec||new ur({"raster-opacity":new or(Z.paint_raster["raster-opacity"]),"raster-hue-rotate":new or(Z.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new or(Z.paint_raster["raster-brightness-min"]),"raster-brightness-max":new or(Z.paint_raster["raster-brightness-max"]),"raster-saturation":new or(Z.paint_raster["raster-saturation"]),"raster-contrast":new or(Z.paint_raster["raster-contrast"]),"raster-resampling":new or(Z.paint_raster["raster-resampling"]),"raster-fade-duration":new or(Z.paint_raster["raster-fade-duration"])})}}
1894
- class Tc extends pr{constructor(t){super(t,Ic)}}class Cc extends pr{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!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Pc{constructor(t){this.we=t,this.xe=!1,"undefined"!=typeof MessageChannel&&(this.Me=new MessageChannel,this.Me.port2.onmessage=()=>{this.xe=!1,this.we()})}trigger(){this.xe||(this.xe=!0,this.Me?this.Me.port1.postMessage(!0):setTimeout(()=>{this.xe=!1,this.we()},0))}remove(){delete this.Me,this.we=()=>{}}}const $c=6371008.8
1894
+ class Cc extends pr{constructor(t){super(t,Ic)}}class Tc extends pr{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!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Pc{constructor(t){this.we=t,this.xe=!1,"undefined"!=typeof MessageChannel&&(this.Me=new MessageChannel,this.Me.port2.onmessage=()=>{this.xe=!1,this.we()})}trigger(){this.xe||(this.xe=!0,this.Me?this.Me.port1.postMessage(!0):setTimeout(()=>{this.xe=!1,this.we()},0))}remove(){delete this.Me,this.we=()=>{}}}const $c=6371008.8
1895
1895
  class Fc{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`)
1896
1896
  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(_(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,s=t.lat*e,n=Math.sin(i)*Math.sin(s)+Math.cos(i)*Math.cos(s)*Math.cos((t.lng-this.lng)*e)
1897
1897
  return $c*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof Fc)return t
@@ -1946,7 +1946,7 @@ for(let l=r;l<o;l++)for(let e=s;e<n;e++)this.data[this.ze(e,l)]=t.data[this.ze(e
1946
1946
  class Hc{constructor(t){this.Se={},this.ke=[]
1947
1947
  for(let e=0;e<t.length;e++){const i=t[e]
1948
1948
  this.Se[i]=e,this.ke[e]=i}}encode(t){return this.Se[t]}decode(t){if(t>=this.ke.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this.ke.length}`)
1949
- return this.ke[t]}}class Xc{constructor(t,e,i,s,n){this.type="Feature",this.Ae=t,t.Ee=e,t.Ie=i,t.Te=s,this.properties=t.properties,this.id=n}get geometry(){return void 0===this.pe&&(this.pe=this.Ae.toGeoJSON(this.Ae.Ie,this.Ae.Te,this.Ae.Ee).geometry),this.pe}set geometry(t){this.pe=t}toJSON(){const t={geometry:this.geometry}
1949
+ return this.ke[t]}}class Xc{constructor(t,e,i,s,n){this.type="Feature",this.Ae=t,t.Ee=e,t.Ie=i,t.Ce=s,this.properties=t.properties,this.id=n}get geometry(){return void 0===this.pe&&(this.pe=this.Ae.toGeoJSON(this.Ae.Ie,this.Ae.Ce,this.Ae.Ee).geometry),this.pe}set geometry(t){this.pe=t}toJSON(){const t={geometry:this.geometry}
1950
1950
  for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e])
1951
1951
  return t}}class Jc{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new vn(Zo,16,0),this.grid3D=new vn(Zo,16,0),this.featureIndexArray=new Qr,this.promoteId=e}insert(t,e,i,s,n,r){const o=this.featureIndexArray.length
1952
1952
  this.featureIndexArray.emplaceBack(i,s,n)
@@ -2019,25 +2019,25 @@ return e}function nu(t,e,i){return t?.6*e*i:0}function ru(t,e){return Math.max(t
2019
2019
  let h=0
2020
2020
  const l=su(t)/2
2021
2021
  for(let c=0;c<t.length-1;c++){const i=t[c],s=t[c+1],n=i.dist(s)
2022
- if(h+n>l){const r=(l-h)/n,u=Te.number(i.x,s.x,r),f=Te.number(i.y,s.y,r),p=new eu(u,f,s.angleTo(i),c)
2022
+ if(h+n>l){const r=(l-h)/n,u=Ce.number(i.x,s.x,r),f=Ce.number(i.y,s.y,r),p=new eu(u,f,s.angleTo(i),c)
2023
2023
  return p.ft(),!o||iu(t,p,a,o,e)?p:void 0}h+=n}}function au(t,e,i,s,n,r,o,a,h){const l=nu(s,r,o),c=ru(s,n),u=c*o,f=0===t[0].x||t[0].x===h||0===t[0].y||t[0].y===h
2024
2024
  return e-u<e/4&&(e=u+e/4),hu(t,f?e/2*a%e:(c/2+2*r)*o*a%e,e,l,i,u,f,!1,h)}function hu(t,e,i,s,n,r,o,a,h){const l=r/2,c=su(t)
2025
2025
  let u=0,f=e-i,p=[]
2026
2026
  for(let d=0;d<t.length-1;d++){const e=t[d],o=t[d+1],a=e.dist(o),m=o.angleTo(e)
2027
2027
  for(;f+i<u+a;){f+=i
2028
- const _=(f-u)/a,g=Te.number(e.x,o.x,_),y=Te.number(e.y,o.y,_)
2028
+ const _=(f-u)/a,g=Ce.number(e.x,o.x,_),y=Ce.number(e.y,o.y,_)
2029
2029
  if(g>=0&&g<h&&y>=0&&y<h&&f-l>=0&&f+l<=c){const e=new eu(g,y,m,d)
2030
2030
  e.ft(),s&&!iu(t,e,r,s,n)||p.push(e)}}u+=a}return a||p.length||o||(p=hu(t,u/2,i,s,n,r,o,!0,h)),p}function lu(t,e,i,s){const n=[],o=t.image,a=o.pixelRatio,h=o.paddedRect.w-2,l=o.paddedRect.h-2
2031
2031
  let c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom}
2032
2032
  const u=o.stretchX||[[0,h]],f=o.stretchY||[[0,l]],p=(t,e)=>t+e[1]-e[0],d=u.reduce(p,0),m=f.reduce(p,0),_=h-d,g=l-m
2033
2033
  let y=0,v=d,w=0,b=m,x=0,M=_,z=0,S=g
2034
- if(o.content&&s){const e=o.content,i=e[2]-e[0],s=e[3]-e[1];(o.textFitWidth||o.textFitHeight)&&(c=oc(t)),y=cu(u,0,e[0]),w=cu(f,0,e[1]),v=cu(u,e[0],e[2]),b=cu(f,e[1],e[3]),x=e[0]-y,z=e[1]-w,M=i-v,S=s-b}const k=c.x1,A=c.y1,E=c.x2-k,I=c.y2-A,T=(t,s,n,h)=>{const l=fu(t.stretch-y,v,E,k),c=pu(t.fixed-x,M,t.stretch,d),u=fu(s.stretch-w,b,I,A),f=pu(s.fixed-z,S,s.stretch,m),p=fu(n.stretch-y,v,E,k),_=pu(n.fixed-x,M,n.stretch,d),g=fu(h.stretch-w,b,I,A),T=pu(h.fixed-z,S,h.stretch,m),C=new r(l,u),P=new r(p,u),$=new r(p,g),F=new r(l,g),D=new r(c/a,f/a),O=new r(_/a,T/a),L=e*Math.PI/180
2034
+ if(o.content&&s){const e=o.content,i=e[2]-e[0],s=e[3]-e[1];(o.textFitWidth||o.textFitHeight)&&(c=oc(t)),y=cu(u,0,e[0]),w=cu(f,0,e[1]),v=cu(u,e[0],e[2]),b=cu(f,e[1],e[3]),x=e[0]-y,z=e[1]-w,M=i-v,S=s-b}const k=c.x1,A=c.y1,E=c.x2-k,I=c.y2-A,C=(t,s,n,h)=>{const l=fu(t.stretch-y,v,E,k),c=pu(t.fixed-x,M,t.stretch,d),u=fu(s.stretch-w,b,I,A),f=pu(s.fixed-z,S,s.stretch,m),p=fu(n.stretch-y,v,E,k),_=pu(n.fixed-x,M,n.stretch,d),g=fu(h.stretch-w,b,I,A),C=pu(h.fixed-z,S,h.stretch,m),T=new r(l,u),P=new r(p,u),$=new r(p,g),F=new r(l,g),D=new r(c/a,f/a),O=new r(_/a,C/a),L=e*Math.PI/180
2035
2035
  if(L){const t=Math.sin(L),e=Math.cos(L),i=[e,-t,t,e]
2036
- C.lt(i),P.lt(i),F.lt(i),$.lt(i)}const N=t.stretch+t.fixed,j=s.stretch+s.fixed
2037
- return{tl:C,tr:P,bl:F,br:$,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+j,w:n.stretch+n.fixed-N,h:h.stretch+h.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:M/a/E,minFontScaleY:S/a/I,isSDF:i}}
2036
+ T.lt(i),P.lt(i),F.lt(i),$.lt(i)}const N=t.stretch+t.fixed,j=s.stretch+s.fixed
2037
+ return{tl:T,tr:P,bl:F,br:$,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+j,w:n.stretch+n.fixed-N,h:h.stretch+h.fixed-j},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:O,minFontScaleX:M/a/E,minFontScaleY:S/a/I,isSDF:i}}
2038
2038
  if(s&&(o.stretchX||o.stretchY)){const t=uu(u,_,d),e=uu(f,g,m)
2039
2039
  for(let i=0;i<t.length-1;i++){const s=t[i],r=t[i+1]
2040
- for(let t=0;t<e.length-1;t++)n.push(T(s,e[t],r,e[t+1]))}}else n.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:h+1},{fixed:0,stretch:l+1}))
2040
+ for(let t=0;t<e.length-1;t++)n.push(C(s,e[t],r,e[t+1]))}}else n.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:h+1},{fixed:0,stretch:l+1}))
2041
2041
  return n}function cu(t,e,i){let s=0
2042
2042
  for(const n of t)s+=Math.max(e,Math.min(i,n[1]))-Math.max(e,Math.min(i,n[0]))
2043
2043
  return s}function uu(t,e,i){const s=[{fixed:-1,stretch:0}]
@@ -2112,14 +2112,14 @@ case"left":case"top-left":case"bottom-left":return"left"}return"center"}function
2112
2112
  void 0===f&&(f=a)
2113
2113
  const p=e.layers[0].layout,d=p.get("icon-offset").evaluate(i,{},u),m=ku(s.horizontal),_=a/24,g=e.tilePixelRatio*_,y=e.tilePixelRatio*f/24,v=e.tilePixelRatio*h,w=e.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*e.tilePixelRatio,x=function(t,e,i,s=1){const n=t.get("icon-padding").evaluate(e,{},i),r=n&&n.values
2114
2114
  return[r[0]*s,r[1]*s,r[2]*s,r[3]*s]}(p,i,u,e.tilePixelRatio),z=p.get("text-max-angle")/180*Math.PI,S="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),k="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),A=p.get("symbol-placement"),E=w/2,I=p.get("icon-text-fit")
2115
- let T
2116
- n&&"none"!==I&&(e.allowVerticalPlacement&&s.vertical&&(T=ac(n,s.vertical,I,p.get("icon-text-fit-padding"),d,_)),m&&(n=ac(n,m,I,p.get("icon-text-fit-padding"),d,_)))
2117
- const C=(h,f)=>{f.x<0||f.x>=Zo||f.y<0||f.y>=Zo||function(e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,z,S,k){const A=e.addToLineVertexArray(i,s)
2118
- let E,I,T,C,P=0,$=0,F=0,D=0,O=-1,L=-1
2115
+ let C
2116
+ n&&"none"!==I&&(e.allowVerticalPlacement&&s.vertical&&(C=ac(n,s.vertical,I,p.get("icon-text-fit-padding"),d,_)),m&&(n=ac(n,m,I,p.get("icon-text-fit-padding"),d,_)))
2117
+ const T=(h,f)=>{f.x<0||f.x>=Zo||f.y<0||f.y>=Zo||function(e,i,s,n,r,o,a,h,l,c,u,f,p,d,m,_,g,y,v,w,b,x,z,S,k){const A=e.addToLineVertexArray(i,s)
2118
+ let E,I,C,T,P=0,$=0,F=0,D=0,O=-1,L=-1
2119
2119
  const N={}
2120
2120
  let j=ko("")
2121
2121
  if(e.allowVerticalPlacement&&n.vertical){const t=h.layout.get("text-rotate").evaluate(b,{},S)+90
2122
- T=new du(l,i,c,u,f,n.vertical,p,d,m,t),a&&(C=new du(l,i,c,u,f,a,g,y,m,t))}if(r){const s=h.layout.get("icon-rotate").evaluate(b,{}),n="none"!==h.layout.get("icon-text-fit"),o=lu(r,s,z,n),p=a?lu(a,s,z,n):void 0
2122
+ C=new du(l,i,c,u,f,n.vertical,p,d,m,t),a&&(T=new du(l,i,c,u,f,a,g,y,m,t))}if(r){const s=h.layout.get("icon-rotate").evaluate(b,{}),n="none"!==h.layout.get("icon-text-fit"),o=lu(r,s,z,n),p=a?lu(a,s,z,n):void 0
2123
2123
  I=new du(l,i,c,u,f,r,g,y,!1,s),P=4*o.length
2124
2124
  const d=e.iconSizeData
2125
2125
  let m=null
@@ -2129,21 +2129,21 @@ if(!E){j=ko(s.text)
2129
2129
  const t=h.layout.get("text-rotate").evaluate(b,{},S)
2130
2130
  E=new du(l,i,c,u,f,s,p,d,m,t)}const r=1===s.positionedLines.length
2131
2131
  if(F+=Su(e,i,s,o,h,m,b,_,A,n.vertical?t.ah.horizontal:t.ah.horizontalOnly,r?R:[M],N,O,x,S),r)break}n.vertical&&(D+=Su(e,i,n.vertical,o,h,m,b,_,A,t.ah.vertical,["vertical"],N,L,x,S))
2132
- const q=E?E.boxStartIndex:e.collisionBoxArray.length,B=E?E.boxEndIndex:e.collisionBoxArray.length,U=T?T.boxStartIndex:e.collisionBoxArray.length,V=T?T.boxEndIndex:e.collisionBoxArray.length,G=I?I.boxStartIndex:e.collisionBoxArray.length,Z=I?I.boxEndIndex:e.collisionBoxArray.length,W=C?C.boxStartIndex:e.collisionBoxArray.length,H=C?C.boxEndIndex:e.collisionBoxArray.length
2132
+ const q=E?E.boxStartIndex:e.collisionBoxArray.length,B=E?E.boxEndIndex:e.collisionBoxArray.length,U=C?C.boxStartIndex:e.collisionBoxArray.length,V=C?C.boxEndIndex:e.collisionBoxArray.length,G=I?I.boxStartIndex:e.collisionBoxArray.length,Z=I?I.boxEndIndex:e.collisionBoxArray.length,W=T?T.boxStartIndex:e.collisionBoxArray.length,H=T?T.boxEndIndex:e.collisionBoxArray.length
2133
2133
  let X=-1
2134
2134
  const J=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e
2135
- X=J(E,X),X=J(T,X),X=J(I,X),X=J(C,X)
2135
+ X=J(E,X),X=J(C,X),X=J(I,X),X=J(T,X)
2136
2136
  const K=X>-1?1:0
2137
2137
  K&&(X*=k/pl),e.glyphOffsetArray.length>=vc.MAX_GLYPHS&&M("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)
2138
2138
  const Y=xu(h,b,S),[Q,tt]=function(e,i){const s=e.length,n=null==i?void 0:i.values
2139
2139
  if((null==n?void 0:n.length)>0)for(let r=0;r<n.length;r+=2){const i=n[r+1]
2140
2140
  e.emplaceBack(t.aq[n[r]],i[0],i[1])}return[s,e.length]}(e.textAnchorOffsets,Y)
2141
- e.symbolInstances.emplaceBack(i.x,i.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,O,L,j,q,B,U,V,G,Z,W,H,c,F,D,P,$,K,0,p,X,Q,tt)}(e,f,h,s,n,r,T,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,g,[b,b,b,b],S,l,v,x,k,d,i,o,c,u,a)}
2141
+ e.symbolInstances.emplaceBack(i.x,i.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical||-1,O,L,j,q,B,U,V,G,Z,W,H,c,F,D,P,$,K,0,p,X,Q,tt)}(e,f,h,s,n,r,C,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,g,[b,b,b,b],S,l,v,x,k,d,i,o,c,u,a)}
2142
2142
  if("line"===A)for(const t of tu(i.geometry,0,0,Zo,Zo)){const i=au(t,w,z,s.vertical||m,n,24,y,e.overscaling,Zo)
2143
- for(const s of i)m&&Au(e,m.text,E,s)||C(t,s)}else if("line-center"===A){for(const t of i.geometry)if(t.length>1){const e=ou(t,z,s.vertical||m,n,24,y)
2144
- e&&C(t,e)}}else if("Polygon"===i.type)for(const t of yi(i.geometry,0)){const e=_u(t,16)
2145
- C(t[0],new eu(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry)C(t,new eu(t[0].x,t[0].y,0))
2146
- else if("Point"===i.type)for(const t of i.geometry)for(const e of t)C([e],new eu(e.x,e.y,0))}function Su(t,e,i,s,n,o,a,h,l,c,u,f,p,d,m){const _=function(t,e,i,s,n,o,a,h){const l=s.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[]
2143
+ for(const s of i)m&&Au(e,m.text,E,s)||T(t,s)}else if("line-center"===A){for(const t of i.geometry)if(t.length>1){const e=ou(t,z,s.vertical||m,n,24,y)
2144
+ e&&T(t,e)}}else if("Polygon"===i.type)for(const t of yi(i.geometry,0)){const e=_u(t,16)
2145
+ T(t[0],new eu(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry)T(t,new eu(t[0].x,t[0].y,0))
2146
+ else if("Point"===i.type)for(const t of i.geometry)for(const e of t)T([e],new eu(e.x,e.y,0))}function Su(t,e,i,s,n,o,a,h,l,c,u,f,p,d,m){const _=function(t,e,i,s,n,o,a,h){const l=s.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[]
2147
2147
  for(const u of e.positionedLines)for(const t of u.positionedGlyphs){if(!t.rect)continue
2148
2148
  const s=t.rect||{}
2149
2149
  let o=4,f=!0,p=1,d=0
@@ -2155,8 +2155,8 @@ m&&(v=y,y=[0,0])
2155
2155
  const w=t.metrics.isDoubleResolution?2:1,b=(t.metrics.left-o)*t.scale-_+y[0],x=(-t.metrics.top-o)*t.scale+y[1],M=b+s.w/w*t.scale/p,z=x+s.h/w*t.scale/p,S=new r(b,x),k=new r(M,x),A=new r(b,z),E=new r(M,z)
2156
2156
  if(m){const e=new r(-_,_-Vl),i=-Math.PI/2,s=12-_,n=new r(22-s,-(t.imageName?s:0)),o=new r(...v)
2157
2157
  S.ht(i,e).tt(n).tt(o),k.ht(i,e).tt(n).tt(o),A.ht(i,e).tt(n).tt(o),E.ht(i,e).tt(n).tt(o)}if(l){const t=Math.sin(l),e=Math.cos(l),i=[e,-t,t,e]
2158
- S.lt(i),k.lt(i),A.lt(i),E.lt(i)}const I=new r(0,0),T=new r(0,0)
2159
- c.push({tl:S,tr:k,bl:A,br:E,tex:s,writingMode:e.writingMode,glyphOffset:g,sectionIndex:t.sectionIndex,isSDF:f,pixelOffsetTL:I,pixelOffsetBR:T,minFontScaleX:0,minFontScaleY:0})}return c}(0,i,h,n,o,a,s,t.allowVerticalPlacement),g=t.textSizeData
2158
+ S.lt(i),k.lt(i),A.lt(i),E.lt(i)}const I=new r(0,0),C=new r(0,0)
2159
+ c.push({tl:S,tr:k,bl:A,br:E,tex:s,writingMode:e.writingMode,glyphOffset:g,sectionIndex:t.sectionIndex,isSDF:f,pixelOffsetTL:I,pixelOffsetBR:C,minFontScaleX:0,minFontScaleY:0})}return c}(0,i,h,n,o,a,s,t.allowVerticalPlacement),g=t.textSizeData
2160
2160
  let y=null
2161
2161
  "source"===g.kind?(y=[hc*n.layout.get("text-size").evaluate(a,{})],y[0]>lc&&M(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===g.kind&&(y=[hc*d.compositeTextSizes[0].evaluate(a,{},m),hc*d.compositeTextSizes[1].evaluate(a,{},m)],(y[0]>lc||y[1]>lc)&&M(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,_,y,h,o,a,c,e,l.lineStartIndex,l.lineLength,p,m)
2162
2162
  for(const r of u)f[r]=t.text.placedSymbolArray.length-1
@@ -2177,10 +2177,10 @@ return new Iu(o,r,n,t)}constructor(t,e=64,i=Float64Array,s){if(isNaN(t)||t<0)thr
2177
2177
  this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array
2178
2178
  const n=Eu.indexOf(this.ArrayType),r=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-o%8)%8
2179
2179
  if(n<0)throw new Error(`Unexpected typed array class: ${i}.`)
2180
- s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+a,2*t),this.Ce=2*t,this.Pe=!0):(this.data=new ArrayBuffer(8+r+o+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+a,2*t),this.Ce=0,this.Pe=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this.Ce>>1
2181
- return this.ids[i]=i,this.coords[this.Ce++]=t,this.coords[this.Ce++]=e,i}finish(){const t=this.Ce>>1
2180
+ s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+a,2*t),this.Te=2*t,this.Pe=!0):(this.data=new ArrayBuffer(8+r+o+a),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+a,2*t),this.Te=0,this.Pe=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this.Te>>1
2181
+ return this.ids[i]=i,this.coords[this.Te++]=t,this.coords[this.Te++]=e,i}finish(){const t=this.Te>>1
2182
2182
  if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`)
2183
- return Tu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this.Pe=!0,this}range(t,e,i,s){if(!this.Pe)throw new Error("Data not yet indexed - call index.finish().")
2183
+ return Cu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this.Pe=!0,this}range(t,e,i,s){if(!this.Pe)throw new Error("Data not yet indexed - call index.finish().")
2184
2184
  const{ids:n,coords:r,nodeSize:o}=this,a=[0,n.length-1,0],h=[]
2185
2185
  for(;a.length;){const l=a.pop()||0,c=a.pop()||0,u=a.pop()||0
2186
2186
  if(c-u<=o){for(let o=u;o<=c;o++){const a=r[2*o],l=r[2*o+1]
@@ -2190,10 +2190,10 @@ const{ids:s,coords:n,nodeSize:r}=this,o=[0,s.length-1,0],a=[],h=i*i
2190
2190
  for(;o.length;){const l=o.pop()||0,c=o.pop()||0,u=o.pop()||0
2191
2191
  if(c-u<=r){for(let i=u;i<=c;i++)Fu(n[2*i],n[2*i+1],t,e)<=h&&a.push(s[i])
2192
2192
  continue}const f=u+c>>1,p=n[2*f],d=n[2*f+1]
2193
- Fu(p,d,t,e)<=h&&a.push(s[f]),(0===l?t-i<=p:e-i<=d)&&(o.push(u),o.push(f-1),o.push(1-l)),(0===l?t+i>=p:e+i>=d)&&(o.push(f+1),o.push(c),o.push(1-l))}return a}}function Tu(t,e,i,s,n,r){if(n-s<=i)return
2193
+ Fu(p,d,t,e)<=h&&a.push(s[f]),(0===l?t-i<=p:e-i<=d)&&(o.push(u),o.push(f-1),o.push(1-l)),(0===l?t+i>=p:e+i>=d)&&(o.push(f+1),o.push(c),o.push(1-l))}return a}}function Cu(t,e,i,s,n,r){if(n-s<=i)return
2194
2194
  const o=s+n>>1
2195
- Cu(t,e,o,s,n,r),Tu(t,e,i,s,o-1,1-r),Tu(t,e,i,o+1,n,1-r)}function Cu(t,e,i,s,n,r){for(;n>s;){if(n-s>600){const o=n-s+1,a=i-s+1,h=Math.log(o),l=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*l*(o-l)/o)*(a-o/2<0?-1:1)
2196
- Cu(t,e,i,Math.max(s,Math.floor(i-a*l/o+c)),Math.min(n,Math.floor(i+(o-a)*l/o+c)),r)}const o=e[2*i+r]
2195
+ Tu(t,e,o,s,n,r),Cu(t,e,i,s,o-1,1-r),Cu(t,e,i,o+1,n,1-r)}function Tu(t,e,i,s,n,r){for(;n>s;){if(n-s>600){const o=n-s+1,a=i-s+1,h=Math.log(o),l=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*l*(o-l)/o)*(a-o/2<0?-1:1)
2196
+ Tu(t,e,i,Math.max(s,Math.floor(i-a*l/o+c)),Math.min(n,Math.floor(i+(o-a)*l/o+c)),r)}const o=e[2*i+r]
2197
2197
  let a=s,h=n
2198
2198
  for(Pu(t,e,s,i),e[2*n+r]>o&&Pu(t,e,s,n);a<h;){for(Pu(t,e,a,h),a++,h--;e[2*a+r]<o;)a++
2199
2199
  for(;e[2*h+r]>o;)h--}e[2*s+r]===o?Pu(t,e,s,h):(h++,Pu(t,e,h,n)),h<=i&&(s=h+1),i<=h&&(n=h-1)}}function Pu(t,e,i,s){$u(t,i,s),$u(e,2*i,2*s),$u(e,2*i+1,2*s+1)}function $u(t,e,i){const s=t[e]
@@ -2233,11 +2233,11 @@ return ga!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=
2233
2233
  return e===t?(t[12]=e[0]*m+e[4]*_+e[8]*g+e[12],t[13]=e[1]*m+e[5]*_+e[9]*g+e[13],t[14]=e[2]*m+e[6]*_+e[10]*g+e[14],t[15]=e[3]*m+e[7]*_+e[11]*g+e[15]):(n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],f=e[9],p=e[10],d=e[11],t[0]=s=e[0],t[1]=n,t[2]=r,t[3]=o,t[4]=a,t[5]=h,t[6]=l,t[7]=c,t[8]=u,t[9]=f,t[10]=p,t[11]=d,t[12]=s*m+a*_+u*g+e[12],t[13]=n*m+h*_+f*g+e[13],t[14]=r*m+l*_+p*g+e[14],t[15]=o*m+c*_+d*g+e[15]),t},t.K=function(t,e,i){var s=i[0],n=i[1],r=i[2]
2234
2234
  return t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=va,t.M=function(t,e){const i={}
2235
2235
  for(let s=0;s<e.length;s++){const n=e[s]
2236
- n in t&&(i[n]=t[n])}return i},t.N=Fc,t.O=Lc,t.P=r,t.Q=Nc,t.R=Pa,t.S=Gc,t.T=tr,t.U=u,t.V=f,t.W=I,t.X=Zo,t.Y=gr,t.Z=qc,t._e=e,t.a=F,t.a$=function(t,e){var i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],h=t[6],l=t[7],c=t[8],u=t[9],f=t[10],p=t[11],d=t[12],m=t[13],_=t[14],g=t[15],y=e[0],v=e[1],w=e[2],b=e[3],x=e[4],M=e[5],z=e[6],S=e[7],k=e[8],A=e[9],E=e[10],I=e[11],T=e[12],C=e[13],P=e[14],$=e[15]
2237
- return Math.abs(i-y)<=_a*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(s-v)<=_a*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(n-w)<=_a*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(r-b)<=_a*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(o-x)<=_a*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-M)<=_a*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(h-z)<=_a*Math.max(1,Math.abs(h),Math.abs(z))&&Math.abs(l-S)<=_a*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-k)<=_a*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-A)<=_a*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(f-E)<=_a*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(p-I)<=_a*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-T)<=_a*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(m-C)<=_a*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(_-P)<=_a*Math.max(1,Math.abs(_),Math.abs(P))&&Math.abs(g-$)<=_a*Math.max(1,Math.abs(g),Math.abs($))},t.a0=go,t.a1=Uc,t.a2=nt,t.a3=t=>{const e=window.document.createElement("video")
2236
+ n in t&&(i[n]=t[n])}return i},t.N=Fc,t.O=Lc,t.P=r,t.Q=Nc,t.R=Pa,t.S=Gc,t.T=tr,t.U=u,t.V=f,t.W=I,t.X=Zo,t.Y=gr,t.Z=qc,t._e=e,t.a=F,t.a$=function(t,e){var i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],h=t[6],l=t[7],c=t[8],u=t[9],f=t[10],p=t[11],d=t[12],m=t[13],_=t[14],g=t[15],y=e[0],v=e[1],w=e[2],b=e[3],x=e[4],M=e[5],z=e[6],S=e[7],k=e[8],A=e[9],E=e[10],I=e[11],C=e[12],T=e[13],P=e[14],$=e[15]
2237
+ return Math.abs(i-y)<=_a*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(s-v)<=_a*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(n-w)<=_a*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(r-b)<=_a*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(o-x)<=_a*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-M)<=_a*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(h-z)<=_a*Math.max(1,Math.abs(h),Math.abs(z))&&Math.abs(l-S)<=_a*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-k)<=_a*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-A)<=_a*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(f-E)<=_a*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(p-I)<=_a*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-C)<=_a*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(m-T)<=_a*Math.max(1,Math.abs(m),Math.abs(T))&&Math.abs(_-P)<=_a*Math.max(1,Math.abs(_),Math.abs(P))&&Math.abs(g-$)<=_a*Math.max(1,Math.abs(g),Math.abs($))},t.a0=go,t.a1=Uc,t.a2=nt,t.a3=t=>{const e=window.document.createElement("video")
2238
2238
  return e.muted=!0,new Promise(i=>{e.onloadstart=()=>{i(e)}
2239
2239
  for(const s of t){const t=window.document.createElement("source")
2240
- R(s)||(e.crossOrigin="Anonymous"),t.src=s,e.appendChild(t)}})},t.a4=function(){return y++},t.a5=Ur,t.a6=vc,t.a7=As,t.a8=Jo,t.a9=Xc,t.aA=function(t){if("custom"===t.type)return new Cc(t)
2240
+ R(s)||(e.crossOrigin="Anonymous"),t.src=s,e.appendChild(t)}})},t.a4=function(){return y++},t.a5=Ur,t.a6=vc,t.a7=As,t.a8=Jo,t.a9=Xc,t.aA=function(t){if("custom"===t.type)return new Tc(t)
2241
2241
  switch(t.type){case"background":return new Ac(t)
2242
2242
  case"circle":return new Ma(t)
2243
2243
  case"fill":return new yh(t)
@@ -2245,7 +2245,7 @@ case"fill-extrusion":return new Bh(t)
2245
2245
  case"heatmap":return new Da(t)
2246
2246
  case"hillshade":return new Na(t)
2247
2247
  case"line":return new nl(t)
2248
- case"raster":return new Tc(t)
2248
+ case"raster":return new Cc(t)
2249
2249
  case"symbol":return new zc(t)}},t.aB=b,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}]
2250
2250
  let i=[]
2251
2251
  try{if(!X(t.version,e.version))return[{command:"setStyle",args:[e]}]
@@ -2267,10 +2267,10 @@ for(let s=0;s<e.length;s++)if(!t(e[s],i[s]))return!1
2267
2267
  return!0}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return!1
2268
2268
  if(Object.keys(e).length!==Object.keys(i).length)return!1
2269
2269
  for(const s in e)if(!t(e[s],i[s]))return!1
2270
- return!0}return e===i},t.aF=v,t.aG=w,t.aH=class extends Co{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.aI=Po,t.aJ=class extends Co{constructor(t,e){super(t,e),this.current=Do}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t)
2270
+ return!0}return e===i},t.aF=v,t.aG=w,t.aH=class extends To{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.aI=Po,t.aJ=class extends To{constructor(t,e){super(t,e),this.current=Do}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t)
2271
2271
  for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t)
2272
- break}}},t.aK=$o,t.aL=Fo,t.aM=Wt,t.aN=class extends Co{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.aO=class extends Co{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.aP=function(t,e,i,s,n,r,o){var a=1/(e-i),h=1/(s-n),l=1/(r-o)
2273
- return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*a,t[13]=(n+s)*h,t[14]=(o+r)*l,t[15]=1,t},t.aQ=ba,t.aR=class extends Cr{},t.aS=cl,t.aT=class extends $r{},t.aU=Fa,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=$a,t.aX=to,t.aY=fo,t.aZ=class extends Rr{},t.a_=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.aa=function(t){const e={}
2272
+ break}}},t.aK=$o,t.aL=Fo,t.aM=Wt,t.aN=class extends To{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.aO=class extends To{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.aP=function(t,e,i,s,n,r,o){var a=1/(e-i),h=1/(s-n),l=1/(r-o)
2273
+ return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*a,t[13]=(n+s)*h,t[14]=(o+r)*l,t[15]=1,t},t.aQ=ba,t.aR=class extends Tr{},t.aS=cl,t.aT=class extends $r{},t.aU=Fa,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=$a,t.aX=to,t.aY=fo,t.aZ=class extends Rr{},t.a_=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.aa=function(t){const e={}
2274
2274
  if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(t,i,s,n)=>{const r=s||n
2275
2275
  return e[i]=!r||r.toLowerCase(),""}),e["max-age"]){const t=parseInt(e["max-age"],10)
2276
2276
  isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){const i=[]
@@ -2279,14 +2279,14 @@ return i},t.ac=m,t.ad=function(t,e,i){var s=Math.sin(i),n=Math.cos(i),r=e[0],o=e
2279
2279
  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]=r*n+l*s,t[1]=o*n+c*s,t[2]=a*n+u*s,t[3]=h*n+f*s,t[4]=l*n-r*s,t[5]=c*n-o*s,t[6]=u*n-a*s,t[7]=f*n-h*s,t},t.ae=function(t){var e=new ga(16)
2280
2280
  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.af=xa,t.ag=function(t,e){let i=0,s=0
2281
2281
  if("constant"===t.kind)s=t.layoutSize
2282
- else if("source"!==t.kind){const{interpolationType:n,minZoom:r,maxZoom:o}=t,a=n?m(Ce.interpolationFactor(n,e,r,o),0,1):0
2283
- "camera"===t.kind?s=Te.number(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:s}},t.ai=function(t,{uSize:e,uSizeT:i},{lowerSize:s,upperSize:n}){return"source"===t.kind?s/hc:"composite"===t.kind?Te.number(s/hc,n/hc,i):e},t.aj=mc,t.ak=function(t,e,i,s){const n=e.y-t.y,o=e.x-t.x,a=s.y-i.y,h=s.x-i.x,l=a*o-h*n
2282
+ else if("source"!==t.kind){const{interpolationType:n,minZoom:r,maxZoom:o}=t,a=n?m(Te.interpolationFactor(n,e,r,o),0,1):0
2283
+ "camera"===t.kind?s=Ce.number(t.minSize,t.maxSize,a):i=a}return{uSizeT:i,uSize:s}},t.ai=function(t,{uSize:e,uSizeT:i},{lowerSize:s,upperSize:n}){return"source"===t.kind?s/hc:"composite"===t.kind?Ce.number(s/hc,n/hc,i):e},t.aj=mc,t.ak=function(t,e,i,s){const n=e.y-t.y,o=e.x-t.x,a=s.y-i.y,h=s.x-i.x,l=a*o-h*n
2284
2284
  if(0===l)return null
2285
2285
  const c=(h*(t.y-i.y)-a*(t.x-i.x))/l
2286
2286
  return new r(t.x+c*o,t.y+c*n)},t.al=tu,t.am=Qo,t.an=ya,t.ao=function(t){let e=1/0,i=1/0,s=-1/0,n=-1/0
2287
2287
  for(const r of t)e=Math.min(e,r.x),i=Math.min(i,r.y),s=Math.max(s,r.x),n=Math.max(n,r.y)
2288
- return[e,i,s,n]},t.ap=pl,t.ar=uc,t.as=function(t,e){var i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],c=e[8],u=e[9],f=e[10],p=e[11],d=e[12],m=e[13],_=e[14],g=e[15],y=i*a-s*o,v=i*h-n*o,w=i*l-r*o,b=s*h-n*a,x=s*l-r*a,M=n*l-r*h,z=c*m-u*d,S=c*_-f*d,k=c*g-p*d,A=u*_-f*m,E=u*g-p*m,I=f*g-p*_,T=y*I-v*E+w*A+b*k-x*S+M*z
2289
- return T?(t[0]=(a*I-h*E+l*A)*(T=1/T),t[1]=(n*E-s*I-r*A)*T,t[2]=(m*M-_*x+g*b)*T,t[3]=(f*x-u*M-p*b)*T,t[4]=(h*k-o*I-l*S)*T,t[5]=(i*I-n*k+r*S)*T,t[6]=(_*w-d*M-g*v)*T,t[7]=(c*M-f*w+p*v)*T,t[8]=(o*E-a*k+l*z)*T,t[9]=(s*k-i*E-r*z)*T,t[10]=(d*x-m*w+g*y)*T,t[11]=(u*w-c*x-p*y)*T,t[12]=(a*S-o*A-h*z)*T,t[13]=(i*A-s*S+n*z)*T,t[14]=(m*v-d*b-_*y)*T,t[15]=(c*b-u*v+f*y)*T,t):null},t.at=Mu,t.au=sc,t.av=Iu,t.aw=function(){const t={},e=Z.$version
2288
+ return[e,i,s,n]},t.ap=pl,t.ar=uc,t.as=function(t,e){var i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],c=e[8],u=e[9],f=e[10],p=e[11],d=e[12],m=e[13],_=e[14],g=e[15],y=i*a-s*o,v=i*h-n*o,w=i*l-r*o,b=s*h-n*a,x=s*l-r*a,M=n*l-r*h,z=c*m-u*d,S=c*_-f*d,k=c*g-p*d,A=u*_-f*m,E=u*g-p*m,I=f*g-p*_,C=y*I-v*E+w*A+b*k-x*S+M*z
2289
+ return C?(t[0]=(a*I-h*E+l*A)*(C=1/C),t[1]=(n*E-s*I-r*A)*C,t[2]=(m*M-_*x+g*b)*C,t[3]=(f*x-u*M-p*b)*C,t[4]=(h*k-o*I-l*S)*C,t[5]=(i*I-n*k+r*S)*C,t[6]=(_*w-d*M-g*v)*C,t[7]=(c*M-f*w+p*v)*C,t[8]=(o*E-a*k+l*z)*C,t[9]=(s*k-i*E-r*z)*C,t[10]=(d*x-m*w+g*y)*C,t[11]=(u*w-c*x-p*y)*C,t[12]=(a*S-o*A-h*z)*C,t[13]=(i*A-s*S+n*z)*C,t[14]=(m*v-d*b-_*y)*C,t[15]=(c*b-u*v+f*y)*C,t):null},t.at=Mu,t.au=sc,t.av=Iu,t.aw=function(){const t={},e=Z.$version
2290
2290
  for(const i in Z.$root){const s=Z.$root[i]
2291
2291
  if(s.required){let n=null
2292
2292
  n="version"===i?e:"array"===s.type?[]:{},null!=n&&(t[i]=n)}}return t},t.ax=An,t.ay=N,t.az=function(t){t=t.slice()
@@ -2327,14 +2327,14 @@ t&&(_=rc(e.imagePositions[c.icon.name],s.get("icon-offset").evaluate(c,{},e.cano
2327
2327
  e.bucket.iconsInText=!!v&&v.iconsInText,(v||_)&&zu(e.bucket,c,d,_,e.imageMap,r,f,p,g,y,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.bq=Yh,t.br=dh,t.bs=Lh,t.bt=xh,t.bu=Ll,t.bv=class{constructor(t){this.$e={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this.$e.start)}finish(){performance.mark(this.$e.end)
2328
2328
  let t=performance.getEntriesByName(this.$e.measure)
2329
2329
  return 0===t.length&&(performance.measure(this.$e.measure,this.$e.start,this.$e.end),t=performance.getEntriesByName(this.$e.measure),performance.clearMarks(this.$e.start),performance.clearMarks(this.$e.end),performance.clearMeasures(this.$e.measure)),t}},t.bw=function(t,i,s,n,r){return e(this,void 0,void 0,function*(){if(f())try{return yield I(t,i,s,n,r)}catch(e){}return function(t,e,i,s,n){const r=t.width,o=t.height
2330
- T&&C||(T=new OffscreenCanvas(r,o),C=T.getContext("2d",{willReadFrequently:!0})),T.width=r,T.height=o,C.drawImage(t,0,0,r,o)
2331
- const a=C.getImageData(e,i,s,n)
2332
- return C.clearRect(0,0,r,o),a.data}(t,i,s,n,r)})},t.bx=Wc,t.by=i,t.bz=s,t.c=$,t.d=t=>e(void 0,void 0,void 0,function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1))
2330
+ C&&T||(C=new OffscreenCanvas(r,o),T=C.getContext("2d",{willReadFrequently:!0})),C.width=r,C.height=o,T.drawImage(t,0,0,r,o)
2331
+ const a=T.getImageData(e,i,s,n)
2332
+ return T.clearRect(0,0,r,o),a.data}(t,i,s,n,r)})},t.bx=Wc,t.by=i,t.bz=s,t.c=$,t.d=t=>e(void 0,void 0,void 0,function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1))
2333
2333
  const e=new Blob([new Uint8Array(t)],{type:"image/png"})
2334
2334
  try{return createImageBitmap(e)}catch(i){throw new Error(`Could not load image because of ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=g,t.f=t=>new Promise((e,i)=>{const s=new Image
2335
2335
  s.onload=()=>{e(s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=E})},s.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."))
2336
2336
  const n=new Blob([new Uint8Array(t)],{type:"image/png"})
2337
- s.src=t.byteLength?URL.createObjectURL(n):E}),t.g=D,t.h=(t,e)=>j(g(t,{type:"json"}),e),t.i=S,t.j=V,t.k=U,t.l=(t,e)=>j(g(t,{type:"arrayBuffer"}),e),t.m=j,t.n=function(t){return new Ll(t).readFields(Nl,[])},t.o=Ca,t.p=ql,t.q=ur,t.r=dn,t.s=R,t.t=yn,t.u=pn,t.v=Z,t.w=M,t.x=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.y=Te,t.z=Kn}),i("worker",0,function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this.Fe={},this.De={},this.update(t,[])}update(e,i){for(const n of e){this.Fe[n.id]=n
2337
+ s.src=t.byteLength?URL.createObjectURL(n):E}),t.g=D,t.h=(t,e)=>j(g(t,{type:"json"}),e),t.i=S,t.j=V,t.k=U,t.l=(t,e)=>j(g(t,{type:"arrayBuffer"}),e),t.m=j,t.n=function(t){return new Ll(t).readFields(Nl,[])},t.o=Ta,t.p=ql,t.q=ur,t.r=dn,t.s=R,t.t=yn,t.u=pn,t.v=Z,t.w=M,t.x=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.y=Ce,t.z=Kn}),i("worker",0,function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this.Fe={},this.De={},this.update(t,[])}update(e,i){for(const n of e){this.Fe[n.id]=n
2338
2338
  const e=this.De[n.id]=t.aA(n)
2339
2339
  e.Vt=t.a7(e.filter),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(const t of i)delete this.keyCache[t],delete this.Fe[t],delete this.De[t]
2340
2340
  this.familiesBySource={}
@@ -2450,9 +2450,9 @@ var i={}
2450
2450
  for(var s in t)i[s]=new y(t[s].features,e),i[s].name=s,i[s].version=e.version,i[s].extent=e.extent
2451
2451
  return v({layers:i})},u.exports.GeoJSONWrapper=y
2452
2452
  var A=t.by(u.exports)
2453
- const E={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},I=Math.fround||(T=new Float32Array(1),t=>(T[0]=+t,T[0]))
2454
- var T
2455
- class C{constructor(t){this.options=Object.assign(Object.create(E),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:s}=this.options
2453
+ const E={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},I=Math.fround||(C=new Float32Array(1),t=>(C[0]=+t,C[0]))
2454
+ var C
2455
+ class T{constructor(t){this.options=Object.assign(Object.create(E),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:s}=this.options
2456
2456
  t.length,this.points=t
2457
2457
  const n=[]
2458
2458
  for(let o=0;o<t.length;o++){const e=t[o]
@@ -2658,7 +2658,7 @@ return 0===r.byteOffset&&r.byteLength===r.buffer.byteLength||(r=new Uint8Array(r
2658
2658
  null===(i=this.He)||void 0===i||i.abort()
2659
2659
  const s=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request)
2660
2660
  this.He=new AbortController
2661
- try{this.Xe=this.loadAndProcessGeoJSON(e,this.He),this.Ge=e.cluster?new C(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e
2661
+ try{this.Xe=this.loadAndProcessGeoJSON(e,this.He),this.Ge=e.cluster?new T(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e
2662
2662
  const s={},n={},r={accumulated:null,zoom:0},o={properties:null},a=Object.keys(i)
2663
2663
  for(const h of a){const[e,r]=i[h],o=t.bC(r),a=t.bC("string"==typeof e?[e,["accumulated"],["get",h]]:e)
2664
2664
  s[h]=o.value,n[h]=a.value}return e.map=t=>{o.properties=t
@@ -2842,9 +2842,9 @@ g[i]=t>0?t*t:0,_[i]=t<0?t*t:0}}S(g,0,0,l,c,l,this.f,this.v,this.z),S(_,m,m,a,h,l
2842
2842
  for(let v=0;v<u;v++){const t=Math.sqrt(g[v])-Math.sqrt(_[v])
2843
2843
  f[v]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}}
2844
2844
  class E{constructor(){this.specification=e.v.light.position}possiblyEvaluate(t,i){return e.x(t.expression.evaluate(i))}interpolate(t,i,s){return{x:e.y.number(t.x,i.x,s),y:e.y.number(t.y,i.y,s),z:e.y.number(t.z,i.z,s)}}}let I
2845
- class T extends e.E{constructor(t){super(),I=I||new e.q({anchor:new e.D(e.v.light.anchor),position:new E,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this.fi=new e.T(I),this.setLight(t),this.di=this.fi.untransitioned()}getLight(){return this.fi.serialize()}setLight(t,i={}){if(!this.Xt(e.r,t,i))for(const e in t){const i=t[e]
2846
- e.endsWith("-transition")?this.fi.setTransition(e.slice(0,-11),i):this.fi.setValue(e,i)}}updateTransitions(t){this.di=this.fi.transitioned(t,this.di)}hasTransition(){return this.di.hasTransition()}recalculate(t){this.properties=this.di.possiblyEvaluate(t)}Xt(t,i,s){return(!s||!1!==s.validate)&&e.t(this,t.call(e.u,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}const C=new e.q({"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"])})
2847
- class P extends e.E{constructor(t){super(),this.fi=new e.T(C),this.setSky(t),this.di=this.fi.untransitioned(),this.recalculate(new e.z(0))}setSky(t,i={}){if(!this.Xt(e.B,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0})
2845
+ class C extends e.E{constructor(t){super(),I=I||new e.q({anchor:new e.D(e.v.light.anchor),position:new E,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this.fi=new e.T(I),this.setLight(t),this.di=this.fi.untransitioned()}getLight(){return this.fi.serialize()}setLight(t,i={}){if(!this.Xt(e.r,t,i))for(const e in t){const i=t[e]
2846
+ e.endsWith("-transition")?this.fi.setTransition(e.slice(0,-11),i):this.fi.setValue(e,i)}}updateTransitions(t){this.di=this.fi.transitioned(t,this.di)}hasTransition(){return this.di.hasTransition()}recalculate(t){this.properties=this.di.possiblyEvaluate(t)}Xt(t,i,s){return(!s||!1!==s.validate)&&e.t(this,t.call(e.u,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}const T=new e.q({"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"])})
2847
+ class P extends e.E{constructor(t){super(),this.fi=new e.T(T),this.setSky(t),this.di=this.fi.untransitioned(),this.recalculate(new e.z(0))}setSky(t,i={}){if(!this.Xt(e.B,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0})
2848
2848
  for(const e in t){const i=t[e]
2849
2849
  e.endsWith("-transition")?this.fi.setTransition(e.slice(0,-11),i):this.fi.setValue(e,i)}}}getSky(){return this.fi.serialize()}updateTransitions(t){this.di=this.fi.transitioned(t,this.di)}hasTransition(){return this.di.hasTransition()}recalculate(t){this.properties=this.di.possiblyEvaluate(t)}Xt(t,i,s={}){return!1!==(null==s?void 0:s.validate)&&e.t(this,t.call(e.u,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class ${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)
2850
2850
  return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const s=[]
@@ -2946,11 +2946,11 @@ const e=yield t.actor.sendAsync({type:"LDT",data:r})
2946
2946
  t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(n){if(delete t.abortController,t.aborted)t.state="unloaded"
2947
2947
  else if(n)throw t.state="errored",n}})}readImageNow(t){return e._e(this,void 0,void 0,function*(){if("undefined"!=typeof VideoFrame&&e.V()){const s=t.width+2,n=t.height+2
2948
2948
  try{return new e.R({width:s,height:n},yield e.W(t,-1,-1,s,n))}catch(i){}}return r.getImageData(t,1)})}Ai(t){const i=t.canonical,s=Math.pow(2,i.z),n=(i.x-1+s)%s,r=0===i.x?t.wrap-1:t.wrap,o=(i.x+1+s)%s,a=i.x+1===s?t.wrap+1:t.wrap,h={}
2949
- return h[new e.S(t.overscaledZ,r,i.z,n,i.y).key]={backfilled:!1},h[new e.S(t.overscaledZ,a,i.z,o,i.y).key]={backfilled:!1},i.y>0&&(h[new e.S(t.overscaledZ,r,i.z,n,i.y-1).key]={backfilled:!1},h[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},h[new e.S(t.overscaledZ,a,i.z,o,i.y-1).key]={backfilled:!1}),i.y+1<s&&(h[new e.S(t.overscaledZ,r,i.z,n,i.y+1).key]={backfilled:!1},h[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},h[new e.S(t.overscaledZ,a,i.z,o,i.y+1).key]={backfilled:!1}),h}unloadTile(t){return e._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 K extends e.E{constructor(t,i,s,n){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this.Ei=!1,this.Ii=0,this.actor=s.getActor(),this.setEventedParent(n),this.Ti=i.data,this.wi=e.e({},i),this.xi=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
2949
+ return h[new e.S(t.overscaledZ,r,i.z,n,i.y).key]={backfilled:!1},h[new e.S(t.overscaledZ,a,i.z,o,i.y).key]={backfilled:!1},i.y>0&&(h[new e.S(t.overscaledZ,r,i.z,n,i.y-1).key]={backfilled:!1},h[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},h[new e.S(t.overscaledZ,a,i.z,o,i.y-1).key]={backfilled:!1}),i.y+1<s&&(h[new e.S(t.overscaledZ,r,i.z,n,i.y+1).key]={backfilled:!1},h[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},h[new e.S(t.overscaledZ,a,i.z,o,i.y+1).key]={backfilled:!1}),h}unloadTile(t){return e._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 K extends e.E{constructor(t,i,s,n){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this.Ei=!1,this.Ii=0,this.actor=s.getActor(),this.setEventedParent(n),this.Ci=i.data,this.wi=e.e({},i),this.xi=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
2950
2950
  const r=e.X/this.tileSize
2951
- 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||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*r,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*r,extent:e.X,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.X,radius:(i.clusterRadius||50)*r,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._e(this,void 0,void 0,function*(){yield this.Ci()})}onAdd(t){this.map=t,this.load()}setData(t){return this.Ti=t,this.Ci(),this}updateData(t){return this.Ci(t),this}getData(){return e._e(this,void 0,void 0,function*(){const t=e.e({type:this.type},this.workerOptions)
2952
- return this.actor.sendAsync({type:"GD",data:t})})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this.Ci(),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}})}Ci(t){return e._e(this,void 0,void 0,function*(){const i=e.e({type:this.type},this.workerOptions)
2953
- t?i.dataDiff=t:"string"==typeof this.Ti?(i.request=this.map.zi.transformRequest(r.resolveURL(this.Ti),"Source"),i.request.collectResourceTiming=this.xi):i.data=JSON.stringify(this.Ti),this.Ii++,this.fire(new e.k("dataloading",{dataType:"source"}))
2951
+ 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||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*r,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*r,extent:e.X,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.X,radius:(i.clusterRadius||50)*r,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._e(this,void 0,void 0,function*(){yield this.Ti()})}onAdd(t){this.map=t,this.load()}setData(t){return this.Ci=t,this.Ti(),this}updateData(t){return this.Ti(t),this}getData(){return e._e(this,void 0,void 0,function*(){const t=e.e({type:this.type},this.workerOptions)
2952
+ return this.actor.sendAsync({type:"GD",data:t})})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this.Ti(),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}})}Ti(t){return e._e(this,void 0,void 0,function*(){const i=e.e({type:this.type},this.workerOptions)
2953
+ t?i.dataDiff=t:"string"==typeof this.Ci?(i.request=this.map.zi.transformRequest(r.resolveURL(this.Ci),"Source"),i.request.collectResourceTiming=this.xi):i.data=JSON.stringify(this.Ci),this.Ii++,this.fire(new e.k("dataloading",{dataType:"source"}))
2954
2954
  try{const t=yield this.actor.sendAsync({type:"LD",data:i})
2955
2955
  if(this.Ii--,this.Ei||t.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}))
2956
2956
  let s=null
@@ -2962,7 +2962,7 @@ t.actor=this.actor
2962
2962
  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}
2963
2963
  t.abortController=new AbortController
2964
2964
  const s=yield this.actor.sendAsync({type:e,data:i},t.abortController)
2965
- delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(s,this.map.painter,"RT"===e)})}abortTile(t){return e._e(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return e._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.Ei=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this.wi,{type:this.type,data:this.Ti})}hasTransition(){return!1}}var Y=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])
2965
+ delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(s,this.map.painter,"RT"===e)})}abortTile(t){return e._e(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return e._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.Ei=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this.wi,{type:this.type,data:this.Ci})}hasTransition(){return!1}}var Y=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])
2966
2966
  class Q extends e.E{constructor(t,e,i,s){super(),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.yi=!1,this.setEventedParent(s),this.options=e}load(t){return e._e(this,void 0,void 0,function*(){this.yi=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this.Pi=new AbortController
2967
2967
  try{const e=yield p.getImage(this.map.zi.transformRequest(this.url,"Image"),this.Pi)
2968
2968
  this.Pi=null,this.yi=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this.$i())}catch(i){this.Pi=null,this.yi=!0,this.fire(new e.j(i))}})}loaded(){return this.yi}updateImage(t){return t.url?(this.Pi&&(this.Pi.abort(),this.Pi=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}$i(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this.Pi&&(this.Pi.abort(),this.Pi=null)}setCoordinates(t){this.coordinates=t
@@ -3220,7 +3220,7 @@ a.push({key:this.circleKeys[t],x1:e-s,y1:i-s,x2:e+s,y2:i+s})}}else this.Dt(t,e,i
3220
3220
  return a}query(t,e,i,s){return this.Is(t,e,i,s,!1,null)}hitTest(t,e,i,s,n,r){return this.Is(t,e,i,s,!0,n,r).length>0}hitTestCircle(t,e,i,s,n){const r=t-i,o=t+i,a=e-i,h=e+i
3221
3221
  if(o<0||r>this.width||h<0||a>this.height)return!1
3222
3222
  const l=[]
3223
- return this.Dt(r,a,o,h,this.Ts,l,{hitTest:!0,overlapMode:s,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),l.length>0}Lt(t,e,i,s,n,r,o,a){const{seenUids:h,hitTest:l,overlapMode:c}=o,u=this.boxCells[n]
3223
+ return this.Dt(r,a,o,h,this.Cs,l,{hitTest:!0,overlapMode:s,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),l.length>0}Lt(t,e,i,s,n,r,o,a){const{seenUids:h,hitTest:l,overlapMode:c}=o,u=this.boxCells[n]
3224
3224
  if(null!==u){const n=this.bboxes
3225
3225
  for(const o of u)if(!h.box[o]){h.box[o]=!0
3226
3226
  const u=4*o,f=this.boxKeys[o]
@@ -3228,18 +3228,18 @@ if(t<=n[u+2]&&e<=n[u+3]&&i>=n[u+0]&&s>=n[u+1]&&(!a||a(f))&&(!l||!mt(c,f.overlapM
3228
3228
  if(null!==f){const n=this.circles
3229
3229
  for(const o of f)if(!h.circle[o]){h.circle[o]=!0
3230
3230
  const u=3*o,f=this.circleKeys[o]
3231
- if(this.Cs(n[u],n[u+1],n[u+2],t,e,i,s)&&(!a||a(f))&&(!l||!mt(c,f.overlapMode))){const t=n[u],e=n[u+1],i=n[u+2]
3232
- if(r.push({key:f,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),l)return!0}}}return!1}Ts(t,e,i,s,n,r,o,a){const{circle:h,seenUids:l,overlapMode:c}=o,u=this.boxCells[n]
3231
+ if(this.Ts(n[u],n[u+1],n[u+2],t,e,i,s)&&(!a||a(f))&&(!l||!mt(c,f.overlapMode))){const t=n[u],e=n[u+1],i=n[u+2]
3232
+ if(r.push({key:f,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),l)return!0}}}return!1}Cs(t,e,i,s,n,r,o,a){const{circle:h,seenUids:l,overlapMode:c}=o,u=this.boxCells[n]
3233
3233
  if(null!==u){const t=this.bboxes
3234
3234
  for(const e of u)if(!l.box[e]){l.box[e]=!0
3235
3235
  const i=4*e,s=this.boxKeys[e]
3236
- if(this.Cs(h.x,h.y,h.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!a||a(s))&&!mt(c,s.overlapMode))return r.push(!0),!0}}const f=this.circleCells[n]
3236
+ if(this.Ts(h.x,h.y,h.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!a||a(s))&&!mt(c,s.overlapMode))return r.push(!0),!0}}const f=this.circleCells[n]
3237
3237
  if(null!==f){const t=this.circles
3238
3238
  for(const e of f)if(!l.circle[e]){l.circle[e]=!0
3239
3239
  const i=3*e,s=this.circleKeys[e]
3240
3240
  if(this.Ps(t[i],t[i+1],t[i+2],h.x,h.y,h.radius)&&(!a||a(s))&&!mt(c,s.overlapMode))return r.push(!0),!0}}}Dt(t,e,i,s,n,r,o,a){const h=this.$s(t),l=this.Fs(e),c=this.$s(i),u=this.Fs(s)
3241
3241
  for(let f=h;f<=c;f++)for(let h=l;h<=u;h++)if(n.call(this,t,e,i,s,this.xCellCount*h+f,r,o,a))return}$s(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}Fs(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}Ps(t,e,i,s,n,r){const o=s-t,a=n-e,h=i+r
3242
- return h*h>o*o+a*a}Cs(t,e,i,s,n,r,o){const a=(r-s)/2,h=Math.abs(t-(s+a))
3242
+ return h*h>o*o+a*a}Ts(t,e,i,s,n,r,o){const a=(r-s)/2,h=Math.abs(t-(s+a))
3243
3243
  if(h>a+i)return!1
3244
3244
  const l=(o-n)/2,c=Math.abs(e-(n+l))
3245
3245
  if(c>l+i)return!1
@@ -3259,10 +3259,10 @@ if(n.hidden||n.writingMode===e.ah.vertical&&!M){$t(n.numGlyphs,v)
3259
3259
  continue}M=!1
3260
3260
  const S=vt(n.anchorX,n.anchorY,i,m)
3261
3261
  if(!bt(S.point,y)){$t(n.numGlyphs,v)
3262
- continue}const k=wt(s.transform.cameraToCenterDistance,S.signedDistanceFromCamera),A=e.ai(_,g,n),E=a?A/k:A*k,I={getElevation:m,labelPlaneMatrix:r,lineVertexArray:w,pitchWithMap:a,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:c,tileAnchorPoint:new e.P(n.anchorX,n.anchorY),unwrappedTileID:u,width:f,height:p,translation:d},T=St(I,n,E,!1,h,i,o,t.glyphOffsetArray,v,x,l)
3263
- M=T.useVertical,(T.notEnoughRoom||M||T.needsFlipping&&St(I,n,E,!0,h,i,o,t.glyphOffsetArray,v,x,l).notEnoughRoom)&&$t(n.numGlyphs,v)}n?t.text.dynamicLayoutVertexBuffer.updateData(v):t.icon.dynamicLayoutVertexBuffer.updateData(v)}function Mt(t,e,i,s,n,r,o,a){const h=r.glyphStartIndex+r.numGlyphs,l=r.lineStartIndex,c=r.lineStartIndex+r.lineLength,u=e.getoffsetX(r.glyphStartIndex),f=e.getoffsetX(h-1),p=Ct(t*u,i,s,n,r.segment,l,c,a,o)
3262
+ continue}const k=wt(s.transform.cameraToCenterDistance,S.signedDistanceFromCamera),A=e.ai(_,g,n),E=a?A/k:A*k,I={getElevation:m,labelPlaneMatrix:r,lineVertexArray:w,pitchWithMap:a,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:c,tileAnchorPoint:new e.P(n.anchorX,n.anchorY),unwrappedTileID:u,width:f,height:p,translation:d},C=St(I,n,E,!1,h,i,o,t.glyphOffsetArray,v,x,l)
3263
+ M=C.useVertical,(C.notEnoughRoom||M||C.needsFlipping&&St(I,n,E,!0,h,i,o,t.glyphOffsetArray,v,x,l).notEnoughRoom)&&$t(n.numGlyphs,v)}n?t.text.dynamicLayoutVertexBuffer.updateData(v):t.icon.dynamicLayoutVertexBuffer.updateData(v)}function Mt(t,e,i,s,n,r,o,a){const h=r.glyphStartIndex+r.numGlyphs,l=r.lineStartIndex,c=r.lineStartIndex+r.lineLength,u=e.getoffsetX(r.glyphStartIndex),f=e.getoffsetX(h-1),p=Tt(t*u,i,s,n,r.segment,l,c,a,o)
3264
3264
  if(!p)return null
3265
- const d=Ct(t*f,i,s,n,r.segment,l,c,a,o)
3265
+ const d=Tt(t*f,i,s,n,r.segment,l,c,a,o)
3266
3266
  return d?a.projectionCache.anyProjectionOccluded?null:{first:p,last:d}:null}function zt(t,i,s,n){return t===e.ah.horizontal&&Math.abs(s.y-i.y)>Math.abs(s.x-i.x)*n?{useVertical:!0}:(t===e.ah.vertical?i.y<s.y:i.x>s.x)?{needsFlipping:!0}:null}function St(t,i,s,n,r,o,a,h,l,c,u){const f=s/24,p=i.lineOffsetX*f,d=i.lineOffsetY*f
3267
3267
  let m
3268
3268
  if(i.numGlyphs>1){const e=i.glyphStartIndex+i.numGlyphs,s=i.lineStartIndex,o=i.lineStartIndex+i.lineLength,l=Mt(f,h,p,d,n,i,u,t)
@@ -3270,9 +3270,9 @@ if(!l)return{notEnoughRoom:!0}
3270
3270
  const _=vt(l.first.point.x,l.first.point.y,a,t.getElevation).point,g=vt(l.last.point.x,l.last.point.y,a,t.getElevation).point
3271
3271
  if(r&&!n){const t=zt(i.writingMode,_,g,c)
3272
3272
  if(t)return t}m=[l.first]
3273
- for(let r=i.glyphStartIndex+1;r<e-1;r++)m.push(Ct(f*h.getoffsetX(r),p,d,n,i.segment,s,o,t,u))
3273
+ for(let r=i.glyphStartIndex+1;r<e-1;r++)m.push(Tt(f*h.getoffsetX(r),p,d,n,i.segment,s,o,t,u))
3274
3274
  m.push(l.last)}else{if(r&&!n){const s=vt(t.tileAnchorPoint.x,t.tileAnchorPoint.y,o,t.getElevation).point,n=i.lineStartIndex+i.segment+1,r=new e.P(t.lineVertexArray.getx(n),t.lineVertexArray.gety(n)),a=vt(r.x,r.y,o,t.getElevation),h=a.signedDistanceFromCamera>0?a.point:kt(t.tileAnchorPoint,r,s,1,o,t),l=zt(i.writingMode,s,h,c)
3275
- if(l)return l}const s=Ct(f*h.getoffsetX(i.glyphStartIndex),p,d,n,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,t,u)
3275
+ if(l)return l}const s=Tt(f*h.getoffsetX(i.glyphStartIndex),p,d,n,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,t,u)
3276
3276
  if(!s||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0}
3277
3277
  m=[s]}for(const _ of m)e.aj(l,_.point,_.angle)
3278
3278
  return{}}function kt(t,e,i,s,n,r){const o=t.add(t.sub(e).ct()),a=void 0!==n?vt(o.x,o.y,n,r.getElevation).point:Et(o.x,o.y,r).point,h=i.sub(a)
@@ -3283,11 +3283,11 @@ if(o.signedDistanceFromCamera>0)return n.projections[t]=o.point,n.anyProjectionO
3283
3283
  const a=t-s.direction
3284
3284
  return kt(0===s.distanceFromAnchor?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(a),i.lineVertexArray.gety(a)),r,s.previousVertex,s.absOffsetX-s.distanceFromAnchor+1,void 0,i)}function Et(t,e,i){const s=t+i.translation[0],n=e+i.translation[1]
3285
3285
  let r
3286
- return!i.pitchWithMap&&i.projection.useSpecialProjectionForSymbols?(r=i.projection.projectTileCoordinates(s,n,i.unwrappedTileID,i.getElevation),r.point.x=(.5*r.point.x+.5)*i.width,r.point.y=(.5*-r.point.y+.5)*i.height):(r=vt(s,n,i.labelPlaneMatrix,i.getElevation),r.isOccluded=!1),r}function It(t,e,i){return t.ct().ut().nt(e*i)}function Tt(t,i,s,n,r,o,a,h,l){if(h.projectionCache.offsets[t])return h.projectionCache.offsets[t]
3286
+ return!i.pitchWithMap&&i.projection.useSpecialProjectionForSymbols?(r=i.projection.projectTileCoordinates(s,n,i.unwrappedTileID,i.getElevation),r.point.x=(.5*r.point.x+.5)*i.width,r.point.y=(.5*-r.point.y+.5)*i.height):(r=vt(s,n,i.labelPlaneMatrix,i.getElevation),r.isOccluded=!1),r}function It(t,e,i){return t.ct().ut().nt(e*i)}function Ct(t,i,s,n,r,o,a,h,l){if(h.projectionCache.offsets[t])return h.projectionCache.offsets[t]
3287
3287
  const c=s.add(i)
3288
3288
  if(t+l.direction<n||t+l.direction>=r)return h.projectionCache.offsets[t]=c,c
3289
3289
  const u=At(t+l.direction,h,l),f=It(u.sub(s),a,l.direction),p=s.add(f),d=u.add(f)
3290
- return h.projectionCache.offsets[t]=e.ak(o,c,p,d)||c,h.projectionCache.offsets[t]}function Ct(t,e,i,s,n,r,o,a,h){const l=s?t-e:t+e
3290
+ return h.projectionCache.offsets[t]=e.ak(o,c,p,d)||c,h.projectionCache.offsets[t]}function Tt(t,e,i,s,n,r,o,a,h){const l=s?t-e:t+e
3291
3291
  let c=l>0?1:-1,u=0
3292
3292
  s&&(c*=-1,u=Math.PI),c<0&&(u+=Math.PI)
3293
3293
  let f,p=c>0?r+n:r+n+1
@@ -3301,7 +3301,7 @@ const t={absOffsetX:w,direction:c,distanceFromAnchor:y,previousVertex:g}
3301
3301
  if(_=At(p,a,t),0===i)b.push(g),x=_.sub(g)
3302
3302
  else{let e
3303
3303
  const s=_.sub(g)
3304
- e=0===s.mag()?It(At(p+c,a,t).sub(_),i,c):It(s,i,c),m||(m=g.add(e)),d=Tt(p,e,_,r,o,m,i,a,t),b.push(m),x=d.sub(m)}v=x.mag()}const M=x.nt((w-y)/v).tt(m||g),z=u+Math.atan2(_.y-g.y,_.x-g.x)
3304
+ e=0===s.mag()?It(At(p+c,a,t).sub(_),i,c):It(s,i,c),m||(m=g.add(e)),d=Ct(p,e,_,r,o,m,i,a,t),b.push(m),x=d.sub(m)}v=x.mag()}const M=x.nt((w-y)/v).tt(m||g),z=u+Math.atan2(_.y-g.y,_.x-g.x)
3305
3305
  return b.push(M),{point:M,angle:h?z:0,path:b}}const Pt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0])
3306
3306
  function $t(t,e){for(let i=0;i<t;i++){const t=e.length
3307
3307
  e.resize(t+4),e.float32.set(Pt,3*t)}}function Ft(t,e,i){const s=e[0],n=e[1]
@@ -3373,10 +3373,10 @@ if((!y||this.collisionIndex.placeCollisionBox(y,f,h,l,c,a,o,g,u.predicate,v,x).p
3373
3373
  if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0")
3374
3374
  return this.variableOffsets[p.crossTileID]={textOffset:b,width:s,height:n,anchor:w,textBoxScale:r,prevAnchor:t},this.markUsedJustification(d,w,p,m),d.allowVerticalPlacement&&(this.markUsedOrientation(d,m,p),this.placedOrientations[p.crossTileID]=m),{shift:x,placedGlyphBoxes:M}}}placeLayerBucketPart(t,i,s){const{bucket:n,layout:r,translationText:o,translationIcon:a,posMatrix:h,unwrappedTileID:l,textLabelPlaneMatrix:c,labelToScreenMatrix:u,textPixelRatio:f,holdingForFade:p,collisionBoxArray:d,partiallyEvaluatedTextSize:m,collisionGroup:_}=t.parameters,g=r.get("text-optional"),y=r.get("icon-optional"),v=e.ar(r,"text-overlap","text-allow-overlap"),w="always"===v,b=e.ar(r,"icon-overlap","icon-allow-overlap"),x="always"===b,M="map"===r.get("text-rotation-alignment"),z="map"===r.get("text-pitch-alignment"),S="none"!==r.get("icon-text-fit"),k="viewport-y"===r.get("symbol-z-order"),A=w&&(x||!n.hasIconData()||y),E=x&&(w||!n.hasTextData()||g)
3375
3375
  !n.collisionArrays&&d&&n.deserializeCollisionBoxes(d)
3376
- const I=this.Ls(this.retainedQueryData[n.bucketInstanceId].tileID),T=(t,d,x)=>{var k,T
3376
+ const I=this.Ls(this.retainedQueryData[n.bucketInstanceId].tileID),C=(t,d,x)=>{var k,C
3377
3377
  if(i[t.crossTileID])return
3378
3378
  if(p)return void(this.placements[t.crossTileID]=new Rt(!1,!1,!1))
3379
- let C=!1,P=!1,$=!0,F=null,D={box:null,placeable:!1,offscreen:null},O={placeable:!1},L=null,N=null,j=null,R=0,q=0,B=0
3379
+ let T=!1,P=!1,$=!0,F=null,D={box:null,placeable:!1,offscreen:null},O={placeable:!1},L=null,N=null,j=null,R=0,q=0,B=0
3380
3380
  d.textFeatureIndex?R=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(R=t.featureIndex),d.verticalTextFeatureIndex&&(q=d.verticalTextFeatureIndex)
3381
3381
  const U=d.textBox
3382
3382
  if(U){const i=i=>{let s=e.ah.horizontal
@@ -3385,30 +3385,30 @@ e&&(this.placedOrientations[t.crossTileID]=e,s=e,this.markUsedOrientation(n,s,t)
3385
3385
  if(u===c){const s=(e,i)=>{const s=this.collisionIndex.placeCollisionBox(e,v,f,h,l,z,M,o,_.predicate,I)
3386
3386
  return s&&s.placeable&&(this.markUsedOrientation(n,i,t),this.placedOrientations[t.crossTileID]=i),s}
3387
3387
  r(()=>s(U,e.ah.horizontal),()=>{const i=d.verticalTextBox
3388
- return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?s(i,e.ah.vertical):{box:null,offscreen:null}}),i(D&&D.placeable)}else{let p=e.aq[null===(T=null===(k=this.prevPlacement)||void 0===k?void 0:k.variableOffsets[t.crossTileID])||void 0===T?void 0:T.anchor]
3388
+ return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?s(i,e.ah.vertical):{box:null,offscreen:null}}),i(D&&D.placeable)}else{let p=e.aq[null===(C=null===(k=this.prevPlacement)||void 0===k?void 0:k.variableOffsets[t.crossTileID])||void 0===C?void 0:C.anchor]
3389
3389
  const m=(i,r,d)=>{const m=i.x2-i.x1,g=i.y2-i.y1,y=t.textBoxScale,w=S&&"never"===b?r:null
3390
3390
  let x=null,k="never"===v?1:2,A="never"
3391
3391
  p&&k++
3392
3392
  for(let e=0;e<k;e++){for(let e=c;e<u;e++){const s=n.textAnchorOffsets.get(e)
3393
3393
  if(p&&s.textAnchor!==p)continue
3394
3394
  const r=this.attemptAnchorPlacement(s,i,m,g,y,M,z,f,h,l,_,A,t,n,d,o,a,w,I)
3395
- if(r&&(x=r.placedGlyphBoxes,x&&x.placeable))return C=!0,F=r.shift,x}p?p=null:A=v}return s&&!x&&(x={box:this.collisionIndex.placeCollisionBox(U,"always",f,h,l,z,M,o,_.predicate,I,new e.P(0,0)).box,offscreen:!1,placeable:!1}),x}
3395
+ if(r&&(x=r.placedGlyphBoxes,x&&x.placeable))return T=!0,F=r.shift,x}p?p=null:A=v}return s&&!x&&(x={box:this.collisionIndex.placeCollisionBox(U,"always",f,h,l,z,M,o,_.predicate,I,new e.P(0,0)).box,offscreen:!1,placeable:!1}),x}
3396
3396
  r(()=>m(U,d.iconBox,e.ah.horizontal),()=>{const i=d.verticalTextBox
3397
- return n.allowVerticalPlacement&&(!D||!D.placeable)&&t.numVerticalGlyphVertices>0&&i?m(i,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),D&&(C=D.placeable,$=D.offscreen)
3397
+ return n.allowVerticalPlacement&&(!D||!D.placeable)&&t.numVerticalGlyphVertices>0&&i?m(i,d.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}),D&&(T=D.placeable,$=D.offscreen)
3398
3398
  const g=i(D&&D.placeable)
3399
- if(!C&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID]
3400
- e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,g))}}}if(L=D,C=L&&L.placeable,$=L&&L.offscreen,t.useRuntimeCollisionCircles){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),a=e.ai(n.textSizeData,m,i),f=r.get("text-padding")
3401
- N=this.collisionIndex.placeCollisionCircles(v,i,n.lineVertexArray,n.glyphOffsetArray,a,h,l,c,u,s,z,_.predicate,t.collisionCircleDiameter,f,o,I),N.circles.length&&N.collisionDetected&&!s&&e.w("Collisions detected, but collision boxes are not shown"),C=w||N.circles.length>0&&!N.collisionDetected,$=$&&N.offscreen}if(d.iconFeatureIndex&&(B=d.iconFeatureIndex),d.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,b,f,h,l,z,M,a,_.predicate,I,S&&F?F:void 0)
3399
+ if(!T&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID]
3400
+ e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,g))}}}if(L=D,T=L&&L.placeable,$=L&&L.offscreen,t.useRuntimeCollisionCircles){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),a=e.ai(n.textSizeData,m,i),f=r.get("text-padding")
3401
+ N=this.collisionIndex.placeCollisionCircles(v,i,n.lineVertexArray,n.glyphOffsetArray,a,h,l,c,u,s,z,_.predicate,t.collisionCircleDiameter,f,o,I),N.circles.length&&N.collisionDetected&&!s&&e.w("Collisions detected, but collision boxes are not shown"),T=w||N.circles.length>0&&!N.collisionDetected,$=$&&N.offscreen}if(d.iconFeatureIndex&&(B=d.iconFeatureIndex),d.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,b,f,h,l,z,M,a,_.predicate,I,S&&F?F:void 0)
3402
3402
  O&&O.placeable&&d.verticalIconBox?(j=t(d.verticalIconBox),P=j.placeable):(j=t(d.iconBox),P=j.placeable),$=$&&j.offscreen}const V=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=y||0===t.numIconVertices
3403
- V||G?G?V||(P=P&&C):C=P&&C:P=C=P&&C
3403
+ V||G?G?V||(P=P&&T):T=P&&T:P=T=P&&T
3404
3404
  const Z=P&&j.placeable
3405
- if(C&&L.placeable&&this.collisionIndex.insertCollisionBox(L.box,v,r.get("text-ignore-placement"),n.bucketInstanceId,O&&O.placeable&&q?q:R,_.ID),Z&&this.collisionIndex.insertCollisionBox(j.box,b,r.get("icon-ignore-placement"),n.bucketInstanceId,B,_.ID),N&&C&&this.collisionIndex.insertCollisionCircles(N.circles,v,r.get("text-ignore-placement"),n.bucketInstanceId,R,_.ID),s&&this.storeCollisionData(n.bucketInstanceId,x,d,L,j,N),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0")
3405
+ if(T&&L.placeable&&this.collisionIndex.insertCollisionBox(L.box,v,r.get("text-ignore-placement"),n.bucketInstanceId,O&&O.placeable&&q?q:R,_.ID),Z&&this.collisionIndex.insertCollisionBox(j.box,b,r.get("icon-ignore-placement"),n.bucketInstanceId,B,_.ID),N&&T&&this.collisionIndex.insertCollisionCircles(N.circles,v,r.get("text-ignore-placement"),n.bucketInstanceId,R,_.ID),s&&this.storeCollisionData(n.bucketInstanceId,x,d,L,j,N),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0")
3406
3406
  if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0")
3407
- this.placements[t.crossTileID]=new Rt(C||A,P||E,$||n.justReloaded),i[t.crossTileID]=!0}
3407
+ this.placements[t.crossTileID]=new Rt(T||A,P||E,$||n.justReloaded),i[t.crossTileID]=!0}
3408
3408
  if(k){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0")
3409
3409
  const e=n.getSortedSymbolIndexes(this.transform.angle)
3410
3410
  for(let t=e.length-1;t>=0;--t){const i=e[t]
3411
- T(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)T(n.symbolInstances.get(e),n.collisionArrays[e],e)
3411
+ C(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)C(n.symbolInstances.get(e),n.collisionArrays[e],e)
3412
3412
  if(s&&n.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[n.bucketInstanceId]
3413
3413
  e.as(t.invProjMatrix,h),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}n.justReloaded=!1}storeCollisionData(t,e,i,s,n,r){if(i.textBox||i.iconBox){let r,o
3414
3414
  this.collisionBoxArrays.has(t)?r=this.collisionBoxArrays.get(t):(r=new Map,this.collisionBoxArrays.set(t,r)),r.has(e)?o=r.get(e):(o={text:null,icon:null},r.set(e,o)),i.textBox&&(o.text=s.box),i.iconBox&&(o.icon=n.box)}if(r){let e=this.collisionCircleArrays[t]
@@ -3530,7 +3530,7 @@ e.h(n,this.sn).then(t=>{this.sn=null,this.nn(t.data,i,s)}).catch(t=>{this.sn=nul
3530
3530
  const r=i.transformStyle?i.transformStyle(s,t):t
3531
3531
  if(!i.validate||!ce(this,e.u(r))){this.yi=!0,this.stylesheet=r
3532
3532
  for(const t in r.sources)this.addSource(t,r.sources[t],{validate:!1})
3533
- r.sprite?this.hn(r.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(r.glyphs),this.cn(),this.light=new T(this.stylesheet.light),this.sky=new P(this.stylesheet.sky),this.map.setTerrain(null!==(n=this.stylesheet.terrain)&&void 0!==n?n:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}cn(){const t=e.az(this.stylesheet.layers)
3533
+ r.sprite?this.hn(r.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(r.glyphs),this.cn(),this.light=new C(this.stylesheet.light),this.sky=new P(this.stylesheet.sky),this.map.setTerrain(null!==(n=this.stylesheet.terrain)&&void 0!==n?n:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}cn(){const t=e.az(this.stylesheet.layers)
3534
3534
  this.dispatcher.broadcast("SL",t),this.Ys=t.map(t=>t.id),this.De={},this.un=null
3535
3535
  for(const i of t){const t=e.aA(i)
3536
3536
  t.setEventedParent(this,{layer:{id:i.id}}),this.De[i.id]=t}}hn(t,i=!1,s=void 0){let n
@@ -3586,11 +3586,11 @@ this.In=!1}}Mn(t,e){this.dispatcher.broadcast("UL",{layers:this.gn(t,!1),removed
3586
3586
  this.vn()
3587
3587
  const n=this.serialize()
3588
3588
  if(t=i.transformStyle?i.transformStyle(n,t):t,(null===(s=i.validate)||void 0===s||s)&&ce(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers)
3589
- const r=e.aC(n,t),o=this.Tn(r)
3589
+ const r=e.aC(n,t),o=this.Cn(r)
3590
3590
  if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`)
3591
3591
  if(0===o.operations.length)return!1
3592
3592
  for(const e of o.operations)e()
3593
- return this.stylesheet=t,this.un=null,!0}Tn(t){const e=[],i=[]
3593
+ return this.stylesheet=t,this.un=null,!0}Cn(t){const e=[],i=[]
3594
3594
  for(const s of t)switch(s.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue
3595
3595
  case"addLayer":e.push(()=>this.addLayer.apply(this,s.args))
3596
3596
  break
@@ -3623,8 +3623,8 @@ break
3623
3623
  case"setTransition":e.push(()=>{})
3624
3624
  break
3625
3625
  default:i.push(s.command)}return{operations:e,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)))
3626
- this.imageManager.addImage(t,i),this.Cn(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.j(new Error(`An image named "${t}" does not exist.`)))
3627
- this.imageManager.removeImage(t),this.Cn(t)}Cn(t){this.Qs=this.imageManager.listImages(),this.pn[t]=!0,this.dn=!0,this.dispatcher.broadcast("SI",this.Qs),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this.vn(),this.imageManager.listImages()}addSource(t,i,s={}){if(this.vn(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`)
3626
+ this.imageManager.addImage(t,i),this.Tn(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.j(new Error(`An image named "${t}" does not exist.`)))
3627
+ this.imageManager.removeImage(t),this.Tn(t)}Tn(t){this.Qs=this.imageManager.listImages(),this.pn[t]=!0,this.dn=!0,this.dispatcher.broadcast("SI",this.Qs),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this.vn(),this.imageManager.listImages()}addSource(t,i,s={}){if(this.vn(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`)
3628
3628
  if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`)
3629
3629
  if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this.Xt(e.u.source,`sources.${t}`,i,null,s))return
3630
3630
  this.map&&this.map.xi&&(i.collectResourceTiming=!0)
@@ -3803,7 +3803,7 @@ return{u_matrix:t,u_lightpos:a,u_lightintensity:r.properties.get("intensity"),u_
3803
3803
  let r,o
3804
3804
  if("map"===s.paint.get("circle-pitch-alignment")){const t=Lt(i,1,n.zoom)
3805
3805
  r=!0,o=[t,t]}else r=!1,o=n.pixelsToGLUnits
3806
- return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+("map"===s.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+r,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:o}},Ee=(t,e,i)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}),Ie=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Te=t=>({u_matrix:t}),Ce=(t,e,i,s)=>({u_matrix:t,u_extrude_scale:Lt(e,1,i),u_intensity:s}),Pe=(t,i,s,n)=>{const r=e.H()
3806
+ return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+("map"===s.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+r,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:o}},Ee=(t,e,i)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}),Ie=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Ce=t=>({u_matrix:t}),Te=(t,e,i,s)=>({u_matrix:t,u_extrude_scale:Lt(e,1,i),u_intensity:s}),Pe=(t,i,s,n)=>{const r=e.H()
3807
3807
  e.aP(r,0,t.width,t.height,0,0,1)
3808
3808
  const o=t.context.gl
3809
3809
  return{u_matrix:r,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:s,u_color_ramp:n,u_opacity:i.paint.get("heatmap-opacity")}}
@@ -3862,15 +3862,15 @@ Ye(i)?i.bindVertexArray(t):null===(e=i.getExtension("OES_vertex_array_object"))|
3862
3862
  const e=this.gl
3863
3863
  e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Ii extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return
3864
3864
  const e=this.gl
3865
- e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Ti extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return
3865
+ e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Ci extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return
3866
3866
  const e=this.gl
3867
- e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Ci extends Qe{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class Pi extends Ci{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return
3867
+ e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Ti extends Qe{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class Pi extends Ti{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return
3868
3868
  this.context.bindFramebuffer.set(this.parent)
3869
3869
  const e=this.gl
3870
- e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class $i extends Ci{set(t){if(t===this.current&&!this.dirty)return
3870
+ e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class $i extends Ti{set(t){if(t===this.current&&!this.dirty)return
3871
3871
  this.context.bindFramebuffer.set(this.parent)
3872
3872
  const e=this.gl
3873
- e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Fi extends Ci{set(t){if(t===this.current&&!this.dirty)return
3873
+ e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Fi extends Ti{set(t){if(t===this.current&&!this.dirty)return
3874
3874
  this.context.bindFramebuffer.set(this.parent)
3875
3875
  const e=this.gl
3876
3876
  e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Di{constructor(t,e,i,s,n){this.context=t,this.width=e,this.height=i
@@ -3881,7 +3881,7 @@ if(r.checkFramebufferStatus(r.FRAMEBUFFER)!==r.FRAMEBUFFER_COMPLETE)throw new Er
3881
3881
  if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get()
3882
3882
  e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Oi{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}Oi.Replace=[1,0],Oi.disabled=new Oi(Oi.Replace,e.aM.transparent,[!1,!1,!1,!1]),Oi.unblended=new Oi(Oi.Replace,e.aM.transparent,[!0,!0,!0,!0]),Oi.alphaBlended=new Oi([1,771],e.aM.transparent,[!0,!0,!0,!0])
3883
3883
  class Li{constructor(t){var e,i
3884
- if(this.gl=t,this.clearColor=new ti(this),this.clearDepth=new ei(this),this.clearStencil=new ii(this),this.colorMask=new si(this),this.depthMask=new ni(this),this.stencilMask=new ri(this),this.stencilFunc=new oi(this),this.stencilOp=new ai(this),this.stencilTest=new hi(this),this.depthRange=new li(this),this.depthTest=new ci(this),this.depthFunc=new ui(this),this.blend=new fi(this),this.blendFunc=new pi(this),this.blendColor=new di(this),this.blendEquation=new mi(this),this.cullFace=new _i(this),this.cullFaceSide=new gi(this),this.frontFace=new yi(this),this.program=new vi(this),this.activeTexture=new wi(this),this.viewport=new bi(this),this.bindFramebuffer=new xi(this),this.bindRenderbuffer=new Mi(this),this.bindTexture=new zi(this),this.bindVertexBuffer=new Si(this),this.bindElementBuffer=new ki(this),this.bindVertexArray=new Ai(this),this.pixelStoreUnpack=new Ei(this),this.pixelStoreUnpackPremultiplyAlpha=new Ii(this),this.pixelStoreUnpackFlipY=new Ti(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),Ye(t)){this.HALF_FLOAT=t.HALF_FLOAT
3884
+ if(this.gl=t,this.clearColor=new ti(this),this.clearDepth=new ei(this),this.clearStencil=new ii(this),this.colorMask=new si(this),this.depthMask=new ni(this),this.stencilMask=new ri(this),this.stencilFunc=new oi(this),this.stencilOp=new ai(this),this.stencilTest=new hi(this),this.depthRange=new li(this),this.depthTest=new ci(this),this.depthFunc=new ui(this),this.blend=new fi(this),this.blendFunc=new pi(this),this.blendColor=new di(this),this.blendEquation=new mi(this),this.cullFace=new _i(this),this.cullFaceSide=new gi(this),this.frontFace=new yi(this),this.program=new vi(this),this.activeTexture=new wi(this),this.viewport=new bi(this),this.bindFramebuffer=new xi(this),this.bindRenderbuffer=new Mi(this),this.bindTexture=new zi(this),this.bindVertexBuffer=new Si(this),this.bindElementBuffer=new ki(this),this.bindVertexArray=new Ai(this),this.pixelStoreUnpack=new Ei(this),this.pixelStoreUnpackPremultiplyAlpha=new Ii(this),this.pixelStoreUnpackFlipY=new Ci(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),Ye(t)){this.HALF_FLOAT=t.HALF_FLOAT
3885
3885
  const s=t.getExtension("EXT_color_buffer_half_float")
3886
3886
  this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==s?void 0:s.RGBA16F_EXT,this.RGB16F=null!==(i=t.RGB16F)&&void 0!==i?i:null==s?void 0:s.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear")
3887
3887
  const e=t.getExtension("OES_texture_half_float")
@@ -3926,9 +3926,9 @@ for(let v=0;v<m.length;v++){const g=m.get(v),w=g.hidden||!g.crossTileID||t.allow
3926
3926
  if(w){const n=new e.P(g.anchorX,g.anchorY),m={getElevation:d,width:r.width,height:r.height,labelPlaneMatrix:o,pitchWithMap:s,projection:u,tileAnchorPoint:n,translation:f,unwrappedTileID:p},v=s?vt(n.x,n.y,a,d):Et(n.x,n.y,m),b=wt(r.cameraToCenterDistance,v.signedDistanceFromCamera)
3927
3927
  let x=e.ai(t.textSizeData,l,g)*b/e.ap
3928
3928
  s&&(x*=t.tilePixelRatio/h)
3929
- const{width:M,height:z,anchor:S,textOffset:k,textBoxScale:A}=w,E=Gi(S,M,z,k,A,x),I=u.getPitchedTextCorrection(r,n.add(new e.P(f[0],f[1])),p),T=Zi(v.point,m,i,E,r.angle,I),C=t.allowVerticalPlacement&&g.placedOrientation===e.ah.vertical?Math.PI/2:0
3930
- for(let t=0;t<g.numGlyphs;t++)e.aj(_,T,C)
3931
- c&&g.associatedIconIndex>=0&&(y[g.associatedIconIndex]={shiftedAnchor:T,angle:C})}else $t(g.numGlyphs,_)}if(c){g.clear()
3929
+ const{width:M,height:z,anchor:S,textOffset:k,textBoxScale:A}=w,E=Gi(S,M,z,k,A,x),I=u.getPitchedTextCorrection(r,n.add(new e.P(f[0],f[1])),p),C=Zi(v.point,m,i,E,r.angle,I),T=t.allowVerticalPlacement&&g.placedOrientation===e.ah.vertical?Math.PI/2:0
3930
+ for(let t=0;t<g.numGlyphs;t++)e.aj(_,C,T)
3931
+ c&&g.associatedIconIndex>=0&&(y[g.associatedIconIndex]={shiftedAnchor:C,angle:T})}else $t(g.numGlyphs,_)}if(c){g.clear()
3932
3932
  const i=t.icon.placedSymbolArray
3933
3933
  for(let t=0;t<i.length;t++){const s=i.get(t)
3934
3934
  if(s.hidden)$t(s.numGlyphs,g)
@@ -3941,7 +3941,7 @@ for(const E of n){const n=i.getTile(E),h=n.getBucket(s)
3941
3941
  if(!h)continue
3942
3942
  const l=r?h.text:h.icon
3943
3943
  if(!l||!l.segments.get().length||!l.hasVisibleVertices)continue
3944
- const u=l.programConfigurations.get(s.id),f=r||h.sdfIcons,p=r?h.textSizeData:h.iconSizeData,z=y||0!==m.pitch,I=t.useProgram(Hi(f,r,h),u),T=e.ag(p,m.zoom),C=t.style.map.terrain&&t.style.map.terrain.getTerrainData(E)
3944
+ const u=l.programConfigurations.get(s.id),f=r||h.sdfIcons,p=r?h.textSizeData:h.iconSizeData,z=y||0!==m.pitch,I=t.useProgram(Hi(f,r,h),u),C=e.ag(p,m.zoom),T=t.style.map.terrain&&t.style.map.terrain.getTerrainData(E)
3945
3945
  let P,$,F,D,O=[0,0],L=null
3946
3946
  if(r)$=n.glyphAtlasTexture,F=d.LINEAR,P=n.glyphAtlasTexture.size,h.iconsInText&&(O=n.imageAtlasTexture.size,L=n.imageAtlasTexture,D=z||t.options.rotating||t.options.zooming||"composite"===p.kind||"camera"===p.kind?d.LINEAR:d.NEAREST)
3947
3947
  else{const e=1!==s.layout.get("icon-size").constantOr(0)||h.iconsNeedLinear
@@ -3949,11 +3949,11 @@ $=n.imageAtlasTexture,F=f||t.options.rotating||t.options.zooming||e||z?d.LINEAR:
3949
3949
  if(v){const e=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(E,e,i):null,i="map"===s.layout.get("text-rotation-alignment")
3950
3950
  xt(h,E.posMatrix,t,r,R,B,y,c,i,_,E.toUnwrapped(),m.width,m.height,U,e)}const Z=E.posMatrix,W=r&&S||G,H=v||W?Vi:R,X=q,J=f&&0!==s.paint.get(r?"text-halo-width":"icon-halo-width").constantOr(1)
3951
3951
  let K
3952
- K=f?h.iconsInText?Ve(p.kind,T,w,y,v,W,t,Z,H,X,U,P,O,A):Ue(p.kind,T,w,y,v,W,t,Z,H,X,U,r,P,0,A):Be(p.kind,T,w,y,v,W,t,Z,H,X,U,r,P,A)
3952
+ K=f?h.iconsInText?Ve(p.kind,C,w,y,v,W,t,Z,H,X,U,P,O,A):Ue(p.kind,C,w,y,v,W,t,Z,H,X,U,r,P,0,A):Be(p.kind,C,w,y,v,W,t,Z,H,X,U,r,P,A)
3953
3953
  const Y={program:I,buffers:l,uniformValues:K,atlasTexture:$,atlasTextureIcon:L,atlasInterpolation:F,atlasInterpolationIcon:D,isSDF:f,hasHalo:J}
3954
3954
  if(x&&h.canOverlap){M=!0
3955
3955
  const t=l.segments.get()
3956
- for(const i of t)k.push({segments:new e.a0([i]),sortKey:i.sortKey,state:Y,terrainData:C})}else k.push({segments:l.segments,sortKey:0,state:Y,terrainData:C})}M&&k.sort((t,e)=>t.sortKey-e.sortKey)
3956
+ for(const i of t)k.push({segments:new e.a0([i]),sortKey:i.sortKey,state:Y,terrainData:T})}else k.push({segments:l.segments,sortKey:0,state:Y,terrainData:T})}M&&k.sort((t,e)=>t.sortKey-e.sortKey)
3957
3957
  for(const e of k){const i=e.state
3958
3958
  if(p.activeTexture.set(d.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,d.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),i.isSDF){const n=i.uniformValues
3959
3959
  i.hasHalo&&(n.u_is_halo=1,Ji(i.buffers,e.segments,s,t,i.program,z,u,f,n,e.terrainData)),n.u_is_halo=0}Ji(i.buffers,e.segments,s,t,i.program,z,u,f,i.uniformValues,e.terrainData)}}function Ji(t,e,i,s,n,r,o,a,h,l){const c=s.context
@@ -3963,7 +3963,7 @@ const c=n.key
3963
3963
  let u=s.heatmapFbos.get(c)
3964
3964
  u||(u=Qi(r,i.tileSize,i.tileSize),s.heatmapFbos.set(c,u)),r.bindFramebuffer.set(u.framebuffer),r.viewport.set([0,0,i.tileSize,i.tileSize]),r.clear({color:e.aM.transparent})
3965
3965
  const f=l.programConfigurations.get(s.id),p=t.useProgram("heatmap",f),d=t.style.map.terrain.getTerrainData(n)
3966
- p.draw(r,o.TRIANGLES,Ni.disabled,a,h,qi.disabled,Ce(n.posMatrix,i,t.transform.zoom,s.paint.get("heatmap-intensity")),d,s.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,s.paint,t.transform.zoom,f)}function Yi(t,e,i){const s=t.context,n=s.gl
3966
+ p.draw(r,o.TRIANGLES,Ni.disabled,a,h,qi.disabled,Te(n.posMatrix,i,t.transform.zoom,s.paint.get("heatmap-intensity")),d,s.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,s.paint,t.transform.zoom,f)}function Yi(t,e,i){const s=t.context,n=s.gl
3967
3967
  s.setColorMode(t.colorModeForRenderPass())
3968
3968
  const r=ts(s,e),o=i.key,a=e.heatmapFbos.get(o)
3969
3969
  a&&(s.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),s.activeTexture.set(n.TEXTURE1),r.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(s,n.TRIANGLES,Ni.disabled,Ri.disabled,t.colorModeForRenderPass(),qi.disabled,Pe(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),a.destroy(),e.heatmapFbos.delete(o))}function Qi(t,e,i){var s,n
@@ -4042,14 +4042,14 @@ const h=this.context.gl
4042
4042
  this.stencilClearMode=new Ri({func:h.ALWAYS,mask:0},0,255,h.ZERO,h.ZERO,h.ZERO)}clearStencil(){const t=this.context,i=t.gl
4043
4043
  this.nextStencilID=1,this.currentStencilSource=void 0
4044
4044
  const s=e.H()
4045
- e.aP(s,0,this.width,this.height,0,0,1),e.K(s,s,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,i.TRIANGLES,Ni.disabled,this.stencilClearMode,Oi.disabled,qi.disabled,Te(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}qn(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return
4045
+ e.aP(s,0,this.width,this.height,0,0,1),e.K(s,s,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,i.TRIANGLES,Ni.disabled,this.stencilClearMode,Oi.disabled,qi.disabled,Ce(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}qn(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return
4046
4046
  this.currentStencilSource=t.source
4047
4047
  const i=this.context,s=i.gl
4048
4048
  this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(Oi.disabled),i.setDepthMode(Ni.disabled)
4049
4049
  const n=this.useProgram("clippingMask")
4050
4050
  this.Bn={}
4051
4051
  for(const r of e){const t=this.Bn[r.key]=this.nextStencilID++,e=this.style.map.terrain&&this.style.map.terrain.getTerrainData(r)
4052
- n.draw(i,s.TRIANGLES,Ni.disabled,new Ri({func:s.ALWAYS,mask:0},t,255,s.KEEP,s.KEEP,s.REPLACE),Oi.disabled,qi.disabled,Te(r.posMatrix),e,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil()
4052
+ n.draw(i,s.TRIANGLES,Ni.disabled,new Ri({func:s.ALWAYS,mask:0},t,255,s.KEEP,s.KEEP,s.REPLACE),Oi.disabled,qi.disabled,Ce(r.posMatrix),e,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil()
4053
4053
  const t=this.nextStencilID++,e=this.context.gl
4054
4054
  return new Ri({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl
4055
4055
  return new Ri({func:e.EQUAL,mask:255},this.Bn[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,i=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),s=i[i.length-1].overscaledZ,n=i[0].overscaledZ-s+1
@@ -4127,7 +4127,7 @@ if(i.hasRenderableParent(l))continue
4127
4127
  const c=i.getTile(l),u=c.getBucket(s)
4128
4128
  if(!u)continue
4129
4129
  const f=u.programConfigurations.get(s.id),p=t.useProgram("heatmap",f),{zoom:d}=t.transform
4130
- p.draw(r,o.TRIANGLES,Ni.disabled,a,h,qi.disabled,Ce(l.posMatrix,c,d,s.paint.get("heatmap-intensity")),null,s.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,s.paint,t.transform.zoom,f)}r.viewport.set([0,0,t.width,t.height])}(t,i,s,n):"translucent"===t.renderPass&&function(t,i){const s=t.context,n=s.gl
4130
+ p.draw(r,o.TRIANGLES,Ni.disabled,a,h,qi.disabled,Te(l.posMatrix,c,d,s.paint.get("heatmap-intensity")),null,s.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,s.paint,t.transform.zoom,f)}r.viewport.set([0,0,t.width,t.height])}(t,i,s,n):"translucent"===t.renderPass&&function(t,i){const s=t.context,n=s.gl
4131
4131
  s.setColorMode(t.colorModeForRenderPass())
4132
4132
  const r=i.heatmapFbos.get(e.aU)
4133
4133
  r&&(s.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),s.activeTexture.set(n.TEXTURE1),ts(s,i).bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(s,n.TRIANGLES,Ni.disabled,Ri.disabled,t.colorModeForRenderPass(),qi.disabled,Pe(t,i,0,1),null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,s)}(t,i,s,n)
@@ -4339,8 +4339,8 @@ if(l+=t?`/${r}/${o}/${i}`:`${i}/${o}/${r}`,(a||h)&&(l+="/"+Math.round(10*a)/10),
4339
4339
  let e=!1
4340
4340
  const i=window.location.hash.slice(1).split("&").map(i=>{const s=i.split("=")[0]
4341
4341
  return s===t?(e=!0,`${s}=${l}`):i}).filter(t=>t)
4342
- return e||i.push(`${t}=${l}`),`#${i.join("&")}`}return`#${l}`}}const ks={linearity:.3,easing:e.b8(0,0,.3,1)},As=e.e({deceleration:2500,maxSpeed:1400},ks),Es=e.e({deceleration:20,maxSpeed:1400},ks),Is=e.e({deceleration:1e3,maxSpeed:360},ks),Ts=e.e({deceleration:1e3,maxSpeed:90},ks)
4343
- class Cs{constructor(t){this.Ue=t,this.clear()}clear(){this.yr=[]}record(t){this.vr(),this.yr.push({time:r.now(),settings:t})}vr(){const t=this.yr,e=r.now()
4342
+ return e||i.push(`${t}=${l}`),`#${i.join("&")}`}return`#${l}`}}const ks={linearity:.3,easing:e.b8(0,0,.3,1)},As=e.e({deceleration:2500,maxSpeed:1400},ks),Es=e.e({deceleration:20,maxSpeed:1400},ks),Is=e.e({deceleration:1e3,maxSpeed:360},ks),Cs=e.e({deceleration:1e3,maxSpeed:90},ks)
4343
+ class Ts{constructor(t){this.Ue=t,this.clear()}clear(){this.yr=[]}record(t){this.vr(),this.yr.push({time:r.now(),settings:t})}vr(){const t=this.yr,e=r.now()
4344
4344
  for(;t.length>0&&e-t[0].time>160;)t.shift()}wr(t){if(this.vr(),this.yr.length<2)return
4345
4345
  const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0}
4346
4346
  for(const{settings:e}of this.yr)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan.tt(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround)
@@ -4348,12 +4348,12 @@ const s=this.yr[this.yr.length-1].time-this.yr[0].time,n={}
4348
4348
  if(i.pan.mag()){const r=$s(i.pan.mag(),s,e.e({},As,t||{}))
4349
4349
  n.offset=i.pan.mult(r.amount/i.pan.mag()),n.center=this.Ue.transform.center,Ps(n,r)}if(i.zoom){const t=$s(i.zoom,s,Es)
4350
4350
  n.zoom=this.Ue.transform.zoom+t.amount,Ps(n,t)}if(i.bearing){const t=$s(i.bearing,s,Is)
4351
- n.bearing=this.Ue.transform.bearing+e.ac(t.amount,-179,179),Ps(n,t)}if(i.pitch){const t=$s(i.pitch,s,Ts)
4351
+ n.bearing=this.Ue.transform.bearing+e.ac(t.amount,-179,179),Ps(n,t)}if(i.pitch){const t=$s(i.pitch,s,Cs)
4352
4352
  n.pitch=this.Ue.transform.pitch+t.amount,Ps(n,t)}if(n.zoom||n.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround
4353
4353
  n.around=t?this.Ue.unproject(t):this.Ue.getCenter()}return this.clear(),e.e(n,{noMoveStart:!0})}}function Ps(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function $s(t,i,s){const{maxSpeed:n,linearity:r,deceleration:o}=s,a=e.ac(t*r/(i/1e3),-n,n),h=Math.abs(a)/(o*r)
4354
4354
  return{easing:s.easing,duration:1e3*h,amount:a*(h/2)}}class Fs extends e.k{preventDefault(){this.Mr=!0}get defaultPrevented(){return this.Mr}constructor(t,i,s,n={}){const r=o.mousePos(i.getCanvas(),s),a=i.unproject(r)
4355
4355
  super(t,e.e({point:r,lngLat:a,originalEvent:s},n)),this.Mr=!1,this.target=i}}class Ds extends e.k{preventDefault(){this.Mr=!0}get defaultPrevented(){return this.Mr}constructor(t,i,s){const n="touchend"===t?s.changedTouches:s.touches,r=o.touchPos(i.getCanvasContainer(),n),a=r.map(t=>i.unproject(t)),h=r.reduce((t,e,i,s)=>t.add(e.div(s.length)),new e.P(0,0))
4356
- super(t,{points:r,point:h,lngLats:a,lngLat:i.unproject(h),originalEvent:s}),this.Mr=!1}}class Os extends e.k{preventDefault(){this.Mr=!0}get defaultPrevented(){return this.Mr}constructor(t,e,i){super(t,{originalEvent:i}),this.Mr=!1}}class Ls{constructor(t,e){this.Ue=t,this.zr=e.clickTolerance}reset(){delete this.Sr}wheel(t){return this.kr(new Os(t.type,this.Ue,t))}mousedown(t,e){return this.Sr=e,this.kr(new Fs(t.type,this.Ue,t))}mouseup(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}click(t,e){this.Sr&&this.Sr.dist(e)>=this.zr||this.Ue.fire(new Fs(t.type,this.Ue,t))}dblclick(t){return this.kr(new Fs(t.type,this.Ue,t))}mouseover(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}mouseout(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}touchstart(t){return this.kr(new Ds(t.type,this.Ue,t))}touchmove(t){this.Ue.fire(new Ds(t.type,this.Ue,t))}touchend(t){this.Ue.fire(new Ds(t.type,this.Ue,t))}touchcancel(t){this.Ue.fire(new Ds(t.type,this.Ue,t))}kr(t){if(this.Ue.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ns{constructor(t){this.Ue=t}reset(){this.Ar=!1,this.Er=!0,delete this.Ir}mousemove(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}mousedown(){this.Ar=!0,this.Er=!1}mouseup(){this.Ar=!1,this.Ir&&(this.Ue.fire(new Fs("contextmenu",this.Ue,this.Ir)),delete this.Ir)}contextmenu(t){this.Ar?this.Ir=t:this.Er||this.Ue.fire(new Fs(t.type,this.Ue,t)),this.Ue.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class js{constructor(t){this.Ue=t}get transform(){return this.Ue.Tr||this.Ue.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.Ue.terrain)}}class Rs{constructor(t,e){this.Ue=t,this.Cr=new js(t),this.Pr=t.getCanvasContainer(),this.$r=t.getContainer(),this.zr=e.clickTolerance||1}isEnabled(){return!!this.Fr}isActive(){return!!this.Dr}enable(){this.isEnabled()||(this.Fr=!0)}disable(){this.isEnabled()&&(this.Fr=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this.Or=this.Lr=e,this.Dr=!0)}mousemoveWindow(t,e){if(!this.Dr)return
4356
+ super(t,{points:r,point:h,lngLats:a,lngLat:i.unproject(h),originalEvent:s}),this.Mr=!1}}class Os extends e.k{preventDefault(){this.Mr=!0}get defaultPrevented(){return this.Mr}constructor(t,e,i){super(t,{originalEvent:i}),this.Mr=!1}}class Ls{constructor(t,e){this.Ue=t,this.zr=e.clickTolerance}reset(){delete this.Sr}wheel(t){return this.kr(new Os(t.type,this.Ue,t))}mousedown(t,e){return this.Sr=e,this.kr(new Fs(t.type,this.Ue,t))}mouseup(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}click(t,e){this.Sr&&this.Sr.dist(e)>=this.zr||this.Ue.fire(new Fs(t.type,this.Ue,t))}dblclick(t){return this.kr(new Fs(t.type,this.Ue,t))}mouseover(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}mouseout(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}touchstart(t){return this.kr(new Ds(t.type,this.Ue,t))}touchmove(t){this.Ue.fire(new Ds(t.type,this.Ue,t))}touchend(t){this.Ue.fire(new Ds(t.type,this.Ue,t))}touchcancel(t){this.Ue.fire(new Ds(t.type,this.Ue,t))}kr(t){if(this.Ue.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ns{constructor(t){this.Ue=t}reset(){this.Ar=!1,this.Er=!0,delete this.Ir}mousemove(t){this.Ue.fire(new Fs(t.type,this.Ue,t))}mousedown(){this.Ar=!0,this.Er=!1}mouseup(){this.Ar=!1,this.Ir&&(this.Ue.fire(new Fs("contextmenu",this.Ue,this.Ir)),delete this.Ir)}contextmenu(t){this.Ar?this.Ir=t:this.Er||this.Ue.fire(new Fs(t.type,this.Ue,t)),this.Ue.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class js{constructor(t){this.Ue=t}get transform(){return this.Ue.Cr||this.Ue.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.Ue.terrain)}}class Rs{constructor(t,e){this.Ue=t,this.Tr=new js(t),this.Pr=t.getCanvasContainer(),this.$r=t.getContainer(),this.zr=e.clickTolerance||1}isEnabled(){return!!this.Fr}isActive(){return!!this.Dr}enable(){this.isEnabled()||(this.Fr=!0)}disable(){this.isEnabled()&&(this.Fr=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(o.disableDrag(),this.Or=this.Lr=e,this.Dr=!0)}mousemoveWindow(t,e){if(!this.Dr)return
4357
4357
  const i=e
4358
4358
  if(this.Lr.equals(i)||!this.Nr&&i.dist(this.Or)<this.zr)return
4359
4359
  const s=this.Or
@@ -4362,7 +4362,7 @@ const n=Math.min(s.x,i.x),r=Math.max(s.x,i.x),a=Math.min(s.y,i.y),h=Math.max(s.y
4362
4362
  o.setTransform(this.Nr,`translate(${n}px,${a}px)`),this.Nr.style.width=r-n+"px",this.Nr.style.height=h-a+"px"}mouseupWindow(t,i){if(!this.Dr)return
4363
4363
  if(0!==t.button)return
4364
4364
  const s=this.Or,n=i
4365
- if(this.reset(),o.suppressClick(),s.x!==n.x||s.y!==n.y)return this.Ue.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(s,n,this.Cr.bearing,{linear:!0})}
4365
+ if(this.reset(),o.suppressClick(),s.x!==n.x||s.y!==n.y)return this.Ue.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(s,n,this.Tr.bearing,{linear:!0})}
4366
4366
  this.jr("boxzoomcancel",t)}keydown(t){this.Dr&&27===t.keyCode&&(this.reset(),this.jr("boxzoomcancel",t))}reset(){this.Dr=!1,this.$r.classList.remove("maplibregl-crosshair"),this.Nr&&(o.remove(this.Nr),this.Nr=null),o.enableDrag(),delete this.Or,delete this.Lr}jr(t,i){return this.Ue.fire(new e.k(t,{originalEvent:i}))}}function qs(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}`)
4367
4367
  const i={}
4368
4368
  for(let s=0;s<t.length;s++)i[t[s].identifier]=e[s]
@@ -4373,7 +4373,7 @@ const s=qs(i,e)
4373
4373
  for(const n in this.touches){const t=s[n];(!t||t.dist(this.touches[n])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid
4374
4374
  if(this.reset(),t)return t}}}class Us{constructor(t){this.singleTap=new Bs(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 s=this.singleTap.touchend(t,e,i)
4375
4375
  if(s){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(s)<30
4376
- if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}}}class Vs{constructor(t){this.Cr=new js(t),this.Rr=new Us({numTouches:1,numTaps:2}),this.qr=new Us({numTouches:2,numTaps:1}),this.reset()}reset(){this.Dr=!1,this.Rr.reset(),this.qr.reset()}touchstart(t,e,i){this.Rr.touchstart(t,e,i),this.qr.touchstart(t,e,i)}touchmove(t,e,i){this.Rr.touchmove(t,e,i),this.qr.touchmove(t,e,i)}touchend(t,e,i){const s=this.Rr.touchend(t,e,i),n=this.qr.touchend(t,e,i),r=this.Cr
4376
+ if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}}}class Vs{constructor(t){this.Tr=new js(t),this.Rr=new Us({numTouches:1,numTaps:2}),this.qr=new Us({numTouches:2,numTaps:1}),this.reset()}reset(){this.Dr=!1,this.Rr.reset(),this.qr.reset()}touchstart(t,e,i){this.Rr.touchstart(t,e,i),this.qr.touchstart(t,e,i)}touchmove(t,e,i){this.Rr.touchmove(t,e,i),this.qr.touchmove(t,e,i)}touchend(t,e,i){const s=this.Rr.touchend(t,e,i),n=this.qr.touchend(t,e,i),r=this.Tr
4377
4377
  return s?(this.Dr=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:r.zoom+1,around:r.unproject(s)},{originalEvent:t})}):n?(this.Dr=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:r.zoom-1,around:r.unproject(n)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this.Fr=!0}disable(){this.Fr=!1,this.reset()}isEnabled(){return this.Fr}isActive(){return this.Dr}}class Gs{constructor(t){this.Fr=!!t.enable,this.Br=t.moveStateManager,this.zr=t.clickTolerance||1,this.Ur=t.move,this.Vr=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this.Dr=!1,this.Gr=!1,delete this.Zr,this.Br.endMove(t)}Wr(...t){const e=this.Ur(...t)
4378
4378
  if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this.Dr=!0,e}dragStart(t,e){this.isEnabled()&&!this.Zr&&this.Br.isValidStartEvent(t)&&(this.Br.startMove(t),this.Zr=e.length?e[0]:e,this.Vr&&this.Zr&&(this.Dr=!0))}dragMove(t,e){if(!this.isEnabled())return
4379
4379
  const i=this.Zr
@@ -4412,7 +4412,7 @@ if(!s&&!n)return
4412
4412
  if(!s||!n)return void 0===this._o&&(this._o=i),i-this._o<100&&void 0
4413
4413
  const r=t.y>0==e.y>0
4414
4414
  return on(t)&&on(e)&&r}}const hn={panStep:100,bearingStep:15,pitchStep:10}
4415
- class ln{constructor(t){this.Cr=new js(t)
4415
+ class ln{constructor(t){this.Tr=new js(t)
4416
4416
  const e=hn
4417
4417
  this.vo=e.panStep,this.wo=e.bearingStep,this.xo=e.pitchStep,this.Mo=!1}reset(){this.Dr=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return
4418
4418
  let e=0,i=0,s=0,n=0,r=0
@@ -4428,19 +4428,19 @@ case 38:t.shiftKey?s=1:(t.preventDefault(),r=-1)
4428
4428
  break
4429
4429
  case 40:t.shiftKey?s=-1:(t.preventDefault(),r=1)
4430
4430
  break
4431
- default:return}return this.Mo&&(i=0,s=0),{cameraAnimation:o=>{const a=this.Cr
4431
+ default:return}return this.Mo&&(i=0,s=0),{cameraAnimation:o=>{const a=this.Tr
4432
4432
  o.easeTo({duration:300,easeId:"keyboardHandler",easing:cn,zoom:e?Math.round(a.zoom)+e*(t.shiftKey?2:1):a.zoom,bearing:a.bearing+i*this.wo,pitch:a.pitch+s*this.xo,offset:[-n*this.vo,-r*this.vo],center:a.center},{originalEvent:t})}}}enable(){this.Fr=!0}disable(){this.Fr=!1,this.reset()}isEnabled(){return this.Fr}isActive(){return this.Dr}disableRotation(){this.Mo=!0}enableRotation(){this.Mo=!1}}function cn(t){return t*(2-t)}const un=4.000244140625
4433
- class fn{constructor(t,e){this.zo=t=>{this.So="wheel",this.ko-=this.Ao,this.Dr||this.ro(t)},this.Ue=t,this.Cr=new js(t),this.Eo=e,this.ko=0,this.Io=.01,this.To=.0022222222222222222}setZoomRate(t){this.Io=t}setWheelZoomRate(t){this.To=t}isEnabled(){return!!this.Fr}isActive(){return!!this.Dr||void 0!==this.Co}isZooming(){return!!this.Po}enable(t){this.isEnabled()||(this.Fr=!0,this.oo=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this.Fr=!1)}io(t){return!!this.Ue.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this.Ue.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return
4433
+ class fn{constructor(t,e){this.zo=t=>{this.So="wheel",this.ko-=this.Ao,this.Dr||this.ro(t)},this.Ue=t,this.Tr=new js(t),this.Eo=e,this.ko=0,this.Io=.01,this.Co=.0022222222222222222}setZoomRate(t){this.Io=t}setWheelZoomRate(t){this.Co=t}isEnabled(){return!!this.Fr}isActive(){return!!this.Dr||void 0!==this.To}isZooming(){return!!this.Po}enable(t){this.isEnabled()||(this.Fr=!0,this.oo=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this.Fr=!1)}io(t){return!!this.Ue.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this.Ue.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return
4434
4434
  if(this.io(t))return void this.Ue.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t)
4435
4435
  let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY
4436
4436
  const i=r.now(),s=i-(this.$o||0)
4437
4437
  this.$o=i,0!==e&&e%un==0?this.So="wheel":0!==e&&Math.abs(e)<4?this.So="trackpad":s>400?(this.So=null,this.Ao=e,this.Fo=setTimeout(this.zo,40,t)):this.So||(this.So=Math.abs(s*e)<200?"trackpad":"wheel",this.Fo&&(clearTimeout(this.Fo),this.Fo=null,e+=this.Ao)),t.shiftKey&&e&&(e/=4),this.So&&(this.Do=t,this.ko-=e,this.Dr||this.ro(t)),t.preventDefault()}ro(t){if(!this.ko)return
4438
- this.Oo&&(this.Oo=null),this.Dr=!0,this.isZooming()||(this.Po=!0),this.Co&&(clearTimeout(this.Co),delete this.Co)
4439
- const i=o.mousePos(this.Ue.getCanvas(),t),s=this.Cr
4438
+ this.Oo&&(this.Oo=null),this.Dr=!0,this.isZooming()||(this.Po=!0),this.To&&(clearTimeout(this.To),delete this.To)
4439
+ const i=o.mousePos(this.Ue.getCanvas(),t),s=this.Tr
4440
4440
  this.Lo=i.y>s.transform.height/2-s.transform.getHorizon()?e.N.convert(this.oo?s.center:s.unproject(i)):e.N.convert(s.center),this.No=s.transform.locationPoint(this.Lo),this.Oo||(this.Oo=!0,this.Eo())}renderFrame(){if(!this.Oo)return
4441
4441
  if(this.Oo=null,!this.isActive())return
4442
- const t=this.Cr.transform
4443
- if(0!==this.ko){const e="wheel"===this.So&&Math.abs(this.ko)>un?this.To:this.Io
4442
+ const t=this.Tr.transform
4443
+ if(0!==this.ko){const e="wheel"===this.So&&Math.abs(this.ko)>un?this.Co:this.Io
4444
4444
  let i=2/(1+Math.exp(-Math.abs(this.ko*e)))
4445
4445
  this.ko<0&&0!==i&&(i=1/i)
4446
4446
  const s="number"==typeof this.jo?t.zoomScale(this.jo):t.scale
@@ -4449,9 +4449,9 @@ let o,a=!1
4449
4449
  const h=r.now()-this.$o
4450
4450
  if("wheel"===this.So&&s&&n&&h){const t=Math.min(h/200,1),r=n(t)
4451
4451
  o=e.y.number(s,i,r),t<1?this.Oo||(this.Oo=!0):a=!0}else o=i,a=!0
4452
- return this.Dr=!0,a&&(this.Dr=!1,this.Co=setTimeout(()=>{this.Po=!1,this.Eo(),delete this.jo,delete this.Co},200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-t.zoom,around:this.No,originalEvent:this.Do}}Bo(t){let i=e.b9
4452
+ return this.Dr=!0,a&&(this.Dr=!1,this.To=setTimeout(()=>{this.Po=!1,this.Eo(),delete this.jo,delete this.To},200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-t.zoom,around:this.No,originalEvent:this.Do}}Bo(t){let i=e.b9
4453
4453
  if(this.Uo){const t=this.Uo,s=(r.now()-t.start)/t.duration,n=t.easing(s+.01)-t.easing(s),o=.27/Math.sqrt(n*n+1e-4)*.01,a=Math.sqrt(.0729-o*o)
4454
- i=e.b8(o,a,.25,1)}return this.Uo={start:r.now(),duration:t,easing:i},i}reset(){this.Dr=!1,this.Po=!1,delete this.jo,this.Co&&(clearTimeout(this.Co),delete this.Co)}}class pn{constructor(t,e){this.Vo=t,this.Go=e}enable(){this.Vo.enable(),this.Go.enable()}disable(){this.Vo.disable(),this.Go.disable()}isEnabled(){return this.Vo.isEnabled()&&this.Go.isEnabled()}isActive(){return this.Vo.isActive()||this.Go.isActive()}}class dn{constructor(t){this.Cr=new js(t),this.reset()}reset(){this.Dr=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this.Cr.zoom+(t.shiftKey?-1:1),around:this.Cr.unproject(e)},{originalEvent:t})}}}enable(){this.Fr=!0}disable(){this.Fr=!1,this.reset()}isEnabled(){return this.Fr}isActive(){return this.Dr}}class mn{constructor(){this.Zo=new Us({numTouches:1,numTaps:1}),this.reset()}reset(){this.Dr=!1,delete this.Wo,delete this.Ho,delete this.Xo,delete this.Jo,this.Zo.reset()}touchstart(t,e,i){if(!this.Wo)if(this.Xo){const s=e[0],n=t.timeStamp-this.Xo<500,r=this.Jo.dist(s)<30
4454
+ i=e.b8(o,a,.25,1)}return this.Uo={start:r.now(),duration:t,easing:i},i}reset(){this.Dr=!1,this.Po=!1,delete this.jo,this.To&&(clearTimeout(this.To),delete this.To)}}class pn{constructor(t,e){this.Vo=t,this.Go=e}enable(){this.Vo.enable(),this.Go.enable()}disable(){this.Vo.disable(),this.Go.disable()}isEnabled(){return this.Vo.isEnabled()&&this.Go.isEnabled()}isActive(){return this.Vo.isActive()||this.Go.isActive()}}class dn{constructor(t){this.Tr=new js(t),this.reset()}reset(){this.Dr=!1}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.Fr=!0}disable(){this.Fr=!1,this.reset()}isEnabled(){return this.Fr}isActive(){return this.Dr}}class mn{constructor(){this.Zo=new Us({numTouches:1,numTaps:1}),this.reset()}reset(){this.Dr=!1,delete this.Wo,delete this.Ho,delete this.Xo,delete this.Jo,this.Zo.reset()}touchstart(t,e,i){if(!this.Wo)if(this.Xo){const s=e[0],n=t.timeStamp-this.Xo<500,r=this.Jo.dist(s)<30
4455
4455
  n&&r?i.length>0&&(this.Wo=s,this.Ho=i[0].identifier):this.reset()}else this.Zo.touchstart(t,e,i)}touchmove(t,e,i){if(this.Xo){if(this.Wo){if(i[0].identifier!==this.Ho)return
4456
4456
  const s=e[0],n=s.y-this.Wo.y
4457
4457
  return this.Wo=s,t.preventDefault(),this.Dr=!0,{zoomDelta:n/128}}}else this.Zo.touchmove(t,e,i)}touchend(t,e,i){if(this.Xo)this.Wo&&0===i.length&&this.reset()
@@ -4474,7 +4474,7 @@ this.da(r,p,o)?f.reset():f[e||t.type]&&(a=f[e||t.type](t,l,h),this.mergeHandlerR
4474
4474
  for(const o in this.ma)r[o]||(c[o]=i)
4475
4475
  this.ma=r,(Object.keys(c).length||xn(s))&&(this._a.push([s,n,c]),this.Eo()),(Object.keys(r).length||xn(s))&&this.Ue.ga(!0),this.ua=!1
4476
4476
  const{cameraAnimation:u}=s
4477
- u&&(this.ya.clear(),this.va({},{},!0),this._a=[],u(this.Ue))},this.Ue=t,this.Pr=this.Ue.getCanvasContainer(),this.pa=[],this.wa={},this._a=[],this.ya=new Cs(t),this.xa=e.bearingSnap,this.ma={},this.Ma={},this.za(e)
4477
+ u&&(this.ya.clear(),this.va({},{},!0),this._a=[],u(this.Ue))},this.Ue=t,this.Pr=this.Ue.getCanvasContainer(),this.pa=[],this.wa={},this._a=[],this.ya=new Ts(t),this.xa=e.bearingSnap,this.ma={},this.Ma={},this.za(e)
4478
4478
  const i=this.Pr
4479
4479
  this.dt=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]]
4480
4480
  for(const[s,n,r]of this.dt)o.addEventListener(s,n,s===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(const[t,e,i]of this.dt)o.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}za(t){const e=this.Ue,i=e.getCanvasContainer()
@@ -4514,7 +4514,7 @@ if(!(xn(t)||r&&this.Ea))return this.va(e,i,!0)
4514
4514
  let{panDelta:o,zoomDelta:a,bearingDelta:h,pitchDelta:l,around:c,pinchAround:u}=t
4515
4515
  void 0!==u&&(c=u),s.ga(!0),c=c||s.transform.centerPoint
4516
4516
  const f=n.pointLocation(o?c.sub(o):c)
4517
- h&&(n.bearing+=h),l&&(n.pitch+=l),a&&(n.zoom+=a),r?this.Ea||!e.drag&&!e.zoom?e.drag&&this.Ea?n.center=n.pointLocation(n.centerPoint.sub(o)):n.setLocationAtPoint(f,c):(this.Ea=!0,this.Ue.Ia=!0,n.setLocationAtPoint(f,c)):n.setLocationAtPoint(f,c),s.Ta(n),this.Ue.Ca(),t.noInertia||this.ya.record(t),this.va(e,i,!0)}va(t,i,s){const n=wn(this.Ma),o=wn(t),a={}
4517
+ h&&(n.bearing+=h),l&&(n.pitch+=l),a&&(n.zoom+=a),r?this.Ea||!e.drag&&!e.zoom?e.drag&&this.Ea?n.center=n.pointLocation(n.centerPoint.sub(o)):n.setLocationAtPoint(f,c):(this.Ea=!0,this.Ue.Ia=!0,n.setLocationAtPoint(f,c)):n.setLocationAtPoint(f,c),s.Ca(n),this.Ue.Ta(),t.noInertia||this.ya.record(t),this.va(e,i,!0)}va(t,i,s){const n=wn(this.Ma),o=wn(t),a={}
4518
4518
  for(const e in t){const{originalEvent:i}=t[e]
4519
4519
  this.Ma[e]||(a[`${e}start`]=i),this.Ma[e]=t[e]}!n&&o&&this.jr("movestart",o.originalEvent)
4520
4520
  for(const e in a)this.jr(e,a[e])
@@ -4527,10 +4527,10 @@ this.wa[t].isActive()||(delete this.Ma[e],l=i[t]||s,h[`${e}end`]=l)}for(const e
4527
4527
  const c=wn(this.Ma),u=(n||o)&&!c
4528
4528
  if(u&&this.Ea){this.Ue.Ia=!1,this.Ea=!1
4529
4529
  const t=this.Ue.Aa()
4530
- t.recalculateZoom(this.Ue.terrain),this.Ue.Ta(t)}if(s&&u){this.ua=!0
4530
+ t.recalculateZoom(this.Ue.terrain),this.Ue.Ca(t)}if(s&&u){this.ua=!0
4531
4531
  const t=this.ya.wr(this.Ue.dragPan.Qo),i=t=>0!==t&&-this.xa<t&&t<this.xa
4532
4532
  !t||!t.essential&&r.prefersReducedMotion?(this.Ue.fire(new e.k("moveend",{originalEvent:l})),i(this.Ue.getBearing())&&this.Ue.resetNorth()):(i(t.bearing||this.Ue.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this.Ue.easeTo(t,{originalEvent:l})),this.ua=!1}}jr(t,i){this.Ue.fire(new e.k(t,i?{originalEvent:i}:{}))}Pa(){return this.Ue.triggerRepaint(),this.Ue.$a.add(t=>{delete this.Oo,this.handleEvent(new bn("renderFrame",{timeStamp:t})),this.Sa()})}Eo(){void 0===this.Oo&&(this.Oo=this.Pa())}}class zn extends e.E{constructor(t,e){super(),this.Fa=()=>{const t=Math.min((r.now()-this.Da)/this.Oa.duration,1)
4533
- this.La(this.Oa.easing(t)),t<1&&this.Na?this.Na=this.ja(this.Fa):this.stop()},this.Ra=!1,this.Po=!1,this.transform=t,this.xa=e.bearingSnap,this.on("moveend",()=>{delete this.Tr})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,i,s){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),s)}panTo(t,i,s){return this.easeTo(e.e({center:t},i),s)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,s){return this.easeTo(e.e({zoom:t},i),s)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),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,s){return this.easeTo(e.e({bearing:t},i),s)}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,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this.xa?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=Z.convert(t).adjustAntiMeridian()
4533
+ this.La(this.Oa.easing(t)),t<1&&this.Na?this.Na=this.ja(this.Fa):this.stop()},this.Ra=!1,this.Po=!1,this.transform=t,this.xa=e.bearingSnap,this.on("moveend",()=>{delete this.Cr})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,i,s){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),s)}panTo(t,i,s){return this.easeTo(e.e({center:t},i),s)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,s){return this.easeTo(e.e({zoom:t},i),s)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),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,s){return this.easeTo(e.e({bearing:t},i),s)}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,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this.xa?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=Z.convert(t).adjustAntiMeridian()
4534
4534
  const i=e&&e.bearing||0
4535
4535
  return this.qa(t.getNorthWest(),t.getSouthEast(),i,e)}qa(t,i,s,n){const r={top:0,bottom:0,right:0,left:0}
4536
4536
  if("number"==typeof(n=e.e({padding:r,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const t=n.padding
@@ -4541,7 +4541,7 @@ const M=Math.min(o.scaleZoom(o.scale*Math.min(b,x)),n.maxZoom),z=e.P.convert(n.o
4541
4541
  return{center:o.unproject(l.add(u).div(2).sub(k)),zoom:M,bearing:s}}fitBounds(t,e,i){return this.Ba(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,s,n,r){return this.Ba(this.qa(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(i)),s,n),n,r)}Ba(t,i,s){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,s):this.flyTo(i,s)):this}jumpTo(t,i){this.stop()
4542
4542
  const s=this.Aa()
4543
4543
  let n=!1,r=!1,o=!1
4544
- return"zoom"in t&&s.zoom!==+t.zoom&&(n=!0,s.zoom=+t.zoom),void 0!==t.center&&(s.center=e.N.convert(t.center)),"bearing"in t&&s.bearing!==+t.bearing&&(r=!0,s.bearing=+t.bearing),"pitch"in t&&s.pitch!==+t.pitch&&(o=!0,s.pitch=+t.pitch),null==t.padding||s.isPaddingEqual(t.padding)||(s.padding=t.padding),this.Ta(s),this.fire(new e.k("movestart",i)).fire(new e.k("move",i)),n&&this.fire(new e.k("zoomstart",i)).fire(new e.k("zoom",i)).fire(new e.k("zoomend",i)),r&&this.fire(new e.k("rotatestart",i)).fire(new e.k("rotate",i)).fire(new e.k("rotateend",i)),o&&this.fire(new e.k("pitchstart",i)).fire(new e.k("pitch",i)).fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}calculateCameraOptionsFromTo(t,i,s,n=0){const r=e.Z.fromLngLat(t,i),o=e.Z.fromLngLat(s,n),a=o.x-r.x,h=o.y-r.y,l=o.z-r.z,c=Math.hypot(a,h,l)
4544
+ return"zoom"in t&&s.zoom!==+t.zoom&&(n=!0,s.zoom=+t.zoom),void 0!==t.center&&(s.center=e.N.convert(t.center)),"bearing"in t&&s.bearing!==+t.bearing&&(r=!0,s.bearing=+t.bearing),"pitch"in t&&s.pitch!==+t.pitch&&(o=!0,s.pitch=+t.pitch),null==t.padding||s.isPaddingEqual(t.padding)||(s.padding=t.padding),this.Ca(s),this.fire(new e.k("movestart",i)).fire(new e.k("move",i)),n&&this.fire(new e.k("zoomstart",i)).fire(new e.k("zoom",i)).fire(new e.k("zoomend",i)),r&&this.fire(new e.k("rotatestart",i)).fire(new e.k("rotate",i)).fire(new e.k("rotateend",i)),o&&this.fire(new e.k("pitchstart",i)).fire(new e.k("pitch",i)).fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}calculateCameraOptionsFromTo(t,i,s,n=0){const r=e.Z.fromLngLat(t,i),o=e.Z.fromLngLat(s,n),a=o.x-r.x,h=o.y-r.y,l=o.z-r.z,c=Math.hypot(a,h,l)
4545
4545
  if(0===c)throw new Error("Can't calculate camera options with same From and To")
4546
4546
  const u=Math.hypot(a,h),f=this.transform.scaleZoom(this.transform.cameraToCenterDistance/c/this.transform.tileSize),p=180*Math.atan2(a,-h)/Math.PI
4547
4547
  let d=180*Math.acos(u/c)/Math.PI
@@ -4557,12 +4557,12 @@ t.around&&(b=e.N.convert(t.around),x=n.locationPoint(b))
4557
4557
  const M={moving:this.Ra,zooming:this.Po,rotating:this.Ga,pitching:this.Za}
4558
4558
  return this.Po=this.Po||g!==o,this.Ga=this.Ga||a!==c,this.Za=this.Za||u!==h,this.Wa=!n.isPaddingEqual(f),this.Ha=t.easeId,this.Xa(i,t.noMoveStart,M),this.terrain&&this.Ja(_),this.Ka(s=>{if(this.Po&&(n.zoom=e.y.number(o,g,s)),this.Ga&&(n.bearing=e.y.number(a,c,s)),this.Za&&(n.pitch=e.y.number(h,u,s)),this.Wa&&(n.interpolatePadding(l,f,s),d=n.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this.Ya(s),b)n.setLocationAtPoint(b,x)
4559
4559
  else{const t=n.zoomScale(n.zoom-o),e=g>o?Math.min(2,w):Math.max(.5,w),i=Math.pow(e,1-s),r=n.unproject(y.add(v.mult(s*i)).mult(t))
4560
- n.setLocationAtPoint(n.renderWorldCopies?r.wrap():r,d)}this.Ta(n),this.Qa(i)},e=>{this.terrain&&t.freezeElevation&&this.th(),this.eh(i,e)},t),this}Xa(t,i,s={}){this.Ra=!0,i||s.moving||this.fire(new e.k("movestart",t)),this.Po&&!s.zooming&&this.fire(new e.k("zoomstart",t)),this.Ga&&!s.rotating&&this.fire(new e.k("rotatestart",t)),this.Za&&!s.pitching&&this.fire(new e.k("pitchstart",t))}Ja(t){this.ih=t,this.sh=this.transform.elevation,this.nh=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this.Ia=!0}Ya(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.ih,this.transform.tileZoom)
4560
+ n.setLocationAtPoint(n.renderWorldCopies?r.wrap():r,d)}this.Ca(n),this.Qa(i)},e=>{this.terrain&&t.freezeElevation&&this.th(),this.eh(i,e)},t),this}Xa(t,i,s={}){this.Ra=!0,i||s.moving||this.fire(new e.k("movestart",t)),this.Po&&!s.zooming&&this.fire(new e.k("zoomstart",t)),this.Ga&&!s.rotating&&this.fire(new e.k("rotatestart",t)),this.Za&&!s.pitching&&this.fire(new e.k("pitchstart",t))}Ja(t){this.ih=t,this.sh=this.transform.elevation,this.nh=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this.Ia=!0}Ya(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.ih,this.transform.tileZoom)
4561
4561
  const i=this.terrain.getElevationForLngLatZoom(this.ih,this.transform.tileZoom)
4562
4562
  if(t<1&&i!==this.nh){const e=this.nh-this.sh
4563
- this.sh+=t*(e-(i-(e*t+this.sh))/(1-t)),this.nh=i}this.transform.elevation=e.y.number(this.sh,this.nh,t)}th(){this.Ia=!1,this.transform.recalculateZoom(this.terrain)}Aa(){return this.transformCameraUpdate||this.terrain?(this.Tr||(this.Tr=this.transform.clone()),this.Tr):this.transform}rh(t){const e=t.getCameraPosition(),i=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom)
4563
+ this.sh+=t*(e-(i-(e*t+this.sh))/(1-t)),this.nh=i}this.transform.elevation=e.y.number(this.sh,this.nh,t)}th(){this.Ia=!1,this.transform.recalculateZoom(this.terrain)}Aa(){return this.transformCameraUpdate||this.terrain?(this.Cr||(this.Cr=this.transform.clone()),this.Cr):this.transform}rh(t){const e=t.getCameraPosition(),i=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom)
4564
4564
  if(e.altitude<i){const s=this.calculateCameraOptionsFromTo(e.lngLat,i,t.center,t.elevation)
4565
- return{pitch:s.pitch,zoom:s.zoom}}return{}}Ta(t){const e=[]
4565
+ return{pitch:s.pitch,zoom:s.zoom}}return{}}Ca(t){const e=[]
4566
4566
  if(this.terrain&&e.push(t=>this.rh(t)),this.transformCameraUpdate&&e.push(t=>this.transformCameraUpdate(t)),!e.length)return
4567
4567
  const i=t.clone()
4568
4568
  for(const s of e){const t=i.clone(),{center:e,zoom:n,pitch:r,bearing:o,elevation:a}=s(t)
@@ -4583,14 +4583,14 @@ if("minZoom"in t){const i=e.ac(Math.min(t.minZoom,o,g),n.minZoom,n.maxZoom),s=x/
4583
4583
  b=Math.sqrt(s/z*2)}const S=b*b
4584
4584
  function k(t){const e=(M*M-x*x+(t?-1:1)*S*S*z*z)/(2*(t?M:x)*S*z)
4585
4585
  return Math.log(Math.sqrt(e*e+1)-e)}function A(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}const I=k(!1)
4586
- let T=function(t){return E(I)/E(I+b*t)},C=function(t){return x*((E(I)*(A(e=I+b*t)/E(e))-A(I))/S)/z
4586
+ let C=function(t){return E(I)/E(I+b*t)},T=function(t){return x*((E(I)*(A(e=I+b*t)/E(e))-A(I))/S)/z
4587
4587
  var e},P=(k(!0)-I)/b
4588
4588
  if(Math.abs(z)<1e-6||!isFinite(P)){if(Math.abs(x-M)<1e-6)return this.easeTo(t,i)
4589
4589
  const e=M<x?-1:1
4590
- P=Math.abs(Math.log(M/x))/b,C=()=>0,T=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this.Po=!0,this.Ga=a!==c,this.Za=u!==h,this.Wa=!n.isPaddingEqual(f),this.Xa(i,!1),this.terrain&&this.Ja(_),this.Ka(s=>{const r=s*P,m=1/T(r)
4590
+ P=Math.abs(Math.log(M/x))/b,T=()=>0,C=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this.Po=!0,this.Ga=a!==c,this.Za=u!==h,this.Wa=!n.isPaddingEqual(f),this.Xa(i,!1),this.terrain&&this.Ja(_),this.Ka(s=>{const r=s*P,m=1/C(r)
4591
4591
  n.zoom=1===s?g:o+n.scaleZoom(m),this.Ga&&(n.bearing=e.y.number(a,c,s)),this.Za&&(n.pitch=e.y.number(h,u,s)),this.Wa&&(n.interpolatePadding(l,f,s),d=n.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this.Ya(s)
4592
- const y=1===s?_:n.unproject(v.add(w.mult(C(r))).mult(m))
4593
- n.setLocationAtPoint(n.renderWorldCopies?y.wrap():y,d),this.Ta(n),this.Qa(i)},()=>{this.terrain&&t.freezeElevation&&this.th(),this.eh(i)},t),this}isEasing(){return!!this.Na}stop(){return this.ga()}ga(t,e){var i
4592
+ const y=1===s?_:n.unproject(v.add(w.mult(T(r))).mult(m))
4593
+ n.setLocationAtPoint(n.renderWorldCopies?y.wrap():y,d),this.Ca(n),this.Qa(i)},()=>{this.terrain&&t.freezeElevation&&this.th(),this.eh(i)},t),this}isEasing(){return!!this.Na}stop(){return this.ga()}ga(t,e){var i
4594
4594
  if(this.Na&&(this.oh(this.Na),delete this.Na,delete this.La),this.hh){const t=this.hh
4595
4595
  delete this.hh,t.call(this,e)}return t||null===(i=this.handlers)||void 0===i||i.stop(!1),this}Ka(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this.Da=r.now(),this.Oa=i,this.La=t,this.hh=e,this.Na=this.ja(this.Fa))}Ua(t,i){t=e.b3(t,-180,180)
4596
4596
  const s=Math.abs(t-i)
@@ -4618,7 +4618,7 @@ const e=this.Ah=this.zh
4618
4618
  this.zh=[]
4619
4619
  for(const i of e)if(!i.cancelled&&(i.callback(t),this.kh))break
4620
4620
  this.kh=!1,this.Ah=!1}clear(){this.Ah&&(this.kh=!0),this.zh=[]}}var In=e.Y([{name:"a_pos3d",type:"Int16",components:3}])
4621
- class Tn extends e.E{constructor(t){super(),this.sourceCache=t,this.Ui={},this.Eh=[],this.Ih={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this.Eh=[]
4621
+ class Cn extends e.E{constructor(t){super(),this.sourceCache=t,this.Ui={},this.Eh=[],this.Ih={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this.Eh=[]
4622
4622
  const s={}
4623
4623
  for(const n of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i}))s[n.key]=!0,this.Eh.push(n.key),this.Ui[n.key]||(n.posMatrix=new Float64Array(16),e.aP(n.posMatrix,0,e.X,0,e.X,0,1),this.Ui[n.key]=new ht(n,this.tileSize))
4624
4624
  for(const e in this.Ui)s[e]||delete this.Ui[e]}freeRtt(t){for(const e in this.Ui){const i=this.Ui[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this.Eh.map(t=>this.getTileByID(t))}getTileByID(t){return this.Ui[t]}getTerrainCoords(t){const i={}
@@ -4636,7 +4636,7 @@ if(s>i.maxzoom&&(s=i.maxzoom),s<i.minzoom)return null
4636
4636
  this.Ih[t.key]||(this.Ih[t.key]=t.scaledTo(s).key)
4637
4637
  let n=this.sourceCache.getTileByID(this.Ih[t.key])
4638
4638
  if((!n||!n.dem)&&e)for(;s>=i.minzoom&&(!n||!n.dem);)n=this.sourceCache.getTileByID(t.scaledTo(s--).key)
4639
- return n}tilesAfterTime(t=Date.now()){return Object.values(this.Ui).filter(e=>e.timeAdded>=t)}}class Cn{constructor(t,e,i){this.painter=t,this.sourceCache=new Tn(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this.Th={},this.coordsIndex=[],this.Ch=1024}getDEMElevation(t,i,s,n=e.X){var r
4639
+ return n}tilesAfterTime(t=Date.now()){return Object.values(this.Ui).filter(e=>e.timeAdded>=t)}}class Tn{constructor(t,e,i){this.painter=t,this.sourceCache=new Cn(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this.Ch={},this.coordsIndex=[],this.Th=1024}getDEMElevation(t,i,s,n=e.X){var r
4640
4640
  if(!(i>=0&&i<n&&s>=0&&s<n))return 0
4641
4641
  const o=this.getTerrainData(t),a=null===(r=o.tile)||void 0===r?void 0:r.dem
4642
4642
  if(!a)return 0
@@ -4648,22 +4648,22 @@ return this.getElevation(s,n%e.X,r%e.X,e.X)}getElevation(t,i,s,n=e.X){return thi
4648
4648
  this.Fh=new b(t,i,t.gl.RGBA,{premultiply:!1}),this.Dh=[0,0,0,0],this.$h=new b(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this.$h.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this.Oh=e.an([])}const i=this.sourceCache.getSourceTile(t,!0)
4649
4649
  if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const t=this.painter.context
4650
4650
  i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new b(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const s=i&&i+i.tileID.key+t.key
4651
- if(s&&!this.Th[s]){const s=this.sourceCache.sourceCache.Bi.maxzoom
4651
+ if(s&&!this.Ch[s]){const s=this.sourceCache.sourceCache.Bi.maxzoom
4652
4652
  let n=t.canonical.z-i.tileID.canonical.z
4653
4653
  t.overscaledZ>t.canonical.z&&(t.canonical.z>=s?n=t.canonical.z-s:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"))
4654
4654
  const r=t.canonical.x-(t.canonical.x>>n<<n),o=t.canonical.y-(t.canonical.y>>n<<n),a=e.bc(new Float64Array(16),[1/(e.X<<n),1/(e.X<<n),0])
4655
- e.J(a,a,[r*e.X,o*e.X,0]),this.Th[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:s?this.Th[t.key].matrix:this.Oh,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this.Dh,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this.$h).texture,depthTexture:(this.Lh||this.Fh).texture,tile:i}}getFramebuffer(t){const e=this.painter,i=e.width/devicePixelRatio,s=e.height/devicePixelRatio
4655
+ e.J(a,a,[r*e.X,o*e.X,0]),this.Ch[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:s?this.Ch[t.key].matrix:this.Oh,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this.Dh,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this.$h).texture,depthTexture:(this.Lh||this.Fh).texture,tile:i}}getFramebuffer(t){const e=this.painter,i=e.width/devicePixelRatio,s=e.height/devicePixelRatio
4656
4656
  return!this.Nh||this.Nh.width===i&&this.Nh.height===s||(this.Nh.destroy(),this.jh.destroy(),this.Lh.destroy(),delete this.Nh,delete this.Lh,delete this.jh),this.jh||(this.jh=new b(e.context,{width:i,height:s,data:null},e.context.gl.RGBA,{premultiply:!1}),this.jh.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this.Lh||(this.Lh=new b(e.context,{width:i,height:s,data:null},e.context.gl.RGBA,{premultiply:!1}),this.Lh.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this.Nh||(this.Nh=e.context.createFramebuffer(i,s,!0,!1),this.Nh.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,i,s))),this.Nh.colorAttachment.set("coords"===t?this.jh.texture:this.Lh.texture),this.Nh}getCoordsTexture(){const t=this.painter.context
4657
4657
  if(this.Rh)return this.Rh
4658
- const i=new Uint8Array(this.Ch*this.Ch*4)
4659
- for(let e=0,r=0;e<this.Ch;e++)for(let t=0;t<this.Ch;t++,r+=4)i[r+0]=255&t,i[r+1]=255&e,i[r+2]=t>>8<<4|e>>8,i[r+3]=0
4660
- const s=new e.R({width:this.Ch,height:this.Ch},new Uint8Array(i.buffer)),n=new b(t,s,t.gl.RGBA,{premultiply:!1})
4658
+ const i=new Uint8Array(this.Th*this.Th*4)
4659
+ for(let e=0,r=0;e<this.Th;e++)for(let t=0;t<this.Th;t++,r+=4)i[r+0]=255&t,i[r+1]=255&e,i[r+2]=t>>8<<4|e>>8,i[r+3]=0
4660
+ const s=new e.R({width:this.Th,height:this.Th},new Uint8Array(i.buffer)),n=new b(t,s,t.gl.RGBA,{premultiply:!1})
4661
4661
  return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this.Rh=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0)
4662
4662
  const i=new Uint8Array(4),s=this.painter.context,n=s.gl,r=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),a=Math.round(this.painter.height/devicePixelRatio)
4663
4663
  s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(r,a-o-1,1,1,n.RGBA,n.UNSIGNED_BYTE,i),s.bindFramebuffer.set(null)
4664
4664
  const h=i[0]+(i[2]>>4<<8),l=i[1]+((15&i[2])<<8),c=this.coordsIndex[255-i[3]],u=c&&this.sourceCache.getTileByID(c)
4665
4665
  if(!u)return null
4666
- const f=this.Ch,p=(1<<u.tileID.canonical.z)*f
4666
+ const f=this.Th,p=(1<<u.tileID.canonical.z)*f
4667
4667
  return new e.Z((u.tileID.canonical.x*f+h)/p+u.tileID.wrap,(u.tileID.canonical.y*f+l)/p,this.getElevation(u.tileID,h,l,f))}depthAtPoint(t){const e=new Uint8Array(4),i=this.painter.context,s=i.gl
4668
4668
  return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),s.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,s.RGBA,s.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this.qh)return this.qh
4669
4669
  const t=this.painter.context,i=new e.bd,s=new e.aY,n=this.meshSize,r=e.X/n,o=n*n
@@ -4722,14 +4722,14 @@ function Vn(t,e,i){const s=t.classList
4722
4722
  for(const n in Un)s.remove(`maplibregl-${i}-anchor-${n}`)
4723
4723
  s.add(`maplibregl-${i}-anchor-${e}`)}class Gn extends e.E{constructor(t){if(super(),this.sl=t=>{const e=t.code,i=t.charCode||t.keyCode
4724
4724
  "Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this.nl=t=>{const e=t.originalEvent.target,i=this.rl
4725
- this.ol&&(e===i||i.contains(e))&&this.togglePopup()},this.Ca=t=>{var e
4725
+ this.ol&&(e===i||i.contains(e))&&this.togglePopup()},this.Ta=t=>{var e
4726
4726
  if(!this.Ue)return
4727
- const i=this.Ue.loaded()&&!this.Ue.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!i)&&this.Ue.once("render",this.Ca),this.hl=this.Ue.transform.renderWorldCopies?Bn(this.hl,this.ll,this.Ue.transform):null===(e=this.hl)||void 0===e?void 0:e.wrap(),this.ll=this.Ce=this.Ue.project(this.hl).tt(this.cl),this.Ue.terrain&&(this.ll=this.Ue.transform.locationPoint(this.hl).tt(this.cl))
4727
+ const i=this.Ue.loaded()&&!this.Ue.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!i)&&this.Ue.once("render",this.Ta),this.hl=this.Ue.transform.renderWorldCopies?Bn(this.hl,this.ll,this.Ue.transform):null===(e=this.hl)||void 0===e?void 0:e.wrap(),this.ll=this.Te=this.Ue.project(this.hl).tt(this.cl),this.Ue.terrain&&(this.ll=this.Ue.transform.locationPoint(this.hl).tt(this.cl))
4728
4728
  let s=""
4729
4729
  "viewport"===this.ul||"auto"===this.ul?s=`rotateZ(${this.fl}deg)`:"map"===this.ul&&(s=`rotateZ(${this.fl-this.Ue.getBearing()}deg)`)
4730
4730
  let n=""
4731
- "viewport"===this.pl||"auto"===this.pl?n="rotateX(0deg)":"map"===this.pl&&(n=`rotateX(${this.Ue.getPitch()}deg)`),this.dl||t&&"moveend"!==t.type||(this.Ce=this.Ce.round()),o.setTransform(this.rl,`${Un[this.ml]} translate(${this.Ce.x}px, ${this.Ce.y}px) ${n} ${s}`),r.frameAsync(new AbortController).then(()=>{this._l(t&&"moveend"===t.type)}).catch(()=>{})},this.yl=t=>{if(!this.vl){const e=this.zr||this.Ue.zr
4732
- this.vl=t.point.dist(this.wl)>=e}this.vl&&(this.Ce=t.point.sub(this.xl),this.hl=this.Ue.unproject(this.Ce),this.setLngLat(this.hl),this.rl.style.pointerEvents="none","pending"===this.mi&&(this.mi="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this.Ml=()=>{this.rl.style.pointerEvents="auto",this.xl=null,this.wl=null,this.vl=!1,this.Ue.off("mousemove",this.yl),this.Ue.off("touchmove",this.yl),"active"===this.mi&&this.fire(new e.k("dragend")),this.mi="inactive"},this.zl=t=>{this.rl.contains(t.originalEvent.target)&&(t.preventDefault(),this.xl=t.point.sub(this.Ce).add(this.cl),this.wl=t.point,this.mi="pending",this.Ue.on("mousemove",this.yl),this.Ue.on("touchmove",this.yl),this.Ue.once("mouseup",this.Ml),this.Ue.once("touchend",this.Ml))},this.ml=t&&t.anchor||"center",this.Sl=t&&t.color||"#3FB1CE",this.kl=t&&t.scale||1,this.Al=t&&t.draggable||!1,this.zr=t&&t.clickTolerance||0,this.dl=t&&t.subpixelPositioning||!1,this.vl=!1,this.mi="inactive",this.fl=t&&t.rotation||0,this.ul=t&&t.rotationAlignment||"auto",this.pl=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this.ul,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this.rl=t.element,this.cl=e.P.convert(t&&t.offset||[0,0])
4731
+ "viewport"===this.pl||"auto"===this.pl?n="rotateX(0deg)":"map"===this.pl&&(n=`rotateX(${this.Ue.getPitch()}deg)`),this.dl||t&&"moveend"!==t.type||(this.Te=this.Te.round()),o.setTransform(this.rl,`${Un[this.ml]} translate(${this.Te.x}px, ${this.Te.y}px) ${n} ${s}`),r.frameAsync(new AbortController).then(()=>{this._l(t&&"moveend"===t.type)}).catch(()=>{})},this.yl=t=>{if(!this.vl){const e=this.zr||this.Ue.zr
4732
+ this.vl=t.point.dist(this.wl)>=e}this.vl&&(this.Te=t.point.sub(this.xl),this.hl=this.Ue.unproject(this.Te),this.setLngLat(this.hl),this.rl.style.pointerEvents="none","pending"===this.mi&&(this.mi="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this.Ml=()=>{this.rl.style.pointerEvents="auto",this.xl=null,this.wl=null,this.vl=!1,this.Ue.off("mousemove",this.yl),this.Ue.off("touchmove",this.yl),"active"===this.mi&&this.fire(new e.k("dragend")),this.mi="inactive"},this.zl=t=>{this.rl.contains(t.originalEvent.target)&&(t.preventDefault(),this.xl=t.point.sub(this.Te).add(this.cl),this.wl=t.point,this.mi="pending",this.Ue.on("mousemove",this.yl),this.Ue.on("touchmove",this.yl),this.Ue.once("mouseup",this.Ml),this.Ue.once("touchend",this.Ml))},this.ml=t&&t.anchor||"center",this.Sl=t&&t.color||"#3FB1CE",this.kl=t&&t.scale||1,this.Al=t&&t.draggable||!1,this.zr=t&&t.clickTolerance||0,this.dl=t&&t.subpixelPositioning||!1,this.vl=!1,this.mi="inactive",this.fl=t&&t.rotation||0,this.ul=t&&t.rotationAlignment||"auto",this.pl=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this.ul,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this.rl=t.element,this.cl=e.P.convert(t&&t.offset||[0,0])
4733
4733
  else{this.El=!0,this.rl=o.create("div")
4734
4734
  const i=o.createNS("http://www.w3.org/2000/svg","svg"),s=41,n=27
4735
4735
  i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${s}px`),i.setAttributeNS(null,"width",`${n}px`),i.setAttributeNS(null,"viewBox",`0 0 ${n} ${s}`)
@@ -4757,15 +4757,15 @@ const _=o.createNS("http://www.w3.org/2000/svg","circle")
4757
4757
  _.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962")
4758
4758
  const g=o.createNS("http://www.w3.org/2000/svg","circle")
4759
4759
  g.setAttributeNS(null,"fill","#FFFFFF"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962"),m.appendChild(_),m.appendChild(g),a.appendChild(h),a.appendChild(c),a.appendChild(f),a.appendChild(d),a.appendChild(m),i.appendChild(a),i.setAttributeNS(null,"height",s*this.kl+"px"),i.setAttributeNS(null,"width",n*this.kl+"px"),this.rl.appendChild(i),this.cl=e.P.convert(t&&t.offset||[0,-14])}if(this.rl.classList.add("maplibregl-marker"),this.rl.addEventListener("dragstart",t=>{t.preventDefault()}),this.rl.addEventListener("mousedown",t=>{t.preventDefault()}),Vn(this.rl,this.ml,"marker"),t&&t.className)for(const e of t.className.split(" "))this.rl.classList.add(e)
4760
- this.ol=null}addTo(t){return this.remove(),this.Ue=t,this.rl.setAttribute("aria-label",t.la("Marker.Title")),t.getCanvasContainer().appendChild(this.rl),t.on("move",this.Ca),t.on("moveend",this.Ca),t.on("terrain",this.Ca),this.setDraggable(this.Al),this.Ca(),this.Ue.on("click",this.nl),this}remove(){return this.Il&&(clearTimeout(this.Il),delete this.Il),this.Ue&&(this.Ue.off("click",this.nl),this.Ue.off("move",this.Ca),this.Ue.off("moveend",this.Ca),this.Ue.off("terrain",this.Ca),this.Ue.off("mousedown",this.zl),this.Ue.off("touchstart",this.zl),this.Ue.off("mouseup",this.Ml),this.Ue.off("touchend",this.Ml),this.Ue.off("mousemove",this.yl),this.Ue.off("touchmove",this.yl),delete this.Ue),o.remove(this.rl),this.ol&&this.ol.remove(),this}getLngLat(){return this.hl}setLngLat(t){return this.hl=e.N.convert(t),this.Ce=null,this.ol&&this.ol.setLngLat(this.hl),this.Ca(),this}getElement(){return this.rl}setPopup(t){if(this.ol&&(this.ol.remove(),this.ol=null,this.rl.removeEventListener("keypress",this.sl),this.Tl||this.rl.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,s=Math.abs(i)/Math.SQRT2
4761
- t.options.offset=this.El?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[s,-1*(e-i+s)],"bottom-right":[-s,-1*(e-i+s)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this.cl}this.ol=t,this.Tl=this.rl.getAttribute("tabindex"),this.Tl||this.rl.setAttribute("tabindex","0"),this.rl.addEventListener("keypress",this.sl)}return this}setSubpixelPositioning(t){return this.dl=t,this}getPopup(){return this.ol}togglePopup(){const t=this.ol
4762
- return this.rl.style.opacity===this.Cl?this:t?(t.isOpen()?t.remove():(t.setLngLat(this.hl),t.addTo(this.Ue)),this):this}_l(t=!1){var i,s
4760
+ this.ol=null}addTo(t){return this.remove(),this.Ue=t,this.rl.setAttribute("aria-label",t.la("Marker.Title")),t.getCanvasContainer().appendChild(this.rl),t.on("move",this.Ta),t.on("moveend",this.Ta),t.on("terrain",this.Ta),this.setDraggable(this.Al),this.Ta(),this.Ue.on("click",this.nl),this}remove(){return this.Il&&(clearTimeout(this.Il),delete this.Il),this.Ue&&(this.Ue.off("click",this.nl),this.Ue.off("move",this.Ta),this.Ue.off("moveend",this.Ta),this.Ue.off("terrain",this.Ta),this.Ue.off("mousedown",this.zl),this.Ue.off("touchstart",this.zl),this.Ue.off("mouseup",this.Ml),this.Ue.off("touchend",this.Ml),this.Ue.off("mousemove",this.yl),this.Ue.off("touchmove",this.yl),delete this.Ue),o.remove(this.rl),this.ol&&this.ol.remove(),this}getLngLat(){return this.hl}setLngLat(t){return this.hl=e.N.convert(t),this.Te=null,this.ol&&this.ol.setLngLat(this.hl),this.Ta(),this}getElement(){return this.rl}setPopup(t){if(this.ol&&(this.ol.remove(),this.ol=null,this.rl.removeEventListener("keypress",this.sl),this.Cl||this.rl.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,s=Math.abs(i)/Math.SQRT2
4761
+ t.options.offset=this.El?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[s,-1*(e-i+s)],"bottom-right":[-s,-1*(e-i+s)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this.cl}this.ol=t,this.Cl=this.rl.getAttribute("tabindex"),this.Cl||this.rl.setAttribute("tabindex","0"),this.rl.addEventListener("keypress",this.sl)}return this}setSubpixelPositioning(t){return this.dl=t,this}getPopup(){return this.ol}togglePopup(){const t=this.ol
4762
+ return this.rl.style.opacity===this.Tl?this:t?(t.isOpen()?t.remove():(t.setLngLat(this.hl),t.addTo(this.Ue)),this):this}_l(t=!1){var i,s
4763
4763
  if(!(null===(i=this.Ue)||void 0===i?void 0:i.terrain))return void(this.rl.style.opacity!==this.Pl&&(this.rl.style.opacity=this.Pl))
4764
4764
  if(t)this.Il=null
4765
4765
  else{if(this.Il)return
4766
- this.Il=setTimeout(()=>{this.Il=null},100)}const n=this.Ue,r=n.terrain.depthAtPoint(this.Ce),o=n.terrain.getElevationForLngLatZoom(this.hl,n.transform.tileZoom)
4766
+ this.Il=setTimeout(()=>{this.Il=null},100)}const n=this.Ue,r=n.terrain.depthAtPoint(this.Te),o=n.terrain.getElevationForLngLatZoom(this.hl,n.transform.tileZoom)
4767
4767
  if(n.transform.lngLatToCameraDepth(this.hl,o)-r<.006)return void(this.rl.style.opacity=this.Pl)
4768
- const a=-this.cl.y/n.transform.lr,h=Math.sin(n.getPitch()*Math.PI/180)*a,l=n.terrain.depthAtPoint(new e.P(this.Ce.x,this.Ce.y-this.cl.y)),c=n.transform.lngLatToCameraDepth(this.hl,o+h)-l>.006;(null===(s=this.ol)||void 0===s?void 0:s.isOpen())&&c&&this.ol.remove(),this.rl.style.opacity=c?this.Cl:this.Pl}getOffset(){return this.cl}setOffset(t){return this.cl=e.P.convert(t),this.Ca(),this}addClassName(t){this.rl.classList.add(t)}removeClassName(t){this.rl.classList.remove(t)}toggleClassName(t){return this.rl.classList.toggle(t)}setDraggable(t){return this.Al=!!t,this.Ue&&(t?(this.Ue.on("mousedown",this.zl),this.Ue.on("touchstart",this.zl)):(this.Ue.off("mousedown",this.zl),this.Ue.off("touchstart",this.zl))),this}isDraggable(){return this.Al}setRotation(t){return this.fl=t||0,this.Ca(),this}getRotation(){return this.fl}setRotationAlignment(t){return this.ul=t||"auto",this.Ca(),this}getRotationAlignment(){return this.ul}setPitchAlignment(t){return this.pl=t&&"auto"!==t?t:this.ul,this.Ca(),this}getPitchAlignment(){return this.pl}setOpacity(t,e){return void 0===t&&void 0===e&&(this.Pl="1",this.Cl="0.2"),void 0!==t&&(this.Pl=t),void 0!==e&&(this.Cl=e),this.Ue&&this._l(!0),this}}const Zn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0}
4768
+ const a=-this.cl.y/n.transform.lr,h=Math.sin(n.getPitch()*Math.PI/180)*a,l=n.terrain.depthAtPoint(new e.P(this.Te.x,this.Te.y-this.cl.y)),c=n.transform.lngLatToCameraDepth(this.hl,o+h)-l>.006;(null===(s=this.ol)||void 0===s?void 0:s.isOpen())&&c&&this.ol.remove(),this.rl.style.opacity=c?this.Tl:this.Pl}getOffset(){return this.cl}setOffset(t){return this.cl=e.P.convert(t),this.Ta(),this}addClassName(t){this.rl.classList.add(t)}removeClassName(t){this.rl.classList.remove(t)}toggleClassName(t){return this.rl.classList.toggle(t)}setDraggable(t){return this.Al=!!t,this.Ue&&(t?(this.Ue.on("mousedown",this.zl),this.Ue.on("touchstart",this.zl)):(this.Ue.off("mousedown",this.zl),this.Ue.off("touchstart",this.zl))),this}isDraggable(){return this.Al}setRotation(t){return this.fl=t||0,this.Ta(),this}getRotation(){return this.fl}setRotationAlignment(t){return this.ul=t||"auto",this.Ta(),this}getRotationAlignment(){return this.ul}setPitchAlignment(t){return this.pl=t&&"auto"!==t?t:this.ul,this.Ta(),this}getPitchAlignment(){return this.pl}setOpacity(t,e){return void 0===t&&void 0===e&&(this.Pl="1",this.Tl="0.2"),void 0!==t&&(this.Pl=t),void 0!==e&&(this.Tl=e),this.Ue&&this._l(!0),this}}const Zn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0}
4769
4769
  let Wn=0,Hn=!1
4770
4770
  const Xn={maxWidth:100,unit:"metric"}
4771
4771
  function Jn(t,e,i){const s=i&&i.maxWidth||100,n=t.$r.clientHeight/2,r=t.unproject([0,n]),o=t.unproject([s,n]),a=r.distanceTo(o)
@@ -4829,11 +4829,11 @@ if(null!=i.minZoom&&null!=i.maxZoom&&i.minZoom>i.maxZoom)throw new Error("maxZoo
4829
4829
  if(null!=i.minPitch&&null!=i.maxPitch&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch")
4830
4830
  if(null!=i.minPitch&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0")
4831
4831
  if(null!=i.maxPitch&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85")
4832
- if(super(new Ms(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this.yc=!1,this.vc=1,this.$a=new En,this.wc=[],this.xc=e.a4(),this.Mc=t=>{t.preventDefault(),this.rn&&(this.rn.abort(),this.rn=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this.zc=t=>{this.Sc(),this.resize(),this.Ca(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this.kc=t=>{if(t.target===this.$r)return this.$r.scrollTop=0,this.$r.scrollLeft=0,!1},this.Ac=()=>{this.Ca()},this.Ec=i.interactive,this.Hi=i.maxTileCacheSize,this.Xi=i.maxTileCacheZoomLevels,this.Ic=!0===i.failIfMajorPerformanceCaveat,this.Tc=!0===i.preserveDrawingBuffer,this.Cc=!0===i.antialias,this.Pc=!0===i.trackResize,this.xa=i.bearingSnap,this.ki=!0===i.refreshExpiredTiles,this.ws=i.fadeDuration,this.$c=!0===i.crossSourceCollisions,this.xi=!0===i.collectResourceTiming,this.Fc=Object.assign(Object.assign({},Dn),i.locale),this.zr=i.clickTolerance,this.Dc=i.pixelRatio,this.Oc=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===i.cancelPendingTileRequestsWhileZooming,this.Lc=p.addThrottleControl(()=>this.isMoving()),this.zi=new d(i.transformRequest),"string"==typeof i.container){if(this.$r=document.getElementById(i.container),!this.$r)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.")
4833
- this.$r=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this.Nc(),this.Sc(),this.on("move",()=>this.Ca(!1)).on("moveend",()=>this.Ca(!1)).on("zoom",()=>this.Ca(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this.Ca(!0)}).once("idle",()=>{this.yc=!0}),"undefined"!=typeof window){addEventListener("online",this.Ac,!1)
4832
+ if(super(new Ms(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this.yc=!1,this.vc=1,this.$a=new En,this.wc=[],this.xc=e.a4(),this.Mc=t=>{t.preventDefault(),this.rn&&(this.rn.abort(),this.rn=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this.zc=t=>{this.Sc(),this.resize(),this.Ta(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this.kc=t=>{if(t.target===this.$r)return this.$r.scrollTop=0,this.$r.scrollLeft=0,!1},this.Ac=()=>{this.Ta()},this.Ec=i.interactive,this.Hi=i.maxTileCacheSize,this.Xi=i.maxTileCacheZoomLevels,this.Ic=!0===i.failIfMajorPerformanceCaveat,this.Cc=!0===i.preserveDrawingBuffer,this.Tc=!0===i.antialias,this.Pc=!0===i.trackResize,this.xa=i.bearingSnap,this.ki=!0===i.refreshExpiredTiles,this.ws=i.fadeDuration,this.$c=!0===i.crossSourceCollisions,this.xi=!0===i.collectResourceTiming,this.Fc=Object.assign(Object.assign({},Dn),i.locale),this.zr=i.clickTolerance,this.Dc=i.pixelRatio,this.Oc=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===i.cancelPendingTileRequestsWhileZooming,this.Lc=p.addThrottleControl(()=>this.isMoving()),this.zi=new d(i.transformRequest),"string"==typeof i.container){if(this.$r=document.getElementById(i.container),!this.$r)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.")
4833
+ this.$r=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this.Nc(),this.Sc(),this.on("move",()=>this.Ta(!1)).on("moveend",()=>this.Ta(!1)).on("zoom",()=>this.Ta(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this.Ta(!0)}).once("idle",()=>{this.yc=!0}),"undefined"!=typeof window){addEventListener("online",this.Ac,!1)
4834
4834
  let t=!1
4835
4835
  const e=zs(t=>{this.Pc&&!this.Ei&&(this.resize(t),this.redraw())},50)
4836
- this.jc=new ResizeObserver(i=>{t?e(i):t=!0}),this.jc.observe(this.$r)}this.handlers=new Mn(this,i),this.Rc=i.hash&&new Ss("string"==typeof i.hash&&i.hash||void 0).addTo(this),this.Rc&&this.Rc.dr()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,e.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this.qc=i.localIdeographFontFamily,this.Bc=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new kn("boolean"==typeof i.attributionControl?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new An,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this.Ca("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.k("sourcedataabort",t))})}Js(){return this.xc}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")))
4836
+ this.jc=new ResizeObserver(i=>{t?e(i):t=!0}),this.jc.observe(this.$r)}this.handlers=new Mn(this,i),this.Rc=i.hash&&new Ss("string"==typeof i.hash&&i.hash||void 0).addTo(this),this.Rc&&this.Rc.dr()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,e.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this.qc=i.localIdeographFontFamily,this.Bc=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new kn("boolean"==typeof i.attributionControl?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new An,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this.Ta("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.k("sourcedataabort",t))})}Js(){return this.xc}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")))
4837
4837
  const s=t.onAdd(this)
4838
4838
  this.wc.push(t)
4839
4839
  const n=this.Uc[i]
@@ -4844,17 +4844,17 @@ const s=this.Vc(),n=s[0],r=s[1],o=this.Gc(n,r)
4844
4844
  if(this.Zc(n,r,o),this.painter.resize(n,r,o),this.painter.overLimit()){const t=this.painter.context.gl
4845
4845
  this.Oc=[t.drawingBufferWidth,t.drawingBufferHeight]
4846
4846
  const e=this.Gc(n,r)
4847
- this.Zc(n,r,e),this.painter.resize(n,r,e)}this.transform.resize(n,r),null===(i=this.Tr)||void 0===i||i.resize(n,r)
4847
+ this.Zc(n,r,e),this.painter.resize(n,r,e)}this.transform.resize(n,r),null===(i=this.Cr)||void 0===i||i.resize(n,r)
4848
4848
  const a=!this.Ra
4849
4849
  return a&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),a&&this.fire(new e.k("moveend",t)),this}Gc(t,e){const{0:i,1:s}=this.Oc,n=this.getPixelRatio(),r=t*n,o=e*n
4850
4850
  return Math.min(r>i?i/r:1,o>s?s/o:1)*n}getPixelRatio(){var t
4851
- return null!==(t=this.Dc)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this.Dc=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(Z.convert(t)),this.Ca()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this.Ca(),this.getZoom()<t&&this.setZoom(t),this
4852
- 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.maxZoom=t,this.Ca(),this.getZoom()>t&&this.setZoom(t),this
4851
+ return null!==(t=this.Dc)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this.Dc=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(Z.convert(t)),this.Ta()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this.Ta(),this.getZoom()<t&&this.setZoom(t),this
4852
+ 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.maxZoom=t,this.Ta(),this.getZoom()>t&&this.setZoom(t),this
4853
4853
  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")
4854
- if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this.Ca(),this.getPitch()<t&&this.setPitch(t),this
4854
+ if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this.Ta(),this.getPitch()<t&&this.setPitch(t),this
4855
4855
  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)>85)throw new Error("maxPitch must be less than or equal to 85")
4856
- if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this.Ca(),this.getPitch()>t&&this.setPitch(t),this
4857
- 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.renderWorldCopies=t,this.Ca()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t
4856
+ if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this.Ta(),this.getPitch()>t&&this.setPitch(t),this
4857
+ 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.renderWorldCopies=t,this.Ta()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t
4858
4858
  return this.Ra||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t
4859
4859
  return this.Po||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t
4860
4860
  return this.Ga||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}Wc(t,e,i){if("mouseenter"===t||"mouseover"===t){let s=!1
@@ -4887,18 +4887,18 @@ if(null==e)throw new Error(`Missing UI string '${t}'`)
4887
4887
  return e}Yc(t,e){if(e.transformStyle&&this.style&&!this.style.yi)return void this.style.once("style.load",()=>this.Yc(t,e))
4888
4888
  const i=this.style&&e.transformStyle?this.style.serialize():void 0
4889
4889
  return this.style&&(this.style.setEventedParent(null),this.style.Dn(!t)),t?(this.style=new fe(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,i):this.style.loadJSON(t,e,i),this):(delete this.style,this)}Qc(){this.style||(this.style=new fe(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}Kc(t,i){if("string"==typeof t){const s=this.zi.transformRequest(t,"Style")
4890
- e.h(s,new AbortController).then(t=>{this.tu(t.data,i)}).catch(t=>{t&&this.fire(new e.j(t))})}else"object"==typeof t&&this.tu(t,i)}tu(t,i){try{this.style.setState(t,i)&&this.Ca(!0)}catch(s){e.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this.Yc(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.Qc(),this.style.addSource(t,e),this.Ca(!0)}isSourceLoaded(t){const i=this.style&&this.style.sourceCaches[t]
4890
+ e.h(s,new AbortController).then(t=>{this.tu(t.data,i)}).catch(t=>{t&&this.fire(new e.j(t))})}else"object"==typeof t&&this.tu(t,i)}tu(t,i){try{this.style.setState(t,i)&&this.Ta(!0)}catch(s){e.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this.Yc(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.Qc(),this.style.addSource(t,e),this.Ta(!0)}isSourceLoaded(t){const i=this.style&&this.style.sourceCaches[t]
4891
4891
  if(void 0!==i)return i.loaded()
4892
4892
  this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style.vn(),this.eu&&this.style.off("data",this.eu),t){const i=this.style.sourceCaches[t.source]
4893
4893
  if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`)
4894
4894
  null===this.terrain&&i.reload()
4895
4895
  for(const s in this.style.De){const i=this.style.De[s]
4896
- "hillshade"===i.type&&i.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.")}this.terrain=new Cn(this.painter,i,t),this.painter.renderToTexture=new Fn(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.eu=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this.Ia||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this.eu)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0
4896
+ "hillshade"===i.type&&i.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.")}this.terrain=new Tn(this.painter,i,t),this.painter.renderToTexture=new Fn(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.eu=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this.Ia||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this.eu)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0
4897
4897
  return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e
4898
4898
  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
4899
4899
  for(const e in t){const i=t[e].Ui
4900
4900
  for(const t in i){const e=i[t]
4901
- if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this.Ca(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,s={}){const{pixelRatio:n=1,sdf:o=!1,stretchX:a,stretchY:h,content:l,textFitWidth:c,textFitHeight:u}=s
4901
+ if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this.Ta(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,s={}){const{pixelRatio:n=1,sdf:o=!1,stretchX:a,stretchY:h,content:l,textFitWidth:c,textFitHeight:u}=s
4902
4902
  if(this.Qc(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))
4903
4903
  {const{width:s,height:r,data:f}=i,p=i
4904
4904
  return this.style.addImage(t,{data:new e.R({width:s,height:r},new Uint8Array(f)),pixelRatio:n,stretchX:a,stretchY:h,content:l,textFitWidth:c,textFitHeight:u,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:s,height:f,data:p}=r.getImageData(i)
@@ -4908,19 +4908,19 @@ const n=i instanceof HTMLImageElement||e.b(i)?r.getImageData(i):i,{width:o,heigh
4908
4908
  if(void 0===o||void 0===a)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))
4909
4909
  if(o!==s.data.width||a!==s.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")))
4910
4910
  const l=!(i instanceof HTMLImageElement||e.b(i))
4911
- return s.data.replace(h,l),this.style.updateImage(t,s),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this.zi.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this.Qc(),this.style.addLayer(t,e),this.Ca(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this.Ca(!0)}removeLayer(t){return this.style.removeLayer(t),this.Ca(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this.Ca(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this.Ca(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,s={}){return this.style.setPaintProperty(t,e,i,s),this.Ca(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,s={}){return this.style.setLayoutProperty(t,e,i,s),this.Ca(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this.Qc(),this.style.setGlyphs(t,e),this.Ca(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this.Qc(),this.style.addSprite(t,e,i,t=>{t||this.Ca(!0)}),this}removeSprite(t){return this.Qc(),this.style.removeSprite(t),this.Ca(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this.Qc(),this.style.setSprite(t,e,t=>{t||this.Ca(!0)}),this}setLight(t,e={}){return this.Qc(),this.style.setLight(t,e),this.Ca(!0)}getLight(){return this.style.getLight()}setSky(t){return this.Qc(),this.style.setSky(t),this.Ca(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this.Ca()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this.Ca()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this.$r}getCanvasContainer(){return this.iu}getCanvas(){return this.su}Vc(){let t=0,e=0
4911
+ return s.data.replace(h,l),this.style.updateImage(t,s),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this.zi.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this.Qc(),this.style.addLayer(t,e),this.Ta(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this.Ta(!0)}removeLayer(t){return this.style.removeLayer(t),this.Ta(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this.Ta(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this.Ta(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,s={}){return this.style.setPaintProperty(t,e,i,s),this.Ta(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,s={}){return this.style.setLayoutProperty(t,e,i,s),this.Ta(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this.Qc(),this.style.setGlyphs(t,e),this.Ta(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this.Qc(),this.style.addSprite(t,e,i,t=>{t||this.Ta(!0)}),this}removeSprite(t){return this.Qc(),this.style.removeSprite(t),this.Ta(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this.Qc(),this.style.setSprite(t,e,t=>{t||this.Ta(!0)}),this}setLight(t,e={}){return this.Qc(),this.style.setLight(t,e),this.Ta(!0)}getLight(){return this.style.getLight()}setSky(t){return this.Qc(),this.style.setSky(t),this.Ta(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this.Ta()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this.Ta()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this.$r}getCanvasContainer(){return this.iu}getCanvas(){return this.su}Vc(){let t=0,e=0
4912
4912
  return this.$r&&(t=this.$r.clientWidth||400,e=this.$r.clientHeight||300),[t,e]}Nc(){const t=this.$r
4913
4913
  t.classList.add("maplibregl-map")
4914
4914
  const e=this.iu=o.create("div","maplibregl-canvas-container",t)
4915
4915
  this.Ec&&e.classList.add("maplibregl-interactive"),this.su=o.create("canvas","maplibregl-canvas",e),this.su.addEventListener("webglcontextlost",this.Mc,!1),this.su.addEventListener("webglcontextrestored",this.zc,!1),this.su.setAttribute("tabindex",this.Ec?"0":"-1"),this.su.setAttribute("aria-label",this.la("Map.Title")),this.su.setAttribute("role","region")
4916
4916
  const i=this.Vc(),s=this.Gc(i[0],i[1])
4917
4917
  this.Zc(i[0],i[1],s)
4918
- const n=this.ql=o.create("div","maplibregl-control-container",t),r=this.Uc={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{r[t]=o.create("div",`maplibregl-ctrl-${t} `,n)}),this.$r.addEventListener("scroll",this.kc,!1)}Zc(t,e,i){this.su.width=Math.floor(i*t),this.su.height=Math.floor(i*e),this.su.style.width=`${t}px`,this.su.style.height=`${e}px`}Sc(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this.Ic,preserveDrawingBuffer:this.Tc,antialias:this.Cc||!1}
4918
+ const n=this.ql=o.create("div","maplibregl-control-container",t),r=this.Uc={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{r[t]=o.create("div",`maplibregl-ctrl-${t} `,n)}),this.$r.addEventListener("scroll",this.kc,!1)}Zc(t,e,i){this.su.width=Math.floor(i*t),this.su.height=Math.floor(i*e),this.su.style.width=`${t}px`,this.su.style.height=`${e}px`}Sc(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this.Ic,preserveDrawingBuffer:this.Cc,antialias:this.Tc||!1}
4919
4919
  let e=null
4920
4920
  this.su.addEventListener("webglcontextcreationerror",i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)},{once:!0})
4921
4921
  const i=this.su.getContext("webgl2",t)||this.su.getContext("webgl",t)
4922
4922
  if(!i){const t="Failed to initialize WebGL"
4923
- throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new ys(i,this.transform),a.testSupport(i)}loaded(){return!this.nu&&!this.ru&&!!this.style&&this.style.loaded()}Ca(t){return this.style&&this.style.yi?(this.nu=this.nu||t,this.ru=!0,this.triggerRepaint(),this):this}ja(t){return this.Ca(),this.$a.add(t)}oh(t){this.$a.remove(t)}ou(t){const i=this.yc?this.ws:0
4923
+ throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new ys(i,this.transform),a.testSupport(i)}loaded(){return!this.nu&&!this.ru&&!!this.style&&this.style.loaded()}Ta(t){return this.style&&this.style.yi?(this.nu=this.nu||t,this.ru=!0,this.triggerRepaint(),this):this}ja(t){return this.Ta(),this.$a.add(t)}oh(t){this.$a.remove(t)}ou(t){const i=this.yc?this.ws:0
4924
4924
  if(this.painter.context.setDirty(),this.painter.setBaseState(),this.$a.run(t),this.Ei)return
4925
4925
  let s=!1
4926
4926
  if(this.style&&this.nu){this.nu=!1
@@ -4933,28 +4933,28 @@ return n||this.lu?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fi
4933
4933
  this.Rc&&this.Rc.remove()
4934
4934
  for(const e of this.wc)e.onRemove(this)
4935
4935
  this.wc=[],this.rn&&(this.rn.abort(),this.rn=null),this.$a.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this.Ac,!1),p.removeThrottleControl(this.Lc),null===(t=this.jc)||void 0===t||t.disconnect()
4936
- const i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this.su.removeEventListener("webglcontextrestored",this.zc,!1),this.su.removeEventListener("webglcontextlost",this.Mc,!1),o.remove(this.iu),o.remove(this.ql),this.$r.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this.Ei=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this.rn&&(this.rn=new AbortController,r.frameAsync(this.rn).then(t=>{e.bf.frame(t),this.rn=null,this.ou(t)}).catch(()=>{}))}get showTileBoundaries(){return!!this.uu}set showTileBoundaries(t){this.uu!==t&&(this.uu=t,this.Ca())}get showPadding(){return!!this.fu}set showPadding(t){this.fu!==t&&(this.fu=t,this.Ca())}get showCollisionBoxes(){return!!this.Gs}set showCollisionBoxes(t){this.Gs!==t&&(this.Gs=t,t?this.style.Ln():this.Ca())}get showOverdrawInspector(){return!!this.Un}set showOverdrawInspector(t){this.Un!==t&&(this.Un=t,this.Ca())}get repaint(){return!!this.lu}set repaint(t){this.lu!==t&&(this.lu=t,this.triggerRepaint())}get vertices(){return!!this.pu}set vertices(t){this.pu=t,this.Ca()}get version(){return On}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Fs,t.MapTouchEvent=Ds,t.MapWheelEvent=Os,t.Marker=Gn,t.NavigationControl=class{constructor(t){this.du=()=>{const t=this.Ue.getZoom(),e=t===this.Ue.getMaxZoom(),i=t===this.Ue.getMinZoom()
4936
+ const i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this.su.removeEventListener("webglcontextrestored",this.zc,!1),this.su.removeEventListener("webglcontextlost",this.Mc,!1),o.remove(this.iu),o.remove(this.ql),this.$r.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this.Ei=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this.rn&&(this.rn=new AbortController,r.frameAsync(this.rn).then(t=>{e.bf.frame(t),this.rn=null,this.ou(t)}).catch(()=>{}))}get showTileBoundaries(){return!!this.uu}set showTileBoundaries(t){this.uu!==t&&(this.uu=t,this.Ta())}get showPadding(){return!!this.fu}set showPadding(t){this.fu!==t&&(this.fu=t,this.Ta())}get showCollisionBoxes(){return!!this.Gs}set showCollisionBoxes(t){this.Gs!==t&&(this.Gs=t,t?this.style.Ln():this.Ta())}get showOverdrawInspector(){return!!this.Un}set showOverdrawInspector(t){this.Un!==t&&(this.Un=t,this.Ta())}get repaint(){return!!this.lu}set repaint(t){this.lu!==t&&(this.lu=t,this.triggerRepaint())}get vertices(){return!!this.pu}set vertices(t){this.pu=t,this.Ta()}get version(){return On}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Fs,t.MapTouchEvent=Ds,t.MapWheelEvent=Os,t.Marker=Gn,t.NavigationControl=class{constructor(t){this.du=()=>{const t=this.Ue.getZoom(),e=t===this.Ue.getMaxZoom(),i=t===this.Ue.getMinZoom()
4937
4937
  this.mu.disabled=e,this._u.disabled=i,this.mu.setAttribute("aria-disabled",e.toString()),this._u.setAttribute("aria-disabled",i.toString())},this.gu=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this.Ue.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this.Ue.transform.pitch}deg) rotateZ(${this.Ue.transform.angle*(180/Math.PI)}deg)`:`rotate(${this.Ue.transform.angle*(180/Math.PI)}deg)`
4938
4938
  this.yu.style.transform=t},this.vu=(t,e)=>{const i=this.Ue.la(`NavigationControl.${e}`)
4939
4939
  t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},jn,t),this.$r=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this.$r.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this.mu=this.wu("maplibregl-ctrl-zoom-in",t=>this.Ue.zoomIn({},{originalEvent:t})),o.create("span","maplibregl-ctrl-icon",this.mu).setAttribute("aria-hidden","true"),this._u=this.wu("maplibregl-ctrl-zoom-out",t=>this.Ue.zoomOut({},{originalEvent:t})),o.create("span","maplibregl-ctrl-icon",this._u).setAttribute("aria-hidden","true")),this.options.showCompass&&(this.xu=this.wu("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this.Ue.resetNorthPitch({},{originalEvent:t}):this.Ue.resetNorth({},{originalEvent:t})}),this.yu=o.create("span","maplibregl-ctrl-icon",this.xu),this.yu.setAttribute("aria-hidden","true"))}onAdd(t){return this.Ue=t,this.options.showZoom&&(this.vu(this.mu,"ZoomIn"),this.vu(this._u,"ZoomOut"),this.Ue.on("zoom",this.du),this.du()),this.options.showCompass&&(this.vu(this.xu,"ResetBearing"),this.options.visualizePitch&&this.Ue.on("pitch",this.gu),this.Ue.on("rotate",this.gu),this.gu(),this.Mu=new Rn(this.Ue,this.xu,this.options.visualizePitch)),this.$r}onRemove(){o.remove(this.$r),this.options.showZoom&&this.Ue.off("zoom",this.du),this.options.showCompass&&(this.options.visualizePitch&&this.Ue.off("pitch",this.gu),this.Ue.off("rotate",this.gu),this.Mu.off(),delete this.Mu),delete this.Ue}wu(t,e){const i=o.create("button",t,this.$r)
4940
- return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this.zu&&o.remove(this.zu),this.$r&&(o.remove(this.$r),delete this.$r),this.Ue&&(this.Ue.off("move",this.Ca),this.Ue.off("move",this.Su),this.Ue.off("click",this.Su),this.Ue.off("remove",this.remove),this.Ue.off("mousemove",this.ku),this.Ue.off("mouseup",this.Au),this.Ue.off("drag",this.Eu),this.Ue.iu.classList.remove("maplibregl-track-pointer"),delete this.Ue,this.fire(new e.k("close"))),this),this.Au=t=>{this.Ca(t.point)},this.ku=t=>{this.Ca(t.point)},this.Eu=t=>{this.Ca(t.point)},this.Ca=t=>{var e
4940
+ return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this.zu&&o.remove(this.zu),this.$r&&(o.remove(this.$r),delete this.$r),this.Ue&&(this.Ue.off("move",this.Ta),this.Ue.off("move",this.Su),this.Ue.off("click",this.Su),this.Ue.off("remove",this.remove),this.Ue.off("mousemove",this.ku),this.Ue.off("mouseup",this.Au),this.Ue.off("drag",this.Eu),this.Ue.iu.classList.remove("maplibregl-track-pointer"),delete this.Ue,this.fire(new e.k("close"))),this),this.Au=t=>{this.Ta(t.point)},this.ku=t=>{this.Ta(t.point)},this.Eu=t=>{this.Ta(t.point)},this.Ta=t=>{var e
4941
4941
  if(!this.Ue||!this.hl&&!this.Iu||!this.zu)return
4942
- if(!this.$r){if(this.$r=o.create("div","maplibregl-popup",this.Ue.getContainer()),this.Tu=o.create("div","maplibregl-popup-tip",this.$r),this.$r.appendChild(this.zu),this.options.className)for(const t of this.options.className.split(" "))this.$r.classList.add(t)
4943
- this.Cu&&this.Cu.setAttribute("aria-label",this.Ue.la("Popup.Close")),this.Iu&&this.$r.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this.$r.style.maxWidth!==this.options.maxWidth&&(this.$r.style.maxWidth=this.options.maxWidth),this.hl=this.Ue.transform.renderWorldCopies&&!this.Iu?Bn(this.hl,this.ll,this.Ue.transform):null===(e=this.hl)||void 0===e?void 0:e.wrap(),this.Iu&&!t)return
4944
- const i=this.ll=this.Ce=this.Iu&&t?t:this.Ue.project(this.hl)
4942
+ if(!this.$r){if(this.$r=o.create("div","maplibregl-popup",this.Ue.getContainer()),this.Cu=o.create("div","maplibregl-popup-tip",this.$r),this.$r.appendChild(this.zu),this.options.className)for(const t of this.options.className.split(" "))this.$r.classList.add(t)
4943
+ this.Tu&&this.Tu.setAttribute("aria-label",this.Ue.la("Popup.Close")),this.Iu&&this.$r.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this.$r.style.maxWidth!==this.options.maxWidth&&(this.$r.style.maxWidth=this.options.maxWidth),this.hl=this.Ue.transform.renderWorldCopies&&!this.Iu?Bn(this.hl,this.ll,this.Ue.transform):null===(e=this.hl)||void 0===e?void 0:e.wrap(),this.Iu&&!t)return
4944
+ const i=this.ll=this.Te=this.Iu&&t?t:this.Ue.project(this.hl)
4945
4945
  this.Ue.terrain&&(this.ll=this.Iu&&t?t:this.Ue.transform.locationPoint(this.hl))
4946
4946
  let s=this.options.anchor
4947
4947
  const n=tr(this.options.offset)
4948
4948
  if(!s){const t=this.$r.offsetWidth,e=this.$r.offsetHeight
4949
4949
  let r
4950
4950
  r=i.y+n.bottom.y<e?["top"]:i.y>this.Ue.transform.height-e?["bottom"]:[],i.x<t/2?r.push("left"):i.x>this.Ue.transform.width-t/2&&r.push("right"),s=0===r.length?"bottom":r.join("-")}let r=i.add(n[s])
4951
- this.options.subpixelPositioning||(r=r.round()),o.setTransform(this.$r,`${Un[s]} translate(${r.x}px,${r.y}px)`),Vn(this.$r,s,"popup")},this.Su=()=>{this.remove()},this.options=e.e(Object.create(Yn),t)}addTo(t){return this.Ue&&this.remove(),this.Ue=t,this.options.closeOnClick&&this.Ue.on("click",this.Su),this.options.closeOnMove&&this.Ue.on("move",this.Su),this.Ue.on("remove",this.remove),this.Ca(),this.Pu(),this.Iu?(this.Ue.on("mousemove",this.ku),this.Ue.on("mouseup",this.Au),this.$r&&this.$r.classList.add("maplibregl-popup-track-pointer"),this.Ue.iu.classList.add("maplibregl-track-pointer")):this.Ue.on("move",this.Ca),this.fire(new e.k("open")),this}isOpen(){return!!this.Ue}getLngLat(){return this.hl}setLngLat(t){return this.hl=e.N.convert(t),this.Ce=null,this.ll=null,this.Iu=!1,this.Ca(),this.Ue&&(this.Ue.on("move",this.Ca),this.Ue.off("mousemove",this.ku),this.$r&&this.$r.classList.remove("maplibregl-popup-track-pointer"),this.Ue.iu.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this.Iu=!0,this.Ce=null,this.ll=null,this.Ca(),this.Ue&&(this.Ue.off("move",this.Ca),this.Ue.on("mousemove",this.ku),this.Ue.on("drag",this.Eu),this.$r&&this.$r.classList.add("maplibregl-popup-track-pointer"),this.Ue.iu.classList.add("maplibregl-track-pointer")),this}getElement(){return this.$r}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body")
4951
+ this.options.subpixelPositioning||(r=r.round()),o.setTransform(this.$r,`${Un[s]} translate(${r.x}px,${r.y}px)`),Vn(this.$r,s,"popup")},this.Su=()=>{this.remove()},this.options=e.e(Object.create(Yn),t)}addTo(t){return this.Ue&&this.remove(),this.Ue=t,this.options.closeOnClick&&this.Ue.on("click",this.Su),this.options.closeOnMove&&this.Ue.on("move",this.Su),this.Ue.on("remove",this.remove),this.Ta(),this.Pu(),this.Iu?(this.Ue.on("mousemove",this.ku),this.Ue.on("mouseup",this.Au),this.$r&&this.$r.classList.add("maplibregl-popup-track-pointer"),this.Ue.iu.classList.add("maplibregl-track-pointer")):this.Ue.on("move",this.Ta),this.fire(new e.k("open")),this}isOpen(){return!!this.Ue}getLngLat(){return this.hl}setLngLat(t){return this.hl=e.N.convert(t),this.Te=null,this.ll=null,this.Iu=!1,this.Ta(),this.Ue&&(this.Ue.on("move",this.Ta),this.Ue.off("mousemove",this.ku),this.$r&&this.$r.classList.remove("maplibregl-popup-track-pointer"),this.Ue.iu.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this.Iu=!0,this.Te=null,this.ll=null,this.Ta(),this.Ue&&(this.Ue.off("move",this.Ta),this.Ue.on("mousemove",this.ku),this.Ue.on("drag",this.Eu),this.$r&&this.$r.classList.add("maplibregl-popup-track-pointer"),this.Ue.iu.classList.add("maplibregl-track-pointer")),this}getElement(){return this.$r}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body")
4952
4952
  let s
4953
4953
  for(i.innerHTML=t;s=i.firstChild,s;)e.appendChild(s)
4954
4954
  return this.setDOMContent(e)}getMaxWidth(){var t
4955
- return null===(t=this.$r)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this.Ca(),this}setDOMContent(t){if(this.zu)for(;this.zu.hasChildNodes();)this.zu.firstChild&&this.zu.removeChild(this.zu.firstChild)
4955
+ return null===(t=this.$r)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this.Ta(),this}setDOMContent(t){if(this.zu)for(;this.zu.hasChildNodes();)this.zu.firstChild&&this.zu.removeChild(this.zu.firstChild)
4956
4956
  else this.zu=o.create("div","maplibregl-popup-content",this.$r)
4957
- return this.zu.appendChild(t),this.$u(),this.Ca(),this.Pu(),this}addClassName(t){return this.$r&&this.$r.classList.add(t),this}removeClassName(t){return this.$r&&this.$r.classList.remove(t),this}setOffset(t){return this.options.offset=t,this.Ca(),this}toggleClassName(t){if(this.$r)return this.$r.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}$u(){this.options.closeButton&&(this.Cu=o.create("button","maplibregl-popup-close-button",this.zu),this.Cu.type="button",this.Cu.innerHTML="&#215;",this.Cu.addEventListener("click",this.Su))}Pu(){if(!this.options.focusAfterOpen||!this.$r)return
4957
+ return this.zu.appendChild(t),this.$u(),this.Ta(),this.Pu(),this}addClassName(t){return this.$r&&this.$r.classList.add(t),this}removeClassName(t){return this.$r&&this.$r.classList.remove(t),this}setOffset(t){return this.options.offset=t,this.Ta(),this}toggleClassName(t){if(this.$r)return this.$r.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}$u(){this.options.closeButton&&(this.Tu=o.create("button","maplibregl-popup-close-button",this.zu),this.Tu.type="button",this.Tu.innerHTML="&#215;",this.Tu.addEventListener("click",this.Su))}Pu(){if(!this.options.focusAfterOpen||!this.$r)return
4958
4958
  const t=this.$r.querySelector(Qn)
4959
4959
  t&&t.focus()}},t.RasterDEMTileSource=J,t.RasterTileSource=X,t.ScaleControl=class{constructor(t){this.yl=()=>{Jn(this.Ue,this.$r,this.options)},this.setUnit=t=>{this.options.unit=t,Jn(this.Ue,this.$r,this.options)},this.options=Object.assign(Object.assign({},Xn),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this.Ue=t,this.$r=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this.Ue.on("move",this.yl),this.yl(),this.$r}onRemove(){o.remove(this.$r),this.Ue.off("move",this.yl),this.Ue=void 0}},t.ScrollZoomHandler=fn,t.Style=fe,t.TerrainControl=class{constructor(t){this.Fu=()=>{this.Ue.getTerrain()?this.Ue.setTerrain(null):this.Ue.setTerrain(this.options),this.Du()},this.Du=()=>{this.Ou.classList.remove("maplibregl-ctrl-terrain"),this.Ou.classList.remove("maplibregl-ctrl-terrain-enabled"),this.Ue.terrain?(this.Ou.classList.add("maplibregl-ctrl-terrain-enabled"),this.Ou.title=this.Ue.la("TerrainControl.Disable")):(this.Ou.classList.add("maplibregl-ctrl-terrain"),this.Ou.title=this.Ue.la("TerrainControl.Enable"))},this.options=t}onAdd(t){return this.Ue=t,this.$r=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this.Ou=o.create("button","maplibregl-ctrl-terrain",this.$r),o.create("span","maplibregl-ctrl-icon",this.Ou).setAttribute("aria-hidden","true"),this.Ou.type="button",this.Ou.addEventListener("click",this.Fu),this.Du(),this.Ue.on("terrain",this.Du),this.$r}onRemove(){o.remove(this.$r),this.Ue.off("terrain",this.Du),this.Ue=void 0}},t.TwoFingersTouchPitchHandler=an,t.TwoFingersTouchRotateHandler=rn,t.TwoFingersTouchZoomHandler=sn,t.TwoFingersTouchZoomRotateHandler=yn,t.VectorTileSource=H,t.VideoSource=tt,t.addSourceType=(t,i)=>e._e(void 0,void 0,void 0,function*(){if(st(t))throw new Error(`A source type called "${t}" already exists.`)
4960
4960
  var e
@@ -4989,8 +4989,8 @@ e.easeTo({center:[t.lng,t.lat],duration:250})}),c.current=i}),e.on("click",t=>{v
4989
4989
  const s=t.lngLat
4990
4990
  null==(i=c.current)||i.setLngLat([s.lng,s.lat]),g(s.lat),v(s.lng),E(s.lat,s.lng),e.easeTo({center:[s.lng,s.lat],duration:200})}),l.current=e,()=>{e.remove(),l.current=null,c.current=null}},[])
4991
4991
  const I=i.useCallback(()=>{A(),k((t,e)=>{var i
4992
- g(t),v(e),E(t,e),l.current&&l.current.flyTo({center:[e,t],zoom:18,duration:1400,essential:!0}),null==(i=c.current)||i.setLngLat([e,t])})},[k,A,E]),T=i.useCallback(()=>{w&&t(_,y,w)},[_,y,w,t]),C=null!==w,P=C&&x
4993
- return e.jsxs("div",{className:"qr-map-wrapper",children:[e.jsxs("div",{className:"qr-step-header",children:[e.jsx("div",{className:"qr-step-badge",children:"1"}),e.jsxs("div",{className:"qr-step-text",children:[e.jsx("span",{className:"qr-step-title",children:"Pin Your Location"}),e.jsx("span",{className:"qr-step-sub",children:"Tap the map or drag the pin to your exact home / office"})]})]}),e.jsxs("div",{className:"qr-map-outer",style:{height:o},children:[e.jsx("div",{ref:h,className:"qr-map-canvas"}),w&&e.jsxs("div",{className:"qr-digipin-badge","aria-live":"polite","aria-label":`DigiPin: ${w}`,children:[e.jsx("span",{className:"qr-digipin-badge__label",children:"DigiPin"}),e.jsx("span",{className:"qr-digipin-badge__code",children:w})]}),!C&&x&&e.jsx("div",{className:"qr-map-notice",role:"status",children:"Move map to India to get a DigiPin"}),e.jsx("button",{className:"qr-locate-btn"+(z?" qr-locate-btn--loading":""),onClick:I,disabled:z,title:"Use my current location","aria-label":"Use my current location",type:"button",children:z?e.jsx("span",{className:"qr-spinner","aria-hidden":"true"}):e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M12 1v4M12 19v4M1 12h4M19 12h4"})]})}),S&&e.jsxs("div",{className:"qr-geo-error",role:"alert",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",className:"qr-geo-error__dismiss",onClick:A,"aria-label":"Dismiss error",children:"×"})]})]}),x&&e.jsxs("div",{className:"qr-coords-strip","aria-label":"Current pin coordinates",children:[e.jsxs("span",{children:[_.toFixed(5),"° N"]}),e.jsx("span",{className:"qr-coords-sep",children:"·"}),e.jsxs("span",{children:[y.toFixed(5),"° E"]})]}),e.jsxs("div",{className:"qr-map-actions",children:[e.jsxs("button",{type:"button",className:"qr-btn qr-btn--primary qr-btn--full",onClick:T,disabled:!P,children:["Confirm Location",e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})]}),!C&&x&&e.jsx("p",{className:"qr-map-hint",children:"Move the pin to a location in India to continue"})]})]})},d="https://api.quantaroute.com"
4992
+ g(t),v(e),E(t,e),l.current&&l.current.flyTo({center:[e,t],zoom:18,duration:1400,essential:!0}),null==(i=c.current)||i.setLngLat([e,t])})},[k,A,E]),C=i.useCallback(()=>{w&&t(_,y,w)},[_,y,w,t]),T=null!==w,P=T&&x
4993
+ return e.jsxs("div",{className:"qr-map-wrapper",children:[e.jsxs("div",{className:"qr-step-header",children:[e.jsx("div",{className:"qr-step-badge",children:"1"}),e.jsxs("div",{className:"qr-step-text",children:[e.jsx("span",{className:"qr-step-title",children:"Pin Your Location"}),e.jsx("span",{className:"qr-step-sub",children:"Tap the map or drag the pin to your exact home / office"})]})]}),e.jsxs("div",{className:"qr-map-outer",style:{height:o},children:[e.jsx("div",{ref:h,className:"qr-map-canvas"}),w&&e.jsxs("div",{className:"qr-digipin-badge","aria-live":"polite","aria-label":`DigiPin: ${w}`,children:[e.jsx("span",{className:"qr-digipin-badge__label",children:"DigiPin"}),e.jsx("span",{className:"qr-digipin-badge__code",children:w})]}),!T&&x&&e.jsx("div",{className:"qr-map-notice",role:"status",children:"Move map to India to get a DigiPin"}),e.jsx("button",{className:"qr-locate-btn"+(z?" qr-locate-btn--loading":""),onClick:I,disabled:z,title:"Use my current location","aria-label":"Use my current location",type:"button",children:z?e.jsx("span",{className:"qr-spinner","aria-hidden":"true"}):e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),e.jsx("circle",{cx:"12",cy:"12",r:"7"}),e.jsx("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3"})]})}),S&&e.jsxs("div",{className:"qr-geo-error",role:"alert",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",className:"qr-geo-error__dismiss",onClick:A,"aria-label":"Dismiss error",children:"×"})]})]}),x&&e.jsxs("div",{className:"qr-coords-strip","aria-label":"Current pin coordinates",children:[e.jsxs("span",{children:[_.toFixed(5),"° N"]}),e.jsx("span",{className:"qr-coords-sep",children:"·"}),e.jsxs("span",{children:[y.toFixed(5),"° E"]})]}),e.jsxs("div",{className:"qr-map-actions",children:[e.jsxs("button",{type:"button",className:"qr-btn qr-btn--primary qr-btn--full",onClick:C,disabled:!P,children:["Confirm Location",e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M5 12h14M12 5l7 7-7 7"})})]}),!T&&x&&e.jsx("p",{className:"qr-map-hint",children:"Move the pin to a location in India to continue"})]})]})},d="https://api.quantaroute.com"
4994
4994
  async function m(t,e,i,s=d){const n=`${s.replace(/\/$/,"")}/v1/location/lookup`
4995
4995
  let r
4996
4996
  try{r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":i},body:JSON.stringify({latitude:t,longitude:e}),signal:AbortSignal.timeout(15e3)})}catch(a){if(a instanceof Error&&"TimeoutError"===a.name)throw new Error("Request timed out. Check your internet connection.")