@loaders.gl/pmtiles 4.4.0-alpha.1 → 4.4.0-alpha.2
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.
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/lib/version.js +1 -1
- package/package.json +7 -7
package/dist/dist.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var Bn=Object.create;var ae=Object.defineProperty;var Sn=Object.getOwnPropertyDescriptor;var En=Object.getOwnPropertyNames;var An=Object.getPrototypeOf,_n=Object.prototype.hasOwnProperty;var Dn=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ot=(e,t)=>{for(var r in t)ae(e,r,{get:t[r],enumerable:!0})},Ee=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of En(t))!_n.call(e,o)&&o!==r&&ae(e,o,{get:()=>t[o],enumerable:!(n=Sn(t,o))||n.enumerable});return e},Ae=(e,t,r)=>(Ee(e,t,"default"),r&&Ee(r,t,"default")),jt=(e,t,r)=>(r=e!=null?Bn(An(e)):{},Ee(t||!e||!e.__esModule?ae(r,"default",{value:e,enumerable:!0}):r,e)),Ln=e=>Ee(ae({},"__esModule",{value:!0}),e);var _e=(e,t,r)=>(Dn(e,typeof t!="symbol"?t+"":t,r),r);var Rt=qe((Fs,zt)=>{zt.exports=globalThis.loaders});var Ar=qe(mt=>{mt.read=function(e,t,r,n,o){var i,s,a=o*8-n-1,l=(1<<a)-1,c=l>>1,f=-7,u=r?o-1:0,h=r?-1:1,d=e[t+u];for(u+=h,i=d&(1<<-f)-1,d>>=-f,f+=a;f>0;i=i*256+e[t+u],u+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=s*256+e[t+u],u+=h,f-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-c}return(d?-1:1)*s*Math.pow(2,i-n)};mt.write=function(e,t,r,n,o,i){var s,a,l,c=i*8-o-1,f=(1<<c)-1,u=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?t+=h/l:t+=h*Math.pow(2,1-u),t*l>=2&&(s++,l/=2),s+u>=f?(a=0,s=f):s+u>=1?(a=(t*l-1)*Math.pow(2,o),s=s+u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[r+d]=a&255,d+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[r+d]=s&255,d+=p,s/=256,c-=8);e[r+d-p]|=y*128}});var Ur=qe((Nl,Vr)=>{"use strict";Vr.exports=x;var ze=Ar();function x(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}x.Varint=0;x.Fixed64=1;x.Bytes=2;x.Fixed32=5;var yt=(1<<16)*(1<<16),_r=1/yt,li=12,Mr=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");x.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),o=n>>3,i=this.pos;this.type=n&7,e(o,t,this),this.pos===i&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Re(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Lr(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Re(this.buf,this.pos)+Re(this.buf,this.pos+4)*yt;return this.pos+=8,e},readSFixed64:function(){var e=Re(this.buf,this.pos)+Lr(this.buf,this.pos+4)*yt;return this.pos+=8,e},readFloat:function(){var e=ze.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ze.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,ci(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=li&&Mr?Pi(this.buf,t,e):Fi(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==x.Bytes)return e.push(this.readVarint(t));var r=G(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==x.Bytes)return e.push(this.readSVarint());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==x.Bytes)return e.push(this.readBoolean());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==x.Bytes)return e.push(this.readFloat());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==x.Bytes)return e.push(this.readDouble());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==x.Bytes)return e.push(this.readFixed32());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==x.Bytes)return e.push(this.readSFixed32());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==x.Bytes)return e.push(this.readFixed64());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==x.Bytes)return e.push(this.readSFixed64());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===x.Varint)for(;this.buf[this.pos++]>127;);else if(t===x.Bytes)this.pos=this.readVarint()+this.pos;else if(t===x.Fixed32)this.pos+=4;else if(t===x.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),re(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),re(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),re(this.buf,e&-1,this.pos),re(this.buf,Math.floor(e*_r),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),re(this.buf,e&-1,this.pos),re(this.buf,Math.floor(e*_r),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){fi(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=Ii(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Dr(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),ze.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),ze.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Dr(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,x.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,di,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,pi,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,yi,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,gi,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,mi,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,xi,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,wi,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,vi,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ti,t)},writeBytesField:function(e,t){this.writeTag(e,x.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,x.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,x.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,x.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,x.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,x.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,x.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,x.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,x.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,x.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function ci(e,t,r){var n=r.buf,o,i;if(i=n[r.pos++],o=(i&112)>>4,i<128||(i=n[r.pos++],o|=(i&127)<<3,i<128)||(i=n[r.pos++],o|=(i&127)<<10,i<128)||(i=n[r.pos++],o|=(i&127)<<17,i<128)||(i=n[r.pos++],o|=(i&127)<<24,i<128)||(i=n[r.pos++],o|=(i&1)<<31,i<128))return te(e,o,t);throw new Error("Expected varint not more than 10 bytes")}function G(e){return e.type===x.Bytes?e.readVarint()+e.pos:e.pos+1}function te(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function fi(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),ui(r,n,t),hi(n,t)}function ui(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function hi(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Dr(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var o=r.pos-1;o>=e;o--)r.buf[o+n]=r.buf[o]}function di(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function pi(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function gi(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function mi(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function yi(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function xi(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function wi(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function vi(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ti(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Re(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function re(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Lr(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Fi(e,t,r){for(var n="",o=t;o<r;){var i=e[o],s=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a>r)break;var l,c,f;a===1?i<128&&(s=i):a===2?(l=e[o+1],(l&192)===128&&(s=(i&31)<<6|l&63,s<=127&&(s=null))):a===3?(l=e[o+1],c=e[o+2],(l&192)===128&&(c&192)===128&&(s=(i&15)<<12|(l&63)<<6|c&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(l=e[o+1],c=e[o+2],f=e[o+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(s=(i&15)<<18|(l&63)<<12|(c&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),o+=a}return n}function Pi(e,t,r){return Mr.decode(e.subarray(t,r))}function Ii(e,t,r){for(var n=0,o,i;n<t.length;n++){if(o=t.charCodeAt(n),o>55295&&o<57344)if(i)if(o<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=o;continue}else o=i-55296<<10|o-56320|65536,i=null;else{o>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=o;continue}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);o<128?e[r++]=o:(o<2048?e[r++]=o>>6|192:(o<65536?e[r++]=o>>12|224:(e[r++]=o>>18|240,e[r++]=o>>12&63|128),e[r++]=o>>6&63|128),e[r++]=o&63|128)}return r}});var Be={};Ot(Be,{PMTilesSource:()=>Dt,PMTilesTileSource:()=>J,_PMTilesLoader:()=>vn});Ae(Be,jt(Rt(),1));function le(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var N={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Mn=N.self||N.window||N.global||{},Vn=N.window||N.self||N.global||{},Un=N.global||N.self||N.window||{},Cn=N.document||{};var et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Ht=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Nn=Ht&&parseFloat(Ht[1])||0;var De=globalThis,kn=globalThis.document||{},Le=globalThis.process||{},Gn=globalThis.console,bs=globalThis.navigator||{};function Zt(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let t=typeof navigator<"u"&&navigator.userAgent,r=e||t;return Boolean(r&&r.indexOf("Electron")>=0)}function z(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Zt()}var tt="4.0.7";function jn(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Me=class{constructor(t,r,n="sessionStorage"){this.storage=jn(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function $t(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function Wt(e,t=8){let r=Math.max(t-e.length,0);return`${" ".repeat(r)}${e}`}var Ve;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ve||(Ve={}));var zn=10;function Jt(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ve[e]||Ve.WHITE)}function Kt(e,t,r){return!z&&typeof e=="string"&&(t&&(e=`\x1B[${Jt(t)}m${e}\x1B[39m`),r&&(e=`\x1B[${Jt(r)+zn}m${e}\x1B[49m`)),e}function Yt(e,t=["constructor"]){let r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let s=o[i];typeof s=="function"&&(t.find(a=>i===a)||(o[i]=s.bind(e)))}}function ce(e,t){if(!e)throw new Error(t||"Assertion failed")}function R(){let e;if(z()&&De.performance)e=De?.performance?.now?.();else if("hrtime"in Le){let t=Le?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var X={debug:z()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Rn={enabled:!0,level:0};function Q(){}var Xt={},Qt={once:!0},j=class{constructor({id:t}={id:""}){this.VERSION=tt,this._startTs=R(),this._deltaTs=R(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Me(`__probe-${this.id}__`,Rn),this.timeStamp(`${this.id} started`),Yt(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((R()-this._startTs).toPrecision(10))}getDelta(){return Number((R()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){if(!t)throw new Error(r||"Assertion failed")}warn(t){return this._getLogFunction(0,t,X.warn,arguments,Qt)}error(t){return this._getLogFunction(0,t,X.error,arguments)}deprecated(t,r){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(t,r){return this.error(`\`${t}\` has been removed. Use \`${r}\` instead`)}probe(t,r){return this._getLogFunction(t,r,X.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,X.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,X.debug||X.info,arguments,Qt)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Q,n&&[n],{tag:Zn(r)}):Q}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Q)}group(t,r,n={collapsed:!1}){let o=qt({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r,n={}){return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Q)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=er(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=qt({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ce(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=R();let s=i.tag||i.message;if(i.once&&s)if(!Xt[s])Xt[s]=R();else return Q;return r=Hn(this.id,i.message,i),n.bind(console,r,...i.args)}return Q}};j.VERSION=tt;function er(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ce(Number.isFinite(t)&&t>=0),t}function qt(e){let{logLevel:t,message:r}=e;e.logLevel=er(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return ce(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function Hn(e,t,r){if(typeof t=="string"){let n=r.time?Wt($t(r.total)):"";t=r.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=Kt(t,r.color,r.background)}return t}function Zn(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}globalThis.probe={};var Ys=new j({id:"@probe.gl/log"});var rt="4.4.0-alpha.0",$n=rt[0]>="0"&&rt[0]<="9"?`v${rt}`:"";function Wn(){let e=new j({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=$n,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var nt=Wn();function tr(e,t){return rr(e||{},t)}function rr(e,t,r=0){if(r>3)return t;let n={...e};for(let[o,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?n[o]=rr(n[o]||{},t[o],r+1):n[o]=t[o];return n}var Jn="",nr={};function fe(e){for(let t in nr)if(e.startsWith(t)){let r=nr[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Jn}${e}`),e}var ue=class{handle;size;bigsize;url;constructor(t){this.handle=t instanceof ArrayBuffer?new Blob([t]):t,this.size=t instanceof ArrayBuffer?t.byteLength:t.size,this.bigsize=BigInt(this.size),this.url=t instanceof File?t.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(t,r){return await this.handle.slice(Number(t),Number(t)+Number(r)).arrayBuffer()}};var ot=class{optionsType;options;data;url;loadOptions;fetch;_needsRefresh=!0;constructor(t,r,n){n?this.options=tr({...n,core:ot.defaultOptions},r):this.options={...r},this.data=t,this.url=typeof t=="string"?fe(t):"",this.loadOptions={...this.options.core?.loadOptions},this.fetch=Kn(this.loadOptions)}setProps(t){this.options=Object.assign(this.options,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}},q=ot;_e(q,"defaultOptions",{core:{type:"auto",attributions:[],loadOptions:{},loaders:[]}});function Kn(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,o)=>t(n,o);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var or="4.4.0-alpha.0";var Yn=globalThis.loaders?.parseImageNode,it=typeof Image<"u",st=typeof ImageBitmap<"u",Xn=Boolean(Yn),at=et?!0:Xn;function ir(e){switch(e){case"auto":return st||it||at;case"imagebitmap":return st;case"image":return it;case"data":return at;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function sr(){if(st)return"imagebitmap";if(it)return"image";if(at)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Qn(e){let t=qn(e);if(!t)throw new Error("Not an image");return t}function ar(e){switch(Qn(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function qn(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var eo=/^data:image\/svg\+xml/,to=/\.svg((\?|#).*)?$/;function Ue(e){return e&&(eo.test(e)||to.test(e))}function lr(e,t){if(Ue(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return lt(e,t)}function lt(e,t){if(Ue(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ce(e,t,r){let n=lr(e,r),o=self.URL||self.webkitURL,i=typeof n!="string"&&o.createObjectURL(n);try{return await ro(i||n,t)}finally{i&&o.revokeObjectURL(i)}}async function ro(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=i=>{let s=i instanceof Error?i.message:"error";o(new Error(s))}}catch(i){o(i)}})}var no={},cr=!0;async function fr(e,t,r){let n;Ue(r)?n=await Ce(e,t,r):n=lt(e,r);let o=t&&t.imagebitmap;return await oo(n,o)}async function oo(e,t=null){if((io(t)||!cr)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),cr=!1}return await createImageBitmap(e)}function io(e){for(let t in e||no)return!1;return!0}function ur(e){return!co(e,"ftyp",4)||!(e[8]&96)?null:so(e)}function so(e){switch(ao(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ao(e,t,r){return String.fromCharCode(...e.slice(t,r))}function lo(e){return[...e].map(t=>t.charCodeAt(0))}function co(e,t,r=0){let n=lo(t);for(let o=0;o<n.length;++o)if(n[o]!==e[o+r])return!1;return!0}var k=!1,he=!0;function Ne(e){let t=de(e);return uo(t)||go(t)||ho(t)||po(t)||fo(t)}function fo(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=ur(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function uo(e){let t=de(e);return t.byteLength>=24&&t.getUint32(0,k)===2303741511?{mimeType:"image/png",width:t.getUint32(16,k),height:t.getUint32(20,k)}:null}function ho(e){let t=de(e);return t.byteLength>=10&&t.getUint32(0,k)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,he),height:t.getUint16(8,he)}:null}function po(e){let t=de(e);return t.byteLength>=14&&t.getUint16(0,k)===16973&&t.getUint32(2,he)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,he),height:t.getUint32(22,he)}:null}function go(e){let t=de(e);if(!(t.byteLength>=3&&t.getUint16(0,k)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=mo(),i=2;for(;i+9<t.byteLength;){let s=t.getUint16(i,k);if(o.has(s))return{mimeType:"image/jpeg",height:t.getUint16(i+5,k),width:t.getUint16(i+7,k)};if(!n.has(s))return null;i+=2,i+=t.getUint16(i,k)}return null}function mo(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function de(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function hr(e,t){let{mimeType:r}=Ne(e)||{},n=globalThis.loaders?.parseImageNode;return le(n),await n(e,r)}async function dr(e,t,r){t=t||{};let o=(t.image||{}).type||"auto",{url:i}=r||{},s=yo(o),a;switch(s){case"imagebitmap":a=await fr(e,t,i);break;case"image":a=await Ce(e,t,i);break;case"data":a=await hr(e,t);break;default:le(!1)}return o==="data"&&(a=ar(a)),a}function yo(e){switch(e){case"auto":case"data":return sr();default:return ir(e),e}}var xo=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],wo=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],vo={image:{type:"auto",decode:!0}},ct={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:or,mimeTypes:wo,extensions:xo,parse:dr,tests:[e=>Boolean(Ne(new DataView(e)))],options:vo};function pr(e){let t=[];if(e.fields)for(let r of e.fields)t.push({name:r.name,type:Fo(r),metadata:Po(r)});return{metadata:To(e),fields:t}}function To(e){let t={};for(let[r,n]of Object.entries(e))r!=="fields"&&n&&(t[r]=JSON.stringify(n));return t}function Fo(e){switch(e.type.toLowerCase()){case"float32":return"float32";case"number":case"float64":return"float64";case"string":case"utf8":return"utf8";case"boolean":return"bool";default:return"null"}}function Po(e){let t={};for(let[r,n]of Object.entries(e))r!=="name"&&n&&(t[r]=JSON.stringify(n));return t}var xr=e=>e!==null&&typeof e=="object";function ft(e,t){if(!e||!xr(e))return null;let r={name:e.name||"",description:e.description||""};if(typeof e.generator=="string"&&(r.generator=e.generator),typeof e.generator_options=="string"&&(r.generatorOptions=e.generator_options),r.boundingBox=gr(e.bounds)||gr(e.antimeridian_adjusted_bounds),r.center=Ao(e.center),r.maxZoom=mr(e.maxzoom),r.minZoom=mr(e.minzoom),typeof e?.json=="string")try{r.metaJson=JSON.parse(e.json)}catch(a){console.warn("Failed to parse tilejson.json field",a)}let n=e.tilestats||r.metaJson?.tilestats,o=Bo(n,t),i=Io(e.vector_layers),s=Eo(i,o);return r={...r,layers:s},r.maxZoom===null&&s.length>0&&(r.maxZoom=s[0].maxZoom||null),r.minZoom===null&&s.length>0&&(r.minZoom=s[0].minZoom||null),r}function Io(e){return Array.isArray(e)?e.map(t=>bo(t)):[]}function bo(e){let t=Object.entries(e.fields||[]).map(([n,o])=>({name:n,...Fr(String(o))})),r={...e};return delete r.fields,{name:e.id||"",...r,fields:t}}function Bo(e,t){return xr(e)&&Array.isArray(e.layers)?e.layers.map(r=>So(r,t)):[]}function So(e,t){let r=[],n={},o=e.attributes||[];for(let i of o){let s=i.attribute;if(typeof s=="string")if(s.split("|").length>1){let a=s.split("|")[0];n[a]=n[a]||[],n[a].push(i),console.warn("ignoring tilestats indexed field",a)}else r[s]||r.push(Do(i,t))}return{name:e.layer||"",dominantGeometry:e.geometry,fields:r}}function Eo(e,t){return e.map(r=>{let n=t.find(s=>s.name===r.name),o=n?.fields||r.fields||[],i={...r,...n,fields:o};return i.schema=pr(i),i})}function gr(e){let t=Tr(e);if(Array.isArray(t)&&t.length===4&&[t[0],t[2]].every(vr)&&[t[1],t[3]].every(wr))return[[t[0],t[1]],[t[2],t[3]]]}function Ao(e){let t=Tr(e);return Array.isArray(t)&&t.length===3&&vr(t[0])&&wr(t[1])&&_o(t[2])?t:null}function mr(e){let t=typeof e=="string"?parseFloat(e):typeof e=="number"?e:null;return t===null||isNaN(t)?null:t}function wr(e){return Number.isFinite(e)&&e<=90&&e>=-90}function vr(e){return Number.isFinite(e)&&e<=180&&e>=-180}function _o(e){return Number.isFinite(e)&&e>=0&&e<=22}function Tr(e){return typeof e=="string"?e.split(",").map(parseFloat):Array.isArray(e)?e:null}var yr={number:{type:"float32"},numeric:{type:"float32"},string:{type:"utf8"},vachar:{type:"utf8"},float:{type:"float32"},int:{type:"int32"},int4:{type:"int32"},boolean:{type:"boolean"},bool:{type:"boolean"}};function Do(e={},t){let r=Fr(e.type),n={name:e.attribute,...r};return typeof e.min=="number"&&(n.min=e.min),typeof e.max=="number"&&(n.max=e.max),typeof e.count=="number"&&(n.uniqueValueCount=e.count),e.values&&(n.values=e.values),n.values&&typeof t.maxValues=="number"&&(n.values=n.values?.slice(0,t.maxValues)),n}function Fr(e){let t=e.toLowerCase();return!t||yr[t],yr[t]||{type:"string"}}var Lo="4.4.0-alpha.0",pe={dataType:null,batchType:null,name:"TileJSON",id:"tilejson",module:"pmtiles",version:Lo,worker:!0,extensions:["json"],mimeTypes:["application/json"],text:!0,options:{tilejson:{maxValues:void 0}},parse:async(e,t)=>{let r=new TextDecoder().decode(e),n=JSON.parse(r),o={...pe.options.tilejson,...t?.tilejson};return ft(n,o)},parseTextSync:(e,t)=>{let r=JSON.parse(e),n={...pe.options.tilejson,...t?.tilejson};return ft(r,n)}};var ge={x:0,y:1,z:2};function H(e,t={}){let{start:r=0,end:n=e.length,plane:o="xy"}=t,i=t.size||2,s=0,a=ge[o[0]],l=ge[o[1]];for(let c=r,f=n-i;c<n;c+=i)s+=(e[c+a]-e[f+a])*(e[c+l]+e[f+l]),f=c;return s/2}function ht(e,t,r=2,n,o="xy"){let i=t&&t.length,s=i?t[0]*r:e.length,a=Ir(e,0,s,r,!0,n&&n[0],o),l=[];if(!a||a.next===a.prev)return l;let c,f,u,h,d,p,y;if(i&&(a=Go(e,t,a,r,n,o)),e.length>80*r){h=f=e[0],d=u=e[1];for(let P=r;P<s;P+=r)p=e[P],y=e[P+1],p<h&&(h=p),y<d&&(d=y),p>f&&(f=p),y>u&&(u=y);c=Math.max(f-h,u-d),c=c!==0?32767/c:0}return me(a,l,r,h,d,c,0),l}function Ir(e,t,r,n,o,i,s){let a,l;i===void 0&&(i=H(e,{start:t,end:r,size:n,plane:s}));let c=ge[s[0]],f=ge[s[1]];if(o===i<0)for(a=t;a<r;a+=n)l=Pr(a,e[a+c],e[a+f],l);else for(a=r-n;a>=t;a-=n)l=Pr(a,e[a+c],e[a+f],l);return l&&Oe(l,l.next)&&(xe(l),l=l.next),l}function Z(e,t){if(!e)return e;t||(t=e);let r=e,n;do if(n=!1,!r.steiner&&(Oe(r,r.next)||T(r.prev,r,r.next)===0)){if(xe(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function me(e,t,r,n,o,i,s){if(!e)return;!s&&i&&Ho(e,n,o,i);let a=e,l,c;for(;e.prev!==e.next;){if(l=e.prev,c=e.next,i?Co(e,n,o,i):Uo(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(c.i/r|0),xe(e),e=c.next,a=c.next;continue}if(e=c,e===a){s?s===1?(e=No(Z(e),t,r),me(e,t,r,n,o,i,2)):s===2&&ko(e,t,r,n,o,i):me(Z(e),t,r,n,o,i,1);break}}}function Uo(e){let t=e.prev,r=e,n=e.next;if(T(t,r,n)>=0)return!1;let o=t.x,i=r.x,s=n.x,a=t.y,l=r.y,c=n.y,f=o<i?o<s?o:s:i<s?i:s,u=a<l?a<c?a:c:l<c?l:c,h=o>i?o>s?o:s:i>s?i:s,d=a>l?a>c?a:c:l>c?l:c,p=n.next;for(;p!==t;){if(p.x>=f&&p.x<=h&&p.y>=u&&p.y<=d&&ee(o,a,i,l,s,c,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Co(e,t,r,n){let o=e.prev,i=e,s=e.next;if(T(o,i,s)>=0)return!1;let a=o.x,l=i.x,c=s.x,f=o.y,u=i.y,h=s.y,d=a<l?a<c?a:c:l<c?l:c,p=f<u?f<h?f:h:u<h?u:h,y=a>l?a>c?a:c:l>c?l:c,P=f>u?f>h?f:h:u>h?u:h,D=ut(d,p,t,r,n),v=ut(y,P,t,r,n),m=e.prevZ,g=e.nextZ;for(;m&&m.z>=D&&g&&g.z<=v;){if(m.x>=d&&m.x<=y&&m.y>=p&&m.y<=P&&m!==o&&m!==s&&ee(a,f,l,u,c,h,m.x,m.y)&&T(m.prev,m,m.next)>=0||(m=m.prevZ,g.x>=d&&g.x<=y&&g.y>=p&&g.y<=P&&g!==o&&g!==s&&ee(a,f,l,u,c,h,g.x,g.y)&&T(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=D;){if(m.x>=d&&m.x<=y&&m.y>=p&&m.y<=P&&m!==o&&m!==s&&ee(a,f,l,u,c,h,m.x,m.y)&&T(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=v;){if(g.x>=d&&g.x<=y&&g.y>=p&&g.y<=P&&g!==o&&g!==s&&ee(a,f,l,u,c,h,g.x,g.y)&&T(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function No(e,t,r){let n=e;do{let o=n.prev,i=n.next.next;!Oe(o,i)&&br(o,n,n.next,i)&&ye(o,i)&&ye(i,o)&&(t.push(o.i/r|0),t.push(n.i/r|0),t.push(i.i/r|0),xe(n),xe(n.next),n=e=i),n=n.next}while(n!==e);return Z(n)}function ko(e,t,r,n,o,i){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Wo(s,a)){let l=Br(s,a);s=Z(s,s.next),l=Z(l,l.next),me(s,t,r,n,o,i,0),me(l,t,r,n,o,i,0);return}a=a.next}s=s.next}while(s!==e)}function Go(e,t,r,n,o,i){let s=[],a,l,c,f,u;for(a=0,l=t.length;a<l;a++)c=t[a]*n,f=a<l-1?t[a+1]*n:e.length,u=Ir(e,c,f,n,!1,o&&o[a+1],i),u===u.next&&(u.steiner=!0),s.push($o(u));for(s.sort(Oo),a=0;a<s.length;a++)r=jo(s[a],r);return r}function Oo(e,t){return e.x-t.x}function jo(e,t){let r=zo(e,t);if(!r)return t;let n=Br(r,e);return Z(n,n.next),Z(r,r.next)}function zo(e,t){let r=t,n=e.x,o=e.y,i=-1/0,s;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){let h=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(h<=n&&h>i&&(i=h,s=r.x<r.next.x?r:r.next,h===n))return s}r=r.next}while(r!==t);if(!s)return null;let a=s,l=s.x,c=s.y,f=1/0,u;r=s;do n>=r.x&&r.x>=l&&n!==r.x&&ee(o<c?n:i,o,l,c,o<c?i:n,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(n-r.x),ye(r,e)&&(u<f||u===f&&(r.x>s.x||r.x===s.x&&Ro(s,r)))&&(s=r,f=u)),r=r.next;while(r!==a);return s}function Ro(e,t){return T(e.prev,e,t.prev)<0&&T(t.next,e,e.next)<0}function Ho(e,t,r,n){let o=e;do o.z===0&&(o.z=ut(o.x,o.y,t,r,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,Zo(o)}function Zo(e){let t,r,n=1,o,i,s,a,l,c;do{for(i=e,e=null,c=null,o=0;i;){for(o++,a=i,s=0,r=0;r<n&&(s++,a=a.nextZ,!!a);r++);for(l=n;s>0||l>0&&a;)s!==0&&(l===0||!a||i.z<=a.z)?(t=i,i=i.nextZ,s--):(t=a,a=a.nextZ,l--),c?c.nextZ=t:e=t,t.prevZ=c,c=t;i=a}c.nextZ=null,n*=2}while(o>1);return e}function ut(e,t,r,n,o){return e=(e-r)*o|0,t=(t-n)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function $o(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function ee(e,t,r,n,o,i,s,a){return(o-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(n-a)>=(r-s)*(t-a)&&(r-s)*(i-a)>=(o-s)*(n-a)}function Wo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Jo(e,t)&&(ye(e,t)&&ye(t,e)&&Ko(e,t)&&(T(e.prev,e,t.prev)||T(e,t.prev,t))||Oe(e,t)&&T(e.prev,e,e.next)>0&&T(t.prev,t,t.next)>0)}function T(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Oe(e,t){return e.x===t.x&&e.y===t.y}function br(e,t,r,n){let o=Ge(T(e,t,r)),i=Ge(T(e,t,n)),s=Ge(T(r,n,e)),a=Ge(T(r,n,t));return!!(o!==i&&s!==a||o===0&&ke(e,r,t)||i===0&&ke(e,n,t)||s===0&&ke(r,e,n)||a===0&&ke(r,t,n))}function ke(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ge(e){return e>0?1:e<0?-1:0}function Jo(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&br(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function ye(e,t){return T(e.prev,e,e.next)<0?T(e,t,e.next)>=0&&T(e,e.prev,t)>=0:T(e,t,e.prev)<0||T(e,e.next,t)<0}function Ko(e,t){let r=e,n=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do r.y>i!=r.next.y>i&&r.next.y!==r.y&&o<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Br(e,t){let r=new we(e.i,e.x,e.y),n=new we(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=o,o.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function Pr(e,t,r,n){let o=new we(e,t,r);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function xe(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}var we=class{constructor(t,r,n){this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1,this.i=t,this.x=r,this.y=n}};function je(e,t,r){let n=ei(e),o=Object.keys(n).filter(i=>n[i]!==Array);return ti(e,{propArrayTypes:n,...t},{numericPropKeys:r&&r.numericPropKeys||o,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function ei(e){let t={};for(let r of e)if(r.properties)for(let n in r.properties){let o=r.properties[n];t[n]=ai(o,t[n])}return t}function ti(e,t,r){let{pointPositionsCount:n,pointFeaturesCount:o,linePositionsCount:i,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:c,polygonRingsCount:f,polygonFeaturesCount:u,propArrayTypes:h,coordLength:d}=t,{numericPropKeys:p=[],PositionDataType:y=Float32Array,triangulate:P=!0}=r,D=e[0]&&"id"in e[0],v=e.length>65535?Uint32Array:Uint16Array,m={type:"Point",positions:new y(n*d),globalFeatureIds:new v(n),featureIds:o>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},g={type:"LineString",pathIndices:i>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new y(i*d),globalFeatureIds:new v(i),featureIds:a>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},S={type:"Polygon",polygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:l>65535?new Uint32Array(f+1):new Uint16Array(f+1),positions:new y(l*d),globalFeatureIds:new v(l),featureIds:u>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};P&&(S.triangles=[]);for(let M of[m,g,S])for(let I of p){let E=h[I];M.numericProps[I]=new E(M.positions.length/d)}g.pathIndices[s]=i,S.polygonIndices[c]=l,S.primitivePolygonIndices[f]=l;let C={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let M of e){let I=M.geometry,E=M.properties||{};switch(I.type){case"Point":ri(I,m,C,d,E),m.properties.push(pt(E,p)),D&&m.fields.push({id:M.id}),C.pointFeature++;break;case"LineString":ni(I,g,C,d,E),g.properties.push(pt(E,p)),D&&g.fields.push({id:M.id}),C.lineFeature++;break;case"Polygon":oi(I,S,C,d,E),S.properties.push(pt(E,p)),D&&S.fields.push({id:M.id}),C.polygonFeature++;break;default:throw new Error("Invalid geometry type")}C.feature++}return si(m,g,S,d)}function ri(e,t,r,n,o){t.positions.set(e.data,r.pointPosition*n);let i=e.data.length/n;gt(t,o,r.pointPosition,i),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+i),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+i),r.pointPosition+=i}function ni(e,t,r,n,o){t.positions.set(e.data,r.linePosition*n);let i=e.data.length/n;gt(t,o,r.linePosition,i),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+i),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+i);for(let s=0,a=e.indices.length;s<a;++s){let l=e.indices[s],c=s===a-1?e.data.length:e.indices[s+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-l)/n}}function oi(e,t,r,n,o){t.positions.set(e.data,r.polygonPosition*n);let i=e.data.length/n;gt(t,o,r.polygonPosition,i),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+i),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+i);for(let s=0,a=e.indices.length;s<a;++s){let l=r.polygonPosition;t.polygonIndices[r.polygonObject++]=l;let c=e.areas[s],f=e.indices[s],u=e.indices[s+1];for(let d=0,p=f.length;d<p;++d){let y=f[d],P=d===p-1?u===void 0?e.data.length:u[0]:f[d+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(P-y)/n}let h=r.polygonPosition;ii(t,c,f,{startPosition:l,endPosition:h,coordLength:n})}}function ii(e,t,r,{startPosition:n,endPosition:o,coordLength:i}){if(!e.triangles)return;let s=n*i,a=o*i,l=e.positions.subarray(s,a),c=r[0],f=r.slice(1).map(h=>(h-c)/i),u=ht(l,f,i,t);for(let h=0,d=u.length;h<d;++h)e.triangles.push(n+u[h])}function dt(e,t){let r={};for(let n in e)r[n]={value:e[n],size:t};return r}function si(e,t,r,n){let o={shape:"binary-feature-collection",points:{...e,positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:dt(e.numericProps,1)},lines:{...t,positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:dt(t.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:dt(r.numericProps,1)}};return o.polygons&&r.triangles&&(o.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),o}function gt(e,t,r,n){for(let o in e.numericProps)if(o in t){let i=t[o];e.numericProps[o].fill(i,r,r+n)}}function pt(e,t){let r={};for(let n in e)t.includes(n)||(r[n]=e[n]);return r}function ai(e,t){return t===Array||!Number.isFinite(e)?Array:t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array}var Tt=jt(Ur(),1);function bi(e){let t=0;for(let r=0,n=e.length-1,o,i;r<e.length;n=r++)o=e[r],i=e[n],t+=(i[0]-o[0])*(o[1]+i[1]);return t}function xt(e,t){if(Array.isArray(e[0])){for(let n of e)xt(n,t);return}let r=e;r[0]/=t,r[1]/=t}function Cr(e,t){for(let r=0;r<e.length;++r)e[r]/=t}function wt(e,t,r){if(typeof e[0][0]!="number"){for(let s of e)wt(s,t,r);return}let n=r*Math.pow(2,t.z),o=r*t.x,i=r*t.y;for(let s=0;s<e.length;s++){let a=e[s];a[0]=(a[0]+o)*360/n-180;let l=180-(a[1]+i)*360/n;a[1]=360/Math.PI*Math.atan(Math.exp(l*Math.PI/180))-90}}function Nr(e,t,r){let{x:n,y:o,z:i}=t,s=r*Math.pow(2,i),a=r*n,l=r*o;for(let c=0,f=e.length;c<f;c+=2){e[c]=(e[c]+a)*360/s-180;let u=180-(e[c+1]+l)*360/s;e[c+1]=360/Math.PI*Math.atan(Math.exp(u*Math.PI/180))-90}}function kr(e){let t=e.length;if(t<=1)return[e];let r=[],n,o;for(let i=0;i<t;i++){let s=bi(e[i]);s!==0&&(o===void 0&&(o=s<0),o===s<0?(n&&r.push(n),n=[e[i]]):n&&n.push(e[i]))}return n&&r.push(n),r}function Gr(e){let t=e.indices.length,r="Polygon";if(t<=1)return{type:r,data:e.data,areas:[[H(e.data)]],indices:[e.indices]};let n=[],o=[],i=[],s=[],a,l=0;for(let c,f=0,u;f<t;f++){u=e.indices[f]-l,c=e.indices[f+1]-l||e.data.length;let h=e.data.slice(u,c),d=H(h);if(d===0){let p=e.data.slice(0,u),y=e.data.slice(c);e.data=p.concat(y),l+=c-u;continue}a===void 0&&(a=d<0),a===d<0?(s.length&&(n.push(i),o.push(s)),s=[u],i=[d]):(i.push(d),s.push(u))}return i&&n.push(i),s.length&&o.push(s),{type:r,areas:n,indices:o,data:e.data}}var $=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(t,r,n,o,i,s){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=o,this._values=i,this._geometryInfo=s,t.readFields(Bi,this,r)}toGeoJSONFeature(t,r){let n=this.loadGeometry();switch(t){case"wgs84":return Or(this,n,o=>wt(o,r,this.extent));default:return Or(this,n,xt)}}toBinaryFeature(t,r){let n=this.loadFlatGeometry();switch(t){case"wgs84":return this._toBinaryCoordinates(n,o=>Nr(o,r,this.extent));default:return this._toBinaryCoordinates(n,Cr)}}bbox(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,o=0,i=0,s=0,a=1/0,l=-1/0,c=1/0,f=-1/0;for(;t.pos<r;){if(o<=0){let u=t.readVarint();n=u&7,o=u>>3}if(o--,n===1||n===2)i+=t.readSVarint(),s+=t.readSVarint(),i<a&&(a=i),i>l&&(l=i),s<c&&(c=s),s>f&&(f=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[a,c,l,f]}_toBinaryCoordinates(t,r){let n;r(t.data,this.extent);let o=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=t.indices.length,n={type:"Point",...t};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=t.indices.length,this._geometryInfo.linePositionsCount+=t.data.length/o,n={type:"LineString",...t};break;case 3:n=Gr(t),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/o;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let i={type:"Feature",geometry:n,properties:this.properties};return this.id!==null&&(i.id=this.id),i}loadGeometry(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,o=0,i=0,s=0,a=[],l;for(;t.pos<r;){if(o<=0){let c=t.readVarint();n=c&7,o=c>>3}switch(o--,n){case 1:case 2:i+=t.readSVarint(),s+=t.readSVarint(),n===1&&(l&&a.push(l),l=[]),l&&l.push([i,s]);break;case 7:l&&l.push(l[0].slice());break;default:throw new Error(`unknown command ${n}`)}}return l&&a.push(l),a}loadFlatGeometry(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,o,i=0,s=0,a=0,l=0,c=[],f=[];for(;t.pos<r;)if(i<=0&&(o=t.readVarint(),n=o&7,i=o>>3),i--,n===1||n===2)s+=t.readSVarint(),a+=t.readSVarint(),n===1&&c.push(l),f.push(s,a),l+=2;else if(n===7){if(l>0){let u=c[c.length-1];f.push(f[u],f[u+1]),l+=2}}else throw new Error(`unknown command ${n}`);return{data:f,indices:c}}};_e($,"types",["Unknown","Point","LineString","Polygon"]);function Or(e,t,r){let n=$.types[e.type],o,i,s;switch(e.type){case 1:let l=[];for(o=0;o<t.length;o++)l[o]=t[o][0];s=l,r(s,e.extent);break;case 2:for(s=t,o=0;o<s.length;o++)r(s[o],e.extent);break;case 3:for(s=kr(t),o=0;o<s.length;o++)for(i=0;i<s[o].length;i++)r(s[o][i],e.extent);break;default:throw new Error("illegal vector tile type")}s.length===1?s=s[0]:n=`Multi${n}`;let a={type:"Feature",geometry:{type:n,coordinates:s},properties:e.properties};return e.id!==null&&(a.properties||={},a.properties.id=e.id),a}function Bi(e,t,r){t&&r&&(e===1?t.id=r.readVarint():e===2?Si(r,t):e===3?t.type=r.readVarint():e===4&&(t._geometry=r.pos))}function Si(e,t){let r=e.readVarint()+e.pos;for(;e.pos<r;){let n=t._keys[e.readVarint()],o=t._values[e.readVarint()];t.properties[n]=o}}var He=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(t,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ei,this,r),this.length=this._features.length}getGeoJSONFeature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let r=this._pbf.readVarint()+this._pbf.pos;return new $(this._pbf,r,this.extent,this._keys,this._values)}getBinaryFeature(t,r){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let n=this._pbf.readVarint()+this._pbf.pos;return new $(this._pbf,n,this.extent,this._keys,this._values,r)}};function Ei(e,t,r){t&&r&&(e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(Ai(r)))}function Ai(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}var ve=class{layers;constructor(t,r){this.layers=t.readFields(_i,{},r)}};function _i(e,t,r){if(e===3&&r){let n=new He(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function Ft(e,t){let r=Li(t),n=t?.gis?.format||t?.mvt?.shape||t?.shape;switch(n){case"columnar-table":return{shape:"columnar-table",data:vt(e,r)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:jr(e,r)};case"geojson":return jr(e,r);case"binary-geometry":return vt(e,r);case"binary":return vt(e,r);default:throw new Error(n||"undefined shape")}}function vt(e,t){let[r,n]=Di(e,t),o=je(r,n);return o.byteLength=e.byteLength,o}function Di(e,t){let r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];let o=new ve(new Tt.default(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(o.layers)).forEach(s=>{let a=o.layers[s];if(a)for(let l=0;l<a.length;l++){let c=a.getBinaryFeature(l,n),f=Vi(c,t,s);r.push(f)}}),[r,n]}function jr(e,t){if(e.byteLength<=0)return[];let r=[],n=new ve(new Tt.default(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach(i=>{let s=n.layers[i];if(s)for(let a=0;a<s.length;a++){let l=s.getGeoJSONFeature(a),c=Mi(l,t,i);r.push(c)}}),r}function Li(e){if(!e?.mvt)throw new Error("mvt options required");if(e.mvt?.coordinates==="wgs84"&&!e.mvt.tileIndex)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.gis&&nt.warn('MVTLoader: "options.gis" is deprecated, use "options.mvt.shape" instead')(),e.mvt}function Mi(e,t,r){let n=e.toGeoJSONFeature(t.coordinates||"local",t.tileIndex);return t.layerProperty&&(n.properties||={},n.properties[t.layerProperty]=r),n}function Vi(e,t,r){let n=e.toBinaryFeature(t.coordinates||"local",t.tileIndex);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}var zr={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],category:"geometry"};var Ui="4.4.0-alpha.0",Rr={...zr,dataType:null,batchType:null,version:Ui,worker:!0,options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:void 0}}},Pt={...Rr,parse:async(e,t)=>Ft(e,t),parseSync:Ft,binary:!0};var Ze={name:"PMTiles",id:"pmtiles",module:"pmtiles",extensions:["pmtiles"],mimeTypes:["application/octet-stream"],tests:["PMTiles"]};var Ie={};Ot(Ie,{Compression:()=>an,EtagMismatch:()=>We,FetchSource:()=>un,FileSource:()=>gs,PMTiles:()=>Et,Protocol:()=>cs,ResolvedValueCache:()=>ys,SharedPromiseCache:()=>mn,TileType:()=>ln,bytesToHeader:()=>hn,findTile:()=>fn,getUint64:()=>_,leafletRasterLayer:()=>as,readVarint:()=>oe,tileIdToZxy:()=>ds,tileTypeExt:()=>cn,zxyToTileId:()=>sn});var W=Math.pow,F=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())}),B=Uint8Array,ie=Uint16Array,Ci=Int32Array,$r=new B([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Wr=new B([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ni=new B([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jr=function(e,t){for(var r=new ie(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Ci(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},Kr=Jr($r,2),Yr=Kr.b,ki=Kr.r;Yr[28]=258,ki[258]=28;var Xr=Jr(Wr,0),Gi=Xr.b,ic=Xr.r,Bt=new ie(32768);for(w=0;w<32768;++w)O=(w&43690)>>1|(w&21845)<<1,O=(O&52428)>>2|(O&13107)<<2,O=(O&61680)>>4|(O&3855)<<4,Bt[w]=((O&65280)>>8|(O&255)<<8)>>1;var O,w,Fe=function(e,t,r){for(var n=e.length,o=0,i=new ie(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new ie(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new ie(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],f=t-e[o],u=s[e[o]-1]++<<f,h=u|(1<<f)-1;u<=h;++u)a[Bt[u]>>l]=c}else for(a=new ie(n),o=0;o<n;++o)e[o]&&(a[o]=Bt[s[e[o]-1]++]>>15-e[o]);return a},Pe=new B(288);for(w=0;w<144;++w)Pe[w]=8;var w;for(w=144;w<256;++w)Pe[w]=9;var w;for(w=256;w<280;++w)Pe[w]=7;var w;for(w=280;w<288;++w)Pe[w]=8;var w,Qr=new B(32);for(w=0;w<32;++w)Qr[w]=5;var w,Oi=Fe(Pe,9,1),ji=Fe(Qr,5,1),It=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},U=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},bt=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},zi=function(e){return(e+7)/8|0},Ri=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new B(r-t);return n.set(e.subarray(t,r)),n},Hi=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],b=function(e,t,r){var n=new Error(t||Hi[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,b),!r)throw n;return n},At=function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new B(0);var s=!r||t.i!=2,a=t.i;r||(r=new B(o*3));var l=function(Nt){var kt=r.length;if(Nt>kt){var Gt=new B(Math.max(kt*2,Nt));Gt.set(r),r=Gt}},c=t.f||0,f=t.p||0,u=t.b||0,h=t.l,d=t.d,p=t.m,y=t.n,P=o*8;do{if(!h){c=U(e,f,1);var D=U(e,f+1,3);if(f+=3,D)if(D==1)h=Oi,d=ji,p=9,y=5;else if(D==2){var S=U(e,f,31)+257,C=U(e,f+10,15)+4,M=S+U(e,f+5,31)+1;f+=14;for(var I=new B(M),E=new B(19),A=0;A<C;++A)E[Ni[A]]=U(e,f+A*3,7);f+=C*3;for(var Lt=It(E),Tn=(1<<Lt)-1,Fn=Fe(E,Lt,1),A=0;A<M;){var Mt=Fn[U(e,f,Tn)];f+=Mt&15;var v=Mt>>4;if(v<16)I[A++]=v;else{var K=0,Se=0;for(v==16?(Se=3+U(e,f,3),f+=2,K=I[A-1]):v==17?(Se=3+U(e,f,7),f+=3):v==18&&(Se=11+U(e,f,127),f+=7);Se--;)I[A++]=K}}var Vt=I.subarray(0,S),V=I.subarray(S);p=It(Vt),y=It(V),h=Fe(Vt,p,1),d=Fe(V,y,1)}else b(1);else{var v=zi(f)+4,m=e[v-4]|e[v-3]<<8,g=v+m;if(g>o){a&&b(0);break}s&&l(u+m),r.set(e.subarray(v,g),u),t.b=u+=m,t.p=f=g*8,t.f=c;continue}if(f>P){a&&b(0);break}}s&&l(u+131072);for(var Pn=(1<<p)-1,In=(1<<y)-1,Ke=f;;Ke=f){var K=h[bt(e,f)&Pn],Y=K>>4;if(f+=K&15,f>P){a&&b(0);break}if(K||b(2),Y<256)r[u++]=Y;else if(Y==256){Ke=f,h=null;break}else{var Ut=Y-254;if(Y>264){var A=Y-257,se=$r[A];Ut=U(e,f,(1<<se)-1)+Yr[A],f+=se}var Ye=d[bt(e,f)&In],Xe=Ye>>4;Ye||b(3),f+=Ye&15;var V=Gi[Xe];if(Xe>3){var se=Wr[Xe];V+=bt(e,f)&(1<<se)-1,f+=se}if(f>P){a&&b(0);break}s&&l(u+131072);var Qe=u+Ut;if(u<V){var Ct=i-V,bn=Math.min(V,Qe);for(Ct+u<0&&b(3);u<bn;++u)r[u]=n[Ct+u]}for(;u<Qe;u+=4)r[u]=r[u-V],r[u+1]=r[u+1-V],r[u+2]=r[u+2-V],r[u+3]=r[u+3-V];u=Qe}}t.l=h,t.p=Ke,t.b=u,t.f=c,h&&(c=1,t.m=p,t.d=d,t.n=y)}while(!c);return u==r.length?r:Ri(r,0,u)},Zi=new B(0),$i=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&b(6,"invalid gzip data");var t=e[3],r=10;t&4&&(r+=(e[10]|e[11]<<8)+2);for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(t&2)},Wi=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Ji=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&b(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&b(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function Ki(e,t){return At(e,{i:2},t&&t.out,t&&t.dictionary)}function Yi(e,t){var r=$i(e);return r+8>e.length&&b(6,"invalid gzip data"),At(e.subarray(r,-8),{i:2},t&&t.out||new B(Wi(e)),t&&t.dictionary)}function Xi(e,t){return At(e.subarray(Ji(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}function St(e,t){return e[0]==31&&e[1]==139&&e[2]==8?Yi(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?Ki(e,t):Xi(e,t)}var Qi=typeof TextDecoder<"u"&&new TextDecoder,qi=0;try{Qi.decode(Zi,{stream:!0}),qi=1}catch{}var qr=(e,t)=>e*W(2,t),Te=(e,t)=>Math.floor(e/W(2,t)),$e=(e,t)=>qr(e.getUint16(t+1,!0),8)+e.getUint8(t),en=(e,t)=>qr(e.getUint32(t+2,!0),16)+e.getUint16(t,!0),es=(e,t,r,n,o)=>{if(e!==n.getUint8(o))return e-n.getUint8(o);let i=$e(n,o+1);if(t!==i)return t-i;let s=$e(n,o+4);return r!==s?r-s:0},ts=(e,t,r,n)=>{let o=tn(e,t|128,r,n);return o?{z:t,x:r,y:n,offset:o[0],length:o[1],isDir:!0}:null},Hr=(e,t,r,n)=>{let o=tn(e,t,r,n);return o?{z:t,x:r,y:n,offset:o[0],length:o[1],isDir:!1}:null},tn=(e,t,r,n)=>{let o=0,i=e.byteLength/17-1;for(;o<=i;){let s=i+o>>1,a=es(t,r,n,e,s*17);if(a>0)o=s+1;else if(a<0)i=s-1;else return[en(e,s*17+7),e.getUint32(s*17+13,!0)]}return null},rs=(e,t)=>e.isDir&&!t.isDir?1:!e.isDir&&t.isDir?-1:e.z!==t.z?e.z-t.z:e.x!==t.x?e.x-t.x:e.y-t.y,rn=(e,t)=>{let r=e.getUint8(t*17);return{z:r&127,x:$e(e,t*17+1),y:$e(e,t*17+4),offset:en(e,t*17+7),length:e.getUint32(t*17+13,!0),isDir:r>>7===1}},Zr=e=>{let t=[],r=new DataView(e);for(let n=0;n<r.byteLength/17;n++)t.push(rn(r,n));return ns(t)},ns=e=>{e.sort(rs);let t=new ArrayBuffer(17*e.length),r=new Uint8Array(t);for(let n=0;n<e.length;n++){let o=e[n],i=o.z;o.isDir&&(i=i|128),r[n*17]=i,r[n*17+1]=o.x&255,r[n*17+2]=o.x>>8&255,r[n*17+3]=o.x>>16&255,r[n*17+4]=o.y&255,r[n*17+5]=o.y>>8&255,r[n*17+6]=o.y>>16&255,r[n*17+7]=o.offset&255,r[n*17+8]=Te(o.offset,8)&255,r[n*17+9]=Te(o.offset,16)&255,r[n*17+10]=Te(o.offset,24)&255,r[n*17+11]=Te(o.offset,32)&255,r[n*17+12]=Te(o.offset,48)&255,r[n*17+13]=o.length&255,r[n*17+14]=o.length>>8&255,r[n*17+15]=o.length>>16&255,r[n*17+16]=o.length>>24&255}return t},os=(e,t)=>{if(e.byteLength<17)return null;let r=e.byteLength/17,n=rn(e,r-1);if(n.isDir){let o=n.z,i=t.z-o,s=Math.trunc(t.x/(1<<i)),a=Math.trunc(t.y/(1<<i));return{z:o,x:s,y:a}}return null};function is(e){return F(this,null,function*(){let t=yield e.getBytes(0,512e3),r=new DataView(t.data),n=r.getUint32(4,!0),o=r.getUint16(8,!0),i=new TextDecoder("utf-8"),s=JSON.parse(i.decode(new DataView(t.data,10,n))),a=0;s.compression==="gzip"&&(a=2);let l=0;"minzoom"in s&&(l=+s.minzoom);let c=0;"maxzoom"in s&&(c=+s.maxzoom);let f=0,u=0,h=0,d=-180,p=-85,y=180,P=85;if(s.bounds){let v=s.bounds.split(",");d=+v[0],p=+v[1],y=+v[2],P=+v[3]}if(s.center){let v=s.center.split(",");f=+v[0],u=+v[1],h=+v[2]}return{specVersion:r.getUint16(2,!0),rootDirectoryOffset:10+n,rootDirectoryLength:o*17,jsonMetadataOffset:10,jsonMetadataLength:n,leafDirectoryOffset:0,leafDirectoryLength:void 0,tileDataOffset:0,tileDataLength:void 0,numAddressedTiles:0,numTileEntries:0,numTileContents:0,clustered:!1,internalCompression:1,tileCompression:a,tileType:1,minZoom:l,maxZoom:c,minLon:d,minLat:p,maxLon:y,maxLat:P,centerZoom:h,centerLon:f,centerLat:u,etag:t.etag}})}function ss(e,t,r,n,o,i,s){return F(this,null,function*(){let a=yield r.getArrayBuffer(t,e.rootDirectoryOffset,e.rootDirectoryLength,e);e.specVersion===1&&(a=Zr(a));let l=Hr(new DataView(a),n,o,i);if(l){let u=(yield t.getBytes(l.offset,l.length,s)).data,h=new DataView(u);return h.getUint8(0)===31&&h.getUint8(1)===139&&(u=St(new Uint8Array(u))),{data:u}}let c=os(new DataView(a),{z:n,x:o,y:i});if(c){let f=ts(new DataView(a),c.z,c.x,c.y);if(f){let u=yield r.getArrayBuffer(t,f.offset,f.length,e);e.specVersion===1&&(u=Zr(u));let h=Hr(new DataView(u),n,o,i);if(h){let p=(yield t.getBytes(h.offset,h.length,s)).data,y=new DataView(p);return y.getUint8(0)===31&&y.getUint8(1)===139&&(p=St(new Uint8Array(p))),{data:p}}}}})}var nn={getHeader:is,getZxy:ss},as=(e,t)=>{let r=!1,n="",o=L.GridLayer.extend({createTile:(i,s)=>{let a=document.createElement("img"),l=new AbortController,c=l.signal;return a.cancel=()=>{l.abort()},r||(e.getHeader().then(f=>{f.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):f.tileType===2?n="image/png":f.tileType===3?n="image/jpeg":f.tileType===4?n="image/webp":f.tileType===5&&(n="image/avif")}),r=!0),e.getZxy(i.z,i.x,i.y,c).then(f=>{if(f){let u=new Blob([f.data],{type:n}),h=window.URL.createObjectURL(u);a.src=h,a.cancel=void 0,s(void 0,a)}}).catch(f=>{if(f.name!=="AbortError")throw f}),a},_removeTile:function(i){let s=this._tiles[i];s&&(s.el.cancel&&s.el.cancel(),s.el.width=0,s.el.height=0,s.el.deleted=!0,L.DomUtil.remove(s.el),delete this._tiles[i],this.fire("tileunload",{tile:s.el,coords:this._keyToTileCoords(i)}))}});return new o(t)},ls=e=>(t,r)=>{if(r instanceof AbortController)return e(t,r);let n=new AbortController;return e(t,n).then(o=>r(void 0,o.data,o.cacheControl||"",o.expires||""),o=>r(o)).catch(o=>r(o)),{cancel:()=>n.abort()}},cs=class{constructor(){this.tilev4=(e,t)=>F(this,null,function*(){if(e.type==="json"){let u=e.url.substr(10),h=this.tiles.get(u);h||(h=new Et(u),this.tiles.set(u,h));let d=yield h.getHeader();return{data:{tiles:[`${e.url}/{z}/{x}/{y}`],minzoom:d.minZoom,maxzoom:d.maxZoom,bounds:[d.minLon,d.minLat,d.maxLon,d.maxLat]}}}let r=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),n=e.url.match(r);if(!n)throw new Error("Invalid PMTiles protocol URL");let o=n[1],i=this.tiles.get(o);i||(i=new Et(o),this.tiles.set(o,i));let s=n[2],a=n[3],l=n[4],c=yield i.getHeader(),f=yield i?.getZxy(+s,+a,+l,t.signal);return f?{data:new Uint8Array(f.data),cacheControl:f.cacheControl,expires:f.expires}:c.tileType===1?{data:new Uint8Array}:{data:null}}),this.tile=ls(this.tilev4),this.tiles=new Map}add(e){this.tiles.set(e.source.getKey(),e)}get(e){return this.tiles.get(e)}};function ne(e,t){return(t>>>0)*4294967296+(e>>>0)}function fs(e,t){let r=t.buf,n=r[t.pos++],o=(n&112)>>4;if(n<128||(n=r[t.pos++],o|=(n&127)<<3,n<128)||(n=r[t.pos++],o|=(n&127)<<10,n<128)||(n=r[t.pos++],o|=(n&127)<<17,n<128)||(n=r[t.pos++],o|=(n&127)<<24,n<128)||(n=r[t.pos++],o|=(n&1)<<31,n<128))return ne(e,o);throw new Error("Expected varint not more than 10 bytes")}function oe(e){let t=e.buf,r=t[e.pos++],n=r&127;return r<128||(r=t[e.pos++],n|=(r&127)<<7,r<128)||(r=t[e.pos++],n|=(r&127)<<14,r<128)||(r=t[e.pos++],n|=(r&127)<<21,r<128)?n:(r=t[e.pos],n|=(r&15)<<28,fs(n,e))}function on(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let o=t[0];t[0]=t[1],t[1]=o}}function us(e,t){let r=W(2,e),n=t,o=t,i=t,s=[0,0],a=1;for(;a<r;)n=1&i/2,o=1&(i^n),on(a,s,n,o),s[0]+=a*n,s[1]+=a*o,i=i/4,a*=2;return[e,s[0],s[1]]}var hs=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function sn(e,t,r){if(e>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(t>W(2,e)-1||r>W(2,e)-1)throw Error("tile x/y outside zoom level bounds");let n=hs[e],o=W(2,e),i=0,s=0,a=0,l=[t,r],c=o/2;for(;c>0;)i=(l[0]&c)>0?1:0,s=(l[1]&c)>0?1:0,a+=c*c*(3*i^s),on(c,l,i,s),c=c/2;return n+a}function ds(e){let t=0,r=0;for(let n=0;n<27;n++){let o=(1<<n)*(1<<n);if(t+o>e)return us(n,e-t);t+=o}throw Error("Tile zoom level exceeds max safe number limit (26)")}var an=(e=>(e[e.Unknown=0]="Unknown",e[e.None=1]="None",e[e.Gzip=2]="Gzip",e[e.Brotli=3]="Brotli",e[e.Zstd=4]="Zstd",e))(an||{});function _t(e,t){return F(this,null,function*(){if(t===1||t===0)return e;if(t===2){if(typeof globalThis.DecompressionStream>"u")return St(new Uint8Array(e));let r=new Response(e).body;if(!r)throw Error("Failed to read response stream");let n=r.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(n).arrayBuffer()}throw Error("Compression method not supported")})}var ln=(e=>(e[e.Unknown=0]="Unknown",e[e.Mvt=1]="Mvt",e[e.Png=2]="Png",e[e.Jpeg=3]="Jpeg",e[e.Webp=4]="Webp",e[e.Avif=5]="Avif",e))(ln||{});function cn(e){return e===1?".mvt":e===2?".png":e===3?".jpg":e===4?".webp":e===5?".avif":""}var ps=127;function fn(e,t){let r=0,n=e.length-1;for(;r<=n;){let o=n+r>>1,i=t-e[o].tileId;if(i>0)r=o+1;else if(i<0)n=o-1;else return e[o]}return n>=0&&(e[n].runLength===0||t-e[n].tileId<e[n].runLength)?e[n]:null}var gs=class{constructor(e){this.file=e}getKey(){return this.file.name}getBytes(e,t){return F(this,null,function*(){return{data:yield this.file.slice(e,e+t).arrayBuffer()}})}},un=class{constructor(e,t=new Headers){this.url=e,this.customHeaders=t,this.mustReload=!1;let r="";"navigator"in globalThis&&(r=globalThis.navigator.userAgent||"");let n=r.indexOf("Windows")>-1,o=/Chrome|Chromium|Edg|OPR|Brave/.test(r);this.chromeWindowsNoCache=!1,n&&o&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(e){this.customHeaders=e}getBytes(e,t,r,n){return F(this,null,function*(){let o,i;r?i=r:(o=new AbortController,i=o.signal);let s=new Headers(this.customHeaders);s.set("range",`bytes=${e}-${e+t-1}`);let a;this.mustReload?a="reload":this.chromeWindowsNoCache&&(a="no-store");let l=yield fetch(this.url,{signal:i,cache:a,headers:s});if(e===0&&l.status===416){let h=l.headers.get("Content-Range");if(!h||!h.startsWith("bytes */"))throw Error("Missing content-length on 416 response");let d=+h.substr(8);l=yield fetch(this.url,{signal:i,cache:"reload",headers:{range:`bytes=0-${d-1}`}})}let c=l.headers.get("Etag");if(c?.startsWith("W/")&&(c=null),l.status===416||n&&c&&c!==n)throw this.mustReload=!0,new We(`Server returned non-matching ETag ${n} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(l.status>=300)throw Error(`Bad response code: ${l.status}`);let f=l.headers.get("Content-Length");if(l.status===200&&(!f||+f>t))throw o&&o.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield l.arrayBuffer(),etag:c||void 0,cacheControl:l.headers.get("Cache-Control")||void 0,expires:l.headers.get("Expires")||void 0}})}};function _(e,t){let r=e.getUint32(t+4,!0),n=e.getUint32(t+0,!0);return r*W(2,32)+n}function hn(e,t){let r=new DataView(e),n=r.getUint8(7);if(n>3)throw Error(`Archive is spec version ${n} but this library supports up to spec version 3`);return{specVersion:n,rootDirectoryOffset:_(r,8),rootDirectoryLength:_(r,16),jsonMetadataOffset:_(r,24),jsonMetadataLength:_(r,32),leafDirectoryOffset:_(r,40),leafDirectoryLength:_(r,48),tileDataOffset:_(r,56),tileDataLength:_(r,64),numAddressedTiles:_(r,72),numTileEntries:_(r,80),numTileContents:_(r,88),clustered:r.getUint8(96)===1,internalCompression:r.getUint8(97),tileCompression:r.getUint8(98),tileType:r.getUint8(99),minZoom:r.getUint8(100),maxZoom:r.getUint8(101),minLon:r.getInt32(102,!0)/1e7,minLat:r.getInt32(106,!0)/1e7,maxLon:r.getInt32(110,!0)/1e7,maxLat:r.getInt32(114,!0)/1e7,centerZoom:r.getUint8(118),centerLon:r.getInt32(119,!0)/1e7,centerLat:r.getInt32(123,!0)/1e7,etag:t}}function dn(e){let t={buf:new Uint8Array(e),pos:0},r=oe(t),n=[],o=0;for(let i=0;i<r;i++){let s=oe(t);n.push({tileId:o+s,offset:0,length:0,runLength:1}),o+=s}for(let i=0;i<r;i++)n[i].runLength=oe(t);for(let i=0;i<r;i++)n[i].length=oe(t);for(let i=0;i<r;i++){let s=oe(t);s===0&&i>0?n[i].offset=n[i-1].offset+n[i-1].length:n[i].offset=s-1}return n}function ms(e){let t=new DataView(e);return t.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):t.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var We=class extends Error{};function pn(e,t){return F(this,null,function*(){let r=yield e.getBytes(0,16384);if(new DataView(r.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(ms(r.data)<3)return[yield nn.getHeader(e)];let o=r.data.slice(0,ps),i=hn(o,r.etag),s=r.data.slice(i.rootDirectoryOffset,i.rootDirectoryOffset+i.rootDirectoryLength),a=`${e.getKey()}|${i.etag||""}|${i.rootDirectoryOffset}|${i.rootDirectoryLength}`,l=dn(yield t(s,i.internalCompression));return[i,[a,l.length,l]]})}function gn(e,t,r,n,o){return F(this,null,function*(){let i=yield e.getBytes(r,n,void 0,o.etag),s=yield t(i.data,o.internalCompression),a=dn(s);if(a.length===0)throw new Error("Empty directory is invalid");return a})}var ys=class{constructor(e=100,t=!0,r=_t){this.cache=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=r}getHeader(e){return F(this,null,function*(){let t=e.getKey(),r=this.cache.get(t);if(r)return r.lastUsed=this.counter++,r.data;let n=yield pn(e,this.decompress);return n[1]&&this.cache.set(n[1][0],{lastUsed:this.counter++,data:n[1][2]}),this.cache.set(t,{lastUsed:this.counter++,data:n[0]}),this.prune(),n[0]})}getDirectory(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,i.data;let s=yield gn(e,this.decompress,t,r,n);return this.cache.set(o,{lastUsed:this.counter++,data:s}),this.prune(),s})}getArrayBuffer(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,yield i.data;let s=yield e.getBytes(t,r,void 0,n.etag);return this.cache.set(o,{lastUsed:this.counter++,data:s.data}),this.prune(),s.data})}prune(){if(this.cache.size>this.maxCacheEntries){let e=1/0,t;this.cache.forEach((r,n)=>{r.lastUsed<e&&(e=r.lastUsed,t=n)}),t&&this.cache.delete(t)}}invalidate(e){return F(this,null,function*(){this.cache.delete(e.getKey())})}},mn=class{constructor(e=100,t=!0,r=_t){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=r}getHeader(e){return F(this,null,function*(){let t=e.getKey(),r=this.cache.get(t);if(r)return r.lastUsed=this.counter++,yield r.data;let n=new Promise((o,i)=>{pn(e,this.decompress).then(s=>{s[1]&&this.cache.set(s[1][0],{lastUsed:this.counter++,data:Promise.resolve(s[1][2])}),o(s[0]),this.prune()}).catch(s=>{i(s)})});return this.cache.set(t,{lastUsed:this.counter++,data:n}),n})}getDirectory(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,yield i.data;let s=new Promise((a,l)=>{gn(e,this.decompress,t,r,n).then(c=>{a(c),this.prune()}).catch(c=>{l(c)})});return this.cache.set(o,{lastUsed:this.counter++,data:s}),s})}getArrayBuffer(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,yield i.data;let s=new Promise((a,l)=>{e.getBytes(t,r,void 0,n.etag).then(c=>{a(c.data),this.cache.has(o),this.prune()}).catch(c=>{l(c)})});return this.cache.set(o,{lastUsed:this.counter++,data:s}),s})}prune(){if(this.cache.size>=this.maxCacheEntries){let e=1/0,t;this.cache.forEach((r,n)=>{r.lastUsed<e&&(e=r.lastUsed,t=n)}),t&&this.cache.delete(t)}}invalidate(e){return F(this,null,function*(){let t=e.getKey();if(this.invalidations.get(t))return yield this.invalidations.get(t);this.cache.delete(e.getKey());let r=new Promise((n,o)=>{this.getHeader(e).then(i=>{n(),this.invalidations.delete(t)}).catch(i=>{o(i)})});this.invalidations.set(t,r)})}},Et=class{constructor(e,t,r){typeof e=="string"?this.source=new un(e):this.source=e,r?this.decompress=r:this.decompress=_t,t?this.cache=t:this.cache=new mn}getHeader(){return F(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(e,t,r,n){return F(this,null,function*(){let o=sn(e,t,r),i=yield this.cache.getHeader(this.source);if(i.specVersion<3)return nn.getZxy(i,this.source,this.cache,e,t,r,n);if(e<i.minZoom||e>i.maxZoom)return;let s=i.rootDirectoryOffset,a=i.rootDirectoryLength;for(let l=0;l<=3;l++){let c=yield this.cache.getDirectory(this.source,s,a,i),f=fn(c,o);if(f){if(f.runLength>0){let u=yield this.source.getBytes(i.tileDataOffset+f.offset,f.length,n,i.etag);return{data:yield this.decompress(u.data,i.tileCompression),cacheControl:u.cacheControl,expires:u.expires}}s=i.leafDirectoryOffset+f.offset,a=f.length}else return}throw Error("Maximum directory depth exceeded")})}getZxy(e,t,r,n){return F(this,null,function*(){try{return yield this.getZxyAttempt(e,t,r,n)}catch(o){if(o instanceof We)return this.cache.invalidate(this.source),yield this.getZxyAttempt(e,t,r,n);throw o}})}getMetadataAttempt(){return F(this,null,function*(){let e=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(e.jsonMetadataOffset,e.jsonMetadataLength,void 0,e.etag),r=yield this.decompress(t.data,e.internalCompression),n=new TextDecoder("utf-8");return JSON.parse(n.decode(r))})}getMetadata(){return F(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(e){if(e instanceof We)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw e}})}getTileJson(e){return F(this,null,function*(){let t=yield this.getHeader(),r=yield this.getMetadata(),n=cn(t.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${e}/{z}/{x}/{y}${n}`],vector_layers:r.vector_layers,attribution:r.attribution,description:r.description,name:r.name,version:r.version,bounds:[t.minLon,t.minLat,t.maxLon,t.maxLat],center:[t.centerLon,t.centerLat,t.centerZoom],minzoom:t.minZoom,maxzoom:t.maxZoom}})}};var{TileType:be}=Ie;function yn(e,t,r,n){let o=null;if(t)try{let a=JSON.stringify(t);o=pe.parseTextSync?.(a,n)||null}catch(a){console.warn("PMTiles metadata could not be interpreted as TileJSON",a)}let i={};typeof o?.name=="string"&&(i.name=o.name),typeof o?.htmlAttribution=="string"&&(i.attributions=[o.htmlAttribution]);let s={...i,format:"pmtiles",formatVersion:e.specVersion,attributions:[],tileMIMEType:xs(e.tileType),minZoom:e.minZoom,maxZoom:e.maxZoom,boundingBox:[[e.minLon,e.minLat],[e.maxLon,e.maxLat]],center:[e.centerLon,e.centerLat],centerZoom:e.centerZoom,etag:e.etag};return o&&(s.tilejson=o),r?.includeFormatHeader&&(s.formatHeader=e,s.formatMetadata=s),s}function xs(e){switch(e){case be.Mvt:return"application/vnd.mapbox-vector-tile";case be.Png:return"image/png";case be.Jpeg:return"image/jpeg";case be.Webp:return"image/webp";case be.Avif:return"image/avif";default:return"application/octet-stream"}}var Je=class{blob;key;constructor(t,r){this.blob=t,this.key=r}getKey(){return this.blob.url||""}async getBytes(t,r,n){return{data:await this.blob.slice(t,t+r).arrayBuffer()}}};var{PMTiles:ws}=Ie,vs="1.0.0",Dt={...Ze,version:vs,type:"pmtiles",fromUrl:!0,fromBlob:!0,defaultOptions:{pmtiles:{}},testURL:e=>e.endsWith(".pmtiles"),createDataSource:(e,t)=>new J(e,t)},J=class extends q{mimeType=null;pmtiles;metadata;constructor(t,r){super(t,r,Dt.defaultOptions);let n=typeof t=="string"?fe(t):new Je(t,"pmtiles");this.pmtiles=new ws(n),this.getTileData=this.getTileData.bind(this),this.metadata=this.getMetadata()}async getSchema(){return{fields:[],metadata:{}}}async getMetadata(){let t=await this.pmtiles.getHeader(),r=await this.pmtiles.getMetadata()||{},n=yn(t,r,{includeFormatHeader:!1},this.loadOptions);return this.options.attributions&&(n.attributions=[...this.options.core?.attributions||[],...n.attributions||[]]),n?.tileMIMEType&&(this.mimeType=n?.tileMIMEType),n}async getTile(t){let{x:r,y:n,z:o}=t,s=(await this.pmtiles.getZxy(o,r,n))?.data;return s||null}async getTileData(t){let{x:r,y:n,z:o}=t.index;switch((await this.metadata).tileMIMEType){case"application/vnd.mapbox-vector-tile":return await this.getVectorTile({x:r,y:n,z:o,layers:[]});default:return await this.getImageTile({x:r,y:n,z:o,layers:[]})}}async getImageTile(t){let r=await this.getTile(t);return r?await ct.parse(r,this.loadOptions):null}async getVectorTile(t){let r=await this.getTile(t),n={shape:"geojson-table",mvt:{coordinates:"wgs84",tileIndex:{x:t.x,y:t.y,z:t.z},...this.loadOptions?.mvt},...this.loadOptions};return r?await Pt.parse(r,n):null}};var xn="4.4.0-alpha.0";var vn={...Ze,version:xn,options:{pmtiles:{}},parse:async(e,t)=>wn(new ue(new Blob([e])),t),parseFile:wn};async function wn(e,t){let n=await new J(e.handle,{pmtiles:t?.pmtiles||{}}).getMetadata(),{tileMIMEType:o,tilejson:i={}}=n,{layers:s=[]}=i;switch(o){case"application/vnd.mapbox-vector-tile":return{shape:"vector-source",layers:s.map(a=>({name:a.name,schema:a.schema})),tables:[],formatSpecificMetadata:n};case"image/png":case"image/jpeg":return{shape:"image-source",formatSpecificMetadata:n};default:throw new Error(`PMTilesLoader: Unsupported tile MIME type ${o}`)}}return Ln(Be);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var Bn=Object.create;var ae=Object.defineProperty;var Sn=Object.getOwnPropertyDescriptor;var En=Object.getOwnPropertyNames;var An=Object.getPrototypeOf,_n=Object.prototype.hasOwnProperty;var Dn=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var qe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ot=(e,t)=>{for(var r in t)ae(e,r,{get:t[r],enumerable:!0})},Ee=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of En(t))!_n.call(e,o)&&o!==r&&ae(e,o,{get:()=>t[o],enumerable:!(n=Sn(t,o))||n.enumerable});return e},Ae=(e,t,r)=>(Ee(e,t,"default"),r&&Ee(r,t,"default")),jt=(e,t,r)=>(r=e!=null?Bn(An(e)):{},Ee(t||!e||!e.__esModule?ae(r,"default",{value:e,enumerable:!0}):r,e)),Ln=e=>Ee(ae({},"__esModule",{value:!0}),e);var _e=(e,t,r)=>(Dn(e,typeof t!="symbol"?t+"":t,r),r);var Rt=qe((Fs,zt)=>{zt.exports=globalThis.loaders});var Ar=qe(mt=>{mt.read=function(e,t,r,n,o){var i,s,a=o*8-n-1,l=(1<<a)-1,c=l>>1,f=-7,u=r?o-1:0,h=r?-1:1,d=e[t+u];for(u+=h,i=d&(1<<-f)-1,d>>=-f,f+=a;f>0;i=i*256+e[t+u],u+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=s*256+e[t+u],u+=h,f-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,n),i=i-c}return(d?-1:1)*s*Math.pow(2,i-n)};mt.write=function(e,t,r,n,o,i){var s,a,l,c=i*8-o-1,f=(1<<c)-1,u=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?t+=h/l:t+=h*Math.pow(2,1-u),t*l>=2&&(s++,l/=2),s+u>=f?(a=0,s=f):s+u>=1?(a=(t*l-1)*Math.pow(2,o),s=s+u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[r+d]=a&255,d+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[r+d]=s&255,d+=p,s/=256,c-=8);e[r+d-p]|=y*128}});var Ur=qe((Nl,Vr)=>{"use strict";Vr.exports=x;var ze=Ar();function x(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}x.Varint=0;x.Fixed64=1;x.Bytes=2;x.Fixed32=5;var yt=(1<<16)*(1<<16),_r=1/yt,li=12,Mr=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");x.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),o=n>>3,i=this.pos;this.type=n&7,e(o,t,this),this.pos===i&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Re(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Lr(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Re(this.buf,this.pos)+Re(this.buf,this.pos+4)*yt;return this.pos+=8,e},readSFixed64:function(){var e=Re(this.buf,this.pos)+Lr(this.buf,this.pos+4)*yt;return this.pos+=8,e},readFloat:function(){var e=ze.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ze.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,ci(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=li&&Mr?Pi(this.buf,t,e):Fi(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==x.Bytes)return e.push(this.readVarint(t));var r=G(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==x.Bytes)return e.push(this.readSVarint());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==x.Bytes)return e.push(this.readBoolean());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==x.Bytes)return e.push(this.readFloat());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==x.Bytes)return e.push(this.readDouble());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==x.Bytes)return e.push(this.readFixed32());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==x.Bytes)return e.push(this.readSFixed32());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==x.Bytes)return e.push(this.readFixed64());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==x.Bytes)return e.push(this.readSFixed64());var t=G(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===x.Varint)for(;this.buf[this.pos++]>127;);else if(t===x.Bytes)this.pos=this.readVarint()+this.pos;else if(t===x.Fixed32)this.pos+=4;else if(t===x.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),re(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),re(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),re(this.buf,e&-1,this.pos),re(this.buf,Math.floor(e*_r),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),re(this.buf,e&-1,this.pos),re(this.buf,Math.floor(e*_r),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){fi(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=Ii(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Dr(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),ze.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),ze.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Dr(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,x.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,di,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,pi,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,yi,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,gi,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,mi,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,xi,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,wi,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,vi,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ti,t)},writeBytesField:function(e,t){this.writeTag(e,x.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,x.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,x.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,x.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,x.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,x.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,x.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,x.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,x.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,x.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function ci(e,t,r){var n=r.buf,o,i;if(i=n[r.pos++],o=(i&112)>>4,i<128||(i=n[r.pos++],o|=(i&127)<<3,i<128)||(i=n[r.pos++],o|=(i&127)<<10,i<128)||(i=n[r.pos++],o|=(i&127)<<17,i<128)||(i=n[r.pos++],o|=(i&127)<<24,i<128)||(i=n[r.pos++],o|=(i&1)<<31,i<128))return te(e,o,t);throw new Error("Expected varint not more than 10 bytes")}function G(e){return e.type===x.Bytes?e.readVarint()+e.pos:e.pos+1}function te(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function fi(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),ui(r,n,t),hi(n,t)}function ui(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function hi(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Dr(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var o=r.pos-1;o>=e;o--)r.buf[o+n]=r.buf[o]}function di(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function pi(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function gi(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function mi(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function yi(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function xi(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function wi(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function vi(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ti(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Re(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function re(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Lr(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Fi(e,t,r){for(var n="",o=t;o<r;){var i=e[o],s=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a>r)break;var l,c,f;a===1?i<128&&(s=i):a===2?(l=e[o+1],(l&192)===128&&(s=(i&31)<<6|l&63,s<=127&&(s=null))):a===3?(l=e[o+1],c=e[o+2],(l&192)===128&&(c&192)===128&&(s=(i&15)<<12|(l&63)<<6|c&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):a===4&&(l=e[o+1],c=e[o+2],f=e[o+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(s=(i&15)<<18|(l&63)<<12|(c&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,a=1):s>65535&&(s-=65536,n+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),n+=String.fromCharCode(s),o+=a}return n}function Pi(e,t,r){return Mr.decode(e.subarray(t,r))}function Ii(e,t,r){for(var n=0,o,i;n<t.length;n++){if(o=t.charCodeAt(n),o>55295&&o<57344)if(i)if(o<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=o;continue}else o=i-55296<<10|o-56320|65536,i=null;else{o>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=o;continue}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);o<128?e[r++]=o:(o<2048?e[r++]=o>>6|192:(o<65536?e[r++]=o>>12|224:(e[r++]=o>>18|240,e[r++]=o>>12&63|128),e[r++]=o>>6&63|128),e[r++]=o&63|128)}return r}});var Be={};Ot(Be,{PMTilesSource:()=>Dt,PMTilesTileSource:()=>J,_PMTilesLoader:()=>vn});Ae(Be,jt(Rt(),1));function le(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var N={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Mn=N.self||N.window||N.global||{},Vn=N.window||N.self||N.global||{},Un=N.global||N.self||N.window||{},Cn=N.document||{};var et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Ht=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Nn=Ht&&parseFloat(Ht[1])||0;var De=globalThis,kn=globalThis.document||{},Le=globalThis.process||{},Gn=globalThis.console,bs=globalThis.navigator||{};function Zt(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let t=typeof navigator<"u"&&navigator.userAgent,r=e||t;return Boolean(r&&r.indexOf("Electron")>=0)}function z(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Zt()}var tt="4.0.7";function jn(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Me=class{constructor(t,r,n="sessionStorage"){this.storage=jn(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function $t(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function Wt(e,t=8){let r=Math.max(t-e.length,0);return`${" ".repeat(r)}${e}`}var Ve;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ve||(Ve={}));var zn=10;function Jt(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ve[e]||Ve.WHITE)}function Kt(e,t,r){return!z&&typeof e=="string"&&(t&&(e=`\x1B[${Jt(t)}m${e}\x1B[39m`),r&&(e=`\x1B[${Jt(r)+zn}m${e}\x1B[49m`)),e}function Yt(e,t=["constructor"]){let r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let s=o[i];typeof s=="function"&&(t.find(a=>i===a)||(o[i]=s.bind(e)))}}function ce(e,t){if(!e)throw new Error(t||"Assertion failed")}function R(){let e;if(z()&&De.performance)e=De?.performance?.now?.();else if("hrtime"in Le){let t=Le?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var X={debug:z()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Rn={enabled:!0,level:0};function Q(){}var Xt={},Qt={once:!0},j=class{constructor({id:t}={id:""}){this.VERSION=tt,this._startTs=R(),this._deltaTs=R(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Me(`__probe-${this.id}__`,Rn),this.timeStamp(`${this.id} started`),Yt(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((R()-this._startTs).toPrecision(10))}getDelta(){return Number((R()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){if(!t)throw new Error(r||"Assertion failed")}warn(t){return this._getLogFunction(0,t,X.warn,arguments,Qt)}error(t){return this._getLogFunction(0,t,X.error,arguments)}deprecated(t,r){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${r}\` instead`)}removed(t,r){return this.error(`\`${t}\` has been removed. Use \`${r}\` instead`)}probe(t,r){return this._getLogFunction(t,r,X.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,X.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,X.debug||X.info,arguments,Qt)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Q,n&&[n],{tag:Zn(r)}):Q}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Q)}group(t,r,n={collapsed:!1}){let o=qt({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r,n={}){return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Q)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=er(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=qt({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ce(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=R();let s=i.tag||i.message;if(i.once&&s)if(!Xt[s])Xt[s]=R();else return Q;return r=Hn(this.id,i.message,i),n.bind(console,r,...i.args)}return Q}};j.VERSION=tt;function er(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ce(Number.isFinite(t)&&t>=0),t}function qt(e){let{logLevel:t,message:r}=e;e.logLevel=er(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return ce(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function Hn(e,t,r){if(typeof t=="string"){let n=r.time?Wt($t(r.total)):"";t=r.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=Kt(t,r.color,r.background)}return t}function Zn(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}globalThis.probe={};var Ys=new j({id:"@probe.gl/log"});var rt="4.4.0-alpha.1",$n=rt[0]>="0"&&rt[0]<="9"?`v${rt}`:"";function Wn(){let e=new j({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=$n,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}var nt=Wn();function tr(e,t){return rr(e||{},t)}function rr(e,t,r=0){if(r>3)return t;let n={...e};for(let[o,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?n[o]=rr(n[o]||{},t[o],r+1):n[o]=t[o];return n}var Jn="",nr={};function fe(e){for(let t in nr)if(e.startsWith(t)){let r=nr[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${Jn}${e}`),e}var ue=class{handle;size;bigsize;url;constructor(t){this.handle=t instanceof ArrayBuffer?new Blob([t]):t,this.size=t instanceof ArrayBuffer?t.byteLength:t.size,this.bigsize=BigInt(this.size),this.url=t instanceof File?t.name:""}async close(){}async stat(){return{size:this.handle.size,bigsize:BigInt(this.handle.size),isDirectory:!1}}async read(t,r){return await this.handle.slice(Number(t),Number(t)+Number(r)).arrayBuffer()}};var ot=class{optionsType;options;data;url;loadOptions;fetch;_needsRefresh=!0;constructor(t,r,n){n?this.options=tr({...n,core:ot.defaultOptions},r):this.options={...r},this.data=t,this.url=typeof t=="string"?fe(t):"",this.loadOptions={...this.options.core?.loadOptions},this.fetch=Kn(this.loadOptions)}setProps(t){this.options=Object.assign(this.options,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let r=this._needsRefresh;return t&&(this._needsRefresh=!1),r}},q=ot;_e(q,"defaultOptions",{core:{type:"auto",attributions:[],loadOptions:{},loaders:[]}});function Kn(e){let t=e?.fetch;if(t&&typeof t=="function")return(n,o)=>t(n,o);let r=e?.fetch;return r&&typeof r!="function"?n=>fetch(n,r):n=>fetch(n)}var or="4.4.0-alpha.1";var Yn=globalThis.loaders?.parseImageNode,it=typeof Image<"u",st=typeof ImageBitmap<"u",Xn=Boolean(Yn),at=et?!0:Xn;function ir(e){switch(e){case"auto":return st||it||at;case"imagebitmap":return st;case"image":return it;case"data":return at;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function sr(){if(st)return"imagebitmap";if(it)return"image";if(at)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Qn(e){let t=qn(e);if(!t)throw new Error("Not an image");return t}function ar(e){switch(Qn(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function qn(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var eo=/^data:image\/svg\+xml/,to=/\.svg((\?|#).*)?$/;function Ue(e){return e&&(eo.test(e)||to.test(e))}function lr(e,t){if(Ue(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return lt(e,t)}function lt(e,t){if(Ue(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Ce(e,t,r){let n=lr(e,r),o=self.URL||self.webkitURL,i=typeof n!="string"&&o.createObjectURL(n);try{return await ro(i||n,t)}finally{i&&o.revokeObjectURL(i)}}async function ro(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=i=>{let s=i instanceof Error?i.message:"error";o(new Error(s))}}catch(i){o(i)}})}var no={},cr=!0;async function fr(e,t,r){let n;Ue(r)?n=await Ce(e,t,r):n=lt(e,r);let o=t&&t.imagebitmap;return await oo(n,o)}async function oo(e,t=null){if((io(t)||!cr)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),cr=!1}return await createImageBitmap(e)}function io(e){for(let t in e||no)return!1;return!0}function ur(e){return!co(e,"ftyp",4)||!(e[8]&96)?null:so(e)}function so(e){switch(ao(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ao(e,t,r){return String.fromCharCode(...e.slice(t,r))}function lo(e){return[...e].map(t=>t.charCodeAt(0))}function co(e,t,r=0){let n=lo(t);for(let o=0;o<n.length;++o)if(n[o]!==e[o+r])return!1;return!0}var k=!1,he=!0;function Ne(e){let t=de(e);return uo(t)||go(t)||ho(t)||po(t)||fo(t)}function fo(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=ur(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function uo(e){let t=de(e);return t.byteLength>=24&&t.getUint32(0,k)===2303741511?{mimeType:"image/png",width:t.getUint32(16,k),height:t.getUint32(20,k)}:null}function ho(e){let t=de(e);return t.byteLength>=10&&t.getUint32(0,k)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,he),height:t.getUint16(8,he)}:null}function po(e){let t=de(e);return t.byteLength>=14&&t.getUint16(0,k)===16973&&t.getUint32(2,he)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,he),height:t.getUint32(22,he)}:null}function go(e){let t=de(e);if(!(t.byteLength>=3&&t.getUint16(0,k)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=mo(),i=2;for(;i+9<t.byteLength;){let s=t.getUint16(i,k);if(o.has(s))return{mimeType:"image/jpeg",height:t.getUint16(i+5,k),width:t.getUint16(i+7,k)};if(!n.has(s))return null;i+=2,i+=t.getUint16(i,k)}return null}function mo(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function de(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function hr(e,t){let{mimeType:r}=Ne(e)||{},n=globalThis.loaders?.parseImageNode;return le(n),await n(e,r)}async function dr(e,t,r){t=t||{};let o=(t.image||{}).type||"auto",{url:i}=r||{},s=yo(o),a;switch(s){case"imagebitmap":a=await fr(e,t,i);break;case"image":a=await Ce(e,t,i);break;case"data":a=await hr(e,t);break;default:le(!1)}return o==="data"&&(a=ar(a)),a}function yo(e){switch(e){case"auto":case"data":return sr();default:return ir(e),e}}var xo=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],wo=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],vo={image:{type:"auto",decode:!0}},ct={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:or,mimeTypes:wo,extensions:xo,parse:dr,tests:[e=>Boolean(Ne(new DataView(e)))],options:vo};function pr(e){let t=[];if(e.fields)for(let r of e.fields)t.push({name:r.name,type:Fo(r),metadata:Po(r)});return{metadata:To(e),fields:t}}function To(e){let t={};for(let[r,n]of Object.entries(e))r!=="fields"&&n&&(t[r]=JSON.stringify(n));return t}function Fo(e){switch(e.type.toLowerCase()){case"float32":return"float32";case"number":case"float64":return"float64";case"string":case"utf8":return"utf8";case"boolean":return"bool";default:return"null"}}function Po(e){let t={};for(let[r,n]of Object.entries(e))r!=="name"&&n&&(t[r]=JSON.stringify(n));return t}var xr=e=>e!==null&&typeof e=="object";function ft(e,t){if(!e||!xr(e))return null;let r={name:e.name||"",description:e.description||""};if(typeof e.generator=="string"&&(r.generator=e.generator),typeof e.generator_options=="string"&&(r.generatorOptions=e.generator_options),r.boundingBox=gr(e.bounds)||gr(e.antimeridian_adjusted_bounds),r.center=Ao(e.center),r.maxZoom=mr(e.maxzoom),r.minZoom=mr(e.minzoom),typeof e?.json=="string")try{r.metaJson=JSON.parse(e.json)}catch(a){console.warn("Failed to parse tilejson.json field",a)}let n=e.tilestats||r.metaJson?.tilestats,o=Bo(n,t),i=Io(e.vector_layers),s=Eo(i,o);return r={...r,layers:s},r.maxZoom===null&&s.length>0&&(r.maxZoom=s[0].maxZoom||null),r.minZoom===null&&s.length>0&&(r.minZoom=s[0].minZoom||null),r}function Io(e){return Array.isArray(e)?e.map(t=>bo(t)):[]}function bo(e){let t=Object.entries(e.fields||[]).map(([n,o])=>({name:n,...Fr(String(o))})),r={...e};return delete r.fields,{name:e.id||"",...r,fields:t}}function Bo(e,t){return xr(e)&&Array.isArray(e.layers)?e.layers.map(r=>So(r,t)):[]}function So(e,t){let r=[],n={},o=e.attributes||[];for(let i of o){let s=i.attribute;if(typeof s=="string")if(s.split("|").length>1){let a=s.split("|")[0];n[a]=n[a]||[],n[a].push(i),console.warn("ignoring tilestats indexed field",a)}else r[s]||r.push(Do(i,t))}return{name:e.layer||"",dominantGeometry:e.geometry,fields:r}}function Eo(e,t){return e.map(r=>{let n=t.find(s=>s.name===r.name),o=n?.fields||r.fields||[],i={...r,...n,fields:o};return i.schema=pr(i),i})}function gr(e){let t=Tr(e);if(Array.isArray(t)&&t.length===4&&[t[0],t[2]].every(vr)&&[t[1],t[3]].every(wr))return[[t[0],t[1]],[t[2],t[3]]]}function Ao(e){let t=Tr(e);return Array.isArray(t)&&t.length===3&&vr(t[0])&&wr(t[1])&&_o(t[2])?t:null}function mr(e){let t=typeof e=="string"?parseFloat(e):typeof e=="number"?e:null;return t===null||isNaN(t)?null:t}function wr(e){return Number.isFinite(e)&&e<=90&&e>=-90}function vr(e){return Number.isFinite(e)&&e<=180&&e>=-180}function _o(e){return Number.isFinite(e)&&e>=0&&e<=22}function Tr(e){return typeof e=="string"?e.split(",").map(parseFloat):Array.isArray(e)?e:null}var yr={number:{type:"float32"},numeric:{type:"float32"},string:{type:"utf8"},vachar:{type:"utf8"},float:{type:"float32"},int:{type:"int32"},int4:{type:"int32"},boolean:{type:"boolean"},bool:{type:"boolean"}};function Do(e={},t){let r=Fr(e.type),n={name:e.attribute,...r};return typeof e.min=="number"&&(n.min=e.min),typeof e.max=="number"&&(n.max=e.max),typeof e.count=="number"&&(n.uniqueValueCount=e.count),e.values&&(n.values=e.values),n.values&&typeof t.maxValues=="number"&&(n.values=n.values?.slice(0,t.maxValues)),n}function Fr(e){let t=e.toLowerCase();return!t||yr[t],yr[t]||{type:"string"}}var Lo="4.4.0-alpha.1",pe={dataType:null,batchType:null,name:"TileJSON",id:"tilejson",module:"pmtiles",version:Lo,worker:!0,extensions:["json"],mimeTypes:["application/json"],text:!0,options:{tilejson:{maxValues:void 0}},parse:async(e,t)=>{let r=new TextDecoder().decode(e),n=JSON.parse(r),o={...pe.options.tilejson,...t?.tilejson};return ft(n,o)},parseTextSync:(e,t)=>{let r=JSON.parse(e),n={...pe.options.tilejson,...t?.tilejson};return ft(r,n)}};var ge={x:0,y:1,z:2};function H(e,t={}){let{start:r=0,end:n=e.length,plane:o="xy"}=t,i=t.size||2,s=0,a=ge[o[0]],l=ge[o[1]];for(let c=r,f=n-i;c<n;c+=i)s+=(e[c+a]-e[f+a])*(e[c+l]+e[f+l]),f=c;return s/2}function ht(e,t,r=2,n,o="xy"){let i=t&&t.length,s=i?t[0]*r:e.length,a=Ir(e,0,s,r,!0,n&&n[0],o),l=[];if(!a||a.next===a.prev)return l;let c,f,u,h,d,p,y;if(i&&(a=Go(e,t,a,r,n,o)),e.length>80*r){h=f=e[0],d=u=e[1];for(let P=r;P<s;P+=r)p=e[P],y=e[P+1],p<h&&(h=p),y<d&&(d=y),p>f&&(f=p),y>u&&(u=y);c=Math.max(f-h,u-d),c=c!==0?32767/c:0}return me(a,l,r,h,d,c,0),l}function Ir(e,t,r,n,o,i,s){let a,l;i===void 0&&(i=H(e,{start:t,end:r,size:n,plane:s}));let c=ge[s[0]],f=ge[s[1]];if(o===i<0)for(a=t;a<r;a+=n)l=Pr(a,e[a+c],e[a+f],l);else for(a=r-n;a>=t;a-=n)l=Pr(a,e[a+c],e[a+f],l);return l&&Oe(l,l.next)&&(xe(l),l=l.next),l}function Z(e,t){if(!e)return e;t||(t=e);let r=e,n;do if(n=!1,!r.steiner&&(Oe(r,r.next)||T(r.prev,r,r.next)===0)){if(xe(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function me(e,t,r,n,o,i,s){if(!e)return;!s&&i&&Ho(e,n,o,i);let a=e,l,c;for(;e.prev!==e.next;){if(l=e.prev,c=e.next,i?Co(e,n,o,i):Uo(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(c.i/r|0),xe(e),e=c.next,a=c.next;continue}if(e=c,e===a){s?s===1?(e=No(Z(e),t,r),me(e,t,r,n,o,i,2)):s===2&&ko(e,t,r,n,o,i):me(Z(e),t,r,n,o,i,1);break}}}function Uo(e){let t=e.prev,r=e,n=e.next;if(T(t,r,n)>=0)return!1;let o=t.x,i=r.x,s=n.x,a=t.y,l=r.y,c=n.y,f=o<i?o<s?o:s:i<s?i:s,u=a<l?a<c?a:c:l<c?l:c,h=o>i?o>s?o:s:i>s?i:s,d=a>l?a>c?a:c:l>c?l:c,p=n.next;for(;p!==t;){if(p.x>=f&&p.x<=h&&p.y>=u&&p.y<=d&&ee(o,a,i,l,s,c,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Co(e,t,r,n){let o=e.prev,i=e,s=e.next;if(T(o,i,s)>=0)return!1;let a=o.x,l=i.x,c=s.x,f=o.y,u=i.y,h=s.y,d=a<l?a<c?a:c:l<c?l:c,p=f<u?f<h?f:h:u<h?u:h,y=a>l?a>c?a:c:l>c?l:c,P=f>u?f>h?f:h:u>h?u:h,D=ut(d,p,t,r,n),v=ut(y,P,t,r,n),m=e.prevZ,g=e.nextZ;for(;m&&m.z>=D&&g&&g.z<=v;){if(m.x>=d&&m.x<=y&&m.y>=p&&m.y<=P&&m!==o&&m!==s&&ee(a,f,l,u,c,h,m.x,m.y)&&T(m.prev,m,m.next)>=0||(m=m.prevZ,g.x>=d&&g.x<=y&&g.y>=p&&g.y<=P&&g!==o&&g!==s&&ee(a,f,l,u,c,h,g.x,g.y)&&T(g.prev,g,g.next)>=0))return!1;g=g.nextZ}for(;m&&m.z>=D;){if(m.x>=d&&m.x<=y&&m.y>=p&&m.y<=P&&m!==o&&m!==s&&ee(a,f,l,u,c,h,m.x,m.y)&&T(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;g&&g.z<=v;){if(g.x>=d&&g.x<=y&&g.y>=p&&g.y<=P&&g!==o&&g!==s&&ee(a,f,l,u,c,h,g.x,g.y)&&T(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function No(e,t,r){let n=e;do{let o=n.prev,i=n.next.next;!Oe(o,i)&&br(o,n,n.next,i)&&ye(o,i)&&ye(i,o)&&(t.push(o.i/r|0),t.push(n.i/r|0),t.push(i.i/r|0),xe(n),xe(n.next),n=e=i),n=n.next}while(n!==e);return Z(n)}function ko(e,t,r,n,o,i){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&Wo(s,a)){let l=Br(s,a);s=Z(s,s.next),l=Z(l,l.next),me(s,t,r,n,o,i,0),me(l,t,r,n,o,i,0);return}a=a.next}s=s.next}while(s!==e)}function Go(e,t,r,n,o,i){let s=[],a,l,c,f,u;for(a=0,l=t.length;a<l;a++)c=t[a]*n,f=a<l-1?t[a+1]*n:e.length,u=Ir(e,c,f,n,!1,o&&o[a+1],i),u===u.next&&(u.steiner=!0),s.push($o(u));for(s.sort(Oo),a=0;a<s.length;a++)r=jo(s[a],r);return r}function Oo(e,t){return e.x-t.x}function jo(e,t){let r=zo(e,t);if(!r)return t;let n=Br(r,e);return Z(n,n.next),Z(r,r.next)}function zo(e,t){let r=t,n=e.x,o=e.y,i=-1/0,s;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){let h=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(h<=n&&h>i&&(i=h,s=r.x<r.next.x?r:r.next,h===n))return s}r=r.next}while(r!==t);if(!s)return null;let a=s,l=s.x,c=s.y,f=1/0,u;r=s;do n>=r.x&&r.x>=l&&n!==r.x&&ee(o<c?n:i,o,l,c,o<c?i:n,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(n-r.x),ye(r,e)&&(u<f||u===f&&(r.x>s.x||r.x===s.x&&Ro(s,r)))&&(s=r,f=u)),r=r.next;while(r!==a);return s}function Ro(e,t){return T(e.prev,e,t.prev)<0&&T(t.next,e,e.next)<0}function Ho(e,t,r,n){let o=e;do o.z===0&&(o.z=ut(o.x,o.y,t,r,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,Zo(o)}function Zo(e){let t,r,n=1,o,i,s,a,l,c;do{for(i=e,e=null,c=null,o=0;i;){for(o++,a=i,s=0,r=0;r<n&&(s++,a=a.nextZ,!!a);r++);for(l=n;s>0||l>0&&a;)s!==0&&(l===0||!a||i.z<=a.z)?(t=i,i=i.nextZ,s--):(t=a,a=a.nextZ,l--),c?c.nextZ=t:e=t,t.prevZ=c,c=t;i=a}c.nextZ=null,n*=2}while(o>1);return e}function ut(e,t,r,n,o){return e=(e-r)*o|0,t=(t-n)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function $o(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function ee(e,t,r,n,o,i,s,a){return(o-s)*(t-a)>=(e-s)*(i-a)&&(e-s)*(n-a)>=(r-s)*(t-a)&&(r-s)*(i-a)>=(o-s)*(n-a)}function Wo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Jo(e,t)&&(ye(e,t)&&ye(t,e)&&Ko(e,t)&&(T(e.prev,e,t.prev)||T(e,t.prev,t))||Oe(e,t)&&T(e.prev,e,e.next)>0&&T(t.prev,t,t.next)>0)}function T(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Oe(e,t){return e.x===t.x&&e.y===t.y}function br(e,t,r,n){let o=Ge(T(e,t,r)),i=Ge(T(e,t,n)),s=Ge(T(r,n,e)),a=Ge(T(r,n,t));return!!(o!==i&&s!==a||o===0&&ke(e,r,t)||i===0&&ke(e,n,t)||s===0&&ke(r,e,n)||a===0&&ke(r,t,n))}function ke(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ge(e){return e>0?1:e<0?-1:0}function Jo(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&br(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function ye(e,t){return T(e.prev,e,e.next)<0?T(e,t,e.next)>=0&&T(e,e.prev,t)>=0:T(e,t,e.prev)<0||T(e,e.next,t)<0}function Ko(e,t){let r=e,n=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do r.y>i!=r.next.y>i&&r.next.y!==r.y&&o<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Br(e,t){let r=new we(e.i,e.x,e.y),n=new we(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=o,o.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function Pr(e,t,r,n){let o=new we(e,t,r);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function xe(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}var we=class{constructor(t,r,n){this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1,this.i=t,this.x=r,this.y=n}};function je(e,t,r){let n=ei(e),o=Object.keys(n).filter(i=>n[i]!==Array);return ti(e,{propArrayTypes:n,...t},{numericPropKeys:r&&r.numericPropKeys||o,PositionDataType:r?r.PositionDataType:Float32Array,triangulate:r?r.triangulate:!0})}function ei(e){let t={};for(let r of e)if(r.properties)for(let n in r.properties){let o=r.properties[n];t[n]=ai(o,t[n])}return t}function ti(e,t,r){let{pointPositionsCount:n,pointFeaturesCount:o,linePositionsCount:i,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:c,polygonRingsCount:f,polygonFeaturesCount:u,propArrayTypes:h,coordLength:d}=t,{numericPropKeys:p=[],PositionDataType:y=Float32Array,triangulate:P=!0}=r,D=e[0]&&"id"in e[0],v=e.length>65535?Uint32Array:Uint16Array,m={type:"Point",positions:new y(n*d),globalFeatureIds:new v(n),featureIds:o>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},g={type:"LineString",pathIndices:i>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new y(i*d),globalFeatureIds:new v(i),featureIds:a>65535?new Uint32Array(i):new Uint16Array(i),numericProps:{},properties:[],fields:[]},S={type:"Polygon",polygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:l>65535?new Uint32Array(f+1):new Uint16Array(f+1),positions:new y(l*d),globalFeatureIds:new v(l),featureIds:u>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};P&&(S.triangles=[]);for(let M of[m,g,S])for(let I of p){let E=h[I];M.numericProps[I]=new E(M.positions.length/d)}g.pathIndices[s]=i,S.polygonIndices[c]=l,S.primitivePolygonIndices[f]=l;let C={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let M of e){let I=M.geometry,E=M.properties||{};switch(I.type){case"Point":ri(I,m,C,d,E),m.properties.push(pt(E,p)),D&&m.fields.push({id:M.id}),C.pointFeature++;break;case"LineString":ni(I,g,C,d,E),g.properties.push(pt(E,p)),D&&g.fields.push({id:M.id}),C.lineFeature++;break;case"Polygon":oi(I,S,C,d,E),S.properties.push(pt(E,p)),D&&S.fields.push({id:M.id}),C.polygonFeature++;break;default:throw new Error("Invalid geometry type")}C.feature++}return si(m,g,S,d)}function ri(e,t,r,n,o){t.positions.set(e.data,r.pointPosition*n);let i=e.data.length/n;gt(t,o,r.pointPosition,i),t.globalFeatureIds.fill(r.feature,r.pointPosition,r.pointPosition+i),t.featureIds.fill(r.pointFeature,r.pointPosition,r.pointPosition+i),r.pointPosition+=i}function ni(e,t,r,n,o){t.positions.set(e.data,r.linePosition*n);let i=e.data.length/n;gt(t,o,r.linePosition,i),t.globalFeatureIds.fill(r.feature,r.linePosition,r.linePosition+i),t.featureIds.fill(r.lineFeature,r.linePosition,r.linePosition+i);for(let s=0,a=e.indices.length;s<a;++s){let l=e.indices[s],c=s===a-1?e.data.length:e.indices[s+1];t.pathIndices[r.linePath++]=r.linePosition,r.linePosition+=(c-l)/n}}function oi(e,t,r,n,o){t.positions.set(e.data,r.polygonPosition*n);let i=e.data.length/n;gt(t,o,r.polygonPosition,i),t.globalFeatureIds.fill(r.feature,r.polygonPosition,r.polygonPosition+i),t.featureIds.fill(r.polygonFeature,r.polygonPosition,r.polygonPosition+i);for(let s=0,a=e.indices.length;s<a;++s){let l=r.polygonPosition;t.polygonIndices[r.polygonObject++]=l;let c=e.areas[s],f=e.indices[s],u=e.indices[s+1];for(let d=0,p=f.length;d<p;++d){let y=f[d],P=d===p-1?u===void 0?e.data.length:u[0]:f[d+1];t.primitivePolygonIndices[r.polygonRing++]=r.polygonPosition,r.polygonPosition+=(P-y)/n}let h=r.polygonPosition;ii(t,c,f,{startPosition:l,endPosition:h,coordLength:n})}}function ii(e,t,r,{startPosition:n,endPosition:o,coordLength:i}){if(!e.triangles)return;let s=n*i,a=o*i,l=e.positions.subarray(s,a),c=r[0],f=r.slice(1).map(h=>(h-c)/i),u=ht(l,f,i,t);for(let h=0,d=u.length;h<d;++h)e.triangles.push(n+u[h])}function dt(e,t){let r={};for(let n in e)r[n]={value:e[n],size:t};return r}function si(e,t,r,n){let o={shape:"binary-feature-collection",points:{...e,positions:{value:e.positions,size:n},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:dt(e.numericProps,1)},lines:{...t,positions:{value:t.positions,size:n},pathIndices:{value:t.pathIndices,size:1},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:dt(t.numericProps,1)},polygons:{...r,positions:{value:r.positions,size:n},polygonIndices:{value:r.polygonIndices,size:1},primitivePolygonIndices:{value:r.primitivePolygonIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:dt(r.numericProps,1)}};return o.polygons&&r.triangles&&(o.polygons.triangles={value:new Uint32Array(r.triangles),size:1}),o}function gt(e,t,r,n){for(let o in e.numericProps)if(o in t){let i=t[o];e.numericProps[o].fill(i,r,r+n)}}function pt(e,t){let r={};for(let n in e)t.includes(n)||(r[n]=e[n]);return r}function ai(e,t){return t===Array||!Number.isFinite(e)?Array:t===Float64Array||Math.fround(e)!==e?Float64Array:Float32Array}var Tt=jt(Ur(),1);function bi(e){let t=0;for(let r=0,n=e.length-1,o,i;r<e.length;n=r++)o=e[r],i=e[n],t+=(i[0]-o[0])*(o[1]+i[1]);return t}function xt(e,t){if(Array.isArray(e[0])){for(let n of e)xt(n,t);return}let r=e;r[0]/=t,r[1]/=t}function Cr(e,t){for(let r=0;r<e.length;++r)e[r]/=t}function wt(e,t,r){if(typeof e[0][0]!="number"){for(let s of e)wt(s,t,r);return}let n=r*Math.pow(2,t.z),o=r*t.x,i=r*t.y;for(let s=0;s<e.length;s++){let a=e[s];a[0]=(a[0]+o)*360/n-180;let l=180-(a[1]+i)*360/n;a[1]=360/Math.PI*Math.atan(Math.exp(l*Math.PI/180))-90}}function Nr(e,t,r){let{x:n,y:o,z:i}=t,s=r*Math.pow(2,i),a=r*n,l=r*o;for(let c=0,f=e.length;c<f;c+=2){e[c]=(e[c]+a)*360/s-180;let u=180-(e[c+1]+l)*360/s;e[c+1]=360/Math.PI*Math.atan(Math.exp(u*Math.PI/180))-90}}function kr(e){let t=e.length;if(t<=1)return[e];let r=[],n,o;for(let i=0;i<t;i++){let s=bi(e[i]);s!==0&&(o===void 0&&(o=s<0),o===s<0?(n&&r.push(n),n=[e[i]]):n&&n.push(e[i]))}return n&&r.push(n),r}function Gr(e){let t=e.indices.length,r="Polygon";if(t<=1)return{type:r,data:e.data,areas:[[H(e.data)]],indices:[e.indices]};let n=[],o=[],i=[],s=[],a,l=0;for(let c,f=0,u;f<t;f++){u=e.indices[f]-l,c=e.indices[f+1]-l||e.data.length;let h=e.data.slice(u,c),d=H(h);if(d===0){let p=e.data.slice(0,u),y=e.data.slice(c);e.data=p.concat(y),l+=c-u;continue}a===void 0&&(a=d<0),a===d<0?(s.length&&(n.push(i),o.push(s)),s=[u],i=[d]):(i.push(d),s.push(u))}return i&&n.push(i),s.length&&o.push(s),{type:r,areas:n,indices:o,data:e.data}}var $=class{properties;extent;type;id;_pbf;_geometry;_keys;_values;_geometryInfo;constructor(t,r,n,o,i,s){this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=o,this._values=i,this._geometryInfo=s,t.readFields(Bi,this,r)}toGeoJSONFeature(t,r){let n=this.loadGeometry();switch(t){case"wgs84":return Or(this,n,o=>wt(o,r,this.extent));default:return Or(this,n,xt)}}toBinaryFeature(t,r){let n=this.loadFlatGeometry();switch(t){case"wgs84":return this._toBinaryCoordinates(n,o=>Nr(o,r,this.extent));default:return this._toBinaryCoordinates(n,Cr)}}bbox(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,o=0,i=0,s=0,a=1/0,l=-1/0,c=1/0,f=-1/0;for(;t.pos<r;){if(o<=0){let u=t.readVarint();n=u&7,o=u>>3}if(o--,n===1||n===2)i+=t.readSVarint(),s+=t.readSVarint(),i<a&&(a=i),i>l&&(l=i),s<c&&(c=s),s>f&&(f=s);else if(n!==7)throw new Error(`unknown command ${n}`)}return[a,c,l,f]}_toBinaryCoordinates(t,r){let n;r(t.data,this.extent);let o=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=t.indices.length,n={type:"Point",...t};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=t.indices.length,this._geometryInfo.linePositionsCount+=t.data.length/o,n={type:"LineString",...t};break;case 3:n=Gr(t),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(let s of n.indices)this._geometryInfo.polygonRingsCount+=s.length;this._geometryInfo.polygonPositionsCount+=n.data.length/o;break;default:throw new Error(`Invalid geometry type: ${this.type}`)}let i={type:"Feature",geometry:n,properties:this.properties};return this.id!==null&&(i.id=this.id),i}loadGeometry(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,o=0,i=0,s=0,a=[],l;for(;t.pos<r;){if(o<=0){let c=t.readVarint();n=c&7,o=c>>3}switch(o--,n){case 1:case 2:i+=t.readSVarint(),s+=t.readSVarint(),n===1&&(l&&a.push(l),l=[]),l&&l.push([i,s]);break;case 7:l&&l.push(l[0].slice());break;default:throw new Error(`unknown command ${n}`)}}return l&&a.push(l),a}loadFlatGeometry(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,o,i=0,s=0,a=0,l=0,c=[],f=[];for(;t.pos<r;)if(i<=0&&(o=t.readVarint(),n=o&7,i=o>>3),i--,n===1||n===2)s+=t.readSVarint(),a+=t.readSVarint(),n===1&&c.push(l),f.push(s,a),l+=2;else if(n===7){if(l>0){let u=c[c.length-1];f.push(f[u],f[u+1]),l+=2}}else throw new Error(`unknown command ${n}`);return{data:f,indices:c}}};_e($,"types",["Unknown","Point","LineString","Polygon"]);function Or(e,t,r){let n=$.types[e.type],o,i,s;switch(e.type){case 1:let l=[];for(o=0;o<t.length;o++)l[o]=t[o][0];s=l,r(s,e.extent);break;case 2:for(s=t,o=0;o<s.length;o++)r(s[o],e.extent);break;case 3:for(s=kr(t),o=0;o<s.length;o++)for(i=0;i<s[o].length;i++)r(s[o][i],e.extent);break;default:throw new Error("illegal vector tile type")}s.length===1?s=s[0]:n=`Multi${n}`;let a={type:"Feature",geometry:{type:n,coordinates:s},properties:e.properties};return e.id!==null&&(a.properties||={},a.properties.id=e.id),a}function Bi(e,t,r){t&&r&&(e===1?t.id=r.readVarint():e===2?Si(r,t):e===3?t.type=r.readVarint():e===4&&(t._geometry=r.pos))}function Si(e,t){let r=e.readVarint()+e.pos;for(;e.pos<r;){let n=t._keys[e.readVarint()],o=t._values[e.readVarint()];t.properties[n]=o}}var He=class{version;name;extent;length;_pbf;_keys;_values;_features;constructor(t,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ei,this,r),this.length=this._features.length}getGeoJSONFeature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let r=this._pbf.readVarint()+this._pbf.pos;return new $(this._pbf,r,this.extent,this._keys,this._values)}getBinaryFeature(t,r){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let n=this._pbf.readVarint()+this._pbf.pos;return new $(this._pbf,n,this.extent,this._keys,this._values,r)}};function Ei(e,t,r){t&&r&&(e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(Ai(r)))}function Ai(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}var ve=class{layers;constructor(t,r){this.layers=t.readFields(_i,{},r)}};function _i(e,t,r){if(e===3&&r){let n=new He(r,r.readVarint()+r.pos);n.length&&t&&(t[n.name]=n)}}function Ft(e,t){let r=Li(t),n=t?.gis?.format||t?.mvt?.shape||t?.shape;switch(n){case"columnar-table":return{shape:"columnar-table",data:vt(e,r)};case"geojson-table":return{shape:"geojson-table",type:"FeatureCollection",features:jr(e,r)};case"geojson":return jr(e,r);case"binary-geometry":return vt(e,r);case"binary":return vt(e,r);default:throw new Error(n||"undefined shape")}}function vt(e,t){let[r,n]=Di(e,t),o=je(r,n);return o.byteLength=e.byteLength,o}function Di(e,t){let r=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength<=0)return[r,n];let o=new ve(new Tt.default(e));return(t&&Array.isArray(t.layers)?t.layers:Object.keys(o.layers)).forEach(s=>{let a=o.layers[s];if(a)for(let l=0;l<a.length;l++){let c=a.getBinaryFeature(l,n),f=Vi(c,t,s);r.push(f)}}),[r,n]}function jr(e,t){if(e.byteLength<=0)return[];let r=[],n=new ve(new Tt.default(e));return(Array.isArray(t.layers)?t.layers:Object.keys(n.layers)).forEach(i=>{let s=n.layers[i];if(s)for(let a=0;a<s.length;a++){let l=s.getGeoJSONFeature(a),c=Mi(l,t,i);r.push(c)}}),r}function Li(e){if(!e?.mvt)throw new Error("mvt options required");if(e.mvt?.coordinates==="wgs84"&&!e.mvt.tileIndex)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return e.gis&&nt.warn('MVTLoader: "options.gis" is deprecated, use "options.mvt.shape" instead')(),e.mvt}function Mi(e,t,r){let n=e.toGeoJSONFeature(t.coordinates||"local",t.tileIndex);return t.layerProperty&&(n.properties||={},n.properties[t.layerProperty]=r),n}function Vi(e,t,r){let n=e.toBinaryFeature(t.coordinates||"local",t.tileIndex);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=r),n}var zr={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],category:"geometry"};var Ui="4.4.0-alpha.1",Rr={...zr,dataType:null,batchType:null,version:Ui,worker:!0,options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:void 0}}},Pt={...Rr,parse:async(e,t)=>Ft(e,t),parseSync:Ft,binary:!0};var Ze={name:"PMTiles",id:"pmtiles",module:"pmtiles",extensions:["pmtiles"],mimeTypes:["application/octet-stream"],tests:["PMTiles"]};var Ie={};Ot(Ie,{Compression:()=>an,EtagMismatch:()=>We,FetchSource:()=>un,FileSource:()=>gs,PMTiles:()=>Et,Protocol:()=>cs,ResolvedValueCache:()=>ys,SharedPromiseCache:()=>mn,TileType:()=>ln,bytesToHeader:()=>hn,findTile:()=>fn,getUint64:()=>_,leafletRasterLayer:()=>as,readVarint:()=>oe,tileIdToZxy:()=>ds,tileTypeExt:()=>cn,zxyToTileId:()=>sn});var W=Math.pow,F=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(c){o(c)}},s=l=>{try{a(r.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())}),B=Uint8Array,ie=Uint16Array,Ci=Int32Array,$r=new B([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Wr=new B([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ni=new B([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jr=function(e,t){for(var r=new ie(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Ci(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},Kr=Jr($r,2),Yr=Kr.b,ki=Kr.r;Yr[28]=258,ki[258]=28;var Xr=Jr(Wr,0),Gi=Xr.b,ic=Xr.r,Bt=new ie(32768);for(w=0;w<32768;++w)O=(w&43690)>>1|(w&21845)<<1,O=(O&52428)>>2|(O&13107)<<2,O=(O&61680)>>4|(O&3855)<<4,Bt[w]=((O&65280)>>8|(O&255)<<8)>>1;var O,w,Fe=function(e,t,r){for(var n=e.length,o=0,i=new ie(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new ie(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var a;if(r){a=new ie(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],f=t-e[o],u=s[e[o]-1]++<<f,h=u|(1<<f)-1;u<=h;++u)a[Bt[u]>>l]=c}else for(a=new ie(n),o=0;o<n;++o)e[o]&&(a[o]=Bt[s[e[o]-1]++]>>15-e[o]);return a},Pe=new B(288);for(w=0;w<144;++w)Pe[w]=8;var w;for(w=144;w<256;++w)Pe[w]=9;var w;for(w=256;w<280;++w)Pe[w]=7;var w;for(w=280;w<288;++w)Pe[w]=8;var w,Qr=new B(32);for(w=0;w<32;++w)Qr[w]=5;var w,Oi=Fe(Pe,9,1),ji=Fe(Qr,5,1),It=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},U=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},bt=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},zi=function(e){return(e+7)/8|0},Ri=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new B(r-t);return n.set(e.subarray(t,r)),n},Hi=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],b=function(e,t,r){var n=new Error(t||Hi[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,b),!r)throw n;return n},At=function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new B(0);var s=!r||t.i!=2,a=t.i;r||(r=new B(o*3));var l=function(Nt){var kt=r.length;if(Nt>kt){var Gt=new B(Math.max(kt*2,Nt));Gt.set(r),r=Gt}},c=t.f||0,f=t.p||0,u=t.b||0,h=t.l,d=t.d,p=t.m,y=t.n,P=o*8;do{if(!h){c=U(e,f,1);var D=U(e,f+1,3);if(f+=3,D)if(D==1)h=Oi,d=ji,p=9,y=5;else if(D==2){var S=U(e,f,31)+257,C=U(e,f+10,15)+4,M=S+U(e,f+5,31)+1;f+=14;for(var I=new B(M),E=new B(19),A=0;A<C;++A)E[Ni[A]]=U(e,f+A*3,7);f+=C*3;for(var Lt=It(E),Tn=(1<<Lt)-1,Fn=Fe(E,Lt,1),A=0;A<M;){var Mt=Fn[U(e,f,Tn)];f+=Mt&15;var v=Mt>>4;if(v<16)I[A++]=v;else{var K=0,Se=0;for(v==16?(Se=3+U(e,f,3),f+=2,K=I[A-1]):v==17?(Se=3+U(e,f,7),f+=3):v==18&&(Se=11+U(e,f,127),f+=7);Se--;)I[A++]=K}}var Vt=I.subarray(0,S),V=I.subarray(S);p=It(Vt),y=It(V),h=Fe(Vt,p,1),d=Fe(V,y,1)}else b(1);else{var v=zi(f)+4,m=e[v-4]|e[v-3]<<8,g=v+m;if(g>o){a&&b(0);break}s&&l(u+m),r.set(e.subarray(v,g),u),t.b=u+=m,t.p=f=g*8,t.f=c;continue}if(f>P){a&&b(0);break}}s&&l(u+131072);for(var Pn=(1<<p)-1,In=(1<<y)-1,Ke=f;;Ke=f){var K=h[bt(e,f)&Pn],Y=K>>4;if(f+=K&15,f>P){a&&b(0);break}if(K||b(2),Y<256)r[u++]=Y;else if(Y==256){Ke=f,h=null;break}else{var Ut=Y-254;if(Y>264){var A=Y-257,se=$r[A];Ut=U(e,f,(1<<se)-1)+Yr[A],f+=se}var Ye=d[bt(e,f)&In],Xe=Ye>>4;Ye||b(3),f+=Ye&15;var V=Gi[Xe];if(Xe>3){var se=Wr[Xe];V+=bt(e,f)&(1<<se)-1,f+=se}if(f>P){a&&b(0);break}s&&l(u+131072);var Qe=u+Ut;if(u<V){var Ct=i-V,bn=Math.min(V,Qe);for(Ct+u<0&&b(3);u<bn;++u)r[u]=n[Ct+u]}for(;u<Qe;u+=4)r[u]=r[u-V],r[u+1]=r[u+1-V],r[u+2]=r[u+2-V],r[u+3]=r[u+3-V];u=Qe}}t.l=h,t.p=Ke,t.b=u,t.f=c,h&&(c=1,t.m=p,t.d=d,t.n=y)}while(!c);return u==r.length?r:Ri(r,0,u)},Zi=new B(0),$i=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&b(6,"invalid gzip data");var t=e[3],r=10;t&4&&(r+=(e[10]|e[11]<<8)+2);for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(t&2)},Wi=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Ji=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&b(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&b(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function Ki(e,t){return At(e,{i:2},t&&t.out,t&&t.dictionary)}function Yi(e,t){var r=$i(e);return r+8>e.length&&b(6,"invalid gzip data"),At(e.subarray(r,-8),{i:2},t&&t.out||new B(Wi(e)),t&&t.dictionary)}function Xi(e,t){return At(e.subarray(Ji(e,t&&t.dictionary),-4),{i:2},t&&t.out,t&&t.dictionary)}function St(e,t){return e[0]==31&&e[1]==139&&e[2]==8?Yi(e,t):(e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31?Ki(e,t):Xi(e,t)}var Qi=typeof TextDecoder<"u"&&new TextDecoder,qi=0;try{Qi.decode(Zi,{stream:!0}),qi=1}catch{}var qr=(e,t)=>e*W(2,t),Te=(e,t)=>Math.floor(e/W(2,t)),$e=(e,t)=>qr(e.getUint16(t+1,!0),8)+e.getUint8(t),en=(e,t)=>qr(e.getUint32(t+2,!0),16)+e.getUint16(t,!0),es=(e,t,r,n,o)=>{if(e!==n.getUint8(o))return e-n.getUint8(o);let i=$e(n,o+1);if(t!==i)return t-i;let s=$e(n,o+4);return r!==s?r-s:0},ts=(e,t,r,n)=>{let o=tn(e,t|128,r,n);return o?{z:t,x:r,y:n,offset:o[0],length:o[1],isDir:!0}:null},Hr=(e,t,r,n)=>{let o=tn(e,t,r,n);return o?{z:t,x:r,y:n,offset:o[0],length:o[1],isDir:!1}:null},tn=(e,t,r,n)=>{let o=0,i=e.byteLength/17-1;for(;o<=i;){let s=i+o>>1,a=es(t,r,n,e,s*17);if(a>0)o=s+1;else if(a<0)i=s-1;else return[en(e,s*17+7),e.getUint32(s*17+13,!0)]}return null},rs=(e,t)=>e.isDir&&!t.isDir?1:!e.isDir&&t.isDir?-1:e.z!==t.z?e.z-t.z:e.x!==t.x?e.x-t.x:e.y-t.y,rn=(e,t)=>{let r=e.getUint8(t*17);return{z:r&127,x:$e(e,t*17+1),y:$e(e,t*17+4),offset:en(e,t*17+7),length:e.getUint32(t*17+13,!0),isDir:r>>7===1}},Zr=e=>{let t=[],r=new DataView(e);for(let n=0;n<r.byteLength/17;n++)t.push(rn(r,n));return ns(t)},ns=e=>{e.sort(rs);let t=new ArrayBuffer(17*e.length),r=new Uint8Array(t);for(let n=0;n<e.length;n++){let o=e[n],i=o.z;o.isDir&&(i=i|128),r[n*17]=i,r[n*17+1]=o.x&255,r[n*17+2]=o.x>>8&255,r[n*17+3]=o.x>>16&255,r[n*17+4]=o.y&255,r[n*17+5]=o.y>>8&255,r[n*17+6]=o.y>>16&255,r[n*17+7]=o.offset&255,r[n*17+8]=Te(o.offset,8)&255,r[n*17+9]=Te(o.offset,16)&255,r[n*17+10]=Te(o.offset,24)&255,r[n*17+11]=Te(o.offset,32)&255,r[n*17+12]=Te(o.offset,48)&255,r[n*17+13]=o.length&255,r[n*17+14]=o.length>>8&255,r[n*17+15]=o.length>>16&255,r[n*17+16]=o.length>>24&255}return t},os=(e,t)=>{if(e.byteLength<17)return null;let r=e.byteLength/17,n=rn(e,r-1);if(n.isDir){let o=n.z,i=t.z-o,s=Math.trunc(t.x/(1<<i)),a=Math.trunc(t.y/(1<<i));return{z:o,x:s,y:a}}return null};function is(e){return F(this,null,function*(){let t=yield e.getBytes(0,512e3),r=new DataView(t.data),n=r.getUint32(4,!0),o=r.getUint16(8,!0),i=new TextDecoder("utf-8"),s=JSON.parse(i.decode(new DataView(t.data,10,n))),a=0;s.compression==="gzip"&&(a=2);let l=0;"minzoom"in s&&(l=+s.minzoom);let c=0;"maxzoom"in s&&(c=+s.maxzoom);let f=0,u=0,h=0,d=-180,p=-85,y=180,P=85;if(s.bounds){let v=s.bounds.split(",");d=+v[0],p=+v[1],y=+v[2],P=+v[3]}if(s.center){let v=s.center.split(",");f=+v[0],u=+v[1],h=+v[2]}return{specVersion:r.getUint16(2,!0),rootDirectoryOffset:10+n,rootDirectoryLength:o*17,jsonMetadataOffset:10,jsonMetadataLength:n,leafDirectoryOffset:0,leafDirectoryLength:void 0,tileDataOffset:0,tileDataLength:void 0,numAddressedTiles:0,numTileEntries:0,numTileContents:0,clustered:!1,internalCompression:1,tileCompression:a,tileType:1,minZoom:l,maxZoom:c,minLon:d,minLat:p,maxLon:y,maxLat:P,centerZoom:h,centerLon:f,centerLat:u,etag:t.etag}})}function ss(e,t,r,n,o,i,s){return F(this,null,function*(){let a=yield r.getArrayBuffer(t,e.rootDirectoryOffset,e.rootDirectoryLength,e);e.specVersion===1&&(a=Zr(a));let l=Hr(new DataView(a),n,o,i);if(l){let u=(yield t.getBytes(l.offset,l.length,s)).data,h=new DataView(u);return h.getUint8(0)===31&&h.getUint8(1)===139&&(u=St(new Uint8Array(u))),{data:u}}let c=os(new DataView(a),{z:n,x:o,y:i});if(c){let f=ts(new DataView(a),c.z,c.x,c.y);if(f){let u=yield r.getArrayBuffer(t,f.offset,f.length,e);e.specVersion===1&&(u=Zr(u));let h=Hr(new DataView(u),n,o,i);if(h){let p=(yield t.getBytes(h.offset,h.length,s)).data,y=new DataView(p);return y.getUint8(0)===31&&y.getUint8(1)===139&&(p=St(new Uint8Array(p))),{data:p}}}}})}var nn={getHeader:is,getZxy:ss},as=(e,t)=>{let r=!1,n="",o=L.GridLayer.extend({createTile:(i,s)=>{let a=document.createElement("img"),l=new AbortController,c=l.signal;return a.cancel=()=>{l.abort()},r||(e.getHeader().then(f=>{f.tileType===1?console.error("Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details."):f.tileType===2?n="image/png":f.tileType===3?n="image/jpeg":f.tileType===4?n="image/webp":f.tileType===5&&(n="image/avif")}),r=!0),e.getZxy(i.z,i.x,i.y,c).then(f=>{if(f){let u=new Blob([f.data],{type:n}),h=window.URL.createObjectURL(u);a.src=h,a.cancel=void 0,s(void 0,a)}}).catch(f=>{if(f.name!=="AbortError")throw f}),a},_removeTile:function(i){let s=this._tiles[i];s&&(s.el.cancel&&s.el.cancel(),s.el.width=0,s.el.height=0,s.el.deleted=!0,L.DomUtil.remove(s.el),delete this._tiles[i],this.fire("tileunload",{tile:s.el,coords:this._keyToTileCoords(i)}))}});return new o(t)},ls=e=>(t,r)=>{if(r instanceof AbortController)return e(t,r);let n=new AbortController;return e(t,n).then(o=>r(void 0,o.data,o.cacheControl||"",o.expires||""),o=>r(o)).catch(o=>r(o)),{cancel:()=>n.abort()}},cs=class{constructor(){this.tilev4=(e,t)=>F(this,null,function*(){if(e.type==="json"){let u=e.url.substr(10),h=this.tiles.get(u);h||(h=new Et(u),this.tiles.set(u,h));let d=yield h.getHeader();return{data:{tiles:[`${e.url}/{z}/{x}/{y}`],minzoom:d.minZoom,maxzoom:d.maxZoom,bounds:[d.minLon,d.minLat,d.maxLon,d.maxLat]}}}let r=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),n=e.url.match(r);if(!n)throw new Error("Invalid PMTiles protocol URL");let o=n[1],i=this.tiles.get(o);i||(i=new Et(o),this.tiles.set(o,i));let s=n[2],a=n[3],l=n[4],c=yield i.getHeader(),f=yield i?.getZxy(+s,+a,+l,t.signal);return f?{data:new Uint8Array(f.data),cacheControl:f.cacheControl,expires:f.expires}:c.tileType===1?{data:new Uint8Array}:{data:null}}),this.tile=ls(this.tilev4),this.tiles=new Map}add(e){this.tiles.set(e.source.getKey(),e)}get(e){return this.tiles.get(e)}};function ne(e,t){return(t>>>0)*4294967296+(e>>>0)}function fs(e,t){let r=t.buf,n=r[t.pos++],o=(n&112)>>4;if(n<128||(n=r[t.pos++],o|=(n&127)<<3,n<128)||(n=r[t.pos++],o|=(n&127)<<10,n<128)||(n=r[t.pos++],o|=(n&127)<<17,n<128)||(n=r[t.pos++],o|=(n&127)<<24,n<128)||(n=r[t.pos++],o|=(n&1)<<31,n<128))return ne(e,o);throw new Error("Expected varint not more than 10 bytes")}function oe(e){let t=e.buf,r=t[e.pos++],n=r&127;return r<128||(r=t[e.pos++],n|=(r&127)<<7,r<128)||(r=t[e.pos++],n|=(r&127)<<14,r<128)||(r=t[e.pos++],n|=(r&127)<<21,r<128)?n:(r=t[e.pos],n|=(r&15)<<28,fs(n,e))}function on(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let o=t[0];t[0]=t[1],t[1]=o}}function us(e,t){let r=W(2,e),n=t,o=t,i=t,s=[0,0],a=1;for(;a<r;)n=1&i/2,o=1&(i^n),on(a,s,n,o),s[0]+=a*n,s[1]+=a*o,i=i/4,a*=2;return[e,s[0],s[1]]}var hs=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function sn(e,t,r){if(e>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(t>W(2,e)-1||r>W(2,e)-1)throw Error("tile x/y outside zoom level bounds");let n=hs[e],o=W(2,e),i=0,s=0,a=0,l=[t,r],c=o/2;for(;c>0;)i=(l[0]&c)>0?1:0,s=(l[1]&c)>0?1:0,a+=c*c*(3*i^s),on(c,l,i,s),c=c/2;return n+a}function ds(e){let t=0,r=0;for(let n=0;n<27;n++){let o=(1<<n)*(1<<n);if(t+o>e)return us(n,e-t);t+=o}throw Error("Tile zoom level exceeds max safe number limit (26)")}var an=(e=>(e[e.Unknown=0]="Unknown",e[e.None=1]="None",e[e.Gzip=2]="Gzip",e[e.Brotli=3]="Brotli",e[e.Zstd=4]="Zstd",e))(an||{});function _t(e,t){return F(this,null,function*(){if(t===1||t===0)return e;if(t===2){if(typeof globalThis.DecompressionStream>"u")return St(new Uint8Array(e));let r=new Response(e).body;if(!r)throw Error("Failed to read response stream");let n=r.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(n).arrayBuffer()}throw Error("Compression method not supported")})}var ln=(e=>(e[e.Unknown=0]="Unknown",e[e.Mvt=1]="Mvt",e[e.Png=2]="Png",e[e.Jpeg=3]="Jpeg",e[e.Webp=4]="Webp",e[e.Avif=5]="Avif",e))(ln||{});function cn(e){return e===1?".mvt":e===2?".png":e===3?".jpg":e===4?".webp":e===5?".avif":""}var ps=127;function fn(e,t){let r=0,n=e.length-1;for(;r<=n;){let o=n+r>>1,i=t-e[o].tileId;if(i>0)r=o+1;else if(i<0)n=o-1;else return e[o]}return n>=0&&(e[n].runLength===0||t-e[n].tileId<e[n].runLength)?e[n]:null}var gs=class{constructor(e){this.file=e}getKey(){return this.file.name}getBytes(e,t){return F(this,null,function*(){return{data:yield this.file.slice(e,e+t).arrayBuffer()}})}},un=class{constructor(e,t=new Headers){this.url=e,this.customHeaders=t,this.mustReload=!1;let r="";"navigator"in globalThis&&(r=globalThis.navigator.userAgent||"");let n=r.indexOf("Windows")>-1,o=/Chrome|Chromium|Edg|OPR|Brave/.test(r);this.chromeWindowsNoCache=!1,n&&o&&(this.chromeWindowsNoCache=!0)}getKey(){return this.url}setHeaders(e){this.customHeaders=e}getBytes(e,t,r,n){return F(this,null,function*(){let o,i;r?i=r:(o=new AbortController,i=o.signal);let s=new Headers(this.customHeaders);s.set("range",`bytes=${e}-${e+t-1}`);let a;this.mustReload?a="reload":this.chromeWindowsNoCache&&(a="no-store");let l=yield fetch(this.url,{signal:i,cache:a,headers:s});if(e===0&&l.status===416){let h=l.headers.get("Content-Range");if(!h||!h.startsWith("bytes */"))throw Error("Missing content-length on 416 response");let d=+h.substr(8);l=yield fetch(this.url,{signal:i,cache:"reload",headers:{range:`bytes=0-${d-1}`}})}let c=l.headers.get("Etag");if(c?.startsWith("W/")&&(c=null),l.status===416||n&&c&&c!==n)throw this.mustReload=!0,new We(`Server returned non-matching ETag ${n} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`);if(l.status>=300)throw Error(`Bad response code: ${l.status}`);let f=l.headers.get("Content-Length");if(l.status===200&&(!f||+f>t))throw o&&o.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield l.arrayBuffer(),etag:c||void 0,cacheControl:l.headers.get("Cache-Control")||void 0,expires:l.headers.get("Expires")||void 0}})}};function _(e,t){let r=e.getUint32(t+4,!0),n=e.getUint32(t+0,!0);return r*W(2,32)+n}function hn(e,t){let r=new DataView(e),n=r.getUint8(7);if(n>3)throw Error(`Archive is spec version ${n} but this library supports up to spec version 3`);return{specVersion:n,rootDirectoryOffset:_(r,8),rootDirectoryLength:_(r,16),jsonMetadataOffset:_(r,24),jsonMetadataLength:_(r,32),leafDirectoryOffset:_(r,40),leafDirectoryLength:_(r,48),tileDataOffset:_(r,56),tileDataLength:_(r,64),numAddressedTiles:_(r,72),numTileEntries:_(r,80),numTileContents:_(r,88),clustered:r.getUint8(96)===1,internalCompression:r.getUint8(97),tileCompression:r.getUint8(98),tileType:r.getUint8(99),minZoom:r.getUint8(100),maxZoom:r.getUint8(101),minLon:r.getInt32(102,!0)/1e7,minLat:r.getInt32(106,!0)/1e7,maxLon:r.getInt32(110,!0)/1e7,maxLat:r.getInt32(114,!0)/1e7,centerZoom:r.getUint8(118),centerLon:r.getInt32(119,!0)/1e7,centerLat:r.getInt32(123,!0)/1e7,etag:t}}function dn(e){let t={buf:new Uint8Array(e),pos:0},r=oe(t),n=[],o=0;for(let i=0;i<r;i++){let s=oe(t);n.push({tileId:o+s,offset:0,length:0,runLength:1}),o+=s}for(let i=0;i<r;i++)n[i].runLength=oe(t);for(let i=0;i<r;i++)n[i].length=oe(t);for(let i=0;i<r;i++){let s=oe(t);s===0&&i>0?n[i].offset=n[i-1].offset+n[i-1].length:n[i].offset=s-1}return n}function ms(e){let t=new DataView(e);return t.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):t.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var We=class extends Error{};function pn(e,t){return F(this,null,function*(){let r=yield e.getBytes(0,16384);if(new DataView(r.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(ms(r.data)<3)return[yield nn.getHeader(e)];let o=r.data.slice(0,ps),i=hn(o,r.etag),s=r.data.slice(i.rootDirectoryOffset,i.rootDirectoryOffset+i.rootDirectoryLength),a=`${e.getKey()}|${i.etag||""}|${i.rootDirectoryOffset}|${i.rootDirectoryLength}`,l=dn(yield t(s,i.internalCompression));return[i,[a,l.length,l]]})}function gn(e,t,r,n,o){return F(this,null,function*(){let i=yield e.getBytes(r,n,void 0,o.etag),s=yield t(i.data,o.internalCompression),a=dn(s);if(a.length===0)throw new Error("Empty directory is invalid");return a})}var ys=class{constructor(e=100,t=!0,r=_t){this.cache=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=r}getHeader(e){return F(this,null,function*(){let t=e.getKey(),r=this.cache.get(t);if(r)return r.lastUsed=this.counter++,r.data;let n=yield pn(e,this.decompress);return n[1]&&this.cache.set(n[1][0],{lastUsed:this.counter++,data:n[1][2]}),this.cache.set(t,{lastUsed:this.counter++,data:n[0]}),this.prune(),n[0]})}getDirectory(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,i.data;let s=yield gn(e,this.decompress,t,r,n);return this.cache.set(o,{lastUsed:this.counter++,data:s}),this.prune(),s})}getArrayBuffer(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,yield i.data;let s=yield e.getBytes(t,r,void 0,n.etag);return this.cache.set(o,{lastUsed:this.counter++,data:s.data}),this.prune(),s.data})}prune(){if(this.cache.size>this.maxCacheEntries){let e=1/0,t;this.cache.forEach((r,n)=>{r.lastUsed<e&&(e=r.lastUsed,t=n)}),t&&this.cache.delete(t)}}invalidate(e){return F(this,null,function*(){this.cache.delete(e.getKey())})}},mn=class{constructor(e=100,t=!0,r=_t){this.cache=new Map,this.invalidations=new Map,this.maxCacheEntries=e,this.counter=1,this.decompress=r}getHeader(e){return F(this,null,function*(){let t=e.getKey(),r=this.cache.get(t);if(r)return r.lastUsed=this.counter++,yield r.data;let n=new Promise((o,i)=>{pn(e,this.decompress).then(s=>{s[1]&&this.cache.set(s[1][0],{lastUsed:this.counter++,data:Promise.resolve(s[1][2])}),o(s[0]),this.prune()}).catch(s=>{i(s)})});return this.cache.set(t,{lastUsed:this.counter++,data:n}),n})}getDirectory(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,yield i.data;let s=new Promise((a,l)=>{gn(e,this.decompress,t,r,n).then(c=>{a(c),this.prune()}).catch(c=>{l(c)})});return this.cache.set(o,{lastUsed:this.counter++,data:s}),s})}getArrayBuffer(e,t,r,n){return F(this,null,function*(){let o=`${e.getKey()}|${n.etag||""}|${t}|${r}`,i=this.cache.get(o);if(i)return i.lastUsed=this.counter++,yield i.data;let s=new Promise((a,l)=>{e.getBytes(t,r,void 0,n.etag).then(c=>{a(c.data),this.cache.has(o),this.prune()}).catch(c=>{l(c)})});return this.cache.set(o,{lastUsed:this.counter++,data:s}),s})}prune(){if(this.cache.size>=this.maxCacheEntries){let e=1/0,t;this.cache.forEach((r,n)=>{r.lastUsed<e&&(e=r.lastUsed,t=n)}),t&&this.cache.delete(t)}}invalidate(e){return F(this,null,function*(){let t=e.getKey();if(this.invalidations.get(t))return yield this.invalidations.get(t);this.cache.delete(e.getKey());let r=new Promise((n,o)=>{this.getHeader(e).then(i=>{n(),this.invalidations.delete(t)}).catch(i=>{o(i)})});this.invalidations.set(t,r)})}},Et=class{constructor(e,t,r){typeof e=="string"?this.source=new un(e):this.source=e,r?this.decompress=r:this.decompress=_t,t?this.cache=t:this.cache=new mn}getHeader(){return F(this,null,function*(){return yield this.cache.getHeader(this.source)})}getZxyAttempt(e,t,r,n){return F(this,null,function*(){let o=sn(e,t,r),i=yield this.cache.getHeader(this.source);if(i.specVersion<3)return nn.getZxy(i,this.source,this.cache,e,t,r,n);if(e<i.minZoom||e>i.maxZoom)return;let s=i.rootDirectoryOffset,a=i.rootDirectoryLength;for(let l=0;l<=3;l++){let c=yield this.cache.getDirectory(this.source,s,a,i),f=fn(c,o);if(f){if(f.runLength>0){let u=yield this.source.getBytes(i.tileDataOffset+f.offset,f.length,n,i.etag);return{data:yield this.decompress(u.data,i.tileCompression),cacheControl:u.cacheControl,expires:u.expires}}s=i.leafDirectoryOffset+f.offset,a=f.length}else return}throw Error("Maximum directory depth exceeded")})}getZxy(e,t,r,n){return F(this,null,function*(){try{return yield this.getZxyAttempt(e,t,r,n)}catch(o){if(o instanceof We)return this.cache.invalidate(this.source),yield this.getZxyAttempt(e,t,r,n);throw o}})}getMetadataAttempt(){return F(this,null,function*(){let e=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(e.jsonMetadataOffset,e.jsonMetadataLength,void 0,e.etag),r=yield this.decompress(t.data,e.internalCompression),n=new TextDecoder("utf-8");return JSON.parse(n.decode(r))})}getMetadata(){return F(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(e){if(e instanceof We)return this.cache.invalidate(this.source),yield this.getMetadataAttempt();throw e}})}getTileJson(e){return F(this,null,function*(){let t=yield this.getHeader(),r=yield this.getMetadata(),n=cn(t.tileType);return{tilejson:"3.0.0",scheme:"xyz",tiles:[`${e}/{z}/{x}/{y}${n}`],vector_layers:r.vector_layers,attribution:r.attribution,description:r.description,name:r.name,version:r.version,bounds:[t.minLon,t.minLat,t.maxLon,t.maxLat],center:[t.centerLon,t.centerLat,t.centerZoom],minzoom:t.minZoom,maxzoom:t.maxZoom}})}};var{TileType:be}=Ie;function yn(e,t,r,n){let o=null;if(t)try{let a=JSON.stringify(t);o=pe.parseTextSync?.(a,n)||null}catch(a){console.warn("PMTiles metadata could not be interpreted as TileJSON",a)}let i={};typeof o?.name=="string"&&(i.name=o.name),typeof o?.htmlAttribution=="string"&&(i.attributions=[o.htmlAttribution]);let s={...i,format:"pmtiles",formatVersion:e.specVersion,attributions:[],tileMIMEType:xs(e.tileType),minZoom:e.minZoom,maxZoom:e.maxZoom,boundingBox:[[e.minLon,e.minLat],[e.maxLon,e.maxLat]],center:[e.centerLon,e.centerLat],centerZoom:e.centerZoom,etag:e.etag};return o&&(s.tilejson=o),r?.includeFormatHeader&&(s.formatHeader=e,s.formatMetadata=s),s}function xs(e){switch(e){case be.Mvt:return"application/vnd.mapbox-vector-tile";case be.Png:return"image/png";case be.Jpeg:return"image/jpeg";case be.Webp:return"image/webp";case be.Avif:return"image/avif";default:return"application/octet-stream"}}var Je=class{blob;key;constructor(t,r){this.blob=t,this.key=r}getKey(){return this.blob.url||""}async getBytes(t,r,n){return{data:await this.blob.slice(t,t+r).arrayBuffer()}}};var{PMTiles:ws}=Ie,vs="1.0.0",Dt={...Ze,version:vs,type:"pmtiles",fromUrl:!0,fromBlob:!0,defaultOptions:{pmtiles:{}},testURL:e=>e.endsWith(".pmtiles"),createDataSource:(e,t)=>new J(e,t)},J=class extends q{mimeType=null;pmtiles;metadata;constructor(t,r){super(t,r,Dt.defaultOptions);let n=typeof t=="string"?fe(t):new Je(t,"pmtiles");this.pmtiles=new ws(n),this.getTileData=this.getTileData.bind(this),this.metadata=this.getMetadata()}async getSchema(){return{fields:[],metadata:{}}}async getMetadata(){let t=await this.pmtiles.getHeader(),r=await this.pmtiles.getMetadata()||{},n=yn(t,r,{includeFormatHeader:!1},this.loadOptions);return this.options.attributions&&(n.attributions=[...this.options.core?.attributions||[],...n.attributions||[]]),n?.tileMIMEType&&(this.mimeType=n?.tileMIMEType),n}async getTile(t){let{x:r,y:n,z:o}=t,s=(await this.pmtiles.getZxy(o,r,n))?.data;return s||null}async getTileData(t){let{x:r,y:n,z:o}=t.index;switch((await this.metadata).tileMIMEType){case"application/vnd.mapbox-vector-tile":return await this.getVectorTile({x:r,y:n,z:o,layers:[]});default:return await this.getImageTile({x:r,y:n,z:o,layers:[]})}}async getImageTile(t){let r=await this.getTile(t);return r?await ct.parse(r,this.loadOptions):null}async getVectorTile(t){let r=await this.getTile(t),n={shape:"geojson-table",mvt:{coordinates:"wgs84",tileIndex:{x:t.x,y:t.y,z:t.z},...this.loadOptions?.mvt},...this.loadOptions};return r?await Pt.parse(r,n):null}};var xn="4.4.0-alpha.1";var vn={...Ze,version:xn,options:{pmtiles:{}},parse:async(e,t)=>wn(new ue(new Blob([e])),t),parseFile:wn};async function wn(e,t){let n=await new J(e.handle,{pmtiles:t?.pmtiles||{}}).getMetadata(),{tileMIMEType:o,tilejson:i={}}=n,{layers:s=[]}=i;switch(o){case"application/vnd.mapbox-vector-tile":return{shape:"vector-source",layers:s.map(a=>({name:a.name,schema:a.schema})),tables:[],formatSpecificMetadata:n};case"image/png":case"image/jpeg":return{shape:"image-source",formatSpecificMetadata:n};default:throw new Error(`PMTilesLoader: Unsupported tile MIME type ${o}`)}}return Ln(Be);})();
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
ieee754/index.js:
|
package/dist/index.cjs
CHANGED
|
@@ -234,7 +234,7 @@ var PMTilesTileSource = class extends import_loader_utils.DataSource {
|
|
|
234
234
|
var import_loader_utils2 = require("@loaders.gl/loader-utils");
|
|
235
235
|
|
|
236
236
|
// dist/lib/version.js
|
|
237
|
-
var VERSION2 = true ? "4.4.0-alpha.
|
|
237
|
+
var VERSION2 = true ? "4.4.0-alpha.1" : "latest";
|
|
238
238
|
|
|
239
239
|
// dist/pmtiles-loader.js
|
|
240
240
|
var PMTilesLoader = {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.js", "pmtiles-source.js", "pmtiles-format.js", "lib/parse-pmtiles.js", "lib/blob-source.js", "pmtiles-loader.js", "lib/version.js"],
|
|
4
|
-
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { PMTilesSource } from \"./pmtiles-source.js\";\nexport { PMTilesTileSource } from \"./pmtiles-source.js\";\nexport { PMTilesLoader as _PMTilesLoader } from \"./pmtiles-loader.js\";\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { DataSource, resolvePath } from '@loaders.gl/loader-utils';\nimport { ImageLoader } from '@loaders.gl/images';\nimport { MVTLoader } from '@loaders.gl/mvt';\nimport { PMTilesFormat } from \"./pmtiles-format.js\";\nimport * as pmtiles from 'pmtiles';\nconst { PMTiles } = pmtiles;\nimport { parsePMTilesHeader } from \"./lib/parse-pmtiles.js\";\nimport { BlobSource } from \"./lib/blob-source.js\";\nconst VERSION = '1.0.0';\n/**\n * Creates vector tile data sources for PMTiles urls or blobs\n */\nexport const PMTilesSource = {\n ...PMTilesFormat,\n version: VERSION,\n type: 'pmtiles',\n fromUrl: true,\n fromBlob: true,\n defaultOptions: {\n pmtiles: {}\n },\n testURL: (url) => url.endsWith('.pmtiles'),\n createDataSource: (url, options) => new PMTilesTileSource(url, options)\n};\n/**\n * A PMTiles data source\n * @note Can be either a raster or vector tile source depending on the contents of the PMTiles file.\n */\nexport class PMTilesTileSource extends DataSource {\n mimeType = null;\n pmtiles;\n metadata;\n constructor(data, options) {\n super(data, options, PMTilesSource.defaultOptions);\n const urlOrBlob = typeof data === 'string' ? resolvePath(data) : new BlobSource(data, 'pmtiles');\n this.pmtiles = new PMTiles(urlOrBlob);\n this.getTileData = this.getTileData.bind(this);\n this.metadata = this.getMetadata();\n }\n async getSchema() {\n return { fields: [], metadata: {} };\n }\n async getMetadata() {\n const pmtilesHeader = await this.pmtiles.getHeader();\n const pmtilesMetadata = (await this.pmtiles.getMetadata()) || {};\n const metadata = parsePMTilesHeader(pmtilesHeader, pmtilesMetadata, { includeFormatHeader: false }, this.loadOptions);\n // Add additional attribution if necessary\n if (this.options.attributions) {\n metadata.attributions = [\n ...(this.options.core?.attributions || []),\n ...(metadata.attributions || [])\n ];\n }\n if (metadata?.tileMIMEType) {\n this.mimeType = metadata?.tileMIMEType;\n }\n // TODO - do we need to allow tileSize to be overridden? Some PMTiles examples seem to suggest it.\n return metadata;\n }\n async getTile(tileParams) {\n const { x, y, z } = tileParams;\n const rangeResponse = await this.pmtiles.getZxy(z, x, y);\n const arrayBuffer = rangeResponse?.data;\n if (!arrayBuffer) {\n // console.error('No arrayBuffer', tileParams);\n return null;\n }\n return arrayBuffer;\n }\n // Tile Source interface implementation: deck.gl compatible API\n // TODO - currently only handles image tiles, not vector tiles\n async getTileData(tileParams) {\n const { x, y, z } = tileParams.index;\n const metadata = await this.metadata;\n switch (metadata.tileMIMEType) {\n case 'application/vnd.mapbox-vector-tile':\n return await this.getVectorTile({ x, y, z, layers: [] });\n default:\n return await this.getImageTile({ x, y, z, layers: [] });\n }\n }\n // ImageTileSource interface implementation\n async getImageTile(tileParams) {\n const arrayBuffer = await this.getTile(tileParams);\n return arrayBuffer ? await ImageLoader.parse(arrayBuffer, this.loadOptions) : null;\n }\n // VectorTileSource interface implementation\n async getVectorTile(tileParams) {\n const arrayBuffer = await this.getTile(tileParams);\n const loadOptions = {\n shape: 'geojson-table',\n mvt: {\n coordinates: 'wgs84',\n tileIndex: { x: tileParams.x, y: tileParams.y, z: tileParams.z },\n ...this.loadOptions?.mvt\n },\n ...this.loadOptions\n };\n return arrayBuffer ? await MVTLoader.parse(arrayBuffer, loadOptions) : null;\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * PMTiles\n */\nexport const PMTilesFormat = {\n name: 'PMTiles',\n id: 'pmtiles',\n module: 'pmtiles',\n extensions: ['pmtiles'],\n mimeTypes: ['application/octet-stream'],\n tests: ['PMTiles']\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { TileJSONLoader } from '@loaders.gl/mvt';\n// import {Source, PMTiles, Header, TileType} from 'pmtiles';\nimport * as pmtiles from 'pmtiles';\nconst { TileType } = pmtiles;\n/**\n * Parse PMTiles metdata from a PMTiles file\n * @param header\n * @param tilejsonMetadata\n * @param options\n * @param loadOptions\n * @returns\n */\nexport function parsePMTilesHeader(header, pmtilesMetadata, options, loadOptions) {\n // Ironically, to use the TileJSON loader we need to stringify the metadata again.\n // This is the price of integrating with the existing pmtiles library.\n // TODO - provide a non-standard TileJSONLoader parsers that accepts a JSON object?\n let tilejson = null;\n if (pmtilesMetadata) {\n try {\n const string = JSON.stringify(pmtilesMetadata);\n tilejson = TileJSONLoader.parseTextSync?.(string, loadOptions) || null;\n }\n catch (error) {\n // eslint-disable-next-line no-console\n console.warn('PMTiles metadata could not be interpreted as TileJSON', error);\n }\n }\n const partialMetadata = {};\n if (typeof tilejson?.name === 'string') {\n partialMetadata.name = tilejson.name;\n }\n if (typeof tilejson?.htmlAttribution === 'string') {\n partialMetadata.attributions = [tilejson.htmlAttribution];\n }\n const metadata = {\n ...partialMetadata,\n format: 'pmtiles',\n formatVersion: header.specVersion,\n attributions: [],\n tileMIMEType: decodeTileType(header.tileType),\n minZoom: header.minZoom,\n maxZoom: header.maxZoom,\n boundingBox: [\n [header.minLon, header.minLat],\n [header.maxLon, header.maxLat]\n ],\n center: [header.centerLon, header.centerLat],\n centerZoom: header.centerZoom,\n etag: header.etag\n };\n if (tilejson) {\n metadata.tilejson = tilejson;\n }\n // Application can optionally include the raw header and metadata.\n if (options?.includeFormatHeader) {\n metadata.formatHeader = header;\n metadata.formatMetadata = metadata;\n }\n return metadata;\n}\n/** Extract a MIME type for tiles from vector tile header */\nfunction decodeTileType(tileType) {\n switch (tileType) {\n case TileType.Mvt:\n return 'application/vnd.mapbox-vector-tile';\n case TileType.Png:\n return 'image/png';\n case TileType.Jpeg:\n return 'image/jpeg';\n case TileType.Webp:\n return 'image/webp';\n case TileType.Avif:\n return 'image/avif';\n default:\n return 'application/octet-stream';\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * A PMTiles library compatible source that reads from blobs\n * @deprecated TODO - reimplement as ReadableFileSource\n * Use loaders.gl HTTP range requests instead\n */\nexport class BlobSource {\n blob;\n key;\n constructor(blob, key) {\n this.blob = blob;\n this.key = key;\n }\n // TODO - how is this used?\n getKey() {\n // @ts-expect-error url is only defined on File subclass\n return this.blob.url || '';\n }\n async getBytes(offset, length, signal) {\n const slice = this.blob.slice(offset, offset + length);\n const data = await slice.arrayBuffer();\n return {\n data\n // etag: response.headers.get('ETag') || undefined,\n // cacheControl: response.headers.get('Cache-Control') || undefined,\n // expires: response.headers.get('Expires') || undefined\n };\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { BlobFile } from '@loaders.gl/loader-utils';\nimport { VERSION } from \"./lib/version.js\";\nimport { PMTilesTileSource } from \"./pmtiles-source.js\";\nimport { PMTilesFormat } from \"./pmtiles-format.js\";\n/**\n * Loader for PMTiles metadata\n * @note This loader is intended to allow PMTiles to be treated like other file types in top-level loading logic.\n * @note For actual access to the tile data, use the PMTilesSource class.\n */\nexport const PMTilesLoader = {\n ...PMTilesFormat,\n version: VERSION,\n options: {\n pmtiles: {}\n },\n parse: async (arrayBuffer, options) => parseFileAsPMTiles(new BlobFile(new Blob([arrayBuffer])), options),\n parseFile: parseFileAsPMTiles\n};\nasync function parseFileAsPMTiles(file, options) {\n const source = new PMTilesTileSource(file.handle, {\n pmtiles: options?.pmtiles || {}\n });\n const formatSpecificMetadata = await source.getMetadata();\n const { tileMIMEType, tilejson = {} } = formatSpecificMetadata;\n const { layers = [] } = tilejson;\n switch (tileMIMEType) {\n case 'application/vnd.mapbox-vector-tile':\n return {\n shape: 'vector-source',\n layers: layers.map((layer) => ({ name: layer.name, schema: layer.schema })),\n tables: [],\n formatSpecificMetadata\n };\n case 'image/png':\n case 'image/jpeg':\n return { shape: 'image-source', formatSpecificMetadata };\n default:\n throw new Error(`PMTilesLoader: Unsupported tile MIME type ${tileMIMEType}`);\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof \"4.4.0-alpha.0\" !== 'undefined' ? \"4.4.0-alpha.0\" : 'latest';\n"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { PMTilesSource } from \"./pmtiles-source.js\";\nexport { PMTilesTileSource } from \"./pmtiles-source.js\";\nexport { PMTilesLoader as _PMTilesLoader } from \"./pmtiles-loader.js\";\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { DataSource, resolvePath } from '@loaders.gl/loader-utils';\nimport { ImageLoader } from '@loaders.gl/images';\nimport { MVTLoader } from '@loaders.gl/mvt';\nimport { PMTilesFormat } from \"./pmtiles-format.js\";\nimport * as pmtiles from 'pmtiles';\nconst { PMTiles } = pmtiles;\nimport { parsePMTilesHeader } from \"./lib/parse-pmtiles.js\";\nimport { BlobSource } from \"./lib/blob-source.js\";\nconst VERSION = '1.0.0';\n/**\n * Creates vector tile data sources for PMTiles urls or blobs\n */\nexport const PMTilesSource = {\n ...PMTilesFormat,\n version: VERSION,\n type: 'pmtiles',\n fromUrl: true,\n fromBlob: true,\n defaultOptions: {\n pmtiles: {}\n },\n testURL: (url) => url.endsWith('.pmtiles'),\n createDataSource: (url, options) => new PMTilesTileSource(url, options)\n};\n/**\n * A PMTiles data source\n * @note Can be either a raster or vector tile source depending on the contents of the PMTiles file.\n */\nexport class PMTilesTileSource extends DataSource {\n mimeType = null;\n pmtiles;\n metadata;\n constructor(data, options) {\n super(data, options, PMTilesSource.defaultOptions);\n const urlOrBlob = typeof data === 'string' ? resolvePath(data) : new BlobSource(data, 'pmtiles');\n this.pmtiles = new PMTiles(urlOrBlob);\n this.getTileData = this.getTileData.bind(this);\n this.metadata = this.getMetadata();\n }\n async getSchema() {\n return { fields: [], metadata: {} };\n }\n async getMetadata() {\n const pmtilesHeader = await this.pmtiles.getHeader();\n const pmtilesMetadata = (await this.pmtiles.getMetadata()) || {};\n const metadata = parsePMTilesHeader(pmtilesHeader, pmtilesMetadata, { includeFormatHeader: false }, this.loadOptions);\n // Add additional attribution if necessary\n if (this.options.attributions) {\n metadata.attributions = [\n ...(this.options.core?.attributions || []),\n ...(metadata.attributions || [])\n ];\n }\n if (metadata?.tileMIMEType) {\n this.mimeType = metadata?.tileMIMEType;\n }\n // TODO - do we need to allow tileSize to be overridden? Some PMTiles examples seem to suggest it.\n return metadata;\n }\n async getTile(tileParams) {\n const { x, y, z } = tileParams;\n const rangeResponse = await this.pmtiles.getZxy(z, x, y);\n const arrayBuffer = rangeResponse?.data;\n if (!arrayBuffer) {\n // console.error('No arrayBuffer', tileParams);\n return null;\n }\n return arrayBuffer;\n }\n // Tile Source interface implementation: deck.gl compatible API\n // TODO - currently only handles image tiles, not vector tiles\n async getTileData(tileParams) {\n const { x, y, z } = tileParams.index;\n const metadata = await this.metadata;\n switch (metadata.tileMIMEType) {\n case 'application/vnd.mapbox-vector-tile':\n return await this.getVectorTile({ x, y, z, layers: [] });\n default:\n return await this.getImageTile({ x, y, z, layers: [] });\n }\n }\n // ImageTileSource interface implementation\n async getImageTile(tileParams) {\n const arrayBuffer = await this.getTile(tileParams);\n return arrayBuffer ? await ImageLoader.parse(arrayBuffer, this.loadOptions) : null;\n }\n // VectorTileSource interface implementation\n async getVectorTile(tileParams) {\n const arrayBuffer = await this.getTile(tileParams);\n const loadOptions = {\n shape: 'geojson-table',\n mvt: {\n coordinates: 'wgs84',\n tileIndex: { x: tileParams.x, y: tileParams.y, z: tileParams.z },\n ...this.loadOptions?.mvt\n },\n ...this.loadOptions\n };\n return arrayBuffer ? await MVTLoader.parse(arrayBuffer, loadOptions) : null;\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * PMTiles\n */\nexport const PMTilesFormat = {\n name: 'PMTiles',\n id: 'pmtiles',\n module: 'pmtiles',\n extensions: ['pmtiles'],\n mimeTypes: ['application/octet-stream'],\n tests: ['PMTiles']\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { TileJSONLoader } from '@loaders.gl/mvt';\n// import {Source, PMTiles, Header, TileType} from 'pmtiles';\nimport * as pmtiles from 'pmtiles';\nconst { TileType } = pmtiles;\n/**\n * Parse PMTiles metdata from a PMTiles file\n * @param header\n * @param tilejsonMetadata\n * @param options\n * @param loadOptions\n * @returns\n */\nexport function parsePMTilesHeader(header, pmtilesMetadata, options, loadOptions) {\n // Ironically, to use the TileJSON loader we need to stringify the metadata again.\n // This is the price of integrating with the existing pmtiles library.\n // TODO - provide a non-standard TileJSONLoader parsers that accepts a JSON object?\n let tilejson = null;\n if (pmtilesMetadata) {\n try {\n const string = JSON.stringify(pmtilesMetadata);\n tilejson = TileJSONLoader.parseTextSync?.(string, loadOptions) || null;\n }\n catch (error) {\n // eslint-disable-next-line no-console\n console.warn('PMTiles metadata could not be interpreted as TileJSON', error);\n }\n }\n const partialMetadata = {};\n if (typeof tilejson?.name === 'string') {\n partialMetadata.name = tilejson.name;\n }\n if (typeof tilejson?.htmlAttribution === 'string') {\n partialMetadata.attributions = [tilejson.htmlAttribution];\n }\n const metadata = {\n ...partialMetadata,\n format: 'pmtiles',\n formatVersion: header.specVersion,\n attributions: [],\n tileMIMEType: decodeTileType(header.tileType),\n minZoom: header.minZoom,\n maxZoom: header.maxZoom,\n boundingBox: [\n [header.minLon, header.minLat],\n [header.maxLon, header.maxLat]\n ],\n center: [header.centerLon, header.centerLat],\n centerZoom: header.centerZoom,\n etag: header.etag\n };\n if (tilejson) {\n metadata.tilejson = tilejson;\n }\n // Application can optionally include the raw header and metadata.\n if (options?.includeFormatHeader) {\n metadata.formatHeader = header;\n metadata.formatMetadata = metadata;\n }\n return metadata;\n}\n/** Extract a MIME type for tiles from vector tile header */\nfunction decodeTileType(tileType) {\n switch (tileType) {\n case TileType.Mvt:\n return 'application/vnd.mapbox-vector-tile';\n case TileType.Png:\n return 'image/png';\n case TileType.Jpeg:\n return 'image/jpeg';\n case TileType.Webp:\n return 'image/webp';\n case TileType.Avif:\n return 'image/avif';\n default:\n return 'application/octet-stream';\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * A PMTiles library compatible source that reads from blobs\n * @deprecated TODO - reimplement as ReadableFileSource\n * Use loaders.gl HTTP range requests instead\n */\nexport class BlobSource {\n blob;\n key;\n constructor(blob, key) {\n this.blob = blob;\n this.key = key;\n }\n // TODO - how is this used?\n getKey() {\n // @ts-expect-error url is only defined on File subclass\n return this.blob.url || '';\n }\n async getBytes(offset, length, signal) {\n const slice = this.blob.slice(offset, offset + length);\n const data = await slice.arrayBuffer();\n return {\n data\n // etag: response.headers.get('ETag') || undefined,\n // cacheControl: response.headers.get('Cache-Control') || undefined,\n // expires: response.headers.get('Expires') || undefined\n };\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { BlobFile } from '@loaders.gl/loader-utils';\nimport { VERSION } from \"./lib/version.js\";\nimport { PMTilesTileSource } from \"./pmtiles-source.js\";\nimport { PMTilesFormat } from \"./pmtiles-format.js\";\n/**\n * Loader for PMTiles metadata\n * @note This loader is intended to allow PMTiles to be treated like other file types in top-level loading logic.\n * @note For actual access to the tile data, use the PMTilesSource class.\n */\nexport const PMTilesLoader = {\n ...PMTilesFormat,\n version: VERSION,\n options: {\n pmtiles: {}\n },\n parse: async (arrayBuffer, options) => parseFileAsPMTiles(new BlobFile(new Blob([arrayBuffer])), options),\n parseFile: parseFileAsPMTiles\n};\nasync function parseFileAsPMTiles(file, options) {\n const source = new PMTilesTileSource(file.handle, {\n pmtiles: options?.pmtiles || {}\n });\n const formatSpecificMetadata = await source.getMetadata();\n const { tileMIMEType, tilejson = {} } = formatSpecificMetadata;\n const { layers = [] } = tilejson;\n switch (tileMIMEType) {\n case 'application/vnd.mapbox-vector-tile':\n return {\n shape: 'vector-source',\n layers: layers.map((layer) => ({ name: layer.name, schema: layer.schema })),\n tables: [],\n formatSpecificMetadata\n };\n case 'image/png':\n case 'image/jpeg':\n return { shape: 'image-source', formatSpecificMetadata };\n default:\n throw new Error(`PMTilesLoader: Unsupported tile MIME type ${tileMIMEType}`);\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof \"4.4.0-alpha.1\" !== 'undefined' ? \"4.4.0-alpha.1\" : 'latest';\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,0BAAwC;AACxC,oBAA4B;AAC5B,IAAAA,cAA0B;;;ACCnB,IAAM,gBAAgB;AAAA,EACzB,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,YAAY,CAAC,SAAS;AAAA,EACtB,WAAW,CAAC,0BAA0B;AAAA,EACtC,OAAO,CAAC,SAAS;AACrB;;;ADNA,IAAAC,WAAyB;;;AEJzB,iBAA+B;AAE/B,cAAyB;AACzB,IAAM,EAAE,SAAS,IAAI;AASd,SAAS,mBAAmB,QAAQ,iBAAiB,SAAS,aAAa;AAflF;AAmBI,MAAI,WAAW;AACf,MAAI,iBAAiB;AACjB,QAAI;AACA,YAAM,SAAS,KAAK,UAAU,eAAe;AAC7C,mBAAW,sCAAe,kBAAf,4BAA+B,QAAQ,iBAAgB;AAAA,IACtE,SACO,OAAP;AAEI,cAAQ,KAAK,yDAAyD,KAAK;AAAA,IAC/E;AAAA,EACJ;AACA,QAAM,kBAAkB,CAAC;AACzB,MAAI,QAAO,qCAAU,UAAS,UAAU;AACpC,oBAAgB,OAAO,SAAS;AAAA,EACpC;AACA,MAAI,QAAO,qCAAU,qBAAoB,UAAU;AAC/C,oBAAgB,eAAe,CAAC,SAAS,eAAe;AAAA,EAC5D;AACA,QAAM,WAAW;AAAA,IACb,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,eAAe,OAAO;AAAA,IACtB,cAAc,CAAC;AAAA,IACf,cAAc,eAAe,OAAO,QAAQ;AAAA,IAC5C,SAAS,OAAO;AAAA,IAChB,SAAS,OAAO;AAAA,IAChB,aAAa;AAAA,MACT,CAAC,OAAO,QAAQ,OAAO,MAAM;AAAA,MAC7B,CAAC,OAAO,QAAQ,OAAO,MAAM;AAAA,IACjC;AAAA,IACA,QAAQ,CAAC,OAAO,WAAW,OAAO,SAAS;AAAA,IAC3C,YAAY,OAAO;AAAA,IACnB,MAAM,OAAO;AAAA,EACjB;AACA,MAAI,UAAU;AACV,aAAS,WAAW;AAAA,EACxB;AAEA,MAAI,mCAAS,qBAAqB;AAC9B,aAAS,eAAe;AACxB,aAAS,iBAAiB;AAAA,EAC9B;AACA,SAAO;AACX;AAEA,SAAS,eAAe,UAAU;AAC9B,UAAQ,UAAU;AAAA,IACd,KAAK,SAAS;AACV,aAAO;AAAA,IACX,KAAK,SAAS;AACV,aAAO;AAAA,IACX,KAAK,SAAS;AACV,aAAO;AAAA,IACX,KAAK,SAAS;AACV,aAAO;AAAA,IACX,KAAK,SAAS;AACV,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EACf;AACJ;;;ACvEO,IAAM,aAAN,MAAiB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,YAAY,MAAM,KAAK;AACnB,SAAK,OAAO;AACZ,SAAK,MAAM;AAAA,EACf;AAAA;AAAA,EAEA,SAAS;AAEL,WAAO,KAAK,KAAK,OAAO;AAAA,EAC5B;AAAA,EACA,MAAM,SAAS,QAAQ,QAAQ,QAAQ;AACnC,UAAM,QAAQ,KAAK,KAAK,MAAM,QAAQ,SAAS,MAAM;AACrD,UAAM,OAAO,MAAM,MAAM,YAAY;AACrC,WAAO;AAAA,MACH;AAAA;AAAA;AAAA;AAAA,IAIJ;AAAA,EACJ;AACJ;;;AHtBA,IAAM,EAAE,QAAQ,IAAIC;AAGpB,IAAM,UAAU;AAIT,IAAM,gBAAgB;AAAA,EACzB,GAAG;AAAA,EACH,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,gBAAgB;AAAA,IACZ,SAAS,CAAC;AAAA,EACd;AAAA,EACA,SAAS,CAAC,QAAQ,IAAI,SAAS,UAAU;AAAA,EACzC,kBAAkB,CAAC,KAAK,YAAY,IAAI,kBAAkB,KAAK,OAAO;AAC1E;AAKO,IAAM,oBAAN,cAAgC,+BAAW;AAAA,EAC9C,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,YAAY,MAAM,SAAS;AACvB,UAAM,MAAM,SAAS,cAAc,cAAc;AACjD,UAAM,YAAY,OAAO,SAAS,eAAW,iCAAY,IAAI,IAAI,IAAI,WAAW,MAAM,SAAS;AAC/F,SAAK,UAAU,IAAI,QAAQ,SAAS;AACpC,SAAK,cAAc,KAAK,YAAY,KAAK,IAAI;AAC7C,SAAK,WAAW,KAAK,YAAY;AAAA,EACrC;AAAA,EACA,MAAM,YAAY;AACd,WAAO,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,EAAE;AAAA,EACtC;AAAA,EACA,MAAM,cAAc;AA7CxB;AA8CQ,UAAM,gBAAgB,MAAM,KAAK,QAAQ,UAAU;AACnD,UAAM,kBAAmB,MAAM,KAAK,QAAQ,YAAY,KAAM,CAAC;AAC/D,UAAM,WAAW,mBAAmB,eAAe,iBAAiB,EAAE,qBAAqB,MAAM,GAAG,KAAK,WAAW;AAEpH,QAAI,KAAK,QAAQ,cAAc;AAC3B,eAAS,eAAe;AAAA,QACpB,KAAI,UAAK,QAAQ,SAAb,mBAAmB,iBAAgB,CAAC;AAAA,QACxC,GAAI,SAAS,gBAAgB,CAAC;AAAA,MAClC;AAAA,IACJ;AACA,QAAI,qCAAU,cAAc;AACxB,WAAK,WAAW,qCAAU;AAAA,IAC9B;AAEA,WAAO;AAAA,EACX;AAAA,EACA,MAAM,QAAQ,YAAY;AACtB,UAAM,EAAE,GAAG,GAAG,EAAE,IAAI;AACpB,UAAM,gBAAgB,MAAM,KAAK,QAAQ,OAAO,GAAG,GAAG,CAAC;AACvD,UAAM,cAAc,+CAAe;AACnC,QAAI,CAAC,aAAa;AAEd,aAAO;AAAA,IACX;AACA,WAAO;AAAA,EACX;AAAA;AAAA;AAAA,EAGA,MAAM,YAAY,YAAY;AAC1B,UAAM,EAAE,GAAG,GAAG,EAAE,IAAI,WAAW;AAC/B,UAAM,WAAW,MAAM,KAAK;AAC5B,YAAQ,SAAS,cAAc;AAAA,MAC3B,KAAK;AACD,eAAO,MAAM,KAAK,cAAc,EAAE,GAAG,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;AAAA,MAC3D;AACI,eAAO,MAAM,KAAK,aAAa,EAAE,GAAG,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;AAAA,IAC9D;AAAA,EACJ;AAAA;AAAA,EAEA,MAAM,aAAa,YAAY;AAC3B,UAAM,cAAc,MAAM,KAAK,QAAQ,UAAU;AACjD,WAAO,cAAc,MAAM,0BAAY,MAAM,aAAa,KAAK,WAAW,IAAI;AAAA,EAClF;AAAA;AAAA,EAEA,MAAM,cAAc,YAAY;AA1FpC;AA2FQ,UAAM,cAAc,MAAM,KAAK,QAAQ,UAAU;AACjD,UAAM,cAAc;AAAA,MAChB,OAAO;AAAA,MACP,KAAK;AAAA,QACD,aAAa;AAAA,QACb,WAAW,EAAE,GAAG,WAAW,GAAG,GAAG,WAAW,GAAG,GAAG,WAAW,EAAE;AAAA,QAC/D,IAAG,UAAK,gBAAL,mBAAkB;AAAA,MACzB;AAAA,MACA,GAAG,KAAK;AAAA,IACZ;AACA,WAAO,cAAc,MAAM,sBAAU,MAAM,aAAa,WAAW,IAAI;AAAA,EAC3E;AACJ;;;AIpGA,IAAAC,uBAAyB;;;ACGlB,IAAMC,WAAU,OAAyC,kBAAkB;;;ADM3E,IAAM,gBAAgB;AAAA,EACzB,GAAG;AAAA,EACH,SAASC;AAAA,EACT,SAAS;AAAA,IACL,SAAS,CAAC;AAAA,EACd;AAAA,EACA,OAAO,OAAO,aAAa,YAAY,mBAAmB,IAAI,8BAAS,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO;AAAA,EACxG,WAAW;AACf;AACA,eAAe,mBAAmB,MAAM,SAAS;AAC7C,QAAM,SAAS,IAAI,kBAAkB,KAAK,QAAQ;AAAA,IAC9C,UAAS,mCAAS,YAAW,CAAC;AAAA,EAClC,CAAC;AACD,QAAM,yBAAyB,MAAM,OAAO,YAAY;AACxD,QAAM,EAAE,cAAc,WAAW,CAAC,EAAE,IAAI;AACxC,QAAM,EAAE,SAAS,CAAC,EAAE,IAAI;AACxB,UAAQ,cAAc;AAAA,IAClB,KAAK;AACD,aAAO;AAAA,QACH,OAAO;AAAA,QACP,QAAQ,OAAO,IAAI,CAAC,WAAW,EAAE,MAAM,MAAM,MAAM,QAAQ,MAAM,OAAO,EAAE;AAAA,QAC1E,QAAQ,CAAC;AAAA,QACT;AAAA,MACJ;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AACD,aAAO,EAAE,OAAO,gBAAgB,uBAAuB;AAAA,IAC3D;AACI,YAAM,IAAI,MAAM,6CAA6C,cAAc;AAAA,EACnF;AACJ;",
|
|
6
6
|
"names": ["import_mvt", "pmtiles", "pmtiles", "import_loader_utils", "VERSION", "VERSION"]
|
|
7
7
|
}
|
package/dist/lib/version.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// Version constant cannot be imported, it needs to correspond to the build version of **this** module.
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
export const VERSION = typeof "4.4.0-alpha.
|
|
7
|
+
export const VERSION = typeof "4.4.0-alpha.1" !== 'undefined' ? "4.4.0-alpha.1" : 'latest';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/pmtiles",
|
|
3
|
-
"version": "4.4.0-alpha.
|
|
3
|
+
"version": "4.4.0-alpha.2",
|
|
4
4
|
"description": "Framework-independent loader for the pmtiles format",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@loaders.gl/images": "4.4.0-alpha.
|
|
50
|
-
"@loaders.gl/loader-utils": "4.4.0-alpha.
|
|
51
|
-
"@loaders.gl/mvt": "4.4.0-alpha.
|
|
52
|
-
"@loaders.gl/schema": "4.4.0-alpha.
|
|
49
|
+
"@loaders.gl/images": "4.4.0-alpha.2",
|
|
50
|
+
"@loaders.gl/loader-utils": "4.4.0-alpha.2",
|
|
51
|
+
"@loaders.gl/mvt": "4.4.0-alpha.2",
|
|
52
|
+
"@loaders.gl/schema": "4.4.0-alpha.2",
|
|
53
53
|
"pmtiles": "^3.0.4"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@loaders.gl/core": "4.4.0-alpha.
|
|
56
|
+
"@loaders.gl/core": "4.4.0-alpha.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "3d9fed050eabdc0812ddf2f4d5fb9914a34ee0c2"
|
|
59
59
|
}
|