@loaders.gl/core 3.0.10 → 3.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.es5.min.js +1 -1
- package/dist/dist.es5.min.js.map +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/dist.min.js.map +1 -1
- package/dist/es5/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/es5/lib/init.js +1 -1
- package/dist/es5/null-loader.js +1 -1
- package/dist/esm/iterators/make-stream/make-dom-stream.js.map +1 -1
- package/dist/esm/lib/api/encode.js +1 -1
- package/dist/esm/lib/api/encode.js.map +1 -1
- package/dist/esm/lib/api/parse-sync.js +1 -1
- package/dist/esm/lib/api/parse-sync.js.map +1 -1
- package/dist/esm/lib/api/parse.js +1 -1
- package/dist/esm/lib/api/parse.js.map +1 -1
- package/dist/esm/lib/api/select-loader.js +3 -3
- package/dist/esm/lib/api/select-loader.js.map +1 -1
- package/dist/esm/lib/fetch/fetch-error-message.js +2 -2
- package/dist/esm/lib/fetch/fetch-error-message.js.map +1 -1
- package/dist/esm/lib/init.js +1 -1
- package/dist/esm/lib/loader-utils/check-errors.js +4 -4
- package/dist/esm/lib/loader-utils/check-errors.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-utils.js +5 -5
- package/dist/esm/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/esm/lib/utils/response-utils.js +7 -7
- package/dist/esm/lib/utils/response-utils.js.map +1 -1
- package/dist/esm/null-loader.js +1 -1
- package/dist/null-worker.js +1 -1
- package/dist/null-worker.js.map +1 -1
- package/package.json +4 -4
- package/src/iterators/make-stream/make-dom-stream.ts +2 -2
package/dist/dist.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(e,t,n){"use strict";(function(e,r){n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return l}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},s=o.self||o.window||o.global||{},i=o.window||o.self||o.global||{},a=o.global||o.self||o.window||{},u=o.document||{},c="object"!=typeof r||"[object process]"!==String(r)||r.browser,l="function"==typeof importScripts,f=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);f&&parseFloat(f[1])}).call(this,n(5),n(3))},function(e,t){},function(e,t,n){"use strict";(function(e,r){n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return i}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},s=o.window||o.self||o.global,i=o.process||{};console}).call(this,n(5),n(3))},function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){function r(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if(void 0!==e&&e.hrtime){const n=e.hrtime();t=1e3*n[0]+n[1]/1e6}else t=Date.now();return t}n.d(t,"a",(function(){return r}))}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},,,,,function(e,t){},function(e,t){},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var r=n(13);function o(){return!("object"==typeof e&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(3))},function(e,t,n){"use strict";(function(e){function r(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"==typeof e.versions&&Boolean(e.versions.electron))return!0;const n="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}n.d(t,"a",(function(){return r}))}).call(this,n(3))},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return o}));"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document,"object"!=typeof r||"[object process]"!==String(r)||r.browser;const o="undefined"!=typeof window&&void 0!==window.orientation,s=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);s&&parseFloat(s[1])}).call(this,n(5),n(3))},function(e,t){},function(e,t,n){(function(t){const r=n(22),o="undefined"==typeof window?t:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,r)}).call(this,n(5))},,,,,function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"fetchFile",(function(){return E})),n.d(t,"readArrayBuffer",(function(){return j})),n.d(t,"readFileSync",(function(){return I})),n.d(t,"writeFile",(function(){return U})),n.d(t,"writeFileSync",(function(){return q})),n.d(t,"setLoaderOptions",(function(){return me})),n.d(t,"registerLoaders",(function(){return _e})),n.d(t,"selectLoader",(function(){return Ae})),n.d(t,"selectLoaderSync",(function(){return Se})),n.d(t,"parse",(function(){return it})),n.d(t,"parseSync",(function(){return at})),n.d(t,"parseInBatches",(function(){return ut})),n.d(t,"load",(function(){return ct})),n.d(t,"loadInBatches",(function(){return lt})),n.d(t,"encode",(function(){return dt})),n.d(t,"encodeSync",(function(){return ht})),n.d(t,"encodeInBatches",(function(){return yt})),n.d(t,"encodeText",(function(){return pt})),n.d(t,"encodeURLtoURL",(function(){return gt})),n.d(t,"save",(function(){return wt})),n.d(t,"saveSync",(function(){return bt})),n.d(t,"setPathPrefix",(function(){return s})),n.d(t,"getPathPrefix",(function(){return i})),n.d(t,"resolvePath",(function(){return a})),n.d(t,"RequestScheduler",(function(){return St})),n.d(t,"makeIterator",(function(){return et})),n.d(t,"makeStream",(function(){return Et})),n.d(t,"makeDOMStream",(function(){return kt})),n.d(t,"makeNodeStream",(function(){return jt.a})),n.d(t,"NullWorkerLoader",(function(){return Ct})),n.d(t,"NullLoader",(function(){return Ot})),n.d(t,"JSONLoader",(function(){return Pt})),n.d(t,"_fetchProgress",(function(){return Ft})),n.d(t,"_BrowserFileSystem",(function(){return Wt})),n.d(t,"_unregisterLoaders",(function(){return Te})),n.d(t,"isBrowser",(function(){return C.c})),n.d(t,"isWorker",(function(){return C.d})),n.d(t,"self",(function(){return C.e})),n.d(t,"window",(function(){return C.f})),n.d(t,"global",(function(){return C.b})),n.d(t,"document",(function(){return C.a})),n.d(t,"assert",(function(){return F})),n.d(t,"forEach",(function(){return Ye})),n.d(t,"concatenateArrayBuffersAsync",(function(){return Ke})),n.d(t,"makeTextDecoderIterator",(function(){return Ut})),n.d(t,"makeTextEncoderIterator",(function(){return qt})),n.d(t,"makeLineIterator",(function(){return Nt})),n.d(t,"makeNumberedLineIterator",(function(){return $t})),n.d(t,"isPureObject",(function(){return f})),n.d(t,"isPromise",(function(){return d})),n.d(t,"isIterable",(function(){return h})),n.d(t,"isAsyncIterable",(function(){return p})),n.d(t,"isIterator",(function(){return y})),n.d(t,"isResponse",(function(){return g})),n.d(t,"isReadableStream",(function(){return w})),n.d(t,"isWritableStream",(function(){return b}));let r="";const o={};function s(e){r=e}function i(){return r}function a(e){for(const t in o)if(e.startsWith(t)){const n=o[t];e=e.replace(t,n)}return e.startsWith("http://")||e.startsWith("https://")||(e=`${r}${e}`),e}const u=e=>"boolean"==typeof e,c=e=>"function"==typeof e,l=e=>null!==e&&"object"==typeof e,f=e=>l(e)&&e.constructor==={}.constructor,d=e=>l(e)&&c(e.then),h=e=>e&&"function"==typeof e[Symbol.iterator],p=e=>e&&"function"==typeof e[Symbol.asyncIterator],y=e=>e&&c(e.next),g=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,m=e=>"undefined"!=typeof Blob&&e instanceof Blob,w=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||l(e)&&c(e.tee)&&c(e.cancel)&&c(e.getReader))(e)||(e=>l(e)&&c(e.read)&&c(e.pipe)&&u(e.readable))(e),b=e=>(e=>l(e)&&c(e.abort)&&c(e.getWriter))(e)||(e=>l(e)&&c(e.end)&&c(e.write)&&u(e.writable))(e),v=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,_=/^([-\w.]+\/[-\w.+]+)/;function T(e){const t=_.exec(e);return t?t[1]:e}function x(e){const t=v.exec(e);return t?t[1]:""}const A=/\?.*/;function S(e){if(g(e)){const t=k(e.url||"");return{url:t,type:T(e.headers.get("content-type")||"")||x(t)}}return m(e)?{url:k(e.name||""),type:e.type||""}:"string"==typeof e?{url:k(e),type:x(e)}:{url:"",type:""}}function k(e){return e.replace(A,"")}async function L(e){if(g(e))return e;const t={},n=function(e){return g(e)?e.headers["content-length"]||-1:m(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);n>=0&&(t["content-length"]=String(n));const{url:r,type:o}=S(e);o&&(t["content-type"]=o);const s=await async function(e){if("string"==typeof e)return"data:,"+e.slice(0,5);if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(e=>{const n=new FileReader;n.onload=t=>{var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=e.slice(0,5);return"data:base64,"+function(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.byteLength;e++)t+=String.fromCharCode(n[e]);return btoa(t)}(t)}return null}(e);s&&(t["x-first-bytes"]=s),"string"==typeof e&&(e=(new TextEncoder).encode(e));const i=new Response(e,{headers:t});return Object.defineProperty(i,"url",{value:r}),i}async function R(e){if(!e.ok){const t=await async function(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{const n=e.headers.get("Content-Type");let r=e.statusText;n.includes("application/json")&&(r+=" "+await e.text()),t+=r,t=t.length>60?t.slice(60)+"...":t}catch(e){}return t}(e);throw new Error(t)}}async function E(e,t){if("string"==typeof e){e=a(e);let n=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(n=t.fetch),await fetch(e,n)}return await L(e)}var B=n(10);async function j(e,t,n){if("number"==typeof e)return await B._readToArrayBuffer(e,t,n);e instanceof Blob||(e=new Blob([e]));const r=e.slice(t,t+n);return await async function(e){return await new Promise((t,n)=>{const r=new FileReader;r.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)})}(r)}var C=n(0),O=n(1);function P(e){if(O.toArrayBuffer&&(e=O.toArrayBuffer(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function M(...e){const t=e.map(e=>e instanceof ArrayBuffer?new Uint8Array(e):e),n=t.reduce((e,t)=>e+t.byteLength,0),r=new Uint8Array(n);let o=0;for(const e of t)r.set(e,o),o+=e.byteLength;return r.buffer}function F(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function I(e,t={}){if(e=a(e),!C.c){const n=B.readFileSync(e,t);return"string"!=typeof n?P(n):n}return t.nothrow||F(!1),null}function W(e){return O.toBuffer?O.toBuffer(e):e}async function U(e,t,n){e=a(e),C.c||await B.writeFile(e,W(t),{flag:"w"}),F(!1)}function q(e,t,n){e=a(e),C.c||B.writeFileSync(e,W(t),{flag:"w"}),F(!1)}var N=n(12);const $=Object(N.a)();class D{constructor(e,t,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(n),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function z(e,t,n,r=600){const o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>r&&(n=Math.min(n,r/e.width));const s=e.width*n,i=e.height*n,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(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}const Q={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function H(e){return"string"==typeof e?Q[e.toUpperCase()]||Q.WHITE:e}function G(e,t){if(!e)throw new Error(t||"Assertion failed")}var J=n(2);function V(){let e;if($&&J.b.performance)e=J.b.performance.now();else if(J.a.hrtime){const t=J.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const Y={debug:$&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},K={enabled:!0,level:0};function X(){}const Z={},ee={once:!0};function te(e){for(const t in e)for(const n in e[t])return n||"untitled";return"empty"}class ne{constructor({id:e}={id:""}){this.id=e,this.VERSION="3.0.10",this._startTs=V(),this._deltaTs=V(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new D("__probe-".concat(this.id,"__"),K),this.userData={},this.timeStamp("".concat(this.id," started")),function(e,t=["constructor"]){const n=Object.getPrototypeOf(e),r=Object.getOwnPropertyNames(n);for(const n of r)"function"==typeof e[n]&&(t.find(e=>n===e)||(e[n]=e[n].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((V()-this._startTs).toPrecision(10))}getDelta(){return Number((V()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}assert(e,t){G(e,t)}warn(e){return this._getLogFunction(0,e,Y.warn,arguments,ee)}error(e){return this._getLogFunction(0,e,Y.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,Y.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Y.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Y.debug||Y.info,arguments,ee)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||X,n&&[n],{tag:te(t)}):X}image({logLevel:e,priority:t,image:r,message:o="",scale:s=1}){return this._shouldLog(e||t)?$?function({image:e,message:t="",scale:n=1}){if("string"==typeof e){const r=new Image;return r.onload=()=>{const e=z(r,t,n);console.log(...e)},r.src=e,X}const r=e.nodeName||"";if("img"===r.toLowerCase())return console.log(...z(e,t,n)),X;if("canvas"===r.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...z(r,t,n)),r.src=e.toDataURL(),X}return X}({image:r,message:o,scale:s}):function({image:e,message:t="",scale:r=1}){let o=null;try{o=n(21)}catch(e){}if(o)return()=>o(e,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(e=>console.log(e));return X}({image:r,message:o,scale:s}):X}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||X)}group(e,t,n={collapsed:!1}){n=oe({logLevel:e,message:t,opts:n});const{collapsed:r}=n;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||X)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=re(e)}_getLogFunction(e,t,n,r=[],o){if(this._shouldLog(e)){o=oe({logLevel:e,message:t,args:r,opts:o}),G(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=V();const s=o.tag||o.message;if(o.once){if(Z[s])return X;Z[s]=V()}return t=function(e,t,n){if("string"==typeof t){const i=n.time?function(e,t=8){const n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(n.total)):"";t=n.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),r=t,o=n.color,s=n.background,$||"string"!=typeof r||(o&&(o=H(o),r="[".concat(o,"m").concat(r,"[39m")),s&&(o=H(s),r="[".concat(s+10,"m").concat(r,"[49m"))),t=r}var r,o,s;return t}(this.id,o.message,o),n.bind(console,t,...o.args)}return X}}function re(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 G(Number.isFinite(t)&&t>=0),t}function oe(e){const{logLevel:t,message:n}=e;e.logLevel=re(t);const r=e.args?Array.from(e.args):[];for(;r.length&&r.shift()!==n;);switch(e.args=r,typeof t){case"string":case"function":void 0!==n&&r.unshift(n),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const o=typeof e.message;return G("string"===o||"object"===o),Object.assign(e,e.opts)}ne.VERSION="3.0.10";const se=new ne({id:"loaders.gl"});class ie{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const ae={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){var e,t,n;n=void 0,(t="console")in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ue={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 ce(){C.b.loaders=C.b.loaders||{};const{loaders:e}=C.b;return e._state=e._state||{},e._state}const le=()=>{const e=ce();return e.globalOptions=e.globalOptions||{...ae},e.globalOptions};function fe(e,t,n,r){return n=n||[],function(e,t){he(e,null,ae,ue,t);for(const n of t){const r=e&&e[n.id]||{},o=n.options&&n.options[n.id]||{},s=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};he(r,n.id,o,s,t)}}(e,n=Array.isArray(n)?n:[n]),ye(t,e,r)}function de(e,t){const n=le(),r=e||n;return"function"==typeof r.fetch?r.fetch:l(r.fetch)?e=>E(e,r):null!=t&&t.fetch?null==t?void 0:t.fetch:E}function he(e,t,n,r,o){const s=t||"Top level",i=t?t+".":"";for(const a in e){const u=!t&&l(e[a]),c="baseUri"===a&&!t,f="workerUrl"===a&&t;if(!(a in n)&&!c&&!f)if(a in r)se.warn(`${s} loader option '${i}${a}' no longer supported, use '${r[a]}'`)();else if(!u){const e=pe(a,o);se.warn(`${s} loader option '${i}${a}' not recognized. ${e}`)()}}}function pe(e,t){const n=e.toLowerCase();let r="";for(const o of t)for(const t in o.options){if(e===t)return`Did you mean '${o.id}.${t}'?`;const s=t.toLowerCase();(n.startsWith(s)||s.startsWith(n))&&(r=r||`Did you mean '${o.id}.${t}'?`)}return r}function ye(e,t,n){const r={...e.options||{}};return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(r,n),null===r.log&&(r.log=new ie),ge(r,le()),ge(r,t),r}function ge(e,t){for(const n in t)if(n in t){const r=t[n];f(r)&&f(e[n])?e[n]={...e[n],...t[n]}:e[n]=t[n]}}function me(e){!function(e){const t=ce(),n=le();t.globalOptions=ye(n,e)}(e)}function we(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function be(e){var t,n;let r;return F(e,"null loader"),F(we(e),"invalid loader"),Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(n=e)&&void 0!==n&&n.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}const ve=()=>{const e=ce();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function _e(e){const t=ve();e=Array.isArray(e)?e:[e];for(const n of e){const e=be(n);t.find(t=>e===t)||t.unshift(e)}}function Te(){ce().loaderRegistry=[]}const xe=/\.([^.]+)$/;async function Ae(e,t=[],n,r){if(!ke(e))return null;let o=Se(e,t,{...n,nothrow:!0},r);if(o)return o;if(m(e)&&(o=Se(e=await e.slice(0,10).arrayBuffer(),t,n,r)),!(o||null!=n&&n.nothrow))throw new Error(Le(e));return o}function Se(e,t=[],n,r){if(!ke(e))return null;if(t&&!Array.isArray(t))return be(t);let o=[];t&&(o=o.concat(t)),null!=n&&n.ignoreRegisteredLoaders||o.push(...ve()),function(e){for(const t of e)be(t)}(o);const s=function(e,t,n,r){const{url:o,type:s}=S(e),i=o||(null==r?void 0:r.url);let a=null;null!=n&&n.mimeType&&(a=Re(t,null==n?void 0:n.mimeType));return a=a||function(e,t){const n=t&&xe.exec(t),r=n&&n[1];return r?function(e,t){t=t.toLowerCase();for(const n of e)for(const e of n.extensions)if(e.toLowerCase()===t)return n;return null}(e,r):null}(t,i),a=a||Re(t,s),a=a||function(e,t){if(!t)return null;for(const n of e)if("string"==typeof t){if(Ee(t,n))return n}else if(ArrayBuffer.isView(t)){if(Be(t.buffer,t.byteOffset,n))return n}else if(t instanceof ArrayBuffer){if(Be(t,0,n))return n}return null}(t,e),a=a||Re(t,null==n?void 0:n.fallbackMimeType),a}(e,o,n,r);if(!(s||null!=n&&n.nothrow))throw new Error(Le(e));return s}function ke(e){return!(e instanceof Response&&204===e.status)}function Le(e){const{url:t,type:n}=S(e);let r="No valid loader found";return e&&(r+=` data: "${function(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return je(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return je(e,0,t)}return""}(e)}", contentType: "${n}"`),t&&(r+=" url: "+t),r}function Re(e,t){for(const n of e){if(n.mimeTypes&&n.mimeTypes.includes(t))return n;if(t==="application/x."+n.id)return n}return null}function Ee(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some(t=>e.startsWith(t))}function Be(e,t,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(r=>function(e,t,n,r){if(r instanceof ArrayBuffer)return function(e,t,n){if(n=n||e.byteLength,e.byteLength<n||t.byteLength<n)return!1;const r=new Uint8Array(e),o=new Uint8Array(t);for(let e=0;e<r.length;++e)if(r[e]!==o[e])return!1;return!0}(r,e,r.byteLength);switch(typeof r){case"function":return r(e,n);case"string":const o=je(e,t,r.length);return r===o;default:return!1}}(e,t,n,r))}function je(e,t,n){if(e.byteLength<t+n)return"";const r=new DataView(e);let o="";for(let e=0;e<n;e++)o+=String.fromCharCode(r.getUint8(t+e));return o}function Ce(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Oe=n(14);const Pe=new Map;function Me(e){Ce(e.source&&!e.url||!e.source&&e.url);let t=Pe.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Fe((t=e,`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`));var t}(e.url),Pe.set(e.url,t)),e.source&&(t=Fe(e.source),Pe.set(e.source,t))),Ce(t),t}function Fe(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Ie(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=()=>{};class qe{static isSupported(){return"undefined"!=typeof Worker}constructor(e){We(this,"name",void 0),We(this,"source",void 0),We(this,"url",void 0),We(this,"terminated",!1),We(this,"worker",void 0),We(this,"onMessage",void 0),We(this,"onError",void 0),We(this,"_loadableURL","");const{name:t,source:n,url:r}=e;Ce(n||r),this.name=t,this.source=n,this.url=r,this.onMessage=Ue,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=Ue,this.onError=Ue,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||function e(t,n=!0,r){const o=r||new Set;if(t){if(Ie(t))o.add(t);else if(Ie(t.buffer))o.add(t.buffer);else if(ArrayBuffer.isView(t));else if(n&&"object"==typeof t)for(const r in t)e(t[r],n,o)}else;return void 0===r?Array.from(o):[]}(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=e.message+" in "),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=Me({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class $e{constructor(e,t){Ne(this,"name",void 0),Ne(this,"workerThread",void 0),Ne(this,"isRunning",void 0),Ne(this,"result",void 0),Ne(this,"_resolve",void 0),Ne(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Ce(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Ce(this.isRunning),this.isRunning=!1,this._reject(e)}}function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ze{constructor(e){De(this,"name","unnamed"),De(this,"source",void 0),De(this,"url",void 0),De(this,"maxConcurrency",1),De(this,"maxMobileConcurrency",1),De(this,"onDebug",()=>{}),De(this,"reuseWorkers",!0),De(this,"props",{}),De(this,"jobQueue",[]),De(this,"idleQueue",[]),De(this,"count",0),De(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e,t=((e,t,n)=>e.done(n)),n=((e,t)=>e.error(t))){const r=new Promise(r=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:r}),this));return this._startQueuedJob(),await r}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new $e(t.name,e);e.onMessage=e=>t.onMessage(n,e.type,e.payload),e.onError=e=>t.onError(n,e),t.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new qe({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Oe.a?this.maxMobileConcurrency:this.maxConcurrency}}function Qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He={maxConcurrency:3,maxMobileConcurrency:1,onDebug:()=>{},reuseWorkers:!0};class Ge{static isSupported(){return qe.isSupported()}static getWorkerFarm(e={}){return Ge._workerFarm=Ge._workerFarm||new Ge({}),Ge._workerFarm.setProps(e),Ge._workerFarm}constructor(e){Qe(this,"props",void 0),Qe(this,"workerPools",new Map),this.props={...He},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:n,url:r}=e;let o=this.workerPools.get(t);return o||(o=new ze({name:t,source:n,url:r}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Qe(Ge,"_workerFarm",void 0);async function Je(e,t,n,r,o){const s=e.id,i=function(e,t={}){const n=t[e.id]||{},r=e.id+"-worker.js";let o=n.workerUrl;if("test"===t._workerType&&(o=`modules/${e.module}/dist/${r}`),!o){let t=e.version;"latest"===t&&(t="latest");const n=t?"@"+t:"";o=`https://unpkg.com/@loaders.gl/${e.module}${n}/dist/${r}`}return Ce(o),o}(e,n),a=Ge.getWorkerFarm(n).getWorkerPool({name:s,url:i});n=JSON.parse(JSON.stringify(n));const u=await a.startJob("process-on-worker",Ve.bind(null,o));u.postMessage("process",{input:t,options:n});const c=await u.result;return await c.result}async function Ve(e,t,n,r){switch(n){case"done":t.done(r);break;case"error":t.error(r.error);break;case"process":const{id:o,input:s,options:i}=r;try{const n=await e(s,i);t.postMessage("done",{id:o,result:n})}catch(e){const n=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:o,error:n})}break;default:console.warn("parse-with-worker unknown message "+n)}}async function Ye(e,t){for(;;){const{done:n,value:r}=await e.next();if(n)return void e.return();if(t(r))return}}async function Ke(e){const t=[];for await(const n of e)t.push(n);return M(...t)}const Xe=262144;function Ze(e,t){return C.c?async function*(e,t){const n=e.getReader();let r;try{for(;;){const e=r||n.read();null!=t&&t._streamReadAhead&&(r=n.read());const{done:o,value:s}=await e;if(o)return;yield P(s)}}catch(e){n.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield P(t)}(e)}function et(e,t){if("string"==typeof e)return function*(e,t){const n=(null==t?void 0:t.chunkSize)||262144;let r=0;const o=new TextEncoder;for(;r<e.length;){const t=Math.min(e.length-r,n),s=e.slice(r,r+t);r+=t,yield o.encode(s)}}(e,t);if(e instanceof ArrayBuffer)return function*(e,t={}){const{chunkSize:n=Xe}=t;let r=0;for(;r<e.byteLength;){const t=Math.min(e.byteLength-r,n),o=new ArrayBuffer(t),s=new Uint8Array(e,r,t);new Uint8Array(o).set(s),r+=t,yield o}}(e,t);if(m(e))return async function*(e,t){const n=(null==t?void 0:t.chunkSize)||1048576;let r=0;for(;r<e.size;){const t=r+n,o=await e.slice(r,t).arrayBuffer();r=t,yield o}}(e,t);if(w(e))return Ze(e,t);if(g(e)){return Ze(e.body,t)}throw new Error("makeIterator")}const tt="Cannot convert supplied data type";function nt(e,t,n){if(t.text&&"string"==typeof e)return e;var r;if((r=e)&&"object"==typeof r&&r.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){const n=e;if(t.text&&!t.binary){return new TextDecoder("utf8").decode(n)}return n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary){return new TextDecoder("utf8").decode(e)}let n=e.buffer;const r=e.byteLength||e.length;return 0===e.byteOffset&&r===n.byteLength||(n=n.slice(e.byteOffset,e.byteOffset+r)),n}throw new Error(tt)}async function rt(e,t){if(y(e))return e;if(g(e)){const n=e;await R(n);return et(await n.body,t)}return m(e)||w(e)?et(e,t):p(e)?e[Symbol.asyncIterator]():function(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(y(e))return e;if(h(e))return e[Symbol.iterator]();throw new Error(tt)}(e)}function ot(e,t,n=null){if(n)return n;const r={fetch:de(t,e),...e};return Array.isArray(r.loaders)||(r.loaders=null),r}function st(e,t){if(!t&&e&&!Array.isArray(e))return e;let n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[...n,...e]:e}return n&&n.length?n:null}async function it(e,t,n,r){Ce(!r||"object"==typeof r),!t||Array.isArray(t)||we(t)||(r=void 0,n=t,t=void 0),e=await e,n=n||{};const{url:o}=S(e),s=st(t,r),i=await Ae(e,s,n);return i?(r=ot({url:o,parse:it,loaders:s},n=fe(n,i,s,o),r),await async function(e,t,n,r){if(function(e,t="3.0.10"){Ce(e,"no worker provided");const n=e.version}(e),t=await async function(e,t,n){const r=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||r)return nt(e,t);if(m(e)&&(e=await L(e)),g(e)){const n=e;return await R(n),t.binary?await n.arrayBuffer():await n.text()}if(w(e)&&(e=et(e,n)),h(e)||p(e))return Ke(e);throw new Error(tt)}(t,e,n),e.parseTextSync&&"string"==typeof t)return n.dataType="text",e.parseTextSync(t,n,r,e);if(function(e,t){return!!Ge.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}(e,n))return await Je(e,t,n,0,it);if(e.parseText&&"string"==typeof t)return await e.parseText(t,n,r,e);if(e.parse)return await e.parse(t,n,r,e);throw Ce(!e.parseSync),new Error(e.id+" loader - no parser found and worker is disabled")}(i,e,n,r)):null}function at(e,t,n,r){F(!r||"object"==typeof r),Array.isArray(t)||we(t)||(r=void 0,n=t,t=void 0),n=n||{};const o=st(t,r),s=Se(e,o,n);if(!s)return null;n=fe(n,s,o);const{url:i}=S(e);return function(e,t,n,r){if(t=nt(t,e),e.parseTextSync&&"string"==typeof t)return e.parseTextSync(t,n);if(e.parseSync&&t instanceof ArrayBuffer)return e.parseSync(t,n,r);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${r.url||""}`)}(s,e,n,r=ot({url:i,parseSync:at,parse:()=>{throw new Error("parseSync called parse")},loaders:t},n))}async function ut(e,t,n,r){F(!r||"object"==typeof r),Array.isArray(t)||we(t)||(r=void 0,n=t,t=void 0),e=await e,n=n||{};const{url:o}=S(e),s=await Ae(e,t,n);return s?(r=ot({url:o,parseInBatches:ut,parse:it,loaders:t},n=fe(n,s,t,o),r),await async function(e,t,n,r){const o=await async function(e,t,n,r){const o=await rt(t,n),s=await async function(e,t=[]){let n=e;for await(const e of t)n=e(n);return n}(o,(null==n?void 0:n.transforms)||[]);if(e.parseInBatches)return e.parseInBatches(s,n,r);return async function*(){const t=await Ke(s),o=await it(t,e,{...n,mimeType:e.mimeTypes[0]},r),i={mimeType:e.mimeTypes[0],shape:Array.isArray(o)?"row-table":"unknown",batchType:"data",data:o,length:Array.isArray(o)?o.length:1};yield i}()}(e,t,n,r);if(!n.metadata)return o;const s={batchType:"metadata",metadata:{_loader:e,_context:r},data:[],bytesUsed:0};return async function*(e){yield s,yield*e}(o)}(s,e,n,r)):null}async function ct(e,t,n,r){Array.isArray(t)||we(t)||(void 0,n=t,t=void 0);const o=de(n);let s=e;return"string"==typeof e&&(s=await o(e)),m(e)&&(s=await o(e)),await it(s,t,n)}function lt(e,t,n,r){Array.isArray(t)||we(t)||(void 0,n=t,t=null);const o=de(n||{});if(!Array.isArray(e))return ft(e,t,n,o);return e.map(e=>ft(e,t,n,o))}async function ft(e,t,n,r){if("string"==typeof e){const o=e,s=await r(o);return await ut(s,t,n)}return await ut(e,t,n)}async function dt(e,t,n){if(t.encode)return await t.encode(e,n);if(t.encodeSync)return t.encodeSync(e,n);if(t.encodeText)return(new TextEncoder).encode(await t.encodeText(e,n));if(t.encodeInBatches){const r=yt(e,t,n),o=[];for await(const e of r)o.push(e);return M(...o)}if(!C.c&&t.encodeURLtoURL){const r=mt("input");await U(r,e);const o=mt("output"),s=await gt(r,o,t,n);return(await E(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function ht(e,t,n){if(t.encodeSync)return t.encodeSync(e,n);throw new Error("Writer could not synchronously encode data")}async function pt(e,t,n){if(t.text&&t.encodeText)return await t.encodeText(e,n);if(t.text&&(t.encode||t.encodeInBatches)){const r=await dt(e,t,n);return(new TextDecoder).decode(r)}throw new Error("Writer could not encode data as text")}function yt(e,t,n){if(t.encodeInBatches){const r=function(e){return[{table:e,start:0,end:e.length}]}(e);return t.encodeInBatches(r,n)}throw new Error("Writer could not encode data in batches")}async function gt(e,t,n,r){if(e=a(e),t=a(t),C.c||!n.encodeURLtoURL)throw new Error;return await n.encodeURLtoURL(e,t,r)}function mt(e){return"/tmp/"+e}async function wt(e,t,n,r){const o=await dt(e,n,r);return await U(t,o)}function bt(e,t,n,r){return q(t,ht(e,n,r))}var vt=n(4);class _t{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Object(vt.a)(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Object(vt.a)()-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}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}_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)}}class Tt{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:n}=e;return this.stats[t]||(this.stats[t]=e instanceof _t?e:new _t(t,n)),this.stats[t]}}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const At={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class St{constructor(e={}){xt(this,"props",void 0),xt(this,"stats",void 0),xt(this,"activeRequestCount",0),xt(this,"requestQueue",[]),xt(this,"requestMap",new Map),xt(this,"deferredUpdate",null),this.props={...At,...e},this.stats=new Tt({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(e,t=(()=>0)){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const n={handle:e,priority:0,getPriority:t},r=new Promise(e=>(n.resolve=e,n));return this.requestQueue.push(n),this.requestMap.set(e,r),this._issueNewRequests(),r}_issueRequest(e){const{handle:t,resolve:n}=e;let r=!1;const o=()=>{r||(r=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(let t=0;t<e;++t){const e=this.requestQueue.shift();e&&this._issueRequest(e)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const n=e[t];this._updateRequest(n)||(e.splice(t,1),this.requestMap.delete(n.handle),t--)}e.sort((e,t)=>e.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}function kt(e,t){const n=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(e){try{const{done:t,value:r}=await n.next();t?e.close():e.enqueue(new Uint8Array(r))}catch(t){e.error(t)}},async cancel(){var e;await(null==n||null===(e=n.return)||void 0===e?void 0:e.call(n))}},{highWaterMark:2**24,...t})}var Lt=n(15),Rt=n.n(Lt);function Et(e,t){return C.c?kt(e,t):Rt()(e,t)}var Bt=n(11),jt=n.n(Bt);const Ct={name:"Null loader",id:"null",module:"core",version:"3.0.10",worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Ot={name:"Null loader",id:"null",module:"core",version:"3.0.10",mimeTypes:["application/x.empty"],extensions:["null"],parse:async e=>e,parseSync:e=>e,parseInBatches:async function*(e){for await(const t of e)yield t},tests:[()=>!1],options:{null:{}}},Pt={name:"JSON",id:"json",module:"json",version:"3.0.10",extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Mt,parse:async e=>Mt((new TextDecoder).decode(e)),options:{}};function Mt(e){return JSON.parse(e)}async function Ft(e,t,n=(()=>{}),r=(()=>{})){if(!(e=await e).ok)return e;const o=e.body;if(!o)return e;const s=e.headers.get("content-length")||0,i=s&&parseInt(s);if(!(s>0))return e;if("undefined"==typeof ReadableStream||!o.getReader)return e;const a=new ReadableStream({async start(e){const s=o.getReader();await async function e(t,n,r,o,s,i,a){try{const{done:u,value:c}=await n.read();if(u)return i(),void t.close();r+=c.byteLength;const l=Math.round(r/o*100);s(l,{loadedBytes:r,totalBytes:o}),t.enqueue(c),await e(t,n,r,o,s,i,a)}catch(e){t.error(e),a(e)}}(e,s,0,i,t,n,r)}});return new Response(a)}function It(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Wt{constructor(e,t){It(this,"_fetch",void 0),It(this,"files",{}),It(this,"lowerCaseFiles",{}),It(this,"usedFiles",{}),this._fetch=(null==t?void 0:t.fetch)||fetch;for(let t=0;t<e.length;++t){const n=e[t];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(e,t){if(e.includes("://"))return this._fetch(e,t);const n=this.files[e];if(!n)return new Response(e,{status:400,statusText:"NOT FOUND"});const r=new Headers(null==t?void 0:t.headers).get("Range"),o=r&&/bytes=($1)-($2)/.exec(r);if(o){const t=parseInt(o[1]),r=parseInt(o[2]),s=await n.slice(t,r).arrayBuffer(),i=new Response(s);return Object.defineProperty(i,"url",{value:e}),i}const s=new Response(n);return Object.defineProperty(s,"url",{value:e}),s}async readdir(e){const t=[];for(const e in this.files)t.push(e);return t}async stat(e,t){const n=this.files[e];if(!n)throw new Error(e);return{size:n.size}}async unlink(e){delete this.files[e],delete this.lowerCaseFiles[e],this.usedFiles[e]=!0}async open(e,t,n){return this.files[e]}async read(e,t,n=0,r=t.byteLength,o=null){const s=e;return{bytesRead:r,buffer:await s.slice(0,0+r).arrayBuffer()}}async close(e){}_getFile(e,t){const n=this.files[e]||this.lowerCaseFiles[e];return n&&t&&(this.usedFiles[e]=!0),n}}async function*Ut(e,t={}){const n=new TextDecoder(void 0,t);for await(const t of e)yield"string"==typeof t?t:n.decode(t,{stream:!0})}async function*qt(e){const t=new TextEncoder;for await(const n of e)yield"string"==typeof n?t.encode(n):n}async function*Nt(e){let t="";for await(const n of e){let e;for(t+=n;(e=t.indexOf("\n"))>=0;){const n=t.slice(0,e+1);t=t.slice(e+1),yield n}}t.length>0&&(yield t)}async function*$t(e){let t=1;for await(const n of e)yield{counter:t,line:n},t++}}])}));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=17)}([function(e,t,n){"use strict";(function(e,r){n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return i})),n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return f}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},s=o.self||o.window||o.global||{},i=o.window||o.self||o.global||{},a=o.global||o.self||o.window||{},u=o.document||{},c="object"!=typeof r||"[object process]"!==String(r)||r.browser,f="function"==typeof importScripts,l=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);l&&parseFloat(l[1])}).call(this,n(5),n(2))},function(e,t,n){"use strict";(function(e,r){n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return i}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},s=o.window||o.self||o.global,i=o.process||{};console}).call(this,n(5),n(2))},function(e,t){var n,r,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,c=[],f=!1,l=-1;function d(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=a(d);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||f||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e){function r(){let t;if("undefined"!=typeof window&&window.performance)t=window.performance.now();else if(void 0!==e&&e.hrtime){const n=e.hrtime();t=1e3*n[0]+n[1]/1e6}else t=Date.now();return t}n.d(t,"a",(function(){return r}))}).call(this,n(2))},function(e,t){},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){},,,,,function(e,t){},function(e,t){},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var r=n(14);function o(){return!("object"==typeof e&&"[object process]"===String(e)&&!e.browser)||Object(r.a)()}}).call(this,n(2))},function(e,t,n){"use strict";(function(e){function r(t){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==e&&"object"==typeof e.versions&&Boolean(e.versions.electron))return!0;const n="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=t||n;return!!(r&&r.indexOf("Electron")>=0)}n.d(t,"a",(function(){return r}))}).call(this,n(2))},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",(function(){return o}));"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document,"object"!=typeof r||"[object process]"!==String(r)||r.browser;const o="undefined"!=typeof window&&void 0!==window.orientation,s=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);s&&parseFloat(s[1])}).call(this,n(5),n(2))},function(e,t){},function(e,t,n){(function(t){const r=n(24),o="undefined"==typeof window?t:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,r)}).call(this,n(5))},,,,,,function(e,t){},function(e,t,n){"use strict";n.r(t),n.d(t,"fetchFile",(function(){return E})),n.d(t,"readArrayBuffer",(function(){return j})),n.d(t,"readFileSync",(function(){return W})),n.d(t,"writeFile",(function(){return U})),n.d(t,"writeFileSync",(function(){return q})),n.d(t,"setLoaderOptions",(function(){return me})),n.d(t,"registerLoaders",(function(){return _e})),n.d(t,"selectLoader",(function(){return Ae})),n.d(t,"selectLoaderSync",(function(){return Se})),n.d(t,"parse",(function(){return it})),n.d(t,"parseSync",(function(){return at})),n.d(t,"parseInBatches",(function(){return ut})),n.d(t,"load",(function(){return ct})),n.d(t,"loadInBatches",(function(){return ft})),n.d(t,"encode",(function(){return dt})),n.d(t,"encodeSync",(function(){return ht})),n.d(t,"encodeInBatches",(function(){return yt})),n.d(t,"encodeText",(function(){return pt})),n.d(t,"encodeURLtoURL",(function(){return gt})),n.d(t,"save",(function(){return wt})),n.d(t,"saveSync",(function(){return bt})),n.d(t,"setPathPrefix",(function(){return s})),n.d(t,"getPathPrefix",(function(){return i})),n.d(t,"resolvePath",(function(){return a})),n.d(t,"RequestScheduler",(function(){return St})),n.d(t,"makeIterator",(function(){return et})),n.d(t,"makeStream",(function(){return Et})),n.d(t,"makeDOMStream",(function(){return kt})),n.d(t,"makeNodeStream",(function(){return jt.a})),n.d(t,"NullWorkerLoader",(function(){return Ct})),n.d(t,"NullLoader",(function(){return Ot})),n.d(t,"JSONLoader",(function(){return Pt})),n.d(t,"_fetchProgress",(function(){return Ft})),n.d(t,"_BrowserFileSystem",(function(){return Wt})),n.d(t,"_unregisterLoaders",(function(){return Te})),n.d(t,"isBrowser",(function(){return C.c})),n.d(t,"isWorker",(function(){return C.d})),n.d(t,"self",(function(){return C.e})),n.d(t,"window",(function(){return C.f})),n.d(t,"global",(function(){return C.b})),n.d(t,"document",(function(){return C.a})),n.d(t,"assert",(function(){return I})),n.d(t,"forEach",(function(){return Ye})),n.d(t,"concatenateArrayBuffersAsync",(function(){return Ke})),n.d(t,"makeTextDecoderIterator",(function(){return Ut})),n.d(t,"makeTextEncoderIterator",(function(){return qt})),n.d(t,"makeLineIterator",(function(){return Nt})),n.d(t,"makeNumberedLineIterator",(function(){return $t})),n.d(t,"isPureObject",(function(){return l})),n.d(t,"isPromise",(function(){return d})),n.d(t,"isIterable",(function(){return h})),n.d(t,"isAsyncIterable",(function(){return p})),n.d(t,"isIterator",(function(){return y})),n.d(t,"isResponse",(function(){return g})),n.d(t,"isReadableStream",(function(){return w})),n.d(t,"isWritableStream",(function(){return b}));let r="";const o={};function s(e){r=e}function i(){return r}function a(e){for(const t in o)if(e.startsWith(t)){const n=o[t];e=e.replace(t,n)}return e.startsWith("http://")||e.startsWith("https://")||(e=`${r}${e}`),e}const u=e=>"boolean"==typeof e,c=e=>"function"==typeof e,f=e=>null!==e&&"object"==typeof e,l=e=>f(e)&&e.constructor==={}.constructor,d=e=>f(e)&&c(e.then),h=e=>e&&"function"==typeof e[Symbol.iterator],p=e=>e&&"function"==typeof e[Symbol.asyncIterator],y=e=>e&&c(e.next),g=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,m=e=>"undefined"!=typeof Blob&&e instanceof Blob,w=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||f(e)&&c(e.tee)&&c(e.cancel)&&c(e.getReader))(e)||(e=>f(e)&&c(e.read)&&c(e.pipe)&&u(e.readable))(e),b=e=>(e=>f(e)&&c(e.abort)&&c(e.getWriter))(e)||(e=>f(e)&&c(e.end)&&c(e.write)&&u(e.writable))(e),v=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,_=/^([-\w.]+\/[-\w.+]+)/;function T(e){const t=_.exec(e);return t?t[1]:e}function x(e){const t=v.exec(e);return t?t[1]:""}const A=/\?.*/;function S(e){if(g(e)){const t=k(e.url||"");return{url:t,type:T(e.headers.get("content-type")||"")||x(t)}}return m(e)?{url:k(e.name||""),type:e.type||""}:"string"==typeof e?{url:k(e),type:x(e)}:{url:"",type:""}}function k(e){return e.replace(A,"")}async function L(e){if(g(e))return e;const t={},n=function(e){return g(e)?e.headers["content-length"]||-1:m(e)?e.size:"string"==typeof e?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}(e);n>=0&&(t["content-length"]=String(n));const{url:r,type:o}=S(e);o&&(t["content-type"]=o);const s=await async function(e){if("string"==typeof e)return"data:,"+e.slice(0,5);if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(e=>{const n=new FileReader;n.onload=t=>{var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=e.slice(0,5);return"data:base64,"+function(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.byteLength;e++)t+=String.fromCharCode(n[e]);return btoa(t)}(t)}return null}(e);s&&(t["x-first-bytes"]=s),"string"==typeof e&&(e=(new TextEncoder).encode(e));const i=new Response(e,{headers:t});return Object.defineProperty(i,"url",{value:r}),i}async function R(e){if(!e.ok){const t=await async function(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{const n=e.headers.get("Content-Type");let r=e.statusText;n.includes("application/json")&&(r+=" "+await e.text()),t+=r,t=t.length>60?t.slice(60)+"...":t}catch(e){}return t}(e);throw new Error(t)}}async function E(e,t){if("string"==typeof e){e=a(e);let n=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(n=t.fetch),await fetch(e,n)}return await L(e)}n(6);var B=n(11);async function j(e,t,n){if("number"==typeof e)return await B._readToArrayBuffer(e,t,n);e instanceof Blob||(e=new Blob([e]));const r=e.slice(t,t+n);return await async function(e){return await new Promise((t,n)=>{const r=new FileReader;r.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)})}(r)}var C=n(0),O=n(4);function P(e){return O.toBuffer?O.toBuffer(e):e}function M(e){var t;if((t=e)&&"object"==typeof t&&t.isBuffer&&(e=function(e){return O.toArrayBuffer?O.toArrayBuffer(e):e}(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return 0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if("string"==typeof e){const t=e;return(new TextEncoder).encode(t).buffer}if(e&&"object"==typeof e&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function F(...e){const t=e.map(e=>e instanceof ArrayBuffer?new Uint8Array(e):e),n=t.reduce((e,t)=>e+t.byteLength,0),r=new Uint8Array(n);let o=0;for(const e of t)r.set(e,o),o+=e.byteLength;return r.buffer}function I(e,t){if(!e)throw new Error(t||"loader assertion failed.")}function W(e,t={}){if(e=a(e),!C.c){const n=B.readFileSync(e,t);return"string"!=typeof n?M(n):n}return t.nothrow||I(!1),null}async function U(e,t,n){e=a(e),C.c||await B.writeFile(e,P(t),{flag:"w"}),I(!1)}function q(e,t,n){e=a(e),C.c||B.writeFileSync(e,P(t),{flag:"w"}),I(!1)}var N=n(13);const $=Object(N.a)();class D{constructor(e,t,n="sessionStorage"){this.storage=function(e){try{const t=window[e],n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch(e){return null}}(n),this.id=e,this.config={},Object.assign(this.config,t),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){return this.config={},this.updateConfiguration(e)}updateConfiguration(e){if(Object.assign(this.config,e),this.storage){const e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}}function z(e,t,n,r=600){const o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>r&&(n=Math.min(n,r/e.width));const s=e.width*n,i=e.height*n,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(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}const Q={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function H(e){return"string"==typeof e?Q[e.toUpperCase()]||Q.WHITE:e}function G(e,t){if(!e)throw new Error(t||"Assertion failed")}var J=n(1);function V(){let e;if($&&J.b.performance)e=J.b.performance.now();else if(J.a.hrtime){const t=J.a.hrtime();e=1e3*t[0]+t[1]/1e6}else e=Date.now();return e}const Y={debug:$&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},K={enabled:!0,level:0};function X(){}const Z={},ee={once:!0};function te(e){for(const t in e)for(const n in e[t])return n||"untitled";return"empty"}class ne{constructor({id:e}={id:""}){this.id=e,this.VERSION="3.0.14",this._startTs=V(),this._deltaTs=V(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new D("__probe-".concat(this.id,"__"),K),this.userData={},this.timeStamp("".concat(this.id," started")),function(e,t=["constructor"]){const n=Object.getPrototypeOf(e),r=Object.getOwnPropertyNames(n);for(const n of r)"function"==typeof e[n]&&(t.find(e=>n===e)||(e[n]=e[n].bind(e)))}(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((V()-this._startTs).toPrecision(10))}getDelta(){return Number((V()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.updateConfiguration({enabled:e}),this}setLevel(e){return this._storage.updateConfiguration({level:e}),this}assert(e,t){G(e,t)}warn(e){return this._getLogFunction(0,e,Y.warn,arguments,ee)}error(e){return this._getLogFunction(0,e,Y.error,arguments)}deprecated(e,t){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(e,t){return this.error("`".concat(e,"` has been removed. Use `").concat(t,"` instead"))}probe(e,t){return this._getLogFunction(e,t,Y.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Y.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Y.debug||Y.info,arguments,ee)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||X,n&&[n],{tag:te(t)}):X}image({logLevel:e,priority:t,image:r,message:o="",scale:s=1}){return this._shouldLog(e||t)?$?function({image:e,message:t="",scale:n=1}){if("string"==typeof e){const r=new Image;return r.onload=()=>{const e=z(r,t,n);console.log(...e)},r.src=e,X}const r=e.nodeName||"";if("img"===r.toLowerCase())return console.log(...z(e,t,n)),X;if("canvas"===r.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...z(r,t,n)),r.src=e.toDataURL(),X}return X}({image:r,message:o,scale:s}):function({image:e,message:t="",scale:r=1}){let o=null;try{o=n(23)}catch(e){}if(o)return()=>o(e,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(e=>console.log(e));return X}({image:r,message:o,scale:s}):X}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(e){return this._storage.config[e]}set(e,t){this._storage.updateConfiguration({[e]:t})}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||X)}group(e,t,n={collapsed:!1}){n=oe({logLevel:e,message:t,opts:n});const{collapsed:r}=n;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||X)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=re(e)}_getLogFunction(e,t,n,r=[],o){if(this._shouldLog(e)){o=oe({logLevel:e,message:t,args:r,opts:o}),G(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=V();const s=o.tag||o.message;if(o.once){if(Z[s])return X;Z[s]=V()}return t=function(e,t,n){if("string"==typeof t){const i=n.time?function(e,t=8){const n=Math.max(t-e.length,0);return"".concat(" ".repeat(n)).concat(e)}(function(e){let t;return t=e<10?"".concat(e.toFixed(2),"ms"):e<100?"".concat(e.toFixed(1),"ms"):e<1e3?"".concat(e.toFixed(0),"ms"):"".concat((e/1e3).toFixed(2),"s"),t}(n.total)):"";t=n.time?"".concat(e,": ").concat(i," ").concat(t):"".concat(e,": ").concat(t),r=t,o=n.color,s=n.background,$||"string"!=typeof r||(o&&(o=H(o),r="[".concat(o,"m").concat(r,"[39m")),s&&(o=H(s),r="[".concat(s+10,"m").concat(r,"[49m"))),t=r}var r,o,s;return t}(this.id,o.message,o),n.bind(console,t,...o.args)}return X}}function re(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 G(Number.isFinite(t)&&t>=0),t}function oe(e){const{logLevel:t,message:n}=e;e.logLevel=re(t);const r=e.args?Array.from(e.args):[];for(;r.length&&r.shift()!==n;);switch(e.args=r,typeof t){case"string":case"function":void 0!==n&&r.unshift(n),e.message=t;break;case"object":Object.assign(e,t)}"function"==typeof e.message&&(e.message=e.message());const o=typeof e.message;return G("string"===o||"object"===o),Object.assign(e,e.opts)}ne.VERSION="3.0.14";const se=new ne({id:"loaders.gl"});class ie{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const ae={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){var e,t,n;n=void 0,(t="console")in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},ue={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 ce(){C.b.loaders=C.b.loaders||{};const{loaders:e}=C.b;return e._state=e._state||{},e._state}const fe=()=>{const e=ce();return e.globalOptions=e.globalOptions||{...ae},e.globalOptions};function le(e,t,n,r){return n=n||[],function(e,t){he(e,null,ae,ue,t);for(const n of t){const r=e&&e[n.id]||{},o=n.options&&n.options[n.id]||{},s=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};he(r,n.id,o,s,t)}}(e,n=Array.isArray(n)?n:[n]),ye(t,e,r)}function de(e,t){const n=fe(),r=e||n;return"function"==typeof r.fetch?r.fetch:f(r.fetch)?e=>E(e,r):null!=t&&t.fetch?null==t?void 0:t.fetch:E}function he(e,t,n,r,o){const s=t||"Top level",i=t?t+".":"";for(const a in e){const u=!t&&f(e[a]),c="baseUri"===a&&!t,l="workerUrl"===a&&t;if(!(a in n)&&!c&&!l)if(a in r)se.warn(`${s} loader option '${i}${a}' no longer supported, use '${r[a]}'`)();else if(!u){const e=pe(a,o);se.warn(`${s} loader option '${i}${a}' not recognized. ${e}`)()}}}function pe(e,t){const n=e.toLowerCase();let r="";for(const o of t)for(const t in o.options){if(e===t)return`Did you mean '${o.id}.${t}'?`;const s=t.toLowerCase();(n.startsWith(s)||s.startsWith(n))&&(r=r||`Did you mean '${o.id}.${t}'?`)}return r}function ye(e,t,n){const r={...e.options||{}};return function(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}(r,n),null===r.log&&(r.log=new ie),ge(r,fe()),ge(r,t),r}function ge(e,t){for(const n in t)if(n in t){const r=t[n];l(r)&&l(e[n])?e[n]={...e[n],...t[n]}:e[n]=t[n]}}function me(e){!function(e){const t=ce(),n=fe();t.globalOptions=ye(n,e)}(e)}function we(e){var t;if(!e)return!1;Array.isArray(e)&&(e=e[0]);return Array.isArray(null===(t=e)||void 0===t?void 0:t.extensions)}function be(e){var t,n;let r;return I(e,"null loader"),I(we(e),"invalid loader"),Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(null!==(t=e)&&void 0!==t&&t.parseTextSync||null!==(n=e)&&void 0!==n&&n.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}const ve=()=>{const e=ce();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function _e(e){const t=ve();e=Array.isArray(e)?e:[e];for(const n of e){const e=be(n);t.find(t=>e===t)||t.unshift(e)}}function Te(){ce().loaderRegistry=[]}const xe=/\.([^.]+)$/;async function Ae(e,t=[],n,r){if(!ke(e))return null;let o=Se(e,t,{...n,nothrow:!0},r);if(o)return o;if(m(e)&&(o=Se(e=await e.slice(0,10).arrayBuffer(),t,n,r)),!(o||null!=n&&n.nothrow))throw new Error(Le(e));return o}function Se(e,t=[],n,r){if(!ke(e))return null;if(t&&!Array.isArray(t))return be(t);let o=[];t&&(o=o.concat(t)),null!=n&&n.ignoreRegisteredLoaders||o.push(...ve()),function(e){for(const t of e)be(t)}(o);const s=function(e,t,n,r){const{url:o,type:s}=S(e),i=o||(null==r?void 0:r.url);let a=null;null!=n&&n.mimeType&&(a=Re(t,null==n?void 0:n.mimeType));return a=a||function(e,t){const n=t&&xe.exec(t),r=n&&n[1];return r?function(e,t){t=t.toLowerCase();for(const n of e)for(const e of n.extensions)if(e.toLowerCase()===t)return n;return null}(e,r):null}(t,i),a=a||Re(t,s),a=a||function(e,t){if(!t)return null;for(const n of e)if("string"==typeof t){if(Ee(t,n))return n}else if(ArrayBuffer.isView(t)){if(Be(t.buffer,t.byteOffset,n))return n}else if(t instanceof ArrayBuffer){if(Be(t,0,n))return n}return null}(t,e),a=a||Re(t,null==n?void 0:n.fallbackMimeType),a}(e,o,n,r);if(!(s||null!=n&&n.nothrow))throw new Error(Le(e));return s}function ke(e){return!(e instanceof Response&&204===e.status)}function Le(e){const{url:t,type:n}=S(e);let r="No valid loader found";return e&&(r+=` data: "${function(e,t=5){if("string"==typeof e)return e.slice(0,t);if(ArrayBuffer.isView(e))return je(e.buffer,e.byteOffset,t);if(e instanceof ArrayBuffer){return je(e,0,t)}return""}(e)}", contentType: "${n}"`),t&&(r+=" url: "+t),r}function Re(e,t){for(const n of e){if(n.mimeTypes&&n.mimeTypes.includes(t))return n;if(t==="application/x."+n.id)return n}return null}function Ee(e,t){if(t.testText)return t.testText(e);return(Array.isArray(t.tests)?t.tests:[t.tests]).some(t=>e.startsWith(t))}function Be(e,t,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(r=>function(e,t,n,r){if(r instanceof ArrayBuffer)return function(e,t,n){if(n=n||e.byteLength,e.byteLength<n||t.byteLength<n)return!1;const r=new Uint8Array(e),o=new Uint8Array(t);for(let e=0;e<r.length;++e)if(r[e]!==o[e])return!1;return!0}(r,e,r.byteLength);switch(typeof r){case"function":return r(e,n);case"string":const o=je(e,t,r.length);return r===o;default:return!1}}(e,t,n,r))}function je(e,t,n){if(e.byteLength<t+n)return"";const r=new DataView(e);let o="";for(let e=0;e<n;e++)o+=String.fromCharCode(r.getUint8(t+e));return o}function Ce(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Oe=n(15);const Pe=new Map;function Me(e){Ce(e.source&&!e.url||!e.source&&e.url);let t=Pe.get(e.source||e.url);return t||(e.url&&(t=function(e){if(!e.startsWith("http"))return e;return Fe((t=e,`try {\n importScripts('${t}');\n} catch (error) {\n console.error(error);\n throw error;\n}`));var t}(e.url),Pe.set(e.url,t)),e.source&&(t=Fe(e.source),Pe.set(e.source,t))),Ce(t),t}function Fe(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function Ie(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}function We(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ue=()=>{};class qe{static isSupported(){return"undefined"!=typeof Worker}constructor(e){We(this,"name",void 0),We(this,"source",void 0),We(this,"url",void 0),We(this,"terminated",!1),We(this,"worker",void 0),We(this,"onMessage",void 0),We(this,"onError",void 0),We(this,"_loadableURL","");const{name:t,source:n,url:r}=e;Ce(n||r),this.name=t,this.source=n,this.url=r,this.onMessage=Ue,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=Ue,this.onError=Ue,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||function e(t,n=!0,r){const o=r||new Set;if(t){if(Ie(t))o.add(t);else if(Ie(t.buffer))o.add(t.buffer);else if(ArrayBuffer.isView(t));else if(n&&"object"==typeof t)for(const r in t)e(t[r],n,o)}else;return void 0===r?Array.from(o):[]}(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name}. `,e.message&&(t+=e.message+" in "),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=Me({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class $e{constructor(e,t){Ne(this,"name",void 0),Ne(this,"workerThread",void 0),Ne(this,"isRunning",void 0),Ne(this,"result",void 0),Ne(this,"_resolve",void 0),Ne(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Ce(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Ce(this.isRunning),this.isRunning=!1,this._reject(e)}}function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ze{constructor(e){De(this,"name","unnamed"),De(this,"source",void 0),De(this,"url",void 0),De(this,"maxConcurrency",1),De(this,"maxMobileConcurrency",1),De(this,"onDebug",()=>{}),De(this,"reuseWorkers",!0),De(this,"props",{}),De(this,"jobQueue",[]),De(this,"idleQueue",[]),De(this,"count",0),De(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(e,t=((e,t,n)=>e.done(n)),n=((e,t)=>e.error(t))){const r=new Promise(r=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:r}),this));return this._startQueuedJob(),await r}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new $e(t.name,e);e.onMessage=e=>t.onMessage(n,e.type,e.payload),e.onError=e=>t.onError(n,e),t.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new qe({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Oe.a?this.maxMobileConcurrency:this.maxConcurrency}}function Qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const He={maxConcurrency:3,maxMobileConcurrency:1,onDebug:()=>{},reuseWorkers:!0};class Ge{static isSupported(){return qe.isSupported()}static getWorkerFarm(e={}){return Ge._workerFarm=Ge._workerFarm||new Ge({}),Ge._workerFarm.setProps(e),Ge._workerFarm}constructor(e){Qe(this,"props",void 0),Qe(this,"workerPools",new Map),this.props={...He},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:n,url:r}=e;let o=this.workerPools.get(t);return o||(o=new ze({name:t,source:n,url:r}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Qe(Ge,"_workerFarm",void 0);async function Je(e,t,n,r,o){const s=e.id,i=function(e,t={}){const n=t[e.id]||{},r=e.id+"-worker.js";let o=n.workerUrl;if(o||"compression"!==e.id||(o=t.workerUrl),"test"===t._workerType&&(o=`modules/${e.module}/dist/${r}`),!o){let t=e.version;"latest"===t&&(t="latest");const n=t?"@"+t:"";o=`https://unpkg.com/@loaders.gl/${e.module}${n}/dist/${r}`}return Ce(o),o}(e,n),a=Ge.getWorkerFarm(n).getWorkerPool({name:s,url:i});n=JSON.parse(JSON.stringify(n));const u=await a.startJob("process-on-worker",Ve.bind(null,o));u.postMessage("process",{input:t,options:n});const c=await u.result;return await c.result}async function Ve(e,t,n,r){switch(n){case"done":t.done(r);break;case"error":t.error(r.error);break;case"process":const{id:o,input:s,options:i}=r;try{const n=await e(s,i);t.postMessage("done",{id:o,result:n})}catch(e){const n=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:o,error:n})}break;default:console.warn("parse-with-worker unknown message "+n)}}async function Ye(e,t){for(;;){const{done:n,value:r}=await e.next();if(n)return void e.return();if(t(r))return}}async function Ke(e){const t=[];for await(const n of e)t.push(n);return F(...t)}const Xe=262144;function Ze(e,t){return C.c?async function*(e,t){const n=e.getReader();let r;try{for(;;){const e=r||n.read();null!=t&&t._streamReadAhead&&(r=n.read());const{done:o,value:s}=await e;if(o)return;yield M(s)}}catch(e){n.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield M(t)}(e)}function et(e,t){if("string"==typeof e)return function*(e,t){const n=(null==t?void 0:t.chunkSize)||262144;let r=0;const o=new TextEncoder;for(;r<e.length;){const t=Math.min(e.length-r,n),s=e.slice(r,r+t);r+=t,yield o.encode(s)}}(e,t);if(e instanceof ArrayBuffer)return function*(e,t={}){const{chunkSize:n=Xe}=t;let r=0;for(;r<e.byteLength;){const t=Math.min(e.byteLength-r,n),o=new ArrayBuffer(t),s=new Uint8Array(e,r,t);new Uint8Array(o).set(s),r+=t,yield o}}(e,t);if(m(e))return async function*(e,t){const n=(null==t?void 0:t.chunkSize)||1048576;let r=0;for(;r<e.size;){const t=r+n,o=await e.slice(r,t).arrayBuffer();r=t,yield o}}(e,t);if(w(e))return Ze(e,t);if(g(e)){return Ze(e.body,t)}throw new Error("makeIterator")}const tt="Cannot convert supplied data type";function nt(e,t,n){if(t.text&&"string"==typeof e)return e;var r;if((r=e)&&"object"==typeof r&&r.isBuffer&&(e=e.buffer),e instanceof ArrayBuffer){const n=e;if(t.text&&!t.binary){return new TextDecoder("utf8").decode(n)}return n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary){return new TextDecoder("utf8").decode(e)}let n=e.buffer;const r=e.byteLength||e.length;return 0===e.byteOffset&&r===n.byteLength||(n=n.slice(e.byteOffset,e.byteOffset+r)),n}throw new Error(tt)}async function rt(e,t){if(y(e))return e;if(g(e)){const n=e;await R(n);return et(await n.body,t)}return m(e)||w(e)?et(e,t):p(e)?e[Symbol.asyncIterator]():function(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(y(e))return e;if(h(e))return e[Symbol.iterator]();throw new Error(tt)}(e)}function ot(e,t,n=null){if(n)return n;const r={fetch:de(t,e),...e};return Array.isArray(r.loaders)||(r.loaders=null),r}function st(e,t){if(!t&&e&&!Array.isArray(e))return e;let n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[...n,...e]:e}return n&&n.length?n:null}async function it(e,t,n,r){Ce(!r||"object"==typeof r),!t||Array.isArray(t)||we(t)||(r=void 0,n=t,t=void 0),e=await e,n=n||{};const{url:o}=S(e),s=st(t,r),i=await Ae(e,s,n);return i?(r=ot({url:o,parse:it,loaders:s},n=le(n,i,s,o),r),await async function(e,t,n,r){if(function(e,t="3.0.14"){Ce(e,"no worker provided");const n=e.version}(e),t=await async function(e,t,n){const r=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||r)return nt(e,t);if(m(e)&&(e=await L(e)),g(e)){const n=e;return await R(n),t.binary?await n.arrayBuffer():await n.text()}if(w(e)&&(e=et(e,n)),h(e)||p(e))return Ke(e);throw new Error(tt)}(t,e,n),e.parseTextSync&&"string"==typeof t)return n.dataType="text",e.parseTextSync(t,n,r,e);if(function(e,t){return!!Ge.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}(e,n))return await Je(e,t,n,0,it);if(e.parseText&&"string"==typeof t)return await e.parseText(t,n,r,e);if(e.parse)return await e.parse(t,n,r,e);throw Ce(!e.parseSync),new Error(e.id+" loader - no parser found and worker is disabled")}(i,e,n,r)):null}function at(e,t,n,r){I(!r||"object"==typeof r),Array.isArray(t)||we(t)||(r=void 0,n=t,t=void 0),n=n||{};const o=st(t,r),s=Se(e,o,n);if(!s)return null;n=le(n,s,o);const{url:i}=S(e);return function(e,t,n,r){if(t=nt(t,e),e.parseTextSync&&"string"==typeof t)return e.parseTextSync(t,n);if(e.parseSync&&t instanceof ArrayBuffer)return e.parseSync(t,n,r);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${r.url||""}`)}(s,e,n,r=ot({url:i,parseSync:at,parse:()=>{throw new Error("parseSync called parse")},loaders:t},n))}async function ut(e,t,n,r){I(!r||"object"==typeof r),Array.isArray(t)||we(t)||(r=void 0,n=t,t=void 0),e=await e,n=n||{};const{url:o}=S(e),s=await Ae(e,t,n);return s?(r=ot({url:o,parseInBatches:ut,parse:it,loaders:t},n=le(n,s,t,o),r),await async function(e,t,n,r){const o=await async function(e,t,n,r){const o=await rt(t,n),s=await async function(e,t=[]){let n=e;for await(const e of t)n=e(n);return n}(o,(null==n?void 0:n.transforms)||[]);if(e.parseInBatches)return e.parseInBatches(s,n,r);return async function*(){const t=await Ke(s),o=await it(t,e,{...n,mimeType:e.mimeTypes[0]},r),i={mimeType:e.mimeTypes[0],shape:Array.isArray(o)?"row-table":"unknown",batchType:"data",data:o,length:Array.isArray(o)?o.length:1};yield i}()}(e,t,n,r);if(!n.metadata)return o;const s={batchType:"metadata",metadata:{_loader:e,_context:r},data:[],bytesUsed:0};return async function*(e){yield s,yield*e}(o)}(s,e,n,r)):null}async function ct(e,t,n,r){Array.isArray(t)||we(t)||(void 0,n=t,t=void 0);const o=de(n);let s=e;return"string"==typeof e&&(s=await o(e)),m(e)&&(s=await o(e)),await it(s,t,n)}function ft(e,t,n,r){Array.isArray(t)||we(t)||(void 0,n=t,t=null);const o=de(n||{});if(!Array.isArray(e))return lt(e,t,n,o);return e.map(e=>lt(e,t,n,o))}async function lt(e,t,n,r){if("string"==typeof e){const o=e,s=await r(o);return await ut(s,t,n)}return await ut(e,t,n)}async function dt(e,t,n){if(t.encode)return await t.encode(e,n);if(t.encodeSync)return t.encodeSync(e,n);if(t.encodeText)return(new TextEncoder).encode(await t.encodeText(e,n));if(t.encodeInBatches){const r=yt(e,t,n),o=[];for await(const e of r)o.push(e);return F(...o)}if(!C.c&&t.encodeURLtoURL){const r=mt("input");await U(r,e);const o=mt("output"),s=await gt(r,o,t,n);return(await E(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function ht(e,t,n){if(t.encodeSync)return t.encodeSync(e,n);throw new Error("Writer could not synchronously encode data")}async function pt(e,t,n){if(t.text&&t.encodeText)return await t.encodeText(e,n);if(t.text&&(t.encode||t.encodeInBatches)){const r=await dt(e,t,n);return(new TextDecoder).decode(r)}throw new Error("Writer could not encode data as text")}function yt(e,t,n){if(t.encodeInBatches){const r=function(e){return[{table:e,start:0,end:e.length}]}(e);return t.encodeInBatches(r,n)}throw new Error("Writer could not encode data in batches")}async function gt(e,t,n,r){if(e=a(e),t=a(t),C.c||!n.encodeURLtoURL)throw new Error;return await n.encodeURLtoURL(e,t,r)}function mt(e){return"/tmp/"+e}async function wt(e,t,n,r){const o=await dt(e,n,r);return await U(t,o)}function bt(e,t,n,r){return q(t,ht(e,n,r))}var vt=n(3);class _t{constructor(e,t){this.name=e,this.type=t,this.sampleSize=1,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Object(vt.a)(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Object(vt.a)()-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}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}_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)}}class Tt{constructor({id:e,stats:t}){this.id=e,this.stats={},this._initializeStats(t),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:n}=e;return this.stats[t]||(this.stats[t]=e instanceof _t?e:new _t(t,n)),this.stats[t]}}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const At={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class St{constructor(e={}){xt(this,"props",void 0),xt(this,"stats",void 0),xt(this,"activeRequestCount",0),xt(this,"requestQueue",[]),xt(this,"requestMap",new Map),xt(this,"deferredUpdate",null),this.props={...At,...e},this.stats=new Tt({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(e,t=(()=>0)){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const n={handle:e,priority:0,getPriority:t},r=new Promise(e=>(n.resolve=e,n));return this.requestQueue.push(n),this.requestMap.set(e,r),this._issueNewRequests(),r}_issueRequest(e){const{handle:t,resolve:n}=e;let r=!1;const o=()=>{r||(r=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:o}):Promise.resolve({done:o})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this._updateAllRequests();for(let t=0;t<e;++t){const e=this.requestQueue.shift();e&&this._issueRequest(e)}}}_updateAllRequests(){const e=this.requestQueue;for(let t=0;t<e.length;++t){const n=e[t];this._updateRequest(n)||(e.splice(t,1),this.requestMap.delete(n.handle),t--)}e.sort((e,t)=>e.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}function kt(e,t){const n=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(e){try{const{done:t,value:r}=await n.next();t?e.close():e.enqueue(new Uint8Array(r))}catch(t){e.error(t)}},async cancel(){var e;await(null==n||null===(e=n.return)||void 0===e?void 0:e.call(n))}},{highWaterMark:2**24,...t})}var Lt=n(16),Rt=n.n(Lt);function Et(e,t){return C.c?kt(e,t):Rt()(e,t)}var Bt=n(12),jt=n.n(Bt);const Ct={name:"Null loader",id:"null",module:"core",version:"3.0.14",worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}},Ot={name:"Null loader",id:"null",module:"core",version:"3.0.14",mimeTypes:["application/x.empty"],extensions:["null"],parse:async e=>e,parseSync:e=>e,parseInBatches:async function*(e){for await(const t of e)yield t},tests:[()=>!1],options:{null:{}}},Pt={name:"JSON",id:"json",module:"json",version:"3.0.14",extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Mt,parse:async e=>Mt((new TextDecoder).decode(e)),options:{}};function Mt(e){return JSON.parse(e)}async function Ft(e,t,n=(()=>{}),r=(()=>{})){if(!(e=await e).ok)return e;const o=e.body;if(!o)return e;const s=e.headers.get("content-length")||0,i=s&&parseInt(s);if(!(s>0))return e;if("undefined"==typeof ReadableStream||!o.getReader)return e;const a=new ReadableStream({async start(e){const s=o.getReader();await async function e(t,n,r,o,s,i,a){try{const{done:u,value:c}=await n.read();if(u)return i(),void t.close();r+=c.byteLength;const f=Math.round(r/o*100);s(f,{loadedBytes:r,totalBytes:o}),t.enqueue(c),await e(t,n,r,o,s,i,a)}catch(e){t.error(e),a(e)}}(e,s,0,i,t,n,r)}});return new Response(a)}function It(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Wt{constructor(e,t){It(this,"_fetch",void 0),It(this,"files",{}),It(this,"lowerCaseFiles",{}),It(this,"usedFiles",{}),this._fetch=(null==t?void 0:t.fetch)||fetch;for(let t=0;t<e.length;++t){const n=e[t];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(e,t){if(e.includes("://"))return this._fetch(e,t);const n=this.files[e];if(!n)return new Response(e,{status:400,statusText:"NOT FOUND"});const r=new Headers(null==t?void 0:t.headers).get("Range"),o=r&&/bytes=($1)-($2)/.exec(r);if(o){const t=parseInt(o[1]),r=parseInt(o[2]),s=await n.slice(t,r).arrayBuffer(),i=new Response(s);return Object.defineProperty(i,"url",{value:e}),i}const s=new Response(n);return Object.defineProperty(s,"url",{value:e}),s}async readdir(e){const t=[];for(const e in this.files)t.push(e);return t}async stat(e,t){const n=this.files[e];if(!n)throw new Error(e);return{size:n.size}}async unlink(e){delete this.files[e],delete this.lowerCaseFiles[e],this.usedFiles[e]=!0}async open(e,t,n){return this.files[e]}async read(e,t,n=0,r=t.byteLength,o=null){const s=e;return{bytesRead:r,buffer:await s.slice(0,0+r).arrayBuffer()}}async close(e){}_getFile(e,t){const n=this.files[e]||this.lowerCaseFiles[e];return n&&t&&(this.usedFiles[e]=!0),n}}async function*Ut(e,t={}){const n=new TextDecoder(void 0,t);for await(const t of e)yield"string"==typeof t?t:n.decode(t,{stream:!0})}async function*qt(e){const t=new TextEncoder;for await(const n of e)yield"string"==typeof n?t.encode(n):n}async function*Nt(e){let t="";for await(const n of e){let e;for(t+=n;(e=t.indexOf("\n"))>=0;){const n=t.slice(0,e+1);t=t.slice(e+1),yield n}}t.length>0&&(yield t)}async function*$t(e){let t=1;for await(const n of e)yield{counter:t,line:n},t++}}])}));
|
|
2
2
|
//# sourceMappingURL=dist.min.js.map
|