@maptiler/geocoding-control 2.0.0-rc.6 → 2.0.0-rc.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/MapLibreBasedGeocodingControl.d.ts +1 -18
  2. package/leaflet-controller.d.ts +2 -3
  3. package/leaflet-controller.js +450 -453
  4. package/leaflet-controller.js.map +1 -1
  5. package/leaflet-controller.umd.js +3 -3
  6. package/leaflet-controller.umd.js.map +1 -1
  7. package/leaflet.js +1010 -1015
  8. package/leaflet.js.map +1 -1
  9. package/leaflet.umd.js +3 -3
  10. package/leaflet.umd.js.map +1 -1
  11. package/maplibregl-controller.d.ts +2 -3
  12. package/maplibregl-controller.js +140 -143
  13. package/maplibregl-controller.js.map +1 -1
  14. package/maplibregl-controller.umd.js +2 -2
  15. package/maplibregl-controller.umd.js.map +1 -1
  16. package/maplibregl.d.ts +0 -17
  17. package/maplibregl.js +1698 -1705
  18. package/maplibregl.js.map +1 -1
  19. package/maplibregl.umd.js +3 -3
  20. package/maplibregl.umd.js.map +1 -1
  21. package/maptilersdk.d.ts +0 -17
  22. package/maptilersdk.js +1695 -1702
  23. package/maptilersdk.js.map +1 -1
  24. package/maptilersdk.umd.js +3 -3
  25. package/maptilersdk.umd.js.map +1 -1
  26. package/openlayers-controller.d.ts +2 -3
  27. package/openlayers-controller.js +366 -369
  28. package/openlayers-controller.js.map +1 -1
  29. package/openlayers-controller.umd.js +3 -3
  30. package/openlayers-controller.umd.js.map +1 -1
  31. package/openlayers.js +1084 -1088
  32. package/openlayers.js.map +1 -1
  33. package/openlayers.umd.js +3 -3
  34. package/openlayers.umd.js.map +1 -1
  35. package/package.json +1 -1
  36. package/react.js +739 -737
  37. package/react.js.map +1 -1
  38. package/react.umd.js +1 -1
  39. package/react.umd.js.map +1 -1
  40. package/svelte/GeocodingControl.svelte +7 -5
  41. package/svelte/MapLibreBasedGeocodingControl.d.ts +1 -18
  42. package/svelte/MapLibreBasedGeocodingControl.js +1 -6
  43. package/svelte/leaflet-controller.d.ts +2 -3
  44. package/svelte/leaflet-controller.js +3 -7
  45. package/svelte/leaflet.js +1 -6
  46. package/svelte/maplibregl-controller.d.ts +2 -3
  47. package/svelte/maplibregl-controller.js +3 -7
  48. package/svelte/maplibregl.d.ts +0 -17
  49. package/svelte/maptilersdk.d.ts +0 -17
  50. package/svelte/openlayers-controller.d.ts +2 -3
  51. package/svelte/openlayers-controller.js +3 -7
  52. package/svelte/openlayers.js +1 -4
  53. package/svelte/types.d.ts +1 -2
  54. package/types.d.ts +1 -2
  55. package/vanilla.js +760 -758
  56. package/vanilla.js.map +1 -1
  57. package/vanilla.umd.js +1 -1
  58. package/vanilla.umd.js.map +1 -1
@@ -35,82 +35,82 @@ function Ut(r, t, e = {}) {
35
35
  }
36
36
  function Yt(r, t, e) {
37
37
  if (r !== null)
38
- for (var n, i, o, f, s, c, u, g = 0, l = 0, h, a = r.type, x = a === "FeatureCollection", p = a === "Feature", y = x ? r.features.length : 1, d = 0; d < y; d++) {
39
- u = x ? r.features[d].geometry : p ? r.geometry : r, h = u ? u.type === "GeometryCollection" : !1, s = h ? u.geometries.length : 1;
40
- for (var v = 0; v < s; v++) {
41
- var w = 0, m = 0;
42
- if (f = h ? u.geometries[v] : u, f !== null) {
43
- c = f.coordinates;
44
- var E = f.type;
45
- switch (g = 0, E) {
38
+ for (var n, i, o, u, l, c, f, p = 0, s = 0, a, h = r.type, g = h === "FeatureCollection", d = h === "Feature", w = g ? r.features.length : 1, y = 0; y < w; y++) {
39
+ f = g ? r.features[y].geometry : d ? r.geometry : r, a = f ? f.type === "GeometryCollection" : !1, l = a ? f.geometries.length : 1;
40
+ for (var v = 0; v < l; v++) {
41
+ var x = 0, m = 0;
42
+ if (u = a ? f.geometries[v] : f, u !== null) {
43
+ c = u.coordinates;
44
+ var E = u.type;
45
+ switch (p = 0, E) {
46
46
  case null:
47
47
  break;
48
48
  case "Point":
49
49
  if (t(
50
50
  c,
51
- l,
52
- d,
53
- w,
51
+ s,
52
+ y,
53
+ x,
54
54
  m
55
55
  ) === !1)
56
56
  return !1;
57
- l++, w++;
57
+ s++, x++;
58
58
  break;
59
59
  case "LineString":
60
60
  case "MultiPoint":
61
61
  for (n = 0; n < c.length; n++) {
62
62
  if (t(
63
63
  c[n],
64
- l,
65
- d,
66
- w,
64
+ s,
65
+ y,
66
+ x,
67
67
  m
68
68
  ) === !1)
69
69
  return !1;
70
- l++, E === "MultiPoint" && w++;
70
+ s++, E === "MultiPoint" && x++;
71
71
  }
72
- E === "LineString" && w++;
72
+ E === "LineString" && x++;
73
73
  break;
74
74
  case "Polygon":
75
75
  case "MultiLineString":
76
76
  for (n = 0; n < c.length; n++) {
77
- for (i = 0; i < c[n].length - g; i++) {
77
+ for (i = 0; i < c[n].length - p; i++) {
78
78
  if (t(
79
79
  c[n][i],
80
- l,
81
- d,
82
- w,
80
+ s,
81
+ y,
82
+ x,
83
83
  m
84
84
  ) === !1)
85
85
  return !1;
86
- l++;
86
+ s++;
87
87
  }
88
- E === "MultiLineString" && w++, E === "Polygon" && m++;
88
+ E === "MultiLineString" && x++, E === "Polygon" && m++;
89
89
  }
90
- E === "Polygon" && w++;
90
+ E === "Polygon" && x++;
91
91
  break;
92
92
  case "MultiPolygon":
93
93
  for (n = 0; n < c.length; n++) {
94
94
  for (m = 0, i = 0; i < c[n].length; i++) {
95
- for (o = 0; o < c[n][i].length - g; o++) {
95
+ for (o = 0; o < c[n][i].length - p; o++) {
96
96
  if (t(
97
97
  c[n][i][o],
98
- l,
99
- d,
100
- w,
98
+ s,
99
+ y,
100
+ x,
101
101
  m
102
102
  ) === !1)
103
103
  return !1;
104
- l++;
104
+ s++;
105
105
  }
106
106
  m++;
107
107
  }
108
- w++;
108
+ x++;
109
109
  }
110
110
  break;
111
111
  case "GeometryCollection":
112
- for (n = 0; n < f.geometries.length; n++)
113
- if (Yt(f.geometries[n], t) === !1)
112
+ for (n = 0; n < u.geometries.length; n++)
113
+ if (Yt(u.geometries[n], t) === !1)
114
114
  return !1;
115
115
  break;
116
116
  default:
@@ -121,16 +121,16 @@ function Yt(r, t, e) {
121
121
  }
122
122
  }
123
123
  function vt(r, t) {
124
- var e, n, i, o, f, s, c, u, g, l, h = 0, a = r.type === "FeatureCollection", x = r.type === "Feature", p = a ? r.features.length : 1;
125
- for (e = 0; e < p; e++) {
126
- for (s = a ? r.features[e].geometry : x ? r.geometry : r, u = a ? r.features[e].properties : x ? r.properties : {}, g = a ? r.features[e].bbox : x ? r.bbox : void 0, l = a ? r.features[e].id : x ? r.id : void 0, c = s ? s.type === "GeometryCollection" : !1, f = c ? s.geometries.length : 1, i = 0; i < f; i++) {
127
- if (o = c ? s.geometries[i] : s, o === null) {
124
+ var e, n, i, o, u, l, c, f, p, s, a = 0, h = r.type === "FeatureCollection", g = r.type === "Feature", d = h ? r.features.length : 1;
125
+ for (e = 0; e < d; e++) {
126
+ for (l = h ? r.features[e].geometry : g ? r.geometry : r, f = h ? r.features[e].properties : g ? r.properties : {}, p = h ? r.features[e].bbox : g ? r.bbox : void 0, s = h ? r.features[e].id : g ? r.id : void 0, c = l ? l.type === "GeometryCollection" : !1, u = c ? l.geometries.length : 1, i = 0; i < u; i++) {
127
+ if (o = c ? l.geometries[i] : l, o === null) {
128
128
  if (t(
129
129
  null,
130
- h,
131
- u,
132
- g,
133
- l
130
+ a,
131
+ f,
132
+ p,
133
+ s
134
134
  ) === !1)
135
135
  return !1;
136
136
  continue;
@@ -144,10 +144,10 @@ function vt(r, t) {
144
144
  case "MultiPolygon": {
145
145
  if (t(
146
146
  o,
147
- h,
148
- u,
149
- g,
150
- l
147
+ a,
148
+ f,
149
+ p,
150
+ s
151
151
  ) === !1)
152
152
  return !1;
153
153
  break;
@@ -156,10 +156,10 @@ function vt(r, t) {
156
156
  for (n = 0; n < o.geometries.length; n++)
157
157
  if (t(
158
158
  o.geometries[n],
159
- h,
160
- u,
161
- g,
162
- l
159
+ a,
160
+ f,
161
+ p,
162
+ s
163
163
  ) === !1)
164
164
  return !1;
165
165
  break;
@@ -168,25 +168,25 @@ function vt(r, t) {
168
168
  throw new Error("Unknown Geometry Type");
169
169
  }
170
170
  }
171
- h++;
171
+ a++;
172
172
  }
173
173
  }
174
174
  function se(r, t) {
175
- vt(r, function(e, n, i, o, f) {
176
- var s = e === null ? null : e.type;
177
- switch (s) {
175
+ vt(r, function(e, n, i, o, u) {
176
+ var l = e === null ? null : e.type;
177
+ switch (l) {
178
178
  case null:
179
179
  case "Point":
180
180
  case "LineString":
181
181
  case "Polygon":
182
182
  return t(
183
- V(e, i, { bbox: o, id: f }),
183
+ V(e, i, { bbox: o, id: u }),
184
184
  n,
185
185
  0
186
186
  ) === !1 ? !1 : void 0;
187
187
  }
188
188
  var c;
189
- switch (s) {
189
+ switch (l) {
190
190
  case "MultiPoint":
191
191
  c = "Point";
192
192
  break;
@@ -197,12 +197,12 @@ function se(r, t) {
197
197
  c = "Polygon";
198
198
  break;
199
199
  }
200
- for (var u = 0; u < e.coordinates.length; u++) {
201
- var g = e.coordinates[u], l = {
200
+ for (var f = 0; f < e.coordinates.length; f++) {
201
+ var p = e.coordinates[f], s = {
202
202
  type: c,
203
- coordinates: g
203
+ coordinates: p
204
204
  };
205
- if (t(V(l, i), n, u) === !1)
205
+ if (t(V(s, i), n, f) === !1)
206
206
  return !1;
207
207
  }
208
208
  });
@@ -303,60 +303,60 @@ function he(r, t) {
303
303
  var e = { label: 0, sent: function() {
304
304
  if (o[0] & 1) throw o[1];
305
305
  return o[1];
306
- }, trys: [], ops: [] }, n, i, o, f;
307
- return f = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
306
+ }, trys: [], ops: [] }, n, i, o, u;
307
+ return u = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
308
308
  return this;
309
- }), f;
310
- function s(u) {
311
- return function(g) {
312
- return c([u, g]);
309
+ }), u;
310
+ function l(f) {
311
+ return function(p) {
312
+ return c([f, p]);
313
313
  };
314
314
  }
315
- function c(u) {
315
+ function c(f) {
316
316
  if (n) throw new TypeError("Generator is already executing.");
317
317
  for (; e; ) try {
318
- if (n = 1, i && (o = u[0] & 2 ? i.return : u[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, u[1])).done) return o;
319
- switch (i = 0, o && (u = [u[0] & 2, o.value]), u[0]) {
318
+ if (n = 1, i && (o = f[0] & 2 ? i.return : f[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, f[1])).done) return o;
319
+ switch (i = 0, o && (f = [f[0] & 2, o.value]), f[0]) {
320
320
  case 0:
321
321
  case 1:
322
- o = u;
322
+ o = f;
323
323
  break;
324
324
  case 4:
325
- return e.label++, { value: u[1], done: !1 };
325
+ return e.label++, { value: f[1], done: !1 };
326
326
  case 5:
327
- e.label++, i = u[1], u = [0];
327
+ e.label++, i = f[1], f = [0];
328
328
  continue;
329
329
  case 7:
330
- u = e.ops.pop(), e.trys.pop();
330
+ f = e.ops.pop(), e.trys.pop();
331
331
  continue;
332
332
  default:
333
- if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) {
333
+ if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (f[0] === 6 || f[0] === 2)) {
334
334
  e = 0;
335
335
  continue;
336
336
  }
337
- if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) {
338
- e.label = u[1];
337
+ if (f[0] === 3 && (!o || f[1] > o[0] && f[1] < o[3])) {
338
+ e.label = f[1];
339
339
  break;
340
340
  }
341
- if (u[0] === 6 && e.label < o[1]) {
342
- e.label = o[1], o = u;
341
+ if (f[0] === 6 && e.label < o[1]) {
342
+ e.label = o[1], o = f;
343
343
  break;
344
344
  }
345
345
  if (o && e.label < o[2]) {
346
- e.label = o[2], e.ops.push(u);
346
+ e.label = o[2], e.ops.push(f);
347
347
  break;
348
348
  }
349
349
  o[2] && e.ops.pop(), e.trys.pop();
350
350
  continue;
351
351
  }
352
- u = t.call(r, e);
353
- } catch (g) {
354
- u = [6, g], i = 0;
352
+ f = t.call(r, e);
353
+ } catch (p) {
354
+ f = [6, p], i = 0;
355
355
  } finally {
356
356
  n = o = 0;
357
357
  }
358
- if (u[0] & 5) throw u[1];
359
- return { value: u[0] ? u[1] : void 0, done: !0 };
358
+ if (f[0] & 5) throw f[1];
359
+ return { value: f[0] ? f[1] : void 0, done: !0 };
360
360
  }
361
361
  }
362
362
  var F = (
@@ -373,22 +373,22 @@ function ae(r, t) {
373
373
  }
374
374
  function B(r, t, e) {
375
375
  for (var n = new F(null, null), i = n, o = n; ; ) {
376
- var f = e(r, t.key);
377
- if (f < 0) {
376
+ var u = e(r, t.key);
377
+ if (u < 0) {
378
378
  if (t.left === null)
379
379
  break;
380
380
  if (e(r, t.left.key) < 0) {
381
- var s = t.left;
382
- if (t.left = s.right, s.right = t, t = s, t.left === null)
381
+ var l = t.left;
382
+ if (t.left = l.right, l.right = t, t = l, t.left === null)
383
383
  break;
384
384
  }
385
385
  o.left = t, o = t, t = t.left;
386
- } else if (f > 0) {
386
+ } else if (u > 0) {
387
387
  if (t.right === null)
388
388
  break;
389
389
  if (e(r, t.right.key) > 0) {
390
- var s = t.right;
391
- if (t.right = s.left, s.left = t, t = s, t.right === null)
390
+ var l = t.right;
391
+ if (t.right = l.left, l.left = t, t = l, t.right === null)
392
392
  break;
393
393
  }
394
394
  i.right = t, i = t, t = t.right;
@@ -414,7 +414,7 @@ function bt(r, t, e) {
414
414
  }
415
415
  return { left: n, right: i };
416
416
  }
417
- function ge(r, t, e) {
417
+ function pe(r, t, e) {
418
418
  return t === null ? r : (r === null || (t = B(r.key, t, e), t.left = r), t);
419
419
  }
420
420
  function ft(r, t, e, n, i) {
@@ -436,8 +436,8 @@ var wt = (
436
436
  }, r.prototype.add = function(t, e) {
437
437
  var n = new F(t, e);
438
438
  this._root === null && (n.left = n.right = null, this._size++, this._root = n);
439
- var i = this._comparator, o = B(t, this._root, i), f = i(t, o.key);
440
- return f === 0 ? this._root = o : (f < 0 ? (n.left = o.left, n.right = o, o.left = null) : f > 0 && (n.right = o.right, n.left = o, o.right = null), this._size++, this._root = n), this._root;
439
+ var i = this._comparator, o = B(t, this._root, i), u = i(t, o.key);
440
+ return u === 0 ? this._root = o : (u < 0 ? (n.left = o.left, n.right = o, o.left = null) : u > 0 && (n.right = o.right, n.left = o, o.right = null), this._size++, this._root = n), this._root;
441
441
  }, r.prototype.remove = function(t) {
442
442
  this._root = this._remove(t, this._root, this._comparator);
443
443
  }, r.prototype._remove = function(t, e, n) {
@@ -478,15 +478,15 @@ var wt = (
478
478
  n !== null ? (i.push(n), n = n.left) : i.length !== 0 ? (n = i.pop(), t.call(e, n), n = n.right) : o = !0;
479
479
  return this;
480
480
  }, r.prototype.range = function(t, e, n, i) {
481
- for (var o = [], f = this._comparator, s = this._root, c; o.length !== 0 || s; )
482
- if (s)
483
- o.push(s), s = s.left;
481
+ for (var o = [], u = this._comparator, l = this._root, c; o.length !== 0 || l; )
482
+ if (l)
483
+ o.push(l), l = l.left;
484
484
  else {
485
- if (s = o.pop(), c = f(s.key, e), c > 0)
485
+ if (l = o.pop(), c = u(l.key, e), c > 0)
486
486
  break;
487
- if (f(s.key, t) >= 0 && n.call(i, s))
487
+ if (u(l.key, t) >= 0 && n.call(i, l))
488
488
  return this;
489
- s = s.right;
489
+ l = l.right;
490
490
  }
491
491
  return this;
492
492
  }, r.prototype.keys = function() {
@@ -564,8 +564,8 @@ var wt = (
564
564
  if (n && at(t, e, 0, i - 1, o), this._root === null)
565
565
  this._root = ct(t, e, 0, i), this._size = i;
566
566
  else {
567
- var f = de(this.toList(), pe(t, e), o);
568
- i = this._size + i, this._root = ht({ head: f }, 0, i);
567
+ var u = de(this.toList(), ge(t, e), o);
568
+ i = this._size + i, this._root = ht({ head: u }, 0, i);
569
569
  }
570
570
  return this;
571
571
  }, r.prototype.isEmpty = function() {
@@ -591,8 +591,8 @@ var wt = (
591
591
  return e.push(n);
592
592
  }, t), e.join("");
593
593
  }, r.prototype.update = function(t, e, n) {
594
- var i = this._comparator, o = bt(t, this._root, i), f = o.left, s = o.right;
595
- i(t, e) < 0 ? s = ot(e, n, s, i) : f = ot(e, n, f, i), this._root = ge(f, s, i);
594
+ var i = this._comparator, o = bt(t, this._root, i), u = o.left, l = o.right;
595
+ i(t, e) < 0 ? l = ot(e, n, l, i) : u = ot(e, n, u, i), this._root = pe(u, l, i);
596
596
  }, r.prototype.split = function(t) {
597
597
  return bt(t, this._root, this._comparator);
598
598
  }, r.prototype[Symbol.iterator] = function() {
@@ -624,12 +624,12 @@ var wt = (
624
624
  function ct(r, t, e, n) {
625
625
  var i = n - e;
626
626
  if (i > 0) {
627
- var o = e + Math.floor(i / 2), f = r[o], s = t[o], c = new F(f, s);
627
+ var o = e + Math.floor(i / 2), u = r[o], l = t[o], c = new F(u, l);
628
628
  return c.left = ct(r, t, e, o), c.right = ct(r, t, o + 1, n), c;
629
629
  }
630
630
  return null;
631
631
  }
632
- function pe(r, t) {
632
+ function ge(r, t) {
633
633
  for (var e = new F(null, null), n = e, i = 0; i < r.length; i++)
634
634
  n = n.next = new F(r[i], t[i]);
635
635
  return n.next = null, e.next;
@@ -642,46 +642,46 @@ function ye(r) {
642
642
  function ht(r, t, e) {
643
643
  var n = e - t;
644
644
  if (n > 0) {
645
- var i = t + Math.floor(n / 2), o = ht(r, t, i), f = r.head;
646
- return f.left = o, r.head = r.head.next, f.right = ht(r, i + 1, e), f;
645
+ var i = t + Math.floor(n / 2), o = ht(r, t, i), u = r.head;
646
+ return u.left = o, r.head = r.head.next, u.right = ht(r, i + 1, e), u;
647
647
  }
648
648
  return null;
649
649
  }
650
650
  function de(r, t, e) {
651
- for (var n = new F(null, null), i = n, o = r, f = t; o !== null && f !== null; )
652
- e(o.key, f.key) < 0 ? (i.next = o, o = o.next) : (i.next = f, f = f.next), i = i.next;
653
- return o !== null ? i.next = o : f !== null && (i.next = f), n.next;
651
+ for (var n = new F(null, null), i = n, o = r, u = t; o !== null && u !== null; )
652
+ e(o.key, u.key) < 0 ? (i.next = o, o = o.next) : (i.next = u, u = u.next), i = i.next;
653
+ return o !== null ? i.next = o : u !== null && (i.next = u), n.next;
654
654
  }
655
655
  function at(r, t, e, n, i) {
656
656
  if (!(e >= n)) {
657
- for (var o = r[e + n >> 1], f = e - 1, s = n + 1; ; ) {
657
+ for (var o = r[e + n >> 1], u = e - 1, l = n + 1; ; ) {
658
658
  do
659
- f++;
660
- while (i(r[f], o) < 0);
659
+ u++;
660
+ while (i(r[u], o) < 0);
661
661
  do
662
- s--;
663
- while (i(r[s], o) > 0);
664
- if (f >= s)
662
+ l--;
663
+ while (i(r[l], o) > 0);
664
+ if (u >= l)
665
665
  break;
666
- var c = r[f];
667
- r[f] = r[s], r[s] = c, c = t[f], t[f] = t[s], t[s] = c;
666
+ var c = r[u];
667
+ r[u] = r[l], r[l] = c, c = t[u], t[u] = t[l], t[l] = c;
668
668
  }
669
- at(r, t, e, s, i), at(r, t, s + 1, n, i);
669
+ at(r, t, e, l, i), at(r, t, l + 1, n, i);
670
670
  }
671
671
  }
672
672
  const O = 11102230246251565e-32, S = 134217729, xe = (3 + 8 * O) * O;
673
673
  function st(r, t, e, n, i) {
674
- let o, f, s, c, u = t[0], g = n[0], l = 0, h = 0;
675
- g > u == g > -u ? (o = u, u = t[++l]) : (o = g, g = n[++h]);
676
- let a = 0;
677
- if (l < r && h < e)
678
- for (g > u == g > -u ? (f = u + o, s = o - (f - u), u = t[++l]) : (f = g + o, s = o - (f - g), g = n[++h]), o = f, s !== 0 && (i[a++] = s); l < r && h < e; )
679
- g > u == g > -u ? (f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l]) : (f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h]), o = f, s !== 0 && (i[a++] = s);
680
- for (; l < r; )
681
- f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l], o = f, s !== 0 && (i[a++] = s);
682
- for (; h < e; )
683
- f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h], o = f, s !== 0 && (i[a++] = s);
684
- return (o !== 0 || a === 0) && (i[a++] = o), a;
674
+ let o, u, l, c, f = t[0], p = n[0], s = 0, a = 0;
675
+ p > f == p > -f ? (o = f, f = t[++s]) : (o = p, p = n[++a]);
676
+ let h = 0;
677
+ if (s < r && a < e)
678
+ for (p > f == p > -f ? (u = f + o, l = o - (u - f), f = t[++s]) : (u = p + o, l = o - (u - p), p = n[++a]), o = u, l !== 0 && (i[h++] = l); s < r && a < e; )
679
+ p > f == p > -f ? (u = o + f, c = u - o, l = o - (u - c) + (f - c), f = t[++s]) : (u = o + p, c = u - o, l = o - (u - c) + (p - c), p = n[++a]), o = u, l !== 0 && (i[h++] = l);
680
+ for (; s < r; )
681
+ u = o + f, c = u - o, l = o - (u - c) + (f - c), f = t[++s], o = u, l !== 0 && (i[h++] = l);
682
+ for (; a < e; )
683
+ u = o + p, c = u - o, l = o - (u - c) + (p - c), p = n[++a], o = u, l !== 0 && (i[h++] = l);
684
+ return (o !== 0 || h === 0) && (i[h++] = o), h;
685
685
  }
686
686
  function ve(r, t) {
687
687
  let e = t[0];
@@ -692,25 +692,25 @@ function K(r) {
692
692
  return new Float64Array(r);
693
693
  }
694
694
  const me = (3 + 16 * O) * O, we = (2 + 12 * O) * O, Ee = (9 + 64 * O) * O * O, q = K(4), _t = K(8), St = K(12), Pt = K(16), P = K(4);
695
- function be(r, t, e, n, i, o, f) {
696
- let s, c, u, g, l, h, a, x, p, y, d, v, w, m, E, b, M, _;
697
- const C = r - i, R = e - i, I = t - o, k = n - o;
698
- m = C * k, h = S * C, a = h - (h - C), x = C - a, h = S * k, p = h - (h - k), y = k - p, E = x * y - (m - a * p - x * p - a * y), b = I * R, h = S * I, a = h - (h - I), x = I - a, h = S * R, p = h - (h - R), y = R - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, q[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, q[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, q[2] = v - (_ - l) + (d - l), q[3] = _;
699
- let A = ve(4, q), D = we * f;
700
- if (A >= D || -A >= D || (l = r - C, s = r - (C + l) + (l - i), l = e - R, u = e - (R + l) + (l - i), l = t - I, c = t - (I + l) + (l - o), l = n - k, g = n - (k + l) + (l - o), s === 0 && c === 0 && u === 0 && g === 0) || (D = Ee * f + xe * Math.abs(A), A += C * g + k * s - (I * u + R * c), A >= D || -A >= D)) return A;
701
- m = s * k, h = S * s, a = h - (h - s), x = s - a, h = S * k, p = h - (h - k), y = k - p, E = x * y - (m - a * p - x * p - a * y), b = c * R, h = S * c, a = h - (h - c), x = c - a, h = S * R, p = h - (h - R), y = R - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, P[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, P[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, P[2] = v - (_ - l) + (d - l), P[3] = _;
695
+ function be(r, t, e, n, i, o, u) {
696
+ let l, c, f, p, s, a, h, g, d, w, y, v, x, m, E, b, M, _;
697
+ const C = r - i, R = e - i, I = t - o, $ = n - o;
698
+ m = C * $, a = S * C, h = a - (a - C), g = C - h, a = S * $, d = a - (a - $), w = $ - d, E = g * w - (m - h * d - g * d - h * w), b = I * R, a = S * I, h = a - (a - I), g = I - h, a = S * R, d = a - (a - R), w = R - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, q[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, q[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, q[2] = v - (_ - s) + (y - s), q[3] = _;
699
+ let A = ve(4, q), D = we * u;
700
+ if (A >= D || -A >= D || (s = r - C, l = r - (C + s) + (s - i), s = e - R, f = e - (R + s) + (s - i), s = t - I, c = t - (I + s) + (s - o), s = n - $, p = n - ($ + s) + (s - o), l === 0 && c === 0 && f === 0 && p === 0) || (D = Ee * u + xe * Math.abs(A), A += C * p + $ * l - (I * f + R * c), A >= D || -A >= D)) return A;
701
+ m = l * $, a = S * l, h = a - (a - l), g = l - h, a = S * $, d = a - (a - $), w = $ - d, E = g * w - (m - h * d - g * d - h * w), b = c * R, a = S * c, h = a - (a - c), g = c - h, a = S * R, d = a - (a - R), w = R - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, P[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, P[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, P[2] = v - (_ - s) + (y - s), P[3] = _;
702
702
  const ee = st(4, q, 4, P, _t);
703
- m = C * g, h = S * C, a = h - (h - C), x = C - a, h = S * g, p = h - (h - g), y = g - p, E = x * y - (m - a * p - x * p - a * y), b = I * u, h = S * I, a = h - (h - I), x = I - a, h = S * u, p = h - (h - u), y = u - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, P[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, P[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, P[2] = v - (_ - l) + (d - l), P[3] = _;
703
+ m = C * p, a = S * C, h = a - (a - C), g = C - h, a = S * p, d = a - (a - p), w = p - d, E = g * w - (m - h * d - g * d - h * w), b = I * f, a = S * I, h = a - (a - I), g = I - h, a = S * f, d = a - (a - f), w = f - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, P[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, P[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, P[2] = v - (_ - s) + (y - s), P[3] = _;
704
704
  const ne = st(ee, _t, 4, P, St);
705
- m = s * g, h = S * s, a = h - (h - s), x = s - a, h = S * g, p = h - (h - g), y = g - p, E = x * y - (m - a * p - x * p - a * y), b = c * u, h = S * c, a = h - (h - c), x = c - a, h = S * u, p = h - (h - u), y = u - p, M = x * y - (b - a * p - x * p - a * y), d = E - M, l = E - d, P[0] = E - (d + l) + (l - M), v = m + d, l = v - m, w = m - (v - l) + (d - l), d = w - b, l = w - d, P[1] = w - (d + l) + (l - b), _ = v + d, l = _ - v, P[2] = v - (_ - l) + (d - l), P[3] = _;
705
+ m = l * p, a = S * l, h = a - (a - l), g = l - h, a = S * p, d = a - (a - p), w = p - d, E = g * w - (m - h * d - g * d - h * w), b = c * f, a = S * c, h = a - (a - c), g = c - h, a = S * f, d = a - (a - f), w = f - d, M = g * w - (b - h * d - g * d - h * w), y = E - M, s = E - y, P[0] = E - (y + s) + (s - M), v = m + y, s = v - m, x = m - (v - s) + (y - s), y = x - b, s = x - y, P[1] = x - (y + s) + (s - b), _ = v + y, s = _ - v, P[2] = v - (_ - s) + (y - s), P[3] = _;
706
706
  const re = st(ne, St, 4, P, Pt);
707
707
  return Pt[re - 1];
708
708
  }
709
709
  function _e(r, t, e, n, i, o) {
710
- const f = (t - o) * (e - i), s = (r - i) * (n - o), c = f - s, u = Math.abs(f + s);
711
- return Math.abs(c) >= me * u ? c : -be(r, t, e, n, i, o, u);
710
+ const u = (t - o) * (e - i), l = (r - i) * (n - o), c = u - l, f = Math.abs(u + l);
711
+ return Math.abs(c) >= me * f ? c : -be(r, t, e, n, i, o, f);
712
712
  }
713
- const j = (r, t) => r.ll.x <= t.x && t.x <= r.ur.x && r.ll.y <= t.y && t.y <= r.ur.y, gt = (r, t) => {
713
+ const j = (r, t) => r.ll.x <= t.x && t.x <= r.ur.x && r.ll.y <= t.y && t.y <= r.ur.y, pt = (r, t) => {
714
714
  if (t.ur.x < r.ll.x || r.ur.x < t.ll.x || t.ur.y < r.ll.y || r.ur.y < t.ll.y) return null;
715
715
  const e = r.ll.x < t.ll.x ? t.ll.x : r.ll.x, n = r.ur.x < t.ur.x ? r.ur.x : t.ur.x, i = r.ll.y < t.ll.y ? t.ll.y : r.ll.y, o = r.ur.y < t.ur.y ? r.ur.y : t.ur.y;
716
716
  return {
@@ -802,10 +802,10 @@ const J = new Pe(), tt = (r, t) => r.x * t.y - r.y * t.x, Vt = (r, t) => r.x * t
802
802
  const o = {
803
803
  x: e.x - r.x,
804
804
  y: e.y - r.y
805
- }, f = tt(o, t) / i, s = tt(o, n) / i, c = r.x + s * t.x, u = e.x + f * n.x, g = r.y + s * t.y, l = e.y + f * n.y, h = (c + u) / 2, a = (g + l) / 2;
805
+ }, u = tt(o, t) / i, l = tt(o, n) / i, c = r.x + l * t.x, f = e.x + u * n.x, p = r.y + l * t.y, s = e.y + u * n.y, a = (c + f) / 2, h = (p + s) / 2;
806
806
  return {
807
- x: h,
808
- y: a
807
+ x: a,
808
+ y: h
809
809
  };
810
810
  };
811
811
  class L {
@@ -874,13 +874,13 @@ class L {
874
874
  return (i, o) => {
875
875
  e.has(i) || n(i), e.has(o) || n(o);
876
876
  const {
877
- sine: f,
878
- cosine: s
877
+ sine: u,
878
+ cosine: l
879
879
  } = e.get(i), {
880
880
  sine: c,
881
- cosine: u
881
+ cosine: f
882
882
  } = e.get(o);
883
- return f >= 0 && c >= 0 ? s < u ? 1 : s > u ? -1 : 0 : f < 0 && c < 0 ? s < u ? -1 : s > u ? 1 : 0 : c < f ? -1 : c > f ? 1 : 0;
883
+ return u >= 0 && c >= 0 ? l < f ? 1 : l > f ? -1 : 0 : u < 0 && c < 0 ? l < f ? -1 : l > f ? 1 : 0 : c < u ? -1 : c > u ? 1 : 0;
884
884
  };
885
885
  }
886
886
  }
@@ -900,44 +900,44 @@ class z {
900
900
  * is directly on the right-more of the two left inputs.
901
901
  */
902
902
  static compare(t, e) {
903
- const n = t.leftSE.point.x, i = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
904
- if (f < n) return 1;
903
+ const n = t.leftSE.point.x, i = e.leftSE.point.x, o = t.rightSE.point.x, u = e.rightSE.point.x;
904
+ if (u < n) return 1;
905
905
  if (o < i) return -1;
906
- const s = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, g = e.rightSE.point.y;
906
+ const l = t.leftSE.point.y, c = e.leftSE.point.y, f = t.rightSE.point.y, p = e.rightSE.point.y;
907
907
  if (n < i) {
908
- if (c < s && c < u) return 1;
909
- if (c > s && c > u) return -1;
910
- const l = t.comparePoint(e.leftSE.point);
911
- if (l < 0) return 1;
912
- if (l > 0) return -1;
913
- const h = e.comparePoint(t.rightSE.point);
914
- return h !== 0 ? h : -1;
908
+ if (c < l && c < f) return 1;
909
+ if (c > l && c > f) return -1;
910
+ const s = t.comparePoint(e.leftSE.point);
911
+ if (s < 0) return 1;
912
+ if (s > 0) return -1;
913
+ const a = e.comparePoint(t.rightSE.point);
914
+ return a !== 0 ? a : -1;
915
915
  }
916
916
  if (n > i) {
917
- if (s < c && s < g) return -1;
918
- if (s > c && s > g) return 1;
919
- const l = e.comparePoint(t.leftSE.point);
920
- if (l !== 0) return l;
921
- const h = t.comparePoint(e.rightSE.point);
922
- return h < 0 ? 1 : h > 0 ? -1 : 1;
917
+ if (l < c && l < p) return -1;
918
+ if (l > c && l > p) return 1;
919
+ const s = e.comparePoint(t.leftSE.point);
920
+ if (s !== 0) return s;
921
+ const a = t.comparePoint(e.rightSE.point);
922
+ return a < 0 ? 1 : a > 0 ? -1 : 1;
923
923
  }
924
- if (s < c) return -1;
925
- if (s > c) return 1;
926
- if (o < f) {
927
- const l = e.comparePoint(t.rightSE.point);
928
- if (l !== 0) return l;
924
+ if (l < c) return -1;
925
+ if (l > c) return 1;
926
+ if (o < u) {
927
+ const s = e.comparePoint(t.rightSE.point);
928
+ if (s !== 0) return s;
929
929
  }
930
- if (o > f) {
931
- const l = t.comparePoint(e.rightSE.point);
932
- if (l < 0) return 1;
933
- if (l > 0) return -1;
930
+ if (o > u) {
931
+ const s = t.comparePoint(e.rightSE.point);
932
+ if (s < 0) return 1;
933
+ if (s > 0) return -1;
934
934
  }
935
- if (o !== f) {
936
- const l = u - s, h = o - n, a = g - c, x = f - i;
937
- if (l > h && a < x) return 1;
938
- if (l < h && a > x) return -1;
935
+ if (o !== u) {
936
+ const s = f - l, a = o - n, h = p - c, g = u - i;
937
+ if (s > a && h < g) return 1;
938
+ if (s < a && h > g) return -1;
939
939
  }
940
- return o > f ? 1 : o < f || u < g ? -1 : u > g ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
940
+ return o > u ? 1 : o < u || f < p ? -1 : f > p ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
941
941
  }
942
942
  /* Warning: a reference to ringWindings input will be stored,
943
943
  * and possibly will be later modified */
@@ -945,15 +945,15 @@ class z {
945
945
  this.id = ++Re, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = i;
946
946
  }
947
947
  static fromRing(t, e, n) {
948
- let i, o, f;
949
- const s = L.comparePoints(t, e);
950
- if (s < 0)
951
- i = t, o = e, f = 1;
952
- else if (s > 0)
953
- i = e, o = t, f = -1;
948
+ let i, o, u;
949
+ const l = L.comparePoints(t, e);
950
+ if (l < 0)
951
+ i = t, o = e, u = 1;
952
+ else if (l > 0)
953
+ i = e, o = t, u = -1;
954
954
  else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);
955
- const c = new L(i, !0), u = new L(o, !1);
956
- return new z(c, u, [n], [f]);
955
+ const c = new L(i, !0), f = new L(o, !1);
956
+ return new z(c, f, [n], [u]);
957
957
  }
958
958
  /* When a segment is split, the rightSE is replaced with a new sweep event */
959
959
  replaceRightSE(t) {
@@ -1000,9 +1000,9 @@ class z {
1000
1000
  const e = this.leftSE.point, n = this.rightSE.point, i = this.vector();
1001
1001
  if (e.x === n.x)
1002
1002
  return t.x === e.x ? 0 : t.x < e.x ? 1 : -1;
1003
- const o = (t.y - e.y) / i.y, f = e.x + o * i.x;
1004
- if (t.x === f) return 0;
1005
- const s = (t.x - e.x) / i.x, c = e.y + s * i.y;
1003
+ const o = (t.y - e.y) / i.y, u = e.x + o * i.x;
1004
+ if (t.x === u) return 0;
1005
+ const l = (t.x - e.x) / i.x, c = e.y + l * i.y;
1006
1006
  return t.y === c ? 0 : t.y < c ? -1 : 1;
1007
1007
  }
1008
1008
  /**
@@ -1021,20 +1021,20 @@ class z {
1021
1021
  * Else, return null.
1022
1022
  */
1023
1023
  getIntersection(t) {
1024
- const e = this.bbox(), n = t.bbox(), i = gt(e, n);
1024
+ const e = this.bbox(), n = t.bbox(), i = pt(e, n);
1025
1025
  if (i === null) return null;
1026
- const o = this.leftSE.point, f = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, u = j(e, s) && this.comparePoint(s) === 0, g = j(n, o) && t.comparePoint(o) === 0, l = j(e, c) && this.comparePoint(c) === 0, h = j(n, f) && t.comparePoint(f) === 0;
1027
- if (g && u)
1028
- return h && !l ? f : !h && l ? c : null;
1029
- if (g)
1030
- return l && o.x === c.x && o.y === c.y ? null : o;
1031
- if (u)
1032
- return h && f.x === s.x && f.y === s.y ? null : s;
1033
- if (h && l) return null;
1034
- if (h) return f;
1035
- if (l) return c;
1036
- const a = Ce(o, this.vector(), s, t.vector());
1037
- return a === null || !j(i, a) ? null : J.round(a.x, a.y);
1026
+ const o = this.leftSE.point, u = this.rightSE.point, l = t.leftSE.point, c = t.rightSE.point, f = j(e, l) && this.comparePoint(l) === 0, p = j(n, o) && t.comparePoint(o) === 0, s = j(e, c) && this.comparePoint(c) === 0, a = j(n, u) && t.comparePoint(u) === 0;
1027
+ if (p && f)
1028
+ return a && !s ? u : !a && s ? c : null;
1029
+ if (p)
1030
+ return s && o.x === c.x && o.y === c.y ? null : o;
1031
+ if (f)
1032
+ return a && u.x === l.x && u.y === l.y ? null : l;
1033
+ if (a && s) return null;
1034
+ if (a) return u;
1035
+ if (s) return c;
1036
+ const h = Ce(o, this.vector(), l, t.vector());
1037
+ return h === null || !j(i, h) ? null : J.round(h.x, h.y);
1038
1038
  }
1039
1039
  /**
1040
1040
  * Split the given segment into multiple segments on the given points.
@@ -1049,10 +1049,10 @@ class z {
1049
1049
  * Warning: input array of points is modified
1050
1050
  */
1051
1051
  split(t) {
1052
- const e = [], n = t.events !== void 0, i = new L(t, !0), o = new L(t, !1), f = this.rightSE;
1052
+ const e = [], n = t.events !== void 0, i = new L(t, !0), o = new L(t, !1), u = this.rightSE;
1053
1053
  this.replaceRightSE(o), e.push(o), e.push(i);
1054
- const s = new z(i, f, this.rings.slice(), this.windings.slice());
1055
- return L.comparePoints(s.leftSE.point, s.rightSE.point) > 0 && s.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (i.checkForConsuming(), o.checkForConsuming()), e;
1054
+ const l = new z(i, u, this.rings.slice(), this.windings.slice());
1055
+ return L.comparePoints(l.leftSE.point, l.rightSE.point) > 0 && l.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (i.checkForConsuming(), o.checkForConsuming()), e;
1056
1056
  }
1057
1057
  /* Swap which event is left and right */
1058
1058
  swapEvents() {
@@ -1077,9 +1077,9 @@ class z {
1077
1077
  const o = e;
1078
1078
  e = n, n = o;
1079
1079
  }
1080
- for (let o = 0, f = n.rings.length; o < f; o++) {
1081
- const s = n.rings[o], c = n.windings[o], u = e.rings.indexOf(s);
1082
- u === -1 ? (e.rings.push(s), e.windings.push(c)) : e.windings[u] += c;
1080
+ for (let o = 0, u = n.rings.length; o < u; o++) {
1081
+ const l = n.rings[o], c = n.windings[o], f = e.rings.indexOf(l);
1082
+ f === -1 ? (e.rings.push(l), e.windings.push(c)) : e.windings[f] += c;
1083
1083
  }
1084
1084
  n.rings = null, n.windings = null, n.consumedBy = e, n.leftSE.consumedBy = e.leftSE, n.rightSE.consumedBy = e.rightSE;
1085
1085
  }
@@ -1110,25 +1110,25 @@ class z {
1110
1110
  multiPolys: []
1111
1111
  };
1112
1112
  const e = this._afterState.rings, n = this._afterState.windings, i = this._afterState.multiPolys;
1113
- for (let s = 0, c = this.rings.length; s < c; s++) {
1114
- const u = this.rings[s], g = this.windings[s], l = e.indexOf(u);
1115
- l === -1 ? (e.push(u), n.push(g)) : n[l] += g;
1113
+ for (let l = 0, c = this.rings.length; l < c; l++) {
1114
+ const f = this.rings[l], p = this.windings[l], s = e.indexOf(f);
1115
+ s === -1 ? (e.push(f), n.push(p)) : n[s] += p;
1116
1116
  }
1117
- const o = [], f = [];
1118
- for (let s = 0, c = e.length; s < c; s++) {
1119
- if (n[s] === 0) continue;
1120
- const u = e[s], g = u.poly;
1121
- if (f.indexOf(g) === -1)
1122
- if (u.isExterior) o.push(g);
1117
+ const o = [], u = [];
1118
+ for (let l = 0, c = e.length; l < c; l++) {
1119
+ if (n[l] === 0) continue;
1120
+ const f = e[l], p = f.poly;
1121
+ if (u.indexOf(p) === -1)
1122
+ if (f.isExterior) o.push(p);
1123
1123
  else {
1124
- f.indexOf(g) === -1 && f.push(g);
1125
- const l = o.indexOf(u.poly);
1126
- l !== -1 && o.splice(l, 1);
1124
+ u.indexOf(p) === -1 && u.push(p);
1125
+ const s = o.indexOf(f.poly);
1126
+ s !== -1 && o.splice(s, 1);
1127
1127
  }
1128
1128
  }
1129
- for (let s = 0, c = o.length; s < c; s++) {
1130
- const u = o[s].multiPoly;
1131
- i.indexOf(u) === -1 && i.push(u);
1129
+ for (let l = 0, c = o.length; l < c; l++) {
1130
+ const f = o[l].multiPoly;
1131
+ i.indexOf(f) === -1 && i.push(f);
1132
1132
  }
1133
1133
  return this._afterState;
1134
1134
  }
@@ -1137,7 +1137,7 @@ class z {
1137
1137
  if (this.consumedBy) return !1;
1138
1138
  if (this._isInResult !== void 0) return this._isInResult;
1139
1139
  const t = this.beforeState().multiPolys, e = this.afterState().multiPolys;
1140
- switch ($.type) {
1140
+ switch (k.type) {
1141
1141
  case "union": {
1142
1142
  const n = t.length === 0, i = e.length === 0;
1143
1143
  this._isInResult = n !== i;
@@ -1145,7 +1145,7 @@ class z {
1145
1145
  }
1146
1146
  case "intersection": {
1147
1147
  let n, i;
1148
- t.length < e.length ? (n = t.length, i = e.length) : (n = e.length, i = t.length), this._isInResult = i === $.numMultiPolys && n < i;
1148
+ t.length < e.length ? (n = t.length, i = e.length) : (n = e.length, i = t.length), this._isInResult = i === k.numMultiPolys && n < i;
1149
1149
  break;
1150
1150
  }
1151
1151
  case "xor": {
@@ -1159,12 +1159,12 @@ class z {
1159
1159
  break;
1160
1160
  }
1161
1161
  default:
1162
- throw new Error(`Unrecognized operation type found ${$.type}`);
1162
+ throw new Error(`Unrecognized operation type found ${k.type}`);
1163
1163
  }
1164
1164
  return this._isInResult;
1165
1165
  }
1166
1166
  }
1167
- class kt {
1167
+ class $t {
1168
1168
  constructor(t, e, n) {
1169
1169
  if (!Array.isArray(t) || t.length === 0)
1170
1170
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
@@ -1182,10 +1182,10 @@ class kt {
1182
1182
  }
1183
1183
  };
1184
1184
  let o = i;
1185
- for (let f = 1, s = t.length; f < s; f++) {
1186
- if (typeof t[f][0] != "number" || typeof t[f][1] != "number")
1185
+ for (let u = 1, l = t.length; u < l; u++) {
1186
+ if (typeof t[u][0] != "number" || typeof t[u][1] != "number")
1187
1187
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
1188
- let c = J.round(t[f][0], t[f][1]);
1188
+ let c = J.round(t[u][0], t[u][1]);
1189
1189
  c.x === o.x && c.y === o.y || (this.segments.push(z.fromRing(o, c, this)), c.x < this.bbox.ll.x && (this.bbox.ll.x = c.x), c.y < this.bbox.ll.y && (this.bbox.ll.y = c.y), c.x > this.bbox.ur.x && (this.bbox.ur.x = c.x), c.y > this.bbox.ur.y && (this.bbox.ur.y = c.y), o = c);
1190
1190
  }
1191
1191
  (i.x !== o.x || i.y !== o.y) && this.segments.push(z.fromRing(o, i, this));
@@ -1203,7 +1203,7 @@ class Ie {
1203
1203
  constructor(t, e) {
1204
1204
  if (!Array.isArray(t))
1205
1205
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
1206
- this.exteriorRing = new kt(t[0], this, !0), this.bbox = {
1206
+ this.exteriorRing = new $t(t[0], this, !0), this.bbox = {
1207
1207
  ll: {
1208
1208
  x: this.exteriorRing.bbox.ll.x,
1209
1209
  y: this.exteriorRing.bbox.ll.y
@@ -1214,7 +1214,7 @@ class Ie {
1214
1214
  }
1215
1215
  }, this.interiorRings = [];
1216
1216
  for (let n = 1, i = t.length; n < i; n++) {
1217
- const o = new kt(t[n], this, !1);
1217
+ const o = new $t(t[n], this, !1);
1218
1218
  o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.interiorRings.push(o);
1219
1219
  }
1220
1220
  this.multiPoly = e;
@@ -1223,13 +1223,13 @@ class Ie {
1223
1223
  const t = this.exteriorRing.getSweepEvents();
1224
1224
  for (let e = 0, n = this.interiorRings.length; e < n; e++) {
1225
1225
  const i = this.interiorRings[e].getSweepEvents();
1226
- for (let o = 0, f = i.length; o < f; o++)
1226
+ for (let o = 0, u = i.length; o < u; o++)
1227
1227
  t.push(i[o]);
1228
1228
  }
1229
1229
  return t;
1230
1230
  }
1231
1231
  }
1232
- class $t {
1232
+ class kt {
1233
1233
  constructor(t, e) {
1234
1234
  if (!Array.isArray(t))
1235
1235
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
@@ -1257,7 +1257,7 @@ class $t {
1257
1257
  const t = [];
1258
1258
  for (let e = 0, n = this.polys.length; e < n; e++) {
1259
1259
  const i = this.polys[e].getSweepEvents();
1260
- for (let o = 0, f = i.length; o < f; o++)
1260
+ for (let o = 0, u = i.length; o < u; o++)
1261
1261
  t.push(i[o]);
1262
1262
  }
1263
1263
  return t;
@@ -1271,39 +1271,39 @@ class nt {
1271
1271
  for (let n = 0, i = t.length; n < i; n++) {
1272
1272
  const o = t[n];
1273
1273
  if (!o.isInResult() || o.ringOut) continue;
1274
- let f = null, s = o.leftSE, c = o.rightSE;
1275
- const u = [s], g = s.point, l = [];
1276
- for (; f = s, s = c, u.push(s), s.point !== g; )
1274
+ let u = null, l = o.leftSE, c = o.rightSE;
1275
+ const f = [l], p = l.point, s = [];
1276
+ for (; u = l, l = c, f.push(l), l.point !== p; )
1277
1277
  for (; ; ) {
1278
- const h = s.getAvailableLinkedEvents();
1279
- if (h.length === 0) {
1280
- const p = u[0].point, y = u[u.length - 1].point;
1281
- throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${y.x}, ${y.y}].`);
1278
+ const a = l.getAvailableLinkedEvents();
1279
+ if (a.length === 0) {
1280
+ const d = f[0].point, w = f[f.length - 1].point;
1281
+ throw new Error(`Unable to complete output ring starting at [${d.x}, ${d.y}]. Last matching segment found ends at [${w.x}, ${w.y}].`);
1282
1282
  }
1283
- if (h.length === 1) {
1284
- c = h[0].otherSE;
1283
+ if (a.length === 1) {
1284
+ c = a[0].otherSE;
1285
1285
  break;
1286
1286
  }
1287
- let a = null;
1288
- for (let p = 0, y = l.length; p < y; p++)
1289
- if (l[p].point === s.point) {
1290
- a = p;
1287
+ let h = null;
1288
+ for (let d = 0, w = s.length; d < w; d++)
1289
+ if (s[d].point === l.point) {
1290
+ h = d;
1291
1291
  break;
1292
1292
  }
1293
- if (a !== null) {
1294
- const p = l.splice(a)[0], y = u.splice(p.index);
1295
- y.unshift(y[0].otherSE), e.push(new nt(y.reverse()));
1293
+ if (h !== null) {
1294
+ const d = s.splice(h)[0], w = f.splice(d.index);
1295
+ w.unshift(w[0].otherSE), e.push(new nt(w.reverse()));
1296
1296
  continue;
1297
1297
  }
1298
- l.push({
1299
- index: u.length,
1300
- point: s.point
1298
+ s.push({
1299
+ index: f.length,
1300
+ point: l.point
1301
1301
  });
1302
- const x = s.getLeftmostComparator(f);
1303
- c = h.sort(x)[0].otherSE;
1302
+ const g = l.getLeftmostComparator(u);
1303
+ c = a.sort(g)[0].otherSE;
1304
1304
  break;
1305
1305
  }
1306
- e.push(new nt(u));
1306
+ e.push(new nt(f));
1307
1307
  }
1308
1308
  return e;
1309
1309
  }
@@ -1316,15 +1316,15 @@ class nt {
1316
1316
  getGeom() {
1317
1317
  let t = this.events[0].point;
1318
1318
  const e = [t];
1319
- for (let u = 1, g = this.events.length - 1; u < g; u++) {
1320
- const l = this.events[u].point, h = this.events[u + 1].point;
1321
- Ct(l, t, h) !== 0 && (e.push(l), t = l);
1319
+ for (let f = 1, p = this.events.length - 1; f < p; f++) {
1320
+ const s = this.events[f].point, a = this.events[f + 1].point;
1321
+ Ct(s, t, a) !== 0 && (e.push(s), t = s);
1322
1322
  }
1323
1323
  if (e.length === 1) return null;
1324
1324
  const n = e[0], i = e[1];
1325
1325
  Ct(n, t, i) === 0 && e.shift(), e.push(e[0]);
1326
- const o = this.isExteriorRing() ? 1 : -1, f = this.isExteriorRing() ? 0 : e.length - 1, s = this.isExteriorRing() ? e.length : -1, c = [];
1327
- for (let u = f; u != s; u += o) c.push([e[u].x, e[u].y]);
1326
+ const o = this.isExteriorRing() ? 1 : -1, u = this.isExteriorRing() ? 0 : e.length - 1, l = this.isExteriorRing() ? e.length : -1, c = [];
1327
+ for (let f = u; f != l; f += o) c.push([e[f].x, e[f].y]);
1328
1328
  return c;
1329
1329
  }
1330
1330
  isExteriorRing() {
@@ -1341,8 +1341,8 @@ class nt {
1341
1341
  _calcEnclosingRing() {
1342
1342
  let t = this.events[0];
1343
1343
  for (let i = 1, o = this.events.length; i < o; i++) {
1344
- const f = this.events[i];
1345
- L.compare(t, f) > 0 && (t = f);
1344
+ const u = this.events[i];
1345
+ L.compare(t, u) > 0 && (t = u);
1346
1346
  }
1347
1347
  let e = t.segment.prevInResult(), n = e ? e.prevInResult() : null;
1348
1348
  for (; ; ) {
@@ -1371,7 +1371,7 @@ class At {
1371
1371
  return t;
1372
1372
  }
1373
1373
  }
1374
- class ke {
1374
+ class $e {
1375
1375
  constructor(t) {
1376
1376
  this.rings = t, this.polys = this._composePolys(t);
1377
1377
  }
@@ -1390,14 +1390,14 @@ class ke {
1390
1390
  if (!o.poly)
1391
1391
  if (o.isExteriorRing()) e.push(new At(o));
1392
1392
  else {
1393
- const f = o.enclosingRing();
1394
- f.poly || e.push(new At(f)), f.poly.addInterior(o);
1393
+ const u = o.enclosingRing();
1394
+ u.poly || e.push(new At(u)), u.poly.addInterior(o);
1395
1395
  }
1396
1396
  }
1397
1397
  return e;
1398
1398
  }
1399
1399
  }
1400
- class $e {
1400
+ class ke {
1401
1401
  constructor(t) {
1402
1402
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : z.compare;
1403
1403
  this.queue = t, this.tree = new wt(e), this.segments = [];
@@ -1408,51 +1408,51 @@ class $e {
1408
1408
  return t.isLeft ? this.queue.remove(t.otherSE) : this.tree.remove(e), n;
1409
1409
  const i = t.isLeft ? this.tree.add(e) : this.tree.find(e);
1410
1410
  if (!i) throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);
1411
- let o = i, f = i, s, c;
1412
- for (; s === void 0; )
1413
- o = this.tree.prev(o), o === null ? s = null : o.key.consumedBy === void 0 && (s = o.key);
1411
+ let o = i, u = i, l, c;
1412
+ for (; l === void 0; )
1413
+ o = this.tree.prev(o), o === null ? l = null : o.key.consumedBy === void 0 && (l = o.key);
1414
1414
  for (; c === void 0; )
1415
- f = this.tree.next(f), f === null ? c = null : f.key.consumedBy === void 0 && (c = f.key);
1415
+ u = this.tree.next(u), u === null ? c = null : u.key.consumedBy === void 0 && (c = u.key);
1416
1416
  if (t.isLeft) {
1417
- let u = null;
1418
- if (s) {
1419
- const l = s.getIntersection(e);
1420
- if (l !== null && (e.isAnEndpoint(l) || (u = l), !s.isAnEndpoint(l))) {
1421
- const h = this._splitSafely(s, l);
1422
- for (let a = 0, x = h.length; a < x; a++)
1423
- n.push(h[a]);
1417
+ let f = null;
1418
+ if (l) {
1419
+ const s = l.getIntersection(e);
1420
+ if (s !== null && (e.isAnEndpoint(s) || (f = s), !l.isAnEndpoint(s))) {
1421
+ const a = this._splitSafely(l, s);
1422
+ for (let h = 0, g = a.length; h < g; h++)
1423
+ n.push(a[h]);
1424
1424
  }
1425
1425
  }
1426
- let g = null;
1426
+ let p = null;
1427
1427
  if (c) {
1428
- const l = c.getIntersection(e);
1429
- if (l !== null && (e.isAnEndpoint(l) || (g = l), !c.isAnEndpoint(l))) {
1430
- const h = this._splitSafely(c, l);
1431
- for (let a = 0, x = h.length; a < x; a++)
1432
- n.push(h[a]);
1428
+ const s = c.getIntersection(e);
1429
+ if (s !== null && (e.isAnEndpoint(s) || (p = s), !c.isAnEndpoint(s))) {
1430
+ const a = this._splitSafely(c, s);
1431
+ for (let h = 0, g = a.length; h < g; h++)
1432
+ n.push(a[h]);
1433
1433
  }
1434
1434
  }
1435
- if (u !== null || g !== null) {
1436
- let l = null;
1437
- u === null ? l = g : g === null ? l = u : l = L.comparePoints(u, g) <= 0 ? u : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
1438
- const h = e.split(l);
1439
- for (let a = 0, x = h.length; a < x; a++)
1440
- n.push(h[a]);
1435
+ if (f !== null || p !== null) {
1436
+ let s = null;
1437
+ f === null ? s = p : p === null ? s = f : s = L.comparePoints(f, p) <= 0 ? f : p, this.queue.remove(e.rightSE), n.push(e.rightSE);
1438
+ const a = e.split(s);
1439
+ for (let h = 0, g = a.length; h < g; h++)
1440
+ n.push(a[h]);
1441
1441
  }
1442
- n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = s);
1442
+ n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = l);
1443
1443
  } else {
1444
- if (s && c) {
1445
- const u = s.getIntersection(c);
1446
- if (u !== null) {
1447
- if (!s.isAnEndpoint(u)) {
1448
- const g = this._splitSafely(s, u);
1449
- for (let l = 0, h = g.length; l < h; l++)
1450
- n.push(g[l]);
1444
+ if (l && c) {
1445
+ const f = l.getIntersection(c);
1446
+ if (f !== null) {
1447
+ if (!l.isAnEndpoint(f)) {
1448
+ const p = this._splitSafely(l, f);
1449
+ for (let s = 0, a = p.length; s < a; s++)
1450
+ n.push(p[s]);
1451
1451
  }
1452
- if (!c.isAnEndpoint(u)) {
1453
- const g = this._splitSafely(c, u);
1454
- for (let l = 0, h = g.length; l < h; l++)
1455
- n.push(g[l]);
1452
+ if (!c.isAnEndpoint(f)) {
1453
+ const p = this._splitSafely(c, f);
1454
+ for (let s = 0, a = p.length; s < a; s++)
1455
+ n.push(p[s]);
1456
1456
  }
1457
1457
  }
1458
1458
  }
@@ -1473,69 +1473,69 @@ class $e {
1473
1473
  const Ot = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, Ae = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
1474
1474
  class Oe {
1475
1475
  run(t, e, n) {
1476
- $.type = t, J.reset();
1477
- const i = [new $t(e, !0)];
1478
- for (let l = 0, h = n.length; l < h; l++)
1479
- i.push(new $t(n[l], !1));
1480
- if ($.numMultiPolys = i.length, $.type === "difference") {
1481
- const l = i[0];
1482
- let h = 1;
1483
- for (; h < i.length; )
1484
- gt(i[h].bbox, l.bbox) !== null ? h++ : i.splice(h, 1);
1476
+ k.type = t, J.reset();
1477
+ const i = [new kt(e, !0)];
1478
+ for (let s = 0, a = n.length; s < a; s++)
1479
+ i.push(new kt(n[s], !1));
1480
+ if (k.numMultiPolys = i.length, k.type === "difference") {
1481
+ const s = i[0];
1482
+ let a = 1;
1483
+ for (; a < i.length; )
1484
+ pt(i[a].bbox, s.bbox) !== null ? a++ : i.splice(a, 1);
1485
1485
  }
1486
- if ($.type === "intersection")
1487
- for (let l = 0, h = i.length; l < h; l++) {
1488
- const a = i[l];
1489
- for (let x = l + 1, p = i.length; x < p; x++)
1490
- if (gt(a.bbox, i[x].bbox) === null) return [];
1486
+ if (k.type === "intersection")
1487
+ for (let s = 0, a = i.length; s < a; s++) {
1488
+ const h = i[s];
1489
+ for (let g = s + 1, d = i.length; g < d; g++)
1490
+ if (pt(h.bbox, i[g].bbox) === null) return [];
1491
1491
  }
1492
1492
  const o = new wt(L.compare);
1493
- for (let l = 0, h = i.length; l < h; l++) {
1494
- const a = i[l].getSweepEvents();
1495
- for (let x = 0, p = a.length; x < p; x++)
1496
- if (o.insert(a[x]), o.size > Ot)
1493
+ for (let s = 0, a = i.length; s < a; s++) {
1494
+ const h = i[s].getSweepEvents();
1495
+ for (let g = 0, d = h.length; g < d; g++)
1496
+ if (o.insert(h[g]), o.size > Ot)
1497
1497
  throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
1498
1498
  }
1499
- const f = new $e(o);
1500
- let s = o.size, c = o.pop();
1499
+ const u = new ke(o);
1500
+ let l = o.size, c = o.pop();
1501
1501
  for (; c; ) {
1502
- const l = c.key;
1503
- if (o.size === s) {
1504
- const a = l.segment;
1505
- throw new Error(`Unable to pop() ${l.isLeft ? "left" : "right"} SweepEvent [${l.point.x}, ${l.point.y}] from segment #${a.id} [${a.leftSE.point.x}, ${a.leftSE.point.y}] -> [${a.rightSE.point.x}, ${a.rightSE.point.y}] from queue.`);
1502
+ const s = c.key;
1503
+ if (o.size === l) {
1504
+ const h = s.segment;
1505
+ throw new Error(`Unable to pop() ${s.isLeft ? "left" : "right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`);
1506
1506
  }
1507
1507
  if (o.size > Ot)
1508
1508
  throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
1509
- if (f.segments.length > Ae)
1509
+ if (u.segments.length > Ae)
1510
1510
  throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
1511
- const h = f.process(l);
1512
- for (let a = 0, x = h.length; a < x; a++) {
1513
- const p = h[a];
1514
- p.consumedBy === void 0 && o.insert(p);
1511
+ const a = u.process(s);
1512
+ for (let h = 0, g = a.length; h < g; h++) {
1513
+ const d = a[h];
1514
+ d.consumedBy === void 0 && o.insert(d);
1515
1515
  }
1516
- s = o.size, c = o.pop();
1516
+ l = o.size, c = o.pop();
1517
1517
  }
1518
1518
  J.reset();
1519
- const u = nt.factory(f.segments);
1520
- return new ke(u).getGeom();
1519
+ const f = nt.factory(u.segments);
1520
+ return new $e(f).getGeom();
1521
1521
  }
1522
1522
  }
1523
- const $ = new Oe(), Ne = function(r) {
1523
+ const k = new Oe(), Ne = function(r) {
1524
1524
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1525
1525
  e[n - 1] = arguments[n];
1526
- return $.run("union", r, e);
1526
+ return k.run("union", r, e);
1527
1527
  }, Be = function(r) {
1528
1528
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1529
1529
  e[n - 1] = arguments[n];
1530
- return $.run("intersection", r, e);
1530
+ return k.run("intersection", r, e);
1531
1531
  }, Ge = function(r) {
1532
1532
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1533
1533
  e[n - 1] = arguments[n];
1534
- return $.run("xor", r, e);
1534
+ return k.run("xor", r, e);
1535
1535
  }, ze = function(r) {
1536
1536
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1537
1537
  e[n - 1] = arguments[n];
1538
- return $.run("difference", r, e);
1538
+ return k.run("difference", r, e);
1539
1539
  };
1540
1540
  var Zt = {
1541
1541
  union: Ne,
@@ -1553,7 +1553,7 @@ function Fe(r, t = {}) {
1553
1553
  return n.length === 0 ? null : n.length === 1 ? xt(n[0], t.properties) : Ut(n, t.properties);
1554
1554
  }
1555
1555
  var Jt = Fe;
1556
- function pt(r) {
1556
+ function gt(r) {
1557
1557
  const t = [...r];
1558
1558
  return t[2] < t[0] && (Math.abs((t[0] + t[2] + 360) / 2) > Math.abs((t[0] - 360 + t[2]) / 2) ? t[0] -= 360 : t[2] += 360), t;
1559
1559
  }
@@ -1667,10 +1667,10 @@ function Ke(r, t) {
1667
1667
  function He(r, t) {
1668
1668
  r.$$.dirty[0] === -1 && (U.push(r), je(), r.$$.dirty.fill(0)), r.$$.dirty[t / 31 | 0] |= 1 << t % 31;
1669
1669
  }
1670
- function tn(r, t, e, n, i, o, f = null, s = [-1]) {
1670
+ function tn(r, t, e, n, i, o, u = null, l = [-1]) {
1671
1671
  const c = Et;
1672
1672
  X(r);
1673
- const u = r.$$ = {
1673
+ const f = r.$$ = {
1674
1674
  fragment: null,
1675
1675
  ctx: [],
1676
1676
  // state
@@ -1687,21 +1687,21 @@ function tn(r, t, e, n, i, o, f = null, s = [-1]) {
1687
1687
  context: new Map(t.context || (c ? c.$$.context : [])),
1688
1688
  // everything else
1689
1689
  callbacks: Nt(),
1690
- dirty: s,
1690
+ dirty: l,
1691
1691
  skip_bound: !1,
1692
1692
  root: t.target || c.$$.root
1693
1693
  };
1694
- f && f(u.root);
1695
- let g = !1;
1696
- if (u.ctx = e ? e(r, t.props || {}, (l, h, ...a) => {
1697
- const x = a.length ? a[0] : h;
1698
- return u.ctx && i(u.ctx[l], u.ctx[l] = x) && (!u.skip_bound && u.bound[l] && u.bound[l](x), g && He(r, l)), h;
1699
- }) : [], u.update(), g = !0, rt(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
1694
+ u && u(f.root);
1695
+ let p = !1;
1696
+ if (f.ctx = e ? e(r, t.props || {}, (s, a, ...h) => {
1697
+ const g = h.length ? h[0] : a;
1698
+ return f.ctx && i(f.ctx[s], f.ctx[s] = g) && (!f.skip_bound && f.bound[s] && f.bound[s](g), p && He(r, s)), a;
1699
+ }) : [], f.update(), p = !0, rt(f.before_update), f.fragment = n ? n(f.ctx) : !1, t.target) {
1700
1700
  if (t.hydrate) {
1701
- const l = Ye(t.target);
1702
- u.fragment && u.fragment.l(l), l.forEach(Ht);
1701
+ const s = Ye(t.target);
1702
+ f.fragment && f.fragment.l(s), s.forEach(Ht);
1703
1703
  } else
1704
- u.fragment && u.fragment.c();
1704
+ f.fragment && f.fragment.c();
1705
1705
  t.intro && Je(r.$$.fragment), We(r, t.target, t.anchor), te();
1706
1706
  }
1707
1707
  X(c);
@@ -1846,22 +1846,22 @@ function Ft(r, t) {
1846
1846
  if (!e)
1847
1847
  return;
1848
1848
  e.properties = { isMask: !0 };
1849
- const n = pt(ut(r)), i = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, s = cn(r);
1850
- if (s.features.length > 1 && (o || f))
1851
- for (const c of s.features) {
1852
- const u = pt(ut(c));
1853
- if (f && u[0] < -180 + i)
1854
- for (const g of c.geometry.coordinates)
1855
- for (const l of g)
1856
- l[0] += 360 - i;
1857
- if (o && u[2] > 180 - i)
1858
- for (const g of c.geometry.coordinates)
1859
- for (const l of g)
1860
- l[0] -= 360 - i;
1849
+ const n = gt(ut(r)), i = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, u = n[2] > 180, l = cn(r);
1850
+ if (l.features.length > 1 && (o || u))
1851
+ for (const c of l.features) {
1852
+ const f = gt(ut(c));
1853
+ if (u && f[0] < -180 + i)
1854
+ for (const p of c.geometry.coordinates)
1855
+ for (const s of p)
1856
+ s[0] += 360 - i;
1857
+ if (o && f[2] > 180 - i)
1858
+ for (const p of c.geometry.coordinates)
1859
+ for (const s of p)
1860
+ s[0] -= 360 - i;
1861
1861
  }
1862
1862
  t(
1863
1863
  Z([
1864
- s.features.length < 2 ? r : Jt(s) ?? r,
1864
+ l.features.length < 2 ? r : Jt(l) ?? r,
1865
1865
  e
1866
1866
  ])
1867
1867
  );
@@ -1878,23 +1878,23 @@ const Tt = (r) => {
1878
1878
  lineCap: "butt"
1879
1879
  };
1880
1880
  };
1881
- function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt, f = !1) {
1882
- let s;
1883
- const c = [];
1884
- let u, g, l = f;
1885
- const h = T.geoJSON(void 0, {
1881
+ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt) {
1882
+ let u;
1883
+ const l = [];
1884
+ let c, f;
1885
+ const p = T.geoJSON(void 0, {
1886
1886
  style: o === !0 ? Tt : o === !1 ? void 0 : o ?? void 0,
1887
1887
  interactive: !1
1888
- }).addTo(r), a = (p) => {
1889
- s == null || s({
1888
+ }).addTo(r), s = (h) => {
1889
+ u == null || u({
1890
1890
  type: "mapClick",
1891
- coordinates: [p.latlng.lng, p.latlng.lat]
1891
+ coordinates: [h.latlng.lng, h.latlng.lat]
1892
1892
  });
1893
1893
  };
1894
- function x(p, y = !1) {
1894
+ function a(h, g = !1) {
1895
1895
  const d = document.createElement("div");
1896
- return new sn({ props: { displayIn: "leaflet" }, target: d }), new T.Marker(p, {
1897
- interactive: y,
1896
+ return new sn({ props: { displayIn: "leaflet" }, target: d }), new T.Marker(h, {
1897
+ interactive: g,
1898
1898
  icon: new T.DivIcon({
1899
1899
  html: d,
1900
1900
  className: "",
@@ -1905,135 +1905,132 @@ function an(r, t = !0, e = !0, n = {}, i = {}, o = Tt, f = !1) {
1905
1905
  });
1906
1906
  }
1907
1907
  return {
1908
- setEventHandler(p) {
1909
- p ? (s = p, r.on("click", a)) : (s = void 0, r.off("click", a));
1908
+ setEventHandler(h) {
1909
+ h ? (u = h, r.on("click", s)) : (u = void 0, r.off("click", s));
1910
1910
  },
1911
- flyTo(p, y) {
1912
- r.flyTo([p[1], p[0]], y, { duration: 2, ...n });
1911
+ flyTo(h, g) {
1912
+ r.flyTo([h[1], h[0]], g, { duration: 2, ...n });
1913
1913
  },
1914
- fitBounds(p, y, d) {
1914
+ fitBounds(h, g, d) {
1915
1915
  r.flyToBounds(
1916
1916
  [
1917
- [p[1], p[0]],
1918
- [p[3], p[2]]
1917
+ [h[1], h[0]],
1918
+ [h[3], h[2]]
1919
1919
  ],
1920
1920
  {
1921
- padding: [y, y],
1921
+ padding: [g, g],
1922
1922
  duration: 2,
1923
1923
  ...d ? { maxZoom: d } : {},
1924
1924
  ...i
1925
1925
  }
1926
1926
  );
1927
1927
  },
1928
- indicateReverse(p) {
1929
- r.getContainer().style.cursor = p ? "crosshair" : "";
1928
+ indicateReverse(h) {
1929
+ r.getContainer().style.cursor = h ? "crosshair" : "";
1930
1930
  },
1931
- setReverseMarker(p) {
1931
+ setReverseMarker(h) {
1932
1932
  var d;
1933
1933
  if (!t)
1934
1934
  return;
1935
- const y = p && [p[1], p[0]];
1936
- g ? y ? g.setLatLng(y) : (g.remove(), g = void 0) : y && (t instanceof Function ? g = t(r) ?? void 0 : (g = (typeof t == "object" ? new T.Marker(y, t) : x(y)).addTo(r), (d = g.getElement()) == null || d.classList.add("marker-reverse")));
1935
+ const g = h && [h[1], h[0]];
1936
+ f ? g ? f.setLatLng(g) : (f.remove(), f = void 0) : g && (t instanceof Function ? f = t(r) ?? void 0 : (f = (typeof t == "object" ? new T.Marker(g, t) : a(g)).addTo(r), (d = f.getElement()) == null || d.classList.add("marker-reverse")));
1937
1937
  },
1938
- setMarkers(p, y) {
1939
- function d(v) {
1940
- h.clearLayers(), v && h.addData(v);
1938
+ setMarkers(h, g, d) {
1939
+ function w(y) {
1940
+ p.clearLayers(), y && p.addData(y);
1941
1941
  }
1942
- for (const v of c)
1943
- v.remove();
1944
- if (c.length = 0, d(), y) {
1945
- let v = !1;
1946
- if (y.geometry.type === "GeometryCollection") {
1947
- const w = y.geometry.geometries.filter(
1948
- (m) => m.type === "Polygon" || m.type === "MultiPolygon"
1942
+ for (const y of l)
1943
+ y.remove();
1944
+ if (l.length = 0, w(), g) {
1945
+ let y = !1;
1946
+ if (g.geometry.type === "GeometryCollection") {
1947
+ const v = g.geometry.geometries.filter(
1948
+ (x) => x.type === "Polygon" || x.type === "MultiPolygon"
1949
1949
  );
1950
- t: if (w.length > 0) {
1951
- const m = Jt(
1952
- Z(w.map((E) => V(E)))
1950
+ t: if (v.length > 0) {
1951
+ const x = Jt(
1952
+ Z(v.map((m) => V(m)))
1953
1953
  );
1954
- if (!m)
1954
+ if (!x)
1955
1955
  break t;
1956
1956
  Ft(
1957
1957
  {
1958
- ...y,
1959
- geometry: m.geometry
1958
+ ...g,
1959
+ geometry: x.geometry
1960
1960
  },
1961
- d
1962
- ), v = !0;
1961
+ w
1962
+ ), y = !0;
1963
1963
  } else {
1964
- const m = y.geometry.geometries.filter(
1965
- (E) => E.type === "LineString" || E.type === "MultiLineString"
1964
+ const x = g.geometry.geometries.filter(
1965
+ (m) => m.type === "LineString" || m.type === "MultiLineString"
1966
1966
  );
1967
- m.length > 0 && (d({
1968
- ...y,
1969
- geometry: { type: "GeometryCollection", geometries: m }
1970
- }), v = !0);
1967
+ x.length > 0 && (w({
1968
+ ...g,
1969
+ geometry: { type: "GeometryCollection", geometries: x }
1970
+ }), y = !0);
1971
1971
  }
1972
1972
  }
1973
- if (!v) {
1974
- if (y.geometry.type === "Polygon" || y.geometry.type === "MultiPolygon")
1975
- Ft(y, (w) => {
1976
- if (!w)
1973
+ if (!y) {
1974
+ if (g.geometry.type === "Polygon" || g.geometry.type === "MultiPolygon")
1975
+ Ft(g, (v) => {
1976
+ if (!v)
1977
1977
  return;
1978
- const m = [...w.features], E = pt(ut(y)), b = E[2] - E[0];
1979
- E[0] - b / 4 < -180 && m.push(...qt(w, -360).features), E[2] + b / 4 > 180 && m.push(...qt(w, 360).features), d(Z(m));
1978
+ const x = [...v.features], m = gt(ut(g)), E = m[2] - m[0];
1979
+ m[0] - E / 4 < -180 && x.push(...qt(v, -360).features), m[2] + E / 4 > 180 && x.push(...qt(v, 360).features), w(Z(x));
1980
1980
  });
1981
- else if (y.geometry.type === "LineString" || y.geometry.type === "MultiLineString") {
1982
- d(y);
1981
+ else if (g.geometry.type === "LineString" || g.geometry.type === "MultiLineString") {
1982
+ w(g);
1983
1983
  return;
1984
1984
  }
1985
1985
  }
1986
- if (!l && y.geometry.type !== "Point")
1986
+ if (!d && g.geometry.type !== "Point")
1987
1987
  return;
1988
1988
  if (t instanceof Function) {
1989
- const w = t(r, y);
1990
- w && c.push(w.addTo(r));
1989
+ const v = t(r, g);
1990
+ v && l.push(v.addTo(r));
1991
1991
  } else if (t) {
1992
- const w = [y.center[1], y.center[0]];
1993
- c.push(
1994
- typeof t == "object" ? new T.Marker(w, t) : x(w).addTo(r)
1992
+ const v = [g.center[1], g.center[0]];
1993
+ l.push(
1994
+ typeof t == "object" ? new T.Marker(v, t) : a(v).addTo(r)
1995
1995
  );
1996
1996
  }
1997
1997
  }
1998
1998
  if (e)
1999
- for (const v of p ?? []) {
2000
- if (v === y)
1999
+ for (const y of h ?? []) {
2000
+ if (y === g)
2001
2001
  continue;
2002
- const w = [
2003
- v.center[1],
2004
- v.center[0]
2002
+ const v = [
2003
+ y.center[1],
2004
+ y.center[0]
2005
2005
  ];
2006
- let m;
2006
+ let x;
2007
2007
  if (e instanceof Function) {
2008
- if (m = e(r, v), !m)
2008
+ if (x = e(r, y), !x)
2009
2009
  continue;
2010
2010
  } else
2011
- m = (typeof e == "object" ? new T.Marker(w, e) : x(w, !0)).addTo(r).bindTooltip(
2012
- v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, ""),
2011
+ x = (typeof e == "object" ? new T.Marker(v, e) : a(v, !0)).addTo(r).bindTooltip(
2012
+ y.place_type[0] === "reverse" ? y.place_name : y.place_name.replace(/,.*/, ""),
2013
2013
  {
2014
2014
  direction: "top"
2015
2015
  }
2016
2016
  );
2017
- const E = m.getElement();
2018
- E && (E.addEventListener("click", (b) => {
2019
- b.stopPropagation(), s == null || s({ type: "markerClick", id: v.id });
2020
- }), E.addEventListener("mouseenter", () => {
2021
- s == null || s({ type: "markerMouseEnter", id: v.id });
2022
- }), E.addEventListener("mouseleave", () => {
2023
- s == null || s({ type: "markerMouseLeave", id: v.id });
2024
- }), E.classList.toggle("marker-fuzzy", !!v.matching_text)), c.push(m);
2017
+ const m = x.getElement();
2018
+ m && (m.addEventListener("click", (E) => {
2019
+ E.stopPropagation(), u == null || u({ type: "markerClick", id: y.id });
2020
+ }), m.addEventListener("mouseenter", () => {
2021
+ u == null || u({ type: "markerMouseEnter", id: y.id });
2022
+ }), m.addEventListener("mouseleave", () => {
2023
+ u == null || u({ type: "markerMouseLeave", id: y.id });
2024
+ }), m.classList.toggle("marker-fuzzy", !!y.matching_text)), l.push(x);
2025
2025
  }
2026
2026
  },
2027
- setSelectedMarker(p) {
2028
- var y, d;
2029
- u && ((y = u.getElement()) == null || y.classList.toggle("marker-selected", !1)), u = p > -1 ? c[p] : void 0, (d = u == null ? void 0 : u.getElement()) == null || d.classList.toggle("marker-selected", !0);
2027
+ setSelectedMarker(h) {
2028
+ var g, d;
2029
+ c && ((g = c.getElement()) == null || g.classList.toggle("marker-selected", !1)), c = h > -1 ? l[h] : void 0, (d = c == null ? void 0 : c.getElement()) == null || d.classList.toggle("marker-selected", !0);
2030
2030
  },
2031
2031
  getCenterAndZoom() {
2032
- const p = r.getCenter();
2033
- return [r.getZoom(), p.lng, p.lat];
2034
- },
2035
- setShowPolygonMarker(p) {
2036
- l = p;
2032
+ const h = r.getCenter();
2033
+ return [r.getZoom(), h.lng, h.lat];
2037
2034
  }
2038
2035
  };
2039
2036
  }