@loaders.gl/tiles-3d 5.0.0-beta.4 → 5.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  3. package/dist/3d-tiles/dist.dev.js +941 -621
  4. package/dist/3d-tiles/dist.min.js +37 -37
  5. package/dist/3d-tiles/index.cjs +876 -947
  6. package/dist/3d-tiles/index.cjs.map +3 -3
  7. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +5 -1
  8. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  9. package/dist/3d-tiles/lib/utils/version.js +1 -1
  10. package/dist/3d-tiles-archive-writer.cjs +1 -1
  11. package/dist/cesium-ion-loader-with-parser.cjs +821 -942
  12. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  13. package/dist/copc/copc-source-loader.js +2 -2
  14. package/dist/copc/copc-source-loader.js.map +1 -1
  15. package/dist/copc/copc-writer.js +1 -1
  16. package/dist/copc/index.cjs +121 -181
  17. package/dist/copc/index.cjs.map +3 -3
  18. package/dist/dist.dev.js +323 -40
  19. package/dist/dist.min.js +10 -10
  20. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  21. package/dist/i3s/dist.dev.js +3173 -712
  22. package/dist/i3s/dist.min.js +47 -47
  23. package/dist/i3s/i3s-attribute-loader.js +1 -1
  24. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  25. package/dist/i3s/i3s-content-loader.js +1 -1
  26. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  27. package/dist/i3s/i3s-loader.js +1 -1
  28. package/dist/i3s/i3s-node-page-loader.js +1 -1
  29. package/dist/i3s/i3s-slpk-loader.js +1 -1
  30. package/dist/i3s/i3s-slpk-writer.js +1 -1
  31. package/dist/i3s/index.cjs +2097 -544
  32. package/dist/i3s/index.cjs.map +3 -3
  33. package/dist/i3s-content-worker-node.js +11 -11
  34. package/dist/i3s-content-worker-node.js.map +4 -4
  35. package/dist/i3s-content-worker.js +768 -346
  36. package/dist/i3s-lepcc-worker-node.js +245 -12
  37. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  38. package/dist/i3s-lepcc-worker.js +240 -12
  39. package/dist/i3s-mesh-writer.cjs +1749 -290
  40. package/dist/i3s-mesh-writer.cjs.map +3 -3
  41. package/dist/i3s-slpk-writer.cjs +1 -1
  42. package/dist/index.cjs +98 -4
  43. package/dist/index.cjs.map +2 -2
  44. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  45. package/dist/point-cloud-tile-source-loader.cjs +46 -2
  46. package/dist/point-cloud-tile-source-loader.cjs.map +2 -2
  47. package/dist/point-cloud-tile-source.cjs +45 -1
  48. package/dist/point-cloud-tile-source.cjs.map +1 -1
  49. package/dist/potree/dist.dev.js +325 -91
  50. package/dist/potree/dist.min.js +30 -30
  51. package/dist/potree/index.cjs +115 -176
  52. package/dist/potree/index.cjs.map +3 -3
  53. package/dist/potree/potree-bin-loader.js +1 -1
  54. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  55. package/dist/potree/potree-loader-types.js +1 -1
  56. package/dist/potree/potree-source-loader.js +1 -1
  57. package/dist/potree/potree-writer.js +1 -1
  58. package/dist/potree/potree2-source.d.ts.map +1 -1
  59. package/dist/potree/potree2-source.js +3 -13
  60. package/dist/potree/potree2-source.js.map +1 -1
  61. package/dist/potree-loader.cjs +1 -1
  62. package/package.json +13 -13
  63. package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +4 -1
  64. package/src/copc/copc-source-loader.ts +1 -1
  65. package/src/potree/potree2-source.ts +3 -14
package/dist/dist.dev.js CHANGED
@@ -2158,6 +2158,35 @@ var __exports__ = (() => {
2158
2158
  out[15] = 1;
2159
2159
  return out;
2160
2160
  }
2161
+ function affineComponents(matrix) {
2162
+ if (matrix.length !== 16 || Array.from(matrix).some((x) => !Number.isFinite(x)) || matrix[3] !== 0 || matrix[7] !== 0 || matrix[11] !== 0 || matrix[15] !== 1) {
2163
+ throw new RangeError("Expected a finite affine matrix");
2164
+ }
2165
+ const scale6 = [
2166
+ Math.hypot(matrix[0], matrix[1], matrix[2]),
2167
+ Math.hypot(matrix[4], matrix[5], matrix[6]),
2168
+ Math.hypot(matrix[8], matrix[9], matrix[10])
2169
+ ];
2170
+ if (scale6.some((x) => x === 0 || !Number.isFinite(x)))
2171
+ throw new RangeError("Singular transform");
2172
+ const rotation2 = Array.from({ length: 9 }, (_, i) => matrix[Math.floor(i / 3) * 4 + i % 3] / scale6[Math.floor(i / 3)]);
2173
+ for (const [a, b] of [
2174
+ [0, 3],
2175
+ [0, 6],
2176
+ [3, 6]
2177
+ ]) {
2178
+ if (Math.abs(rotation2[a] * rotation2[b] + rotation2[a + 1] * rotation2[b + 1] + rotation2[a + 2] * rotation2[b + 2]) > 1e-7) {
2179
+ throw new RangeError("Sheared transforms do not have a TRS decomposition");
2180
+ }
2181
+ }
2182
+ const determinant3 = rotation2[0] * (rotation2[4] * rotation2[8] - rotation2[5] * rotation2[7]) - rotation2[3] * (rotation2[1] * rotation2[8] - rotation2[2] * rotation2[7]) + rotation2[6] * (rotation2[1] * rotation2[5] - rotation2[2] * rotation2[4]);
2183
+ if (determinant3 < 0) {
2184
+ scale6[0] = -scale6[0];
2185
+ for (let i = 0; i < 3; i++)
2186
+ rotation2[i] = -rotation2[i];
2187
+ }
2188
+ return { rotation: rotation2, scale: scale6, translation: [matrix[12], matrix[13], matrix[14]] };
2189
+ }
2161
2190
  var perspective, ortho;
2162
2191
  var init_mat4 = __esm({
2163
2192
  "../../node_modules/@math.gl/core/dist/gl-matrix/mat4.js"() {
@@ -2291,6 +2320,7 @@ var __exports__ = (() => {
2291
2320
  var init_matrix4 = __esm({
2292
2321
  "../../node_modules/@math.gl/core/dist/classes/matrix4.js"() {
2293
2322
  init_matrix();
2323
+ init_mat4();
2294
2324
  init_validators();
2295
2325
  init_gl_matrix_extras();
2296
2326
  init_mat4();
@@ -2575,27 +2605,15 @@ var __exports__ = (() => {
2575
2605
  * @returns self
2576
2606
  */
2577
2607
  getRotation(result, scaleResult) {
2578
- result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];
2579
- scaleResult = scaleResult || [-0, -0, -0];
2580
- const scale6 = this.getScale(scaleResult);
2581
- const inverseScale0 = 1 / scale6[0];
2582
- const inverseScale1 = 1 / scale6[1];
2583
- const inverseScale2 = 1 / scale6[2];
2584
- result[0] = this[0] * inverseScale0;
2585
- result[1] = this[1] * inverseScale1;
2586
- result[2] = this[2] * inverseScale2;
2587
- result[3] = 0;
2588
- result[4] = this[4] * inverseScale0;
2589
- result[5] = this[5] * inverseScale1;
2590
- result[6] = this[6] * inverseScale2;
2591
- result[7] = 0;
2592
- result[8] = this[8] * inverseScale0;
2593
- result[9] = this[9] * inverseScale1;
2594
- result[10] = this[10] * inverseScale2;
2595
- result[11] = 0;
2596
- result[12] = 0;
2597
- result[13] = 0;
2598
- result[14] = 0;
2608
+ const { rotation: rotation2, scale: scale6 } = affineComponents(this);
2609
+ result = result || new Array(16);
2610
+ if (scaleResult)
2611
+ for (let i = 0; i < 3; i++)
2612
+ scaleResult[i] = scale6[i];
2613
+ for (let i = 0; i < 16; i++)
2614
+ result[i] = 0;
2615
+ for (let i = 0; i < 9; i++)
2616
+ result[Math.floor(i / 3) * 4 + i % 3] = rotation2[i];
2599
2617
  result[15] = 1;
2600
2618
  return result;
2601
2619
  }
@@ -2606,21 +2624,13 @@ var __exports__ = (() => {
2606
2624
  * @returns self
2607
2625
  */
2608
2626
  getRotationMatrix3(result, scaleResult) {
2609
- result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];
2610
- scaleResult = scaleResult || [-0, -0, -0];
2611
- const scale6 = this.getScale(scaleResult);
2612
- const inverseScale0 = 1 / scale6[0];
2613
- const inverseScale1 = 1 / scale6[1];
2614
- const inverseScale2 = 1 / scale6[2];
2615
- result[0] = this[0] * inverseScale0;
2616
- result[1] = this[1] * inverseScale1;
2617
- result[2] = this[2] * inverseScale2;
2618
- result[3] = this[4] * inverseScale0;
2619
- result[4] = this[5] * inverseScale1;
2620
- result[5] = this[6] * inverseScale2;
2621
- result[6] = this[8] * inverseScale0;
2622
- result[7] = this[9] * inverseScale1;
2623
- result[8] = this[10] * inverseScale2;
2627
+ const { rotation: rotation2, scale: scale6 } = affineComponents(this);
2628
+ result = result || new Array(9);
2629
+ if (scaleResult)
2630
+ for (let i = 0; i < 3; i++)
2631
+ scaleResult[i] = scale6[i];
2632
+ for (let i = 0; i < 9; i++)
2633
+ result[i] = rotation2[i];
2624
2634
  return result;
2625
2635
  }
2626
2636
  // Modifiers
@@ -2933,6 +2943,28 @@ var __exports__ = (() => {
2933
2943
  }
2934
2944
  return out;
2935
2945
  }
2946
+ function rotateTowards(out, a, b, step) {
2947
+ if (a.length !== 4 || b.length !== 4 || [...Array.from(a), ...Array.from(b), step].some((x) => !Number.isFinite(x))) {
2948
+ throw new RangeError("Expected finite quaternions and step");
2949
+ }
2950
+ if (a.length !== 4 || step < 0)
2951
+ throw new RangeError("Expected quaternions and a nonnegative step");
2952
+ const aScale = Math.max(...Array.from(a, Math.abs)), bScale = Math.max(...Array.from(b, Math.abs));
2953
+ if (!aScale || !bScale)
2954
+ throw new RangeError("Zero quaternion");
2955
+ const an = Array.from(a, (x) => x / aScale), bn = Array.from(b, (x) => x / bScale);
2956
+ const al = Math.hypot(...an), bl = Math.hypot(...bn);
2957
+ for (let i = 0; i < 4; i++) {
2958
+ an[i] /= al;
2959
+ bn[i] /= bl;
2960
+ }
2961
+ const dot5 = an.reduce((sum, x, i) => sum + x * bn[i], 0);
2962
+ const angle2 = 2 * Math.acos(Math.min(1, Math.abs(dot5)));
2963
+ if (out.length < 4)
2964
+ throw new RangeError("Result buffer is too short");
2965
+ slerp(out, an, bn, angle2 === 0 ? 0 : Math.min(1, step / angle2));
2966
+ return out;
2967
+ }
2936
2968
  var add2, scale4, dot3, lerp2, length3, squaredLength2, normalize3, rotationTo;
2937
2969
  var init_quat = __esm({
2938
2970
  "../../node_modules/@math.gl/core/dist/gl-matrix/quat.js"() {
@@ -2981,6 +3013,7 @@ var __exports__ = (() => {
2981
3013
  var Quaternion;
2982
3014
  var init_quaternion = __esm({
2983
3015
  "../../node_modules/@math.gl/core/dist/classes/quaternion.js"() {
3016
+ init_quat();
2984
3017
  init_math_array();
2985
3018
  init_validators();
2986
3019
  init_quat();
@@ -3054,6 +3087,9 @@ var __exports__ = (() => {
3054
3087
  return this.check();
3055
3088
  }
3056
3089
  /** Set a quat to the identity quaternion */
3090
+ rotateTowards(target, step) {
3091
+ return rotateTowards(this, this, target, step);
3092
+ }
3057
3093
  identity() {
3058
3094
  identity2(this);
3059
3095
  return this.check();
@@ -3551,6 +3587,19 @@ var __exports__ = (() => {
3551
3587
  }
3552
3588
  });
3553
3589
 
3590
+ // ../../node_modules/@math.gl/core/dist/projections.js
3591
+ function getProjectionDepthRange(options = {}) {
3592
+ const range = options.depthRange ?? "negative-one-to-one";
3593
+ if (range !== "negative-one-to-one" && range !== "zero-to-one")
3594
+ throw new RangeError("Unknown depth range");
3595
+ const low = range === "zero-to-one" ? 0 : -1;
3596
+ return options.reversedDepth ? [1, low] : [low, 1];
3597
+ }
3598
+ var init_projections = __esm({
3599
+ "../../node_modules/@math.gl/core/dist/projections.js"() {
3600
+ }
3601
+ });
3602
+
3554
3603
  // ../../node_modules/@math.gl/core/dist/index.js
3555
3604
  var init_dist = __esm({
3556
3605
  "../../node_modules/@math.gl/core/dist/index.js"() {
@@ -3572,6 +3621,7 @@ var __exports__ = (() => {
3572
3621
  init_vec32();
3573
3622
  init_vec42();
3574
3623
  init_mat42();
3624
+ init_projections();
3575
3625
  }
3576
3626
  });
3577
3627
 
@@ -4524,11 +4574,49 @@ var __exports__ = (() => {
4524
4574
  }
4525
4575
  });
4526
4576
 
4577
+ // ../../node_modules/@math.gl/geometry/dist/culling/frustum-planes.js
4578
+ function extractFrustumPlanes(matrix, options = {}) {
4579
+ if (matrix.length !== 16 || Array.from(matrix).some((x2) => !Number.isFinite(x2)))
4580
+ throw new RangeError("Expected a finite view-projection matrix");
4581
+ const [near, far] = getProjectionDepthRange(options);
4582
+ const low = Math.min(near, far), high = Math.max(near, far);
4583
+ const row = (i) => [matrix[i], matrix[i + 4], matrix[i + 8], matrix[i + 12]];
4584
+ const x = row(0), y = row(1), z = row(2), w = row(3);
4585
+ const combine = (a, b, factor) => a.map((v, i) => v + factor * b[i]);
4586
+ const lo = combine(z, w, -low), hi = w.map((v, i) => high * v - z[i]);
4587
+ const coefficients = [
4588
+ combine(w, x, 1),
4589
+ combine(w, x, -1),
4590
+ combine(w, y, 1),
4591
+ combine(w, y, -1),
4592
+ ...options.reversedDepth ? [hi, lo] : [lo, hi]
4593
+ ];
4594
+ const planes = [];
4595
+ for (const [a, b, c, d] of coefficients) {
4596
+ const length4 = Math.hypot(a, b, c);
4597
+ if (length4 === 0) {
4598
+ if (d < 0)
4599
+ throw new RangeError("Empty clipping volume");
4600
+ } else
4601
+ planes.push(new Plane([a / length4, b / length4, c / length4], d / length4));
4602
+ }
4603
+ if (planes.length < 4)
4604
+ throw new RangeError("Degenerate clipping volume");
4605
+ return planes;
4606
+ }
4607
+ var init_frustum_planes = __esm({
4608
+ "../../node_modules/@math.gl/geometry/dist/culling/frustum-planes.js"() {
4609
+ init_dist();
4610
+ init_plane();
4611
+ }
4612
+ });
4613
+
4527
4614
  // ../../node_modules/@math.gl/geometry/dist/culling/lib/culling-volume.js
4528
4615
  var faces, scratchPlaneCenter, scratchPlaneNormal, CullingVolume;
4529
4616
  var init_culling_volume = __esm({
4530
4617
  "../../node_modules/@math.gl/geometry/dist/culling/lib/culling-volume.js"() {
4531
4618
  init_dist();
4619
+ init_frustum_planes();
4532
4620
  init_plane();
4533
4621
  faces = [new Vector3([1, 0, 0]), new Vector3([0, 1, 0]), new Vector3([0, 0, 1])];
4534
4622
  scratchPlaneCenter = new Vector3();
@@ -4568,6 +4656,12 @@ var __exports__ = (() => {
4568
4656
  }
4569
4657
  return this;
4570
4658
  }
4659
+ /** Replace planes from a view-projection matrix; validates before mutating. */
4660
+ fromViewProjection(matrix, options = {}) {
4661
+ const planes = extractFrustumPlanes(matrix, options);
4662
+ this.planes.splice(0, this.planes.length, ...planes);
4663
+ return this;
4664
+ }
4571
4665
  /** Determines whether a bounding volume intersects the culling volume. */
4572
4666
  computeVisibility(boundingVolume) {
4573
4667
  let intersect = "inside";
@@ -11855,6 +11949,8 @@ var __exports__ = (() => {
11855
11949
  identityHints;
11856
11950
  /** Failure objects already included in telemetry. */
11857
11951
  countedFailures = /* @__PURE__ */ new WeakSet();
11952
+ /** Observer for cumulative transport counters, including asynchronous cancellation. */
11953
+ onTelemetry;
11858
11954
  /** Mutable counters backing immutable telemetry snapshots. */
11859
11955
  telemetry = {
11860
11956
  requestedBytes: 0,
@@ -11868,6 +11964,7 @@ var __exports__ = (() => {
11868
11964
  constructor(url, options) {
11869
11965
  validateKnownByteLength(options.byteLength);
11870
11966
  this.url = url;
11967
+ this.onTelemetry = options.onTelemetry;
11871
11968
  this.fetchFunction = options.fetch || ((input, init) => globalThis.fetch(input, init));
11872
11969
  this.fetchOptions = options.fetchOptions ? { ...options.fetchOptions, headers: new Headers(options.fetchOptions.headers) } : void 0;
11873
11970
  this.consistency = options.consistency || "best-effort";
@@ -11905,6 +12002,7 @@ var __exports__ = (() => {
11905
12002
  } else {
11906
12003
  this.telemetry.errorCount++;
11907
12004
  }
12005
+ this.onTelemetry?.(this.getTelemetry(), error);
11908
12006
  }
11909
12007
  /** Performs and validates one exact HTTP range request. */
11910
12008
  async requestRange(offset2, length4, signal, expectedIdentity) {
@@ -11924,7 +12022,13 @@ var __exports__ = (() => {
11924
12022
  await cancelResponse(response);
11925
12023
  throw new Error(`HTTP byte-range request expected 206, received ${response.status}`);
11926
12024
  }
11927
- const contentRange = await readContentRange(response);
12025
+ const contentRange = response.headers.has("Content-Range") ? await readContentRange(response) : await this.inferContentRange(
12026
+ response,
12027
+ offset2,
12028
+ length4,
12029
+ expectedIdentity,
12030
+ abortContext.signal
12031
+ );
11928
12032
  const responseIdentity = getResponseIdentity(response, contentRange.byteLength);
11929
12033
  const responseError = getIdentityError(
11930
12034
  expectedIdentity,
@@ -11958,6 +12062,44 @@ var __exports__ = (() => {
11958
12062
  } finally {
11959
12063
  abortContext.removeAbortListeners();
11960
12064
  this.telemetry.networkTimeMs += getTimestamp2() - requestStartTime;
12065
+ this.onTelemetry?.(this.getTelemetry());
12066
+ }
12067
+ }
12068
+ /** Infers bounds for a CORS-filtered 206; the caller still validates the body length. */
12069
+ async inferContentRange(response, offset2, length4, expectedIdentity, signal) {
12070
+ try {
12071
+ let byteLength = expectedIdentity?.byteLength ?? this.identityHints.byteLength;
12072
+ if (byteLength === void 0) {
12073
+ const headers = new Headers(this.fetchOptions?.headers);
12074
+ headers.delete("Range");
12075
+ this.telemetry.requestCount++;
12076
+ const metadata2 = await this.fetchFunction(this.url, {
12077
+ ...this.fetchOptions,
12078
+ method: "HEAD",
12079
+ body: void 0,
12080
+ headers,
12081
+ signal
12082
+ });
12083
+ await cancelResponse(metadata2);
12084
+ const value2 = metadata2.headers.get("Content-Length");
12085
+ byteLength = value2 && /^\d+$/.test(value2) ? Number(value2) : NaN;
12086
+ if (metadata2.status !== 200 || !Number.isSafeInteger(byteLength) || byteLength < offset2 + length4) {
12087
+ throw new Error(
12088
+ "HTTP byte-range response is missing Content-Range and HEAD did not provide a valid file length"
12089
+ );
12090
+ }
12091
+ const identityError = getIdentityError(
12092
+ getResponseIdentity(metadata2, byteLength),
12093
+ getResponseIdentity(response, byteLength),
12094
+ this.identityHints,
12095
+ this.consistency
12096
+ );
12097
+ if (identityError) throw new Error(identityError);
12098
+ }
12099
+ return { offset: offset2, endOffset: offset2 + length4 - 1, byteLength };
12100
+ } catch (error) {
12101
+ await cancelResponse(response);
12102
+ throw error;
11961
12103
  }
11962
12104
  }
11963
12105
  /** Validates and consumes the special empty-object identity response. */
@@ -12205,7 +12347,7 @@ var __exports__ = (() => {
12205
12347
  if (options?.core) {
12206
12348
  loadOptions.core = { ...options.core };
12207
12349
  const parserCore = loadOptions.core;
12208
- for (const key2 of ["type", "attributions", "loaders", "onError", "loadOptions"]) {
12350
+ for (const key2 of ["type", "name", "attributions", "loaders", "onError", "loadOptions"]) {
12209
12351
  delete parserCore[key2];
12210
12352
  }
12211
12353
  if (Object.keys(parserCore).length === 0) {
@@ -12240,6 +12382,43 @@ var __exports__ = (() => {
12240
12382
  );
12241
12383
  };
12242
12384
  }
12385
+ function getDataSourceName(data, options) {
12386
+ const explicitName = options.core?.name;
12387
+ if (explicitName !== void 0) {
12388
+ if (typeof explicitName !== "string" || !explicitName.trim())
12389
+ throw new Error("Data source name must be a non-empty string.");
12390
+ return explicitName;
12391
+ }
12392
+ if (data && typeof data === "object") {
12393
+ const named = data;
12394
+ if (typeof named.name === "string" && named.name.trim())
12395
+ return data instanceof Blob ? removeFileExtension(named.name) : named.name;
12396
+ const metadata2 = named.schema?.metadata;
12397
+ const embeddedName = metadata2 instanceof Map ? metadata2.get("name") : metadata2?.name;
12398
+ if (typeof embeddedName === "string" && embeddedName.trim()) return embeddedName;
12399
+ }
12400
+ if (typeof data === "string") {
12401
+ try {
12402
+ const url = new URL(data.replace(/\\/g, "/"), "https://source.invalid/");
12403
+ if (!["data:", "blob:"].includes(url.protocol)) {
12404
+ let basename = url.pathname.split("/").filter(Boolean).pop();
12405
+ if (basename) {
12406
+ try {
12407
+ basename = decodeURIComponent(basename);
12408
+ } catch {
12409
+ }
12410
+ return removeFileExtension(basename);
12411
+ }
12412
+ }
12413
+ } catch {
12414
+ }
12415
+ }
12416
+ return options.core?.type && options.core.type !== "auto" ? options.core.type : "source";
12417
+ }
12418
+ function removeFileExtension(name) {
12419
+ const extension = name.lastIndexOf(".");
12420
+ return extension > 0 ? name.slice(0, extension) : name;
12421
+ }
12243
12422
  var UNAVAILABLE_CORE_API, DataSource;
12244
12423
  var init_data_source = __esm({
12245
12424
  "../core/src/loader-utils/lib/sources/data-source.ts"() {
@@ -12271,6 +12450,8 @@ var __exports__ = (() => {
12271
12450
  options;
12272
12451
  data;
12273
12452
  url;
12453
+ /** Stable query-visible name, resolved without fetching source data. */
12454
+ name;
12274
12455
  /** Shared parser options derived from the source options, excluding source-only core controls. */
12275
12456
  loadOptions;
12276
12457
  /** A resolved fetch function extracted from the shared core options. */
@@ -12287,6 +12468,7 @@ var __exports__ = (() => {
12287
12468
  );
12288
12469
  this.data = data;
12289
12470
  this.url = typeof data === "string" ? resolvePath(data) : "";
12471
+ this.name = getDataSourceName(data, this.options);
12290
12472
  const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(this.options));
12291
12473
  this.loadOptions = loadOptions;
12292
12474
  const fetch2 = getFetchFunction(loadOptions);
@@ -12295,6 +12477,8 @@ var __exports__ = (() => {
12295
12477
  this.fetch = fetch2;
12296
12478
  }
12297
12479
  setProps(options) {
12480
+ if (options.core?.name !== void 0 && options.core.name !== this.name)
12481
+ throw new Error("Data source names are fixed at creation.");
12298
12482
  const mergedOptions = mergeOptions(this.options, options);
12299
12483
  const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(mergedOptions));
12300
12484
  this.options = mergedOptions;
@@ -34947,6 +35131,55 @@ return true;`);
34947
35131
  };
34948
35132
  }
34949
35133
 
35134
+ // ../../node_modules/@math.gl/geospatial/dist/projection/experimental/transform-description.js
35135
+ function describeCRS(crs) {
35136
+ const ellipsoid = Object.freeze({ ...crs.ellipsoid });
35137
+ return Object.freeze({
35138
+ kind: crs.kind,
35139
+ projection: crs.projection,
35140
+ parameters: Object.freeze(Object.fromEntries(Object.entries(crs.parameters).map(([name, value2]) => [name, value2 ?? null]))),
35141
+ ellipsoid,
35142
+ datum: Object.freeze({
35143
+ ellipsoid: Object.freeze({ ...crs.datum.ellipsoid }),
35144
+ towgs84: crs.datum.towgs84 && Object.freeze([...crs.datum.towgs84]),
35145
+ grids: crs.datum.grids && Object.freeze(crs.datum.grids.map((reference) => Object.freeze({
35146
+ name: reference.name,
35147
+ optional: reference.optional,
35148
+ loaded: Boolean(reference.grid)
35149
+ })))
35150
+ }),
35151
+ angularUnit: crs.angularUnit,
35152
+ toMeter: crs.toMeter,
35153
+ verticalUnit: crs.verticalUnit,
35154
+ primeMeridian: crs.primeMeridian,
35155
+ axis: crs.axis,
35156
+ storedAxis: crs.storedAxis,
35157
+ longitudeWrap: crs.longitudeWrap,
35158
+ areaOfUse: crs.areaOfUse && Object.freeze([...crs.areaOfUse]),
35159
+ lossy: crs.lossy,
35160
+ algorithm: crs.algorithm && Object.freeze({ ...crs.algorithm })
35161
+ });
35162
+ }
35163
+ function describeTransform(source, target, forward33, inverse33) {
35164
+ const opaqueReasons = [];
35165
+ if (!source.algorithm)
35166
+ opaqueReasons.push("source-algorithm");
35167
+ if (!target.algorithm)
35168
+ opaqueReasons.push("target-algorithm");
35169
+ if (source.datum.grids || target.datum.grids || source.parameters["geoidgrids"] || target.parameters["geoidgrids"])
35170
+ opaqueReasons.push("grid-resource");
35171
+ return Object.freeze({
35172
+ version: 1,
35173
+ source,
35174
+ target,
35175
+ forward: forward33,
35176
+ inverse: inverse33,
35177
+ lossy: source.lossy || target.lossy,
35178
+ complete: opaqueReasons.length === 0,
35179
+ opaqueReasons: Object.freeze(opaqueReasons)
35180
+ });
35181
+ }
35182
+
34950
35183
  // ../../node_modules/@math.gl/geospatial/dist/projection/experimental/typescript-projection.js
34951
35184
  var ProjectionTransform = class _ProjectionTransform {
34952
35185
  /** Resolve required descriptors once, then return an ordinary synchronous instance. */
@@ -34961,6 +35194,10 @@ return true;`);
34961
35194
  getTargetRenderingProfile(coverage) {
34962
35195
  return this.targetRenderingProfile && resolveRenderingProfile(this.targetRenderingProfile, coverage);
34963
35196
  }
35197
+ /** Deferred transforms expose metadata only once their implementations are prepared. */
35198
+ get description() {
35199
+ return this.deferred?.implementation?.description ?? this.resolvedDescription;
35200
+ }
34964
35201
  constructor(options = {}) {
34965
35202
  this.coordinateScratch = new ProjectionScratch();
34966
35203
  this.targetLongitudeOrigin = 0;
@@ -34986,6 +35223,7 @@ return true;`);
34986
35223
  unsupportedStage("Horizontal extraction cannot be combined with vertical grids");
34987
35224
  this.forwardTransform = compileTransform(from, to, Boolean(options.enforceAxis));
34988
35225
  this.inverseTransform = compileTransform(to, from, Boolean(options.enforceAxis));
35226
+ this.resolvedDescription = describeTransform(describeCRS(from), describeCRS(to), this.forwardTransform.description, this.inverseTransform.description);
34989
35227
  }
34990
35228
  this.project = this.project.bind(this);
34991
35229
  this.unproject = this.unproject.bind(this);
@@ -35163,7 +35401,8 @@ return true;`);
35163
35401
  const verticalGrid = compileVerticalGrid(crs.parameters["geoidgrids"], options.verticalGrids);
35164
35402
  if (verticalGrid && (crs.kind === "geocentric" || crs.kind === "identity" || crs.lossy))
35165
35403
  unsupportedStage("Vertical grids require a non-lossy geographic or projected CRS");
35166
- return { ...crs, datum, implementation, verticalGrid };
35404
+ const algorithm = plugin ? plugin.semantics : { id: "@math.gl/geospatial/" + crs.kind, version: 1 };
35405
+ return { ...crs, datum, implementation, verticalGrid, algorithm };
35167
35406
  }
35168
35407
  function finite(point) {
35169
35408
  return Number.isFinite(point.x) && Number.isFinite(point.y) && Number.isFinite(point.z);
@@ -35206,9 +35445,51 @@ return true;`);
35206
35445
  if (from.kind === "projected" && to.kind === "geographic")
35207
35446
  flat = from.implementation?.createInverseFlat?.(context);
35208
35447
  }
35448
+ const requiresInputZ = Boolean(from.verticalGrid || to.verticalGrid) || from.kind === "geocentric" || /[ud]/.test(fromAxis.slice(0, 2)) || /[ud]/.test(toAxis.slice(0, 2));
35449
+ const stages = [];
35450
+ if (inputAxis)
35451
+ stages.push("input-axis");
35452
+ if (horizontalOnly)
35453
+ stages.push("discard-height");
35454
+ if (inputScale !== 1)
35455
+ stages.push("input-scale");
35456
+ if (source)
35457
+ stages.push("source-inverse");
35458
+ if (inputVerticalScale !== 1)
35459
+ stages.push("input-height-scale");
35460
+ stages.push("geographic-domain-check");
35461
+ if (fromPrime)
35462
+ stages.push("source-prime-meridian");
35463
+ if (from.verticalGrid)
35464
+ stages.push("source-vertical-grid");
35465
+ if (datum)
35466
+ stages.push("datum");
35467
+ if (to.verticalGrid)
35468
+ stages.push("target-vertical-grid");
35469
+ if (toPrime)
35470
+ stages.push("target-prime-meridian");
35471
+ if (longitudeWrap !== void 0)
35472
+ stages.push("longitude-wrap");
35473
+ if (target)
35474
+ stages.push("target-forward");
35475
+ if (outputScale !== 1)
35476
+ stages.push("output-scale");
35477
+ if (outputVerticalScale !== 1)
35478
+ stages.push("output-height-scale");
35479
+ if (horizontalOnly)
35480
+ stages.push("restore-height");
35481
+ if (outputAxis)
35482
+ stages.push("output-axis");
35209
35483
  return {
35484
+ description: Object.freeze({
35485
+ inputAxis: fromAxis,
35486
+ outputAxis: toAxis,
35487
+ requiresInputZ,
35488
+ geocentricOutput: to.kind === "geocentric",
35489
+ stages: Object.freeze(stages)
35490
+ }),
35210
35491
  flat,
35211
- requiresInputZ: Boolean(from.verticalGrid || to.verticalGrid) || from.kind === "geocentric" || /[ud]/.test(fromAxis.slice(0, 2)) || /[ud]/.test(toAxis.slice(0, 2)),
35492
+ requiresInputZ,
35212
35493
  geocentricOutput: to.kind === "geocentric",
35213
35494
  run(point) {
35214
35495
  if (!finite(point))
@@ -35658,6 +35939,7 @@ return true;`);
35658
35939
  init_rendering_bounds();
35659
35940
  var mercator = {
35660
35941
  name: "merc",
35942
+ semantics: { id: "@math.gl/geospatial/merc", version: 1 },
35661
35943
  aliases: [
35662
35944
  "Mercator",
35663
35945
  "Popular Visualisation Pseudo Mercator",
@@ -35746,6 +36028,7 @@ return true;`);
35746
36028
  init_rendering_bounds();
35747
36029
  var equidistantCylindrical = {
35748
36030
  name: "eqc",
36031
+ semantics: { id: "@math.gl/geospatial/eqc", version: 1 },
35749
36032
  aliases: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical"],
35750
36033
  parameters: ["lon_0", "lat_0", "lat_ts", "x_0", "y_0"],
35751
36034
  create({ semiMajorAxis: a, parameters, primeMeridian: primeMeridian2 = 0 }) {