@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.5
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/README.md +1 -1
- package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles/dist.dev.js +1393 -962
- package/dist/3d-tiles/dist.min.js +37 -37
- package/dist/3d-tiles/index.cjs +989 -987
- package/dist/3d-tiles/index.cjs.map +3 -3
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
- package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +5 -1
- package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/3d-tiles/lib/utils/version.js +1 -1
- package/dist/3d-tiles-archive-writer.cjs +1 -1
- package/dist/cesium-ion-loader-with-parser.cjs +983 -981
- package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
- package/dist/copc/copc-source-loader.js +2 -2
- package/dist/copc/copc-source-loader.js.map +1 -1
- package/dist/copc/copc-writer.js +1 -1
- package/dist/copc/index.cjs +365 -170
- package/dist/copc/index.cjs.map +3 -3
- package/dist/dist.dev.js +231 -38
- package/dist/dist.min.js +10 -10
- package/dist/i3s/arcgis-webscene-loader.js +1 -1
- package/dist/i3s/dist.dev.js +6591 -1184
- package/dist/i3s/dist.min.js +55 -47
- package/dist/i3s/i3s-attribute-loader.js +1 -1
- package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s/i3s-content-loader.js +1 -1
- package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
- package/dist/i3s/i3s-loader.js +1 -1
- package/dist/i3s/i3s-node-page-loader.js +1 -1
- package/dist/i3s/i3s-slpk-loader.js +1 -1
- package/dist/i3s/i3s-slpk-writer.js +1 -1
- package/dist/i3s/index.cjs +4763 -1136
- package/dist/i3s/index.cjs.map +3 -3
- package/dist/i3s-content-worker-node.js +11 -11
- package/dist/i3s-content-worker-node.js.map +4 -4
- package/dist/i3s-content-worker.js +1148 -391
- package/dist/i3s-lepcc-worker-node.js +609 -44
- package/dist/i3s-lepcc-worker-node.js.map +4 -4
- package/dist/i3s-lepcc-worker.js +575 -40
- package/dist/i3s-mesh-writer.cjs +8880 -5253
- package/dist/i3s-mesh-writer.cjs.map +3 -3
- package/dist/i3s-slpk-writer.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/point-cloud-tile-source-loader-types.js +1 -1
- package/dist/point-cloud-tile-source-loader.cjs +1 -1
- package/dist/potree/dist.dev.js +310 -110
- package/dist/potree/dist.min.js +31 -31
- package/dist/potree/index.cjs +19 -166
- package/dist/potree/index.cjs.map +3 -3
- package/dist/potree/potree-bin-loader.js +1 -1
- package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
- package/dist/potree/potree-loader-types.js +1 -1
- package/dist/potree/potree-source-loader.js +1 -1
- package/dist/potree/potree-writer.js +1 -1
- package/dist/potree-loader.cjs +1 -1
- package/package.json +13 -13
- package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
- package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +4 -1
- package/src/copc/copc-source-loader.ts +1 -1
package/dist/3d-tiles/index.cjs
CHANGED
|
@@ -14,8 +14,8 @@ var __esm = (fn, res, err) => function __init() {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
var __export = (target, all) => {
|
|
17
|
-
for (var
|
|
18
|
-
__defProp(target,
|
|
17
|
+
for (var name22 in all)
|
|
18
|
+
__defProp(target, name22, { get: all[name22], enumerable: true });
|
|
19
19
|
};
|
|
20
20
|
var __copyProps = (to, from, except, desc) => {
|
|
21
21
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -580,9 +580,9 @@ function registerJSModules(modules) {
|
|
|
580
580
|
globalThis.loaders.modules ||= {};
|
|
581
581
|
Object.assign(globalThis.loaders.modules, modules);
|
|
582
582
|
}
|
|
583
|
-
function getJSModuleOrNull(
|
|
583
|
+
function getJSModuleOrNull(name22) {
|
|
584
584
|
var _a, _b;
|
|
585
|
-
const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[
|
|
585
|
+
const module2 = (_b = (_a = globalThis.loaders) == null ? void 0 : _a.modules) == null ? void 0 : _b[name22];
|
|
586
586
|
return module2 || null;
|
|
587
587
|
}
|
|
588
588
|
var init_js_module_utils = __esm({
|
|
@@ -1087,10 +1087,10 @@ function createAbortError() {
|
|
|
1087
1087
|
error.name = "AbortError";
|
|
1088
1088
|
return error;
|
|
1089
1089
|
}
|
|
1090
|
-
function validateLimit(value, fallback,
|
|
1090
|
+
function validateLimit(value, fallback, name22) {
|
|
1091
1091
|
const limit = value ?? fallback;
|
|
1092
1092
|
if (limit < 0 || Number.isNaN(limit)) {
|
|
1093
|
-
throw new Error(`${
|
|
1093
|
+
throw new Error(`${name22} must be a non-negative number`);
|
|
1094
1094
|
}
|
|
1095
1095
|
return limit;
|
|
1096
1096
|
}
|
|
@@ -4769,17 +4769,17 @@ var init_gltf_scenegraph = __esm({
|
|
|
4769
4769
|
return extras[key];
|
|
4770
4770
|
}
|
|
4771
4771
|
hasExtension(extensionName) {
|
|
4772
|
-
const isUsedExtension = this.getUsedExtensions().find((
|
|
4773
|
-
const isRequiredExtension = this.getRequiredExtensions().find((
|
|
4772
|
+
const isUsedExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
|
|
4773
|
+
const isRequiredExtension = this.getRequiredExtensions().find((name22) => name22 === extensionName);
|
|
4774
4774
|
return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
|
|
4775
4775
|
}
|
|
4776
4776
|
getExtension(extensionName) {
|
|
4777
|
-
const isExtension = this.getUsedExtensions().find((
|
|
4777
|
+
const isExtension = this.getUsedExtensions().find((name22) => name22 === extensionName);
|
|
4778
4778
|
const extensions = this.json.extensions || {};
|
|
4779
4779
|
return isExtension ? extensions[extensionName] : null;
|
|
4780
4780
|
}
|
|
4781
4781
|
getRequiredExtension(extensionName) {
|
|
4782
|
-
const isRequired = this.getRequiredExtensions().find((
|
|
4782
|
+
const isRequired = this.getRequiredExtensions().find((name22) => name22 === extensionName);
|
|
4783
4783
|
return isRequired ? this.getExtension(extensionName) : null;
|
|
4784
4784
|
}
|
|
4785
4785
|
getRequiredExtensions() {
|
|
@@ -5181,8 +5181,8 @@ var init_gltf_scenegraph = __esm({
|
|
|
5181
5181
|
assert3(bufferOffset !== void 0);
|
|
5182
5182
|
bufferView.byteOffset = bufferOffset + (bufferView.byteOffset || 0);
|
|
5183
5183
|
bufferView.buffer = 0;
|
|
5184
|
-
for (const
|
|
5185
|
-
const extension = (_b = bufferView.extensions) == null ? void 0 : _b[
|
|
5184
|
+
for (const name22 of ["EXT_meshopt_compression", "KHR_meshopt_compression"]) {
|
|
5185
|
+
const extension = (_b = bufferView.extensions) == null ? void 0 : _b[name22];
|
|
5186
5186
|
if (extension) {
|
|
5187
5187
|
const extensionOffset = bufferOffsets[extension.buffer];
|
|
5188
5188
|
assert3(extensionOffset !== void 0);
|
|
@@ -5501,7 +5501,7 @@ function iterateObjectData(objects) {
|
|
|
5501
5501
|
})();
|
|
5502
5502
|
}
|
|
5503
5503
|
function mapObjectData(objects) {
|
|
5504
|
-
return new Map(Array.from(objects, ([
|
|
5504
|
+
return new Map(Array.from(objects, ([name22, object]) => [name22, object.data]));
|
|
5505
5505
|
}
|
|
5506
5506
|
function getCollectionName(type) {
|
|
5507
5507
|
switch (type) {
|
|
@@ -6379,7 +6379,7 @@ function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
|
|
|
6379
6379
|
if (typeof imageIndex !== "undefined") {
|
|
6380
6380
|
const mimeType = (_d = (_c = json.images) == null ? void 0 : _c[imageIndex]) == null ? void 0 : _d.mimeType;
|
|
6381
6381
|
const parsedImage = (_e = scenegraph.gltf.images) == null ? void 0 : _e[imageIndex];
|
|
6382
|
-
if (parsedImage && typeof parsedImage.width !== "undefined") {
|
|
6382
|
+
if (parsedImage && typeof parsedImage.width !== "undefined" && !("compressed" in parsedImage && parsedImage.compressed)) {
|
|
6383
6383
|
const textureData = [];
|
|
6384
6384
|
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
6385
6385
|
const value = getImageValueByCoordinates(
|
|
@@ -6953,38 +6953,56 @@ __export(KHR_gaussian_splatting_exports, {
|
|
|
6953
6953
|
getGaussianSplatPrimitives: () => getGaussianSplatPrimitives,
|
|
6954
6954
|
name: () => name6
|
|
6955
6955
|
});
|
|
6956
|
-
async function decode6(gltfData, options) {
|
|
6957
|
-
var _a, _b, _c, _d;
|
|
6956
|
+
async function decode6(gltfData, options, context) {
|
|
6957
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6958
|
+
const loader = (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find((candidate) => {
|
|
6959
|
+
var _a2;
|
|
6960
|
+
return (_a2 = candidate.extensions) == null ? void 0 : _a2.includes("spz");
|
|
6961
|
+
});
|
|
6958
6962
|
const descriptors = getGaussianSplatPrimitives(gltfData);
|
|
6959
6963
|
const iterator = new GLTFIterator(gltfData);
|
|
6960
6964
|
for (const [meshIndex, mesh] of (gltfData.json.meshes || []).entries()) {
|
|
6961
6965
|
for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
|
|
6962
|
-
const extension = (
|
|
6966
|
+
const extension = (_b = primitive.extensions) == null ? void 0 : _b[name6];
|
|
6963
6967
|
if (!extension) continue;
|
|
6968
|
+
const descriptor = descriptors.find(
|
|
6969
|
+
(item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
|
|
6970
|
+
);
|
|
6971
|
+
const legacyColorSpace = (_c = options == null ? void 0 : options.gltf) == null ? void 0 : _c.legacyGaussianSplatColorSpace;
|
|
6972
|
+
const normalizedExtension = legacyColorSpace && ((_d = extension.extensions) == null ? void 0 : _d[SPZ_COMPRESSION_EXTENSION_NAME]) ? {
|
|
6973
|
+
...extension,
|
|
6974
|
+
kernel: extension.kernel ?? "ellipse",
|
|
6975
|
+
colorSpace: extension.colorSpace ?? legacyColorSpace
|
|
6976
|
+
} : extension;
|
|
6977
|
+
if (descriptor) descriptor.extension = normalizedExtension;
|
|
6964
6978
|
validateGaussianSplatPrimitive(
|
|
6965
6979
|
gltfData.json,
|
|
6966
6980
|
primitive,
|
|
6967
|
-
|
|
6981
|
+
normalizedExtension,
|
|
6968
6982
|
meshIndex,
|
|
6969
6983
|
primitiveIndex,
|
|
6970
6984
|
iterator
|
|
6971
6985
|
);
|
|
6972
|
-
const compression = (
|
|
6986
|
+
const compression = (_e = extension.extensions) == null ? void 0 : _e[SPZ_COMPRESSION_EXTENSION_NAME];
|
|
6973
6987
|
if (compression) {
|
|
6974
|
-
const descriptor = descriptors.find(
|
|
6975
|
-
(item) => item.meshIndex === meshIndex && item.primitiveIndex === primitiveIndex
|
|
6976
|
-
);
|
|
6977
6988
|
if (descriptor) {
|
|
6978
|
-
const decoder = (
|
|
6979
|
-
const bufferView = (
|
|
6989
|
+
const decoder = (_f = options == null ? void 0 : options.gltf) == null ? void 0 : _f.splatDecoder;
|
|
6990
|
+
const bufferView = (_g = gltfData.json.bufferViews) == null ? void 0 : _g[compression.bufferView];
|
|
6980
6991
|
if (bufferView && gltfData.buffers[bufferView.buffer]) {
|
|
6981
6992
|
descriptor.compressedBytes = getBufferViewBytes(gltfData, compression.bufferView);
|
|
6982
|
-
} else if (decoder) {
|
|
6993
|
+
} else if (decoder || loader) {
|
|
6983
6994
|
throw new Error(
|
|
6984
6995
|
`KHR_gaussian_splatting: bufferView ${compression.bufferView} is not loaded for SPZ2 decoding.`
|
|
6985
6996
|
);
|
|
6986
6997
|
}
|
|
6987
|
-
if (
|
|
6998
|
+
if (loader && context && descriptor.compressedBytes) {
|
|
6999
|
+
descriptor.decoded = await parseFromContext(
|
|
7000
|
+
descriptor.compressedBytes.buffer,
|
|
7001
|
+
loader,
|
|
7002
|
+
{ ...options, splats: { ...options.splats, sourceCoordinateSystem: "LUF" } },
|
|
7003
|
+
context
|
|
7004
|
+
);
|
|
7005
|
+
} else if (decoder && descriptor.compressedBytes) {
|
|
6988
7006
|
descriptor.decoded = await decoder(descriptor.compressedBytes.buffer, {
|
|
6989
7007
|
sourceCoordinateSystem: "LUF"
|
|
6990
7008
|
});
|
|
@@ -7125,6 +7143,7 @@ var name6, SPZ_COMPRESSION_EXTENSION_NAME, REQUIRED_ATTRIBUTES;
|
|
|
7125
7143
|
var init_KHR_gaussian_splatting = __esm({
|
|
7126
7144
|
"../scene/src/gltf/lib/extensions/KHR_gaussian_splatting.ts"() {
|
|
7127
7145
|
"use strict";
|
|
7146
|
+
init_loader_utils();
|
|
7128
7147
|
init_gltf_iterator();
|
|
7129
7148
|
name6 = "KHR_gaussian_splatting";
|
|
7130
7149
|
SPZ_COMPRESSION_EXTENSION_NAME = "KHR_gaussian_splatting_compression_spz_2";
|
|
@@ -8139,7 +8158,7 @@ var init_EXT_feature_metadata = __esm({
|
|
|
8139
8158
|
});
|
|
8140
8159
|
|
|
8141
8160
|
// ../scene/src/gltf/lib/types/gltf-additional-extension-schemas.ts
|
|
8142
|
-
var import_zod, indexSchema, propertyShape, GLTFKHRMaterialVariantSchema, GLTFKHRMaterialsVariantsSchema, GLTFKHRMaterialVariantMappingSchema, GLTFKHRMaterialsVariantsPrimitiveSchema, GLTFEXTMeshGPUInstancingSchema, GLTFKHRAnimationPointerSchema, GLTFKHRNodeVisibilitySchema, GLTFKHRNodeSelectabilitySchema, GLTFKHRNodeHoverabilitySchema, GLTFKHRXMPPacketSchema, GLTFKHRXMPJSONLDSchema, GLTFKHRXMPJSONLDReferenceSchema;
|
|
8161
|
+
var import_zod, indexSchema, propertyShape, GLTFKHRMaterialVariantSchema, GLTFKHRMaterialsVariantsSchema, GLTFKHRMaterialVariantMappingSchema, GLTFKHRMaterialsVariantsPrimitiveSchema, GLTFEXTMeshGPUInstancingSchema, GLTFKHRAnimationPointerSchema, GLTFKHRNodeVisibilitySchema, GLTFKHRNodeSelectabilitySchema, GLTFKHRNodeHoverabilitySchema, GLTFKHRXMPPacketSchema, GLTFKHRXMPJSONLDSchema, GLTFKHRXMPJSONLDReferenceSchema, GLTFKHRMaterialsEmissiveStrengthSchema, GLTFFBGeometryMetadataSchema;
|
|
8143
8162
|
var init_gltf_additional_extension_schemas = __esm({
|
|
8144
8163
|
"../scene/src/gltf/lib/types/gltf-additional-extension-schemas.ts"() {
|
|
8145
8164
|
"use strict";
|
|
@@ -8214,6 +8233,24 @@ var init_gltf_additional_extension_schemas = __esm({
|
|
|
8214
8233
|
/** Index into the document-level packets array. */
|
|
8215
8234
|
packet: indexSchema
|
|
8216
8235
|
});
|
|
8236
|
+
GLTFKHRMaterialsEmissiveStrengthSchema = import_zod.z.looseObject({
|
|
8237
|
+
...propertyShape,
|
|
8238
|
+
/** Unitless multiplier; defaults to one when omitted. */
|
|
8239
|
+
emissiveStrength: import_zod.z.number().nonnegative().optional()
|
|
8240
|
+
});
|
|
8241
|
+
GLTFFBGeometryMetadataSchema = import_zod.z.looseObject({
|
|
8242
|
+
...propertyShape,
|
|
8243
|
+
/** Authored count of vertices. */
|
|
8244
|
+
vertexCount: import_zod.z.number().nonnegative().optional(),
|
|
8245
|
+
/** Authored count of primitives. */
|
|
8246
|
+
primitiveCount: import_zod.z.number().nonnegative().optional(),
|
|
8247
|
+
/** Static scene-space bounding box. */
|
|
8248
|
+
sceneBounds: import_zod.z.looseObject({
|
|
8249
|
+
...propertyShape,
|
|
8250
|
+
min: import_zod.z.array(import_zod.z.number()).length(3),
|
|
8251
|
+
max: import_zod.z.array(import_zod.z.number()).length(3)
|
|
8252
|
+
}).optional()
|
|
8253
|
+
});
|
|
8217
8254
|
}
|
|
8218
8255
|
});
|
|
8219
8256
|
|
|
@@ -8365,7 +8402,7 @@ var init_gltf_audio_extension_schemas = __esm({
|
|
|
8365
8402
|
});
|
|
8366
8403
|
|
|
8367
8404
|
// ../scene/src/gltf/lib/types/gltf-extension-schemas.ts
|
|
8368
|
-
var import_zod3, GLTFPropertyExtensionsSchema, GLTFRootExtensionsSchema, GLTFNodeExtensionsSchema, GLTFSceneExtensionsSchema, GLTFMeshPrimitiveExtensionsSchema, GLTFAnimationTargetExtensionsSchema;
|
|
8405
|
+
var import_zod3, GLTFPropertyExtensionsSchema, GLTFMaterialExtensionsSchema, GLTFRootExtensionsSchema, GLTFNodeExtensionsSchema, GLTFSceneExtensionsSchema, GLTFMeshPrimitiveExtensionsSchema, GLTFAnimationTargetExtensionsSchema;
|
|
8369
8406
|
var init_gltf_extension_schemas = __esm({
|
|
8370
8407
|
"../scene/src/gltf/lib/types/gltf-extension-schemas.ts"() {
|
|
8371
8408
|
"use strict";
|
|
@@ -8376,6 +8413,10 @@ var init_gltf_extension_schemas = __esm({
|
|
|
8376
8413
|
/** Shared XMP packet reference. */
|
|
8377
8414
|
KHR_xmp_json_ld: GLTFKHRXMPJSONLDReferenceSchema.optional()
|
|
8378
8415
|
});
|
|
8416
|
+
GLTFMaterialExtensionsSchema = GLTFPropertyExtensionsSchema.extend({
|
|
8417
|
+
/** Emissive intensity multiplier. */
|
|
8418
|
+
KHR_materials_emissive_strength: GLTFKHRMaterialsEmissiveStrengthSchema.optional()
|
|
8419
|
+
});
|
|
8379
8420
|
GLTFRootExtensionsSchema = import_zod3.z.looseObject({
|
|
8380
8421
|
/** Shared material variant declarations. */
|
|
8381
8422
|
KHR_materials_variants: GLTFKHRMaterialsVariantsSchema.optional(),
|
|
@@ -8401,6 +8442,8 @@ var init_gltf_extension_schemas = __esm({
|
|
|
8401
8442
|
MPEG_audio_spatial: GLTFMPEGAudioSpatialSchema.optional()
|
|
8402
8443
|
});
|
|
8403
8444
|
GLTFSceneExtensionsSchema = GLTFPropertyExtensionsSchema.extend({
|
|
8445
|
+
/** Authored static geometry summary. */
|
|
8446
|
+
FB_geometry_metadata: GLTFFBGeometryMetadataSchema.optional(),
|
|
8404
8447
|
/** Attached global KHR audio emitters. */
|
|
8405
8448
|
KHR_audio_emitter: GLTFKHRAudioAttachmentSchema.optional()
|
|
8406
8449
|
});
|
|
@@ -8682,6 +8725,33 @@ var init_resolve_gltf_file = __esm({
|
|
|
8682
8725
|
}
|
|
8683
8726
|
});
|
|
8684
8727
|
|
|
8728
|
+
// ../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts
|
|
8729
|
+
var KHR_accessor_float64_exports = {};
|
|
8730
|
+
__export(KHR_accessor_float64_exports, {
|
|
8731
|
+
name: () => name10,
|
|
8732
|
+
preprocess: () => preprocess
|
|
8733
|
+
});
|
|
8734
|
+
function preprocess(gltf) {
|
|
8735
|
+
var _a, _b, _c, _d;
|
|
8736
|
+
const { json } = gltf;
|
|
8737
|
+
if (!((_a = json.extensionsUsed) == null ? void 0 : _a.includes(name10)) && !((_b = json.extensionsRequired) == null ? void 0 : _b.includes(name10))) return;
|
|
8738
|
+
if (!((_c = json.extensionsUsed) == null ? void 0 : _c.includes(name10)) || !((_d = json.extensionsRequired) == null ? void 0 : _d.includes(name10))) {
|
|
8739
|
+
throw new Error(`${name10}: must be declared in extensionsUsed and extensionsRequired.`);
|
|
8740
|
+
}
|
|
8741
|
+
for (const [index, accessor] of (json.accessors || []).entries()) {
|
|
8742
|
+
if (accessor.componentType === 5130 && accessor.normalized) {
|
|
8743
|
+
throw new Error(`${name10}: accessor ${index} must not be normalized.`);
|
|
8744
|
+
}
|
|
8745
|
+
}
|
|
8746
|
+
}
|
|
8747
|
+
var name10;
|
|
8748
|
+
var init_KHR_accessor_float64 = __esm({
|
|
8749
|
+
"../scene/src/gltf/lib/extensions/KHR_accessor_float64.ts"() {
|
|
8750
|
+
"use strict";
|
|
8751
|
+
name10 = "KHR_accessor_float64";
|
|
8752
|
+
}
|
|
8753
|
+
});
|
|
8754
|
+
|
|
8685
8755
|
// ../scene/src/gltf/libs/meshopt-decoder.mjs
|
|
8686
8756
|
var meshopt_decoder_exports = {};
|
|
8687
8757
|
__export(meshopt_decoder_exports, {
|
|
@@ -8832,7 +8902,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8832
8902
|
}
|
|
8833
8903
|
return result.buffer.slice(0, write);
|
|
8834
8904
|
}
|
|
8835
|
-
function
|
|
8905
|
+
function decode18(instance2, fun, target, count, size, source, filter) {
|
|
8836
8906
|
var sbrk = instance2.exports.sbrk;
|
|
8837
8907
|
var count4 = count + 3 & ~3;
|
|
8838
8908
|
var tp = sbrk(count4 * size);
|
|
@@ -8878,7 +8948,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8878
8948
|
return worker;
|
|
8879
8949
|
}
|
|
8880
8950
|
function initWorkers(count) {
|
|
8881
|
-
var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm2) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" +
|
|
8951
|
+
var source = "self.ready = WebAssembly.instantiate(new Uint8Array([" + new Uint8Array(wasm2) + "]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = " + workerProcess.name + ";" + decode18.toString() + workerProcess.toString();
|
|
8882
8952
|
var blob = new Blob([source], { type: "text/javascript" });
|
|
8883
8953
|
var url = URL.createObjectURL(blob);
|
|
8884
8954
|
for (var i = workers.length; i < count; ++i) {
|
|
@@ -8913,7 +8983,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8913
8983
|
}
|
|
8914
8984
|
try {
|
|
8915
8985
|
var target = new Uint8Array(data.count * data.size);
|
|
8916
|
-
|
|
8986
|
+
decode18(instance2, instance2.exports[data.mode], target, data.count, data.size, data.source, instance2.exports[data.filter]);
|
|
8917
8987
|
self.postMessage({ id: data.id, count: data.count, action: "resolve", value: target }, [target.buffer]);
|
|
8918
8988
|
} catch (error) {
|
|
8919
8989
|
self.postMessage({ id: data.id, count: data.count, action: "reject", value: error });
|
|
@@ -8927,16 +8997,16 @@ var init_meshopt_decoder = __esm({
|
|
|
8927
8997
|
initWorkers(count);
|
|
8928
8998
|
},
|
|
8929
8999
|
decodeVertexBuffer: function(target, count, size, source, filter) {
|
|
8930
|
-
|
|
9000
|
+
decode18(instance, instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);
|
|
8931
9001
|
},
|
|
8932
9002
|
decodeIndexBuffer: function(target, count, size, source) {
|
|
8933
|
-
|
|
9003
|
+
decode18(instance, instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
|
|
8934
9004
|
},
|
|
8935
9005
|
decodeIndexSequence: function(target, count, size, source) {
|
|
8936
|
-
|
|
9006
|
+
decode18(instance, instance.exports.meshopt_decodeIndexSequence, target, count, size, source);
|
|
8937
9007
|
},
|
|
8938
9008
|
decodeGltfBuffer: function(target, count, size, source, mode, filter) {
|
|
8939
|
-
|
|
9009
|
+
decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
|
|
8940
9010
|
},
|
|
8941
9011
|
decodeGltfBufferAsync: function(count, size, source, mode, filter) {
|
|
8942
9012
|
if (workers.length > 0) {
|
|
@@ -8944,7 +9014,7 @@ var init_meshopt_decoder = __esm({
|
|
|
8944
9014
|
}
|
|
8945
9015
|
return ready.then(function() {
|
|
8946
9016
|
var target = new Uint8Array(count * size);
|
|
8947
|
-
|
|
9017
|
+
decode18(instance, instance.exports[decoders[mode]], target, count, size, source, instance.exports[filters[filter]]);
|
|
8948
9018
|
return target;
|
|
8949
9019
|
});
|
|
8950
9020
|
}
|
|
@@ -9098,17 +9168,17 @@ var init_meshopt_compression = __esm({
|
|
|
9098
9168
|
var EXT_meshopt_compression_exports = {};
|
|
9099
9169
|
__export(EXT_meshopt_compression_exports, {
|
|
9100
9170
|
decode: () => decode10,
|
|
9101
|
-
name: () =>
|
|
9171
|
+
name: () => name11
|
|
9102
9172
|
});
|
|
9103
9173
|
async function decode10(gltfData, options) {
|
|
9104
|
-
await decodeMeshoptCompression(gltfData, options,
|
|
9174
|
+
await decodeMeshoptCompression(gltfData, options, name11);
|
|
9105
9175
|
}
|
|
9106
|
-
var
|
|
9176
|
+
var name11;
|
|
9107
9177
|
var init_EXT_meshopt_compression = __esm({
|
|
9108
9178
|
"../scene/src/gltf/lib/extensions/EXT_meshopt_compression.ts"() {
|
|
9109
9179
|
"use strict";
|
|
9110
9180
|
init_meshopt_compression();
|
|
9111
|
-
|
|
9181
|
+
name11 = "EXT_meshopt_compression";
|
|
9112
9182
|
}
|
|
9113
9183
|
});
|
|
9114
9184
|
|
|
@@ -9116,28 +9186,29 @@ var init_EXT_meshopt_compression = __esm({
|
|
|
9116
9186
|
var KHR_meshopt_compression_exports = {};
|
|
9117
9187
|
__export(KHR_meshopt_compression_exports, {
|
|
9118
9188
|
decode: () => decode11,
|
|
9119
|
-
name: () =>
|
|
9189
|
+
name: () => name12
|
|
9120
9190
|
});
|
|
9121
9191
|
async function decode11(gltfData, options) {
|
|
9122
|
-
await decodeMeshoptCompression(gltfData, options,
|
|
9192
|
+
await decodeMeshoptCompression(gltfData, options, name12);
|
|
9123
9193
|
}
|
|
9124
|
-
var
|
|
9194
|
+
var name12;
|
|
9125
9195
|
var init_KHR_meshopt_compression = __esm({
|
|
9126
9196
|
"../scene/src/gltf/lib/extensions/KHR_meshopt_compression.ts"() {
|
|
9127
9197
|
"use strict";
|
|
9128
9198
|
init_meshopt_compression();
|
|
9129
|
-
|
|
9199
|
+
name12 = "KHR_meshopt_compression";
|
|
9130
9200
|
}
|
|
9131
9201
|
});
|
|
9132
9202
|
|
|
9133
9203
|
// ../scene/src/gltf/lib/extensions/EXT_texture_webp.ts
|
|
9134
9204
|
var EXT_texture_webp_exports = {};
|
|
9135
9205
|
__export(EXT_texture_webp_exports, {
|
|
9136
|
-
name: () =>
|
|
9137
|
-
preprocess: () =>
|
|
9206
|
+
name: () => name13,
|
|
9207
|
+
preprocess: () => preprocess2
|
|
9138
9208
|
});
|
|
9139
|
-
function
|
|
9209
|
+
function preprocess2(gltfData, options) {
|
|
9140
9210
|
const iterator = new GLTFIterator(gltfData);
|
|
9211
|
+
if (!iterator.hasExtension(EXT_TEXTURE_WEBP)) return;
|
|
9141
9212
|
if (!isImageFormatSupported("image/webp")) {
|
|
9142
9213
|
if (iterator.isExtensionRequired(EXT_TEXTURE_WEBP)) {
|
|
9143
9214
|
throw new Error(`gltf: Required extension ${EXT_TEXTURE_WEBP} not supported by browser`);
|
|
@@ -9153,24 +9224,24 @@ function preprocess(gltfData, options) {
|
|
|
9153
9224
|
}
|
|
9154
9225
|
iterator.removeExtension(EXT_TEXTURE_WEBP);
|
|
9155
9226
|
}
|
|
9156
|
-
var EXT_TEXTURE_WEBP,
|
|
9227
|
+
var EXT_TEXTURE_WEBP, name13;
|
|
9157
9228
|
var init_EXT_texture_webp = __esm({
|
|
9158
9229
|
"../scene/src/gltf/lib/extensions/EXT_texture_webp.ts"() {
|
|
9159
9230
|
"use strict";
|
|
9160
9231
|
init_src();
|
|
9161
9232
|
init_gltf_iterator();
|
|
9162
9233
|
EXT_TEXTURE_WEBP = "EXT_texture_webp";
|
|
9163
|
-
|
|
9234
|
+
name13 = EXT_TEXTURE_WEBP;
|
|
9164
9235
|
}
|
|
9165
9236
|
});
|
|
9166
9237
|
|
|
9167
9238
|
// ../scene/src/gltf/lib/extensions/EXT_texture_avif.ts
|
|
9168
9239
|
var EXT_texture_avif_exports = {};
|
|
9169
9240
|
__export(EXT_texture_avif_exports, {
|
|
9170
|
-
name: () =>
|
|
9171
|
-
preprocess: () =>
|
|
9241
|
+
name: () => name14,
|
|
9242
|
+
preprocess: () => preprocess3
|
|
9172
9243
|
});
|
|
9173
|
-
async function
|
|
9244
|
+
async function preprocess3(gltfData, options) {
|
|
9174
9245
|
void options;
|
|
9175
9246
|
const iterator = new GLTFIterator(gltfData);
|
|
9176
9247
|
if (!iterator.hasExtension(EXT_TEXTURE_AVIF)) return;
|
|
@@ -9190,24 +9261,72 @@ async function preprocess2(gltfData, options) {
|
|
|
9190
9261
|
}
|
|
9191
9262
|
iterator.removeExtension(EXT_TEXTURE_AVIF);
|
|
9192
9263
|
}
|
|
9193
|
-
var EXT_TEXTURE_AVIF,
|
|
9264
|
+
var EXT_TEXTURE_AVIF, name14;
|
|
9194
9265
|
var init_EXT_texture_avif = __esm({
|
|
9195
9266
|
"../scene/src/gltf/lib/extensions/EXT_texture_avif.ts"() {
|
|
9196
9267
|
"use strict";
|
|
9197
9268
|
init_src();
|
|
9198
9269
|
init_gltf_iterator();
|
|
9199
9270
|
EXT_TEXTURE_AVIF = "EXT_texture_avif";
|
|
9200
|
-
|
|
9271
|
+
name14 = EXT_TEXTURE_AVIF;
|
|
9272
|
+
}
|
|
9273
|
+
});
|
|
9274
|
+
|
|
9275
|
+
// ../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts
|
|
9276
|
+
var MSFT_texture_dds_exports = {};
|
|
9277
|
+
__export(MSFT_texture_dds_exports, {
|
|
9278
|
+
decode: () => decode12,
|
|
9279
|
+
getDDSLoader: () => getDDSLoader,
|
|
9280
|
+
name: () => name15,
|
|
9281
|
+
preprocess: () => preprocess4
|
|
9282
|
+
});
|
|
9283
|
+
function getDDSLoader(context) {
|
|
9284
|
+
var _a;
|
|
9285
|
+
return (_a = context == null ? void 0 : context.loaders) == null ? void 0 : _a.find(
|
|
9286
|
+
(loader) => {
|
|
9287
|
+
var _a2, _b;
|
|
9288
|
+
return ((_a2 = loader.extensions) == null ? void 0 : _a2.includes("dds")) || ((_b = loader.mimeTypes) == null ? void 0 : _b.includes("image/vnd-ms.dds"));
|
|
9289
|
+
}
|
|
9290
|
+
);
|
|
9291
|
+
}
|
|
9292
|
+
function preprocess4(gltf, _options, context) {
|
|
9293
|
+
const iterator = new GLTFIterator(gltf);
|
|
9294
|
+
if (!iterator.hasExtension(name15)) return;
|
|
9295
|
+
if (!getDDSLoader(context)) {
|
|
9296
|
+
if (iterator.isExtensionRequired(name15)) {
|
|
9297
|
+
throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");
|
|
9298
|
+
}
|
|
9299
|
+
return;
|
|
9300
|
+
}
|
|
9301
|
+
for (const texture of iterator.textures) {
|
|
9302
|
+
const extension = iterator.getExtension(texture, name15);
|
|
9303
|
+
if (extension) texture.source = extension.source;
|
|
9304
|
+
}
|
|
9305
|
+
}
|
|
9306
|
+
async function decode12(gltf, options, context) {
|
|
9307
|
+
var _a;
|
|
9308
|
+
if (!getDDSLoader(context) || ((_a = options.gltf) == null ? void 0 : _a.loadImages) === false) return;
|
|
9309
|
+
const iterator = new GLTFIterator(gltf);
|
|
9310
|
+
if (!iterator.hasExtension(name15)) return;
|
|
9311
|
+
for (const texture of iterator.textures) iterator.removeExtension(texture, name15);
|
|
9312
|
+
iterator.removeExtension(name15);
|
|
9313
|
+
}
|
|
9314
|
+
var name15;
|
|
9315
|
+
var init_MSFT_texture_dds = __esm({
|
|
9316
|
+
"../scene/src/gltf/lib/extensions/MSFT_texture_dds.ts"() {
|
|
9317
|
+
"use strict";
|
|
9318
|
+
init_gltf_iterator();
|
|
9319
|
+
name15 = "MSFT_texture_dds";
|
|
9201
9320
|
}
|
|
9202
9321
|
});
|
|
9203
9322
|
|
|
9204
9323
|
// ../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts
|
|
9205
9324
|
var KHR_texture_basisu_exports = {};
|
|
9206
9325
|
__export(KHR_texture_basisu_exports, {
|
|
9207
|
-
name: () =>
|
|
9208
|
-
preprocess: () =>
|
|
9326
|
+
name: () => name16,
|
|
9327
|
+
preprocess: () => preprocess5
|
|
9209
9328
|
});
|
|
9210
|
-
function
|
|
9329
|
+
function preprocess5(gltfData, options) {
|
|
9211
9330
|
void options;
|
|
9212
9331
|
const iterator = new GLTFIterator(gltfData);
|
|
9213
9332
|
for (const texture of iterator.textures) {
|
|
@@ -9219,697 +9338,109 @@ function preprocess3(gltfData, options) {
|
|
|
9219
9338
|
}
|
|
9220
9339
|
iterator.removeExtension(KHR_TEXTURE_BASISU);
|
|
9221
9340
|
}
|
|
9222
|
-
var KHR_TEXTURE_BASISU,
|
|
9341
|
+
var KHR_TEXTURE_BASISU, name16;
|
|
9223
9342
|
var init_KHR_texture_basisu = __esm({
|
|
9224
9343
|
"../scene/src/gltf/lib/extensions/KHR_texture_basisu.ts"() {
|
|
9225
9344
|
"use strict";
|
|
9226
9345
|
init_gltf_iterator();
|
|
9227
9346
|
KHR_TEXTURE_BASISU = "KHR_texture_basisu";
|
|
9228
|
-
|
|
9347
|
+
name16 = KHR_TEXTURE_BASISU;
|
|
9229
9348
|
}
|
|
9230
9349
|
});
|
|
9231
9350
|
|
|
9232
|
-
// ../core/src/
|
|
9233
|
-
function
|
|
9351
|
+
// ../core/src/arrow-worker-transport.ts
|
|
9352
|
+
function serializeArrowWorkerResult(result, options) {
|
|
9353
|
+
var _a;
|
|
9354
|
+
if (!isArrowTableWrapper(result)) {
|
|
9355
|
+
return result;
|
|
9356
|
+
}
|
|
9357
|
+
const workerOptions = options;
|
|
9358
|
+
const bufferCopyMode = ((_a = workerOptions == null ? void 0 : workerOptions.core) == null ? void 0 : _a.workerTransferBufferCopy) ?? (workerOptions == null ? void 0 : workerOptions.workerTransferBufferCopy);
|
|
9234
9359
|
return {
|
|
9235
|
-
|
|
9236
|
-
|
|
9360
|
+
...result,
|
|
9361
|
+
data: (0, import_arrow.dehydrateArrowTable)(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
9237
9362
|
};
|
|
9238
9363
|
}
|
|
9239
|
-
function
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
);
|
|
9244
|
-
}
|
|
9245
|
-
function serializeArrowMetadata(arrowMetadata) {
|
|
9246
|
-
return Object.fromEntries(arrowMetadata);
|
|
9247
|
-
}
|
|
9248
|
-
function deserializeArrowMetadata(metadata) {
|
|
9249
|
-
return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
|
|
9364
|
+
function deserializeArrowWorkerResult(result) {
|
|
9365
|
+
if (!isDehydratedArrowTableWrapper(result)) {
|
|
9366
|
+
return result;
|
|
9367
|
+
}
|
|
9368
|
+
return { ...result, data: (0, import_arrow.hydrateArrowTable)(result.data) };
|
|
9250
9369
|
}
|
|
9251
|
-
function
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
metadata: serializeArrowMetadata(field.metadata)
|
|
9257
|
-
};
|
|
9370
|
+
function isArrowTableWrapper(value) {
|
|
9371
|
+
const table = value;
|
|
9372
|
+
return Boolean(
|
|
9373
|
+
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
9374
|
+
);
|
|
9258
9375
|
}
|
|
9259
|
-
function
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
field.nullable,
|
|
9264
|
-
deserializeArrowMetadata(field.metadata)
|
|
9376
|
+
function isDehydratedArrowTableWrapper(value) {
|
|
9377
|
+
const table = value;
|
|
9378
|
+
return Boolean(
|
|
9379
|
+
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
9265
9380
|
);
|
|
9266
9381
|
}
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9382
|
+
var import_arrow;
|
|
9383
|
+
var init_arrow_worker_transport = __esm({
|
|
9384
|
+
"../core/src/arrow-worker-transport.ts"() {
|
|
9385
|
+
"use strict";
|
|
9386
|
+
import_arrow = require("@math.gl/arrow");
|
|
9270
9387
|
}
|
|
9271
|
-
|
|
9272
|
-
|
|
9388
|
+
});
|
|
9389
|
+
|
|
9390
|
+
// ../scene/src/draco/lib/utils/version.ts
|
|
9391
|
+
var VERSION4;
|
|
9392
|
+
var init_version4 = __esm({
|
|
9393
|
+
"../scene/src/draco/lib/utils/version.ts"() {
|
|
9394
|
+
"use strict";
|
|
9395
|
+
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
9273
9396
|
}
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9397
|
+
});
|
|
9398
|
+
|
|
9399
|
+
// ../scene/src/draco/draco-format.ts
|
|
9400
|
+
var DracoFormat;
|
|
9401
|
+
var init_draco_format = __esm({
|
|
9402
|
+
"../scene/src/draco/draco-format.ts"() {
|
|
9403
|
+
"use strict";
|
|
9404
|
+
DracoFormat = {
|
|
9405
|
+
name: "Draco",
|
|
9406
|
+
id: "draco",
|
|
9407
|
+
module: "scene",
|
|
9408
|
+
encoding: "binary",
|
|
9409
|
+
format: "draco",
|
|
9410
|
+
extensions: ["drc"],
|
|
9411
|
+
mimeTypes: ["application/octet-stream"],
|
|
9412
|
+
binary: true,
|
|
9413
|
+
tests: ["DRACO"]
|
|
9279
9414
|
};
|
|
9280
9415
|
}
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
}
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
return "uint32";
|
|
9310
|
-
case arrow.Uint64:
|
|
9311
|
-
return "uint64";
|
|
9312
|
-
case arrow.Float:
|
|
9313
|
-
const precision = arrowType.precision;
|
|
9314
|
-
switch (precision) {
|
|
9315
|
-
case arrow.Precision.HALF:
|
|
9316
|
-
return "float16";
|
|
9317
|
-
case arrow.Precision.SINGLE:
|
|
9318
|
-
return "float32";
|
|
9319
|
-
case arrow.Precision.DOUBLE:
|
|
9320
|
-
return "float64";
|
|
9321
|
-
default:
|
|
9322
|
-
return "float16";
|
|
9323
|
-
}
|
|
9324
|
-
case arrow.Float16:
|
|
9325
|
-
return "float16";
|
|
9326
|
-
case arrow.Float32:
|
|
9327
|
-
return "float32";
|
|
9328
|
-
case arrow.Float64:
|
|
9329
|
-
return "float64";
|
|
9330
|
-
case arrow.Utf8:
|
|
9331
|
-
return "utf8";
|
|
9332
|
-
case arrow.Decimal:
|
|
9333
|
-
const decimal = arrowType;
|
|
9334
|
-
return {
|
|
9335
|
-
type: "decimal",
|
|
9336
|
-
bitWidth: decimal.bitWidth,
|
|
9337
|
-
precision: decimal.precision,
|
|
9338
|
-
scale: decimal.scale
|
|
9339
|
-
};
|
|
9340
|
-
case arrow.Date_:
|
|
9341
|
-
const dateUnit = arrowType.unit;
|
|
9342
|
-
return dateUnit === arrow.DateUnit.DAY ? "date-day" : "date-millisecond";
|
|
9343
|
-
case arrow.DateDay:
|
|
9344
|
-
return "date-day";
|
|
9345
|
-
case arrow.DateMillisecond:
|
|
9346
|
-
return "date-millisecond";
|
|
9347
|
-
case arrow.Time:
|
|
9348
|
-
const timeUnit = arrowType.unit;
|
|
9349
|
-
switch (timeUnit) {
|
|
9350
|
-
case arrow.TimeUnit.SECOND:
|
|
9351
|
-
return "time-second";
|
|
9352
|
-
case arrow.TimeUnit.MILLISECOND:
|
|
9353
|
-
return "time-millisecond";
|
|
9354
|
-
case arrow.TimeUnit.MICROSECOND:
|
|
9355
|
-
return "time-microsecond";
|
|
9356
|
-
case arrow.TimeUnit.NANOSECOND:
|
|
9357
|
-
return "time-nanosecond";
|
|
9358
|
-
default:
|
|
9359
|
-
return "time-second";
|
|
9360
|
-
}
|
|
9361
|
-
case arrow.TimeMillisecond:
|
|
9362
|
-
return "time-millisecond";
|
|
9363
|
-
case arrow.TimeSecond:
|
|
9364
|
-
return "time-second";
|
|
9365
|
-
case arrow.TimeMicrosecond:
|
|
9366
|
-
return "time-microsecond";
|
|
9367
|
-
case arrow.TimeNanosecond:
|
|
9368
|
-
return "time-nanosecond";
|
|
9369
|
-
case arrow.Timestamp:
|
|
9370
|
-
const timeStampUnit = arrowType.unit;
|
|
9371
|
-
switch (timeStampUnit) {
|
|
9372
|
-
case arrow.TimeUnit.SECOND:
|
|
9373
|
-
return "timestamp-second";
|
|
9374
|
-
case arrow.TimeUnit.MILLISECOND:
|
|
9375
|
-
return "timestamp-millisecond";
|
|
9376
|
-
case arrow.TimeUnit.MICROSECOND:
|
|
9377
|
-
return "timestamp-microsecond";
|
|
9378
|
-
case arrow.TimeUnit.NANOSECOND:
|
|
9379
|
-
return "timestamp-nanosecond";
|
|
9380
|
-
default:
|
|
9381
|
-
return "timestamp-second";
|
|
9382
|
-
}
|
|
9383
|
-
case arrow.TimestampSecond:
|
|
9384
|
-
return "timestamp-second";
|
|
9385
|
-
case arrow.TimestampMillisecond:
|
|
9386
|
-
return "timestamp-millisecond";
|
|
9387
|
-
case arrow.TimestampMicrosecond:
|
|
9388
|
-
return "timestamp-microsecond";
|
|
9389
|
-
case arrow.TimestampNanosecond:
|
|
9390
|
-
return "timestamp-nanosecond";
|
|
9391
|
-
case arrow.Interval:
|
|
9392
|
-
const intervalUnit = arrowType.unit;
|
|
9393
|
-
switch (intervalUnit) {
|
|
9394
|
-
case arrow.IntervalUnit.DAY_TIME:
|
|
9395
|
-
return "interval-daytime";
|
|
9396
|
-
case arrow.IntervalUnit.YEAR_MONTH:
|
|
9397
|
-
return "interval-yearmonth";
|
|
9398
|
-
default:
|
|
9399
|
-
return "interval-daytime";
|
|
9400
|
-
}
|
|
9401
|
-
case arrow.IntervalDayTime:
|
|
9402
|
-
return "interval-daytime";
|
|
9403
|
-
case arrow.IntervalYearMonth:
|
|
9404
|
-
return "interval-yearmonth";
|
|
9405
|
-
case arrow.Map_:
|
|
9406
|
-
const mapType = arrowType;
|
|
9407
|
-
return {
|
|
9408
|
-
type: "map",
|
|
9409
|
-
keysSorted: mapType.keysSorted,
|
|
9410
|
-
children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
9411
|
-
};
|
|
9412
|
-
case arrow.List:
|
|
9413
|
-
const listType = arrowType;
|
|
9414
|
-
const listField = listType.valueField;
|
|
9415
|
-
return {
|
|
9416
|
-
type: "list",
|
|
9417
|
-
children: [serializeArrowField(listField)]
|
|
9418
|
-
};
|
|
9419
|
-
case arrow.FixedSizeList:
|
|
9420
|
-
const fixedSizeList = arrowType;
|
|
9421
|
-
return {
|
|
9422
|
-
type: "fixed-size-list",
|
|
9423
|
-
listSize: fixedSizeList.listSize,
|
|
9424
|
-
children: [serializeArrowField(fixedSizeList.children[0])]
|
|
9425
|
-
};
|
|
9426
|
-
case arrow.Struct:
|
|
9427
|
-
const structType = arrowType;
|
|
9428
|
-
return {
|
|
9429
|
-
type: "struct",
|
|
9430
|
-
children: structType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
9431
|
-
};
|
|
9432
|
-
case arrow.SparseUnion:
|
|
9433
|
-
case arrow.DenseUnion:
|
|
9434
|
-
const unionType = arrowType;
|
|
9435
|
-
return {
|
|
9436
|
-
type: unionType instanceof arrow.DenseUnion ? "dense-union" : "sparse-union",
|
|
9437
|
-
typeIds: unionType.typeIds,
|
|
9438
|
-
children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
|
|
9439
|
-
typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
|
|
9440
|
-
};
|
|
9441
|
-
case arrow.Dictionary:
|
|
9442
|
-
const dictionaryType = arrowType;
|
|
9443
|
-
return {
|
|
9444
|
-
type: "dictionary",
|
|
9445
|
-
id: dictionaryType.id,
|
|
9446
|
-
indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
|
|
9447
|
-
dictionary: serializeArrowType(dictionaryType.dictionary),
|
|
9448
|
-
isOrdered: dictionaryType.isOrdered
|
|
9449
|
-
};
|
|
9450
|
-
default:
|
|
9451
|
-
throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
|
|
9452
|
-
}
|
|
9453
|
-
}
|
|
9454
|
-
function deserializeArrowType(dataType, options) {
|
|
9455
|
-
if (typeof dataType === "object") {
|
|
9456
|
-
switch (dataType.type) {
|
|
9457
|
-
case "decimal":
|
|
9458
|
-
return new arrow.Decimal(dataType.scale, dataType.precision, dataType.bitWidth);
|
|
9459
|
-
case "map": {
|
|
9460
|
-
const children = dataType.children.map(
|
|
9461
|
-
(arrowField) => deserializeArrowField(arrowField, options)
|
|
9462
|
-
);
|
|
9463
|
-
return new arrow.Map_(children[0], dataType.keysSorted);
|
|
9464
|
-
}
|
|
9465
|
-
case "list": {
|
|
9466
|
-
const field = deserializeArrowField(dataType.children[0], options);
|
|
9467
|
-
return new arrow.List(field);
|
|
9468
|
-
}
|
|
9469
|
-
case "large-list": {
|
|
9470
|
-
const field = deserializeArrowField(dataType.children[0], options);
|
|
9471
|
-
const LargeList = getOptionalArrowConstructor("LargeList");
|
|
9472
|
-
if (!LargeList) {
|
|
9473
|
-
throw new Error(
|
|
9474
|
-
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
9475
|
-
);
|
|
9476
|
-
}
|
|
9477
|
-
return new LargeList(field);
|
|
9478
|
-
}
|
|
9479
|
-
case "fixed-size-list": {
|
|
9480
|
-
const child = deserializeArrowField(dataType.children[0], options);
|
|
9481
|
-
return new arrow.FixedSizeList(dataType.listSize, child);
|
|
9482
|
-
}
|
|
9483
|
-
case "fixed-size-binary":
|
|
9484
|
-
return new arrow.FixedSizeBinary(dataType.byteWidth);
|
|
9485
|
-
case "struct": {
|
|
9486
|
-
const children = dataType.children.map(
|
|
9487
|
-
(arrowField) => deserializeArrowField(arrowField, options)
|
|
9488
|
-
);
|
|
9489
|
-
return new arrow.Struct(children);
|
|
9490
|
-
}
|
|
9491
|
-
case "sparse-union":
|
|
9492
|
-
case "dense-union": {
|
|
9493
|
-
const children = dataType.children.map(
|
|
9494
|
-
(arrowField) => deserializeArrowField(arrowField, options)
|
|
9495
|
-
);
|
|
9496
|
-
return dataType.type === "dense-union" ? new arrow.DenseUnion(dataType.typeIds, children) : new arrow.SparseUnion(dataType.typeIds, children);
|
|
9497
|
-
}
|
|
9498
|
-
case "dictionary": {
|
|
9499
|
-
return new arrow.Dictionary(
|
|
9500
|
-
deserializeArrowType(dataType.dictionary, options),
|
|
9501
|
-
deserializeArrowDictionaryKeyType(dataType.indices),
|
|
9502
|
-
dataType.id,
|
|
9503
|
-
dataType.isOrdered
|
|
9504
|
-
);
|
|
9505
|
-
}
|
|
9506
|
-
default:
|
|
9507
|
-
throw new Error("array type not supported");
|
|
9508
|
-
}
|
|
9509
|
-
}
|
|
9510
|
-
switch (dataType) {
|
|
9511
|
-
case "null":
|
|
9512
|
-
return new arrow.Null();
|
|
9513
|
-
case "binary":
|
|
9514
|
-
return makeVariableWidthArrowType("BinaryView", new arrow.Binary(), options);
|
|
9515
|
-
case "binary-view":
|
|
9516
|
-
return makeRequiredArrowViewType("BinaryView");
|
|
9517
|
-
case "bool":
|
|
9518
|
-
return new arrow.Bool();
|
|
9519
|
-
case "int8":
|
|
9520
|
-
return new arrow.Int8();
|
|
9521
|
-
case "int16":
|
|
9522
|
-
return new arrow.Int16();
|
|
9523
|
-
case "int32":
|
|
9524
|
-
return new arrow.Int32();
|
|
9525
|
-
case "int64":
|
|
9526
|
-
return new arrow.Int64();
|
|
9527
|
-
case "uint8":
|
|
9528
|
-
return new arrow.Uint8();
|
|
9529
|
-
case "uint16":
|
|
9530
|
-
return new arrow.Uint16();
|
|
9531
|
-
case "uint32":
|
|
9532
|
-
return new arrow.Uint32();
|
|
9533
|
-
case "uint64":
|
|
9534
|
-
return new arrow.Uint64();
|
|
9535
|
-
case "float16":
|
|
9536
|
-
return new arrow.Float16();
|
|
9537
|
-
case "float32":
|
|
9538
|
-
return new arrow.Float32();
|
|
9539
|
-
case "float64":
|
|
9540
|
-
return new arrow.Float64();
|
|
9541
|
-
case "utf8":
|
|
9542
|
-
return makeVariableWidthArrowType("Utf8View", new arrow.Utf8(), options);
|
|
9543
|
-
case "utf8-view":
|
|
9544
|
-
return makeRequiredArrowViewType("Utf8View");
|
|
9545
|
-
case "date-day":
|
|
9546
|
-
return new arrow.DateDay();
|
|
9547
|
-
case "date-millisecond":
|
|
9548
|
-
return new arrow.DateMillisecond();
|
|
9549
|
-
case "time-second":
|
|
9550
|
-
return new arrow.TimeSecond();
|
|
9551
|
-
case "time-millisecond":
|
|
9552
|
-
return new arrow.TimeMillisecond();
|
|
9553
|
-
case "time-microsecond":
|
|
9554
|
-
return new arrow.TimeMicrosecond();
|
|
9555
|
-
case "time-nanosecond":
|
|
9556
|
-
return new arrow.TimeNanosecond();
|
|
9557
|
-
case "timestamp-second":
|
|
9558
|
-
return new arrow.TimestampSecond();
|
|
9559
|
-
case "timestamp-millisecond":
|
|
9560
|
-
return new arrow.TimestampMillisecond();
|
|
9561
|
-
case "timestamp-microsecond":
|
|
9562
|
-
return new arrow.TimestampMicrosecond();
|
|
9563
|
-
case "timestamp-nanosecond":
|
|
9564
|
-
return new arrow.TimestampNanosecond();
|
|
9565
|
-
case "interval-daytime":
|
|
9566
|
-
return new arrow.IntervalDayTime();
|
|
9567
|
-
case "interval-yearmonth":
|
|
9568
|
-
return new arrow.IntervalYearMonth();
|
|
9569
|
-
default:
|
|
9570
|
-
throw new Error("array type not supported");
|
|
9571
|
-
}
|
|
9572
|
-
}
|
|
9573
|
-
function getOptionalArrowConstructor(typeName) {
|
|
9574
|
-
return arrow[typeName];
|
|
9575
|
-
}
|
|
9576
|
-
function isArrowViewType(arrowType, viewTypeName) {
|
|
9577
|
-
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
9578
|
-
if (constructor && arrowType instanceof constructor) {
|
|
9579
|
-
return true;
|
|
9580
|
-
}
|
|
9581
|
-
const guards = arrow.DataType;
|
|
9582
|
-
const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
|
|
9583
|
-
return Boolean(guard == null ? void 0 : guard(arrowType));
|
|
9584
|
-
}
|
|
9585
|
-
function isOptionalArrowType(arrowType, typeName) {
|
|
9586
|
-
const constructor = getOptionalArrowConstructor(typeName);
|
|
9587
|
-
return Boolean(constructor && arrowType instanceof constructor);
|
|
9588
|
-
}
|
|
9589
|
-
function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
|
|
9590
|
-
const viewTypeMode = (options == null ? void 0 : options.viewTypes) || "never";
|
|
9591
|
-
if (viewTypeMode === "never") {
|
|
9592
|
-
return fallbackType;
|
|
9593
|
-
}
|
|
9594
|
-
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
9595
|
-
if (constructor) {
|
|
9596
|
-
return new constructor();
|
|
9597
|
-
}
|
|
9598
|
-
if (viewTypeMode === "require") {
|
|
9599
|
-
throw new Error(
|
|
9600
|
-
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
9601
|
-
);
|
|
9602
|
-
}
|
|
9603
|
-
return fallbackType;
|
|
9604
|
-
}
|
|
9605
|
-
function makeRequiredArrowViewType(viewTypeName) {
|
|
9606
|
-
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
9607
|
-
if (!constructor) {
|
|
9608
|
-
throw new Error(
|
|
9609
|
-
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
9610
|
-
);
|
|
9611
|
-
}
|
|
9612
|
-
return new constructor();
|
|
9613
|
-
}
|
|
9614
|
-
function serializeArrowDictionaryKeyType(arrowType) {
|
|
9615
|
-
if (arrowType instanceof arrow.Int) {
|
|
9616
|
-
const prefix = arrowType.isSigned ? "int" : "uint";
|
|
9617
|
-
const keyType = `${prefix}${arrowType.bitWidth}`;
|
|
9618
|
-
if (isSchemaDictionaryKeyType(keyType)) {
|
|
9619
|
-
return keyType;
|
|
9620
|
-
}
|
|
9621
|
-
}
|
|
9622
|
-
switch (arrowType.constructor) {
|
|
9623
|
-
case arrow.Int8:
|
|
9624
|
-
return "int8";
|
|
9625
|
-
case arrow.Int16:
|
|
9626
|
-
return "int16";
|
|
9627
|
-
case arrow.Int32:
|
|
9628
|
-
return "int32";
|
|
9629
|
-
case arrow.Uint8:
|
|
9630
|
-
return "uint8";
|
|
9631
|
-
case arrow.Uint16:
|
|
9632
|
-
return "uint16";
|
|
9633
|
-
case arrow.Uint32:
|
|
9634
|
-
return "uint32";
|
|
9635
|
-
default:
|
|
9636
|
-
throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
|
|
9637
|
-
}
|
|
9638
|
-
}
|
|
9639
|
-
function isSchemaDictionaryKeyType(keyType) {
|
|
9640
|
-
return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
|
|
9641
|
-
}
|
|
9642
|
-
function deserializeArrowDictionaryKeyType(keyType) {
|
|
9643
|
-
switch (keyType) {
|
|
9644
|
-
case "int8":
|
|
9645
|
-
return new arrow.Int8();
|
|
9646
|
-
case "int16":
|
|
9647
|
-
return new arrow.Int16();
|
|
9648
|
-
case "int32":
|
|
9649
|
-
return new arrow.Int32();
|
|
9650
|
-
case "uint8":
|
|
9651
|
-
return new arrow.Uint8();
|
|
9652
|
-
case "uint16":
|
|
9653
|
-
return new arrow.Uint16();
|
|
9654
|
-
case "uint32":
|
|
9655
|
-
return new arrow.Uint32();
|
|
9656
|
-
default:
|
|
9657
|
-
throw new Error(`schema dictionary index type not supported: ${keyType}`);
|
|
9658
|
-
}
|
|
9659
|
-
}
|
|
9660
|
-
var arrow;
|
|
9661
|
-
var init_convert_arrow_schema = __esm({
|
|
9662
|
-
"../core/src/schema-utils/lib/schema/convert-arrow-schema.ts"() {
|
|
9663
|
-
"use strict";
|
|
9664
|
-
arrow = __toESM(require("apache-arrow"), 1);
|
|
9665
|
-
}
|
|
9666
|
-
});
|
|
9667
|
-
|
|
9668
|
-
// ../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts
|
|
9669
|
-
function splitArrowBuffers(input, options = {}) {
|
|
9670
|
-
const context = { ...options, copies: /* @__PURE__ */ new WeakMap() };
|
|
9671
|
-
if (isArrowTable(input)) {
|
|
9672
|
-
return splitArrowTableBuffersInternal(input, context);
|
|
9673
|
-
}
|
|
9674
|
-
if (isArrowRecordBatch(input)) {
|
|
9675
|
-
return splitArrowRecordBatchBuffers(input, context);
|
|
9676
|
-
}
|
|
9677
|
-
if (isArrowVector(input)) {
|
|
9678
|
-
return splitArrowVectorBuffers(input, context);
|
|
9679
|
-
}
|
|
9680
|
-
return splitArrowDataBuffers(input, context);
|
|
9681
|
-
}
|
|
9682
|
-
function isArrowTable(input) {
|
|
9683
|
-
return "batches" in input;
|
|
9684
|
-
}
|
|
9685
|
-
function isArrowRecordBatch(input) {
|
|
9686
|
-
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
9687
|
-
}
|
|
9688
|
-
function isArrowVector(input) {
|
|
9689
|
-
return "data" in input && Array.isArray(input.data);
|
|
9690
|
-
}
|
|
9691
|
-
function splitArrowTableBuffersInternal(table, options) {
|
|
9692
|
-
const recordBatches = table.batches.map(
|
|
9693
|
-
(recordBatch) => splitArrowRecordBatchBuffers(recordBatch, options)
|
|
9694
|
-
);
|
|
9695
|
-
return new arrow2.Table(table.schema, recordBatches);
|
|
9696
|
-
}
|
|
9697
|
-
function splitArrowRecordBatchBuffers(recordBatch, options) {
|
|
9698
|
-
return new arrow2.RecordBatch(
|
|
9699
|
-
recordBatch.schema,
|
|
9700
|
-
splitArrowDataBuffers(recordBatch.data, options)
|
|
9701
|
-
);
|
|
9702
|
-
}
|
|
9703
|
-
function splitArrowDataBuffers(data, options) {
|
|
9704
|
-
const children = data.children.map((childData) => splitArrowDataBuffers(childData, options));
|
|
9705
|
-
const dictionary = data.dictionary ? splitArrowVectorBuffers(data.dictionary, options) : void 0;
|
|
9706
|
-
const buffers = {
|
|
9707
|
-
[arrow2.BufferType.OFFSET]: splitArrowBuffer(data.buffers[arrow2.BufferType.OFFSET], options),
|
|
9708
|
-
[arrow2.BufferType.DATA]: splitArrowBuffer(data.buffers[arrow2.BufferType.DATA], options),
|
|
9709
|
-
[arrow2.BufferType.VALIDITY]: splitArrowBuffer(data.buffers[arrow2.BufferType.VALIDITY], options),
|
|
9710
|
-
[arrow2.BufferType.TYPE]: splitArrowBuffer(data.buffers[arrow2.BufferType.TYPE], options)
|
|
9711
|
-
};
|
|
9712
|
-
return new arrow2.Data(
|
|
9713
|
-
data.type,
|
|
9714
|
-
data.offset,
|
|
9715
|
-
data.length,
|
|
9716
|
-
// @ts-expect-error _nullCount is protected. Reuse it to preserve lazy null-count state.
|
|
9717
|
-
data._nullCount,
|
|
9718
|
-
buffers,
|
|
9719
|
-
children,
|
|
9720
|
-
dictionary
|
|
9721
|
-
);
|
|
9722
|
-
}
|
|
9723
|
-
function splitArrowVectorBuffers(vector, options) {
|
|
9724
|
-
return new arrow2.Vector(vector.data.map((data) => splitArrowDataBuffers(data, options)));
|
|
9725
|
-
}
|
|
9726
|
-
function splitArrowBuffer(array, options) {
|
|
9727
|
-
if (!isArrowTypedArray(array)) {
|
|
9728
|
-
return array;
|
|
9729
|
-
}
|
|
9730
|
-
if (options.copy === "none") {
|
|
9731
|
-
return array;
|
|
9732
|
-
}
|
|
9733
|
-
if (options.copy !== "all" && array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {
|
|
9734
|
-
return array;
|
|
9735
|
-
}
|
|
9736
|
-
let copy = options.copies.get(array);
|
|
9737
|
-
if (!copy) {
|
|
9738
|
-
copy = array.slice();
|
|
9739
|
-
options.copies.set(array, copy);
|
|
9740
|
-
}
|
|
9741
|
-
return copy;
|
|
9742
|
-
}
|
|
9743
|
-
function isArrowTypedArray(value) {
|
|
9744
|
-
return ArrayBuffer.isView(value) && !(value instanceof DataView);
|
|
9745
|
-
}
|
|
9746
|
-
var arrow2;
|
|
9747
|
-
var init_split_arrow_buffers = __esm({
|
|
9748
|
-
"../core/src/schema-utils/lib/arrow/split-arrow-buffers.ts"() {
|
|
9749
|
-
"use strict";
|
|
9750
|
-
arrow2 = __toESM(require("apache-arrow"), 1);
|
|
9751
|
-
}
|
|
9752
|
-
});
|
|
9753
|
-
|
|
9754
|
-
// ../core/src/schema-utils/lib/arrow/arrow-table-transport.ts
|
|
9755
|
-
function dehydrateArrowTable(table, options) {
|
|
9756
|
-
const splitTable = splitArrowBuffers(table, options);
|
|
9757
|
-
return {
|
|
9758
|
-
shape: "arrow-table",
|
|
9759
|
-
transport: "arrow-js",
|
|
9760
|
-
schema: serializeArrowSchema(splitTable.schema),
|
|
9761
|
-
batches: splitTable.batches.map((recordBatch) => dehydrateArrowRecordBatch(recordBatch))
|
|
9762
|
-
};
|
|
9763
|
-
}
|
|
9764
|
-
function hydrateArrowTable(table) {
|
|
9765
|
-
const schema = deserializeArrowSchema(table.schema);
|
|
9766
|
-
const recordBatches = table.batches.map(
|
|
9767
|
-
(recordBatch) => new arrow3.RecordBatch(schema, hydrateArrowData(recordBatch.data))
|
|
9768
|
-
);
|
|
9769
|
-
return new arrow3.Table(schema, recordBatches);
|
|
9770
|
-
}
|
|
9771
|
-
function serializeArrowWorkerResult(result, options) {
|
|
9772
|
-
var _a;
|
|
9773
|
-
if (!isArrowTableWrapper(result)) {
|
|
9774
|
-
return result;
|
|
9775
|
-
}
|
|
9776
|
-
const workerOptions = options;
|
|
9777
|
-
const bufferCopyMode = ((_a = workerOptions == null ? void 0 : workerOptions.core) == null ? void 0 : _a.workerTransferBufferCopy) ?? (workerOptions == null ? void 0 : workerOptions.workerTransferBufferCopy);
|
|
9778
|
-
return {
|
|
9779
|
-
...result,
|
|
9780
|
-
data: dehydrateArrowTable(result.data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
9781
|
-
};
|
|
9782
|
-
}
|
|
9783
|
-
function deserializeArrowWorkerResult(result) {
|
|
9784
|
-
if (!isDehydratedArrowTableWrapper(result)) {
|
|
9785
|
-
return result;
|
|
9786
|
-
}
|
|
9787
|
-
return { ...result, data: hydrateArrowTable(result.data) };
|
|
9788
|
-
}
|
|
9789
|
-
function isArrowTableWrapper(value) {
|
|
9790
|
-
const table = value;
|
|
9791
|
-
return Boolean(
|
|
9792
|
-
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
9793
|
-
);
|
|
9794
|
-
}
|
|
9795
|
-
function isDehydratedArrowTableWrapper(value) {
|
|
9796
|
-
const table = value;
|
|
9797
|
-
return Boolean(
|
|
9798
|
-
table && table.shape === "arrow-table" && table.data && table.data.transport === "arrow-js" && Array.isArray(table.data.batches)
|
|
9799
|
-
);
|
|
9800
|
-
}
|
|
9801
|
-
function dehydrateArrowRecordBatch(recordBatch) {
|
|
9802
|
-
return { data: dehydrateArrowData(recordBatch.data) };
|
|
9803
|
-
}
|
|
9804
|
-
function dehydrateArrowData(data) {
|
|
9805
|
-
return {
|
|
9806
|
-
type: serializeArrowType(data.type),
|
|
9807
|
-
offset: data.offset,
|
|
9808
|
-
length: data.length,
|
|
9809
|
-
// @ts-expect-error _nullCount is protected. Preserve the Arrow lazy null-count state.
|
|
9810
|
-
nullCount: data._nullCount,
|
|
9811
|
-
buffers: {
|
|
9812
|
-
[arrow3.BufferType.OFFSET]: data.buffers[arrow3.BufferType.OFFSET],
|
|
9813
|
-
[arrow3.BufferType.DATA]: data.buffers[arrow3.BufferType.DATA],
|
|
9814
|
-
[arrow3.BufferType.VALIDITY]: data.buffers[arrow3.BufferType.VALIDITY],
|
|
9815
|
-
[arrow3.BufferType.TYPE]: data.buffers[arrow3.BufferType.TYPE]
|
|
9816
|
-
},
|
|
9817
|
-
children: data.children.map((childData) => dehydrateArrowData(childData)),
|
|
9818
|
-
dictionary: data.dictionary ? dehydrateArrowVector(data.dictionary) : void 0
|
|
9819
|
-
};
|
|
9820
|
-
}
|
|
9821
|
-
function dehydrateArrowVector(vector) {
|
|
9822
|
-
return { data: vector.data.map((data) => dehydrateArrowData(data)) };
|
|
9823
|
-
}
|
|
9824
|
-
function hydrateArrowData(data) {
|
|
9825
|
-
const children = data.children.map((childData) => hydrateArrowData(childData));
|
|
9826
|
-
const dictionary = data.dictionary ? hydrateArrowVector(data.dictionary) : void 0;
|
|
9827
|
-
return new arrow3.Data(
|
|
9828
|
-
deserializeArrowType(data.type),
|
|
9829
|
-
data.offset,
|
|
9830
|
-
data.length,
|
|
9831
|
-
data.nullCount,
|
|
9832
|
-
data.buffers,
|
|
9833
|
-
children,
|
|
9834
|
-
dictionary
|
|
9835
|
-
);
|
|
9836
|
-
}
|
|
9837
|
-
function hydrateArrowVector(vector) {
|
|
9838
|
-
return new arrow3.Vector(vector.data.map((data) => hydrateArrowData(data)));
|
|
9839
|
-
}
|
|
9840
|
-
var arrow3;
|
|
9841
|
-
var init_arrow_table_transport = __esm({
|
|
9842
|
-
"../core/src/schema-utils/lib/arrow/arrow-table-transport.ts"() {
|
|
9843
|
-
"use strict";
|
|
9844
|
-
arrow3 = __toESM(require("apache-arrow"), 1);
|
|
9845
|
-
init_convert_arrow_schema();
|
|
9846
|
-
init_split_arrow_buffers();
|
|
9847
|
-
}
|
|
9848
|
-
});
|
|
9849
|
-
|
|
9850
|
-
// ../core/src/schema-utils/arrow-transport.ts
|
|
9851
|
-
var init_arrow_transport = __esm({
|
|
9852
|
-
"../core/src/schema-utils/arrow-transport.ts"() {
|
|
9853
|
-
"use strict";
|
|
9854
|
-
init_arrow_table_transport();
|
|
9855
|
-
init_split_arrow_buffers();
|
|
9856
|
-
}
|
|
9857
|
-
});
|
|
9858
|
-
|
|
9859
|
-
// ../scene/src/draco/lib/utils/version.ts
|
|
9860
|
-
var VERSION4;
|
|
9861
|
-
var init_version4 = __esm({
|
|
9862
|
-
"../scene/src/draco/lib/utils/version.ts"() {
|
|
9863
|
-
"use strict";
|
|
9864
|
-
VERSION4 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
9865
|
-
}
|
|
9866
|
-
});
|
|
9867
|
-
|
|
9868
|
-
// ../scene/src/draco/draco-format.ts
|
|
9869
|
-
var DracoFormat;
|
|
9870
|
-
var init_draco_format = __esm({
|
|
9871
|
-
"../scene/src/draco/draco-format.ts"() {
|
|
9872
|
-
"use strict";
|
|
9873
|
-
DracoFormat = {
|
|
9874
|
-
name: "Draco",
|
|
9875
|
-
id: "draco",
|
|
9876
|
-
module: "scene",
|
|
9877
|
-
encoding: "binary",
|
|
9878
|
-
format: "draco",
|
|
9879
|
-
extensions: ["drc"],
|
|
9880
|
-
mimeTypes: ["application/octet-stream"],
|
|
9881
|
-
binary: true,
|
|
9882
|
-
tests: ["DRACO"]
|
|
9883
|
-
};
|
|
9884
|
-
}
|
|
9885
|
-
});
|
|
9886
|
-
|
|
9887
|
-
// ../scene/src/draco/draco-loader-options.ts
|
|
9888
|
-
var DRACO_LOADER_DEFAULT_OPTIONS;
|
|
9889
|
-
var init_draco_loader_options = __esm({
|
|
9890
|
-
"../scene/src/draco/draco-loader-options.ts"() {
|
|
9891
|
-
"use strict";
|
|
9892
|
-
DRACO_LOADER_DEFAULT_OPTIONS = {
|
|
9893
|
-
backend: typeof WebAssembly === "object" ? "wasm" : "javascript",
|
|
9894
|
-
extraAttributes: {},
|
|
9895
|
-
attributeNameEntry: void 0,
|
|
9896
|
-
shape: "arrow-table",
|
|
9897
|
-
decoderProfile: "full"
|
|
9898
|
-
};
|
|
9899
|
-
}
|
|
9900
|
-
});
|
|
9901
|
-
|
|
9902
|
-
// ../scene/src/draco/lib/draco-library-loader.ts
|
|
9903
|
-
async function loadLibrary2(libraryUrl, moduleName = null, options = {}, libraryName = null, moduleLibraryName = null) {
|
|
9904
|
-
var _a;
|
|
9905
|
-
if (isBrowser2 && options.useLocalLibraries && !options.CDN && libraryName && ((_a = options.modules) == null ? void 0 : _a[libraryName]) === void 0) {
|
|
9906
|
-
const directory = isWorker ? "./libs" : `modules/${moduleName}/dist/libs`;
|
|
9907
|
-
options = {
|
|
9908
|
-
...options,
|
|
9909
|
-
modules: {
|
|
9910
|
-
[libraryName]: `${directory}/${libraryName}`,
|
|
9911
|
-
...moduleLibraryName ? { [moduleLibraryName]: `${directory}/${moduleLibraryName}` } : {},
|
|
9912
|
-
...options.modules
|
|
9416
|
+
});
|
|
9417
|
+
|
|
9418
|
+
// ../scene/src/draco/draco-loader-options.ts
|
|
9419
|
+
var DRACO_LOADER_DEFAULT_OPTIONS;
|
|
9420
|
+
var init_draco_loader_options = __esm({
|
|
9421
|
+
"../scene/src/draco/draco-loader-options.ts"() {
|
|
9422
|
+
"use strict";
|
|
9423
|
+
DRACO_LOADER_DEFAULT_OPTIONS = {
|
|
9424
|
+
backend: typeof WebAssembly === "object" ? "wasm" : "javascript",
|
|
9425
|
+
extraAttributes: {},
|
|
9426
|
+
attributeNameEntry: void 0,
|
|
9427
|
+
shape: "arrow-table",
|
|
9428
|
+
decoderProfile: "full"
|
|
9429
|
+
};
|
|
9430
|
+
}
|
|
9431
|
+
});
|
|
9432
|
+
|
|
9433
|
+
// ../scene/src/draco/lib/draco-library-loader.ts
|
|
9434
|
+
async function loadLibrary2(libraryUrl, moduleName = null, options = {}, libraryName = null, moduleLibraryName = null) {
|
|
9435
|
+
var _a;
|
|
9436
|
+
if (isBrowser2 && options.useLocalLibraries && !options.CDN && libraryName && ((_a = options.modules) == null ? void 0 : _a[libraryName]) === void 0) {
|
|
9437
|
+
const directory = isWorker ? "./libs" : `modules/${moduleName}/dist/libs`;
|
|
9438
|
+
options = {
|
|
9439
|
+
...options,
|
|
9440
|
+
modules: {
|
|
9441
|
+
[libraryName]: `${directory}/${libraryName}`,
|
|
9442
|
+
...moduleLibraryName ? { [moduleLibraryName]: `${directory}/${moduleLibraryName}` } : {},
|
|
9443
|
+
...options.modules
|
|
9913
9444
|
}
|
|
9914
9445
|
};
|
|
9915
9446
|
}
|
|
@@ -10092,122 +9623,552 @@ function initializeDracoModule(initializer, wasmBinary) {
|
|
|
10092
9623
|
(draco) => ({ draco })
|
|
10093
9624
|
);
|
|
10094
9625
|
}
|
|
10095
|
-
function getLibraryExport(library, exportName) {
|
|
10096
|
-
if (typeof library === "function") {
|
|
10097
|
-
return library;
|
|
9626
|
+
function getLibraryExport(library, exportName) {
|
|
9627
|
+
if (typeof library === "function") {
|
|
9628
|
+
return library;
|
|
9629
|
+
}
|
|
9630
|
+
if (library && typeof library === "object") {
|
|
9631
|
+
const exports = library;
|
|
9632
|
+
const exportedInitializer = exports[exportName] || exports.default;
|
|
9633
|
+
return typeof exportedInitializer === "function" ? exportedInitializer : void 0;
|
|
9634
|
+
}
|
|
9635
|
+
return void 0;
|
|
9636
|
+
}
|
|
9637
|
+
function getInjectedDraco3DModule(options) {
|
|
9638
|
+
var _a;
|
|
9639
|
+
const module2 = (_a = options.modules) == null ? void 0 : _a.draco3d;
|
|
9640
|
+
if (!module2) {
|
|
9641
|
+
return void 0;
|
|
9642
|
+
}
|
|
9643
|
+
if (typeof module2 !== "object" && typeof module2 !== "function") {
|
|
9644
|
+
throw new Error("Invalid draco3d module");
|
|
9645
|
+
}
|
|
9646
|
+
return module2;
|
|
9647
|
+
}
|
|
9648
|
+
function validateDracoDecoderModule(module2) {
|
|
9649
|
+
const typedModule = module2;
|
|
9650
|
+
if (typeof (typedModule == null ? void 0 : typedModule.createDecoderModule) !== "function") {
|
|
9651
|
+
throw new Error("Invalid draco3d decoder module");
|
|
9652
|
+
}
|
|
9653
|
+
return typedModule;
|
|
9654
|
+
}
|
|
9655
|
+
function getLibraryCacheKey2(type, options) {
|
|
9656
|
+
const libraryOverrides = Object.entries(options.modules || {}).filter(([name22]) => name22 !== "draco3d").map(([name22, value]) => `${name22}:${String(value)}`).sort().join("|");
|
|
9657
|
+
return [
|
|
9658
|
+
type,
|
|
9659
|
+
options.useLocalLibraries ? "local" : "remote",
|
|
9660
|
+
options.CDN || "",
|
|
9661
|
+
libraryOverrides
|
|
9662
|
+
].join("|");
|
|
9663
|
+
}
|
|
9664
|
+
var libraryDecoderPromises, injectedDecoderPromises, decoderInitializationQueue;
|
|
9665
|
+
var init_draco_module_loader = __esm({
|
|
9666
|
+
"../scene/src/draco/lib/draco-module-loader.ts"() {
|
|
9667
|
+
"use strict";
|
|
9668
|
+
init_loader_utils();
|
|
9669
|
+
init_draco_library_loader();
|
|
9670
|
+
init_draco_libraries();
|
|
9671
|
+
libraryDecoderPromises = /* @__PURE__ */ new Map();
|
|
9672
|
+
injectedDecoderPromises = /* @__PURE__ */ new WeakMap();
|
|
9673
|
+
decoderInitializationQueue = Promise.resolve();
|
|
9674
|
+
}
|
|
9675
|
+
});
|
|
9676
|
+
|
|
9677
|
+
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
9678
|
+
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
9679
|
+
if (value instanceof Date) {
|
|
9680
|
+
return "date-millisecond";
|
|
9681
|
+
}
|
|
9682
|
+
if (typeof value === "number") {
|
|
9683
|
+
return defaultNumberType;
|
|
9684
|
+
}
|
|
9685
|
+
if (typeof value === "boolean") {
|
|
9686
|
+
return "bool";
|
|
9687
|
+
}
|
|
9688
|
+
if (typeof value === "string") {
|
|
9689
|
+
return "utf8";
|
|
9690
|
+
}
|
|
9691
|
+
if (value === null || value === "undefined") {
|
|
9692
|
+
return "null";
|
|
9693
|
+
}
|
|
9694
|
+
return "null";
|
|
9695
|
+
}
|
|
9696
|
+
function getDataTypeFromArray(array) {
|
|
9697
|
+
let type = getDataTypeFromTypedArray(array);
|
|
9698
|
+
if (type !== "null") {
|
|
9699
|
+
return { type, nullable: false };
|
|
9700
|
+
}
|
|
9701
|
+
if (array.length > 0) {
|
|
9702
|
+
type = getDataTypeFromValue(array[0]);
|
|
9703
|
+
return { type, nullable: true };
|
|
9704
|
+
}
|
|
9705
|
+
return { type: "null", nullable: true };
|
|
9706
|
+
}
|
|
9707
|
+
function getDataTypeFromTypedArray(array) {
|
|
9708
|
+
if (typeof Float16Array !== "undefined" && array instanceof Float16Array) {
|
|
9709
|
+
return "float16";
|
|
9710
|
+
}
|
|
9711
|
+
switch (array.constructor) {
|
|
9712
|
+
case Int8Array:
|
|
9713
|
+
return "int8";
|
|
9714
|
+
case Uint8Array:
|
|
9715
|
+
case Uint8ClampedArray:
|
|
9716
|
+
return "uint8";
|
|
9717
|
+
case Int16Array:
|
|
9718
|
+
return "int16";
|
|
9719
|
+
case Uint16Array:
|
|
9720
|
+
return "uint16";
|
|
9721
|
+
case Int32Array:
|
|
9722
|
+
return "int32";
|
|
9723
|
+
case Uint32Array:
|
|
9724
|
+
return "uint32";
|
|
9725
|
+
case BigInt64Array:
|
|
9726
|
+
return "int64";
|
|
9727
|
+
case BigUint64Array:
|
|
9728
|
+
return "uint64";
|
|
9729
|
+
case Float32Array:
|
|
9730
|
+
return "float32";
|
|
9731
|
+
case Float64Array:
|
|
9732
|
+
return "float64";
|
|
9733
|
+
default:
|
|
9734
|
+
return "null";
|
|
9735
|
+
}
|
|
9736
|
+
}
|
|
9737
|
+
var import_core;
|
|
9738
|
+
var init_data_type = __esm({
|
|
9739
|
+
"../core/src/schema-utils/lib/schema/data-type.ts"() {
|
|
9740
|
+
"use strict";
|
|
9741
|
+
import_core = require("@math.gl/core");
|
|
9742
|
+
}
|
|
9743
|
+
});
|
|
9744
|
+
|
|
9745
|
+
// ../core/src/schema-utils/lib/schema/convert-arrow-schema.ts
|
|
9746
|
+
function serializeArrowSchema(arrowSchema) {
|
|
9747
|
+
return {
|
|
9748
|
+
fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),
|
|
9749
|
+
metadata: serializeArrowMetadata(arrowSchema.metadata)
|
|
9750
|
+
};
|
|
9751
|
+
}
|
|
9752
|
+
function serializeArrowMetadata(arrowMetadata) {
|
|
9753
|
+
return Object.fromEntries(arrowMetadata);
|
|
9754
|
+
}
|
|
9755
|
+
function deserializeArrowMetadata(metadata) {
|
|
9756
|
+
return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
|
|
9757
|
+
}
|
|
9758
|
+
function serializeArrowField(field) {
|
|
9759
|
+
return {
|
|
9760
|
+
name: field.name,
|
|
9761
|
+
type: serializeArrowType(field.type),
|
|
9762
|
+
nullable: field.nullable,
|
|
9763
|
+
metadata: serializeArrowMetadata(field.metadata)
|
|
9764
|
+
};
|
|
9765
|
+
}
|
|
9766
|
+
function deserializeArrowField(field, options) {
|
|
9767
|
+
return new arrow.Field(
|
|
9768
|
+
field.name,
|
|
9769
|
+
deserializeArrowType(field.type, options),
|
|
9770
|
+
field.nullable,
|
|
9771
|
+
deserializeArrowMetadata(field.metadata)
|
|
9772
|
+
);
|
|
9773
|
+
}
|
|
9774
|
+
function serializeArrowType(arrowType) {
|
|
9775
|
+
if (isArrowViewType(arrowType, "BinaryView")) {
|
|
9776
|
+
return "binary-view";
|
|
10098
9777
|
}
|
|
10099
|
-
if (
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
9778
|
+
if (isArrowViewType(arrowType, "Utf8View")) {
|
|
9779
|
+
return "utf8-view";
|
|
9780
|
+
}
|
|
9781
|
+
if (isOptionalArrowType(arrowType, "LargeList")) {
|
|
9782
|
+
const largeListType = arrowType;
|
|
9783
|
+
return {
|
|
9784
|
+
type: "large-list",
|
|
9785
|
+
children: [serializeArrowField(largeListType.valueField)]
|
|
9786
|
+
};
|
|
9787
|
+
}
|
|
9788
|
+
switch (arrowType.constructor) {
|
|
9789
|
+
case arrow.Null:
|
|
9790
|
+
return "null";
|
|
9791
|
+
case arrow.Binary:
|
|
9792
|
+
return "binary";
|
|
9793
|
+
case arrow.FixedSizeBinary:
|
|
9794
|
+
return {
|
|
9795
|
+
type: "fixed-size-binary",
|
|
9796
|
+
byteWidth: arrowType.byteWidth
|
|
9797
|
+
};
|
|
9798
|
+
case arrow.Bool:
|
|
9799
|
+
return "bool";
|
|
9800
|
+
case arrow.Int:
|
|
9801
|
+
const intType = arrowType;
|
|
9802
|
+
return `${intType.isSigned ? "" : "u"}int${intType.bitWidth}`;
|
|
9803
|
+
case arrow.Int8:
|
|
9804
|
+
return "int8";
|
|
9805
|
+
case arrow.Int16:
|
|
9806
|
+
return "int16";
|
|
9807
|
+
case arrow.Int32:
|
|
9808
|
+
return "int32";
|
|
9809
|
+
case arrow.Int64:
|
|
9810
|
+
return "int64";
|
|
9811
|
+
case arrow.Uint8:
|
|
9812
|
+
return "uint8";
|
|
9813
|
+
case arrow.Uint16:
|
|
9814
|
+
return "uint16";
|
|
9815
|
+
case arrow.Uint32:
|
|
9816
|
+
return "uint32";
|
|
9817
|
+
case arrow.Uint64:
|
|
9818
|
+
return "uint64";
|
|
9819
|
+
case arrow.Float:
|
|
9820
|
+
const precision = arrowType.precision;
|
|
9821
|
+
switch (precision) {
|
|
9822
|
+
case arrow.Precision.HALF:
|
|
9823
|
+
return "float16";
|
|
9824
|
+
case arrow.Precision.SINGLE:
|
|
9825
|
+
return "float32";
|
|
9826
|
+
case arrow.Precision.DOUBLE:
|
|
9827
|
+
return "float64";
|
|
9828
|
+
default:
|
|
9829
|
+
return "float16";
|
|
9830
|
+
}
|
|
9831
|
+
case arrow.Float16:
|
|
9832
|
+
return "float16";
|
|
9833
|
+
case arrow.Float32:
|
|
9834
|
+
return "float32";
|
|
9835
|
+
case arrow.Float64:
|
|
9836
|
+
return "float64";
|
|
9837
|
+
case arrow.Utf8:
|
|
9838
|
+
return "utf8";
|
|
9839
|
+
case arrow.Decimal:
|
|
9840
|
+
const decimal = arrowType;
|
|
9841
|
+
return {
|
|
9842
|
+
type: "decimal",
|
|
9843
|
+
bitWidth: decimal.bitWidth,
|
|
9844
|
+
precision: decimal.precision,
|
|
9845
|
+
scale: decimal.scale
|
|
9846
|
+
};
|
|
9847
|
+
case arrow.Date_:
|
|
9848
|
+
const dateUnit = arrowType.unit;
|
|
9849
|
+
return dateUnit === arrow.DateUnit.DAY ? "date-day" : "date-millisecond";
|
|
9850
|
+
case arrow.DateDay:
|
|
9851
|
+
return "date-day";
|
|
9852
|
+
case arrow.DateMillisecond:
|
|
9853
|
+
return "date-millisecond";
|
|
9854
|
+
case arrow.Time:
|
|
9855
|
+
const timeUnit = arrowType.unit;
|
|
9856
|
+
switch (timeUnit) {
|
|
9857
|
+
case arrow.TimeUnit.SECOND:
|
|
9858
|
+
return "time-second";
|
|
9859
|
+
case arrow.TimeUnit.MILLISECOND:
|
|
9860
|
+
return "time-millisecond";
|
|
9861
|
+
case arrow.TimeUnit.MICROSECOND:
|
|
9862
|
+
return "time-microsecond";
|
|
9863
|
+
case arrow.TimeUnit.NANOSECOND:
|
|
9864
|
+
return "time-nanosecond";
|
|
9865
|
+
default:
|
|
9866
|
+
return "time-second";
|
|
9867
|
+
}
|
|
9868
|
+
case arrow.TimeMillisecond:
|
|
9869
|
+
return "time-millisecond";
|
|
9870
|
+
case arrow.TimeSecond:
|
|
9871
|
+
return "time-second";
|
|
9872
|
+
case arrow.TimeMicrosecond:
|
|
9873
|
+
return "time-microsecond";
|
|
9874
|
+
case arrow.TimeNanosecond:
|
|
9875
|
+
return "time-nanosecond";
|
|
9876
|
+
case arrow.Timestamp:
|
|
9877
|
+
const timeStampUnit = arrowType.unit;
|
|
9878
|
+
switch (timeStampUnit) {
|
|
9879
|
+
case arrow.TimeUnit.SECOND:
|
|
9880
|
+
return "timestamp-second";
|
|
9881
|
+
case arrow.TimeUnit.MILLISECOND:
|
|
9882
|
+
return "timestamp-millisecond";
|
|
9883
|
+
case arrow.TimeUnit.MICROSECOND:
|
|
9884
|
+
return "timestamp-microsecond";
|
|
9885
|
+
case arrow.TimeUnit.NANOSECOND:
|
|
9886
|
+
return "timestamp-nanosecond";
|
|
9887
|
+
default:
|
|
9888
|
+
return "timestamp-second";
|
|
9889
|
+
}
|
|
9890
|
+
case arrow.TimestampSecond:
|
|
9891
|
+
return "timestamp-second";
|
|
9892
|
+
case arrow.TimestampMillisecond:
|
|
9893
|
+
return "timestamp-millisecond";
|
|
9894
|
+
case arrow.TimestampMicrosecond:
|
|
9895
|
+
return "timestamp-microsecond";
|
|
9896
|
+
case arrow.TimestampNanosecond:
|
|
9897
|
+
return "timestamp-nanosecond";
|
|
9898
|
+
case arrow.Interval:
|
|
9899
|
+
const intervalUnit = arrowType.unit;
|
|
9900
|
+
switch (intervalUnit) {
|
|
9901
|
+
case arrow.IntervalUnit.DAY_TIME:
|
|
9902
|
+
return "interval-daytime";
|
|
9903
|
+
case arrow.IntervalUnit.YEAR_MONTH:
|
|
9904
|
+
return "interval-yearmonth";
|
|
9905
|
+
default:
|
|
9906
|
+
return "interval-daytime";
|
|
9907
|
+
}
|
|
9908
|
+
case arrow.IntervalDayTime:
|
|
9909
|
+
return "interval-daytime";
|
|
9910
|
+
case arrow.IntervalYearMonth:
|
|
9911
|
+
return "interval-yearmonth";
|
|
9912
|
+
case arrow.Map_:
|
|
9913
|
+
const mapType = arrowType;
|
|
9914
|
+
return {
|
|
9915
|
+
type: "map",
|
|
9916
|
+
keysSorted: mapType.keysSorted,
|
|
9917
|
+
children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
9918
|
+
};
|
|
9919
|
+
case arrow.List:
|
|
9920
|
+
const listType = arrowType;
|
|
9921
|
+
const listField = listType.valueField;
|
|
9922
|
+
return {
|
|
9923
|
+
type: "list",
|
|
9924
|
+
children: [serializeArrowField(listField)]
|
|
9925
|
+
};
|
|
9926
|
+
case arrow.FixedSizeList:
|
|
9927
|
+
const fixedSizeList = arrowType;
|
|
9928
|
+
return {
|
|
9929
|
+
type: "fixed-size-list",
|
|
9930
|
+
listSize: fixedSizeList.listSize,
|
|
9931
|
+
children: [serializeArrowField(fixedSizeList.children[0])]
|
|
9932
|
+
};
|
|
9933
|
+
case arrow.Struct:
|
|
9934
|
+
const structType = arrowType;
|
|
9935
|
+
return {
|
|
9936
|
+
type: "struct",
|
|
9937
|
+
children: structType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
9938
|
+
};
|
|
9939
|
+
case arrow.SparseUnion:
|
|
9940
|
+
case arrow.DenseUnion:
|
|
9941
|
+
const unionType = arrowType;
|
|
9942
|
+
return {
|
|
9943
|
+
type: unionType instanceof arrow.DenseUnion ? "dense-union" : "sparse-union",
|
|
9944
|
+
typeIds: unionType.typeIds,
|
|
9945
|
+
children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
|
|
9946
|
+
typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
|
|
9947
|
+
};
|
|
9948
|
+
case arrow.Dictionary:
|
|
9949
|
+
const dictionaryType = arrowType;
|
|
9950
|
+
return {
|
|
9951
|
+
type: "dictionary",
|
|
9952
|
+
id: dictionaryType.id,
|
|
9953
|
+
indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
|
|
9954
|
+
dictionary: serializeArrowType(dictionaryType.dictionary),
|
|
9955
|
+
isOrdered: dictionaryType.isOrdered
|
|
9956
|
+
};
|
|
9957
|
+
default:
|
|
9958
|
+
throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
|
|
10103
9959
|
}
|
|
10104
|
-
return void 0;
|
|
10105
9960
|
}
|
|
10106
|
-
function
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
9961
|
+
function deserializeArrowType(dataType, options) {
|
|
9962
|
+
if (typeof dataType === "object") {
|
|
9963
|
+
switch (dataType.type) {
|
|
9964
|
+
case "decimal":
|
|
9965
|
+
return new arrow.Decimal(dataType.scale, dataType.precision, dataType.bitWidth);
|
|
9966
|
+
case "map": {
|
|
9967
|
+
const children = dataType.children.map(
|
|
9968
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
9969
|
+
);
|
|
9970
|
+
return new arrow.Map_(children[0], dataType.keysSorted);
|
|
9971
|
+
}
|
|
9972
|
+
case "list": {
|
|
9973
|
+
const field = deserializeArrowField(dataType.children[0], options);
|
|
9974
|
+
return new arrow.List(field);
|
|
9975
|
+
}
|
|
9976
|
+
case "large-list": {
|
|
9977
|
+
const field = deserializeArrowField(dataType.children[0], options);
|
|
9978
|
+
const LargeList = getOptionalArrowConstructor("LargeList");
|
|
9979
|
+
if (!LargeList) {
|
|
9980
|
+
throw new Error(
|
|
9981
|
+
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
9982
|
+
);
|
|
9983
|
+
}
|
|
9984
|
+
return new LargeList(field);
|
|
9985
|
+
}
|
|
9986
|
+
case "fixed-size-list": {
|
|
9987
|
+
const child = deserializeArrowField(dataType.children[0], options);
|
|
9988
|
+
return new arrow.FixedSizeList(dataType.listSize, child);
|
|
9989
|
+
}
|
|
9990
|
+
case "fixed-size-binary":
|
|
9991
|
+
return new arrow.FixedSizeBinary(dataType.byteWidth);
|
|
9992
|
+
case "struct": {
|
|
9993
|
+
const children = dataType.children.map(
|
|
9994
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
9995
|
+
);
|
|
9996
|
+
return new arrow.Struct(children);
|
|
9997
|
+
}
|
|
9998
|
+
case "sparse-union":
|
|
9999
|
+
case "dense-union": {
|
|
10000
|
+
const children = dataType.children.map(
|
|
10001
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
10002
|
+
);
|
|
10003
|
+
return dataType.type === "dense-union" ? new arrow.DenseUnion(dataType.typeIds, children) : new arrow.SparseUnion(dataType.typeIds, children);
|
|
10004
|
+
}
|
|
10005
|
+
case "dictionary": {
|
|
10006
|
+
return new arrow.Dictionary(
|
|
10007
|
+
deserializeArrowType(dataType.dictionary, options),
|
|
10008
|
+
deserializeArrowDictionaryKeyType(dataType.indices),
|
|
10009
|
+
dataType.id,
|
|
10010
|
+
dataType.isOrdered
|
|
10011
|
+
);
|
|
10012
|
+
}
|
|
10013
|
+
default:
|
|
10014
|
+
throw new Error("array type not supported");
|
|
10015
|
+
}
|
|
10111
10016
|
}
|
|
10112
|
-
|
|
10113
|
-
|
|
10017
|
+
switch (dataType) {
|
|
10018
|
+
case "null":
|
|
10019
|
+
return new arrow.Null();
|
|
10020
|
+
case "binary":
|
|
10021
|
+
return makeVariableWidthArrowType("BinaryView", new arrow.Binary(), options);
|
|
10022
|
+
case "binary-view":
|
|
10023
|
+
return makeRequiredArrowViewType("BinaryView");
|
|
10024
|
+
case "bool":
|
|
10025
|
+
return new arrow.Bool();
|
|
10026
|
+
case "int8":
|
|
10027
|
+
return new arrow.Int8();
|
|
10028
|
+
case "int16":
|
|
10029
|
+
return new arrow.Int16();
|
|
10030
|
+
case "int32":
|
|
10031
|
+
return new arrow.Int32();
|
|
10032
|
+
case "int64":
|
|
10033
|
+
return new arrow.Int64();
|
|
10034
|
+
case "uint8":
|
|
10035
|
+
return new arrow.Uint8();
|
|
10036
|
+
case "uint16":
|
|
10037
|
+
return new arrow.Uint16();
|
|
10038
|
+
case "uint32":
|
|
10039
|
+
return new arrow.Uint32();
|
|
10040
|
+
case "uint64":
|
|
10041
|
+
return new arrow.Uint64();
|
|
10042
|
+
case "float16":
|
|
10043
|
+
return new arrow.Float16();
|
|
10044
|
+
case "float32":
|
|
10045
|
+
return new arrow.Float32();
|
|
10046
|
+
case "float64":
|
|
10047
|
+
return new arrow.Float64();
|
|
10048
|
+
case "utf8":
|
|
10049
|
+
return makeVariableWidthArrowType("Utf8View", new arrow.Utf8(), options);
|
|
10050
|
+
case "utf8-view":
|
|
10051
|
+
return makeRequiredArrowViewType("Utf8View");
|
|
10052
|
+
case "date-day":
|
|
10053
|
+
return new arrow.DateDay();
|
|
10054
|
+
case "date-millisecond":
|
|
10055
|
+
return new arrow.DateMillisecond();
|
|
10056
|
+
case "time-second":
|
|
10057
|
+
return new arrow.TimeSecond();
|
|
10058
|
+
case "time-millisecond":
|
|
10059
|
+
return new arrow.TimeMillisecond();
|
|
10060
|
+
case "time-microsecond":
|
|
10061
|
+
return new arrow.TimeMicrosecond();
|
|
10062
|
+
case "time-nanosecond":
|
|
10063
|
+
return new arrow.TimeNanosecond();
|
|
10064
|
+
case "timestamp-second":
|
|
10065
|
+
return new arrow.TimestampSecond();
|
|
10066
|
+
case "timestamp-millisecond":
|
|
10067
|
+
return new arrow.TimestampMillisecond();
|
|
10068
|
+
case "timestamp-microsecond":
|
|
10069
|
+
return new arrow.TimestampMicrosecond();
|
|
10070
|
+
case "timestamp-nanosecond":
|
|
10071
|
+
return new arrow.TimestampNanosecond();
|
|
10072
|
+
case "interval-daytime":
|
|
10073
|
+
return new arrow.IntervalDayTime();
|
|
10074
|
+
case "interval-yearmonth":
|
|
10075
|
+
return new arrow.IntervalYearMonth();
|
|
10076
|
+
default:
|
|
10077
|
+
throw new Error("array type not supported");
|
|
10114
10078
|
}
|
|
10115
|
-
return module2;
|
|
10116
10079
|
}
|
|
10117
|
-
function
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10080
|
+
function getOptionalArrowConstructor(typeName) {
|
|
10081
|
+
return arrow[typeName];
|
|
10082
|
+
}
|
|
10083
|
+
function isArrowViewType(arrowType, viewTypeName) {
|
|
10084
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
10085
|
+
if (constructor && arrowType instanceof constructor) {
|
|
10086
|
+
return true;
|
|
10121
10087
|
}
|
|
10122
|
-
|
|
10088
|
+
const guards = arrow.DataType;
|
|
10089
|
+
const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
|
|
10090
|
+
return Boolean(guard == null ? void 0 : guard(arrowType));
|
|
10123
10091
|
}
|
|
10124
|
-
function
|
|
10125
|
-
const
|
|
10126
|
-
return
|
|
10127
|
-
type,
|
|
10128
|
-
options.useLocalLibraries ? "local" : "remote",
|
|
10129
|
-
options.CDN || "",
|
|
10130
|
-
libraryOverrides
|
|
10131
|
-
].join("|");
|
|
10092
|
+
function isOptionalArrowType(arrowType, typeName) {
|
|
10093
|
+
const constructor = getOptionalArrowConstructor(typeName);
|
|
10094
|
+
return Boolean(constructor && arrowType instanceof constructor);
|
|
10132
10095
|
}
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
"
|
|
10136
|
-
|
|
10137
|
-
init_loader_utils();
|
|
10138
|
-
init_draco_library_loader();
|
|
10139
|
-
init_draco_libraries();
|
|
10140
|
-
libraryDecoderPromises = /* @__PURE__ */ new Map();
|
|
10141
|
-
injectedDecoderPromises = /* @__PURE__ */ new WeakMap();
|
|
10142
|
-
decoderInitializationQueue = Promise.resolve();
|
|
10143
|
-
}
|
|
10144
|
-
});
|
|
10145
|
-
|
|
10146
|
-
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
10147
|
-
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
10148
|
-
if (value instanceof Date) {
|
|
10149
|
-
return "date-millisecond";
|
|
10150
|
-
}
|
|
10151
|
-
if (typeof value === "number") {
|
|
10152
|
-
return defaultNumberType;
|
|
10153
|
-
}
|
|
10154
|
-
if (typeof value === "boolean") {
|
|
10155
|
-
return "bool";
|
|
10096
|
+
function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
|
|
10097
|
+
const viewTypeMode = (options == null ? void 0 : options.viewTypes) || "never";
|
|
10098
|
+
if (viewTypeMode === "never") {
|
|
10099
|
+
return fallbackType;
|
|
10156
10100
|
}
|
|
10157
|
-
|
|
10158
|
-
|
|
10101
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
10102
|
+
if (constructor) {
|
|
10103
|
+
return new constructor();
|
|
10159
10104
|
}
|
|
10160
|
-
if (
|
|
10161
|
-
|
|
10105
|
+
if (viewTypeMode === "require") {
|
|
10106
|
+
throw new Error(
|
|
10107
|
+
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
10108
|
+
);
|
|
10162
10109
|
}
|
|
10163
|
-
return
|
|
10110
|
+
return fallbackType;
|
|
10164
10111
|
}
|
|
10165
|
-
function
|
|
10166
|
-
|
|
10167
|
-
if (
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
type = getDataTypeFromValue(array[0]);
|
|
10172
|
-
return { type, nullable: true };
|
|
10112
|
+
function makeRequiredArrowViewType(viewTypeName) {
|
|
10113
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
10114
|
+
if (!constructor) {
|
|
10115
|
+
throw new Error(
|
|
10116
|
+
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
10117
|
+
);
|
|
10173
10118
|
}
|
|
10174
|
-
return
|
|
10119
|
+
return new constructor();
|
|
10175
10120
|
}
|
|
10176
|
-
function
|
|
10177
|
-
if (
|
|
10178
|
-
|
|
10121
|
+
function serializeArrowDictionaryKeyType(arrowType) {
|
|
10122
|
+
if (arrowType instanceof arrow.Int) {
|
|
10123
|
+
const prefix = arrowType.isSigned ? "int" : "uint";
|
|
10124
|
+
const keyType = `${prefix}${arrowType.bitWidth}`;
|
|
10125
|
+
if (isSchemaDictionaryKeyType(keyType)) {
|
|
10126
|
+
return keyType;
|
|
10127
|
+
}
|
|
10179
10128
|
}
|
|
10180
|
-
switch (
|
|
10181
|
-
case
|
|
10129
|
+
switch (arrowType.constructor) {
|
|
10130
|
+
case arrow.Int8:
|
|
10182
10131
|
return "int8";
|
|
10183
|
-
case
|
|
10184
|
-
case Uint8ClampedArray:
|
|
10185
|
-
return "uint8";
|
|
10186
|
-
case Int16Array:
|
|
10132
|
+
case arrow.Int16:
|
|
10187
10133
|
return "int16";
|
|
10188
|
-
case
|
|
10189
|
-
return "uint16";
|
|
10190
|
-
case Int32Array:
|
|
10134
|
+
case arrow.Int32:
|
|
10191
10135
|
return "int32";
|
|
10192
|
-
case
|
|
10136
|
+
case arrow.Uint8:
|
|
10137
|
+
return "uint8";
|
|
10138
|
+
case arrow.Uint16:
|
|
10139
|
+
return "uint16";
|
|
10140
|
+
case arrow.Uint32:
|
|
10193
10141
|
return "uint32";
|
|
10194
|
-
case BigInt64Array:
|
|
10195
|
-
return "int64";
|
|
10196
|
-
case BigUint64Array:
|
|
10197
|
-
return "uint64";
|
|
10198
|
-
case Float32Array:
|
|
10199
|
-
return "float32";
|
|
10200
|
-
case Float64Array:
|
|
10201
|
-
return "float64";
|
|
10202
10142
|
default:
|
|
10203
|
-
|
|
10143
|
+
throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
|
|
10204
10144
|
}
|
|
10205
10145
|
}
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10146
|
+
function isSchemaDictionaryKeyType(keyType) {
|
|
10147
|
+
return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
|
|
10148
|
+
}
|
|
10149
|
+
function deserializeArrowDictionaryKeyType(keyType) {
|
|
10150
|
+
switch (keyType) {
|
|
10151
|
+
case "int8":
|
|
10152
|
+
return new arrow.Int8();
|
|
10153
|
+
case "int16":
|
|
10154
|
+
return new arrow.Int16();
|
|
10155
|
+
case "int32":
|
|
10156
|
+
return new arrow.Int32();
|
|
10157
|
+
case "uint8":
|
|
10158
|
+
return new arrow.Uint8();
|
|
10159
|
+
case "uint16":
|
|
10160
|
+
return new arrow.Uint16();
|
|
10161
|
+
case "uint32":
|
|
10162
|
+
return new arrow.Uint32();
|
|
10163
|
+
default:
|
|
10164
|
+
throw new Error(`schema dictionary index type not supported: ${keyType}`);
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
var arrow;
|
|
10168
|
+
var init_convert_arrow_schema = __esm({
|
|
10169
|
+
"../core/src/schema-utils/lib/schema/convert-arrow-schema.ts"() {
|
|
10209
10170
|
"use strict";
|
|
10210
|
-
|
|
10171
|
+
arrow = __toESM(require("apache-arrow"), 1);
|
|
10211
10172
|
}
|
|
10212
10173
|
});
|
|
10213
10174
|
|
|
@@ -10307,23 +10268,23 @@ var init_float16 = __esm({
|
|
|
10307
10268
|
});
|
|
10308
10269
|
|
|
10309
10270
|
// ../core/src/schema/categories/category-mesh.ts
|
|
10310
|
-
var
|
|
10271
|
+
var arrow2, meshArrowSchema, indexedMeshArrowSchema;
|
|
10311
10272
|
var init_category_mesh = __esm({
|
|
10312
10273
|
"../core/src/schema/categories/category-mesh.ts"() {
|
|
10313
10274
|
"use strict";
|
|
10314
|
-
|
|
10315
|
-
meshArrowSchema = new
|
|
10316
|
-
new
|
|
10275
|
+
arrow2 = __toESM(require("apache-arrow"), 1);
|
|
10276
|
+
meshArrowSchema = new arrow2.Schema([
|
|
10277
|
+
new arrow2.Field(
|
|
10317
10278
|
"POSITION",
|
|
10318
|
-
new
|
|
10279
|
+
new arrow2.FixedSizeList(3, new arrow2.Field("value", new arrow2.Float32(), false)),
|
|
10319
10280
|
false
|
|
10320
10281
|
)
|
|
10321
10282
|
]);
|
|
10322
|
-
indexedMeshArrowSchema = new
|
|
10283
|
+
indexedMeshArrowSchema = new arrow2.Schema([
|
|
10323
10284
|
...meshArrowSchema.fields,
|
|
10324
|
-
new
|
|
10285
|
+
new arrow2.Field(
|
|
10325
10286
|
"indices",
|
|
10326
|
-
new
|
|
10287
|
+
new arrow2.List(new arrow2.Field("item", new arrow2.Uint32(), false)),
|
|
10327
10288
|
true
|
|
10328
10289
|
)
|
|
10329
10290
|
]);
|
|
@@ -10342,7 +10303,7 @@ var init_schema = __esm({
|
|
|
10342
10303
|
// ../core/src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts
|
|
10343
10304
|
function getFixedSizeListVector(typedArray, stride, logicalType) {
|
|
10344
10305
|
const data = getFixedSizeListData(typedArray, stride, logicalType);
|
|
10345
|
-
return new
|
|
10306
|
+
return new arrow3.Vector([data]);
|
|
10346
10307
|
}
|
|
10347
10308
|
function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
10348
10309
|
const listType = getFixedSizeListType(typedArray, stride, logicalType);
|
|
@@ -10350,13 +10311,13 @@ function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
|
10350
10311
|
const storage = logicalType === "float16" && isNativeFloat16Array(typedArray) ? getFloat16Storage(typedArray) : typedArray;
|
|
10351
10312
|
const buffers = {
|
|
10352
10313
|
// valueOffsets: undefined,
|
|
10353
|
-
[
|
|
10314
|
+
[arrow3.BufferType.DATA]: storage
|
|
10354
10315
|
// values
|
|
10355
10316
|
// nullBitmap: undefined,
|
|
10356
10317
|
// typeIds: undefined
|
|
10357
10318
|
};
|
|
10358
|
-
const nestedData = new
|
|
10359
|
-
const data = new
|
|
10319
|
+
const nestedData = new arrow3.Data(nestedType, 0, storage.length, 0, buffers);
|
|
10320
|
+
const data = new arrow3.Data(
|
|
10360
10321
|
listType,
|
|
10361
10322
|
0,
|
|
10362
10323
|
storage.length / stride,
|
|
@@ -10369,15 +10330,15 @@ function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
|
10369
10330
|
function getFixedSizeListType(typedArray, stride, logicalType) {
|
|
10370
10331
|
const type = logicalType || getDataTypeFromArray(typedArray).type;
|
|
10371
10332
|
const arrowType = deserializeArrowType(type);
|
|
10372
|
-
const listType = new
|
|
10333
|
+
const listType = new arrow3.FixedSizeList(stride, new arrow3.Field("value", arrowType, false));
|
|
10373
10334
|
return listType;
|
|
10374
10335
|
}
|
|
10375
|
-
var
|
|
10336
|
+
var arrow3;
|
|
10376
10337
|
var init_arrow_fixed_size_list_utils = __esm({
|
|
10377
10338
|
"../core/src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts"() {
|
|
10378
10339
|
"use strict";
|
|
10379
10340
|
init_schema();
|
|
10380
|
-
|
|
10341
|
+
arrow3 = __toESM(require("apache-arrow"), 1);
|
|
10381
10342
|
init_data_type();
|
|
10382
10343
|
init_convert_arrow_schema();
|
|
10383
10344
|
}
|
|
@@ -10437,8 +10398,8 @@ function makeMeshArrowTable(attributes, options = {}) {
|
|
|
10437
10398
|
fields.push(indicesField);
|
|
10438
10399
|
}
|
|
10439
10400
|
}
|
|
10440
|
-
const arrowSchema = new
|
|
10441
|
-
const table = ((_c = columns[attributeNames[0]]) == null ? void 0 : _c.length) === 0 ? new
|
|
10401
|
+
const arrowSchema = new arrow4.Schema(fields, getMeshArrowMetadata(options));
|
|
10402
|
+
const table = ((_c = columns[attributeNames[0]]) == null ? void 0 : _c.length) === 0 ? new arrow4.Table(arrowSchema) : new arrow4.Table(arrowSchema, columns);
|
|
10442
10403
|
const schema = serializeArrowSchema(table.schema);
|
|
10443
10404
|
return {
|
|
10444
10405
|
shape: "arrow-table",
|
|
@@ -10452,14 +10413,14 @@ function getAttributeArrowVector(value, size, componentType) {
|
|
|
10452
10413
|
if (componentType === "float16") {
|
|
10453
10414
|
const storage = isNativeFloat16Array(value) ? getFloat16Storage(value) : value;
|
|
10454
10415
|
if (size === 1) {
|
|
10455
|
-
const data = new
|
|
10456
|
-
[
|
|
10416
|
+
const data = new arrow4.Data(new arrow4.Float16(), 0, storage.length, 0, {
|
|
10417
|
+
[arrow4.BufferType.DATA]: storage
|
|
10457
10418
|
});
|
|
10458
|
-
return new
|
|
10419
|
+
return new arrow4.Vector([data]);
|
|
10459
10420
|
}
|
|
10460
10421
|
return getFixedSizeListVector(value, size, componentType);
|
|
10461
10422
|
}
|
|
10462
|
-
return size === 1 ?
|
|
10423
|
+
return size === 1 ? arrow4.makeVector(value) : getFixedSizeListVector(value, size);
|
|
10463
10424
|
}
|
|
10464
10425
|
function getOrderedAttributeNames(attributes) {
|
|
10465
10426
|
const attributeNames = Object.keys(attributes);
|
|
@@ -10486,7 +10447,7 @@ function getAttributeArrowField(schema, attributeName, column, componentType) {
|
|
|
10486
10447
|
for (const [key, value] of Object.entries(suppliedField.metadata)) {
|
|
10487
10448
|
metadata.set(key, value);
|
|
10488
10449
|
}
|
|
10489
|
-
return new
|
|
10450
|
+
return new arrow4.Field(
|
|
10490
10451
|
canonicalField.name,
|
|
10491
10452
|
canonicalField.type,
|
|
10492
10453
|
canonicalField.nullable,
|
|
@@ -10497,21 +10458,21 @@ function getAttributeArrowField(schema, attributeName, column, componentType) {
|
|
|
10497
10458
|
if (componentType === "float16") {
|
|
10498
10459
|
const metadata = new Map(Object.entries((field == null ? void 0 : field.metadata) || {}));
|
|
10499
10460
|
metadata.set("componentType", "float16");
|
|
10500
|
-
return new
|
|
10461
|
+
return new arrow4.Field(attributeName, column.type, false, metadata);
|
|
10501
10462
|
}
|
|
10502
10463
|
if (field && field.type.toString() !== column.type.toString()) {
|
|
10503
10464
|
const deserializedField = deserializeArrowField(field);
|
|
10504
|
-
return new
|
|
10465
|
+
return new arrow4.Field(
|
|
10505
10466
|
attributeName,
|
|
10506
10467
|
column.type,
|
|
10507
10468
|
deserializedField.nullable,
|
|
10508
10469
|
deserializedField.metadata
|
|
10509
10470
|
);
|
|
10510
10471
|
}
|
|
10511
|
-
return field ? deserializeArrowField(field) : new
|
|
10472
|
+
return field ? deserializeArrowField(field) : new arrow4.Field(attributeName, column.type, false);
|
|
10512
10473
|
}
|
|
10513
10474
|
function isMeshPositionColumn(column) {
|
|
10514
|
-
return column.type instanceof
|
|
10475
|
+
return column.type instanceof arrow4.FixedSizeList && column.type.listSize === 3 && column.type.children[0].type instanceof arrow4.Float32;
|
|
10515
10476
|
}
|
|
10516
10477
|
function getIndicesVector(indices, vertexCount, type) {
|
|
10517
10478
|
const indicesType = type;
|
|
@@ -10524,25 +10485,25 @@ function getIndicesVector(indices, vertexCount, type) {
|
|
|
10524
10485
|
if (vertexCount > 0) {
|
|
10525
10486
|
nullBitmap[0] = 1;
|
|
10526
10487
|
}
|
|
10527
|
-
const valuesData = new
|
|
10488
|
+
const valuesData = new arrow4.Data(
|
|
10528
10489
|
indicesType.children[0].type,
|
|
10529
10490
|
0,
|
|
10530
10491
|
values.length,
|
|
10531
10492
|
0,
|
|
10532
|
-
{ [
|
|
10493
|
+
{ [arrow4.BufferType.DATA]: values }
|
|
10533
10494
|
);
|
|
10534
|
-
const indicesData = new
|
|
10495
|
+
const indicesData = new arrow4.Data(
|
|
10535
10496
|
indicesType,
|
|
10536
10497
|
0,
|
|
10537
10498
|
vertexCount,
|
|
10538
10499
|
Math.max(0, vertexCount - 1),
|
|
10539
10500
|
{
|
|
10540
|
-
[
|
|
10541
|
-
[
|
|
10501
|
+
[arrow4.BufferType.OFFSET]: valueOffsets,
|
|
10502
|
+
[arrow4.BufferType.VALIDITY]: nullBitmap
|
|
10542
10503
|
},
|
|
10543
10504
|
[valuesData]
|
|
10544
10505
|
);
|
|
10545
|
-
return new
|
|
10506
|
+
return new arrow4.Vector([indicesData]);
|
|
10546
10507
|
}
|
|
10547
10508
|
function getMeshArrowMetadata(options) {
|
|
10548
10509
|
var _a;
|
|
@@ -10558,13 +10519,13 @@ function getMeshArrowMetadata(options) {
|
|
|
10558
10519
|
}
|
|
10559
10520
|
return deserializeArrowMetadata(metadata);
|
|
10560
10521
|
}
|
|
10561
|
-
var
|
|
10522
|
+
var arrow4, MESH_ARROW_ATTRIBUTE_ORDER;
|
|
10562
10523
|
var init_convert_mesh_to_table = __esm({
|
|
10563
10524
|
"../core/src/schema-utils/lib/mesh/convert-mesh-to-table.ts"() {
|
|
10564
10525
|
"use strict";
|
|
10565
10526
|
init_schema();
|
|
10566
10527
|
init_schema();
|
|
10567
|
-
|
|
10528
|
+
arrow4 = __toESM(require("apache-arrow"), 1);
|
|
10568
10529
|
init_arrow_fixed_size_list_utils();
|
|
10569
10530
|
init_convert_arrow_schema();
|
|
10570
10531
|
MESH_ARROW_ATTRIBUTE_ORDER = ["POSITION"];
|
|
@@ -10572,12 +10533,12 @@ var init_convert_mesh_to_table = __esm({
|
|
|
10572
10533
|
});
|
|
10573
10534
|
|
|
10574
10535
|
// ../core/src/schema-utils/lib/mesh/deduce-mesh-schema.ts
|
|
10575
|
-
function deduceMeshField(
|
|
10536
|
+
function deduceMeshField(name22, attribute, optionalMetadata) {
|
|
10576
10537
|
const type = attribute.componentType || getDataTypeFromTypedArray(attribute.value);
|
|
10577
10538
|
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
10578
10539
|
const dataType = attribute.size === 1 ? type : { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] };
|
|
10579
10540
|
return {
|
|
10580
|
-
name:
|
|
10541
|
+
name: name22,
|
|
10581
10542
|
type: dataType,
|
|
10582
10543
|
nullable: false,
|
|
10583
10544
|
metadata
|
|
@@ -11428,7 +11389,7 @@ var DracoLoader;
|
|
|
11428
11389
|
var init_draco_loader_types = __esm({
|
|
11429
11390
|
"../scene/src/draco/draco-loader-types.ts"() {
|
|
11430
11391
|
"use strict";
|
|
11431
|
-
|
|
11392
|
+
init_arrow_worker_transport();
|
|
11432
11393
|
init_version4();
|
|
11433
11394
|
init_draco_format();
|
|
11434
11395
|
init_draco_loader_options();
|
|
@@ -11462,11 +11423,11 @@ var init_draco_loader_types2 = __esm({
|
|
|
11462
11423
|
// ../scene/src/gltf/lib/gltf-utils/gltf-attribute-utils.ts
|
|
11463
11424
|
function getGLTFAccessors(attributes) {
|
|
11464
11425
|
const accessors = {};
|
|
11465
|
-
for (const
|
|
11466
|
-
const attribute = attributes[
|
|
11467
|
-
if (
|
|
11426
|
+
for (const name22 in attributes) {
|
|
11427
|
+
const attribute = attributes[name22];
|
|
11428
|
+
if (name22 !== "indices") {
|
|
11468
11429
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
11469
|
-
accessors[
|
|
11430
|
+
accessors[name22] = glTFAccessor;
|
|
11470
11431
|
}
|
|
11471
11432
|
}
|
|
11472
11433
|
return accessors;
|
|
@@ -11527,11 +11488,11 @@ var init_gltf_attribute_utils = __esm({
|
|
|
11527
11488
|
// ../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts
|
|
11528
11489
|
var KHR_draco_mesh_compression_exports = {};
|
|
11529
11490
|
__export(KHR_draco_mesh_compression_exports, {
|
|
11530
|
-
decode: () =>
|
|
11531
|
-
name: () =>
|
|
11532
|
-
preprocess: () =>
|
|
11491
|
+
decode: () => decode13,
|
|
11492
|
+
name: () => name17,
|
|
11493
|
+
preprocess: () => preprocess6
|
|
11533
11494
|
});
|
|
11534
|
-
function
|
|
11495
|
+
function preprocess6(gltfData, options, context) {
|
|
11535
11496
|
const iterator = new GLTFIterator(gltfData);
|
|
11536
11497
|
for (const mesh of iterator.meshes) {
|
|
11537
11498
|
for (const primitive of iterator.getReferences(mesh).primitives) {
|
|
@@ -11540,7 +11501,7 @@ function preprocess4(gltfData, options, context) {
|
|
|
11540
11501
|
}
|
|
11541
11502
|
}
|
|
11542
11503
|
}
|
|
11543
|
-
async function
|
|
11504
|
+
async function decode13(gltfData, options, context) {
|
|
11544
11505
|
var _a;
|
|
11545
11506
|
if (!((_a = options == null ? void 0 : options.gltf) == null ? void 0 : _a.decompressMeshes)) {
|
|
11546
11507
|
return;
|
|
@@ -11623,7 +11584,7 @@ function checkPrimitive(primitive) {
|
|
|
11623
11584
|
throw new Error("glTF: Empty primitive detected: Draco decompression failure?");
|
|
11624
11585
|
}
|
|
11625
11586
|
}
|
|
11626
|
-
var KHR_DRACO_MESH_COMPRESSION,
|
|
11587
|
+
var KHR_DRACO_MESH_COMPRESSION, name17;
|
|
11627
11588
|
var init_KHR_draco_mesh_compression = __esm({
|
|
11628
11589
|
"../scene/src/gltf/lib/extensions/KHR_draco_mesh_compression.ts"() {
|
|
11629
11590
|
"use strict";
|
|
@@ -11633,17 +11594,17 @@ var init_KHR_draco_mesh_compression = __esm({
|
|
|
11633
11594
|
init_gltf_attribute_utils();
|
|
11634
11595
|
init_get_typed_array();
|
|
11635
11596
|
KHR_DRACO_MESH_COMPRESSION = "KHR_draco_mesh_compression";
|
|
11636
|
-
|
|
11597
|
+
name17 = KHR_DRACO_MESH_COMPRESSION;
|
|
11637
11598
|
}
|
|
11638
11599
|
});
|
|
11639
11600
|
|
|
11640
11601
|
// ../scene/src/gltf/lib/extensions/KHR_texture_transform.ts
|
|
11641
11602
|
var KHR_texture_transform_exports = {};
|
|
11642
11603
|
__export(KHR_texture_transform_exports, {
|
|
11643
|
-
decode: () =>
|
|
11644
|
-
name: () =>
|
|
11604
|
+
decode: () => decode14,
|
|
11605
|
+
name: () => name18
|
|
11645
11606
|
});
|
|
11646
|
-
async function
|
|
11607
|
+
async function decode14(gltfData, options) {
|
|
11647
11608
|
var _a;
|
|
11648
11609
|
const iterator = new GLTFIterator(gltfData);
|
|
11649
11610
|
const hasExtension = iterator.hasExtension(KHR_TEXTURE_TRANSFORM);
|
|
@@ -11864,7 +11825,7 @@ function makeTransformationMatrix(extensionData) {
|
|
|
11864
11825
|
const scaleMatrix = scratchScaleMatrix.set(scale[0], 0, 0, 0, scale[1], 0, 0, 0, 1);
|
|
11865
11826
|
return translationMatrix.multiplyRight(rotationMatrix).multiplyRight(scaleMatrix);
|
|
11866
11827
|
}
|
|
11867
|
-
var import_core3, KHR_TEXTURE_TRANSFORM,
|
|
11828
|
+
var import_core3, KHR_TEXTURE_TRANSFORM, name18, scratchVector, scratchRotationMatrix, scratchScaleMatrix;
|
|
11868
11829
|
var init_KHR_texture_transform = __esm({
|
|
11869
11830
|
"../scene/src/gltf/lib/extensions/KHR_texture_transform.ts"() {
|
|
11870
11831
|
"use strict";
|
|
@@ -11874,7 +11835,7 @@ var init_KHR_texture_transform = __esm({
|
|
|
11874
11835
|
init_gltf_iterator();
|
|
11875
11836
|
init_loader_utils();
|
|
11876
11837
|
KHR_TEXTURE_TRANSFORM = "KHR_texture_transform";
|
|
11877
|
-
|
|
11838
|
+
name18 = KHR_TEXTURE_TRANSFORM;
|
|
11878
11839
|
scratchVector = new import_core3.Vector3();
|
|
11879
11840
|
scratchRotationMatrix = new import_core3.Matrix3();
|
|
11880
11841
|
scratchScaleMatrix = new import_core3.Matrix3();
|
|
@@ -11884,11 +11845,11 @@ var init_KHR_texture_transform = __esm({
|
|
|
11884
11845
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
11885
11846
|
var KHR_lights_punctual_exports = {};
|
|
11886
11847
|
__export(KHR_lights_punctual_exports, {
|
|
11887
|
-
decode: () =>
|
|
11848
|
+
decode: () => decode15,
|
|
11888
11849
|
encode: () => encode3,
|
|
11889
|
-
name: () =>
|
|
11850
|
+
name: () => name19
|
|
11890
11851
|
});
|
|
11891
|
-
async function
|
|
11852
|
+
async function decode15(gltfData) {
|
|
11892
11853
|
const iterator = new GLTFIterator(gltfData);
|
|
11893
11854
|
const extension = iterator.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
11894
11855
|
if (extension) {
|
|
@@ -11920,7 +11881,7 @@ async function encode3(gltfData) {
|
|
|
11920
11881
|
delete gltfScenegraph.json.lights;
|
|
11921
11882
|
}
|
|
11922
11883
|
}
|
|
11923
|
-
var KHR_LIGHTS_PUNCTUAL,
|
|
11884
|
+
var KHR_LIGHTS_PUNCTUAL, name19;
|
|
11924
11885
|
var init_KHR_lights_punctual = __esm({
|
|
11925
11886
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_lights_punctual.ts"() {
|
|
11926
11887
|
"use strict";
|
|
@@ -11928,18 +11889,18 @@ var init_KHR_lights_punctual = __esm({
|
|
|
11928
11889
|
init_gltf_iterator();
|
|
11929
11890
|
init_gltf_scenegraph();
|
|
11930
11891
|
KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
11931
|
-
|
|
11892
|
+
name19 = KHR_LIGHTS_PUNCTUAL;
|
|
11932
11893
|
}
|
|
11933
11894
|
});
|
|
11934
11895
|
|
|
11935
11896
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
11936
11897
|
var KHR_materials_unlit_exports = {};
|
|
11937
11898
|
__export(KHR_materials_unlit_exports, {
|
|
11938
|
-
decode: () =>
|
|
11899
|
+
decode: () => decode16,
|
|
11939
11900
|
encode: () => encode4,
|
|
11940
|
-
name: () =>
|
|
11901
|
+
name: () => name20
|
|
11941
11902
|
});
|
|
11942
|
-
async function
|
|
11903
|
+
async function decode16(gltfData) {
|
|
11943
11904
|
const iterator = new GLTFIterator(gltfData);
|
|
11944
11905
|
for (const material of iterator.materials) {
|
|
11945
11906
|
const extension = iterator.getExtension(material, KHR_MATERIALS_UNLIT);
|
|
@@ -11964,25 +11925,25 @@ function encode4(gltfData) {
|
|
|
11964
11925
|
for (const field of ["extensionsUsed", "extensionsRequired"])
|
|
11965
11926
|
if (((_a = gltfData.json[field]) == null ? void 0 : _a.length) === 0) delete gltfData.json[field];
|
|
11966
11927
|
}
|
|
11967
|
-
var KHR_MATERIALS_UNLIT,
|
|
11928
|
+
var KHR_MATERIALS_UNLIT, name20;
|
|
11968
11929
|
var init_KHR_materials_unlit = __esm({
|
|
11969
11930
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_materials_unlit.ts"() {
|
|
11970
11931
|
"use strict";
|
|
11971
11932
|
init_gltf_iterator();
|
|
11972
11933
|
init_gltf_scenegraph();
|
|
11973
11934
|
KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
11974
|
-
|
|
11935
|
+
name20 = KHR_MATERIALS_UNLIT;
|
|
11975
11936
|
}
|
|
11976
11937
|
});
|
|
11977
11938
|
|
|
11978
11939
|
// ../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
11979
11940
|
var KHR_techniques_webgl_exports = {};
|
|
11980
11941
|
__export(KHR_techniques_webgl_exports, {
|
|
11981
|
-
decode: () =>
|
|
11942
|
+
decode: () => decode17,
|
|
11982
11943
|
encode: () => encode5,
|
|
11983
|
-
name: () =>
|
|
11944
|
+
name: () => name21
|
|
11984
11945
|
});
|
|
11985
|
-
async function
|
|
11946
|
+
async function decode17(gltfData) {
|
|
11986
11947
|
const iterator = new GLTFIterator(gltfData);
|
|
11987
11948
|
const extension = iterator.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
11988
11949
|
if (extension) {
|
|
@@ -12043,14 +12004,14 @@ function resolveValues(technique, iterator) {
|
|
|
12043
12004
|
});
|
|
12044
12005
|
return values;
|
|
12045
12006
|
}
|
|
12046
|
-
var KHR_TECHNIQUES_WEBGL,
|
|
12007
|
+
var KHR_TECHNIQUES_WEBGL, name21;
|
|
12047
12008
|
var init_KHR_techniques_webgl = __esm({
|
|
12048
12009
|
"../scene/src/gltf/lib/extensions/deprecated/KHR_techniques_webgl.ts"() {
|
|
12049
12010
|
"use strict";
|
|
12050
12011
|
init_gltf_iterator();
|
|
12051
12012
|
init_get_typed_array();
|
|
12052
12013
|
KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
12053
|
-
|
|
12014
|
+
name21 = KHR_TECHNIQUES_WEBGL;
|
|
12054
12015
|
}
|
|
12055
12016
|
});
|
|
12056
12017
|
|
|
@@ -12080,6 +12041,7 @@ var EXTENSIONS;
|
|
|
12080
12041
|
var init_gltf_extensions = __esm({
|
|
12081
12042
|
"../scene/src/gltf/lib/api/gltf-extensions.ts"() {
|
|
12082
12043
|
"use strict";
|
|
12044
|
+
init_KHR_accessor_float64();
|
|
12083
12045
|
init_EXT_mesh_features();
|
|
12084
12046
|
init_EXT_structural_metadata();
|
|
12085
12047
|
init_KHR_gaussian_splatting();
|
|
@@ -12091,6 +12053,7 @@ var init_gltf_extensions = __esm({
|
|
|
12091
12053
|
init_KHR_meshopt_compression();
|
|
12092
12054
|
init_EXT_texture_webp();
|
|
12093
12055
|
init_EXT_texture_avif();
|
|
12056
|
+
init_MSFT_texture_dds();
|
|
12094
12057
|
init_KHR_texture_basisu();
|
|
12095
12058
|
init_KHR_draco_mesh_compression();
|
|
12096
12059
|
init_KHR_texture_transform();
|
|
@@ -12100,6 +12063,7 @@ var init_gltf_extensions = __esm({
|
|
|
12100
12063
|
init_KHR_techniques_webgl();
|
|
12101
12064
|
init_EXT_feature_metadata();
|
|
12102
12065
|
EXTENSIONS = [
|
|
12066
|
+
KHR_accessor_float64_exports,
|
|
12103
12067
|
// 1.0
|
|
12104
12068
|
// KHR_binary_gltf is handled separately - must be processed before other parsing starts
|
|
12105
12069
|
// KHR_binary_gltf,
|
|
@@ -12118,9 +12082,11 @@ var init_gltf_extensions = __esm({
|
|
|
12118
12082
|
EXT_mesh_polygon_exports,
|
|
12119
12083
|
MPEG_audio_spatial_exports,
|
|
12120
12084
|
KHR_audio_emitter_exports,
|
|
12121
|
-
EXT_texture_avif_exports,
|
|
12122
12085
|
EXT_texture_webp_exports,
|
|
12123
|
-
|
|
12086
|
+
EXT_texture_avif_exports,
|
|
12087
|
+
// Compressed textures take precedence over browser image formats when available.
|
|
12088
|
+
MSFT_texture_dds_exports,
|
|
12089
|
+
// BasisU remains preferred when both compressed alternatives are provided.
|
|
12124
12090
|
KHR_texture_basisu_exports,
|
|
12125
12091
|
KHR_lights_punctual_exports,
|
|
12126
12092
|
KHR_materials_unlit_exports,
|
|
@@ -12132,7 +12098,7 @@ var init_gltf_extensions = __esm({
|
|
|
12132
12098
|
});
|
|
12133
12099
|
|
|
12134
12100
|
// ../scene/src/gltf/lib/extensions/KHR_binary_gltf.ts
|
|
12135
|
-
function
|
|
12101
|
+
function preprocess7(gltfData) {
|
|
12136
12102
|
const iterator = new GLTFIterator(gltfData);
|
|
12137
12103
|
for (const image of iterator.images) {
|
|
12138
12104
|
const extension = iterator.getExtension(image, KHR_BINARY_GLTF);
|
|
@@ -12274,7 +12240,7 @@ function convertGLTFV1Skins(json, resolveNodeId, reportUnsupported) {
|
|
|
12274
12240
|
for (let skinIndex = 0; skinIndex < originalSkinCount; skinIndex++) {
|
|
12275
12241
|
const skin = skins[skinIndex];
|
|
12276
12242
|
const jointNames = skin.jointNames;
|
|
12277
|
-
if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((
|
|
12243
|
+
if (!Array.isArray(jointNames) || jointNames.length === 0 || jointNames.some((name22) => typeof name22 !== "string" || !name22) || new Set(jointNames).size !== jointNames.length) {
|
|
12278
12244
|
reportUnsupported(`skin ${skinIndex} has invalid joint names`);
|
|
12279
12245
|
hasUnconvertedSkin = true;
|
|
12280
12246
|
continue;
|
|
@@ -12858,7 +12824,7 @@ function hasOpaqueGLTFV1Consumers(json) {
|
|
|
12858
12824
|
for (const [field, value] of Object.entries(object)) {
|
|
12859
12825
|
if (field === "extras") continue;
|
|
12860
12826
|
if (field === "extensions" && value && typeof value === "object" && Object.keys(value).some(
|
|
12861
|
-
(
|
|
12827
|
+
(name22) => !["KHR_materials_unlit", "KHR_materials_common"].includes(name22)
|
|
12862
12828
|
))
|
|
12863
12829
|
return true;
|
|
12864
12830
|
pending.push(value);
|
|
@@ -12998,18 +12964,18 @@ function preserveLegacyFields(object, fields) {
|
|
|
12998
12964
|
function isRecord(value) {
|
|
12999
12965
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
13000
12966
|
}
|
|
13001
|
-
function convertGLTFV1AttributeName(
|
|
13002
|
-
const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(
|
|
12967
|
+
function convertGLTFV1AttributeName(name22) {
|
|
12968
|
+
const indexed = /^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(name22);
|
|
13003
12969
|
if (indexed) {
|
|
13004
12970
|
const semantic = indexed[1].startsWith("JOINT") ? "JOINTS" : indexed[1].startsWith("WEIGHT") ? "WEIGHTS" : indexed[1];
|
|
13005
12971
|
const index = Number(indexed[2] || 0);
|
|
13006
12972
|
if (!Number.isSafeInteger(index) || index > 999999999)
|
|
13007
|
-
throw new Error(`glTF v1: invalid attribute set index ${
|
|
12973
|
+
throw new Error(`glTF v1: invalid attribute set index ${name22}`);
|
|
13008
12974
|
return `${semantic}_${index}`;
|
|
13009
12975
|
}
|
|
13010
|
-
if (["POSITION", "NORMAL", "TANGENT"].includes(
|
|
13011
|
-
return
|
|
13012
|
-
return `_${
|
|
12976
|
+
if (["POSITION", "NORMAL", "TANGENT"].includes(name22) || name22.startsWith("_") || name22.includes(":"))
|
|
12977
|
+
return name22;
|
|
12978
|
+
return `_${name22}`;
|
|
13013
12979
|
}
|
|
13014
12980
|
var init_clean_gltf_v1_fields = __esm({
|
|
13015
12981
|
"../scene/src/gltf/lib/api/clean-gltf-v1-fields.ts"() {
|
|
@@ -13435,8 +13401,8 @@ function validateSkinInfluences(gltf, readAccessor, reportUnsupported) {
|
|
|
13435
13401
|
checkedBindings.add(binding);
|
|
13436
13402
|
for (const [primitiveIndex, primitive] of mesh.primitives.entries()) {
|
|
13437
13403
|
const label = `mesh ${node.mesh} primitive ${primitiveIndex} skin ${node.skin}`;
|
|
13438
|
-
const jointSets = Object.keys(primitive.attributes).filter((
|
|
13439
|
-
const weightSets = Object.keys(primitive.attributes).filter((
|
|
13404
|
+
const jointSets = Object.keys(primitive.attributes).filter((name22) => /^JOINTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(7))).sort((first, second) => first - second);
|
|
13405
|
+
const weightSets = Object.keys(primitive.attributes).filter((name22) => /^WEIGHTS_\d+$/.test(name22)).map((name22) => Number(name22.slice(8))).sort((first, second) => first - second);
|
|
13440
13406
|
if (!jointSets.length && !weightSets.length) {
|
|
13441
13407
|
reportUnsupported(`${label} requires JOINTS_0 and WEIGHTS_0 skin influences`);
|
|
13442
13408
|
continue;
|
|
@@ -13887,7 +13853,7 @@ function collectExtensionNames(value) {
|
|
|
13887
13853
|
if (!object || typeof object !== "object" || visited.has(object)) continue;
|
|
13888
13854
|
visited.add(object);
|
|
13889
13855
|
if (isRecord2(object) && isRecord2(object.extensions))
|
|
13890
|
-
for (const
|
|
13856
|
+
for (const name22 of Object.keys(object.extensions)) names.add(name22);
|
|
13891
13857
|
for (const [field, child] of Object.entries(object))
|
|
13892
13858
|
if (field !== "extras") pending.push(child);
|
|
13893
13859
|
}
|
|
@@ -14045,7 +14011,7 @@ var init_normalize_gltf_v1 = __esm({
|
|
|
14045
14011
|
this._addAsset(json);
|
|
14046
14012
|
this._orderBinaryBufferPayloads(gltf);
|
|
14047
14013
|
this._convertTopLevelObjectsToArrays(json);
|
|
14048
|
-
|
|
14014
|
+
preprocess7(gltf);
|
|
14049
14015
|
this._convertObjectIdsToArrayIndices(json);
|
|
14050
14016
|
this._updateObjects(json);
|
|
14051
14017
|
for (const [bufferIndex, buffer] of (json.buffers || []).entries())
|
|
@@ -14634,6 +14600,7 @@ function getReferencesImageIndices(gltf) {
|
|
|
14634
14600
|
return Array.from(imageIndices).sort();
|
|
14635
14601
|
}
|
|
14636
14602
|
async function loadImage(gltf, image, index, options, context) {
|
|
14603
|
+
var _a, _b, _c;
|
|
14637
14604
|
let arrayBuffer;
|
|
14638
14605
|
if (image.uri && !image.hasOwnProperty("bufferView")) {
|
|
14639
14606
|
const uri = resolveUrl(image.uri, options, context);
|
|
@@ -14650,6 +14617,33 @@ async function loadImage(gltf, image, index, options, context) {
|
|
|
14650
14617
|
}
|
|
14651
14618
|
assert3(arrayBuffer, "glTF image has no data");
|
|
14652
14619
|
const gltfOptions = getGLTFImageOptions(options, image.mimeType);
|
|
14620
|
+
const ddsLoader = getDDSLoader(context);
|
|
14621
|
+
const ddsSelected = Boolean(
|
|
14622
|
+
ddsLoader && !((_b = (_a = options.gltf) == null ? void 0 : _a.excludeExtensions) == null ? void 0 : _b.includes("MSFT_texture_dds")) && ((_c = gltf.json.textures) == null ? void 0 : _c.some(
|
|
14623
|
+
(texture) => {
|
|
14624
|
+
var _a2, _b2;
|
|
14625
|
+
return texture.source === index && ((_b2 = (_a2 = texture.extensions) == null ? void 0 : _a2.MSFT_texture_dds) == null ? void 0 : _b2.source) === index;
|
|
14626
|
+
}
|
|
14627
|
+
))
|
|
14628
|
+
);
|
|
14629
|
+
if (ddsSelected) {
|
|
14630
|
+
const levels = await parseFromContext(
|
|
14631
|
+
arrayBuffer,
|
|
14632
|
+
ddsLoader,
|
|
14633
|
+
options,
|
|
14634
|
+
context
|
|
14635
|
+
);
|
|
14636
|
+
assert3(levels.length > 0, "MSFT_texture_dds parser returned no texture levels");
|
|
14637
|
+
gltf.images = gltf.images || [];
|
|
14638
|
+
gltf.images[index] = {
|
|
14639
|
+
compressed: true,
|
|
14640
|
+
mipmaps: true,
|
|
14641
|
+
width: levels[0].width,
|
|
14642
|
+
height: levels[0].height,
|
|
14643
|
+
data: levels
|
|
14644
|
+
};
|
|
14645
|
+
return;
|
|
14646
|
+
}
|
|
14653
14647
|
let parsedImage = await parseFromContext(
|
|
14654
14648
|
arrayBuffer,
|
|
14655
14649
|
[ImageLoader, BasisLoader],
|
|
@@ -14682,6 +14676,7 @@ var init_parse_gltf = __esm({
|
|
|
14682
14676
|
init_resolve_gltf_file();
|
|
14683
14677
|
init_get_typed_array();
|
|
14684
14678
|
init_gltf_extensions();
|
|
14679
|
+
init_MSFT_texture_dds();
|
|
14685
14680
|
init_normalize_gltf_v1();
|
|
14686
14681
|
PACKAGE_URL_PREFIX = "gltf-package://";
|
|
14687
14682
|
}
|
|
@@ -14890,7 +14885,7 @@ var VERSION5;
|
|
|
14890
14885
|
var init_version5 = __esm({
|
|
14891
14886
|
"dist/3d-tiles/lib/utils/version.js"() {
|
|
14892
14887
|
"use strict";
|
|
14893
|
-
VERSION5 = true ? "5.0.0-beta.
|
|
14888
|
+
VERSION5 = true ? "5.0.0-beta.5" : "latest";
|
|
14894
14889
|
}
|
|
14895
14890
|
});
|
|
14896
14891
|
|
|
@@ -17743,8 +17738,8 @@ var init_format_spatial_reference = __esm({
|
|
|
17743
17738
|
function getSpatialProjectionEngine() {
|
|
17744
17739
|
return spatialProjectionEngine;
|
|
17745
17740
|
}
|
|
17746
|
-
function getGeoidModel(
|
|
17747
|
-
return geoidModels.get(
|
|
17741
|
+
function getGeoidModel(name22) {
|
|
17742
|
+
return geoidModels.get(name22);
|
|
17748
17743
|
}
|
|
17749
17744
|
var import_earth, import_projection, geoidModels, spatialProjectionEngine;
|
|
17750
17745
|
var init_spatial_resource_registry = __esm({
|
|
@@ -20140,9 +20135,9 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20140
20135
|
this.binary = binary;
|
|
20141
20136
|
this.featureCount = featureCount;
|
|
20142
20137
|
this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
|
|
20143
|
-
this._properties =
|
|
20144
|
-
for (const propertyName
|
|
20145
|
-
if (!IGNORED_PROPERTY_FIELDS
|
|
20138
|
+
this._properties = /* @__PURE__ */ Object.create(null);
|
|
20139
|
+
for (const propertyName of Object.keys(this.json)) {
|
|
20140
|
+
if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS, propertyName)) {
|
|
20146
20141
|
this._properties[propertyName] = this.json[propertyName];
|
|
20147
20142
|
}
|
|
20148
20143
|
}
|
|
@@ -20183,10 +20178,10 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20183
20178
|
}
|
|
20184
20179
|
return void 0;
|
|
20185
20180
|
}
|
|
20186
|
-
hasProperty(batchId,
|
|
20181
|
+
hasProperty(batchId, name22) {
|
|
20187
20182
|
this._checkBatchId(batchId);
|
|
20188
|
-
assert(typeof
|
|
20189
|
-
return defined4(this._properties[
|
|
20183
|
+
assert(typeof name22 === "string", name22);
|
|
20184
|
+
return defined4(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
|
|
20190
20185
|
}
|
|
20191
20186
|
getPropertyNames(batchId, results) {
|
|
20192
20187
|
this._checkBatchId(batchId);
|
|
@@ -20199,47 +20194,47 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20199
20194
|
}
|
|
20200
20195
|
return results;
|
|
20201
20196
|
}
|
|
20202
|
-
getProperty(batchId,
|
|
20197
|
+
getProperty(batchId, name22) {
|
|
20203
20198
|
this._checkBatchId(batchId);
|
|
20204
|
-
assert(typeof
|
|
20199
|
+
assert(typeof name22 === "string", name22);
|
|
20205
20200
|
if (this._binaryProperties) {
|
|
20206
|
-
const binaryProperty = this._binaryProperties[
|
|
20201
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
20207
20202
|
if (defined4(binaryProperty)) {
|
|
20208
20203
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
20209
20204
|
}
|
|
20210
20205
|
}
|
|
20211
|
-
const propertyValues = this._properties[
|
|
20206
|
+
const propertyValues = this._properties[name22];
|
|
20212
20207
|
if (defined4(propertyValues)) {
|
|
20213
20208
|
return clone(propertyValues[batchId], true);
|
|
20214
20209
|
}
|
|
20215
20210
|
if (this._hierarchy) {
|
|
20216
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
20211
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
|
|
20217
20212
|
if (defined4(hierarchyProperty)) {
|
|
20218
20213
|
return hierarchyProperty;
|
|
20219
20214
|
}
|
|
20220
20215
|
}
|
|
20221
20216
|
return void 0;
|
|
20222
20217
|
}
|
|
20223
|
-
setProperty(batchId,
|
|
20218
|
+
setProperty(batchId, name22, value) {
|
|
20224
20219
|
const featureCount = this.featureCount;
|
|
20225
20220
|
this._checkBatchId(batchId);
|
|
20226
|
-
assert(typeof
|
|
20221
|
+
assert(typeof name22 === "string", name22);
|
|
20227
20222
|
if (this._binaryProperties) {
|
|
20228
|
-
const binaryProperty = this._binaryProperties[
|
|
20223
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
20229
20224
|
if (binaryProperty) {
|
|
20230
20225
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
20231
20226
|
return;
|
|
20232
20227
|
}
|
|
20233
20228
|
}
|
|
20234
20229
|
if (this._hierarchy) {
|
|
20235
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
20230
|
+
if (this._setHierarchyProperty(this, batchId, name22, value)) {
|
|
20236
20231
|
return;
|
|
20237
20232
|
}
|
|
20238
20233
|
}
|
|
20239
|
-
let propertyValues = this._properties[
|
|
20234
|
+
let propertyValues = this._properties[name22];
|
|
20240
20235
|
if (!defined4(propertyValues)) {
|
|
20241
|
-
this._properties[
|
|
20242
|
-
propertyValues = this._properties[
|
|
20236
|
+
this._properties[name22] = new Array(featureCount);
|
|
20237
|
+
propertyValues = this._properties[name22];
|
|
20243
20238
|
}
|
|
20244
20239
|
propertyValues[batchId] = clone(value, true);
|
|
20245
20240
|
}
|
|
@@ -20258,21 +20253,21 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20258
20253
|
}
|
|
20259
20254
|
_initializeBinaryProperties() {
|
|
20260
20255
|
let binaryProperties = null;
|
|
20261
|
-
for (const
|
|
20262
|
-
const property = this._properties[
|
|
20263
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
20256
|
+
for (const name22 in this._properties) {
|
|
20257
|
+
const property = this._properties[name22];
|
|
20258
|
+
const binaryProperty = this._initializeBinaryProperty(name22, property);
|
|
20264
20259
|
if (binaryProperty) {
|
|
20265
|
-
binaryProperties
|
|
20266
|
-
binaryProperties[
|
|
20260
|
+
binaryProperties ??= /* @__PURE__ */ Object.create(null);
|
|
20261
|
+
binaryProperties[name22] = binaryProperty;
|
|
20267
20262
|
}
|
|
20268
20263
|
}
|
|
20269
20264
|
return binaryProperties;
|
|
20270
20265
|
}
|
|
20271
|
-
_initializeBinaryProperty(
|
|
20266
|
+
_initializeBinaryProperty(name22, property) {
|
|
20272
20267
|
if ("byteOffset" in property) {
|
|
20273
20268
|
const tile3DAccessor = property;
|
|
20274
|
-
assert(this.binary, `Property ${
|
|
20275
|
-
assert(tile3DAccessor.type, `Property ${
|
|
20269
|
+
assert(this.binary, `Property ${name22} requires a batch table binary.`);
|
|
20270
|
+
assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
|
|
20276
20271
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
20277
20272
|
return {
|
|
20278
20273
|
typedArray: accessor.values,
|
|
@@ -20284,14 +20279,14 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20284
20279
|
return null;
|
|
20285
20280
|
}
|
|
20286
20281
|
// EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
|
|
20287
|
-
_hasPropertyInHierarchy(batchId,
|
|
20282
|
+
_hasPropertyInHierarchy(batchId, name22) {
|
|
20288
20283
|
if (!this._hierarchy) {
|
|
20289
20284
|
return false;
|
|
20290
20285
|
}
|
|
20291
20286
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20292
20287
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20293
20288
|
const instances = hierarchy.classes[classId].instances;
|
|
20294
|
-
return defined4(instances[
|
|
20289
|
+
return Object.hasOwn(instances, name22) && defined4(instances[name22]) ? true : void 0;
|
|
20295
20290
|
});
|
|
20296
20291
|
return defined4(result);
|
|
20297
20292
|
}
|
|
@@ -20299,21 +20294,21 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20299
20294
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20300
20295
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20301
20296
|
const instances = hierarchy.classes[classId].instances;
|
|
20302
|
-
for (const
|
|
20303
|
-
if (
|
|
20304
|
-
if (results.indexOf(
|
|
20305
|
-
results.push(
|
|
20297
|
+
for (const name22 in instances) {
|
|
20298
|
+
if (Object.hasOwn(instances, name22)) {
|
|
20299
|
+
if (results.indexOf(name22) === -1) {
|
|
20300
|
+
results.push(name22);
|
|
20306
20301
|
}
|
|
20307
20302
|
}
|
|
20308
20303
|
}
|
|
20309
20304
|
});
|
|
20310
20305
|
}
|
|
20311
|
-
_getHierarchyProperty(batchId,
|
|
20306
|
+
_getHierarchyProperty(batchId, name22) {
|
|
20312
20307
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20313
20308
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20314
20309
|
const instanceClass = hierarchy.classes[classId];
|
|
20315
20310
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
20316
|
-
const propertyValues = instanceClass.instances[
|
|
20311
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
20317
20312
|
if (defined4(propertyValues)) {
|
|
20318
20313
|
if (defined4(propertyValues.typedArray)) {
|
|
20319
20314
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -20323,14 +20318,14 @@ var init_tile_3d_batch_table = __esm({
|
|
|
20323
20318
|
return void 0;
|
|
20324
20319
|
});
|
|
20325
20320
|
}
|
|
20326
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
20321
|
+
_setHierarchyProperty(batchTable, batchId, name22, value) {
|
|
20327
20322
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
20328
20323
|
const classId = hierarchy.classIds[instanceIndex];
|
|
20329
20324
|
const instanceClass = hierarchy.classes[classId];
|
|
20330
20325
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
20331
|
-
const propertyValues = instanceClass.instances[
|
|
20326
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
20332
20327
|
if (defined4(propertyValues)) {
|
|
20333
|
-
assert(instanceIndex === batchId, `Inherited property "${
|
|
20328
|
+
assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
|
|
20334
20329
|
if (defined4(propertyValues.typedArray)) {
|
|
20335
20330
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
20336
20331
|
} else {
|
|
@@ -20956,6 +20951,7 @@ function parseInstancedModel(tile, arrayBuffer, byteOffset, options, context) {
|
|
|
20956
20951
|
function extractInstancedAttributes(tile, featureTable, batchTable, instancesLength) {
|
|
20957
20952
|
const instances = new Array(instancesLength);
|
|
20958
20953
|
const instancePosition = new import_core17.Vector3();
|
|
20954
|
+
const instanceFramePosition = new import_core17.Vector3();
|
|
20959
20955
|
const instanceNormalRight = new import_core17.Vector3();
|
|
20960
20956
|
const instanceNormalUp = new import_core17.Vector3();
|
|
20961
20957
|
const instanceNormalForward = new import_core17.Vector3();
|
|
@@ -21018,7 +21014,10 @@ function extractInstancedAttributes(tile, featureTable, batchTable, instancesLen
|
|
|
21018
21014
|
tile.hasCustomOrientation = true;
|
|
21019
21015
|
hasCustomOrientation = true;
|
|
21020
21016
|
} else if (tile.eastNorthUp) {
|
|
21021
|
-
|
|
21017
|
+
instanceFramePosition.copy(instancePosition);
|
|
21018
|
+
if (tile.rtcCenter)
|
|
21019
|
+
instanceFramePosition.add(tile.rtcCenter);
|
|
21020
|
+
(0, import_geospatial9.eastNorthUpToFixedFrame)(import_geospatial8.Ellipsoid.WGS84, instanceFramePosition, instanceTransform);
|
|
21022
21021
|
instanceTransform.getRotationMatrix3(instanceRotation);
|
|
21023
21022
|
} else {
|
|
21024
21023
|
instanceRotation.identity();
|
|
@@ -23453,9 +23452,9 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23453
23452
|
this.binary = binary;
|
|
23454
23453
|
this.featureCount = featureCount;
|
|
23455
23454
|
this._extensions = ((_a = this.json) == null ? void 0 : _a.extensions) || {};
|
|
23456
|
-
this._properties =
|
|
23457
|
-
for (const propertyName
|
|
23458
|
-
if (!IGNORED_PROPERTY_FIELDS2
|
|
23455
|
+
this._properties = /* @__PURE__ */ Object.create(null);
|
|
23456
|
+
for (const propertyName of Object.keys(this.json)) {
|
|
23457
|
+
if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS2, propertyName)) {
|
|
23459
23458
|
this._properties[propertyName] = this.json[propertyName];
|
|
23460
23459
|
}
|
|
23461
23460
|
}
|
|
@@ -23496,10 +23495,10 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23496
23495
|
}
|
|
23497
23496
|
return void 0;
|
|
23498
23497
|
}
|
|
23499
|
-
hasProperty(batchId,
|
|
23498
|
+
hasProperty(batchId, name22) {
|
|
23500
23499
|
this._checkBatchId(batchId);
|
|
23501
|
-
assert(typeof
|
|
23502
|
-
return defined6(this._properties[
|
|
23500
|
+
assert(typeof name22 === "string", name22);
|
|
23501
|
+
return defined6(this._properties[name22]) || this._hasPropertyInHierarchy(batchId, name22);
|
|
23503
23502
|
}
|
|
23504
23503
|
getPropertyNames(batchId, results) {
|
|
23505
23504
|
this._checkBatchId(batchId);
|
|
@@ -23512,47 +23511,47 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23512
23511
|
}
|
|
23513
23512
|
return results;
|
|
23514
23513
|
}
|
|
23515
|
-
getProperty(batchId,
|
|
23514
|
+
getProperty(batchId, name22) {
|
|
23516
23515
|
this._checkBatchId(batchId);
|
|
23517
|
-
assert(typeof
|
|
23516
|
+
assert(typeof name22 === "string", name22);
|
|
23518
23517
|
if (this._binaryProperties) {
|
|
23519
|
-
const binaryProperty = this._binaryProperties[
|
|
23518
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
23520
23519
|
if (defined6(binaryProperty)) {
|
|
23521
23520
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
23522
23521
|
}
|
|
23523
23522
|
}
|
|
23524
|
-
const propertyValues = this._properties[
|
|
23523
|
+
const propertyValues = this._properties[name22];
|
|
23525
23524
|
if (defined6(propertyValues)) {
|
|
23526
23525
|
return clone2(propertyValues[batchId], true);
|
|
23527
23526
|
}
|
|
23528
23527
|
if (this._hierarchy) {
|
|
23529
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
23528
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name22);
|
|
23530
23529
|
if (defined6(hierarchyProperty)) {
|
|
23531
23530
|
return hierarchyProperty;
|
|
23532
23531
|
}
|
|
23533
23532
|
}
|
|
23534
23533
|
return void 0;
|
|
23535
23534
|
}
|
|
23536
|
-
setProperty(batchId,
|
|
23535
|
+
setProperty(batchId, name22, value) {
|
|
23537
23536
|
const featureCount = this.featureCount;
|
|
23538
23537
|
this._checkBatchId(batchId);
|
|
23539
|
-
assert(typeof
|
|
23538
|
+
assert(typeof name22 === "string", name22);
|
|
23540
23539
|
if (this._binaryProperties) {
|
|
23541
|
-
const binaryProperty = this._binaryProperties[
|
|
23540
|
+
const binaryProperty = this._binaryProperties[name22];
|
|
23542
23541
|
if (binaryProperty) {
|
|
23543
23542
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
23544
23543
|
return;
|
|
23545
23544
|
}
|
|
23546
23545
|
}
|
|
23547
23546
|
if (this._hierarchy) {
|
|
23548
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
23547
|
+
if (this._setHierarchyProperty(this, batchId, name22, value)) {
|
|
23549
23548
|
return;
|
|
23550
23549
|
}
|
|
23551
23550
|
}
|
|
23552
|
-
let propertyValues = this._properties[
|
|
23551
|
+
let propertyValues = this._properties[name22];
|
|
23553
23552
|
if (!defined6(propertyValues)) {
|
|
23554
|
-
this._properties[
|
|
23555
|
-
propertyValues = this._properties[
|
|
23553
|
+
this._properties[name22] = new Array(featureCount);
|
|
23554
|
+
propertyValues = this._properties[name22];
|
|
23556
23555
|
}
|
|
23557
23556
|
propertyValues[batchId] = clone2(value, true);
|
|
23558
23557
|
}
|
|
@@ -23571,21 +23570,21 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23571
23570
|
}
|
|
23572
23571
|
_initializeBinaryProperties() {
|
|
23573
23572
|
let binaryProperties = null;
|
|
23574
|
-
for (const
|
|
23575
|
-
const property = this._properties[
|
|
23576
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
23573
|
+
for (const name22 in this._properties) {
|
|
23574
|
+
const property = this._properties[name22];
|
|
23575
|
+
const binaryProperty = this._initializeBinaryProperty(name22, property);
|
|
23577
23576
|
if (binaryProperty) {
|
|
23578
|
-
binaryProperties
|
|
23579
|
-
binaryProperties[
|
|
23577
|
+
binaryProperties ??= /* @__PURE__ */ Object.create(null);
|
|
23578
|
+
binaryProperties[name22] = binaryProperty;
|
|
23580
23579
|
}
|
|
23581
23580
|
}
|
|
23582
23581
|
return binaryProperties;
|
|
23583
23582
|
}
|
|
23584
|
-
_initializeBinaryProperty(
|
|
23583
|
+
_initializeBinaryProperty(name22, property) {
|
|
23585
23584
|
if ("byteOffset" in property) {
|
|
23586
23585
|
const tile3DAccessor = property;
|
|
23587
|
-
assert(this.binary, `Property ${
|
|
23588
|
-
assert(tile3DAccessor.type, `Property ${
|
|
23586
|
+
assert(this.binary, `Property ${name22} requires a batch table binary.`);
|
|
23587
|
+
assert(tile3DAccessor.type, `Property ${name22} requires a type.`);
|
|
23589
23588
|
const accessor = createTypedArrayFromAccessor2(
|
|
23590
23589
|
tile3DAccessor,
|
|
23591
23590
|
this.binary.buffer,
|
|
@@ -23602,14 +23601,14 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23602
23601
|
return null;
|
|
23603
23602
|
}
|
|
23604
23603
|
// EXTENSION SUPPORT: 3DTILES_batch_table_hierarchy
|
|
23605
|
-
_hasPropertyInHierarchy(batchId,
|
|
23604
|
+
_hasPropertyInHierarchy(batchId, name22) {
|
|
23606
23605
|
if (!this._hierarchy) {
|
|
23607
23606
|
return false;
|
|
23608
23607
|
}
|
|
23609
23608
|
const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23610
23609
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23611
23610
|
const instances = hierarchy.classes[classId].instances;
|
|
23612
|
-
return defined6(instances[
|
|
23611
|
+
return Object.hasOwn(instances, name22) && defined6(instances[name22]) ? true : void 0;
|
|
23613
23612
|
});
|
|
23614
23613
|
return defined6(result);
|
|
23615
23614
|
}
|
|
@@ -23617,21 +23616,21 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23617
23616
|
traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23618
23617
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23619
23618
|
const instances = hierarchy.classes[classId].instances;
|
|
23620
|
-
for (const
|
|
23621
|
-
if (
|
|
23622
|
-
if (results.indexOf(
|
|
23623
|
-
results.push(
|
|
23619
|
+
for (const name22 in instances) {
|
|
23620
|
+
if (Object.hasOwn(instances, name22)) {
|
|
23621
|
+
if (results.indexOf(name22) === -1) {
|
|
23622
|
+
results.push(name22);
|
|
23624
23623
|
}
|
|
23625
23624
|
}
|
|
23626
23625
|
}
|
|
23627
23626
|
});
|
|
23628
23627
|
}
|
|
23629
|
-
_getHierarchyProperty(batchId,
|
|
23628
|
+
_getHierarchyProperty(batchId, name22) {
|
|
23630
23629
|
return traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23631
23630
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23632
23631
|
const instanceClass = hierarchy.classes[classId];
|
|
23633
23632
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
23634
|
-
const propertyValues = instanceClass.instances[
|
|
23633
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
23635
23634
|
if (defined6(propertyValues)) {
|
|
23636
23635
|
if (defined6(propertyValues.typedArray)) {
|
|
23637
23636
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -23641,14 +23640,14 @@ var init_tile_3d_batch_table2 = __esm({
|
|
|
23641
23640
|
return void 0;
|
|
23642
23641
|
});
|
|
23643
23642
|
}
|
|
23644
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
23643
|
+
_setHierarchyProperty(batchTable, batchId, name22, value) {
|
|
23645
23644
|
const result = traverseHierarchy2(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
23646
23645
|
const classId = hierarchy.classIds[instanceIndex];
|
|
23647
23646
|
const instanceClass = hierarchy.classes[classId];
|
|
23648
23647
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
23649
|
-
const propertyValues = instanceClass.instances[
|
|
23648
|
+
const propertyValues = Object.hasOwn(instanceClass.instances, name22) ? instanceClass.instances[name22] : void 0;
|
|
23650
23649
|
if (defined6(propertyValues)) {
|
|
23651
|
-
assert(instanceIndex === batchId, `Inherited property "${
|
|
23650
|
+
assert(instanceIndex === batchId, `Inherited property "${name22}" is read-only.`);
|
|
23652
23651
|
if (defined6(propertyValues.typedArray)) {
|
|
23653
23652
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
23654
23653
|
} else {
|
|
@@ -24313,6 +24312,7 @@ function parseInstancedModel2(tile, arrayBuffer, byteOffset, options, context) {
|
|
|
24313
24312
|
function extractInstancedAttributes2(tile, featureTable, batchTable, instancesLength) {
|
|
24314
24313
|
const instances = new Array(instancesLength);
|
|
24315
24314
|
const instancePosition = new import_core23.Vector3();
|
|
24315
|
+
const instanceFramePosition = new import_core23.Vector3();
|
|
24316
24316
|
const instanceNormalRight = new import_core23.Vector3();
|
|
24317
24317
|
const instanceNormalUp = new import_core23.Vector3();
|
|
24318
24318
|
const instanceNormalForward = new import_core23.Vector3();
|
|
@@ -24407,7 +24407,9 @@ function extractInstancedAttributes2(tile, featureTable, batchTable, instancesLe
|
|
|
24407
24407
|
tile.hasCustomOrientation = true;
|
|
24408
24408
|
hasCustomOrientation = true;
|
|
24409
24409
|
} else if (tile.eastNorthUp) {
|
|
24410
|
-
|
|
24410
|
+
instanceFramePosition.copy(instancePosition);
|
|
24411
|
+
if (tile.rtcCenter) instanceFramePosition.add(tile.rtcCenter);
|
|
24412
|
+
(0, import_geospatial12.eastNorthUpToFixedFrame)(import_geospatial11.Ellipsoid.WGS84, instanceFramePosition, instanceTransform);
|
|
24411
24413
|
instanceTransform.getRotationMatrix3(instanceRotation);
|
|
24412
24414
|
} else {
|
|
24413
24415
|
instanceRotation.identity();
|
|
@@ -28662,12 +28664,12 @@ var init_zip_archive = __esm({
|
|
|
28662
28664
|
maxDecodedBytes: options.maxDecodedBytes ?? DEFAULT_OPTIONS.maxDecodedBytes,
|
|
28663
28665
|
chunkBytes: options.chunkBytes ?? DEFAULT_OPTIONS.chunkBytes
|
|
28664
28666
|
};
|
|
28665
|
-
for (const [
|
|
28667
|
+
for (const [name22, value] of Object.entries(this.limits)) {
|
|
28666
28668
|
const bigintLimit = ["maxArchiveBytes", "maxCompressedBytes", "maxDecodedBytes"].includes(
|
|
28667
|
-
|
|
28669
|
+
name22
|
|
28668
28670
|
);
|
|
28669
28671
|
if (bigintLimit ? typeof value !== "bigint" || value < 0n : typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
|
|
28670
|
-
throw new RangeError(`Invalid ZIP ${
|
|
28672
|
+
throw new RangeError(`Invalid ZIP ${name22} limit`);
|
|
28671
28673
|
}
|
|
28672
28674
|
this.signal = options.signal ? AbortSignal.any([this.controller.signal, options.signal]) : this.controller.signal;
|
|
28673
28675
|
}
|
|
@@ -29348,7 +29350,7 @@ var init_d_tiles_archive_loader = __esm({
|
|
|
29348
29350
|
"dist/3d-tiles/3d-tiles-archive-loader.js"() {
|
|
29349
29351
|
"use strict";
|
|
29350
29352
|
init_tiles_3d_format();
|
|
29351
|
-
VERSION7 = true ? "5.0.0-beta.
|
|
29353
|
+
VERSION7 = true ? "5.0.0-beta.5" : "latest";
|
|
29352
29354
|
Tiles3DArchiveFileLoader = {
|
|
29353
29355
|
dataType: null,
|
|
29354
29356
|
batchType: null,
|