@loaders.gl/core
Advanced tools
Comparing version 2.1.0-alpha.2 to 2.1.0-alpha.3
@@ -1,1 +0,1 @@ | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=5)}([,function(e,r){},function(e,r){},function(e,r){},function(e,r){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,r,t){(function(r){const n=t(7),o="undefined"==typeof window?r:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,n)}).call(this,t(4))},function(e,r){var t,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],f=!1,l=-1;function d(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&y())}function y(){if(!f){var e=u(d);f=!0;for(var r=c.length;r;){for(a=c,c=[];++l<r;)a&&a[l].run();l=-1,r=c.length}a=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(r){try{return n.call(null,e)}catch(r){return n.call(this,e)}}}(e)}}function h(e,r){this.fun=e,this.array=r}function p(){}o.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];c.push(new h(e,r)),1!==c.length||f||u(y)},h.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=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,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,r,t){"use strict";t.r(r);var n={};function o(e){const r=e&&e.lastIndexOf("/");return r>=0?e.substr(0,r):""}t.r(n),t.d(n,"dirname",(function(){return o}));let i="";const s={};function u(e){i=e}function a(){return i}function c(e){for(const r in s)if(e.startsWith(r)){const t=s[r];return e.replace(r,t)}return e+=i}const f=e=>"boolean"==typeof e,l=e=>"function"==typeof e,d=e=>null!==e&&"object"==typeof e,y=e=>d(e)&&l(e.then),h=e=>e&&"function"==typeof e[Symbol.iterator],p=e=>e&&"function"==typeof e[Symbol.asyncIterator],w=e=>e&&l(e.next),b=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,g=e=>(e=>"undefined"!=typeof File&&e instanceof File)(e)||(e=>"undefined"!=typeof Blob&&e instanceof Blob)(e),m=e=>e&&"object"==typeof e&&e.isBuffer,x=e=>(e=>d(e)&&l(e.tee)&&l(e.cancel)&&l(e.pipeTo)&&l(e.getReader))(e)||(e=>d(e)&&l(e.read)&&l(e.pipe)&&f(e.readable))(e),A=e=>(e=>d(e)&&l(e.abort)&&l(e.getWriter))(e)||(e=>d(e)&&l(e.end)&&l(e.write)&&f(e.writable))(e);function v(e,r){if(!e)throw new Error(r||"loader assertion failed.")}class S{constructor(e){this._fileOrBlob=e,this.bodyUsed=!1}get headers(){return new Headers({"Content-Length":this._fileOrBlob.size,"Content-Type":this._fileOrBlob.type})}get ok(){return!0}get status(){return 200}get url(){return this._fileOrBlob.name||""}async arrayBuffer(){const{reader:e,promise:r}=this._getFileReader();return e.readAsArrayBuffer(this._fileOrBlob),r}async text(){const{reader:e,promise:r}=this._getFileReader();return e.readAsText(this._fileOrBlob),r}async json(){const e=await this.text();return JSON.parse(e)}_getFileReader(){let e;v(!this.bodyUsed),this.bodyUsed=!0;const r=new Promise((r,t)=>{try{e=new FileReader,e.onerror=e=>t(new Error(e)),e.onabort=()=>t(new Error("Read aborted.")),e.onload=()=>r(e.result)}catch(e){t(e)}});return{reader:e,promise:r}}}function k(e,r){return Promise.resolve(new S(e,r))}async function B(e,r){return g(e)?k(e,r):(e=c(e),fetch(e,r))}var T=t(8),j=t(2);const O={dataType:"arraybuffer",nothrow:!0},_=e=>e.startsWith("data:");function I(e,r){return r=function(e={}){return(e=Object.assign({},O,e)).responseType=e.responseType||e.dataType,e}(r),_(e),r.nothrow||v(!1),null}function W(e,r={}){return e=c(e),!T.c&&j.readFileSync?j.readFileSync(e,r):I(e,r)}var P=t(1);function $(e,r,t){return e=c(e),!T.c&&P.writeFile?P.writeFile(e,r,t):v(!1)}function E(e,r,t){return e=c(e),!T.c&&P.writeFileSync?P.writeFileSync(e,r,t):v(!1)}function L(e){return`Failed to fetch resource ${e.url}(${e.status}): ${e.statusText} `}async function C(e){let r=`Failed to fetch resource ${e.url} (${e.status}): `;try{e.headers.get("Content-Type").includes("application/json")?r+=await e.text():r+=e.statusText}catch(e){return r}return r}class D{log(){return e=>{}}info(){return e=>{}}warn(){return e=>{}}error(){return e=>{}}}const M={CDN:"https://unpkg.com/@loaders.gl",worker:!0,log:new class{constructor(){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)}},dataType:"arraybuffer"},F=e=>e&&"object"==typeof e&&e.constructor==={}.constructor;let R={...M};function U(e,r,t){const n={...e&&(e.DEFAULT_LOADER_OPTIONS||e.defaultOptions||e.options||{})};return function(e,r){!r||"baseUri"in e||(e.baseUri=r)}(n,t),null===n.log&&(n.log=new D),Q(n,R),Q(n,r),n}function Q(e,r){for(const t in r)if(t in r){const n=r[t];F(n)&&F(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function N(e){!function(e){R=U(R,e)}(e)}function V(e){if(!e)return!1;Array.isArray(e)&&(e=e[0]);let r=e.parseTextSync||e.parseSync||e.parse||e.parseStream||e.parseInBatches;const t=e.options&&e.options[e.id];return r=r||t&&t.workerUrl,r}function J(e){let r;return v(e,"null loader"),v(V(e),"invalid loader"),Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),e.extension&&(e.extensions=e.extensions||e.extension,delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),v(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}let q=[];function z(e){e=Array.isArray(e)?e:[e];for(const r of e){const e=J(r);q.find(r=>e===r)||q.unshift(e)}}function H(){q=[]}const G="2.1.0-alpha.2";function K(e){const r=e.split(".").map(Number);return{major:r[0],minor:r[1]}}function X(e){if(T.c||T.e>=10){if("function"==typeof e[Symbol.asyncIterator])return e;if("function"==typeof e.getIterator)return e.getIterator()}return T.c?async function*(e){const r=e.getReader();try{for(;;){const{done:e,value:t}=await r.read();if(e)return;yield t}}catch(e){r.releaseLock()}}(e):async function*(e){e=await e;for(;;){const r=e.read();if(null===r){if(e._readableState.ended)return;await Y(e)}else yield r}}(e)}async function Y(e){return new Promise(r=>{e.once("readable",r)})}function Z(e,r){const t=e instanceof ArrayBuffer?new Uint8Array(e):e,n=r instanceof ArrayBuffer?new Uint8Array(r):r,o=new Uint8Array(t.byteLength+n.byteLength);return o.set(t,0),o.set(n,t.byteLength),o}async function ee(e,r){for(;;){const{done:t,value:n}=await e.next();if(t)return void e.return();if(r(n))return}}async function re(e){let r=new ArrayBuffer,t="";for await(const n of e)"string"==typeof n?t+=n:r=Z(r,n);return t||r}async function*te(e,r){const t=new TextDecoder(r);for await(const r of e)yield"string"==typeof r?r:t.decode(r,{stream:!0})}async function*ne(e){let r="";for await(const t of e){let e;for(r+=t;(e=r.indexOf("\n"))>=0;){const t=r.slice(0,e+1);r=r.slice(e+1),yield t}}r.length>0&&(yield r)}async function*oe(e){let r=1;for await(const t of e)yield{counter:r,line:t},r++}const ie="Cannot convert supplied data type";function se(e,r){if(r.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer){const t=e;if(r.text&&!r.binary){return new TextDecoder("utf8").decode(t)}return t}if(ArrayBuffer.isView(e)||m(e)){if(r.text&&!r.binary){return new TextDecoder("utf8").decode(e)}let t=e.buffer;const n=e.byteLength||e.length;return 0===e.byteOffset&&n===t.byteLength||(t=t.slice(e.byteOffset,e.byteOffset+n)),t}throw new Error(ie)}async function ue(e,r){const t=(e=await e)instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||t)return se(e,r);if(g(e)&&(e=await k(e)),b(e)){const t=e;return await async function(e){if(!e.ok){let r=`fetch failed ${e.status} `;try{r+=await e.text()}catch(e){}throw new Error(r)}}(t),r.binary?await t.arrayBuffer():await t.text()}if(x(e)&&(e=X(e)),h(e)||p(e))return re(e);throw new Error(ie)}function ae(e){return w(e)?e:b(e)&&e.body?(function(e){if(!e.ok)throw new Error(`fetch failed ${e.status}`)}(e),X(e.body)):x(e)?X(e):p(e)?e[Symbol.asyncIterator]():ce(e)}function ce(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return function*(){yield e.buffer||e}();if(w(e))return e;if(h(e))return e[Symbol.iterator]();throw new Error(ie)}function fe(e,r,t){return t||(e={fetch:e.fetch||B,...e},Array.isArray(e.loaders)||(e.loaders=null),e)}function le(e,r){if(!r&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){const e=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...e]:e}return t&&t.length?t:null}var de=t(3);function ye(e){if(de.toArrayBuffer&&(e=Object(de.toArrayBuffer)(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const r=e;return(new TextEncoder).encode(r).buffer}return v(!1)}const he=new Map;function pe(e){return!!e&&(e instanceof ArrayBuffer||e.buffer instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}function we(e,r=!0,t=[]){if(e){if(pe(e))t.push(e);else if(pe(e.buffer))t.push(e.buffer);else if(r&&"object"==typeof e)for(const n in e)we(e[n],r,t)}else;return t}let be=0;function ge({data:e,resolve:r}){r(e)}class me{constructor({source:e,name:r=`web-worker-${be++}`,onMessage:t}){const n=function(e,r="Worker"){if(v("string"==typeof e,"worker source"),e.startsWith("url(")&&e.endsWith(")")){const r=e.match(/^url\((.*)\)$/)[1];if(r&&!r.startsWith("http"))return r;e=function(e){return`try {\n importScripts('${e}');\n} catch (error) {\n console.error(error);\n}`}(r)}let t=he.get(e);if(!t){const r=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(r),he.set(e,t)}return t}(e,r);this.worker=new Worker(n,{name:r}),this.name=r,this.onMessage=t||ge}async process(e){return new Promise((r,t)=>{this.worker.onmessage=e=>this.onMessage({worker:this.worker,data:e.data,resolve:r,reject:t}),this.worker.onerror=e=>{let r=`${this.name}: WorkerThread.process() failed`;e.message&&(r+=` ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);const n=new Error(r);console.error(e),t(n)};const n=we(e);this.worker.postMessage(e,n)})}destroy(){this.worker.terminate(),this.worker=null}}class xe{constructor({source:e,name:r="unnamed",maxConcurrency:t=1,onMessage:n,onDebug:o=(()=>{})}){this.source=e,this.name=r,this.maxConcurrency=t,this.onMessage=n,this.onDebug=o,this.jobQueue=[],this.idleQueue=[],this.count=0,this.isDestroyed=!1}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}async process(e,r){return new Promise((t,n)=>{this.jobQueue.push({data:e,jobName:r,resolve:t,reject:n}),this._startQueuedJob()})}_startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const r=this.jobQueue.shift();this.onDebug({message:"processing",worker:e.name,job:r.jobName,backlog:this.jobQueue.length}),e.process(r.data).then(e=>r.resolve(e)).catch(e=>r.reject(e)).then(()=>this._onWorkerDone(e))}_onWorkerDone(e){this.isDestroyed?e.destroy():(this.idleQueue.push(e),this._startQueuedJob())}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift();if(this.count<this.maxConcurrency){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new me({source:this.source,onMessage:this.onMessage,name:e})}return null}}const Ae=5;class ve{static isSupported(){return"undefined"!=typeof Worker}constructor({maxConcurrency:e=Ae,onMessage:r,onDebug:t=(()=>{})}){this.maxConcurrency=e,this.onMessage=r,this.onDebug=t,this.workerPools=new Map}setProps(e){"maxConcurrency"in e&&(this.maxConcurrency=e.maxConcurrency),"onDebug"in e&&(this.onDebug=e.onDebug)}destroy(){this.workerPools.forEach(e=>e.destroy())}async process(e,r,t){return this._getWorkerPool(e,r).process(t)}_getWorkerPool(e,r){let t=this.workerPools.get(r);return t||(t=new xe({source:e,name:r,onMessage:this.onMessage,maxConcurrency:this.maxConcurrency,onDebug:this.onDebug}),this.workerPools.set(r,t)),t}}const Se="2.1.0-alpha.2";function ke(e,r,t,n){const{worker:o}=t||{},i=t&&t[e.id]||{},s=`url(${"local"===o?i.localWorkerUrl:i.workerUrl})`,u=e.name,a=function(e={}){const r={};e.maxConcurrency&&(r.maxConcurrency=e.maxConcurrency);e.onDebug&&(r.onDebug=e.onDebug);Be||(Be=new ve({onMessage:Te}));return Be.setProps(r),Be}(t);t=JSON.parse(JSON.stringify(t));const c=e.version!==Se?`(core version ${Se})`:"";return a.process(s,`${u}-worker@${e.version}${c}`,{arraybuffer:ye(r),options:t,source:`loaders.gl@${Se}`,type:"parse"})}let Be=null;async function Te({worker:e,data:r,resolve:t,reject:n}){switch(r.type){case"done":t(r.result);break;case"parse":try{const t=await Ee(r.arraybuffer,r.options,r.url);e.postMessage({type:"parse-done",id:r.id,result:t},we(t))}catch(t){e.postMessage({type:"parse-error",id:r.id,message:t.message})}break;case"error":n(r.message)}}const je=/\.([^.]+)$/,Oe=/^data:(.*?)(;|,)/;function _e(e,r="",t=null,{nothrow:n=!1}={}){if(r=r||"",e&&!Array.isArray(e)){const r=e;return J(r),r}!function(e){for(const r of e)J(r)}(e=[...e||[],...q]);let o=function(e,r){let t=r.match(Oe);const n=t&&t[1];if(n)return Ie(e,n);t=r.match(je);const o=t&&t[1];return o&&function(e,r){r=r.toLowerCase();for(const t of e)for(const e of t.extensions)if(e.toLowerCase()===r)return t;return null}(e,o)}(e,r=r.replace(/\?.*/,""));if(o=o||function(e,r){if(!r||!b(r)||!r.headers)return null;const t=r.headers.get("content-type");return Ie(e,t)}(e,t),o=o||function(e,r){if(!r)return null;for(const t of e)if("string"==typeof r){if(We(r,t))return t}else if(ArrayBuffer.isView(r)){if(Pe(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer){if(Pe(r,0,t))return t}return null}(e,t),!o){if(n)return null;let e="No valid loader found";throw t&&(e+=` for data starting with "${function(e,r=5){if("string"==typeof e)return e.slice(0,r);if(ArrayBuffer.isView(e))return $e(e.buffer,e.byteOffset,r);if(e instanceof ArrayBuffer){return $e(e,0,r)}return""}(t)}"`),r&&(e+=` for ${r}`),new Error(e)}return o}function Ie(e,r){for(const t of e)if(t.mimeTypes&&t.mimeTypes.includes(r))return t;return null}function We(e,r){return r.testText&&r.testText(e)}function Pe(e,r,t){switch(Array.isArray(t.test)?"array":typeof t.test){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(t=>{return t===$e(e,r,t.length)});default:return!1}}function $e(e,r,t){if(e.byteLength<=r+t)return"";const n=new DataView(e);let o="";for(let e=0;e<t;e++)o+=String.fromCharCode(n.getUint8(r+e));return o}async function Ee(e,r,t,n){!r||Array.isArray(r)||V(r)||(n=t,t=r,r=null);let o="";"string"==typeof n&&(o=n,n=null),t=t||{};const i=function(e,r){return b(e)?r=r||e.url:g(r)&&(r=r.name),"string"==typeof r?r.replace(/\?.*/,""):r}(e,o),s=le(r,n),u=_e(s,i,e);return u?(t=U(u,t,i),n=fe({url:i,parse:Ee,loaders:s},0,n),await async function(e,r,t,n){if(function(e,r=G){v(e,"no loader provided");let t=e.version;r&&t&&(r=K(r),t=K(t))}(e),r=await ue(r,e),e.parseTextSync&&"string"==typeof r)return t.dataType="text",e.parseTextSync(r,t,n,e);if(function(e,r,t,n){if(!ve.isSupported())return!1;const o=t&&t[e.id];return!!("local"===t.worker&&o&&o.localWorkerUrl||t.worker&&o&&o.workerUrl)&&(!e.useWorker||e.useWorker(t))}(e,0,t))return await ke(e,r,t);if(e.parse)return await e.parse(r,t,n,e);return v(!e.parseSync),v(!1)}(u,e,t,n)):null}function Le(e,r,t,n){Array.isArray(r)||V(r)||(n=t,t=r,r=null);let o="";"string"==typeof n&&(o=n,n=null),t=t||{};const i=_e(le(r,n),o,e);return i?function(e,r,t,n){if(r=se(r,e),e.parseTextSync&&"string"==typeof r)return e.parseTextSync(r,t,n,e);if(e.parseSync)return e.parseSync(r,t,n,e);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${n.url||""}`)}(i,e,t=U(i,t,o),n=fe({url:o,parseSync:Le,loaders:r})):null}async function Ce(e,r,t,n){Array.isArray(r)||V(r)||(n=t,t=r,r=null);const o=_e(r,n,null);return function(e,r,t,n){if(e.parseInBatches){let o=ae(r);return e.text&&(o=te(o)),e.parseInBatches(o,t,n,e)}throw new Error("parseWithLoaderInBatchesSync not available")}(o,e,t=U(o,t,n),fe({url:n,loaders:r}))}async function De(e,r,t,n){Array.isArray(r)||V(r)||(n=t,t=r,r=null);const o=_e(r,n,null);return function(e,r,t,n){if(e.parseInBatchesSync){const o=ce(r);return e.parseInBatchesSync(o,t,n,e)}throw new Error("parseWithLoaderInBatchesSync not available")}(o,e,t=U(o,t),fe({url:n,loaders:r}))}async function Me(e,r,t){Array.isArray(r)||V(r)||(t=r,r=null);let n=e;return"string"==typeof e?n=await B(e,t):e=null,g(e)&&(n=await B(e,t),e=null),await Ee(n,r,t,e)}async function Fe(e,r,t){return Ce(await B(e,t),r,t,e)}async function Re(e,r,t,n){if(r.encode)return await r.encode(e,t);if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not encode data")}function Ue(e,r,t,n){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}function Qe(e,r,t,n){if(r.encodeInBatches)return r.encodeInBatches(e,t);throw new Error("Writer could not encode data in batches")}function Ne(e,r,t,n){return $(r,Re(e,t,n))}function Ve(e,r,t,n){return E(r,Ue(e,t,n))}async function Je(e,r,t=(()=>{}),n=(()=>{})){if(!(e=await e).ok)return e;if(!e.body)return e;const o=e.headers.get("content-length"),i=o&&parseInt(o,10);if(!(o>0))return e;if("undefined"==typeof ReadableStream)return e;const s=new ReadableStream({start(o){!async function e(r,t,n,o,i,s,u){try{const{done:a,value:c}=await t.read();if(a)return s(),void r.close();n+=c.byteLength;const f=Math.round(n/o*100);i(f,{loadedBytes:n,totalBytes:o}),r.enqueue(c),await e(r,t,n,o,i,s,u)}catch(e){r.error(e),u(e)}}(o,e.body.getReader(),0,i,r,t,n)}});return new Response(s)}t.d(r,"path",(function(){return n})),t.d(r,"fetchFile",(function(){return B})),t.d(r,"readFileSync",(function(){return W})),t.d(r,"writeFile",(function(){return $})),t.d(r,"writeFileSync",(function(){return E})),t.d(r,"_getErrorMessageFromResponseSync",(function(){return L})),t.d(r,"_getErrorMessageFromResponse",(function(){return C})),t.d(r,"setLoaderOptions",(function(){return N})),t.d(r,"registerLoaders",(function(){return z})),t.d(r,"parse",(function(){return Ee})),t.d(r,"parseSync",(function(){return Le})),t.d(r,"parseInBatches",(function(){return Ce})),t.d(r,"parseInBatchesSync",(function(){return De})),t.d(r,"load",(function(){return Me})),t.d(r,"loadInBatches",(function(){return Fe})),t.d(r,"encode",(function(){return Re})),t.d(r,"encodeSync",(function(){return Ue})),t.d(r,"encodeInBatches",(function(){return Qe})),t.d(r,"save",(function(){return Ne})),t.d(r,"saveSync",(function(){return Ve})),t.d(r,"isPromise",(function(){return y})),t.d(r,"isIterable",(function(){return h})),t.d(r,"isAsyncIterable",(function(){return p})),t.d(r,"isIterator",(function(){return w})),t.d(r,"isFetchResponse",(function(){return b})),t.d(r,"isReadableStream",(function(){return x})),t.d(r,"isWritableStream",(function(){return A})),t.d(r,"toArrayBuffer",(function(){return ye})),t.d(r,"getStreamIterator",(function(){return X})),t.d(r,"forEach",(function(){return ee})),t.d(r,"concatenateAsyncIterator",(function(){return re})),t.d(r,"lineAsyncIterator",(function(){return ne})),t.d(r,"textDecoderAsyncIterator",(function(){return te})),t.d(r,"numberedLineAsyncIterator",(function(){return oe})),t.d(r,"isBrowser",(function(){return T.c})),t.d(r,"isWorker",(function(){return T.d})),t.d(r,"self",(function(){return T.f})),t.d(r,"window",(function(){return T.g})),t.d(r,"global",(function(){return T.b})),t.d(r,"document",(function(){return T.a})),t.d(r,"assert",(function(){return v})),t.d(r,"setPathPrefix",(function(){return u})),t.d(r,"getPathPrefix",(function(){return a})),t.d(r,"resolvePath",(function(){return c})),t.d(r,"_selectLoader",(function(){return _e})),t.d(r,"_WorkerThread",(function(){return me})),t.d(r,"_WorkerFarm",(function(){return ve})),t.d(r,"_WorkerPool",(function(){return xe})),t.d(r,"_fetchProgress",(function(){return Je})),t.d(r,"_unregisterLoaders",(function(){return H}))},function(e,r,t){"use strict";(function(e,n){t.d(r,"f",(function(){return i})),t.d(r,"g",(function(){return s})),t.d(r,"b",(function(){return u})),t.d(r,"a",(function(){return a})),t.d(r,"c",(function(){return c})),t.d(r,"d",(function(){return f})),t.d(r,"e",(function(){return d}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},i=o.self||o.window||o.global,s=o.window||o.self||o.global,u=o.global||o.self||o.window,a=o.document||{},c="object"!=typeof n||"[object process]"!==String(n)||n.browser,f="function"==typeof importScripts,l=void 0!==n&&n.version&&n.version.match(/v([0-9]*)/),d=l&&parseFloat(l[1])||0}).call(this,t(4),t(6))}])})); | ||
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=5)}([,function(e,r){},function(e,r){},function(e,r){},function(e,r){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,r,t){(function(r){const n=t(7),o="undefined"==typeof window?r:window;o.loaders=o.loaders||{},e.exports=Object.assign(o.loaders,n)}).call(this,t(4))},function(e,r){var t,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],f=!1,l=-1;function d(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&y())}function y(){if(!f){var e=u(d);f=!0;for(var r=c.length;r;){for(a=c,c=[];++l<r;)a&&a[l].run();l=-1,r=c.length}a=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(r){try{return n.call(null,e)}catch(r){return n.call(this,e)}}}(e)}}function h(e,r){this.fun=e,this.array=r}function p(){}o.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];c.push(new h(e,r)),1!==c.length||f||u(y)},h.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=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,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,r,t){"use strict";t.r(r);var n={};function o(e){const r=e&&e.lastIndexOf("/");return r>=0?e.substr(0,r):""}t.r(n),t.d(n,"dirname",(function(){return o}));let i="";const s={};function u(e){i=e}function a(){return i}function c(e){for(const r in s)if(e.startsWith(r)){const t=s[r];return e.replace(r,t)}return e+=i}const f=e=>"boolean"==typeof e,l=e=>"function"==typeof e,d=e=>null!==e&&"object"==typeof e,y=e=>d(e)&&l(e.then),h=e=>e&&"function"==typeof e[Symbol.iterator],p=e=>e&&"function"==typeof e[Symbol.asyncIterator],w=e=>e&&l(e.next),b=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,g=e=>(e=>"undefined"!=typeof File&&e instanceof File)(e)||(e=>"undefined"!=typeof Blob&&e instanceof Blob)(e),m=e=>e&&"object"==typeof e&&e.isBuffer,x=e=>(e=>d(e)&&l(e.tee)&&l(e.cancel)&&l(e.pipeTo)&&l(e.getReader))(e)||(e=>d(e)&&l(e.read)&&l(e.pipe)&&f(e.readable))(e),A=e=>(e=>d(e)&&l(e.abort)&&l(e.getWriter))(e)||(e=>d(e)&&l(e.end)&&l(e.write)&&f(e.writable))(e);function v(e,r){if(!e)throw new Error(r||"loader assertion failed.")}class S{constructor(e){this._fileOrBlob=e,this.bodyUsed=!1}get headers(){return new Headers({"Content-Length":this._fileOrBlob.size,"Content-Type":this._fileOrBlob.type})}get ok(){return!0}get status(){return 200}get url(){return this._fileOrBlob.name||""}async arrayBuffer(){const{reader:e,promise:r}=this._getFileReader();return e.readAsArrayBuffer(this._fileOrBlob),r}async text(){const{reader:e,promise:r}=this._getFileReader();return e.readAsText(this._fileOrBlob),r}async json(){const e=await this.text();return JSON.parse(e)}_getFileReader(){let e;v(!this.bodyUsed),this.bodyUsed=!0;const r=new Promise((r,t)=>{try{e=new FileReader,e.onerror=e=>t(new Error(e)),e.onabort=()=>t(new Error("Read aborted.")),e.onload=()=>r(e.result)}catch(e){t(e)}});return{reader:e,promise:r}}}function k(e,r){return Promise.resolve(new S(e,r))}async function B(e,r){return g(e)?k(e,r):(e=c(e),fetch(e,r))}var T=t(8),j=t(2);const O={dataType:"arraybuffer",nothrow:!0},_=e=>e.startsWith("data:");function I(e,r){return r=function(e={}){return(e=Object.assign({},O,e)).responseType=e.responseType||e.dataType,e}(r),_(e),r.nothrow||v(!1),null}function W(e,r={}){return e=c(e),!T.c&&j.readFileSync?j.readFileSync(e,r):I(e,r)}var P=t(1);function $(e,r,t){return e=c(e),!T.c&&P.writeFile?P.writeFile(e,r,t):v(!1)}function E(e,r,t){return e=c(e),!T.c&&P.writeFileSync?P.writeFileSync(e,r,t):v(!1)}function L(e){return`Failed to fetch resource ${e.url}(${e.status}): ${e.statusText} `}async function C(e){let r=`Failed to fetch resource ${e.url} (${e.status}): `;try{e.headers.get("Content-Type").includes("application/json")?r+=await e.text():r+=e.statusText}catch(e){return r}return r}class D{log(){return e=>{}}info(){return e=>{}}warn(){return e=>{}}error(){return e=>{}}}const M={CDN:"https://unpkg.com/@loaders.gl",worker:!0,log:new class{constructor(){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)}},dataType:"arraybuffer"},F=e=>e&&"object"==typeof e&&e.constructor==={}.constructor;let R={...M};function U(e,r,t){const n={...e&&(e.DEFAULT_LOADER_OPTIONS||e.defaultOptions||e.options||{})};return function(e,r){!r||"baseUri"in e||(e.baseUri=r)}(n,t),null===n.log&&(n.log=new D),Q(n,R),Q(n,r),n}function Q(e,r){for(const t in r)if(t in r){const n=r[t];F(n)&&F(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function N(e){!function(e){R=U(R,e)}(e)}function V(e){if(!e)return!1;Array.isArray(e)&&(e=e[0]);let r=e.parseTextSync||e.parseSync||e.parse||e.parseStream||e.parseInBatches;const t=e.options&&e.options[e.id];return r=r||t&&t.workerUrl,r}function J(e){let r;return v(e,"null loader"),v(V(e),"invalid loader"),Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),e.extension&&(e.extensions=e.extensions||e.extension,delete e.extension),Array.isArray(e.extensions)||(e.extensions=[e.extensions]),v(e.extensions&&e.extensions.length>0&&e.extensions[0]),e.parseTextSync&&(e.text=!0),e.text||(e.binary=!0),e}let q=[];function z(e){e=Array.isArray(e)?e:[e];for(const r of e){const e=J(r);q.find(r=>e===r)||q.unshift(e)}}function H(){q=[]}const G="2.1.0-alpha.3";function K(e){const r=e.split(".").map(Number);return{major:r[0],minor:r[1]}}function X(e){if(T.c||T.e>=10){if("function"==typeof e[Symbol.asyncIterator])return e;if("function"==typeof e.getIterator)return e.getIterator()}return T.c?async function*(e){const r=e.getReader();try{for(;;){const{done:e,value:t}=await r.read();if(e)return;yield t}}catch(e){r.releaseLock()}}(e):async function*(e){e=await e;for(;;){const r=e.read();if(null===r){if(e._readableState.ended)return;await Y(e)}else yield r}}(e)}async function Y(e){return new Promise(r=>{e.once("readable",r)})}function Z(e,r){const t=e instanceof ArrayBuffer?new Uint8Array(e):e,n=r instanceof ArrayBuffer?new Uint8Array(r):r,o=new Uint8Array(t.byteLength+n.byteLength);return o.set(t,0),o.set(n,t.byteLength),o}async function ee(e,r){for(;;){const{done:t,value:n}=await e.next();if(t)return void e.return();if(r(n))return}}async function re(e){let r=new ArrayBuffer,t="";for await(const n of e)"string"==typeof n?t+=n:r=Z(r,n);return t||r}async function*te(e,r){const t=new TextDecoder(r);for await(const r of e)yield"string"==typeof r?r:t.decode(r,{stream:!0})}async function*ne(e){let r="";for await(const t of e){let e;for(r+=t;(e=r.indexOf("\n"))>=0;){const t=r.slice(0,e+1);r=r.slice(e+1),yield t}}r.length>0&&(yield r)}async function*oe(e){let r=1;for await(const t of e)yield{counter:r,line:t},r++}const ie="Cannot convert supplied data type";function se(e,r){if(r.text&&"string"==typeof e)return e;if(e instanceof ArrayBuffer){const t=e;if(r.text&&!r.binary){return new TextDecoder("utf8").decode(t)}return t}if(ArrayBuffer.isView(e)||m(e)){if(r.text&&!r.binary){return new TextDecoder("utf8").decode(e)}let t=e.buffer;const n=e.byteLength||e.length;return 0===e.byteOffset&&n===t.byteLength||(t=t.slice(e.byteOffset,e.byteOffset+n)),t}throw new Error(ie)}async function ue(e,r){const t=(e=await e)instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||t)return se(e,r);if(g(e)&&(e=await k(e)),b(e)){const t=e;return await async function(e){if(!e.ok){let r=`fetch failed ${e.status} `;try{r+=await e.text()}catch(e){}throw new Error(r)}}(t),r.binary?await t.arrayBuffer():await t.text()}if(x(e)&&(e=X(e)),h(e)||p(e))return re(e);throw new Error(ie)}function ae(e){return w(e)?e:b(e)&&e.body?(function(e){if(!e.ok)throw new Error(`fetch failed ${e.status}`)}(e),X(e.body)):x(e)?X(e):p(e)?e[Symbol.asyncIterator]():ce(e)}function ce(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return function*(){yield e.buffer||e}();if(w(e))return e;if(h(e))return e[Symbol.iterator]();throw new Error(ie)}function fe(e,r,t){return t||(e={fetch:e.fetch||B,...e},Array.isArray(e.loaders)||(e.loaders=null),e)}function le(e,r){if(!r&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){const e=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...e]:e}return t&&t.length?t:null}var de=t(3);function ye(e){if(de.toArrayBuffer&&(e=Object(de.toArrayBuffer)(e)),e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.buffer;if("string"==typeof e){const r=e;return(new TextEncoder).encode(r).buffer}return v(!1)}const he=new Map;function pe(e){return!!e&&(e instanceof ArrayBuffer||e.buffer instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}function we(e,r=!0,t=[]){if(e){if(pe(e))t.push(e);else if(pe(e.buffer))t.push(e.buffer);else if(r&&"object"==typeof e)for(const n in e)we(e[n],r,t)}else;return t}let be=0;function ge({data:e,resolve:r}){r(e)}class me{constructor({source:e,name:r=`web-worker-${be++}`,onMessage:t}){const n=function(e,r="Worker"){if(v("string"==typeof e,"worker source"),e.startsWith("url(")&&e.endsWith(")")){const r=e.match(/^url\((.*)\)$/)[1];if(r&&!r.startsWith("http"))return r;e=function(e){return`try {\n importScripts('${e}');\n} catch (error) {\n console.error(error);\n}`}(r)}let t=he.get(e);if(!t){const r=new Blob([e],{type:"application/javascript"});t=URL.createObjectURL(r),he.set(e,t)}return t}(e,r);this.worker=new Worker(n,{name:r}),this.name=r,this.onMessage=t||ge}async process(e){return new Promise((r,t)=>{this.worker.onmessage=e=>this.onMessage({worker:this.worker,data:e.data,resolve:r,reject:t}),this.worker.onerror=e=>{let r=`${this.name}: WorkerThread.process() failed`;e.message&&(r+=` ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);const n=new Error(r);console.error(e),t(n)};const n=we(e);this.worker.postMessage(e,n)})}destroy(){this.worker.terminate(),this.worker=null}}class xe{constructor({source:e,name:r="unnamed",maxConcurrency:t=1,onMessage:n,onDebug:o=(()=>{})}){this.source=e,this.name=r,this.maxConcurrency=t,this.onMessage=n,this.onDebug=o,this.jobQueue=[],this.idleQueue=[],this.count=0,this.isDestroyed=!1}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}async process(e,r){return new Promise((t,n)=>{this.jobQueue.push({data:e,jobName:r,resolve:t,reject:n}),this._startQueuedJob()})}_startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const r=this.jobQueue.shift();this.onDebug({message:"processing",worker:e.name,job:r.jobName,backlog:this.jobQueue.length}),e.process(r.data).then(e=>r.resolve(e)).catch(e=>r.reject(e)).then(()=>this._onWorkerDone(e))}_onWorkerDone(e){this.isDestroyed?e.destroy():(this.idleQueue.push(e),this._startQueuedJob())}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift();if(this.count<this.maxConcurrency){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new me({source:this.source,onMessage:this.onMessage,name:e})}return null}}const Ae=5;class ve{static isSupported(){return"undefined"!=typeof Worker}constructor({maxConcurrency:e=Ae,onMessage:r,onDebug:t=(()=>{})}){this.maxConcurrency=e,this.onMessage=r,this.onDebug=t,this.workerPools=new Map}setProps(e){"maxConcurrency"in e&&(this.maxConcurrency=e.maxConcurrency),"onDebug"in e&&(this.onDebug=e.onDebug)}destroy(){this.workerPools.forEach(e=>e.destroy())}async process(e,r,t){return this._getWorkerPool(e,r).process(t)}_getWorkerPool(e,r){let t=this.workerPools.get(r);return t||(t=new xe({source:e,name:r,onMessage:this.onMessage,maxConcurrency:this.maxConcurrency,onDebug:this.onDebug}),this.workerPools.set(r,t)),t}}const Se="2.1.0-alpha.3";function ke(e,r,t,n){const{worker:o}=t||{},i=t&&t[e.id]||{},s=`url(${"local"===o?i.localWorkerUrl:i.workerUrl})`,u=e.name,a=function(e={}){const r={};e.maxConcurrency&&(r.maxConcurrency=e.maxConcurrency);e.onDebug&&(r.onDebug=e.onDebug);Be||(Be=new ve({onMessage:Te}));return Be.setProps(r),Be}(t);t=JSON.parse(JSON.stringify(t));const c=e.version!==Se?`(core version ${Se})`:"";return a.process(s,`${u}-worker@${e.version}${c}`,{arraybuffer:ye(r),options:t,source:`loaders.gl@${Se}`,type:"parse"})}let Be=null;async function Te({worker:e,data:r,resolve:t,reject:n}){switch(r.type){case"done":t(r.result);break;case"parse":try{const t=await Ee(r.arraybuffer,r.options,r.url);e.postMessage({type:"parse-done",id:r.id,result:t},we(t))}catch(t){e.postMessage({type:"parse-error",id:r.id,message:t.message})}break;case"error":n(r.message)}}const je=/\.([^.]+)$/,Oe=/^data:(.*?)(;|,)/;function _e(e,r="",t=null,{nothrow:n=!1}={}){if(r=r||"",e&&!Array.isArray(e)){const r=e;return J(r),r}!function(e){for(const r of e)J(r)}(e=[...e||[],...q]);let o=function(e,r){let t=r.match(Oe);const n=t&&t[1];if(n)return Ie(e,n);t=r.match(je);const o=t&&t[1];return o&&function(e,r){r=r.toLowerCase();for(const t of e)for(const e of t.extensions)if(e.toLowerCase()===r)return t;return null}(e,o)}(e,r=r.replace(/\?.*/,""));if(o=o||function(e,r){if(!r||!b(r)||!r.headers)return null;const t=r.headers.get("content-type");return Ie(e,t)}(e,t),o=o||function(e,r){if(!r)return null;for(const t of e)if("string"==typeof r){if(We(r,t))return t}else if(ArrayBuffer.isView(r)){if(Pe(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer){if(Pe(r,0,t))return t}return null}(e,t),!o){if(n)return null;let e="No valid loader found";throw t&&(e+=` for data starting with "${function(e,r=5){if("string"==typeof e)return e.slice(0,r);if(ArrayBuffer.isView(e))return $e(e.buffer,e.byteOffset,r);if(e instanceof ArrayBuffer){return $e(e,0,r)}return""}(t)}"`),r&&(e+=` for ${r}`),new Error(e)}return o}function Ie(e,r){for(const t of e)if(t.mimeTypes&&t.mimeTypes.includes(r))return t;return null}function We(e,r){return r.testText&&r.testText(e)}function Pe(e,r,t){switch(Array.isArray(t.test)?"array":typeof t.test){case"function":return t.test(e,t);case"string":case"array":return(Array.isArray(t.test)?t.test:[t.test]).some(t=>{return t===$e(e,r,t.length)});default:return!1}}function $e(e,r,t){if(e.byteLength<=r+t)return"";const n=new DataView(e);let o="";for(let e=0;e<t;e++)o+=String.fromCharCode(n.getUint8(r+e));return o}async function Ee(e,r,t,n){!r||Array.isArray(r)||V(r)||(n=t,t=r,r=null);let o="";"string"==typeof n&&(o=n,n=null),t=t||{};const i=function(e,r){return b(e)?r=r||e.url:g(r)&&(r=r.name),"string"==typeof r?r.replace(/\?.*/,""):r}(e,o),s=le(r,n),u=_e(s,i,e);return u?(t=U(u,t,i),n=fe({url:i,parse:Ee,loaders:s},0,n),await async function(e,r,t,n){if(function(e,r=G){v(e,"no loader provided");let t=e.version;r&&t&&(r=K(r),t=K(t))}(e),r=await ue(r,e),e.parseTextSync&&"string"==typeof r)return t.dataType="text",e.parseTextSync(r,t,n,e);if(function(e,r,t,n){if(!ve.isSupported())return!1;const o=t&&t[e.id];return!!("local"===t.worker&&o&&o.localWorkerUrl||t.worker&&o&&o.workerUrl)&&(!e.useWorker||e.useWorker(t))}(e,0,t))return await ke(e,r,t);if(e.parse)return await e.parse(r,t,n,e);return v(!e.parseSync),v(!1)}(u,e,t,n)):null}function Le(e,r,t,n){Array.isArray(r)||V(r)||(n=t,t=r,r=null);let o="";"string"==typeof n&&(o=n,n=null),t=t||{};const i=_e(le(r,n),o,e);return i?function(e,r,t,n){if(r=se(r,e),e.parseTextSync&&"string"==typeof r)return e.parseTextSync(r,t,n,e);if(e.parseSync)return e.parseSync(r,t,n,e);throw new Error(`${e.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${n.url||""}`)}(i,e,t=U(i,t,o),n=fe({url:o,parseSync:Le,loaders:r})):null}async function Ce(e,r,t,n){Array.isArray(r)||V(r)||(n=t,t=r,r=null);const o=_e(r,n,null);return function(e,r,t,n){if(e.parseInBatches){let o=ae(r);return e.text&&(o=te(o)),e.parseInBatches(o,t,n,e)}throw new Error("parseWithLoaderInBatchesSync not available")}(o,e,t=U(o,t,n),fe({url:n,loaders:r}))}async function De(e,r,t,n){Array.isArray(r)||V(r)||(n=t,t=r,r=null);const o=_e(r,n,null);return function(e,r,t,n){if(e.parseInBatchesSync){const o=ce(r);return e.parseInBatchesSync(o,t,n,e)}throw new Error("parseWithLoaderInBatchesSync not available")}(o,e,t=U(o,t),fe({url:n,loaders:r}))}async function Me(e,r,t){Array.isArray(r)||V(r)||(t=r,r=null);let n=e;return"string"==typeof e?n=await B(e,t):e=null,g(e)&&(n=await B(e,t),e=null),await Ee(n,r,t,e)}async function Fe(e,r,t){return Ce(await B(e,t),r,t,e)}async function Re(e,r,t,n){if(r.encode)return await r.encode(e,t);if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not encode data")}function Ue(e,r,t,n){if(r.encodeSync)return r.encodeSync(e,t);throw new Error("Writer could not synchronously encode data")}function Qe(e,r,t,n){if(r.encodeInBatches)return r.encodeInBatches(e,t);throw new Error("Writer could not encode data in batches")}function Ne(e,r,t,n){return $(r,Re(e,t,n))}function Ve(e,r,t,n){return E(r,Ue(e,t,n))}async function Je(e,r,t=(()=>{}),n=(()=>{})){if(!(e=await e).ok)return e;if(!e.body)return e;const o=e.headers.get("content-length"),i=o&&parseInt(o,10);if(!(o>0))return e;if("undefined"==typeof ReadableStream)return e;const s=new ReadableStream({start(o){!async function e(r,t,n,o,i,s,u){try{const{done:a,value:c}=await t.read();if(a)return s(),void r.close();n+=c.byteLength;const f=Math.round(n/o*100);i(f,{loadedBytes:n,totalBytes:o}),r.enqueue(c),await e(r,t,n,o,i,s,u)}catch(e){r.error(e),u(e)}}(o,e.body.getReader(),0,i,r,t,n)}});return new Response(s)}t.d(r,"path",(function(){return n})),t.d(r,"fetchFile",(function(){return B})),t.d(r,"readFileSync",(function(){return W})),t.d(r,"writeFile",(function(){return $})),t.d(r,"writeFileSync",(function(){return E})),t.d(r,"_getErrorMessageFromResponseSync",(function(){return L})),t.d(r,"_getErrorMessageFromResponse",(function(){return C})),t.d(r,"setLoaderOptions",(function(){return N})),t.d(r,"registerLoaders",(function(){return z})),t.d(r,"parse",(function(){return Ee})),t.d(r,"parseSync",(function(){return Le})),t.d(r,"parseInBatches",(function(){return Ce})),t.d(r,"parseInBatchesSync",(function(){return De})),t.d(r,"load",(function(){return Me})),t.d(r,"loadInBatches",(function(){return Fe})),t.d(r,"encode",(function(){return Re})),t.d(r,"encodeSync",(function(){return Ue})),t.d(r,"encodeInBatches",(function(){return Qe})),t.d(r,"save",(function(){return Ne})),t.d(r,"saveSync",(function(){return Ve})),t.d(r,"isPromise",(function(){return y})),t.d(r,"isIterable",(function(){return h})),t.d(r,"isAsyncIterable",(function(){return p})),t.d(r,"isIterator",(function(){return w})),t.d(r,"isFetchResponse",(function(){return b})),t.d(r,"isReadableStream",(function(){return x})),t.d(r,"isWritableStream",(function(){return A})),t.d(r,"toArrayBuffer",(function(){return ye})),t.d(r,"getStreamIterator",(function(){return X})),t.d(r,"forEach",(function(){return ee})),t.d(r,"concatenateAsyncIterator",(function(){return re})),t.d(r,"lineAsyncIterator",(function(){return ne})),t.d(r,"textDecoderAsyncIterator",(function(){return te})),t.d(r,"numberedLineAsyncIterator",(function(){return oe})),t.d(r,"isBrowser",(function(){return T.c})),t.d(r,"isWorker",(function(){return T.d})),t.d(r,"self",(function(){return T.f})),t.d(r,"window",(function(){return T.g})),t.d(r,"global",(function(){return T.b})),t.d(r,"document",(function(){return T.a})),t.d(r,"assert",(function(){return v})),t.d(r,"setPathPrefix",(function(){return u})),t.d(r,"getPathPrefix",(function(){return a})),t.d(r,"resolvePath",(function(){return c})),t.d(r,"_selectLoader",(function(){return _e})),t.d(r,"_WorkerThread",(function(){return me})),t.d(r,"_WorkerFarm",(function(){return ve})),t.d(r,"_WorkerPool",(function(){return xe})),t.d(r,"_fetchProgress",(function(){return Je})),t.d(r,"_unregisterLoaders",(function(){return H}))},function(e,r,t){"use strict";(function(e,n){t.d(r,"f",(function(){return i})),t.d(r,"g",(function(){return s})),t.d(r,"b",(function(){return u})),t.d(r,"a",(function(){return a})),t.d(r,"c",(function(){return c})),t.d(r,"d",(function(){return f})),t.d(r,"e",(function(){return d}));const o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document},i=o.self||o.window||o.global,s=o.window||o.self||o.global,u=o.global||o.self||o.window,a=o.document||{},c="object"!=typeof n||"[object process]"!==String(n)||n.browser,f="function"==typeof importScripts,l=void 0!==n&&n.version&&n.version.match(/v([0-9]*)/),d=l&&parseFloat(l[1])||0}).call(this,t(4),t(6))}])})); |
@@ -23,3 +23,3 @@ "use strict"; | ||
var VERSION = typeof "2.1.0-alpha.2" !== 'undefined' ? "2.1.0-alpha.2" : 'latest'; | ||
var VERSION = typeof "2.1.0-alpha.3" !== 'undefined' ? "2.1.0-alpha.3" : 'latest'; | ||
@@ -26,0 +26,0 @@ function canParseWithWorker(loader, data, options, context) { |
@@ -5,3 +5,3 @@ import { toArrayBuffer } from '../../javascript-utils/binary-utils'; | ||
import { parse } from '../parse'; | ||
const VERSION = typeof "2.1.0-alpha.2" !== 'undefined' ? "2.1.0-alpha.2" : 'latest'; | ||
const VERSION = typeof "2.1.0-alpha.3" !== 'undefined' ? "2.1.0-alpha.3" : 'latest'; | ||
export function canParseWithWorker(loader, data, options, context) { | ||
@@ -8,0 +8,0 @@ if (!WorkerFarm.isSupported()) { |
@@ -7,3 +7,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import { parse } from '../parse'; | ||
var VERSION = typeof "2.1.0-alpha.2" !== 'undefined' ? "2.1.0-alpha.2" : 'latest'; | ||
var VERSION = typeof "2.1.0-alpha.3" !== 'undefined' ? "2.1.0-alpha.3" : 'latest'; | ||
export function canParseWithWorker(loader, data, options, context) { | ||
@@ -10,0 +10,0 @@ if (!WorkerFarm.isSupported()) { |
{ | ||
"name": "@loaders.gl/core", | ||
"version": "2.1.0-alpha.2", | ||
"version": "2.1.0-alpha.3", | ||
"description": "Framework-independent loaders for 3D graphics formats", | ||
@@ -54,5 +54,5 @@ "license": "MIT", | ||
"@babel/runtime": "^7.3.1", | ||
"@loaders.gl/loader-utils": "2.1.0-alpha.2" | ||
"@loaders.gl/loader-utils": "2.1.0-alpha.3" | ||
}, | ||
"gitHead": "5cfbf4e3e41ea3b0b5974cc9be9154c2defc77f1" | ||
"gitHead": "afb026d1d61ec2634a293adbc125f17f4964d6eb" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
+ Added@loaders.gl/loader-utils@2.1.0-alpha.3(transitive)
- Removed@loaders.gl/loader-utils@2.1.0-alpha.2(transitive)