@loaders.gl/tile-converter 4.0.0-alpha.23 → 4.0.0-alpha.25
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/3d-tiles-converter/helpers/b3dm-converter.d.ts +4 -4
- package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +1 -1
- package/dist/converter.min.js +105 -105
- package/dist/dist.min.js +725 -652
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +18 -18
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/load-i3s.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +16 -14
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +6 -18
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +83 -44
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +13 -83
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +15 -8
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/types.js.map +1 -1
- package/dist/es5/pgm-loader.js +11 -3
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +8 -8
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/load-i3s.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +5 -15
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/feature-attributes.js +5 -5
- package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +76 -34
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +10 -80
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +15 -9
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-converter/types.js.map +1 -1
- package/dist/esm/i3s-server/bin/i3s-server.min.js +75 -75
- package/dist/esm/pgm-loader.js +7 -4
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +4 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/feature-attributes.d.ts +6 -6
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/types.d.ts +13 -5
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/pgm-loader.d.ts +9 -2
- package/dist/pgm-loader.d.ts.map +1 -1
- package/dist/slpk-extractor.min.js +42 -42
- package/package.json +14 -14
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +8 -8
- package/src/3d-tiles-converter/helpers/load-i3s.ts +1 -0
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +14 -35
- package/src/i3s-converter/helpers/feature-attributes.ts +14 -11
- package/src/i3s-converter/helpers/geometry-attributes.ts +80 -50
- package/src/i3s-converter/helpers/geometry-converter.ts +41 -177
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +30 -9
- package/src/i3s-converter/i3s-converter.ts +0 -2
- package/src/i3s-converter/types.ts +14 -5
- package/src/pgm-loader.ts +15 -7
- package/dist/3d-tiles-converter/3d-tiles-converter.js +0 -279
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +0 -271
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -23
- package/dist/3d-tiles-converter/helpers/load-i3s.js +0 -42
- package/dist/3d-tiles-converter/helpers/texture-atlas.js +0 -54
- package/dist/3d-tiles-converter/json-templates/tileset.js +0 -43
- package/dist/bundle.js +0 -5
- package/dist/constants.js +0 -4
- package/dist/converter-cli.js +0 -222
- package/dist/deps-installer/deps-installer.js +0 -89
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +0 -179
- package/dist/i3s-converter/helpers/coordinate-converter.js +0 -122
- package/dist/i3s-converter/helpers/create-scene-server-path.js +0 -28
- package/dist/i3s-converter/helpers/feature-attributes.js +0 -218
- package/dist/i3s-converter/helpers/geometry-attributes.js +0 -203
- package/dist/i3s-converter/helpers/geometry-converter.js +0 -1321
- package/dist/i3s-converter/helpers/gltf-attributes.js +0 -129
- package/dist/i3s-converter/helpers/load-3d-tiles.js +0 -99
- package/dist/i3s-converter/helpers/node-debug.js +0 -120
- package/dist/i3s-converter/helpers/node-index-document.js +0 -271
- package/dist/i3s-converter/helpers/node-pages.js +0 -316
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +0 -100
- package/dist/i3s-converter/helpers/tileset-traversal.js +0 -29
- package/dist/i3s-converter/i3s-converter.js +0 -964
- package/dist/i3s-converter/json-templates/geometry-definitions.js +0 -87
- package/dist/i3s-converter/json-templates/layers.js +0 -139
- package/dist/i3s-converter/json-templates/metadata.js +0 -25
- package/dist/i3s-converter/json-templates/node.js +0 -89
- package/dist/i3s-converter/json-templates/scene-server.js +0 -31
- package/dist/i3s-converter/json-templates/shared-resources.js +0 -129
- package/dist/i3s-converter/json-templates/store.js +0 -103
- package/dist/i3s-converter/types.js +0 -17
- package/dist/i3s-server/app.js +0 -29
- package/dist/i3s-server/bin/www.js +0 -37
- package/dist/i3s-server/controllers/index-controller.js +0 -31
- package/dist/i3s-server/controllers/slpk-controller.js +0 -33
- package/dist/i3s-server/routes/index.js +0 -20
- package/dist/i3s-server/routes/slpk-router.js +0 -34
- package/dist/i3s-server/utils/create-scene-server.js +0 -22
- package/dist/i3s-server/utils/server-utils.js +0 -66
- package/dist/index.js +0 -10
- package/dist/lib/utils/cli-utils.js +0 -82
- package/dist/lib/utils/compress-util.js +0 -257
- package/dist/lib/utils/file-utils.js +0 -139
- package/dist/lib/utils/geometry-utils.js +0 -18
- package/dist/lib/utils/lod-conversion-utils.js +0 -76
- package/dist/lib/utils/queue.js +0 -18
- package/dist/lib/utils/statistic-utills.js +0 -64
- package/dist/lib/utils/write-queue.js +0 -80
- package/dist/pgm-loader.js +0 -24
- package/dist/slpk-extractor/slpk-extractor.js +0 -75
- package/dist/slpk-extractor-cli.js +0 -102
package/dist/dist.min.js
CHANGED
|
@@ -21238,13 +21238,13 @@ var require_minimatch = __commonJS({
|
|
|
21238
21238
|
var require_readdir_glob = __commonJS({
|
|
21239
21239
|
"../../node_modules/readdir-glob/index.js"(exports, module2) {
|
|
21240
21240
|
module2.exports = readdirGlob;
|
|
21241
|
-
var
|
|
21241
|
+
var fs7 = require("fs");
|
|
21242
21242
|
var { EventEmitter } = require("events");
|
|
21243
21243
|
var { Minimatch } = require_minimatch();
|
|
21244
21244
|
var { resolve: resolve2 } = require("path");
|
|
21245
21245
|
function readdir2(dir, strict) {
|
|
21246
21246
|
return new Promise((resolve3, reject) => {
|
|
21247
|
-
|
|
21247
|
+
fs7.readdir(dir, { withFileTypes: true }, (err, files) => {
|
|
21248
21248
|
if (err) {
|
|
21249
21249
|
switch (err.code) {
|
|
21250
21250
|
case "ENOTDIR":
|
|
@@ -21273,7 +21273,7 @@ var require_readdir_glob = __commonJS({
|
|
|
21273
21273
|
}
|
|
21274
21274
|
function stat3(file, followSymlinks) {
|
|
21275
21275
|
return new Promise((resolve3, reject) => {
|
|
21276
|
-
const statFunc = followSymlinks ?
|
|
21276
|
+
const statFunc = followSymlinks ? fs7.stat : fs7.lstat;
|
|
21277
21277
|
statFunc(file, (err, stats) => {
|
|
21278
21278
|
if (err) {
|
|
21279
21279
|
switch (err.code) {
|
|
@@ -23395,56 +23395,56 @@ var require_polyfills = __commonJS({
|
|
|
23395
23395
|
}
|
|
23396
23396
|
var chdir;
|
|
23397
23397
|
module2.exports = patch;
|
|
23398
|
-
function patch(
|
|
23398
|
+
function patch(fs7) {
|
|
23399
23399
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
23400
|
-
patchLchmod(
|
|
23401
|
-
}
|
|
23402
|
-
if (!
|
|
23403
|
-
patchLutimes(
|
|
23404
|
-
}
|
|
23405
|
-
|
|
23406
|
-
|
|
23407
|
-
|
|
23408
|
-
|
|
23409
|
-
|
|
23410
|
-
|
|
23411
|
-
|
|
23412
|
-
|
|
23413
|
-
|
|
23414
|
-
|
|
23415
|
-
|
|
23416
|
-
|
|
23417
|
-
|
|
23418
|
-
|
|
23419
|
-
|
|
23420
|
-
|
|
23421
|
-
|
|
23422
|
-
|
|
23423
|
-
if (
|
|
23424
|
-
|
|
23400
|
+
patchLchmod(fs7);
|
|
23401
|
+
}
|
|
23402
|
+
if (!fs7.lutimes) {
|
|
23403
|
+
patchLutimes(fs7);
|
|
23404
|
+
}
|
|
23405
|
+
fs7.chown = chownFix(fs7.chown);
|
|
23406
|
+
fs7.fchown = chownFix(fs7.fchown);
|
|
23407
|
+
fs7.lchown = chownFix(fs7.lchown);
|
|
23408
|
+
fs7.chmod = chmodFix(fs7.chmod);
|
|
23409
|
+
fs7.fchmod = chmodFix(fs7.fchmod);
|
|
23410
|
+
fs7.lchmod = chmodFix(fs7.lchmod);
|
|
23411
|
+
fs7.chownSync = chownFixSync(fs7.chownSync);
|
|
23412
|
+
fs7.fchownSync = chownFixSync(fs7.fchownSync);
|
|
23413
|
+
fs7.lchownSync = chownFixSync(fs7.lchownSync);
|
|
23414
|
+
fs7.chmodSync = chmodFixSync(fs7.chmodSync);
|
|
23415
|
+
fs7.fchmodSync = chmodFixSync(fs7.fchmodSync);
|
|
23416
|
+
fs7.lchmodSync = chmodFixSync(fs7.lchmodSync);
|
|
23417
|
+
fs7.stat = statFix(fs7.stat);
|
|
23418
|
+
fs7.fstat = statFix(fs7.fstat);
|
|
23419
|
+
fs7.lstat = statFix(fs7.lstat);
|
|
23420
|
+
fs7.statSync = statFixSync(fs7.statSync);
|
|
23421
|
+
fs7.fstatSync = statFixSync(fs7.fstatSync);
|
|
23422
|
+
fs7.lstatSync = statFixSync(fs7.lstatSync);
|
|
23423
|
+
if (fs7.chmod && !fs7.lchmod) {
|
|
23424
|
+
fs7.lchmod = function(path2, mode, cb) {
|
|
23425
23425
|
if (cb)
|
|
23426
23426
|
process.nextTick(cb);
|
|
23427
23427
|
};
|
|
23428
|
-
|
|
23428
|
+
fs7.lchmodSync = function() {
|
|
23429
23429
|
};
|
|
23430
23430
|
}
|
|
23431
|
-
if (
|
|
23432
|
-
|
|
23431
|
+
if (fs7.chown && !fs7.lchown) {
|
|
23432
|
+
fs7.lchown = function(path2, uid, gid, cb) {
|
|
23433
23433
|
if (cb)
|
|
23434
23434
|
process.nextTick(cb);
|
|
23435
23435
|
};
|
|
23436
|
-
|
|
23436
|
+
fs7.lchownSync = function() {
|
|
23437
23437
|
};
|
|
23438
23438
|
}
|
|
23439
23439
|
if (platform === "win32") {
|
|
23440
|
-
|
|
23440
|
+
fs7.rename = typeof fs7.rename !== "function" ? fs7.rename : function(fs$rename) {
|
|
23441
23441
|
function rename(from, to, cb) {
|
|
23442
23442
|
var start = Date.now();
|
|
23443
23443
|
var backoff = 0;
|
|
23444
23444
|
fs$rename(from, to, function CB(er) {
|
|
23445
23445
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
23446
23446
|
setTimeout(function() {
|
|
23447
|
-
|
|
23447
|
+
fs7.stat(to, function(stater, st) {
|
|
23448
23448
|
if (stater && stater.code === "ENOENT")
|
|
23449
23449
|
fs$rename(from, to, CB);
|
|
23450
23450
|
else
|
|
@@ -23462,33 +23462,33 @@ var require_polyfills = __commonJS({
|
|
|
23462
23462
|
if (Object.setPrototypeOf)
|
|
23463
23463
|
Object.setPrototypeOf(rename, fs$rename);
|
|
23464
23464
|
return rename;
|
|
23465
|
-
}(
|
|
23465
|
+
}(fs7.rename);
|
|
23466
23466
|
}
|
|
23467
|
-
|
|
23468
|
-
function
|
|
23467
|
+
fs7.read = typeof fs7.read !== "function" ? fs7.read : function(fs$read) {
|
|
23468
|
+
function read3(fd, buffer, offset, length, position, callback_) {
|
|
23469
23469
|
var callback;
|
|
23470
23470
|
if (callback_ && typeof callback_ === "function") {
|
|
23471
23471
|
var eagCounter = 0;
|
|
23472
23472
|
callback = function(er, _2, __) {
|
|
23473
23473
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
23474
23474
|
eagCounter++;
|
|
23475
|
-
return fs$read.call(
|
|
23475
|
+
return fs$read.call(fs7, fd, buffer, offset, length, position, callback);
|
|
23476
23476
|
}
|
|
23477
23477
|
callback_.apply(this, arguments);
|
|
23478
23478
|
};
|
|
23479
23479
|
}
|
|
23480
|
-
return fs$read.call(
|
|
23480
|
+
return fs$read.call(fs7, fd, buffer, offset, length, position, callback);
|
|
23481
23481
|
}
|
|
23482
23482
|
if (Object.setPrototypeOf)
|
|
23483
|
-
Object.setPrototypeOf(
|
|
23484
|
-
return
|
|
23485
|
-
}(
|
|
23486
|
-
|
|
23483
|
+
Object.setPrototypeOf(read3, fs$read);
|
|
23484
|
+
return read3;
|
|
23485
|
+
}(fs7.read);
|
|
23486
|
+
fs7.readSync = typeof fs7.readSync !== "function" ? fs7.readSync : function(fs$readSync) {
|
|
23487
23487
|
return function(fd, buffer, offset, length, position) {
|
|
23488
23488
|
var eagCounter = 0;
|
|
23489
23489
|
while (true) {
|
|
23490
23490
|
try {
|
|
23491
|
-
return fs$readSync.call(
|
|
23491
|
+
return fs$readSync.call(fs7, fd, buffer, offset, length, position);
|
|
23492
23492
|
} catch (er) {
|
|
23493
23493
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
23494
23494
|
eagCounter++;
|
|
@@ -23498,85 +23498,85 @@ var require_polyfills = __commonJS({
|
|
|
23498
23498
|
}
|
|
23499
23499
|
}
|
|
23500
23500
|
};
|
|
23501
|
-
}(
|
|
23502
|
-
function patchLchmod(
|
|
23503
|
-
|
|
23504
|
-
|
|
23501
|
+
}(fs7.readSync);
|
|
23502
|
+
function patchLchmod(fs8) {
|
|
23503
|
+
fs8.lchmod = function(path2, mode, callback) {
|
|
23504
|
+
fs8.open(path2, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
23505
23505
|
if (err) {
|
|
23506
23506
|
if (callback)
|
|
23507
23507
|
callback(err);
|
|
23508
23508
|
return;
|
|
23509
23509
|
}
|
|
23510
|
-
|
|
23511
|
-
|
|
23510
|
+
fs8.fchmod(fd, mode, function(err2) {
|
|
23511
|
+
fs8.close(fd, function(err22) {
|
|
23512
23512
|
if (callback)
|
|
23513
23513
|
callback(err2 || err22);
|
|
23514
23514
|
});
|
|
23515
23515
|
});
|
|
23516
23516
|
});
|
|
23517
23517
|
};
|
|
23518
|
-
|
|
23519
|
-
var fd =
|
|
23518
|
+
fs8.lchmodSync = function(path2, mode) {
|
|
23519
|
+
var fd = fs8.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
23520
23520
|
var threw = true;
|
|
23521
23521
|
var ret;
|
|
23522
23522
|
try {
|
|
23523
|
-
ret =
|
|
23523
|
+
ret = fs8.fchmodSync(fd, mode);
|
|
23524
23524
|
threw = false;
|
|
23525
23525
|
} finally {
|
|
23526
23526
|
if (threw) {
|
|
23527
23527
|
try {
|
|
23528
|
-
|
|
23528
|
+
fs8.closeSync(fd);
|
|
23529
23529
|
} catch (er) {
|
|
23530
23530
|
}
|
|
23531
23531
|
} else {
|
|
23532
|
-
|
|
23532
|
+
fs8.closeSync(fd);
|
|
23533
23533
|
}
|
|
23534
23534
|
}
|
|
23535
23535
|
return ret;
|
|
23536
23536
|
};
|
|
23537
23537
|
}
|
|
23538
|
-
function patchLutimes(
|
|
23539
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
23540
|
-
|
|
23541
|
-
|
|
23538
|
+
function patchLutimes(fs8) {
|
|
23539
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs8.futimes) {
|
|
23540
|
+
fs8.lutimes = function(path2, at, mt, cb) {
|
|
23541
|
+
fs8.open(path2, constants.O_SYMLINK, function(er, fd) {
|
|
23542
23542
|
if (er) {
|
|
23543
23543
|
if (cb)
|
|
23544
23544
|
cb(er);
|
|
23545
23545
|
return;
|
|
23546
23546
|
}
|
|
23547
|
-
|
|
23548
|
-
|
|
23547
|
+
fs8.futimes(fd, at, mt, function(er2) {
|
|
23548
|
+
fs8.close(fd, function(er22) {
|
|
23549
23549
|
if (cb)
|
|
23550
23550
|
cb(er2 || er22);
|
|
23551
23551
|
});
|
|
23552
23552
|
});
|
|
23553
23553
|
});
|
|
23554
23554
|
};
|
|
23555
|
-
|
|
23556
|
-
var fd =
|
|
23555
|
+
fs8.lutimesSync = function(path2, at, mt) {
|
|
23556
|
+
var fd = fs8.openSync(path2, constants.O_SYMLINK);
|
|
23557
23557
|
var ret;
|
|
23558
23558
|
var threw = true;
|
|
23559
23559
|
try {
|
|
23560
|
-
ret =
|
|
23560
|
+
ret = fs8.futimesSync(fd, at, mt);
|
|
23561
23561
|
threw = false;
|
|
23562
23562
|
} finally {
|
|
23563
23563
|
if (threw) {
|
|
23564
23564
|
try {
|
|
23565
|
-
|
|
23565
|
+
fs8.closeSync(fd);
|
|
23566
23566
|
} catch (er) {
|
|
23567
23567
|
}
|
|
23568
23568
|
} else {
|
|
23569
|
-
|
|
23569
|
+
fs8.closeSync(fd);
|
|
23570
23570
|
}
|
|
23571
23571
|
}
|
|
23572
23572
|
return ret;
|
|
23573
23573
|
};
|
|
23574
|
-
} else if (
|
|
23575
|
-
|
|
23574
|
+
} else if (fs8.futimes) {
|
|
23575
|
+
fs8.lutimes = function(_a, _b, _c, cb) {
|
|
23576
23576
|
if (cb)
|
|
23577
23577
|
process.nextTick(cb);
|
|
23578
23578
|
};
|
|
23579
|
-
|
|
23579
|
+
fs8.lutimesSync = function() {
|
|
23580
23580
|
};
|
|
23581
23581
|
}
|
|
23582
23582
|
}
|
|
@@ -23584,7 +23584,7 @@ var require_polyfills = __commonJS({
|
|
|
23584
23584
|
if (!orig)
|
|
23585
23585
|
return orig;
|
|
23586
23586
|
return function(target, mode, cb) {
|
|
23587
|
-
return orig.call(
|
|
23587
|
+
return orig.call(fs7, target, mode, function(er) {
|
|
23588
23588
|
if (chownErOk(er))
|
|
23589
23589
|
er = null;
|
|
23590
23590
|
if (cb)
|
|
@@ -23597,7 +23597,7 @@ var require_polyfills = __commonJS({
|
|
|
23597
23597
|
return orig;
|
|
23598
23598
|
return function(target, mode) {
|
|
23599
23599
|
try {
|
|
23600
|
-
return orig.call(
|
|
23600
|
+
return orig.call(fs7, target, mode);
|
|
23601
23601
|
} catch (er) {
|
|
23602
23602
|
if (!chownErOk(er))
|
|
23603
23603
|
throw er;
|
|
@@ -23608,7 +23608,7 @@ var require_polyfills = __commonJS({
|
|
|
23608
23608
|
if (!orig)
|
|
23609
23609
|
return orig;
|
|
23610
23610
|
return function(target, uid, gid, cb) {
|
|
23611
|
-
return orig.call(
|
|
23611
|
+
return orig.call(fs7, target, uid, gid, function(er) {
|
|
23612
23612
|
if (chownErOk(er))
|
|
23613
23613
|
er = null;
|
|
23614
23614
|
if (cb)
|
|
@@ -23621,7 +23621,7 @@ var require_polyfills = __commonJS({
|
|
|
23621
23621
|
return orig;
|
|
23622
23622
|
return function(target, uid, gid) {
|
|
23623
23623
|
try {
|
|
23624
|
-
return orig.call(
|
|
23624
|
+
return orig.call(fs7, target, uid, gid);
|
|
23625
23625
|
} catch (er) {
|
|
23626
23626
|
if (!chownErOk(er))
|
|
23627
23627
|
throw er;
|
|
@@ -23646,14 +23646,14 @@ var require_polyfills = __commonJS({
|
|
|
23646
23646
|
if (cb)
|
|
23647
23647
|
cb.apply(this, arguments);
|
|
23648
23648
|
}
|
|
23649
|
-
return options ? orig.call(
|
|
23649
|
+
return options ? orig.call(fs7, target, options, callback) : orig.call(fs7, target, callback);
|
|
23650
23650
|
};
|
|
23651
23651
|
}
|
|
23652
23652
|
function statFixSync(orig) {
|
|
23653
23653
|
if (!orig)
|
|
23654
23654
|
return orig;
|
|
23655
23655
|
return function(target, options) {
|
|
23656
|
-
var stats = options ? orig.call(
|
|
23656
|
+
var stats = options ? orig.call(fs7, target, options) : orig.call(fs7, target);
|
|
23657
23657
|
if (stats) {
|
|
23658
23658
|
if (stats.uid < 0)
|
|
23659
23659
|
stats.uid += 4294967296;
|
|
@@ -23684,7 +23684,7 @@ var require_legacy_streams = __commonJS({
|
|
|
23684
23684
|
"../../node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
|
23685
23685
|
var Stream = require("stream").Stream;
|
|
23686
23686
|
module2.exports = legacy;
|
|
23687
|
-
function legacy(
|
|
23687
|
+
function legacy(fs7) {
|
|
23688
23688
|
return {
|
|
23689
23689
|
ReadStream,
|
|
23690
23690
|
WriteStream
|
|
@@ -23729,7 +23729,7 @@ var require_legacy_streams = __commonJS({
|
|
|
23729
23729
|
});
|
|
23730
23730
|
return;
|
|
23731
23731
|
}
|
|
23732
|
-
|
|
23732
|
+
fs7.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
23733
23733
|
if (err) {
|
|
23734
23734
|
self2.emit("error", err);
|
|
23735
23735
|
self2.readable = false;
|
|
@@ -23769,7 +23769,7 @@ var require_legacy_streams = __commonJS({
|
|
|
23769
23769
|
this.busy = false;
|
|
23770
23770
|
this._queue = [];
|
|
23771
23771
|
if (this.fd === null) {
|
|
23772
|
-
this._open =
|
|
23772
|
+
this._open = fs7.open;
|
|
23773
23773
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
23774
23774
|
this.flush();
|
|
23775
23775
|
}
|
|
@@ -23804,7 +23804,7 @@ var require_clone = __commonJS({
|
|
|
23804
23804
|
// ../../node_modules/graceful-fs/graceful-fs.js
|
|
23805
23805
|
var require_graceful_fs = __commonJS({
|
|
23806
23806
|
"../../node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
|
23807
|
-
var
|
|
23807
|
+
var fs7 = require("fs");
|
|
23808
23808
|
var polyfills = require_polyfills();
|
|
23809
23809
|
var legacy = require_legacy_streams();
|
|
23810
23810
|
var clone2 = require_clone();
|
|
@@ -23836,12 +23836,12 @@ var require_graceful_fs = __commonJS({
|
|
|
23836
23836
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
23837
23837
|
console.error(m);
|
|
23838
23838
|
};
|
|
23839
|
-
if (!
|
|
23839
|
+
if (!fs7[gracefulQueue]) {
|
|
23840
23840
|
queue = global[gracefulQueue] || [];
|
|
23841
|
-
publishQueue(
|
|
23842
|
-
|
|
23843
|
-
function
|
|
23844
|
-
return fs$close.call(
|
|
23841
|
+
publishQueue(fs7, queue);
|
|
23842
|
+
fs7.close = function(fs$close) {
|
|
23843
|
+
function close2(fd, cb) {
|
|
23844
|
+
return fs$close.call(fs7, fd, function(err) {
|
|
23845
23845
|
if (!err) {
|
|
23846
23846
|
resetQueue();
|
|
23847
23847
|
}
|
|
@@ -23849,44 +23849,44 @@ var require_graceful_fs = __commonJS({
|
|
|
23849
23849
|
cb.apply(this, arguments);
|
|
23850
23850
|
});
|
|
23851
23851
|
}
|
|
23852
|
-
Object.defineProperty(
|
|
23852
|
+
Object.defineProperty(close2, previousSymbol, {
|
|
23853
23853
|
value: fs$close
|
|
23854
23854
|
});
|
|
23855
|
-
return
|
|
23856
|
-
}(
|
|
23857
|
-
|
|
23855
|
+
return close2;
|
|
23856
|
+
}(fs7.close);
|
|
23857
|
+
fs7.closeSync = function(fs$closeSync) {
|
|
23858
23858
|
function closeSync(fd) {
|
|
23859
|
-
fs$closeSync.apply(
|
|
23859
|
+
fs$closeSync.apply(fs7, arguments);
|
|
23860
23860
|
resetQueue();
|
|
23861
23861
|
}
|
|
23862
23862
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
23863
23863
|
value: fs$closeSync
|
|
23864
23864
|
});
|
|
23865
23865
|
return closeSync;
|
|
23866
|
-
}(
|
|
23866
|
+
}(fs7.closeSync);
|
|
23867
23867
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
23868
23868
|
process.on("exit", function() {
|
|
23869
|
-
debug(
|
|
23870
|
-
require("assert").equal(
|
|
23869
|
+
debug(fs7[gracefulQueue]);
|
|
23870
|
+
require("assert").equal(fs7[gracefulQueue].length, 0);
|
|
23871
23871
|
});
|
|
23872
23872
|
}
|
|
23873
23873
|
}
|
|
23874
23874
|
var queue;
|
|
23875
23875
|
if (!global[gracefulQueue]) {
|
|
23876
|
-
publishQueue(global,
|
|
23877
|
-
}
|
|
23878
|
-
module2.exports = patch(clone2(
|
|
23879
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
23880
|
-
module2.exports = patch(
|
|
23881
|
-
|
|
23882
|
-
}
|
|
23883
|
-
function patch(
|
|
23884
|
-
polyfills(
|
|
23885
|
-
|
|
23886
|
-
|
|
23887
|
-
|
|
23888
|
-
var fs$readFile =
|
|
23889
|
-
|
|
23876
|
+
publishQueue(global, fs7[gracefulQueue]);
|
|
23877
|
+
}
|
|
23878
|
+
module2.exports = patch(clone2(fs7));
|
|
23879
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs7.__patched) {
|
|
23880
|
+
module2.exports = patch(fs7);
|
|
23881
|
+
fs7.__patched = true;
|
|
23882
|
+
}
|
|
23883
|
+
function patch(fs8) {
|
|
23884
|
+
polyfills(fs8);
|
|
23885
|
+
fs8.gracefulify = patch;
|
|
23886
|
+
fs8.createReadStream = createReadStream3;
|
|
23887
|
+
fs8.createWriteStream = createWriteStream3;
|
|
23888
|
+
var fs$readFile = fs8.readFile;
|
|
23889
|
+
fs8.readFile = readFile2;
|
|
23890
23890
|
function readFile2(path2, options, cb) {
|
|
23891
23891
|
if (typeof options === "function")
|
|
23892
23892
|
cb = options, options = null;
|
|
@@ -23902,8 +23902,8 @@ var require_graceful_fs = __commonJS({
|
|
|
23902
23902
|
});
|
|
23903
23903
|
}
|
|
23904
23904
|
}
|
|
23905
|
-
var fs$writeFile =
|
|
23906
|
-
|
|
23905
|
+
var fs$writeFile = fs8.writeFile;
|
|
23906
|
+
fs8.writeFile = writeFile4;
|
|
23907
23907
|
function writeFile4(path2, data, options, cb) {
|
|
23908
23908
|
if (typeof options === "function")
|
|
23909
23909
|
cb = options, options = null;
|
|
@@ -23919,9 +23919,9 @@ var require_graceful_fs = __commonJS({
|
|
|
23919
23919
|
});
|
|
23920
23920
|
}
|
|
23921
23921
|
}
|
|
23922
|
-
var fs$appendFile =
|
|
23922
|
+
var fs$appendFile = fs8.appendFile;
|
|
23923
23923
|
if (fs$appendFile)
|
|
23924
|
-
|
|
23924
|
+
fs8.appendFile = appendFile;
|
|
23925
23925
|
function appendFile(path2, data, options, cb) {
|
|
23926
23926
|
if (typeof options === "function")
|
|
23927
23927
|
cb = options, options = null;
|
|
@@ -23937,9 +23937,9 @@ var require_graceful_fs = __commonJS({
|
|
|
23937
23937
|
});
|
|
23938
23938
|
}
|
|
23939
23939
|
}
|
|
23940
|
-
var fs$copyFile =
|
|
23940
|
+
var fs$copyFile = fs8.copyFile;
|
|
23941
23941
|
if (fs$copyFile)
|
|
23942
|
-
|
|
23942
|
+
fs8.copyFile = copyFile;
|
|
23943
23943
|
function copyFile(src, dest, flags, cb) {
|
|
23944
23944
|
if (typeof flags === "function") {
|
|
23945
23945
|
cb = flags;
|
|
@@ -23957,8 +23957,8 @@ var require_graceful_fs = __commonJS({
|
|
|
23957
23957
|
});
|
|
23958
23958
|
}
|
|
23959
23959
|
}
|
|
23960
|
-
var fs$readdir =
|
|
23961
|
-
|
|
23960
|
+
var fs$readdir = fs8.readdir;
|
|
23961
|
+
fs8.readdir = readdir2;
|
|
23962
23962
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
23963
23963
|
function readdir2(path2, options, cb) {
|
|
23964
23964
|
if (typeof options === "function")
|
|
@@ -23989,21 +23989,21 @@ var require_graceful_fs = __commonJS({
|
|
|
23989
23989
|
}
|
|
23990
23990
|
}
|
|
23991
23991
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
23992
|
-
var legStreams = legacy(
|
|
23992
|
+
var legStreams = legacy(fs8);
|
|
23993
23993
|
ReadStream = legStreams.ReadStream;
|
|
23994
23994
|
WriteStream = legStreams.WriteStream;
|
|
23995
23995
|
}
|
|
23996
|
-
var fs$ReadStream =
|
|
23996
|
+
var fs$ReadStream = fs8.ReadStream;
|
|
23997
23997
|
if (fs$ReadStream) {
|
|
23998
23998
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
23999
23999
|
ReadStream.prototype.open = ReadStream$open;
|
|
24000
24000
|
}
|
|
24001
|
-
var fs$WriteStream =
|
|
24001
|
+
var fs$WriteStream = fs8.WriteStream;
|
|
24002
24002
|
if (fs$WriteStream) {
|
|
24003
24003
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
24004
24004
|
WriteStream.prototype.open = WriteStream$open;
|
|
24005
24005
|
}
|
|
24006
|
-
Object.defineProperty(
|
|
24006
|
+
Object.defineProperty(fs8, "ReadStream", {
|
|
24007
24007
|
get: function() {
|
|
24008
24008
|
return ReadStream;
|
|
24009
24009
|
},
|
|
@@ -24013,7 +24013,7 @@ var require_graceful_fs = __commonJS({
|
|
|
24013
24013
|
enumerable: true,
|
|
24014
24014
|
configurable: true
|
|
24015
24015
|
});
|
|
24016
|
-
Object.defineProperty(
|
|
24016
|
+
Object.defineProperty(fs8, "WriteStream", {
|
|
24017
24017
|
get: function() {
|
|
24018
24018
|
return WriteStream;
|
|
24019
24019
|
},
|
|
@@ -24024,7 +24024,7 @@ var require_graceful_fs = __commonJS({
|
|
|
24024
24024
|
configurable: true
|
|
24025
24025
|
});
|
|
24026
24026
|
var FileReadStream = ReadStream;
|
|
24027
|
-
Object.defineProperty(
|
|
24027
|
+
Object.defineProperty(fs8, "FileReadStream", {
|
|
24028
24028
|
get: function() {
|
|
24029
24029
|
return FileReadStream;
|
|
24030
24030
|
},
|
|
@@ -24035,7 +24035,7 @@ var require_graceful_fs = __commonJS({
|
|
|
24035
24035
|
configurable: true
|
|
24036
24036
|
});
|
|
24037
24037
|
var FileWriteStream = WriteStream;
|
|
24038
|
-
Object.defineProperty(
|
|
24038
|
+
Object.defineProperty(fs8, "FileWriteStream", {
|
|
24039
24039
|
get: function() {
|
|
24040
24040
|
return FileWriteStream;
|
|
24041
24041
|
},
|
|
@@ -24053,7 +24053,7 @@ var require_graceful_fs = __commonJS({
|
|
|
24053
24053
|
}
|
|
24054
24054
|
function ReadStream$open() {
|
|
24055
24055
|
var that = this;
|
|
24056
|
-
|
|
24056
|
+
open2(that.path, that.flags, that.mode, function(err, fd) {
|
|
24057
24057
|
if (err) {
|
|
24058
24058
|
if (that.autoClose)
|
|
24059
24059
|
that.destroy();
|
|
@@ -24073,7 +24073,7 @@ var require_graceful_fs = __commonJS({
|
|
|
24073
24073
|
}
|
|
24074
24074
|
function WriteStream$open() {
|
|
24075
24075
|
var that = this;
|
|
24076
|
-
|
|
24076
|
+
open2(that.path, that.flags, that.mode, function(err, fd) {
|
|
24077
24077
|
if (err) {
|
|
24078
24078
|
that.destroy();
|
|
24079
24079
|
that.emit("error", err);
|
|
@@ -24084,14 +24084,14 @@ var require_graceful_fs = __commonJS({
|
|
|
24084
24084
|
});
|
|
24085
24085
|
}
|
|
24086
24086
|
function createReadStream3(path2, options) {
|
|
24087
|
-
return new
|
|
24087
|
+
return new fs8.ReadStream(path2, options);
|
|
24088
24088
|
}
|
|
24089
24089
|
function createWriteStream3(path2, options) {
|
|
24090
|
-
return new
|
|
24090
|
+
return new fs8.WriteStream(path2, options);
|
|
24091
24091
|
}
|
|
24092
|
-
var fs$open =
|
|
24093
|
-
|
|
24094
|
-
function
|
|
24092
|
+
var fs$open = fs8.open;
|
|
24093
|
+
fs8.open = open2;
|
|
24094
|
+
function open2(path2, flags, mode, cb) {
|
|
24095
24095
|
if (typeof mode === "function")
|
|
24096
24096
|
cb = mode, mode = null;
|
|
24097
24097
|
return go$open(path2, flags, mode, cb);
|
|
@@ -24106,20 +24106,20 @@ var require_graceful_fs = __commonJS({
|
|
|
24106
24106
|
});
|
|
24107
24107
|
}
|
|
24108
24108
|
}
|
|
24109
|
-
return
|
|
24109
|
+
return fs8;
|
|
24110
24110
|
}
|
|
24111
24111
|
function enqueue(elem) {
|
|
24112
24112
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
24113
|
-
|
|
24113
|
+
fs7[gracefulQueue].push(elem);
|
|
24114
24114
|
retry();
|
|
24115
24115
|
}
|
|
24116
24116
|
var retryTimer;
|
|
24117
24117
|
function resetQueue() {
|
|
24118
24118
|
var now = Date.now();
|
|
24119
|
-
for (var i = 0; i <
|
|
24120
|
-
if (
|
|
24121
|
-
|
|
24122
|
-
|
|
24119
|
+
for (var i = 0; i < fs7[gracefulQueue].length; ++i) {
|
|
24120
|
+
if (fs7[gracefulQueue][i].length > 2) {
|
|
24121
|
+
fs7[gracefulQueue][i][3] = now;
|
|
24122
|
+
fs7[gracefulQueue][i][4] = now;
|
|
24123
24123
|
}
|
|
24124
24124
|
}
|
|
24125
24125
|
retry();
|
|
@@ -24127,9 +24127,9 @@ var require_graceful_fs = __commonJS({
|
|
|
24127
24127
|
function retry() {
|
|
24128
24128
|
clearTimeout(retryTimer);
|
|
24129
24129
|
retryTimer = void 0;
|
|
24130
|
-
if (
|
|
24130
|
+
if (fs7[gracefulQueue].length === 0)
|
|
24131
24131
|
return;
|
|
24132
|
-
var elem =
|
|
24132
|
+
var elem = fs7[gracefulQueue].shift();
|
|
24133
24133
|
var fn = elem[0];
|
|
24134
24134
|
var args = elem[1];
|
|
24135
24135
|
var err = elem[2];
|
|
@@ -24151,7 +24151,7 @@ var require_graceful_fs = __commonJS({
|
|
|
24151
24151
|
debug("RETRY", fn.name, args);
|
|
24152
24152
|
fn.apply(null, args.concat([startTime]));
|
|
24153
24153
|
} else {
|
|
24154
|
-
|
|
24154
|
+
fs7[gracefulQueue].push(elem);
|
|
24155
24155
|
}
|
|
24156
24156
|
}
|
|
24157
24157
|
if (retryTimer === void 0) {
|
|
@@ -25348,7 +25348,7 @@ var require_old = __commonJS({
|
|
|
25348
25348
|
"../../node_modules/fs.realpath/old.js"(exports) {
|
|
25349
25349
|
var pathModule = require("path");
|
|
25350
25350
|
var isWindows = process.platform === "win32";
|
|
25351
|
-
var
|
|
25351
|
+
var fs7 = require("fs");
|
|
25352
25352
|
var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
|
25353
25353
|
function rethrow() {
|
|
25354
25354
|
var callback;
|
|
@@ -25413,7 +25413,7 @@ var require_old = __commonJS({
|
|
|
25413
25413
|
base = m[0];
|
|
25414
25414
|
previous = "";
|
|
25415
25415
|
if (isWindows && !knownHard[base]) {
|
|
25416
|
-
|
|
25416
|
+
fs7.lstatSync(base);
|
|
25417
25417
|
knownHard[base] = true;
|
|
25418
25418
|
}
|
|
25419
25419
|
}
|
|
@@ -25431,7 +25431,7 @@ var require_old = __commonJS({
|
|
|
25431
25431
|
if (cache3 && Object.prototype.hasOwnProperty.call(cache3, base)) {
|
|
25432
25432
|
resolvedLink = cache3[base];
|
|
25433
25433
|
} else {
|
|
25434
|
-
var stat3 =
|
|
25434
|
+
var stat3 = fs7.lstatSync(base);
|
|
25435
25435
|
if (!stat3.isSymbolicLink()) {
|
|
25436
25436
|
knownHard[base] = true;
|
|
25437
25437
|
if (cache3)
|
|
@@ -25446,8 +25446,8 @@ var require_old = __commonJS({
|
|
|
25446
25446
|
}
|
|
25447
25447
|
}
|
|
25448
25448
|
if (linkTarget === null) {
|
|
25449
|
-
|
|
25450
|
-
linkTarget =
|
|
25449
|
+
fs7.statSync(base);
|
|
25450
|
+
linkTarget = fs7.readlinkSync(base);
|
|
25451
25451
|
}
|
|
25452
25452
|
resolvedLink = pathModule.resolve(previous, linkTarget);
|
|
25453
25453
|
if (cache3)
|
|
@@ -25484,7 +25484,7 @@ var require_old = __commonJS({
|
|
|
25484
25484
|
base = m[0];
|
|
25485
25485
|
previous = "";
|
|
25486
25486
|
if (isWindows && !knownHard[base]) {
|
|
25487
|
-
|
|
25487
|
+
fs7.lstat(base, function(err) {
|
|
25488
25488
|
if (err)
|
|
25489
25489
|
return cb(err);
|
|
25490
25490
|
knownHard[base] = true;
|
|
@@ -25512,7 +25512,7 @@ var require_old = __commonJS({
|
|
|
25512
25512
|
if (cache3 && Object.prototype.hasOwnProperty.call(cache3, base)) {
|
|
25513
25513
|
return gotResolvedLink(cache3[base]);
|
|
25514
25514
|
}
|
|
25515
|
-
return
|
|
25515
|
+
return fs7.lstat(base, gotStat);
|
|
25516
25516
|
}
|
|
25517
25517
|
function gotStat(err, stat3) {
|
|
25518
25518
|
if (err)
|
|
@@ -25529,10 +25529,10 @@ var require_old = __commonJS({
|
|
|
25529
25529
|
return gotTarget(null, seenLinks[id], base);
|
|
25530
25530
|
}
|
|
25531
25531
|
}
|
|
25532
|
-
|
|
25532
|
+
fs7.stat(base, function(err2) {
|
|
25533
25533
|
if (err2)
|
|
25534
25534
|
return cb(err2);
|
|
25535
|
-
|
|
25535
|
+
fs7.readlink(base, function(err3, target) {
|
|
25536
25536
|
if (!isWindows)
|
|
25537
25537
|
seenLinks[id] = target;
|
|
25538
25538
|
gotTarget(err3, target);
|
|
@@ -25564,9 +25564,9 @@ var require_fs = __commonJS({
|
|
|
25564
25564
|
realpath.realpathSync = realpathSync;
|
|
25565
25565
|
realpath.monkeypatch = monkeypatch;
|
|
25566
25566
|
realpath.unmonkeypatch = unmonkeypatch;
|
|
25567
|
-
var
|
|
25568
|
-
var origRealpath =
|
|
25569
|
-
var origRealpathSync =
|
|
25567
|
+
var fs7 = require("fs");
|
|
25568
|
+
var origRealpath = fs7.realpath;
|
|
25569
|
+
var origRealpathSync = fs7.realpathSync;
|
|
25570
25570
|
var version2 = process.version;
|
|
25571
25571
|
var ok = /^v[0-5]\./.test(version2);
|
|
25572
25572
|
var old = require_old();
|
|
@@ -25604,12 +25604,12 @@ var require_fs = __commonJS({
|
|
|
25604
25604
|
}
|
|
25605
25605
|
}
|
|
25606
25606
|
function monkeypatch() {
|
|
25607
|
-
|
|
25608
|
-
|
|
25607
|
+
fs7.realpath = realpath;
|
|
25608
|
+
fs7.realpathSync = realpathSync;
|
|
25609
25609
|
}
|
|
25610
25610
|
function unmonkeypatch() {
|
|
25611
|
-
|
|
25612
|
-
|
|
25611
|
+
fs7.realpath = origRealpath;
|
|
25612
|
+
fs7.realpathSync = origRealpathSync;
|
|
25613
25613
|
}
|
|
25614
25614
|
}
|
|
25615
25615
|
});
|
|
@@ -26399,7 +26399,7 @@ var require_common4 = __commonJS({
|
|
|
26399
26399
|
function ownProp(obj, field) {
|
|
26400
26400
|
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
26401
26401
|
}
|
|
26402
|
-
var
|
|
26402
|
+
var fs7 = require("fs");
|
|
26403
26403
|
var path2 = require("path");
|
|
26404
26404
|
var minimatch = require_minimatch2();
|
|
26405
26405
|
var isAbsolute2 = require_path_is_absolute();
|
|
@@ -26454,7 +26454,7 @@ var require_common4 = __commonJS({
|
|
|
26454
26454
|
self2.stat = !!options.stat;
|
|
26455
26455
|
self2.noprocess = !!options.noprocess;
|
|
26456
26456
|
self2.absolute = !!options.absolute;
|
|
26457
|
-
self2.fs = options.fs ||
|
|
26457
|
+
self2.fs = options.fs || fs7;
|
|
26458
26458
|
self2.maxLength = options.maxLength || Infinity;
|
|
26459
26459
|
self2.cache = options.cache || Object.create(null);
|
|
26460
26460
|
self2.statCache = options.statCache || Object.create(null);
|
|
@@ -26661,27 +26661,27 @@ var require_sync = __commonJS({
|
|
|
26661
26661
|
break;
|
|
26662
26662
|
}
|
|
26663
26663
|
var remain = pattern.slice(n);
|
|
26664
|
-
var
|
|
26664
|
+
var read3;
|
|
26665
26665
|
if (prefix === null)
|
|
26666
|
-
|
|
26666
|
+
read3 = ".";
|
|
26667
26667
|
else if (isAbsolute2(prefix) || isAbsolute2(pattern.map(function(p) {
|
|
26668
26668
|
return typeof p === "string" ? p : "[*]";
|
|
26669
26669
|
}).join("/"))) {
|
|
26670
26670
|
if (!prefix || !isAbsolute2(prefix))
|
|
26671
26671
|
prefix = "/" + prefix;
|
|
26672
|
-
|
|
26672
|
+
read3 = prefix;
|
|
26673
26673
|
} else
|
|
26674
|
-
|
|
26675
|
-
var abs = this._makeAbs(
|
|
26676
|
-
if (childrenIgnored(this,
|
|
26674
|
+
read3 = prefix;
|
|
26675
|
+
var abs = this._makeAbs(read3);
|
|
26676
|
+
if (childrenIgnored(this, read3))
|
|
26677
26677
|
return;
|
|
26678
26678
|
var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
|
26679
26679
|
if (isGlobStar)
|
|
26680
|
-
this._processGlobStar(prefix,
|
|
26680
|
+
this._processGlobStar(prefix, read3, abs, remain, index, inGlobStar);
|
|
26681
26681
|
else
|
|
26682
|
-
this._processReaddir(prefix,
|
|
26682
|
+
this._processReaddir(prefix, read3, abs, remain, index, inGlobStar);
|
|
26683
26683
|
};
|
|
26684
|
-
GlobSync.prototype._processReaddir = function(prefix,
|
|
26684
|
+
GlobSync.prototype._processReaddir = function(prefix, read3, abs, remain, index, inGlobStar) {
|
|
26685
26685
|
var entries = this._readdir(abs, inGlobStar);
|
|
26686
26686
|
if (!entries)
|
|
26687
26687
|
return;
|
|
@@ -26836,7 +26836,7 @@ var require_sync = __commonJS({
|
|
|
26836
26836
|
break;
|
|
26837
26837
|
}
|
|
26838
26838
|
};
|
|
26839
|
-
GlobSync.prototype._processGlobStar = function(prefix,
|
|
26839
|
+
GlobSync.prototype._processGlobStar = function(prefix, read3, abs, remain, index, inGlobStar) {
|
|
26840
26840
|
var entries = this._readdir(abs, inGlobStar);
|
|
26841
26841
|
if (!entries)
|
|
26842
26842
|
return;
|
|
@@ -27285,33 +27285,33 @@ var require_glob = __commonJS({
|
|
|
27285
27285
|
break;
|
|
27286
27286
|
}
|
|
27287
27287
|
var remain = pattern.slice(n);
|
|
27288
|
-
var
|
|
27288
|
+
var read3;
|
|
27289
27289
|
if (prefix === null)
|
|
27290
|
-
|
|
27290
|
+
read3 = ".";
|
|
27291
27291
|
else if (isAbsolute2(prefix) || isAbsolute2(pattern.map(function(p) {
|
|
27292
27292
|
return typeof p === "string" ? p : "[*]";
|
|
27293
27293
|
}).join("/"))) {
|
|
27294
27294
|
if (!prefix || !isAbsolute2(prefix))
|
|
27295
27295
|
prefix = "/" + prefix;
|
|
27296
|
-
|
|
27296
|
+
read3 = prefix;
|
|
27297
27297
|
} else
|
|
27298
|
-
|
|
27299
|
-
var abs = this._makeAbs(
|
|
27300
|
-
if (childrenIgnored(this,
|
|
27298
|
+
read3 = prefix;
|
|
27299
|
+
var abs = this._makeAbs(read3);
|
|
27300
|
+
if (childrenIgnored(this, read3))
|
|
27301
27301
|
return cb();
|
|
27302
27302
|
var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
|
27303
27303
|
if (isGlobStar)
|
|
27304
|
-
this._processGlobStar(prefix,
|
|
27304
|
+
this._processGlobStar(prefix, read3, abs, remain, index, inGlobStar, cb);
|
|
27305
27305
|
else
|
|
27306
|
-
this._processReaddir(prefix,
|
|
27306
|
+
this._processReaddir(prefix, read3, abs, remain, index, inGlobStar, cb);
|
|
27307
27307
|
};
|
|
27308
|
-
Glob.prototype._processReaddir = function(prefix,
|
|
27308
|
+
Glob.prototype._processReaddir = function(prefix, read3, abs, remain, index, inGlobStar, cb) {
|
|
27309
27309
|
var self2 = this;
|
|
27310
27310
|
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
27311
|
-
return self2._processReaddir2(prefix,
|
|
27311
|
+
return self2._processReaddir2(prefix, read3, abs, remain, index, inGlobStar, entries, cb);
|
|
27312
27312
|
});
|
|
27313
27313
|
};
|
|
27314
|
-
Glob.prototype._processReaddir2 = function(prefix,
|
|
27314
|
+
Glob.prototype._processReaddir2 = function(prefix, read3, abs, remain, index, inGlobStar, entries, cb) {
|
|
27315
27315
|
if (!entries)
|
|
27316
27316
|
return cb();
|
|
27317
27317
|
var pn = remain[0];
|
|
@@ -27492,13 +27492,13 @@ var require_glob = __commonJS({
|
|
|
27492
27492
|
}
|
|
27493
27493
|
return cb();
|
|
27494
27494
|
};
|
|
27495
|
-
Glob.prototype._processGlobStar = function(prefix,
|
|
27495
|
+
Glob.prototype._processGlobStar = function(prefix, read3, abs, remain, index, inGlobStar, cb) {
|
|
27496
27496
|
var self2 = this;
|
|
27497
27497
|
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
27498
|
-
self2._processGlobStar2(prefix,
|
|
27498
|
+
self2._processGlobStar2(prefix, read3, abs, remain, index, inGlobStar, entries, cb);
|
|
27499
27499
|
});
|
|
27500
27500
|
};
|
|
27501
|
-
Glob.prototype._processGlobStar2 = function(prefix,
|
|
27501
|
+
Glob.prototype._processGlobStar2 = function(prefix, read3, abs, remain, index, inGlobStar, entries, cb) {
|
|
27502
27502
|
if (!entries)
|
|
27503
27503
|
return cb();
|
|
27504
27504
|
var remainWithoutGlobStar = remain.slice(1);
|
|
@@ -27613,7 +27613,7 @@ var require_glob = __commonJS({
|
|
|
27613
27613
|
// ../../node_modules/archiver-utils/file.js
|
|
27614
27614
|
var require_file = __commonJS({
|
|
27615
27615
|
"../../node_modules/archiver-utils/file.js"(exports, module2) {
|
|
27616
|
-
var
|
|
27616
|
+
var fs7 = require_graceful_fs();
|
|
27617
27617
|
var path2 = require("path");
|
|
27618
27618
|
var flatten = require_lodash2();
|
|
27619
27619
|
var difference = require_lodash3();
|
|
@@ -27640,7 +27640,7 @@ var require_file = __commonJS({
|
|
|
27640
27640
|
};
|
|
27641
27641
|
file.exists = function() {
|
|
27642
27642
|
var filepath = path2.join.apply(path2, arguments);
|
|
27643
|
-
return
|
|
27643
|
+
return fs7.existsSync(filepath);
|
|
27644
27644
|
};
|
|
27645
27645
|
file.expand = function(...args) {
|
|
27646
27646
|
var options = isPlainObject(args[0]) ? args.shift() : {};
|
|
@@ -27658,7 +27658,7 @@ var require_file = __commonJS({
|
|
|
27658
27658
|
if (typeof options.filter === "function") {
|
|
27659
27659
|
return options.filter(filepath);
|
|
27660
27660
|
} else {
|
|
27661
|
-
return
|
|
27661
|
+
return fs7.statSync(filepath)[options.filter]();
|
|
27662
27662
|
}
|
|
27663
27663
|
} catch (e) {
|
|
27664
27664
|
return false;
|
|
@@ -27766,7 +27766,7 @@ var require_file = __commonJS({
|
|
|
27766
27766
|
// ../../node_modules/archiver-utils/index.js
|
|
27767
27767
|
var require_archiver_utils = __commonJS({
|
|
27768
27768
|
"../../node_modules/archiver-utils/index.js"(exports, module2) {
|
|
27769
|
-
var
|
|
27769
|
+
var fs7 = require_graceful_fs();
|
|
27770
27770
|
var path2 = require("path");
|
|
27771
27771
|
var nutil = require("util");
|
|
27772
27772
|
var lazystream = require_lazystream();
|
|
@@ -27815,7 +27815,7 @@ var require_archiver_utils = __commonJS({
|
|
|
27815
27815
|
};
|
|
27816
27816
|
utils.lazyReadStream = function(filepath) {
|
|
27817
27817
|
return new lazystream.Readable(function() {
|
|
27818
|
-
return
|
|
27818
|
+
return fs7.createReadStream(filepath);
|
|
27819
27819
|
});
|
|
27820
27820
|
};
|
|
27821
27821
|
utils.normalizeInputSource = function(source) {
|
|
@@ -27845,7 +27845,7 @@ var require_archiver_utils = __commonJS({
|
|
|
27845
27845
|
callback = base;
|
|
27846
27846
|
base = dirpath;
|
|
27847
27847
|
}
|
|
27848
|
-
|
|
27848
|
+
fs7.readdir(dirpath, function(err, list) {
|
|
27849
27849
|
var i = 0;
|
|
27850
27850
|
var file;
|
|
27851
27851
|
var filepath;
|
|
@@ -27858,7 +27858,7 @@ var require_archiver_utils = __commonJS({
|
|
|
27858
27858
|
return callback(null, results);
|
|
27859
27859
|
}
|
|
27860
27860
|
filepath = path2.join(dirpath, file);
|
|
27861
|
-
|
|
27861
|
+
fs7.stat(filepath, function(err2, stats) {
|
|
27862
27862
|
results.push({
|
|
27863
27863
|
path: filepath,
|
|
27864
27864
|
relative: path2.relative(base, filepath).replace(/\\/g, "/"),
|
|
@@ -30731,7 +30731,7 @@ var require_readable2 = __commonJS({
|
|
|
30731
30731
|
// ../../node_modules/archiver/lib/core.js
|
|
30732
30732
|
var require_core = __commonJS({
|
|
30733
30733
|
"../../node_modules/archiver/lib/core.js"(exports, module2) {
|
|
30734
|
-
var
|
|
30734
|
+
var fs7 = require("fs");
|
|
30735
30735
|
var glob = require_readdir_glob();
|
|
30736
30736
|
var async = require_async();
|
|
30737
30737
|
var path2 = require("path");
|
|
@@ -30795,7 +30795,7 @@ var require_core = __commonJS({
|
|
|
30795
30795
|
data.sourcePath = filepath;
|
|
30796
30796
|
task.data = data;
|
|
30797
30797
|
this._entriesCount++;
|
|
30798
|
-
if (data.stats && data.stats instanceof
|
|
30798
|
+
if (data.stats && data.stats instanceof fs7.Stats) {
|
|
30799
30799
|
task = this._updateQueueTaskWithStats(task, data.stats);
|
|
30800
30800
|
if (task) {
|
|
30801
30801
|
if (data.stats.size) {
|
|
@@ -30966,7 +30966,7 @@ var require_core = __commonJS({
|
|
|
30966
30966
|
callback();
|
|
30967
30967
|
return;
|
|
30968
30968
|
}
|
|
30969
|
-
|
|
30969
|
+
fs7.lstat(task.filepath, function(err, stats) {
|
|
30970
30970
|
if (this._state.aborted) {
|
|
30971
30971
|
setImmediate(callback);
|
|
30972
30972
|
return;
|
|
@@ -31009,7 +31009,7 @@ var require_core = __commonJS({
|
|
|
31009
31009
|
task.data.sourceType = "buffer";
|
|
31010
31010
|
task.source = Buffer.concat([]);
|
|
31011
31011
|
} else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) {
|
|
31012
|
-
var linkPath =
|
|
31012
|
+
var linkPath = fs7.readlinkSync(task.filepath);
|
|
31013
31013
|
var dirName = path2.dirname(task.filepath);
|
|
31014
31014
|
task.data.type = "symlink";
|
|
31015
31015
|
task.data.linkname = path2.relative(dirName, path2.resolve(dirName, linkPath));
|
|
@@ -45517,9 +45517,9 @@ var require_geoid = __commonJS({
|
|
|
45517
45517
|
var stencilsize_ = 12;
|
|
45518
45518
|
var nterms_ = (3 + 1) * (3 + 2) / 2;
|
|
45519
45519
|
var PIXEL_SIZE = 2;
|
|
45520
|
-
var
|
|
45521
|
-
function
|
|
45522
|
-
(0, _classCallCheck2.default)(this,
|
|
45520
|
+
var Geoid2 = function() {
|
|
45521
|
+
function Geoid3(options) {
|
|
45522
|
+
(0, _classCallCheck2.default)(this, Geoid3);
|
|
45523
45523
|
(0, _defineProperty2.default)(this, "_v00", 0);
|
|
45524
45524
|
(0, _defineProperty2.default)(this, "_v01", 0);
|
|
45525
45525
|
(0, _defineProperty2.default)(this, "_v10", 0);
|
|
@@ -45532,7 +45532,7 @@ var require_geoid = __commonJS({
|
|
|
45532
45532
|
this._ix = this.options._width;
|
|
45533
45533
|
this._iy = this.options._height;
|
|
45534
45534
|
}
|
|
45535
|
-
(0, _createClass2.default)(
|
|
45535
|
+
(0, _createClass2.default)(Geoid3, [{
|
|
45536
45536
|
key: "getHeight",
|
|
45537
45537
|
value: function getHeight(lat, lon) {
|
|
45538
45538
|
lat = Math.abs(lat) > 90 ? NaN : lat;
|
|
@@ -45625,9 +45625,9 @@ var require_geoid = __commonJS({
|
|
|
45625
45625
|
return r;
|
|
45626
45626
|
}
|
|
45627
45627
|
}]);
|
|
45628
|
-
return
|
|
45628
|
+
return Geoid3;
|
|
45629
45629
|
}();
|
|
45630
|
-
exports.default =
|
|
45630
|
+
exports.default = Geoid2;
|
|
45631
45631
|
function remainder(x, y) {
|
|
45632
45632
|
y = Math.abs(y);
|
|
45633
45633
|
var z = fmod(x, y);
|
|
@@ -46582,12 +46582,37 @@ var isBrowser = Boolean(typeof process !== "object" || String(process) !== "[obj
|
|
|
46582
46582
|
var matches = typeof process !== "undefined" && process.version && /v([0-9]*)/.exec(process.version);
|
|
46583
46583
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
46584
46584
|
|
|
46585
|
+
// ../loader-utils/src/lib/option-utils/merge-loader-options.ts
|
|
46586
|
+
function mergeLoaderOptions(baseOptions, newOptions) {
|
|
46587
|
+
return mergeOptionsRecursively(baseOptions || {}, newOptions);
|
|
46588
|
+
}
|
|
46589
|
+
function mergeOptionsRecursively(baseOptions, newOptions) {
|
|
46590
|
+
const options = { ...baseOptions };
|
|
46591
|
+
for (const [key, newValue] of Object.entries(newOptions)) {
|
|
46592
|
+
if (newValue && typeof newValue === "object" && !Array.isArray(newValue)) {
|
|
46593
|
+
options[key] = mergeOptionsRecursively(options[key] || {}, newOptions[key]);
|
|
46594
|
+
} else {
|
|
46595
|
+
options[key] = newOptions[key];
|
|
46596
|
+
}
|
|
46597
|
+
}
|
|
46598
|
+
return options;
|
|
46599
|
+
}
|
|
46600
|
+
|
|
46585
46601
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
46586
|
-
var
|
|
46587
|
-
|
|
46588
|
-
if (
|
|
46589
|
-
|
|
46602
|
+
var NPM_TAG = "beta";
|
|
46603
|
+
function getVersion() {
|
|
46604
|
+
if (!globalThis._loadersgl_?.version) {
|
|
46605
|
+
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
46606
|
+
if (typeof __VERSION__ === "undefined") {
|
|
46607
|
+
console.error("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
46608
|
+
globalThis._loadersgl_.version = NPM_TAG;
|
|
46609
|
+
} else {
|
|
46610
|
+
globalThis._loadersgl_.version = __VERSION__;
|
|
46611
|
+
}
|
|
46612
|
+
}
|
|
46613
|
+
return globalThis._loadersgl_.version;
|
|
46590
46614
|
}
|
|
46615
|
+
var VERSION = getVersion();
|
|
46591
46616
|
|
|
46592
46617
|
// ../worker-utils/src/lib/env-utils/assert.ts
|
|
46593
46618
|
function assert3(condition, message) {
|
|
@@ -46994,10 +47019,8 @@ var WorkerFarm = class {
|
|
|
46994
47019
|
};
|
|
46995
47020
|
|
|
46996
47021
|
// ../worker-utils/src/lib/worker-api/get-worker-url.ts
|
|
46997
|
-
var NPM_TAG = "beta";
|
|
46998
|
-
var VERSION2 = typeof VERSION !== "undefined" ? VERSION : NPM_TAG;
|
|
46999
47022
|
function getWorkerName(worker) {
|
|
47000
|
-
const warning = worker.version !==
|
|
47023
|
+
const warning = worker.version !== VERSION ? ` (worker-utils@${VERSION})` : "";
|
|
47001
47024
|
return `${worker.name}@${worker.version}${warning}`;
|
|
47002
47025
|
}
|
|
47003
47026
|
function getWorkerURL(worker, options = {}) {
|
|
@@ -47135,8 +47158,6 @@ function requireFromString(code, filename2 = "", options) {
|
|
|
47135
47158
|
}
|
|
47136
47159
|
|
|
47137
47160
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
47138
|
-
var LATEST = "beta";
|
|
47139
|
-
var VERSION3 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
47140
47161
|
var loadLibraryPromises = {};
|
|
47141
47162
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
|
|
47142
47163
|
if (moduleName) {
|
|
@@ -47159,7 +47180,7 @@ function getLibraryUrl(library, moduleName, options = {}, libraryName = null) {
|
|
|
47159
47180
|
}
|
|
47160
47181
|
if (options.CDN) {
|
|
47161
47182
|
assert3(options.CDN.startsWith("http"));
|
|
47162
|
-
return `${options.CDN}/${moduleName}@${
|
|
47183
|
+
return `${options.CDN}/${moduleName}@${VERSION}/dist/libs/${libraryName}`;
|
|
47163
47184
|
}
|
|
47164
47185
|
if (isWorker) {
|
|
47165
47186
|
return `../src/libs/${libraryName}`;
|
|
@@ -47617,12 +47638,12 @@ function resolvePath(filename2) {
|
|
|
47617
47638
|
}
|
|
47618
47639
|
|
|
47619
47640
|
// ../loader-utils/src/json-loader.ts
|
|
47620
|
-
var
|
|
47641
|
+
var VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
47621
47642
|
var JSONLoader = {
|
|
47622
47643
|
name: "JSON",
|
|
47623
47644
|
id: "json",
|
|
47624
47645
|
module: "json",
|
|
47625
|
-
version:
|
|
47646
|
+
version: VERSION2,
|
|
47626
47647
|
extensions: ["json", "geojson"],
|
|
47627
47648
|
mimeTypes: ["application/json"],
|
|
47628
47649
|
category: "json",
|
|
@@ -47855,43 +47876,27 @@ __export(fs_exports, {
|
|
|
47855
47876
|
readFile: () => readFile,
|
|
47856
47877
|
readFileSync: () => readFileSync,
|
|
47857
47878
|
readdir: () => readdir,
|
|
47858
|
-
stat: () =>
|
|
47879
|
+
stat: () => stat2,
|
|
47859
47880
|
statSync: () => statSync,
|
|
47860
47881
|
writeFile: () => writeFile,
|
|
47861
47882
|
writeFileSync: () => writeFileSync
|
|
47862
47883
|
});
|
|
47863
|
-
var
|
|
47864
|
-
var
|
|
47865
|
-
var
|
|
47866
|
-
var
|
|
47867
|
-
var
|
|
47868
|
-
var
|
|
47869
|
-
var
|
|
47870
|
-
var
|
|
47871
|
-
var
|
|
47872
|
-
var
|
|
47873
|
-
var
|
|
47874
|
-
var
|
|
47875
|
-
var
|
|
47876
|
-
var
|
|
47877
|
-
var
|
|
47878
|
-
|
|
47879
|
-
readdir = promisify2(import_fs2.default.readdir);
|
|
47880
|
-
stat = promisify2(import_fs2.default.stat);
|
|
47881
|
-
statSync = import_fs2.default.statSync;
|
|
47882
|
-
readFile = import_fs2.default.readFile;
|
|
47883
|
-
readFileSync = import_fs2.default.readFileSync;
|
|
47884
|
-
writeFile = promisify3(import_fs2.default.writeFile);
|
|
47885
|
-
writeFileSync = import_fs2.default.writeFileSync;
|
|
47886
|
-
open = import_fs2.default.open;
|
|
47887
|
-
close = (fd) => new Promise((resolve2, reject) => import_fs2.default.close(fd, (err) => err ? reject(err) : resolve2()));
|
|
47888
|
-
read = import_fs2.default.read;
|
|
47889
|
-
fstat = import_fs2.default.fstat;
|
|
47890
|
-
createReadStream = import_fs2.default.createReadStream;
|
|
47891
|
-
createWriteStream = import_fs2.default.createWriteStream;
|
|
47892
|
-
isSupported = Boolean(import_fs2.default);
|
|
47893
|
-
} catch {
|
|
47894
|
-
}
|
|
47884
|
+
var fs2 = __toModule(require("fs"));
|
|
47885
|
+
var fsPromises = __toModule(require("fs/promises"));
|
|
47886
|
+
var readdir = promisify2(fs2.readdir);
|
|
47887
|
+
var stat2 = fsPromises.stat;
|
|
47888
|
+
var statSync = fs2.statSync;
|
|
47889
|
+
var readFile = fs2.readFile;
|
|
47890
|
+
var readFileSync = fs2.readFileSync;
|
|
47891
|
+
var writeFile = promisify3(fs2.writeFile);
|
|
47892
|
+
var writeFileSync = fs2.writeFileSync;
|
|
47893
|
+
var open = fs2.open;
|
|
47894
|
+
var close = (fd) => new Promise((resolve2, reject) => fs2.close(fd, (err) => err ? reject(err) : resolve2()));
|
|
47895
|
+
var read = fs2.read;
|
|
47896
|
+
var fstat = fs2.fstat;
|
|
47897
|
+
var createReadStream = fs2.createReadStream;
|
|
47898
|
+
var createWriteStream = fs2.createWriteStream;
|
|
47899
|
+
var isSupported = Boolean(fs2);
|
|
47895
47900
|
async function _readToArrayBuffer(fd, start, length) {
|
|
47896
47901
|
const buffer = Buffer.alloc(length);
|
|
47897
47902
|
const { bytesRead } = await read(fd, buffer, 0, length, start);
|
|
@@ -47907,12 +47912,11 @@ var isFileProvider = (fileProvider) => {
|
|
|
47907
47912
|
};
|
|
47908
47913
|
|
|
47909
47914
|
// ../loader-utils/src/lib/file-provider/file-handle.ts
|
|
47910
|
-
var import_fs3 = __toModule(require("fs"));
|
|
47911
47915
|
var FileHandle = class {
|
|
47912
47916
|
constructor(fileDescriptor, stats) {
|
|
47913
47917
|
this.read = (buffer, offset, length, position) => {
|
|
47914
47918
|
return new Promise((s) => {
|
|
47915
|
-
|
|
47919
|
+
read(this.fileDescriptor, buffer, offset, length, position, (_err, bytesRead, buffer2) => s({ bytesRead, buffer: buffer2 }));
|
|
47916
47920
|
});
|
|
47917
47921
|
};
|
|
47918
47922
|
this.fileDescriptor = fileDescriptor;
|
|
@@ -47921,18 +47925,14 @@ var FileHandle = class {
|
|
|
47921
47925
|
static async open(path2) {
|
|
47922
47926
|
const [fd, stats] = await Promise.all([
|
|
47923
47927
|
new Promise((resolve2, reject) => {
|
|
47924
|
-
|
|
47928
|
+
open(path2, void 0, void 0, (_err, fd2) => _err ? reject(_err) : resolve2(fd2));
|
|
47925
47929
|
}),
|
|
47926
|
-
|
|
47927
|
-
(0, import_fs3.stat)(path2, { bigint: true }, (_err, stats2) => _err ? reject(_err) : resolve2(stats2));
|
|
47928
|
-
})
|
|
47930
|
+
stat2(path2, { bigint: true })
|
|
47929
47931
|
]);
|
|
47930
47932
|
return new FileHandle(fd, stats);
|
|
47931
47933
|
}
|
|
47932
47934
|
async close() {
|
|
47933
|
-
return
|
|
47934
|
-
(0, import_fs3.close)(this.fileDescriptor, (_err) => resolve2());
|
|
47935
|
-
});
|
|
47935
|
+
return close(this.fileDescriptor);
|
|
47936
47936
|
}
|
|
47937
47937
|
get stat() {
|
|
47938
47938
|
return this.stats;
|
|
@@ -48268,7 +48268,7 @@ var console_ = globalThis.console;
|
|
|
48268
48268
|
var navigator_ = globalThis.navigator || {};
|
|
48269
48269
|
|
|
48270
48270
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
48271
|
-
var
|
|
48271
|
+
var VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
48272
48272
|
var isBrowser4 = isBrowser3();
|
|
48273
48273
|
|
|
48274
48274
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -48453,7 +48453,7 @@ var Log = class {
|
|
|
48453
48453
|
id: ""
|
|
48454
48454
|
};
|
|
48455
48455
|
_defineProperty(this, "id", void 0);
|
|
48456
|
-
_defineProperty(this, "VERSION",
|
|
48456
|
+
_defineProperty(this, "VERSION", VERSION3);
|
|
48457
48457
|
_defineProperty(this, "_startTs", getHiResTimestamp());
|
|
48458
48458
|
_defineProperty(this, "_deltaTs", getHiResTimestamp());
|
|
48459
48459
|
_defineProperty(this, "_storage", void 0);
|
|
@@ -48656,7 +48656,7 @@ var Log = class {
|
|
|
48656
48656
|
return noop;
|
|
48657
48657
|
}
|
|
48658
48658
|
};
|
|
48659
|
-
_defineProperty(Log, "VERSION",
|
|
48659
|
+
_defineProperty(Log, "VERSION", VERSION3);
|
|
48660
48660
|
function normalizeLogLevel(logLevel) {
|
|
48661
48661
|
if (!logLevel) {
|
|
48662
48662
|
return 0;
|
|
@@ -49386,6 +49386,7 @@ async function parse(data, loaders, options, context) {
|
|
|
49386
49386
|
}
|
|
49387
49387
|
async function parseWithLoader(loader, data, options, context) {
|
|
49388
49388
|
validateWorkerVersion(loader);
|
|
49389
|
+
options = mergeLoaderOptions(loader.options, options);
|
|
49389
49390
|
if (isResponse(data)) {
|
|
49390
49391
|
const response = data;
|
|
49391
49392
|
const { ok, redirected, status, statusText, type, url } = response;
|
|
@@ -49490,7 +49491,7 @@ async function encodeURLtoURL(inputUrl, outputUrl, writer, options) {
|
|
|
49490
49491
|
return outputFilename;
|
|
49491
49492
|
}
|
|
49492
49493
|
function getIterator(data) {
|
|
49493
|
-
const dataIterator = [{
|
|
49494
|
+
const dataIterator = [{ ...data, start: 0, end: data.length }];
|
|
49494
49495
|
return dataIterator;
|
|
49495
49496
|
}
|
|
49496
49497
|
function getTemporaryFilename(filename2) {
|
|
@@ -49607,7 +49608,7 @@ function createSphere(sphere, transform11, result) {
|
|
|
49607
49608
|
}
|
|
49608
49609
|
|
|
49609
49610
|
// ../3d-tiles/src/lib/utils/version.ts
|
|
49610
|
-
var
|
|
49611
|
+
var VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
49611
49612
|
|
|
49612
49613
|
// ../3d-tiles/src/lib/constants.ts
|
|
49613
49614
|
var TILE3D_TYPE = {
|
|
@@ -49641,7 +49642,7 @@ function getMagicString3(arrayBuffer, byteOffset = 0) {
|
|
|
49641
49642
|
}
|
|
49642
49643
|
|
|
49643
49644
|
// ../draco/src/lib/utils/version.ts
|
|
49644
|
-
var
|
|
49645
|
+
var VERSION5 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
49645
49646
|
|
|
49646
49647
|
// ../draco/src/draco-loader.ts
|
|
49647
49648
|
var DEFAULT_DRACO_OPTIONS = {
|
|
@@ -49656,7 +49657,7 @@ var DracoLoader = {
|
|
|
49656
49657
|
name: "Draco",
|
|
49657
49658
|
id: "draco",
|
|
49658
49659
|
module: "draco",
|
|
49659
|
-
version:
|
|
49660
|
+
version: VERSION5,
|
|
49660
49661
|
worker: true,
|
|
49661
49662
|
extensions: ["drc"],
|
|
49662
49663
|
mimeTypes: ["application/octet-stream"],
|
|
@@ -50121,7 +50122,7 @@ function getUint32Array(dracoArray) {
|
|
|
50121
50122
|
}
|
|
50122
50123
|
|
|
50123
50124
|
// ../draco/src/lib/draco-module-loader.ts
|
|
50124
|
-
var DRACO_DECODER_VERSION = "1.5.
|
|
50125
|
+
var DRACO_DECODER_VERSION = "1.5.6";
|
|
50125
50126
|
var DRACO_ENCODER_VERSION = "1.4.1";
|
|
50126
50127
|
var STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
50127
50128
|
var DRACO_EXTERNAL_LIBRARIES = {
|
|
@@ -50183,7 +50184,7 @@ var DracoWriterWorker = {
|
|
|
50183
50184
|
id: "draco-writer",
|
|
50184
50185
|
name: "Draco compressed geometry writer",
|
|
50185
50186
|
module: "draco",
|
|
50186
|
-
version:
|
|
50187
|
+
version: VERSION5,
|
|
50187
50188
|
worker: true,
|
|
50188
50189
|
options: {
|
|
50189
50190
|
draco: {},
|
|
@@ -51345,12 +51346,12 @@ async function loadDraco(tile, dracoData, options, context) {
|
|
|
51345
51346
|
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
51346
51347
|
var EXT_mesh_features_exports = {};
|
|
51347
51348
|
__export(EXT_mesh_features_exports, {
|
|
51348
|
-
decode: () =>
|
|
51349
|
-
name: () =>
|
|
51349
|
+
decode: () => decode,
|
|
51350
|
+
name: () => name
|
|
51350
51351
|
});
|
|
51351
51352
|
|
|
51352
51353
|
// ../images/src/lib/utils/version.ts
|
|
51353
|
-
var
|
|
51354
|
+
var VERSION6 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
51354
51355
|
|
|
51355
51356
|
// ../images/src/lib/category-api/image-type.ts
|
|
51356
51357
|
var { _parseImageNode } = globalThis;
|
|
@@ -51741,7 +51742,7 @@ var ImageLoader = {
|
|
|
51741
51742
|
id: "image",
|
|
51742
51743
|
module: "images",
|
|
51743
51744
|
name: "Images",
|
|
51744
|
-
version:
|
|
51745
|
+
version: VERSION6,
|
|
51745
51746
|
mimeTypes: MIME_TYPES,
|
|
51746
51747
|
extensions: EXTENSIONS,
|
|
51747
51748
|
parse: parseImage,
|
|
@@ -51804,7 +51805,7 @@ var ImageWriter = {
|
|
|
51804
51805
|
name: "Images",
|
|
51805
51806
|
id: "image",
|
|
51806
51807
|
module: "images",
|
|
51807
|
-
version:
|
|
51808
|
+
version: VERSION6,
|
|
51808
51809
|
extensions: ["jpeg"],
|
|
51809
51810
|
options: {
|
|
51810
51811
|
image: {
|
|
@@ -51855,6 +51856,25 @@ function assert6(condition, message) {
|
|
|
51855
51856
|
}
|
|
51856
51857
|
}
|
|
51857
51858
|
|
|
51859
|
+
// ../gltf/src/lib/gltf-utils/gltf-constants.ts
|
|
51860
|
+
var COMPONENTS = {
|
|
51861
|
+
SCALAR: 1,
|
|
51862
|
+
VEC2: 2,
|
|
51863
|
+
VEC3: 3,
|
|
51864
|
+
VEC4: 4,
|
|
51865
|
+
MAT2: 4,
|
|
51866
|
+
MAT3: 9,
|
|
51867
|
+
MAT4: 16
|
|
51868
|
+
};
|
|
51869
|
+
var BYTES = {
|
|
51870
|
+
5120: 1,
|
|
51871
|
+
5121: 1,
|
|
51872
|
+
5122: 2,
|
|
51873
|
+
5123: 2,
|
|
51874
|
+
5125: 4,
|
|
51875
|
+
5126: 4
|
|
51876
|
+
};
|
|
51877
|
+
|
|
51858
51878
|
// ../gltf/src/lib/gltf-utils/gltf-utils.ts
|
|
51859
51879
|
var MIPMAP_FACTOR = 1.33;
|
|
51860
51880
|
var TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
|
|
@@ -51913,6 +51933,27 @@ function getAccessorArrayTypeAndLength(accessor, bufferView) {
|
|
|
51913
51933
|
assert6(byteLength >= 0 && byteLength <= bufferView.byteLength);
|
|
51914
51934
|
return { ArrayType, length, byteLength };
|
|
51915
51935
|
}
|
|
51936
|
+
function getFloat32ArrayForAccessor(gltfData, texCoordAccessor) {
|
|
51937
|
+
const accessor = gltfData.json.accessors?.[texCoordAccessor];
|
|
51938
|
+
if (accessor && typeof accessor.bufferView !== "undefined") {
|
|
51939
|
+
const bufferView = gltfData.json.bufferViews?.[accessor.bufferView];
|
|
51940
|
+
if (bufferView) {
|
|
51941
|
+
const { arrayBuffer, byteOffset: bufferByteOffset } = gltfData.buffers[bufferView.buffer];
|
|
51942
|
+
const byteOffset = (bufferByteOffset || 0) + (accessor.byteOffset || 0) + (bufferView.byteOffset || 0);
|
|
51943
|
+
const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
51944
|
+
const bytes = BYTES[accessor.componentType];
|
|
51945
|
+
const components = COMPONENTS[accessor.type];
|
|
51946
|
+
const elementAddressScale = bufferView.byteStride || bytes * components;
|
|
51947
|
+
const result = new Float32Array(length);
|
|
51948
|
+
for (let i = 0; i < accessor.count; i++) {
|
|
51949
|
+
const uv = new ArrayType(arrayBuffer, byteOffset + i * elementAddressScale, 2);
|
|
51950
|
+
result.set(uv, i * components);
|
|
51951
|
+
}
|
|
51952
|
+
return result;
|
|
51953
|
+
}
|
|
51954
|
+
}
|
|
51955
|
+
return null;
|
|
51956
|
+
}
|
|
51916
51957
|
function getMemoryUsageGLTF(gltf) {
|
|
51917
51958
|
let { images, bufferViews } = gltf;
|
|
51918
51959
|
images = images || [];
|
|
@@ -52340,7 +52381,7 @@ var GLTFScenegraph = class {
|
|
|
52340
52381
|
}
|
|
52341
52382
|
};
|
|
52342
52383
|
|
|
52343
|
-
// ../gltf/src/lib/extensions/
|
|
52384
|
+
// ../gltf/src/lib/extensions/utils/3d-tiles-utils.ts
|
|
52344
52385
|
var ATTRIBUTE_TYPE_TO_COMPONENTS2 = {
|
|
52345
52386
|
SCALAR: 1,
|
|
52346
52387
|
VEC2: 2,
|
|
@@ -52380,21 +52421,40 @@ var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2 = {
|
|
|
52380
52421
|
function getArrayElementByteSize(attributeType, componentType) {
|
|
52381
52422
|
return ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2[componentType] * ATTRIBUTE_TYPE_TO_COMPONENTS2[attributeType];
|
|
52382
52423
|
}
|
|
52383
|
-
function
|
|
52424
|
+
function getOffsetsForProperty(scenegraph, bufferViewIndex, offsetType, numberOfElements) {
|
|
52425
|
+
if (offsetType !== "UINT8" && offsetType !== "UINT16" && offsetType !== "UINT32" && offsetType !== "UINT64") {
|
|
52426
|
+
return null;
|
|
52427
|
+
}
|
|
52428
|
+
const arrayOffsetsBytes = scenegraph.getTypedArrayForBufferView(bufferViewIndex);
|
|
52429
|
+
const arrayOffsets = convertRawBufferToMetadataArray(arrayOffsetsBytes, "SCALAR", offsetType, numberOfElements + 1);
|
|
52430
|
+
if (arrayOffsets instanceof BigInt64Array || arrayOffsets instanceof BigUint64Array) {
|
|
52431
|
+
return null;
|
|
52432
|
+
}
|
|
52433
|
+
return arrayOffsets;
|
|
52434
|
+
}
|
|
52435
|
+
function convertRawBufferToMetadataArray(data, attributeType, componentType, elementCount = 1) {
|
|
52384
52436
|
const numberOfComponents = ATTRIBUTE_TYPE_TO_COMPONENTS2[attributeType];
|
|
52385
52437
|
const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY2[componentType];
|
|
52386
|
-
const length = elementCount * numberOfComponents;
|
|
52387
52438
|
const size = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2[componentType];
|
|
52388
|
-
const
|
|
52389
|
-
|
|
52439
|
+
const length = elementCount * numberOfComponents;
|
|
52440
|
+
const byteLength = length * size;
|
|
52441
|
+
let buffer = data.buffer;
|
|
52442
|
+
let offset = data.byteOffset;
|
|
52443
|
+
if (offset % size !== 0) {
|
|
52444
|
+
const bufferArray = new Uint8Array(buffer);
|
|
52445
|
+
buffer = bufferArray.slice(offset, offset + byteLength).buffer;
|
|
52446
|
+
offset = 0;
|
|
52447
|
+
}
|
|
52448
|
+
return new ArrayType(buffer, offset, length);
|
|
52390
52449
|
}
|
|
52391
52450
|
function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
|
|
52392
52451
|
const json = scenegraph.gltf.json;
|
|
52393
52452
|
const texCoordAccessorKey = `TEXCOORD_${textureInfo.texCoord || 0}`;
|
|
52394
52453
|
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
52395
|
-
const
|
|
52396
|
-
|
|
52397
|
-
|
|
52454
|
+
const textureCoordinates = getFloat32ArrayForAccessor(scenegraph.gltf, texCoordAccessorIndex);
|
|
52455
|
+
if (!textureCoordinates) {
|
|
52456
|
+
return null;
|
|
52457
|
+
}
|
|
52398
52458
|
const textureIndex = textureInfo.index;
|
|
52399
52459
|
const imageIndex = json.textures?.[textureIndex]?.source;
|
|
52400
52460
|
if (typeof imageIndex !== "undefined") {
|
|
@@ -52412,8 +52472,9 @@ function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
|
|
|
52412
52472
|
return null;
|
|
52413
52473
|
}
|
|
52414
52474
|
function primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive) {
|
|
52415
|
-
if (propertyData
|
|
52475
|
+
if (!propertyData?.length) {
|
|
52416
52476
|
return;
|
|
52477
|
+
}
|
|
52417
52478
|
const featureIndices = [];
|
|
52418
52479
|
for (const texelData of propertyData) {
|
|
52419
52480
|
let index = featureTable.findIndex((item) => item === texelData);
|
|
@@ -52437,12 +52498,12 @@ function primitivePropertyDataToAttributes(scenegraph, attributeName, propertyDa
|
|
|
52437
52498
|
primitive.attributes[attributeName] = accessorIndex;
|
|
52438
52499
|
}
|
|
52439
52500
|
function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, channels = [0]) {
|
|
52440
|
-
const CHANNELS_MAP =
|
|
52441
|
-
{ offset: 0, shift: 0 },
|
|
52442
|
-
{ offset: 1, shift: 8 },
|
|
52443
|
-
{ offset: 2, shift: 16 },
|
|
52444
|
-
{ offset: 3, shift: 24 }
|
|
52445
|
-
|
|
52501
|
+
const CHANNELS_MAP = {
|
|
52502
|
+
r: { offset: 0, shift: 0 },
|
|
52503
|
+
g: { offset: 1, shift: 8 },
|
|
52504
|
+
b: { offset: 2, shift: 16 },
|
|
52505
|
+
a: { offset: 3, shift: 24 }
|
|
52506
|
+
};
|
|
52446
52507
|
const u = textureCoordinates[index];
|
|
52447
52508
|
const v = textureCoordinates[index + 1];
|
|
52448
52509
|
let components = 1;
|
|
@@ -52451,7 +52512,7 @@ function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, i
|
|
|
52451
52512
|
const offset = coordinatesToOffset(u, v, parsedImage, components);
|
|
52452
52513
|
let value = 0;
|
|
52453
52514
|
for (const c of channels) {
|
|
52454
|
-
const map = CHANNELS_MAP[c];
|
|
52515
|
+
const map = typeof c === "number" ? Object.values(CHANNELS_MAP)[c] : CHANNELS_MAP[c];
|
|
52455
52516
|
const imageOffset = offset + map.offset;
|
|
52456
52517
|
const imageData = getImageData(parsedImage);
|
|
52457
52518
|
if (imageData.data.length <= imageOffset) {
|
|
@@ -52474,19 +52535,81 @@ function coordinatesToOffset(u, v, parsedImage, componentsCount = 1) {
|
|
|
52474
52535
|
return offset;
|
|
52475
52536
|
}
|
|
52476
52537
|
|
|
52538
|
+
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
52539
|
+
var EXT_MESH_FEATURES_NAME = "EXT_mesh_features";
|
|
52540
|
+
var name = EXT_MESH_FEATURES_NAME;
|
|
52541
|
+
async function decode(gltfData, options) {
|
|
52542
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52543
|
+
decodeExtMeshFeatures(scenegraph, options);
|
|
52544
|
+
}
|
|
52545
|
+
function decodeExtMeshFeatures(scenegraph, options) {
|
|
52546
|
+
const json = scenegraph.gltf.json;
|
|
52547
|
+
if (!json.meshes) {
|
|
52548
|
+
return;
|
|
52549
|
+
}
|
|
52550
|
+
for (const mesh of json.meshes) {
|
|
52551
|
+
for (const primitive of mesh.primitives) {
|
|
52552
|
+
processMeshPrimitiveFeatures(scenegraph, primitive, options);
|
|
52553
|
+
}
|
|
52554
|
+
}
|
|
52555
|
+
}
|
|
52556
|
+
function processMeshPrimitiveFeatures(scenegraph, primitive, options) {
|
|
52557
|
+
if (!options?.gltf?.loadBuffers) {
|
|
52558
|
+
return;
|
|
52559
|
+
}
|
|
52560
|
+
const extension = primitive.extensions?.[EXT_MESH_FEATURES_NAME];
|
|
52561
|
+
const featureIds = extension?.featureIds;
|
|
52562
|
+
if (!featureIds) {
|
|
52563
|
+
return;
|
|
52564
|
+
}
|
|
52565
|
+
for (const featureId of featureIds) {
|
|
52566
|
+
let featureIdData = null;
|
|
52567
|
+
if (typeof featureId.attribute !== "undefined") {
|
|
52568
|
+
const accessorKey = `_FEATURE_ID_${featureId.attribute}`;
|
|
52569
|
+
const accessorIndex = primitive.attributes[accessorKey];
|
|
52570
|
+
featureIdData = scenegraph.getTypedArrayForAccessor(accessorIndex);
|
|
52571
|
+
} else if (typeof featureId.texture !== "undefined" && options?.gltf?.loadImages) {
|
|
52572
|
+
featureIdData = getPrimitiveTextureData(scenegraph, featureId.texture, primitive);
|
|
52573
|
+
} else {
|
|
52574
|
+
}
|
|
52575
|
+
featureId.data = featureIdData;
|
|
52576
|
+
}
|
|
52577
|
+
}
|
|
52578
|
+
|
|
52477
52579
|
// ../gltf/src/lib/extensions/EXT_structural_metadata.ts
|
|
52478
52580
|
var EXT_structural_metadata_exports = {};
|
|
52479
52581
|
__export(EXT_structural_metadata_exports, {
|
|
52480
|
-
decode: () =>
|
|
52582
|
+
decode: () => decode2,
|
|
52583
|
+
getPropertyTableFromExtStructuralMetadata: () => getPropertyTableFromExtStructuralMetadata,
|
|
52481
52584
|
getPropertyTablePopulated: () => getPropertyTablePopulated,
|
|
52482
|
-
name: () =>
|
|
52585
|
+
name: () => name2
|
|
52483
52586
|
});
|
|
52484
52587
|
var EXT_STRUCTURAL_METADATA_NAME = "EXT_structural_metadata";
|
|
52485
|
-
var
|
|
52486
|
-
async function
|
|
52588
|
+
var name2 = EXT_STRUCTURAL_METADATA_NAME;
|
|
52589
|
+
async function decode2(gltfData, options) {
|
|
52487
52590
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52488
52591
|
decodeExtStructuralMetadata(scenegraph, options);
|
|
52489
52592
|
}
|
|
52593
|
+
function getPropertyTableFromExtStructuralMetadata(extension, metadataClass) {
|
|
52594
|
+
if (extension.propertyTables) {
|
|
52595
|
+
const firstPropertyTable = extension?.propertyTables[0];
|
|
52596
|
+
const propertyTableWithData = {};
|
|
52597
|
+
for (const propertyName in firstPropertyTable.properties) {
|
|
52598
|
+
propertyTableWithData[propertyName] = firstPropertyTable.properties[propertyName].data;
|
|
52599
|
+
}
|
|
52600
|
+
return propertyTableWithData;
|
|
52601
|
+
}
|
|
52602
|
+
if (extension.propertyTextures) {
|
|
52603
|
+
const firstPropertyTexture = extension?.propertyTextures[0];
|
|
52604
|
+
const propertyTableWithData = {};
|
|
52605
|
+
for (const propertyName in firstPropertyTexture.properties) {
|
|
52606
|
+
propertyTableWithData[propertyName] = firstPropertyTexture.properties[propertyName].data;
|
|
52607
|
+
}
|
|
52608
|
+
return propertyTableWithData;
|
|
52609
|
+
}
|
|
52610
|
+
console.warn("Cannot get property table from EXT_structural_metadata extension. There is neither propertyTables, nor propertyTextures in the extension.");
|
|
52611
|
+
return null;
|
|
52612
|
+
}
|
|
52490
52613
|
function getPropertyTablePopulated(scenegraph, propertyTableIndex) {
|
|
52491
52614
|
const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
|
|
52492
52615
|
const propertyTable = extension?.propertyTables?.[propertyTableIndex];
|
|
@@ -52497,30 +52620,53 @@ function getPropertyTablePopulated(scenegraph, propertyTableIndex) {
|
|
|
52497
52620
|
throw new Error(`Incorrect data in the EXT_structural_metadata extension: no property table with index ${propertyTableIndex}`);
|
|
52498
52621
|
}
|
|
52499
52622
|
function decodeExtStructuralMetadata(scenegraph, options) {
|
|
52623
|
+
if (!options.gltf?.loadBuffers) {
|
|
52624
|
+
return;
|
|
52625
|
+
}
|
|
52500
52626
|
const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
|
|
52501
|
-
if (!extension
|
|
52627
|
+
if (!extension) {
|
|
52502
52628
|
return;
|
|
52503
52629
|
}
|
|
52630
|
+
if (options.gltf?.loadImages) {
|
|
52631
|
+
decodePropertyTextures(scenegraph, extension);
|
|
52632
|
+
}
|
|
52633
|
+
decodePropertyTables(scenegraph, extension);
|
|
52634
|
+
}
|
|
52635
|
+
function decodePropertyTextures(scenegraph, extension) {
|
|
52504
52636
|
const propertyTextures = extension.propertyTextures;
|
|
52505
52637
|
const json = scenegraph.gltf.json;
|
|
52506
|
-
if (propertyTextures && json.meshes
|
|
52638
|
+
if (propertyTextures && json.meshes) {
|
|
52507
52639
|
for (const mesh of json.meshes) {
|
|
52508
52640
|
for (const primitive of mesh.primitives) {
|
|
52509
52641
|
processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension);
|
|
52510
52642
|
}
|
|
52511
52643
|
}
|
|
52512
52644
|
}
|
|
52513
|
-
|
|
52645
|
+
}
|
|
52646
|
+
function decodePropertyTables(scenegraph, extension) {
|
|
52647
|
+
const schema = extension.schema;
|
|
52648
|
+
if (!schema) {
|
|
52649
|
+
return;
|
|
52650
|
+
}
|
|
52651
|
+
const schemaClasses = schema.classes;
|
|
52514
52652
|
const propertyTables = extension.propertyTables;
|
|
52515
52653
|
if (schemaClasses && propertyTables) {
|
|
52516
52654
|
for (const schemaName in schemaClasses) {
|
|
52517
52655
|
const propertyTable = findPropertyTableByClass(propertyTables, schemaName);
|
|
52518
52656
|
if (propertyTable) {
|
|
52519
|
-
processPropertyTable(scenegraph,
|
|
52657
|
+
processPropertyTable(scenegraph, schema, propertyTable);
|
|
52520
52658
|
}
|
|
52521
52659
|
}
|
|
52522
52660
|
}
|
|
52523
52661
|
}
|
|
52662
|
+
function findPropertyTableByClass(propertyTables, schemaClassName) {
|
|
52663
|
+
for (const propertyTable of propertyTables) {
|
|
52664
|
+
if (propertyTable.class === schemaClassName) {
|
|
52665
|
+
return propertyTable;
|
|
52666
|
+
}
|
|
52667
|
+
}
|
|
52668
|
+
return null;
|
|
52669
|
+
}
|
|
52524
52670
|
function processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension) {
|
|
52525
52671
|
if (!propertyTextures) {
|
|
52526
52672
|
return;
|
|
@@ -52543,9 +52689,9 @@ function processPrimitivePropertyTexture(scenegraph, propertyTexture, primitive,
|
|
|
52543
52689
|
extension.dataAttributeNames = [];
|
|
52544
52690
|
}
|
|
52545
52691
|
const className = propertyTexture.class;
|
|
52546
|
-
for (const
|
|
52547
|
-
const attributeName = `${className}_${
|
|
52548
|
-
const textureInfoTopLevel = propertyTexture.properties?.[
|
|
52692
|
+
for (const propertyName in propertyTexture.properties) {
|
|
52693
|
+
const attributeName = `${className}_${propertyName}`;
|
|
52694
|
+
const textureInfoTopLevel = propertyTexture.properties?.[propertyName];
|
|
52549
52695
|
if (!textureInfoTopLevel) {
|
|
52550
52696
|
continue;
|
|
52551
52697
|
}
|
|
@@ -52581,14 +52727,8 @@ function getPropertyDataFromBinarySource(scenegraph, schema, classProperty, numb
|
|
|
52581
52727
|
let data = [];
|
|
52582
52728
|
const valuesBufferView = propertyTableProperty.values;
|
|
52583
52729
|
const valuesDataBytes = scenegraph.getTypedArrayForBufferView(valuesBufferView);
|
|
52584
|
-
|
|
52585
|
-
|
|
52586
|
-
arrayOffsets = getOffsetArray(scenegraph, propertyTableProperty.arrayOffsets, propertyTableProperty.arrayOffsetType, numberOfElements);
|
|
52587
|
-
}
|
|
52588
|
-
let stringOffsets = null;
|
|
52589
|
-
if (typeof propertyTableProperty.stringOffsets !== "undefined" && typeof propertyTableProperty.stringOffsetType !== "undefined") {
|
|
52590
|
-
stringOffsets = getOffsetArray(scenegraph, propertyTableProperty.stringOffsets, propertyTableProperty.stringOffsetType, numberOfElements);
|
|
52591
|
-
}
|
|
52730
|
+
const arrayOffsets = getArrayOffsetsForProperty(scenegraph, classProperty, propertyTableProperty, numberOfElements);
|
|
52731
|
+
const stringOffsets = getStringOffsetsForProperty(scenegraph, propertyTableProperty, numberOfElements);
|
|
52592
52732
|
switch (classProperty.type) {
|
|
52593
52733
|
case "SCALAR":
|
|
52594
52734
|
case "VEC2":
|
|
@@ -52616,11 +52756,17 @@ function getPropertyDataFromBinarySource(scenegraph, schema, classProperty, numb
|
|
|
52616
52756
|
}
|
|
52617
52757
|
return data;
|
|
52618
52758
|
}
|
|
52619
|
-
function
|
|
52620
|
-
|
|
52621
|
-
|
|
52622
|
-
|
|
52623
|
-
return
|
|
52759
|
+
function getArrayOffsetsForProperty(scenegraph, classProperty, propertyTableProperty, numberOfElements) {
|
|
52760
|
+
if (classProperty.array && typeof classProperty.count === "undefined" && typeof propertyTableProperty.arrayOffsets !== "undefined") {
|
|
52761
|
+
return getOffsetsForProperty(scenegraph, propertyTableProperty.arrayOffsets, propertyTableProperty.arrayOffsetType || "UINT32", numberOfElements);
|
|
52762
|
+
}
|
|
52763
|
+
return null;
|
|
52764
|
+
}
|
|
52765
|
+
function getStringOffsetsForProperty(scenegraph, propertyTableProperty, numberOfElements) {
|
|
52766
|
+
if (typeof propertyTableProperty.stringOffsets !== "undefined") {
|
|
52767
|
+
return getOffsetsForProperty(scenegraph, propertyTableProperty.stringOffsets, propertyTableProperty.stringOffsetType || "UINT32", numberOfElements);
|
|
52768
|
+
}
|
|
52769
|
+
return null;
|
|
52624
52770
|
}
|
|
52625
52771
|
function getPropertyDataNumeric(classProperty, numberOfElements, valuesDataBytes, arrayOffsets) {
|
|
52626
52772
|
const isArray = classProperty.array;
|
|
@@ -52630,52 +52776,42 @@ function getPropertyDataNumeric(classProperty, numberOfElements, valuesDataBytes
|
|
|
52630
52776
|
let valuesData;
|
|
52631
52777
|
if (classProperty.componentType) {
|
|
52632
52778
|
valuesData = convertRawBufferToMetadataArray(valuesDataBytes, classProperty.type, classProperty.componentType, elementCount);
|
|
52779
|
+
if (!valuesData) {
|
|
52780
|
+
valuesData = valuesDataBytes;
|
|
52781
|
+
}
|
|
52633
52782
|
} else {
|
|
52634
52783
|
valuesData = valuesDataBytes;
|
|
52635
52784
|
}
|
|
52636
52785
|
if (isArray) {
|
|
52637
52786
|
if (arrayOffsets) {
|
|
52638
|
-
return
|
|
52787
|
+
return parseVariableLengthArrayNumeric(valuesData, numberOfElements, arrayOffsets, valuesDataBytes.length, elementSize);
|
|
52639
52788
|
}
|
|
52640
52789
|
if (arrayCount) {
|
|
52641
|
-
return
|
|
52790
|
+
return parseFixedLengthArrayNumeric(valuesData, numberOfElements, arrayCount);
|
|
52642
52791
|
}
|
|
52643
52792
|
return [];
|
|
52644
52793
|
}
|
|
52645
|
-
|
|
52646
|
-
for (let index = 0; index < numberOfElements; index++) {
|
|
52647
|
-
const value = valuesData[index];
|
|
52648
|
-
attributeValueArray.push(value);
|
|
52649
|
-
}
|
|
52650
|
-
return attributeValueArray;
|
|
52794
|
+
return valuesData;
|
|
52651
52795
|
}
|
|
52652
|
-
function
|
|
52796
|
+
function parseVariableLengthArrayNumeric(valuesData, numberOfElements, arrayOffsets, valuesDataBytesLength, valueSize) {
|
|
52653
52797
|
const attributeValueArray = [];
|
|
52654
52798
|
for (let index = 0; index < numberOfElements; index++) {
|
|
52655
|
-
const array = [];
|
|
52656
52799
|
const arrayOffset = arrayOffsets[index];
|
|
52657
52800
|
const arrayByteSize = arrayOffsets[index + 1] - arrayOffsets[index];
|
|
52658
|
-
if (arrayByteSize + arrayOffset
|
|
52659
|
-
|
|
52660
|
-
const elementCount = arrayByteSize / elementSize;
|
|
52661
|
-
for (let i = 0; i < elementCount; i++) {
|
|
52662
|
-
const value = valuesData[typedArrayOffset + i];
|
|
52663
|
-
array.push(value);
|
|
52664
|
-
}
|
|
52801
|
+
if (arrayByteSize + arrayOffset > valuesDataBytesLength) {
|
|
52802
|
+
break;
|
|
52665
52803
|
}
|
|
52666
|
-
|
|
52804
|
+
const typedArrayOffset = arrayOffset / valueSize;
|
|
52805
|
+
const elementCount = arrayByteSize / valueSize;
|
|
52806
|
+
attributeValueArray.push(valuesData.slice(typedArrayOffset, typedArrayOffset + elementCount));
|
|
52667
52807
|
}
|
|
52668
52808
|
return attributeValueArray;
|
|
52669
52809
|
}
|
|
52670
|
-
function
|
|
52810
|
+
function parseFixedLengthArrayNumeric(valuesData, numberOfElements, arrayCount) {
|
|
52671
52811
|
const attributeValueArray = [];
|
|
52672
52812
|
for (let index = 0; index < numberOfElements; index++) {
|
|
52673
|
-
const
|
|
52674
|
-
|
|
52675
|
-
const value = valuesData[i];
|
|
52676
|
-
array.push(value);
|
|
52677
|
-
}
|
|
52678
|
-
attributeValueArray.push(array);
|
|
52813
|
+
const elementOffset = index * arrayCount;
|
|
52814
|
+
attributeValueArray.push(valuesData.slice(elementOffset, elementOffset + arrayCount));
|
|
52679
52815
|
}
|
|
52680
52816
|
return attributeValueArray;
|
|
52681
52817
|
}
|
|
@@ -52701,9 +52837,6 @@ function getPropertyDataString(classProperty, numberOfElements, valuesDataBytes,
|
|
|
52701
52837
|
return [];
|
|
52702
52838
|
}
|
|
52703
52839
|
function getPropertyDataENUM(schema, classProperty, numberOfElements, valuesDataBytes, arrayOffsets) {
|
|
52704
|
-
const data = [];
|
|
52705
|
-
const isArray = classProperty.array;
|
|
52706
|
-
const arrayCount = classProperty.count;
|
|
52707
52840
|
const enumType = classProperty.enumType;
|
|
52708
52841
|
if (!enumType) {
|
|
52709
52842
|
throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");
|
|
@@ -52715,69 +52848,77 @@ function getPropertyDataENUM(schema, classProperty, numberOfElements, valuesData
|
|
|
52715
52848
|
const enumValueType = enumEntry.valueType || "UINT16";
|
|
52716
52849
|
const elementSize = getArrayElementByteSize(classProperty.type, enumValueType);
|
|
52717
52850
|
const elementCount = valuesDataBytes.byteLength / elementSize;
|
|
52718
|
-
|
|
52719
|
-
if (
|
|
52851
|
+
let valuesData = convertRawBufferToMetadataArray(valuesDataBytes, classProperty.type, enumValueType, elementCount);
|
|
52852
|
+
if (!valuesData) {
|
|
52853
|
+
valuesData = valuesDataBytes;
|
|
52854
|
+
}
|
|
52855
|
+
if (classProperty.array) {
|
|
52720
52856
|
if (arrayOffsets) {
|
|
52721
|
-
return
|
|
52857
|
+
return parseVariableLengthArrayENUM({
|
|
52858
|
+
valuesData,
|
|
52859
|
+
numberOfElements,
|
|
52860
|
+
arrayOffsets,
|
|
52861
|
+
valuesDataBytesLength: valuesDataBytes.length,
|
|
52862
|
+
elementSize,
|
|
52863
|
+
enumEntry
|
|
52864
|
+
});
|
|
52722
52865
|
}
|
|
52866
|
+
const arrayCount = classProperty.count;
|
|
52723
52867
|
if (arrayCount) {
|
|
52724
|
-
return
|
|
52868
|
+
return parseFixedLengthArrayENUM(valuesData, numberOfElements, arrayCount, enumEntry);
|
|
52725
52869
|
}
|
|
52726
52870
|
return [];
|
|
52727
52871
|
}
|
|
52728
|
-
|
|
52729
|
-
const enumValue = valuesData[index];
|
|
52730
|
-
const enumObject = getEnumByValue(enumEntry, enumValue);
|
|
52731
|
-
if (enumObject) {
|
|
52732
|
-
data.push(enumObject.name);
|
|
52733
|
-
}
|
|
52734
|
-
}
|
|
52735
|
-
return data;
|
|
52872
|
+
return getEnumsArray(valuesData, 0, numberOfElements, enumEntry);
|
|
52736
52873
|
}
|
|
52737
|
-
function
|
|
52874
|
+
function parseVariableLengthArrayENUM(params) {
|
|
52875
|
+
const {
|
|
52876
|
+
valuesData,
|
|
52877
|
+
numberOfElements,
|
|
52878
|
+
arrayOffsets,
|
|
52879
|
+
valuesDataBytesLength,
|
|
52880
|
+
elementSize,
|
|
52881
|
+
enumEntry
|
|
52882
|
+
} = params;
|
|
52738
52883
|
const attributeValueArray = [];
|
|
52739
52884
|
for (let index = 0; index < numberOfElements; index++) {
|
|
52740
|
-
const array = [];
|
|
52741
52885
|
const arrayOffset = arrayOffsets[index];
|
|
52742
52886
|
const arrayByteSize = arrayOffsets[index + 1] - arrayOffsets[index];
|
|
52743
|
-
if (arrayByteSize + arrayOffset
|
|
52744
|
-
|
|
52745
|
-
const elementCount = arrayByteSize / elementSize;
|
|
52746
|
-
for (let i = 0; i < elementCount; i++) {
|
|
52747
|
-
const value = valuesData[typedArrayOffset + i];
|
|
52748
|
-
const enumObject = getEnumByValue(enumEntry, value);
|
|
52749
|
-
if (enumObject) {
|
|
52750
|
-
array.push(enumObject.name);
|
|
52751
|
-
}
|
|
52752
|
-
}
|
|
52887
|
+
if (arrayByteSize + arrayOffset > valuesDataBytesLength) {
|
|
52888
|
+
break;
|
|
52753
52889
|
}
|
|
52890
|
+
const typedArrayOffset = arrayOffset / elementSize;
|
|
52891
|
+
const elementCount = arrayByteSize / elementSize;
|
|
52892
|
+
const array = getEnumsArray(valuesData, typedArrayOffset, elementCount, enumEntry);
|
|
52754
52893
|
attributeValueArray.push(array);
|
|
52755
52894
|
}
|
|
52756
52895
|
return attributeValueArray;
|
|
52757
52896
|
}
|
|
52758
|
-
function
|
|
52897
|
+
function parseFixedLengthArrayENUM(valuesData, numberOfElements, arrayCount, enumEntry) {
|
|
52759
52898
|
const attributeValueArray = [];
|
|
52760
52899
|
for (let index = 0; index < numberOfElements; index++) {
|
|
52761
|
-
const
|
|
52762
|
-
|
|
52763
|
-
const value = valuesData[i];
|
|
52764
|
-
const enumObject = getEnumByValue(enumEntry, value);
|
|
52765
|
-
if (enumObject) {
|
|
52766
|
-
array.push(enumObject.name);
|
|
52767
|
-
}
|
|
52768
|
-
}
|
|
52900
|
+
const elementOffset = arrayCount * index;
|
|
52901
|
+
const array = getEnumsArray(valuesData, elementOffset, arrayCount, enumEntry);
|
|
52769
52902
|
attributeValueArray.push(array);
|
|
52770
52903
|
}
|
|
52771
52904
|
return attributeValueArray;
|
|
52772
52905
|
}
|
|
52773
|
-
function
|
|
52774
|
-
|
|
52775
|
-
|
|
52776
|
-
if (
|
|
52777
|
-
|
|
52906
|
+
function getEnumsArray(valuesData, offset, count, enumEntry) {
|
|
52907
|
+
const array = [];
|
|
52908
|
+
for (let i = 0; i < count; i++) {
|
|
52909
|
+
if (valuesData instanceof BigInt64Array || valuesData instanceof BigUint64Array) {
|
|
52910
|
+
array.push("");
|
|
52911
|
+
} else {
|
|
52912
|
+
const value = valuesData[offset + i];
|
|
52913
|
+
const enumObject = getEnumByValue(enumEntry, value);
|
|
52914
|
+
if (enumObject) {
|
|
52915
|
+
array.push(enumObject.name);
|
|
52916
|
+
} else {
|
|
52917
|
+
array.push("");
|
|
52918
|
+
}
|
|
52778
52919
|
}
|
|
52779
52920
|
}
|
|
52780
|
-
return
|
|
52921
|
+
return array;
|
|
52781
52922
|
}
|
|
52782
52923
|
function getEnumByValue(enumEntry, value) {
|
|
52783
52924
|
for (const enumValue of enumEntry.values) {
|
|
@@ -52788,63 +52929,11 @@ function getEnumByValue(enumEntry, value) {
|
|
|
52788
52929
|
return null;
|
|
52789
52930
|
}
|
|
52790
52931
|
|
|
52791
|
-
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
52792
|
-
var EXT_MESH_FEATURES_NAME = "EXT_mesh_features";
|
|
52793
|
-
var name2 = EXT_MESH_FEATURES_NAME;
|
|
52794
|
-
async function decode2(gltfData, options) {
|
|
52795
|
-
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52796
|
-
decodeExtMeshFeatures(scenegraph, options);
|
|
52797
|
-
}
|
|
52798
|
-
function decodeExtMeshFeatures(scenegraph, options) {
|
|
52799
|
-
const json = scenegraph.gltf.json;
|
|
52800
|
-
if (!json.meshes) {
|
|
52801
|
-
return;
|
|
52802
|
-
}
|
|
52803
|
-
for (const mesh of json.meshes) {
|
|
52804
|
-
for (const primitive of mesh.primitives) {
|
|
52805
|
-
processMeshPrimitiveFeatures(scenegraph, primitive, options);
|
|
52806
|
-
}
|
|
52807
|
-
}
|
|
52808
|
-
}
|
|
52809
|
-
function processMeshPrimitiveFeatures(scenegraph, primitive, options) {
|
|
52810
|
-
const extension = primitive.extensions?.[EXT_MESH_FEATURES_NAME];
|
|
52811
|
-
const featureIds = extension?.featureIds;
|
|
52812
|
-
if (!featureIds)
|
|
52813
|
-
return;
|
|
52814
|
-
if (!extension.dataAttributeNames) {
|
|
52815
|
-
extension.dataAttributeNames = [];
|
|
52816
|
-
}
|
|
52817
|
-
let featureIdCount = 0;
|
|
52818
|
-
for (const featureId of featureIds) {
|
|
52819
|
-
let propertyTable = null;
|
|
52820
|
-
if (typeof featureId.propertyTable === "number") {
|
|
52821
|
-
propertyTable = getPropertyTablePopulated(scenegraph, featureId.propertyTable);
|
|
52822
|
-
}
|
|
52823
|
-
let propertyData = null;
|
|
52824
|
-
if (typeof featureId.attribute !== "undefined") {
|
|
52825
|
-
const accessorKey = `_FEATURE_ID_${featureId.attribute}`;
|
|
52826
|
-
const accessorIndex = primitive.attributes[accessorKey];
|
|
52827
|
-
const propertyDataTypedArray = scenegraph.getTypedArrayForAccessor(accessorIndex);
|
|
52828
|
-
propertyData = Array.prototype.slice.call(propertyDataTypedArray);
|
|
52829
|
-
} else if (typeof featureId.texture !== "undefined" && options?.gltf?.loadImages) {
|
|
52830
|
-
propertyData = getPrimitiveTextureData(scenegraph, featureId.texture, primitive);
|
|
52831
|
-
} else {
|
|
52832
|
-
}
|
|
52833
|
-
const attributeName = featureId.label || propertyTable?.name || `featureAttribute${featureIdCount}`;
|
|
52834
|
-
const featureTable = [];
|
|
52835
|
-
if (propertyData) {
|
|
52836
|
-
primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive);
|
|
52837
|
-
}
|
|
52838
|
-
extension.dataAttributeNames.push(attributeName);
|
|
52839
|
-
featureId.data = featureTable;
|
|
52840
|
-
featureIdCount++;
|
|
52841
|
-
}
|
|
52842
|
-
}
|
|
52843
|
-
|
|
52844
52932
|
// ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
|
|
52845
52933
|
var EXT_feature_metadata_exports = {};
|
|
52846
52934
|
__export(EXT_feature_metadata_exports, {
|
|
52847
52935
|
decode: () => decode3,
|
|
52936
|
+
getPropertyTableFromExtFeatureMetadata: () => getPropertyTableFromExtFeatureMetadata,
|
|
52848
52937
|
name: () => name3
|
|
52849
52938
|
});
|
|
52850
52939
|
var EXT_FEATURE_METADATA_NAME = "EXT_feature_metadata";
|
|
@@ -52853,6 +52942,38 @@ async function decode3(gltfData, options) {
|
|
|
52853
52942
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52854
52943
|
decodeExtFeatureMetadata(scenegraph, options);
|
|
52855
52944
|
}
|
|
52945
|
+
function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
52946
|
+
if (extension.featureTables) {
|
|
52947
|
+
const firstFeatureTableName = Object.keys(extension.featureTables)?.[0];
|
|
52948
|
+
if (firstFeatureTableName) {
|
|
52949
|
+
const featureTable = extension.featureTables[firstFeatureTableName];
|
|
52950
|
+
const propertyTable = {};
|
|
52951
|
+
for (const propertyName in featureTable.properties) {
|
|
52952
|
+
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
52953
|
+
}
|
|
52954
|
+
return propertyTable;
|
|
52955
|
+
}
|
|
52956
|
+
}
|
|
52957
|
+
if (extension.featureTextures) {
|
|
52958
|
+
let featureTexture;
|
|
52959
|
+
for (const textureKey in extension.featureTextures) {
|
|
52960
|
+
const texture = extension.featureTextures[textureKey];
|
|
52961
|
+
if (texture.class === metadataClass) {
|
|
52962
|
+
featureTexture = textureKey;
|
|
52963
|
+
}
|
|
52964
|
+
}
|
|
52965
|
+
if (typeof featureTexture === "string") {
|
|
52966
|
+
const featureTable = extension.featureTextures[featureTexture];
|
|
52967
|
+
const propertyTable = {};
|
|
52968
|
+
for (const propertyName in featureTable.properties) {
|
|
52969
|
+
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
52970
|
+
}
|
|
52971
|
+
return propertyTable;
|
|
52972
|
+
}
|
|
52973
|
+
}
|
|
52974
|
+
console.warn("Cannot get property table from EXT_feature_metadata extension. There is neither featureTables, nor featureTextures in the extension.");
|
|
52975
|
+
return null;
|
|
52976
|
+
}
|
|
52856
52977
|
function decodeExtFeatureMetadata(scenegraph, options) {
|
|
52857
52978
|
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA_NAME);
|
|
52858
52979
|
if (!extension)
|
|
@@ -52903,16 +53024,43 @@ function handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass)
|
|
|
52903
53024
|
function getPropertyDataFromBinarySource2(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
|
|
52904
53025
|
const bufferView = featureTableProperty.bufferView;
|
|
52905
53026
|
const dataArray = scenegraph.getTypedArrayForBufferView(bufferView);
|
|
52906
|
-
|
|
52907
|
-
|
|
52908
|
-
|
|
52909
|
-
|
|
52910
|
-
return getStringAttributes(dataArray, offsetsData, numberOfFeatures);
|
|
53027
|
+
if (schemaProperty.type === "STRING") {
|
|
53028
|
+
const offsetsData = getStringOffsets(scenegraph, featureTableProperty, numberOfFeatures);
|
|
53029
|
+
if (!offsetsData) {
|
|
53030
|
+
return [];
|
|
52911
53031
|
}
|
|
52912
|
-
|
|
53032
|
+
return getStringAttributes(dataArray, offsetsData, numberOfFeatures);
|
|
53033
|
+
} else if (isNumericProperty(schemaProperty.type)) {
|
|
53034
|
+
return getNumericAttributes(dataArray, schemaProperty.type, numberOfFeatures);
|
|
52913
53035
|
}
|
|
52914
53036
|
return dataArray;
|
|
52915
53037
|
}
|
|
53038
|
+
function isNumericProperty(schemaPropertyType) {
|
|
53039
|
+
return [
|
|
53040
|
+
"UINT8",
|
|
53041
|
+
"INT16",
|
|
53042
|
+
"UINT16",
|
|
53043
|
+
"INT32",
|
|
53044
|
+
"UINT32",
|
|
53045
|
+
"INT64",
|
|
53046
|
+
"UINT64",
|
|
53047
|
+
"FLOAT32",
|
|
53048
|
+
"FLOAT64"
|
|
53049
|
+
].includes(schemaPropertyType);
|
|
53050
|
+
}
|
|
53051
|
+
function getStringOffsets(scenegraph, featureTableProperty, numberOfElements) {
|
|
53052
|
+
if (typeof featureTableProperty.stringOffsetBufferView !== "undefined") {
|
|
53053
|
+
return getOffsetsForProperty(scenegraph, featureTableProperty.stringOffsetBufferView, featureTableProperty.offsetType || "UINT32", numberOfElements);
|
|
53054
|
+
}
|
|
53055
|
+
return null;
|
|
53056
|
+
}
|
|
53057
|
+
function getNumericAttributes(valuesDataBytes, propertyType, elementCount) {
|
|
53058
|
+
let valuesData = convertRawBufferToMetadataArray(valuesDataBytes, "SCALAR", propertyType, elementCount);
|
|
53059
|
+
if (!valuesData) {
|
|
53060
|
+
valuesData = valuesDataBytes;
|
|
53061
|
+
}
|
|
53062
|
+
return valuesData;
|
|
53063
|
+
}
|
|
52916
53064
|
function getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName) {
|
|
52917
53065
|
const json = scenegraph.gltf.json;
|
|
52918
53066
|
if (!json.meshes) {
|
|
@@ -52931,9 +53079,10 @@ function processPrimitiveTextures(scenegraph, attributeName, featureTexturePrope
|
|
|
52931
53079
|
const textureData = [];
|
|
52932
53080
|
const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;
|
|
52933
53081
|
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
52934
|
-
const
|
|
52935
|
-
|
|
52936
|
-
|
|
53082
|
+
const textureCoordinates = getFloat32ArrayForAccessor(scenegraph.gltf, texCoordAccessorIndex);
|
|
53083
|
+
if (!textureCoordinates) {
|
|
53084
|
+
return;
|
|
53085
|
+
}
|
|
52937
53086
|
const textureIndex = featureTextureProperty.texture.index;
|
|
52938
53087
|
const texture = json.textures?.[textureIndex];
|
|
52939
53088
|
const imageIndex = texture?.source;
|
|
@@ -53030,23 +53179,19 @@ function findFeatureTextureByName(featureTextures, schemaClassName) {
|
|
|
53030
53179
|
function getStringAttributes(data, offsetsData, stringsCount) {
|
|
53031
53180
|
const stringsArray = [];
|
|
53032
53181
|
const textDecoder = new TextDecoder("utf8");
|
|
53033
|
-
let stringOffset = 0;
|
|
53034
|
-
const bytesPerStringSize = 4;
|
|
53035
53182
|
for (let index = 0; index < stringsCount; index++) {
|
|
53036
|
-
const
|
|
53037
|
-
const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
|
|
53183
|
+
const stringData = data.slice(offsetsData[index], offsetsData[index + 1]);
|
|
53038
53184
|
const stringAttribute = textDecoder.decode(stringData);
|
|
53039
53185
|
stringsArray.push(stringAttribute);
|
|
53040
|
-
stringOffset += stringByteSize;
|
|
53041
53186
|
}
|
|
53042
53187
|
return stringsArray;
|
|
53043
53188
|
}
|
|
53044
53189
|
|
|
53045
53190
|
// ../gltf/src/lib/utils/version.ts
|
|
53046
|
-
var
|
|
53191
|
+
var VERSION7 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
53047
53192
|
|
|
53048
53193
|
// ../textures/src/lib/utils/version.ts
|
|
53049
|
-
var
|
|
53194
|
+
var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
53050
53195
|
|
|
53051
53196
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
53052
53197
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -53551,7 +53696,7 @@ var BasisWorkerLoader = {
|
|
|
53551
53696
|
name: "Basis",
|
|
53552
53697
|
id: "basis",
|
|
53553
53698
|
module: "textures",
|
|
53554
|
-
version:
|
|
53699
|
+
version: VERSION8,
|
|
53555
53700
|
worker: true,
|
|
53556
53701
|
extensions: ["basis", "ktx2"],
|
|
53557
53702
|
mimeTypes: ["application/octet-stream", "image/ktx2"],
|
|
@@ -53858,7 +54003,7 @@ var CompressedTextureWorkerLoader = {
|
|
|
53858
54003
|
name: "Texture Containers",
|
|
53859
54004
|
id: "compressed-texture",
|
|
53860
54005
|
module: "textures",
|
|
53861
|
-
version:
|
|
54006
|
+
version: VERSION8,
|
|
53862
54007
|
worker: true,
|
|
53863
54008
|
extensions: [
|
|
53864
54009
|
"ktx",
|
|
@@ -53906,7 +54051,7 @@ var KTX2BasisWriterWorker = {
|
|
|
53906
54051
|
name: "Basis Universal Supercompressed GPU Texture",
|
|
53907
54052
|
id: "ktx2-basis-writer",
|
|
53908
54053
|
module: "textures",
|
|
53909
|
-
version:
|
|
54054
|
+
version: VERSION8,
|
|
53910
54055
|
extensions: ["ktx2"],
|
|
53911
54056
|
worker: true,
|
|
53912
54057
|
options: {
|
|
@@ -54490,27 +54635,6 @@ __export(KHR_texture_transform_exports, {
|
|
|
54490
54635
|
name: () => name8
|
|
54491
54636
|
});
|
|
54492
54637
|
var import_core6 = __toModule(require_es5());
|
|
54493
|
-
|
|
54494
|
-
// ../gltf/src/lib/gltf-utils/gltf-constants.ts
|
|
54495
|
-
var COMPONENTS = {
|
|
54496
|
-
SCALAR: 1,
|
|
54497
|
-
VEC2: 2,
|
|
54498
|
-
VEC3: 3,
|
|
54499
|
-
VEC4: 4,
|
|
54500
|
-
MAT2: 4,
|
|
54501
|
-
MAT3: 9,
|
|
54502
|
-
MAT4: 16
|
|
54503
|
-
};
|
|
54504
|
-
var BYTES = {
|
|
54505
|
-
5120: 1,
|
|
54506
|
-
5121: 1,
|
|
54507
|
-
5122: 2,
|
|
54508
|
-
5123: 2,
|
|
54509
|
-
5125: 4,
|
|
54510
|
-
5126: 4
|
|
54511
|
-
};
|
|
54512
|
-
|
|
54513
|
-
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
54514
54638
|
var EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
|
|
54515
54639
|
var name8 = EXT_MESHOPT_TRANSFORM;
|
|
54516
54640
|
var scratchVector = new import_core6.Vector3();
|
|
@@ -54801,8 +54925,8 @@ function resolveValues(technique, gltfScenegraph) {
|
|
|
54801
54925
|
|
|
54802
54926
|
// ../gltf/src/lib/api/gltf-extensions.ts
|
|
54803
54927
|
var EXTENSIONS2 = [
|
|
54804
|
-
EXT_mesh_features_exports,
|
|
54805
54928
|
EXT_structural_metadata_exports,
|
|
54929
|
+
EXT_mesh_features_exports,
|
|
54806
54930
|
EXT_meshopt_compression_exports,
|
|
54807
54931
|
EXT_texture_webp_exports,
|
|
54808
54932
|
KHR_texture_basisu_exports,
|
|
@@ -55172,7 +55296,7 @@ var GLTFLoader = {
|
|
|
55172
55296
|
name: "glTF",
|
|
55173
55297
|
id: "gltf",
|
|
55174
55298
|
module: "gltf",
|
|
55175
|
-
version:
|
|
55299
|
+
version: VERSION7,
|
|
55176
55300
|
extensions: ["gltf", "glb"],
|
|
55177
55301
|
mimeTypes: ["model/gltf+json", "model/gltf-binary"],
|
|
55178
55302
|
text: true,
|
|
@@ -55270,7 +55394,7 @@ var GLTFWriter = {
|
|
|
55270
55394
|
name: "glTF",
|
|
55271
55395
|
id: "gltf",
|
|
55272
55396
|
module: "gltf",
|
|
55273
|
-
version:
|
|
55397
|
+
version: VERSION7,
|
|
55274
55398
|
extensions: ["glb"],
|
|
55275
55399
|
mimeTypes: ["model/gltf-binary"],
|
|
55276
55400
|
binary: true,
|
|
@@ -55990,7 +56114,7 @@ var Tile3DSubtreeLoader = {
|
|
|
55990
56114
|
id: "3d-tiles-subtree",
|
|
55991
56115
|
name: "3D Tiles Subtree",
|
|
55992
56116
|
module: "3d-tiles",
|
|
55993
|
-
version:
|
|
56117
|
+
version: VERSION4,
|
|
55994
56118
|
extensions: ["subtree"],
|
|
55995
56119
|
mimeTypes: ["application/octet-stream"],
|
|
55996
56120
|
tests: ["subtree"],
|
|
@@ -56029,7 +56153,7 @@ var console_2 = globalThis.console;
|
|
|
56029
56153
|
var navigator_2 = globalThis.navigator || {};
|
|
56030
56154
|
|
|
56031
56155
|
// ../3d-tiles/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
56032
|
-
var
|
|
56156
|
+
var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
56033
56157
|
var isBrowser6 = isBrowser5();
|
|
56034
56158
|
|
|
56035
56159
|
// ../3d-tiles/node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -56214,7 +56338,7 @@ var Log2 = class {
|
|
|
56214
56338
|
id: ""
|
|
56215
56339
|
};
|
|
56216
56340
|
this.id = void 0;
|
|
56217
|
-
this.VERSION =
|
|
56341
|
+
this.VERSION = VERSION9;
|
|
56218
56342
|
this._startTs = getHiResTimestamp2();
|
|
56219
56343
|
this._deltaTs = getHiResTimestamp2();
|
|
56220
56344
|
this._storage = void 0;
|
|
@@ -56417,7 +56541,7 @@ var Log2 = class {
|
|
|
56417
56541
|
return noop2;
|
|
56418
56542
|
}
|
|
56419
56543
|
};
|
|
56420
|
-
Log2.VERSION =
|
|
56544
|
+
Log2.VERSION = VERSION9;
|
|
56421
56545
|
function normalizeLogLevel2(logLevel) {
|
|
56422
56546
|
if (!logLevel) {
|
|
56423
56547
|
return 0;
|
|
@@ -58086,7 +58210,7 @@ var Tiles3DLoader = {
|
|
|
58086
58210
|
id: "3d-tiles",
|
|
58087
58211
|
name: "3D Tiles",
|
|
58088
58212
|
module: "3d-tiles",
|
|
58089
|
-
version:
|
|
58213
|
+
version: VERSION4,
|
|
58090
58214
|
extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
58091
58215
|
mimeTypes: ["application/octet-stream"],
|
|
58092
58216
|
tests: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
@@ -58912,7 +59036,7 @@ var Tile3DWriter = {
|
|
|
58912
59036
|
name: "3D Tile",
|
|
58913
59037
|
id: "3d-tiles",
|
|
58914
59038
|
module: "3d-tiles",
|
|
58915
|
-
version:
|
|
59039
|
+
version: VERSION4,
|
|
58916
59040
|
extensions: ["cmpt", "pnts", "b3dm", "i3dm"],
|
|
58917
59041
|
mimeTypes: ["application/octet-stream"],
|
|
58918
59042
|
encodeSync: encodeSync3,
|
|
@@ -58973,21 +59097,21 @@ var METADATA = () => ({
|
|
|
58973
59097
|
});
|
|
58974
59098
|
|
|
58975
59099
|
// src/lib/utils/file-utils.ts
|
|
58976
|
-
var
|
|
59100
|
+
var import_fs3 = __toModule(require("fs"));
|
|
58977
59101
|
var import_path3 = __toModule(require("path"));
|
|
58978
59102
|
|
|
58979
59103
|
// src/lib/utils/compress-util.ts
|
|
58980
59104
|
var import_zlib2 = __toModule(require("zlib"));
|
|
58981
59105
|
var import_path2 = __toModule(require("path"));
|
|
58982
|
-
var
|
|
59106
|
+
var import_fs2 = __toModule(require("fs"));
|
|
58983
59107
|
var import_archiver = __toModule(require_archiver());
|
|
58984
59108
|
var import_jszip = __toModule(require_lib3());
|
|
58985
59109
|
var import_crypt = __toModule(require_crypt());
|
|
58986
59110
|
function compressFileWithGzip(pathFile) {
|
|
58987
59111
|
const compressedPathFile = `${pathFile}.gz`;
|
|
58988
59112
|
const gzip = (0, import_zlib2.createGzip)();
|
|
58989
|
-
const input = (0,
|
|
58990
|
-
const output = (0,
|
|
59113
|
+
const input = (0, import_fs2.createReadStream)(pathFile);
|
|
59114
|
+
const output = (0, import_fs2.createWriteStream)(compressedPathFile);
|
|
58991
59115
|
return new Promise((resolve2, reject) => {
|
|
58992
59116
|
input.on("end", () => {
|
|
58993
59117
|
console.log(`${compressedPathFile} compressed and saved.`);
|
|
@@ -59047,10 +59171,10 @@ async function writeFile3(path2, data, fileName = "index.json") {
|
|
|
59047
59171
|
} else {
|
|
59048
59172
|
toWriteData = data;
|
|
59049
59173
|
}
|
|
59050
|
-
await
|
|
59174
|
+
await import_fs3.promises.mkdir(path2, { recursive: true });
|
|
59051
59175
|
const pathFile = (0, import_path3.join)(path2, fileName);
|
|
59052
59176
|
try {
|
|
59053
|
-
await
|
|
59177
|
+
await import_fs3.promises.writeFile(pathFile, toWriteData);
|
|
59054
59178
|
} catch (err) {
|
|
59055
59179
|
throw err;
|
|
59056
59180
|
}
|
|
@@ -59096,17 +59220,17 @@ async function openJson(path2, fileName) {
|
|
|
59096
59220
|
}
|
|
59097
59221
|
async function isFileExists(fileName) {
|
|
59098
59222
|
try {
|
|
59099
|
-
await
|
|
59223
|
+
await import_fs3.promises.stat(fileName);
|
|
59100
59224
|
return true;
|
|
59101
59225
|
} catch {
|
|
59102
59226
|
return false;
|
|
59103
59227
|
}
|
|
59104
59228
|
}
|
|
59105
59229
|
function removeDir(path2) {
|
|
59106
|
-
return
|
|
59230
|
+
return import_fs3.promises.rm(path2, { recursive: true });
|
|
59107
59231
|
}
|
|
59108
59232
|
function removeFile(path2) {
|
|
59109
|
-
return
|
|
59233
|
+
return import_fs3.promises.unlink(path2);
|
|
59110
59234
|
}
|
|
59111
59235
|
function getAbsoluteFilePath(filePath) {
|
|
59112
59236
|
return (0, import_path3.isAbsolute)(filePath) ? filePath : (0, import_path3.join)(process.cwd(), filePath);
|
|
@@ -59293,7 +59417,7 @@ var NodePages = class {
|
|
|
59293
59417
|
|
|
59294
59418
|
// src/lib/utils/statistic-utills.ts
|
|
59295
59419
|
var import_path5 = __toModule(require("path"));
|
|
59296
|
-
var
|
|
59420
|
+
var import_fs4 = __toModule(require("fs"));
|
|
59297
59421
|
function timeConverter(time) {
|
|
59298
59422
|
const nanoSecondsInMillisecond = 1e6;
|
|
59299
59423
|
let timeInSeconds = time[0];
|
|
@@ -59324,7 +59448,7 @@ async function calculateFilesSize(params) {
|
|
|
59324
59448
|
try {
|
|
59325
59449
|
if (slpk) {
|
|
59326
59450
|
const slpkPath = (0, import_path5.join)(fullOutputPath, `${tilesetName}.slpk`);
|
|
59327
|
-
const stat3 = await
|
|
59451
|
+
const stat3 = await import_fs4.promises.stat(slpkPath);
|
|
59328
59452
|
return stat3.size;
|
|
59329
59453
|
}
|
|
59330
59454
|
const directoryPath = (0, import_path5.join)(fullOutputPath, tilesetName);
|
|
@@ -59337,9 +59461,9 @@ async function calculateFilesSize(params) {
|
|
|
59337
59461
|
}
|
|
59338
59462
|
async function getTotalFilesSize(dirPath) {
|
|
59339
59463
|
let totalFileSize = 0;
|
|
59340
|
-
const files = await
|
|
59464
|
+
const files = await import_fs4.promises.readdir(dirPath);
|
|
59341
59465
|
for (const file of files) {
|
|
59342
|
-
const fileStat = await
|
|
59466
|
+
const fileStat = await import_fs4.promises.stat((0, import_path5.join)(dirPath, file));
|
|
59343
59467
|
if (fileStat.isDirectory()) {
|
|
59344
59468
|
totalFileSize += await getTotalFilesSize((0, import_path5.join)(dirPath, file));
|
|
59345
59469
|
} else {
|
|
@@ -59433,6 +59557,11 @@ function makeAttributeObjects(attributes) {
|
|
|
59433
59557
|
let colorsList = new Uint8Array(colors);
|
|
59434
59558
|
let texCoordsList = new Float32Array(texCoords);
|
|
59435
59559
|
let uvRegionsList = new Uint16Array(uvRegions);
|
|
59560
|
+
let positionsOffset = 0;
|
|
59561
|
+
let normalsOffset = 0;
|
|
59562
|
+
let colorsOffset = 0;
|
|
59563
|
+
let uvRegionsOffset = 0;
|
|
59564
|
+
let texCoordsOffset = 0;
|
|
59436
59565
|
for (let index = 0; index < featureIds.length; index++) {
|
|
59437
59566
|
const startIndex = faceRange[index * 2];
|
|
59438
59567
|
const endIndex = faceRange[index * 2 + 1];
|
|
@@ -59443,19 +59572,19 @@ function makeAttributeObjects(attributes) {
|
|
|
59443
59572
|
const texCoordsCount = getSliceAttributeCount("texCoords", startIndex, endIndex);
|
|
59444
59573
|
groupedData.push({
|
|
59445
59574
|
featureId: featureIds[index],
|
|
59446
|
-
positions: positionsList.
|
|
59447
|
-
normals: normalsList.
|
|
59448
|
-
colors: colorsList.
|
|
59449
|
-
uvRegions: uvRegionsList.
|
|
59450
|
-
texCoords: texCoordsList.
|
|
59575
|
+
positions: positionsList.subarray(positionsOffset, positionsOffset + positionsCount),
|
|
59576
|
+
normals: normalsList.subarray(normalsOffset, normalsOffset + normalsCount),
|
|
59577
|
+
colors: colorsList.subarray(colorsOffset, colorsOffset + colorsCount),
|
|
59578
|
+
uvRegions: uvRegionsList.subarray(uvRegionsOffset, uvRegionsOffset + uvRegionsCount),
|
|
59579
|
+
texCoords: texCoordsList.subarray(texCoordsOffset, texCoordsOffset + texCoordsCount)
|
|
59451
59580
|
});
|
|
59452
|
-
|
|
59453
|
-
|
|
59454
|
-
|
|
59455
|
-
|
|
59456
|
-
|
|
59581
|
+
positionsOffset += positionsCount;
|
|
59582
|
+
normalsOffset += normalsCount;
|
|
59583
|
+
colorsOffset += colorsCount;
|
|
59584
|
+
uvRegionsOffset += uvRegionsCount;
|
|
59585
|
+
texCoordsOffset += texCoordsCount;
|
|
59457
59586
|
}
|
|
59458
|
-
return groupedData
|
|
59587
|
+
return groupedData;
|
|
59459
59588
|
}
|
|
59460
59589
|
function getSliceAttributeCount(attributeName, startIndex, endIndex) {
|
|
59461
59590
|
const itemsPerVertex4 = 4;
|
|
@@ -59476,50 +59605,66 @@ function getSliceAttributeCount(attributeName, startIndex, endIndex) {
|
|
|
59476
59605
|
}
|
|
59477
59606
|
}
|
|
59478
59607
|
function unifyObjectsByFeatureId(sortedData) {
|
|
59479
|
-
const
|
|
59480
|
-
for (
|
|
59481
|
-
const
|
|
59482
|
-
const existingObject = uniqueObjects.find((obj) => obj.featureId === currentObject.featureId);
|
|
59608
|
+
const groupedMetadata = [];
|
|
59609
|
+
for (const data of sortedData) {
|
|
59610
|
+
const existingObject = groupedMetadata.find((obj) => obj.featureId === data.featureId);
|
|
59483
59611
|
if (existingObject) {
|
|
59484
|
-
existingObject.
|
|
59485
|
-
existingObject.normals = concatenateTypedArrays(existingObject.normals, currentObject.normals);
|
|
59486
|
-
existingObject.colors = concatenateTypedArrays(existingObject.colors, currentObject.colors);
|
|
59487
|
-
existingObject.texCoords = concatenateTypedArrays(existingObject.texCoords, currentObject.texCoords);
|
|
59488
|
-
existingObject.uvRegions = concatenateTypedArrays(existingObject.uvRegions, currentObject.uvRegions);
|
|
59612
|
+
existingObject.attributes.push(data);
|
|
59489
59613
|
} else {
|
|
59490
|
-
|
|
59614
|
+
groupedMetadata.push({
|
|
59615
|
+
featureId: data.featureId,
|
|
59616
|
+
attributes: [data]
|
|
59617
|
+
});
|
|
59491
59618
|
}
|
|
59492
59619
|
}
|
|
59620
|
+
const uniqueObjects = [];
|
|
59621
|
+
for (const metatada of groupedMetadata) {
|
|
59622
|
+
const attributes = concatenateAttributes(metatada.attributes);
|
|
59623
|
+
uniqueObjects.push({
|
|
59624
|
+
featureId: metatada.featureId,
|
|
59625
|
+
...attributes
|
|
59626
|
+
});
|
|
59627
|
+
}
|
|
59493
59628
|
return uniqueObjects;
|
|
59494
59629
|
}
|
|
59495
59630
|
function groupAttributesAndRangesByFeatureId(unifiedObjects, featureCount) {
|
|
59496
59631
|
const firstAttributeObject = unifiedObjects[0];
|
|
59497
59632
|
const featureIds = [firstAttributeObject.featureId || 0];
|
|
59498
|
-
let positions = new Float32Array(firstAttributeObject.positions);
|
|
59499
|
-
let normals = new Float32Array(firstAttributeObject.normals);
|
|
59500
|
-
let colors = new Uint8Array(firstAttributeObject.colors);
|
|
59501
|
-
let uvRegions = new Uint16Array(firstAttributeObject.uvRegions);
|
|
59502
|
-
let texCoords = new Float32Array(firstAttributeObject.texCoords);
|
|
59503
59633
|
const range = [0];
|
|
59504
59634
|
let objIndex = 0;
|
|
59505
59635
|
let sum = 0;
|
|
59506
59636
|
for (let index = 1; index < unifiedObjects.length; index++) {
|
|
59507
59637
|
const currentAttributesObject = unifiedObjects[index];
|
|
59508
59638
|
featureIds.push(currentAttributesObject.featureId || 0);
|
|
59509
|
-
positions = concatenateTypedArrays(positions, currentAttributesObject.positions);
|
|
59510
|
-
normals = concatenateTypedArrays(normals, currentAttributesObject.normals);
|
|
59511
|
-
colors = concatenateTypedArrays(colors, currentAttributesObject.colors);
|
|
59512
|
-
uvRegions = concatenateTypedArrays(uvRegions, currentAttributesObject.uvRegions);
|
|
59513
|
-
texCoords = concatenateTypedArrays(texCoords, currentAttributesObject.texCoords);
|
|
59514
59639
|
const groupedObject = unifiedObjects[objIndex];
|
|
59515
59640
|
range.push(groupedObject.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE - 1 + sum);
|
|
59516
59641
|
range.push(groupedObject.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE + sum);
|
|
59517
59642
|
sum += groupedObject.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE;
|
|
59518
59643
|
objIndex += 1;
|
|
59519
59644
|
}
|
|
59520
|
-
|
|
59645
|
+
const attributes = concatenateAttributes(unifiedObjects);
|
|
59646
|
+
range.push(attributes.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE - 1);
|
|
59521
59647
|
const faceRange = new Uint32Array(range);
|
|
59522
|
-
return { faceRange, featureIds,
|
|
59648
|
+
return { faceRange, featureIds, featureCount, ...attributes };
|
|
59649
|
+
}
|
|
59650
|
+
function concatenateAttributes(attributes) {
|
|
59651
|
+
const positionGroups = attributes.map(({ positions: positions2 }) => positions2);
|
|
59652
|
+
const positions = positionGroups.length > 1 ? concatenateTypedArrays(...positionGroups) : positionGroups[0];
|
|
59653
|
+
const normalGroups = attributes.map(({ normals: normals2 }) => normals2);
|
|
59654
|
+
const normals = normalGroups.length > 1 ? concatenateTypedArrays(...normalGroups) : normalGroups[0];
|
|
59655
|
+
const colorGroups = attributes.map(({ colors: colors2 }) => colors2);
|
|
59656
|
+
const colors = colorGroups.length > 1 ? concatenateTypedArrays(...colorGroups) : colorGroups[0];
|
|
59657
|
+
const texCoordGroups = attributes.map(({ texCoords: texCoords2 }) => texCoords2);
|
|
59658
|
+
const texCoords = texCoordGroups.length > 1 ? concatenateTypedArrays(...texCoordGroups) : texCoordGroups[0];
|
|
59659
|
+
const uvRegionGroups = attributes.map(({ uvRegions: uvRegions2 }) => uvRegions2);
|
|
59660
|
+
const uvRegions = uvRegionGroups.length > 1 ? concatenateTypedArrays(...uvRegionGroups) : uvRegionGroups[0];
|
|
59661
|
+
return {
|
|
59662
|
+
positions,
|
|
59663
|
+
normals,
|
|
59664
|
+
colors,
|
|
59665
|
+
texCoords,
|
|
59666
|
+
uvRegions
|
|
59667
|
+
};
|
|
59523
59668
|
}
|
|
59524
59669
|
|
|
59525
59670
|
// src/i3s-converter/helpers/coordinate-converter.ts
|
|
@@ -59716,29 +59861,19 @@ function handleBatchIdsExtensions(attributes, primitive, images, featureTexture)
|
|
|
59716
59861
|
switch (extensionName) {
|
|
59717
59862
|
case name3:
|
|
59718
59863
|
return handleExtFeatureMetadataExtension(attributes, extensionData, images, featureTexture);
|
|
59719
|
-
case name2:
|
|
59720
|
-
return handleExtMeshFeaturesExtension(attributes, extensionData);
|
|
59721
59864
|
case name:
|
|
59722
|
-
return
|
|
59865
|
+
return handleExtMeshFeaturesExtension(attributes, extensionData);
|
|
59723
59866
|
default:
|
|
59724
59867
|
return [];
|
|
59725
59868
|
}
|
|
59726
59869
|
}
|
|
59727
59870
|
return [];
|
|
59728
59871
|
}
|
|
59729
|
-
function handleExtStructuralMetadataExtension(attributes, extStructuralMetadata) {
|
|
59730
|
-
const dataAttributeNames = extStructuralMetadata?.dataAttributeNames;
|
|
59731
|
-
if (dataAttributeNames?.length) {
|
|
59732
|
-
const batchIdsAttribute = attributes[dataAttributeNames[0]];
|
|
59733
|
-
return batchIdsAttribute.value;
|
|
59734
|
-
}
|
|
59735
|
-
return [];
|
|
59736
|
-
}
|
|
59737
59872
|
function handleExtMeshFeaturesExtension(attributes, extMeshFeatures) {
|
|
59738
|
-
|
|
59739
|
-
|
|
59740
|
-
|
|
59741
|
-
|
|
59873
|
+
for (let ids of extMeshFeatures.featureIds) {
|
|
59874
|
+
if (typeof ids.propertyTable !== "undefined") {
|
|
59875
|
+
return ids.data;
|
|
59876
|
+
}
|
|
59742
59877
|
}
|
|
59743
59878
|
return [];
|
|
59744
59879
|
}
|
|
@@ -59818,19 +59953,19 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
|
|
|
59818
59953
|
}
|
|
59819
59954
|
|
|
59820
59955
|
// src/i3s-converter/helpers/feature-attributes.ts
|
|
59821
|
-
function flattenPropertyTableByFeatureIds(
|
|
59956
|
+
function flattenPropertyTableByFeatureIds(featureIdsMap, propertyTable) {
|
|
59822
59957
|
const resultPropertyTable = {};
|
|
59823
59958
|
for (const propertyName in propertyTable) {
|
|
59824
59959
|
const properties = propertyTable[propertyName];
|
|
59825
|
-
resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties,
|
|
59960
|
+
resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIdsMap);
|
|
59826
59961
|
}
|
|
59827
59962
|
return resultPropertyTable;
|
|
59828
59963
|
}
|
|
59829
|
-
function getPropertiesByFeatureIds(properties,
|
|
59964
|
+
function getPropertiesByFeatureIds(properties, featureIdsMap) {
|
|
59830
59965
|
const resultProperties = [];
|
|
59831
59966
|
if (properties) {
|
|
59832
|
-
for (const
|
|
59833
|
-
const property = properties[
|
|
59967
|
+
for (const featureIdKey in featureIdsMap) {
|
|
59968
|
+
const property = properties[featureIdKey] || null;
|
|
59834
59969
|
resultProperties.push(property);
|
|
59835
59970
|
}
|
|
59836
59971
|
}
|
|
@@ -60047,8 +60182,9 @@ async function _makeNodeResources({
|
|
|
60047
60182
|
const boundingVolumes = convertedAttributes.boundingVolumes;
|
|
60048
60183
|
const vertexCount = convertedAttributes.positions.length / VALUES_PER_VERTEX2;
|
|
60049
60184
|
const { faceRange, featureIds, positions, normals, colors, uvRegions, texCoords, featureCount } = generateAttributes(convertedAttributes);
|
|
60050
|
-
|
|
60051
|
-
|
|
60185
|
+
let featureIdsMap = {};
|
|
60186
|
+
if (propertyTable) {
|
|
60187
|
+
featureIdsMap = makeFeatureIdsUnique(featureIds, convertedAttributes.featureIndices, featuresHashArray, propertyTable);
|
|
60052
60188
|
}
|
|
60053
60189
|
const header = new Uint32Array(2);
|
|
60054
60190
|
const typedFeatureIds = generateBigUint64Array(featureIds);
|
|
@@ -60065,7 +60201,7 @@ async function _makeNodeResources({
|
|
|
60065
60201
|
}, libraries) : null;
|
|
60066
60202
|
let attributes = [];
|
|
60067
60203
|
if (attributeStorageInfo && propertyTable) {
|
|
60068
|
-
attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
|
|
60204
|
+
attributes = convertPropertyTableToAttributeBuffers(featureIds, featureIdsMap, propertyTable, attributeStorageInfo);
|
|
60069
60205
|
}
|
|
60070
60206
|
return {
|
|
60071
60207
|
nodeId,
|
|
@@ -60529,6 +60665,7 @@ function makeFeatureIdsUnique(featureIds, featureIndices, featuresHashArray, bat
|
|
|
60529
60665
|
const replaceMap = getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray);
|
|
60530
60666
|
replaceIndicesByUnique(featureIndices, replaceMap);
|
|
60531
60667
|
replaceIndicesByUnique(featureIds, replaceMap);
|
|
60668
|
+
return replaceMap;
|
|
60532
60669
|
}
|
|
60533
60670
|
function getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray) {
|
|
60534
60671
|
const featureMap = {};
|
|
@@ -60559,10 +60696,10 @@ function replaceIndicesByUnique(indicesArray, featureMap) {
|
|
|
60559
60696
|
indicesArray[index] = featureMap[indicesArray[index]];
|
|
60560
60697
|
}
|
|
60561
60698
|
}
|
|
60562
|
-
function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo) {
|
|
60699
|
+
function convertPropertyTableToAttributeBuffers(featureIds, featureIdsMap, propertyTable, attributeStorageInfo) {
|
|
60563
60700
|
const attributeBuffers = [];
|
|
60564
60701
|
const needFlattenPropertyTable = checkPropertiesLength(featureIds, propertyTable);
|
|
60565
|
-
const properties = needFlattenPropertyTable ? flattenPropertyTableByFeatureIds(
|
|
60702
|
+
const properties = needFlattenPropertyTable ? flattenPropertyTableByFeatureIds(featureIdsMap, propertyTable) : propertyTable;
|
|
60566
60703
|
const propertyTableWithObjectIds = {
|
|
60567
60704
|
OBJECTID: featureIds,
|
|
60568
60705
|
...properties
|
|
@@ -60702,17 +60839,13 @@ function getPropertyTable(tileContent, metadataClass) {
|
|
|
60702
60839
|
return null;
|
|
60703
60840
|
}
|
|
60704
60841
|
let propertyTable;
|
|
60705
|
-
const batchTableJson = tileContent
|
|
60842
|
+
const batchTableJson = tileContent.batchTableJson;
|
|
60706
60843
|
if (batchTableJson) {
|
|
60707
60844
|
return batchTableJson;
|
|
60708
60845
|
}
|
|
60709
60846
|
const { extensionName, extension } = getPropertyTableExtension(tileContent);
|
|
60710
60847
|
switch (extensionName) {
|
|
60711
60848
|
case name2: {
|
|
60712
|
-
propertyTable = getPropertyTableFromExtMeshFeatures(extension, metadataClass);
|
|
60713
|
-
return propertyTable;
|
|
60714
|
-
}
|
|
60715
|
-
case name: {
|
|
60716
60849
|
propertyTable = getPropertyTableFromExtStructuralMetadata(extension, metadataClass);
|
|
60717
60850
|
return propertyTable;
|
|
60718
60851
|
}
|
|
@@ -60725,11 +60858,7 @@ function getPropertyTable(tileContent, metadataClass) {
|
|
|
60725
60858
|
}
|
|
60726
60859
|
}
|
|
60727
60860
|
function getPropertyTableExtension(tileContent) {
|
|
60728
|
-
const extensionsWithPropertyTables = [
|
|
60729
|
-
name3,
|
|
60730
|
-
name,
|
|
60731
|
-
name2
|
|
60732
|
-
];
|
|
60861
|
+
const extensionsWithPropertyTables = [name3, name2];
|
|
60733
60862
|
const extensionsUsed = tileContent?.gltf?.extensionsUsed;
|
|
60734
60863
|
if (!extensionsUsed) {
|
|
60735
60864
|
return { extensionName: null, extension: null };
|
|
@@ -60747,72 +60876,6 @@ function getPropertyTableExtension(tileContent) {
|
|
|
60747
60876
|
const extension = tileContent?.gltf?.extensions?.[extensionName];
|
|
60748
60877
|
return { extensionName, extension };
|
|
60749
60878
|
}
|
|
60750
|
-
function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
60751
|
-
if (extension?.featureTables) {
|
|
60752
|
-
const firstFeatureTableName = Object.keys(extension.featureTables)?.[0];
|
|
60753
|
-
if (firstFeatureTableName) {
|
|
60754
|
-
const featureTable = extension?.featureTables[firstFeatureTableName];
|
|
60755
|
-
const propertyTable = {};
|
|
60756
|
-
for (const propertyName in featureTable.properties) {
|
|
60757
|
-
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
60758
|
-
}
|
|
60759
|
-
return propertyTable;
|
|
60760
|
-
}
|
|
60761
|
-
}
|
|
60762
|
-
if (extension?.featureTextures) {
|
|
60763
|
-
let featureTexture;
|
|
60764
|
-
for (const textureKey in extension.featureTextures) {
|
|
60765
|
-
const texture = extension.featureTextures[textureKey];
|
|
60766
|
-
if (texture.class === metadataClass) {
|
|
60767
|
-
featureTexture = textureKey;
|
|
60768
|
-
}
|
|
60769
|
-
}
|
|
60770
|
-
if (typeof featureTexture === "string") {
|
|
60771
|
-
const featureTable = extension?.featureTextures[featureTexture];
|
|
60772
|
-
const propertyTable = {};
|
|
60773
|
-
for (const propertyName in featureTable.properties) {
|
|
60774
|
-
propertyTable[propertyName] = featureTable.properties[propertyName].data;
|
|
60775
|
-
}
|
|
60776
|
-
return propertyTable;
|
|
60777
|
-
}
|
|
60778
|
-
}
|
|
60779
|
-
console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension.");
|
|
60780
|
-
return null;
|
|
60781
|
-
}
|
|
60782
|
-
function getPropertyTableFromExtStructuralMetadata(extension, metadataClass) {
|
|
60783
|
-
if (extension?.propertyTables) {
|
|
60784
|
-
const firstPropertyTable = extension?.propertyTables[0];
|
|
60785
|
-
const propertyTableWithData = {};
|
|
60786
|
-
for (const propertyName in firstPropertyTable.properties) {
|
|
60787
|
-
propertyTableWithData[propertyName] = firstPropertyTable.properties[propertyName].data;
|
|
60788
|
-
}
|
|
60789
|
-
return propertyTableWithData;
|
|
60790
|
-
}
|
|
60791
|
-
if (extension?.propertyTextures) {
|
|
60792
|
-
if (extension?.propertyTextures) {
|
|
60793
|
-
const firstPropertyTexture = extension?.propertyTextures[0];
|
|
60794
|
-
const propertyTableWithData = {};
|
|
60795
|
-
for (const propertyName in firstPropertyTexture.properties) {
|
|
60796
|
-
propertyTableWithData[propertyName] = firstPropertyTexture.properties[propertyName].data;
|
|
60797
|
-
}
|
|
60798
|
-
return propertyTableWithData;
|
|
60799
|
-
}
|
|
60800
|
-
}
|
|
60801
|
-
console.warn("The I3S converter couldn't handle EXT_structural_metadata extension: There is neither propertyTables, no propertyTextures in the extension.");
|
|
60802
|
-
return null;
|
|
60803
|
-
}
|
|
60804
|
-
function getPropertyTableFromExtMeshFeatures(extension, metadataClass) {
|
|
60805
|
-
if (extension?.featureIds) {
|
|
60806
|
-
const firstFeatureId = extension?.featureIds[0];
|
|
60807
|
-
const propertyTableWithData = {};
|
|
60808
|
-
if (!firstFeatureId.propertyTable) {
|
|
60809
|
-
console.warn("Should be implemented as we have the tileset with Ext_mesh_features not linked with EXT_structural_metadata extension");
|
|
60810
|
-
}
|
|
60811
|
-
return propertyTableWithData;
|
|
60812
|
-
}
|
|
60813
|
-
console.warn("The I3S converter couldn't handle EXT_mesh_features extension: There is no featureIds in the extension.");
|
|
60814
|
-
return null;
|
|
60815
|
-
}
|
|
60816
60879
|
|
|
60817
60880
|
// src/i3s-converter/helpers/create-scene-server-path.ts
|
|
60818
60881
|
var import_json_map_transform2 = __toModule(require_json_map_transform());
|
|
@@ -60899,17 +60962,19 @@ function convertScreenThresholdToGeometricError(node2) {
|
|
|
60899
60962
|
|
|
60900
60963
|
// src/pgm-loader.ts
|
|
60901
60964
|
var import_geoid = __toModule(require_es54());
|
|
60902
|
-
var
|
|
60965
|
+
var VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
60903
60966
|
var PGMLoader = {
|
|
60904
60967
|
name: "PGM - Netpbm grayscale image format",
|
|
60905
60968
|
id: "pgm",
|
|
60906
60969
|
module: "tile-converter",
|
|
60907
|
-
version:
|
|
60970
|
+
version: VERSION10,
|
|
60908
60971
|
mimeTypes: ["image/x-portable-graymap"],
|
|
60909
|
-
parse: async (arrayBuffer, options) => (0, import_geoid.parsePGM)(new Uint8Array(arrayBuffer), options),
|
|
60972
|
+
parse: async (arrayBuffer, options) => (0, import_geoid.parsePGM)(new Uint8Array(arrayBuffer), options?.pgm || {}),
|
|
60910
60973
|
extensions: ["pgm"],
|
|
60911
60974
|
options: {
|
|
60912
|
-
|
|
60975
|
+
pgm: {
|
|
60976
|
+
cubic: false
|
|
60977
|
+
}
|
|
60913
60978
|
}
|
|
60914
60979
|
};
|
|
60915
60980
|
|
|
@@ -61968,14 +62033,14 @@ var analyzeTileContent = async (tileContent) => {
|
|
|
61968
62033
|
if (!gltf) {
|
|
61969
62034
|
return defaultResult;
|
|
61970
62035
|
}
|
|
61971
|
-
const meshTopologyTypes =
|
|
61972
|
-
const metadataClasses =
|
|
62036
|
+
const meshTopologyTypes = getMeshTypesFromGLTF(gltf);
|
|
62037
|
+
const metadataClasses = getMetadataClassesFromGLTF(gltf);
|
|
61973
62038
|
return {
|
|
61974
62039
|
meshTopologyTypes,
|
|
61975
62040
|
metadataClasses
|
|
61976
62041
|
};
|
|
61977
62042
|
};
|
|
61978
|
-
var
|
|
62043
|
+
var getMeshTypesFromGLTF = (gltfJson) => {
|
|
61979
62044
|
const result = new Set();
|
|
61980
62045
|
for (const mesh of gltfJson.meshes || []) {
|
|
61981
62046
|
for (const primitive of mesh.primitives) {
|
|
@@ -61988,11 +62053,17 @@ var getMeshTypesFromGltf = (gltfJson) => {
|
|
|
61988
62053
|
}
|
|
61989
62054
|
return result;
|
|
61990
62055
|
};
|
|
61991
|
-
var
|
|
62056
|
+
var getMetadataClassesFromGLTF = (gltfJson) => {
|
|
61992
62057
|
const result = new Set();
|
|
61993
|
-
const
|
|
61994
|
-
if (
|
|
61995
|
-
for (const classKey of Object.keys(
|
|
62058
|
+
const extFeatureMetadataClasses = gltfJson.extensions?.[name3]?.schema?.classes;
|
|
62059
|
+
if (extFeatureMetadataClasses) {
|
|
62060
|
+
for (const classKey of Object.keys(extFeatureMetadataClasses)) {
|
|
62061
|
+
result.add(classKey);
|
|
62062
|
+
}
|
|
62063
|
+
}
|
|
62064
|
+
const extStructuralMetadataClasses = gltfJson.extensions?.[name2]?.schema?.classes;
|
|
62065
|
+
if (extStructuralMetadataClasses) {
|
|
62066
|
+
for (const classKey of Object.keys(extStructuralMetadataClasses)) {
|
|
61996
62067
|
result.add(classKey);
|
|
61997
62068
|
}
|
|
61998
62069
|
}
|
|
@@ -62847,12 +62918,12 @@ function parseStringsAttribute(arrayBuffer) {
|
|
|
62847
62918
|
}
|
|
62848
62919
|
|
|
62849
62920
|
// ../i3s/src/i3s-attribute-loader.ts
|
|
62850
|
-
var
|
|
62921
|
+
var VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
62851
62922
|
var I3SAttributeLoader = {
|
|
62852
62923
|
name: "I3S Attribute",
|
|
62853
62924
|
id: "i3s-attribute",
|
|
62854
62925
|
module: "i3s",
|
|
62855
|
-
version:
|
|
62926
|
+
version: VERSION11,
|
|
62856
62927
|
mimeTypes: ["application/binary"],
|
|
62857
62928
|
parse: async (arrayBuffer, options) => parseI3STileAttribute(arrayBuffer, options),
|
|
62858
62929
|
extensions: ["bin"],
|
|
@@ -63312,13 +63383,13 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
|
63312
63383
|
}
|
|
63313
63384
|
|
|
63314
63385
|
// ../i3s/src/i3s-content-loader.ts
|
|
63315
|
-
var
|
|
63386
|
+
var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
63316
63387
|
var I3SContentLoader = {
|
|
63317
63388
|
name: "I3S Content (Indexed Scene Layers)",
|
|
63318
63389
|
id: "i3s-content",
|
|
63319
63390
|
module: "i3s",
|
|
63320
63391
|
worker: true,
|
|
63321
|
-
version:
|
|
63392
|
+
version: VERSION12,
|
|
63322
63393
|
mimeTypes: ["application/octet-stream"],
|
|
63323
63394
|
parse: parse6,
|
|
63324
63395
|
extensions: ["bin"],
|
|
@@ -63341,20 +63412,22 @@ var import_culling5 = __toModule(require_es53());
|
|
|
63341
63412
|
var import_geospatial9 = __toModule(require_es52());
|
|
63342
63413
|
|
|
63343
63414
|
// ../i3s/src/i3s-node-page-loader.ts
|
|
63344
|
-
var
|
|
63345
|
-
async function parseNodePage(data, options) {
|
|
63346
|
-
return JSON.parse(new TextDecoder().decode(data));
|
|
63347
|
-
}
|
|
63415
|
+
var VERSION13 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
63348
63416
|
var I3SNodePageLoader = {
|
|
63349
63417
|
name: "I3S Node Page",
|
|
63350
63418
|
id: "i3s-node-page",
|
|
63351
63419
|
module: "i3s",
|
|
63352
|
-
version:
|
|
63420
|
+
version: VERSION13,
|
|
63353
63421
|
mimeTypes: ["application/json"],
|
|
63354
63422
|
parse: parseNodePage,
|
|
63355
63423
|
extensions: ["json"],
|
|
63356
|
-
options: {
|
|
63424
|
+
options: {
|
|
63425
|
+
i3s: {}
|
|
63426
|
+
}
|
|
63357
63427
|
};
|
|
63428
|
+
async function parseNodePage(data, options) {
|
|
63429
|
+
return JSON.parse(new TextDecoder().decode(data));
|
|
63430
|
+
}
|
|
63358
63431
|
|
|
63359
63432
|
// ../i3s/src/lib/helpers/i3s-nodepages-tiles.ts
|
|
63360
63433
|
var I3SNodePagesTiles = class {
|
|
@@ -63613,7 +63686,7 @@ async function normalizeTilesetData(tileset, options, context) {
|
|
|
63613
63686
|
}
|
|
63614
63687
|
|
|
63615
63688
|
// ../i3s/src/i3s-loader.ts
|
|
63616
|
-
var
|
|
63689
|
+
var VERSION14 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
63617
63690
|
var TILESET_REGEX = /layers\/[0-9]+$/;
|
|
63618
63691
|
var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
63619
63692
|
var SLPK_HEX = "504b0304";
|
|
@@ -63622,7 +63695,7 @@ var I3SLoader = {
|
|
|
63622
63695
|
name: "I3S (Indexed Scene Layers)",
|
|
63623
63696
|
id: "i3s",
|
|
63624
63697
|
module: "i3s",
|
|
63625
|
-
version:
|
|
63698
|
+
version: VERSION14,
|
|
63626
63699
|
mimeTypes: ["application/octet-stream"],
|
|
63627
63700
|
parse: parseI3S,
|
|
63628
63701
|
extensions: ["bin"],
|
|
@@ -63786,7 +63859,7 @@ var Z_UP_TO_Y_UP_MATRIX = new import_core31.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0,
|
|
|
63786
63859
|
var scratchVector6 = new import_core31.Vector3();
|
|
63787
63860
|
var B3dmConverter = class {
|
|
63788
63861
|
async convert(i3sAttributesData, featureAttributes = null) {
|
|
63789
|
-
const gltf = await this.
|
|
63862
|
+
const gltf = await this.buildGLTF(i3sAttributesData, featureAttributes);
|
|
63790
63863
|
const b3dm = encodeSync({
|
|
63791
63864
|
gltfEncoded: new Uint8Array(gltf),
|
|
63792
63865
|
type: "b3dm",
|
|
@@ -63795,12 +63868,12 @@ var B3dmConverter = class {
|
|
|
63795
63868
|
}, Tile3DWriter);
|
|
63796
63869
|
return b3dm;
|
|
63797
63870
|
}
|
|
63798
|
-
async
|
|
63871
|
+
async buildGLTF(i3sAttributesData, featureAttributes) {
|
|
63799
63872
|
const { tileContent, textureFormat, box } = i3sAttributesData;
|
|
63800
63873
|
const { material, attributes, indices: originalIndices, modelMatrix } = tileContent;
|
|
63801
63874
|
const gltfBuilder = new GLTFScenegraph();
|
|
63802
|
-
const textureIndex = await this.
|
|
63803
|
-
const pbrMaterialInfo = this.
|
|
63875
|
+
const textureIndex = await this._addI3sTextureToGLTF(tileContent, textureFormat, gltfBuilder);
|
|
63876
|
+
const pbrMaterialInfo = this._convertI3sMaterialToGLTFMaterial(material, textureIndex);
|
|
63804
63877
|
const materialIndex = gltfBuilder.addMaterial(pbrMaterialInfo);
|
|
63805
63878
|
const positions = attributes.positions;
|
|
63806
63879
|
const positionsValue = positions.value;
|
|
@@ -63829,7 +63902,7 @@ var B3dmConverter = class {
|
|
|
63829
63902
|
const gltfBuffer = encodeSync(gltfBuilder.gltf, GLTFWriter);
|
|
63830
63903
|
return gltfBuffer;
|
|
63831
63904
|
}
|
|
63832
|
-
async
|
|
63905
|
+
async _addI3sTextureToGLTF(tileContent, textureFormat, gltfBuilder) {
|
|
63833
63906
|
const { texture, material, attributes } = tileContent;
|
|
63834
63907
|
let textureIndex = null;
|
|
63835
63908
|
let selectedTexture = texture;
|
|
@@ -63891,7 +63964,7 @@ var B3dmConverter = class {
|
|
|
63891
63964
|
return "image/jpeg";
|
|
63892
63965
|
}
|
|
63893
63966
|
}
|
|
63894
|
-
|
|
63967
|
+
_convertI3sMaterialToGLTFMaterial(material, textureIndex) {
|
|
63895
63968
|
const isTextureIndexExists = textureIndex !== null;
|
|
63896
63969
|
if (!material) {
|
|
63897
63970
|
material = {
|
|
@@ -63913,11 +63986,11 @@ var B3dmConverter = class {
|
|
|
63913
63986
|
return material;
|
|
63914
63987
|
}
|
|
63915
63988
|
if (textureIndex !== null) {
|
|
63916
|
-
material = this.
|
|
63989
|
+
material = this._setGLTFTexture(material, textureIndex);
|
|
63917
63990
|
}
|
|
63918
63991
|
return material;
|
|
63919
63992
|
}
|
|
63920
|
-
|
|
63993
|
+
_setGLTFTexture(materialDefinition, textureIndex) {
|
|
63921
63994
|
const material = {
|
|
63922
63995
|
...materialDefinition,
|
|
63923
63996
|
pbrMetallicRoughness: { ...materialDefinition.pbrMetallicRoughness }
|