Socket
Socket
Sign inDemoInstall

@loaders.gl/core

Package Overview
Dependencies
Maintainers
9
Versions
336
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/core - npm Package Compare versions

Comparing version 4.2.0-beta.2 to 4.2.0

4

dist/dist.min.js

@@ -7,3 +7,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

else root['loaders'] = factory();})(globalThis, function () {
"use strict";var __exports__=(()=>{var xe=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var zr=Object.getOwnPropertyNames;var Vr=Object.prototype.hasOwnProperty;var Hr=(e,t,r)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Bt=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},Gr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zr(t))!Vr.call(e,n)&&n!==r&&xe(e,n,{get:()=>t[n],enumerable:!(o=$r(t,n))||o.enumerable});return e};var qr=e=>Gr(xe({},"__esModule",{value:!0}),e);var Lt=(e,t,r)=>(Hr(e,typeof t!="symbol"?t+"":t,r),r);var cn={};Bt(cn,{FetchError:()=>J,JSONLoader:()=>st,NullLoader:()=>Ur,NullWorkerLoader:()=>Cr,RequestScheduler:()=>Q,_BrowserFileSystem:()=>Ie,_fetchProgress:()=>jr,_unregisterLoaders:()=>dr,assert:()=>$,concatenateArrayBuffersAsync:()=>O,document:()=>Ne,encode:()=>vr,encodeInBatches:()=>Pr,encodeSync:()=>_t,encodeTable:()=>Tt,encodeTableAsText:()=>Ir,encodeTableInBatches:()=>At,encodeText:()=>Mr,encodeTextSync:()=>Nr,encodeURLtoURL:()=>kt,fetchFile:()=>D,forEach:()=>tt,getLoaderOptions:()=>L,getPathPrefix:()=>nt,global:()=>Me,isAsyncIterable:()=>de,isBrowser:()=>p,isIterable:()=>he,isIterator:()=>ge,isPromise:()=>Xt,isPureObject:()=>pe,isReadableStream:()=>j,isResponse:()=>m,isWorker:()=>Pe,isWritableStream:()=>tr,load:()=>Br,loadInBatches:()=>Rr,makeIterator:()=>ee,makeLineIterator:()=>Xe,makeNumberedLineIterator:()=>et,makeStream:()=>Wr,makeTextDecoderIterator:()=>Ye,makeTextEncoderIterator:()=>Ze,parse:()=>E,parseInBatches:()=>M,parseSync:()=>Er,readArrayBuffer:()=>ar,registerLoaders:()=>pr,resolvePath:()=>v,selectLoader:()=>X,selectLoaderSync:()=>Z,self:()=>Fe,setLoaderOptions:()=>mt,setPathPrefix:()=>ot,window:()=>ve});function $(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Fe=A.self||A.window||A.global||{},ve=A.window||A.self||A.global||{},Me=A.global||A.self||A.window||{},Ne=A.document||{};var p=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser),Pe=typeof importScripts=="function",Rt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Qr=Rt&&parseFloat(Rt[1])||0;function I(e){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(e)}function We(e,t){if(I(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(I(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oe(e){var t=We(e,"string");return I(t)==="symbol"?t:String(t)}function u(e,t,r){return t=Oe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ce(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function w(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ce()}var Jr=globalThis.self||globalThis.window||globalThis.global,z=globalThis.window||globalThis.self||globalThis.global,Kr=globalThis.document||{},N=globalThis.process||{},Yr=globalThis.console,_n=globalThis.navigator||{};var Te=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",En=w();function Zr(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ae=class{constructor(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";u(this,"storage",void 0),u(this,"id",void 0),u(this,"config",void 0),this.storage=Zr(o),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 It(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Ft(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function _e(e,t,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,n=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>o&&(r=Math.min(r,o/e.width));let s=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(n,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var ke;(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"})(ke||(ke={}));var Xr=10;function vt(e){return typeof e!="string"?e:(e=e.toUpperCase(),ke[e]||ke.WHITE)}function Mt(e,t,r){if(!w&&typeof e=="string"){if(t){let o=vt(t);e="\x1B[".concat(o,"m").concat(e,"\x1B[39m")}if(r){let o=vt(r);e="\x1B[".concat(o+Xr,"m").concat(e,"\x1B[49m")}}return e}function Nt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(r),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(t.find(a=>s===a)||(n[s]=i.bind(e)))}}function V(e,t){if(!e)throw new Error(t||"Assertion failed")}function P(){let e;if(w()&&z.performance){var t,r;e=z===null||z===void 0||(t=z.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in N){var o;let n=N===null||N===void 0||(o=N.hrtime)===null||o===void 0?void 0:o.call(N);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var H={debug:w()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},eo={enabled:!0,level:0};function d(){}var Pt={},Wt={once:!0},_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};u(this,"id",void 0),u(this,"VERSION",Te),u(this,"_startTs",P()),u(this,"_deltaTs",P()),u(this,"_storage",void 0),u(this,"userData",{}),u(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new Ae("__probe-".concat(this.id,"__"),eo),this.timeStamp("".concat(this.id," started")),Nt(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((P()-this._startTs).toPrecision(10))}getDelta(){return Number((P()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!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){V(t,r)}warn(t){return this._getLogFunction(0,t,H.warn,arguments,Wt)}error(t){return this._getLogFunction(0,t,H.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,H.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,H.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,H.debug||H.info,arguments,Wt)}table(t,r,o){return r?this._getLogFunction(t,r,console.table||d,o&&[o],{tag:no(r)}):d}image(t){let{logLevel:r,priority:o,image:n,message:s="",scale:i=1}=t;return this._shouldLog(r||o)?w()?oo({image:n,message:s,scale:i}):ro({image:n,message:s,scale:i}):d}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||d)}group(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=Ot({logLevel:t,message:r,opts:o}),{collapsed:s}=o;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},o,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||d)}withGroup(t,r,o){this.group(t,r)();try{o()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Ct(t)}_getLogFunction(t,r,o,n,s){if(this._shouldLog(t)){s=Ot({logLevel:t,message:r,args:n,opts:s}),o=o||s.method,V(o),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=P();let i=s.tag||s.message;if(s.once&&i)if(!Pt[i])Pt[i]=P();else return d;return r=to(this.id,s.message,s),o.bind(console,r,...s.args)}return d}};u(_,"VERSION",Te);function Ct(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 V(Number.isFinite(t)&&t>=0),t}function Ot(e){let{logLevel:t,message:r}=e;e.logLevel=Ct(t);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&o.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return V(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}function to(e,t,r){if(typeof t=="string"){let o=r.time?Ft(It(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),t=Mt(t,r.color,r.background)}return t}function ro(e){let{image:t,message:r="",scale:o=1}=e;return console.warn("removed"),d}function oo(e){let{image:t,message:r="",scale:o=1}=e;if(typeof t=="string"){let s=new Image;return s.onload=()=>{let i=_e(s,r,o);console.log(...i)},s.src=t,d}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(..._e(t,r,o)),d;if(n.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(..._e(s,r,o)),s.src=t.toDataURL(),d}return d}function no(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Xn=new _({id:"@probe.gl/log"});function Ue(e,t){return Ut(e||{},t)}function Ut(e,t,r=0){if(r>3)return t;let o={...e};for(let[n,s]of Object.entries(t))s&&typeof s=="object"&&!Array.isArray(s)?o[n]=Ut(o[n]||{},t[n],r+1):o[n]=t[n];return o}function je(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}var jt="latest";function so(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-beta.1"),globalThis._loadersgl_.version}var oe=so();function l(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var k={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},is=k.self||k.window||k.global||{},as=k.window||k.self||k.global||{},cs=k.global||k.self||k.window||{},us=k.document||{};var g=typeof process!="object"||String(process)!=="[object process]"||process.browser;var $t=typeof window<"u"&&typeof window.orientation<"u",Dt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),fs=Dt&&parseFloat(Dt[1])||0;var ne=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){l(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){l(this.isRunning),this.isRunning=!1,this._reject(t)}};var G=class{terminate(){}};var De=new Map;function zt(e){l(e.source&&!e.url||!e.source&&e.url);let t=De.get(e.source||e.url);return t||(e.url&&(t=io(e.url),De.set(e.url,t)),e.source&&(t=Vt(e.source),De.set(e.source,t))),l(t),t}function io(e){if(!e.startsWith("http"))return e;let t=ao(e);return Vt(t)}function Vt(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function ao(e){return`try {
"use strict";var __exports__=(()=>{var xe=Object.defineProperty;var $r=Object.getOwnPropertyDescriptor;var zr=Object.getOwnPropertyNames;var Vr=Object.prototype.hasOwnProperty;var Hr=(e,t,r)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Bt=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},Gr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zr(t))!Vr.call(e,n)&&n!==r&&xe(e,n,{get:()=>t[n],enumerable:!(o=$r(t,n))||o.enumerable});return e};var qr=e=>Gr(xe({},"__esModule",{value:!0}),e);var Lt=(e,t,r)=>(Hr(e,typeof t!="symbol"?t+"":t,r),r);var cn={};Bt(cn,{FetchError:()=>J,JSONLoader:()=>st,NullLoader:()=>Ur,NullWorkerLoader:()=>Cr,RequestScheduler:()=>Q,_BrowserFileSystem:()=>Ie,_fetchProgress:()=>jr,_unregisterLoaders:()=>dr,assert:()=>$,concatenateArrayBuffersAsync:()=>O,document:()=>Ne,encode:()=>vr,encodeInBatches:()=>Pr,encodeSync:()=>_t,encodeTable:()=>Tt,encodeTableAsText:()=>Ir,encodeTableInBatches:()=>At,encodeText:()=>Mr,encodeTextSync:()=>Nr,encodeURLtoURL:()=>kt,fetchFile:()=>D,forEach:()=>tt,getLoaderOptions:()=>L,getPathPrefix:()=>nt,global:()=>Me,isAsyncIterable:()=>de,isBrowser:()=>p,isIterable:()=>he,isIterator:()=>ge,isPromise:()=>Xt,isPureObject:()=>pe,isReadableStream:()=>j,isResponse:()=>m,isWorker:()=>Pe,isWritableStream:()=>tr,load:()=>Br,loadInBatches:()=>Rr,makeIterator:()=>ee,makeLineIterator:()=>Xe,makeNumberedLineIterator:()=>et,makeStream:()=>Wr,makeTextDecoderIterator:()=>Ye,makeTextEncoderIterator:()=>Ze,parse:()=>E,parseInBatches:()=>M,parseSync:()=>Er,readArrayBuffer:()=>ar,registerLoaders:()=>pr,resolvePath:()=>v,selectLoader:()=>X,selectLoaderSync:()=>Z,self:()=>Fe,setLoaderOptions:()=>mt,setPathPrefix:()=>ot,window:()=>ve});function $(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var A={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Fe=A.self||A.window||A.global||{},ve=A.window||A.self||A.global||{},Me=A.global||A.self||A.window||{},Ne=A.document||{};var p=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser),Pe=typeof importScripts=="function",Rt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Qr=Rt&&parseFloat(Rt[1])||0;function I(e){return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I(e)}function We(e,t){if(I(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(I(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oe(e){var t=We(e,"string");return I(t)==="symbol"?t:String(t)}function u(e,t,r){return t=Oe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ce(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function w(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ce()}var Jr=globalThis.self||globalThis.window||globalThis.global,z=globalThis.window||globalThis.self||globalThis.global,Kr=globalThis.document||{},N=globalThis.process||{},Yr=globalThis.console,_n=globalThis.navigator||{};var Te=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",En=w();function Zr(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ae=class{constructor(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";u(this,"storage",void 0),u(this,"id",void 0),u(this,"config",void 0),this.storage=Zr(o),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 It(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function Ft(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function _e(e,t,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,n=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>o&&(r=Math.min(r,o/e.width));let s=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(n,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var ke;(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"})(ke||(ke={}));var Xr=10;function vt(e){return typeof e!="string"?e:(e=e.toUpperCase(),ke[e]||ke.WHITE)}function Mt(e,t,r){if(!w&&typeof e=="string"){if(t){let o=vt(t);e="\x1B[".concat(o,"m").concat(e,"\x1B[39m")}if(r){let o=vt(r);e="\x1B[".concat(o+Xr,"m").concat(e,"\x1B[49m")}}return e}function Nt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),o=Object.getOwnPropertyNames(r),n=e;for(let s of o){let i=n[s];typeof i=="function"&&(t.find(a=>s===a)||(n[s]=i.bind(e)))}}function V(e,t){if(!e)throw new Error(t||"Assertion failed")}function P(){let e;if(w()&&z.performance){var t,r;e=z===null||z===void 0||(t=z.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in N){var o;let n=N===null||N===void 0||(o=N.hrtime)===null||o===void 0?void 0:o.call(N);e=n[0]*1e3+n[1]/1e6}else e=Date.now();return e}var H={debug:w()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},eo={enabled:!0,level:0};function d(){}var Pt={},Wt={once:!0},_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};u(this,"id",void 0),u(this,"VERSION",Te),u(this,"_startTs",P()),u(this,"_deltaTs",P()),u(this,"_storage",void 0),u(this,"userData",{}),u(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new Ae("__probe-".concat(this.id,"__"),eo),this.timeStamp("".concat(this.id," started")),Nt(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((P()-this._startTs).toPrecision(10))}getDelta(){return Number((P()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!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){V(t,r)}warn(t){return this._getLogFunction(0,t,H.warn,arguments,Wt)}error(t){return this._getLogFunction(0,t,H.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,H.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,H.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,H.debug||H.info,arguments,Wt)}table(t,r,o){return r?this._getLogFunction(t,r,console.table||d,o&&[o],{tag:no(r)}):d}image(t){let{logLevel:r,priority:o,image:n,message:s="",scale:i=1}=t;return this._shouldLog(r||o)?w()?oo({image:n,message:s,scale:i}):ro({image:n,message:s,scale:i}):d}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||d)}group(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},n=Ot({logLevel:t,message:r,opts:o}),{collapsed:s}=o;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},o,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||d)}withGroup(t,r,o){this.group(t,r)();try{o()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Ct(t)}_getLogFunction(t,r,o,n,s){if(this._shouldLog(t)){s=Ot({logLevel:t,message:r,args:n,opts:s}),o=o||s.method,V(o),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=P();let i=s.tag||s.message;if(s.once&&i)if(!Pt[i])Pt[i]=P();else return d;return r=to(this.id,s.message,s),o.bind(console,r,...s.args)}return d}};u(_,"VERSION",Te);function Ct(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 V(Number.isFinite(t)&&t>=0),t}function Ot(e){let{logLevel:t,message:r}=e;e.logLevel=Ct(t);let o=e.args?Array.from(e.args):[];for(;o.length&&o.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&o.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let n=typeof e.message;return V(n==="string"||n==="object"),Object.assign(e,{args:o},e.opts)}function to(e,t,r){if(typeof t=="string"){let o=r.time?Ft(It(r.total)):"";t=r.time?"".concat(e,": ").concat(o," ").concat(t):"".concat(e,": ").concat(t),t=Mt(t,r.color,r.background)}return t}function ro(e){let{image:t,message:r="",scale:o=1}=e;return console.warn("removed"),d}function oo(e){let{image:t,message:r="",scale:o=1}=e;if(typeof t=="string"){let s=new Image;return s.onload=()=>{let i=_e(s,r,o);console.log(...i)},s.src=t,d}let n=t.nodeName||"";if(n.toLowerCase()==="img")return console.log(..._e(t,r,o)),d;if(n.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(..._e(s,r,o)),s.src=t.toDataURL(),d}return d}function no(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Xn=new _({id:"@probe.gl/log"});function Ue(e,t){return Ut(e||{},t)}function Ut(e,t,r=0){if(r>3)return t;let o={...e};for(let[n,s]of Object.entries(t))s&&typeof s=="object"&&!Array.isArray(s)?o[n]=Ut(o[n]||{},t[n],r+1):o[n]=t[n];return o}function je(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}var jt="latest";function so(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-beta.2"),globalThis._loadersgl_.version}var oe=so();function l(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var k={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},is=k.self||k.window||k.global||{},as=k.window||k.self||k.global||{},cs=k.global||k.self||k.window||{},us=k.document||{};var g=typeof process!="object"||String(process)!=="[object process]"||process.browser;var $t=typeof window<"u"&&typeof window.orientation<"u",Dt=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),fs=Dt&&parseFloat(Dt[1])||0;var ne=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((o,n)=>{this._resolve=o,this._reject=n})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){l(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){l(this.isRunning),this.isRunning=!1,this._reject(t)}};var G=class{terminate(){}};var De=new Map;function zt(e){l(e.source&&!e.url||!e.source&&e.url);let t=De.get(e.source||e.url);return t||(e.url&&(t=io(e.url),De.set(e.url,t)),e.source&&(t=Vt(e.source),De.set(e.source,t))),l(t),t}function io(e){if(!e.startsWith("http"))return e;let t=ao(e);return Vt(t)}function Vt(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function ao(e){return`try {
importScripts('${e}');

@@ -14,4 +14,4 @@ } catch (error) {

}`}function $e(e,t=!0,r){let o=r||new Set;if(e){if(Ht(e))o.add(e);else if(Ht(e.buffer))o.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let n in e)$e(e[n],t,o)}}return r===void 0?Array.from(o):[]}function Ht(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}function ze(e){if(e===null)return{};let t=Object.assign({},e);return Object.keys(t).forEach(r=>{typeof e[r]=="object"&&!ArrayBuffer.isView(e[r])&&!(e[r]instanceof Array)?t[r]=ze(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var Ve=()=>{},F=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&g||typeof G<"u"&&!g}constructor(t){let{name:r,source:o,url:n}=t;l(o||n),this.name=r,this.source=o,this.url=n,this.onMessage=Ve,this.onError=s=>console.log(s),this.worker=g?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=Ve,this.onError=Ve,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||$e(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=zt({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let o=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new G(o,{eval:!1})}else if(this.source)t=new G(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var se=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return F.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(n,s,i)=>n.done(i),o=(n,s)=>n.error(s)){let n=new Promise(s=>(this.jobQueue.push({name:t,onMessage:r,onError:o,onStart:s}),this));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let o=new ne(r.name,t);t.onMessage=n=>r.onMessage(o,n.type,n.payload),t.onError=n=>r.onError(o,n),r.onStart(o);try{await o.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!g||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new F({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return $t?this.maxMobileConcurrency:this.maxConcurrency}};var co={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},W=class{props;workerPools=new Map;static isSupported(){return F.isSupported()}static getWorkerFarm(t={}){return W._workerFarm=W._workerFarm||new W({}),W._workerFarm.setProps(t),W._workerFarm}constructor(t){this.props={...co},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:o,url:n}=t,s=this.workerPools.get(r);return s||(s=new se({name:r,source:o,url:n}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},y=W;Lt(y,"_workerFarm");function Gt(e){let t=e.version!==oe?` (worker-utils@${oe})`:"";return`${e.name}@${e.version}${t}`}function ie(e,t={}){let r=t[e.id]||{},o=g?`${e.id}-worker.js`:`${e.id}-worker-node.js`,n=r.workerUrl;if(!n&&e.id==="compression"&&(n=t.workerUrl),t._workerType==="test"&&(g?n=`modules/${e.module}/dist/${o}`:n=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!n){let s=e.version;s==="latest"&&(s=jt);let i=s?`@${s}`:"";n=`https://unpkg.com/@loaders.gl/${e.module}${i}/dist/${o}`}return l(n),n}async function He(e,t,r={},o={}){let n=Gt(e),s=y.getWorkerFarm(r),{source:i}=r,a={name:n,source:i};i||(a.url=ie(e,r));let c=s.getWorkerPool(a),f=r.jobName||e.name,B=await c.startJob(f,uo.bind(null,o)),R=ze(r);return B.postMessage("process",{input:t,options:R}),(await B.result).result}async function uo(e,t,r,o){switch(r){case"done":t.done(o);break;case"error":t.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{if(!e.process){t.postMessage("error",{id:n,error:"Worker not set up to process on main thread"});return}let a=await e.process(s,i);t.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:n,error:c})}break;default:console.warn(`process-on-worker: unknown message ${r}`)}}function Ge(e,t=oe){l(e,"no worker provided");let r=e.version;return!(!t||!r)}function qe(e,t){return!y.isSupported()||!g&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function Qe(e,t,r,o,n){let s=e.id,i=ie(e,r),c=y.getWorkerFarm(r).getWorkerPool({name:s,url:i});r=JSON.parse(JSON.stringify(r)),o=JSON.parse(JSON.stringify(o||{}));let f=await c.startJob("process-on-worker",fo.bind(null,n));return f.postMessage("process",{input:t,options:r,context:o}),await(await f.result).result}async function fo(e,t,r,o){switch(r){case"done":t.done(o);break;case"error":t.error(new Error(o.error));break;case"process":let{id:n,input:s,options:i}=o;try{let a=await e(s,i);t.postMessage("done",{id:n,result:a})}catch(a){let c=a instanceof Error?a.message:"unknown error";t.postMessage("error",{id:n,error:c})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function Je(e,t){return!y.isSupported()||!p&&!t?._nodeWorkers?!1:e.worker&&t?.worker}function Ke(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let o=new Uint8Array(e),n=new Uint8Array(t);for(let s=0;s<o.length;++s)if(o[s]!==n[s])return!1;return!0}function ae(...e){return qt(e)}function qt(e){let t=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=t.reduce((s,i)=>s+i.byteLength,0),o=new Uint8Array(r),n=0;for(let s of t)o.set(s,n),n+=s.byteLength;return o.buffer}async function*Ye(e,t={}){let r=new TextDecoder(void 0,t);for await(let o of e)yield typeof o=="string"?o:r.decode(o,{stream:!0})}async function*Ze(e){let t=new TextEncoder;for await(let r of e)yield typeof r=="string"?t.encode(r):r}async function*Xe(e){let t="";for await(let r of e){t+=r;let o;for(;(o=t.indexOf(`
`))>=0;){let n=t.slice(0,o+1);t=t.slice(o+1),yield n}}t.length>0&&(yield t)}async function*et(e){let t=1;for await(let r of e)yield{counter:t,line:r},t++}async function tt(e,t){for(;;){let{done:r,value:o}=await e.next();if(r){e.return();return}if(t(o))return}}async function O(e){let t=[];for await(let r of e)t.push(r);return ae(...t)}function ce(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var C=class{constructor(t,r){u(this,"name",void 0),u(this,"type",void 0),u(this,"sampleSize",1),u(this,"time",0),u(this,"count",0),u(this,"samples",0),u(this,"lastTiming",0),u(this,"lastSampleTime",0),u(this,"lastSampleCount",0),u(this,"_count",0),u(this,"_time",0),u(this,"_samples",0),u(this,"_startTime",0),u(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ce(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ce()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var q=class{constructor(t){u(this,"id",void 0),u(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:o}=t,n=this.stats[r];return n||(t instanceof C?n=t:n=new C(r,o),this.stats[r]=n),n}};var lo="Queued Requests",mo="Active Requests",po="Cancelled Requests",ho="Queued Requests Ever",go="Active Requests Ever",yo={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},Q=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...yo,...t},this.stats=new q({id:this.props.id}),this.stats.get(lo),this.stats.get(mo),this.stats.get(po),this.stats.get(ho),this.stats.get(go)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let o={handle:t,priority:0,getPriority:r},n=new Promise(s=>(o.resolve=s,o));return this.requestQueue.push(o),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:o}=t,n=!1,s=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,o?o({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let o=this.requestQueue.shift();o&&this._issueRequest(o)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let o=t[r];this._updateRequest(o)||(t.splice(r,1),this.requestMap.delete(o.handle),r--)}t.sort((r,o)=>r.priority-o.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var rt="",Qt={};function ot(e){rt=e}function nt(){return rt}function v(e){for(let t in Qt)if(e.startsWith(t)){let r=Qt[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${rt}${e}`),e}var wo="4.2.0-beta.1",st={dataType:null,batchType:null,name:"JSON",id:"json",module:"json",version:wo,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Jt,parse:async e=>Jt(new TextDecoder().decode(e)),options:{}};function Jt(e){return JSON.parse(e)}function Kt(e){return e&&typeof e=="object"&&e.isBuffer}function Se(e){if(Kt(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var U={};Bt(U,{dirname:()=>xo,filename:()=>bo,join:()=>To,resolve:()=>Ao});function Yt(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function bo(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function xo(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function To(...e){let t="/";return e=e.map((r,o)=>(o&&(r=r.replace(new RegExp(`^${t}`),"")),o!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function Ao(...e){let t=[];for(let s=0;s<e.length;s++)t[s]=e[s];let r="",o=!1,n;for(let s=t.length-1;s>=-1&&!o;s--){let i;s>=0?i=t[s]:(n===void 0&&(n=Yt()),i=n),i.length!==0&&(r=`${i}/${r}`,o=i.charCodeAt(0)===ue)}return r=_o(r,!o),o?`/${r}`:r.length>0?r:"."}var ue=47,it=46;function _o(e,t){let r="",o=-1,n=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===ue)break;s=ue}if(s===ue){if(!(o===a-1||n===1))if(o!==a-1&&n===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==it||r.charCodeAt(r.length-2)!==it){if(r.length>2){let c=r.length-1,f=c;for(;f>=0&&r.charCodeAt(f)!==ue;--f);if(f!==c){r=f===-1?"":r.slice(0,f),o=a,n=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",o=a,n=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(o+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}o=a,n=0}else s===it&&n!==-1?++n:n=-1}return r}var fe=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(t,t+r).arrayBuffer()}};var le=new Error("Not implemented"),me=class{handle;size=0;bigsize=0n;url="";constructor(t,r,o){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,o);throw p?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw le}async write(t,r,o){throw le}async stat(){throw le}async truncate(t){throw le}async append(t){throw le}async close(){}};var Zt=e=>typeof e=="boolean",b=e=>typeof e=="function",S=e=>e!==null&&typeof e=="object",pe=e=>S(e)&&e.constructor==={}.constructor,Xt=e=>S(e)&&b(e.then),he=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",de=e=>e&&typeof e[Symbol.asyncIterator]=="function",ge=e=>e&&b(e.next),m=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var h=e=>typeof Blob<"u"&&e instanceof Blob,er=e=>e&&typeof e=="object"&&e.isBuffer,ko=e=>S(e)&&b(e.abort)&&b(e.getWriter),So=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||S(e)&&b(e.tee)&&b(e.cancel)&&b(e.getReader),Eo=e=>S(e)&&b(e.end)&&b(e.write)&&Zt(e.writable),Bo=e=>S(e)&&b(e.read)&&b(e.pipe)&&Zt(e.readable),j=e=>So(e)||Bo(e),tr=e=>ko(e)||Eo(e);var J=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var Lo=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Ro=/^([-\w.]+\/[-\w.+]+)/;function at(e,t){return e.toLowerCase()===t.toLowerCase()}function rr(e){let t=Ro.exec(e);return t?t[1]:e}function ct(e){let t=Lo.exec(e);return t?t[1]:""}var or=/\?.*/;function nr(e){let t=e.match(or);return t&&t[0]}function K(e){return e.replace(or,"")}function sr(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function x(e){return m(e)?e.url:h(e)?e.name||"":typeof e=="string"?e:""}function ye(e){if(m(e)){let t=e,r=t.headers.get("content-type")||"",o=K(t.url);return rr(r)||ct(o)}return h(e)?e.type||"":typeof e=="string"?ct(e):""}function ir(e){return m(e)?e.headers["content-length"]||-1:h(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Ee(e){if(m(e))return e;let t={},r=ir(e);r>=0&&(t["content-length"]=String(r));let o=x(e),n=ye(e);n&&(t["content-type"]=n);let s=await Fo(e);s&&(t["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));let i=new Response(e,{headers:t});return Object.defineProperty(i,"url",{value:o}),i}async function ut(e){if(!e.ok)throw await Io(e)}async function Io(e){let t=sr(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let o={reason:e.statusText,url:e.url,response:e};try{let n=e.headers.get("Content-Type");o.reason=n?.includes("application/json")?await e.json():e.text()}catch{}return new J(r,o)}async function Fo(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(o=>{let n=new FileReader;n.onload=s=>o(s?.target?.result),n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${vo(r)}`}return null}function vo(e){let t="",r=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)t+=String.fromCharCode(r[o]);return btoa(t)}function Mo(e){return!No(e)&&!Po(e)}function No(e){return e.startsWith("http:")||e.startsWith("https:")}function Po(e){return e.startsWith("data:")}async function D(e,t){if(typeof e=="string"){let r=v(e);return Mo(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Ee(e)}async function ar(e,t,r){e instanceof Blob||(e=new Blob([e]));let o=e.slice(t,t+r);return await Wo(o)}async function Wo(e){return await new Promise((t,r)=>{let o=new FileReader;o.onload=n=>t(n?.target?.result),o.onerror=n=>r(n),o.readAsArrayBuffer(e)})}var ft=new _({id:"loaders.gl"}),Be=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Le=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var lt={fetch:null,mimeType:void 0,nothrow:!1,log:new Le,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:p,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},cr={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function we(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function L(){let e=we();return e.globalOptions=e.globalOptions||{...lt},e.globalOptions}function mt(e){let t=we(),r=L();t.globalOptions=lr(r,e),je(e.modules)}function Y(e,t,r,o){return r=r||[],r=Array.isArray(r)?r:[r],Oo(e,r),lr(t,e,o)}function Oo(e,t){ur(e,null,lt,cr,t);for(let r of t){let o=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},s=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};ur(o,r.id,n,s,t)}}function ur(e,t,r,o,n){let s=t||"Top level",i=t?`${t}.`:"";for(let a in e){let c=!t&&S(e[a]),f=a==="baseUri"&&!t,B=a==="workerUrl"&&t;if(!(a in r)&&!f&&!B){if(a in o)ft.warn(`${s} loader option '${i}${a}' no longer supported, use '${o[a]}'`)();else if(!c){let R=Co(a,n);ft.warn(`${s} loader option '${i}${a}' not recognized. ${R}`)()}}}}function Co(e,t){let r=e.toLowerCase(),o="";for(let n of t)for(let s in n.options){if(e===s)return`Did you mean '${n.id}.${s}'?`;let i=s.toLowerCase();(r.startsWith(i)||i.startsWith(r))&&(o=o||`Did you mean '${n.id}.${s}'?`)}return o}function lr(e,t,r){let n={...e.options||{}};return Uo(n,r),n.log===null&&(n.log=new Be),fr(n,L()),fr(n,t),n}function fr(e,t){for(let r in t)if(r in t){let o=t[r];pe(o)&&pe(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Uo(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function T(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function be(e){$(e,"null loader"),$(T(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var mr=()=>{let e=we();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function pr(e){let t=mr();e=Array.isArray(e)?e:[e];for(let r of e){let o=be(r);t.find(n=>o===n)||t.unshift(o)}}function hr(){return mr()}function dr(){let e=we();e.loaderRegistry=[]}var gr=new _({id:"loaders.gl"});var jo=/\.([^.]+)$/;async function X(e,t=[],r,o){if(!wr(e))return null;let n=Z(e,t,{...r,nothrow:!0},o);if(n)return n;if(h(e)&&(e=await e.slice(0,10).arrayBuffer(),n=Z(e,t,r,o)),!n&&!r?.nothrow)throw new Error(br(e));return n}function Z(e,t=[],r,o){if(!wr(e))return null;if(t&&!Array.isArray(t))return be(t);let n=[];t&&(n=n.concat(t)),r?.ignoreRegisteredLoaders||n.push(...hr()),$o(n);let s=Do(e,n,r,o);if(!s&&!r?.nothrow)throw new Error(br(e));return s}function Do(e,t,r,o){let n=x(e),s=ye(e),i=K(n)||o?.url,a=null,c="";return r?.mimeType&&(a=pt(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||zo(t,i),c=c||(a?`matched url ${i}`:""),a=a||pt(t,s),c=c||(a?`matched MIME type ${s}`:""),a=a||Ho(t,e),c=c||(a?`matched initial data ${xr(e)}`:""),r?.fallbackMimeType&&(a=a||pt(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${s}`:"")),c&&gr.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function wr(e){return!(e instanceof Response&&e.status===204)}function br(e){let t=x(e),r=ye(e),o="No valid loader found (";o+=t?`${U.filename(t)}, `:"no url provided, ",o+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?xr(e):"";return o+=n?` first bytes: "${n}"`:"first bytes: not available",o+=")",o}function $o(e){for(let t of e)be(t)}function zo(e,t){let r=t&&jo.exec(t),o=r&&r[1];return o?Vo(e,o):null}function Vo(e,t){t=t.toLowerCase();for(let r of e)for(let o of r.extensions)if(o.toLowerCase()===t)return r;return null}function pt(e,t){for(let r of e)if(r.mimeTypes?.some(o=>at(t,o))||at(t,`application/x.${r.id}`))return r;return null}function Ho(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(Go(t,r))return r}else if(ArrayBuffer.isView(t)){if(yr(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&yr(t,0,r))return r;return null}function Go(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(o=>e.startsWith(o))}function yr(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>qo(e,t,r,n))}function qo(e,t,r,o){if(o instanceof ArrayBuffer)return Ke(o,e,o.byteLength);switch(typeof o){case"function":return o(e);case"string":let n=ht(e,t,o.length);return o===n;default:return!1}}function xr(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ht(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ht(e,0,t):""}function ht(e,t,r){if(e.byteLength<t+r)return"";let o=new DataView(e),n="";for(let s=0;s<r;s++)n+=String.fromCharCode(o.getUint8(t+s));return n}function*Tr(e,t){let r=t?.chunkSize||262144,o=0,n=new TextEncoder;for(;o<e.length;){let s=Math.min(e.length-o,r),i=e.slice(o,o+s);o+=s,yield n.encode(i)}}function*Ar(e,t={}){let{chunkSize:r=262144}=t,o=0;for(;o<e.byteLength;){let n=Math.min(e.byteLength-o,r),s=new ArrayBuffer(n),i=new Uint8Array(e,o,n);new Uint8Array(s).set(i),o+=n,yield s}}async function*_r(e,t){let r=t?.chunkSize||1048576,o=0;for(;o<e.size;){let n=o+r,s=await e.slice(o,n).arrayBuffer();o=n,yield s}}function dt(e,t){return p?Qo(e,t):Jo(e,t)}async function*Qo(e,t){let r=e.getReader(),o;try{for(;;){let n=o||r.read();t?._streamReadAhead&&(o=r.read());let{done:s,value:i}=await n;if(s)return;yield Se(i)}}catch{r.releaseLock()}}async function*Jo(e,t){for await(let r of e)yield Se(r)}function ee(e,t){if(typeof e=="string")return Tr(e,t);if(e instanceof ArrayBuffer)return Ar(e,t);if(h(e))return _r(e,t);if(j(e))return dt(e,t);if(m(e))return dt(e.body,t);throw new Error("makeIterator")}var gt="Cannot convert supplied data type";function yt(e,t,r){if(t.text&&typeof e=="string")return e;if(er(e)&&(e=e.buffer),e instanceof ArrayBuffer){let o=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(o):o}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let o=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==o.byteLength)&&(o=o.slice(e.byteOffset,e.byteOffset+n)),o}throw new Error(gt)}async function kr(e,t,r){let o=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||o)return yt(e,t,r);if(h(e)&&(e=await Ee(e)),m(e)){let n=e;return await ut(n),t.binary?await n.arrayBuffer():await n.text()}if(j(e)&&(e=ee(e,r)),he(e)||de(e))return O(e);throw new Error(gt)}async function Sr(e,t){if(ge(e))return e;if(m(e)){let r=e;await ut(r);let o=await r.body;return ee(o,t)}return h(e)||j(e)?ee(e,t):de(e)?e:Ko(e)}function Ko(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(ge(e))return e;if(he(e))return e[Symbol.iterator]();throw new Error(gt)}function te(e,t){let r=L(),o=e||r;return typeof o.fetch=="function"?o.fetch:S(o.fetch)?n=>D(n,o.fetch):t?.fetch?t?.fetch:D}function re(e,t,r){if(r)return r;let o={fetch:te(t,e),...e};if(o.url){let n=K(o.url);o.baseUrl=n,o.queryString=nr(o.url),o.filename=U.filename(n),o.baseUrl=U.dirname(n)}return Array.isArray(o.loaders)||(o.loaders=null),o}function Re(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let o=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...o]:o}return r&&r.length?r:void 0}async function E(e,t,r,o){t&&!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let n=x(e),i=Re(t,o),a=await X(e,i,r);return a?(r=Y(r,a,i,n),o=re({url:n,_parse:E,loaders:i},r,o||null),await Yo(a,e,r,o)):null}async function Yo(e,t,r,o){if(Ge(e),r=Ue(e.options,r),m(t)){let s=t,{ok:i,redirected:a,status:c,statusText:f,type:B,url:R}=s,Et=Object.fromEntries(s.headers.entries());o.response={headers:Et,ok:i,redirected:a,status:c,statusText:f,type:B,url:R}}t=await kr(t,e,r);let n=e;if(n.parseTextSync&&typeof t=="string")return n.parseTextSync(t,r,o);if(qe(e,r))return await Qe(e,t,r,o,E);if(n.parseText&&typeof t=="string")return await n.parseText(t,r,o);if(n.parse)return await n.parse(t,r,o);throw l(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Er(e,t,r,o){!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),r=r||{};let s=Re(t,o),i=Z(e,s,r);if(!i)return null;r=Y(r,i,s);let a=x(e),c=()=>{throw new Error("parseSync called parse (which is async")};return o=re({url:a,_parseSync:c,_parse:c,loaders:t},r,o||null),Zo(i,e,r,o)}function Zo(e,t,r,o){if(t=yt(t,e,r),e.parseTextSync&&typeof t=="string")return e.parseTextSync(t,r);if(e.parseSync&&t instanceof ArrayBuffer)return e.parseSync(t,r,o);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${o.url||""}`)}function wt(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function bt(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let r of Object.values(e.data))return r.length||0;return 0;default:throw new Error("table")}}function xt(e){return{...e,length:bt(e),batchType:"data"}}async function M(e,t,r,o){let n=Array.isArray(t)?t:void 0;!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let s=x(e),i=await X(e,t,r);return i?(r=Y(r,i,n,s),o=re({url:s,_parseInBatches:M,_parse:E,loaders:n},r,o||null),await Xo(i,e,r,o)):[]}async function Xo(e,t,r,o){let n=await en(e,t,r,o);if(!r.metadata)return n;let s={shape:"metadata",batchType:"metadata",metadata:{_loader:e,_context:o},data:[],bytesUsed:0};async function*i(a){yield s,yield*a}return i(n)}async function en(e,t,r,o){let n=await Sr(t,r),s=await on(n,r?.transforms||[]);return e.parseInBatches?e.parseInBatches(s,r,o):tn(s,e,r,o)}async function*tn(e,t,r,o){let n=await O(e),s=await E(n,t,{...r,mimeType:t.mimeTypes[0]},o);yield rn(s,t)}function rn(e,t){let r=wt(e)?xt(e):{shape:"unknown",batchType:"data",data:e,length:Array.isArray(e)?e.length:1};return r.mimeType=t.mimeTypes[0],r}async function on(e,t=[]){let r=e;for await(let o of t)r=o(r);return r}async function Br(e,t,r,o){let n,s;!Array.isArray(t)&&!T(t)?(n=[],s=t,o=void 0):(n=t,s=r);let i=te(s),a=e;return typeof e=="string"&&(a=await i(e)),h(e)&&(a=await i(e)),Array.isArray(n)?await E(a,n,s):await E(a,n,s)}function Rr(e,t,r,o){let n;!Array.isArray(t)&&!T(t)?(o=void 0,r=t,n=void 0):n=t;let s=te(r||{});return Array.isArray(e)?e.map(a=>Lr(a,n,r||{},s)):Lr(e,n,r||{},s)}async function Lr(e,t,r,o){if(typeof e=="string"){let s=await o(e);return Array.isArray(t)?await M(s,t,r):await M(s,t,r)}return Array.isArray(t)?await M(e,t,r):await M(e,t,r)}async function Tt(e,t,r){if(t.encode)return await t.encode(e,r);if(t.encodeText){let o=await t.encodeText(e,r);return new TextEncoder().encode(o)}if(t.encodeInBatches){let o=At(e,t,r),n=[];for await(let s of o)n.push(s);return ae(...n)}throw new Error("Writer could not encode data")}async function Ir(e,t,r){if(t.text&&t.encodeText)return await t.encodeText(e,r);if(t.text){let o=await Tt(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function At(e,t,r){if(t.encodeInBatches){let o=nn(e);return t.encodeInBatches(o,r)}throw new Error("Writer could not encode data in batches")}function nn(e){return[{...e,start:0,end:e.length}]}async function vr(e,t,r){return r={...L(),...r},t.encodeURLtoURL?sn(t,e,r):Je(t,r)?await He(t,e,r):await t.encode(e,r)}function _t(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeTextSync)return new TextEncoder().encode(t.encodeTextSync(e,r));throw new Error(`Writer ${t.name} could not synchronously encode data`)}async function Mr(e,t,r){if(t.encodeText)return await t.encodeText(e,r);if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text){let o=await t.encode(e,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Nr(e,t,r){if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text&&t.encodeSync){let o=_t(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Pr(e,t,r){if(t.encodeInBatches){let o=an(e);return t.encodeInBatches(o,r)}throw new Error(`Writer ${t.name} could not encode in batches`)}async function kt(e,t,r,o){if(e=v(e),t=v(t),p||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,o)}async function sn(e,t,r){if(p)throw new Error(`Writer ${e.name} not supported in browser`);let o=Fr("input");await new me(o,"w").write(t);let s=Fr("output"),i=await kt(o,s,e,r);return(await D(i)).arrayBuffer()}function an(e){return[{...e,start:0,end:e.length}]}function Fr(e){return`/tmp/${e}`}function Wr(e,t){if(globalThis.loaders.makeNodeStream)return globalThis.loaders.makeNodeStream(e,t);let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(o){try{let{done:n,value:s}=await r.next();n?o.close():o.enqueue(new Uint8Array(s))}catch(n){o.error(n)}},async cancel(){await r?.return?.()}},{highWaterMark:2**24,...t})}var Or="4.2.0-beta.1",Cr={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Or,worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Ur={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Or,mimeTypes:["application/x.empty"],extensions:["null"],parse:async(e,t,r)=>St(e,t||{},r),parseSync:St,parseInBatches:async function*(t,r,o){for await(let n of t)yield St(n,r,o)},tests:[()=>!1],options:{null:{}}};function St(e,t,r){return null}async function jr(e,t,r=()=>{},o=()=>{}){if(e=await e,!e.ok)return e;let n=e.body;if(!n)return e;let s=e.headers.get("content-length")||0,i=s?parseInt(s):0;if(!(i>0)||typeof ReadableStream>"u"||!n.getReader)return e;let a=new ReadableStream({async start(c){let f=n.getReader();await Dr(c,f,0,i,t,r,o)}});return new Response(a)}async function Dr(e,t,r,o,n,s,i){try{let{done:a,value:c}=await t.read();if(a){s(),e.close();return}r+=c.byteLength;let f=Math.round(r/o*100);n(f,{loadedBytes:r,totalBytes:o}),e.enqueue(c),await Dr(e,t,r,o,n,s,i)}catch(a){e.error(a),i(a)}}var Ie=class{_fetch;files={};lowerCaseFiles={};usedFiles={};constructor(t,r){this._fetch=r?.fetch||fetch;for(let o=0;o<t.length;++o){let n=t[o];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(t,r){if(t.includes("://"))return this._fetch(t,r);let o=this.files[t];if(!o)return new Response(t,{status:400,statusText:"NOT FOUND"});let s=new Headers(r?.headers).get("Range"),i=s&&/bytes=($1)-($2)/.exec(s);if(i){let c=parseInt(i[1]),f=parseInt(i[2]),B=await o.slice(c,f).arrayBuffer(),R=new Response(B);return Object.defineProperty(R,"url",{value:t}),R}let a=new Response(o);return Object.defineProperty(a,"url",{value:t}),a}async readdir(t){let r=[];for(let o in this.files)r.push(o);return r}async stat(t,r){let o=this.files[t];if(!o)throw new Error(t);return{size:o.size}}async unlink(t){delete this.files[t],delete this.lowerCaseFiles[t],this.usedFiles[t]=!0}async openReadableFile(t,r){return new fe(this.files[t])}_getFile(t,r){let o=this.files[t]||this.lowerCaseFiles[t];return o&&r&&(this.usedFiles[t]=!0),o}};return qr(cn);})();
`))>=0;){let n=t.slice(0,o+1);t=t.slice(o+1),yield n}}t.length>0&&(yield t)}async function*et(e){let t=1;for await(let r of e)yield{counter:t,line:r},t++}async function tt(e,t){for(;;){let{done:r,value:o}=await e.next();if(r){e.return();return}if(t(o))return}}async function O(e){let t=[];for await(let r of e)t.push(r);return ae(...t)}function ce(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var C=class{constructor(t,r){u(this,"name",void 0),u(this,"type",void 0),u(this,"sampleSize",1),u(this,"time",0),u(this,"count",0),u(this,"samples",0),u(this,"lastTiming",0),u(this,"lastSampleTime",0),u(this,"lastSampleCount",0),u(this,"_count",0),u(this,"_time",0),u(this,"_samples",0),u(this,"_startTime",0),u(this,"_timerPending",!1),this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ce(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ce()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var q=class{constructor(t){u(this,"id",void 0),u(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:o}=t,n=this.stats[r];return n||(t instanceof C?n=t:n=new C(r,o),this.stats[r]=n),n}};var lo="Queued Requests",mo="Active Requests",po="Cancelled Requests",ho="Queued Requests Ever",go="Active Requests Ever",yo={id:"request-scheduler",throttleRequests:!0,maxRequests:6,debounceTime:0},Q=class{props;stats;activeRequestCount=0;requestQueue=[];requestMap=new Map;updateTimer=null;constructor(t={}){this.props={...yo,...t},this.stats=new q({id:this.props.id}),this.stats.get(lo),this.stats.get(mo),this.stats.get(po),this.stats.get(ho),this.stats.get(go)}scheduleRequest(t,r=()=>0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);let o={handle:t,priority:0,getPriority:r},n=new Promise(s=>(o.resolve=s,o));return this.requestQueue.push(o),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){let{handle:r,resolve:o}=t,n=!1,s=()=>{n||(n=!0,this.requestMap.delete(r),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,o?o({done:s}):Promise.resolve({done:s})}_issueNewRequests(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(()=>this._issueNewRequestsAsync(),this.props.debounceTime)}_issueNewRequestsAsync(){this.updateTimer!==null&&clearTimeout(this.updateTimer),this.updateTimer=null;let t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(t!==0){this._updateAllRequests();for(let r=0;r<t;++r){let o=this.requestQueue.shift();o&&this._issueRequest(o)}}}_updateAllRequests(){let t=this.requestQueue;for(let r=0;r<t.length;++r){let o=t[r];this._updateRequest(o)||(t.splice(r,1),this.requestMap.delete(o.handle),r--)}t.sort((r,o)=>r.priority-o.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),t.priority<0?(t.resolve(null),!1):!0}};var rt="",Qt={};function ot(e){rt=e}function nt(){return rt}function v(e){for(let t in Qt)if(e.startsWith(t)){let r=Qt[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${rt}${e}`),e}var wo="4.2.0-beta.2",st={dataType:null,batchType:null,name:"JSON",id:"json",module:"json",version:wo,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Jt,parse:async e=>Jt(new TextDecoder().decode(e)),options:{}};function Jt(e){return JSON.parse(e)}function Kt(e){return e&&typeof e=="object"&&e.isBuffer}function Se(e){if(Kt(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var U={};Bt(U,{dirname:()=>xo,filename:()=>bo,join:()=>To,resolve:()=>Ao});function Yt(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function bo(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function xo(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function To(...e){let t="/";return e=e.map((r,o)=>(o&&(r=r.replace(new RegExp(`^${t}`),"")),o!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function Ao(...e){let t=[];for(let s=0;s<e.length;s++)t[s]=e[s];let r="",o=!1,n;for(let s=t.length-1;s>=-1&&!o;s--){let i;s>=0?i=t[s]:(n===void 0&&(n=Yt()),i=n),i.length!==0&&(r=`${i}/${r}`,o=i.charCodeAt(0)===ue)}return r=_o(r,!o),o?`/${r}`:r.length>0?r:"."}var ue=47,it=46;function _o(e,t){let r="",o=-1,n=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===ue)break;s=ue}if(s===ue){if(!(o===a-1||n===1))if(o!==a-1&&n===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==it||r.charCodeAt(r.length-2)!==it){if(r.length>2){let c=r.length-1,f=c;for(;f>=0&&r.charCodeAt(f)!==ue;--f);if(f!==c){r=f===-1?"":r.slice(0,f),o=a,n=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",o=a,n=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(o+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}o=a,n=0}else s===it&&n!==-1?++n:n=-1}return r}var fe=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(t,t+r).arrayBuffer()}};var le=new Error("Not implemented"),me=class{handle;size=0;bigsize=0n;url="";constructor(t,r,o){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,o);throw p?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw le}async write(t,r,o){throw le}async stat(){throw le}async truncate(t){throw le}async append(t){throw le}async close(){}};var Zt=e=>typeof e=="boolean",b=e=>typeof e=="function",S=e=>e!==null&&typeof e=="object",pe=e=>S(e)&&e.constructor==={}.constructor,Xt=e=>S(e)&&b(e.then),he=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",de=e=>e&&typeof e[Symbol.asyncIterator]=="function",ge=e=>e&&b(e.next),m=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var h=e=>typeof Blob<"u"&&e instanceof Blob,er=e=>e&&typeof e=="object"&&e.isBuffer,ko=e=>S(e)&&b(e.abort)&&b(e.getWriter),So=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||S(e)&&b(e.tee)&&b(e.cancel)&&b(e.getReader),Eo=e=>S(e)&&b(e.end)&&b(e.write)&&Zt(e.writable),Bo=e=>S(e)&&b(e.read)&&b(e.pipe)&&Zt(e.readable),j=e=>So(e)||Bo(e),tr=e=>ko(e)||Eo(e);var J=class extends Error{constructor(t,r){super(t),this.reason=r.reason,this.url=r.url,this.response=r.response}reason;url;response};var Lo=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Ro=/^([-\w.]+\/[-\w.+]+)/;function at(e,t){return e.toLowerCase()===t.toLowerCase()}function rr(e){let t=Ro.exec(e);return t?t[1]:e}function ct(e){let t=Lo.exec(e);return t?t[1]:""}var or=/\?.*/;function nr(e){let t=e.match(or);return t&&t[0]}function K(e){return e.replace(or,"")}function sr(e){if(e.length<50)return e;let t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function x(e){return m(e)?e.url:h(e)?e.name||"":typeof e=="string"?e:""}function ye(e){if(m(e)){let t=e,r=t.headers.get("content-type")||"",o=K(t.url);return rr(r)||ct(o)}return h(e)?e.type||"":typeof e=="string"?ct(e):""}function ir(e){return m(e)?e.headers["content-length"]||-1:h(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Ee(e){if(m(e))return e;let t={},r=ir(e);r>=0&&(t["content-length"]=String(r));let o=x(e),n=ye(e);n&&(t["content-type"]=n);let s=await Fo(e);s&&(t["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));let i=new Response(e,{headers:t});return Object.defineProperty(i,"url",{value:o}),i}async function ut(e){if(!e.ok)throw await Io(e)}async function Io(e){let t=sr(e.url),r=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;r=r.length>100?`${r.slice(0,100)}...`:r;let o={reason:e.statusText,url:e.url,response:e};try{let n=e.headers.get("Content-Type");o.reason=n?.includes("application/json")?await e.json():e.text()}catch{}return new J(r,o)}async function Fo(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(o=>{let n=new FileReader;n.onload=s=>o(s?.target?.result),n.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${vo(r)}`}return null}function vo(e){let t="",r=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)t+=String.fromCharCode(r[o]);return btoa(t)}function Mo(e){return!No(e)&&!Po(e)}function No(e){return e.startsWith("http:")||e.startsWith("https:")}function Po(e){return e.startsWith("data:")}async function D(e,t){if(typeof e=="string"){let r=v(e);return Mo(r)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(r,t):await fetch(r,t)}return await Ee(e)}async function ar(e,t,r){e instanceof Blob||(e=new Blob([e]));let o=e.slice(t,t+r);return await Wo(o)}async function Wo(e){return await new Promise((t,r)=>{let o=new FileReader;o.onload=n=>t(n?.target?.result),o.onerror=n=>r(n),o.readAsArrayBuffer(e)})}var ft=new _({id:"loaders.gl"}),Be=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Le=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var lt={fetch:null,mimeType:void 0,nothrow:!1,log:new Le,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:p,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},cr={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function we(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function L(){let e=we();return e.globalOptions=e.globalOptions||{...lt},e.globalOptions}function mt(e){let t=we(),r=L();t.globalOptions=lr(r,e),je(e.modules)}function Y(e,t,r,o){return r=r||[],r=Array.isArray(r)?r:[r],Oo(e,r),lr(t,e,o)}function Oo(e,t){ur(e,null,lt,cr,t);for(let r of t){let o=e&&e[r.id]||{},n=r.options&&r.options[r.id]||{},s=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};ur(o,r.id,n,s,t)}}function ur(e,t,r,o,n){let s=t||"Top level",i=t?`${t}.`:"";for(let a in e){let c=!t&&S(e[a]),f=a==="baseUri"&&!t,B=a==="workerUrl"&&t;if(!(a in r)&&!f&&!B){if(a in o)ft.warn(`${s} loader option '${i}${a}' no longer supported, use '${o[a]}'`)();else if(!c){let R=Co(a,n);ft.warn(`${s} loader option '${i}${a}' not recognized. ${R}`)()}}}}function Co(e,t){let r=e.toLowerCase(),o="";for(let n of t)for(let s in n.options){if(e===s)return`Did you mean '${n.id}.${s}'?`;let i=s.toLowerCase();(r.startsWith(i)||i.startsWith(r))&&(o=o||`Did you mean '${n.id}.${s}'?`)}return o}function lr(e,t,r){let n={...e.options||{}};return Uo(n,r),n.log===null&&(n.log=new Be),fr(n,L()),fr(n,t),n}function fr(e,t){for(let r in t)if(r in t){let o=t[r];pe(o)&&pe(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function Uo(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function T(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function be(e){$(e,"null loader"),$(T(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var mr=()=>{let e=we();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function pr(e){let t=mr();e=Array.isArray(e)?e:[e];for(let r of e){let o=be(r);t.find(n=>o===n)||t.unshift(o)}}function hr(){return mr()}function dr(){let e=we();e.loaderRegistry=[]}var gr=new _({id:"loaders.gl"});var jo=/\.([^.]+)$/;async function X(e,t=[],r,o){if(!wr(e))return null;let n=Z(e,t,{...r,nothrow:!0},o);if(n)return n;if(h(e)&&(e=await e.slice(0,10).arrayBuffer(),n=Z(e,t,r,o)),!n&&!r?.nothrow)throw new Error(br(e));return n}function Z(e,t=[],r,o){if(!wr(e))return null;if(t&&!Array.isArray(t))return be(t);let n=[];t&&(n=n.concat(t)),r?.ignoreRegisteredLoaders||n.push(...hr()),$o(n);let s=Do(e,n,r,o);if(!s&&!r?.nothrow)throw new Error(br(e));return s}function Do(e,t,r,o){let n=x(e),s=ye(e),i=K(n)||o?.url,a=null,c="";return r?.mimeType&&(a=pt(t,r?.mimeType),c=`match forced by supplied MIME type ${r?.mimeType}`),a=a||zo(t,i),c=c||(a?`matched url ${i}`:""),a=a||pt(t,s),c=c||(a?`matched MIME type ${s}`:""),a=a||Ho(t,e),c=c||(a?`matched initial data ${xr(e)}`:""),r?.fallbackMimeType&&(a=a||pt(t,r?.fallbackMimeType),c=c||(a?`matched fallback MIME type ${s}`:"")),c&&gr.log(1,`selectLoader selected ${a?.name}: ${c}.`),a}function wr(e){return!(e instanceof Response&&e.status===204)}function br(e){let t=x(e),r=ye(e),o="No valid loader found (";o+=t?`${U.filename(t)}, `:"no url provided, ",o+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let n=e?xr(e):"";return o+=n?` first bytes: "${n}"`:"first bytes: not available",o+=")",o}function $o(e){for(let t of e)be(t)}function zo(e,t){let r=t&&jo.exec(t),o=r&&r[1];return o?Vo(e,o):null}function Vo(e,t){t=t.toLowerCase();for(let r of e)for(let o of r.extensions)if(o.toLowerCase()===t)return r;return null}function pt(e,t){for(let r of e)if(r.mimeTypes?.some(o=>at(t,o))||at(t,`application/x.${r.id}`))return r;return null}function Ho(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(Go(t,r))return r}else if(ArrayBuffer.isView(t)){if(yr(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&yr(t,0,r))return r;return null}function Go(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(o=>e.startsWith(o))}function yr(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(n=>qo(e,t,r,n))}function qo(e,t,r,o){if(o instanceof ArrayBuffer)return Ke(o,e,o.byteLength);switch(typeof o){case"function":return o(e);case"string":let n=ht(e,t,o.length);return o===n;default:return!1}}function xr(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ht(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ht(e,0,t):""}function ht(e,t,r){if(e.byteLength<t+r)return"";let o=new DataView(e),n="";for(let s=0;s<r;s++)n+=String.fromCharCode(o.getUint8(t+s));return n}function*Tr(e,t){let r=t?.chunkSize||262144,o=0,n=new TextEncoder;for(;o<e.length;){let s=Math.min(e.length-o,r),i=e.slice(o,o+s);o+=s,yield n.encode(i)}}function*Ar(e,t={}){let{chunkSize:r=262144}=t,o=0;for(;o<e.byteLength;){let n=Math.min(e.byteLength-o,r),s=new ArrayBuffer(n),i=new Uint8Array(e,o,n);new Uint8Array(s).set(i),o+=n,yield s}}async function*_r(e,t){let r=t?.chunkSize||1048576,o=0;for(;o<e.size;){let n=o+r,s=await e.slice(o,n).arrayBuffer();o=n,yield s}}function dt(e,t){return p?Qo(e,t):Jo(e,t)}async function*Qo(e,t){let r=e.getReader(),o;try{for(;;){let n=o||r.read();t?._streamReadAhead&&(o=r.read());let{done:s,value:i}=await n;if(s)return;yield Se(i)}}catch{r.releaseLock()}}async function*Jo(e,t){for await(let r of e)yield Se(r)}function ee(e,t){if(typeof e=="string")return Tr(e,t);if(e instanceof ArrayBuffer)return Ar(e,t);if(h(e))return _r(e,t);if(j(e))return dt(e,t);if(m(e))return dt(e.body,t);throw new Error("makeIterator")}var gt="Cannot convert supplied data type";function yt(e,t,r){if(t.text&&typeof e=="string")return e;if(er(e)&&(e=e.buffer),e instanceof ArrayBuffer){let o=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(o):o}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let o=e.buffer,n=e.byteLength||e.length;return(e.byteOffset!==0||n!==o.byteLength)&&(o=o.slice(e.byteOffset,e.byteOffset+n)),o}throw new Error(gt)}async function kr(e,t,r){let o=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||o)return yt(e,t,r);if(h(e)&&(e=await Ee(e)),m(e)){let n=e;return await ut(n),t.binary?await n.arrayBuffer():await n.text()}if(j(e)&&(e=ee(e,r)),he(e)||de(e))return O(e);throw new Error(gt)}async function Sr(e,t){if(ge(e))return e;if(m(e)){let r=e;await ut(r);let o=await r.body;return ee(o,t)}return h(e)||j(e)?ee(e,t):de(e)?e:Ko(e)}function Ko(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(ge(e))return e;if(he(e))return e[Symbol.iterator]();throw new Error(gt)}function te(e,t){let r=L(),o=e||r;return typeof o.fetch=="function"?o.fetch:S(o.fetch)?n=>D(n,o.fetch):t?.fetch?t?.fetch:D}function re(e,t,r){if(r)return r;let o={fetch:te(t,e),...e};if(o.url){let n=K(o.url);o.baseUrl=n,o.queryString=nr(o.url),o.filename=U.filename(n),o.baseUrl=U.dirname(n)}return Array.isArray(o.loaders)||(o.loaders=null),o}function Re(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let o=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...o]:o}return r&&r.length?r:void 0}async function E(e,t,r,o){t&&!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let n=x(e),i=Re(t,o),a=await X(e,i,r);return a?(r=Y(r,a,i,n),o=re({url:n,_parse:E,loaders:i},r,o||null),await Yo(a,e,r,o)):null}async function Yo(e,t,r,o){if(Ge(e),r=Ue(e.options,r),m(t)){let s=t,{ok:i,redirected:a,status:c,statusText:f,type:B,url:R}=s,Et=Object.fromEntries(s.headers.entries());o.response={headers:Et,ok:i,redirected:a,status:c,statusText:f,type:B,url:R}}t=await kr(t,e,r);let n=e;if(n.parseTextSync&&typeof t=="string")return n.parseTextSync(t,r,o);if(qe(e,r))return await Qe(e,t,r,o,E);if(n.parseText&&typeof t=="string")return await n.parseText(t,r,o);if(n.parse)return await n.parse(t,r,o);throw l(!n.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function Er(e,t,r,o){!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),r=r||{};let s=Re(t,o),i=Z(e,s,r);if(!i)return null;r=Y(r,i,s);let a=x(e),c=()=>{throw new Error("parseSync called parse (which is async")};return o=re({url:a,_parseSync:c,_parse:c,loaders:t},r,o||null),Zo(i,e,r,o)}function Zo(e,t,r,o){if(t=yt(t,e,r),e.parseTextSync&&typeof t=="string")return e.parseTextSync(t,r);if(e.parseSync&&t instanceof ArrayBuffer)return e.parseSync(t,r,o);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${o.url||""}`)}function wt(e){switch(typeof e=="object"&&e?.shape){case"array-row-table":case"object-row-table":return Array.isArray(e.data);case"geojson-table":return Array.isArray(e.features);case"columnar-table":return e.data&&typeof e.data=="object";case"arrow-table":return Boolean(e?.data?.numRows!==void 0);default:return!1}}function bt(e){switch(e.shape){case"array-row-table":case"object-row-table":return e.data.length;case"geojson-table":return e.features.length;case"arrow-table":return e.data.numRows;case"columnar-table":for(let r of Object.values(e.data))return r.length||0;return 0;default:throw new Error("table")}}function xt(e){return{...e,length:bt(e),batchType:"data"}}async function M(e,t,r,o){let n=Array.isArray(t)?t:void 0;!Array.isArray(t)&&!T(t)&&(o=void 0,r=t,t=void 0),e=await e,r=r||{};let s=x(e),i=await X(e,t,r);return i?(r=Y(r,i,n,s),o=re({url:s,_parseInBatches:M,_parse:E,loaders:n},r,o||null),await Xo(i,e,r,o)):[]}async function Xo(e,t,r,o){let n=await en(e,t,r,o);if(!r.metadata)return n;let s={shape:"metadata",batchType:"metadata",metadata:{_loader:e,_context:o},data:[],bytesUsed:0};async function*i(a){yield s,yield*a}return i(n)}async function en(e,t,r,o){let n=await Sr(t,r),s=await on(n,r?.transforms||[]);return e.parseInBatches?e.parseInBatches(s,r,o):tn(s,e,r,o)}async function*tn(e,t,r,o){let n=await O(e),s=await E(n,t,{...r,mimeType:t.mimeTypes[0]},o);yield rn(s,t)}function rn(e,t){let r=wt(e)?xt(e):{shape:"unknown",batchType:"data",data:e,length:Array.isArray(e)?e.length:1};return r.mimeType=t.mimeTypes[0],r}async function on(e,t=[]){let r=e;for await(let o of t)r=o(r);return r}async function Br(e,t,r,o){let n,s;!Array.isArray(t)&&!T(t)?(n=[],s=t,o=void 0):(n=t,s=r);let i=te(s),a=e;return typeof e=="string"&&(a=await i(e)),h(e)&&(a=await i(e)),Array.isArray(n)?await E(a,n,s):await E(a,n,s)}function Rr(e,t,r,o){let n;!Array.isArray(t)&&!T(t)?(o=void 0,r=t,n=void 0):n=t;let s=te(r||{});return Array.isArray(e)?e.map(a=>Lr(a,n,r||{},s)):Lr(e,n,r||{},s)}async function Lr(e,t,r,o){if(typeof e=="string"){let s=await o(e);return Array.isArray(t)?await M(s,t,r):await M(s,t,r)}return Array.isArray(t)?await M(e,t,r):await M(e,t,r)}async function Tt(e,t,r){if(t.encode)return await t.encode(e,r);if(t.encodeText){let o=await t.encodeText(e,r);return new TextEncoder().encode(o)}if(t.encodeInBatches){let o=At(e,t,r),n=[];for await(let s of o)n.push(s);return ae(...n)}throw new Error("Writer could not encode data")}async function Ir(e,t,r){if(t.text&&t.encodeText)return await t.encodeText(e,r);if(t.text){let o=await Tt(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function At(e,t,r){if(t.encodeInBatches){let o=nn(e);return t.encodeInBatches(o,r)}throw new Error("Writer could not encode data in batches")}function nn(e){return[{...e,start:0,end:e.length}]}async function vr(e,t,r){return r={...L(),...r},t.encodeURLtoURL?sn(t,e,r):Je(t,r)?await He(t,e,r):await t.encode(e,r)}function _t(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeTextSync)return new TextEncoder().encode(t.encodeTextSync(e,r));throw new Error(`Writer ${t.name} could not synchronously encode data`)}async function Mr(e,t,r){if(t.encodeText)return await t.encodeText(e,r);if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text){let o=await t.encode(e,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Nr(e,t,r){if(t.encodeTextSync)return t.encodeTextSync(e,r);if(t.text&&t.encodeSync){let o=_t(e,t,r);return new TextDecoder().decode(o)}throw new Error(`Writer ${t.name} could not encode data as text`)}function Pr(e,t,r){if(t.encodeInBatches){let o=an(e);return t.encodeInBatches(o,r)}throw new Error(`Writer ${t.name} could not encode in batches`)}async function kt(e,t,r,o){if(e=v(e),t=v(t),p||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,o)}async function sn(e,t,r){if(p)throw new Error(`Writer ${e.name} not supported in browser`);let o=Fr("input");await new me(o,"w").write(t);let s=Fr("output"),i=await kt(o,s,e,r);return(await D(i)).arrayBuffer()}function an(e){return[{...e,start:0,end:e.length}]}function Fr(e){return`/tmp/${e}`}function Wr(e,t){if(globalThis.loaders.makeNodeStream)return globalThis.loaders.makeNodeStream(e,t);let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(o){try{let{done:n,value:s}=await r.next();n?o.close():o.enqueue(new Uint8Array(s))}catch(n){o.error(n)}},async cancel(){await r?.return?.()}},{highWaterMark:2**24,...t})}var Or="4.2.0-beta.2",Cr={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Or,worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Ur={dataType:null,batchType:null,name:"Null loader",id:"null",module:"core",version:Or,mimeTypes:["application/x.empty"],extensions:["null"],parse:async(e,t,r)=>St(e,t||{},r),parseSync:St,parseInBatches:async function*(t,r,o){for await(let n of t)yield St(n,r,o)},tests:[()=>!1],options:{null:{}}};function St(e,t,r){return null}async function jr(e,t,r=()=>{},o=()=>{}){if(e=await e,!e.ok)return e;let n=e.body;if(!n)return e;let s=e.headers.get("content-length")||0,i=s?parseInt(s):0;if(!(i>0)||typeof ReadableStream>"u"||!n.getReader)return e;let a=new ReadableStream({async start(c){let f=n.getReader();await Dr(c,f,0,i,t,r,o)}});return new Response(a)}async function Dr(e,t,r,o,n,s,i){try{let{done:a,value:c}=await t.read();if(a){s(),e.close();return}r+=c.byteLength;let f=Math.round(r/o*100);n(f,{loadedBytes:r,totalBytes:o}),e.enqueue(c),await Dr(e,t,r,o,n,s,i)}catch(a){e.error(a),i(a)}}var Ie=class{_fetch;files={};lowerCaseFiles={};usedFiles={};constructor(t,r){this._fetch=r?.fetch||fetch;for(let o=0;o<t.length;++o){let n=t[o];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(t,r){if(t.includes("://"))return this._fetch(t,r);let o=this.files[t];if(!o)return new Response(t,{status:400,statusText:"NOT FOUND"});let s=new Headers(r?.headers).get("Range"),i=s&&/bytes=($1)-($2)/.exec(s);if(i){let c=parseInt(i[1]),f=parseInt(i[2]),B=await o.slice(c,f).arrayBuffer(),R=new Response(B);return Object.defineProperty(R,"url",{value:t}),R}let a=new Response(o);return Object.defineProperty(a,"url",{value:t}),a}async readdir(t){let r=[];for(let o in this.files)r.push(o);return r}async stat(t,r){let o=this.files[t];if(!o)throw new Error(t);return{size:o.size}}async unlink(t){delete this.files[t],delete this.lowerCaseFiles[t],this.usedFiles[t]=!0}async openReadableFile(t,r){return new fe(this.files[t])}_getFile(t,r){let o=this.files[t]||this.lowerCaseFiles[t];return o&&r&&(this.usedFiles[t]=!0),o}};return qr(cn);})();
return __exports__;
});

@@ -6,3 +6,3 @@ // loaders.gl

// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const version = typeof "4.2.0-beta.1" !== 'undefined' ? "4.2.0-beta.1" : '';
const version = typeof "4.2.0-beta.2" !== 'undefined' ? "4.2.0-beta.2" : '';
// @ts-ignore

@@ -9,0 +9,0 @@ if (!globalThis.loaders) {

@@ -6,3 +6,3 @@ // loaders.gl

// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.2.0-beta.1" !== 'undefined' ? "4.2.0-beta.1" : 'latest';
const VERSION = typeof "4.2.0-beta.2" !== 'undefined' ? "4.2.0-beta.2" : 'latest';
/**

@@ -9,0 +9,0 @@ * Loads any data and returns null (or optionally passes through data unparsed)

@@ -238,3 +238,3 @@ "use strict";

// src/null-loader.ts
var VERSION = true ? "4.2.0-beta.1" : "latest";
var VERSION = true ? "4.2.0-beta.2" : "latest";
var NullLoader = {

@@ -241,0 +241,0 @@ dataType: null,

@@ -203,3 +203,3 @@ "use strict";

// src/null-loader.ts
var VERSION = true ? "4.2.0-beta.1" : "latest";
var VERSION = true ? "4.2.0-beta.2" : "latest";
var NullLoader = {

@@ -206,0 +206,0 @@ dataType: null,

{
"name": "@loaders.gl/core",
"version": "4.2.0-beta.2",
"version": "4.2.0",
"description": "The core API for working with loaders.gl loaders and writers",

@@ -58,8 +58,8 @@ "license": "MIT",

"dependencies": {
"@loaders.gl/loader-utils": "4.2.0-beta.2",
"@loaders.gl/schema": "4.2.0-beta.2",
"@loaders.gl/worker-utils": "4.2.0-beta.2",
"@loaders.gl/loader-utils": "4.2.0",
"@loaders.gl/schema": "4.2.0",
"@loaders.gl/worker-utils": "4.2.0",
"@probe.gl/log": "^4.0.2"
},
"gitHead": "13c03663fec365a4d24c06377d50035cebd7ba9f"
"gitHead": "0d9f54fca98dd1fae8998ef5829004af01feaaff"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc