@vitessce/json 4.0.10 → 4.1.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.
@@ -309,6 +309,7 @@ const CoordinationType$1 = {
309
309
  SPATIAL_ROTATION_ORBIT: "spatialRotationOrbit",
310
310
  SPATIAL_ORBIT_AXIS: "spatialOrbitAxis",
311
311
  SPATIAL_AXIS_FIXED: "spatialAxisFixed",
312
+ SPATIAL_CAMERA_SNAPSHOT: "spatialCameraSnapshot",
312
313
  HEATMAP_ZOOM_X: "heatmapZoomX",
313
314
  HEATMAP_ZOOM_Y: "heatmapZoomY",
314
315
  HEATMAP_TARGET_X: "heatmapTargetX",
@@ -360,6 +361,7 @@ const CoordinationType$1 = {
360
361
  SPATIAL_TARGET_C: "spatialTargetC",
361
362
  SPATIAL_LAYER_VISIBLE: "spatialLayerVisible",
362
363
  SPATIAL_LAYER_OPACITY: "spatialLayerOpacity",
364
+ SPATIAL_LAYER_OPACITY_UNSELECTED: "spatialLayerOpacityUnselected",
363
365
  SPATIAL_LAYER_COLORMAP: "spatialLayerColormap",
364
366
  SPATIAL_LAYER_LABEL: "spatialLayerLabel",
365
367
  SPATIAL_LAYER_TRANSPARENT_COLOR: "spatialLayerTransparentColor",
@@ -398,6 +400,7 @@ const CoordinationType$1 = {
398
400
  PIXEL_HIGHLIGHT: "pixelHighlight",
399
401
  // Per-image-layer
400
402
  TOOLTIP_CROSSHAIRS_VISIBLE: "tooltipCrosshairsVisible",
403
+ TOOLTIP_OBS_SETS_MODE: "tooltipObsSetsMode",
401
404
  LEGEND_VISIBLE: "legendVisible",
402
405
  SPATIAL_CHANNEL_LABELS_VISIBLE: "spatialChannelLabelsVisible",
403
406
  SPATIAL_CHANNEL_LABELS_ORIENTATION: "spatialChannelLabelsOrientation",
@@ -725,6 +728,8 @@ const CoordinationType$1 = {
725
728
  CoordinationType$1.SPATIAL_ROTATION_ORBIT,
726
729
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
727
730
  CoordinationType$1.SPATIAL_ZOOM,
731
+ CoordinationType$1.SPATIAL_CAMERA_SNAPSHOT,
732
+ CoordinationType$1.SPATIAL_RENDERING_MODE,
728
733
  CoordinationType$1.OBS_FILTER,
729
734
  CoordinationType$1.OBS_HIGHLIGHT,
730
735
  CoordinationType$1.OBS_SET_SELECTION,
@@ -750,6 +755,7 @@ const CoordinationType$1 = {
750
755
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
751
756
  CoordinationType$1.SPATIAL_LAYER_COLOR,
752
757
  CoordinationType$1.SPATIAL_LAYER_OPACITY,
758
+ CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED,
753
759
  CoordinationType$1.SPATIAL_LAYER_VISIBLE,
754
760
  CoordinationType$1.SPATIAL_LAYER_LABEL,
755
761
  CoordinationType$1.SPATIAL_CHANNEL_COLOR,
@@ -791,6 +797,7 @@ const CoordinationType$1 = {
791
797
  CoordinationType$1.OBS_COLOR_ENCODING,
792
798
  CoordinationType$1.ADDITIONAL_OBS_SETS,
793
799
  CoordinationType$1.TOOLTIPS_VISIBLE,
800
+ CoordinationType$1.TOOLTIP_OBS_SETS_MODE,
794
801
  CoordinationType$1.SAMPLE_TYPE,
795
802
  CoordinationType$1.SAMPLE_SET_SELECTION,
796
803
  CoordinationType$1.SAMPLE_SET_FILTER,
@@ -842,6 +849,7 @@ const CoordinationType$1 = {
842
849
  CoordinationType$1.OBS_COLOR_ENCODING,
843
850
  CoordinationType$1.ADDITIONAL_OBS_SETS,
844
851
  CoordinationType$1.TOOLTIPS_VISIBLE,
852
+ CoordinationType$1.TOOLTIP_OBS_SETS_MODE,
845
853
  CoordinationType$1.SAMPLE_TYPE,
846
854
  CoordinationType$1.SAMPLE_SET_SELECTION,
847
855
  CoordinationType$1.SAMPLE_SET_FILTER,
@@ -923,6 +931,7 @@ const CoordinationType$1 = {
923
931
  CoordinationType$1.ADDITIONAL_OBS_SETS,
924
932
  CoordinationType$1.MOLECULE_HIGHLIGHT,
925
933
  CoordinationType$1.TOOLTIPS_VISIBLE,
934
+ CoordinationType$1.TOOLTIP_OBS_SETS_MODE,
926
935
  CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
927
936
  CoordinationType$1.ANNOTATION_STORY,
928
937
  CoordinationType$1.ANNOTATION_SHAPES,
@@ -954,6 +963,7 @@ const CoordinationType$1 = {
954
963
  CoordinationType$1.SPATIAL_ROTATION_ORBIT,
955
964
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
956
965
  CoordinationType$1.SPATIAL_AXIS_FIXED,
966
+ CoordinationType$1.SPATIAL_CAMERA_SNAPSHOT,
957
967
  CoordinationType$1.OBS_FILTER,
958
968
  CoordinationType$1.OBS_HIGHLIGHT,
959
969
  CoordinationType$1.OBS_SET_SELECTION,
@@ -971,10 +981,12 @@ const CoordinationType$1 = {
971
981
  CoordinationType$1.ADDITIONAL_OBS_SETS,
972
982
  CoordinationType$1.MOLECULE_HIGHLIGHT,
973
983
  CoordinationType$1.TOOLTIPS_VISIBLE,
984
+ CoordinationType$1.TOOLTIP_OBS_SETS_MODE,
974
985
  CoordinationType$1.FILE_UID,
975
986
  CoordinationType$1.SPATIAL_TARGET_C,
976
987
  CoordinationType$1.SPATIAL_LAYER_VISIBLE,
977
988
  CoordinationType$1.SPATIAL_LAYER_OPACITY,
989
+ CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED,
978
990
  CoordinationType$1.SPATIAL_LAYER_COLORMAP,
979
991
  CoordinationType$1.SPATIAL_LAYER_TRANSPARENT_COLOR,
980
992
  CoordinationType$1.SPATIAL_LAYER_MODEL_MATRIX,
@@ -1053,7 +1065,8 @@ const CoordinationType$1 = {
1053
1065
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
1054
1066
  CoordinationType$1.OBS_COLOR_ENCODING,
1055
1067
  CoordinationType$1.ADDITIONAL_OBS_SETS,
1056
- CoordinationType$1.TOOLTIPS_VISIBLE
1068
+ CoordinationType$1.TOOLTIPS_VISIBLE,
1069
+ CoordinationType$1.TOOLTIP_OBS_SETS_MODE
1057
1070
  ],
1058
1071
  [ViewType$1.OBS_SETS]: [
1059
1072
  CoordinationType$1.DATASET,
@@ -1170,6 +1183,7 @@ const CoordinationType$1 = {
1170
1183
  CoordinationType$1.SPATIAL_LAYER_VISIBLE,
1171
1184
  CoordinationType$1.SPATIAL_LAYER_LABEL,
1172
1185
  CoordinationType$1.SPATIAL_LAYER_OPACITY,
1186
+ CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED,
1173
1187
  CoordinationType$1.SPATIAL_LAYER_COLORMAP,
1174
1188
  CoordinationType$1.SPATIAL_LAYER_TRANSPARENT_COLOR,
1175
1189
  CoordinationType$1.SPATIAL_LAYER_MODEL_MATRIX,
@@ -6307,7 +6321,7 @@ var reTrimStart = /^\s+/;
6307
6321
  function baseTrim(string) {
6308
6322
  return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
6309
6323
  }
6310
- function isObject$5(value) {
6324
+ function isObject$3(value) {
6311
6325
  var type = typeof value;
6312
6326
  return value != null && (type == "object" || type == "function");
6313
6327
  }
@@ -6323,9 +6337,9 @@ function toNumber(value) {
6323
6337
  if (isSymbol(value)) {
6324
6338
  return NAN;
6325
6339
  }
6326
- if (isObject$5(value)) {
6340
+ if (isObject$3(value)) {
6327
6341
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
6328
- value = isObject$5(other) ? other + "" : other;
6342
+ value = isObject$3(other) ? other + "" : other;
6329
6343
  }
6330
6344
  if (typeof value != "string") {
6331
6345
  return value === 0 ? value : +value;
@@ -6351,7 +6365,7 @@ function identity$6(value) {
6351
6365
  }
6352
6366
  var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
6353
6367
  function isFunction$2(value) {
6354
- if (!isObject$5(value)) {
6368
+ if (!isObject$3(value)) {
6355
6369
  return false;
6356
6370
  }
6357
6371
  var tag2 = baseGetTag(value);
@@ -6389,7 +6403,7 @@ var reIsNative = RegExp(
6389
6403
  "^" + funcToString.call(hasOwnProperty$c).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
6390
6404
  );
6391
6405
  function baseIsNative(value) {
6392
- if (!isObject$5(value) || isMasked(value)) {
6406
+ if (!isObject$3(value) || isMasked(value)) {
6393
6407
  return false;
6394
6408
  }
6395
6409
  var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
@@ -6408,7 +6422,7 @@ var baseCreate = /* @__PURE__ */ function() {
6408
6422
  function object2() {
6409
6423
  }
6410
6424
  return function(proto) {
6411
- if (!isObject$5(proto)) {
6425
+ if (!isObject$3(proto)) {
6412
6426
  return {};
6413
6427
  }
6414
6428
  if (objectCreate) {
@@ -6475,7 +6489,7 @@ function isArrayLike(value) {
6475
6489
  return value != null && isLength(value.length) && !isFunction$2(value);
6476
6490
  }
6477
6491
  function isIterateeCall(value, index2, object2) {
6478
- if (!isObject$5(object2)) {
6492
+ if (!isObject$3(object2)) {
6479
6493
  return false;
6480
6494
  }
6481
6495
  var type = typeof index2;
@@ -6948,7 +6962,7 @@ function baseClone(value, bitmask, customizer, key, object2, stack2) {
6948
6962
  if (result !== void 0) {
6949
6963
  return result;
6950
6964
  }
6951
- if (!isObject$5(value)) {
6965
+ if (!isObject$3(value)) {
6952
6966
  return value;
6953
6967
  }
6954
6968
  var isArr = isArray$4(value);
@@ -9417,12 +9431,12 @@ function requireIntersects() {
9417
9431
  if (hasRequiredIntersects) return intersects_1;
9418
9432
  hasRequiredIntersects = 1;
9419
9433
  const Range = requireRange();
9420
- const intersects2 = (r1, r2, options) => {
9434
+ const intersects = (r1, r2, options) => {
9421
9435
  r1 = new Range(r1, options);
9422
9436
  r2 = new Range(r2, options);
9423
9437
  return r1.intersects(r2, options);
9424
9438
  };
9425
- intersects_1 = intersects2;
9439
+ intersects_1 = intersects;
9426
9440
  return intersects_1;
9427
9441
  }
9428
9442
  var simplify;
@@ -9680,7 +9694,7 @@ function requireSemver() {
9680
9694
  const outside = requireOutside();
9681
9695
  const gtr = requireGtr();
9682
9696
  const ltr = requireLtr();
9683
- const intersects2 = requireIntersects();
9697
+ const intersects = requireIntersects();
9684
9698
  const simplifyRange = requireSimplify();
9685
9699
  const subset = requireSubset();
9686
9700
  semver = {
@@ -9718,7 +9732,7 @@ function requireSemver() {
9718
9732
  outside,
9719
9733
  gtr,
9720
9734
  ltr,
9721
- intersects: intersects2,
9735
+ intersects,
9722
9736
  simplifyRange,
9723
9737
  subset,
9724
9738
  SemVer,
@@ -13440,16 +13454,6 @@ function polygons(coordinates2, properties, options = {}) {
13440
13454
  options
13441
13455
  );
13442
13456
  }
13443
- function lineString(coordinates2, properties, options = {}) {
13444
- if (coordinates2.length < 2) {
13445
- throw new Error("coordinates must be an array of two or more positions");
13446
- }
13447
- const geom = {
13448
- type: "LineString",
13449
- coordinates: coordinates2
13450
- };
13451
- return feature$1(geom, properties, options);
13452
- }
13453
13457
  function featureCollection(features, options = {}) {
13454
13458
  const fc = { type: "FeatureCollection" };
13455
13459
  if (options.id) {
@@ -13475,10 +13479,6 @@ function radiansToLength(radians2, units = "kilometers") {
13475
13479
  }
13476
13480
  return radians2 * factor;
13477
13481
  }
13478
- function radiansToDegrees(radians2) {
13479
- const normalisedRadians = radians2 % (2 * Math.PI);
13480
- return normalisedRadians * 180 / Math.PI;
13481
- }
13482
13482
  function degreesToRadians(degrees2) {
13483
13483
  const normalisedDegrees = degrees2 % 360;
13484
13484
  return normalisedDegrees * Math.PI / 180;
@@ -13486,114 +13486,6 @@ function degreesToRadians(degrees2) {
13486
13486
  function isNumber$1(num) {
13487
13487
  return !isNaN(num) && num !== null && !Array.isArray(num);
13488
13488
  }
13489
- function isObject$4(input) {
13490
- return input !== null && typeof input === "object" && !Array.isArray(input);
13491
- }
13492
- function coordEach(geojson, callback, excludeWrapCoord) {
13493
- if (geojson === null) return;
13494
- var j, k, l2, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === "FeatureCollection", isFeature = type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
13495
- for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
13496
- geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
13497
- isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
13498
- stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
13499
- for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
13500
- var multiFeatureIndex = 0;
13501
- var geometryIndex = 0;
13502
- geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
13503
- if (geometry2 === null) continue;
13504
- coords = geometry2.coordinates;
13505
- var geomType = geometry2.type;
13506
- wrapShrink = 0;
13507
- switch (geomType) {
13508
- case null:
13509
- break;
13510
- case "Point":
13511
- if (callback(
13512
- coords,
13513
- coordIndex,
13514
- featureIndex,
13515
- multiFeatureIndex,
13516
- geometryIndex
13517
- ) === false)
13518
- return false;
13519
- coordIndex++;
13520
- multiFeatureIndex++;
13521
- break;
13522
- case "LineString":
13523
- case "MultiPoint":
13524
- for (j = 0; j < coords.length; j++) {
13525
- if (callback(
13526
- coords[j],
13527
- coordIndex,
13528
- featureIndex,
13529
- multiFeatureIndex,
13530
- geometryIndex
13531
- ) === false)
13532
- return false;
13533
- coordIndex++;
13534
- if (geomType === "MultiPoint") multiFeatureIndex++;
13535
- }
13536
- if (geomType === "LineString") multiFeatureIndex++;
13537
- break;
13538
- case "Polygon":
13539
- case "MultiLineString":
13540
- for (j = 0; j < coords.length; j++) {
13541
- for (k = 0; k < coords[j].length - wrapShrink; k++) {
13542
- if (callback(
13543
- coords[j][k],
13544
- coordIndex,
13545
- featureIndex,
13546
- multiFeatureIndex,
13547
- geometryIndex
13548
- ) === false)
13549
- return false;
13550
- coordIndex++;
13551
- }
13552
- if (geomType === "MultiLineString") multiFeatureIndex++;
13553
- if (geomType === "Polygon") geometryIndex++;
13554
- }
13555
- if (geomType === "Polygon") multiFeatureIndex++;
13556
- break;
13557
- case "MultiPolygon":
13558
- for (j = 0; j < coords.length; j++) {
13559
- geometryIndex = 0;
13560
- for (k = 0; k < coords[j].length; k++) {
13561
- for (l2 = 0; l2 < coords[j][k].length - wrapShrink; l2++) {
13562
- if (callback(
13563
- coords[j][k][l2],
13564
- coordIndex,
13565
- featureIndex,
13566
- multiFeatureIndex,
13567
- geometryIndex
13568
- ) === false)
13569
- return false;
13570
- coordIndex++;
13571
- }
13572
- geometryIndex++;
13573
- }
13574
- multiFeatureIndex++;
13575
- }
13576
- break;
13577
- case "GeometryCollection":
13578
- for (j = 0; j < geometry2.geometries.length; j++)
13579
- if (coordEach(geometry2.geometries[j], callback) === false)
13580
- return false;
13581
- break;
13582
- default:
13583
- throw new Error("Unknown Geometry Type");
13584
- }
13585
- }
13586
- }
13587
- }
13588
- function featureEach(geojson, callback) {
13589
- if (geojson.type === "Feature") {
13590
- callback(geojson, 0);
13591
- } else if (geojson.type === "FeatureCollection") {
13592
- for (var i2 = 0; i2 < geojson.features.length; i2++) {
13593
- if (callback(geojson.features[i2], i2) === false) break;
13594
- }
13595
- }
13596
- }
13597
13489
  function geomEach(geojson, callback) {
13598
13490
  var i2, j, g2, geometry2, stopG, geometryMaybeCollection, isGeometryCollection, featureProperties, featureBBox, featureId2, featureIndex = 0, isFeatureCollection = geojson.type === "FeatureCollection", isFeature = geojson.type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
13599
13491
  for (i2 = 0; i2 < stop; i2++) {
@@ -13671,7 +13563,7 @@ function geomReduce(geojson, callback, initialValue) {
13671
13563
  return previousValue;
13672
13564
  }
13673
13565
  function flattenEach(geojson, callback) {
13674
- geomEach(geojson, function(geometry2, featureIndex, properties, bbox2, id) {
13566
+ geomEach(geojson, function(geometry2, featureIndex, properties, bbox, id) {
13675
13567
  var type = geometry2 === null ? null : geometry2.type;
13676
13568
  switch (type) {
13677
13569
  case null:
@@ -13679,7 +13571,7 @@ function flattenEach(geojson, callback) {
13679
13571
  case "LineString":
13680
13572
  case "Polygon":
13681
13573
  if (callback(
13682
- feature$1(geometry2, properties, { bbox: bbox2, id }),
13574
+ feature$1(geometry2, properties, { bbox, id }),
13683
13575
  featureIndex,
13684
13576
  0
13685
13577
  ) === false)
@@ -13727,46 +13619,6 @@ function flattenReduce(geojson, callback, initialValue) {
13727
13619
  );
13728
13620
  return previousValue;
13729
13621
  }
13730
- function segmentEach(geojson, callback) {
13731
- flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
13732
- var segmentIndex = 0;
13733
- if (!feature2.geometry) return;
13734
- var type = feature2.geometry.type;
13735
- if (type === "Point" || type === "MultiPoint") return;
13736
- var previousCoords;
13737
- var previousFeatureIndex = 0;
13738
- var previousMultiIndex = 0;
13739
- var prevGeomIndex = 0;
13740
- if (coordEach(
13741
- feature2,
13742
- function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {
13743
- if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {
13744
- previousCoords = currentCoord;
13745
- previousFeatureIndex = featureIndex;
13746
- previousMultiIndex = multiPartIndexCoord;
13747
- prevGeomIndex = geometryIndex;
13748
- segmentIndex = 0;
13749
- return;
13750
- }
13751
- var currentSegment = lineString(
13752
- [previousCoords, currentCoord],
13753
- feature2.properties
13754
- );
13755
- if (callback(
13756
- currentSegment,
13757
- featureIndex,
13758
- multiFeatureIndex,
13759
- geometryIndex,
13760
- segmentIndex
13761
- ) === false)
13762
- return false;
13763
- segmentIndex++;
13764
- previousCoords = currentCoord;
13765
- }
13766
- ) === false)
13767
- return false;
13768
- });
13769
- }
13770
13622
  var concaveman = { exports: {} };
13771
13623
  var rbush_min$1 = { exports: {} };
13772
13624
  var rbush_min = rbush_min$1.exports;
@@ -14172,7 +14024,7 @@ var hasRequiredConcaveman;
14172
14024
  function requireConcaveman() {
14173
14025
  if (hasRequiredConcaveman) return concaveman.exports;
14174
14026
  hasRequiredConcaveman = 1;
14175
- var RBush2 = requireRbush_min();
14027
+ var RBush = requireRbush_min();
14176
14028
  var Queue = require$$1$3;
14177
14029
  var pointInPolygon2 = requirePointInPolygon();
14178
14030
  var orient = requireOrient2d_min().orient2d;
@@ -14185,7 +14037,7 @@ function requireConcaveman() {
14185
14037
  concavity = Math.max(0, concavity === void 0 ? 2 : concavity);
14186
14038
  lengthThreshold = lengthThreshold || 0;
14187
14039
  var hull = fastConvexHull(points);
14188
- var tree = new RBush2(16);
14040
+ var tree = new RBush(16);
14189
14041
  tree.toBBox = function(a3) {
14190
14042
  return {
14191
14043
  minX: a3[0],
@@ -14208,7 +14060,7 @@ function requireConcaveman() {
14208
14060
  last = insertNode(p, last);
14209
14061
  queue.push(last);
14210
14062
  }
14211
- var segTree = new RBush2(16);
14063
+ var segTree = new RBush(16);
14212
14064
  for (i2 = 0; i2 < queue.length; i2++) segTree.insert(updateBBox(queue[i2]));
14213
14065
  var sqConcavity = concavity * concavity;
14214
14066
  var sqLenThreshold = lengthThreshold * lengthThreshold;
@@ -14266,20 +14118,20 @@ function requireConcaveman() {
14266
14118
  function compareDist(a2, b) {
14267
14119
  return a2.dist - b.dist;
14268
14120
  }
14269
- function sqSegBoxDist(a2, b, bbox2) {
14270
- if (inside(a2, bbox2) || inside(b, bbox2)) return 0;
14271
- var d1 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.maxX, bbox2.minY);
14121
+ function sqSegBoxDist(a2, b, bbox) {
14122
+ if (inside(a2, bbox) || inside(b, bbox)) return 0;
14123
+ var d1 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox.minX, bbox.minY, bbox.maxX, bbox.minY);
14272
14124
  if (d1 === 0) return 0;
14273
- var d2 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.minX, bbox2.maxY);
14125
+ var d2 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox.minX, bbox.minY, bbox.minX, bbox.maxY);
14274
14126
  if (d2 === 0) return 0;
14275
- var d3 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox2.maxX, bbox2.minY, bbox2.maxX, bbox2.maxY);
14127
+ var d3 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY);
14276
14128
  if (d3 === 0) return 0;
14277
- var d4 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox2.minX, bbox2.maxY, bbox2.maxX, bbox2.maxY);
14129
+ var d4 = sqSegSegDist(a2[0], a2[1], b[0], b[1], bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY);
14278
14130
  if (d4 === 0) return 0;
14279
14131
  return Math.min(d1, d2, d3, d4);
14280
14132
  }
14281
- function inside(a2, bbox2) {
14282
- return a2[0] >= bbox2.minX && a2[0] <= bbox2.maxX && a2[1] >= bbox2.minY && a2[1] <= bbox2.maxY;
14133
+ function inside(a2, bbox) {
14134
+ return a2[0] >= bbox.minX && a2[0] <= bbox.maxX && a2[1] >= bbox.minY && a2[1] <= bbox.maxY;
14283
14135
  }
14284
14136
  function noIntersections(a2, b, segTree) {
14285
14137
  var minX = Math.min(a2[0], b[0]);
@@ -14288,14 +14140,14 @@ function requireConcaveman() {
14288
14140
  var maxY = Math.max(a2[1], b[1]);
14289
14141
  var edges = segTree.search({ minX, minY, maxX, maxY });
14290
14142
  for (var i2 = 0; i2 < edges.length; i2++) {
14291
- if (intersects2(edges[i2].p, edges[i2].next.p, a2, b)) return false;
14143
+ if (intersects(edges[i2].p, edges[i2].next.p, a2, b)) return false;
14292
14144
  }
14293
14145
  return true;
14294
14146
  }
14295
14147
  function cross2(p1, p2, p3) {
14296
14148
  return orient(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
14297
14149
  }
14298
- function intersects2(p1, q1, p2, q2) {
14150
+ function intersects(p1, q1, p2, q2) {
14299
14151
  return p1 !== q2 && q1 !== p2 && cross2(p1, q1, p2) > 0 !== cross2(p1, q1, q2) > 0 && cross2(p2, q2, p1) > 0 !== cross2(p2, q2, q1) > 0;
14300
14152
  }
14301
14153
  function updateBBox(node2) {
@@ -16760,10 +16612,10 @@ function normalize$4(out, a2) {
16760
16612
  out[2] = a2[2] * len2;
16761
16613
  return out;
16762
16614
  }
16763
- function dot$4(a2, b) {
16615
+ function dot$3(a2, b) {
16764
16616
  return a2[0] * b[0] + a2[1] * b[1] + a2[2] * b[2];
16765
16617
  }
16766
- function cross$1(out, a2, b) {
16618
+ function cross(out, a2, b) {
16767
16619
  var ax = a2[0], ay = a2[1], az = a2[2];
16768
16620
  var bx = b[0], by = b[1], bz = b[2];
16769
16621
  out[0] = ay * bz - az * by;
@@ -16852,8 +16704,8 @@ function rotateZ$2(out, a2, b, rad) {
16852
16704
  out[2] = r2[2] + b[2];
16853
16705
  return out;
16854
16706
  }
16855
- function angle$2(a2, b) {
16856
- var ax = a2[0], ay = a2[1], az = a2[2], bx = b[0], by = b[1], bz = b[2], mag1 = Math.sqrt(ax * ax + ay * ay + az * az), mag2 = Math.sqrt(bx * bx + by * by + bz * bz), mag = mag1 * mag2, cosine2 = mag && dot$4(a2, b) / mag;
16707
+ function angle$1(a2, b) {
16708
+ var ax = a2[0], ay = a2[1], az = a2[2], bx = b[0], by = b[1], bz = b[2], mag1 = Math.sqrt(ax * ax + ay * ay + az * az), mag2 = Math.sqrt(bx * bx + by * by + bz * bz), mag = mag1 * mag2, cosine2 = mag && dot$3(a2, b) / mag;
16857
16709
  return Math.acos(Math.min(Math.max(cosine2, -1), 1));
16858
16710
  }
16859
16711
  var sub$1 = subtract$1;
@@ -16952,10 +16804,10 @@ class Vector3 extends Vector {
16952
16804
  this[2] = checkNumber(value);
16953
16805
  }
16954
16806
  angle(vector) {
16955
- return angle$2(this, vector);
16807
+ return angle$1(this, vector);
16956
16808
  }
16957
16809
  cross(vector) {
16958
- cross$1(this, this, vector);
16810
+ cross(this, this, vector);
16959
16811
  return this.check();
16960
16812
  }
16961
16813
  rotateX({
@@ -18072,7 +17924,7 @@ function normalize$3(out, a2) {
18072
17924
  out[3] = w2 * len2;
18073
17925
  return out;
18074
17926
  }
18075
- function dot$3(a2, b) {
17927
+ function dot$2(a2, b) {
18076
17928
  return a2[0] * b[0] + a2[1] * b[1] + a2[2] * b[2] + a2[3] * b[3];
18077
17929
  }
18078
17930
  function lerp$3(out, a2, b, t) {
@@ -18688,7 +18540,7 @@ function fromMat3(out, m) {
18688
18540
  }
18689
18541
  var add$3 = add$4;
18690
18542
  var scale = scale$1;
18691
- var dot$2 = dot$3;
18543
+ var dot$1 = dot$2;
18692
18544
  var lerp$2 = lerp$3;
18693
18545
  var length$2 = length$3;
18694
18546
  var squaredLength = squaredLength$1;
@@ -18698,10 +18550,10 @@ var rotationTo = function() {
18698
18550
  var xUnitVec3 = fromValues(1, 0, 0);
18699
18551
  var yUnitVec3 = fromValues(0, 1, 0);
18700
18552
  return function(out, a2, b) {
18701
- var dot2 = dot$4(a2, b);
18553
+ var dot2 = dot$3(a2, b);
18702
18554
  if (dot2 < -0.999999) {
18703
- cross$1(tmpvec3, xUnitVec3, a2);
18704
- if (len(tmpvec3) < 1e-6) cross$1(tmpvec3, yUnitVec3, a2);
18555
+ cross(tmpvec3, xUnitVec3, a2);
18556
+ if (len(tmpvec3) < 1e-6) cross(tmpvec3, yUnitVec3, a2);
18705
18557
  normalize$4(tmpvec3, tmpvec3);
18706
18558
  setAxisAngle(out, tmpvec3, Math.PI);
18707
18559
  return out;
@@ -18712,7 +18564,7 @@ var rotationTo = function() {
18712
18564
  out[3] = 1;
18713
18565
  return out;
18714
18566
  } else {
18715
- cross$1(tmpvec3, a2, b);
18567
+ cross(tmpvec3, a2, b);
18716
18568
  out[0] = tmpvec3[0];
18717
18569
  out[1] = tmpvec3[1];
18718
18570
  out[2] = tmpvec3[2];
@@ -18826,7 +18678,7 @@ class Quaternion extends MathArray {
18826
18678
  return squaredLength(this);
18827
18679
  }
18828
18680
  dot(a2) {
18829
- return dot$2(this, a2);
18681
+ return dot$1(this, a2);
18830
18682
  }
18831
18683
  rotationTo(vectorA, vectorB) {
18832
18684
  rotationTo(this, vectorA, vectorB);
@@ -19750,7 +19602,7 @@ function isDate(x) {
19750
19602
  function isRegExp(x) {
19751
19603
  return x instanceof RegExp;
19752
19604
  }
19753
- function isObject$3(x) {
19605
+ function isObject$2(x) {
19754
19606
  return !!(x && typeof x === "object" && x.constructor === Object && !isComplex(x) && !isFraction(x));
19755
19607
  }
19756
19608
  function isNull(x) {
@@ -19857,7 +19709,7 @@ function mapObject(object2, callback) {
19857
19709
  }
19858
19710
  return clone2;
19859
19711
  }
19860
- function extend$1(a2, b) {
19712
+ function extend(a2, b) {
19861
19713
  for (var prop in b) {
19862
19714
  if (hasOwnProperty$2(b, prop)) {
19863
19715
  a2[prop] = b[prop];
@@ -21722,7 +21574,7 @@ var createTyped = /* @__PURE__ */ factory("typed", dependencies$Q, function crea
21722
21574
  },
21723
21575
  {
21724
21576
  name: "Object",
21725
- test: isObject$3
21577
+ test: isObject$2
21726
21578
  }
21727
21579
  // order 'Object' last, it matches on other classes too
21728
21580
  ];
@@ -28797,7 +28649,7 @@ var createMultiply = /* @__PURE__ */ factory(name$v, dependencies$o, (_ref) => {
28797
28649
  cptr[bcolumns] = cindex.length;
28798
28650
  return c;
28799
28651
  }
28800
- return typed2(name$v, extend$1({
28652
+ return typed2(name$v, extend({
28801
28653
  // we extend the signatures of multiplyScalar with signatures dealing with matrices
28802
28654
  "Array, Array": function ArrayArray(x, y) {
28803
28655
  _validateMatrixDimensions(arraySize(x), arraySize(y));
@@ -34216,7 +34068,7 @@ var createDivide = /* @__PURE__ */ factory(name$7, dependencies, (_ref) => {
34216
34068
  var algorithm14 = createAlgorithm14({
34217
34069
  typed: typed2
34218
34070
  });
34219
- return typed2("divide", extend$1({
34071
+ return typed2("divide", extend({
34220
34072
  // we extend the signatures of divideScalar with signatures dealing with matrices
34221
34073
  "Array | Matrix, Array | Matrix": function ArrayMatrixArrayMatrix(x, y) {
34222
34074
  return multiply2(x, inv2(y));
@@ -34351,7 +34203,7 @@ var FibonacciHeap = /* @__PURE__ */ createFibonacciHeapClass({
34351
34203
  larger,
34352
34204
  smaller: smaller$1
34353
34205
  });
34354
- var dot$1 = /* @__PURE__ */ createDot({
34206
+ var dot = /* @__PURE__ */ createDot({
34355
34207
  addScalar,
34356
34208
  conj,
34357
34209
  multiplyScalar,
@@ -34367,7 +34219,7 @@ var floor = /* @__PURE__ */ createFloor({
34367
34219
  });
34368
34220
  var multiply = /* @__PURE__ */ createMultiply({
34369
34221
  addScalar,
34370
- dot: dot$1,
34222
+ dot,
34371
34223
  equalScalar,
34372
34224
  matrix,
34373
34225
  multiplyScalar,
@@ -34400,7 +34252,7 @@ var subtract = /* @__PURE__ */ createSubtract({
34400
34252
  typed,
34401
34253
  unaryMinus
34402
34254
  });
34403
- var equal$2 = /* @__PURE__ */ createEqual({
34255
+ var equal = /* @__PURE__ */ createEqual({
34404
34256
  DenseMatrix,
34405
34257
  equalScalar,
34406
34258
  matrix,
@@ -34479,7 +34331,7 @@ var Unit = /* @__PURE__ */ createUnitClass({
34479
34331
  addScalar,
34480
34332
  config: config$1,
34481
34333
  divideScalar,
34482
- equal: equal$2,
34334
+ equal,
34483
34335
  fix,
34484
34336
  format,
34485
34337
  isNumeric: isNumeric$1,
@@ -35505,15 +35357,15 @@ function dirname(url) {
35505
35357
  }
35506
35358
  const isBoolean = (x) => typeof x === "boolean";
35507
35359
  const isFunction = (x) => typeof x === "function";
35508
- const isObject$2 = (x) => x !== null && typeof x === "object";
35509
- const isPureObject = (x) => isObject$2(x) && x.constructor === {}.constructor;
35360
+ const isObject$1 = (x) => x !== null && typeof x === "object";
35361
+ const isPureObject = (x) => isObject$1(x) && x.constructor === {}.constructor;
35510
35362
  const isIterable = (x) => x && typeof x[Symbol.iterator] === "function";
35511
35363
  const isAsyncIterable$1 = (x) => x && typeof x[Symbol.asyncIterator] === "function";
35512
35364
  const isResponse = (x) => typeof Response !== "undefined" && x instanceof Response || x && x.arrayBuffer && x.text && x.json;
35513
35365
  const isBlob = (x) => typeof Blob !== "undefined" && x instanceof Blob;
35514
35366
  const isBuffer = (x) => x && typeof x === "object" && x.isBuffer;
35515
- const isReadableDOMStream = (x) => typeof ReadableStream !== "undefined" && x instanceof ReadableStream || isObject$2(x) && isFunction(x.tee) && isFunction(x.cancel) && isFunction(x.getReader);
35516
- const isReadableNodeStream = (x) => isObject$2(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);
35367
+ const isReadableDOMStream = (x) => typeof ReadableStream !== "undefined" && x instanceof ReadableStream || isObject$1(x) && isFunction(x.tee) && isFunction(x.cancel) && isFunction(x.getReader);
35368
+ const isReadableNodeStream = (x) => isObject$1(x) && isFunction(x.read) && isFunction(x.pipe) && isBoolean(x.readable);
35517
35369
  const isReadableStream = (x) => isReadableDOMStream(x) || isReadableNodeStream(x);
35518
35370
  const DATA_URL_PATTERN = /^data:([-\w.]+\/[-\w.+]+)(;|,)/;
35519
35371
  const MIME_TYPE_PATTERN = /^([-\w.]+\/[-\w.+]+)/;
@@ -36312,7 +36164,7 @@ function getFetchFunction(options, context) {
36312
36164
  if (typeof fetchOptions.fetch === "function") {
36313
36165
  return fetchOptions.fetch;
36314
36166
  }
36315
- if (isObject$2(fetchOptions.fetch)) {
36167
+ if (isObject$1(fetchOptions.fetch)) {
36316
36168
  return (url) => fetchFile(url, fetchOptions);
36317
36169
  }
36318
36170
  if (context !== null && context !== void 0 && context.fetch) {
@@ -36333,7 +36185,7 @@ function validateOptionsObject(options, id, defaultOptions, deprecatedOptions, l
36333
36185
  const loaderName = id || "Top level";
36334
36186
  const prefix = id ? "".concat(id, ".") : "";
36335
36187
  for (const key in options) {
36336
- const isSubOptions = !id && isObject$2(options[key]);
36188
+ const isSubOptions = !id && isObject$1(options[key]);
36337
36189
  const isBaseUriOption = key === "baseUri" && !id;
36338
36190
  const isWorkerUrlOption = key === "workerUrl" && id;
36339
36191
  if (!(key in defaultOptions) && !isBaseUriOption && !isWorkerUrlOption) {
@@ -59513,7 +59365,7 @@ function getPropTypes(props) {
59513
59365
  const ERR_NOT_OBJECT = "count(): argument not an object";
59514
59366
  const ERR_NOT_CONTAINER = "count(): argument not a container";
59515
59367
  function count(container) {
59516
- if (!isObject$1(container)) {
59368
+ if (!isObject(container)) {
59517
59369
  throw new Error(ERR_NOT_OBJECT);
59518
59370
  }
59519
59371
  if (typeof container.count === "function") {
@@ -59533,7 +59385,7 @@ function count(container) {
59533
59385
  function isPlainObject(value) {
59534
59386
  return value !== null && typeof value === "object" && value.constructor === Object;
59535
59387
  }
59536
- function isObject$1(value) {
59388
+ function isObject(value) {
59537
59389
  return value !== null && typeof value === "object";
59538
59390
  }
59539
59391
  function mergeShaders(target, source) {
@@ -63866,35 +63718,35 @@ function getPointAtIndex(positions, index2, size2, offset, out = []) {
63866
63718
  }
63867
63719
  return out;
63868
63720
  }
63869
- function intersect(a2, b, edge, bbox2, out = []) {
63721
+ function intersect(a2, b, edge, bbox, out = []) {
63870
63722
  let t;
63871
63723
  let snap;
63872
63724
  if (edge & 8) {
63873
- t = (bbox2[3] - a2[1]) / (b[1] - a2[1]);
63725
+ t = (bbox[3] - a2[1]) / (b[1] - a2[1]);
63874
63726
  snap = 3;
63875
63727
  } else if (edge & 4) {
63876
- t = (bbox2[1] - a2[1]) / (b[1] - a2[1]);
63728
+ t = (bbox[1] - a2[1]) / (b[1] - a2[1]);
63877
63729
  snap = 1;
63878
63730
  } else if (edge & 2) {
63879
- t = (bbox2[2] - a2[0]) / (b[0] - a2[0]);
63731
+ t = (bbox[2] - a2[0]) / (b[0] - a2[0]);
63880
63732
  snap = 2;
63881
63733
  } else if (edge & 1) {
63882
- t = (bbox2[0] - a2[0]) / (b[0] - a2[0]);
63734
+ t = (bbox[0] - a2[0]) / (b[0] - a2[0]);
63883
63735
  snap = 0;
63884
63736
  } else {
63885
63737
  return null;
63886
63738
  }
63887
63739
  for (let i2 = 0; i2 < a2.length; i2++) {
63888
- out[i2] = (snap & 1) === i2 ? bbox2[snap] : t * (b[i2] - a2[i2]) + a2[i2];
63740
+ out[i2] = (snap & 1) === i2 ? bbox[snap] : t * (b[i2] - a2[i2]) + a2[i2];
63889
63741
  }
63890
63742
  return out;
63891
63743
  }
63892
- function bitCode(p, bbox2) {
63744
+ function bitCode(p, bbox) {
63893
63745
  let code = 0;
63894
- if (p[0] < bbox2[0]) code |= 1;
63895
- else if (p[0] > bbox2[2]) code |= 2;
63896
- if (p[1] < bbox2[1]) code |= 4;
63897
- else if (p[1] > bbox2[3]) code |= 8;
63746
+ if (p[0] < bbox[0]) code |= 1;
63747
+ else if (p[0] > bbox[2]) code |= 2;
63748
+ if (p[1] < bbox[1]) code |= 4;
63749
+ else if (p[1] > bbox[3]) code |= 8;
63898
63750
  return code;
63899
63751
  }
63900
63752
  function cutPolylineByGrid(positions, options) {
@@ -63964,7 +63816,7 @@ function cutPolygonByGrid(positions, holeIndices = null, options) {
63964
63816
  types: edgeTypes ? new Array(positions.length / size2).fill(TYPE_BORDER) : null,
63965
63817
  holes: holeIndices || []
63966
63818
  }];
63967
- const bbox2 = [[], []];
63819
+ const bbox = [[], []];
63968
63820
  let cell = [];
63969
63821
  while (queue.length) {
63970
63822
  const {
@@ -63972,9 +63824,9 @@ function cutPolygonByGrid(positions, holeIndices = null, options) {
63972
63824
  types,
63973
63825
  holes
63974
63826
  } = queue.shift();
63975
- getBoundingBox$2(pos, size2, holes[0] || pos.length, bbox2);
63976
- cell = getGridCell(bbox2[0], gridResolution, gridOffset, cell);
63977
- const code = bitCode(bbox2[1], cell);
63827
+ getBoundingBox$2(pos, size2, holes[0] || pos.length, bbox);
63828
+ cell = getGridCell(bbox[0], gridResolution, gridOffset, cell);
63829
+ const code = bitCode(bbox[1], cell);
63978
63830
  if (code) {
63979
63831
  let parts = bisectPolygon(pos, types, size2, 0, holes[0] || pos.length, cell, code);
63980
63832
  const polygonLow = {
@@ -64020,7 +63872,7 @@ function cutPolygonByGrid(positions, holeIndices = null, options) {
64020
63872
  }
64021
63873
  return result;
64022
63874
  }
64023
- function bisectPolygon(positions, edgeTypes, size2, startIndex, endIndex, bbox2, edge) {
63875
+ function bisectPolygon(positions, edgeTypes, size2, startIndex, endIndex, bbox, edge) {
64024
63876
  const numPoints = (endIndex - startIndex) / size2;
64025
63877
  const resultLow = [];
64026
63878
  const resultHigh = [];
@@ -64031,16 +63883,16 @@ function bisectPolygon(positions, edgeTypes, size2, startIndex, endIndex, bbox2,
64031
63883
  let side;
64032
63884
  let type;
64033
63885
  const prev = getPointAtIndex(positions, numPoints - 1, size2, startIndex);
64034
- let prevSide = Math.sign(edge & 8 ? prev[1] - bbox2[3] : prev[0] - bbox2[2]);
63886
+ let prevSide = Math.sign(edge & 8 ? prev[1] - bbox[3] : prev[0] - bbox[2]);
64035
63887
  let prevType = edgeTypes && edgeTypes[numPoints - 1];
64036
63888
  let lowPointCount = 0;
64037
63889
  let highPointCount = 0;
64038
63890
  for (let i2 = 0; i2 < numPoints; i2++) {
64039
63891
  p = getPointAtIndex(positions, i2, size2, startIndex, p);
64040
- side = Math.sign(edge & 8 ? p[1] - bbox2[3] : p[0] - bbox2[2]);
63892
+ side = Math.sign(edge & 8 ? p[1] - bbox[3] : p[0] - bbox[2]);
64041
63893
  type = edgeTypes && edgeTypes[startIndex / size2 + i2];
64042
63894
  if (side && prevSide && prevSide !== side) {
64043
- intersect(prev, p, edge, bbox2, scratchPoint);
63895
+ intersect(prev, p, edge, bbox, scratchPoint);
64044
63896
  push(resultLow, scratchPoint) && typesLow.push(prevType);
64045
63897
  push(resultHigh, scratchPoint) && typesHigh.push(prevType);
64046
63898
  }
@@ -65172,7 +65024,7 @@ function requireEarcut() {
65172
65024
  var p = start;
65173
65025
  do {
65174
65026
  var a2 = p.prev, b = p.next.next;
65175
- if (!equals2(a2, b) && intersects2(a2, p, p.next, b) && locallyInside(a2, b) && locallyInside(b, a2)) {
65027
+ if (!equals2(a2, b) && intersects(a2, p, p.next, b) && locallyInside(a2, b) && locallyInside(b, a2)) {
65176
65028
  triangles.push(a2.i / dim | 0);
65177
65029
  triangles.push(p.i / dim | 0);
65178
65030
  triangles.push(b.i / dim | 0);
@@ -65347,7 +65199,7 @@ function requireEarcut() {
65347
65199
  function equals2(p1, p2) {
65348
65200
  return p1.x === p2.x && p1.y === p2.y;
65349
65201
  }
65350
- function intersects2(p1, q1, p2, q2) {
65202
+ function intersects(p1, q1, p2, q2) {
65351
65203
  var o1 = sign2(area2(p1, q1, p2));
65352
65204
  var o2 = sign2(area2(p1, q1, q2));
65353
65205
  var o3 = sign2(area2(p2, q2, p1));
@@ -65368,7 +65220,7 @@ function requireEarcut() {
65368
65220
  function intersectsPolygon(a2, b) {
65369
65221
  var p = a2;
65370
65222
  do {
65371
- if (p.i !== a2.i && p.next.i !== a2.i && p.i !== b.i && p.next.i !== b.i && intersects2(p, p.next, a2, b)) return true;
65223
+ if (p.i !== a2.i && p.next.i !== a2.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a2, b)) return true;
65372
65224
  p = p.next;
65373
65225
  } while (p !== a2);
65374
65226
  return false;
@@ -71404,7 +71256,7 @@ class Tile2DHeader {
71404
71256
  const {
71405
71257
  index: index2,
71406
71258
  id,
71407
- bbox: bbox2,
71259
+ bbox,
71408
71260
  userData,
71409
71261
  zoom
71410
71262
  } = this;
@@ -71430,7 +71282,7 @@ class Tile2DHeader {
71430
71282
  tileData = await getData({
71431
71283
  index: index2,
71432
71284
  id,
71433
- bbox: bbox2,
71285
+ bbox,
71434
71286
  userData,
71435
71287
  zoom,
71436
71288
  signal
@@ -72304,8 +72156,8 @@ const urlType = {
72304
72156
  return true;
72305
72157
  }
72306
72158
  };
72307
- function transformBox(bbox2, modelMatrix2) {
72308
- const transformedCoords = [modelMatrix2.transformAsPoint([bbox2[0], bbox2[1]]), modelMatrix2.transformAsPoint([bbox2[2], bbox2[1]]), modelMatrix2.transformAsPoint([bbox2[0], bbox2[3]]), modelMatrix2.transformAsPoint([bbox2[2], bbox2[3]])];
72159
+ function transformBox(bbox, modelMatrix2) {
72160
+ const transformedCoords = [modelMatrix2.transformAsPoint([bbox[0], bbox[1]]), modelMatrix2.transformAsPoint([bbox[2], bbox[1]]), modelMatrix2.transformAsPoint([bbox[0], bbox[3]]), modelMatrix2.transformAsPoint([bbox[2], bbox[3]])];
72309
72161
  const transformedBox = [Math.min(...transformedCoords.map((i2) => i2[0])), Math.min(...transformedCoords.map((i2) => i2[1])), Math.max(...transformedCoords.map((i2) => i2[0])), Math.max(...transformedCoords.map((i2) => i2[1]))];
72310
72162
  return transformedBox;
72311
72163
  }
@@ -72373,12 +72225,12 @@ function getCullBoundsInViewport(viewport, z2, cullRect) {
72373
72225
  const bounds1 = getCullBoundsInViewport(viewport, z2[1], cullRect);
72374
72226
  return [Math.min(bounds0[0], bounds1[0]), Math.min(bounds0[1], bounds1[1]), Math.max(bounds0[2], bounds1[2]), Math.max(bounds0[3], bounds1[3])];
72375
72227
  }
72376
- function getIndexingCoords(bbox2, scale2, modelMatrixInverse) {
72228
+ function getIndexingCoords(bbox, scale2, modelMatrixInverse) {
72377
72229
  if (modelMatrixInverse) {
72378
- const transformedTileIndex = transformBox(bbox2, modelMatrixInverse).map((i2) => i2 * scale2 / TILE_SIZE$1);
72230
+ const transformedTileIndex = transformBox(bbox, modelMatrixInverse).map((i2) => i2 * scale2 / TILE_SIZE$1);
72379
72231
  return transformedTileIndex;
72380
72232
  }
72381
- return bbox2.map((i2) => i2 * scale2 / TILE_SIZE$1);
72233
+ return bbox.map((i2) => i2 * scale2 / TILE_SIZE$1);
72382
72234
  }
72383
72235
  function getScale(z2, tileSize) {
72384
72236
  return Math.pow(2, z2) * TILE_SIZE$1 / tileSize;
@@ -72415,9 +72267,9 @@ function tileToBoundingBox(viewport, x, y, z2, tileSize = TILE_SIZE$1) {
72415
72267
  };
72416
72268
  }
72417
72269
  function getIdentityTileIndices(viewport, z2, tileSize, extent2, modelMatrixInverse) {
72418
- const bbox2 = getBoundingBox(viewport, null, extent2);
72270
+ const bbox = getBoundingBox(viewport, null, extent2);
72419
72271
  const scale2 = getScale(z2, tileSize);
72420
- const [minX, minY, maxX, maxY] = getIndexingCoords(bbox2, scale2, modelMatrixInverse);
72272
+ const [minX, minY, maxX, maxY] = getIndexingCoords(bbox, scale2, modelMatrixInverse);
72421
72273
  const indices = [];
72422
72274
  for (let x = Math.floor(minX); x < maxX; x++) {
72423
72275
  for (let y = Math.floor(minY); y < maxY; y++) {
@@ -72606,16 +72458,16 @@ class Tileset2D {
72606
72458
  cullRect
72607
72459
  });
72608
72460
  const {
72609
- bbox: bbox2
72461
+ bbox
72610
72462
  } = tile;
72611
72463
  for (const [minX, minY, maxX, maxY] of boundsArr) {
72612
72464
  let overlaps;
72613
- if ("west" in bbox2) {
72614
- overlaps = bbox2.west < maxX && bbox2.east > minX && bbox2.south < maxY && bbox2.north > minY;
72465
+ if ("west" in bbox) {
72466
+ overlaps = bbox.west < maxX && bbox.east > minX && bbox.south < maxY && bbox.north > minY;
72615
72467
  } else {
72616
- const y02 = Math.min(bbox2.top, bbox2.bottom);
72617
- const y12 = Math.max(bbox2.top, bbox2.bottom);
72618
- overlaps = bbox2.left < maxX && bbox2.right > minX && y02 < maxY && y12 > minY;
72468
+ const y02 = Math.min(bbox.top, bbox.bottom);
72469
+ const y12 = Math.max(bbox.top, bbox.bottom);
72470
+ overlaps = bbox.left < maxX && bbox.right > minX && y02 < maxY && y12 > minY;
72619
72471
  }
72620
72472
  if (overlaps) {
72621
72473
  return true;
@@ -89905,7 +89757,7 @@ class Ellipsoid {
89905
89757
  h.copy(scratchCartesian).subtract(point2);
89906
89758
  const longitude = Math.atan2(normal.y, normal.x);
89907
89759
  const latitude = Math.asin(normal.z);
89908
- const height = Math.sign(dot$4(h, scratchCartesian)) * length$4(h);
89760
+ const height = Math.sign(dot$3(h, scratchCartesian)) * length$4(h);
89909
89761
  return toCartographicFromRadians([longitude, latitude, height], result);
89910
89762
  }
89911
89763
  eastNorthUpToFixedFrame(origin, result = new Matrix4()) {
@@ -94309,13 +94161,13 @@ class TerrainLayer extends CompositeLayer {
94309
94161
  let bottomLeft = [0, 0];
94310
94162
  let topRight = [0, 0];
94311
94163
  if (viewport.isGeospatial) {
94312
- const bbox2 = tile.bbox;
94313
- bottomLeft = viewport.projectFlat([bbox2.west, bbox2.south]);
94314
- topRight = viewport.projectFlat([bbox2.east, bbox2.north]);
94164
+ const bbox = tile.bbox;
94165
+ bottomLeft = viewport.projectFlat([bbox.west, bbox.south]);
94166
+ topRight = viewport.projectFlat([bbox.east, bbox.north]);
94315
94167
  } else {
94316
- const bbox2 = tile.bbox;
94317
- bottomLeft = [bbox2.left, bbox2.bottom];
94318
- topRight = [bbox2.right, bbox2.top];
94168
+ const bbox = tile.bbox;
94169
+ bottomLeft = [bbox.left, bbox.bottom];
94170
+ topRight = [bbox.right, bbox.top];
94319
94171
  }
94320
94172
  const bounds2 = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]];
94321
94173
  const terrain = this.loadTerrain({
@@ -94686,27 +94538,27 @@ function Point([pointX, pointY], [nw, se], viewport) {
94686
94538
  const y = lerp$6(nw[1], se[1], pointY);
94687
94539
  return viewport.unprojectFlat([x, y]);
94688
94540
  }
94689
- function getPoints(geometry2, bbox2, viewport) {
94690
- return geometry2.map((g2) => Point(g2, bbox2, viewport));
94541
+ function getPoints(geometry2, bbox, viewport) {
94542
+ return geometry2.map((g2) => Point(g2, bbox, viewport));
94691
94543
  }
94692
- function MultiPoint(multiPoint, bbox2, viewport) {
94693
- return getPoints(multiPoint, bbox2, viewport);
94544
+ function MultiPoint(multiPoint, bbox, viewport) {
94545
+ return getPoints(multiPoint, bbox, viewport);
94694
94546
  }
94695
- function LineString(line, bbox2, viewport) {
94696
- return getPoints(line, bbox2, viewport);
94547
+ function LineString(line, bbox, viewport) {
94548
+ return getPoints(line, bbox, viewport);
94697
94549
  }
94698
- function MultiLineString(multiLineString, bbox2, viewport) {
94699
- return multiLineString.map((lineString2) => LineString(lineString2, bbox2, viewport));
94550
+ function MultiLineString(multiLineString, bbox, viewport) {
94551
+ return multiLineString.map((lineString) => LineString(lineString, bbox, viewport));
94700
94552
  }
94701
- function Polygon(polygon2, bbox2, viewport) {
94702
- return polygon2.map((polygonRing) => getPoints(polygonRing, bbox2, viewport));
94553
+ function Polygon(polygon2, bbox, viewport) {
94554
+ return polygon2.map((polygonRing) => getPoints(polygonRing, bbox, viewport));
94703
94555
  }
94704
- function MultiPolygon(multiPolygon2, bbox2, viewport) {
94705
- return multiPolygon2.map((polygon2) => Polygon(polygon2, bbox2, viewport));
94556
+ function MultiPolygon(multiPolygon2, bbox, viewport) {
94557
+ return multiPolygon2.map((polygon2) => Polygon(polygon2, bbox, viewport));
94706
94558
  }
94707
- function transform$1(geometry2, bbox2, viewport) {
94708
- const nw = viewport.projectFlat([bbox2.west, bbox2.north]);
94709
- const se = viewport.projectFlat([bbox2.east, bbox2.south]);
94559
+ function transform$1(geometry2, bbox, viewport) {
94560
+ const nw = viewport.projectFlat([bbox.west, bbox.north]);
94561
+ const se = viewport.projectFlat([bbox.east, bbox.south]);
94710
94562
  const projectedBbox = [nw, se];
94711
94563
  return {
94712
94564
  ...geometry2,
@@ -95096,11 +94948,11 @@ class MVTLayer extends TileLayer {
95096
94948
  return [];
95097
94949
  }
95098
94950
  const {
95099
- bbox: bbox2
94951
+ bbox
95100
94952
  } = tile;
95101
- if (tile._contentWGS84 === void 0 && isGeoBoundingBox(bbox2)) {
94953
+ if (tile._contentWGS84 === void 0 && isGeoBoundingBox(bbox)) {
95102
94954
  const content = this.state.binary ? binaryToGeojson(tile.content) : tile.content;
95103
- tile._contentWGS84 = content.map((feature2) => transformTileCoordsToWGS84(feature2, bbox2, this.context.viewport));
94955
+ tile._contentWGS84 = content.map((feature2) => transformTileCoordsToWGS84(feature2, bbox, this.context.viewport));
95104
94956
  }
95105
94957
  return tile._contentWGS84;
95106
94958
  }
@@ -95127,7 +94979,7 @@ function getFeatureLayerName(feature2) {
95127
94979
  function isFeatureIdDefined(value) {
95128
94980
  return value !== void 0 && value !== null && value !== "";
95129
94981
  }
95130
- function transformTileCoordsToWGS84(object2, bbox2, viewport) {
94982
+ function transformTileCoordsToWGS84(object2, bbox, viewport) {
95131
94983
  const feature2 = {
95132
94984
  ...object2,
95133
94985
  geometry: {
@@ -95136,7 +94988,7 @@ function transformTileCoordsToWGS84(object2, bbox2, viewport) {
95136
94988
  };
95137
94989
  Object.defineProperty(feature2.geometry, "coordinates", {
95138
94990
  get: () => {
95139
- const wgs84Geom = transform$1(object2.geometry, bbox2, viewport);
94991
+ const wgs84Geom = transform$1(object2.geometry, bbox, viewport);
95140
94992
  return wgs84Geom.coordinates;
95141
94993
  }
95142
94994
  });
@@ -95228,147 +95080,6 @@ const esm$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
95228
95080
  _Tileset2D: Tileset2D,
95229
95081
  _getURLFromTemplate: getURLFromTemplate
95230
95082
  }, Symbol.toStringTag, { value: "Module" }));
95231
- function bbox$1(geojson, options = {}) {
95232
- if (geojson.bbox != null && true !== options.recompute) {
95233
- return geojson.bbox;
95234
- }
95235
- const result = [Infinity, Infinity, -Infinity, -Infinity];
95236
- coordEach(geojson, (coord) => {
95237
- if (result[0] > coord[0]) {
95238
- result[0] = coord[0];
95239
- }
95240
- if (result[1] > coord[1]) {
95241
- result[1] = coord[1];
95242
- }
95243
- if (result[2] < coord[0]) {
95244
- result[2] = coord[0];
95245
- }
95246
- if (result[3] < coord[1]) {
95247
- result[3] = coord[1];
95248
- }
95249
- });
95250
- return result;
95251
- }
95252
- function getCoord(coord) {
95253
- if (!coord) {
95254
- throw new Error("coord is required");
95255
- }
95256
- if (!Array.isArray(coord)) {
95257
- if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
95258
- return [...coord.geometry.coordinates];
95259
- }
95260
- if (coord.type === "Point") {
95261
- return [...coord.coordinates];
95262
- }
95263
- }
95264
- if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
95265
- return [...coord];
95266
- }
95267
- throw new Error("coord must be GeoJSON Point or an Array of numbers");
95268
- }
95269
- function getCoords(coords) {
95270
- if (Array.isArray(coords)) {
95271
- return coords;
95272
- }
95273
- if (coords.type === "Feature") {
95274
- if (coords.geometry !== null) {
95275
- return coords.geometry.coordinates;
95276
- }
95277
- } else {
95278
- if (coords.coordinates) {
95279
- return coords.coordinates;
95280
- }
95281
- }
95282
- throw new Error(
95283
- "coords must be GeoJSON Feature, Geometry Object or an Array"
95284
- );
95285
- }
95286
- function getGeom(geojson) {
95287
- if (geojson.type === "Feature") {
95288
- return geojson.geometry;
95289
- }
95290
- return geojson;
95291
- }
95292
- function booleanPointOnLine(pt, line, options = {}) {
95293
- const ptCoords = getCoord(pt);
95294
- const lineCoords = getCoords(line);
95295
- for (let i2 = 0; i2 < lineCoords.length - 1; i2++) {
95296
- let ignoreBoundary = false;
95297
- if (options.ignoreEndVertices) {
95298
- if (i2 === 0) {
95299
- ignoreBoundary = "start";
95300
- }
95301
- if (i2 === lineCoords.length - 2) {
95302
- ignoreBoundary = "end";
95303
- }
95304
- if (i2 === 0 && i2 + 1 === lineCoords.length - 1) {
95305
- ignoreBoundary = "both";
95306
- }
95307
- }
95308
- if (isPointOnLineSegment(
95309
- lineCoords[i2],
95310
- lineCoords[i2 + 1],
95311
- ptCoords,
95312
- ignoreBoundary,
95313
- typeof options.epsilon === "undefined" ? null : options.epsilon
95314
- )) {
95315
- return true;
95316
- }
95317
- }
95318
- return false;
95319
- }
95320
- function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt, excludeBoundary, epsilon3) {
95321
- const x = pt[0];
95322
- const y = pt[1];
95323
- const x12 = lineSegmentStart[0];
95324
- const y12 = lineSegmentStart[1];
95325
- const x2 = lineSegmentEnd[0];
95326
- const y2 = lineSegmentEnd[1];
95327
- const dxc = pt[0] - x12;
95328
- const dyc = pt[1] - y12;
95329
- const dxl = x2 - x12;
95330
- const dyl = y2 - y12;
95331
- const cross2 = dxc * dyl - dyc * dxl;
95332
- if (epsilon3 !== null) {
95333
- if (Math.abs(cross2) > epsilon3) {
95334
- return false;
95335
- }
95336
- } else if (cross2 !== 0) {
95337
- return false;
95338
- }
95339
- if (Math.abs(dxl) === Math.abs(dyl) && Math.abs(dxl) === 0) {
95340
- if (excludeBoundary) {
95341
- return false;
95342
- }
95343
- if (pt[0] === lineSegmentStart[0] && pt[1] === lineSegmentStart[1]) {
95344
- return true;
95345
- } else {
95346
- return false;
95347
- }
95348
- }
95349
- if (!excludeBoundary) {
95350
- if (Math.abs(dxl) >= Math.abs(dyl)) {
95351
- return dxl > 0 ? x12 <= x && x <= x2 : x2 <= x && x <= x12;
95352
- }
95353
- return dyl > 0 ? y12 <= y && y <= y2 : y2 <= y && y <= y12;
95354
- } else if (excludeBoundary === "start") {
95355
- if (Math.abs(dxl) >= Math.abs(dyl)) {
95356
- return dxl > 0 ? x12 < x && x <= x2 : x2 <= x && x < x12;
95357
- }
95358
- return dyl > 0 ? y12 < y && y <= y2 : y2 <= y && y < y12;
95359
- } else if (excludeBoundary === "end") {
95360
- if (Math.abs(dxl) >= Math.abs(dyl)) {
95361
- return dxl > 0 ? x12 <= x && x < x2 : x2 < x && x <= x12;
95362
- }
95363
- return dyl > 0 ? y12 <= y && y < y2 : y2 < y && y <= y12;
95364
- } else if (excludeBoundary === "both") {
95365
- if (Math.abs(dxl) >= Math.abs(dyl)) {
95366
- return dxl > 0 ? x12 < x && x < x2 : x2 < x && x < x12;
95367
- }
95368
- return dyl > 0 ? y12 < y && y < y2 : y2 < y && y < y12;
95369
- }
95370
- return false;
95371
- }
95372
95083
  const epsilon$1 = 11102230246251565e-32;
95373
95084
  const splitter = 134217729;
95374
95085
  const resulterrbound = (3 + 8 * epsilon$1) * epsilon$1;
@@ -95665,6 +95376,29 @@ function pointInPolygon(p, polygon2) {
95665
95376
  }
95666
95377
  return true;
95667
95378
  }
95379
+ function getCoord(coord) {
95380
+ if (!coord) {
95381
+ throw new Error("coord is required");
95382
+ }
95383
+ if (!Array.isArray(coord)) {
95384
+ if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
95385
+ return [...coord.geometry.coordinates];
95386
+ }
95387
+ if (coord.type === "Point") {
95388
+ return [...coord.coordinates];
95389
+ }
95390
+ }
95391
+ if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
95392
+ return [...coord];
95393
+ }
95394
+ throw new Error("coord must be GeoJSON Point or an Array of numbers");
95395
+ }
95396
+ function getGeom(geojson) {
95397
+ if (geojson.type === "Feature") {
95398
+ return geojson.geometry;
95399
+ }
95400
+ return geojson;
95401
+ }
95668
95402
  function booleanPointInPolygon(point2, polygon2, options = {}) {
95669
95403
  if (!point2) {
95670
95404
  throw new Error("point is required");
@@ -95675,9 +95409,9 @@ function booleanPointInPolygon(point2, polygon2, options = {}) {
95675
95409
  const pt = getCoord(point2);
95676
95410
  const geom = getGeom(polygon2);
95677
95411
  const type = geom.type;
95678
- const bbox2 = polygon2.bbox;
95412
+ const bbox = polygon2.bbox;
95679
95413
  let polys = geom.coordinates;
95680
- if (bbox2 && inBBox(pt, bbox2) === false) {
95414
+ if (bbox && inBBox(pt, bbox) === false) {
95681
95415
  return false;
95682
95416
  }
95683
95417
  if (type === "Polygon") {
@@ -95691,1607 +95425,8 @@ function booleanPointInPolygon(point2, polygon2, options = {}) {
95691
95425
  }
95692
95426
  return result;
95693
95427
  }
95694
- function inBBox(pt, bbox2) {
95695
- return bbox2[0] <= pt[0] && bbox2[1] <= pt[1] && bbox2[2] >= pt[0] && bbox2[3] >= pt[1];
95696
- }
95697
- function booleanWithin(feature1, feature2) {
95698
- var geom1 = getGeom(feature1);
95699
- var geom2 = getGeom(feature2);
95700
- var type1 = geom1.type;
95701
- var type2 = geom2.type;
95702
- switch (type1) {
95703
- case "Point":
95704
- switch (type2) {
95705
- case "MultiPoint":
95706
- return isPointInMultiPoint$1(geom1, geom2);
95707
- case "LineString":
95708
- return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });
95709
- case "Polygon":
95710
- case "MultiPolygon":
95711
- return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });
95712
- default:
95713
- throw new Error("feature2 " + type2 + " geometry not supported");
95714
- }
95715
- case "MultiPoint":
95716
- switch (type2) {
95717
- case "MultiPoint":
95718
- return isMultiPointInMultiPoint$1(geom1, geom2);
95719
- case "LineString":
95720
- return isMultiPointOnLine$1(geom1, geom2);
95721
- case "Polygon":
95722
- case "MultiPolygon":
95723
- return isMultiPointInPoly$1(geom1, geom2);
95724
- default:
95725
- throw new Error("feature2 " + type2 + " geometry not supported");
95726
- }
95727
- case "LineString":
95728
- switch (type2) {
95729
- case "LineString":
95730
- return isLineOnLine$1(geom1, geom2);
95731
- case "Polygon":
95732
- case "MultiPolygon":
95733
- return isLineInPoly$1(geom1, geom2);
95734
- default:
95735
- throw new Error("feature2 " + type2 + " geometry not supported");
95736
- }
95737
- case "Polygon":
95738
- switch (type2) {
95739
- case "Polygon":
95740
- case "MultiPolygon":
95741
- return isPolyInPoly$1(geom1, geom2);
95742
- default:
95743
- throw new Error("feature2 " + type2 + " geometry not supported");
95744
- }
95745
- default:
95746
- throw new Error("feature1 " + type1 + " geometry not supported");
95747
- }
95748
- }
95749
- function isPointInMultiPoint$1(point2, multiPoint) {
95750
- var i2;
95751
- var output = false;
95752
- for (i2 = 0; i2 < multiPoint.coordinates.length; i2++) {
95753
- if (compareCoords$1(multiPoint.coordinates[i2], point2.coordinates)) {
95754
- output = true;
95755
- break;
95756
- }
95757
- }
95758
- return output;
95759
- }
95760
- function isMultiPointInMultiPoint$1(multiPoint1, multiPoint2) {
95761
- for (var i2 = 0; i2 < multiPoint1.coordinates.length; i2++) {
95762
- var anyMatch = false;
95763
- for (var i22 = 0; i22 < multiPoint2.coordinates.length; i22++) {
95764
- if (compareCoords$1(multiPoint1.coordinates[i2], multiPoint2.coordinates[i22])) {
95765
- anyMatch = true;
95766
- }
95767
- }
95768
- if (!anyMatch) {
95769
- return false;
95770
- }
95771
- }
95772
- return true;
95773
- }
95774
- function isMultiPointOnLine$1(multiPoint, lineString2) {
95775
- var foundInsidePoint = false;
95776
- for (var i2 = 0; i2 < multiPoint.coordinates.length; i2++) {
95777
- if (!booleanPointOnLine(multiPoint.coordinates[i2], lineString2)) {
95778
- return false;
95779
- }
95780
- if (!foundInsidePoint) {
95781
- foundInsidePoint = booleanPointOnLine(
95782
- multiPoint.coordinates[i2],
95783
- lineString2,
95784
- { ignoreEndVertices: true }
95785
- );
95786
- }
95787
- }
95788
- return foundInsidePoint;
95789
- }
95790
- function isMultiPointInPoly$1(multiPoint, polygon2) {
95791
- var output = true;
95792
- var isInside = false;
95793
- for (var i2 = 0; i2 < multiPoint.coordinates.length; i2++) {
95794
- isInside = booleanPointInPolygon(multiPoint.coordinates[i2], polygon2);
95795
- if (!isInside) {
95796
- output = false;
95797
- break;
95798
- }
95799
- {
95800
- isInside = booleanPointInPolygon(multiPoint.coordinates[i2], polygon2, {
95801
- ignoreBoundary: true
95802
- });
95803
- }
95804
- }
95805
- return output && isInside;
95806
- }
95807
- function isLineOnLine$1(lineString1, lineString2) {
95808
- for (var i2 = 0; i2 < lineString1.coordinates.length; i2++) {
95809
- if (!booleanPointOnLine(lineString1.coordinates[i2], lineString2)) {
95810
- return false;
95811
- }
95812
- }
95813
- return true;
95814
- }
95815
- function isLineInPoly$1(linestring, polygon2) {
95816
- var polyBbox = bbox$1(polygon2);
95817
- var lineBbox = bbox$1(linestring);
95818
- if (!doBBoxOverlap$1(polyBbox, lineBbox)) {
95819
- return false;
95820
- }
95821
- var foundInsidePoint = false;
95822
- for (var i2 = 0; i2 < linestring.coordinates.length; i2++) {
95823
- if (!booleanPointInPolygon(linestring.coordinates[i2], polygon2)) {
95824
- return false;
95825
- }
95826
- if (!foundInsidePoint) {
95827
- foundInsidePoint = booleanPointInPolygon(
95828
- linestring.coordinates[i2],
95829
- polygon2,
95830
- { ignoreBoundary: true }
95831
- );
95832
- }
95833
- if (!foundInsidePoint && i2 < linestring.coordinates.length - 1) {
95834
- var midpoint = getMidpoint$1(
95835
- linestring.coordinates[i2],
95836
- linestring.coordinates[i2 + 1]
95837
- );
95838
- foundInsidePoint = booleanPointInPolygon(midpoint, polygon2, {
95839
- ignoreBoundary: true
95840
- });
95841
- }
95842
- }
95843
- return foundInsidePoint;
95844
- }
95845
- function isPolyInPoly$1(geometry1, geometry2) {
95846
- var poly1Bbox = bbox$1(geometry1);
95847
- var poly2Bbox = bbox$1(geometry2);
95848
- if (!doBBoxOverlap$1(poly2Bbox, poly1Bbox)) {
95849
- return false;
95850
- }
95851
- for (var i2 = 0; i2 < geometry1.coordinates[0].length; i2++) {
95852
- if (!booleanPointInPolygon(geometry1.coordinates[0][i2], geometry2)) {
95853
- return false;
95854
- }
95855
- }
95856
- return true;
95857
- }
95858
- function doBBoxOverlap$1(bbox1, bbox2) {
95859
- if (bbox1[0] > bbox2[0]) return false;
95860
- if (bbox1[2] < bbox2[2]) return false;
95861
- if (bbox1[1] > bbox2[1]) return false;
95862
- if (bbox1[3] < bbox2[3]) return false;
95863
- return true;
95864
- }
95865
- function compareCoords$1(pair1, pair2) {
95866
- return pair1[0] === pair2[0] && pair1[1] === pair2[1];
95867
- }
95868
- function getMidpoint$1(pair1, pair2) {
95869
- return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
95870
- }
95871
- function booleanContains(feature1, feature2) {
95872
- const geom1 = getGeom(feature1);
95873
- const geom2 = getGeom(feature2);
95874
- const type1 = geom1.type;
95875
- const type2 = geom2.type;
95876
- const coords1 = geom1.coordinates;
95877
- const coords2 = geom2.coordinates;
95878
- switch (type1) {
95879
- case "Point":
95880
- switch (type2) {
95881
- case "Point":
95882
- return compareCoords(coords1, coords2);
95883
- default:
95884
- throw new Error("feature2 " + type2 + " geometry not supported");
95885
- }
95886
- case "MultiPoint":
95887
- switch (type2) {
95888
- case "Point":
95889
- return isPointInMultiPoint(geom1, geom2);
95890
- case "MultiPoint":
95891
- return isMultiPointInMultiPoint(geom1, geom2);
95892
- default:
95893
- throw new Error("feature2 " + type2 + " geometry not supported");
95894
- }
95895
- case "LineString":
95896
- switch (type2) {
95897
- case "Point":
95898
- return booleanPointOnLine(geom2, geom1, { ignoreEndVertices: true });
95899
- case "LineString":
95900
- return isLineOnLine(geom1, geom2);
95901
- case "MultiPoint":
95902
- return isMultiPointOnLine(geom1, geom2);
95903
- default:
95904
- throw new Error("feature2 " + type2 + " geometry not supported");
95905
- }
95906
- case "Polygon":
95907
- switch (type2) {
95908
- case "Point":
95909
- return booleanPointInPolygon(geom2, geom1, { ignoreBoundary: true });
95910
- case "LineString":
95911
- return isLineInPoly(geom1, geom2);
95912
- case "Polygon":
95913
- return isPolyInPoly(geom1, geom2);
95914
- case "MultiPoint":
95915
- return isMultiPointInPoly(geom1, geom2);
95916
- default:
95917
- throw new Error("feature2 " + type2 + " geometry not supported");
95918
- }
95919
- case "MultiPolygon":
95920
- switch (type2) {
95921
- case "Polygon":
95922
- return isPolygonInMultiPolygon(geom1, geom2);
95923
- default:
95924
- throw new Error("feature2 " + type2 + " geometry not supported");
95925
- }
95926
- default:
95927
- throw new Error("feature1 " + type1 + " geometry not supported");
95928
- }
95929
- }
95930
- function isPolygonInMultiPolygon(multiPolygon2, polygon2) {
95931
- return multiPolygon2.coordinates.some(
95932
- (coords) => isPolyInPoly({ type: "Polygon", coordinates: coords }, polygon2)
95933
- );
95934
- }
95935
- function isPointInMultiPoint(multiPoint, pt) {
95936
- let i2;
95937
- let output = false;
95938
- for (i2 = 0; i2 < multiPoint.coordinates.length; i2++) {
95939
- if (compareCoords(multiPoint.coordinates[i2], pt.coordinates)) {
95940
- output = true;
95941
- break;
95942
- }
95943
- }
95944
- return output;
95945
- }
95946
- function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
95947
- for (const coord2 of multiPoint2.coordinates) {
95948
- let matchFound = false;
95949
- for (const coord1 of multiPoint1.coordinates) {
95950
- if (compareCoords(coord2, coord1)) {
95951
- matchFound = true;
95952
- break;
95953
- }
95954
- }
95955
- if (!matchFound) {
95956
- return false;
95957
- }
95958
- }
95959
- return true;
95960
- }
95961
- function isMultiPointOnLine(lineString2, multiPoint) {
95962
- let haveFoundInteriorPoint = false;
95963
- for (const coord of multiPoint.coordinates) {
95964
- if (booleanPointOnLine(coord, lineString2, { ignoreEndVertices: true })) {
95965
- haveFoundInteriorPoint = true;
95966
- }
95967
- if (!booleanPointOnLine(coord, lineString2)) {
95968
- return false;
95969
- }
95970
- }
95971
- if (haveFoundInteriorPoint) {
95972
- return true;
95973
- }
95974
- return false;
95975
- }
95976
- function isMultiPointInPoly(polygon2, multiPoint) {
95977
- for (const coord of multiPoint.coordinates) {
95978
- if (!booleanPointInPolygon(coord, polygon2, { ignoreBoundary: true })) {
95979
- return false;
95980
- }
95981
- }
95982
- return true;
95983
- }
95984
- function isLineOnLine(lineString1, lineString2) {
95985
- let haveFoundInteriorPoint = false;
95986
- for (const coords of lineString2.coordinates) {
95987
- if (booleanPointOnLine({ type: "Point", coordinates: coords }, lineString1, {
95988
- ignoreEndVertices: true
95989
- })) {
95990
- haveFoundInteriorPoint = true;
95991
- }
95992
- if (!booleanPointOnLine({ type: "Point", coordinates: coords }, lineString1, {
95993
- ignoreEndVertices: false
95994
- })) {
95995
- return false;
95996
- }
95997
- }
95998
- return haveFoundInteriorPoint;
95999
- }
96000
- function isLineInPoly(polygon2, linestring) {
96001
- let output = false;
96002
- let i2 = 0;
96003
- const polyBbox = bbox$1(polygon2);
96004
- const lineBbox = bbox$1(linestring);
96005
- if (!doBBoxOverlap(polyBbox, lineBbox)) {
96006
- return false;
96007
- }
96008
- for (i2; i2 < linestring.coordinates.length - 1; i2++) {
96009
- const midPoint = getMidpoint(
96010
- linestring.coordinates[i2],
96011
- linestring.coordinates[i2 + 1]
96012
- );
96013
- if (booleanPointInPolygon({ type: "Point", coordinates: midPoint }, polygon2, {
96014
- ignoreBoundary: true
96015
- })) {
96016
- output = true;
96017
- break;
96018
- }
96019
- }
96020
- return output;
96021
- }
96022
- function isPolyInPoly(feature1, feature2) {
96023
- if (feature1.type === "Feature" && feature1.geometry === null) {
96024
- return false;
96025
- }
96026
- if (feature2.type === "Feature" && feature2.geometry === null) {
96027
- return false;
96028
- }
96029
- const poly1Bbox = bbox$1(feature1);
96030
- const poly2Bbox = bbox$1(feature2);
96031
- if (!doBBoxOverlap(poly1Bbox, poly2Bbox)) {
96032
- return false;
96033
- }
96034
- const coords = getGeom(feature2).coordinates;
96035
- for (const ring of coords) {
96036
- for (const coord of ring) {
96037
- if (!booleanPointInPolygon(coord, feature1)) {
96038
- return false;
96039
- }
96040
- }
96041
- }
96042
- return true;
96043
- }
96044
- function doBBoxOverlap(bbox1, bbox2) {
96045
- if (bbox1[0] > bbox2[0]) {
96046
- return false;
96047
- }
96048
- if (bbox1[2] < bbox2[2]) {
96049
- return false;
96050
- }
96051
- if (bbox1[1] > bbox2[1]) {
96052
- return false;
96053
- }
96054
- if (bbox1[3] < bbox2[3]) {
96055
- return false;
96056
- }
96057
- return true;
96058
- }
96059
- function compareCoords(pair1, pair2) {
96060
- return pair1[0] === pair2[0] && pair1[1] === pair2[1];
96061
- }
96062
- function getMidpoint(pair1, pair2) {
96063
- return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
96064
- }
96065
- function quickselect(arr, k, left, right, compare2) {
96066
- quickselectStep(arr, k, left || 0, right || arr.length - 1, compare2 || defaultCompare$1);
96067
- }
96068
- function quickselectStep(arr, k, left, right, compare2) {
96069
- while (right > left) {
96070
- if (right - left > 600) {
96071
- var n3 = right - left + 1;
96072
- var m = k - left + 1;
96073
- var z2 = Math.log(n3);
96074
- var s2 = 0.5 * Math.exp(2 * z2 / 3);
96075
- var sd = 0.5 * Math.sqrt(z2 * s2 * (n3 - s2) / n3) * (m - n3 / 2 < 0 ? -1 : 1);
96076
- var newLeft = Math.max(left, Math.floor(k - m * s2 / n3 + sd));
96077
- var newRight = Math.min(right, Math.floor(k + (n3 - m) * s2 / n3 + sd));
96078
- quickselectStep(arr, k, newLeft, newRight, compare2);
96079
- }
96080
- var t = arr[k];
96081
- var i2 = left;
96082
- var j = right;
96083
- swap(arr, left, k);
96084
- if (compare2(arr[right], t) > 0) swap(arr, left, right);
96085
- while (i2 < j) {
96086
- swap(arr, i2, j);
96087
- i2++;
96088
- j--;
96089
- while (compare2(arr[i2], t) < 0) i2++;
96090
- while (compare2(arr[j], t) > 0) j--;
96091
- }
96092
- if (compare2(arr[left], t) === 0) swap(arr, left, j);
96093
- else {
96094
- j++;
96095
- swap(arr, j, right);
96096
- }
96097
- if (j <= k) left = j + 1;
96098
- if (k <= j) right = j - 1;
96099
- }
96100
- }
96101
- function swap(arr, i2, j) {
96102
- var tmp = arr[i2];
96103
- arr[i2] = arr[j];
96104
- arr[j] = tmp;
96105
- }
96106
- function defaultCompare$1(a2, b) {
96107
- return a2 < b ? -1 : a2 > b ? 1 : 0;
96108
- }
96109
- class RBush {
96110
- constructor(maxEntries = 9) {
96111
- this._maxEntries = Math.max(4, maxEntries);
96112
- this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
96113
- this.clear();
96114
- }
96115
- all() {
96116
- return this._all(this.data, []);
96117
- }
96118
- search(bbox2) {
96119
- let node2 = this.data;
96120
- const result = [];
96121
- if (!intersects(bbox2, node2)) return result;
96122
- const toBBox = this.toBBox;
96123
- const nodesToSearch = [];
96124
- while (node2) {
96125
- for (let i2 = 0; i2 < node2.children.length; i2++) {
96126
- const child = node2.children[i2];
96127
- const childBBox = node2.leaf ? toBBox(child) : child;
96128
- if (intersects(bbox2, childBBox)) {
96129
- if (node2.leaf) result.push(child);
96130
- else if (contains$1(bbox2, childBBox)) this._all(child, result);
96131
- else nodesToSearch.push(child);
96132
- }
96133
- }
96134
- node2 = nodesToSearch.pop();
96135
- }
96136
- return result;
96137
- }
96138
- collides(bbox2) {
96139
- let node2 = this.data;
96140
- if (!intersects(bbox2, node2)) return false;
96141
- const nodesToSearch = [];
96142
- while (node2) {
96143
- for (let i2 = 0; i2 < node2.children.length; i2++) {
96144
- const child = node2.children[i2];
96145
- const childBBox = node2.leaf ? this.toBBox(child) : child;
96146
- if (intersects(bbox2, childBBox)) {
96147
- if (node2.leaf || contains$1(bbox2, childBBox)) return true;
96148
- nodesToSearch.push(child);
96149
- }
96150
- }
96151
- node2 = nodesToSearch.pop();
96152
- }
96153
- return false;
96154
- }
96155
- load(data) {
96156
- if (!(data && data.length)) return this;
96157
- if (data.length < this._minEntries) {
96158
- for (let i2 = 0; i2 < data.length; i2++) {
96159
- this.insert(data[i2]);
96160
- }
96161
- return this;
96162
- }
96163
- let node2 = this._build(data.slice(), 0, data.length - 1, 0);
96164
- if (!this.data.children.length) {
96165
- this.data = node2;
96166
- } else if (this.data.height === node2.height) {
96167
- this._splitRoot(this.data, node2);
96168
- } else {
96169
- if (this.data.height < node2.height) {
96170
- const tmpNode = this.data;
96171
- this.data = node2;
96172
- node2 = tmpNode;
96173
- }
96174
- this._insert(node2, this.data.height - node2.height - 1, true);
96175
- }
96176
- return this;
96177
- }
96178
- insert(item) {
96179
- if (item) this._insert(item, this.data.height - 1);
96180
- return this;
96181
- }
96182
- clear() {
96183
- this.data = createNode([]);
96184
- return this;
96185
- }
96186
- remove(item, equalsFn) {
96187
- if (!item) return this;
96188
- let node2 = this.data;
96189
- const bbox2 = this.toBBox(item);
96190
- const path = [];
96191
- const indexes = [];
96192
- let i2, parent, goingUp;
96193
- while (node2 || path.length) {
96194
- if (!node2) {
96195
- node2 = path.pop();
96196
- parent = path[path.length - 1];
96197
- i2 = indexes.pop();
96198
- goingUp = true;
96199
- }
96200
- if (node2.leaf) {
96201
- const index2 = findItem(item, node2.children, equalsFn);
96202
- if (index2 !== -1) {
96203
- node2.children.splice(index2, 1);
96204
- path.push(node2);
96205
- this._condense(path);
96206
- return this;
96207
- }
96208
- }
96209
- if (!goingUp && !node2.leaf && contains$1(node2, bbox2)) {
96210
- path.push(node2);
96211
- indexes.push(i2);
96212
- i2 = 0;
96213
- parent = node2;
96214
- node2 = node2.children[0];
96215
- } else if (parent) {
96216
- i2++;
96217
- node2 = parent.children[i2];
96218
- goingUp = false;
96219
- } else node2 = null;
96220
- }
96221
- return this;
96222
- }
96223
- toBBox(item) {
96224
- return item;
96225
- }
96226
- compareMinX(a2, b) {
96227
- return a2.minX - b.minX;
96228
- }
96229
- compareMinY(a2, b) {
96230
- return a2.minY - b.minY;
96231
- }
96232
- toJSON() {
96233
- return this.data;
96234
- }
96235
- fromJSON(data) {
96236
- this.data = data;
96237
- return this;
96238
- }
96239
- _all(node2, result) {
96240
- const nodesToSearch = [];
96241
- while (node2) {
96242
- if (node2.leaf) result.push(...node2.children);
96243
- else nodesToSearch.push(...node2.children);
96244
- node2 = nodesToSearch.pop();
96245
- }
96246
- return result;
96247
- }
96248
- _build(items, left, right, height) {
96249
- const N2 = right - left + 1;
96250
- let M = this._maxEntries;
96251
- let node2;
96252
- if (N2 <= M) {
96253
- node2 = createNode(items.slice(left, right + 1));
96254
- calcBBox(node2, this.toBBox);
96255
- return node2;
96256
- }
96257
- if (!height) {
96258
- height = Math.ceil(Math.log(N2) / Math.log(M));
96259
- M = Math.ceil(N2 / Math.pow(M, height - 1));
96260
- }
96261
- node2 = createNode([]);
96262
- node2.leaf = false;
96263
- node2.height = height;
96264
- const N22 = Math.ceil(N2 / M);
96265
- const N1 = N22 * Math.ceil(Math.sqrt(M));
96266
- multiSelect(items, left, right, N1, this.compareMinX);
96267
- for (let i2 = left; i2 <= right; i2 += N1) {
96268
- const right2 = Math.min(i2 + N1 - 1, right);
96269
- multiSelect(items, i2, right2, N22, this.compareMinY);
96270
- for (let j = i2; j <= right2; j += N22) {
96271
- const right3 = Math.min(j + N22 - 1, right2);
96272
- node2.children.push(this._build(items, j, right3, height - 1));
96273
- }
96274
- }
96275
- calcBBox(node2, this.toBBox);
96276
- return node2;
96277
- }
96278
- _chooseSubtree(bbox2, node2, level, path) {
96279
- while (true) {
96280
- path.push(node2);
96281
- if (node2.leaf || path.length - 1 === level) break;
96282
- let minArea = Infinity;
96283
- let minEnlargement = Infinity;
96284
- let targetNode;
96285
- for (let i2 = 0; i2 < node2.children.length; i2++) {
96286
- const child = node2.children[i2];
96287
- const area2 = bboxArea(child);
96288
- const enlargement = enlargedArea(bbox2, child) - area2;
96289
- if (enlargement < minEnlargement) {
96290
- minEnlargement = enlargement;
96291
- minArea = area2 < minArea ? area2 : minArea;
96292
- targetNode = child;
96293
- } else if (enlargement === minEnlargement) {
96294
- if (area2 < minArea) {
96295
- minArea = area2;
96296
- targetNode = child;
96297
- }
96298
- }
96299
- }
96300
- node2 = targetNode || node2.children[0];
96301
- }
96302
- return node2;
96303
- }
96304
- _insert(item, level, isNode2) {
96305
- const bbox2 = isNode2 ? item : this.toBBox(item);
96306
- const insertPath = [];
96307
- const node2 = this._chooseSubtree(bbox2, this.data, level, insertPath);
96308
- node2.children.push(item);
96309
- extend(node2, bbox2);
96310
- while (level >= 0) {
96311
- if (insertPath[level].children.length > this._maxEntries) {
96312
- this._split(insertPath, level);
96313
- level--;
96314
- } else break;
96315
- }
96316
- this._adjustParentBBoxes(bbox2, insertPath, level);
96317
- }
96318
- // split overflowed node into two
96319
- _split(insertPath, level) {
96320
- const node2 = insertPath[level];
96321
- const M = node2.children.length;
96322
- const m = this._minEntries;
96323
- this._chooseSplitAxis(node2, m, M);
96324
- const splitIndex = this._chooseSplitIndex(node2, m, M);
96325
- const newNode = createNode(node2.children.splice(splitIndex, node2.children.length - splitIndex));
96326
- newNode.height = node2.height;
96327
- newNode.leaf = node2.leaf;
96328
- calcBBox(node2, this.toBBox);
96329
- calcBBox(newNode, this.toBBox);
96330
- if (level) insertPath[level - 1].children.push(newNode);
96331
- else this._splitRoot(node2, newNode);
96332
- }
96333
- _splitRoot(node2, newNode) {
96334
- this.data = createNode([node2, newNode]);
96335
- this.data.height = node2.height + 1;
96336
- this.data.leaf = false;
96337
- calcBBox(this.data, this.toBBox);
96338
- }
96339
- _chooseSplitIndex(node2, m, M) {
96340
- let index2;
96341
- let minOverlap = Infinity;
96342
- let minArea = Infinity;
96343
- for (let i2 = m; i2 <= M - m; i2++) {
96344
- const bbox1 = distBBox(node2, 0, i2, this.toBBox);
96345
- const bbox2 = distBBox(node2, i2, M, this.toBBox);
96346
- const overlap = intersectionArea(bbox1, bbox2);
96347
- const area2 = bboxArea(bbox1) + bboxArea(bbox2);
96348
- if (overlap < minOverlap) {
96349
- minOverlap = overlap;
96350
- index2 = i2;
96351
- minArea = area2 < minArea ? area2 : minArea;
96352
- } else if (overlap === minOverlap) {
96353
- if (area2 < minArea) {
96354
- minArea = area2;
96355
- index2 = i2;
96356
- }
96357
- }
96358
- }
96359
- return index2 || M - m;
96360
- }
96361
- // sorts node children by the best axis for split
96362
- _chooseSplitAxis(node2, m, M) {
96363
- const compareMinX = node2.leaf ? this.compareMinX : compareNodeMinX;
96364
- const compareMinY = node2.leaf ? this.compareMinY : compareNodeMinY;
96365
- const xMargin = this._allDistMargin(node2, m, M, compareMinX);
96366
- const yMargin = this._allDistMargin(node2, m, M, compareMinY);
96367
- if (xMargin < yMargin) node2.children.sort(compareMinX);
96368
- }
96369
- // total margin of all possible split distributions where each node is at least m full
96370
- _allDistMargin(node2, m, M, compare2) {
96371
- node2.children.sort(compare2);
96372
- const toBBox = this.toBBox;
96373
- const leftBBox = distBBox(node2, 0, m, toBBox);
96374
- const rightBBox = distBBox(node2, M - m, M, toBBox);
96375
- let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);
96376
- for (let i2 = m; i2 < M - m; i2++) {
96377
- const child = node2.children[i2];
96378
- extend(leftBBox, node2.leaf ? toBBox(child) : child);
96379
- margin += bboxMargin(leftBBox);
96380
- }
96381
- for (let i2 = M - m - 1; i2 >= m; i2--) {
96382
- const child = node2.children[i2];
96383
- extend(rightBBox, node2.leaf ? toBBox(child) : child);
96384
- margin += bboxMargin(rightBBox);
96385
- }
96386
- return margin;
96387
- }
96388
- _adjustParentBBoxes(bbox2, path, level) {
96389
- for (let i2 = level; i2 >= 0; i2--) {
96390
- extend(path[i2], bbox2);
96391
- }
96392
- }
96393
- _condense(path) {
96394
- for (let i2 = path.length - 1, siblings; i2 >= 0; i2--) {
96395
- if (path[i2].children.length === 0) {
96396
- if (i2 > 0) {
96397
- siblings = path[i2 - 1].children;
96398
- siblings.splice(siblings.indexOf(path[i2]), 1);
96399
- } else this.clear();
96400
- } else calcBBox(path[i2], this.toBBox);
96401
- }
96402
- }
96403
- }
96404
- function findItem(item, items, equalsFn) {
96405
- if (!equalsFn) return items.indexOf(item);
96406
- for (let i2 = 0; i2 < items.length; i2++) {
96407
- if (equalsFn(item, items[i2])) return i2;
96408
- }
96409
- return -1;
96410
- }
96411
- function calcBBox(node2, toBBox) {
96412
- distBBox(node2, 0, node2.children.length, toBBox, node2);
96413
- }
96414
- function distBBox(node2, k, p, toBBox, destNode) {
96415
- if (!destNode) destNode = createNode(null);
96416
- destNode.minX = Infinity;
96417
- destNode.minY = Infinity;
96418
- destNode.maxX = -Infinity;
96419
- destNode.maxY = -Infinity;
96420
- for (let i2 = k; i2 < p; i2++) {
96421
- const child = node2.children[i2];
96422
- extend(destNode, node2.leaf ? toBBox(child) : child);
96423
- }
96424
- return destNode;
96425
- }
96426
- function extend(a2, b) {
96427
- a2.minX = Math.min(a2.minX, b.minX);
96428
- a2.minY = Math.min(a2.minY, b.minY);
96429
- a2.maxX = Math.max(a2.maxX, b.maxX);
96430
- a2.maxY = Math.max(a2.maxY, b.maxY);
96431
- return a2;
96432
- }
96433
- function compareNodeMinX(a2, b) {
96434
- return a2.minX - b.minX;
96435
- }
96436
- function compareNodeMinY(a2, b) {
96437
- return a2.minY - b.minY;
96438
- }
96439
- function bboxArea(a2) {
96440
- return (a2.maxX - a2.minX) * (a2.maxY - a2.minY);
96441
- }
96442
- function bboxMargin(a2) {
96443
- return a2.maxX - a2.minX + (a2.maxY - a2.minY);
96444
- }
96445
- function enlargedArea(a2, b) {
96446
- return (Math.max(b.maxX, a2.maxX) - Math.min(b.minX, a2.minX)) * (Math.max(b.maxY, a2.maxY) - Math.min(b.minY, a2.minY));
96447
- }
96448
- function intersectionArea(a2, b) {
96449
- const minX = Math.max(a2.minX, b.minX);
96450
- const minY = Math.max(a2.minY, b.minY);
96451
- const maxX = Math.min(a2.maxX, b.maxX);
96452
- const maxY = Math.min(a2.maxY, b.maxY);
96453
- return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
96454
- }
96455
- function contains$1(a2, b) {
96456
- return a2.minX <= b.minX && a2.minY <= b.minY && b.maxX <= a2.maxX && b.maxY <= a2.maxY;
96457
- }
96458
- function intersects(a2, b) {
96459
- return b.minX <= a2.maxX && b.minY <= a2.maxY && b.maxX >= a2.minX && b.maxY >= a2.minY;
96460
- }
96461
- function createNode(children) {
96462
- return {
96463
- children,
96464
- height: 1,
96465
- leaf: true,
96466
- minX: Infinity,
96467
- minY: Infinity,
96468
- maxX: -Infinity,
96469
- maxY: -Infinity
96470
- };
96471
- }
96472
- function multiSelect(arr, left, right, n3, compare2) {
96473
- const stack2 = [left, right];
96474
- while (stack2.length) {
96475
- right = stack2.pop();
96476
- left = stack2.pop();
96477
- if (right - left <= n3) continue;
96478
- const mid = left + Math.ceil((right - left) / n3 / 2) * n3;
96479
- quickselect(arr, mid, left, right, compare2);
96480
- stack2.push(left, mid, mid, right);
96481
- }
96482
- }
96483
- function geojsonRbush(maxEntries) {
96484
- var tree = new RBush(maxEntries);
96485
- tree.insert = function(feature2) {
96486
- if (feature2.type !== "Feature") throw new Error("invalid feature");
96487
- feature2.bbox = feature2.bbox ? feature2.bbox : bbox$1(feature2);
96488
- return RBush.prototype.insert.call(this, feature2);
96489
- };
96490
- tree.load = function(features) {
96491
- var load2 = [];
96492
- if (Array.isArray(features)) {
96493
- features.forEach(function(feature2) {
96494
- if (feature2.type !== "Feature") throw new Error("invalid features");
96495
- feature2.bbox = feature2.bbox ? feature2.bbox : bbox$1(feature2);
96496
- load2.push(feature2);
96497
- });
96498
- } else {
96499
- featureEach(features, function(feature2) {
96500
- if (feature2.type !== "Feature") throw new Error("invalid features");
96501
- feature2.bbox = feature2.bbox ? feature2.bbox : bbox$1(feature2);
96502
- load2.push(feature2);
96503
- });
96504
- }
96505
- return RBush.prototype.load.call(this, load2);
96506
- };
96507
- tree.remove = function(feature2, equals2) {
96508
- if (feature2.type !== "Feature") throw new Error("invalid feature");
96509
- feature2.bbox = feature2.bbox ? feature2.bbox : bbox$1(feature2);
96510
- return RBush.prototype.remove.call(this, feature2, equals2);
96511
- };
96512
- tree.clear = function() {
96513
- return RBush.prototype.clear.call(this);
96514
- };
96515
- tree.search = function(geojson) {
96516
- var features = RBush.prototype.search.call(this, this.toBBox(geojson));
96517
- return featureCollection(features);
96518
- };
96519
- tree.collides = function(geojson) {
96520
- return RBush.prototype.collides.call(this, this.toBBox(geojson));
96521
- };
96522
- tree.all = function() {
96523
- var features = RBush.prototype.all.call(this);
96524
- return featureCollection(features);
96525
- };
96526
- tree.toJSON = function() {
96527
- return RBush.prototype.toJSON.call(this);
96528
- };
96529
- tree.fromJSON = function(json) {
96530
- return RBush.prototype.fromJSON.call(this, json);
96531
- };
96532
- tree.toBBox = function(geojson) {
96533
- var bbox2;
96534
- if (geojson.bbox) bbox2 = geojson.bbox;
96535
- else if (Array.isArray(geojson) && geojson.length === 4) bbox2 = geojson;
96536
- else if (Array.isArray(geojson) && geojson.length === 6)
96537
- bbox2 = [geojson[0], geojson[1], geojson[3], geojson[4]];
96538
- else if (geojson.type === "Feature") bbox2 = bbox$1(geojson);
96539
- else if (geojson.type === "FeatureCollection") bbox2 = bbox$1(geojson);
96540
- else throw new Error("invalid geojson");
96541
- return {
96542
- minX: bbox2[0],
96543
- minY: bbox2[1],
96544
- maxX: bbox2[2],
96545
- maxY: bbox2[3]
96546
- };
96547
- };
96548
- return tree;
96549
- }
96550
- function lineSegment(geojson) {
96551
- if (!geojson) {
96552
- throw new Error("geojson is required");
96553
- }
96554
- const results = [];
96555
- flattenEach(geojson, (feature2) => {
96556
- lineSegmentFeature(feature2, results);
96557
- });
96558
- return featureCollection(results);
96559
- }
96560
- function lineSegmentFeature(geojson, results) {
96561
- let coords = [];
96562
- const geometry2 = geojson.geometry;
96563
- if (geometry2 !== null) {
96564
- switch (geometry2.type) {
96565
- case "Polygon":
96566
- coords = getCoords(geometry2);
96567
- break;
96568
- case "LineString":
96569
- coords = [getCoords(geometry2)];
96570
- }
96571
- coords.forEach((coord) => {
96572
- const segments = createSegments(coord, geojson.properties);
96573
- segments.forEach((segment) => {
96574
- segment.id = results.length;
96575
- results.push(segment);
96576
- });
96577
- });
96578
- }
96579
- }
96580
- function createSegments(coords, properties) {
96581
- const segments = [];
96582
- coords.reduce((previousCoords, currentCoords) => {
96583
- const segment = lineString([previousCoords, currentCoords], properties);
96584
- segment.bbox = bbox(previousCoords, currentCoords);
96585
- segments.push(segment);
96586
- return currentCoords;
96587
- });
96588
- return segments;
96589
- }
96590
- function bbox(coords1, coords2) {
96591
- const x12 = coords1[0];
96592
- const y12 = coords1[1];
96593
- const x2 = coords2[0];
96594
- const y2 = coords2[1];
96595
- const west = x12 < x2 ? x12 : x2;
96596
- const south = y12 < y2 ? y12 : y2;
96597
- const east = x12 > x2 ? x12 : x2;
96598
- const north = y12 > y2 ? y12 : y2;
96599
- return [west, south, east, north];
96600
- }
96601
- function distance$1(from, to, options = {}) {
96602
- var coordinates1 = getCoord(from);
96603
- var coordinates2 = getCoord(to);
96604
- var dLat = degreesToRadians(coordinates2[1] - coordinates1[1]);
96605
- var dLon = degreesToRadians(coordinates2[0] - coordinates1[0]);
96606
- var lat1 = degreesToRadians(coordinates1[1]);
96607
- var lat2 = degreesToRadians(coordinates2[1]);
96608
- var a2 = Math.pow(Math.sin(dLat / 2), 2) + Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);
96609
- return radiansToLength(
96610
- 2 * Math.atan2(Math.sqrt(a2), Math.sqrt(1 - a2)),
96611
- options.units
96612
- );
96613
- }
96614
- var __defProp$4 = Object.defineProperty;
96615
- var __defProps = Object.defineProperties;
96616
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
96617
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
96618
- var __hasOwnProp = Object.prototype.hasOwnProperty;
96619
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
96620
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
96621
- var __spreadValues = (a2, b) => {
96622
- for (var prop in b || (b = {}))
96623
- if (__hasOwnProp.call(b, prop))
96624
- __defNormalProp$1(a2, prop, b[prop]);
96625
- if (__getOwnPropSymbols)
96626
- for (var prop of __getOwnPropSymbols(b)) {
96627
- if (__propIsEnum.call(b, prop))
96628
- __defNormalProp$1(a2, prop, b[prop]);
96629
- }
96630
- return a2;
96631
- };
96632
- var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
96633
- function nearestPointOnLine(lines, pt, options = {}) {
96634
- if (!lines || !pt) {
96635
- throw new Error("lines and pt are required arguments");
96636
- }
96637
- const ptPos = getCoord(pt);
96638
- let closestPt = point([Infinity, Infinity], {
96639
- dist: Infinity,
96640
- index: -1,
96641
- multiFeatureIndex: -1,
96642
- location: -1
96643
- });
96644
- let length2 = 0;
96645
- flattenEach(
96646
- lines,
96647
- function(line, _featureIndex, multiFeatureIndex) {
96648
- const coords = getCoords(line);
96649
- for (let i2 = 0; i2 < coords.length - 1; i2++) {
96650
- const start = point(coords[i2]);
96651
- start.properties.dist = distance$1(pt, start, options);
96652
- const startPos = getCoord(start);
96653
- const stop = point(coords[i2 + 1]);
96654
- stop.properties.dist = distance$1(pt, stop, options);
96655
- const stopPos = getCoord(stop);
96656
- const sectionLength = distance$1(start, stop, options);
96657
- let intersectPos;
96658
- let wasEnd;
96659
- if (startPos[0] === ptPos[0] && startPos[1] === ptPos[1]) {
96660
- [intersectPos, , wasEnd] = [startPos, void 0, false];
96661
- } else if (stopPos[0] === ptPos[0] && stopPos[1] === ptPos[1]) {
96662
- [intersectPos, , wasEnd] = [stopPos, void 0, true];
96663
- } else {
96664
- [intersectPos, , wasEnd] = nearestPointOnSegment(
96665
- start.geometry.coordinates,
96666
- stop.geometry.coordinates,
96667
- getCoord(pt)
96668
- );
96669
- }
96670
- let intersectPt;
96671
- if (intersectPos) {
96672
- intersectPt = point(intersectPos, {
96673
- dist: distance$1(pt, intersectPos, options),
96674
- multiFeatureIndex,
96675
- location: length2 + distance$1(start, intersectPos, options)
96676
- });
96677
- }
96678
- if (intersectPt && intersectPt.properties.dist < closestPt.properties.dist) {
96679
- closestPt = __spreadProps(__spreadValues({}, intersectPt), {
96680
- properties: __spreadProps(__spreadValues({}, intersectPt.properties), {
96681
- // Legacy behaviour where index progresses to next segment # if we
96682
- // went with the end point this iteration.
96683
- index: wasEnd ? i2 + 1 : i2
96684
- })
96685
- });
96686
- }
96687
- length2 += sectionLength;
96688
- }
96689
- }
96690
- );
96691
- return closestPt;
96692
- }
96693
- function dot(v12, v2) {
96694
- const [v1x, v1y, v1z] = v12;
96695
- const [v2x, v2y, v2z] = v2;
96696
- return v1x * v2x + v1y * v2y + v1z * v2z;
96697
- }
96698
- function cross(v12, v2) {
96699
- const [v1x, v1y, v1z] = v12;
96700
- const [v2x, v2y, v2z] = v2;
96701
- return [v1y * v2z - v1z * v2y, v1z * v2x - v1x * v2z, v1x * v2y - v1y * v2x];
96702
- }
96703
- function magnitude(v) {
96704
- return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2) + Math.pow(v[2], 2));
96705
- }
96706
- function angle$1(v12, v2) {
96707
- const theta = dot(v12, v2) / (magnitude(v12) * magnitude(v2));
96708
- return Math.acos(Math.min(Math.max(theta, -1), 1));
96709
- }
96710
- function lngLatToVector(a2) {
96711
- const lat = degreesToRadians(a2[1]);
96712
- const lng = degreesToRadians(a2[0]);
96713
- return [
96714
- Math.cos(lat) * Math.cos(lng),
96715
- Math.cos(lat) * Math.sin(lng),
96716
- Math.sin(lat)
96717
- ];
96718
- }
96719
- function vectorToLngLat(v) {
96720
- const [x, y, z2] = v;
96721
- const lat = radiansToDegrees(Math.asin(z2));
96722
- const lng = radiansToDegrees(Math.atan2(y, x));
96723
- return [lng, lat];
96724
- }
96725
- function nearestPointOnSegment(posA, posB, posC) {
96726
- const A2 = lngLatToVector(posA);
96727
- const B2 = lngLatToVector(posB);
96728
- const C3 = lngLatToVector(posC);
96729
- const [Cx, Cy, Cz] = C3;
96730
- const [D2, E2, F] = cross(A2, B2);
96731
- const a2 = E2 * Cz - F * Cy;
96732
- const b = F * Cx - D2 * Cz;
96733
- const c = D2 * Cy - E2 * Cx;
96734
- const f2 = c * E2 - b * F;
96735
- const g2 = a2 * F - c * D2;
96736
- const h = b * D2 - a2 * E2;
96737
- const t = 1 / Math.sqrt(Math.pow(f2, 2) + Math.pow(g2, 2) + Math.pow(h, 2));
96738
- const I1 = [f2 * t, g2 * t, h * t];
96739
- const I2 = [-1 * f2 * t, -1 * g2 * t, -1 * h * t];
96740
- const angleAB = angle$1(A2, B2);
96741
- const angleAI1 = angle$1(A2, I1);
96742
- const angleBI1 = angle$1(B2, I1);
96743
- const angleAI2 = angle$1(A2, I2);
96744
- const angleBI2 = angle$1(B2, I2);
96745
- let I3;
96746
- if (angleAI1 < angleAI2 && angleAI1 < angleBI2 || angleBI1 < angleAI2 && angleBI1 < angleBI2) {
96747
- I3 = I1;
96748
- } else {
96749
- I3 = I2;
96750
- }
96751
- if (angle$1(A2, I3) > angleAB || angle$1(B2, I3) > angleAB) {
96752
- if (distance$1(vectorToLngLat(I3), vectorToLngLat(A2)) <= distance$1(vectorToLngLat(I3), vectorToLngLat(B2))) {
96753
- return [vectorToLngLat(A2), true, false];
96754
- } else {
96755
- return [vectorToLngLat(B2), false, true];
96756
- }
96757
- }
96758
- return [vectorToLngLat(I3), false, false];
96759
- }
96760
- var fastDeepEqual;
96761
- var hasRequiredFastDeepEqual;
96762
- function requireFastDeepEqual() {
96763
- if (hasRequiredFastDeepEqual) return fastDeepEqual;
96764
- hasRequiredFastDeepEqual = 1;
96765
- fastDeepEqual = function equal2(a2, b) {
96766
- if (a2 === b) return true;
96767
- if (a2 && b && typeof a2 == "object" && typeof b == "object") {
96768
- if (a2.constructor !== b.constructor) return false;
96769
- var length2, i2, keys2;
96770
- if (Array.isArray(a2)) {
96771
- length2 = a2.length;
96772
- if (length2 != b.length) return false;
96773
- for (i2 = length2; i2-- !== 0; )
96774
- if (!equal2(a2[i2], b[i2])) return false;
96775
- return true;
96776
- }
96777
- if (a2.constructor === RegExp) return a2.source === b.source && a2.flags === b.flags;
96778
- if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b.valueOf();
96779
- if (a2.toString !== Object.prototype.toString) return a2.toString() === b.toString();
96780
- keys2 = Object.keys(a2);
96781
- length2 = keys2.length;
96782
- if (length2 !== Object.keys(b).length) return false;
96783
- for (i2 = length2; i2-- !== 0; )
96784
- if (!Object.prototype.hasOwnProperty.call(b, keys2[i2])) return false;
96785
- for (i2 = length2; i2-- !== 0; ) {
96786
- var key = keys2[i2];
96787
- if (!equal2(a2[key], b[key])) return false;
96788
- }
96789
- return true;
96790
- }
96791
- return a2 !== a2 && b !== b;
96792
- };
96793
- return fastDeepEqual;
96794
- }
96795
- var fastDeepEqualExports = requireFastDeepEqual();
96796
- const equal$1 = /* @__PURE__ */ getDefaultExportFromCjs(fastDeepEqualExports);
96797
- function lineOverlap(line1, line2, options = {}) {
96798
- options = options || {};
96799
- if (!isObject$4(options)) throw new Error("options is invalid");
96800
- var tolerance = options.tolerance || 0;
96801
- var features = [];
96802
- var tree = geojsonRbush();
96803
- const line = lineSegment(line1);
96804
- tree.load(line);
96805
- var overlapSegment;
96806
- let additionalSegments = [];
96807
- segmentEach(line2, function(segment) {
96808
- var doesOverlaps = false;
96809
- if (!segment) {
96810
- return;
96811
- }
96812
- featureEach(tree.search(segment), function(match) {
96813
- if (doesOverlaps === false) {
96814
- var coordsSegment = getCoords(segment).sort();
96815
- var coordsMatch = getCoords(match).sort();
96816
- if (equal$1(coordsSegment, coordsMatch)) {
96817
- doesOverlaps = true;
96818
- if (overlapSegment) {
96819
- overlapSegment = concatSegment(overlapSegment, segment) || overlapSegment;
96820
- } else overlapSegment = segment;
96821
- } else if (tolerance === 0 ? booleanPointOnLine(coordsSegment[0], match) && booleanPointOnLine(coordsSegment[1], match) : nearestPointOnLine(match, coordsSegment[0]).properties.dist <= tolerance && nearestPointOnLine(match, coordsSegment[1]).properties.dist <= tolerance) {
96822
- doesOverlaps = true;
96823
- if (overlapSegment) {
96824
- overlapSegment = concatSegment(overlapSegment, segment) || overlapSegment;
96825
- } else overlapSegment = segment;
96826
- } else if (tolerance === 0 ? booleanPointOnLine(coordsMatch[0], segment) && booleanPointOnLine(coordsMatch[1], segment) : nearestPointOnLine(segment, coordsMatch[0]).properties.dist <= tolerance && nearestPointOnLine(segment, coordsMatch[1]).properties.dist <= tolerance) {
96827
- if (overlapSegment) {
96828
- const combinedSegment = concatSegment(overlapSegment, match);
96829
- if (combinedSegment) {
96830
- overlapSegment = combinedSegment;
96831
- } else {
96832
- additionalSegments.push(match);
96833
- }
96834
- } else overlapSegment = match;
96835
- }
96836
- }
96837
- });
96838
- if (doesOverlaps === false && overlapSegment) {
96839
- features.push(overlapSegment);
96840
- if (additionalSegments.length) {
96841
- features = features.concat(additionalSegments);
96842
- additionalSegments = [];
96843
- }
96844
- overlapSegment = void 0;
96845
- }
96846
- });
96847
- if (overlapSegment) features.push(overlapSegment);
96848
- return featureCollection(features);
96849
- }
96850
- function concatSegment(line, segment) {
96851
- var coords = getCoords(segment);
96852
- var lineCoords = getCoords(line);
96853
- var start = lineCoords[0];
96854
- var end = lineCoords[lineCoords.length - 1];
96855
- var geom = line.geometry.coordinates;
96856
- if (equal$1(coords[0], start)) geom.unshift(coords[1]);
96857
- else if (equal$1(coords[0], end)) geom.push(coords[1]);
96858
- else if (equal$1(coords[1], start)) geom.unshift(coords[0]);
96859
- else if (equal$1(coords[1], end)) geom.push(coords[0]);
96860
- else return;
96861
- return line;
96862
- }
96863
- class TinyQueue2 {
96864
- constructor(data = [], compare2 = defaultCompare) {
96865
- this.data = data;
96866
- this.length = this.data.length;
96867
- this.compare = compare2;
96868
- if (this.length > 0) {
96869
- for (let i2 = (this.length >> 1) - 1; i2 >= 0; i2--) this._down(i2);
96870
- }
96871
- }
96872
- push(item) {
96873
- this.data.push(item);
96874
- this.length++;
96875
- this._up(this.length - 1);
96876
- }
96877
- pop() {
96878
- if (this.length === 0) return void 0;
96879
- const top = this.data[0];
96880
- const bottom = this.data.pop();
96881
- this.length--;
96882
- if (this.length > 0) {
96883
- this.data[0] = bottom;
96884
- this._down(0);
96885
- }
96886
- return top;
96887
- }
96888
- peek() {
96889
- return this.data[0];
96890
- }
96891
- _up(pos) {
96892
- const { data, compare: compare2 } = this;
96893
- const item = data[pos];
96894
- while (pos > 0) {
96895
- const parent = pos - 1 >> 1;
96896
- const current = data[parent];
96897
- if (compare2(item, current) >= 0) break;
96898
- data[pos] = current;
96899
- pos = parent;
96900
- }
96901
- data[pos] = item;
96902
- }
96903
- _down(pos) {
96904
- const { data, compare: compare2 } = this;
96905
- const halfLength = this.length >> 1;
96906
- const item = data[pos];
96907
- while (pos < halfLength) {
96908
- let left = (pos << 1) + 1;
96909
- let best = data[left];
96910
- const right = left + 1;
96911
- if (right < this.length && compare2(data[right], best) < 0) {
96912
- left = right;
96913
- best = data[right];
96914
- }
96915
- if (compare2(best, item) >= 0) break;
96916
- data[pos] = best;
96917
- pos = left;
96918
- }
96919
- data[pos] = item;
96920
- }
96921
- }
96922
- function defaultCompare(a2, b) {
96923
- return a2 < b ? -1 : a2 > b ? 1 : 0;
96924
- }
96925
- function checkWhichEventIsLeft(e1, e2) {
96926
- if (e1.p.x > e2.p.x) return 1;
96927
- if (e1.p.x < e2.p.x) return -1;
96928
- if (e1.p.y !== e2.p.y) return e1.p.y > e2.p.y ? 1 : -1;
96929
- return 1;
96930
- }
96931
- function checkWhichSegmentHasRightEndpointFirst(seg1, seg2) {
96932
- if (seg1.rightSweepEvent.p.x > seg2.rightSweepEvent.p.x) return 1;
96933
- if (seg1.rightSweepEvent.p.x < seg2.rightSweepEvent.p.x) return -1;
96934
- if (seg1.rightSweepEvent.p.y !== seg2.rightSweepEvent.p.y) return seg1.rightSweepEvent.p.y < seg2.rightSweepEvent.p.y ? 1 : -1;
96935
- return 1;
96936
- }
96937
- class Event {
96938
- constructor(p, featureId2, ringId2, eventId2) {
96939
- this.p = {
96940
- x: p[0],
96941
- y: p[1]
96942
- };
96943
- this.featureId = featureId2;
96944
- this.ringId = ringId2;
96945
- this.eventId = eventId2;
96946
- this.otherEvent = null;
96947
- this.isLeftEndpoint = null;
96948
- }
96949
- isSamePoint(eventToCheck) {
96950
- return this.p.x === eventToCheck.p.x && this.p.y === eventToCheck.p.y;
96951
- }
96952
- }
96953
- function fillEventQueue(geojson, eventQueue) {
96954
- if (geojson.type === "FeatureCollection") {
96955
- const features = geojson.features;
96956
- for (let i2 = 0; i2 < features.length; i2++) {
96957
- processFeature(features[i2], eventQueue);
96958
- }
96959
- } else {
96960
- processFeature(geojson, eventQueue);
96961
- }
96962
- }
96963
- let featureId = 0;
96964
- let ringId = 0;
96965
- let eventId = 0;
96966
- function processFeature(featureOrGeometry, eventQueue) {
96967
- const geom = featureOrGeometry.type === "Feature" ? featureOrGeometry.geometry : featureOrGeometry;
96968
- let coords = geom.coordinates;
96969
- if (geom.type === "Polygon" || geom.type === "MultiLineString") coords = [coords];
96970
- if (geom.type === "LineString") coords = [[coords]];
96971
- for (let i2 = 0; i2 < coords.length; i2++) {
96972
- for (let ii = 0; ii < coords[i2].length; ii++) {
96973
- let currentP = coords[i2][ii][0];
96974
- let nextP = null;
96975
- ringId = ringId + 1;
96976
- for (let iii = 0; iii < coords[i2][ii].length - 1; iii++) {
96977
- nextP = coords[i2][ii][iii + 1];
96978
- const e1 = new Event(currentP, featureId, ringId, eventId);
96979
- const e2 = new Event(nextP, featureId, ringId, eventId + 1);
96980
- e1.otherEvent = e2;
96981
- e2.otherEvent = e1;
96982
- if (checkWhichEventIsLeft(e1, e2) > 0) {
96983
- e2.isLeftEndpoint = true;
96984
- e1.isLeftEndpoint = false;
96985
- } else {
96986
- e1.isLeftEndpoint = true;
96987
- e2.isLeftEndpoint = false;
96988
- }
96989
- eventQueue.push(e1);
96990
- eventQueue.push(e2);
96991
- currentP = nextP;
96992
- eventId = eventId + 1;
96993
- }
96994
- }
96995
- }
96996
- featureId = featureId + 1;
96997
- }
96998
- let Segment$1 = class Segment {
96999
- constructor(event) {
97000
- this.leftSweepEvent = event;
97001
- this.rightSweepEvent = event.otherEvent;
97002
- }
97003
- };
97004
- function testSegmentIntersect(seg1, seg2) {
97005
- if (seg1 === null || seg2 === null) return false;
97006
- if (seg1.leftSweepEvent.ringId === seg2.leftSweepEvent.ringId && (seg1.rightSweepEvent.isSamePoint(seg2.leftSweepEvent) || seg1.rightSweepEvent.isSamePoint(seg2.leftSweepEvent) || seg1.rightSweepEvent.isSamePoint(seg2.rightSweepEvent) || seg1.leftSweepEvent.isSamePoint(seg2.leftSweepEvent) || seg1.leftSweepEvent.isSamePoint(seg2.rightSweepEvent))) return false;
97007
- const x12 = seg1.leftSweepEvent.p.x;
97008
- const y12 = seg1.leftSweepEvent.p.y;
97009
- const x2 = seg1.rightSweepEvent.p.x;
97010
- const y2 = seg1.rightSweepEvent.p.y;
97011
- const x3 = seg2.leftSweepEvent.p.x;
97012
- const y3 = seg2.leftSweepEvent.p.y;
97013
- const x4 = seg2.rightSweepEvent.p.x;
97014
- const y4 = seg2.rightSweepEvent.p.y;
97015
- const denom = (y4 - y3) * (x2 - x12) - (x4 - x3) * (y2 - y12);
97016
- const numeA = (x4 - x3) * (y12 - y3) - (y4 - y3) * (x12 - x3);
97017
- const numeB = (x2 - x12) * (y12 - y3) - (y2 - y12) * (x12 - x3);
97018
- if (denom === 0) {
97019
- if (numeA === 0 && numeB === 0) return false;
97020
- return false;
97021
- }
97022
- const uA = numeA / denom;
97023
- const uB = numeB / denom;
97024
- if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
97025
- const x = x12 + uA * (x2 - x12);
97026
- const y = y12 + uA * (y2 - y12);
97027
- return [x, y];
97028
- }
97029
- return false;
97030
- }
97031
- function runCheck(eventQueue, ignoreSelfIntersections) {
97032
- ignoreSelfIntersections = ignoreSelfIntersections ? ignoreSelfIntersections : false;
97033
- const intersectionPoints = [];
97034
- const outQueue = new TinyQueue2([], checkWhichSegmentHasRightEndpointFirst);
97035
- while (eventQueue.length) {
97036
- const event = eventQueue.pop();
97037
- if (event.isLeftEndpoint) {
97038
- const segment = new Segment$1(event);
97039
- for (let i2 = 0; i2 < outQueue.data.length; i2++) {
97040
- const otherSeg = outQueue.data[i2];
97041
- if (ignoreSelfIntersections) {
97042
- if (otherSeg.leftSweepEvent.featureId === event.featureId) continue;
97043
- }
97044
- const intersection2 = testSegmentIntersect(segment, otherSeg);
97045
- if (intersection2 !== false) intersectionPoints.push(intersection2);
97046
- }
97047
- outQueue.push(segment);
97048
- } else if (event.isLeftEndpoint === false) {
97049
- outQueue.pop();
97050
- }
97051
- }
97052
- return intersectionPoints;
97053
- }
97054
- function sweeplineIntersections$1(geojson, ignoreSelfIntersections) {
97055
- const eventQueue = new TinyQueue2([], checkWhichEventIsLeft);
97056
- fillEventQueue(geojson, eventQueue);
97057
- return runCheck(eventQueue, ignoreSelfIntersections);
97058
- }
97059
- const sweeplineIntersections_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
97060
- __proto__: null,
97061
- default: sweeplineIntersections$1
97062
- }, Symbol.toStringTag, { value: "Module" }));
97063
- var sweeplineIntersections = sweeplineIntersections$1;
97064
- function lineIntersect(line1, line2, options = {}) {
97065
- const { removeDuplicates = true, ignoreSelfIntersections = true } = options;
97066
- let features = [];
97067
- if (line1.type === "FeatureCollection")
97068
- features = features.concat(line1.features);
97069
- else if (line1.type === "Feature") features.push(line1);
97070
- else if (line1.type === "LineString" || line1.type === "Polygon" || line1.type === "MultiLineString" || line1.type === "MultiPolygon") {
97071
- features.push(feature$1(line1));
97072
- }
97073
- if (line2.type === "FeatureCollection")
97074
- features = features.concat(line2.features);
97075
- else if (line2.type === "Feature") features.push(line2);
97076
- else if (line2.type === "LineString" || line2.type === "Polygon" || line2.type === "MultiLineString" || line2.type === "MultiPolygon") {
97077
- features.push(feature$1(line2));
97078
- }
97079
- const intersections = sweeplineIntersections(
97080
- featureCollection(features),
97081
- ignoreSelfIntersections
97082
- );
97083
- let results = [];
97084
- if (removeDuplicates) {
97085
- const unique2 = {};
97086
- intersections.forEach((intersection2) => {
97087
- const key = intersection2.join(",");
97088
- if (!unique2[key]) {
97089
- unique2[key] = true;
97090
- results.push(intersection2);
97091
- }
97092
- });
97093
- } else {
97094
- results = intersections;
97095
- }
97096
- return featureCollection(results.map((r2) => point(r2)));
97097
- }
97098
- var __defProp$1 = Object.defineProperty;
97099
- var __name = (target, value) => __defProp$1(target, "name", { value, configurable: true });
97100
- var _GeojsonEquality = class _GeojsonEquality2 {
97101
- constructor(opts) {
97102
- this.direction = false;
97103
- this.compareProperties = true;
97104
- var _a2, _b, _c;
97105
- this.precision = 10 ** -((_a2 = opts == null ? void 0 : opts.precision) != null ? _a2 : 17);
97106
- this.direction = (_b = opts == null ? void 0 : opts.direction) != null ? _b : false;
97107
- this.compareProperties = (_c = opts == null ? void 0 : opts.compareProperties) != null ? _c : true;
97108
- }
97109
- compare(g1, g2) {
97110
- if (g1.type !== g2.type) {
97111
- return false;
97112
- }
97113
- if (!sameLength(g1, g2)) {
97114
- return false;
97115
- }
97116
- switch (g1.type) {
97117
- case "Point":
97118
- return this.compareCoord(g1.coordinates, g2.coordinates);
97119
- case "LineString":
97120
- return this.compareLine(g1.coordinates, g2.coordinates);
97121
- case "Polygon":
97122
- return this.comparePolygon(g1, g2);
97123
- case "GeometryCollection":
97124
- return this.compareGeometryCollection(g1, g2);
97125
- case "Feature":
97126
- return this.compareFeature(g1, g2);
97127
- case "FeatureCollection":
97128
- return this.compareFeatureCollection(g1, g2);
97129
- default:
97130
- if (g1.type.startsWith("Multi")) {
97131
- const g1s = explode(g1);
97132
- const g2s = explode(
97133
- g2
97134
- );
97135
- return g1s.every(
97136
- (g1part) => g2s.some((g2part) => this.compare(g1part, g2part))
97137
- );
97138
- }
97139
- }
97140
- return false;
97141
- }
97142
- compareCoord(c1, c2) {
97143
- return c1.length === c2.length && c1.every((c, i2) => Math.abs(c - c2[i2]) < this.precision);
97144
- }
97145
- compareLine(path1, path2, ind = 0, isPoly = false) {
97146
- if (!sameLength(path1, path2)) {
97147
- return false;
97148
- }
97149
- const p1 = path1;
97150
- let p2 = path2;
97151
- if (isPoly && !this.compareCoord(p1[0], p2[0])) {
97152
- const startIndex = this.fixStartIndex(p2, p1);
97153
- if (!startIndex) {
97154
- return false;
97155
- } else {
97156
- p2 = startIndex;
97157
- }
97158
- }
97159
- const sameDirection = this.compareCoord(p1[ind], p2[ind]);
97160
- if (this.direction || sameDirection) {
97161
- return this.comparePath(p1, p2);
97162
- } else {
97163
- if (this.compareCoord(p1[ind], p2[p2.length - (1 + ind)])) {
97164
- return this.comparePath(p1.slice().reverse(), p2);
97165
- }
97166
- return false;
97167
- }
97168
- }
97169
- fixStartIndex(sourcePath, targetPath) {
97170
- let correctPath, ind = -1;
97171
- for (let i2 = 0; i2 < sourcePath.length; i2++) {
97172
- if (this.compareCoord(sourcePath[i2], targetPath[0])) {
97173
- ind = i2;
97174
- break;
97175
- }
97176
- }
97177
- if (ind >= 0) {
97178
- correctPath = [].concat(
97179
- sourcePath.slice(ind, sourcePath.length),
97180
- sourcePath.slice(1, ind + 1)
97181
- );
97182
- }
97183
- return correctPath;
97184
- }
97185
- comparePath(p1, p2) {
97186
- return p1.every((c, i2) => this.compareCoord(c, p2[i2]));
97187
- }
97188
- comparePolygon(g1, g2) {
97189
- if (this.compareLine(g1.coordinates[0], g2.coordinates[0], 1, true)) {
97190
- const holes1 = g1.coordinates.slice(1, g1.coordinates.length);
97191
- const holes2 = g2.coordinates.slice(1, g2.coordinates.length);
97192
- return holes1.every(
97193
- (h1) => holes2.some((h2) => this.compareLine(h1, h2, 1, true))
97194
- );
97195
- }
97196
- return false;
97197
- }
97198
- compareGeometryCollection(g1, g2) {
97199
- return sameLength(g1.geometries, g2.geometries) && this.compareBBox(g1, g2) && g1.geometries.every((g3, i2) => this.compare(g3, g2.geometries[i2]));
97200
- }
97201
- compareFeature(g1, g2) {
97202
- return g1.id === g2.id && (this.compareProperties ? equal(g1.properties, g2.properties) : true) && this.compareBBox(g1, g2) && this.compare(g1.geometry, g2.geometry);
97203
- }
97204
- compareFeatureCollection(g1, g2) {
97205
- return sameLength(g1.features, g2.features) && this.compareBBox(g1, g2) && g1.features.every((f2, i2) => this.compare(f2, g2.features[i2]));
97206
- }
97207
- compareBBox(g1, g2) {
97208
- return Boolean(!g1.bbox && !g2.bbox) || (g1.bbox && g2.bbox ? this.compareCoord(g1.bbox, g2.bbox) : false);
97209
- }
97210
- };
97211
- __name(_GeojsonEquality, "GeojsonEquality");
97212
- var GeojsonEquality = _GeojsonEquality;
97213
- function sameLength(g1, g2) {
97214
- return g1.coordinates ? g1.coordinates.length === g2.coordinates.length : g1.length === g2.length;
97215
- }
97216
- __name(sameLength, "sameLength");
97217
- function explode(g2) {
97218
- return g2.coordinates.map((part) => ({
97219
- type: g2.type.replace("Multi", ""),
97220
- coordinates: part
97221
- }));
97222
- }
97223
- __name(explode, "explode");
97224
- function geojsonEquality(g1, g2, opts) {
97225
- const eq2 = new GeojsonEquality(opts);
97226
- return eq2.compare(g1, g2);
97227
- }
97228
- __name(geojsonEquality, "geojsonEquality");
97229
- function equal(object1, object2) {
97230
- if (object1 === null && object2 === null) {
97231
- return true;
97232
- }
97233
- if (object1 === null || object2 === null) {
97234
- return false;
97235
- }
97236
- const objKeys1 = Object.keys(object1);
97237
- const objKeys2 = Object.keys(object2);
97238
- if (objKeys1.length !== objKeys2.length) return false;
97239
- for (var key of objKeys1) {
97240
- const value1 = object1[key];
97241
- const value2 = object2[key];
97242
- const isObjects = isObject(value1) && isObject(value2);
97243
- if (isObjects && !equal(value1, value2) || !isObjects && value1 !== value2) {
97244
- return false;
97245
- }
97246
- }
97247
- return true;
97248
- }
97249
- __name(equal, "equal");
97250
- var isObject = /* @__PURE__ */ __name((object2) => {
97251
- return object2 != null && typeof object2 === "object";
97252
- }, "isObject");
97253
- function booleanOverlap(feature1, feature2) {
97254
- const geom1 = getGeom(feature1);
97255
- const geom2 = getGeom(feature2);
97256
- const type1 = geom1.type;
97257
- const type2 = geom2.type;
97258
- if (type1 === "MultiPoint" && type2 !== "MultiPoint" || (type1 === "LineString" || type1 === "MultiLineString") && type2 !== "LineString" && type2 !== "MultiLineString" || (type1 === "Polygon" || type1 === "MultiPolygon") && type2 !== "Polygon" && type2 !== "MultiPolygon") {
97259
- throw new Error("features must be of the same type");
97260
- }
97261
- if (type1 === "Point") throw new Error("Point geometry not supported");
97262
- if (geojsonEquality(feature1, feature2, { precision: 6 }))
97263
- return false;
97264
- let overlap = 0;
97265
- switch (type1) {
97266
- case "MultiPoint":
97267
- for (var i2 = 0; i2 < geom1.coordinates.length; i2++) {
97268
- for (var j = 0; j < geom2.coordinates.length; j++) {
97269
- var coord1 = geom1.coordinates[i2];
97270
- var coord2 = geom2.coordinates[j];
97271
- if (coord1[0] === coord2[0] && coord1[1] === coord2[1]) {
97272
- return true;
97273
- }
97274
- }
97275
- }
97276
- return false;
97277
- case "LineString":
97278
- case "MultiLineString":
97279
- segmentEach(feature1, (segment1) => {
97280
- segmentEach(feature2, (segment2) => {
97281
- if (lineOverlap(segment1, segment2).features.length) overlap++;
97282
- });
97283
- });
97284
- break;
97285
- case "Polygon":
97286
- case "MultiPolygon":
97287
- segmentEach(feature1, (segment1) => {
97288
- segmentEach(feature2, (segment2) => {
97289
- if (lineIntersect(segment1, segment2).features.length) overlap++;
97290
- });
97291
- });
97292
- break;
97293
- }
97294
- return overlap > 0;
95428
+ function inBBox(pt, bbox) {
95429
+ return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];
97295
95430
  }
97296
95431
  var distEs6$2 = {};
97297
95432
  var style$1 = {};
@@ -97388,7 +95523,7 @@ function requireCjs$f() {
97388
95523
  case "Point":
97389
95524
  return point2(coordinates2).geometry;
97390
95525
  case "LineString":
97391
- return lineString2(coordinates2).geometry;
95526
+ return lineString(coordinates2).geometry;
97392
95527
  case "Polygon":
97393
95528
  return polygon2(coordinates2).geometry;
97394
95529
  case "MultiPoint":
@@ -97458,7 +95593,7 @@ function requireCjs$f() {
97458
95593
  options
97459
95594
  );
97460
95595
  }
97461
- function lineString2(coordinates2, properties, options = {}) {
95596
+ function lineString(coordinates2, properties, options = {}) {
97462
95597
  if (coordinates2.length < 2) {
97463
95598
  throw new Error("coordinates must be an array of two or more positions");
97464
95599
  }
@@ -97471,7 +95606,7 @@ function requireCjs$f() {
97471
95606
  function lineStrings(coordinates2, properties, options = {}) {
97472
95607
  return featureCollection2(
97473
95608
  coordinates2.map((coords) => {
97474
- return lineString2(coords, properties);
95609
+ return lineString(coords, properties);
97475
95610
  }),
97476
95611
  options
97477
95612
  );
@@ -97537,7 +95672,7 @@ function requireCjs$f() {
97537
95672
  return distance2 / factor;
97538
95673
  }
97539
95674
  function lengthToDegrees(distance2, units) {
97540
- return radiansToDegrees2(lengthToRadians(distance2, units));
95675
+ return radiansToDegrees(lengthToRadians(distance2, units));
97541
95676
  }
97542
95677
  function bearingToAzimuth(bearing) {
97543
95678
  let angle2 = bearing % 360;
@@ -97555,7 +95690,7 @@ function requireCjs$f() {
97555
95690
  }
97556
95691
  return angle2;
97557
95692
  }
97558
- function radiansToDegrees2(radians2) {
95693
+ function radiansToDegrees(radians2) {
97559
95694
  const normalisedRadians = radians2 % (2 * Math.PI);
97560
95695
  return normalisedRadians * 180 / Math.PI;
97561
95696
  }
@@ -97589,17 +95724,17 @@ function requireCjs$f() {
97589
95724
  function isObject2(input) {
97590
95725
  return input !== null && typeof input === "object" && !Array.isArray(input);
97591
95726
  }
97592
- function validateBBox(bbox2) {
97593
- if (!bbox2) {
95727
+ function validateBBox(bbox) {
95728
+ if (!bbox) {
97594
95729
  throw new Error("bbox is required");
97595
95730
  }
97596
- if (!Array.isArray(bbox2)) {
95731
+ if (!Array.isArray(bbox)) {
97597
95732
  throw new Error("bbox must be an Array");
97598
95733
  }
97599
- if (bbox2.length !== 4 && bbox2.length !== 6) {
95734
+ if (bbox.length !== 4 && bbox.length !== 6) {
97600
95735
  throw new Error("bbox must be an Array of 4 or 6 numbers");
97601
95736
  }
97602
- bbox2.forEach((num) => {
95737
+ bbox.forEach((num) => {
97603
95738
  if (!isNumber2(num)) {
97604
95739
  throw new Error("bbox must only contain numbers");
97605
95740
  }
@@ -97629,7 +95764,7 @@ function requireCjs$f() {
97629
95764
  cjs$f.isObject = isObject2;
97630
95765
  cjs$f.lengthToDegrees = lengthToDegrees;
97631
95766
  cjs$f.lengthToRadians = lengthToRadians;
97632
- cjs$f.lineString = lineString2;
95767
+ cjs$f.lineString = lineString;
97633
95768
  cjs$f.lineStrings = lineStrings;
97634
95769
  cjs$f.multiLineString = multiLineString;
97635
95770
  cjs$f.multiPoint = multiPoint;
@@ -97638,7 +95773,7 @@ function requireCjs$f() {
97638
95773
  cjs$f.points = points;
97639
95774
  cjs$f.polygon = polygon2;
97640
95775
  cjs$f.polygons = polygons2;
97641
- cjs$f.radiansToDegrees = radiansToDegrees2;
95776
+ cjs$f.radiansToDegrees = radiansToDegrees;
97642
95777
  cjs$f.radiansToLength = radiansToLength2;
97643
95778
  cjs$f.round = round2;
97644
95779
  cjs$f.validateBBox = validateBBox;
@@ -97653,7 +95788,7 @@ function requireCjs$e() {
97653
95788
  hasRequiredCjs$e = 1;
97654
95789
  Object.defineProperty(cjs$d, "__esModule", { value: true });
97655
95790
  var _helpers = /* @__PURE__ */ requireCjs$f();
97656
- function coordEach2(geojson, callback, excludeWrapCoord) {
95791
+ function coordEach(geojson, callback, excludeWrapCoord) {
97657
95792
  if (geojson === null) return;
97658
95793
  var j, k, l2, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === "FeatureCollection", isFeature = type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
97659
95794
  for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
@@ -97740,7 +95875,7 @@ function requireCjs$e() {
97740
95875
  break;
97741
95876
  case "GeometryCollection":
97742
95877
  for (j = 0; j < geometry2.geometries.length; j++)
97743
- if (coordEach2(geometry2.geometries[j], callback, excludeWrapCoord) === false)
95878
+ if (coordEach(geometry2.geometries[j], callback, excludeWrapCoord) === false)
97744
95879
  return false;
97745
95880
  break;
97746
95881
  default:
@@ -97751,7 +95886,7 @@ function requireCjs$e() {
97751
95886
  }
97752
95887
  function coordReduce(geojson, callback, initialValue, excludeWrapCoord) {
97753
95888
  var previousValue = initialValue;
97754
- coordEach2(
95889
+ coordEach(
97755
95890
  geojson,
97756
95891
  function(currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
97757
95892
  if (coordIndex === 0 && initialValue === void 0)
@@ -97793,7 +95928,7 @@ function requireCjs$e() {
97793
95928
  });
97794
95929
  return previousValue;
97795
95930
  }
97796
- function featureEach2(geojson, callback) {
95931
+ function featureEach(geojson, callback) {
97797
95932
  if (geojson.type === "Feature") {
97798
95933
  callback(geojson, 0);
97799
95934
  } else if (geojson.type === "FeatureCollection") {
@@ -97804,7 +95939,7 @@ function requireCjs$e() {
97804
95939
  }
97805
95940
  function featureReduce(geojson, callback, initialValue) {
97806
95941
  var previousValue = initialValue;
97807
- featureEach2(geojson, function(currentFeature, featureIndex) {
95942
+ featureEach(geojson, function(currentFeature, featureIndex) {
97808
95943
  if (featureIndex === 0 && initialValue === void 0)
97809
95944
  previousValue = currentFeature;
97810
95945
  else previousValue = callback(previousValue, currentFeature, featureIndex);
@@ -97813,7 +95948,7 @@ function requireCjs$e() {
97813
95948
  }
97814
95949
  function coordAll(geojson) {
97815
95950
  var coords = [];
97816
- coordEach2(geojson, function(coord) {
95951
+ coordEach(geojson, function(coord) {
97817
95952
  coords.push(coord);
97818
95953
  });
97819
95954
  return coords;
@@ -97898,7 +96033,7 @@ function requireCjs$e() {
97898
96033
  return previousValue;
97899
96034
  }
97900
96035
  function flattenEach2(geojson, callback) {
97901
- geomEach2(geojson, function(geometry2, featureIndex, properties, bbox2, id) {
96036
+ geomEach2(geojson, function(geometry2, featureIndex, properties, bbox, id) {
97902
96037
  var type = geometry2 === null ? null : geometry2.type;
97903
96038
  switch (type) {
97904
96039
  case null:
@@ -97906,7 +96041,7 @@ function requireCjs$e() {
97906
96041
  case "LineString":
97907
96042
  case "Polygon":
97908
96043
  if (callback(
97909
- _helpers.feature.call(void 0, geometry2, properties, { bbox: bbox2, id }),
96044
+ _helpers.feature.call(void 0, geometry2, properties, { bbox, id }),
97910
96045
  featureIndex,
97911
96046
  0
97912
96047
  ) === false)
@@ -97954,7 +96089,7 @@ function requireCjs$e() {
97954
96089
  );
97955
96090
  return previousValue;
97956
96091
  }
97957
- function segmentEach2(geojson, callback) {
96092
+ function segmentEach(geojson, callback) {
97958
96093
  flattenEach2(geojson, function(feature2, featureIndex, multiFeatureIndex) {
97959
96094
  var segmentIndex = 0;
97960
96095
  if (!feature2.geometry) return;
@@ -97964,7 +96099,7 @@ function requireCjs$e() {
97964
96099
  var previousFeatureIndex = 0;
97965
96100
  var previousMultiIndex = 0;
97966
96101
  var prevGeomIndex = 0;
97967
- if (coordEach2(
96102
+ if (coordEach(
97968
96103
  feature2,
97969
96104
  function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {
97970
96105
  if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {
@@ -97998,7 +96133,7 @@ function requireCjs$e() {
97998
96133
  function segmentReduce(geojson, callback, initialValue) {
97999
96134
  var previousValue = initialValue;
98000
96135
  var started = false;
98001
- segmentEach2(
96136
+ segmentEach(
98002
96137
  geojson,
98003
96138
  function(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {
98004
96139
  if (started === false && initialValue === void 0)
@@ -98225,9 +96360,9 @@ function requireCjs$e() {
98225
96360
  throw new Error("geojson is invalid");
98226
96361
  }
98227
96362
  cjs$d.coordAll = coordAll;
98228
- cjs$d.coordEach = coordEach2;
96363
+ cjs$d.coordEach = coordEach;
98229
96364
  cjs$d.coordReduce = coordReduce;
98230
- cjs$d.featureEach = featureEach2;
96365
+ cjs$d.featureEach = featureEach;
98231
96366
  cjs$d.featureReduce = featureReduce;
98232
96367
  cjs$d.findPoint = findPoint;
98233
96368
  cjs$d.findSegment = findSegment;
@@ -98239,7 +96374,7 @@ function requireCjs$e() {
98239
96374
  cjs$d.lineReduce = lineReduce;
98240
96375
  cjs$d.propEach = propEach;
98241
96376
  cjs$d.propReduce = propReduce;
98242
- cjs$d.segmentEach = segmentEach2;
96377
+ cjs$d.segmentEach = segmentEach;
98243
96378
  cjs$d.segmentReduce = segmentReduce;
98244
96379
  return cjs$d;
98245
96380
  }
@@ -98249,7 +96384,7 @@ function requireCjs$d() {
98249
96384
  hasRequiredCjs$d = 1;
98250
96385
  Object.defineProperty(cjs$e, "__esModule", { value: true });
98251
96386
  var _meta = /* @__PURE__ */ requireCjs$e();
98252
- function bbox2(geojson, options = {}) {
96387
+ function bbox(geojson, options = {}) {
98253
96388
  if (geojson.bbox != null && true !== options.recompute) {
98254
96389
  return geojson.bbox;
98255
96390
  }
@@ -98270,8 +96405,8 @@ function requireCjs$d() {
98270
96405
  });
98271
96406
  return result;
98272
96407
  }
98273
- var turf_bbox_default = bbox2;
98274
- cjs$e.bbox = bbox2;
96408
+ var turf_bbox_default = bbox;
96409
+ cjs$e.bbox = bbox;
98275
96410
  cjs$e.default = turf_bbox_default;
98276
96411
  return cjs$e;
98277
96412
  }
@@ -98355,7 +96490,7 @@ function requireJs$p() {
98355
96490
  case "Point":
98356
96491
  return point2(coordinates2).geometry;
98357
96492
  case "LineString":
98358
- return lineString2(coordinates2).geometry;
96493
+ return lineString(coordinates2).geometry;
98359
96494
  case "Polygon":
98360
96495
  return polygon2(coordinates2).geometry;
98361
96496
  case "MultiPoint":
@@ -98432,7 +96567,7 @@ function requireJs$p() {
98432
96567
  }), options);
98433
96568
  }
98434
96569
  exports2.polygons = polygons2;
98435
- function lineString2(coordinates2, properties, options) {
96570
+ function lineString(coordinates2, properties, options) {
98436
96571
  if (options === void 0) {
98437
96572
  options = {};
98438
96573
  }
@@ -98445,13 +96580,13 @@ function requireJs$p() {
98445
96580
  };
98446
96581
  return feature2(geom, properties, options);
98447
96582
  }
98448
- exports2.lineString = lineString2;
96583
+ exports2.lineString = lineString;
98449
96584
  function lineStrings(coordinates2, properties, options) {
98450
96585
  if (options === void 0) {
98451
96586
  options = {};
98452
96587
  }
98453
96588
  return featureCollection2(coordinates2.map(function(coords) {
98454
- return lineString2(coords, properties);
96589
+ return lineString(coords, properties);
98455
96590
  }), options);
98456
96591
  }
98457
96592
  exports2.lineStrings = lineStrings;
@@ -98548,7 +96683,7 @@ function requireJs$p() {
98548
96683
  }
98549
96684
  exports2.lengthToRadians = lengthToRadians;
98550
96685
  function lengthToDegrees(distance2, units) {
98551
- return radiansToDegrees2(lengthToRadians(distance2, units));
96686
+ return radiansToDegrees(lengthToRadians(distance2, units));
98552
96687
  }
98553
96688
  exports2.lengthToDegrees = lengthToDegrees;
98554
96689
  function bearingToAzimuth(bearing) {
@@ -98559,11 +96694,11 @@ function requireJs$p() {
98559
96694
  return angle2;
98560
96695
  }
98561
96696
  exports2.bearingToAzimuth = bearingToAzimuth;
98562
- function radiansToDegrees2(radians2) {
96697
+ function radiansToDegrees(radians2) {
98563
96698
  var degrees2 = radians2 % (2 * Math.PI);
98564
96699
  return degrees2 * 180 / Math.PI;
98565
96700
  }
98566
- exports2.radiansToDegrees = radiansToDegrees2;
96701
+ exports2.radiansToDegrees = radiansToDegrees;
98567
96702
  function degreesToRadians2(degrees2) {
98568
96703
  var radians2 = degrees2 % 360;
98569
96704
  return radians2 * Math.PI / 180;
@@ -98611,17 +96746,17 @@ function requireJs$p() {
98611
96746
  return !!input && input.constructor === Object;
98612
96747
  }
98613
96748
  exports2.isObject = isObject2;
98614
- function validateBBox(bbox2) {
98615
- if (!bbox2) {
96749
+ function validateBBox(bbox) {
96750
+ if (!bbox) {
98616
96751
  throw new Error("bbox is required");
98617
96752
  }
98618
- if (!Array.isArray(bbox2)) {
96753
+ if (!Array.isArray(bbox)) {
98619
96754
  throw new Error("bbox must be an Array");
98620
96755
  }
98621
- if (bbox2.length !== 4 && bbox2.length !== 6) {
96756
+ if (bbox.length !== 4 && bbox.length !== 6) {
98622
96757
  throw new Error("bbox must be an Array of 4 or 6 numbers");
98623
96758
  }
98624
- bbox2.forEach(function(num) {
96759
+ bbox.forEach(function(num) {
98625
96760
  if (!isNumber2(num)) {
98626
96761
  throw new Error("bbox must only contain numbers");
98627
96762
  }
@@ -98646,22 +96781,22 @@ function requireJs$o() {
98646
96781
  hasRequiredJs$o = 1;
98647
96782
  Object.defineProperty(js$p, "__esModule", { value: true });
98648
96783
  var helpers_1 = /* @__PURE__ */ requireJs$p();
98649
- function bboxPolygon(bbox2, options) {
96784
+ function bboxPolygon(bbox, options) {
98650
96785
  if (options === void 0) {
98651
96786
  options = {};
98652
96787
  }
98653
- var west = Number(bbox2[0]);
98654
- var south = Number(bbox2[1]);
98655
- var east = Number(bbox2[2]);
98656
- var north = Number(bbox2[3]);
98657
- if (bbox2.length === 6) {
96788
+ var west = Number(bbox[0]);
96789
+ var south = Number(bbox[1]);
96790
+ var east = Number(bbox[2]);
96791
+ var north = Number(bbox[3]);
96792
+ if (bbox.length === 6) {
98658
96793
  throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
98659
96794
  }
98660
96795
  var lowLeft = [west, south];
98661
96796
  var topLeft = [west, north];
98662
96797
  var topRight = [east, north];
98663
96798
  var lowRight = [east, south];
98664
- return helpers_1.polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options.properties, { bbox: bbox2, id: options.id });
96799
+ return helpers_1.polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options.properties, { bbox, id: options.id });
98665
96800
  }
98666
96801
  js$p.default = bboxPolygon;
98667
96802
  return js$p;
@@ -98676,7 +96811,7 @@ function requireJs$n() {
98676
96811
  hasRequiredJs$n = 1;
98677
96812
  Object.defineProperty(js$k, "__esModule", { value: true });
98678
96813
  var helpers = /* @__PURE__ */ requireJs$p();
98679
- function coordEach2(geojson, callback, excludeWrapCoord) {
96814
+ function coordEach(geojson, callback, excludeWrapCoord) {
98680
96815
  if (geojson === null) return;
98681
96816
  var j, k, l2, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type = geojson.type, isFeatureCollection = type === "FeatureCollection", isFeature = type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
98682
96817
  for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
@@ -98763,7 +96898,7 @@ function requireJs$n() {
98763
96898
  break;
98764
96899
  case "GeometryCollection":
98765
96900
  for (j = 0; j < geometry2.geometries.length; j++)
98766
- if (coordEach2(geometry2.geometries[j], callback, excludeWrapCoord) === false)
96901
+ if (coordEach(geometry2.geometries[j], callback, excludeWrapCoord) === false)
98767
96902
  return false;
98768
96903
  break;
98769
96904
  default:
@@ -98774,7 +96909,7 @@ function requireJs$n() {
98774
96909
  }
98775
96910
  function coordReduce(geojson, callback, initialValue, excludeWrapCoord) {
98776
96911
  var previousValue = initialValue;
98777
- coordEach2(
96912
+ coordEach(
98778
96913
  geojson,
98779
96914
  function(currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
98780
96915
  if (coordIndex === 0 && initialValue === void 0)
@@ -98816,7 +96951,7 @@ function requireJs$n() {
98816
96951
  });
98817
96952
  return previousValue;
98818
96953
  }
98819
- function featureEach2(geojson, callback) {
96954
+ function featureEach(geojson, callback) {
98820
96955
  if (geojson.type === "Feature") {
98821
96956
  callback(geojson, 0);
98822
96957
  } else if (geojson.type === "FeatureCollection") {
@@ -98827,7 +96962,7 @@ function requireJs$n() {
98827
96962
  }
98828
96963
  function featureReduce(geojson, callback, initialValue) {
98829
96964
  var previousValue = initialValue;
98830
- featureEach2(geojson, function(currentFeature, featureIndex) {
96965
+ featureEach(geojson, function(currentFeature, featureIndex) {
98831
96966
  if (featureIndex === 0 && initialValue === void 0)
98832
96967
  previousValue = currentFeature;
98833
96968
  else previousValue = callback(previousValue, currentFeature, featureIndex);
@@ -98836,7 +96971,7 @@ function requireJs$n() {
98836
96971
  }
98837
96972
  function coordAll(geojson) {
98838
96973
  var coords = [];
98839
- coordEach2(geojson, function(coord) {
96974
+ coordEach(geojson, function(coord) {
98840
96975
  coords.push(coord);
98841
96976
  });
98842
96977
  return coords;
@@ -98921,7 +97056,7 @@ function requireJs$n() {
98921
97056
  return previousValue;
98922
97057
  }
98923
97058
  function flattenEach2(geojson, callback) {
98924
- geomEach2(geojson, function(geometry2, featureIndex, properties, bbox2, id) {
97059
+ geomEach2(geojson, function(geometry2, featureIndex, properties, bbox, id) {
98925
97060
  var type = geometry2 === null ? null : geometry2.type;
98926
97061
  switch (type) {
98927
97062
  case null:
@@ -98929,7 +97064,7 @@ function requireJs$n() {
98929
97064
  case "LineString":
98930
97065
  case "Polygon":
98931
97066
  if (callback(
98932
- helpers.feature(geometry2, properties, { bbox: bbox2, id }),
97067
+ helpers.feature(geometry2, properties, { bbox, id }),
98933
97068
  featureIndex,
98934
97069
  0
98935
97070
  ) === false)
@@ -98977,7 +97112,7 @@ function requireJs$n() {
98977
97112
  );
98978
97113
  return previousValue;
98979
97114
  }
98980
- function segmentEach2(geojson, callback) {
97115
+ function segmentEach(geojson, callback) {
98981
97116
  flattenEach2(geojson, function(feature2, featureIndex, multiFeatureIndex) {
98982
97117
  var segmentIndex = 0;
98983
97118
  if (!feature2.geometry) return;
@@ -98987,7 +97122,7 @@ function requireJs$n() {
98987
97122
  var previousFeatureIndex = 0;
98988
97123
  var previousMultiIndex = 0;
98989
97124
  var prevGeomIndex = 0;
98990
- if (coordEach2(
97125
+ if (coordEach(
98991
97126
  feature2,
98992
97127
  function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {
98993
97128
  if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {
@@ -99020,7 +97155,7 @@ function requireJs$n() {
99020
97155
  function segmentReduce(geojson, callback, initialValue) {
99021
97156
  var previousValue = initialValue;
99022
97157
  var started = false;
99023
- segmentEach2(
97158
+ segmentEach(
99024
97159
  geojson,
99025
97160
  function(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {
99026
97161
  if (started === false && initialValue === void 0)
@@ -99242,9 +97377,9 @@ function requireJs$n() {
99242
97377
  throw new Error("geojson is invalid");
99243
97378
  }
99244
97379
  js$k.coordAll = coordAll;
99245
- js$k.coordEach = coordEach2;
97380
+ js$k.coordEach = coordEach;
99246
97381
  js$k.coordReduce = coordReduce;
99247
- js$k.featureEach = featureEach2;
97382
+ js$k.featureEach = featureEach;
99248
97383
  js$k.featureReduce = featureReduce;
99249
97384
  js$k.findPoint = findPoint;
99250
97385
  js$k.findSegment = findSegment;
@@ -99256,7 +97391,7 @@ function requireJs$n() {
99256
97391
  js$k.lineReduce = lineReduce;
99257
97392
  js$k.propEach = propEach;
99258
97393
  js$k.propReduce = propReduce;
99259
- js$k.segmentEach = segmentEach2;
97394
+ js$k.segmentEach = segmentEach;
99260
97395
  js$k.segmentReduce = segmentReduce;
99261
97396
  return js$k;
99262
97397
  }
@@ -99266,7 +97401,7 @@ function requireJs$m() {
99266
97401
  hasRequiredJs$m = 1;
99267
97402
  Object.defineProperty(js$l, "__esModule", { value: true });
99268
97403
  var meta_1 = /* @__PURE__ */ requireJs$n();
99269
- function bbox2(geojson) {
97404
+ function bbox(geojson) {
99270
97405
  var result = [Infinity, Infinity, -Infinity, -Infinity];
99271
97406
  meta_1.coordEach(geojson, function(coord) {
99272
97407
  if (result[0] > coord[0]) {
@@ -99284,8 +97419,8 @@ function requireJs$m() {
99284
97419
  });
99285
97420
  return result;
99286
97421
  }
99287
- bbox2["default"] = bbox2;
99288
- js$l.default = bbox2;
97422
+ bbox["default"] = bbox;
97423
+ js$l.default = bbox;
99289
97424
  return js$l;
99290
97425
  }
99291
97426
  var hasRequiredJs$l;
@@ -109516,7 +107651,7 @@ function length$1(object2) {
109516
107651
  return +lengthSum$1;
109517
107652
  }
109518
107653
  var coordinates = [null, null], object = { type: "LineString", coordinates };
109519
- function distance(a2, b) {
107654
+ function distance$1(a2, b) {
109520
107655
  coordinates[0] = a2;
109521
107656
  coordinates[1] = b;
109522
107657
  return length$1(object);
@@ -109569,10 +107704,10 @@ function containsGeometry(geometry2, point2) {
109569
107704
  return geometry2 && containsGeometryType.hasOwnProperty(geometry2.type) ? containsGeometryType[geometry2.type](geometry2, point2) : false;
109570
107705
  }
109571
107706
  function containsPoint(coordinates2, point2) {
109572
- return distance(coordinates2, point2) === 0;
107707
+ return distance$1(coordinates2, point2) === 0;
109573
107708
  }
109574
107709
  function containsLine(coordinates2, point2) {
109575
- var ab = distance(coordinates2[0], coordinates2[1]), ao = distance(coordinates2[0], point2), ob = distance(point2, coordinates2[1]);
107710
+ var ab = distance$1(coordinates2[0], coordinates2[1]), ao = distance$1(coordinates2[0], point2), ob = distance$1(point2, coordinates2[1]);
109576
107711
  return ao + ob <= ab + epsilon;
109577
107712
  }
109578
107713
  function containsPolygon(coordinates2, point2) {
@@ -110789,7 +108924,7 @@ const d3Geo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
110789
108924
  geoConicEquidistant: conicEquidistant,
110790
108925
  geoConicEquidistantRaw: conicEquidistantRaw,
110791
108926
  geoContains: contains,
110792
- geoDistance: distance,
108927
+ geoDistance: distance$1,
110793
108928
  geoEquirectangular: equirectangular,
110794
108929
  geoEquirectangularRaw: equirectangularRaw,
110795
108930
  geoGnomonic: gnomonic,
@@ -111489,8 +109624,8 @@ function requirePolygonClipping_umd() {
111489
109624
  sort(keys2, values2, left, j, compare2);
111490
109625
  sort(keys2, values2, j + 1, right, compare2);
111491
109626
  }
111492
- var isInBbox2 = function isInBbox3(bbox2, point2) {
111493
- return bbox2.ll.x <= point2.x && point2.x <= bbox2.ur.x && bbox2.ll.y <= point2.y && point2.y <= bbox2.ur.y;
109627
+ var isInBbox2 = function isInBbox3(bbox, point2) {
109628
+ return bbox.ll.x <= point2.x && point2.x <= bbox.ur.x && bbox.ll.y <= point2.y && point2.y <= bbox.ur.y;
111494
109629
  };
111495
109630
  var getBboxOverlap2 = function getBboxOverlap3(b1, b2) {
111496
109631
  if (b2.ur.x < b1.ll.x || b1.ur.x < b2.ll.x || b2.ur.y < b1.ll.y || b1.ur.y < b2.ll.y) return null;
@@ -111870,7 +110005,7 @@ function requirePolygonClipping_umd() {
111870
110005
  }
111871
110006
  }, {
111872
110007
  key: "bbox",
111873
- value: function bbox2() {
110008
+ value: function bbox() {
111874
110009
  var y12 = this.leftSE.point.y;
111875
110010
  var y2 = this.rightSE.point.y;
111876
110011
  return {
@@ -112807,7 +110942,7 @@ function requireJs$j() {
112807
110942
  throw new Error("coord must be GeoJSON Point or an Array of numbers");
112808
110943
  }
112809
110944
  js$i.getCoord = getCoord2;
112810
- function getCoords2(coords) {
110945
+ function getCoords(coords) {
112811
110946
  if (Array.isArray(coords)) {
112812
110947
  return coords;
112813
110948
  }
@@ -112822,7 +110957,7 @@ function requireJs$j() {
112822
110957
  }
112823
110958
  throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
112824
110959
  }
112825
- js$i.getCoords = getCoords2;
110960
+ js$i.getCoords = getCoords;
112826
110961
  function containsNumber(coordinates2) {
112827
110962
  if (coordinates2.length > 1 && helpers_1.isNumber(coordinates2[0]) && helpers_1.isNumber(coordinates2[1])) {
112828
110963
  return true;
@@ -112952,7 +111087,7 @@ function requireCjs$c() {
112952
111087
  }
112953
111088
  throw new Error("coord must be GeoJSON Point or an Array of numbers");
112954
111089
  }
112955
- function getCoords2(coords) {
111090
+ function getCoords(coords) {
112956
111091
  if (Array.isArray(coords)) {
112957
111092
  return coords;
112958
111093
  }
@@ -113054,7 +111189,7 @@ function requireCjs$c() {
113054
111189
  cjs$b.featureOf = featureOf;
113055
111190
  cjs$b.geojsonType = geojsonType;
113056
111191
  cjs$b.getCoord = getCoord2;
113057
- cjs$b.getCoords = getCoords2;
111192
+ cjs$b.getCoords = getCoords;
113058
111193
  cjs$b.getGeom = getGeom2;
113059
111194
  cjs$b.getType = getType;
113060
111195
  return cjs$b;
@@ -113527,7 +111662,7 @@ function requireFeature() {
113527
111662
  }
113528
111663
  _createClass(Feature2, [{
113529
111664
  key: "getCoords",
113530
- value: function getCoords2() {
111665
+ value: function getCoords() {
113531
111666
  return this.geoJson.geometry.coordinates;
113532
111667
  }
113533
111668
  }]);
@@ -115708,7 +113843,7 @@ function requireCjs$a() {
115708
113843
  var __defProp2 = Object.defineProperty;
115709
113844
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
115710
113845
  var __getOwnPropNames = Object.getOwnPropertyNames;
115711
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
113846
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
115712
113847
  var __export = (target, all) => {
115713
113848
  for (var name2 in all)
115714
113849
  __defProp2(target, name2, { get: all[name2], enumerable: true });
@@ -115716,7 +113851,7 @@ function requireCjs$a() {
115716
113851
  var __copyProps = (to, from, except, desc) => {
115717
113852
  if (from && typeof from === "object" || typeof from === "function") {
115718
113853
  for (let key of __getOwnPropNames(from))
115719
- if (!__hasOwnProp2.call(to, key) && key !== except)
113854
+ if (!__hasOwnProp.call(to, key) && key !== except)
115720
113855
  __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
115721
113856
  }
115722
113857
  return to;
@@ -116422,7 +114557,7 @@ function requireCjs$9() {
116422
114557
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
116423
114558
  var __getOwnPropNames = Object.getOwnPropertyNames;
116424
114559
  var __getProtoOf = Object.getPrototypeOf;
116425
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
114560
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
116426
114561
  var __export = (target, all) => {
116427
114562
  for (var name2 in all)
116428
114563
  __defProp2(target, name2, { get: all[name2], enumerable: true });
@@ -116430,7 +114565,7 @@ function requireCjs$9() {
116430
114565
  var __copyProps = (to, from, except, desc) => {
116431
114566
  if (from && typeof from === "object" || typeof from === "function") {
116432
114567
  for (let key of __getOwnPropNames(from))
116433
- if (!__hasOwnProp2.call(to, key) && key !== except)
114568
+ if (!__hasOwnProp.call(to, key) && key !== except)
116434
114569
  __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
116435
114570
  }
116436
114571
  return to;
@@ -116512,8 +114647,8 @@ function requireCjs$9() {
116512
114647
  };
116513
114648
  };
116514
114649
  var precision2 = set2();
116515
- var isInBbox2 = (bbox2, point2) => {
116516
- return bbox2.ll.x.isLessThanOrEqualTo(point2.x) && point2.x.isLessThanOrEqualTo(bbox2.ur.x) && bbox2.ll.y.isLessThanOrEqualTo(point2.y) && point2.y.isLessThanOrEqualTo(bbox2.ur.y);
114650
+ var isInBbox2 = (bbox, point2) => {
114651
+ return bbox.ll.x.isLessThanOrEqualTo(point2.x) && point2.x.isLessThanOrEqualTo(bbox.ur.x) && bbox.ll.y.isLessThanOrEqualTo(point2.y) && point2.y.isLessThanOrEqualTo(bbox.ur.y);
116517
114652
  };
116518
114653
  var getBboxOverlap2 = (b1, b2) => {
116519
114654
  if (b2.ur.x.isLessThan(b1.ll.x) || b1.ur.x.isLessThan(b2.ll.x) || b2.ur.y.isLessThan(b1.ll.y) || b1.ur.y.isLessThan(b2.ll.y))
@@ -118088,7 +116223,7 @@ function requireUtils$2() {
118088
116223
  utils$2.distance2d = distance2d;
118089
116224
  utils$2.mix = mix;
118090
116225
  utils$2.nearestPointOnProjectedLine = nearestPointOnProjectedLine;
118091
- utils$2.nearestPointOnLine = nearestPointOnLine2;
116226
+ utils$2.nearestPointOnLine = nearestPointOnLine;
118092
116227
  utils$2.getPickedEditHandle = getPickedEditHandle;
118093
116228
  utils$2.getPickedSnapSourceEditHandle = getPickedSnapSourceEditHandle;
118094
116229
  utils$2.getNonGuidePicks = getNonGuidePicks;
@@ -118185,12 +116320,12 @@ function requireUtils$2() {
118185
116320
  return false;
118186
116321
  }
118187
116322
  function generatePointsParallelToLinePoints(p1, p2, mapCoords) {
118188
- var lineString2 = {
116323
+ var lineString = {
118189
116324
  type: "LineString",
118190
116325
  coordinates: [p1, p2]
118191
116326
  };
118192
116327
  var pt = (0, _helpers.point)(mapCoords);
118193
- var ddistance = (0, _pointToLineDistance["default"])(pt, lineString2);
116328
+ var ddistance = (0, _pointToLineDistance["default"])(pt, lineString);
118194
116329
  var lineBearing = (0, _bearing["default"])(p1, p2);
118195
116330
  var isPointToLeftOfLine = (mapCoords[0] - p1[0]) * (p2[1] - p1[1]) - (mapCoords[1] - p1[1]) * (p2[0] - p1[0]);
118196
116331
  var orthogonalBearing = isPointToLeftOfLine < 0 ? lineBearing - 90 : lineBearing - 270;
@@ -118256,7 +116391,7 @@ function requireUtils$2() {
118256
116391
  }
118257
116392
  };
118258
116393
  }
118259
- function nearestPointOnLine2(lines, inPoint, viewport) {
116394
+ function nearestPointOnLine(lines, inPoint, viewport) {
118260
116395
  var _lines$geometry, _lines$geometry2;
118261
116396
  var mercator2;
118262
116397
  if (viewport) {
@@ -118776,8 +116911,8 @@ function requireImmutableFeatureCollection() {
118776
116911
  }
118777
116912
  function pruneMultiLineStringIfNecessary(geometry2) {
118778
116913
  for (var lineStringIndex = 0; lineStringIndex < geometry2.coordinates.length; lineStringIndex++) {
118779
- var lineString2 = geometry2.coordinates[lineStringIndex];
118780
- if (lineString2.length === 1) {
116914
+ var lineString = geometry2.coordinates[lineStringIndex];
116915
+ if (lineString.length === 1) {
118781
116916
  geometry2.coordinates.splice(lineStringIndex, 1);
118782
116917
  lineStringIndex--;
118783
116918
  }
@@ -119366,8 +117501,8 @@ function requireModifyMode() {
119366
117501
  var intermediatePoint = null;
119367
117502
  var positionIndexPrefix = [];
119368
117503
  var referencePoint = (0, _helpers.point)(mapCoords);
119369
- (0, _utils.recursivelyTraverseNestedArrays)(featureAsPick.object.geometry.coordinates, [], function(lineString2, prefix) {
119370
- var lineStringFeature = (0, _helpers.lineString)(lineString2);
117504
+ (0, _utils.recursivelyTraverseNestedArrays)(featureAsPick.object.geometry.coordinates, [], function(lineString, prefix) {
117505
+ var lineStringFeature = (0, _helpers.lineString)(lineString);
119371
117506
  var candidateIntermediatePoint = _this.getNearestPoint(
119372
117507
  // @ts-ignore
119373
117508
  lineStringFeature,
@@ -119543,29 +117678,29 @@ function requireCjs$6() {
119543
117678
  hasRequiredCjs$6 = 1;
119544
117679
  Object.defineProperty(cjs$6, "__esModule", { value: true });
119545
117680
  var __defProp2 = Object.defineProperty;
119546
- var __defProps2 = Object.defineProperties;
119547
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
119548
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
119549
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
119550
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
117681
+ var __defProps = Object.defineProperties;
117682
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
117683
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
117684
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
117685
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
119551
117686
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
119552
- var __spreadValues2 = (a2, b) => {
117687
+ var __spreadValues = (a2, b) => {
119553
117688
  for (var prop in b || (b = {}))
119554
- if (__hasOwnProp2.call(b, prop))
117689
+ if (__hasOwnProp.call(b, prop))
119555
117690
  __defNormalProp2(a2, prop, b[prop]);
119556
- if (__getOwnPropSymbols2)
119557
- for (var prop of __getOwnPropSymbols2(b)) {
119558
- if (__propIsEnum2.call(b, prop))
117691
+ if (__getOwnPropSymbols)
117692
+ for (var prop of __getOwnPropSymbols(b)) {
117693
+ if (__propIsEnum.call(b, prop))
119559
117694
  __defNormalProp2(a2, prop, b[prop]);
119560
117695
  }
119561
117696
  return a2;
119562
117697
  };
119563
- var __spreadProps2 = (a2, b) => __defProps2(a2, __getOwnPropDescs2(b));
117698
+ var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
119564
117699
  var _distance = /* @__PURE__ */ requireCjs$b();
119565
117700
  var _meta = /* @__PURE__ */ requireCjs$e();
119566
117701
  var _helpers = /* @__PURE__ */ requireCjs$f();
119567
117702
  var _invariant = /* @__PURE__ */ requireCjs$c();
119568
- function nearestPointOnLine2(lines, pt, options = {}) {
117703
+ function nearestPointOnLine(lines, pt, options = {}) {
119569
117704
  if (!lines || !pt) {
119570
117705
  throw new Error("lines and pt are required arguments");
119571
117706
  }
@@ -119597,7 +117732,7 @@ function requireCjs$6() {
119597
117732
  } else if (stopPos[0] === ptPos[0] && stopPos[1] === ptPos[1]) {
119598
117733
  [intersectPos, , wasEnd] = [stopPos, void 0, true];
119599
117734
  } else {
119600
- [intersectPos, , wasEnd] = nearestPointOnSegment2(
117735
+ [intersectPos, , wasEnd] = nearestPointOnSegment(
119601
117736
  start.geometry.coordinates,
119602
117737
  stop.geometry.coordinates,
119603
117738
  _invariant.getCoord.call(void 0, pt)
@@ -119612,8 +117747,8 @@ function requireCjs$6() {
119612
117747
  });
119613
117748
  }
119614
117749
  if (intersectPt && intersectPt.properties.dist < closestPt.properties.dist) {
119615
- closestPt = __spreadProps2(__spreadValues2({}, intersectPt), {
119616
- properties: __spreadProps2(__spreadValues2({}, intersectPt.properties), {
117750
+ closestPt = __spreadProps(__spreadValues({}, intersectPt), {
117751
+ properties: __spreadProps(__spreadValues({}, intersectPt.properties), {
119617
117752
  // Legacy behaviour where index progresses to next segment # if we
119618
117753
  // went with the end point this iteration.
119619
117754
  index: wasEnd ? i2 + 1 : i2
@@ -119636,14 +117771,14 @@ function requireCjs$6() {
119636
117771
  const [v2x, v2y, v2z] = v2;
119637
117772
  return [v1y * v2z - v1z * v2y, v1z * v2x - v1x * v2z, v1x * v2y - v1y * v2x];
119638
117773
  }
119639
- function magnitude2(v) {
117774
+ function magnitude(v) {
119640
117775
  return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2) + Math.pow(v[2], 2));
119641
117776
  }
119642
117777
  function angle2(v12, v2) {
119643
- const theta = dot2(v12, v2) / (magnitude2(v12) * magnitude2(v2));
117778
+ const theta = dot2(v12, v2) / (magnitude(v12) * magnitude(v2));
119644
117779
  return Math.acos(Math.min(Math.max(theta, -1), 1));
119645
117780
  }
119646
- function lngLatToVector2(a2) {
117781
+ function lngLatToVector(a2) {
119647
117782
  const lat = _helpers.degreesToRadians.call(void 0, a2[1]);
119648
117783
  const lng = _helpers.degreesToRadians.call(void 0, a2[0]);
119649
117784
  return [
@@ -119652,16 +117787,16 @@ function requireCjs$6() {
119652
117787
  Math.sin(lat)
119653
117788
  ];
119654
117789
  }
119655
- function vectorToLngLat2(v) {
117790
+ function vectorToLngLat(v) {
119656
117791
  const [x, y, z2] = v;
119657
117792
  const lat = _helpers.radiansToDegrees.call(void 0, Math.asin(z2));
119658
117793
  const lng = _helpers.radiansToDegrees.call(void 0, Math.atan2(y, x));
119659
117794
  return [lng, lat];
119660
117795
  }
119661
- function nearestPointOnSegment2(posA, posB, posC) {
119662
- const A2 = lngLatToVector2(posA);
119663
- const B2 = lngLatToVector2(posB);
119664
- const C3 = lngLatToVector2(posC);
117796
+ function nearestPointOnSegment(posA, posB, posC) {
117797
+ const A2 = lngLatToVector(posA);
117798
+ const B2 = lngLatToVector(posB);
117799
+ const C3 = lngLatToVector(posC);
119665
117800
  const [Cx, Cy, Cz] = C3;
119666
117801
  const [D2, E2, F] = cross2(A2, B2);
119667
117802
  const a2 = E2 * Cz - F * Cy;
@@ -119685,17 +117820,17 @@ function requireCjs$6() {
119685
117820
  I3 = I2;
119686
117821
  }
119687
117822
  if (angle2(A2, I3) > angleAB || angle2(B2, I3) > angleAB) {
119688
- if (_distance.distance.call(void 0, vectorToLngLat2(I3), vectorToLngLat2(A2)) <= _distance.distance.call(void 0, vectorToLngLat2(I3), vectorToLngLat2(B2))) {
119689
- return [vectorToLngLat2(A2), true, false];
117823
+ if (_distance.distance.call(void 0, vectorToLngLat(I3), vectorToLngLat(A2)) <= _distance.distance.call(void 0, vectorToLngLat(I3), vectorToLngLat(B2))) {
117824
+ return [vectorToLngLat(A2), true, false];
119690
117825
  } else {
119691
- return [vectorToLngLat2(B2), false, true];
117826
+ return [vectorToLngLat(B2), false, true];
119692
117827
  }
119693
117828
  }
119694
- return [vectorToLngLat2(I3), false, false];
117829
+ return [vectorToLngLat(I3), false, false];
119695
117830
  }
119696
- var turf_nearest_point_on_line_default = nearestPointOnLine2;
117831
+ var turf_nearest_point_on_line_default = nearestPointOnLine;
119697
117832
  cjs$6.default = turf_nearest_point_on_line_default;
119698
- cjs$6.nearestPointOnLine = nearestPointOnLine2;
117833
+ cjs$6.nearestPointOnLine = nearestPointOnLine;
119699
117834
  return cjs$6;
119700
117835
  }
119701
117836
  var cjs$5 = {};
@@ -119895,8 +118030,8 @@ function requireResizeCircleMode() {
119895
118030
  var intermediatePoint = null;
119896
118031
  var positionIndexPrefix = [];
119897
118032
  var referencePoint = (0, _helpers.point)(mapCoords);
119898
- (0, _utils.recursivelyTraverseNestedArrays)(featureAsPick.object.geometry.coordinates, [], function(lineString2, prefix) {
119899
- var lineStringFeature = (0, _helpers.lineString)(lineString2);
118033
+ (0, _utils.recursivelyTraverseNestedArrays)(featureAsPick.object.geometry.coordinates, [], function(lineString, prefix) {
118034
+ var lineStringFeature = (0, _helpers.lineString)(lineString);
119900
118035
  var candidateIntermediatePoint = _this2.getNearestPoint(
119901
118036
  // @ts-ignore
119902
118037
  lineStringFeature,
@@ -120534,11 +118669,11 @@ function requireJs$4() {
120534
118669
  if (origin === void 0 || origin === null) origin = "centroid";
120535
118670
  if (Array.isArray(origin) || typeof origin === "object")
120536
118671
  return invariant.getCoord(origin);
120537
- var bbox2 = geojson.bbox ? geojson.bbox : turfBBox__default["default"](geojson);
120538
- var west = bbox2[0];
120539
- var south = bbox2[1];
120540
- var east = bbox2[2];
120541
- var north = bbox2[3];
118672
+ var bbox = geojson.bbox ? geojson.bbox : turfBBox__default["default"](geojson);
118673
+ var west = bbox[0];
118674
+ var south = bbox[1];
118675
+ var east = bbox[2];
118676
+ var north = bbox[3];
120542
118677
  switch (origin) {
120543
118678
  case "sw":
120544
118679
  case "southwest":
@@ -121894,9 +120029,9 @@ function requireCjs$2() {
121894
120029
  const pt = _invariant.getCoord.call(void 0, point2);
121895
120030
  const geom = _invariant.getGeom.call(void 0, polygon2);
121896
120031
  const type = geom.type;
121897
- const bbox2 = polygon2.bbox;
120032
+ const bbox = polygon2.bbox;
121898
120033
  let polys = geom.coordinates;
121899
- if (bbox2 && inBBox2(pt, bbox2) === false) {
120034
+ if (bbox && inBBox2(pt, bbox) === false) {
121900
120035
  return false;
121901
120036
  }
121902
120037
  if (type === "Polygon") {
@@ -121910,8 +120045,8 @@ function requireCjs$2() {
121910
120045
  }
121911
120046
  return result;
121912
120047
  }
121913
- function inBBox2(pt, bbox2) {
121914
- return bbox2[0] <= pt[0] && bbox2[1] <= pt[1] && bbox2[2] >= pt[0] && bbox2[3] >= pt[1];
120048
+ function inBBox2(pt, bbox) {
120049
+ return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];
121915
120050
  }
121916
120051
  var turf_boolean_point_in_polygon_default = booleanPointInPolygon2;
121917
120052
  cjs$3.booleanPointInPolygon = booleanPointInPolygon2;
@@ -121919,6 +120054,206 @@ function requireCjs$2() {
121919
120054
  return cjs$3;
121920
120055
  }
121921
120056
  var cjs$1 = {};
120057
+ class TinyQueue2 {
120058
+ constructor(data = [], compare2 = defaultCompare$1) {
120059
+ this.data = data;
120060
+ this.length = this.data.length;
120061
+ this.compare = compare2;
120062
+ if (this.length > 0) {
120063
+ for (let i2 = (this.length >> 1) - 1; i2 >= 0; i2--) this._down(i2);
120064
+ }
120065
+ }
120066
+ push(item) {
120067
+ this.data.push(item);
120068
+ this.length++;
120069
+ this._up(this.length - 1);
120070
+ }
120071
+ pop() {
120072
+ if (this.length === 0) return void 0;
120073
+ const top = this.data[0];
120074
+ const bottom = this.data.pop();
120075
+ this.length--;
120076
+ if (this.length > 0) {
120077
+ this.data[0] = bottom;
120078
+ this._down(0);
120079
+ }
120080
+ return top;
120081
+ }
120082
+ peek() {
120083
+ return this.data[0];
120084
+ }
120085
+ _up(pos) {
120086
+ const { data, compare: compare2 } = this;
120087
+ const item = data[pos];
120088
+ while (pos > 0) {
120089
+ const parent = pos - 1 >> 1;
120090
+ const current = data[parent];
120091
+ if (compare2(item, current) >= 0) break;
120092
+ data[pos] = current;
120093
+ pos = parent;
120094
+ }
120095
+ data[pos] = item;
120096
+ }
120097
+ _down(pos) {
120098
+ const { data, compare: compare2 } = this;
120099
+ const halfLength = this.length >> 1;
120100
+ const item = data[pos];
120101
+ while (pos < halfLength) {
120102
+ let left = (pos << 1) + 1;
120103
+ let best = data[left];
120104
+ const right = left + 1;
120105
+ if (right < this.length && compare2(data[right], best) < 0) {
120106
+ left = right;
120107
+ best = data[right];
120108
+ }
120109
+ if (compare2(best, item) >= 0) break;
120110
+ data[pos] = best;
120111
+ pos = left;
120112
+ }
120113
+ data[pos] = item;
120114
+ }
120115
+ }
120116
+ function defaultCompare$1(a2, b) {
120117
+ return a2 < b ? -1 : a2 > b ? 1 : 0;
120118
+ }
120119
+ function checkWhichEventIsLeft(e1, e2) {
120120
+ if (e1.p.x > e2.p.x) return 1;
120121
+ if (e1.p.x < e2.p.x) return -1;
120122
+ if (e1.p.y !== e2.p.y) return e1.p.y > e2.p.y ? 1 : -1;
120123
+ return 1;
120124
+ }
120125
+ function checkWhichSegmentHasRightEndpointFirst(seg1, seg2) {
120126
+ if (seg1.rightSweepEvent.p.x > seg2.rightSweepEvent.p.x) return 1;
120127
+ if (seg1.rightSweepEvent.p.x < seg2.rightSweepEvent.p.x) return -1;
120128
+ if (seg1.rightSweepEvent.p.y !== seg2.rightSweepEvent.p.y) return seg1.rightSweepEvent.p.y < seg2.rightSweepEvent.p.y ? 1 : -1;
120129
+ return 1;
120130
+ }
120131
+ class Event {
120132
+ constructor(p, featureId2, ringId2, eventId2) {
120133
+ this.p = {
120134
+ x: p[0],
120135
+ y: p[1]
120136
+ };
120137
+ this.featureId = featureId2;
120138
+ this.ringId = ringId2;
120139
+ this.eventId = eventId2;
120140
+ this.otherEvent = null;
120141
+ this.isLeftEndpoint = null;
120142
+ }
120143
+ isSamePoint(eventToCheck) {
120144
+ return this.p.x === eventToCheck.p.x && this.p.y === eventToCheck.p.y;
120145
+ }
120146
+ }
120147
+ function fillEventQueue(geojson, eventQueue) {
120148
+ if (geojson.type === "FeatureCollection") {
120149
+ const features = geojson.features;
120150
+ for (let i2 = 0; i2 < features.length; i2++) {
120151
+ processFeature(features[i2], eventQueue);
120152
+ }
120153
+ } else {
120154
+ processFeature(geojson, eventQueue);
120155
+ }
120156
+ }
120157
+ let featureId = 0;
120158
+ let ringId = 0;
120159
+ let eventId = 0;
120160
+ function processFeature(featureOrGeometry, eventQueue) {
120161
+ const geom = featureOrGeometry.type === "Feature" ? featureOrGeometry.geometry : featureOrGeometry;
120162
+ let coords = geom.coordinates;
120163
+ if (geom.type === "Polygon" || geom.type === "MultiLineString") coords = [coords];
120164
+ if (geom.type === "LineString") coords = [[coords]];
120165
+ for (let i2 = 0; i2 < coords.length; i2++) {
120166
+ for (let ii = 0; ii < coords[i2].length; ii++) {
120167
+ let currentP = coords[i2][ii][0];
120168
+ let nextP = null;
120169
+ ringId = ringId + 1;
120170
+ for (let iii = 0; iii < coords[i2][ii].length - 1; iii++) {
120171
+ nextP = coords[i2][ii][iii + 1];
120172
+ const e1 = new Event(currentP, featureId, ringId, eventId);
120173
+ const e2 = new Event(nextP, featureId, ringId, eventId + 1);
120174
+ e1.otherEvent = e2;
120175
+ e2.otherEvent = e1;
120176
+ if (checkWhichEventIsLeft(e1, e2) > 0) {
120177
+ e2.isLeftEndpoint = true;
120178
+ e1.isLeftEndpoint = false;
120179
+ } else {
120180
+ e1.isLeftEndpoint = true;
120181
+ e2.isLeftEndpoint = false;
120182
+ }
120183
+ eventQueue.push(e1);
120184
+ eventQueue.push(e2);
120185
+ currentP = nextP;
120186
+ eventId = eventId + 1;
120187
+ }
120188
+ }
120189
+ }
120190
+ featureId = featureId + 1;
120191
+ }
120192
+ let Segment$1 = class Segment {
120193
+ constructor(event) {
120194
+ this.leftSweepEvent = event;
120195
+ this.rightSweepEvent = event.otherEvent;
120196
+ }
120197
+ };
120198
+ function testSegmentIntersect(seg1, seg2) {
120199
+ if (seg1 === null || seg2 === null) return false;
120200
+ if (seg1.leftSweepEvent.ringId === seg2.leftSweepEvent.ringId && (seg1.rightSweepEvent.isSamePoint(seg2.leftSweepEvent) || seg1.rightSweepEvent.isSamePoint(seg2.leftSweepEvent) || seg1.rightSweepEvent.isSamePoint(seg2.rightSweepEvent) || seg1.leftSweepEvent.isSamePoint(seg2.leftSweepEvent) || seg1.leftSweepEvent.isSamePoint(seg2.rightSweepEvent))) return false;
120201
+ const x12 = seg1.leftSweepEvent.p.x;
120202
+ const y12 = seg1.leftSweepEvent.p.y;
120203
+ const x2 = seg1.rightSweepEvent.p.x;
120204
+ const y2 = seg1.rightSweepEvent.p.y;
120205
+ const x3 = seg2.leftSweepEvent.p.x;
120206
+ const y3 = seg2.leftSweepEvent.p.y;
120207
+ const x4 = seg2.rightSweepEvent.p.x;
120208
+ const y4 = seg2.rightSweepEvent.p.y;
120209
+ const denom = (y4 - y3) * (x2 - x12) - (x4 - x3) * (y2 - y12);
120210
+ const numeA = (x4 - x3) * (y12 - y3) - (y4 - y3) * (x12 - x3);
120211
+ const numeB = (x2 - x12) * (y12 - y3) - (y2 - y12) * (x12 - x3);
120212
+ if (denom === 0) {
120213
+ if (numeA === 0 && numeB === 0) return false;
120214
+ return false;
120215
+ }
120216
+ const uA = numeA / denom;
120217
+ const uB = numeB / denom;
120218
+ if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
120219
+ const x = x12 + uA * (x2 - x12);
120220
+ const y = y12 + uA * (y2 - y12);
120221
+ return [x, y];
120222
+ }
120223
+ return false;
120224
+ }
120225
+ function runCheck(eventQueue, ignoreSelfIntersections) {
120226
+ ignoreSelfIntersections = ignoreSelfIntersections ? ignoreSelfIntersections : false;
120227
+ const intersectionPoints = [];
120228
+ const outQueue = new TinyQueue2([], checkWhichSegmentHasRightEndpointFirst);
120229
+ while (eventQueue.length) {
120230
+ const event = eventQueue.pop();
120231
+ if (event.isLeftEndpoint) {
120232
+ const segment = new Segment$1(event);
120233
+ for (let i2 = 0; i2 < outQueue.data.length; i2++) {
120234
+ const otherSeg = outQueue.data[i2];
120235
+ if (ignoreSelfIntersections) {
120236
+ if (otherSeg.leftSweepEvent.featureId === event.featureId) continue;
120237
+ }
120238
+ const intersection2 = testSegmentIntersect(segment, otherSeg);
120239
+ if (intersection2 !== false) intersectionPoints.push(intersection2);
120240
+ }
120241
+ outQueue.push(segment);
120242
+ } else if (event.isLeftEndpoint === false) {
120243
+ outQueue.pop();
120244
+ }
120245
+ }
120246
+ return intersectionPoints;
120247
+ }
120248
+ function sweeplineIntersections(geojson, ignoreSelfIntersections) {
120249
+ const eventQueue = new TinyQueue2([], checkWhichEventIsLeft);
120250
+ fillEventQueue(geojson, eventQueue);
120251
+ return runCheck(eventQueue, ignoreSelfIntersections);
120252
+ }
120253
+ const sweeplineIntersections_esm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
120254
+ __proto__: null,
120255
+ default: sweeplineIntersections
120256
+ }, Symbol.toStringTag, { value: "Module" }));
121922
120257
  const require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(sweeplineIntersections_esm);
121923
120258
  var hasRequiredCjs$1;
121924
120259
  function requireCjs$1() {
@@ -121932,7 +120267,7 @@ function requireCjs$1() {
121932
120267
  var _sweeplineintersections = require$$1$1;
121933
120268
  var _sweeplineintersections2 = _interopRequireDefault(_sweeplineintersections);
121934
120269
  var sweeplineIntersections2 = _sweeplineintersections2.default;
121935
- function lineIntersect2(line1, line2, options = {}) {
120270
+ function lineIntersect(line1, line2, options = {}) {
121936
120271
  const { removeDuplicates = true, ignoreSelfIntersections = true } = options;
121937
120272
  let features = [];
121938
120273
  if (line1.type === "FeatureCollection")
@@ -121966,9 +120301,9 @@ function requireCjs$1() {
121966
120301
  }
121967
120302
  return _helpers.featureCollection.call(void 0, results.map((r2) => _helpers.point.call(void 0, r2)));
121968
120303
  }
121969
- var turf_line_intersect_default = lineIntersect2;
120304
+ var turf_line_intersect_default = lineIntersect;
121970
120305
  cjs$1.default = turf_line_intersect_default;
121971
- cjs$1.lineIntersect = lineIntersect2;
120306
+ cjs$1.lineIntersect = lineIntersect;
121972
120307
  return cjs$1;
121973
120308
  }
121974
120309
  var hasRequiredSplitPolygonMode;
@@ -125832,8 +124167,8 @@ function requireDraw90degreePolygonMode() {
125832
124167
  return;
125833
124168
  }
125834
124169
  if (clickSequence.length === 3 && tentativeFeature.geometry.type === "LineString") {
125835
- var lineString2 = tentativeFeature.geometry;
125836
- clickSequence[clickSequence.length - 1] = lineString2.coordinates[lineString2.coordinates.length - 1];
124170
+ var lineString = tentativeFeature.geometry;
124171
+ clickSequence[clickSequence.length - 1] = lineString.coordinates[lineString.coordinates.length - 1];
125837
124172
  } else if (clickSequence.length > 3 && tentativeFeature.geometry.type === "Polygon") {
125838
124173
  var polygon2 = tentativeFeature.geometry;
125839
124174
  clickSequence[clickSequence.length - 1] = polygon2.coordinates[0][polygon2.coordinates[0].length - 2];
@@ -131703,12 +130038,12 @@ function requireUtils$1() {
131703
130038
  return false;
131704
130039
  }
131705
130040
  function generatePointsParallelToLinePoints(p1, p2, groundCoords) {
131706
- var lineString2 = {
130041
+ var lineString = {
131707
130042
  type: "LineString",
131708
130043
  coordinates: [p1, p2]
131709
130044
  };
131710
130045
  var pt = (0, _helpers.point)(groundCoords);
131711
- var ddistance = (0, _pointToLineDistance["default"])(pt, lineString2);
130046
+ var ddistance = (0, _pointToLineDistance["default"])(pt, lineString);
131712
130047
  var lineBearing = (0, _bearing["default"])(p1, p2);
131713
130048
  var isPointToLeftOfLine = (groundCoords[0] - p1[0]) * (p2[1] - p1[1]) - (groundCoords[1] - p1[1]) * (p2[0] - p1[0]);
131714
130049
  var orthogonalBearing = isPointToLeftOfLine < 0 ? lineBearing - 90 : lineBearing - 270;
@@ -133376,31 +131711,35 @@ class SelectionLayer extends CompositeLayer {
133376
131711
  const { flipY, obsLayers } = this.props;
133377
131712
  const flippedCoordinates = flipY ? coordinates2.map((poly) => poly.map((p) => [p[0], -p[1]])) : coordinates2;
133378
131713
  const selectedPolygon = polygon(flippedCoordinates);
131714
+ let minX = Infinity;
131715
+ let minY = Infinity;
131716
+ let maxX = -Infinity;
131717
+ let maxY = -Infinity;
131718
+ flippedCoordinates[0].forEach(([x, y]) => {
131719
+ minX = Math.min(minX, x);
131720
+ minY = Math.min(minY, y);
131721
+ maxX = Math.max(maxX, x);
131722
+ maxY = Math.max(maxY, y);
131723
+ });
133379
131724
  obsLayers.forEach((obsLayer) => {
133380
131725
  const { getObsCoords, obsQuadTree, obsIndex, onSelect: layerOnSelect } = obsLayer;
133381
- const pickingInfos = [];
131726
+ const pickingIds = [];
133382
131727
  obsQuadTree?.visit((node2, x02, y02, x12, y12) => {
133383
- const nodePoints = [[[x02, y02], [x12, y02], [x12, y12], [x02, y12], [x02, y02]]];
133384
- const nodePolygon = polygon(nodePoints);
133385
- const nodePolygonContainsSelectedPolygon = booleanContains(nodePolygon, selectedPolygon);
133386
- const nodePolygonWithinSelectedPolygon = booleanWithin(nodePolygon, selectedPolygon);
133387
- const nodePolygonOverlapsSelectedPolgyon = booleanOverlap(nodePolygon, selectedPolygon);
133388
- if (!nodePolygonContainsSelectedPolygon && !nodePolygonWithinSelectedPolygon && !nodePolygonOverlapsSelectedPolgyon) {
131728
+ if (x02 > maxX || y02 > maxY || x12 < minX || y12 < minY) {
133389
131729
  return true;
133390
131730
  }
133391
- if (node2.data) {
131731
+ if (!node2.length) {
133392
131732
  let current = node2;
133393
131733
  while (current) {
133394
- const pointCoords = [].slice.call(getObsCoords(current.data));
133395
- if (booleanPointInPolygon(point(pointCoords), selectedPolygon)) {
133396
- pickingInfos.push(current.data);
131734
+ const [x, y] = getObsCoords(current.data);
131735
+ if (booleanPointInPolygon([x, y], selectedPolygon)) {
131736
+ pickingIds.push(obsIndex[current.data]);
133397
131737
  }
133398
131738
  current = current.next;
133399
131739
  }
133400
131740
  }
133401
131741
  return false;
133402
131742
  });
133403
- const pickingIds = pickingInfos.map((obsI) => obsIndex[obsI]);
133404
131743
  layerOnSelect(pickingIds);
133405
131744
  });
133406
131745
  }
@@ -135256,22 +133595,22 @@ async function getDecoder(fileDirectory) {
135256
133595
  const Decoder = await importFn();
135257
133596
  return new Decoder(fileDirectory);
135258
133597
  }
135259
- addDecoder([void 0, 1], () => import("./raw-DrKGleEE.js").then((m) => m.default));
135260
- addDecoder(5, () => import("./lzw-Cn4MHMg0.js").then((m) => m.default));
133598
+ addDecoder([void 0, 1], () => import("./raw-C41mEEq1.js").then((m) => m.default));
133599
+ addDecoder(5, () => import("./lzw-DY9PEFkn.js").then((m) => m.default));
135261
133600
  addDecoder(6, () => {
135262
133601
  throw new Error("old style JPEG compression is not supported.");
135263
133602
  });
135264
- addDecoder(7, () => import("./jpeg-DYOBxHhT.js").then((m) => m.default));
135265
- addDecoder([8, 32946], () => import("./deflate-B9yQXNA5.js").then((m) => m.default));
135266
- addDecoder(32773, () => import("./packbits-3K31MqMe.js").then((m) => m.default));
133603
+ addDecoder(7, () => import("./jpeg-548JNFXA.js").then((m) => m.default));
133604
+ addDecoder([8, 32946], () => import("./deflate-CqUjMell.js").then((m) => m.default));
133605
+ addDecoder(32773, () => import("./packbits-Dhy4-kGH.js").then((m) => m.default));
135267
133606
  addDecoder(
135268
133607
  34887,
135269
- () => import("./lerc-CXBCb2wB.js").then(async (m) => {
133608
+ () => import("./lerc-BWRR_ELq.js").then(async (m) => {
135270
133609
  await m.zstd.init();
135271
133610
  return m;
135272
133611
  }).then((m) => m.default)
135273
133612
  );
135274
- addDecoder(50001, () => import("./webimage-MBv_oDxF.js").then((m) => m.default));
133613
+ addDecoder(50001, () => import("./webimage-BWnXHQIU.js").then((m) => m.default));
135275
133614
  function copyNewSize(array, width, height, samplesPerPixel = 1) {
135276
133615
  return new (Object.getPrototypeOf(array)).constructor(width * height * samplesPerPixel);
135277
133616
  }
@@ -137706,26 +136045,26 @@ class GeoTIFFBase {
137706
136045
  */
137707
136046
  async readRasters(options = {}) {
137708
136047
  const { window: imageWindow, width, height } = options;
137709
- let { resX, resY, bbox: bbox2 } = options;
136048
+ let { resX, resY, bbox } = options;
137710
136049
  const firstImage = await this.getImage();
137711
136050
  let usedImage = firstImage;
137712
136051
  const imageCount = await this.getImageCount();
137713
136052
  const imgBBox = firstImage.getBoundingBox();
137714
- if (imageWindow && bbox2) {
136053
+ if (imageWindow && bbox) {
137715
136054
  throw new Error('Both "bbox" and "window" passed.');
137716
136055
  }
137717
136056
  if (width || height) {
137718
136057
  if (imageWindow) {
137719
136058
  const [oX, oY] = firstImage.getOrigin();
137720
136059
  const [rX, rY] = firstImage.getResolution();
137721
- bbox2 = [
136060
+ bbox = [
137722
136061
  oX + imageWindow[0] * rX,
137723
136062
  oY + imageWindow[1] * rY,
137724
136063
  oX + imageWindow[2] * rX,
137725
136064
  oY + imageWindow[3] * rY
137726
136065
  ];
137727
136066
  }
137728
- const usedBBox = bbox2 || imgBBox;
136067
+ const usedBBox = bbox || imgBBox;
137729
136068
  if (width) {
137730
136069
  if (resX) {
137731
136070
  throw new Error("Both width and resX passed");
@@ -137760,14 +136099,14 @@ class GeoTIFFBase {
137760
136099
  }
137761
136100
  }
137762
136101
  let wnd = imageWindow;
137763
- if (bbox2) {
136102
+ if (bbox) {
137764
136103
  const [oX, oY] = firstImage.getOrigin();
137765
136104
  const [imageResX, imageResY] = usedImage.getResolution(firstImage);
137766
136105
  wnd = [
137767
- Math.round((bbox2[0] - oX) / imageResX),
137768
- Math.round((bbox2[1] - oY) / imageResY),
137769
- Math.round((bbox2[2] - oX) / imageResX),
137770
- Math.round((bbox2[3] - oY) / imageResY)
136106
+ Math.round((bbox[0] - oX) / imageResX),
136107
+ Math.round((bbox[1] - oY) / imageResY),
136108
+ Math.round((bbox[2] - oX) / imageResX),
136109
+ Math.round((bbox[3] - oY) / imageResY)
137771
136110
  ];
137772
136111
  wnd = [
137773
136112
  Math.min(wnd[0], wnd[2]),
@@ -138077,6 +136416,50 @@ async function N(A2, I2) {
138077
136416
  if (0 === g2.length) throw Error("Failed to decode with LZW decoder.");
138078
136417
  return g2;
138079
136418
  }
136419
+ function quickselect(arr, k, left, right, compare2) {
136420
+ quickselectStep(arr, k, left || 0, right || arr.length - 1, defaultCompare);
136421
+ }
136422
+ function quickselectStep(arr, k, left, right, compare2) {
136423
+ while (right > left) {
136424
+ if (right - left > 600) {
136425
+ var n3 = right - left + 1;
136426
+ var m = k - left + 1;
136427
+ var z2 = Math.log(n3);
136428
+ var s2 = 0.5 * Math.exp(2 * z2 / 3);
136429
+ var sd = 0.5 * Math.sqrt(z2 * s2 * (n3 - s2) / n3) * (m - n3 / 2 < 0 ? -1 : 1);
136430
+ var newLeft = Math.max(left, Math.floor(k - m * s2 / n3 + sd));
136431
+ var newRight = Math.min(right, Math.floor(k + (n3 - m) * s2 / n3 + sd));
136432
+ quickselectStep(arr, k, newLeft, newRight, compare2);
136433
+ }
136434
+ var t = arr[k];
136435
+ var i2 = left;
136436
+ var j = right;
136437
+ swap(arr, left, k);
136438
+ if (compare2(arr[right], t) > 0) swap(arr, left, right);
136439
+ while (i2 < j) {
136440
+ swap(arr, i2, j);
136441
+ i2++;
136442
+ j--;
136443
+ while (compare2(arr[i2], t) < 0) i2++;
136444
+ while (compare2(arr[j], t) > 0) j--;
136445
+ }
136446
+ if (compare2(arr[left], t) === 0) swap(arr, left, j);
136447
+ else {
136448
+ j++;
136449
+ swap(arr, j, right);
136450
+ }
136451
+ if (j <= k) left = j + 1;
136452
+ if (k <= j) right = j - 1;
136453
+ }
136454
+ }
136455
+ function swap(arr, i2, j) {
136456
+ var tmp = arr[i2];
136457
+ arr[i2] = arr[j];
136458
+ arr[j] = tmp;
136459
+ }
136460
+ function defaultCompare(a2, b) {
136461
+ return a2 < b ? -1 : a2 > b ? 1 : 0;
136462
+ }
138080
136463
  const registry = /* @__PURE__ */ new Map();
138081
136464
  function addCodec(id, importFn) {
138082
136465
  registry.set(id, importFn);
@@ -146328,17 +144711,17 @@ function sizeToMeters(size2, unit2) {
146328
144711
  throw new Error("Received unknown unit");
146329
144712
  }
146330
144713
  function snapValue(value) {
146331
- let magnitude2 = 0;
144714
+ let magnitude = 0;
146332
144715
  if (value < MIN_TARGET || value > MAX_TARGET) {
146333
- magnitude2 = Math.floor(Math.log10(value));
144716
+ magnitude = Math.floor(Math.log10(value));
146334
144717
  }
146335
144718
  let snappedUnit = SI_PREFIXES.find(
146336
- (p) => p.exponent % 3 === 0 && p.exponent <= magnitude2
144719
+ (p) => p.exponent % 3 === 0 && p.exponent <= magnitude
146337
144720
  );
146338
144721
  let adjustedValue = value / 10 ** snappedUnit.exponent;
146339
144722
  if (adjustedValue > 500 && adjustedValue <= 1e3) {
146340
144723
  snappedUnit = SI_PREFIXES.find(
146341
- (p) => p.exponent % 3 === 0 && p.exponent <= magnitude2 + 3
144724
+ (p) => p.exponent % 3 === 0 && p.exponent <= magnitude + 3
146342
144725
  );
146343
144726
  adjustedValue = value / 10 ** snappedUnit.exponent;
146344
144727
  }
@@ -150730,8 +149113,8 @@ var set = (eps) => {
150730
149113
  };
150731
149114
  };
150732
149115
  var precision = set();
150733
- var isInBbox = (bbox2, point2) => {
150734
- return bbox2.ll.x.isLessThanOrEqualTo(point2.x) && point2.x.isLessThanOrEqualTo(bbox2.ur.x) && bbox2.ll.y.isLessThanOrEqualTo(point2.y) && point2.y.isLessThanOrEqualTo(bbox2.ur.y);
149116
+ var isInBbox = (bbox, point2) => {
149117
+ return bbox.ll.x.isLessThanOrEqualTo(point2.x) && point2.x.isLessThanOrEqualTo(bbox.ur.x) && bbox.ll.y.isLessThanOrEqualTo(point2.y) && point2.y.isLessThanOrEqualTo(bbox.ur.y);
150735
149118
  };
150736
149119
  var getBboxOverlap = (b1, b2) => {
150737
149120
  if (b2.ur.x.isLessThan(b1.ll.x) || b1.ur.x.isLessThan(b2.ll.x) || b2.ur.y.isLessThan(b1.ll.y) || b1.ur.y.isLessThan(b2.ll.y))
@@ -151831,6 +150214,19 @@ function ringArea(coords) {
151831
150214
  }
151832
150215
  return total * FACTOR;
151833
150216
  }
150217
+ function distance(from, to, options = {}) {
150218
+ var coordinates1 = getCoord(from);
150219
+ var coordinates2 = getCoord(to);
150220
+ var dLat = degreesToRadians(coordinates2[1] - coordinates1[1]);
150221
+ var dLon = degreesToRadians(coordinates2[0] - coordinates1[0]);
150222
+ var lat1 = degreesToRadians(coordinates1[1]);
150223
+ var lat2 = degreesToRadians(coordinates2[1]);
150224
+ var a2 = Math.pow(Math.sin(dLat / 2), 2) + Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);
150225
+ return radiansToLength(
150226
+ 2 * Math.atan2(Math.sqrt(a2), Math.sqrt(1 - a2)),
150227
+ options.units
150228
+ );
150229
+ }
151834
150230
  const DEFAULT_THRESHOLD = 1;
151835
150231
  const defaultProps$1 = {
151836
150232
  // for text
@@ -151927,7 +150323,7 @@ class ContourLayerWithText extends ContourLayer {
151927
150323
  const circlePoint = point(circleCoord);
151928
150324
  polygonVertices.forEach((polyCoord) => {
151929
150325
  const polyPoint = point(polyCoord);
151930
- const dist2 = distance$1(circlePoint, polyPoint);
150326
+ const dist2 = distance(circlePoint, polyPoint);
151931
150327
  if (dist2 < minDist) {
151932
150328
  minDist = dist2;
151933
150329
  minCirclePoint = circleCoord;
@@ -152400,10 +150796,8 @@ function createAnnotationLayers(shapes = [], zoom = 0, selectedShapeUid = null,
152400
150796
  getLineColor: strokeColor,
152401
150797
  getLineWidth: strokeWidth,
152402
150798
  lineWidthUnits: "pixels",
152403
- ...dashArray ? {
152404
- extensions: [new PathStyleExtension({ dash: true })],
152405
- getDashArray: dashArray
152406
- } : {}
150799
+ extensions: dashExt,
150800
+ getDashArray: getDash
152407
150801
  }));
152408
150802
  if (shape.text && labelOpacity > 0) {
152409
150803
  layers.push(new TextLayer({
@@ -152438,8 +150832,8 @@ function createAnnotationLayers(shapes = [], zoom = 0, selectedShapeUid = null,
152438
150832
  layers.push(new PathLayer({
152439
150833
  ...base,
152440
150834
  id: `annotation-line-${uid2}-${i2}`,
152441
- extensions: [new PathStyleExtension({ dash: true })],
152442
- getDashArray: dashArray ?? [0, 0],
150835
+ extensions: dashExt,
150836
+ getDashArray: getDash,
152443
150837
  data: [{ path: [[srcX, srcY], [tgtX, tgtY]] }],
152444
150838
  getPath: (d) => d.path,
152445
150839
  getColor: strokeColor,
@@ -152587,10 +150981,8 @@ function createAnnotationLayers(shapes = [], zoom = 0, selectedShapeUid = null,
152587
150981
  getLineColor: strokeColor,
152588
150982
  getLineWidth: strokeWidth,
152589
150983
  lineWidthUnits: "pixels",
152590
- ...dashArray ? {
152591
- extensions: [new PathStyleExtension({ dash: true })],
152592
- getDashArray: dashArray
152593
- } : {}
150984
+ extensions: dashExt,
150985
+ getDashArray: getDash
152594
150986
  }));
152595
150987
  if (shape.text && labelOpacity > 0) {
152596
150988
  layers.push(new TextLayer({