@loaders.gl/core 3.3.2 → 3.4.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/dist.min.js +242 -186
  2. package/dist/es5/lib/api/encode.js.map +1 -1
  3. package/dist/es5/lib/api/load-in-batches.js +2 -2
  4. package/dist/es5/lib/api/load-in-batches.js.map +1 -1
  5. package/dist/es5/lib/api/load.js +2 -2
  6. package/dist/es5/lib/api/load.js.map +1 -1
  7. package/dist/es5/lib/init.js +1 -1
  8. package/dist/es5/lib/init.js.map +1 -1
  9. package/dist/es5/lib/loader-utils/get-fetch-function.js +31 -0
  10. package/dist/es5/lib/loader-utils/get-fetch-function.js.map +1 -0
  11. package/dist/es5/lib/loader-utils/loader-context.js +2 -2
  12. package/dist/es5/lib/loader-utils/loader-context.js.map +1 -1
  13. package/dist/es5/lib/loader-utils/option-utils.js +20 -43
  14. package/dist/es5/lib/loader-utils/option-utils.js.map +1 -1
  15. package/dist/es5/null-loader.js +1 -1
  16. package/dist/es5/null-loader.js.map +1 -1
  17. package/dist/esm/lib/api/encode.js.map +1 -1
  18. package/dist/esm/lib/api/load-in-batches.js +1 -1
  19. package/dist/esm/lib/api/load-in-batches.js.map +1 -1
  20. package/dist/esm/lib/api/load.js +1 -1
  21. package/dist/esm/lib/api/load.js.map +1 -1
  22. package/dist/esm/lib/init.js +1 -1
  23. package/dist/esm/lib/init.js.map +1 -1
  24. package/dist/esm/lib/loader-utils/get-fetch-function.js +25 -0
  25. package/dist/esm/lib/loader-utils/get-fetch-function.js.map +1 -0
  26. package/dist/esm/lib/loader-utils/loader-context.js +1 -1
  27. package/dist/esm/lib/loader-utils/loader-context.js.map +1 -1
  28. package/dist/esm/lib/loader-utils/option-utils.js +2 -20
  29. package/dist/esm/lib/loader-utils/option-utils.js.map +1 -1
  30. package/dist/esm/null-loader.js +1 -1
  31. package/dist/esm/null-loader.js.map +1 -1
  32. package/dist/lib/api/encode.d.ts +5 -5
  33. package/dist/lib/api/encode.d.ts.map +1 -1
  34. package/dist/lib/api/encode.js +1 -0
  35. package/dist/lib/api/load-in-batches.js +2 -2
  36. package/dist/lib/api/load.d.ts.map +1 -1
  37. package/dist/lib/api/load.js +3 -2
  38. package/dist/lib/loader-utils/get-fetch-function.d.ts +9 -0
  39. package/dist/lib/loader-utils/get-fetch-function.d.ts.map +1 -0
  40. package/dist/lib/loader-utils/get-fetch-function.js +31 -0
  41. package/dist/lib/loader-utils/loader-context.js +2 -2
  42. package/dist/lib/loader-utils/option-utils.d.ts +5 -15
  43. package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
  44. package/dist/lib/loader-utils/option-utils.js +10 -31
  45. package/dist/null-worker.js +1 -1
  46. package/package.json +5 -5
  47. package/src/lib/api/encode.ts +7 -6
  48. package/src/lib/api/load-in-batches.ts +1 -1
  49. package/src/lib/api/load.ts +3 -2
  50. package/src/lib/loader-utils/get-fetch-function.ts +38 -0
  51. package/src/lib/loader-utils/loader-context.ts +1 -1
  52. package/src/lib/loader-utils/option-utils.ts +17 -44
package/dist/dist.min.js CHANGED
@@ -559,7 +559,7 @@
559
559
  "../worker-utils/src/lib/worker-api/get-worker-url.ts"() {
560
560
  init_assert2();
561
561
  init_version();
562
- NPM_TAG = "latest";
562
+ NPM_TAG = "beta";
563
563
  VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
564
564
  }
565
565
  });
@@ -832,7 +832,7 @@
832
832
  }
833
833
  });
834
834
 
835
- // ../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js
835
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
836
836
  function getHiResTimestamp() {
837
837
  let timestamp;
838
838
  if (typeof window !== "undefined" && window.performance) {
@@ -846,14 +846,14 @@
846
846
  return timestamp;
847
847
  }
848
848
  var init_hi_res_timestamp = __esm({
849
- "../../node_modules/@probe.gl/stats/dist/esm/utils/hi-res-timestamp.js"() {
849
+ "../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
850
850
  }
851
851
  });
852
852
 
853
- // ../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js
853
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js
854
854
  var Stat;
855
855
  var init_stat = __esm({
856
- "../../node_modules/@probe.gl/stats/dist/esm/lib/stat.js"() {
856
+ "../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js"() {
857
857
  init_defineProperty();
858
858
  init_hi_res_timestamp();
859
859
  Stat = class {
@@ -861,12 +861,12 @@
861
861
  _defineProperty(this, "name", void 0);
862
862
  _defineProperty(this, "type", void 0);
863
863
  _defineProperty(this, "sampleSize", 1);
864
- _defineProperty(this, "time", void 0);
865
- _defineProperty(this, "count", void 0);
866
- _defineProperty(this, "samples", void 0);
867
- _defineProperty(this, "lastTiming", void 0);
868
- _defineProperty(this, "lastSampleTime", void 0);
869
- _defineProperty(this, "lastSampleCount", void 0);
864
+ _defineProperty(this, "time", 0);
865
+ _defineProperty(this, "count", 0);
866
+ _defineProperty(this, "samples", 0);
867
+ _defineProperty(this, "lastTiming", 0);
868
+ _defineProperty(this, "lastSampleTime", 0);
869
+ _defineProperty(this, "lastSampleCount", 0);
870
870
  _defineProperty(this, "_count", 0);
871
871
  _defineProperty(this, "_time", 0);
872
872
  _defineProperty(this, "_samples", 0);
@@ -876,6 +876,20 @@
876
876
  this.type = type;
877
877
  this.reset();
878
878
  }
879
+ reset() {
880
+ this.time = 0;
881
+ this.count = 0;
882
+ this.samples = 0;
883
+ this.lastTiming = 0;
884
+ this.lastSampleTime = 0;
885
+ this.lastSampleCount = 0;
886
+ this._count = 0;
887
+ this._time = 0;
888
+ this._samples = 0;
889
+ this._startTime = 0;
890
+ this._timerPending = false;
891
+ return this;
892
+ }
879
893
  setSampleSize(samples) {
880
894
  this.sampleSize = samples;
881
895
  return this;
@@ -939,20 +953,6 @@
939
953
  getHz() {
940
954
  return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
941
955
  }
942
- reset() {
943
- this.time = 0;
944
- this.count = 0;
945
- this.samples = 0;
946
- this.lastTiming = 0;
947
- this.lastSampleTime = 0;
948
- this.lastSampleCount = 0;
949
- this._count = 0;
950
- this._time = 0;
951
- this._samples = 0;
952
- this._startTime = 0;
953
- this._timerPending = false;
954
- return this;
955
- }
956
956
  _checkSampling() {
957
957
  if (this._samples === this.sampleSize) {
958
958
  this.lastSampleTime = this._time;
@@ -969,10 +969,10 @@
969
969
  }
970
970
  });
971
971
 
972
- // ../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js
972
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js
973
973
  var Stats;
974
974
  var init_stats = __esm({
975
- "../../node_modules/@probe.gl/stats/dist/esm/lib/stats.js"() {
975
+ "../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js"() {
976
976
  init_defineProperty();
977
977
  init_stat();
978
978
  Stats = class {
@@ -995,56 +995,56 @@
995
995
  return Object.keys(this.stats).length;
996
996
  }
997
997
  reset() {
998
- for (const key in this.stats) {
999
- this.stats[key].reset();
998
+ for (const stat2 of Object.values(this.stats)) {
999
+ stat2.reset();
1000
1000
  }
1001
1001
  return this;
1002
1002
  }
1003
1003
  forEach(fn) {
1004
- for (const key in this.stats) {
1005
- fn(this.stats[key]);
1004
+ for (const stat2 of Object.values(this.stats)) {
1005
+ fn(stat2);
1006
1006
  }
1007
1007
  }
1008
1008
  getTable() {
1009
1009
  const table = {};
1010
- this.forEach((stat) => {
1011
- table[stat.name] = {
1012
- time: stat.time || 0,
1013
- count: stat.count || 0,
1014
- average: stat.getAverageTime() || 0,
1015
- hz: stat.getHz() || 0
1010
+ this.forEach((stat2) => {
1011
+ table[stat2.name] = {
1012
+ time: stat2.time || 0,
1013
+ count: stat2.count || 0,
1014
+ average: stat2.getAverageTime() || 0,
1015
+ hz: stat2.getHz() || 0
1016
1016
  };
1017
1017
  });
1018
1018
  return table;
1019
1019
  }
1020
1020
  _initializeStats() {
1021
1021
  let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
1022
- stats.forEach((stat) => this._getOrCreate(stat));
1022
+ stats.forEach((stat2) => this._getOrCreate(stat2));
1023
1023
  }
1024
- _getOrCreate(stat) {
1025
- if (!stat || !stat.name) {
1024
+ _getOrCreate(stat2) {
1025
+ if (!stat2 || !stat2.name) {
1026
1026
  return null;
1027
1027
  }
1028
1028
  const {
1029
1029
  name,
1030
1030
  type
1031
- } = stat;
1031
+ } = stat2;
1032
1032
  if (!this.stats[name]) {
1033
- if (stat instanceof Stat) {
1034
- this.stats[name] = stat;
1033
+ if (stat2 instanceof Stat) {
1034
+ this.stats[name] = stat2;
1035
1035
  } else {
1036
1036
  this.stats[name] = new Stat(name, type);
1037
1037
  }
1038
1038
  }
1039
- return this.stats[name];
1039
+ return this.stats[name] || null;
1040
1040
  }
1041
1041
  };
1042
1042
  }
1043
1043
  });
1044
1044
 
1045
- // ../../node_modules/@probe.gl/stats/dist/esm/index.js
1046
- var init_esm = __esm({
1047
- "../../node_modules/@probe.gl/stats/dist/esm/index.js"() {
1045
+ // ../loader-utils/node_modules/@probe.gl/stats/dist/index.js
1046
+ var init_dist = __esm({
1047
+ "../loader-utils/node_modules/@probe.gl/stats/dist/index.js"() {
1048
1048
  init_stats();
1049
1049
  init_stat();
1050
1050
  init_hi_res_timestamp();
@@ -1055,7 +1055,7 @@
1055
1055
  var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
1056
1056
  var init_request_scheduler = __esm({
1057
1057
  "../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
1058
- init_esm();
1058
+ init_dist();
1059
1059
  STAT_QUEUED_REQUESTS = "Queued Requests";
1060
1060
  STAT_ACTIVE_REQUESTS = "Active Requests";
1061
1061
  STAT_CANCELLED_REQUESTS = "Cancelled Requests";
@@ -1206,9 +1206,15 @@
1206
1206
  }
1207
1207
  });
1208
1208
 
1209
- // (disabled):../loader-utils/src/lib/node/buffer
1210
- var init_buffer = __esm({
1211
- "(disabled):../loader-utils/src/lib/node/buffer"() {
1209
+ // ../loader-utils/src/lib/node/buffer.browser.ts
1210
+ function toArrayBuffer(buffer) {
1211
+ return buffer;
1212
+ }
1213
+ function toBuffer(binaryData) {
1214
+ throw new Error("Buffer not supported in browser");
1215
+ }
1216
+ var init_buffer_browser = __esm({
1217
+ "../loader-utils/src/lib/node/buffer.browser.ts"() {
1212
1218
  }
1213
1219
  });
1214
1220
 
@@ -1217,11 +1223,11 @@
1217
1223
  return value && typeof value === "object" && value.isBuffer;
1218
1224
  }
1219
1225
  function toBuffer2(data) {
1220
- return node.toBuffer ? node.toBuffer(data) : data;
1226
+ return toBuffer ? toBuffer(data) : data;
1221
1227
  }
1222
1228
  function toArrayBuffer2(data) {
1223
1229
  if (isBuffer(data)) {
1224
- return node.toArrayBuffer(data);
1230
+ return toArrayBuffer(data);
1225
1231
  }
1226
1232
  if (data instanceof ArrayBuffer) {
1227
1233
  return data;
@@ -1244,7 +1250,19 @@
1244
1250
  }
1245
1251
  var init_memory_conversion_utils = __esm({
1246
1252
  "../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
1247
- init_buffer();
1253
+ init_buffer_browser();
1254
+ }
1255
+ });
1256
+
1257
+ // ../loader-utils/src/lib/node/promisify.ts
1258
+ function promisify2(fn) {
1259
+ return (arg1, arg2) => new Promise((resolve, reject) => fn(arg1, arg2, (error, callbackArgs) => error ? reject(error) : resolve(callbackArgs)));
1260
+ }
1261
+ function promisify3(fn) {
1262
+ return (arg1, arg2, arg3) => new Promise((resolve, reject) => fn(arg1, arg2, arg3, (error, callbackArgs) => error ? reject(error) : resolve(callbackArgs)));
1263
+ }
1264
+ var init_promisify = __esm({
1265
+ "../loader-utils/src/lib/node/promisify.ts"() {
1248
1266
  }
1249
1267
  });
1250
1268
 
@@ -1281,14 +1299,63 @@
1281
1299
  }
1282
1300
  });
1283
1301
 
1284
- // (disabled):../loader-utils/src/lib/node/fs
1302
+ // (disabled):fs
1285
1303
  var require_fs = __commonJS({
1286
- "(disabled):../loader-utils/src/lib/node/fs"() {
1304
+ "(disabled):fs"() {
1305
+ }
1306
+ });
1307
+
1308
+ // ../loader-utils/src/lib/node/fs.ts
1309
+ var fs_exports = {};
1310
+ __export(fs_exports, {
1311
+ _readToArrayBuffer: () => _readToArrayBuffer,
1312
+ close: () => close,
1313
+ createWriteStream: () => createWriteStream,
1314
+ fstat: () => fstat,
1315
+ isSupported: () => isSupported,
1316
+ open: () => open,
1317
+ read: () => read,
1318
+ readFile: () => readFile,
1319
+ readFileSync: () => readFileSync,
1320
+ readdir: () => readdir,
1321
+ stat: () => stat,
1322
+ writeFile: () => writeFile,
1323
+ writeFileSync: () => writeFileSync
1324
+ });
1325
+ async function _readToArrayBuffer(fd, start, length) {
1326
+ const buffer = Buffer.alloc(length);
1327
+ const { bytesRead } = await read(fd, buffer, 0, length, start);
1328
+ if (bytesRead !== length) {
1329
+ throw new Error("fs.read failed");
1330
+ }
1331
+ return toArrayBuffer(buffer);
1332
+ }
1333
+ var import_fs, readdir, stat, readFile, readFileSync, writeFile, writeFileSync, open, close, read, fstat, createWriteStream, isSupported;
1334
+ var init_fs = __esm({
1335
+ "../loader-utils/src/lib/node/fs.ts"() {
1336
+ import_fs = __toModule(require_fs());
1337
+ init_buffer_browser();
1338
+ init_promisify();
1339
+ isSupported = Boolean(import_fs.default);
1340
+ try {
1341
+ readdir = promisify2(import_fs.default.readdir);
1342
+ stat = promisify2(import_fs.default.stat);
1343
+ readFile = import_fs.default.readFile;
1344
+ readFileSync = import_fs.default.readFileSync;
1345
+ writeFile = promisify3(import_fs.default.writeFile);
1346
+ writeFileSync = import_fs.default.writeFileSync;
1347
+ open = import_fs.default.open;
1348
+ close = (fd) => new Promise((resolve, reject) => import_fs.default.close(fd, (err) => err ? reject(err) : resolve()));
1349
+ read = import_fs.default.read;
1350
+ fstat = import_fs.default.fstat;
1351
+ createWriteStream = import_fs.default.createWriteStream;
1352
+ isSupported = Boolean(import_fs.default);
1353
+ } catch {
1354
+ }
1287
1355
  }
1288
1356
  });
1289
1357
 
1290
1358
  // ../loader-utils/src/index.ts
1291
- var fs;
1292
1359
  var init_src2 = __esm({
1293
1360
  "../loader-utils/src/index.ts"() {
1294
1361
  init_assert();
@@ -1303,7 +1370,7 @@
1303
1370
  init_json_loader();
1304
1371
  init_memory_conversion_utils();
1305
1372
  init_path();
1306
- fs = __toModule(require_fs());
1373
+ init_fs();
1307
1374
  }
1308
1375
  });
1309
1376
 
@@ -1513,7 +1580,7 @@
1513
1580
  // src/lib/fetch/read-array-buffer.ts
1514
1581
  async function readArrayBuffer(file, start, length) {
1515
1582
  if (typeof file === "number") {
1516
- return await fs._readToArrayBuffer(file, start, length);
1583
+ return await fs_exports._readToArrayBuffer(file, start, length);
1517
1584
  }
1518
1585
  if (!(file instanceof Blob)) {
1519
1586
  file = new Blob([file]);
@@ -1536,10 +1603,10 @@
1536
1603
  });
1537
1604
 
1538
1605
  // src/lib/fetch/read-file.ts
1539
- function readFileSync(url, options = {}) {
1606
+ function readFileSync2(url, options = {}) {
1540
1607
  url = resolvePath(url);
1541
1608
  if (!isBrowser) {
1542
- const buffer = fs.readFileSync(url, options);
1609
+ const buffer = fs_exports.readFileSync(url, options);
1543
1610
  return typeof buffer !== "string" ? toArrayBuffer2(buffer) : buffer;
1544
1611
  }
1545
1612
  if (!options.nothrow) {
@@ -1555,17 +1622,17 @@
1555
1622
  });
1556
1623
 
1557
1624
  // src/lib/fetch/write-file.ts
1558
- async function writeFile(filePath, arrayBufferOrString, options) {
1625
+ async function writeFile2(filePath, arrayBufferOrString, options) {
1559
1626
  filePath = resolvePath(filePath);
1560
1627
  if (!isBrowser) {
1561
- await fs.writeFile(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1628
+ await fs_exports.writeFile(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1562
1629
  }
1563
1630
  assert(false);
1564
1631
  }
1565
- function writeFileSync(filePath, arrayBufferOrString, options) {
1632
+ function writeFileSync2(filePath, arrayBufferOrString, options) {
1566
1633
  filePath = resolvePath(filePath);
1567
1634
  if (!isBrowser) {
1568
- fs.writeFileSync(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1635
+ fs_exports.writeFileSync(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
1569
1636
  }
1570
1637
  assert(false);
1571
1638
  }
@@ -1576,12 +1643,12 @@
1576
1643
  }
1577
1644
  });
1578
1645
 
1579
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js
1646
+ // node_modules/@probe.gl/env/dist/lib/is-electron.js
1580
1647
  function isElectron(mockUserAgent) {
1581
1648
  if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
1582
1649
  return true;
1583
1650
  }
1584
- if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions.electron)) {
1651
+ if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
1585
1652
  return true;
1586
1653
  }
1587
1654
  const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
@@ -1592,59 +1659,54 @@
1592
1659
  return false;
1593
1660
  }
1594
1661
  var init_is_electron = __esm({
1595
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-electron.js"() {
1662
+ "node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
1596
1663
  }
1597
1664
  });
1598
1665
 
1599
- // ../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js
1666
+ // node_modules/@probe.gl/env/dist/lib/is-browser.js
1600
1667
  function isBrowser3() {
1601
1668
  const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
1602
1669
  return !isNode || isElectron();
1603
1670
  }
1604
1671
  var init_is_browser = __esm({
1605
- "../../node_modules/@probe.gl/env/dist/esm/lib/is-browser.js"() {
1672
+ "node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
1606
1673
  init_is_electron();
1607
1674
  }
1608
1675
  });
1609
1676
 
1610
- // ../../node_modules/@probe.gl/env/dist/esm/lib/globals.js
1611
- var globals3, self_3, window_3, document_3, process_;
1677
+ // node_modules/@probe.gl/env/dist/lib/globals.js
1678
+ var self2, window2, document2, process2, console2, navigator2;
1612
1679
  var init_globals3 = __esm({
1613
- "../../node_modules/@probe.gl/env/dist/esm/lib/globals.js"() {
1614
- globals3 = {
1615
- self: typeof self !== "undefined" && self,
1616
- window: typeof window !== "undefined" && window,
1617
- global: typeof global !== "undefined" && global,
1618
- document: typeof document !== "undefined" && document,
1619
- process: typeof process === "object" && process
1620
- };
1621
- self_3 = globals3.self || globals3.window || globals3.global;
1622
- window_3 = globals3.window || globals3.self || globals3.global;
1623
- document_3 = globals3.document || {};
1624
- process_ = globals3.process || {};
1680
+ "node_modules/@probe.gl/env/dist/lib/globals.js"() {
1681
+ self2 = globalThis.self || globalThis.window || globalThis.global;
1682
+ window2 = globalThis.window || globalThis.self || globalThis.global;
1683
+ document2 = globalThis.document || {};
1684
+ process2 = globalThis.process || {};
1685
+ console2 = globalThis.console;
1686
+ navigator2 = globalThis.navigator || {};
1625
1687
  }
1626
1688
  });
1627
1689
 
1628
- // ../../node_modules/@probe.gl/env/dist/esm/utils/globals.js
1690
+ // node_modules/@probe.gl/env/dist/utils/globals.js
1629
1691
  var VERSION4, isBrowser4;
1630
1692
  var init_globals4 = __esm({
1631
- "../../node_modules/@probe.gl/env/dist/esm/utils/globals.js"() {
1693
+ "node_modules/@probe.gl/env/dist/utils/globals.js"() {
1632
1694
  init_is_browser();
1633
1695
  VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
1634
1696
  isBrowser4 = isBrowser3();
1635
1697
  }
1636
1698
  });
1637
1699
 
1638
- // ../../node_modules/@probe.gl/env/dist/esm/index.js
1639
- var init_esm2 = __esm({
1640
- "../../node_modules/@probe.gl/env/dist/esm/index.js"() {
1700
+ // node_modules/@probe.gl/env/dist/index.js
1701
+ var init_dist2 = __esm({
1702
+ "node_modules/@probe.gl/env/dist/index.js"() {
1641
1703
  init_globals4();
1642
1704
  init_globals3();
1643
1705
  init_is_browser();
1644
1706
  }
1645
1707
  });
1646
1708
 
1647
- // ../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js
1709
+ // node_modules/@probe.gl/log/dist/utils/local-storage.js
1648
1710
  function getStorage(type) {
1649
1711
  try {
1650
1712
  const storage = window[type];
@@ -1658,35 +1720,28 @@
1658
1720
  }
1659
1721
  var LocalStorage;
1660
1722
  var init_local_storage = __esm({
1661
- "../../node_modules/@probe.gl/log/dist/esm/utils/local-storage.js"() {
1723
+ "node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
1662
1724
  init_defineProperty();
1663
1725
  LocalStorage = class {
1664
- constructor(id) {
1665
- let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1726
+ constructor(id, defaultConfig) {
1666
1727
  let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
1667
1728
  _defineProperty(this, "storage", void 0);
1668
1729
  _defineProperty(this, "id", void 0);
1669
- _defineProperty(this, "config", {});
1730
+ _defineProperty(this, "config", void 0);
1670
1731
  this.storage = getStorage(type);
1671
1732
  this.id = id;
1672
- this.config = {};
1673
- Object.assign(this.config, defaultSettings);
1733
+ this.config = defaultConfig;
1674
1734
  this._loadConfiguration();
1675
1735
  }
1676
1736
  getConfiguration() {
1677
1737
  return this.config;
1678
1738
  }
1679
1739
  setConfiguration(configuration) {
1680
- this.config = {};
1681
- return this.updateConfiguration(configuration);
1682
- }
1683
- updateConfiguration(configuration) {
1684
1740
  Object.assign(this.config, configuration);
1685
1741
  if (this.storage) {
1686
1742
  const serialized = JSON.stringify(this.config);
1687
1743
  this.storage.setItem(this.id, serialized);
1688
1744
  }
1689
- return this;
1690
1745
  }
1691
1746
  _loadConfiguration() {
1692
1747
  let configuration = {};
@@ -1701,7 +1756,7 @@
1701
1756
  }
1702
1757
  });
1703
1758
 
1704
- // ../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js
1759
+ // node_modules/@probe.gl/log/dist/utils/formatters.js
1705
1760
  function formatTime(ms) {
1706
1761
  let formatted;
1707
1762
  if (ms < 10) {
@@ -1732,31 +1787,35 @@
1732
1787
  return ["".concat(message, " %c+"), style];
1733
1788
  }
1734
1789
  var init_formatters = __esm({
1735
- "../../node_modules/@probe.gl/log/dist/esm/utils/formatters.js"() {
1790
+ "node_modules/@probe.gl/log/dist/utils/formatters.js"() {
1736
1791
  }
1737
1792
  });
1738
1793
 
1739
- // ../../node_modules/@probe.gl/log/dist/esm/utils/color.js
1794
+ // node_modules/@probe.gl/log/dist/utils/color.js
1740
1795
  function getColor(color) {
1741
- return typeof color === "string" ? COLOR[color.toUpperCase()] || COLOR.WHITE : color;
1796
+ if (typeof color !== "string") {
1797
+ return color;
1798
+ }
1799
+ color = color.toUpperCase();
1800
+ return COLOR[color] || COLOR.WHITE;
1742
1801
  }
1743
1802
  function addColor(string, color, background) {
1744
1803
  if (!isBrowser3 && typeof string === "string") {
1745
1804
  if (color) {
1746
- color = getColor(color);
1747
- string = "[".concat(color, "m").concat(string, "");
1805
+ const colorCode = getColor(color);
1806
+ string = "[".concat(colorCode, "m").concat(string, "");
1748
1807
  }
1749
1808
  if (background) {
1750
- color = getColor(background);
1751
- string = "[".concat(background + 10, "m").concat(string, "");
1809
+ const colorCode = getColor(background);
1810
+ string = "[".concat(colorCode + BACKGROUND_INCREMENT, "m").concat(string, "");
1752
1811
  }
1753
1812
  }
1754
1813
  return string;
1755
1814
  }
1756
- var COLOR;
1815
+ var COLOR, BACKGROUND_INCREMENT;
1757
1816
  var init_color = __esm({
1758
- "../../node_modules/@probe.gl/log/dist/esm/utils/color.js"() {
1759
- init_esm2();
1817
+ "node_modules/@probe.gl/log/dist/utils/color.js"() {
1818
+ init_dist2();
1760
1819
  (function(COLOR2) {
1761
1820
  COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
1762
1821
  COLOR2[COLOR2["RED"] = 31] = "RED";
@@ -1775,47 +1834,50 @@
1775
1834
  COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
1776
1835
  COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
1777
1836
  })(COLOR || (COLOR = {}));
1837
+ BACKGROUND_INCREMENT = 10;
1778
1838
  }
1779
1839
  });
1780
1840
 
1781
- // ../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js
1841
+ // node_modules/@probe.gl/log/dist/utils/autobind.js
1782
1842
  function autobind(obj) {
1783
1843
  let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
1784
1844
  const proto = Object.getPrototypeOf(obj);
1785
1845
  const propNames = Object.getOwnPropertyNames(proto);
1846
+ const object = obj;
1786
1847
  for (const key of propNames) {
1787
- if (typeof obj[key] === "function") {
1848
+ const value = object[key];
1849
+ if (typeof value === "function") {
1788
1850
  if (!predefined.find((name) => key === name)) {
1789
- obj[key] = obj[key].bind(obj);
1851
+ object[key] = value.bind(obj);
1790
1852
  }
1791
1853
  }
1792
1854
  }
1793
1855
  }
1794
1856
  var init_autobind = __esm({
1795
- "../../node_modules/@probe.gl/log/dist/esm/utils/autobind.js"() {
1857
+ "node_modules/@probe.gl/log/dist/utils/autobind.js"() {
1796
1858
  }
1797
1859
  });
1798
1860
 
1799
- // ../../node_modules/@probe.gl/log/dist/esm/utils/assert.js
1861
+ // node_modules/@probe.gl/log/dist/utils/assert.js
1800
1862
  function assert3(condition, message) {
1801
1863
  if (!condition) {
1802
1864
  throw new Error(message || "Assertion failed");
1803
1865
  }
1804
1866
  }
1805
1867
  var init_assert3 = __esm({
1806
- "../../node_modules/@probe.gl/log/dist/esm/utils/assert.js"() {
1868
+ "node_modules/@probe.gl/log/dist/utils/assert.js"() {
1807
1869
  }
1808
1870
  });
1809
1871
 
1810
- // ../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js
1872
+ // node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
1811
1873
  function getHiResTimestamp2() {
1812
1874
  let timestamp;
1813
- if (isBrowser3 && "performance" in window_3) {
1875
+ if (isBrowser3() && window2.performance) {
1814
1876
  var _window$performance, _window$performance$n;
1815
- timestamp = window_3 === null || window_3 === void 0 ? void 0 : (_window$performance = window_3.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
1816
- } else if ("hrtime" in process_) {
1877
+ timestamp = window2 === null || window2 === void 0 ? void 0 : (_window$performance = window2.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$n = _window$performance.now) === null || _window$performance$n === void 0 ? void 0 : _window$performance$n.call(_window$performance);
1878
+ } else if ("hrtime" in process2) {
1817
1879
  var _process$hrtime;
1818
- const timeParts = process_ === null || process_ === void 0 ? void 0 : (_process$hrtime = process_.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process_);
1880
+ const timeParts = process2 === null || process2 === void 0 ? void 0 : (_process$hrtime = process2.hrtime) === null || _process$hrtime === void 0 ? void 0 : _process$hrtime.call(process2);
1819
1881
  timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
1820
1882
  } else {
1821
1883
  timestamp = Date.now();
@@ -1823,18 +1885,12 @@
1823
1885
  return timestamp;
1824
1886
  }
1825
1887
  var init_hi_res_timestamp2 = __esm({
1826
- "../../node_modules/@probe.gl/log/dist/esm/utils/hi-res-timestamp.js"() {
1827
- init_esm2();
1828
- }
1829
- });
1830
-
1831
- // (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
1832
- var init_node_asciify_image = __esm({
1833
- "(disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image"() {
1888
+ "node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js"() {
1889
+ init_dist2();
1834
1890
  }
1835
1891
  });
1836
1892
 
1837
- // ../../node_modules/@probe.gl/log/dist/esm/log.js
1893
+ // node_modules/@probe.gl/log/dist/log.js
1838
1894
  function noop() {
1839
1895
  }
1840
1896
  function normalizeLogLevel(logLevel) {
@@ -1900,11 +1956,7 @@
1900
1956
  message = "",
1901
1957
  scale = 1
1902
1958
  } = _ref2;
1903
- asciify.nodeAsciifyImage({
1904
- image,
1905
- message,
1906
- scale
1907
- });
1959
+ console.warn("removed");
1908
1960
  return noop;
1909
1961
  }
1910
1962
  function logImageInBrowser(_ref3) {
@@ -1943,26 +1995,25 @@
1943
1995
  }
1944
1996
  return "empty";
1945
1997
  }
1946
- var originalConsole, DEFAULT_SETTINGS, cache, ONCE, Log;
1998
+ var originalConsole, DEFAULT_LOG_CONFIGURATION, cache, ONCE, Log;
1947
1999
  var init_log = __esm({
1948
- "../../node_modules/@probe.gl/log/dist/esm/log.js"() {
2000
+ "node_modules/@probe.gl/log/dist/log.js"() {
1949
2001
  init_defineProperty();
1950
- init_esm2();
2002
+ init_dist2();
1951
2003
  init_local_storage();
1952
2004
  init_formatters();
1953
2005
  init_color();
1954
2006
  init_autobind();
1955
2007
  init_assert3();
1956
2008
  init_hi_res_timestamp2();
1957
- init_node_asciify_image();
1958
2009
  originalConsole = {
1959
- debug: isBrowser3 ? console.debug || console.log : console.log,
2010
+ debug: isBrowser3() ? console.debug || console.log : console.log,
1960
2011
  log: console.log,
1961
2012
  info: console.info,
1962
2013
  warn: console.warn,
1963
2014
  error: console.error
1964
2015
  };
1965
- DEFAULT_SETTINGS = {
2016
+ DEFAULT_LOG_CONFIGURATION = {
1966
2017
  enabled: true,
1967
2018
  level: 0
1968
2019
  };
@@ -1985,8 +2036,8 @@
1985
2036
  _defineProperty(this, "userData", {});
1986
2037
  _defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
1987
2038
  this.id = id;
1988
- this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
1989
2039
  this.userData = {};
2040
+ this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION);
1990
2041
  this.timeStamp("".concat(this.id, " started"));
1991
2042
  autobind(this);
1992
2043
  Object.seal(this);
@@ -2020,13 +2071,13 @@
2020
2071
  }
2021
2072
  enable() {
2022
2073
  let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
2023
- this._storage.updateConfiguration({
2074
+ this._storage.setConfiguration({
2024
2075
  enabled
2025
2076
  });
2026
2077
  return this;
2027
2078
  }
2028
2079
  setLevel(level) {
2029
- this._storage.updateConfiguration({
2080
+ this._storage.setConfiguration({
2030
2081
  level
2031
2082
  });
2032
2083
  return this;
@@ -2035,7 +2086,7 @@
2035
2086
  return this._storage.config[setting];
2036
2087
  }
2037
2088
  set(setting, value) {
2038
- this._storage.updateConfiguration({
2089
+ this._storage.setConfiguration({
2039
2090
  [setting]: value
2040
2091
  });
2041
2092
  }
@@ -2074,9 +2125,6 @@
2074
2125
  return this._getLogFunction(logLevel, message, console.info, arguments);
2075
2126
  }
2076
2127
  once(logLevel, message) {
2077
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2078
- args[_key - 2] = arguments[_key];
2079
- }
2080
2128
  return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
2081
2129
  }
2082
2130
  table(logLevel, table, columns) {
@@ -2098,7 +2146,7 @@
2098
2146
  if (!this._shouldLog(logLevel || priority)) {
2099
2147
  return noop;
2100
2148
  }
2101
- return isBrowser3 ? logImageInBrowser({
2149
+ return isBrowser3() ? logImageInBrowser({
2102
2150
  image,
2103
2151
  message,
2104
2152
  scale
@@ -2171,7 +2219,7 @@
2171
2219
  opts.delta = this.getDelta();
2172
2220
  this._deltaTs = getHiResTimestamp2();
2173
2221
  const tag = opts.tag || opts.message;
2174
- if (opts.once) {
2222
+ if (opts.once && tag) {
2175
2223
  if (!cache[tag]) {
2176
2224
  cache[tag] = getHiResTimestamp2();
2177
2225
  } else {
@@ -2188,13 +2236,13 @@
2188
2236
  }
2189
2237
  });
2190
2238
 
2191
- // ../../node_modules/@probe.gl/log/dist/esm/index.js
2192
- var esm_default;
2193
- var init_esm3 = __esm({
2194
- "../../node_modules/@probe.gl/log/dist/esm/index.js"() {
2239
+ // node_modules/@probe.gl/log/dist/index.js
2240
+ var dist_default;
2241
+ var init_dist3 = __esm({
2242
+ "node_modules/@probe.gl/log/dist/index.js"() {
2195
2243
  init_log();
2196
2244
  init_log();
2197
- esm_default = new Log({
2245
+ dist_default = new Log({
2198
2246
  id: "@probe.gl/log"
2199
2247
  });
2200
2248
  }
@@ -2204,7 +2252,7 @@
2204
2252
  var probeLog, NullLog, ConsoleLog;
2205
2253
  var init_loggers = __esm({
2206
2254
  "src/lib/loader-utils/loggers.ts"() {
2207
- init_esm3();
2255
+ init_dist3();
2208
2256
  probeLog = new Log({ id: "loaders.gl" });
2209
2257
  NullLog = class {
2210
2258
  log() {
@@ -2307,20 +2355,6 @@
2307
2355
  validateOptions(options, loaders);
2308
2356
  return normalizeOptionsInternal(loader, options, url);
2309
2357
  }
2310
- function getFetchFunction(options, context) {
2311
- const globalOptions = getGlobalLoaderOptions();
2312
- const fetchOptions = options || globalOptions;
2313
- if (typeof fetchOptions.fetch === "function") {
2314
- return fetchOptions.fetch;
2315
- }
2316
- if (isObject(fetchOptions.fetch)) {
2317
- return (url) => fetchFile(url, fetchOptions);
2318
- }
2319
- if (context?.fetch) {
2320
- return context?.fetch;
2321
- }
2322
- return fetchFile;
2323
- }
2324
2358
  function validateOptions(options, loaders) {
2325
2359
  validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
2326
2360
  for (const loader of loaders) {
@@ -2399,7 +2433,6 @@
2399
2433
  var init_option_utils = __esm({
2400
2434
  "src/lib/loader-utils/option-utils.ts"() {
2401
2435
  init_is_type();
2402
- init_fetch_file();
2403
2436
  init_loggers();
2404
2437
  init_option_defaults();
2405
2438
  getGlobalLoaderOptions = () => {
@@ -2490,7 +2523,7 @@
2490
2523
  var log;
2491
2524
  var init_log2 = __esm({
2492
2525
  "src/lib/utils/log.ts"() {
2493
- init_esm3();
2526
+ init_dist3();
2494
2527
  log = new Log({ id: "loaders.gl" });
2495
2528
  }
2496
2529
  });
@@ -2909,6 +2942,29 @@
2909
2942
  }
2910
2943
  });
2911
2944
 
2945
+ // src/lib/loader-utils/get-fetch-function.ts
2946
+ function getFetchFunction(options, context) {
2947
+ const globalOptions = getGlobalLoaderOptions();
2948
+ const fetchOptions = options || globalOptions;
2949
+ if (typeof fetchOptions.fetch === "function") {
2950
+ return fetchOptions.fetch;
2951
+ }
2952
+ if (isObject(fetchOptions.fetch)) {
2953
+ return (url) => fetchFile(url, fetchOptions);
2954
+ }
2955
+ if (context?.fetch) {
2956
+ return context?.fetch;
2957
+ }
2958
+ return fetchFile;
2959
+ }
2960
+ var init_get_fetch_function = __esm({
2961
+ "src/lib/loader-utils/get-fetch-function.ts"() {
2962
+ init_is_type();
2963
+ init_fetch_file();
2964
+ init_option_utils();
2965
+ }
2966
+ });
2967
+
2912
2968
  // src/lib/loader-utils/loader-context.ts
2913
2969
  function getLoaderContext(context, options, previousContext = null) {
2914
2970
  if (previousContext) {
@@ -2939,7 +2995,7 @@
2939
2995
  }
2940
2996
  var init_loader_context = __esm({
2941
2997
  "src/lib/loader-utils/loader-context.ts"() {
2942
- init_option_utils();
2998
+ init_get_fetch_function();
2943
2999
  }
2944
3000
  });
2945
3001
 
@@ -3148,7 +3204,7 @@
3148
3204
  "src/lib/api/load.ts"() {
3149
3205
  init_is_type();
3150
3206
  init_normalize_loader();
3151
- init_option_utils();
3207
+ init_get_fetch_function();
3152
3208
  init_parse();
3153
3209
  }
3154
3210
  });
@@ -3178,7 +3234,7 @@
3178
3234
  var init_load_in_batches = __esm({
3179
3235
  "src/lib/api/load-in-batches.ts"() {
3180
3236
  init_normalize_loader();
3181
- init_option_utils();
3237
+ init_get_fetch_function();
3182
3238
  init_parse_in_batches();
3183
3239
  }
3184
3240
  });
@@ -3209,7 +3265,7 @@
3209
3265
  }
3210
3266
  if (!isBrowser && writer.encodeURLtoURL) {
3211
3267
  const tmpInputFilename = getTemporaryFilename("input");
3212
- await writeFile(tmpInputFilename, data);
3268
+ await writeFile2(tmpInputFilename, data);
3213
3269
  const tmpOutputFilename = getTemporaryFilename("output");
3214
3270
  const outputFilename = await encodeURLtoURL(tmpInputFilename, tmpOutputFilename, writer, options);
3215
3271
  const response = await fetchFile(outputFilename);
@@ -3271,11 +3327,11 @@
3271
3327
  // src/lib/api/save.ts
3272
3328
  async function save(data, url, writer, options) {
3273
3329
  const encodedData = await encode(data, writer, options);
3274
- return await writeFile(url, encodedData);
3330
+ return await writeFile2(url, encodedData);
3275
3331
  }
3276
3332
  function saveSync(data, url, writer, options) {
3277
3333
  const encodedData = encodeSync(data, writer, options);
3278
- return writeFileSync(url, encodedData);
3334
+ return writeFileSync2(url, encodedData);
3279
3335
  }
3280
3336
  var init_save = __esm({
3281
3337
  "src/lib/api/save.ts"() {
@@ -3385,12 +3441,12 @@
3385
3441
  const progressStream = new ReadableStream({
3386
3442
  async start(controller) {
3387
3443
  const reader = body.getReader();
3388
- await read(controller, reader, 0, totalBytes, onProgress, onDone, onError);
3444
+ await read2(controller, reader, 0, totalBytes, onProgress, onDone, onError);
3389
3445
  }
3390
3446
  });
3391
3447
  return new Response(progressStream);
3392
3448
  }
3393
- async function read(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
3449
+ async function read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
3394
3450
  try {
3395
3451
  const { done, value } = await reader.read();
3396
3452
  if (done) {
@@ -3402,7 +3458,7 @@
3402
3458
  const percent = Math.round(loadedBytes / totalBytes * 100);
3403
3459
  onProgress(percent, { loadedBytes, totalBytes });
3404
3460
  controller.enqueue(value);
3405
- await read(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
3461
+ await read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
3406
3462
  } catch (error) {
3407
3463
  controller.error(error);
3408
3464
  onError(error);
@@ -3540,7 +3596,7 @@
3540
3596
  parseInBatches: () => parseInBatches,
3541
3597
  parseSync: () => parseSync,
3542
3598
  readArrayBuffer: () => readArrayBuffer,
3543
- readFileSync: () => readFileSync,
3599
+ readFileSync: () => readFileSync2,
3544
3600
  registerLoaders: () => registerLoaders,
3545
3601
  resolvePath: () => resolvePath,
3546
3602
  save: () => save,
@@ -3551,8 +3607,8 @@
3551
3607
  setLoaderOptions: () => setGlobalOptions,
3552
3608
  setPathPrefix: () => setPathPrefix,
3553
3609
  window: () => window_,
3554
- writeFile: () => writeFile,
3555
- writeFileSync: () => writeFileSync
3610
+ writeFile: () => writeFile2,
3611
+ writeFileSync: () => writeFileSync2
3556
3612
  });
3557
3613
  var init_src3 = __esm({
3558
3614
  "src/index.ts"() {