@loaders.gl/core 3.4.0-alpha.1 → 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.
- package/dist/dist.min.js +281 -233
- package/dist/es5/iterators/make-stream/make-node-stream.js +13 -6
- package/dist/es5/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/es5/lib/api/encode.js.map +1 -1
- package/dist/es5/lib/api/load-in-batches.js +2 -2
- package/dist/es5/lib/api/load-in-batches.js.map +1 -1
- package/dist/es5/lib/api/load.js +2 -2
- package/dist/es5/lib/api/load.js.map +1 -1
- package/dist/es5/lib/init.js +1 -1
- package/dist/es5/lib/loader-utils/get-fetch-function.js +31 -0
- package/dist/es5/lib/loader-utils/get-fetch-function.js.map +1 -0
- package/dist/es5/lib/loader-utils/loader-context.js +2 -2
- package/dist/es5/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/es5/lib/loader-utils/option-utils.js +20 -43
- package/dist/es5/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/es5/null-loader.js +1 -1
- package/dist/esm/iterators/make-stream/make-node-stream.js +3 -1
- package/dist/esm/iterators/make-stream/make-node-stream.js.map +1 -1
- package/dist/esm/lib/api/encode.js.map +1 -1
- package/dist/esm/lib/api/load-in-batches.js +1 -1
- package/dist/esm/lib/api/load-in-batches.js.map +1 -1
- package/dist/esm/lib/api/load.js +1 -1
- package/dist/esm/lib/api/load.js.map +1 -1
- package/dist/esm/lib/init.js +1 -1
- package/dist/esm/lib/loader-utils/get-fetch-function.js +25 -0
- package/dist/esm/lib/loader-utils/get-fetch-function.js.map +1 -0
- package/dist/esm/lib/loader-utils/loader-context.js +1 -1
- package/dist/esm/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/esm/lib/loader-utils/option-utils.js +2 -20
- package/dist/esm/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/esm/null-loader.js +1 -1
- package/dist/iterators/make-stream/make-node-stream.d.ts +7 -2
- package/dist/iterators/make-stream/make-node-stream.d.ts.map +1 -1
- package/dist/iterators/make-stream/make-node-stream.js +28 -2
- package/dist/lib/api/encode.d.ts +5 -5
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +1 -0
- package/dist/lib/api/load-in-batches.js +2 -2
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +3 -2
- package/dist/lib/loader-utils/get-fetch-function.d.ts +9 -0
- package/dist/lib/loader-utils/get-fetch-function.d.ts.map +1 -0
- package/dist/lib/loader-utils/get-fetch-function.js +31 -0
- package/dist/lib/loader-utils/loader-context.js +2 -2
- package/dist/lib/loader-utils/option-utils.d.ts +5 -15
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +10 -31
- package/dist/null-worker.js +1 -1
- package/package.json +5 -5
- package/src/iterators/make-stream/make-node-stream.ts +8 -2
- package/src/lib/api/encode.ts +7 -6
- package/src/lib/api/load-in-batches.ts +1 -1
- package/src/lib/api/load.ts +3 -2
- package/src/lib/loader-utils/get-fetch-function.ts +38 -0
- package/src/lib/loader-utils/loader-context.ts +1 -1
- package/src/lib/loader-utils/option-utils.ts +17 -44
package/dist/dist.min.js
CHANGED
|
@@ -715,56 +715,7 @@
|
|
|
715
715
|
}
|
|
716
716
|
});
|
|
717
717
|
|
|
718
|
-
// (disabled):../loader-utils/src/lib/node/buffer
|
|
719
|
-
var init_buffer = __esm({
|
|
720
|
-
"(disabled):../loader-utils/src/lib/node/buffer"() {
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
// ../loader-utils/src/lib/binary-utils/buffer-utils.ts
|
|
725
|
-
function isBuffer(value) {
|
|
726
|
-
return value && typeof value === "object" && value.isBuffer;
|
|
727
|
-
}
|
|
728
|
-
function toBuffer2(data) {
|
|
729
|
-
return node.toBuffer ? node.toBuffer(data) : data;
|
|
730
|
-
}
|
|
731
|
-
function bufferToArrayBuffer(buffer) {
|
|
732
|
-
if (isBuffer(buffer)) {
|
|
733
|
-
const typedArray = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.length);
|
|
734
|
-
return typedArray.slice().buffer;
|
|
735
|
-
}
|
|
736
|
-
return buffer;
|
|
737
|
-
}
|
|
738
|
-
var init_buffer_utils = __esm({
|
|
739
|
-
"../loader-utils/src/lib/binary-utils/buffer-utils.ts"() {
|
|
740
|
-
init_buffer();
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
|
|
744
718
|
// ../loader-utils/src/lib/binary-utils/array-buffer-utils.ts
|
|
745
|
-
function toArrayBuffer(data) {
|
|
746
|
-
if (isBuffer(data)) {
|
|
747
|
-
return bufferToArrayBuffer(data);
|
|
748
|
-
}
|
|
749
|
-
if (data instanceof ArrayBuffer) {
|
|
750
|
-
return data;
|
|
751
|
-
}
|
|
752
|
-
if (ArrayBuffer.isView(data)) {
|
|
753
|
-
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
754
|
-
return data.buffer;
|
|
755
|
-
}
|
|
756
|
-
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
757
|
-
}
|
|
758
|
-
if (typeof data === "string") {
|
|
759
|
-
const text = data;
|
|
760
|
-
const uint8Array = new TextEncoder().encode(text);
|
|
761
|
-
return uint8Array.buffer;
|
|
762
|
-
}
|
|
763
|
-
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
764
|
-
return data._toArrayBuffer();
|
|
765
|
-
}
|
|
766
|
-
throw new Error("toArrayBuffer");
|
|
767
|
-
}
|
|
768
719
|
function compareArrayBuffers(arrayBuffer1, arrayBuffer2, byteLength) {
|
|
769
720
|
byteLength = byteLength || arrayBuffer1.byteLength;
|
|
770
721
|
if (arrayBuffer1.byteLength < byteLength || arrayBuffer2.byteLength < byteLength) {
|
|
@@ -792,7 +743,6 @@
|
|
|
792
743
|
}
|
|
793
744
|
var init_array_buffer_utils = __esm({
|
|
794
745
|
"../loader-utils/src/lib/binary-utils/array-buffer-utils.ts"() {
|
|
795
|
-
init_buffer_utils();
|
|
796
746
|
}
|
|
797
747
|
});
|
|
798
748
|
|
|
@@ -882,7 +832,7 @@
|
|
|
882
832
|
}
|
|
883
833
|
});
|
|
884
834
|
|
|
885
|
-
//
|
|
835
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js
|
|
886
836
|
function getHiResTimestamp() {
|
|
887
837
|
let timestamp;
|
|
888
838
|
if (typeof window !== "undefined" && window.performance) {
|
|
@@ -896,14 +846,14 @@
|
|
|
896
846
|
return timestamp;
|
|
897
847
|
}
|
|
898
848
|
var init_hi_res_timestamp = __esm({
|
|
899
|
-
"
|
|
849
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/utils/hi-res-timestamp.js"() {
|
|
900
850
|
}
|
|
901
851
|
});
|
|
902
852
|
|
|
903
|
-
//
|
|
853
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js
|
|
904
854
|
var Stat;
|
|
905
855
|
var init_stat = __esm({
|
|
906
|
-
"
|
|
856
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/lib/stat.js"() {
|
|
907
857
|
init_defineProperty();
|
|
908
858
|
init_hi_res_timestamp();
|
|
909
859
|
Stat = class {
|
|
@@ -911,12 +861,12 @@
|
|
|
911
861
|
_defineProperty(this, "name", void 0);
|
|
912
862
|
_defineProperty(this, "type", void 0);
|
|
913
863
|
_defineProperty(this, "sampleSize", 1);
|
|
914
|
-
_defineProperty(this, "time",
|
|
915
|
-
_defineProperty(this, "count",
|
|
916
|
-
_defineProperty(this, "samples",
|
|
917
|
-
_defineProperty(this, "lastTiming",
|
|
918
|
-
_defineProperty(this, "lastSampleTime",
|
|
919
|
-
_defineProperty(this, "lastSampleCount",
|
|
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);
|
|
920
870
|
_defineProperty(this, "_count", 0);
|
|
921
871
|
_defineProperty(this, "_time", 0);
|
|
922
872
|
_defineProperty(this, "_samples", 0);
|
|
@@ -926,6 +876,20 @@
|
|
|
926
876
|
this.type = type;
|
|
927
877
|
this.reset();
|
|
928
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
|
+
}
|
|
929
893
|
setSampleSize(samples) {
|
|
930
894
|
this.sampleSize = samples;
|
|
931
895
|
return this;
|
|
@@ -989,20 +953,6 @@
|
|
|
989
953
|
getHz() {
|
|
990
954
|
return this.time > 0 ? this.samples / (this.time / 1e3) : 0;
|
|
991
955
|
}
|
|
992
|
-
reset() {
|
|
993
|
-
this.time = 0;
|
|
994
|
-
this.count = 0;
|
|
995
|
-
this.samples = 0;
|
|
996
|
-
this.lastTiming = 0;
|
|
997
|
-
this.lastSampleTime = 0;
|
|
998
|
-
this.lastSampleCount = 0;
|
|
999
|
-
this._count = 0;
|
|
1000
|
-
this._time = 0;
|
|
1001
|
-
this._samples = 0;
|
|
1002
|
-
this._startTime = 0;
|
|
1003
|
-
this._timerPending = false;
|
|
1004
|
-
return this;
|
|
1005
|
-
}
|
|
1006
956
|
_checkSampling() {
|
|
1007
957
|
if (this._samples === this.sampleSize) {
|
|
1008
958
|
this.lastSampleTime = this._time;
|
|
@@ -1019,10 +969,10 @@
|
|
|
1019
969
|
}
|
|
1020
970
|
});
|
|
1021
971
|
|
|
1022
|
-
//
|
|
972
|
+
// ../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js
|
|
1023
973
|
var Stats;
|
|
1024
974
|
var init_stats = __esm({
|
|
1025
|
-
"
|
|
975
|
+
"../loader-utils/node_modules/@probe.gl/stats/dist/lib/stats.js"() {
|
|
1026
976
|
init_defineProperty();
|
|
1027
977
|
init_stat();
|
|
1028
978
|
Stats = class {
|
|
@@ -1045,56 +995,56 @@
|
|
|
1045
995
|
return Object.keys(this.stats).length;
|
|
1046
996
|
}
|
|
1047
997
|
reset() {
|
|
1048
|
-
for (const
|
|
1049
|
-
|
|
998
|
+
for (const stat2 of Object.values(this.stats)) {
|
|
999
|
+
stat2.reset();
|
|
1050
1000
|
}
|
|
1051
1001
|
return this;
|
|
1052
1002
|
}
|
|
1053
1003
|
forEach(fn) {
|
|
1054
|
-
for (const
|
|
1055
|
-
fn(
|
|
1004
|
+
for (const stat2 of Object.values(this.stats)) {
|
|
1005
|
+
fn(stat2);
|
|
1056
1006
|
}
|
|
1057
1007
|
}
|
|
1058
1008
|
getTable() {
|
|
1059
1009
|
const table = {};
|
|
1060
|
-
this.forEach((
|
|
1061
|
-
table[
|
|
1062
|
-
time:
|
|
1063
|
-
count:
|
|
1064
|
-
average:
|
|
1065
|
-
hz:
|
|
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
|
|
1066
1016
|
};
|
|
1067
1017
|
});
|
|
1068
1018
|
return table;
|
|
1069
1019
|
}
|
|
1070
1020
|
_initializeStats() {
|
|
1071
1021
|
let stats = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
1072
|
-
stats.forEach((
|
|
1022
|
+
stats.forEach((stat2) => this._getOrCreate(stat2));
|
|
1073
1023
|
}
|
|
1074
|
-
_getOrCreate(
|
|
1075
|
-
if (!
|
|
1024
|
+
_getOrCreate(stat2) {
|
|
1025
|
+
if (!stat2 || !stat2.name) {
|
|
1076
1026
|
return null;
|
|
1077
1027
|
}
|
|
1078
1028
|
const {
|
|
1079
1029
|
name,
|
|
1080
1030
|
type
|
|
1081
|
-
} =
|
|
1031
|
+
} = stat2;
|
|
1082
1032
|
if (!this.stats[name]) {
|
|
1083
|
-
if (
|
|
1084
|
-
this.stats[name] =
|
|
1033
|
+
if (stat2 instanceof Stat) {
|
|
1034
|
+
this.stats[name] = stat2;
|
|
1085
1035
|
} else {
|
|
1086
1036
|
this.stats[name] = new Stat(name, type);
|
|
1087
1037
|
}
|
|
1088
1038
|
}
|
|
1089
|
-
return this.stats[name];
|
|
1039
|
+
return this.stats[name] || null;
|
|
1090
1040
|
}
|
|
1091
1041
|
};
|
|
1092
1042
|
}
|
|
1093
1043
|
});
|
|
1094
1044
|
|
|
1095
|
-
//
|
|
1096
|
-
var
|
|
1097
|
-
"
|
|
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"() {
|
|
1098
1048
|
init_stats();
|
|
1099
1049
|
init_stat();
|
|
1100
1050
|
init_hi_res_timestamp();
|
|
@@ -1105,7 +1055,7 @@
|
|
|
1105
1055
|
var STAT_QUEUED_REQUESTS, STAT_ACTIVE_REQUESTS, STAT_CANCELLED_REQUESTS, STAT_QUEUED_REQUESTS_EVER, STAT_ACTIVE_REQUESTS_EVER, DEFAULT_PROPS2, RequestScheduler;
|
|
1106
1056
|
var init_request_scheduler = __esm({
|
|
1107
1057
|
"../loader-utils/src/lib/request-utils/request-scheduler.ts"() {
|
|
1108
|
-
|
|
1058
|
+
init_dist();
|
|
1109
1059
|
STAT_QUEUED_REQUESTS = "Queued Requests";
|
|
1110
1060
|
STAT_ACTIVE_REQUESTS = "Active Requests";
|
|
1111
1061
|
STAT_CANCELLED_REQUESTS = "Cancelled Requests";
|
|
@@ -1256,6 +1206,66 @@
|
|
|
1256
1206
|
}
|
|
1257
1207
|
});
|
|
1258
1208
|
|
|
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"() {
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
|
|
1221
|
+
// ../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts
|
|
1222
|
+
function isBuffer(value) {
|
|
1223
|
+
return value && typeof value === "object" && value.isBuffer;
|
|
1224
|
+
}
|
|
1225
|
+
function toBuffer2(data) {
|
|
1226
|
+
return toBuffer ? toBuffer(data) : data;
|
|
1227
|
+
}
|
|
1228
|
+
function toArrayBuffer2(data) {
|
|
1229
|
+
if (isBuffer(data)) {
|
|
1230
|
+
return toArrayBuffer(data);
|
|
1231
|
+
}
|
|
1232
|
+
if (data instanceof ArrayBuffer) {
|
|
1233
|
+
return data;
|
|
1234
|
+
}
|
|
1235
|
+
if (ArrayBuffer.isView(data)) {
|
|
1236
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
1237
|
+
return data.buffer;
|
|
1238
|
+
}
|
|
1239
|
+
return data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
1240
|
+
}
|
|
1241
|
+
if (typeof data === "string") {
|
|
1242
|
+
const text = data;
|
|
1243
|
+
const uint8Array = new TextEncoder().encode(text);
|
|
1244
|
+
return uint8Array.buffer;
|
|
1245
|
+
}
|
|
1246
|
+
if (data && typeof data === "object" && data._toArrayBuffer) {
|
|
1247
|
+
return data._toArrayBuffer();
|
|
1248
|
+
}
|
|
1249
|
+
throw new Error("toArrayBuffer");
|
|
1250
|
+
}
|
|
1251
|
+
var init_memory_conversion_utils = __esm({
|
|
1252
|
+
"../loader-utils/src/lib/binary-utils/memory-conversion-utils.ts"() {
|
|
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"() {
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1259
1269
|
// ../loader-utils/src/lib/path-utils/path.ts
|
|
1260
1270
|
var path_exports = {};
|
|
1261
1271
|
__export(path_exports, {
|
|
@@ -1289,14 +1299,63 @@
|
|
|
1289
1299
|
}
|
|
1290
1300
|
});
|
|
1291
1301
|
|
|
1292
|
-
// (disabled)
|
|
1302
|
+
// (disabled):fs
|
|
1293
1303
|
var require_fs = __commonJS({
|
|
1294
|
-
"(disabled)
|
|
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
|
+
}
|
|
1295
1355
|
}
|
|
1296
1356
|
});
|
|
1297
1357
|
|
|
1298
1358
|
// ../loader-utils/src/index.ts
|
|
1299
|
-
var fs;
|
|
1300
1359
|
var init_src2 = __esm({
|
|
1301
1360
|
"../loader-utils/src/index.ts"() {
|
|
1302
1361
|
init_assert();
|
|
@@ -1309,9 +1368,9 @@
|
|
|
1309
1368
|
init_request_scheduler();
|
|
1310
1369
|
init_file_aliases();
|
|
1311
1370
|
init_json_loader();
|
|
1371
|
+
init_memory_conversion_utils();
|
|
1312
1372
|
init_path();
|
|
1313
|
-
|
|
1314
|
-
fs = __toModule(require_fs());
|
|
1373
|
+
init_fs();
|
|
1315
1374
|
}
|
|
1316
1375
|
});
|
|
1317
1376
|
|
|
@@ -1521,7 +1580,7 @@
|
|
|
1521
1580
|
// src/lib/fetch/read-array-buffer.ts
|
|
1522
1581
|
async function readArrayBuffer(file, start, length) {
|
|
1523
1582
|
if (typeof file === "number") {
|
|
1524
|
-
return await
|
|
1583
|
+
return await fs_exports._readToArrayBuffer(file, start, length);
|
|
1525
1584
|
}
|
|
1526
1585
|
if (!(file instanceof Blob)) {
|
|
1527
1586
|
file = new Blob([file]);
|
|
@@ -1544,11 +1603,11 @@
|
|
|
1544
1603
|
});
|
|
1545
1604
|
|
|
1546
1605
|
// src/lib/fetch/read-file.ts
|
|
1547
|
-
function
|
|
1606
|
+
function readFileSync2(url, options = {}) {
|
|
1548
1607
|
url = resolvePath(url);
|
|
1549
1608
|
if (!isBrowser) {
|
|
1550
|
-
const buffer =
|
|
1551
|
-
return typeof buffer !== "string" ?
|
|
1609
|
+
const buffer = fs_exports.readFileSync(url, options);
|
|
1610
|
+
return typeof buffer !== "string" ? toArrayBuffer2(buffer) : buffer;
|
|
1552
1611
|
}
|
|
1553
1612
|
if (!options.nothrow) {
|
|
1554
1613
|
assert(false);
|
|
@@ -1563,17 +1622,17 @@
|
|
|
1563
1622
|
});
|
|
1564
1623
|
|
|
1565
1624
|
// src/lib/fetch/write-file.ts
|
|
1566
|
-
async function
|
|
1625
|
+
async function writeFile2(filePath, arrayBufferOrString, options) {
|
|
1567
1626
|
filePath = resolvePath(filePath);
|
|
1568
1627
|
if (!isBrowser) {
|
|
1569
|
-
await
|
|
1628
|
+
await fs_exports.writeFile(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
|
|
1570
1629
|
}
|
|
1571
1630
|
assert(false);
|
|
1572
1631
|
}
|
|
1573
|
-
function
|
|
1632
|
+
function writeFileSync2(filePath, arrayBufferOrString, options) {
|
|
1574
1633
|
filePath = resolvePath(filePath);
|
|
1575
1634
|
if (!isBrowser) {
|
|
1576
|
-
|
|
1635
|
+
fs_exports.writeFileSync(filePath, toBuffer2(arrayBufferOrString), { flag: "w" });
|
|
1577
1636
|
}
|
|
1578
1637
|
assert(false);
|
|
1579
1638
|
}
|
|
@@ -1584,12 +1643,12 @@
|
|
|
1584
1643
|
}
|
|
1585
1644
|
});
|
|
1586
1645
|
|
|
1587
|
-
//
|
|
1646
|
+
// node_modules/@probe.gl/env/dist/lib/is-electron.js
|
|
1588
1647
|
function isElectron(mockUserAgent) {
|
|
1589
1648
|
if (typeof window !== "undefined" && typeof window.process === "object" && window.process.type === "renderer") {
|
|
1590
1649
|
return true;
|
|
1591
1650
|
}
|
|
1592
|
-
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions
|
|
1651
|
+
if (typeof process !== "undefined" && typeof process.versions === "object" && Boolean(process.versions["electron"])) {
|
|
1593
1652
|
return true;
|
|
1594
1653
|
}
|
|
1595
1654
|
const realUserAgent = typeof navigator === "object" && typeof navigator.userAgent === "string" && navigator.userAgent;
|
|
@@ -1600,59 +1659,54 @@
|
|
|
1600
1659
|
return false;
|
|
1601
1660
|
}
|
|
1602
1661
|
var init_is_electron = __esm({
|
|
1603
|
-
"
|
|
1662
|
+
"node_modules/@probe.gl/env/dist/lib/is-electron.js"() {
|
|
1604
1663
|
}
|
|
1605
1664
|
});
|
|
1606
1665
|
|
|
1607
|
-
//
|
|
1666
|
+
// node_modules/@probe.gl/env/dist/lib/is-browser.js
|
|
1608
1667
|
function isBrowser3() {
|
|
1609
1668
|
const isNode = typeof process === "object" && String(process) === "[object process]" && !process.browser;
|
|
1610
1669
|
return !isNode || isElectron();
|
|
1611
1670
|
}
|
|
1612
1671
|
var init_is_browser = __esm({
|
|
1613
|
-
"
|
|
1672
|
+
"node_modules/@probe.gl/env/dist/lib/is-browser.js"() {
|
|
1614
1673
|
init_is_electron();
|
|
1615
1674
|
}
|
|
1616
1675
|
});
|
|
1617
1676
|
|
|
1618
|
-
//
|
|
1619
|
-
var
|
|
1677
|
+
// node_modules/@probe.gl/env/dist/lib/globals.js
|
|
1678
|
+
var self2, window2, document2, process2, console2, navigator2;
|
|
1620
1679
|
var init_globals3 = __esm({
|
|
1621
|
-
"
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
};
|
|
1629
|
-
self_3 = globals3.self || globals3.window || globals3.global;
|
|
1630
|
-
window_3 = globals3.window || globals3.self || globals3.global;
|
|
1631
|
-
document_3 = globals3.document || {};
|
|
1632
|
-
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 || {};
|
|
1633
1687
|
}
|
|
1634
1688
|
});
|
|
1635
1689
|
|
|
1636
|
-
//
|
|
1690
|
+
// node_modules/@probe.gl/env/dist/utils/globals.js
|
|
1637
1691
|
var VERSION4, isBrowser4;
|
|
1638
1692
|
var init_globals4 = __esm({
|
|
1639
|
-
"
|
|
1693
|
+
"node_modules/@probe.gl/env/dist/utils/globals.js"() {
|
|
1640
1694
|
init_is_browser();
|
|
1641
1695
|
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
1642
1696
|
isBrowser4 = isBrowser3();
|
|
1643
1697
|
}
|
|
1644
1698
|
});
|
|
1645
1699
|
|
|
1646
|
-
//
|
|
1647
|
-
var
|
|
1648
|
-
"
|
|
1700
|
+
// node_modules/@probe.gl/env/dist/index.js
|
|
1701
|
+
var init_dist2 = __esm({
|
|
1702
|
+
"node_modules/@probe.gl/env/dist/index.js"() {
|
|
1649
1703
|
init_globals4();
|
|
1650
1704
|
init_globals3();
|
|
1651
1705
|
init_is_browser();
|
|
1652
1706
|
}
|
|
1653
1707
|
});
|
|
1654
1708
|
|
|
1655
|
-
//
|
|
1709
|
+
// node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
1656
1710
|
function getStorage(type) {
|
|
1657
1711
|
try {
|
|
1658
1712
|
const storage = window[type];
|
|
@@ -1666,35 +1720,28 @@
|
|
|
1666
1720
|
}
|
|
1667
1721
|
var LocalStorage;
|
|
1668
1722
|
var init_local_storage = __esm({
|
|
1669
|
-
"
|
|
1723
|
+
"node_modules/@probe.gl/log/dist/utils/local-storage.js"() {
|
|
1670
1724
|
init_defineProperty();
|
|
1671
1725
|
LocalStorage = class {
|
|
1672
|
-
constructor(id) {
|
|
1673
|
-
let defaultSettings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1726
|
+
constructor(id, defaultConfig) {
|
|
1674
1727
|
let type = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "sessionStorage";
|
|
1675
1728
|
_defineProperty(this, "storage", void 0);
|
|
1676
1729
|
_defineProperty(this, "id", void 0);
|
|
1677
|
-
_defineProperty(this, "config",
|
|
1730
|
+
_defineProperty(this, "config", void 0);
|
|
1678
1731
|
this.storage = getStorage(type);
|
|
1679
1732
|
this.id = id;
|
|
1680
|
-
this.config =
|
|
1681
|
-
Object.assign(this.config, defaultSettings);
|
|
1733
|
+
this.config = defaultConfig;
|
|
1682
1734
|
this._loadConfiguration();
|
|
1683
1735
|
}
|
|
1684
1736
|
getConfiguration() {
|
|
1685
1737
|
return this.config;
|
|
1686
1738
|
}
|
|
1687
1739
|
setConfiguration(configuration) {
|
|
1688
|
-
this.config = {};
|
|
1689
|
-
return this.updateConfiguration(configuration);
|
|
1690
|
-
}
|
|
1691
|
-
updateConfiguration(configuration) {
|
|
1692
1740
|
Object.assign(this.config, configuration);
|
|
1693
1741
|
if (this.storage) {
|
|
1694
1742
|
const serialized = JSON.stringify(this.config);
|
|
1695
1743
|
this.storage.setItem(this.id, serialized);
|
|
1696
1744
|
}
|
|
1697
|
-
return this;
|
|
1698
1745
|
}
|
|
1699
1746
|
_loadConfiguration() {
|
|
1700
1747
|
let configuration = {};
|
|
@@ -1709,7 +1756,7 @@
|
|
|
1709
1756
|
}
|
|
1710
1757
|
});
|
|
1711
1758
|
|
|
1712
|
-
//
|
|
1759
|
+
// node_modules/@probe.gl/log/dist/utils/formatters.js
|
|
1713
1760
|
function formatTime(ms) {
|
|
1714
1761
|
let formatted;
|
|
1715
1762
|
if (ms < 10) {
|
|
@@ -1740,31 +1787,35 @@
|
|
|
1740
1787
|
return ["".concat(message, " %c+"), style];
|
|
1741
1788
|
}
|
|
1742
1789
|
var init_formatters = __esm({
|
|
1743
|
-
"
|
|
1790
|
+
"node_modules/@probe.gl/log/dist/utils/formatters.js"() {
|
|
1744
1791
|
}
|
|
1745
1792
|
});
|
|
1746
1793
|
|
|
1747
|
-
//
|
|
1794
|
+
// node_modules/@probe.gl/log/dist/utils/color.js
|
|
1748
1795
|
function getColor(color) {
|
|
1749
|
-
|
|
1796
|
+
if (typeof color !== "string") {
|
|
1797
|
+
return color;
|
|
1798
|
+
}
|
|
1799
|
+
color = color.toUpperCase();
|
|
1800
|
+
return COLOR[color] || COLOR.WHITE;
|
|
1750
1801
|
}
|
|
1751
1802
|
function addColor(string, color, background) {
|
|
1752
1803
|
if (!isBrowser3 && typeof string === "string") {
|
|
1753
1804
|
if (color) {
|
|
1754
|
-
|
|
1755
|
-
string = "[".concat(
|
|
1805
|
+
const colorCode = getColor(color);
|
|
1806
|
+
string = "[".concat(colorCode, "m").concat(string, "[39m");
|
|
1756
1807
|
}
|
|
1757
1808
|
if (background) {
|
|
1758
|
-
|
|
1759
|
-
string = "[".concat(
|
|
1809
|
+
const colorCode = getColor(background);
|
|
1810
|
+
string = "[".concat(colorCode + BACKGROUND_INCREMENT, "m").concat(string, "[49m");
|
|
1760
1811
|
}
|
|
1761
1812
|
}
|
|
1762
1813
|
return string;
|
|
1763
1814
|
}
|
|
1764
|
-
var COLOR;
|
|
1815
|
+
var COLOR, BACKGROUND_INCREMENT;
|
|
1765
1816
|
var init_color = __esm({
|
|
1766
|
-
"
|
|
1767
|
-
|
|
1817
|
+
"node_modules/@probe.gl/log/dist/utils/color.js"() {
|
|
1818
|
+
init_dist2();
|
|
1768
1819
|
(function(COLOR2) {
|
|
1769
1820
|
COLOR2[COLOR2["BLACK"] = 30] = "BLACK";
|
|
1770
1821
|
COLOR2[COLOR2["RED"] = 31] = "RED";
|
|
@@ -1783,47 +1834,50 @@
|
|
|
1783
1834
|
COLOR2[COLOR2["BRIGHT_CYAN"] = 96] = "BRIGHT_CYAN";
|
|
1784
1835
|
COLOR2[COLOR2["BRIGHT_WHITE"] = 97] = "BRIGHT_WHITE";
|
|
1785
1836
|
})(COLOR || (COLOR = {}));
|
|
1837
|
+
BACKGROUND_INCREMENT = 10;
|
|
1786
1838
|
}
|
|
1787
1839
|
});
|
|
1788
1840
|
|
|
1789
|
-
//
|
|
1841
|
+
// node_modules/@probe.gl/log/dist/utils/autobind.js
|
|
1790
1842
|
function autobind(obj) {
|
|
1791
1843
|
let predefined = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ["constructor"];
|
|
1792
1844
|
const proto = Object.getPrototypeOf(obj);
|
|
1793
1845
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
1846
|
+
const object = obj;
|
|
1794
1847
|
for (const key of propNames) {
|
|
1795
|
-
|
|
1848
|
+
const value = object[key];
|
|
1849
|
+
if (typeof value === "function") {
|
|
1796
1850
|
if (!predefined.find((name) => key === name)) {
|
|
1797
|
-
|
|
1851
|
+
object[key] = value.bind(obj);
|
|
1798
1852
|
}
|
|
1799
1853
|
}
|
|
1800
1854
|
}
|
|
1801
1855
|
}
|
|
1802
1856
|
var init_autobind = __esm({
|
|
1803
|
-
"
|
|
1857
|
+
"node_modules/@probe.gl/log/dist/utils/autobind.js"() {
|
|
1804
1858
|
}
|
|
1805
1859
|
});
|
|
1806
1860
|
|
|
1807
|
-
//
|
|
1861
|
+
// node_modules/@probe.gl/log/dist/utils/assert.js
|
|
1808
1862
|
function assert3(condition, message) {
|
|
1809
1863
|
if (!condition) {
|
|
1810
1864
|
throw new Error(message || "Assertion failed");
|
|
1811
1865
|
}
|
|
1812
1866
|
}
|
|
1813
1867
|
var init_assert3 = __esm({
|
|
1814
|
-
"
|
|
1868
|
+
"node_modules/@probe.gl/log/dist/utils/assert.js"() {
|
|
1815
1869
|
}
|
|
1816
1870
|
});
|
|
1817
1871
|
|
|
1818
|
-
//
|
|
1872
|
+
// node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
|
|
1819
1873
|
function getHiResTimestamp2() {
|
|
1820
1874
|
let timestamp;
|
|
1821
|
-
if (isBrowser3 &&
|
|
1875
|
+
if (isBrowser3() && window2.performance) {
|
|
1822
1876
|
var _window$performance, _window$performance$n;
|
|
1823
|
-
timestamp =
|
|
1824
|
-
} else if ("hrtime" in
|
|
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) {
|
|
1825
1879
|
var _process$hrtime;
|
|
1826
|
-
const timeParts =
|
|
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);
|
|
1827
1881
|
timestamp = timeParts[0] * 1e3 + timeParts[1] / 1e6;
|
|
1828
1882
|
} else {
|
|
1829
1883
|
timestamp = Date.now();
|
|
@@ -1831,18 +1885,12 @@
|
|
|
1831
1885
|
return timestamp;
|
|
1832
1886
|
}
|
|
1833
1887
|
var init_hi_res_timestamp2 = __esm({
|
|
1834
|
-
"
|
|
1835
|
-
|
|
1836
|
-
}
|
|
1837
|
-
});
|
|
1838
|
-
|
|
1839
|
-
// (disabled):../../node_modules/@probe.gl/log/dist/esm/node/node-asciify-image
|
|
1840
|
-
var init_node_asciify_image = __esm({
|
|
1841
|
-
"(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();
|
|
1842
1890
|
}
|
|
1843
1891
|
});
|
|
1844
1892
|
|
|
1845
|
-
//
|
|
1893
|
+
// node_modules/@probe.gl/log/dist/log.js
|
|
1846
1894
|
function noop() {
|
|
1847
1895
|
}
|
|
1848
1896
|
function normalizeLogLevel(logLevel) {
|
|
@@ -1908,11 +1956,7 @@
|
|
|
1908
1956
|
message = "",
|
|
1909
1957
|
scale = 1
|
|
1910
1958
|
} = _ref2;
|
|
1911
|
-
|
|
1912
|
-
image,
|
|
1913
|
-
message,
|
|
1914
|
-
scale
|
|
1915
|
-
});
|
|
1959
|
+
console.warn("removed");
|
|
1916
1960
|
return noop;
|
|
1917
1961
|
}
|
|
1918
1962
|
function logImageInBrowser(_ref3) {
|
|
@@ -1951,26 +1995,25 @@
|
|
|
1951
1995
|
}
|
|
1952
1996
|
return "empty";
|
|
1953
1997
|
}
|
|
1954
|
-
var originalConsole,
|
|
1998
|
+
var originalConsole, DEFAULT_LOG_CONFIGURATION, cache, ONCE, Log;
|
|
1955
1999
|
var init_log = __esm({
|
|
1956
|
-
"
|
|
2000
|
+
"node_modules/@probe.gl/log/dist/log.js"() {
|
|
1957
2001
|
init_defineProperty();
|
|
1958
|
-
|
|
2002
|
+
init_dist2();
|
|
1959
2003
|
init_local_storage();
|
|
1960
2004
|
init_formatters();
|
|
1961
2005
|
init_color();
|
|
1962
2006
|
init_autobind();
|
|
1963
2007
|
init_assert3();
|
|
1964
2008
|
init_hi_res_timestamp2();
|
|
1965
|
-
init_node_asciify_image();
|
|
1966
2009
|
originalConsole = {
|
|
1967
|
-
debug: isBrowser3 ? console.debug || console.log : console.log,
|
|
2010
|
+
debug: isBrowser3() ? console.debug || console.log : console.log,
|
|
1968
2011
|
log: console.log,
|
|
1969
2012
|
info: console.info,
|
|
1970
2013
|
warn: console.warn,
|
|
1971
2014
|
error: console.error
|
|
1972
2015
|
};
|
|
1973
|
-
|
|
2016
|
+
DEFAULT_LOG_CONFIGURATION = {
|
|
1974
2017
|
enabled: true,
|
|
1975
2018
|
level: 0
|
|
1976
2019
|
};
|
|
@@ -1993,8 +2036,8 @@
|
|
|
1993
2036
|
_defineProperty(this, "userData", {});
|
|
1994
2037
|
_defineProperty(this, "LOG_THROTTLE_TIMEOUT", 0);
|
|
1995
2038
|
this.id = id;
|
|
1996
|
-
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_SETTINGS);
|
|
1997
2039
|
this.userData = {};
|
|
2040
|
+
this._storage = new LocalStorage("__probe-".concat(this.id, "__"), DEFAULT_LOG_CONFIGURATION);
|
|
1998
2041
|
this.timeStamp("".concat(this.id, " started"));
|
|
1999
2042
|
autobind(this);
|
|
2000
2043
|
Object.seal(this);
|
|
@@ -2028,13 +2071,13 @@
|
|
|
2028
2071
|
}
|
|
2029
2072
|
enable() {
|
|
2030
2073
|
let enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
2031
|
-
this._storage.
|
|
2074
|
+
this._storage.setConfiguration({
|
|
2032
2075
|
enabled
|
|
2033
2076
|
});
|
|
2034
2077
|
return this;
|
|
2035
2078
|
}
|
|
2036
2079
|
setLevel(level) {
|
|
2037
|
-
this._storage.
|
|
2080
|
+
this._storage.setConfiguration({
|
|
2038
2081
|
level
|
|
2039
2082
|
});
|
|
2040
2083
|
return this;
|
|
@@ -2043,7 +2086,7 @@
|
|
|
2043
2086
|
return this._storage.config[setting];
|
|
2044
2087
|
}
|
|
2045
2088
|
set(setting, value) {
|
|
2046
|
-
this._storage.
|
|
2089
|
+
this._storage.setConfiguration({
|
|
2047
2090
|
[setting]: value
|
|
2048
2091
|
});
|
|
2049
2092
|
}
|
|
@@ -2082,9 +2125,6 @@
|
|
|
2082
2125
|
return this._getLogFunction(logLevel, message, console.info, arguments);
|
|
2083
2126
|
}
|
|
2084
2127
|
once(logLevel, message) {
|
|
2085
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
2086
|
-
args[_key - 2] = arguments[_key];
|
|
2087
|
-
}
|
|
2088
2128
|
return this._getLogFunction(logLevel, message, originalConsole.debug || originalConsole.info, arguments, ONCE);
|
|
2089
2129
|
}
|
|
2090
2130
|
table(logLevel, table, columns) {
|
|
@@ -2106,7 +2146,7 @@
|
|
|
2106
2146
|
if (!this._shouldLog(logLevel || priority)) {
|
|
2107
2147
|
return noop;
|
|
2108
2148
|
}
|
|
2109
|
-
return isBrowser3 ? logImageInBrowser({
|
|
2149
|
+
return isBrowser3() ? logImageInBrowser({
|
|
2110
2150
|
image,
|
|
2111
2151
|
message,
|
|
2112
2152
|
scale
|
|
@@ -2179,7 +2219,7 @@
|
|
|
2179
2219
|
opts.delta = this.getDelta();
|
|
2180
2220
|
this._deltaTs = getHiResTimestamp2();
|
|
2181
2221
|
const tag = opts.tag || opts.message;
|
|
2182
|
-
if (opts.once) {
|
|
2222
|
+
if (opts.once && tag) {
|
|
2183
2223
|
if (!cache[tag]) {
|
|
2184
2224
|
cache[tag] = getHiResTimestamp2();
|
|
2185
2225
|
} else {
|
|
@@ -2196,13 +2236,13 @@
|
|
|
2196
2236
|
}
|
|
2197
2237
|
});
|
|
2198
2238
|
|
|
2199
|
-
//
|
|
2200
|
-
var
|
|
2201
|
-
var
|
|
2202
|
-
"
|
|
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"() {
|
|
2203
2243
|
init_log();
|
|
2204
2244
|
init_log();
|
|
2205
|
-
|
|
2245
|
+
dist_default = new Log({
|
|
2206
2246
|
id: "@probe.gl/log"
|
|
2207
2247
|
});
|
|
2208
2248
|
}
|
|
@@ -2212,7 +2252,7 @@
|
|
|
2212
2252
|
var probeLog, NullLog, ConsoleLog;
|
|
2213
2253
|
var init_loggers = __esm({
|
|
2214
2254
|
"src/lib/loader-utils/loggers.ts"() {
|
|
2215
|
-
|
|
2255
|
+
init_dist3();
|
|
2216
2256
|
probeLog = new Log({ id: "loaders.gl" });
|
|
2217
2257
|
NullLog = class {
|
|
2218
2258
|
log() {
|
|
@@ -2315,20 +2355,6 @@
|
|
|
2315
2355
|
validateOptions(options, loaders);
|
|
2316
2356
|
return normalizeOptionsInternal(loader, options, url);
|
|
2317
2357
|
}
|
|
2318
|
-
function getFetchFunction(options, context) {
|
|
2319
|
-
const globalOptions = getGlobalLoaderOptions();
|
|
2320
|
-
const fetchOptions = options || globalOptions;
|
|
2321
|
-
if (typeof fetchOptions.fetch === "function") {
|
|
2322
|
-
return fetchOptions.fetch;
|
|
2323
|
-
}
|
|
2324
|
-
if (isObject(fetchOptions.fetch)) {
|
|
2325
|
-
return (url) => fetchFile(url, fetchOptions);
|
|
2326
|
-
}
|
|
2327
|
-
if (context?.fetch) {
|
|
2328
|
-
return context?.fetch;
|
|
2329
|
-
}
|
|
2330
|
-
return fetchFile;
|
|
2331
|
-
}
|
|
2332
2358
|
function validateOptions(options, loaders) {
|
|
2333
2359
|
validateOptionsObject(options, null, DEFAULT_LOADER_OPTIONS, REMOVED_LOADER_OPTIONS, loaders);
|
|
2334
2360
|
for (const loader of loaders) {
|
|
@@ -2407,7 +2433,6 @@
|
|
|
2407
2433
|
var init_option_utils = __esm({
|
|
2408
2434
|
"src/lib/loader-utils/option-utils.ts"() {
|
|
2409
2435
|
init_is_type();
|
|
2410
|
-
init_fetch_file();
|
|
2411
2436
|
init_loggers();
|
|
2412
2437
|
init_option_defaults();
|
|
2413
2438
|
getGlobalLoaderOptions = () => {
|
|
@@ -2498,7 +2523,7 @@
|
|
|
2498
2523
|
var log;
|
|
2499
2524
|
var init_log2 = __esm({
|
|
2500
2525
|
"src/lib/utils/log.ts"() {
|
|
2501
|
-
|
|
2526
|
+
init_dist3();
|
|
2502
2527
|
log = new Log({ id: "loaders.gl" });
|
|
2503
2528
|
}
|
|
2504
2529
|
});
|
|
@@ -2771,7 +2796,7 @@
|
|
|
2771
2796
|
if (done) {
|
|
2772
2797
|
return;
|
|
2773
2798
|
}
|
|
2774
|
-
yield
|
|
2799
|
+
yield toArrayBuffer2(value);
|
|
2775
2800
|
}
|
|
2776
2801
|
} catch (error) {
|
|
2777
2802
|
reader.releaseLock();
|
|
@@ -2779,7 +2804,7 @@
|
|
|
2779
2804
|
}
|
|
2780
2805
|
async function* makeNodeStreamIterator(stream, options) {
|
|
2781
2806
|
for await (const chunk of stream) {
|
|
2782
|
-
yield
|
|
2807
|
+
yield toArrayBuffer2(chunk);
|
|
2783
2808
|
}
|
|
2784
2809
|
}
|
|
2785
2810
|
var init_make_stream_iterator = __esm({
|
|
@@ -2917,6 +2942,29 @@
|
|
|
2917
2942
|
}
|
|
2918
2943
|
});
|
|
2919
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
|
+
|
|
2920
2968
|
// src/lib/loader-utils/loader-context.ts
|
|
2921
2969
|
function getLoaderContext(context, options, previousContext = null) {
|
|
2922
2970
|
if (previousContext) {
|
|
@@ -2947,7 +2995,7 @@
|
|
|
2947
2995
|
}
|
|
2948
2996
|
var init_loader_context = __esm({
|
|
2949
2997
|
"src/lib/loader-utils/loader-context.ts"() {
|
|
2950
|
-
|
|
2998
|
+
init_get_fetch_function();
|
|
2951
2999
|
}
|
|
2952
3000
|
});
|
|
2953
3001
|
|
|
@@ -3156,7 +3204,7 @@
|
|
|
3156
3204
|
"src/lib/api/load.ts"() {
|
|
3157
3205
|
init_is_type();
|
|
3158
3206
|
init_normalize_loader();
|
|
3159
|
-
|
|
3207
|
+
init_get_fetch_function();
|
|
3160
3208
|
init_parse();
|
|
3161
3209
|
}
|
|
3162
3210
|
});
|
|
@@ -3186,7 +3234,7 @@
|
|
|
3186
3234
|
var init_load_in_batches = __esm({
|
|
3187
3235
|
"src/lib/api/load-in-batches.ts"() {
|
|
3188
3236
|
init_normalize_loader();
|
|
3189
|
-
|
|
3237
|
+
init_get_fetch_function();
|
|
3190
3238
|
init_parse_in_batches();
|
|
3191
3239
|
}
|
|
3192
3240
|
});
|
|
@@ -3217,7 +3265,7 @@
|
|
|
3217
3265
|
}
|
|
3218
3266
|
if (!isBrowser && writer.encodeURLtoURL) {
|
|
3219
3267
|
const tmpInputFilename = getTemporaryFilename("input");
|
|
3220
|
-
await
|
|
3268
|
+
await writeFile2(tmpInputFilename, data);
|
|
3221
3269
|
const tmpOutputFilename = getTemporaryFilename("output");
|
|
3222
3270
|
const outputFilename = await encodeURLtoURL(tmpInputFilename, tmpOutputFilename, writer, options);
|
|
3223
3271
|
const response = await fetchFile(outputFilename);
|
|
@@ -3279,11 +3327,11 @@
|
|
|
3279
3327
|
// src/lib/api/save.ts
|
|
3280
3328
|
async function save(data, url, writer, options) {
|
|
3281
3329
|
const encodedData = await encode(data, writer, options);
|
|
3282
|
-
return await
|
|
3330
|
+
return await writeFile2(url, encodedData);
|
|
3283
3331
|
}
|
|
3284
3332
|
function saveSync(data, url, writer, options) {
|
|
3285
3333
|
const encodedData = encodeSync(data, writer, options);
|
|
3286
|
-
return
|
|
3334
|
+
return writeFileSync2(url, encodedData);
|
|
3287
3335
|
}
|
|
3288
3336
|
var init_save = __esm({
|
|
3289
3337
|
"src/lib/api/save.ts"() {
|
|
@@ -3393,12 +3441,12 @@
|
|
|
3393
3441
|
const progressStream = new ReadableStream({
|
|
3394
3442
|
async start(controller) {
|
|
3395
3443
|
const reader = body.getReader();
|
|
3396
|
-
await
|
|
3444
|
+
await read2(controller, reader, 0, totalBytes, onProgress, onDone, onError);
|
|
3397
3445
|
}
|
|
3398
3446
|
});
|
|
3399
3447
|
return new Response(progressStream);
|
|
3400
3448
|
}
|
|
3401
|
-
async function
|
|
3449
|
+
async function read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError) {
|
|
3402
3450
|
try {
|
|
3403
3451
|
const { done, value } = await reader.read();
|
|
3404
3452
|
if (done) {
|
|
@@ -3410,7 +3458,7 @@
|
|
|
3410
3458
|
const percent = Math.round(loadedBytes / totalBytes * 100);
|
|
3411
3459
|
onProgress(percent, { loadedBytes, totalBytes });
|
|
3412
3460
|
controller.enqueue(value);
|
|
3413
|
-
await
|
|
3461
|
+
await read2(controller, reader, loadedBytes, totalBytes, onProgress, onDone, onError);
|
|
3414
3462
|
} catch (error) {
|
|
3415
3463
|
controller.error(error);
|
|
3416
3464
|
onError(error);
|
|
@@ -3548,7 +3596,7 @@
|
|
|
3548
3596
|
parseInBatches: () => parseInBatches,
|
|
3549
3597
|
parseSync: () => parseSync,
|
|
3550
3598
|
readArrayBuffer: () => readArrayBuffer,
|
|
3551
|
-
readFileSync: () =>
|
|
3599
|
+
readFileSync: () => readFileSync2,
|
|
3552
3600
|
registerLoaders: () => registerLoaders,
|
|
3553
3601
|
resolvePath: () => resolvePath,
|
|
3554
3602
|
save: () => save,
|
|
@@ -3559,8 +3607,8 @@
|
|
|
3559
3607
|
setLoaderOptions: () => setGlobalOptions,
|
|
3560
3608
|
setPathPrefix: () => setPathPrefix,
|
|
3561
3609
|
window: () => window_,
|
|
3562
|
-
writeFile: () =>
|
|
3563
|
-
writeFileSync: () =>
|
|
3610
|
+
writeFile: () => writeFile2,
|
|
3611
|
+
writeFileSync: () => writeFileSync2
|
|
3564
3612
|
});
|
|
3565
3613
|
var init_src3 = __esm({
|
|
3566
3614
|
"src/index.ts"() {
|