@vitessce/json 3.6.18 → 3.7.1

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.
@@ -1,15 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __typeError = (msg) => {
3
- throw TypeError(msg);
4
- };
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
8
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
9
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
- var __privateSet = (obj, member, value, setter2) => (__accessCheck(obj, member, "write to private field"), setter2 ? setter2.call(obj, value) : member.set(obj, value), value);
11
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _a2, _b, _overrides, _use_suffix_request, _FetchStore_instances, merge_init_fn, _bytes, _encoder, _data, _stride, _TypedArray, _BYTES_PER_ELEMENT, _shape, _endian, _encoder_config, _decoder_config, _order, _inverseOrder, _shape2, _strides, _metadata, _metadata2, _c;
13
1
  import "react";
14
2
  function _mergeNamespaces(n3, m) {
15
3
  for (var i2 = 0; i2 < m.length; i2++) {
@@ -687,6 +675,7 @@ const CoordinationType$1 = {
687
675
  CoordinationType$1.SPATIAL_ROTATION_Y,
688
676
  CoordinationType$1.SPATIAL_ROTATION_Z,
689
677
  CoordinationType$1.SPATIAL_AXIS_FIXED,
678
+ CoordinationType$1.SPATIAL_ROTATION_ORBIT,
690
679
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
691
680
  CoordinationType$1.SPATIAL_ZOOM,
692
681
  CoordinationType$1.OBS_FILTER,
@@ -694,14 +683,11 @@ const CoordinationType$1 = {
694
683
  CoordinationType$1.OBS_SET_SELECTION,
695
684
  CoordinationType$1.OBS_SET_FILTER,
696
685
  CoordinationType$1.OBS_SET_HIGHLIGHT,
697
- CoordinationType$1.OBS_SET_COLOR,
698
686
  CoordinationType$1.OBS_TYPE,
699
- CoordinationType$1.ADDITIONAL_OBS_SETS,
700
687
  CoordinationType$1.OBS_SET_COLOR,
701
688
  CoordinationType$1.OBS_COLOR_ENCODING,
702
- CoordinationType$1.OBS_SET_SELECTION,
703
689
  CoordinationType$1.EMBEDDING_TYPE,
704
- CoordinationType$1.OBS_COLOR_ENCODING,
690
+ CoordinationType$1.ADDITIONAL_OBS_SETS,
705
691
  CoordinationType$1.TOOLTIPS_VISIBLE
706
692
  ],
707
693
  [ViewType$1.SCATTERPLOT]: [
@@ -1972,11 +1958,11 @@ class ZodType {
1972
1958
  throw result.error;
1973
1959
  }
1974
1960
  safeParse(data, params) {
1975
- var _a3;
1961
+ var _a2;
1976
1962
  const ctx = {
1977
1963
  common: {
1978
1964
  issues: [],
1979
- async: (_a3 = params === null || params === void 0 ? void 0 : params.async) !== null && _a3 !== void 0 ? _a3 : false,
1965
+ async: (_a2 = params === null || params === void 0 ? void 0 : params.async) !== null && _a2 !== void 0 ? _a2 : false,
1980
1966
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
1981
1967
  },
1982
1968
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -2318,7 +2304,7 @@ class ZodString extends ZodType {
2318
2304
  } else if (check.kind === "url") {
2319
2305
  try {
2320
2306
  new URL(input.data);
2321
- } catch (_a3) {
2307
+ } catch (_a2) {
2322
2308
  ctx = this._getOrReturnCtx(input, ctx);
2323
2309
  addIssueToContext(ctx, {
2324
2310
  validation: "url",
@@ -2440,7 +2426,7 @@ class ZodString extends ZodType {
2440
2426
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
2441
2427
  }
2442
2428
  datetime(options) {
2443
- var _a3;
2429
+ var _a2;
2444
2430
  if (typeof options === "string") {
2445
2431
  return this._addCheck({
2446
2432
  kind: "datetime",
@@ -2452,7 +2438,7 @@ class ZodString extends ZodType {
2452
2438
  return this._addCheck({
2453
2439
  kind: "datetime",
2454
2440
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2455
- offset: (_a3 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a3 !== void 0 ? _a3 : false,
2441
+ offset: (_a2 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a2 !== void 0 ? _a2 : false,
2456
2442
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
2457
2443
  });
2458
2444
  }
@@ -2580,11 +2566,11 @@ class ZodString extends ZodType {
2580
2566
  }
2581
2567
  }
2582
2568
  ZodString.create = (params) => {
2583
- var _a3;
2569
+ var _a2;
2584
2570
  return new ZodString({
2585
2571
  checks: [],
2586
2572
  typeName: ZodFirstPartyTypeKind.ZodString,
2587
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
2573
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
2588
2574
  ...processCreateParams(params)
2589
2575
  });
2590
2576
  };
@@ -2985,11 +2971,11 @@ class ZodBigInt extends ZodType {
2985
2971
  }
2986
2972
  }
2987
2973
  ZodBigInt.create = (params) => {
2988
- var _a3;
2974
+ var _a2;
2989
2975
  return new ZodBigInt({
2990
2976
  checks: [],
2991
2977
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
2992
- coerce: (_a3 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a3 !== void 0 ? _a3 : false,
2978
+ coerce: (_a2 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a2 !== void 0 ? _a2 : false,
2993
2979
  ...processCreateParams(params)
2994
2980
  });
2995
2981
  };
@@ -3494,8 +3480,8 @@ class ZodObject extends ZodType {
3494
3480
  unknownKeys: "strict",
3495
3481
  ...message !== void 0 ? {
3496
3482
  errorMap: (issue, ctx) => {
3497
- var _a3, _b2, _c2, _d;
3498
- const defaultError = (_c2 = (_b2 = (_a3 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a3, issue, ctx).message) !== null && _c2 !== void 0 ? _c2 : ctx.defaultError;
3483
+ var _a2, _b, _c, _d;
3484
+ const defaultError = (_c = (_b = (_a2 = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a2, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
3499
3485
  if (issue.code === "unrecognized_keys")
3500
3486
  return {
3501
3487
  message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
@@ -4905,10 +4891,10 @@ ZodReadonly.create = (type, params) => {
4905
4891
  const custom = (check, params = {}, fatal) => {
4906
4892
  if (check)
4907
4893
  return ZodAny.create().superRefine((data, ctx) => {
4908
- var _a3, _b2;
4894
+ var _a2, _b;
4909
4895
  if (!check(data)) {
4910
4896
  const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
4911
- const _fatal = (_b2 = (_a3 = p.fatal) !== null && _a3 !== void 0 ? _a3 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
4897
+ const _fatal = (_b = (_a2 = p.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b !== void 0 ? _b : true;
4912
4898
  const p2 = typeof p === "string" ? { message: p } : p;
4913
4899
  ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
4914
4900
  }
@@ -5497,7 +5483,7 @@ function toFinite$1(value) {
5497
5483
  return value === 0 ? value : 0;
5498
5484
  }
5499
5485
  value = toNumber(value);
5500
- if (value === INFINITY || value === -Infinity) {
5486
+ if (value === INFINITY || value === -INFINITY) {
5501
5487
  var sign2 = value < 0 ? -1 : 1;
5502
5488
  return sign2 * MAX_INTEGER;
5503
5489
  }
@@ -6432,7 +6418,12 @@ function getAugmentedNamespace(n3) {
6432
6418
  var f2 = n3.default;
6433
6419
  if (typeof f2 == "function") {
6434
6420
  var a2 = function a3() {
6435
- if (this instanceof a3) {
6421
+ var isInstance = false;
6422
+ try {
6423
+ isInstance = this instanceof a3;
6424
+ } catch {
6425
+ }
6426
+ if (isInstance) {
6436
6427
  return Reflect.construct(f2, arguments, this.constructor);
6437
6428
  }
6438
6429
  return f2.apply(this, arguments);
@@ -7148,13 +7139,12 @@ function upgradeFrom0_1_0(config3, datasetUid = null) {
7148
7139
  };
7149
7140
  const layout = [];
7150
7141
  config3.staticLayout.forEach((componentDef) => {
7151
- var _a3, _b2, _c2;
7152
7142
  let newComponentDef = {
7153
7143
  ...componentDef,
7154
7144
  coordinationScopes: {}
7155
7145
  };
7156
7146
  if (componentDef.component === "scatterplot") {
7157
- if (((_a3 = componentDef.props) == null ? void 0 : _a3.mapping) && typeof componentDef.props.mapping === "string") {
7147
+ if (componentDef.props?.mapping && typeof componentDef.props.mapping === "string") {
7158
7148
  coordinationSpace.embeddingType[componentDef.props.mapping] = componentDef.props.mapping;
7159
7149
  newComponentDef = {
7160
7150
  ...newComponentDef,
@@ -7164,7 +7154,7 @@ function upgradeFrom0_1_0(config3, datasetUid = null) {
7164
7154
  }
7165
7155
  };
7166
7156
  }
7167
- if ((_b2 = componentDef.props) == null ? void 0 : _b2.view) {
7157
+ if (componentDef.props?.view) {
7168
7158
  const newScopeValues = upgradeReplaceViewProp("embedding", componentDef.props.view, coordinationSpace);
7169
7159
  newComponentDef = {
7170
7160
  ...newComponentDef,
@@ -7176,7 +7166,7 @@ function upgradeFrom0_1_0(config3, datasetUid = null) {
7176
7166
  }
7177
7167
  }
7178
7168
  if (componentDef.component === "spatial") {
7179
- if ((_c2 = componentDef == null ? void 0 : componentDef.props) == null ? void 0 : _c2.view) {
7169
+ if (componentDef?.props?.view) {
7180
7170
  const newScopeValues = upgradeReplaceViewProp("spatial", componentDef.props.view, coordinationSpace);
7181
7171
  newComponentDef = {
7182
7172
  ...newComponentDef,
@@ -7266,7 +7256,6 @@ function upgradeFrom1_0_0(config3) {
7266
7256
  };
7267
7257
  }
7268
7258
  function upgradeFrom1_0_1(config3) {
7269
- var _a3;
7270
7259
  const layout = config3.layout.map((component) => {
7271
7260
  const newComponent = { ...component };
7272
7261
  if (newComponent.component === "layerController") {
@@ -7278,9 +7267,8 @@ function upgradeFrom1_0_1(config3) {
7278
7267
  return newComponent;
7279
7268
  });
7280
7269
  const newConfig = cloneDeep(config3);
7281
- Object.keys(((_a3 = newConfig == null ? void 0 : newConfig.coordinationSpace) == null ? void 0 : _a3.spatialRasterLayers) || {}).forEach((key) => {
7282
- var _a4, _b2;
7283
- if ((_b2 = (_a4 = newConfig.coordinationSpace) == null ? void 0 : _a4.spatialRasterLayers) == null ? void 0 : _b2[key]) {
7270
+ Object.keys(newConfig?.coordinationSpace?.spatialRasterLayers || {}).forEach((key) => {
7271
+ if (newConfig.coordinationSpace?.spatialRasterLayers?.[key]) {
7284
7272
  newConfig.coordinationSpace.spatialRasterLayers[key].forEach((layer, index2) => {
7285
7273
  if (newConfig.coordinationSpace) {
7286
7274
  newConfig.coordinationSpace.spatialRasterLayers[key][index2].type = ["bitmask", "raster"].includes(layer.type) ? layer.type : "raster";
@@ -7421,7 +7409,7 @@ function upgradeFrom1_0_10(config3) {
7421
7409
  function upgradeFrom1_0_11(config3) {
7422
7410
  const newConfig = cloneDeep(config3);
7423
7411
  const { datasets, coordinationSpace } = newConfig;
7424
- if (coordinationSpace == null ? void 0 : coordinationSpace.embeddingType) {
7412
+ if (coordinationSpace?.embeddingType) {
7425
7413
  const embeddingTypes = Object.values(coordinationSpace.embeddingType);
7426
7414
  datasets.forEach((dataset, i2) => {
7427
7415
  const { files } = dataset;
@@ -7454,7 +7442,7 @@ function upgradeFrom1_0_12(config3) {
7454
7442
  if (options && "factors" in options && Array.isArray(options.factors)) {
7455
7443
  const obsLabelsTypeScopes = [];
7456
7444
  options.factors.forEach((olt) => {
7457
- const nextScope = getNextScope(Object.keys((coordinationSpace == null ? void 0 : coordinationSpace.obsLabelsType) || {}));
7445
+ const nextScope = getNextScope(Object.keys(coordinationSpace?.obsLabelsType || {}));
7458
7446
  newCoordinationSpace.obsLabelsType = {
7459
7447
  ...newCoordinationSpace.obsLabelsType,
7460
7448
  // Need to remove the obs/ prefix.
@@ -7468,8 +7456,7 @@ function upgradeFrom1_0_12(config3) {
7468
7456
  });
7469
7457
  });
7470
7458
  function getDatasetUidForView(viewDef) {
7471
- var _a3, _b2;
7472
- if (((_a3 = viewDef.coordinationScopes) == null ? void 0 : _a3.dataset) && typeof ((_b2 = viewDef.coordinationScopes) == null ? void 0 : _b2.dataset) === "string") {
7459
+ if (viewDef.coordinationScopes?.dataset && typeof viewDef.coordinationScopes?.dataset === "string") {
7473
7460
  return newCoordinationSpace.dataset[viewDef.coordinationScopes.dataset];
7474
7461
  }
7475
7462
  if (datasets.length > 0) {
@@ -7532,8 +7519,7 @@ function upgradeFrom1_0_14(config3) {
7532
7519
  };
7533
7520
  newLayout.forEach((viewDef) => {
7534
7521
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
7535
- var _a3;
7536
- if ((_a3 = viewDef.props) == null ? void 0 : _a3[oldProp]) {
7522
+ if (viewDef.props?.[oldProp]) {
7537
7523
  log$6.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
7538
7524
  }
7539
7525
  });
@@ -7550,7 +7536,7 @@ function upgradeFrom1_0_15(config3) {
7550
7536
  const newLayout = layout.map((view) => {
7551
7537
  const { coordinationScopes } = view;
7552
7538
  const newCoordinationScopes = {};
7553
- if ((coordinationScopes == null ? void 0 : coordinationScopes.dataset) && Array.isArray(coordinationScopes.dataset)) {
7539
+ if (coordinationScopes?.dataset && Array.isArray(coordinationScopes.dataset)) {
7554
7540
  const coordinationScopesBy = {
7555
7541
  dataset: {}
7556
7542
  };
@@ -10245,7 +10231,6 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
10245
10231
  return this.cachedResult;
10246
10232
  }
10247
10233
  async load() {
10248
- var _a3;
10249
10234
  const payload = await super.load();
10250
10235
  const channelCoordination = [{
10251
10236
  // obsType: null,
@@ -10265,7 +10250,7 @@ class ObsSegmentationsJsonLoader extends JsonLoader {
10265
10250
  // spatialTargetT: imageWrapper.getDefaultTargetT(),
10266
10251
  segmentationLayer: CL([
10267
10252
  {
10268
- fileUid: ((_a3 = this.coordinationValues) == null ? void 0 : _a3.fileUid) || null,
10253
+ fileUid: this.coordinationValues?.fileUid || null,
10269
10254
  spatialLayerOpacity: 1,
10270
10255
  spatialLayerVisible: true,
10271
10256
  segmentationChannel: CL(channelCoordination)
@@ -17810,7 +17795,6 @@ class CellsJsonAsObsSegmentationsLoader extends JsonLoader {
17810
17795
  this.schema = cellsSchema;
17811
17796
  }
17812
17797
  loadFromCache(data) {
17813
- var _a3;
17814
17798
  if (this.cachedResult) {
17815
17799
  return this.cachedResult;
17816
17800
  }
@@ -17820,7 +17804,7 @@ class CellsJsonAsObsSegmentationsLoader extends JsonLoader {
17820
17804
  this.cachedResult = null;
17821
17805
  } else {
17822
17806
  let cellPolygons;
17823
- if (!Array.isArray(cellObjs[0].poly) || !((_a3 = cellObjs[0].poly) == null ? void 0 : _a3.length)) {
17807
+ if (!Array.isArray(cellObjs[0].poly) || !cellObjs[0].poly?.length) {
17824
17808
  const radius = 50;
17825
17809
  cellPolygons = cellObjs.map((cellObj) => square(cellObj.xy[0], cellObj.xy[1], radius));
17826
17810
  } else {
@@ -23945,7 +23929,7 @@ var EXP_LIMIT = 9e15, MAX_DIGITS = 1e9, NUMERALS = "0123456789abcdef", LN10 = "2
23945
23929
  // 0 to EXP_LIMIT
23946
23930
  // The minimum exponent value, beneath which underflow to zero occurs.
23947
23931
  // JavaScript numbers: -324 (5e-324)
23948
- minE: -9e15,
23932
+ minE: -EXP_LIMIT,
23949
23933
  // -1 to -EXP_LIMIT
23950
23934
  // The maximum exponent value, above which overflow to Infinity occurs.
23951
23935
  // JavaScript numbers: 308 (1.7976931348623157e+308)
@@ -25700,7 +25684,7 @@ function config2(obj) {
25700
25684
  0,
25701
25685
  8,
25702
25686
  "toExpNeg",
25703
- -9e15,
25687
+ -EXP_LIMIT,
25704
25688
  0,
25705
25689
  "toExpPos",
25706
25690
  0,
@@ -25709,7 +25693,7 @@ function config2(obj) {
25709
25693
  0,
25710
25694
  EXP_LIMIT,
25711
25695
  "minE",
25712
- -9e15,
25696
+ -EXP_LIMIT,
25713
25697
  0,
25714
25698
  "modulo",
25715
25699
  0,
@@ -26125,15 +26109,15 @@ function requireComplex() {
26125
26109
  throw SyntaxError("Invalid Param");
26126
26110
  };
26127
26111
  function logHypot(a2, b) {
26128
- var _a3 = Math.abs(a2);
26129
- var _b2 = Math.abs(b);
26112
+ var _a2 = Math.abs(a2);
26113
+ var _b = Math.abs(b);
26130
26114
  if (a2 === 0) {
26131
- return Math.log(_b2);
26115
+ return Math.log(_b);
26132
26116
  }
26133
26117
  if (b === 0) {
26134
- return Math.log(_a3);
26118
+ return Math.log(_a2);
26135
26119
  }
26136
- if (_a3 < 3e3 && _b2 < 3e3) {
26120
+ if (_a2 < 3e3 && _b < 3e3) {
26137
26121
  return Math.log(a2 * a2 + b * b) * 0.5;
26138
26122
  }
26139
26123
  a2 = a2 / 2;
@@ -29552,7 +29536,7 @@ var createMatrix = /* @__PURE__ */ factory(name$L, dependencies$E, (_ref) => {
29552
29536
  "string, string": function stringString(format2, datatype) {
29553
29537
  return _create([], format2, datatype);
29554
29538
  },
29555
- Array: function Array2(data) {
29539
+ Array: function Array3(data) {
29556
29540
  return _create(data);
29557
29541
  },
29558
29542
  Matrix: function Matrix6(data) {
@@ -31143,7 +31127,7 @@ var createIdentity = /* @__PURE__ */ factory(name$r, dependencies$k, (_ref) => {
31143
31127
  "number | BigNumber, number | BigNumber, string": function numberBigNumberNumberBigNumberString(rows, cols, format2) {
31144
31128
  return _identity(rows, cols, format2);
31145
31129
  },
31146
- Array: function Array2(size2) {
31130
+ Array: function Array3(size2) {
31147
31131
  return _identityVector(size2);
31148
31132
  },
31149
31133
  "Array, string": function ArrayString(size2, format2) {
@@ -35674,18 +35658,18 @@ var createDot = /* @__PURE__ */ factory(name$b, dependencies$4, (_ref) => {
35674
35658
  return c;
35675
35659
  }
35676
35660
  if (!aIsColumn && bIsColumn) {
35677
- var _c2 = mul2(conj2(adata[0]), bdata[0][0]);
35661
+ var _c = mul2(conj2(adata[0]), bdata[0][0]);
35678
35662
  for (var _i = 1; _i < N2; _i++) {
35679
- _c2 = add2(_c2, mul2(conj2(adata[_i]), bdata[_i][0]));
35663
+ _c = add2(_c, mul2(conj2(adata[_i]), bdata[_i][0]));
35680
35664
  }
35681
- return _c2;
35665
+ return _c;
35682
35666
  }
35683
35667
  if (aIsColumn && !bIsColumn) {
35684
- var _c22 = mul2(conj2(adata[0][0]), bdata[0]);
35668
+ var _c2 = mul2(conj2(adata[0][0]), bdata[0]);
35685
35669
  for (var _i2 = 1; _i2 < N2; _i2++) {
35686
- _c22 = add2(_c22, mul2(conj2(adata[_i2][0]), bdata[_i2]));
35670
+ _c2 = add2(_c2, mul2(conj2(adata[_i2][0]), bdata[_i2]));
35687
35671
  }
35688
- return _c22;
35672
+ return _c2;
35689
35673
  }
35690
35674
  if (aIsColumn && bIsColumn) {
35691
35675
  var _c3 = mul2(conj2(adata[0][0]), bdata[0][0]);
@@ -35754,7 +35738,7 @@ var createLup = /* @__PURE__ */ factory(name$a, dependencies$3, (_ref) => {
35754
35738
  SparseMatrix: function SparseMatrix3(m) {
35755
35739
  return _sparseLUP(m);
35756
35740
  },
35757
- Array: function Array2(a2) {
35741
+ Array: function Array3(a2) {
35758
35742
  var m = matrix2(a2);
35759
35743
  var r2 = _denseLUP(m);
35760
35744
  return {
@@ -50176,8 +50160,8 @@ function fitBounds(options) {
50176
50160
  } = options;
50177
50161
  const [[west, south], [east, north]] = bounds2;
50178
50162
  const padding = getPaddingObject(options.padding);
50179
- const nw = lngLatToWorld([west, clamp$1(north, -85.051129, MAX_LATITUDE)]);
50180
- const se = lngLatToWorld([east, clamp$1(south, -85.051129, MAX_LATITUDE)]);
50163
+ const nw = lngLatToWorld([west, clamp$1(north, -MAX_LATITUDE, MAX_LATITUDE)]);
50164
+ const se = lngLatToWorld([east, clamp$1(south, -MAX_LATITUDE, MAX_LATITUDE)]);
50181
50165
  const size2 = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
50182
50166
  const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
50183
50167
  assert$7(targetSize[0] > 0 && targetSize[1] > 0);
@@ -68527,7 +68511,7 @@ function requireTinySdf() {
68527
68511
  function edt1d(grid, offset, stride, length2, f2, v, z2) {
68528
68512
  var q, k, s2, r2;
68529
68513
  v[0] = 0;
68530
- z2[0] = -1e20;
68514
+ z2[0] = -INF;
68531
68515
  z2[1] = INF;
68532
68516
  for (q = 0; q < length2; q++) f2[q] = grid[offset + q * stride];
68533
68517
  for (q = 1, k = 0, s2 = 0; q < length2; q++) {
@@ -71687,51 +71671,51 @@ const ONE6TH = 1 / 6;
71687
71671
  const OFFSET = {
71688
71672
  N: [0, HALF],
71689
71673
  E: [HALF, 0],
71690
- S: [0, -0.5],
71691
- W: [-0.5, 0],
71674
+ S: [0, -HALF],
71675
+ W: [-HALF, 0],
71692
71676
  NE: [HALF, HALF],
71693
- NW: [-0.5, HALF],
71694
- SE: [HALF, -0.5],
71695
- SW: [-0.5, -0.5]
71677
+ NW: [-HALF, HALF],
71678
+ SE: [HALF, -HALF],
71679
+ SW: [-HALF, -HALF]
71696
71680
  };
71697
71681
  const SW_TRIANGLE = [OFFSET.W, OFFSET.SW, OFFSET.S];
71698
71682
  const SE_TRIANGLE = [OFFSET.S, OFFSET.SE, OFFSET.E];
71699
71683
  const NE_TRIANGLE = [OFFSET.E, OFFSET.NE, OFFSET.N];
71700
71684
  const NW_TRIANGLE = [OFFSET.NW, OFFSET.W, OFFSET.N];
71701
- const SW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5]];
71702
- const SE_TRAPEZOID = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
71703
- const NE_TRAPEZOID = [[HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71704
- const NW_TRAPEZOID = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71685
+ const SW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF]];
71686
+ const SE_TRAPEZOID = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH]];
71687
+ const NE_TRAPEZOID = [[HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71688
+ const NW_TRAPEZOID = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71705
71689
  const S_RECTANGLE = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E];
71706
71690
  const E_RECTANGLE = [OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
71707
71691
  const N_RECTANGLE = [OFFSET.NW, OFFSET.W, OFFSET.E, OFFSET.NE];
71708
71692
  const W_RECTANGLE = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.N];
71709
- const EW_RECTANGEL = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [HALF, -0.16666666666666666], [HALF, ONE6TH]];
71710
- const SN_RECTANGEL = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71693
+ const EW_RECTANGEL = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [HALF, -ONE6TH], [HALF, ONE6TH]];
71694
+ const SN_RECTANGEL = [[-ONE6TH, -HALF], [ONE6TH, -HALF], [ONE6TH, HALF], [-ONE6TH, HALF]];
71711
71695
  const SQUARE = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.NE];
71712
71696
  const SW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.SE, OFFSET.E, OFFSET.N];
71713
71697
  const SE_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.NE, OFFSET.N];
71714
71698
  const NE_PENTAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.NE];
71715
71699
  const NW_PENTAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE];
71716
- const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
71717
- const NE_E_PENTAGON = [[-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
71718
- const SE_S_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E];
71719
- const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71720
- const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.N];
71721
- const NE_N_PENTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.E, OFFSET.NE, OFFSET.N];
71722
- const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71723
- const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH]];
71724
- const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71725
- const E_HEXAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
71726
- const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE];
71727
- const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
71700
+ const NW_N_PENTAGON = [OFFSET.NW, OFFSET.W, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
71701
+ const NE_E_PENTAGON = [[-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
71702
+ const SE_S_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E];
71703
+ const SW_W_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [ONE6TH, HALF], [-ONE6TH, HALF]];
71704
+ const NW_W_PENTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.N];
71705
+ const NE_N_PENTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.E, OFFSET.NE, OFFSET.N];
71706
+ const SE_E_PENTAGON = [OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
71707
+ const SW_S_PENTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH]];
71708
+ const S_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
71709
+ const E_HEXAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.NE, OFFSET.N];
71710
+ const N_HEXAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE];
71711
+ const W_HEXAGON = [OFFSET.NW, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
71728
71712
  const SW_NE_HEXAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, OFFSET.E, OFFSET.NE, OFFSET.N];
71729
71713
  const NW_SE_HEXAGON = [OFFSET.NW, OFFSET.W, OFFSET.S, OFFSET.SE, OFFSET.E, OFFSET.N];
71730
- const NE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], OFFSET.E, OFFSET.NE, OFFSET.N];
71731
- const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71732
- const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], OFFSET.N];
71733
- const SE_HEPTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71734
- const OCTAGON = [[-0.5, ONE6TH], [-0.5, -0.16666666666666666], [-0.16666666666666666, -0.5], [ONE6TH, -0.5], [HALF, -0.16666666666666666], [HALF, ONE6TH], [ONE6TH, HALF], [-0.16666666666666666, HALF]];
71714
+ const NE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], OFFSET.E, OFFSET.NE, OFFSET.N];
71715
+ const SW_HEPTAGON = [OFFSET.W, OFFSET.SW, OFFSET.S, [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71716
+ const NW_HEPTAGON = [OFFSET.NW, OFFSET.W, [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], OFFSET.N];
71717
+ const SE_HEPTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], OFFSET.S, OFFSET.SE, OFFSET.E, [ONE6TH, HALF], [-ONE6TH, HALF]];
71718
+ const OCTAGON = [[-HALF, ONE6TH], [-HALF, -ONE6TH], [-ONE6TH, -HALF], [ONE6TH, -HALF], [HALF, -ONE6TH], [HALF, ONE6TH], [ONE6TH, HALF], [-ONE6TH, HALF]];
71735
71719
  const ISOLINES_CODE_OFFSET_MAP = {
71736
71720
  0: [],
71737
71721
  1: [[OFFSET.W, OFFSET.S]],
@@ -72515,7 +72499,7 @@ function requireLong() {
72515
72499
  if (value >= TWO_PWR_64_DBL)
72516
72500
  return MAX_UNSIGNED_VALUE;
72517
72501
  } else {
72518
- if (value <= -9223372036854776e3)
72502
+ if (value <= -TWO_PWR_63_DBL)
72519
72503
  return MIN_VALUE;
72520
72504
  if (value + 1 >= TWO_PWR_63_DBL)
72521
72505
  return MAX_VALUE;
@@ -74131,7 +74115,7 @@ function getOSMTileIndices(viewport, maxZ, zRange, bounds2) {
74131
74115
  if (viewport instanceof WebMercatorViewport2 && viewport.subViewports && viewport.subViewports.length > 1) {
74132
74116
  traversalParams.offset = -1;
74133
74117
  while (root2.update(traversalParams)) {
74134
- if (--traversalParams.offset < -3) {
74118
+ if (--traversalParams.offset < -MAX_MAPS) {
74135
74119
  break;
74136
74120
  }
74137
74121
  }
@@ -77021,7 +77005,7 @@ var libh3 = function(libh32) {
77021
77005
  b[h >> 2] = 0;
77022
77006
  h = h + 4 | 0;
77023
77007
  } while ((h | 0) < (j | 0));
77024
- _b2(c, g3);
77008
+ _b(c, g3);
77025
77009
  h = g3;
77026
77010
  j = b[h >> 2] | 0;
77027
77011
  h = b[h + 4 >> 2] | 0;
@@ -77055,7 +77039,7 @@ var libh3 = function(libh32) {
77055
77039
  b[h >> 2] = 0;
77056
77040
  h = h + 4 | 0;
77057
77041
  } while ((h | 0) < (j | 0));
77058
- _b2(d, g3);
77042
+ _b(d, g3);
77059
77043
  j = g3;
77060
77044
  h = b[j >> 2] | 0;
77061
77045
  j = b[j + 4 >> 2] | 0;
@@ -77147,13 +77131,13 @@ var libh3 = function(libh32) {
77147
77131
  if (k < 0) {
77148
77132
  if (!(a3 & 1)) {
77149
77133
  m = (a3 | 0) / 2 | 0;
77150
- m = _c2(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77134
+ m = _c(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77151
77135
  d = ~~(+(d | 0) - (+(m >>> 0) + 4294967296 * +(G2() | 0)) * 2);
77152
77136
  b[c >> 2] = d;
77153
77137
  break;
77154
77138
  } else {
77155
77139
  m = (a3 + 1 | 0) / 2 | 0;
77156
- m = _c2(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77140
+ m = _c(d | 0, ((d | 0) < 0) << 31 >> 31 | 0, m | 0, ((m | 0) < 0) << 31 >> 31 | 0) | 0;
77157
77141
  d = ~~(+(d | 0) - ((+(m >>> 0) + 4294967296 * +(G2() | 0)) * 2 + 1));
77158
77142
  b[c >> 2] = d;
77159
77143
  break;
@@ -78196,7 +78180,7 @@ var libh3 = function(libh32) {
78196
78180
  S = k;
78197
78181
  return;
78198
78182
  }
78199
- function _a3(a3, c, d, f2, g3) {
78183
+ function _a2(a3, c, d, f2, g3) {
78200
78184
  a3 = a3 | 0;
78201
78185
  c = c | 0;
78202
78186
  d = d | 0;
@@ -78242,7 +78226,7 @@ var libh3 = function(libh32) {
78242
78226
  S = S + 16 | 0;
78243
78227
  f2 = e3;
78244
78228
  Da(a3 + 4 | 0, f2);
78245
- _a3(f2, b[a3 >> 2] | 0, c, 0, d);
78229
+ _a2(f2, b[a3 >> 2] | 0, c, 0, d);
78246
78230
  S = e3;
78247
78231
  return;
78248
78232
  }
@@ -78354,12 +78338,12 @@ var libh3 = function(libh32) {
78354
78338
  }
78355
78339
  }
78356
78340
  Gc(w3, y2, f2, a3, C4);
78357
- _a3(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78341
+ _a2(C4, b[v2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78358
78342
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78359
78343
  }
78360
78344
  if ((j | 0) < (n3 | 0)) {
78361
78345
  Da(t2, v2);
78362
- _a3(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78346
+ _a2(v2, b[F2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78363
78347
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78364
78348
  }
78365
78349
  b[E2 >> 2] = b[F2 >> 2];
@@ -78619,13 +78603,13 @@ var libh3 = function(libh32) {
78619
78603
  }
78620
78604
  Gc(A3, s3, f2, a3, w3);
78621
78605
  if (!(Hc(A3, w3) | 0) ? !(Hc(s3, w3) | 0) : 0) {
78622
- _a3(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78606
+ _a2(w3, b[x2 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78623
78607
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78624
78608
  }
78625
78609
  }
78626
78610
  if ((j | 0) < (l2 | 0)) {
78627
78611
  Da(q2, A3);
78628
- _a3(A3, b[z3 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78612
+ _a2(A3, b[z3 >> 2] | 0, k, 1, g3 + 8 + (b[g3 >> 2] << 4) | 0);
78629
78613
  b[g3 >> 2] = (b[g3 >> 2] | 0) + 1;
78630
78614
  }
78631
78615
  j = j + 1 | 0;
@@ -80953,7 +80937,7 @@ var libh3 = function(libh32) {
80953
80937
  function Zb() {
80954
80938
  return 12;
80955
80939
  }
80956
- function _b2(a3, c) {
80940
+ function _b(a3, c) {
80957
80941
  a3 = a3 | 0;
80958
80942
  c = c | 0;
80959
80943
  var d = 0, e3 = 0, f2 = 0, g3 = 0, h = 0, i2 = 0, j = 0;
@@ -84994,7 +84978,7 @@ var libh3 = function(libh32) {
84994
84978
  c = a3 + c >>> 0;
84995
84979
  return (F(b2 + d + (c >>> 0 < a3 >>> 0 | 0) >>> 0 | 0), c | 0) | 0;
84996
84980
  }
84997
- function _c2(a3, b2, c, d) {
84981
+ function _c(a3, b2, c, d) {
84998
84982
  a3 = a3 | 0;
84999
84983
  b2 = b2 | 0;
85000
84984
  c = c | 0;
@@ -85167,11 +85151,11 @@ var libh3 = function(libh32) {
85167
85151
  g3 = i2 | g3 << 1;
85168
85152
  e3 = a3 << 1 | e3 >>> 31 | 0;
85169
85153
  n3 = a3 >>> 31 | c << 1 | 0;
85170
- _c2(k | 0, d | 0, e3 | 0, n3 | 0) | 0;
85154
+ _c(k | 0, d | 0, e3 | 0, n3 | 0) | 0;
85171
85155
  p2 = G2() | 0;
85172
85156
  o2 = p2 >> 31 | ((p2 | 0) < 0 ? -1 : 0) << 1;
85173
85157
  i2 = o2 & 1;
85174
- a3 = _c2(e3 | 0, n3 | 0, o2 & m | 0, (((p2 | 0) < 0 ? -1 : 0) >> 31 | ((p2 | 0) < 0 ? -1 : 0) << 1) & l2 | 0) | 0;
85158
+ a3 = _c(e3 | 0, n3 | 0, o2 & m | 0, (((p2 | 0) < 0 ? -1 : 0) >> 31 | ((p2 | 0) < 0 ? -1 : 0) << 1) & l2 | 0) | 0;
85175
85159
  c = G2() | 0;
85176
85160
  h = h - 1 | 0;
85177
85161
  } while ((h | 0) != 0);
@@ -85398,7 +85382,7 @@ var libh3 = function(libh32) {
85398
85382
  _getH3UnidirectionalEdgeBoundary: gc,
85399
85383
  _getH3UnidirectionalEdgesFromHexagon: fc,
85400
85384
  _getOriginH3IndexFromUnidirectionalEdge: bc,
85401
- _getPentagonIndexes: _b2,
85385
+ _getPentagonIndexes: _b,
85402
85386
  _getRes0Indexes: va,
85403
85387
  _h3Distance: qc,
85404
85388
  _h3GetBaseCell: Ab,
@@ -85420,7 +85404,7 @@ var libh3 = function(libh32) {
85420
85404
  _hexAreaKm2: nb,
85421
85405
  _hexAreaM2: ob,
85422
85406
  _hexRing: ea,
85423
- _i64Subtract: _c2,
85407
+ _i64Subtract: _c,
85424
85408
  _kRing: $,
85425
85409
  _kRingDistances: aa,
85426
85410
  _llvm_minnum_f64: ed,
@@ -98966,10 +98950,10 @@ var _GeojsonEquality = class _GeojsonEquality2 {
98966
98950
  constructor(opts) {
98967
98951
  this.direction = false;
98968
98952
  this.compareProperties = true;
98969
- var _a3, _b2, _c2;
98970
- this.precision = 10 ** -((_a3 = opts == null ? void 0 : opts.precision) != null ? _a3 : 17);
98971
- this.direction = (_b2 = opts == null ? void 0 : opts.direction) != null ? _b2 : false;
98972
- this.compareProperties = (_c2 = opts == null ? void 0 : opts.compareProperties) != null ? _c2 : true;
98953
+ var _a2, _b, _c;
98954
+ this.precision = 10 ** -((_a2 = opts == null ? void 0 : opts.precision) != null ? _a2 : 17);
98955
+ this.direction = (_b = opts == null ? void 0 : opts.direction) != null ? _b : false;
98956
+ this.compareProperties = (_c = opts == null ? void 0 : opts.compareProperties) != null ? _c : true;
98973
98957
  }
98974
98958
  compare(g1, g2) {
98975
98959
  if (g1.type !== g2.type) {
@@ -110682,7 +110666,7 @@ var boundsStream$1 = {
110682
110666
  boundsStream$1.lineEnd = boundsLineEnd;
110683
110667
  if (areaRingSum$1 < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
110684
110668
  else if (deltaSum > epsilon) phi1 = 90;
110685
- else if (deltaSum < -1e-6) phi0 = -90;
110669
+ else if (deltaSum < -epsilon) phi0 = -90;
110686
110670
  range$3[0] = lambda0$1, range$3[1] = lambda1;
110687
110671
  }
110688
110672
  };
@@ -111192,7 +111176,7 @@ function merge(arrays) {
111192
111176
  }
111193
111177
  return merged;
111194
111178
  }
111195
- var clipMax = 1e9, clipMin = -1e9;
111179
+ var clipMax = 1e9, clipMin = -clipMax;
111196
111180
  function clipExtent(x02, y02, x12, y12) {
111197
111181
  function visible(x, y) {
111198
111182
  return x02 <= x && x <= x12 && y02 <= y && y <= y12;
@@ -111346,7 +111330,7 @@ function polygonContains(polygon2, point2) {
111346
111330
  }
111347
111331
  }
111348
111332
  }
111349
- return (angle2 < -1e-6 || angle2 < epsilon && sum$1 < -1e-6) ^ winding & 1;
111333
+ return (angle2 < -epsilon || angle2 < epsilon && sum$1 < -epsilon) ^ winding & 1;
111350
111334
  }
111351
111335
  var lengthSum$1 = adder(), lambda0, sinPhi0, cosPhi0;
111352
111336
  var lengthStream$1 = {
@@ -113076,16 +113060,16 @@ function requirePolygonClipping_umd() {
113076
113060
  };
113077
113061
  Tree2.prototype.keys = function() {
113078
113062
  var keys2 = [];
113079
- this.forEach(function(_a3) {
113080
- var key = _a3.key;
113063
+ this.forEach(function(_a2) {
113064
+ var key = _a2.key;
113081
113065
  return keys2.push(key);
113082
113066
  });
113083
113067
  return keys2;
113084
113068
  };
113085
113069
  Tree2.prototype.values = function() {
113086
113070
  var values2 = [];
113087
- this.forEach(function(_a3) {
113088
- var data = _a3.data;
113071
+ this.forEach(function(_a2) {
113072
+ var data = _a2.data;
113089
113073
  return values2.push(data);
113090
113074
  });
113091
113075
  return values2;
@@ -113240,7 +113224,7 @@ function requirePolygonClipping_umd() {
113240
113224
  };
113241
113225
  Tree2.prototype.update = function(key, newKey, newData) {
113242
113226
  var comparator2 = this._comparator;
113243
- var _a3 = split(key, this._root, comparator2), left = _a3.left, right = _a3.right;
113227
+ var _a2 = split(key, this._root, comparator2), left = _a2.left, right = _a2.right;
113244
113228
  if (comparator2(key, newKey) < 0) {
113245
113229
  right = insert(newKey, newData, right, comparator2);
113246
113230
  } else {
@@ -114732,8 +114716,8 @@ function requireJs$j() {
114732
114716
  if (!featureCollection2 || featureCollection2.type !== "FeatureCollection") {
114733
114717
  throw new Error("Invalid input to " + name2 + ", FeatureCollection required");
114734
114718
  }
114735
- for (var _i = 0, _a3 = featureCollection2.features; _i < _a3.length; _i++) {
114736
- var feature2 = _a3[_i];
114719
+ for (var _i = 0, _a2 = featureCollection2.features; _i < _a2.length; _i++) {
114720
+ var feature2 = _a2[_i];
114737
114721
  if (!feature2 || feature2.type !== "Feature" || !feature2.geometry) {
114738
114722
  throw new Error("Invalid input to " + name2 + ", Feature with geometry required");
114739
114723
  }
@@ -116378,24 +116362,24 @@ function requireBignumber() {
116378
116362
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
116379
116363
  v = obj[p];
116380
116364
  if (v && v.pop) {
116381
- intCheck2(v[0], -1e9, 0, p);
116365
+ intCheck2(v[0], -MAX2, 0, p);
116382
116366
  intCheck2(v[1], 0, MAX2, p);
116383
116367
  TO_EXP_NEG = v[0];
116384
116368
  TO_EXP_POS = v[1];
116385
116369
  } else {
116386
- intCheck2(v, -1e9, MAX2, p);
116370
+ intCheck2(v, -MAX2, MAX2, p);
116387
116371
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
116388
116372
  }
116389
116373
  }
116390
116374
  if (obj.hasOwnProperty(p = "RANGE")) {
116391
116375
  v = obj[p];
116392
116376
  if (v && v.pop) {
116393
- intCheck2(v[0], -1e9, -1, p);
116377
+ intCheck2(v[0], -MAX2, -1, p);
116394
116378
  intCheck2(v[1], 1, MAX2, p);
116395
116379
  MIN_EXP = v[0];
116396
116380
  MAX_EXP = v[1];
116397
116381
  } else {
116398
- intCheck2(v, -1e9, MAX2, p);
116382
+ intCheck2(v, -MAX2, MAX2, p);
116399
116383
  if (v) {
116400
116384
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
116401
116385
  } else {
@@ -116465,7 +116449,7 @@ function requireBignumber() {
116465
116449
  if (!BigNumber3.DEBUG) return true;
116466
116450
  var i2, n3, c = v.c, e2 = v.e, s2 = v.s;
116467
116451
  out: if ({}.toString.call(c) == "[object Array]") {
116468
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
116452
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX2 && e2 <= MAX2 && e2 === mathfloor2(e2)) {
116469
116453
  if (c[0] === 0) {
116470
116454
  if (e2 === 0 && c.length === 1) return true;
116471
116455
  break out;
@@ -117305,7 +117289,7 @@ function requireBignumber() {
117305
117289
  return n3;
117306
117290
  };
117307
117291
  P2.shiftedBy = function(k) {
117308
- intCheck2(k, -9007199254740991, MAX_SAFE_INTEGER2);
117292
+ intCheck2(k, -MAX_SAFE_INTEGER2, MAX_SAFE_INTEGER2);
117309
117293
  return this.times("1e" + k);
117310
117294
  };
117311
117295
  P2.squareRoot = P2.sqrt = function() {
@@ -117568,26 +117552,25 @@ function requireBignumber() {
117568
117552
  var cjs$9;
117569
117553
  var hasRequiredCjs$a;
117570
117554
  function requireCjs$a() {
117571
- var _a3, _b2, _c2, _d;
117572
117555
  if (hasRequiredCjs$a) return cjs$9;
117573
117556
  hasRequiredCjs$a = 1;
117574
- var __defProp3 = Object.defineProperty;
117557
+ var __defProp2 = Object.defineProperty;
117575
117558
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
117576
117559
  var __getOwnPropNames = Object.getOwnPropertyNames;
117577
117560
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
117578
117561
  var __export = (target, all) => {
117579
117562
  for (var name2 in all)
117580
- __defProp3(target, name2, { get: all[name2], enumerable: true });
117563
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
117581
117564
  };
117582
117565
  var __copyProps = (to, from, except, desc) => {
117583
117566
  if (from && typeof from === "object" || typeof from === "function") {
117584
117567
  for (let key of __getOwnPropNames(from))
117585
117568
  if (!__hasOwnProp2.call(to, key) && key !== except)
117586
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
117569
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
117587
117570
  }
117588
117571
  return to;
117589
117572
  };
117590
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
117573
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
117591
117574
  var src_exports = {};
117592
117575
  __export(src_exports, {
117593
117576
  SplayTreeMap: () => SplayTreeMap,
@@ -117595,10 +117578,10 @@ function requireCjs$a() {
117595
117578
  });
117596
117579
  cjs$9 = __toCommonJS(src_exports);
117597
117580
  var SplayTreeNode2 = class {
117581
+ key;
117582
+ left = null;
117583
+ right = null;
117598
117584
  constructor(key) {
117599
- __publicField(this, "key");
117600
- __publicField(this, "left", null);
117601
- __publicField(this, "right", null);
117602
117585
  this.key = key;
117603
117586
  }
117604
117587
  };
@@ -117608,9 +117591,9 @@ function requireCjs$a() {
117608
117591
  }
117609
117592
  };
117610
117593
  var SplayTreeMapNode = class _SplayTreeMapNode extends SplayTreeNode2 {
117594
+ value;
117611
117595
  constructor(key, value) {
117612
117596
  super(key);
117613
- __publicField(this, "value");
117614
117597
  this.value = value;
117615
117598
  }
117616
117599
  replaceValue(value) {
@@ -117621,11 +117604,9 @@ function requireCjs$a() {
117621
117604
  }
117622
117605
  };
117623
117606
  var SplayTree2 = class {
117624
- constructor() {
117625
- __publicField(this, "size", 0);
117626
- __publicField(this, "modificationCount", 0);
117627
- __publicField(this, "splayCount", 0);
117628
- }
117607
+ size = 0;
117608
+ modificationCount = 0;
117609
+ splayCount = 0;
117629
117610
  splay(key) {
117630
117611
  const root2 = this.root;
117631
117612
  if (root2 == null) {
@@ -117810,12 +117791,11 @@ function requireCjs$a() {
117810
117791
  }
117811
117792
  };
117812
117793
  var SplayTreeMap = class extends SplayTree2 {
117794
+ root = null;
117795
+ compare;
117796
+ validKey;
117813
117797
  constructor(compare2, isValidKey) {
117814
117798
  super();
117815
- __publicField(this, "root", null);
117816
- __publicField(this, "compare");
117817
- __publicField(this, "validKey");
117818
- __publicField(this, _a3, "[object Map]");
117819
117799
  this.compare = compare2 ?? this.defaultCompare();
117820
117800
  this.validKey = isValidKey ?? ((a2) => a2 != null && a2 != void 0);
117821
117801
  }
@@ -117981,17 +117961,17 @@ function requireCjs$a() {
117981
117961
  entries() {
117982
117962
  return this[Symbol.iterator]();
117983
117963
  }
117984
- [(_b2 = Symbol.iterator, _a3 = Symbol.toStringTag, _b2)]() {
117964
+ [Symbol.iterator]() {
117985
117965
  return new SplayTreeMapEntryIterableIterator(this.wrap());
117986
117966
  }
117967
+ [Symbol.toStringTag] = "[object Map]";
117987
117968
  };
117988
117969
  var SplayTreeSet2 = class _SplayTreeSet2 extends SplayTree2 {
117970
+ root = null;
117971
+ compare;
117972
+ validKey;
117989
117973
  constructor(compare2, isValidKey) {
117990
117974
  super();
117991
- __publicField(this, "root", null);
117992
- __publicField(this, "compare");
117993
- __publicField(this, "validKey");
117994
- __publicField(this, _c2, "[object Set]");
117995
117975
  this.compare = compare2 ?? this.defaultCompare();
117996
117976
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
117997
117977
  }
@@ -118158,16 +118138,17 @@ function requireCjs$a() {
118158
118138
  values() {
118159
118139
  return this[Symbol.iterator]();
118160
118140
  }
118161
- [(_d = Symbol.iterator, _c2 = Symbol.toStringTag, _d)]() {
118141
+ [Symbol.iterator]() {
118162
118142
  return new SplayTreeKeyIterableIterator2(this.wrap());
118163
118143
  }
118144
+ [Symbol.toStringTag] = "[object Set]";
118164
118145
  };
118165
118146
  var SplayTreeIterableIterator2 = class {
118147
+ tree;
118148
+ path = new Array();
118149
+ modificationCount = null;
118150
+ splayCount;
118166
118151
  constructor(tree) {
118167
- __publicField(this, "tree");
118168
- __publicField(this, "path", new Array());
118169
- __publicField(this, "modificationCount", null);
118170
- __publicField(this, "splayCount");
118171
118152
  this.tree = tree;
118172
118153
  this.splayCount = tree.getSplayCount();
118173
118154
  }
@@ -118286,20 +118267,20 @@ function requireCjs$9() {
118286
118267
  if (hasRequiredCjs$9) return cjs$8;
118287
118268
  hasRequiredCjs$9 = 1;
118288
118269
  var __create = Object.create;
118289
- var __defProp3 = Object.defineProperty;
118270
+ var __defProp2 = Object.defineProperty;
118290
118271
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
118291
118272
  var __getOwnPropNames = Object.getOwnPropertyNames;
118292
118273
  var __getProtoOf = Object.getPrototypeOf;
118293
118274
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
118294
118275
  var __export = (target, all) => {
118295
118276
  for (var name2 in all)
118296
- __defProp3(target, name2, { get: all[name2], enumerable: true });
118277
+ __defProp2(target, name2, { get: all[name2], enumerable: true });
118297
118278
  };
118298
118279
  var __copyProps = (to, from, except, desc) => {
118299
118280
  if (from && typeof from === "object" || typeof from === "function") {
118300
118281
  for (let key of __getOwnPropNames(from))
118301
118282
  if (!__hasOwnProp2.call(to, key) && key !== except)
118302
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
118283
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
118303
118284
  }
118304
118285
  return to;
118305
118286
  };
@@ -118308,10 +118289,10 @@ function requireCjs$9() {
118308
118289
  // file that has been converted to a CommonJS file using a Babel-
118309
118290
  // compatible transform (i.e. "__esModule" has not been set), then set
118310
118291
  // "default" to the CommonJS "module.exports" for node compatibility.
118311
- __defProp3(target, "default", { value: mod2, enumerable: true }),
118292
+ __defProp2(target, "default", { value: mod2, enumerable: true }),
118312
118293
  mod2
118313
118294
  ));
118314
- var __toCommonJS = (mod2) => __copyProps(__defProp3({}, "__esModule", { value: true }), mod2);
118295
+ var __toCommonJS = (mod2) => __copyProps(__defProp2({}, "__esModule", { value: true }), mod2);
118315
118296
  var src_exports = {};
118316
118297
  __export(src_exports, {
118317
118298
  difference: () => difference,
@@ -118431,18 +118412,11 @@ function requireCjs$9() {
118431
118412
  return { x, y };
118432
118413
  };
118433
118414
  var SweepEvent2 = class _SweepEvent2 {
118434
- // Warning: 'point' input will be modified and re-used (for performance)
118435
- constructor(point2, isLeft) {
118436
- __publicField(this, "point");
118437
- __publicField(this, "isLeft");
118438
- __publicField(this, "segment");
118439
- __publicField(this, "otherSE");
118440
- __publicField(this, "consumedBy");
118441
- if (point2.events === void 0) point2.events = [this];
118442
- else point2.events.push(this);
118443
- this.point = point2;
118444
- this.isLeft = isLeft;
118445
- }
118415
+ point;
118416
+ isLeft;
118417
+ segment;
118418
+ otherSE;
118419
+ consumedBy;
118446
118420
  // for ordering sweep events in the sweep event queue
118447
118421
  static compare(a2, b) {
118448
118422
  const ptCmp = _SweepEvent2.comparePoints(a2.point, b.point);
@@ -118459,6 +118433,13 @@ function requireCjs$9() {
118459
118433
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
118460
118434
  return 0;
118461
118435
  }
118436
+ // Warning: 'point' input will be modified and re-used (for performance)
118437
+ constructor(point2, isLeft) {
118438
+ if (point2.events === void 0) point2.events = [this];
118439
+ else point2.events.push(this);
118440
+ this.point = point2;
118441
+ this.isLeft = isLeft;
118442
+ }
118462
118443
  link(other) {
118463
118444
  if (other.point === this.point) {
118464
118445
  throw new Error("Tried to link already linked events");
@@ -118537,17 +118518,10 @@ function requireCjs$9() {
118537
118518
  }
118538
118519
  };
118539
118520
  var RingOut2 = class _RingOut2 {
118540
- constructor(events2) {
118541
- __publicField(this, "events");
118542
- __publicField(this, "poly");
118543
- __publicField(this, "_isExteriorRing");
118544
- __publicField(this, "_enclosingRing");
118545
- this.events = events2;
118546
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
118547
- events2[i2].segment.ringOut = this;
118548
- }
118549
- this.poly = null;
118550
- }
118521
+ events;
118522
+ poly;
118523
+ _isExteriorRing;
118524
+ _enclosingRing;
118551
118525
  /* Given the segments from the sweep line pass, compute & return a series
118552
118526
  * of closed rings from all the segments marked to be part of the result */
118553
118527
  static factory(allSegments) {
@@ -118606,6 +118580,13 @@ function requireCjs$9() {
118606
118580
  }
118607
118581
  return ringsOut;
118608
118582
  }
118583
+ constructor(events2) {
118584
+ this.events = events2;
118585
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
118586
+ events2[i2].segment.ringOut = this;
118587
+ }
118588
+ this.poly = null;
118589
+ }
118609
118590
  getGeom() {
118610
118591
  let prevPt = this.events[0].point;
118611
118592
  const points = [prevPt];
@@ -118644,7 +118625,6 @@ function requireCjs$9() {
118644
118625
  }
118645
118626
  /* Returns the ring that encloses this one, if any */
118646
118627
  _calcEnclosingRing() {
118647
- var _a3, _b2;
118648
118628
  let leftMostEvt = this.events[0];
118649
118629
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
118650
118630
  const evt = this.events[i2];
@@ -118656,9 +118636,9 @@ function requireCjs$9() {
118656
118636
  if (!prevSeg) return null;
118657
118637
  if (!prevPrevSeg) return prevSeg.ringOut;
118658
118638
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
118659
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
118639
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
118660
118640
  return prevSeg.ringOut;
118661
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
118641
+ } else return prevSeg.ringOut?.enclosingRing();
118662
118642
  }
118663
118643
  prevSeg = prevPrevSeg.prevInResult();
118664
118644
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -118666,9 +118646,9 @@ function requireCjs$9() {
118666
118646
  }
118667
118647
  };
118668
118648
  var PolyOut2 = class {
118649
+ exteriorRing;
118650
+ interiorRings;
118669
118651
  constructor(exteriorRing) {
118670
- __publicField(this, "exteriorRing");
118671
- __publicField(this, "interiorRings");
118672
118652
  this.exteriorRing = exteriorRing;
118673
118653
  exteriorRing.poly = this;
118674
118654
  this.interiorRings = [];
@@ -118690,9 +118670,9 @@ function requireCjs$9() {
118690
118670
  }
118691
118671
  };
118692
118672
  var MultiPolyOut2 = class {
118673
+ rings;
118674
+ polys;
118693
118675
  constructor(rings) {
118694
- __publicField(this, "rings");
118695
- __publicField(this, "polys");
118696
118676
  this.rings = rings;
118697
118677
  this.polys = this._composePolys(rings);
118698
118678
  }
@@ -118706,7 +118686,6 @@ function requireCjs$9() {
118706
118686
  return geom;
118707
118687
  }
118708
118688
  _composePolys(rings) {
118709
- var _a3;
118710
118689
  const polys = [];
118711
118690
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
118712
118691
  const ring = rings[i2];
@@ -118714,8 +118693,8 @@ function requireCjs$9() {
118714
118693
  if (ring.isExteriorRing()) polys.push(new PolyOut2(ring));
118715
118694
  else {
118716
118695
  const enclosingRing = ring.enclosingRing();
118717
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut2(enclosingRing));
118718
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
118696
+ if (!enclosingRing?.poly) polys.push(new PolyOut2(enclosingRing));
118697
+ enclosingRing?.poly?.addInterior(ring);
118719
118698
  }
118720
118699
  }
118721
118700
  return polys;
@@ -118723,10 +118702,10 @@ function requireCjs$9() {
118723
118702
  };
118724
118703
  var import_splaytree_ts2 = requireCjs$a();
118725
118704
  var SweepLine2 = class {
118705
+ queue;
118706
+ tree;
118707
+ segments;
118726
118708
  constructor(queue, comparator2 = Segment3.compare) {
118727
- __publicField(this, "queue");
118728
- __publicField(this, "tree");
118729
- __publicField(this, "segments");
118730
118709
  this.queue = queue;
118731
118710
  this.tree = new import_splaytree_ts2.SplayTreeSet(comparator2);
118732
118711
  this.segments = [];
@@ -118835,10 +118814,8 @@ function requireCjs$9() {
118835
118814
  }
118836
118815
  };
118837
118816
  var Operation2 = class {
118838
- constructor() {
118839
- __publicField(this, "type");
118840
- __publicField(this, "numMultiPolys");
118841
- }
118817
+ type;
118818
+ numMultiPolys;
118842
118819
  run(type, geom, moreGeoms) {
118843
118820
  operation2.type = type;
118844
118821
  const multipolys = [new MultiPolyIn2(geom, true)];
@@ -118898,31 +118875,18 @@ function requireCjs$9() {
118898
118875
  var operation_default2 = operation2;
118899
118876
  var segmentId2 = 0;
118900
118877
  var Segment3 = class _Segment2 {
118901
- /* Warning: a reference to ringWindings input will be stored,
118902
- * and possibly will be later modified */
118903
- constructor(leftSE, rightSE, rings, windings) {
118904
- __publicField(this, "id");
118905
- __publicField(this, "leftSE");
118906
- __publicField(this, "rightSE");
118907
- __publicField(this, "rings");
118908
- __publicField(this, "windings");
118909
- __publicField(this, "ringOut");
118910
- __publicField(this, "consumedBy");
118911
- __publicField(this, "prev");
118912
- __publicField(this, "_prevInResult");
118913
- __publicField(this, "_beforeState");
118914
- __publicField(this, "_afterState");
118915
- __publicField(this, "_isInResult");
118916
- this.id = ++segmentId2;
118917
- this.leftSE = leftSE;
118918
- leftSE.segment = this;
118919
- leftSE.otherSE = rightSE;
118920
- this.rightSE = rightSE;
118921
- rightSE.segment = this;
118922
- rightSE.otherSE = leftSE;
118923
- this.rings = rings;
118924
- this.windings = windings;
118925
- }
118878
+ id;
118879
+ leftSE;
118880
+ rightSE;
118881
+ rings;
118882
+ windings;
118883
+ ringOut;
118884
+ consumedBy;
118885
+ prev;
118886
+ _prevInResult;
118887
+ _beforeState;
118888
+ _afterState;
118889
+ _isInResult;
118926
118890
  /* This compare() function is for ordering segments in the sweep
118927
118891
  * line tree, and does so according to the following criteria:
118928
118892
  *
@@ -118994,6 +118958,19 @@ function requireCjs$9() {
118994
118958
  if (a2.id > b.id) return 1;
118995
118959
  return 0;
118996
118960
  }
118961
+ /* Warning: a reference to ringWindings input will be stored,
118962
+ * and possibly will be later modified */
118963
+ constructor(leftSE, rightSE, rings, windings) {
118964
+ this.id = ++segmentId2;
118965
+ this.leftSE = leftSE;
118966
+ leftSE.segment = this;
118967
+ leftSE.otherSE = rightSE;
118968
+ this.rightSE = rightSE;
118969
+ rightSE.segment = this;
118970
+ rightSE.otherSE = leftSE;
118971
+ this.rings = rings;
118972
+ this.windings = windings;
118973
+ }
118997
118974
  static fromRing(pt1, pt2, ring) {
118998
118975
  let leftPt, rightPt, winding;
118999
118976
  const cmpPts = SweepEvent2.comparePoints(pt1, pt2);
@@ -119294,11 +119271,11 @@ function requireCjs$9() {
119294
119271
  }
119295
119272
  };
119296
119273
  var RingIn2 = class {
119274
+ poly;
119275
+ isExterior;
119276
+ segments;
119277
+ bbox;
119297
119278
  constructor(geomRing, poly, isExterior) {
119298
- __publicField(this, "poly");
119299
- __publicField(this, "isExterior");
119300
- __publicField(this, "segments");
119301
- __publicField(this, "bbox");
119302
119279
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
119303
119280
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
119304
119281
  }
@@ -119342,11 +119319,11 @@ function requireCjs$9() {
119342
119319
  }
119343
119320
  };
119344
119321
  var PolyIn2 = class {
119322
+ multiPoly;
119323
+ exteriorRing;
119324
+ interiorRings;
119325
+ bbox;
119345
119326
  constructor(geomPoly, multiPoly) {
119346
- __publicField(this, "multiPoly");
119347
- __publicField(this, "exteriorRing");
119348
- __publicField(this, "interiorRings");
119349
- __publicField(this, "bbox");
119350
119327
  if (!Array.isArray(geomPoly)) {
119351
119328
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
119352
119329
  }
@@ -119378,10 +119355,10 @@ function requireCjs$9() {
119378
119355
  }
119379
119356
  };
119380
119357
  var MultiPolyIn2 = class {
119358
+ isSubject;
119359
+ polys;
119360
+ bbox;
119381
119361
  constructor(geom, isSubject) {
119382
- __publicField(this, "isSubject");
119383
- __publicField(this, "polys");
119384
- __publicField(this, "bbox");
119385
119362
  if (!Array.isArray(geom)) {
119386
119363
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
119387
119364
  }
@@ -120292,9 +120269,9 @@ function requireUtils$2() {
120292
120269
  }
120293
120270
  break;
120294
120271
  case "MultiPolygon":
120295
- for (var _a3 = 0; _a3 < geometry2.coordinates.length; _a3++) {
120296
- for (var b = 0; b < geometry2.coordinates[_a3].length; b++) {
120297
- handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a3][b], [_a3, b], featureIndex, editHandleType));
120272
+ for (var _a2 = 0; _a2 < geometry2.coordinates.length; _a2++) {
120273
+ for (var b = 0; b < geometry2.coordinates[_a2].length; b++) {
120274
+ handles = handles.concat(getEditHandlesForCoordinates(geometry2.coordinates[_a2][b], [_a2, b], featureIndex, editHandleType));
120298
120275
  handles = handles.slice(0, -1);
120299
120276
  }
120300
120277
  }
@@ -121414,21 +121391,21 @@ function requireCjs$6() {
121414
121391
  if (hasRequiredCjs$6) return cjs$6;
121415
121392
  hasRequiredCjs$6 = 1;
121416
121393
  Object.defineProperty(cjs$6, "__esModule", { value: true });
121417
- var __defProp3 = Object.defineProperty;
121394
+ var __defProp2 = Object.defineProperty;
121418
121395
  var __defProps2 = Object.defineProperties;
121419
121396
  var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
121420
121397
  var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
121421
121398
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
121422
121399
  var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
121423
- var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
121400
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
121424
121401
  var __spreadValues2 = (a2, b) => {
121425
121402
  for (var prop in b || (b = {}))
121426
121403
  if (__hasOwnProp2.call(b, prop))
121427
- __defNormalProp3(a2, prop, b[prop]);
121404
+ __defNormalProp2(a2, prop, b[prop]);
121428
121405
  if (__getOwnPropSymbols2)
121429
121406
  for (var prop of __getOwnPropSymbols2(b)) {
121430
121407
  if (__propIsEnum2.call(b, prop))
121431
- __defNormalProp3(a2, prop, b[prop]);
121408
+ __defNormalProp2(a2, prop, b[prop]);
121432
121409
  }
121433
121410
  return a2;
121434
121411
  };
@@ -124454,9 +124431,9 @@ function requireExtrudeMode() {
124454
124431
  size2 = coordinates2[a2][b].length;
124455
124432
  }
124456
124433
  } else {
124457
- var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b2 = _positionIndexes2[0];
124458
- if (coordinates2.length && coordinates2[_b2].length) {
124459
- size2 = coordinates2[_b2].length;
124434
+ var _positionIndexes2 = _slicedToArray(positionIndexes, 1), _b = _positionIndexes2[0];
124435
+ if (coordinates2.length && coordinates2[_b].length) {
124436
+ size2 = coordinates2[_b].length;
124460
124437
  }
124461
124438
  }
124462
124439
  }
@@ -124525,9 +124502,9 @@ function requireExtrudeMode() {
124525
124502
  p1 = coordinates2[a2][b][c];
124526
124503
  }
124527
124504
  } else {
124528
- var _positionIndexes4 = _slicedToArray(positionIndexes, 2), _b2 = _positionIndexes4[0], _c2 = _positionIndexes4[1];
124505
+ var _positionIndexes4 = _slicedToArray(positionIndexes, 2), _b2 = _positionIndexes4[0], _c = _positionIndexes4[1];
124529
124506
  if (coordinates2.length && coordinates2[_b2].length) {
124530
- p1 = coordinates2[_b2][_c2];
124507
+ p1 = coordinates2[_b2][_c];
124531
124508
  }
124532
124509
  }
124533
124510
  }
@@ -135236,7 +135213,7 @@ class SelectionLayer extends CompositeLayer {
135236
135213
  obsLayers.forEach((obsLayer) => {
135237
135214
  const { getObsCoords, obsQuadTree, obsIndex, onSelect: layerOnSelect } = obsLayer;
135238
135215
  const pickingInfos = [];
135239
- obsQuadTree == null ? void 0 : obsQuadTree.visit((node2, x02, y02, x12, y12) => {
135216
+ obsQuadTree?.visit((node2, x02, y02, x12, y12) => {
135240
135217
  const nodePoints = [[[x02, y02], [x12, y02], [x12, y12], [x02, y12], [x02, y02]]];
135241
135218
  const nodePolygon = polygon(nodePoints);
135242
135219
  const nodePolygonContainsSelectedPolygon = booleanContains(nodePolygon, selectedPolygon);
@@ -135340,6 +135317,8 @@ const PIXELATED_TEXTURE_PARAMETERS = {
135340
135317
  [GL$1.TEXTURE_WRAP_T]: GL$1.CLAMP_TO_EDGE
135341
135318
  };
135342
135319
  const GLSL_COLORMAPS = [
135320
+ // NOTE: the ordering of these is important,
135321
+ // as the shader code in bitmask-layer-beta-shaders hardcodes their indices.
135343
135322
  "plasma",
135344
135323
  "viridis",
135345
135324
  "jet",
@@ -135821,13 +135800,12 @@ class HeatmapBitmapLayer extends BitmapLayer$1 {
135821
135800
  });
135822
135801
  }
135823
135802
  updateState(args) {
135824
- var _a3;
135825
135803
  super.updateState(args);
135826
135804
  this.loadTexture(this.props.image);
135827
135805
  const { props, oldProps } = args;
135828
135806
  if (props.colormap !== oldProps.colormap) {
135829
135807
  const { gl } = this.context;
135830
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
135808
+ this.state.model?.delete();
135831
135809
  this.state.model = this._getModel(gl);
135832
135810
  this.getAttributeManager().invalidateAll();
135833
135811
  }
@@ -136197,12 +136175,11 @@ class PaddedExpressionHeatmapBitmapLayer extends BitmapLayer$1 {
136197
136175
  });
136198
136176
  }
136199
136177
  updateState(args) {
136200
- var _a3;
136201
136178
  super.updateState(args);
136202
136179
  const { props, oldProps } = args;
136203
136180
  if (props.colormap !== oldProps.colormap) {
136204
136181
  const { gl } = this.context;
136205
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
136182
+ this.state.model?.delete();
136206
136183
  this.state.model = this._getModel(gl);
136207
136184
  this.getAttributeManager().invalidateAll();
136208
136185
  }
@@ -136316,21 +136293,20 @@ class ScaledExpressionExtension extends LayerExtension {
136316
136293
  };
136317
136294
  }
136318
136295
  updateState({ props, oldProps }) {
136319
- var _a3, _b2, _c2, _d;
136320
136296
  if (props.colormap !== oldProps.colormap) {
136321
136297
  const { gl } = this.context;
136322
136298
  if (this.state.model) {
136323
- (_a3 = this.state.model) == null ? void 0 : _a3.delete();
136299
+ this.state.model?.delete();
136324
136300
  this.state.model = this._getModel(gl);
136325
136301
  } else {
136326
136302
  if (this.state.models) {
136327
- (_b2 = this.state.models) == null ? void 0 : _b2.forEach((model) => model == null ? void 0 : model.delete());
136303
+ this.state.models?.forEach((model) => model?.delete());
136328
136304
  }
136329
136305
  if (this.state.topModel) {
136330
- (_c2 = this.state.topModel) == null ? void 0 : _c2.delete();
136306
+ this.state.topModel?.delete();
136331
136307
  }
136332
136308
  if (this.state.sideModel) {
136333
- (_d = this.state.sideModel) == null ? void 0 : _d.delete();
136309
+ this.state.sideModel?.delete();
136334
136310
  }
136335
136311
  if (this._getModels) {
136336
136312
  this.setState(this._getModels(this.context.gl));
@@ -136371,10 +136347,10 @@ class ScaledExpressionExtension extends LayerExtension {
136371
136347
  uColorScaleRange: [colorScaleLo, colorScaleHi],
136372
136348
  uIsExpressionMode: isExpressionMode
136373
136349
  };
136374
- model == null ? void 0 : model.setUniforms(uniforms);
136375
- models == null ? void 0 : models.forEach((m) => m.setUniforms(uniforms));
136376
- topModel == null ? void 0 : topModel.setUniforms(uniforms);
136377
- sideModel == null ? void 0 : sideModel.setUniforms(uniforms);
136350
+ model?.setUniforms(uniforms);
136351
+ models?.forEach((m) => m.setUniforms(uniforms));
136352
+ topModel?.setUniforms(uniforms);
136353
+ sideModel?.setUniforms(uniforms);
136378
136354
  }
136379
136355
  }
136380
136356
  ScaledExpressionExtension.extensionName = "ScaledExpressionExtension";
@@ -137113,22 +137089,22 @@ async function getDecoder(fileDirectory) {
137113
137089
  const Decoder = await importFn();
137114
137090
  return new Decoder(fileDirectory);
137115
137091
  }
137116
- addDecoder([void 0, 1], () => import("./raw-DTPVJ1o9.js").then((m) => m.default));
137117
- addDecoder(5, () => import("./lzw-CiXrXL8r.js").then((m) => m.default));
137092
+ addDecoder([void 0, 1], () => import("./raw-BP5eKOA5.js").then((m) => m.default));
137093
+ addDecoder(5, () => import("./lzw-DvlaVaG-.js").then((m) => m.default));
137118
137094
  addDecoder(6, () => {
137119
137095
  throw new Error("old style JPEG compression is not supported.");
137120
137096
  });
137121
- addDecoder(7, () => import("./jpeg-uLYxf0zU.js").then((m) => m.default));
137122
- addDecoder([8, 32946], () => import("./deflate-Dwj2TkFo.js").then((m) => m.default));
137123
- addDecoder(32773, () => import("./packbits-jRtcxRzM.js").then((m) => m.default));
137097
+ addDecoder(7, () => import("./jpeg-XX08oKrs.js").then((m) => m.default));
137098
+ addDecoder([8, 32946], () => import("./deflate-C-zGDPFg.js").then((m) => m.default));
137099
+ addDecoder(32773, () => import("./packbits-CfkQ2l4M.js").then((m) => m.default));
137124
137100
  addDecoder(
137125
137101
  34887,
137126
- () => import("./lerc-DgruiVGI.js").then(async (m) => {
137102
+ () => import("./lerc-DTLAzplT.js").then(async (m) => {
137127
137103
  await m.zstd.init();
137128
137104
  return m;
137129
137105
  }).then((m) => m.default)
137130
137106
  );
137131
- addDecoder(50001, () => import("./webimage-CXJ7hRD-.js").then((m) => m.default));
137107
+ addDecoder(50001, () => import("./webimage-C1LCHbGi.js").then((m) => m.default));
137132
137108
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
137133
137109
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
137134
137110
  }
@@ -145317,9 +145293,8 @@ function isText(node2) {
145317
145293
  return node2.nodeType === 3;
145318
145294
  }
145319
145295
  function xmlToJson(xmlNode, options) {
145320
- var _a3;
145321
145296
  if (isText(xmlNode)) {
145322
- return ((_a3 = xmlNode.nodeValue) == null ? void 0 : _a3.trim()) ?? "";
145297
+ return xmlNode.nodeValue?.trim() ?? "";
145323
145298
  }
145324
145299
  if (xmlNode.childNodes.length === 0 && (!xmlNode.attributes || xmlNode.attributes.length === 0)) {
145325
145300
  return "";
@@ -145633,14 +145608,13 @@ class TiffPixelSource {
145633
145608
  return this._readRasters(image2, { window: window2, width, height, signal });
145634
145609
  }
145635
145610
  async _readRasters(image2, props) {
145636
- var _a3;
145637
145611
  const interleave = isInterleaved$2(this.shape);
145638
145612
  const raster = await image2.readRasters({
145639
145613
  interleave,
145640
145614
  ...props,
145641
145615
  pool: this.pool
145642
145616
  });
145643
- if ((_a3 = props == null ? void 0 : props.signal) == null ? void 0 : _a3.aborted) {
145617
+ if (props?.signal?.aborted) {
145644
145618
  throw SIGNAL_ABORTED;
145645
145619
  }
145646
145620
  const data = interleave ? raster : raster[0];
@@ -145913,10 +145887,10 @@ function getIndexer(labels) {
145913
145887
  return selection;
145914
145888
  };
145915
145889
  }
145916
- var __defProp2 = Object.defineProperty;
145917
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
145918
- var __publicField2 = (obj, key, value) => {
145919
- __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
145890
+ var __defProp = Object.defineProperty;
145891
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
145892
+ var __publicField = (obj, key, value) => {
145893
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
145920
145894
  return value;
145921
145895
  };
145922
145896
  const DTYPE_LOOKUP = {
@@ -145938,8 +145912,8 @@ class ZarrPixelSource {
145938
145912
  constructor(data, labels, tileSize) {
145939
145913
  this.labels = labels;
145940
145914
  this.tileSize = tileSize;
145941
- __publicField2(this, "_data");
145942
- __publicField2(this, "_indexer");
145915
+ __publicField(this, "_data");
145916
+ __publicField(this, "_indexer");
145943
145917
  this._indexer = getIndexer(labels);
145944
145918
  this._data = data;
145945
145919
  }
@@ -147509,8 +147483,7 @@ const defaultProps$4$1 = {
147509
147483
  };
147510
147484
  const AdditiveColormapExtension = class extends LayerExtension {
147511
147485
  getShaders() {
147512
- var _a3;
147513
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$4$1.colormap.value;
147486
+ const name2 = this?.props?.colormap || defaultProps$4$1.colormap.value;
147514
147487
  const apply_cmap = cmaps[name2];
147515
147488
  if (!apply_cmap) {
147516
147489
  throw Error(`No colormap named ${name2} found in registry`);
@@ -147528,7 +147501,6 @@ const AdditiveColormapExtension = class extends LayerExtension {
147528
147501
  }
147529
147502
  }
147530
147503
  draw() {
147531
- var _a3;
147532
147504
  const {
147533
147505
  useTransparentColor = defaultProps$4$1.useTransparentColor.value,
147534
147506
  opacity = defaultProps$4$1.opacity.value
@@ -147537,7 +147509,7 @@ const AdditiveColormapExtension = class extends LayerExtension {
147537
147509
  opacity,
147538
147510
  useTransparentColor
147539
147511
  };
147540
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147512
+ this.state.model?.setUniforms(uniforms);
147541
147513
  }
147542
147514
  };
147543
147515
  AdditiveColormapExtension.extensionName = "AdditiveColormapExtension";
@@ -147631,7 +147603,6 @@ const ColorPaletteExtension = class extends LayerExtension {
147631
147603
  };
147632
147604
  }
147633
147605
  draw() {
147634
- var _a3;
147635
147606
  const {
147636
147607
  colors,
147637
147608
  channelsVisible,
@@ -147649,7 +147620,7 @@ const ColorPaletteExtension = class extends LayerExtension {
147649
147620
  transparentColor: (transparentColor || [0, 0, 0]).map((i2) => i2 / 255),
147650
147621
  useTransparentColor: Boolean(useTransparentColor)
147651
147622
  };
147652
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147623
+ this.state.model?.setUniforms(uniforms);
147653
147624
  }
147654
147625
  };
147655
147626
  ColorPaletteExtension.extensionName = "ColorPaletteExtension";
@@ -147798,7 +147769,6 @@ const LensExtension = class extends LayerExtension {
147798
147769
  this.setState({ onMouseMove, unprojectLensBounds: [0, 0, 0, 0] });
147799
147770
  }
147800
147771
  draw() {
147801
- var _a3;
147802
147772
  const { unprojectLensBounds = [0, 0, 0, 0] } = this.state;
147803
147773
  const {
147804
147774
  bounds: bounds2,
@@ -147832,15 +147802,14 @@ const LensExtension = class extends LayerExtension {
147832
147802
  lensBorderRadius,
147833
147803
  colors: paddedColors
147834
147804
  };
147835
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147805
+ this.state.model?.setUniforms(uniforms);
147836
147806
  }
147837
147807
  finalizeState() {
147838
- var _a3, _b2, _c2;
147839
147808
  if (this.context.deck) {
147840
147809
  this.context.deck.eventManager.off({
147841
- pointermove: (_a3 = this.state) == null ? void 0 : _a3.onMouseMove,
147842
- pointerleave: (_b2 = this.state) == null ? void 0 : _b2.onMouseMove,
147843
- wheel: (_c2 = this.state) == null ? void 0 : _c2.onMouseMove
147810
+ pointermove: this.state?.onMouseMove,
147811
+ pointerleave: this.state?.onMouseMove,
147812
+ wheel: this.state?.onMouseMove
147844
147813
  });
147845
147814
  }
147846
147815
  }
@@ -147867,8 +147836,7 @@ const BaseExtension$1 = class BaseExtension extends LayerExtension {
147867
147836
  this.opts = this.opts || {};
147868
147837
  }
147869
147838
  getShaders() {
147870
- var _a3;
147871
- const name2 = ((_a3 = this == null ? void 0 : this.props) == null ? void 0 : _a3.colormap) || defaultProps$1$2.colormap.value;
147839
+ const name2 = this?.props?.colormap || defaultProps$1$2.colormap.value;
147872
147840
  const apply_cmap = cmaps[name2];
147873
147841
  return {
147874
147842
  ...super.getShaders(),
@@ -147976,7 +147944,6 @@ const BaseExtension2 = class extends LayerExtension {
147976
147944
  this.opts = this.opts || {};
147977
147945
  }
147978
147946
  draw() {
147979
- var _a3;
147980
147947
  const { colors, channelsVisible } = this.props;
147981
147948
  const paddedColors = padColors({
147982
147949
  channelsVisible: channelsVisible || this.selections.map(() => true),
@@ -147985,7 +147952,7 @@ const BaseExtension2 = class extends LayerExtension {
147985
147952
  const uniforms = {
147986
147953
  colors: paddedColors
147987
147954
  };
147988
- (_a3 = this.state.model) == null ? void 0 : _a3.setUniforms(uniforms);
147955
+ this.state.model?.setUniforms(uniforms);
147989
147956
  }
147990
147957
  };
147991
147958
  BaseExtension2.extensionName = "BaseExtension";
@@ -148124,9 +148091,8 @@ function padContrastLimits({
148124
148091
  return paddedContrastLimits;
148125
148092
  }
148126
148093
  function getPhysicalSizeScalingMatrix(loader) {
148127
- var _a3;
148128
- const { x, y, z: z2 } = ((_a3 = loader == null ? void 0 : loader.meta) == null ? void 0 : _a3.physicalSizes) ?? {};
148129
- if ((x == null ? void 0 : x.size) && (y == null ? void 0 : y.size) && (z2 == null ? void 0 : z2.size)) {
148094
+ const { x, y, z: z2 } = loader?.meta?.physicalSizes ?? {};
148095
+ if (x?.size && y?.size && z2?.size) {
148130
148096
  const min2 = Math.min(z2.size, x.size, y.size);
148131
148097
  const ratio = [x.size / min2, y.size / min2, z2.size / min2];
148132
148098
  return new Matrix4().scale(ratio);
@@ -148353,11 +148319,11 @@ const XRLayer = class extends Layer {
148353
148319
  }
148354
148320
  _isHookDefinedByExtensions(hookName) {
148355
148321
  const { extensions } = this.props;
148356
- return extensions == null ? void 0 : extensions.some((e2) => {
148322
+ return extensions?.some((e2) => {
148357
148323
  const shaders = e2.getShaders();
148358
148324
  const { inject: inject2 = {}, modules = [] } = shaders;
148359
148325
  const definesInjection = inject2[hookName];
148360
- const moduleDefinesInjection = modules.some((m) => m == null ? void 0 : m.inject[hookName]);
148326
+ const moduleDefinesInjection = modules.some((m) => m?.inject[hookName]);
148361
148327
  return definesInjection || moduleDefinesInjection;
148362
148328
  });
148363
148329
  }
@@ -148406,7 +148372,6 @@ const XRLayer = class extends Layer {
148406
148372
  * and loading any textures that need be loading.
148407
148373
  */
148408
148374
  updateState({ props, oldProps, changeFlags, ...rest }) {
148409
- var _a3, _b2;
148410
148375
  super.updateState({ props, oldProps, changeFlags, ...rest });
148411
148376
  if (changeFlags.extensionsChanged || props.interpolation !== oldProps.interpolation) {
148412
148377
  const { gl } = this.context;
@@ -148416,7 +148381,7 @@ const XRLayer = class extends Layer {
148416
148381
  this.setState({ model: this._getModel(gl) });
148417
148382
  this.getAttributeManager().invalidateAll();
148418
148383
  }
148419
- if (props.channelData !== oldProps.channelData && ((_a3 = props.channelData) == null ? void 0 : _a3.data) !== ((_b2 = oldProps.channelData) == null ? void 0 : _b2.data) || props.interpolation !== oldProps.interpolation) {
148384
+ if (props.channelData !== oldProps.channelData && props.channelData?.data !== oldProps.channelData?.data || props.interpolation !== oldProps.interpolation) {
148420
148385
  this.loadChannelTextures(props.channelData);
148421
148386
  }
148422
148387
  const attributeManager = this.getAttributeManager();
@@ -148515,7 +148480,6 @@ const XRLayer = class extends Layer {
148515
148480
  * This function creates textures from the data
148516
148481
  */
148517
148482
  dataToTexture(data, width, height) {
148518
- var _a3;
148519
148483
  const { interpolation } = this.props;
148520
148484
  const attrs = getRenderingAttrs$1(
148521
148485
  this.props.dtype,
@@ -148525,7 +148489,7 @@ const XRLayer = class extends Layer {
148525
148489
  return new Texture2D(this.context.gl, {
148526
148490
  width,
148527
148491
  height,
148528
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
148492
+ data: attrs.cast?.(data) ?? data,
148529
148493
  // we don't want or need mimaps
148530
148494
  mipmaps: false,
148531
148495
  parameters: {
@@ -148784,11 +148748,10 @@ const ImageLayer = class extends CompositeLayer {
148784
148748
  const getRaster = (selection) => loader.getRaster({ selection, signal });
148785
148749
  const dataPromises = selections.map(getRaster);
148786
148750
  Promise.all(dataPromises).then((rasters) => {
148787
- var _a3, _b2;
148788
148751
  const raster = {
148789
148752
  data: rasters.map((d) => d.data),
148790
- width: (_a3 = rasters[0]) == null ? void 0 : _a3.width,
148791
- height: (_b2 = rasters[0]) == null ? void 0 : _b2.height
148753
+ width: rasters[0]?.width,
148754
+ height: rasters[0]?.height
148792
148755
  };
148793
148756
  if (isInterleaved$2(loader.shape)) {
148794
148757
  raster.data = raster.data[0];
@@ -149509,13 +149472,13 @@ const XR3DLayer = class extends Layer {
149509
149472
  }
149510
149473
  _isHookDefinedByExtensions(hookName) {
149511
149474
  const { extensions } = this.props;
149512
- return extensions == null ? void 0 : extensions.some((e2) => {
149475
+ return extensions?.some((e2) => {
149513
149476
  const shaders = e2.getShaders();
149514
149477
  if (shaders) {
149515
149478
  const { inject: inject2 = {}, modules = [] } = shaders;
149516
149479
  const definesInjection = inject2[hookName];
149517
149480
  const moduleDefinesInjection = modules.some(
149518
- (m) => m.inject && (m == null ? void 0 : m.inject[hookName])
149481
+ (m) => m.inject && m?.inject[hookName]
149519
149482
  );
149520
149483
  return definesInjection || moduleDefinesInjection;
149521
149484
  }
@@ -149560,7 +149523,6 @@ const XR3DLayer = class extends Layer {
149560
149523
  * and loading any textures that need be loading.
149561
149524
  */
149562
149525
  updateState({ props, oldProps, changeFlags }) {
149563
- var _a3, _b2;
149564
149526
  if (changeFlags.extensionsChanged || props.colormap !== oldProps.colormap || props.renderingMode !== oldProps.renderingMode || props.clippingPlanes.length !== oldProps.clippingPlanes.length) {
149565
149527
  const { gl } = this.context;
149566
149528
  if (this.state.model) {
@@ -149568,7 +149530,7 @@ const XR3DLayer = class extends Layer {
149568
149530
  }
149569
149531
  this.setState({ model: this._getModel(gl) });
149570
149532
  }
149571
- if (props.channelData && ((_a3 = props == null ? void 0 : props.channelData) == null ? void 0 : _a3.data) !== ((_b2 = oldProps == null ? void 0 : oldProps.channelData) == null ? void 0 : _b2.data)) {
149533
+ if (props.channelData && props?.channelData?.data !== oldProps?.channelData?.data) {
149572
149534
  this.loadTexture(props.channelData);
149573
149535
  }
149574
149536
  }
@@ -149689,13 +149651,12 @@ const XR3DLayer = class extends Layer {
149689
149651
  * This function creates textures from the data
149690
149652
  */
149691
149653
  dataToTexture(data, width, height, depth) {
149692
- var _a3;
149693
149654
  const attrs = getRenderingAttrs();
149694
149655
  const texture = new Texture3D(this.context.gl, {
149695
149656
  width,
149696
149657
  height,
149697
149658
  depth,
149698
- data: ((_a3 = attrs.cast) == null ? void 0 : _a3.call(attrs, data)) ?? data,
149659
+ data: attrs.cast?.(data) ?? data,
149699
149660
  // ? Seems to be a luma.gl bug. Looks like Texture2D is wrong or this is but these are flipped somewhere.
149700
149661
  format: attrs.dataFormat,
149701
149662
  dataFormat: attrs.format,
@@ -149868,15 +149829,14 @@ const VolumeLayer = class extends CompositeLayer {
149868
149829
  loader[resolution]
149869
149830
  );
149870
149831
  Promise.all(volumePromises).then((volumes) => {
149871
- var _a3, _b2, _c2;
149872
149832
  if (onViewportLoad) {
149873
149833
  onViewportLoad(volumes);
149874
149834
  }
149875
149835
  const volume = {
149876
149836
  data: volumes.map((d) => d.data),
149877
- width: (_a3 = volumes[0]) == null ? void 0 : _a3.width,
149878
- height: (_b2 = volumes[0]) == null ? void 0 : _b2.height,
149879
- depth: (_c2 = volumes[0]) == null ? void 0 : _c2.depth
149837
+ width: volumes[0]?.width,
149838
+ height: volumes[0]?.height,
149839
+ depth: volumes[0]?.depth
149880
149840
  };
149881
149841
  this.setState({
149882
149842
  ...volume,
@@ -150200,7 +150160,7 @@ uniform float channelOpacities[7];
150200
150160
  uniform bool channelIsStaticColorMode[7]; // TODO: should this be a single float?
150201
150161
  uniform bool channelIsSetColorMode[7]; // TODO: should this be a single float?
150202
150162
 
150203
- // TODO: can array of tuples/vec2 be used?
150163
+ uniform int channelColormapFuncIndices[7];
150204
150164
  uniform float channelColormapRangeStarts[7];
150205
150165
  uniform float channelColormapRangeEnds[7];
150206
150166
 
@@ -150266,7 +150226,30 @@ vec3 sampleAndGetData(sampler2D dataTex, vec2 coord, bool isFilled, float stroke
150266
150226
  return vec3(clampedSampledData * float(isOn), sampledData, float(isEdge));
150267
150227
  }
150268
150228
 
150269
- vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
150229
+ vec3 colormapFunc(float clampedScaledExpressionValue, int colormapIndex) {
150230
+ // Map indices of GLSL_COLORMAPS array to their function calls.
150231
+ // GLSL_COLORMAPS is defined in ./constants.js and needs to stay manually synced.
150232
+ // 0: 'plasma',
150233
+ // 1: 'viridis',
150234
+ // 2: 'jet',
150235
+ // 3: 'greys',
150236
+
150237
+ if (colormapIndex <= 0) {
150238
+ // This should also match -1, to account for a failed Array.indexOf lookup.
150239
+ return plasma(clampedScaledExpressionValue).rgb;
150240
+ }
150241
+ if (colormapIndex == 1) {
150242
+ return viridis(clampedScaledExpressionValue).rgb;
150243
+ }
150244
+ if (colormapIndex == 2) {
150245
+ return jet(clampedScaledExpressionValue).rgb;
150246
+ }
150247
+ if (colormapIndex == 3) {
150248
+ return greys(clampedScaledExpressionValue).rgb;
150249
+ }
150250
+ }
150251
+
150252
+ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channelColor, float channelOpacity, float valueOffset, int colormapFuncIndex, float rangeStart, float rangeEnd, bool isSetColorMode, float setColorOffset) {
150270
150253
  float clampedSampledDataAndIsOn = sampledDataAndIsEdge.x;
150271
150254
  float sampledData = sampledDataAndIsEdge.y;
150272
150255
  float isEdge = sampledDataAndIsEdge.z;
@@ -150310,7 +150293,7 @@ vec4 dataToColor(vec3 sampledDataAndIsEdge, bool isStaticColorMode, vec3 channel
150310
150293
  }
150311
150294
 
150312
150295
 
150313
- vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(COLORMAP_FUNC(clamp(scaledExpressionValue, 0.0, 1.0)).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
150296
+ vec4 sampledColor = (1. - (float(isStaticColorMode) + float(isSetColorMode))) * vec4(colormapFunc(clamp(scaledExpressionValue, 0.0, 1.0), colormapFuncIndex).rgb, channelOpacity) + float(isStaticColorMode) * vec4(channelColor.rgb, channelOpacity) + float(isSetColorMode) * vec4(setColor, channelOpacity);
150314
150297
  // Only return a color if the data is non-zero.
150315
150298
 
150316
150299
  return clampedSampledDataAndIsOn * isEdge * sampledColor;
@@ -150326,15 +150309,15 @@ void main() {
150326
150309
  vec3 dat4 = sampleAndGetData(channel4, vTexCoord, channelsFilled[4], channelStrokeWidths[4], channelsVisible[4]);
150327
150310
  vec3 dat5 = sampleAndGetData(channel5, vTexCoord, channelsFilled[5], channelStrokeWidths[5], channelsVisible[5]);
150328
150311
  vec3 dat6 = sampleAndGetData(channel6, vTexCoord, channelsFilled[6], channelStrokeWidths[6], channelsVisible[6]);
150329
-
150330
- vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
150331
- vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
150332
- vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
150333
- vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
150334
- vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
150335
- vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
150336
- vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
150337
-
150312
+
150313
+ vec4 val0 = dataToColor(dat0, channelIsStaticColorMode[0], color0, channelOpacities[0], valueTexOffsets[0], channelColormapFuncIndices[0], channelColormapRangeStarts[0], channelColormapRangeEnds[0], channelIsSetColorMode[0], colorTexOffsets[0]);
150314
+ vec4 val1 = dataToColor(dat1, channelIsStaticColorMode[1], color1, channelOpacities[1], valueTexOffsets[1], channelColormapFuncIndices[1], channelColormapRangeStarts[1], channelColormapRangeEnds[1], channelIsSetColorMode[1], colorTexOffsets[1]);
150315
+ vec4 val2 = dataToColor(dat2, channelIsStaticColorMode[2], color2, channelOpacities[2], valueTexOffsets[2], channelColormapFuncIndices[2], channelColormapRangeStarts[2], channelColormapRangeEnds[2], channelIsSetColorMode[2], colorTexOffsets[2]);
150316
+ vec4 val3 = dataToColor(dat3, channelIsStaticColorMode[3], color3, channelOpacities[3], valueTexOffsets[3], channelColormapFuncIndices[3], channelColormapRangeStarts[3], channelColormapRangeEnds[3], channelIsSetColorMode[3], colorTexOffsets[3]);
150317
+ vec4 val4 = dataToColor(dat4, channelIsStaticColorMode[4], color4, channelOpacities[4], valueTexOffsets[4], channelColormapFuncIndices[4], channelColormapRangeStarts[4], channelColormapRangeEnds[4], channelIsSetColorMode[4], colorTexOffsets[4]);
150318
+ vec4 val5 = dataToColor(dat5, channelIsStaticColorMode[5], color5, channelOpacities[5], valueTexOffsets[5], channelColormapFuncIndices[5], channelColormapRangeStarts[5], channelColormapRangeEnds[5], channelIsSetColorMode[5], colorTexOffsets[5]);
150319
+ vec4 val6 = dataToColor(dat6, channelIsStaticColorMode[6], color6, channelOpacities[6], valueTexOffsets[6], channelColormapFuncIndices[6], channelColormapRangeStarts[6], channelColormapRangeEnds[6], channelIsSetColorMode[6], colorTexOffsets[6]);
150320
+
150338
150321
  // If all of the channels are "empty", then discard this pixel so that it is not considered during picking.
150339
150322
  float emptyDat = 0.;
150340
150323
  if(dat0.x == emptyDat && dat1.x == emptyDat && dat2.x == emptyDat && dat3.x == emptyDat && dat4.x == emptyDat && dat5.x == emptyDat && dat6.x == emptyDat) {
@@ -150373,12 +150356,11 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
150373
150356
  let totalValuesLength = 0;
150374
150357
  let totalColorsLength = 0;
150375
150358
  channelIsSetColorMode.forEach((isSetColorMode, channelIndex) => {
150376
- var _a3, _b2, _c2, _d;
150377
150359
  if (isSetColorMode) {
150378
- totalColorsLength += (((_b2 = (_a3 = setColorValues[channelIndex]) == null ? void 0 : _a3.setColors) == null ? void 0 : _b2.length) ?? 0) * 3;
150379
- totalValuesLength += ((_c2 = setColorValues[channelIndex]) == null ? void 0 : _c2.obsIndex) ? max$1(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
150360
+ totalColorsLength += (setColorValues[channelIndex]?.setColors?.length ?? 0) * 3;
150361
+ totalValuesLength += setColorValues[channelIndex]?.obsIndex ? max$1(setColorValues[channelIndex].obsIndex.map((d) => parseInt(d))) : 0;
150380
150362
  } else {
150381
- totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$1(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : ((_d = multiFeatureValues[channelIndex]) == null ? void 0 : _d.length) ?? 0;
150363
+ totalValuesLength += multiMatrixObsIndex[channelIndex] ? max$1(multiMatrixObsIndex[channelIndex].map((d) => parseInt(d))) : multiFeatureValues[channelIndex]?.length ?? 0;
150382
150364
  }
150383
150365
  });
150384
150366
  const valueTexHeight = Math.max(2, Math.ceil(totalValuesLength / texSize));
@@ -150420,8 +150402,8 @@ function multiSetsToTextureData(multiFeatureValues, multiMatrixObsIndex, setColo
150420
150402
  }
150421
150403
  indicesOffsets.push(indexOffset);
150422
150404
  colorsOffsets.push(colorOffset);
150423
- indexOffset += (obsIndex == null ? void 0 : obsIndex.length) || 0;
150424
- colorOffset += (setColors == null ? void 0 : setColors.length) || 0;
150405
+ indexOffset += obsIndex?.length || 0;
150406
+ colorOffset += setColors?.length || 0;
150425
150407
  } else {
150426
150408
  const featureArr = multiFeatureValues[channelIndex] ?? [];
150427
150409
  const normalizedFeatureArr = normalize(featureArr);
@@ -150490,14 +150472,10 @@ const defaultProps$1 = {
150490
150472
  class BitmaskLayer2 extends XRLayer {
150491
150473
  // eslint-disable-next-line class-methods-use-this
150492
150474
  getShaders() {
150493
- const { colormap } = this.props;
150494
150475
  return {
150495
150476
  fs,
150496
150477
  vs,
150497
- modules: [project32, picking],
150498
- defines: {
150499
- [COLORMAP_SHADER_PLACEHOLDER]: GLSL_COLORMAPS.includes(colormap) ? colormap : GLSL_COLORMAP_DEFAULT
150500
- }
150478
+ modules: [project32, picking]
150501
150479
  };
150502
150480
  }
150503
150481
  /**
@@ -150556,8 +150534,6 @@ class BitmaskLayer2 extends XRLayer {
150556
150534
  channelOpacities,
150557
150535
  channelColors,
150558
150536
  channelsVisible,
150559
- // TODO: use `channelFeatureValueColormaps` in shader,
150560
- // figure out how to call multiple GLSL colormap functions
150561
150537
  channelFeatureValueColormaps,
150562
150538
  channelFeatureValueColormapRanges,
150563
150539
  channelIsStaticColorMode,
@@ -150618,14 +150594,20 @@ class BitmaskLayer2 extends XRLayer {
150618
150594
  // There are six texture entries on the shaders
150619
150595
  MAX_CHANNELS - channelStrokeWidths.length
150620
150596
  ),
150597
+ channelColormapFuncIndices: padWithDefault(
150598
+ channelFeatureValueColormaps.map((d) => GLSL_COLORMAPS.indexOf(d)),
150599
+ 0,
150600
+ // There are six texture entries on the shaders
150601
+ MAX_CHANNELS - channelFeatureValueColormaps.length
150602
+ ),
150621
150603
  channelColormapRangeStarts: padWithDefault(
150622
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[0]) || 0),
150604
+ channelFeatureValueColormapRanges.map((r2) => r2?.[0] || 0),
150623
150605
  0,
150624
150606
  // There are six texture entries on the shaders
150625
150607
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
150626
150608
  ),
150627
150609
  channelColormapRangeEnds: padWithDefault(
150628
- channelFeatureValueColormapRanges.map((r2) => (r2 == null ? void 0 : r2[1]) || 1),
150610
+ channelFeatureValueColormapRanges.map((r2) => r2?.[1] || 1),
150629
150611
  1,
150630
150612
  // There are six texture entries on the shaders
150631
150613
  MAX_CHANNELS - channelFeatureValueColormapRanges.length
@@ -150891,24 +150873,24 @@ function clone(configObject) {
150891
150873
  if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
150892
150874
  v = obj[p];
150893
150875
  if (v && v.pop) {
150894
- intCheck(v[0], -1e9, 0, p);
150876
+ intCheck(v[0], -MAX, 0, p);
150895
150877
  intCheck(v[1], 0, MAX, p);
150896
150878
  TO_EXP_NEG = v[0];
150897
150879
  TO_EXP_POS = v[1];
150898
150880
  } else {
150899
- intCheck(v, -1e9, MAX, p);
150881
+ intCheck(v, -MAX, MAX, p);
150900
150882
  TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
150901
150883
  }
150902
150884
  }
150903
150885
  if (obj.hasOwnProperty(p = "RANGE")) {
150904
150886
  v = obj[p];
150905
150887
  if (v && v.pop) {
150906
- intCheck(v[0], -1e9, -1, p);
150888
+ intCheck(v[0], -MAX, -1, p);
150907
150889
  intCheck(v[1], 1, MAX, p);
150908
150890
  MIN_EXP = v[0];
150909
150891
  MAX_EXP = v[1];
150910
150892
  } else {
150911
- intCheck(v, -1e9, MAX, p);
150893
+ intCheck(v, -MAX, MAX, p);
150912
150894
  if (v) {
150913
150895
  MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
150914
150896
  } else {
@@ -150978,7 +150960,7 @@ function clone(configObject) {
150978
150960
  if (!BigNumber2.DEBUG) return true;
150979
150961
  var i2, n3, c = v.c, e2 = v.e, s2 = v.s;
150980
150962
  out: if ({}.toString.call(c) == "[object Array]") {
150981
- if ((s2 === 1 || s2 === -1) && e2 >= -1e9 && e2 <= MAX && e2 === mathfloor(e2)) {
150963
+ if ((s2 === 1 || s2 === -1) && e2 >= -MAX && e2 <= MAX && e2 === mathfloor(e2)) {
150982
150964
  if (c[0] === 0) {
150983
150965
  if (e2 === 0 && c.length === 1) return true;
150984
150966
  break out;
@@ -151818,7 +151800,7 @@ function clone(configObject) {
151818
151800
  return n3;
151819
151801
  };
151820
151802
  P2.shiftedBy = function(k) {
151821
- intCheck(k, -9007199254740991, MAX_SAFE_INTEGER);
151803
+ intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
151822
151804
  return this.times("1e" + k);
151823
151805
  };
151824
151806
  P2.squareRoot = P2.sqrt = function() {
@@ -152068,10 +152050,10 @@ function toFixedPoint(str, e2, z2) {
152068
152050
  }
152069
152051
  var BigNumber = clone();
152070
152052
  var SplayTreeNode = class {
152053
+ key;
152054
+ left = null;
152055
+ right = null;
152071
152056
  constructor(key) {
152072
- __publicField(this, "key");
152073
- __publicField(this, "left", null);
152074
- __publicField(this, "right", null);
152075
152057
  this.key = key;
152076
152058
  }
152077
152059
  };
@@ -152081,11 +152063,9 @@ var SplayTreeSetNode = class extends SplayTreeNode {
152081
152063
  }
152082
152064
  };
152083
152065
  var SplayTree = class {
152084
- constructor() {
152085
- __publicField(this, "size", 0);
152086
- __publicField(this, "modificationCount", 0);
152087
- __publicField(this, "splayCount", 0);
152088
- }
152066
+ size = 0;
152067
+ modificationCount = 0;
152068
+ splayCount = 0;
152089
152069
  splay(key) {
152090
152070
  const root2 = this.root;
152091
152071
  if (root2 == null) {
@@ -152270,12 +152250,11 @@ var SplayTree = class {
152270
152250
  }
152271
152251
  };
152272
152252
  var SplayTreeSet = class _SplayTreeSet extends SplayTree {
152253
+ root = null;
152254
+ compare;
152255
+ validKey;
152273
152256
  constructor(compare2, isValidKey) {
152274
152257
  super();
152275
- __publicField(this, "root", null);
152276
- __publicField(this, "compare");
152277
- __publicField(this, "validKey");
152278
- __publicField(this, _a2, "[object Set]");
152279
152258
  this.compare = compare2 ?? this.defaultCompare();
152280
152259
  this.validKey = isValidKey ?? ((v) => v != null && v != void 0);
152281
152260
  }
@@ -152442,16 +152421,17 @@ var SplayTreeSet = class _SplayTreeSet extends SplayTree {
152442
152421
  values() {
152443
152422
  return this[Symbol.iterator]();
152444
152423
  }
152445
- [(_b = Symbol.iterator, _a2 = Symbol.toStringTag, _b)]() {
152424
+ [Symbol.iterator]() {
152446
152425
  return new SplayTreeKeyIterableIterator(this.wrap());
152447
152426
  }
152427
+ [Symbol.toStringTag] = "[object Set]";
152448
152428
  };
152449
152429
  var SplayTreeIterableIterator = class {
152430
+ tree;
152431
+ path = new Array();
152432
+ modificationCount = null;
152433
+ splayCount;
152450
152434
  constructor(tree) {
152451
- __publicField(this, "tree");
152452
- __publicField(this, "path", new Array());
152453
- __publicField(this, "modificationCount", null);
152454
- __publicField(this, "splayCount");
152455
152435
  this.tree = tree;
152456
152436
  this.splayCount = tree.getSplayCount();
152457
152437
  }
@@ -152628,18 +152608,11 @@ var intersection = (pt1, v12, pt2, v2) => {
152628
152608
  return { x, y };
152629
152609
  };
152630
152610
  var SweepEvent = class _SweepEvent {
152631
- // Warning: 'point' input will be modified and re-used (for performance)
152632
- constructor(point2, isLeft) {
152633
- __publicField(this, "point");
152634
- __publicField(this, "isLeft");
152635
- __publicField(this, "segment");
152636
- __publicField(this, "otherSE");
152637
- __publicField(this, "consumedBy");
152638
- if (point2.events === void 0) point2.events = [this];
152639
- else point2.events.push(this);
152640
- this.point = point2;
152641
- this.isLeft = isLeft;
152642
- }
152611
+ point;
152612
+ isLeft;
152613
+ segment;
152614
+ otherSE;
152615
+ consumedBy;
152643
152616
  // for ordering sweep events in the sweep event queue
152644
152617
  static compare(a2, b) {
152645
152618
  const ptCmp = _SweepEvent.comparePoints(a2.point, b.point);
@@ -152656,6 +152629,13 @@ var SweepEvent = class _SweepEvent {
152656
152629
  if (aPt.y.isGreaterThan(bPt.y)) return 1;
152657
152630
  return 0;
152658
152631
  }
152632
+ // Warning: 'point' input will be modified and re-used (for performance)
152633
+ constructor(point2, isLeft) {
152634
+ if (point2.events === void 0) point2.events = [this];
152635
+ else point2.events.push(this);
152636
+ this.point = point2;
152637
+ this.isLeft = isLeft;
152638
+ }
152659
152639
  link(other) {
152660
152640
  if (other.point === this.point) {
152661
152641
  throw new Error("Tried to link already linked events");
@@ -152734,17 +152714,10 @@ var SweepEvent = class _SweepEvent {
152734
152714
  }
152735
152715
  };
152736
152716
  var RingOut = class _RingOut {
152737
- constructor(events2) {
152738
- __publicField(this, "events");
152739
- __publicField(this, "poly");
152740
- __publicField(this, "_isExteriorRing");
152741
- __publicField(this, "_enclosingRing");
152742
- this.events = events2;
152743
- for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
152744
- events2[i2].segment.ringOut = this;
152745
- }
152746
- this.poly = null;
152747
- }
152717
+ events;
152718
+ poly;
152719
+ _isExteriorRing;
152720
+ _enclosingRing;
152748
152721
  /* Given the segments from the sweep line pass, compute & return a series
152749
152722
  * of closed rings from all the segments marked to be part of the result */
152750
152723
  static factory(allSegments) {
@@ -152803,6 +152776,13 @@ var RingOut = class _RingOut {
152803
152776
  }
152804
152777
  return ringsOut;
152805
152778
  }
152779
+ constructor(events2) {
152780
+ this.events = events2;
152781
+ for (let i2 = 0, iMax = events2.length; i2 < iMax; i2++) {
152782
+ events2[i2].segment.ringOut = this;
152783
+ }
152784
+ this.poly = null;
152785
+ }
152806
152786
  getGeom() {
152807
152787
  let prevPt = this.events[0].point;
152808
152788
  const points = [prevPt];
@@ -152841,7 +152821,6 @@ var RingOut = class _RingOut {
152841
152821
  }
152842
152822
  /* Returns the ring that encloses this one, if any */
152843
152823
  _calcEnclosingRing() {
152844
- var _a3, _b2;
152845
152824
  let leftMostEvt = this.events[0];
152846
152825
  for (let i2 = 1, iMax = this.events.length; i2 < iMax; i2++) {
152847
152826
  const evt = this.events[i2];
@@ -152853,9 +152832,9 @@ var RingOut = class _RingOut {
152853
152832
  if (!prevSeg) return null;
152854
152833
  if (!prevPrevSeg) return prevSeg.ringOut;
152855
152834
  if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
152856
- if (((_a3 = prevPrevSeg.ringOut) == null ? void 0 : _a3.enclosingRing()) !== prevSeg.ringOut) {
152835
+ if (prevPrevSeg.ringOut?.enclosingRing() !== prevSeg.ringOut) {
152857
152836
  return prevSeg.ringOut;
152858
- } else return (_b2 = prevSeg.ringOut) == null ? void 0 : _b2.enclosingRing();
152837
+ } else return prevSeg.ringOut?.enclosingRing();
152859
152838
  }
152860
152839
  prevSeg = prevPrevSeg.prevInResult();
152861
152840
  prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
@@ -152863,9 +152842,9 @@ var RingOut = class _RingOut {
152863
152842
  }
152864
152843
  };
152865
152844
  var PolyOut = class {
152845
+ exteriorRing;
152846
+ interiorRings;
152866
152847
  constructor(exteriorRing) {
152867
- __publicField(this, "exteriorRing");
152868
- __publicField(this, "interiorRings");
152869
152848
  this.exteriorRing = exteriorRing;
152870
152849
  exteriorRing.poly = this;
152871
152850
  this.interiorRings = [];
@@ -152887,9 +152866,9 @@ var PolyOut = class {
152887
152866
  }
152888
152867
  };
152889
152868
  var MultiPolyOut = class {
152869
+ rings;
152870
+ polys;
152890
152871
  constructor(rings) {
152891
- __publicField(this, "rings");
152892
- __publicField(this, "polys");
152893
152872
  this.rings = rings;
152894
152873
  this.polys = this._composePolys(rings);
152895
152874
  }
@@ -152903,7 +152882,6 @@ var MultiPolyOut = class {
152903
152882
  return geom;
152904
152883
  }
152905
152884
  _composePolys(rings) {
152906
- var _a3;
152907
152885
  const polys = [];
152908
152886
  for (let i2 = 0, iMax = rings.length; i2 < iMax; i2++) {
152909
152887
  const ring = rings[i2];
@@ -152911,18 +152889,18 @@ var MultiPolyOut = class {
152911
152889
  if (ring.isExteriorRing()) polys.push(new PolyOut(ring));
152912
152890
  else {
152913
152891
  const enclosingRing = ring.enclosingRing();
152914
- if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut(enclosingRing));
152915
- (_a3 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a3.addInterior(ring);
152892
+ if (!enclosingRing?.poly) polys.push(new PolyOut(enclosingRing));
152893
+ enclosingRing?.poly?.addInterior(ring);
152916
152894
  }
152917
152895
  }
152918
152896
  return polys;
152919
152897
  }
152920
152898
  };
152921
152899
  var SweepLine = class {
152900
+ queue;
152901
+ tree;
152902
+ segments;
152922
152903
  constructor(queue, comparator2 = Segment2.compare) {
152923
- __publicField(this, "queue");
152924
- __publicField(this, "tree");
152925
- __publicField(this, "segments");
152926
152904
  this.queue = queue;
152927
152905
  this.tree = new SplayTreeSet(comparator2);
152928
152906
  this.segments = [];
@@ -153031,10 +153009,8 @@ var SweepLine = class {
153031
153009
  }
153032
153010
  };
153033
153011
  var Operation = class {
153034
- constructor() {
153035
- __publicField(this, "type");
153036
- __publicField(this, "numMultiPolys");
153037
- }
153012
+ type;
153013
+ numMultiPolys;
153038
153014
  run(type, geom, moreGeoms) {
153039
153015
  operation.type = type;
153040
153016
  const multipolys = [new MultiPolyIn(geom, true)];
@@ -153094,31 +153070,18 @@ var operation = new Operation();
153094
153070
  var operation_default = operation;
153095
153071
  var segmentId = 0;
153096
153072
  var Segment2 = class _Segment {
153097
- /* Warning: a reference to ringWindings input will be stored,
153098
- * and possibly will be later modified */
153099
- constructor(leftSE, rightSE, rings, windings) {
153100
- __publicField(this, "id");
153101
- __publicField(this, "leftSE");
153102
- __publicField(this, "rightSE");
153103
- __publicField(this, "rings");
153104
- __publicField(this, "windings");
153105
- __publicField(this, "ringOut");
153106
- __publicField(this, "consumedBy");
153107
- __publicField(this, "prev");
153108
- __publicField(this, "_prevInResult");
153109
- __publicField(this, "_beforeState");
153110
- __publicField(this, "_afterState");
153111
- __publicField(this, "_isInResult");
153112
- this.id = ++segmentId;
153113
- this.leftSE = leftSE;
153114
- leftSE.segment = this;
153115
- leftSE.otherSE = rightSE;
153116
- this.rightSE = rightSE;
153117
- rightSE.segment = this;
153118
- rightSE.otherSE = leftSE;
153119
- this.rings = rings;
153120
- this.windings = windings;
153121
- }
153073
+ id;
153074
+ leftSE;
153075
+ rightSE;
153076
+ rings;
153077
+ windings;
153078
+ ringOut;
153079
+ consumedBy;
153080
+ prev;
153081
+ _prevInResult;
153082
+ _beforeState;
153083
+ _afterState;
153084
+ _isInResult;
153122
153085
  /* This compare() function is for ordering segments in the sweep
153123
153086
  * line tree, and does so according to the following criteria:
153124
153087
  *
@@ -153190,6 +153153,19 @@ var Segment2 = class _Segment {
153190
153153
  if (a2.id > b.id) return 1;
153191
153154
  return 0;
153192
153155
  }
153156
+ /* Warning: a reference to ringWindings input will be stored,
153157
+ * and possibly will be later modified */
153158
+ constructor(leftSE, rightSE, rings, windings) {
153159
+ this.id = ++segmentId;
153160
+ this.leftSE = leftSE;
153161
+ leftSE.segment = this;
153162
+ leftSE.otherSE = rightSE;
153163
+ this.rightSE = rightSE;
153164
+ rightSE.segment = this;
153165
+ rightSE.otherSE = leftSE;
153166
+ this.rings = rings;
153167
+ this.windings = windings;
153168
+ }
153193
153169
  static fromRing(pt1, pt2, ring) {
153194
153170
  let leftPt, rightPt, winding;
153195
153171
  const cmpPts = SweepEvent.comparePoints(pt1, pt2);
@@ -153490,11 +153466,11 @@ var Segment2 = class _Segment {
153490
153466
  }
153491
153467
  };
153492
153468
  var RingIn = class {
153469
+ poly;
153470
+ isExterior;
153471
+ segments;
153472
+ bbox;
153493
153473
  constructor(geomRing, poly, isExterior) {
153494
- __publicField(this, "poly");
153495
- __publicField(this, "isExterior");
153496
- __publicField(this, "segments");
153497
- __publicField(this, "bbox");
153498
153474
  if (!Array.isArray(geomRing) || geomRing.length === 0) {
153499
153475
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
153500
153476
  }
@@ -153538,11 +153514,11 @@ var RingIn = class {
153538
153514
  }
153539
153515
  };
153540
153516
  var PolyIn = class {
153517
+ multiPoly;
153518
+ exteriorRing;
153519
+ interiorRings;
153520
+ bbox;
153541
153521
  constructor(geomPoly, multiPoly) {
153542
- __publicField(this, "multiPoly");
153543
- __publicField(this, "exteriorRing");
153544
- __publicField(this, "interiorRings");
153545
- __publicField(this, "bbox");
153546
153522
  if (!Array.isArray(geomPoly)) {
153547
153523
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
153548
153524
  }
@@ -153574,10 +153550,10 @@ var PolyIn = class {
153574
153550
  }
153575
153551
  };
153576
153552
  var MultiPolyIn = class {
153553
+ isSubject;
153554
+ polys;
153555
+ bbox;
153577
153556
  constructor(geom, isSubject) {
153578
- __publicField(this, "isSubject");
153579
- __publicField(this, "polys");
153580
- __publicField(this, "bbox");
153581
153557
  if (!Array.isArray(geom)) {
153582
153558
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
153583
153559
  }
@@ -153739,17 +153715,17 @@ function getMaxAreaPolygon(levelToUse) {
153739
153715
  return [maxAreaValue, maxAreaPolygon];
153740
153716
  }
153741
153717
  function getMaxAreaPolygonAndLevel(contourPolygons) {
153742
- const l2 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 2)) ?? [];
153718
+ const l2 = contourPolygons?.filter((d) => d.contour.i === 2) ?? [];
153743
153719
  const [l2area, l2polygon] = getMaxAreaPolygon(l2);
153744
153720
  if (Math.log10(l2area) >= MIN_AREA_THRESHOLD) {
153745
153721
  return [l2area, l2polygon, 2];
153746
153722
  }
153747
- const l1 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 1)) ?? [];
153723
+ const l1 = contourPolygons?.filter((d) => d.contour.i === 1) ?? [];
153748
153724
  const [l1area, l1polygon] = getMaxAreaPolygon(l1);
153749
153725
  if (Math.log10(l1area) >= MIN_AREA_THRESHOLD) {
153750
153726
  return [l1area, l1polygon, 1];
153751
153727
  }
153752
- const l0 = (contourPolygons == null ? void 0 : contourPolygons.filter((d) => d.contour.i === 0)) ?? [];
153728
+ const l0 = contourPolygons?.filter((d) => d.contour.i === 0) ?? [];
153753
153729
  const [l0area, l0polygon] = getMaxAreaPolygon(l0);
153754
153730
  return [l0area, l0polygon, 0];
153755
153731
  }
@@ -153765,7 +153741,7 @@ class ContourLayerWithText extends ContourLayer {
153765
153741
  if (!circleInfo) {
153766
153742
  return lineAndTextLayers;
153767
153743
  }
153768
- const obsSetName = obsSetPath == null ? void 0 : obsSetPath.at(-1);
153744
+ const obsSetName = obsSetPath?.at(-1);
153769
153745
  const [maxAreaValue, maxAreaPolygon, levelI] = getMaxAreaPolygonAndLevel(contourPolygons);
153770
153746
  const { center, steps, polygon: circlePolygon } = circleInfo;
153771
153747
  if (maxAreaValue > 0 && maxAreaPolygon) {
@@ -153901,24 +153877,17 @@ function isRgb(loader, channels2) {
153901
153877
  }
153902
153878
  function getMetaWithTransformMatrices(imageMeta, imageLoaders) {
153903
153879
  const sources = imageLoaders.map((loader) => getSourceFromLoader(loader));
153904
- if (imageMeta.map((meta) => {
153905
- var _a3, _b2, _c2, _d, _e, _f;
153906
- return ((_b2 = (_a3 = meta == null ? void 0 : meta.metadata) == null ? void 0 : _a3.transform) == null ? void 0 : _b2.matrix) || ((_d = (_c2 = meta == null ? void 0 : meta.metadata) == null ? void 0 : _c2.transform) == null ? void 0 : _d.scale) || ((_f = (_e = meta == null ? void 0 : meta.metadata) == null ? void 0 : _e.transform) == null ? void 0 : _f.translate);
153907
- }).some(Boolean) || sources.every((source) => {
153908
- var _a3, _b2, _c2, _d;
153909
- return !((_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.x) || !((_d = (_c2 = source.meta) == null ? void 0 : _c2.physicalSizes) == null ? void 0 : _d.y);
153910
- })) {
153880
+ if (imageMeta.map((meta) => meta?.metadata?.transform?.matrix || meta?.metadata?.transform?.scale || meta?.metadata?.transform?.translate).some(Boolean) || sources.every((source) => !source.meta?.physicalSizes?.x || !source.meta?.physicalSizes?.y)) {
153911
153881
  return imageMeta;
153912
153882
  }
153913
153883
  const minPhysicalSize = sources.reduce((acc, source) => {
153914
- var _a3, _b2, _c2, _d, _e, _f, _g, _h, _i;
153915
- const hasZPhyscialSize = (_c2 = (_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.z) == null ? void 0 : _c2.size;
153884
+ const hasZPhyscialSize = source.meta?.physicalSizes?.z?.size;
153916
153885
  const sizes = [
153917
- unit(`${(_d = source.meta) == null ? void 0 : _d.physicalSizes.x.size} ${(_e = source.meta) == null ? void 0 : _e.physicalSizes.x.unit}`.replace("µ", "u")),
153918
- unit(`${(_f = source.meta) == null ? void 0 : _f.physicalSizes.y.size} ${(_g = source.meta) == null ? void 0 : _g.physicalSizes.y.unit}`.replace("µ", "u"))
153886
+ unit(`${source.meta?.physicalSizes.x.size} ${source.meta?.physicalSizes.x.unit}`.replace("µ", "u")),
153887
+ unit(`${source.meta?.physicalSizes.y.size} ${source.meta?.physicalSizes.y.unit}`.replace("µ", "u"))
153919
153888
  ];
153920
153889
  if (hasZPhyscialSize) {
153921
- sizes.push(unit(`${(_h = source.meta) == null ? void 0 : _h.physicalSizes.z.size} ${(_i = source.meta) == null ? void 0 : _i.physicalSizes.z.unit}`.replace("µ", "u")));
153890
+ sizes.push(unit(`${source.meta?.physicalSizes.z.size} ${source.meta?.physicalSizes.z.unit}`.replace("µ", "u")));
153922
153891
  }
153923
153892
  acc[0] = acc[0] === void 0 || compare$1(sizes[0], acc[0]) === -1 ? sizes[0] : acc[0];
153924
153893
  acc[1] = acc[1] === void 0 || compare$1(sizes[1], acc[1]) === -1 ? sizes[1] : acc[1];
@@ -153926,15 +153895,14 @@ function getMetaWithTransformMatrices(imageMeta, imageLoaders) {
153926
153895
  return acc;
153927
153896
  }, []);
153928
153897
  const imageMetaWithTransform = imageMeta.map((meta, j) => {
153929
- var _a3, _b2, _c2, _d, _e, _f, _g, _h, _i;
153930
153898
  const source = sources[j];
153931
- const hasZPhyscialSize = (_c2 = (_b2 = (_a3 = source.meta) == null ? void 0 : _a3.physicalSizes) == null ? void 0 : _b2.z) == null ? void 0 : _c2.size;
153899
+ const hasZPhyscialSize = source.meta?.physicalSizes?.z?.size;
153932
153900
  const sizes = [
153933
- unit(`${(_d = source.meta) == null ? void 0 : _d.physicalSizes.x.size} ${(_e = source.meta) == null ? void 0 : _e.physicalSizes.x.unit}`.replace("µ", "u")),
153934
- unit(`${(_f = source.meta) == null ? void 0 : _f.physicalSizes.y.size} ${(_g = source.meta) == null ? void 0 : _g.physicalSizes.y.unit}`.replace("µ", "u"))
153901
+ unit(`${source.meta?.physicalSizes.x.size} ${source.meta?.physicalSizes.x.unit}`.replace("µ", "u")),
153902
+ unit(`${source.meta?.physicalSizes.y.size} ${source.meta?.physicalSizes.y.unit}`.replace("µ", "u"))
153935
153903
  ];
153936
153904
  if (hasZPhyscialSize) {
153937
- sizes.push(unit(`${(_h = source.meta) == null ? void 0 : _h.physicalSizes.z.size} ${(_i = source.meta) == null ? void 0 : _i.physicalSizes.z.unit}`.replace("µ", "u")));
153905
+ sizes.push(unit(`${source.meta?.physicalSizes.z.size} ${source.meta?.physicalSizes.z.unit}`.replace("µ", "u")));
153938
153906
  }
153939
153907
  const scale2 = sizes.map((i2, k) => divide(i2, minPhysicalSize[k]));
153940
153908
  if (!sizes[0].equals(sizes[1])) {
@@ -154025,41 +153993,35 @@ async function initializeRasterLayersAndChannels(rasterLayers, rasterRenderLayer
154025
153993
  if (!rasterRenderLayers) {
154026
153994
  const layerIndex = Math.floor(rasterLayers.length / 2);
154027
153995
  const loader = nextImageLoaders[layerIndex];
154028
- const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => {
154029
- var _a3, _b2, _c2, _d, _e;
154030
- return Promise.resolve({
154031
- type: ((_b2 = (_a3 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b2.isBitmask) ? "bitmask" : "raster",
154032
- index: layerIndex,
154033
- ...DEFAULT_RASTER_LAYER_PROPS,
154034
- channels: channels2.map((channel, j) => ({
154035
- ...channel,
154036
- ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154037
- })),
154038
- modelMatrix: (_e = (_d = (_c2 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _c2.metadata) == null ? void 0 : _d.transform) == null ? void 0 : _e.matrix,
154039
- transparentColor: layerIndex > 0 ? [0, 0, 0] : null
154040
- });
154041
- });
153996
+ const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => Promise.resolve({
153997
+ type: nextImageMetaAndLayers[layerIndex]?.metadata?.isBitmask ? "bitmask" : "raster",
153998
+ index: layerIndex,
153999
+ ...DEFAULT_RASTER_LAYER_PROPS,
154000
+ channels: channels2.map((channel, j) => ({
154001
+ ...channel,
154002
+ ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154003
+ })),
154004
+ modelMatrix: nextImageMetaAndLayers[layerIndex]?.metadata?.transform?.matrix,
154005
+ transparentColor: layerIndex > 0 ? [0, 0, 0] : null
154006
+ }));
154042
154007
  autoImageLayerDefPromises.push(autoImageLayerDefPromise);
154043
154008
  } else {
154044
154009
  const globalIndicesOfRenderLayers = rasterRenderLayers.map((imageName) => rasterLayers.findIndex((image2) => image2.name === imageName));
154045
154010
  for (let i2 = 0; i2 < globalIndicesOfRenderLayers.length; i2++) {
154046
154011
  const layerIndex = globalIndicesOfRenderLayers[i2];
154047
154012
  const loader = nextImageLoaders[layerIndex];
154048
- const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => {
154049
- var _a3, _b2, _c2, _d, _e;
154050
- return Promise.resolve({
154051
- type: ((_b2 = (_a3 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _a3.metadata) == null ? void 0 : _b2.isBitmask) ? "bitmask" : "raster",
154052
- index: layerIndex,
154053
- ...DEFAULT_RASTER_LAYER_PROPS,
154054
- channels: channels2.map((channel, j) => ({
154055
- ...channel,
154056
- ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154057
- })),
154058
- domainType: "Min/Max",
154059
- modelMatrix: (_e = (_d = (_c2 = nextImageMetaAndLayers[layerIndex]) == null ? void 0 : _c2.metadata) == null ? void 0 : _d.transform) == null ? void 0 : _e.matrix,
154060
- transparentColor: i2 > 0 ? [0, 0, 0] : null
154061
- });
154062
- });
154013
+ const autoImageLayerDefPromise = initializeLayerChannels(loader).then((channels2) => Promise.resolve({
154014
+ type: nextImageMetaAndLayers[layerIndex]?.metadata?.isBitmask ? "bitmask" : "raster",
154015
+ index: layerIndex,
154016
+ ...DEFAULT_RASTER_LAYER_PROPS,
154017
+ channels: channels2.map((channel, j) => ({
154018
+ ...channel,
154019
+ ...nextImageMetaAndLayers[layerIndex].channels ? nextImageMetaAndLayers[layerIndex].channels[j] : []
154020
+ })),
154021
+ domainType: "Min/Max",
154022
+ modelMatrix: nextImageMetaAndLayers[layerIndex]?.metadata?.transform?.matrix,
154023
+ transparentColor: i2 > 0 ? [0, 0, 0] : null
154024
+ }));
154063
154025
  autoImageLayerDefPromises.push(autoImageLayerDefPromise);
154064
154026
  }
154065
154027
  }
@@ -154257,72 +154219,68 @@ async function fetch_suffix(url, suffix_length, init, use_suffix_request) {
154257
154219
  return fetch_range(url, length2 - suffix_length, length2, init);
154258
154220
  }
154259
154221
  class FetchStore {
154222
+ #overrides;
154223
+ #use_suffix_request;
154260
154224
  constructor(url, options = {}) {
154261
- __privateAdd(this, _FetchStore_instances);
154262
- __privateAdd(this, _overrides);
154263
- __privateAdd(this, _use_suffix_request);
154264
154225
  this.url = url;
154265
- __privateSet(this, _overrides, options.overrides ?? {});
154266
- __privateSet(this, _use_suffix_request, options.useSuffixRequest ?? false);
154226
+ this.#overrides = options.overrides ?? {};
154227
+ this.#use_suffix_request = options.useSuffixRequest ?? false;
154228
+ }
154229
+ #merge_init(overrides) {
154230
+ return merge_init(this.#overrides, overrides);
154267
154231
  }
154268
154232
  async get(key, options = {}) {
154269
154233
  let href = resolve(this.url, key).href;
154270
- let response = await fetch(href, __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options));
154234
+ let response = await fetch(href, this.#merge_init(options));
154271
154235
  return handle_response(response);
154272
154236
  }
154273
154237
  async getRange(key, range2, options = {}) {
154274
154238
  let url = resolve(this.url, key);
154275
- let init = __privateMethod(this, _FetchStore_instances, merge_init_fn).call(this, options);
154239
+ let init = this.#merge_init(options);
154276
154240
  let response;
154277
154241
  if ("suffixLength" in range2) {
154278
- response = await fetch_suffix(url, range2.suffixLength, init, __privateGet(this, _use_suffix_request));
154242
+ response = await fetch_suffix(url, range2.suffixLength, init, this.#use_suffix_request);
154279
154243
  } else {
154280
154244
  response = await fetch_range(url, range2.offset, range2.length, init);
154281
154245
  }
154282
154246
  return handle_response(response);
154283
154247
  }
154284
154248
  }
154285
- _overrides = new WeakMap();
154286
- _use_suffix_request = new WeakMap();
154287
- _FetchStore_instances = new WeakSet();
154288
- merge_init_fn = function(overrides) {
154289
- return merge_init(__privateGet(this, _overrides), overrides);
154290
- };
154291
154249
  class BoolArray {
154250
+ #bytes;
154292
154251
  constructor(x, byteOffset, length2) {
154293
- __privateAdd(this, _bytes);
154294
154252
  if (typeof x === "number") {
154295
- __privateSet(this, _bytes, new Uint8Array(x));
154253
+ this.#bytes = new Uint8Array(x);
154296
154254
  } else if (x instanceof ArrayBuffer) {
154297
- __privateSet(this, _bytes, new Uint8Array(x, byteOffset, length2));
154255
+ this.#bytes = new Uint8Array(x, byteOffset, length2);
154298
154256
  } else {
154299
- __privateSet(this, _bytes, new Uint8Array(Array.from(x, (v) => v ? 1 : 0)));
154257
+ this.#bytes = new Uint8Array(Array.from(x, (v) => v ? 1 : 0));
154300
154258
  }
154301
154259
  }
154302
154260
  get BYTES_PER_ELEMENT() {
154303
154261
  return 1;
154304
154262
  }
154305
154263
  get byteOffset() {
154306
- return __privateGet(this, _bytes).byteOffset;
154264
+ return this.#bytes.byteOffset;
154307
154265
  }
154308
154266
  get byteLength() {
154309
- return __privateGet(this, _bytes).byteLength;
154267
+ return this.#bytes.byteLength;
154310
154268
  }
154311
154269
  get buffer() {
154312
- return __privateGet(this, _bytes).buffer;
154270
+ return this.#bytes.buffer;
154313
154271
  }
154314
154272
  get length() {
154315
- return __privateGet(this, _bytes).length;
154273
+ return this.#bytes.length;
154316
154274
  }
154317
154275
  get(idx) {
154318
- let value = __privateGet(this, _bytes)[idx];
154276
+ let value = this.#bytes[idx];
154319
154277
  return typeof value === "number" ? value !== 0 : value;
154320
154278
  }
154321
154279
  set(idx, value) {
154322
- __privateGet(this, _bytes)[idx] = value ? 1 : 0;
154280
+ this.#bytes[idx] = value ? 1 : 0;
154323
154281
  }
154324
154282
  fill(value) {
154325
- __privateGet(this, _bytes).fill(value ? 1 : 0);
154283
+ this.#bytes.fill(value ? 1 : 0);
154326
154284
  }
154327
154285
  *[Symbol.iterator]() {
154328
154286
  for (let i2 = 0; i2 < this.length; i2++) {
@@ -154330,12 +154288,11 @@ class BoolArray {
154330
154288
  }
154331
154289
  }
154332
154290
  }
154333
- _bytes = new WeakMap();
154334
154291
  class ByteStringArray {
154292
+ #encoder;
154335
154293
  constructor(chars, x, byteOffset, length2) {
154336
- __privateAdd(this, _encoder);
154337
154294
  this.chars = chars;
154338
- __privateSet(this, _encoder, new TextEncoder());
154295
+ this.#encoder = new TextEncoder();
154339
154296
  if (typeof x === "number") {
154340
154297
  this._data = new Uint8Array(x * chars);
154341
154298
  } else if (x instanceof ArrayBuffer) {
@@ -154372,10 +154329,10 @@ class ByteStringArray {
154372
154329
  set(idx, value) {
154373
154330
  const view = new Uint8Array(this.buffer, this.byteOffset + this.chars * idx, this.chars);
154374
154331
  view.fill(0);
154375
- view.set(__privateGet(this, _encoder).encode(value));
154332
+ view.set(this.#encoder.encode(value));
154376
154333
  }
154377
154334
  fill(value) {
154378
- const encoded = __privateGet(this, _encoder).encode(value);
154335
+ const encoded = this.#encoder.encode(value);
154379
154336
  for (let i2 = 0; i2 < this.length; i2++) {
154380
154337
  this._data.set(encoded, i2 * this.chars);
154381
154338
  }
@@ -154386,54 +154343,53 @@ class ByteStringArray {
154386
154343
  }
154387
154344
  }
154388
154345
  }
154389
- _encoder = new WeakMap();
154390
- const _UnicodeStringArray = class _UnicodeStringArray {
154346
+ class UnicodeStringArray {
154347
+ #data;
154391
154348
  constructor(chars, x, byteOffset, length2) {
154392
- __privateAdd(this, _data);
154393
154349
  this.chars = chars;
154394
154350
  if (typeof x === "number") {
154395
- __privateSet(this, _data, new Int32Array(x * chars));
154351
+ this.#data = new Int32Array(x * chars);
154396
154352
  } else if (x instanceof ArrayBuffer) {
154397
154353
  if (length2)
154398
154354
  length2 *= chars;
154399
- __privateSet(this, _data, new Int32Array(x, byteOffset, length2));
154355
+ this.#data = new Int32Array(x, byteOffset, length2);
154400
154356
  } else {
154401
154357
  const values2 = x;
154402
- const d = new _UnicodeStringArray(chars, 1);
154403
- __privateSet(this, _data, new Int32Array(function* () {
154358
+ const d = new UnicodeStringArray(chars, 1);
154359
+ this.#data = new Int32Array(function* () {
154404
154360
  for (let str of values2) {
154405
154361
  d.set(0, str);
154406
- yield* __privateGet(d, _data);
154362
+ yield* d.#data;
154407
154363
  }
154408
- }()));
154364
+ }());
154409
154365
  }
154410
154366
  }
154411
154367
  get BYTES_PER_ELEMENT() {
154412
- return __privateGet(this, _data).BYTES_PER_ELEMENT * this.chars;
154368
+ return this.#data.BYTES_PER_ELEMENT * this.chars;
154413
154369
  }
154414
154370
  get byteLength() {
154415
- return __privateGet(this, _data).byteLength;
154371
+ return this.#data.byteLength;
154416
154372
  }
154417
154373
  get byteOffset() {
154418
- return __privateGet(this, _data).byteOffset;
154374
+ return this.#data.byteOffset;
154419
154375
  }
154420
154376
  get buffer() {
154421
- return __privateGet(this, _data).buffer;
154377
+ return this.#data.buffer;
154422
154378
  }
154423
154379
  get length() {
154424
- return __privateGet(this, _data).length / this.chars;
154380
+ return this.#data.length / this.chars;
154425
154381
  }
154426
154382
  get(idx) {
154427
154383
  const offset = this.chars * idx;
154428
154384
  let result = "";
154429
154385
  for (let i2 = 0; i2 < this.chars; i2++) {
154430
- result += String.fromCodePoint(__privateGet(this, _data)[offset + i2]);
154386
+ result += String.fromCodePoint(this.#data[offset + i2]);
154431
154387
  }
154432
154388
  return result.replace(/\u0000/g, "");
154433
154389
  }
154434
154390
  set(idx, value) {
154435
154391
  const offset = this.chars * idx;
154436
- const view = __privateGet(this, _data).subarray(offset, offset + this.chars);
154392
+ const view = this.#data.subarray(offset, offset + this.chars);
154437
154393
  view.fill(0);
154438
154394
  for (let i2 = 0; i2 < this.chars; i2++) {
154439
154395
  view[i2] = value.codePointAt(i2) ?? 0;
@@ -154441,9 +154397,9 @@ const _UnicodeStringArray = class _UnicodeStringArray {
154441
154397
  }
154442
154398
  fill(value) {
154443
154399
  this.set(0, value);
154444
- let encoded = __privateGet(this, _data).subarray(0, this.chars);
154400
+ let encoded = this.#data.subarray(0, this.chars);
154445
154401
  for (let i2 = 1; i2 < this.length; i2++) {
154446
- __privateGet(this, _data).set(encoded, i2 * this.chars);
154402
+ this.#data.set(encoded, i2 * this.chars);
154447
154403
  }
154448
154404
  }
154449
154405
  *[Symbol.iterator]() {
@@ -154451,9 +154407,7 @@ const _UnicodeStringArray = class _UnicodeStringArray {
154451
154407
  yield this.get(i2);
154452
154408
  }
154453
154409
  }
154454
- };
154455
- _data = new WeakMap();
154456
- let UnicodeStringArray = _UnicodeStringArray;
154410
+ }
154457
154411
  function json_decode_object(bytes) {
154458
154412
  const str = new TextDecoder().decode(bytes);
154459
154413
  return JSON.parse(str);
@@ -154512,11 +154466,11 @@ function get_strides(shape, order) {
154512
154466
  }
154513
154467
  function create_chunk_key_encoder({ name: name2, configuration }) {
154514
154468
  if (name2 === "default") {
154515
- const separator = (configuration == null ? void 0 : configuration.separator) ?? "/";
154469
+ const separator = configuration?.separator ?? "/";
154516
154470
  return (chunk_coords) => ["c", ...chunk_coords].join(separator);
154517
154471
  }
154518
154472
  if (name2 === "v2") {
154519
- const separator = (configuration == null ? void 0 : configuration.separator) ?? ".";
154473
+ const separator = configuration?.separator ?? ".";
154520
154474
  return (chunk_coords) => chunk_coords.join(separator) || "0";
154521
154475
  }
154522
154476
  throw new Error(`Unknown chunk key encoding: ${name2}`);
@@ -154612,7 +154566,7 @@ function is_dtype(dtype, query) {
154612
154566
  return !is_string && !is_bigint && !is_boolean && !is_object;
154613
154567
  }
154614
154568
  function is_sharding_codec(codec) {
154615
- return (codec == null ? void 0 : codec.name) === "sharding_indexed";
154569
+ return codec?.name === "sharding_indexed";
154616
154570
  }
154617
154571
  function ensure_correct_scalar(metadata) {
154618
154572
  if ((metadata.data_type === "uint64" || metadata.data_type === "int64") && metadata.fill_value != null) {
@@ -154638,7 +154592,7 @@ async function decompress(data, { format: format2, signal }) {
154638
154592
  const buffer2 = await decompressedResponse.arrayBuffer();
154639
154593
  return buffer2;
154640
154594
  } catch {
154641
- signal == null ? void 0 : signal.throwIfAborted();
154595
+ signal?.throwIfAborted();
154642
154596
  throw new Error(`Failed to decode ${format2}`);
154643
154597
  }
154644
154598
  }
@@ -154678,48 +154632,42 @@ function bytes_per_element(TypedArray2) {
154678
154632
  }
154679
154633
  return 4;
154680
154634
  }
154681
- const _BytesCodec = class _BytesCodec {
154635
+ class BytesCodec {
154682
154636
  constructor(configuration, meta) {
154683
- __privateAdd(this, _stride);
154684
- __privateAdd(this, _TypedArray);
154685
- __privateAdd(this, _BYTES_PER_ELEMENT);
154686
- __privateAdd(this, _shape);
154687
- __privateAdd(this, _endian);
154688
154637
  this.kind = "array_to_bytes";
154689
- __privateSet(this, _endian, configuration == null ? void 0 : configuration.endian);
154690
- __privateSet(this, _TypedArray, get_ctr(meta.data_type));
154691
- __privateSet(this, _shape, meta.shape);
154692
- __privateSet(this, _stride, get_strides(meta.shape, "C"));
154693
- const sample = new (__privateGet(this, _TypedArray))(0);
154694
- __privateSet(this, _BYTES_PER_ELEMENT, sample.BYTES_PER_ELEMENT);
154695
- }
154638
+ this.#endian = configuration?.endian;
154639
+ this.#TypedArray = get_ctr(meta.data_type);
154640
+ this.#shape = meta.shape;
154641
+ this.#stride = get_strides(meta.shape, "C");
154642
+ const sample = new this.#TypedArray(0);
154643
+ this.#BYTES_PER_ELEMENT = sample.BYTES_PER_ELEMENT;
154644
+ }
154645
+ #stride;
154646
+ #TypedArray;
154647
+ #BYTES_PER_ELEMENT;
154648
+ #shape;
154649
+ #endian;
154696
154650
  static fromConfig(configuration, meta) {
154697
- return new _BytesCodec(configuration, meta);
154651
+ return new BytesCodec(configuration, meta);
154698
154652
  }
154699
154653
  encode(arr) {
154700
154654
  let bytes = new Uint8Array(arr.data.buffer);
154701
- if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
154702
- byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
154655
+ if (LITTLE_ENDIAN_OS && this.#endian === "big") {
154656
+ byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
154703
154657
  }
154704
154658
  return bytes;
154705
154659
  }
154706
154660
  decode(bytes) {
154707
- if (LITTLE_ENDIAN_OS && __privateGet(this, _endian) === "big") {
154708
- byteswap_inplace(bytes, bytes_per_element(__privateGet(this, _TypedArray)));
154661
+ if (LITTLE_ENDIAN_OS && this.#endian === "big") {
154662
+ byteswap_inplace(bytes, bytes_per_element(this.#TypedArray));
154709
154663
  }
154710
154664
  return {
154711
- data: new (__privateGet(this, _TypedArray))(bytes.buffer, bytes.byteOffset, bytes.byteLength / __privateGet(this, _BYTES_PER_ELEMENT)),
154712
- shape: __privateGet(this, _shape),
154713
- stride: __privateGet(this, _stride)
154665
+ data: new this.#TypedArray(bytes.buffer, bytes.byteOffset, bytes.byteLength / this.#BYTES_PER_ELEMENT),
154666
+ shape: this.#shape,
154667
+ stride: this.#stride
154714
154668
  };
154715
154669
  }
154716
- };
154717
- _stride = new WeakMap();
154718
- _TypedArray = new WeakMap();
154719
- _BYTES_PER_ELEMENT = new WeakMap();
154720
- _shape = new WeakMap();
154721
- _endian = new WeakMap();
154722
- let BytesCodec = _BytesCodec;
154670
+ }
154723
154671
  class Crc32cCodec {
154724
154672
  constructor() {
154725
154673
  this.kind = "bytes_to_bytes";
@@ -154741,7 +154689,7 @@ class GzipCodec {
154741
154689
  static fromConfig(_) {
154742
154690
  return new GzipCodec();
154743
154691
  }
154744
- encode(_bytes2) {
154692
+ encode(_bytes) {
154745
154693
  throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
154746
154694
  }
154747
154695
  async decode(bytes) {
@@ -154761,10 +154709,8 @@ function sort_keys_replacer(_key, value) {
154761
154709
  return sorted;
154762
154710
  }, {}) : value;
154763
154711
  }
154764
- const _JsonCodec = class _JsonCodec {
154712
+ class JsonCodec {
154765
154713
  constructor(configuration = {}) {
154766
- __privateAdd(this, _encoder_config);
154767
- __privateAdd(this, _decoder_config);
154768
154714
  this.kind = "array_to_bytes";
154769
154715
  this.configuration = configuration;
154770
154716
  const { encoding = "utf-8", skipkeys = false, ensure_ascii = true, check_circular = true, allow_nan = true, sort_keys = true, indent, strict = true } = configuration;
@@ -154776,7 +154722,7 @@ const _JsonCodec = class _JsonCodec {
154776
154722
  separators = [", ", ": "];
154777
154723
  }
154778
154724
  }
154779
- __privateSet(this, _encoder_config, {
154725
+ this.#encoder_config = {
154780
154726
  encoding,
154781
154727
  skipkeys,
154782
154728
  ensure_ascii,
@@ -154785,14 +154731,16 @@ const _JsonCodec = class _JsonCodec {
154785
154731
  indent,
154786
154732
  separators,
154787
154733
  sort_keys
154788
- });
154789
- __privateSet(this, _decoder_config, { strict });
154734
+ };
154735
+ this.#decoder_config = { strict };
154790
154736
  }
154737
+ #encoder_config;
154738
+ #decoder_config;
154791
154739
  static fromConfig(configuration) {
154792
- return new _JsonCodec(configuration);
154740
+ return new JsonCodec(configuration);
154793
154741
  }
154794
154742
  encode(buf) {
154795
- const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = __privateGet(this, _encoder_config);
154743
+ const { indent, encoding, ensure_ascii, check_circular, allow_nan, sort_keys } = this.#encoder_config;
154796
154744
  assert$1(encoding === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
154797
154745
  const replacer_functions = [];
154798
154746
  assert$1(check_circular, "JsonCodec does not yet support skipping the check for circular references during encoding.");
@@ -154826,7 +154774,7 @@ const _JsonCodec = class _JsonCodec {
154826
154774
  return new TextEncoder().encode(json_str);
154827
154775
  }
154828
154776
  decode(bytes) {
154829
- const { strict } = __privateGet(this, _decoder_config);
154777
+ const { strict } = this.#decoder_config;
154830
154778
  assert$1(strict, "JsonCodec does not yet support non-strict decoding.");
154831
154779
  const items = json_decode_object(bytes);
154832
154780
  const shape = items.pop();
@@ -154836,10 +154784,7 @@ const _JsonCodec = class _JsonCodec {
154836
154784
  const data = items;
154837
154785
  return { data, shape, stride };
154838
154786
  }
154839
- };
154840
- _encoder_config = new WeakMap();
154841
- _decoder_config = new WeakMap();
154842
- let JsonCodec = _JsonCodec;
154787
+ }
154843
154788
  function proxy(arr) {
154844
154789
  if (arr instanceof BoolArray || arr instanceof ByteStringArray || arr instanceof UnicodeStringArray) {
154845
154790
  const arrp = new Proxy(arr, {
@@ -154908,10 +154853,8 @@ function matches_order(chunk, target) {
154908
154853
  assert$1(source.length === target.length, "Orders must match");
154909
154854
  return source.every((dim, i2) => dim === target[i2]);
154910
154855
  }
154911
- const _TransposeCodec = class _TransposeCodec {
154856
+ class TransposeCodec {
154912
154857
  constructor(configuration, meta) {
154913
- __privateAdd(this, _order);
154914
- __privateAdd(this, _inverseOrder);
154915
154858
  this.kind = "array_to_array";
154916
154859
  let value = configuration.order ?? "C";
154917
154860
  let rank2 = meta.shape.length;
@@ -154934,39 +154877,38 @@ const _TransposeCodec = class _TransposeCodec {
154934
154877
  inverseOrder[x] = i2;
154935
154878
  });
154936
154879
  }
154937
- __privateSet(this, _order, order);
154938
- __privateSet(this, _inverseOrder, inverseOrder);
154880
+ this.#order = order;
154881
+ this.#inverseOrder = inverseOrder;
154939
154882
  }
154883
+ #order;
154884
+ #inverseOrder;
154940
154885
  static fromConfig(configuration, meta) {
154941
- return new _TransposeCodec(configuration, meta);
154886
+ return new TransposeCodec(configuration, meta);
154942
154887
  }
154943
154888
  encode(arr) {
154944
- if (matches_order(arr, __privateGet(this, _inverseOrder))) {
154889
+ if (matches_order(arr, this.#inverseOrder)) {
154945
154890
  return arr;
154946
154891
  }
154947
- return convert_array_order(arr, __privateGet(this, _inverseOrder));
154892
+ return convert_array_order(arr, this.#inverseOrder);
154948
154893
  }
154949
154894
  decode(arr) {
154950
154895
  return {
154951
154896
  data: arr.data,
154952
154897
  shape: arr.shape,
154953
- stride: get_strides(arr.shape, __privateGet(this, _order))
154898
+ stride: get_strides(arr.shape, this.#order)
154954
154899
  };
154955
154900
  }
154956
- };
154957
- _order = new WeakMap();
154958
- _inverseOrder = new WeakMap();
154959
- let TransposeCodec = _TransposeCodec;
154960
- const _VLenUTF8 = class _VLenUTF8 {
154901
+ }
154902
+ class VLenUTF8 {
154961
154903
  constructor(shape) {
154962
- __privateAdd(this, _shape2);
154963
- __privateAdd(this, _strides);
154964
154904
  this.kind = "array_to_bytes";
154965
- __privateSet(this, _shape2, shape);
154966
- __privateSet(this, _strides, get_strides(shape, "C"));
154905
+ this.#shape = shape;
154906
+ this.#strides = get_strides(shape, "C");
154967
154907
  }
154908
+ #shape;
154909
+ #strides;
154968
154910
  static fromConfig(_, meta) {
154969
- return new _VLenUTF8(meta.shape);
154911
+ return new VLenUTF8(meta.shape);
154970
154912
  }
154971
154913
  encode(_chunk) {
154972
154914
  throw new Error("Method not implemented.");
@@ -154982,12 +154924,9 @@ const _VLenUTF8 = class _VLenUTF8 {
154982
154924
  data[i2] = decoder.decode(bytes.buffer.slice(pos, pos + item_length));
154983
154925
  pos += item_length;
154984
154926
  }
154985
- return { data, shape: __privateGet(this, _shape2), stride: __privateGet(this, _strides) };
154927
+ return { data, shape: this.#shape, stride: this.#strides };
154986
154928
  }
154987
- };
154988
- _shape2 = new WeakMap();
154989
- _strides = new WeakMap();
154990
- let VLenUTF8 = _VLenUTF8;
154929
+ }
154991
154930
  class ZlibCodec {
154992
154931
  constructor() {
154993
154932
  this.kind = "bytes_to_bytes";
@@ -154995,7 +154934,7 @@ class ZlibCodec {
154995
154934
  static fromConfig(_) {
154996
154935
  return new ZlibCodec();
154997
154936
  }
154998
- encode(_bytes2) {
154937
+ encode(_bytes) {
154999
154938
  throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
155000
154939
  }
155001
154940
  async decode(bytes) {
@@ -155004,7 +154943,7 @@ class ZlibCodec {
155004
154943
  }
155005
154944
  }
155006
154945
  function create_default_registry() {
155007
- return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-B8fjEpk7.js").then((m) => m.default)).set("lz4", () => import("./lz4-C9lm_i9S.js").then((m) => m.default)).set("zstd", () => import("./zstd-y75FARxZ.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
154946
+ return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-DvQQ1ST0.js").then((m) => m.default)).set("lz4", () => import("./lz4-BIbM36RN.js").then((m) => m.default)).set("zstd", () => import("./zstd-CO575QiM.js").then((m) => m.default)).set("gzip", () => GzipCodec).set("zlib", () => ZlibCodec).set("transpose", () => TransposeCodec).set("bytes", () => BytesCodec).set("crc32c", () => Crc32cCodec).set("vlen-utf8", () => VLenUTF8).set("json2", () => JsonCodec).set("bitround", () => BitroundCodec);
155008
154947
  }
155009
154948
  const registry = create_default_registry();
155010
154949
  function create_codec_pipeline(chunk_metadata) {
@@ -155038,8 +154977,7 @@ function create_codec_pipeline(chunk_metadata) {
155038
154977
  }
155039
154978
  async function load_codecs(chunk_meta) {
155040
154979
  let promises = chunk_meta.codecs.map(async (meta) => {
155041
- var _a3;
155042
- let Codec = await ((_a3 = registry.get(meta.name)) == null ? void 0 : _a3());
154980
+ let Codec = await registry.get(meta.name)?.();
155043
154981
  assert$1(Codec, `Unknown codec: ${meta.name}`);
155044
154982
  return { Codec, meta };
155045
154983
  });
@@ -155138,19 +155076,17 @@ function root(store) {
155138
155076
  class Group extends Location {
155139
155077
  constructor(store, path, metadata) {
155140
155078
  super(store, path);
155141
- __privateAdd(this, _metadata);
155142
155079
  this.kind = "group";
155143
- __privateSet(this, _metadata, metadata);
155080
+ this.#metadata = metadata;
155144
155081
  }
155082
+ #metadata;
155145
155083
  get attrs() {
155146
- return __privateGet(this, _metadata).attributes;
155084
+ return this.#metadata.attributes;
155147
155085
  }
155148
155086
  }
155149
- _metadata = new WeakMap();
155150
155087
  function get_array_order(codecs) {
155151
- var _a3;
155152
155088
  const maybe_transpose_codec = codecs.find((c) => c.name === "transpose");
155153
- return ((_a3 = maybe_transpose_codec == null ? void 0 : maybe_transpose_codec.configuration) == null ? void 0 : _a3.order) ?? "C";
155089
+ return maybe_transpose_codec?.configuration?.order ?? "C";
155154
155090
  }
155155
155091
  const CONTEXT_MARKER = Symbol("zarrita.context");
155156
155092
  function get_context(obj) {
@@ -155200,28 +155136,28 @@ function create_context(location, metadata) {
155200
155136
  }
155201
155137
  };
155202
155138
  }
155203
- let Array$1 = (_c = class extends (_a = Location, _a) {
155139
+ let Array$1 = class Array2 extends (_a = Location, _a) {
155204
155140
  constructor(store, path, metadata) {
155205
155141
  super(store, path);
155206
- __privateAdd(this, _metadata2);
155207
155142
  this.kind = "array";
155208
- __privateSet(this, _metadata2, {
155143
+ this.#metadata = {
155209
155144
  ...metadata,
155210
155145
  fill_value: ensure_correct_scalar(metadata)
155211
- });
155146
+ };
155212
155147
  this[CONTEXT_MARKER] = create_context(this, metadata);
155213
155148
  }
155149
+ #metadata;
155214
155150
  get attrs() {
155215
- return __privateGet(this, _metadata2).attributes;
155151
+ return this.#metadata.attributes;
155216
155152
  }
155217
155153
  get shape() {
155218
- return __privateGet(this, _metadata2).shape;
155154
+ return this.#metadata.shape;
155219
155155
  }
155220
155156
  get chunks() {
155221
155157
  return this[CONTEXT_MARKER].chunk_shape;
155222
155158
  }
155223
155159
  get dtype() {
155224
- return __privateGet(this, _metadata2).data_type;
155160
+ return this.#metadata.data_type;
155225
155161
  }
155226
155162
  async getChunk(chunk_coords, options) {
155227
155163
  let context = this[CONTEXT_MARKER];
@@ -155258,7 +155194,7 @@ let Array$1 = (_c = class extends (_a = Location, _a) {
155258
155194
  is(query) {
155259
155195
  return is_dtype(this.dtype, query);
155260
155196
  }
155261
- }, _metadata2 = new WeakMap(), _c);
155197
+ };
155262
155198
  function* range(start, stop, step = 1) {
155263
155199
  if (stop === void 0) {
155264
155200
  stop = start;
@@ -155472,7 +155408,6 @@ function unwrap(arr, idx) {
155472
155408
  return "get" in arr ? arr.get(idx) : arr[idx];
155473
155409
  }
155474
155410
  async function get$1(arr, selection, opts, setter2) {
155475
- var _a3;
155476
155411
  let context = get_context(arr);
155477
155412
  let indexer = new BasicIndexer({
155478
155413
  selection,
@@ -155480,7 +155415,7 @@ async function get$1(arr, selection, opts, setter2) {
155480
155415
  chunk_shape: arr.chunks
155481
155416
  });
155482
155417
  let out = setter2.prepare(new context.TypedArray(indexer.shape.reduce((a2, b) => a2 * b, 1)), indexer.shape, context.get_strides(indexer.shape));
155483
- let queue = ((_a3 = opts.create_queue) == null ? void 0 : _a3.call(opts)) ?? create_queue();
155418
+ let queue = opts.create_queue?.() ?? create_queue();
155484
155419
  for (const { chunk_coords, mapping } of indexer) {
155485
155420
  queue.add(async () => {
155486
155421
  let { data, shape, stride } = await arr.getChunk(chunk_coords, opts.opts);
@@ -155785,11 +155720,10 @@ class RelaxedFetchStore extends FetchStore {
155785
155720
  // custom error handling function or additional options
155786
155721
  // to the zarrita FetchStore so that a subclass is not required.
155787
155722
  async get(key, options = {}) {
155788
- var _a3;
155789
155723
  try {
155790
155724
  return await super.get(key, options);
155791
155725
  } catch (e2) {
155792
- if (((_a3 = e2 == null ? void 0 : e2.message) == null ? void 0 : _a3.startsWith("Unexpected response status 403")) && true) {
155726
+ if (e2?.message?.startsWith("Unexpected response status 403") && true) {
155793
155727
  return void 0;
155794
155728
  }
155795
155729
  throw e2;
@@ -155799,7 +155733,7 @@ class RelaxedFetchStore extends FetchStore {
155799
155733
  function zarrOpenRoot(url, fileType, opts) {
155800
155734
  let store;
155801
155735
  {
155802
- store = new RelaxedFetchStore(url, { overrides: opts == null ? void 0 : opts.requestInit });
155736
+ store = new RelaxedFetchStore(url, { overrides: opts?.requestInit });
155803
155737
  }
155804
155738
  return root(store);
155805
155739
  }
@@ -155955,21 +155889,21 @@ async function initLoader(imageData) {
155955
155889
  }
155956
155890
  case "ome-tiff": {
155957
155891
  let loader;
155958
- if (metadata == null ? void 0 : metadata.omeTiffOffsetsUrl) {
155892
+ if (metadata?.omeTiffOffsetsUrl) {
155959
155893
  try {
155960
155894
  const res = await fetch(metadata.omeTiffOffsetsUrl, requestInit2 || {});
155961
155895
  if (!res.ok) throw new Error(`Offsets not found: ${res.status} from ${res.url}`);
155962
155896
  const offsets = await res.json();
155963
155897
  loader = await loadOmeTiff(url, {
155964
155898
  offsets,
155965
- headers: requestInit2 == null ? void 0 : requestInit2.headers
155899
+ headers: requestInit2?.headers
155966
155900
  });
155967
155901
  } catch (err2) {
155968
155902
  log$6.error("Error loading OME-TIFF offsets:", err2);
155969
155903
  throw err2;
155970
155904
  }
155971
155905
  } else {
155972
- loader = await loadOmeTiff(url, { headers: requestInit2 == null ? void 0 : requestInit2.headers });
155906
+ loader = await loadOmeTiff(url, { headers: requestInit2?.headers });
155973
155907
  }
155974
155908
  const { Pixels: { Channels } } = loader.metadata;
155975
155909
  const channels2 = Array.isArray(Channels) ? Channels.map((channel, i2) => channel.Name || `Channel ${i2}`) : [Channels.Name || `Channel ${0}`];
@@ -156057,20 +155991,18 @@ class RasterLoader extends JsonLoader {
156057
155991
  }
156058
155992
  class RasterJsonAsImageLoader extends RasterLoader {
156059
155993
  async load() {
156060
- var _a3;
156061
155994
  const loaderResult = await super.load();
156062
155995
  const { data = {}, url: urls, coordinationValues } = loaderResult;
156063
155996
  const { loaders: allLoaders = [], meta: allMeta = [] } = data;
156064
155997
  const loaders = [];
156065
155998
  const meta = [];
156066
155999
  allMeta.forEach((layer, i2) => {
156067
- var _a4;
156068
- if (!((_a4 = layer == null ? void 0 : layer.metadata) == null ? void 0 : _a4.isBitmask)) {
156000
+ if (!layer?.metadata?.isBitmask) {
156069
156001
  loaders.push(allLoaders[i2]);
156070
156002
  meta.push(allMeta[i2]);
156071
156003
  }
156072
156004
  });
156073
- if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
156005
+ if (!coordinationValues?.spatialImageLayer) {
156074
156006
  log$6.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsImageLoader. This may be an indicator that the image could not be loaded.");
156075
156007
  }
156076
156008
  return new LoaderResult(
@@ -156080,7 +156012,7 @@ class RasterJsonAsImageLoader extends RasterLoader {
156080
156012
  urls,
156081
156013
  {
156082
156014
  // Filter coordinationValues, keeping only non-bitmask layers.
156083
- spatialImageLayer: (_a3 = coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer) == null ? void 0 : _a3.filter((l2) => l2.type !== "bitmask").map((layer) => ({
156015
+ spatialImageLayer: coordinationValues?.spatialImageLayer?.filter((l2) => l2.type !== "bitmask").map((layer) => ({
156084
156016
  ...layer,
156085
156017
  index: meta.findIndex((metaItem) => metaItem.name === allMeta[layer.index].name)
156086
156018
  }))
@@ -156090,20 +156022,18 @@ class RasterJsonAsImageLoader extends RasterLoader {
156090
156022
  }
156091
156023
  class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
156092
156024
  async load() {
156093
- var _a3;
156094
156025
  const loaderResult = await super.load();
156095
156026
  const { data = {}, url: urls, coordinationValues } = loaderResult;
156096
156027
  const { loaders: allLoaders = [], meta: allMeta = [] } = data;
156097
156028
  const loaders = [];
156098
156029
  const meta = [];
156099
156030
  allMeta.forEach((layer, i2) => {
156100
- var _a4;
156101
- if ((_a4 = layer == null ? void 0 : layer.metadata) == null ? void 0 : _a4.isBitmask) {
156031
+ if (layer?.metadata?.isBitmask) {
156102
156032
  loaders.push(allLoaders[i2]);
156103
156033
  meta.push(allMeta[i2]);
156104
156034
  }
156105
156035
  });
156106
- if (!(coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer)) {
156036
+ if (!coordinationValues?.spatialImageLayer) {
156107
156037
  log$6.warn("Could not initialize coordinationValues.spatialImageLayer in RasterJsonAsObsSegmentationsLoader. This may be an indicator that the image could not be loaded.");
156108
156038
  }
156109
156039
  return new LoaderResult(
@@ -156114,7 +156044,7 @@ class RasterJsonAsObsSegmentationsLoader extends RasterLoader {
156114
156044
  urls,
156115
156045
  {
156116
156046
  // Filter coordinationValues, keeping only bitmask layers.
156117
- spatialSegmentationLayer: (_a3 = coordinationValues == null ? void 0 : coordinationValues.spatialImageLayer) == null ? void 0 : _a3.filter((l2) => l2.type === "bitmask").map((layer) => ({
156047
+ spatialSegmentationLayer: coordinationValues?.spatialImageLayer?.filter((l2) => l2.type === "bitmask").map((layer) => ({
156118
156048
  ...layer,
156119
156049
  index: meta.findIndex((metaItem) => metaItem.name === allMeta[layer.index].name)
156120
156050
  }))