@maptiler/geocoding-control 2.1.0-rc1 → 2.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.
- package/leaflet-controller.js +1942 -1523
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +1 -22
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.js +2800 -2368
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +1 -22
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.js +1918 -1498
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +1 -22
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.js +2858 -2425
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +1 -22
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.js +2863 -2428
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +1 -22
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.js +1686 -1264
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +1 -22
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.js +2785 -2353
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +1 -22
- package/openlayers.umd.js.map +1 -1
- package/package.json +19 -19
- package/react.js +800 -784
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/{MapLibreBasedGeocodingControl.d.ts → src/MapLibreBasedGeocodingControl.d.ts} +35 -69
- package/{maplibregl.d.ts → src/maplibregl.d.ts} +34 -68
- package/{maptilersdk.d.ts → src/maptilersdk.d.ts} +34 -68
- package/src/types.d.ts +391 -0
- package/svelte/GeocodingControl.svelte +55 -14
- package/svelte/GeocodingControl.svelte.d.ts +5 -2
- package/svelte/MapLibreBasedGeocodingControl.d.ts +35 -69
- package/svelte/maplibregl.d.ts +34 -68
- package/svelte/maptilersdk.d.ts +34 -68
- package/svelte/maptilersdk.js +2 -0
- package/svelte/react.js +3 -0
- package/svelte/types.d.ts +175 -127
- package/vanilla.js +870 -857
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/types.d.ts +0 -343
- /package/{geo-coordinates-parser.t.d.ts → src/geo-coordinates-parser.t.d.ts} +0 -0
- /package/{geoUtils.d.ts → src/geoUtils.d.ts} +0 -0
- /package/{leaflet-controller.d.ts → src/leaflet-controller.d.ts} +0 -0
- /package/{leaflet.d.ts → src/leaflet.d.ts} +0 -0
- /package/{maplibregl-controller.d.ts → src/maplibregl-controller.d.ts} +0 -0
- /package/{mask.d.ts → src/mask.d.ts} +0 -0
- /package/{openlayers-controller.d.ts → src/openlayers-controller.d.ts} +0 -0
- /package/{openlayers.d.ts → src/openlayers.d.ts} +0 -0
- /package/{proximity.d.ts → src/proximity.d.ts} +0 -0
- /package/{react.d.ts → src/react.d.ts} +0 -0
- /package/{vanilla.d.ts → src/vanilla.d.ts} +0 -0
package/openlayers-controller.js
CHANGED
|
@@ -1,122 +1,125 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import gt from "ol/
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
var ct = Object.defineProperty;
|
|
2
|
+
var at = (i, t, e) => t in i ? ct(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var M = (i, t, e) => at(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { Feature as se } from "ol";
|
|
5
|
+
import { Point as Re, Polygon as Fe, MultiPolygon as qe, GeometryCollection as pt, LineString as De, MultiLineString as ze } from "ol/geom";
|
|
6
|
+
import gt from "ol/layer/Vector";
|
|
7
|
+
import { fromLonLat as me, transformExtent as yt, toLonLat as Ue, getUserProjection as mt } from "ol/proj";
|
|
8
|
+
import dt from "ol/source/Vector";
|
|
9
|
+
import Ve from "ol/style/Fill";
|
|
10
|
+
import xt from "ol/style/Icon";
|
|
11
|
+
import $e from "ol/style/Stroke";
|
|
12
|
+
import wt from "ol/style/Style";
|
|
13
|
+
import Et from "ol/style/Text";
|
|
14
|
+
function Se(i, t, e = {}) {
|
|
12
15
|
const n = { type: "Feature" };
|
|
13
|
-
return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry =
|
|
16
|
+
return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry = i, n;
|
|
14
17
|
}
|
|
15
|
-
function
|
|
16
|
-
for (const r of
|
|
18
|
+
function Be(i, t, e = {}) {
|
|
19
|
+
for (const r of i) {
|
|
17
20
|
if (r.length < 4)
|
|
18
21
|
throw new Error(
|
|
19
22
|
"Each LinearRing of a Polygon must have 4 or more Positions."
|
|
20
23
|
);
|
|
21
24
|
if (r[r.length - 1].length !== r[0].length)
|
|
22
25
|
throw new Error("First and last Position are not equivalent.");
|
|
23
|
-
for (let
|
|
24
|
-
if (r[r.length - 1][
|
|
26
|
+
for (let f = 0; f < r[r.length - 1].length; f++)
|
|
27
|
+
if (r[r.length - 1][f] !== r[0][f])
|
|
25
28
|
throw new Error("First and last Position are not equivalent.");
|
|
26
29
|
}
|
|
27
|
-
return
|
|
30
|
+
return Se({
|
|
28
31
|
type: "Polygon",
|
|
29
|
-
coordinates:
|
|
32
|
+
coordinates: i
|
|
30
33
|
}, t, e);
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function Ce(i, t = {}) {
|
|
33
36
|
const e = { type: "FeatureCollection" };
|
|
34
|
-
return t.id && (e.id = t.id), t.bbox && (e.bbox = t.bbox), e.features =
|
|
37
|
+
return t.id && (e.id = t.id), t.bbox && (e.bbox = t.bbox), e.features = i, e;
|
|
35
38
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
39
|
+
function rt(i, t, e = {}) {
|
|
40
|
+
return Se({
|
|
38
41
|
type: "MultiPolygon",
|
|
39
|
-
coordinates:
|
|
42
|
+
coordinates: i
|
|
40
43
|
}, t, e);
|
|
41
44
|
}
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
44
|
-
for (var n, r,
|
|
45
|
-
|
|
46
|
-
for (var
|
|
47
|
-
var
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
switch (
|
|
45
|
+
function st(i, t, e) {
|
|
46
|
+
if (i !== null)
|
|
47
|
+
for (var n, r, f, a, c, E, d, T = 0, b = 0, P, N = i.type, _ = N === "FeatureCollection", L = N === "Feature", A = _ ? i.features.length : 1, V = 0; V < A; V++) {
|
|
48
|
+
d = _ ? i.features[V].geometry : L ? i.geometry : i, P = d ? d.type === "GeometryCollection" : !1, c = P ? d.geometries.length : 1;
|
|
49
|
+
for (var S = 0; S < c; S++) {
|
|
50
|
+
var F = 0, B = 0;
|
|
51
|
+
if (a = P ? d.geometries[S] : d, a !== null) {
|
|
52
|
+
E = a.coordinates;
|
|
53
|
+
var Y = a.type;
|
|
54
|
+
switch (T = 0, Y) {
|
|
52
55
|
case null:
|
|
53
56
|
break;
|
|
54
57
|
case "Point":
|
|
55
58
|
if (t(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
E,
|
|
60
|
+
b,
|
|
61
|
+
V,
|
|
62
|
+
F,
|
|
63
|
+
B
|
|
61
64
|
) === !1)
|
|
62
65
|
return !1;
|
|
63
|
-
|
|
66
|
+
b++, F++;
|
|
64
67
|
break;
|
|
65
68
|
case "LineString":
|
|
66
69
|
case "MultiPoint":
|
|
67
|
-
for (n = 0; n <
|
|
70
|
+
for (n = 0; n < E.length; n++) {
|
|
68
71
|
if (t(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
E[n],
|
|
73
|
+
b,
|
|
74
|
+
V,
|
|
75
|
+
F,
|
|
76
|
+
B
|
|
74
77
|
) === !1)
|
|
75
78
|
return !1;
|
|
76
|
-
|
|
79
|
+
b++, Y === "MultiPoint" && F++;
|
|
77
80
|
}
|
|
78
|
-
|
|
81
|
+
Y === "LineString" && F++;
|
|
79
82
|
break;
|
|
80
83
|
case "Polygon":
|
|
81
84
|
case "MultiLineString":
|
|
82
|
-
for (n = 0; n <
|
|
83
|
-
for (r = 0; r <
|
|
85
|
+
for (n = 0; n < E.length; n++) {
|
|
86
|
+
for (r = 0; r < E[n].length - T; r++) {
|
|
84
87
|
if (t(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
E[n][r],
|
|
89
|
+
b,
|
|
90
|
+
V,
|
|
91
|
+
F,
|
|
92
|
+
B
|
|
90
93
|
) === !1)
|
|
91
94
|
return !1;
|
|
92
|
-
|
|
95
|
+
b++;
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
Y === "MultiLineString" && F++, Y === "Polygon" && B++;
|
|
95
98
|
}
|
|
96
|
-
|
|
99
|
+
Y === "Polygon" && F++;
|
|
97
100
|
break;
|
|
98
101
|
case "MultiPolygon":
|
|
99
|
-
for (n = 0; n <
|
|
100
|
-
for (
|
|
101
|
-
for (
|
|
102
|
+
for (n = 0; n < E.length; n++) {
|
|
103
|
+
for (B = 0, r = 0; r < E[n].length; r++) {
|
|
104
|
+
for (f = 0; f < E[n][r].length - T; f++) {
|
|
102
105
|
if (t(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
E[n][r][f],
|
|
107
|
+
b,
|
|
108
|
+
V,
|
|
109
|
+
F,
|
|
110
|
+
B
|
|
108
111
|
) === !1)
|
|
109
112
|
return !1;
|
|
110
|
-
|
|
113
|
+
b++;
|
|
111
114
|
}
|
|
112
|
-
|
|
115
|
+
B++;
|
|
113
116
|
}
|
|
114
|
-
|
|
117
|
+
F++;
|
|
115
118
|
}
|
|
116
119
|
break;
|
|
117
120
|
case "GeometryCollection":
|
|
118
|
-
for (n = 0; n <
|
|
119
|
-
if (
|
|
121
|
+
for (n = 0; n < a.geometries.length; n++)
|
|
122
|
+
if (st(a.geometries[n], t) === !1)
|
|
120
123
|
return !1;
|
|
121
124
|
break;
|
|
122
125
|
default:
|
|
@@ -126,22 +129,22 @@ function Ot(o, t, e) {
|
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
|
-
function
|
|
130
|
-
var e, n, r,
|
|
131
|
-
for (e = 0; e <
|
|
132
|
-
for (
|
|
133
|
-
if (
|
|
132
|
+
function Ge(i, t) {
|
|
133
|
+
var e, n, r, f, a, c, E, d, T, b, P = 0, N = i.type === "FeatureCollection", _ = i.type === "Feature", L = N ? i.features.length : 1;
|
|
134
|
+
for (e = 0; e < L; e++) {
|
|
135
|
+
for (c = N ? i.features[e].geometry : _ ? i.geometry : i, d = N ? i.features[e].properties : _ ? i.properties : {}, T = N ? i.features[e].bbox : _ ? i.bbox : void 0, b = N ? i.features[e].id : _ ? i.id : void 0, E = c ? c.type === "GeometryCollection" : !1, a = E ? c.geometries.length : 1, r = 0; r < a; r++) {
|
|
136
|
+
if (f = E ? c.geometries[r] : c, f === null) {
|
|
134
137
|
if (t(
|
|
135
138
|
null,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
P,
|
|
140
|
+
d,
|
|
141
|
+
T,
|
|
142
|
+
b
|
|
140
143
|
) === !1)
|
|
141
144
|
return !1;
|
|
142
145
|
continue;
|
|
143
146
|
}
|
|
144
|
-
switch (
|
|
147
|
+
switch (f.type) {
|
|
145
148
|
case "Point":
|
|
146
149
|
case "LineString":
|
|
147
150
|
case "MultiPoint":
|
|
@@ -149,23 +152,23 @@ function st(o, t) {
|
|
|
149
152
|
case "MultiLineString":
|
|
150
153
|
case "MultiPolygon": {
|
|
151
154
|
if (t(
|
|
152
|
-
i,
|
|
153
|
-
h,
|
|
154
155
|
f,
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
P,
|
|
157
|
+
d,
|
|
158
|
+
T,
|
|
159
|
+
b
|
|
157
160
|
) === !1)
|
|
158
161
|
return !1;
|
|
159
162
|
break;
|
|
160
163
|
}
|
|
161
164
|
case "GeometryCollection": {
|
|
162
|
-
for (n = 0; n <
|
|
165
|
+
for (n = 0; n < f.geometries.length; n++)
|
|
163
166
|
if (t(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
f.geometries[n],
|
|
168
|
+
P,
|
|
169
|
+
d,
|
|
170
|
+
T,
|
|
171
|
+
b
|
|
169
172
|
) === !1)
|
|
170
173
|
return !1;
|
|
171
174
|
break;
|
|
@@ -174,606 +177,1052 @@ function st(o, t) {
|
|
|
174
177
|
throw new Error("Unknown Geometry Type");
|
|
175
178
|
}
|
|
176
179
|
}
|
|
177
|
-
|
|
180
|
+
P++;
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
var
|
|
183
|
-
switch (
|
|
183
|
+
function St(i, t) {
|
|
184
|
+
Ge(i, function(e, n, r, f, a) {
|
|
185
|
+
var c = e === null ? null : e.type;
|
|
186
|
+
switch (c) {
|
|
184
187
|
case null:
|
|
185
188
|
case "Point":
|
|
186
189
|
case "LineString":
|
|
187
190
|
case "Polygon":
|
|
188
191
|
return t(
|
|
189
|
-
|
|
192
|
+
Se(e, r, { bbox: f, id: a }),
|
|
190
193
|
n,
|
|
191
194
|
0
|
|
192
195
|
) === !1 ? !1 : void 0;
|
|
193
196
|
}
|
|
194
|
-
var
|
|
195
|
-
switch (
|
|
197
|
+
var E;
|
|
198
|
+
switch (c) {
|
|
196
199
|
case "MultiPoint":
|
|
197
|
-
|
|
200
|
+
E = "Point";
|
|
198
201
|
break;
|
|
199
202
|
case "MultiLineString":
|
|
200
|
-
|
|
203
|
+
E = "LineString";
|
|
201
204
|
break;
|
|
202
205
|
case "MultiPolygon":
|
|
203
|
-
|
|
206
|
+
E = "Polygon";
|
|
204
207
|
break;
|
|
205
208
|
}
|
|
206
|
-
for (var
|
|
207
|
-
var
|
|
208
|
-
type:
|
|
209
|
-
coordinates:
|
|
209
|
+
for (var d = 0; d < e.coordinates.length; d++) {
|
|
210
|
+
var T = e.coordinates[d], b = {
|
|
211
|
+
type: E,
|
|
212
|
+
coordinates: T
|
|
210
213
|
};
|
|
211
|
-
if (t(
|
|
214
|
+
if (t(Se(b, r), n, d) === !1)
|
|
212
215
|
return !1;
|
|
213
216
|
}
|
|
214
217
|
});
|
|
215
218
|
}
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
218
|
-
return
|
|
219
|
+
function vt(i, t = {}) {
|
|
220
|
+
if (i.bbox != null && t.recompute !== !0)
|
|
221
|
+
return i.bbox;
|
|
219
222
|
const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
220
|
-
return
|
|
223
|
+
return st(i, (n) => {
|
|
221
224
|
e[0] > n[0] && (e[0] = n[0]), e[1] > n[1] && (e[1] = n[1]), e[2] < n[0] && (e[2] = n[0]), e[3] < n[1] && (e[3] = n[1]);
|
|
222
225
|
}), e;
|
|
223
226
|
}
|
|
224
|
-
var
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
f = e.ops.pop(), e.trys.pop();
|
|
276
|
-
continue;
|
|
277
|
-
default:
|
|
278
|
-
if (i = e.trys, !(i = i.length > 0 && i[i.length - 1]) && (f[0] === 6 || f[0] === 2)) {
|
|
279
|
-
e = 0;
|
|
227
|
+
var Ke = vt, bt = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, _e = Math.ceil, j = Math.floor, X = "[BigNumber Error] ", Xe = X + "Number primitive has more than 15 significant digits: ", ee = 1e14, C = 14, Ye = 9007199254740991, Oe = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], ue = 1e7, W = 1e9;
|
|
228
|
+
function ot(i) {
|
|
229
|
+
var t, e, n, r = S.prototype = { constructor: S, toString: null, valueOf: null }, f = new S(1), a = 20, c = 4, E = -7, d = 21, T = -1e7, b = 1e7, P = !1, N = 1, _ = 0, L = {
|
|
230
|
+
prefix: "",
|
|
231
|
+
groupSize: 3,
|
|
232
|
+
secondaryGroupSize: 0,
|
|
233
|
+
groupSeparator: ",",
|
|
234
|
+
decimalSeparator: ".",
|
|
235
|
+
fractionGroupSize: 0,
|
|
236
|
+
fractionGroupSeparator: " ",
|
|
237
|
+
// non-breaking space
|
|
238
|
+
suffix: ""
|
|
239
|
+
}, A = "0123456789abcdefghijklmnopqrstuvwxyz", V = !0;
|
|
240
|
+
function S(s, o) {
|
|
241
|
+
var l, m, h, g, w, u, p, x, y = this;
|
|
242
|
+
if (!(y instanceof S)) return new S(s, o);
|
|
243
|
+
if (o == null) {
|
|
244
|
+
if (s && s._isBigNumber === !0) {
|
|
245
|
+
y.s = s.s, !s.c || s.e > b ? y.c = y.e = null : s.e < T ? y.c = [y.e = 0] : (y.e = s.e, y.c = s.c.slice());
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if ((u = typeof s == "number") && s * 0 == 0) {
|
|
249
|
+
if (y.s = 1 / s < 0 ? (s = -s, -1) : 1, s === ~~s) {
|
|
250
|
+
for (g = 0, w = s; w >= 10; w /= 10, g++) ;
|
|
251
|
+
g > b ? y.c = y.e = null : (y.e = g, y.c = [s]);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
x = String(s);
|
|
255
|
+
} else {
|
|
256
|
+
if (!bt.test(x = String(s))) return n(y, x, u);
|
|
257
|
+
y.s = x.charCodeAt(0) == 45 ? (x = x.slice(1), -1) : 1;
|
|
258
|
+
}
|
|
259
|
+
(g = x.indexOf(".")) > -1 && (x = x.replace(".", "")), (w = x.search(/e/i)) > 0 ? (g < 0 && (g = w), g += +x.slice(w + 1), x = x.substring(0, w)) : g < 0 && (g = x.length);
|
|
260
|
+
} else {
|
|
261
|
+
if (q(o, 2, A.length, "Base"), o == 10 && V)
|
|
262
|
+
return y = new S(s), Z(y, a + y.e + 1, c);
|
|
263
|
+
if (x = String(s), u = typeof s == "number") {
|
|
264
|
+
if (s * 0 != 0) return n(y, x, u, o);
|
|
265
|
+
if (y.s = 1 / s < 0 ? (x = x.slice(1), -1) : 1, S.DEBUG && x.replace(/^0\.0*|\./, "").length > 15)
|
|
266
|
+
throw Error(Xe + s);
|
|
267
|
+
} else
|
|
268
|
+
y.s = x.charCodeAt(0) === 45 ? (x = x.slice(1), -1) : 1;
|
|
269
|
+
for (l = A.slice(0, o), g = w = 0, p = x.length; w < p; w++)
|
|
270
|
+
if (l.indexOf(m = x.charAt(w)) < 0) {
|
|
271
|
+
if (m == ".") {
|
|
272
|
+
if (w > g) {
|
|
273
|
+
g = p;
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
} else if (!h && (x == x.toUpperCase() && (x = x.toLowerCase()) || x == x.toLowerCase() && (x = x.toUpperCase()))) {
|
|
277
|
+
h = !0, w = -1, g = 0;
|
|
280
278
|
continue;
|
|
281
279
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
if (f[0] === 6 && e.label < i[1]) {
|
|
287
|
-
e.label = i[1], i = f;
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
if (i && e.label < i[2]) {
|
|
291
|
-
e.label = i[2], e.ops.push(f);
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
i[2] && e.ops.pop(), e.trys.pop();
|
|
295
|
-
continue;
|
|
296
|
-
}
|
|
297
|
-
f = t.call(o, e);
|
|
298
|
-
} catch (a) {
|
|
299
|
-
f = [6, a], r = 0;
|
|
300
|
-
} finally {
|
|
301
|
-
n = i = 0;
|
|
280
|
+
return n(y, String(s), u, o);
|
|
281
|
+
}
|
|
282
|
+
u = !1, x = e(x, o, 10, y.s), (g = x.indexOf(".")) > -1 ? x = x.replace(".", "") : g = x.length;
|
|
302
283
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
var u = e(o, t.key);
|
|
322
|
-
if (u < 0) {
|
|
323
|
-
if (t.left === null)
|
|
324
|
-
break;
|
|
325
|
-
if (e(o, t.left.key) < 0) {
|
|
326
|
-
var l = t.left;
|
|
327
|
-
if (t.left = l.right, l.right = t, t = l, t.left === null)
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
i.left = t, i = t, t = t.left;
|
|
331
|
-
} else if (u > 0) {
|
|
332
|
-
if (t.right === null)
|
|
333
|
-
break;
|
|
334
|
-
if (e(o, t.right.key) > 0) {
|
|
335
|
-
var l = t.right;
|
|
336
|
-
if (t.right = l.left, l.left = t, t = l, t.right === null)
|
|
337
|
-
break;
|
|
284
|
+
for (w = 0; x.charCodeAt(w) === 48; w++) ;
|
|
285
|
+
for (p = x.length; x.charCodeAt(--p) === 48; ) ;
|
|
286
|
+
if (x = x.slice(w, ++p)) {
|
|
287
|
+
if (p -= w, u && S.DEBUG && p > 15 && (s > Ye || s !== j(s)))
|
|
288
|
+
throw Error(Xe + y.s * s);
|
|
289
|
+
if ((g = g - w - 1) > b)
|
|
290
|
+
y.c = y.e = null;
|
|
291
|
+
else if (g < T)
|
|
292
|
+
y.c = [y.e = 0];
|
|
293
|
+
else {
|
|
294
|
+
if (y.e = g, y.c = [], w = (g + 1) % C, g < 0 && (w += C), w < p) {
|
|
295
|
+
for (w && y.c.push(+x.slice(0, w)), p -= C; w < p; )
|
|
296
|
+
y.c.push(+x.slice(w, w += C));
|
|
297
|
+
w = C - (x = x.slice(w)).length;
|
|
298
|
+
} else
|
|
299
|
+
w -= p;
|
|
300
|
+
for (; w--; x += "0") ;
|
|
301
|
+
y.c.push(+x);
|
|
338
302
|
}
|
|
339
|
-
r.right = t, r = t, t = t.right;
|
|
340
303
|
} else
|
|
341
|
-
|
|
304
|
+
y.c = [y.e = 0];
|
|
342
305
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
306
|
+
S.clone = ot, S.ROUND_UP = 0, S.ROUND_DOWN = 1, S.ROUND_CEIL = 2, S.ROUND_FLOOR = 3, S.ROUND_HALF_UP = 4, S.ROUND_HALF_DOWN = 5, S.ROUND_HALF_EVEN = 6, S.ROUND_HALF_CEIL = 7, S.ROUND_HALF_FLOOR = 8, S.EUCLID = 9, S.config = S.set = function(s) {
|
|
307
|
+
var o, l;
|
|
308
|
+
if (s != null)
|
|
309
|
+
if (typeof s == "object") {
|
|
310
|
+
if (s.hasOwnProperty(o = "DECIMAL_PLACES") && (l = s[o], q(l, 0, W, o), a = l), s.hasOwnProperty(o = "ROUNDING_MODE") && (l = s[o], q(l, 0, 8, o), c = l), s.hasOwnProperty(o = "EXPONENTIAL_AT") && (l = s[o], l && l.pop ? (q(l[0], -1e9, 0, o), q(l[1], 0, W, o), E = l[0], d = l[1]) : (q(l, -1e9, W, o), E = -(d = l < 0 ? -l : l))), s.hasOwnProperty(o = "RANGE"))
|
|
311
|
+
if (l = s[o], l && l.pop)
|
|
312
|
+
q(l[0], -1e9, -1, o), q(l[1], 1, W, o), T = l[0], b = l[1];
|
|
313
|
+
else if (q(l, -1e9, W, o), l)
|
|
314
|
+
T = -(b = l < 0 ? -l : l);
|
|
315
|
+
else
|
|
316
|
+
throw Error(X + o + " cannot be zero: " + l);
|
|
317
|
+
if (s.hasOwnProperty(o = "CRYPTO"))
|
|
318
|
+
if (l = s[o], l === !!l)
|
|
319
|
+
if (l)
|
|
320
|
+
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
321
|
+
P = l;
|
|
322
|
+
else
|
|
323
|
+
throw P = !l, Error(X + "crypto unavailable");
|
|
324
|
+
else
|
|
325
|
+
P = l;
|
|
326
|
+
else
|
|
327
|
+
throw Error(X + o + " not true or false: " + l);
|
|
328
|
+
if (s.hasOwnProperty(o = "MODULO_MODE") && (l = s[o], q(l, 0, 9, o), N = l), s.hasOwnProperty(o = "POW_PRECISION") && (l = s[o], q(l, 0, W, o), _ = l), s.hasOwnProperty(o = "FORMAT"))
|
|
329
|
+
if (l = s[o], typeof l == "object") L = l;
|
|
330
|
+
else throw Error(X + o + " not an object: " + l);
|
|
331
|
+
if (s.hasOwnProperty(o = "ALPHABET"))
|
|
332
|
+
if (l = s[o], typeof l == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(l))
|
|
333
|
+
V = l.slice(0, 10) == "0123456789", A = l;
|
|
334
|
+
else
|
|
335
|
+
throw Error(X + o + " invalid: " + l);
|
|
336
|
+
} else
|
|
337
|
+
throw Error(X + "Object expected: " + s);
|
|
338
|
+
return {
|
|
339
|
+
DECIMAL_PLACES: a,
|
|
340
|
+
ROUNDING_MODE: c,
|
|
341
|
+
EXPONENTIAL_AT: [E, d],
|
|
342
|
+
RANGE: [T, b],
|
|
343
|
+
CRYPTO: P,
|
|
344
|
+
MODULO_MODE: N,
|
|
345
|
+
POW_PRECISION: _,
|
|
346
|
+
FORMAT: L,
|
|
347
|
+
ALPHABET: A
|
|
348
|
+
};
|
|
349
|
+
}, S.isBigNumber = function(s) {
|
|
350
|
+
if (!s || s._isBigNumber !== !0) return !1;
|
|
351
|
+
if (!S.DEBUG) return !0;
|
|
352
|
+
var o, l, m = s.c, h = s.e, g = s.s;
|
|
353
|
+
e: if ({}.toString.call(m) == "[object Array]") {
|
|
354
|
+
if ((g === 1 || g === -1) && h >= -1e9 && h <= W && h === j(h)) {
|
|
355
|
+
if (m[0] === 0) {
|
|
356
|
+
if (h === 0 && m.length === 1) return !0;
|
|
357
|
+
break e;
|
|
358
|
+
}
|
|
359
|
+
if (o = (h + 1) % C, o < 1 && (o += C), String(m[0]).length == o) {
|
|
360
|
+
for (o = 0; o < m.length; o++)
|
|
361
|
+
if (l = m[o], l < 0 || l >= ee || l !== j(l)) break e;
|
|
362
|
+
if (l !== 0) return !0;
|
|
363
|
+
}
|
|
401
364
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
365
|
+
} else if (m === null && h === null && (g === null || g === 1 || g === -1))
|
|
366
|
+
return !0;
|
|
367
|
+
throw Error(X + "Invalid BigNumber: " + s);
|
|
368
|
+
}, S.maximum = S.max = function() {
|
|
369
|
+
return B(arguments, -1);
|
|
370
|
+
}, S.minimum = S.min = function() {
|
|
371
|
+
return B(arguments, 1);
|
|
372
|
+
}, S.random = function() {
|
|
373
|
+
var s = 9007199254740992, o = Math.random() * s & 2097151 ? function() {
|
|
374
|
+
return j(Math.random() * s);
|
|
375
|
+
} : function() {
|
|
376
|
+
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
377
|
+
};
|
|
378
|
+
return function(l) {
|
|
379
|
+
var m, h, g, w, u, p = 0, x = [], y = new S(f);
|
|
380
|
+
if (l == null ? l = a : q(l, 0, W), w = _e(l / C), P)
|
|
381
|
+
if (crypto.getRandomValues) {
|
|
382
|
+
for (m = crypto.getRandomValues(new Uint32Array(w *= 2)); p < w; )
|
|
383
|
+
u = m[p] * 131072 + (m[p + 1] >>> 11), u >= 9e15 ? (h = crypto.getRandomValues(new Uint32Array(2)), m[p] = h[0], m[p + 1] = h[1]) : (x.push(u % 1e14), p += 2);
|
|
384
|
+
p = w / 2;
|
|
385
|
+
} else if (crypto.randomBytes) {
|
|
386
|
+
for (m = crypto.randomBytes(w *= 7); p < w; )
|
|
387
|
+
u = (m[p] & 31) * 281474976710656 + m[p + 1] * 1099511627776 + m[p + 2] * 4294967296 + m[p + 3] * 16777216 + (m[p + 4] << 16) + (m[p + 5] << 8) + m[p + 6], u >= 9e15 ? crypto.randomBytes(7).copy(m, p) : (x.push(u % 1e14), p += 7);
|
|
388
|
+
p = w / 7;
|
|
389
|
+
} else
|
|
390
|
+
throw P = !1, Error(X + "crypto unavailable");
|
|
391
|
+
if (!P)
|
|
392
|
+
for (; p < w; )
|
|
393
|
+
u = o(), u < 9e15 && (x[p++] = u % 1e14);
|
|
394
|
+
for (w = x[--p], l %= C, w && l && (u = Oe[C - l], x[p] = j(w / u) * u); x[p] === 0; x.pop(), p--) ;
|
|
395
|
+
if (p < 0)
|
|
396
|
+
x = [g = 0];
|
|
397
|
+
else {
|
|
398
|
+
for (g = -1; x[0] === 0; x.splice(0, 1), g -= C) ;
|
|
399
|
+
for (p = 1, u = x[0]; u >= 10; u /= 10, p++) ;
|
|
400
|
+
p < C && (g -= C - p);
|
|
409
401
|
}
|
|
410
|
-
return
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
402
|
+
return y.e = g, y.c = x, y;
|
|
403
|
+
};
|
|
404
|
+
}(), S.sum = function() {
|
|
405
|
+
for (var s = 1, o = arguments, l = new S(o[0]); s < o.length; ) l = l.plus(o[s++]);
|
|
406
|
+
return l;
|
|
407
|
+
}, e = /* @__PURE__ */ function() {
|
|
408
|
+
var s = "0123456789";
|
|
409
|
+
function o(l, m, h, g) {
|
|
410
|
+
for (var w, u = [0], p, x = 0, y = l.length; x < y; ) {
|
|
411
|
+
for (p = u.length; p--; u[p] *= m) ;
|
|
412
|
+
for (u[0] += g.indexOf(l.charAt(x++)), w = 0; w < u.length; w++)
|
|
413
|
+
u[w] > h - 1 && (u[w + 1] == null && (u[w + 1] = 0), u[w + 1] += u[w] / h | 0, u[w] %= h);
|
|
419
414
|
}
|
|
420
|
-
return
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
415
|
+
return u.reverse();
|
|
416
|
+
}
|
|
417
|
+
return function(l, m, h, g, w) {
|
|
418
|
+
var u, p, x, y, v, R, O, k, D = l.indexOf("."), U = a, I = c;
|
|
419
|
+
for (D >= 0 && (y = _, _ = 0, l = l.replace(".", ""), k = new S(m), R = k.pow(l.length - D), _ = y, k.c = o(
|
|
420
|
+
oe(J(R.c), R.e, "0"),
|
|
421
|
+
10,
|
|
422
|
+
h,
|
|
423
|
+
s
|
|
424
|
+
), k.e = k.c.length), O = o(l, m, h, w ? (u = A, s) : (u = s, A)), x = y = O.length; O[--y] == 0; O.pop()) ;
|
|
425
|
+
if (!O[0]) return u.charAt(0);
|
|
426
|
+
if (D < 0 ? --x : (R.c = O, R.e = x, R.s = g, R = t(R, k, U, I, h), O = R.c, v = R.r, x = R.e), p = x + U + 1, D = O[p], y = h / 2, v = v || p < 0 || O[p + 1] != null, v = I < 4 ? (D != null || v) && (I == 0 || I == (R.s < 0 ? 3 : 2)) : D > y || D == y && (I == 4 || v || I == 6 && O[p - 1] & 1 || I == (R.s < 0 ? 8 : 7)), p < 1 || !O[0])
|
|
427
|
+
l = v ? oe(u.charAt(1), -U, u.charAt(0)) : u.charAt(0);
|
|
428
|
+
else {
|
|
429
|
+
if (O.length = p, v)
|
|
430
|
+
for (--h; ++O[--p] > h; )
|
|
431
|
+
O[p] = 0, p || (++x, O = [1].concat(O));
|
|
432
|
+
for (y = O.length; !O[--y]; ) ;
|
|
433
|
+
for (D = 0, l = ""; D <= y; l += u.charAt(O[D++])) ;
|
|
434
|
+
l = oe(l, x, u.charAt(0));
|
|
435
|
+
}
|
|
436
|
+
return l;
|
|
437
|
+
};
|
|
438
|
+
}(), t = /* @__PURE__ */ function() {
|
|
439
|
+
function s(m, h, g) {
|
|
440
|
+
var w, u, p, x, y = 0, v = m.length, R = h % ue, O = h / ue | 0;
|
|
441
|
+
for (m = m.slice(); v--; )
|
|
442
|
+
p = m[v] % ue, x = m[v] / ue | 0, w = O * p + x * R, u = R * p + w % ue * ue + y, y = (u / g | 0) + (w / ue | 0) + O * x, m[v] = u % g;
|
|
443
|
+
return y && (m = [y].concat(m)), m;
|
|
444
|
+
}
|
|
445
|
+
function o(m, h, g, w) {
|
|
446
|
+
var u, p;
|
|
447
|
+
if (g != w)
|
|
448
|
+
p = g > w ? 1 : -1;
|
|
449
|
+
else
|
|
450
|
+
for (u = p = 0; u < g; u++)
|
|
451
|
+
if (m[u] != h[u]) {
|
|
452
|
+
p = m[u] > h[u] ? 1 : -1;
|
|
431
453
|
break;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
r++, e = e.right;
|
|
471
|
-
} else
|
|
472
|
-
n = !0;
|
|
473
|
-
return null;
|
|
474
|
-
}, o.prototype.next = function(t) {
|
|
475
|
-
var e = this._root, n = null;
|
|
476
|
-
if (t.right) {
|
|
477
|
-
for (n = t.right; n.left; )
|
|
478
|
-
n = n.left;
|
|
479
|
-
return n;
|
|
454
|
+
}
|
|
455
|
+
return p;
|
|
456
|
+
}
|
|
457
|
+
function l(m, h, g, w) {
|
|
458
|
+
for (var u = 0; g--; )
|
|
459
|
+
m[g] -= u, u = m[g] < h[g] ? 1 : 0, m[g] = u * w + m[g] - h[g];
|
|
460
|
+
for (; !m[0] && m.length > 1; m.splice(0, 1)) ;
|
|
461
|
+
}
|
|
462
|
+
return function(m, h, g, w, u) {
|
|
463
|
+
var p, x, y, v, R, O, k, D, U, I, G, $, ye, Le, Me, te, he, H = m.s == h.s ? 1 : -1, K = m.c, z = h.c;
|
|
464
|
+
if (!K || !K[0] || !z || !z[0])
|
|
465
|
+
return new S(
|
|
466
|
+
// Return NaN if either NaN, or both Infinity or 0.
|
|
467
|
+
!m.s || !h.s || (K ? z && K[0] == z[0] : !z) ? NaN : (
|
|
468
|
+
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
469
|
+
K && K[0] == 0 || !z ? H * 0 : H / 0
|
|
470
|
+
)
|
|
471
|
+
);
|
|
472
|
+
for (D = new S(H), U = D.c = [], x = m.e - h.e, H = g + x + 1, u || (u = ee, x = Q(m.e / C) - Q(h.e / C), H = H / C | 0), y = 0; z[y] == (K[y] || 0); y++) ;
|
|
473
|
+
if (z[y] > (K[y] || 0) && x--, H < 0)
|
|
474
|
+
U.push(1), v = !0;
|
|
475
|
+
else {
|
|
476
|
+
for (Le = K.length, te = z.length, y = 0, H += 2, R = j(u / (z[0] + 1)), R > 1 && (z = s(z, R, u), K = s(K, R, u), te = z.length, Le = K.length), ye = te, I = K.slice(0, te), G = I.length; G < te; I[G++] = 0) ;
|
|
477
|
+
he = z.slice(), he = [0].concat(he), Me = z[0], z[1] >= u / 2 && Me++;
|
|
478
|
+
do {
|
|
479
|
+
if (R = 0, p = o(z, I, te, G), p < 0) {
|
|
480
|
+
if ($ = I[0], te != G && ($ = $ * u + (I[1] || 0)), R = j($ / Me), R > 1)
|
|
481
|
+
for (R >= u && (R = u - 1), O = s(z, R, u), k = O.length, G = I.length; o(O, I, k, G) == 1; )
|
|
482
|
+
R--, l(O, te < k ? he : z, k, u), k = O.length, p = 1;
|
|
483
|
+
else
|
|
484
|
+
R == 0 && (p = R = 1), O = z.slice(), k = O.length;
|
|
485
|
+
if (k < G && (O = [0].concat(O)), l(I, O, G, u), G = I.length, p == -1)
|
|
486
|
+
for (; o(z, I, te, G) < 1; )
|
|
487
|
+
R++, l(I, te < G ? he : z, G, u), G = I.length;
|
|
488
|
+
} else p === 0 && (R++, I = [0]);
|
|
489
|
+
U[y++] = R, I[0] ? I[G++] = K[ye] || 0 : (I = [K[ye]], G = 1);
|
|
490
|
+
} while ((ye++ < Le || I[0] != null) && H--);
|
|
491
|
+
v = I[0] != null, U[0] || U.splice(0, 1);
|
|
480
492
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
493
|
+
if (u == ee) {
|
|
494
|
+
for (y = 1, H = U[0]; H >= 10; H /= 10, y++) ;
|
|
495
|
+
Z(D, g + (D.e = y + x * C - 1) + 1, w, v);
|
|
496
|
+
} else
|
|
497
|
+
D.e = x, D.r = +v;
|
|
498
|
+
return D;
|
|
499
|
+
};
|
|
500
|
+
}();
|
|
501
|
+
function F(s, o, l, m) {
|
|
502
|
+
var h, g, w, u, p;
|
|
503
|
+
if (l == null ? l = c : q(l, 0, 8), !s.c) return s.toString();
|
|
504
|
+
if (h = s.c[0], w = s.e, o == null)
|
|
505
|
+
p = J(s.c), p = m == 1 || m == 2 && (w <= E || w >= d) ? xe(p, w) : oe(p, w, "0");
|
|
506
|
+
else if (s = Z(new S(s), o, l), g = s.e, p = J(s.c), u = p.length, m == 1 || m == 2 && (o <= g || g <= E)) {
|
|
507
|
+
for (; u < o; p += "0", u++) ;
|
|
508
|
+
p = xe(p, g);
|
|
509
|
+
} else if (o -= w, p = oe(p, g, "0"), g + 1 > u) {
|
|
510
|
+
if (--o > 0) for (p += "."; o--; p += "0") ;
|
|
511
|
+
} else if (o += g - u, o > 0)
|
|
512
|
+
for (g + 1 == u && (p += "."); o--; p += "0") ;
|
|
513
|
+
return s.s < 0 && h ? "-" + p : p;
|
|
514
|
+
}
|
|
515
|
+
function B(s, o) {
|
|
516
|
+
for (var l, m, h = 1, g = new S(s[0]); h < s.length; h++)
|
|
517
|
+
m = new S(s[h]), (!m.s || (l = fe(g, m)) === o || l === 0 && g.s === o) && (g = m);
|
|
518
|
+
return g;
|
|
519
|
+
}
|
|
520
|
+
function Y(s, o, l) {
|
|
521
|
+
for (var m = 1, h = o.length; !o[--h]; o.pop()) ;
|
|
522
|
+
for (h = o[0]; h >= 10; h /= 10, m++) ;
|
|
523
|
+
return (l = m + l * C - 1) > b ? s.c = s.e = null : l < T ? s.c = [s.e = 0] : (s.e = l, s.c = o), s;
|
|
524
|
+
}
|
|
525
|
+
n = /* @__PURE__ */ function() {
|
|
526
|
+
var s = /^(-?)0([xbo])(?=\w[\w.]*$)/i, o = /^([^.]+)\.$/, l = /^\.([^.]+)$/, m = /^-?(Infinity|NaN)$/, h = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
527
|
+
return function(g, w, u, p) {
|
|
528
|
+
var x, y = u ? w : w.replace(h, "");
|
|
529
|
+
if (m.test(y))
|
|
530
|
+
g.s = isNaN(y) ? null : y < 0 ? -1 : 1;
|
|
531
|
+
else {
|
|
532
|
+
if (!u && (y = y.replace(s, function(v, R, O) {
|
|
533
|
+
return x = (O = O.toLowerCase()) == "x" ? 16 : O == "b" ? 2 : 8, !p || p == x ? R : v;
|
|
534
|
+
}), p && (x = p, y = y.replace(o, "$1").replace(l, "0.$1")), w != y))
|
|
535
|
+
return new S(y, x);
|
|
536
|
+
if (S.DEBUG)
|
|
537
|
+
throw Error(X + "Not a" + (p ? " base " + p : "") + " number: " + w);
|
|
538
|
+
g.s = null;
|
|
486
539
|
}
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
540
|
+
g.c = g.e = null;
|
|
541
|
+
};
|
|
542
|
+
}();
|
|
543
|
+
function Z(s, o, l, m) {
|
|
544
|
+
var h, g, w, u, p, x, y, v = s.c, R = Oe;
|
|
545
|
+
if (v) {
|
|
546
|
+
e: {
|
|
547
|
+
for (h = 1, u = v[0]; u >= 10; u /= 10, h++) ;
|
|
548
|
+
if (g = o - h, g < 0)
|
|
549
|
+
g += C, w = o, p = v[x = 0], y = j(p / R[h - w - 1] % 10);
|
|
550
|
+
else if (x = _e((g + 1) / C), x >= v.length)
|
|
551
|
+
if (m) {
|
|
552
|
+
for (; v.length <= x; v.push(0)) ;
|
|
553
|
+
p = y = 0, h = 1, g %= C, w = g - C + 1;
|
|
554
|
+
} else
|
|
555
|
+
break e;
|
|
556
|
+
else {
|
|
557
|
+
for (p = u = v[x], h = 1; u >= 10; u /= 10, h++) ;
|
|
558
|
+
g %= C, w = g - C + h, y = w < 0 ? 0 : j(p / R[h - w - 1] % 10);
|
|
559
|
+
}
|
|
560
|
+
if (m = m || o < 0 || // Are there any non-zero digits after the rounding digit?
|
|
561
|
+
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
562
|
+
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
563
|
+
v[x + 1] != null || (w < 0 ? p : p % R[h - w - 1]), m = l < 4 ? (y || m) && (l == 0 || l == (s.s < 0 ? 3 : 2)) : y > 5 || y == 5 && (l == 4 || m || l == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
564
|
+
(g > 0 ? w > 0 ? p / R[h - w] : 0 : v[x - 1]) % 10 & 1 || l == (s.s < 0 ? 8 : 7)), o < 1 || !v[0])
|
|
565
|
+
return v.length = 0, m ? (o -= s.e + 1, v[0] = R[(C - o % C) % C], s.e = -o || 0) : v[0] = s.e = 0, s;
|
|
566
|
+
if (g == 0 ? (v.length = x, u = 1, x--) : (v.length = x + 1, u = R[C - g], v[x] = w > 0 ? j(p / R[h - w] % R[w]) * u : 0), m)
|
|
567
|
+
for (; ; )
|
|
568
|
+
if (x == 0) {
|
|
569
|
+
for (g = 1, w = v[0]; w >= 10; w /= 10, g++) ;
|
|
570
|
+
for (w = v[0] += u, u = 1; w >= 10; w /= 10, u++) ;
|
|
571
|
+
g != u && (s.e++, v[0] == ee && (v[0] = 1));
|
|
572
|
+
break;
|
|
573
|
+
} else {
|
|
574
|
+
if (v[x] += u, v[x] != ee) break;
|
|
575
|
+
v[x--] = 0, u = 1;
|
|
576
|
+
}
|
|
577
|
+
for (g = v.length; v[--g] === 0; v.pop()) ;
|
|
494
578
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
579
|
+
s.e > b ? s.c = s.e = null : s.e < T && (s.c = [s.e = 0]);
|
|
580
|
+
}
|
|
581
|
+
return s;
|
|
582
|
+
}
|
|
583
|
+
function re(s) {
|
|
584
|
+
var o, l = s.e;
|
|
585
|
+
return l === null ? s.toString() : (o = J(s.c), o = l <= E || l >= d ? xe(o, l) : oe(o, l, "0"), s.s < 0 ? "-" + o : o);
|
|
586
|
+
}
|
|
587
|
+
return r.absoluteValue = r.abs = function() {
|
|
588
|
+
var s = new S(this);
|
|
589
|
+
return s.s < 0 && (s.s = 1), s;
|
|
590
|
+
}, r.comparedTo = function(s, o) {
|
|
591
|
+
return fe(this, new S(s, o));
|
|
592
|
+
}, r.decimalPlaces = r.dp = function(s, o) {
|
|
593
|
+
var l, m, h, g = this;
|
|
594
|
+
if (s != null)
|
|
595
|
+
return q(s, 0, W), o == null ? o = c : q(o, 0, 8), Z(new S(g), s + g.e + 1, o);
|
|
596
|
+
if (!(l = g.c)) return null;
|
|
597
|
+
if (m = ((h = l.length - 1) - Q(this.e / C)) * C, h = l[h]) for (; h % 10 == 0; h /= 10, m--) ;
|
|
598
|
+
return m < 0 && (m = 0), m;
|
|
599
|
+
}, r.dividedBy = r.div = function(s, o) {
|
|
600
|
+
return t(this, new S(s, o), a, c);
|
|
601
|
+
}, r.dividedToIntegerBy = r.idiv = function(s, o) {
|
|
602
|
+
return t(this, new S(s, o), 0, 1);
|
|
603
|
+
}, r.exponentiatedBy = r.pow = function(s, o) {
|
|
604
|
+
var l, m, h, g, w, u, p, x, y, v = this;
|
|
605
|
+
if (s = new S(s), s.c && !s.isInteger())
|
|
606
|
+
throw Error(X + "Exponent not an integer: " + re(s));
|
|
607
|
+
if (o != null && (o = new S(o)), u = s.e > 14, !v.c || !v.c[0] || v.c[0] == 1 && !v.e && v.c.length == 1 || !s.c || !s.c[0])
|
|
608
|
+
return y = new S(Math.pow(+re(v), u ? s.s * (2 - de(s)) : +re(s))), o ? y.mod(o) : y;
|
|
609
|
+
if (p = s.s < 0, o) {
|
|
610
|
+
if (o.c ? !o.c[0] : !o.s) return new S(NaN);
|
|
611
|
+
m = !p && v.isInteger() && o.isInteger(), m && (v = v.mod(o));
|
|
612
|
+
} else {
|
|
613
|
+
if (s.e > 9 && (v.e > 0 || v.e < -1 || (v.e == 0 ? v.c[0] > 1 || u && v.c[1] >= 24e7 : v.c[0] < 8e13 || u && v.c[0] <= 9999975e7)))
|
|
614
|
+
return g = v.s < 0 && de(s) ? -0 : 0, v.e > -1 && (g = 1 / g), new S(p ? 1 / g : g);
|
|
615
|
+
_ && (g = _e(_ / C + 2));
|
|
616
|
+
}
|
|
617
|
+
for (u ? (l = new S(0.5), p && (s.s = 1), x = de(s)) : (h = Math.abs(+re(s)), x = h % 2), y = new S(f); ; ) {
|
|
618
|
+
if (x) {
|
|
619
|
+
if (y = y.times(v), !y.c) break;
|
|
620
|
+
g ? y.c.length > g && (y.c.length = g) : m && (y = y.mod(o));
|
|
500
621
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}, o.prototype.load = function(t, e, n) {
|
|
507
|
-
e === void 0 && (e = []), n === void 0 && (n = !1);
|
|
508
|
-
var r = t.length, i = this._comparator;
|
|
509
|
-
if (n && rt(t, e, 0, r - 1, i), this._root === null)
|
|
510
|
-
this._root = et(t, e, 0, r), this._size = r;
|
|
622
|
+
if (h) {
|
|
623
|
+
if (h = j(h / 2), h === 0) break;
|
|
624
|
+
x = h % 2;
|
|
625
|
+
} else if (s = s.times(l), Z(s, s.e + 1, 1), s.e > 14)
|
|
626
|
+
x = de(s);
|
|
511
627
|
else {
|
|
512
|
-
|
|
513
|
-
|
|
628
|
+
if (h = +re(s), h === 0) break;
|
|
629
|
+
x = h % 2;
|
|
514
630
|
}
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
631
|
+
v = v.times(v), g ? v.c && v.c.length > g && (v.c.length = g) : m && (v = v.mod(o));
|
|
632
|
+
}
|
|
633
|
+
return m ? y : (p && (y = f.div(y)), o ? y.mod(o) : g ? Z(y, _, c, w) : y);
|
|
634
|
+
}, r.integerValue = function(s) {
|
|
635
|
+
var o = new S(this);
|
|
636
|
+
return s == null ? s = c : q(s, 0, 8), Z(o, o.e + 1, s);
|
|
637
|
+
}, r.isEqualTo = r.eq = function(s, o) {
|
|
638
|
+
return fe(this, new S(s, o)) === 0;
|
|
639
|
+
}, r.isFinite = function() {
|
|
640
|
+
return !!this.c;
|
|
641
|
+
}, r.isGreaterThan = r.gt = function(s, o) {
|
|
642
|
+
return fe(this, new S(s, o)) > 0;
|
|
643
|
+
}, r.isGreaterThanOrEqualTo = r.gte = function(s, o) {
|
|
644
|
+
return (o = fe(this, new S(s, o))) === 1 || o === 0;
|
|
645
|
+
}, r.isInteger = function() {
|
|
646
|
+
return !!this.c && Q(this.e / C) > this.c.length - 2;
|
|
647
|
+
}, r.isLessThan = r.lt = function(s, o) {
|
|
648
|
+
return fe(this, new S(s, o)) < 0;
|
|
649
|
+
}, r.isLessThanOrEqualTo = r.lte = function(s, o) {
|
|
650
|
+
return (o = fe(this, new S(s, o))) === -1 || o === 0;
|
|
651
|
+
}, r.isNaN = function() {
|
|
652
|
+
return !this.s;
|
|
653
|
+
}, r.isNegative = function() {
|
|
654
|
+
return this.s < 0;
|
|
655
|
+
}, r.isPositive = function() {
|
|
656
|
+
return this.s > 0;
|
|
657
|
+
}, r.isZero = function() {
|
|
658
|
+
return !!this.c && this.c[0] == 0;
|
|
659
|
+
}, r.minus = function(s, o) {
|
|
660
|
+
var l, m, h, g, w = this, u = w.s;
|
|
661
|
+
if (s = new S(s, o), o = s.s, !u || !o) return new S(NaN);
|
|
662
|
+
if (u != o)
|
|
663
|
+
return s.s = -o, w.plus(s);
|
|
664
|
+
var p = w.e / C, x = s.e / C, y = w.c, v = s.c;
|
|
665
|
+
if (!p || !x) {
|
|
666
|
+
if (!y || !v) return y ? (s.s = -o, s) : new S(v ? w : NaN);
|
|
667
|
+
if (!y[0] || !v[0])
|
|
668
|
+
return v[0] ? (s.s = -o, s) : new S(y[0] ? w : (
|
|
669
|
+
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
670
|
+
c == 3 ? -0 : 0
|
|
671
|
+
));
|
|
672
|
+
}
|
|
673
|
+
if (p = Q(p), x = Q(x), y = y.slice(), u = p - x) {
|
|
674
|
+
for ((g = u < 0) ? (u = -u, h = y) : (x = p, h = v), h.reverse(), o = u; o--; h.push(0)) ;
|
|
675
|
+
h.reverse();
|
|
676
|
+
} else
|
|
677
|
+
for (m = (g = (u = y.length) < (o = v.length)) ? u : o, u = o = 0; o < m; o++)
|
|
678
|
+
if (y[o] != v[o]) {
|
|
679
|
+
g = y[o] < v[o];
|
|
680
|
+
break;
|
|
564
681
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
);
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
return
|
|
592
|
-
}
|
|
593
|
-
|
|
682
|
+
if (g && (h = y, y = v, v = h, s.s = -s.s), o = (m = v.length) - (l = y.length), o > 0) for (; o--; y[l++] = 0) ;
|
|
683
|
+
for (o = ee - 1; m > u; ) {
|
|
684
|
+
if (y[--m] < v[m]) {
|
|
685
|
+
for (l = m; l && !y[--l]; y[l] = o) ;
|
|
686
|
+
--y[l], y[m] += ee;
|
|
687
|
+
}
|
|
688
|
+
y[m] -= v[m];
|
|
689
|
+
}
|
|
690
|
+
for (; y[0] == 0; y.splice(0, 1), --x) ;
|
|
691
|
+
return y[0] ? Y(s, y, x) : (s.s = c == 3 ? -1 : 1, s.c = [s.e = 0], s);
|
|
692
|
+
}, r.modulo = r.mod = function(s, o) {
|
|
693
|
+
var l, m, h = this;
|
|
694
|
+
return s = new S(s, o), !h.c || !s.s || s.c && !s.c[0] ? new S(NaN) : !s.c || h.c && !h.c[0] ? new S(h) : (N == 9 ? (m = s.s, s.s = 1, l = t(h, s, 0, 3), s.s = m, l.s *= m) : l = t(h, s, 0, N), s = h.minus(l.times(s)), !s.c[0] && N == 1 && (s.s = h.s), s);
|
|
695
|
+
}, r.multipliedBy = r.times = function(s, o) {
|
|
696
|
+
var l, m, h, g, w, u, p, x, y, v, R, O, k, D, U, I = this, G = I.c, $ = (s = new S(s, o)).c;
|
|
697
|
+
if (!G || !$ || !G[0] || !$[0])
|
|
698
|
+
return !I.s || !s.s || G && !G[0] && !$ || $ && !$[0] && !G ? s.c = s.e = s.s = null : (s.s *= I.s, !G || !$ ? s.c = s.e = null : (s.c = [0], s.e = 0)), s;
|
|
699
|
+
for (m = Q(I.e / C) + Q(s.e / C), s.s *= I.s, p = G.length, v = $.length, p < v && (k = G, G = $, $ = k, h = p, p = v, v = h), h = p + v, k = []; h--; k.push(0)) ;
|
|
700
|
+
for (D = ee, U = ue, h = v; --h >= 0; ) {
|
|
701
|
+
for (l = 0, R = $[h] % U, O = $[h] / U | 0, w = p, g = h + w; g > h; )
|
|
702
|
+
x = G[--w] % U, y = G[w] / U | 0, u = O * x + y * R, x = R * x + u % U * U + k[g] + l, l = (x / D | 0) + (u / U | 0) + O * y, k[g--] = x % D;
|
|
703
|
+
k[g] = l;
|
|
704
|
+
}
|
|
705
|
+
return l ? ++m : k.splice(0, 1), Y(s, k, m);
|
|
706
|
+
}, r.negated = function() {
|
|
707
|
+
var s = new S(this);
|
|
708
|
+
return s.s = -s.s || null, s;
|
|
709
|
+
}, r.plus = function(s, o) {
|
|
710
|
+
var l, m = this, h = m.s;
|
|
711
|
+
if (s = new S(s, o), o = s.s, !h || !o) return new S(NaN);
|
|
712
|
+
if (h != o)
|
|
713
|
+
return s.s = -o, m.minus(s);
|
|
714
|
+
var g = m.e / C, w = s.e / C, u = m.c, p = s.c;
|
|
715
|
+
if (!g || !w) {
|
|
716
|
+
if (!u || !p) return new S(h / 0);
|
|
717
|
+
if (!u[0] || !p[0]) return p[0] ? s : new S(u[0] ? m : h * 0);
|
|
718
|
+
}
|
|
719
|
+
if (g = Q(g), w = Q(w), u = u.slice(), h = g - w) {
|
|
720
|
+
for (h > 0 ? (w = g, l = p) : (h = -h, l = u), l.reverse(); h--; l.push(0)) ;
|
|
721
|
+
l.reverse();
|
|
722
|
+
}
|
|
723
|
+
for (h = u.length, o = p.length, h - o < 0 && (l = p, p = u, u = l, o = h), h = 0; o; )
|
|
724
|
+
h = (u[--o] = u[o] + p[o] + h) / ee | 0, u[o] = ee === u[o] ? 0 : u[o] % ee;
|
|
725
|
+
return h && (u = [h].concat(u), ++w), Y(s, u, w);
|
|
726
|
+
}, r.precision = r.sd = function(s, o) {
|
|
727
|
+
var l, m, h, g = this;
|
|
728
|
+
if (s != null && s !== !!s)
|
|
729
|
+
return q(s, 1, W), o == null ? o = c : q(o, 0, 8), Z(new S(g), s, o);
|
|
730
|
+
if (!(l = g.c)) return null;
|
|
731
|
+
if (h = l.length - 1, m = h * C + 1, h = l[h]) {
|
|
732
|
+
for (; h % 10 == 0; h /= 10, m--) ;
|
|
733
|
+
for (h = l[0]; h >= 10; h /= 10, m++) ;
|
|
734
|
+
}
|
|
735
|
+
return s && g.e + 1 > m && (m = g.e + 1), m;
|
|
736
|
+
}, r.shiftedBy = function(s) {
|
|
737
|
+
return q(s, -9007199254740991, Ye), this.times("1e" + s);
|
|
738
|
+
}, r.squareRoot = r.sqrt = function() {
|
|
739
|
+
var s, o, l, m, h, g = this, w = g.c, u = g.s, p = g.e, x = a + 4, y = new S("0.5");
|
|
740
|
+
if (u !== 1 || !w || !w[0])
|
|
741
|
+
return new S(!u || u < 0 && (!w || w[0]) ? NaN : w ? g : 1 / 0);
|
|
742
|
+
if (u = Math.sqrt(+re(g)), u == 0 || u == 1 / 0 ? (o = J(w), (o.length + p) % 2 == 0 && (o += "0"), u = Math.sqrt(+o), p = Q((p + 1) / 2) - (p < 0 || p % 2), u == 1 / 0 ? o = "5e" + p : (o = u.toExponential(), o = o.slice(0, o.indexOf("e") + 1) + p), l = new S(o)) : l = new S(u + ""), l.c[0]) {
|
|
743
|
+
for (p = l.e, u = p + x, u < 3 && (u = 0); ; )
|
|
744
|
+
if (h = l, l = y.times(h.plus(t(g, h, x, 1))), J(h.c).slice(0, u) === (o = J(l.c)).slice(0, u))
|
|
745
|
+
if (l.e < p && --u, o = o.slice(u - 3, u + 1), o == "9999" || !m && o == "4999") {
|
|
746
|
+
if (!m && (Z(h, h.e + a + 2, 0), h.times(h).eq(g))) {
|
|
747
|
+
l = h;
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
x += 4, u += 4, m = 1;
|
|
751
|
+
} else {
|
|
752
|
+
(!+o || !+o.slice(1) && o.charAt(0) == "5") && (Z(l, l.e + a + 2, 1), s = !l.times(l).eq(g));
|
|
753
|
+
break;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return Z(l, l.e + a + 1, c, s);
|
|
757
|
+
}, r.toExponential = function(s, o) {
|
|
758
|
+
return s != null && (q(s, 0, W), s++), F(this, s, o, 1);
|
|
759
|
+
}, r.toFixed = function(s, o) {
|
|
760
|
+
return s != null && (q(s, 0, W), s = s + this.e + 1), F(this, s, o);
|
|
761
|
+
}, r.toFormat = function(s, o, l) {
|
|
762
|
+
var m, h = this;
|
|
763
|
+
if (l == null)
|
|
764
|
+
s != null && o && typeof o == "object" ? (l = o, o = null) : s && typeof s == "object" ? (l = s, s = o = null) : l = L;
|
|
765
|
+
else if (typeof l != "object")
|
|
766
|
+
throw Error(X + "Argument not an object: " + l);
|
|
767
|
+
if (m = h.toFixed(s, o), h.c) {
|
|
768
|
+
var g, w = m.split("."), u = +l.groupSize, p = +l.secondaryGroupSize, x = l.groupSeparator || "", y = w[0], v = w[1], R = h.s < 0, O = R ? y.slice(1) : y, k = O.length;
|
|
769
|
+
if (p && (g = u, u = p, p = g, k -= g), u > 0 && k > 0) {
|
|
770
|
+
for (g = k % u || u, y = O.substr(0, g); g < k; g += u) y += x + O.substr(g, u);
|
|
771
|
+
p > 0 && (y += x + O.slice(g)), R && (y = "-" + y);
|
|
772
|
+
}
|
|
773
|
+
m = v ? y + (l.decimalSeparator || "") + ((p = +l.fractionGroupSize) ? v.replace(
|
|
774
|
+
new RegExp("\\d{" + p + "}\\B", "g"),
|
|
775
|
+
"$&" + (l.fractionGroupSeparator || "")
|
|
776
|
+
) : v) : y;
|
|
777
|
+
}
|
|
778
|
+
return (l.prefix || "") + m + (l.suffix || "");
|
|
779
|
+
}, r.toFraction = function(s) {
|
|
780
|
+
var o, l, m, h, g, w, u, p, x, y, v, R, O = this, k = O.c;
|
|
781
|
+
if (s != null && (u = new S(s), !u.isInteger() && (u.c || u.s !== 1) || u.lt(f)))
|
|
782
|
+
throw Error(X + "Argument " + (u.isInteger() ? "out of range: " : "not an integer: ") + re(u));
|
|
783
|
+
if (!k) return new S(O);
|
|
784
|
+
for (o = new S(f), x = l = new S(f), m = p = new S(f), R = J(k), g = o.e = R.length - O.e - 1, o.c[0] = Oe[(w = g % C) < 0 ? C + w : w], s = !s || u.comparedTo(o) > 0 ? g > 0 ? o : x : u, w = b, b = 1 / 0, u = new S(R), p.c[0] = 0; y = t(u, o, 0, 1), h = l.plus(y.times(m)), h.comparedTo(s) != 1; )
|
|
785
|
+
l = m, m = h, x = p.plus(y.times(h = x)), p = h, o = u.minus(y.times(h = o)), u = h;
|
|
786
|
+
return h = t(s.minus(l), m, 0, 1), p = p.plus(h.times(x)), l = l.plus(h.times(m)), p.s = x.s = O.s, g = g * 2, v = t(x, m, g, c).minus(O).abs().comparedTo(
|
|
787
|
+
t(p, l, g, c).minus(O).abs()
|
|
788
|
+
) < 1 ? [x, m] : [p, l], b = w, v;
|
|
789
|
+
}, r.toNumber = function() {
|
|
790
|
+
return +re(this);
|
|
791
|
+
}, r.toPrecision = function(s, o) {
|
|
792
|
+
return s != null && q(s, 1, W), F(this, s, o, 2);
|
|
793
|
+
}, r.toString = function(s) {
|
|
794
|
+
var o, l = this, m = l.s, h = l.e;
|
|
795
|
+
return h === null ? m ? (o = "Infinity", m < 0 && (o = "-" + o)) : o = "NaN" : (s == null ? o = h <= E || h >= d ? xe(J(l.c), h) : oe(J(l.c), h, "0") : s === 10 && V ? (l = Z(new S(l), a + h + 1, c), o = oe(J(l.c), l.e, "0")) : (q(s, 2, A.length, "Base"), o = e(oe(J(l.c), h, "0"), 10, s, m, !0)), m < 0 && l.c[0] && (o = "-" + o)), o;
|
|
796
|
+
}, r.valueOf = r.toJSON = function() {
|
|
797
|
+
return re(this);
|
|
798
|
+
}, r._isBigNumber = !0, r[Symbol.toStringTag] = "BigNumber", r[Symbol.for("nodejs.util.inspect.custom")] = r.valueOf, i != null && S.set(i), S;
|
|
594
799
|
}
|
|
595
|
-
function
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
return i !== null ? r.next = i : u !== null && (r.next = u), n.next;
|
|
800
|
+
function Q(i) {
|
|
801
|
+
var t = i | 0;
|
|
802
|
+
return i > 0 || i === t ? t : t - 1;
|
|
599
803
|
}
|
|
600
|
-
function
|
|
601
|
-
|
|
602
|
-
for (
|
|
603
|
-
|
|
604
|
-
u++;
|
|
605
|
-
while (r(o[u], i) < 0);
|
|
606
|
-
do
|
|
607
|
-
l--;
|
|
608
|
-
while (r(o[l], i) > 0);
|
|
609
|
-
if (u >= l)
|
|
610
|
-
break;
|
|
611
|
-
var c = o[u];
|
|
612
|
-
o[u] = o[l], o[l] = c, c = t[u], t[u] = t[l], t[l] = c;
|
|
613
|
-
}
|
|
614
|
-
rt(o, t, e, l, r), rt(o, t, l + 1, n, r);
|
|
804
|
+
function J(i) {
|
|
805
|
+
for (var t, e, n = 1, r = i.length, f = i[0] + ""; n < r; ) {
|
|
806
|
+
for (t = i[n++] + "", e = C - t.length; e--; t = "0" + t) ;
|
|
807
|
+
f += t;
|
|
615
808
|
}
|
|
809
|
+
for (r = f.length; f.charCodeAt(--r) === 48; ) ;
|
|
810
|
+
return f.slice(0, r + 1 || 1);
|
|
616
811
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
if (
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
u = i + f, c = u - i, l = i - (u - c) + (f - c), f = t[++s], i = u, l !== 0 && (r[g++] = l);
|
|
627
|
-
for (; h < e; )
|
|
628
|
-
u = i + a, c = u - i, l = i - (u - c) + (a - c), a = n[++h], i = u, l !== 0 && (r[g++] = l);
|
|
629
|
-
return (i !== 0 || g === 0) && (r[g++] = i), g;
|
|
812
|
+
function fe(i, t) {
|
|
813
|
+
var e, n, r = i.c, f = t.c, a = i.s, c = t.s, E = i.e, d = t.e;
|
|
814
|
+
if (!a || !c) return null;
|
|
815
|
+
if (e = r && !r[0], n = f && !f[0], e || n) return e ? n ? 0 : -c : a;
|
|
816
|
+
if (a != c) return a;
|
|
817
|
+
if (e = a < 0, n = E == d, !r || !f) return n ? 0 : !r ^ e ? 1 : -1;
|
|
818
|
+
if (!n) return E > d ^ e ? 1 : -1;
|
|
819
|
+
for (c = (E = r.length) < (d = f.length) ? E : d, a = 0; a < c; a++) if (r[a] != f[a]) return r[a] > f[a] ^ e ? 1 : -1;
|
|
820
|
+
return E == d ? 0 : E > d ^ e ? 1 : -1;
|
|
630
821
|
}
|
|
631
|
-
function
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
return e;
|
|
822
|
+
function q(i, t, e, n) {
|
|
823
|
+
if (i < t || i > e || i !== j(i))
|
|
824
|
+
throw Error(X + (n || "Argument") + (typeof i == "number" ? i < t || i > e ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(i));
|
|
635
825
|
}
|
|
636
|
-
function
|
|
637
|
-
|
|
826
|
+
function de(i) {
|
|
827
|
+
var t = i.c.length - 1;
|
|
828
|
+
return Q(i.e / C) == t && i.c[t] % 2 != 0;
|
|
638
829
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
let l, c, f, a, s, h, g, y, p, d, x, v, w, m, E, b, M, S;
|
|
642
|
-
const L = o - r, I = e - r, k = t - i, C = n - i;
|
|
643
|
-
m = L * C, h = _ * L, g = h - (h - L), y = L - g, h = _ * C, p = h - (h - C), d = C - p, E = y * d - (m - g * p - y * p - g * d), b = k * I, h = _ * k, g = h - (h - k), y = k - g, h = _ * I, p = h - (h - I), d = I - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, T[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, T[1] = w - (x + s) + (s - b), S = v + x, s = S - v, T[2] = v - (S - s) + (x - s), T[3] = S;
|
|
644
|
-
let O = ne(4, T), q = ie * u;
|
|
645
|
-
if (O >= q || -O >= q || (s = o - L, l = o - (L + s) + (s - r), s = e - I, f = e - (I + s) + (s - r), s = t - k, c = t - (k + s) + (s - i), s = n - C, a = n - (C + s) + (s - i), l === 0 && c === 0 && f === 0 && a === 0) || (q = oe * u + ee * Math.abs(O), O += L * a + C * l - (k * f + I * c), O >= q || -O >= q)) return O;
|
|
646
|
-
m = l * C, h = _ * l, g = h - (h - l), y = l - g, h = _ * C, p = h - (h - C), d = C - p, E = y * d - (m - g * p - y * p - g * d), b = c * I, h = _ * c, g = h - (h - c), y = c - g, h = _ * I, p = h - (h - I), d = I - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, P[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, P[1] = w - (x + s) + (s - b), S = v + x, s = S - v, P[2] = v - (S - s) + (x - s), P[3] = S;
|
|
647
|
-
const Gt = K(4, T, 4, P, dt);
|
|
648
|
-
m = L * a, h = _ * L, g = h - (h - L), y = L - g, h = _ * a, p = h - (h - a), d = a - p, E = y * d - (m - g * p - y * p - g * d), b = k * f, h = _ * k, g = h - (h - k), y = k - g, h = _ * f, p = h - (h - f), d = f - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, P[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, P[1] = w - (x + s) + (s - b), S = v + x, s = S - v, P[2] = v - (S - s) + (x - s), P[3] = S;
|
|
649
|
-
const Bt = K(Gt, dt, 4, P, vt);
|
|
650
|
-
m = l * a, h = _ * l, g = h - (h - l), y = l - g, h = _ * a, p = h - (h - a), d = a - p, E = y * d - (m - g * p - y * p - g * d), b = c * f, h = _ * c, g = h - (h - c), y = c - g, h = _ * f, p = h - (h - f), d = f - p, M = y * d - (b - g * p - y * p - g * d), x = E - M, s = E - x, P[0] = E - (x + s) + (s - M), v = m + x, s = v - m, w = m - (v - s) + (x - s), x = w - b, s = w - x, P[1] = w - (x + s) + (s - b), S = v + x, s = S - v, P[2] = v - (S - s) + (x - s), P[3] = S;
|
|
651
|
-
const zt = K(Bt, vt, 4, P, mt);
|
|
652
|
-
return mt[zt - 1];
|
|
830
|
+
function xe(i, t) {
|
|
831
|
+
return (i.length > 1 ? i.charAt(0) + "." + i.slice(1) : i) + (t < 0 ? "e" : "e+") + t;
|
|
653
832
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
656
|
-
|
|
833
|
+
function oe(i, t, e) {
|
|
834
|
+
var n, r;
|
|
835
|
+
if (t < 0) {
|
|
836
|
+
for (r = e + "."; ++t; r += e) ;
|
|
837
|
+
i = r + i;
|
|
838
|
+
} else if (n = i.length, ++t > n) {
|
|
839
|
+
for (r = e, t -= n; --t; r += e) ;
|
|
840
|
+
i += r;
|
|
841
|
+
} else t < n && (i = i.slice(0, t) + "." + i.slice(t));
|
|
842
|
+
return i;
|
|
657
843
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
};
|
|
671
|
-
};
|
|
672
|
-
let B = Number.EPSILON;
|
|
673
|
-
B === void 0 && (B = Math.pow(2, -52));
|
|
674
|
-
const ue = B * B, wt = (o, t) => {
|
|
675
|
-
if (-B < o && o < B && -B < t && t < B)
|
|
676
|
-
return 0;
|
|
677
|
-
const e = o - t;
|
|
678
|
-
return e * e < ue * o * t ? 0 : o < t ? -1 : 1;
|
|
679
|
-
};
|
|
680
|
-
class fe {
|
|
844
|
+
var ne = ot(), Tt = class {
|
|
845
|
+
constructor(i) {
|
|
846
|
+
M(this, "key");
|
|
847
|
+
M(this, "left", null);
|
|
848
|
+
M(this, "right", null);
|
|
849
|
+
this.key = i;
|
|
850
|
+
}
|
|
851
|
+
}, ce = class extends Tt {
|
|
852
|
+
constructor(i) {
|
|
853
|
+
super(i);
|
|
854
|
+
}
|
|
855
|
+
}, Pt = class {
|
|
681
856
|
constructor() {
|
|
682
|
-
this
|
|
857
|
+
M(this, "size", 0);
|
|
858
|
+
M(this, "modificationCount", 0);
|
|
859
|
+
M(this, "splayCount", 0);
|
|
683
860
|
}
|
|
684
|
-
|
|
685
|
-
|
|
861
|
+
splay(i) {
|
|
862
|
+
const t = this.root;
|
|
863
|
+
if (t == null)
|
|
864
|
+
return this.compare(i, i), -1;
|
|
865
|
+
let e = null, n = null, r = null, f = null, a = t;
|
|
866
|
+
const c = this.compare;
|
|
867
|
+
let E;
|
|
868
|
+
for (; ; )
|
|
869
|
+
if (E = c(a.key, i), E > 0) {
|
|
870
|
+
let d = a.left;
|
|
871
|
+
if (d == null || (E = c(d.key, i), E > 0 && (a.left = d.right, d.right = a, a = d, d = a.left, d == null)))
|
|
872
|
+
break;
|
|
873
|
+
e == null ? n = a : e.left = a, e = a, a = d;
|
|
874
|
+
} else if (E < 0) {
|
|
875
|
+
let d = a.right;
|
|
876
|
+
if (d == null || (E = c(d.key, i), E < 0 && (a.right = d.left, d.left = a, a = d, d = a.right, d == null)))
|
|
877
|
+
break;
|
|
878
|
+
r == null ? f = a : r.right = a, r = a, a = d;
|
|
879
|
+
} else
|
|
880
|
+
break;
|
|
881
|
+
return r != null && (r.right = a.left, a.left = f), e != null && (e.left = a.right, a.right = n), this.root !== a && (this.root = a, this.splayCount++), E;
|
|
882
|
+
}
|
|
883
|
+
splayMin(i) {
|
|
884
|
+
let t = i, e = t.left;
|
|
885
|
+
for (; e != null; ) {
|
|
886
|
+
const n = e;
|
|
887
|
+
t.left = n.right, n.right = t, t = n, e = t.left;
|
|
888
|
+
}
|
|
889
|
+
return t;
|
|
890
|
+
}
|
|
891
|
+
splayMax(i) {
|
|
892
|
+
let t = i, e = t.right;
|
|
893
|
+
for (; e != null; ) {
|
|
894
|
+
const n = e;
|
|
895
|
+
t.right = n.left, n.left = t, t = n, e = t.right;
|
|
896
|
+
}
|
|
897
|
+
return t;
|
|
898
|
+
}
|
|
899
|
+
_delete(i) {
|
|
900
|
+
if (this.root == null || this.splay(i) != 0) return null;
|
|
901
|
+
let e = this.root;
|
|
902
|
+
const n = e, r = e.left;
|
|
903
|
+
if (this.size--, r == null)
|
|
904
|
+
this.root = e.right;
|
|
905
|
+
else {
|
|
906
|
+
const f = e.right;
|
|
907
|
+
e = this.splayMax(r), e.right = f, this.root = e;
|
|
908
|
+
}
|
|
909
|
+
return this.modificationCount++, n;
|
|
910
|
+
}
|
|
911
|
+
addNewRoot(i, t) {
|
|
912
|
+
this.size++, this.modificationCount++;
|
|
913
|
+
const e = this.root;
|
|
914
|
+
if (e == null) {
|
|
915
|
+
this.root = i;
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
t < 0 ? (i.left = e, i.right = e.right, e.right = null) : (i.right = e, i.left = e.left, e.left = null), this.root = i;
|
|
919
|
+
}
|
|
920
|
+
_first() {
|
|
921
|
+
const i = this.root;
|
|
922
|
+
return i == null ? null : (this.root = this.splayMin(i), this.root);
|
|
686
923
|
}
|
|
687
|
-
|
|
924
|
+
_last() {
|
|
925
|
+
const i = this.root;
|
|
926
|
+
return i == null ? null : (this.root = this.splayMax(i), this.root);
|
|
927
|
+
}
|
|
928
|
+
clear() {
|
|
929
|
+
this.root = null, this.size = 0, this.modificationCount++;
|
|
930
|
+
}
|
|
931
|
+
has(i) {
|
|
932
|
+
return this.validKey(i) && this.splay(i) == 0;
|
|
933
|
+
}
|
|
934
|
+
defaultCompare() {
|
|
935
|
+
return (i, t) => i < t ? -1 : i > t ? 1 : 0;
|
|
936
|
+
}
|
|
937
|
+
wrap() {
|
|
688
938
|
return {
|
|
689
|
-
|
|
690
|
-
|
|
939
|
+
getRoot: () => this.root,
|
|
940
|
+
setRoot: (i) => {
|
|
941
|
+
this.root = i;
|
|
942
|
+
},
|
|
943
|
+
getSize: () => this.size,
|
|
944
|
+
getModificationCount: () => this.modificationCount,
|
|
945
|
+
getSplayCount: () => this.splayCount,
|
|
946
|
+
setSplayCount: (i) => {
|
|
947
|
+
this.splayCount = i;
|
|
948
|
+
},
|
|
949
|
+
splay: (i) => this.splay(i),
|
|
950
|
+
has: (i) => this.has(i)
|
|
691
951
|
};
|
|
692
952
|
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
this
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
// remain left endpoints during splitting (never change to
|
|
702
|
-
// right). No - it wouldn't, because we snap intersections
|
|
703
|
-
// to endpoints (to establish independence from the segment
|
|
704
|
-
// angle for t-intersections).
|
|
705
|
-
round(t) {
|
|
706
|
-
const e = this.tree.add(t), n = this.tree.prev(e);
|
|
707
|
-
if (n !== null && wt(e.key, n.key) === 0)
|
|
708
|
-
return this.tree.remove(t), n.key;
|
|
709
|
-
const r = this.tree.next(e);
|
|
710
|
-
return r !== null && wt(e.key, r.key) === 0 ? (this.tree.remove(t), r.key) : t;
|
|
953
|
+
}, it, nt, ve = class pe extends Pt {
|
|
954
|
+
constructor(e, n) {
|
|
955
|
+
super();
|
|
956
|
+
M(this, "root", null);
|
|
957
|
+
M(this, "compare");
|
|
958
|
+
M(this, "validKey");
|
|
959
|
+
M(this, it, "[object Set]");
|
|
960
|
+
this.compare = e ?? this.defaultCompare(), this.validKey = n ?? ((r) => r != null && r != null);
|
|
711
961
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
962
|
+
delete(e) {
|
|
963
|
+
return this.validKey(e) ? this._delete(e) != null : !1;
|
|
964
|
+
}
|
|
965
|
+
deleteAll(e) {
|
|
966
|
+
for (const n of e)
|
|
967
|
+
this.delete(n);
|
|
968
|
+
}
|
|
969
|
+
forEach(e) {
|
|
970
|
+
const n = this[Symbol.iterator]();
|
|
971
|
+
let r;
|
|
972
|
+
for (; r = n.next(), !r.done; )
|
|
973
|
+
e(r.value, r.value, this);
|
|
974
|
+
}
|
|
975
|
+
add(e) {
|
|
976
|
+
const n = this.splay(e);
|
|
977
|
+
return n != 0 && this.addNewRoot(new ce(e), n), this;
|
|
978
|
+
}
|
|
979
|
+
addAndReturn(e) {
|
|
980
|
+
const n = this.splay(e);
|
|
981
|
+
return n != 0 && this.addNewRoot(new ce(e), n), this.root.key;
|
|
982
|
+
}
|
|
983
|
+
addAll(e) {
|
|
984
|
+
for (const n of e)
|
|
985
|
+
this.add(n);
|
|
986
|
+
}
|
|
987
|
+
isEmpty() {
|
|
988
|
+
return this.root == null;
|
|
989
|
+
}
|
|
990
|
+
isNotEmpty() {
|
|
991
|
+
return this.root != null;
|
|
992
|
+
}
|
|
993
|
+
single() {
|
|
994
|
+
if (this.size == 0) throw "Bad state: No element";
|
|
995
|
+
if (this.size > 1) throw "Bad state: Too many element";
|
|
996
|
+
return this.root.key;
|
|
997
|
+
}
|
|
998
|
+
first() {
|
|
999
|
+
if (this.size == 0) throw "Bad state: No element";
|
|
1000
|
+
return this._first().key;
|
|
1001
|
+
}
|
|
1002
|
+
last() {
|
|
1003
|
+
if (this.size == 0) throw "Bad state: No element";
|
|
1004
|
+
return this._last().key;
|
|
1005
|
+
}
|
|
1006
|
+
lastBefore(e) {
|
|
1007
|
+
if (e == null) throw "Invalid arguments(s)";
|
|
1008
|
+
if (this.root == null) return null;
|
|
1009
|
+
if (this.splay(e) < 0) return this.root.key;
|
|
1010
|
+
let r = this.root.left;
|
|
1011
|
+
if (r == null) return null;
|
|
1012
|
+
let f = r.right;
|
|
1013
|
+
for (; f != null; )
|
|
1014
|
+
r = f, f = r.right;
|
|
1015
|
+
return r.key;
|
|
1016
|
+
}
|
|
1017
|
+
firstAfter(e) {
|
|
1018
|
+
if (e == null) throw "Invalid arguments(s)";
|
|
1019
|
+
if (this.root == null) return null;
|
|
1020
|
+
if (this.splay(e) > 0) return this.root.key;
|
|
1021
|
+
let r = this.root.right;
|
|
1022
|
+
if (r == null) return null;
|
|
1023
|
+
let f = r.left;
|
|
1024
|
+
for (; f != null; )
|
|
1025
|
+
r = f, f = r.left;
|
|
1026
|
+
return r.key;
|
|
1027
|
+
}
|
|
1028
|
+
retainAll(e) {
|
|
1029
|
+
const n = new pe(this.compare, this.validKey), r = this.modificationCount;
|
|
1030
|
+
for (const f of e) {
|
|
1031
|
+
if (r != this.modificationCount)
|
|
1032
|
+
throw "Concurrent modification during iteration.";
|
|
1033
|
+
this.validKey(f) && this.splay(f) == 0 && n.add(this.root.key);
|
|
1034
|
+
}
|
|
1035
|
+
n.size != this.size && (this.root = n.root, this.size = n.size, this.modificationCount++);
|
|
1036
|
+
}
|
|
1037
|
+
lookup(e) {
|
|
1038
|
+
return !this.validKey(e) || this.splay(e) != 0 ? null : this.root.key;
|
|
1039
|
+
}
|
|
1040
|
+
intersection(e) {
|
|
1041
|
+
const n = new pe(this.compare, this.validKey);
|
|
1042
|
+
for (const r of this)
|
|
1043
|
+
e.has(r) && n.add(r);
|
|
1044
|
+
return n;
|
|
1045
|
+
}
|
|
1046
|
+
difference(e) {
|
|
1047
|
+
const n = new pe(this.compare, this.validKey);
|
|
1048
|
+
for (const r of this)
|
|
1049
|
+
e.has(r) || n.add(r);
|
|
1050
|
+
return n;
|
|
1051
|
+
}
|
|
1052
|
+
union(e) {
|
|
1053
|
+
const n = this.clone();
|
|
1054
|
+
return n.addAll(e), n;
|
|
1055
|
+
}
|
|
1056
|
+
clone() {
|
|
1057
|
+
const e = new pe(this.compare, this.validKey);
|
|
1058
|
+
return e.size = this.size, e.root = this.copyNode(this.root), e;
|
|
1059
|
+
}
|
|
1060
|
+
copyNode(e) {
|
|
1061
|
+
if (e == null) return null;
|
|
1062
|
+
function n(f, a) {
|
|
1063
|
+
let c, E;
|
|
1064
|
+
do {
|
|
1065
|
+
if (c = f.left, E = f.right, c != null) {
|
|
1066
|
+
const d = new ce(c.key);
|
|
1067
|
+
a.left = d, n(c, d);
|
|
1068
|
+
}
|
|
1069
|
+
if (E != null) {
|
|
1070
|
+
const d = new ce(E.key);
|
|
1071
|
+
a.right = d, f = E, a = d;
|
|
1072
|
+
}
|
|
1073
|
+
} while (E != null);
|
|
1074
|
+
}
|
|
1075
|
+
const r = new ce(e.key);
|
|
1076
|
+
return n(e, r), r;
|
|
1077
|
+
}
|
|
1078
|
+
toSet() {
|
|
1079
|
+
return this.clone();
|
|
1080
|
+
}
|
|
1081
|
+
entries() {
|
|
1082
|
+
return new Mt(this.wrap());
|
|
1083
|
+
}
|
|
1084
|
+
keys() {
|
|
1085
|
+
return this[Symbol.iterator]();
|
|
1086
|
+
}
|
|
1087
|
+
values() {
|
|
1088
|
+
return this[Symbol.iterator]();
|
|
1089
|
+
}
|
|
1090
|
+
[(nt = Symbol.iterator, it = Symbol.toStringTag, nt)]() {
|
|
1091
|
+
return new Lt(this.wrap());
|
|
1092
|
+
}
|
|
1093
|
+
}, lt = class {
|
|
1094
|
+
constructor(i) {
|
|
1095
|
+
M(this, "tree");
|
|
1096
|
+
M(this, "path", new Array());
|
|
1097
|
+
M(this, "modificationCount", null);
|
|
1098
|
+
M(this, "splayCount");
|
|
1099
|
+
this.tree = i, this.splayCount = i.getSplayCount();
|
|
1100
|
+
}
|
|
1101
|
+
[Symbol.iterator]() {
|
|
1102
|
+
return this;
|
|
1103
|
+
}
|
|
1104
|
+
next() {
|
|
1105
|
+
return this.moveNext() ? { done: !1, value: this.current() } : { done: !0, value: null };
|
|
1106
|
+
}
|
|
1107
|
+
current() {
|
|
1108
|
+
if (!this.path.length) return null;
|
|
1109
|
+
const i = this.path[this.path.length - 1];
|
|
1110
|
+
return this.getValue(i);
|
|
1111
|
+
}
|
|
1112
|
+
rebuildPath(i) {
|
|
1113
|
+
this.path.splice(0, this.path.length), this.tree.splay(i), this.path.push(this.tree.getRoot()), this.splayCount = this.tree.getSplayCount();
|
|
1114
|
+
}
|
|
1115
|
+
findLeftMostDescendent(i) {
|
|
1116
|
+
for (; i != null; )
|
|
1117
|
+
this.path.push(i), i = i.left;
|
|
1118
|
+
}
|
|
1119
|
+
moveNext() {
|
|
1120
|
+
if (this.modificationCount != this.tree.getModificationCount()) {
|
|
1121
|
+
if (this.modificationCount == null) {
|
|
1122
|
+
this.modificationCount = this.tree.getModificationCount();
|
|
1123
|
+
let e = this.tree.getRoot();
|
|
1124
|
+
for (; e != null; )
|
|
1125
|
+
this.path.push(e), e = e.left;
|
|
1126
|
+
return this.path.length > 0;
|
|
1127
|
+
}
|
|
1128
|
+
throw "Concurrent modification during iteration.";
|
|
1129
|
+
}
|
|
1130
|
+
if (!this.path.length) return !1;
|
|
1131
|
+
this.splayCount != this.tree.getSplayCount() && this.rebuildPath(this.path[this.path.length - 1].key);
|
|
1132
|
+
let i = this.path[this.path.length - 1], t = i.right;
|
|
1133
|
+
if (t != null) {
|
|
1134
|
+
for (; t != null; )
|
|
1135
|
+
this.path.push(t), t = t.left;
|
|
1136
|
+
return !0;
|
|
1137
|
+
}
|
|
1138
|
+
for (this.path.pop(); this.path.length && this.path[this.path.length - 1].right === i; )
|
|
1139
|
+
i = this.path.pop();
|
|
1140
|
+
return this.path.length > 0;
|
|
1141
|
+
}
|
|
1142
|
+
}, Lt = class extends lt {
|
|
1143
|
+
getValue(i) {
|
|
1144
|
+
return i.key;
|
|
1145
|
+
}
|
|
1146
|
+
}, Mt = class extends lt {
|
|
1147
|
+
getValue(i) {
|
|
1148
|
+
return [i.key, i.key];
|
|
1149
|
+
}
|
|
1150
|
+
}, ut = (i) => () => i, Ne = (i) => {
|
|
1151
|
+
const t = i ? (e, n) => n.minus(e).abs().isLessThanOrEqualTo(i) : ut(!1);
|
|
1152
|
+
return (e, n) => t(e, n) ? 0 : e.comparedTo(n);
|
|
755
1153
|
};
|
|
756
|
-
|
|
1154
|
+
function Rt(i) {
|
|
1155
|
+
const t = i ? (e, n, r, f, a) => e.exponentiatedBy(2).isLessThanOrEqualTo(
|
|
1156
|
+
f.minus(n).exponentiatedBy(2).plus(a.minus(r).exponentiatedBy(2)).times(i)
|
|
1157
|
+
) : ut(!1);
|
|
1158
|
+
return (e, n, r) => {
|
|
1159
|
+
const f = e.x, a = e.y, c = r.x, E = r.y, d = a.minus(E).times(n.x.minus(c)).minus(f.minus(c).times(n.y.minus(E)));
|
|
1160
|
+
return t(d, f, a, c, E) ? 0 : d.comparedTo(0);
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
var _t = (i) => i, Ot = (i) => {
|
|
1164
|
+
if (i) {
|
|
1165
|
+
const t = new ve(Ne(i)), e = new ve(Ne(i)), n = (f, a) => a.addAndReturn(f), r = (f) => ({
|
|
1166
|
+
x: n(f.x, t),
|
|
1167
|
+
y: n(f.y, e)
|
|
1168
|
+
});
|
|
1169
|
+
return r({ x: new ne(0), y: new ne(0) }), r;
|
|
1170
|
+
}
|
|
1171
|
+
return _t;
|
|
1172
|
+
}, Ae = (i) => ({
|
|
1173
|
+
set: (t) => {
|
|
1174
|
+
le = Ae(t);
|
|
1175
|
+
},
|
|
1176
|
+
reset: () => Ae(i),
|
|
1177
|
+
compare: Ne(i),
|
|
1178
|
+
snap: Ot(i),
|
|
1179
|
+
orient: Rt(i)
|
|
1180
|
+
}), le = Ae(), ae = (i, t) => i.ll.x.isLessThanOrEqualTo(t.x) && t.x.isLessThanOrEqualTo(i.ur.x) && i.ll.y.isLessThanOrEqualTo(t.y) && t.y.isLessThanOrEqualTo(i.ur.y), Ie = (i, t) => {
|
|
1181
|
+
if (t.ur.x.isLessThan(i.ll.x) || i.ur.x.isLessThan(t.ll.x) || t.ur.y.isLessThan(i.ll.y) || i.ur.y.isLessThan(t.ll.y))
|
|
1182
|
+
return null;
|
|
1183
|
+
const e = i.ll.x.isLessThan(t.ll.x) ? t.ll.x : i.ll.x, n = i.ur.x.isLessThan(t.ur.x) ? i.ur.x : t.ur.x, r = i.ll.y.isLessThan(t.ll.y) ? t.ll.y : i.ll.y, f = i.ur.y.isLessThan(t.ur.y) ? i.ur.y : t.ur.y;
|
|
1184
|
+
return { ll: { x: e, y: r }, ur: { x: n, y: f } };
|
|
1185
|
+
}, we = (i, t) => i.x.times(t.y).minus(i.y.times(t.x)), ft = (i, t) => i.x.times(t.x).plus(i.y.times(t.y)), be = (i) => ft(i, i).sqrt(), Ct = (i, t, e) => {
|
|
1186
|
+
const n = { x: t.x.minus(i.x), y: t.y.minus(i.y) }, r = { x: e.x.minus(i.x), y: e.y.minus(i.y) };
|
|
1187
|
+
return we(r, n).div(be(r)).div(be(n));
|
|
1188
|
+
}, Nt = (i, t, e) => {
|
|
1189
|
+
const n = { x: t.x.minus(i.x), y: t.y.minus(i.y) }, r = { x: e.x.minus(i.x), y: e.y.minus(i.y) };
|
|
1190
|
+
return ft(r, n).div(be(r)).div(be(n));
|
|
1191
|
+
}, We = (i, t, e) => t.y.isZero() ? null : { x: i.x.plus(t.x.div(t.y).times(e.minus(i.y))), y: e }, Ze = (i, t, e) => t.x.isZero() ? null : { x: e, y: i.y.plus(t.y.div(t.x).times(e.minus(i.x))) }, At = (i, t, e, n) => {
|
|
1192
|
+
if (t.x.isZero()) return Ze(e, n, i.x);
|
|
1193
|
+
if (n.x.isZero()) return Ze(i, t, e.x);
|
|
1194
|
+
if (t.y.isZero()) return We(e, n, i.y);
|
|
1195
|
+
if (n.y.isZero()) return We(i, t, e.y);
|
|
1196
|
+
const r = we(t, n);
|
|
1197
|
+
if (r.isZero()) return null;
|
|
1198
|
+
const f = { x: e.x.minus(i.x), y: e.y.minus(i.y) }, a = we(f, t).div(r), c = we(f, n).div(r), E = i.x.plus(c.times(t.x)), d = e.x.plus(a.times(n.x)), T = i.y.plus(c.times(t.y)), b = e.y.plus(a.times(n.y)), P = E.plus(d).div(2), N = T.plus(b).div(2);
|
|
1199
|
+
return { x: P, y: N };
|
|
1200
|
+
}, ie = class ht {
|
|
1201
|
+
// Warning: 'point' input will be modified and re-used (for performance)
|
|
1202
|
+
constructor(t, e) {
|
|
1203
|
+
M(this, "point");
|
|
1204
|
+
M(this, "isLeft");
|
|
1205
|
+
M(this, "segment");
|
|
1206
|
+
M(this, "otherSE");
|
|
1207
|
+
M(this, "consumedBy");
|
|
1208
|
+
t.events === void 0 ? t.events = [this] : t.events.push(this), this.point = t, this.isLeft = e;
|
|
1209
|
+
}
|
|
757
1210
|
// for ordering sweep events in the sweep event queue
|
|
758
1211
|
static compare(t, e) {
|
|
759
|
-
const n =
|
|
760
|
-
return n !== 0 ? n : (t.point !== e.point && t.link(e), t.isLeft !== e.isLeft ? t.isLeft ? 1 : -1 :
|
|
1212
|
+
const n = ht.comparePoints(t.point, e.point);
|
|
1213
|
+
return n !== 0 ? n : (t.point !== e.point && t.link(e), t.isLeft !== e.isLeft ? t.isLeft ? 1 : -1 : Pe.compare(t.segment, e.segment));
|
|
761
1214
|
}
|
|
762
1215
|
// for ordering points in sweep line order
|
|
763
1216
|
static comparePoints(t, e) {
|
|
764
|
-
return t.x
|
|
765
|
-
}
|
|
766
|
-
// Warning: 'point' input will be modified and re-used (for performance)
|
|
767
|
-
constructor(t, e) {
|
|
768
|
-
t.events === void 0 ? t.events = [this] : t.events.push(this), this.point = t, this.isLeft = e;
|
|
1217
|
+
return t.x.isLessThan(e.x) ? -1 : t.x.isGreaterThan(e.x) ? 1 : t.y.isLessThan(e.y) ? -1 : t.y.isGreaterThan(e.y) ? 1 : 0;
|
|
769
1218
|
}
|
|
770
1219
|
link(t) {
|
|
771
1220
|
if (t.point === this.point)
|
|
772
1221
|
throw new Error("Tried to link already linked events");
|
|
773
1222
|
const e = t.point.events;
|
|
774
1223
|
for (let n = 0, r = e.length; n < r; n++) {
|
|
775
|
-
const
|
|
776
|
-
this.point.events.push(
|
|
1224
|
+
const f = e[n];
|
|
1225
|
+
this.point.events.push(f), f.point = this.point;
|
|
777
1226
|
}
|
|
778
1227
|
this.checkForConsuming();
|
|
779
1228
|
}
|
|
@@ -785,8 +1234,8 @@ class R {
|
|
|
785
1234
|
const n = this.point.events[e];
|
|
786
1235
|
if (n.segment.consumedBy === void 0)
|
|
787
1236
|
for (let r = e + 1; r < t; r++) {
|
|
788
|
-
const
|
|
789
|
-
|
|
1237
|
+
const f = this.point.events[r];
|
|
1238
|
+
f.consumedBy === void 0 && n.otherSE.point.events === f.otherSE.point.events && n.segment.consume(f.segment);
|
|
790
1239
|
}
|
|
791
1240
|
}
|
|
792
1241
|
}
|
|
@@ -810,27 +1259,301 @@ class R {
|
|
|
810
1259
|
*/
|
|
811
1260
|
getLeftmostComparator(t) {
|
|
812
1261
|
const e = /* @__PURE__ */ new Map(), n = (r) => {
|
|
813
|
-
const
|
|
1262
|
+
const f = r.otherSE;
|
|
814
1263
|
e.set(r, {
|
|
815
|
-
sine:
|
|
816
|
-
cosine:
|
|
1264
|
+
sine: Ct(this.point, t.point, f.point),
|
|
1265
|
+
cosine: Nt(this.point, t.point, f.point)
|
|
817
1266
|
});
|
|
818
1267
|
};
|
|
819
|
-
return (r,
|
|
820
|
-
e.has(r) || n(r), e.has(
|
|
821
|
-
const {
|
|
822
|
-
|
|
823
|
-
cosine: l
|
|
824
|
-
} = e.get(r), {
|
|
825
|
-
sine: c,
|
|
826
|
-
cosine: f
|
|
827
|
-
} = e.get(i);
|
|
828
|
-
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;
|
|
1268
|
+
return (r, f) => {
|
|
1269
|
+
e.has(r) || n(r), e.has(f) || n(f);
|
|
1270
|
+
const { sine: a, cosine: c } = e.get(r), { sine: E, cosine: d } = e.get(f);
|
|
1271
|
+
return a.isGreaterThanOrEqualTo(0) && E.isGreaterThanOrEqualTo(0) ? c.isLessThan(d) ? 1 : c.isGreaterThan(d) ? -1 : 0 : a.isLessThan(0) && E.isLessThan(0) ? c.isLessThan(d) ? -1 : c.isGreaterThan(d) ? 1 : 0 : E.isLessThan(a) ? -1 : E.isGreaterThan(a) ? 1 : 0;
|
|
829
1272
|
};
|
|
830
1273
|
}
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
|
|
1274
|
+
}, It = class ke {
|
|
1275
|
+
constructor(t) {
|
|
1276
|
+
M(this, "events");
|
|
1277
|
+
M(this, "poly");
|
|
1278
|
+
M(this, "_isExteriorRing");
|
|
1279
|
+
M(this, "_enclosingRing");
|
|
1280
|
+
this.events = t;
|
|
1281
|
+
for (let e = 0, n = t.length; e < n; e++)
|
|
1282
|
+
t[e].segment.ringOut = this;
|
|
1283
|
+
this.poly = null;
|
|
1284
|
+
}
|
|
1285
|
+
/* Given the segments from the sweep line pass, compute & return a series
|
|
1286
|
+
* of closed rings from all the segments marked to be part of the result */
|
|
1287
|
+
static factory(t) {
|
|
1288
|
+
const e = [];
|
|
1289
|
+
for (let n = 0, r = t.length; n < r; n++) {
|
|
1290
|
+
const f = t[n];
|
|
1291
|
+
if (!f.isInResult() || f.ringOut) continue;
|
|
1292
|
+
let a = null, c = f.leftSE, E = f.rightSE;
|
|
1293
|
+
const d = [c], T = c.point, b = [];
|
|
1294
|
+
for (; a = c, c = E, d.push(c), c.point !== T; )
|
|
1295
|
+
for (; ; ) {
|
|
1296
|
+
const P = c.getAvailableLinkedEvents();
|
|
1297
|
+
if (P.length === 0) {
|
|
1298
|
+
const L = d[0].point, A = d[d.length - 1].point;
|
|
1299
|
+
throw new Error(
|
|
1300
|
+
`Unable to complete output ring starting at [${L.x}, ${L.y}]. Last matching segment found ends at [${A.x}, ${A.y}].`
|
|
1301
|
+
);
|
|
1302
|
+
}
|
|
1303
|
+
if (P.length === 1) {
|
|
1304
|
+
E = P[0].otherSE;
|
|
1305
|
+
break;
|
|
1306
|
+
}
|
|
1307
|
+
let N = null;
|
|
1308
|
+
for (let L = 0, A = b.length; L < A; L++)
|
|
1309
|
+
if (b[L].point === c.point) {
|
|
1310
|
+
N = L;
|
|
1311
|
+
break;
|
|
1312
|
+
}
|
|
1313
|
+
if (N !== null) {
|
|
1314
|
+
const L = b.splice(N)[0], A = d.splice(L.index);
|
|
1315
|
+
A.unshift(A[0].otherSE), e.push(new ke(A.reverse()));
|
|
1316
|
+
continue;
|
|
1317
|
+
}
|
|
1318
|
+
b.push({
|
|
1319
|
+
index: d.length,
|
|
1320
|
+
point: c.point
|
|
1321
|
+
});
|
|
1322
|
+
const _ = c.getLeftmostComparator(a);
|
|
1323
|
+
E = P.sort(_)[0].otherSE;
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
1326
|
+
e.push(new ke(d));
|
|
1327
|
+
}
|
|
1328
|
+
return e;
|
|
1329
|
+
}
|
|
1330
|
+
getGeom() {
|
|
1331
|
+
let t = this.events[0].point;
|
|
1332
|
+
const e = [t];
|
|
1333
|
+
for (let d = 1, T = this.events.length - 1; d < T; d++) {
|
|
1334
|
+
const b = this.events[d].point, P = this.events[d + 1].point;
|
|
1335
|
+
le.orient(b, t, P) !== 0 && (e.push(b), t = b);
|
|
1336
|
+
}
|
|
1337
|
+
if (e.length === 1) return null;
|
|
1338
|
+
const n = e[0], r = e[1];
|
|
1339
|
+
le.orient(n, t, r) === 0 && e.shift(), e.push(e[0]);
|
|
1340
|
+
const f = this.isExteriorRing() ? 1 : -1, a = this.isExteriorRing() ? 0 : e.length - 1, c = this.isExteriorRing() ? e.length : -1, E = [];
|
|
1341
|
+
for (let d = a; d != c; d += f)
|
|
1342
|
+
E.push([e[d].x.toNumber(), e[d].y.toNumber()]);
|
|
1343
|
+
return E;
|
|
1344
|
+
}
|
|
1345
|
+
isExteriorRing() {
|
|
1346
|
+
if (this._isExteriorRing === void 0) {
|
|
1347
|
+
const t = this.enclosingRing();
|
|
1348
|
+
this._isExteriorRing = t ? !t.isExteriorRing() : !0;
|
|
1349
|
+
}
|
|
1350
|
+
return this._isExteriorRing;
|
|
1351
|
+
}
|
|
1352
|
+
enclosingRing() {
|
|
1353
|
+
return this._enclosingRing === void 0 && (this._enclosingRing = this._calcEnclosingRing()), this._enclosingRing;
|
|
1354
|
+
}
|
|
1355
|
+
/* Returns the ring that encloses this one, if any */
|
|
1356
|
+
_calcEnclosingRing() {
|
|
1357
|
+
var r, f;
|
|
1358
|
+
let t = this.events[0];
|
|
1359
|
+
for (let a = 1, c = this.events.length; a < c; a++) {
|
|
1360
|
+
const E = this.events[a];
|
|
1361
|
+
ie.compare(t, E) > 0 && (t = E);
|
|
1362
|
+
}
|
|
1363
|
+
let e = t.segment.prevInResult(), n = e ? e.prevInResult() : null;
|
|
1364
|
+
for (; ; ) {
|
|
1365
|
+
if (!e) return null;
|
|
1366
|
+
if (!n) return e.ringOut;
|
|
1367
|
+
if (n.ringOut !== e.ringOut)
|
|
1368
|
+
return ((r = n.ringOut) == null ? void 0 : r.enclosingRing()) !== e.ringOut ? e.ringOut : (f = e.ringOut) == null ? void 0 : f.enclosingRing();
|
|
1369
|
+
e = n.prevInResult(), n = e ? e.prevInResult() : null;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
}, He = class {
|
|
1373
|
+
constructor(i) {
|
|
1374
|
+
M(this, "exteriorRing");
|
|
1375
|
+
M(this, "interiorRings");
|
|
1376
|
+
this.exteriorRing = i, i.poly = this, this.interiorRings = [];
|
|
1377
|
+
}
|
|
1378
|
+
addInterior(i) {
|
|
1379
|
+
this.interiorRings.push(i), i.poly = this;
|
|
1380
|
+
}
|
|
1381
|
+
getGeom() {
|
|
1382
|
+
const i = this.exteriorRing.getGeom();
|
|
1383
|
+
if (i === null) return null;
|
|
1384
|
+
const t = [i];
|
|
1385
|
+
for (let e = 0, n = this.interiorRings.length; e < n; e++) {
|
|
1386
|
+
const r = this.interiorRings[e].getGeom();
|
|
1387
|
+
r !== null && t.push(r);
|
|
1388
|
+
}
|
|
1389
|
+
return t;
|
|
1390
|
+
}
|
|
1391
|
+
}, kt = class {
|
|
1392
|
+
constructor(i) {
|
|
1393
|
+
M(this, "rings");
|
|
1394
|
+
M(this, "polys");
|
|
1395
|
+
this.rings = i, this.polys = this._composePolys(i);
|
|
1396
|
+
}
|
|
1397
|
+
getGeom() {
|
|
1398
|
+
const i = [];
|
|
1399
|
+
for (let t = 0, e = this.polys.length; t < e; t++) {
|
|
1400
|
+
const n = this.polys[t].getGeom();
|
|
1401
|
+
n !== null && i.push(n);
|
|
1402
|
+
}
|
|
1403
|
+
return i;
|
|
1404
|
+
}
|
|
1405
|
+
_composePolys(i) {
|
|
1406
|
+
var e;
|
|
1407
|
+
const t = [];
|
|
1408
|
+
for (let n = 0, r = i.length; n < r; n++) {
|
|
1409
|
+
const f = i[n];
|
|
1410
|
+
if (!f.poly)
|
|
1411
|
+
if (f.isExteriorRing()) t.push(new He(f));
|
|
1412
|
+
else {
|
|
1413
|
+
const a = f.enclosingRing();
|
|
1414
|
+
a != null && a.poly || t.push(new He(a)), (e = a == null ? void 0 : a.poly) == null || e.addInterior(f);
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
return t;
|
|
1418
|
+
}
|
|
1419
|
+
}, Bt = class {
|
|
1420
|
+
constructor(i, t = Pe.compare) {
|
|
1421
|
+
M(this, "queue");
|
|
1422
|
+
M(this, "tree");
|
|
1423
|
+
M(this, "segments");
|
|
1424
|
+
this.queue = i, this.tree = new ve(t), this.segments = [];
|
|
1425
|
+
}
|
|
1426
|
+
process(i) {
|
|
1427
|
+
const t = i.segment, e = [];
|
|
1428
|
+
if (i.consumedBy)
|
|
1429
|
+
return i.isLeft ? this.queue.delete(i.otherSE) : this.tree.delete(t), e;
|
|
1430
|
+
i.isLeft && this.tree.add(t);
|
|
1431
|
+
let n = t, r = t;
|
|
1432
|
+
do
|
|
1433
|
+
n = this.tree.lastBefore(n);
|
|
1434
|
+
while (n != null && n.consumedBy != null);
|
|
1435
|
+
do
|
|
1436
|
+
r = this.tree.firstAfter(r);
|
|
1437
|
+
while (r != null && r.consumedBy != null);
|
|
1438
|
+
if (i.isLeft) {
|
|
1439
|
+
let f = null;
|
|
1440
|
+
if (n) {
|
|
1441
|
+
const c = n.getIntersection(t);
|
|
1442
|
+
if (c !== null && (t.isAnEndpoint(c) || (f = c), !n.isAnEndpoint(c))) {
|
|
1443
|
+
const E = this._splitSafely(n, c);
|
|
1444
|
+
for (let d = 0, T = E.length; d < T; d++)
|
|
1445
|
+
e.push(E[d]);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
let a = null;
|
|
1449
|
+
if (r) {
|
|
1450
|
+
const c = r.getIntersection(t);
|
|
1451
|
+
if (c !== null && (t.isAnEndpoint(c) || (a = c), !r.isAnEndpoint(c))) {
|
|
1452
|
+
const E = this._splitSafely(r, c);
|
|
1453
|
+
for (let d = 0, T = E.length; d < T; d++)
|
|
1454
|
+
e.push(E[d]);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
if (f !== null || a !== null) {
|
|
1458
|
+
let c = null;
|
|
1459
|
+
f === null ? c = a : a === null ? c = f : c = ie.comparePoints(
|
|
1460
|
+
f,
|
|
1461
|
+
a
|
|
1462
|
+
) <= 0 ? f : a, this.queue.delete(t.rightSE), e.push(t.rightSE);
|
|
1463
|
+
const E = t.split(c);
|
|
1464
|
+
for (let d = 0, T = E.length; d < T; d++)
|
|
1465
|
+
e.push(E[d]);
|
|
1466
|
+
}
|
|
1467
|
+
e.length > 0 ? (this.tree.delete(t), e.push(i)) : (this.segments.push(t), t.prev = n);
|
|
1468
|
+
} else {
|
|
1469
|
+
if (n && r) {
|
|
1470
|
+
const f = n.getIntersection(r);
|
|
1471
|
+
if (f !== null) {
|
|
1472
|
+
if (!n.isAnEndpoint(f)) {
|
|
1473
|
+
const a = this._splitSafely(n, f);
|
|
1474
|
+
for (let c = 0, E = a.length; c < E; c++)
|
|
1475
|
+
e.push(a[c]);
|
|
1476
|
+
}
|
|
1477
|
+
if (!r.isAnEndpoint(f)) {
|
|
1478
|
+
const a = this._splitSafely(r, f);
|
|
1479
|
+
for (let c = 0, E = a.length; c < E; c++)
|
|
1480
|
+
e.push(a[c]);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
this.tree.delete(t);
|
|
1485
|
+
}
|
|
1486
|
+
return e;
|
|
1487
|
+
}
|
|
1488
|
+
/* Safely split a segment that is currently in the datastructures
|
|
1489
|
+
* IE - a segment other than the one that is currently being processed. */
|
|
1490
|
+
_splitSafely(i, t) {
|
|
1491
|
+
this.tree.delete(i);
|
|
1492
|
+
const e = i.rightSE;
|
|
1493
|
+
this.queue.delete(e);
|
|
1494
|
+
const n = i.split(t);
|
|
1495
|
+
return n.push(e), i.consumedBy === void 0 && this.tree.add(i), n;
|
|
1496
|
+
}
|
|
1497
|
+
}, Gt = class {
|
|
1498
|
+
constructor() {
|
|
1499
|
+
M(this, "type");
|
|
1500
|
+
M(this, "numMultiPolys");
|
|
1501
|
+
}
|
|
1502
|
+
run(i, t, e) {
|
|
1503
|
+
ge.type = i;
|
|
1504
|
+
const n = [new je(t, !0)];
|
|
1505
|
+
for (let d = 0, T = e.length; d < T; d++)
|
|
1506
|
+
n.push(new je(e[d], !1));
|
|
1507
|
+
if (ge.numMultiPolys = n.length, ge.type === "difference") {
|
|
1508
|
+
const d = n[0];
|
|
1509
|
+
let T = 1;
|
|
1510
|
+
for (; T < n.length; )
|
|
1511
|
+
Ie(n[T].bbox, d.bbox) !== null ? T++ : n.splice(T, 1);
|
|
1512
|
+
}
|
|
1513
|
+
if (ge.type === "intersection")
|
|
1514
|
+
for (let d = 0, T = n.length; d < T; d++) {
|
|
1515
|
+
const b = n[d];
|
|
1516
|
+
for (let P = d + 1, N = n.length; P < N; P++)
|
|
1517
|
+
if (Ie(b.bbox, n[P].bbox) === null) return [];
|
|
1518
|
+
}
|
|
1519
|
+
const r = new ve(ie.compare);
|
|
1520
|
+
for (let d = 0, T = n.length; d < T; d++) {
|
|
1521
|
+
const b = n[d].getSweepEvents();
|
|
1522
|
+
for (let P = 0, N = b.length; P < N; P++)
|
|
1523
|
+
r.add(b[P]);
|
|
1524
|
+
}
|
|
1525
|
+
const f = new Bt(r);
|
|
1526
|
+
let a = null;
|
|
1527
|
+
for (r.size != 0 && (a = r.first(), r.delete(a)); a; ) {
|
|
1528
|
+
const d = f.process(a);
|
|
1529
|
+
for (let T = 0, b = d.length; T < b; T++) {
|
|
1530
|
+
const P = d[T];
|
|
1531
|
+
P.consumedBy === void 0 && r.add(P);
|
|
1532
|
+
}
|
|
1533
|
+
r.size != 0 ? (a = r.first(), r.delete(a)) : a = null;
|
|
1534
|
+
}
|
|
1535
|
+
le.reset();
|
|
1536
|
+
const c = It.factory(f.segments);
|
|
1537
|
+
return new kt(c).getGeom();
|
|
1538
|
+
}
|
|
1539
|
+
}, ge = new Gt(), Te = ge, Ft = 0, Pe = class Ee {
|
|
1540
|
+
/* Warning: a reference to ringWindings input will be stored,
|
|
1541
|
+
* and possibly will be later modified */
|
|
1542
|
+
constructor(t, e, n, r) {
|
|
1543
|
+
M(this, "id");
|
|
1544
|
+
M(this, "leftSE");
|
|
1545
|
+
M(this, "rightSE");
|
|
1546
|
+
M(this, "rings");
|
|
1547
|
+
M(this, "windings");
|
|
1548
|
+
M(this, "ringOut");
|
|
1549
|
+
M(this, "consumedBy");
|
|
1550
|
+
M(this, "prev");
|
|
1551
|
+
M(this, "_prevInResult");
|
|
1552
|
+
M(this, "_beforeState");
|
|
1553
|
+
M(this, "_afterState");
|
|
1554
|
+
M(this, "_isInResult");
|
|
1555
|
+
this.id = ++Ft, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
|
|
1556
|
+
}
|
|
834
1557
|
/* This compare() function is for ordering segments in the sweep
|
|
835
1558
|
* line tree, and does so according to the following criteria:
|
|
836
1559
|
*
|
|
@@ -845,60 +1568,58 @@ class z {
|
|
|
845
1568
|
* is directly on the right-more of the two left inputs.
|
|
846
1569
|
*/
|
|
847
1570
|
static compare(t, e) {
|
|
848
|
-
const n = t.leftSE.point.x, r = e.leftSE.point.x,
|
|
849
|
-
if (
|
|
850
|
-
if (
|
|
851
|
-
const
|
|
852
|
-
if (n
|
|
853
|
-
if (c
|
|
854
|
-
if (c
|
|
855
|
-
const
|
|
856
|
-
if (
|
|
857
|
-
if (
|
|
858
|
-
const
|
|
859
|
-
return
|
|
860
|
-
}
|
|
861
|
-
if (n
|
|
862
|
-
if (
|
|
863
|
-
if (
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
const
|
|
867
|
-
return
|
|
868
|
-
}
|
|
869
|
-
if (
|
|
870
|
-
if (
|
|
871
|
-
if (
|
|
872
|
-
const
|
|
873
|
-
if (
|
|
874
|
-
}
|
|
875
|
-
if (
|
|
876
|
-
const
|
|
877
|
-
if (
|
|
878
|
-
if (
|
|
879
|
-
}
|
|
880
|
-
if (
|
|
881
|
-
const
|
|
882
|
-
if (
|
|
883
|
-
if (
|
|
884
|
-
}
|
|
885
|
-
return
|
|
886
|
-
}
|
|
887
|
-
/* Warning: a reference to ringWindings input will be stored,
|
|
888
|
-
* and possibly will be later modified */
|
|
889
|
-
constructor(t, e, n, r) {
|
|
890
|
-
this.id = ++ge, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
|
|
1571
|
+
const n = t.leftSE.point.x, r = e.leftSE.point.x, f = t.rightSE.point.x, a = e.rightSE.point.x;
|
|
1572
|
+
if (a.isLessThan(n)) return 1;
|
|
1573
|
+
if (f.isLessThan(r)) return -1;
|
|
1574
|
+
const c = t.leftSE.point.y, E = e.leftSE.point.y, d = t.rightSE.point.y, T = e.rightSE.point.y;
|
|
1575
|
+
if (n.isLessThan(r)) {
|
|
1576
|
+
if (E.isLessThan(c) && E.isLessThan(d)) return 1;
|
|
1577
|
+
if (E.isGreaterThan(c) && E.isGreaterThan(d)) return -1;
|
|
1578
|
+
const b = t.comparePoint(e.leftSE.point);
|
|
1579
|
+
if (b < 0) return 1;
|
|
1580
|
+
if (b > 0) return -1;
|
|
1581
|
+
const P = e.comparePoint(t.rightSE.point);
|
|
1582
|
+
return P !== 0 ? P : -1;
|
|
1583
|
+
}
|
|
1584
|
+
if (n.isGreaterThan(r)) {
|
|
1585
|
+
if (c.isLessThan(E) && c.isLessThan(T)) return -1;
|
|
1586
|
+
if (c.isGreaterThan(E) && c.isGreaterThan(T)) return 1;
|
|
1587
|
+
const b = e.comparePoint(t.leftSE.point);
|
|
1588
|
+
if (b !== 0) return b;
|
|
1589
|
+
const P = t.comparePoint(e.rightSE.point);
|
|
1590
|
+
return P < 0 ? 1 : P > 0 ? -1 : 1;
|
|
1591
|
+
}
|
|
1592
|
+
if (c.isLessThan(E)) return -1;
|
|
1593
|
+
if (c.isGreaterThan(E)) return 1;
|
|
1594
|
+
if (f.isLessThan(a)) {
|
|
1595
|
+
const b = e.comparePoint(t.rightSE.point);
|
|
1596
|
+
if (b !== 0) return b;
|
|
1597
|
+
}
|
|
1598
|
+
if (f.isGreaterThan(a)) {
|
|
1599
|
+
const b = t.comparePoint(e.rightSE.point);
|
|
1600
|
+
if (b < 0) return 1;
|
|
1601
|
+
if (b > 0) return -1;
|
|
1602
|
+
}
|
|
1603
|
+
if (!f.eq(a)) {
|
|
1604
|
+
const b = d.minus(c), P = f.minus(n), N = T.minus(E), _ = a.minus(r);
|
|
1605
|
+
if (b.isGreaterThan(P) && N.isLessThan(_)) return 1;
|
|
1606
|
+
if (b.isLessThan(P) && N.isGreaterThan(_)) return -1;
|
|
1607
|
+
}
|
|
1608
|
+
return f.isGreaterThan(a) ? 1 : f.isLessThan(a) || d.isLessThan(T) ? -1 : d.isGreaterThan(T) ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
|
|
891
1609
|
}
|
|
892
1610
|
static fromRing(t, e, n) {
|
|
893
|
-
let r,
|
|
894
|
-
const
|
|
895
|
-
if (
|
|
896
|
-
r = t,
|
|
897
|
-
else if (
|
|
898
|
-
r = e,
|
|
899
|
-
else
|
|
900
|
-
|
|
901
|
-
|
|
1611
|
+
let r, f, a;
|
|
1612
|
+
const c = ie.comparePoints(t, e);
|
|
1613
|
+
if (c < 0)
|
|
1614
|
+
r = t, f = e, a = 1;
|
|
1615
|
+
else if (c > 0)
|
|
1616
|
+
r = e, f = t, a = -1;
|
|
1617
|
+
else
|
|
1618
|
+
throw new Error(
|
|
1619
|
+
`Tried to create degenerate segment at [${t.x}, ${t.y}]`
|
|
1620
|
+
);
|
|
1621
|
+
const E = new ie(r, !0), d = new ie(f, !1);
|
|
1622
|
+
return new Ee(E, d, [n], [a]);
|
|
902
1623
|
}
|
|
903
1624
|
/* When a segment is split, the rightSE is replaced with a new sweep event */
|
|
904
1625
|
replaceRightSE(t) {
|
|
@@ -907,25 +1628,19 @@ class z {
|
|
|
907
1628
|
bbox() {
|
|
908
1629
|
const t = this.leftSE.point.y, e = this.rightSE.point.y;
|
|
909
1630
|
return {
|
|
910
|
-
ll: {
|
|
911
|
-
|
|
912
|
-
y: t < e ? t : e
|
|
913
|
-
},
|
|
914
|
-
ur: {
|
|
915
|
-
x: this.rightSE.point.x,
|
|
916
|
-
y: t > e ? t : e
|
|
917
|
-
}
|
|
1631
|
+
ll: { x: this.leftSE.point.x, y: t.isLessThan(e) ? t : e },
|
|
1632
|
+
ur: { x: this.rightSE.point.x, y: t.isGreaterThan(e) ? t : e }
|
|
918
1633
|
};
|
|
919
1634
|
}
|
|
920
1635
|
/* A vector from the left point to the right */
|
|
921
1636
|
vector() {
|
|
922
1637
|
return {
|
|
923
|
-
x: this.rightSE.point.x
|
|
924
|
-
y: this.rightSE.point.y
|
|
1638
|
+
x: this.rightSE.point.x.minus(this.leftSE.point.x),
|
|
1639
|
+
y: this.rightSE.point.y.minus(this.leftSE.point.y)
|
|
925
1640
|
};
|
|
926
1641
|
}
|
|
927
1642
|
isAnEndpoint(t) {
|
|
928
|
-
return t.x
|
|
1643
|
+
return t.x.eq(this.leftSE.point.x) && t.y.eq(this.leftSE.point.y) || t.x.eq(this.rightSE.point.x) && t.y.eq(this.rightSE.point.y);
|
|
929
1644
|
}
|
|
930
1645
|
/* Compare this segment with a point.
|
|
931
1646
|
*
|
|
@@ -941,14 +1656,7 @@ class z {
|
|
|
941
1656
|
* -1: point lies below the segment (to the right of vertical)
|
|
942
1657
|
*/
|
|
943
1658
|
comparePoint(t) {
|
|
944
|
-
|
|
945
|
-
const e = this.leftSE.point, n = this.rightSE.point, r = this.vector();
|
|
946
|
-
if (e.x === n.x)
|
|
947
|
-
return t.x === e.x ? 0 : t.x < e.x ? 1 : -1;
|
|
948
|
-
const i = (t.y - e.y) / r.y, u = e.x + i * r.x;
|
|
949
|
-
if (t.x === u) return 0;
|
|
950
|
-
const l = (t.x - e.x) / r.x, c = e.y + l * r.y;
|
|
951
|
-
return t.y === c ? 0 : t.y < c ? -1 : 1;
|
|
1659
|
+
return le.orient(this.leftSE.point, t, this.rightSE.point);
|
|
952
1660
|
}
|
|
953
1661
|
/**
|
|
954
1662
|
* Given another segment, returns the first non-trivial intersection
|
|
@@ -966,20 +1674,20 @@ class z {
|
|
|
966
1674
|
* Else, return null.
|
|
967
1675
|
*/
|
|
968
1676
|
getIntersection(t) {
|
|
969
|
-
const e = this.bbox(), n = t.bbox(), r =
|
|
1677
|
+
const e = this.bbox(), n = t.bbox(), r = Ie(e, n);
|
|
970
1678
|
if (r === null) return null;
|
|
971
|
-
const
|
|
972
|
-
if (
|
|
973
|
-
return
|
|
974
|
-
if (
|
|
975
|
-
return
|
|
976
|
-
if (
|
|
977
|
-
return
|
|
978
|
-
if (
|
|
979
|
-
if (
|
|
980
|
-
if (
|
|
981
|
-
const
|
|
982
|
-
return
|
|
1679
|
+
const f = this.leftSE.point, a = this.rightSE.point, c = t.leftSE.point, E = t.rightSE.point, d = ae(e, c) && this.comparePoint(c) === 0, T = ae(n, f) && t.comparePoint(f) === 0, b = ae(e, E) && this.comparePoint(E) === 0, P = ae(n, a) && t.comparePoint(a) === 0;
|
|
1680
|
+
if (T && d)
|
|
1681
|
+
return P && !b ? a : !P && b ? E : null;
|
|
1682
|
+
if (T)
|
|
1683
|
+
return b && f.x.eq(E.x) && f.y.eq(E.y) ? null : f;
|
|
1684
|
+
if (d)
|
|
1685
|
+
return P && a.x.eq(c.x) && a.y.eq(c.y) ? null : c;
|
|
1686
|
+
if (P && b) return null;
|
|
1687
|
+
if (P) return a;
|
|
1688
|
+
if (b) return E;
|
|
1689
|
+
const N = At(f, this.vector(), c, t.vector());
|
|
1690
|
+
return N === null || !ae(r, N) ? null : le.snap(N);
|
|
983
1691
|
}
|
|
984
1692
|
/**
|
|
985
1693
|
* Split the given segment into multiple segments on the given points.
|
|
@@ -994,10 +1702,15 @@ class z {
|
|
|
994
1702
|
* Warning: input array of points is modified
|
|
995
1703
|
*/
|
|
996
1704
|
split(t) {
|
|
997
|
-
const e = [], n = t.events !== void 0, r = new
|
|
998
|
-
this.replaceRightSE(
|
|
999
|
-
const
|
|
1000
|
-
|
|
1705
|
+
const e = [], n = t.events !== void 0, r = new ie(t, !0), f = new ie(t, !1), a = this.rightSE;
|
|
1706
|
+
this.replaceRightSE(f), e.push(f), e.push(r);
|
|
1707
|
+
const c = new Ee(
|
|
1708
|
+
r,
|
|
1709
|
+
a,
|
|
1710
|
+
this.rings.slice(),
|
|
1711
|
+
this.windings.slice()
|
|
1712
|
+
);
|
|
1713
|
+
return ie.comparePoints(c.leftSE.point, c.rightSE.point) > 0 && c.swapEvents(), ie.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (r.checkForConsuming(), f.checkForConsuming()), e;
|
|
1001
1714
|
}
|
|
1002
1715
|
/* Swap which event is left and right */
|
|
1003
1716
|
swapEvents() {
|
|
@@ -1012,19 +1725,19 @@ class z {
|
|
|
1012
1725
|
let e = this, n = t;
|
|
1013
1726
|
for (; e.consumedBy; ) e = e.consumedBy;
|
|
1014
1727
|
for (; n.consumedBy; ) n = n.consumedBy;
|
|
1015
|
-
const r =
|
|
1728
|
+
const r = Ee.compare(e, n);
|
|
1016
1729
|
if (r !== 0) {
|
|
1017
1730
|
if (r > 0) {
|
|
1018
|
-
const
|
|
1019
|
-
e = n, n =
|
|
1731
|
+
const f = e;
|
|
1732
|
+
e = n, n = f;
|
|
1020
1733
|
}
|
|
1021
1734
|
if (e.prev === n) {
|
|
1022
|
-
const
|
|
1023
|
-
e = n, n =
|
|
1735
|
+
const f = e;
|
|
1736
|
+
e = n, n = f;
|
|
1024
1737
|
}
|
|
1025
|
-
for (let
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1738
|
+
for (let f = 0, a = n.rings.length; f < a; f++) {
|
|
1739
|
+
const c = n.rings[f], E = n.windings[f], d = e.rings.indexOf(c);
|
|
1740
|
+
d === -1 ? (e.rings.push(c), e.windings.push(E)) : e.windings[d] += E;
|
|
1028
1741
|
}
|
|
1029
1742
|
n.rings = null, n.windings = null, n.consumedBy = e, n.leftSE.consumedBy = e.leftSE, n.rightSE.consumedBy = e.rightSE;
|
|
1030
1743
|
}
|
|
@@ -1035,11 +1748,12 @@ class z {
|
|
|
1035
1748
|
}
|
|
1036
1749
|
beforeState() {
|
|
1037
1750
|
if (this._beforeState !== void 0) return this._beforeState;
|
|
1038
|
-
if (!this.prev)
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1751
|
+
if (!this.prev)
|
|
1752
|
+
this._beforeState = {
|
|
1753
|
+
rings: [],
|
|
1754
|
+
windings: [],
|
|
1755
|
+
multiPolys: []
|
|
1756
|
+
};
|
|
1043
1757
|
else {
|
|
1044
1758
|
const t = this.prev.consumedBy || this.prev;
|
|
1045
1759
|
this._beforeState = t.afterState();
|
|
@@ -1055,25 +1769,25 @@ class z {
|
|
|
1055
1769
|
multiPolys: []
|
|
1056
1770
|
};
|
|
1057
1771
|
const e = this._afterState.rings, n = this._afterState.windings, r = this._afterState.multiPolys;
|
|
1058
|
-
for (let
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
}
|
|
1062
|
-
const
|
|
1063
|
-
for (let
|
|
1064
|
-
if (n[
|
|
1065
|
-
const
|
|
1066
|
-
if (
|
|
1067
|
-
if (
|
|
1772
|
+
for (let c = 0, E = this.rings.length; c < E; c++) {
|
|
1773
|
+
const d = this.rings[c], T = this.windings[c], b = e.indexOf(d);
|
|
1774
|
+
b === -1 ? (e.push(d), n.push(T)) : n[b] += T;
|
|
1775
|
+
}
|
|
1776
|
+
const f = [], a = [];
|
|
1777
|
+
for (let c = 0, E = e.length; c < E; c++) {
|
|
1778
|
+
if (n[c] === 0) continue;
|
|
1779
|
+
const d = e[c], T = d.poly;
|
|
1780
|
+
if (a.indexOf(T) === -1)
|
|
1781
|
+
if (d.isExterior) f.push(T);
|
|
1068
1782
|
else {
|
|
1069
|
-
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1783
|
+
a.indexOf(T) === -1 && a.push(T);
|
|
1784
|
+
const b = f.indexOf(d.poly);
|
|
1785
|
+
b !== -1 && f.splice(b, 1);
|
|
1072
1786
|
}
|
|
1073
1787
|
}
|
|
1074
|
-
for (let
|
|
1075
|
-
const
|
|
1076
|
-
r.indexOf(
|
|
1788
|
+
for (let c = 0, E = f.length; c < E; c++) {
|
|
1789
|
+
const d = f[c].multiPoly;
|
|
1790
|
+
r.indexOf(d) === -1 && r.push(d);
|
|
1077
1791
|
}
|
|
1078
1792
|
return this._afterState;
|
|
1079
1793
|
}
|
|
@@ -1082,7 +1796,7 @@ class z {
|
|
|
1082
1796
|
if (this.consumedBy) return !1;
|
|
1083
1797
|
if (this._isInResult !== void 0) return this._isInResult;
|
|
1084
1798
|
const t = this.beforeState().multiPolys, e = this.afterState().multiPolys;
|
|
1085
|
-
switch (
|
|
1799
|
+
switch (Te.type) {
|
|
1086
1800
|
case "union": {
|
|
1087
1801
|
const n = t.length === 0, r = e.length === 0;
|
|
1088
1802
|
this._isInResult = n !== r;
|
|
@@ -1090,7 +1804,7 @@ class z {
|
|
|
1090
1804
|
}
|
|
1091
1805
|
case "intersection": {
|
|
1092
1806
|
let n, r;
|
|
1093
|
-
t.length < e.length ? (n = t.length, r = e.length) : (n = e.length, r = t.length), this._isInResult = r ===
|
|
1807
|
+
t.length < e.length ? (n = t.length, r = e.length) : (n = e.length, r = t.length), this._isInResult = r === Te.numMultiPolys && n < r;
|
|
1094
1808
|
break;
|
|
1095
1809
|
}
|
|
1096
1810
|
case "xor": {
|
|
@@ -1103,428 +1817,136 @@ class z {
|
|
|
1103
1817
|
this._isInResult = n(t) !== n(e);
|
|
1104
1818
|
break;
|
|
1105
1819
|
}
|
|
1106
|
-
default:
|
|
1107
|
-
throw new Error(`Unrecognized operation type found ${A.type}`);
|
|
1108
1820
|
}
|
|
1109
1821
|
return this._isInResult;
|
|
1110
1822
|
}
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1823
|
+
}, Je = class {
|
|
1824
|
+
constructor(i, t, e) {
|
|
1825
|
+
M(this, "poly");
|
|
1826
|
+
M(this, "isExterior");
|
|
1827
|
+
M(this, "segments");
|
|
1828
|
+
M(this, "bbox");
|
|
1829
|
+
if (!Array.isArray(i) || i.length === 0)
|
|
1115
1830
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
1116
|
-
if (this.poly =
|
|
1831
|
+
if (this.poly = t, this.isExterior = e, this.segments = [], typeof i[0][0] != "number" || typeof i[0][1] != "number")
|
|
1117
1832
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
1118
|
-
const
|
|
1833
|
+
const n = le.snap({ x: new ne(i[0][0]), y: new ne(i[0][1]) });
|
|
1119
1834
|
this.bbox = {
|
|
1120
|
-
ll: {
|
|
1121
|
-
|
|
1122
|
-
y: r.y
|
|
1123
|
-
},
|
|
1124
|
-
ur: {
|
|
1125
|
-
x: r.x,
|
|
1126
|
-
y: r.y
|
|
1127
|
-
}
|
|
1835
|
+
ll: { x: n.x, y: n.y },
|
|
1836
|
+
ur: { x: n.x, y: n.y }
|
|
1128
1837
|
};
|
|
1129
|
-
let
|
|
1130
|
-
for (let
|
|
1131
|
-
if (typeof
|
|
1838
|
+
let r = n;
|
|
1839
|
+
for (let f = 1, a = i.length; f < a; f++) {
|
|
1840
|
+
if (typeof i[f][0] != "number" || typeof i[f][1] != "number")
|
|
1132
1841
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
1133
|
-
|
|
1134
|
-
c.x
|
|
1842
|
+
const c = le.snap({ x: new ne(i[f][0]), y: new ne(i[f][1]) });
|
|
1843
|
+
c.x.eq(r.x) && c.y.eq(r.y) || (this.segments.push(Pe.fromRing(r, c, this)), c.x.isLessThan(this.bbox.ll.x) && (this.bbox.ll.x = c.x), c.y.isLessThan(this.bbox.ll.y) && (this.bbox.ll.y = c.y), c.x.isGreaterThan(this.bbox.ur.x) && (this.bbox.ur.x = c.x), c.y.isGreaterThan(this.bbox.ur.y) && (this.bbox.ur.y = c.y), r = c);
|
|
1135
1844
|
}
|
|
1136
|
-
(
|
|
1845
|
+
(!n.x.eq(r.x) || !n.y.eq(r.y)) && this.segments.push(Pe.fromRing(r, n, this));
|
|
1137
1846
|
}
|
|
1138
1847
|
getSweepEvents() {
|
|
1139
|
-
const
|
|
1140
|
-
for (let
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1848
|
+
const i = [];
|
|
1849
|
+
for (let t = 0, e = this.segments.length; t < e; t++) {
|
|
1850
|
+
const n = this.segments[t];
|
|
1851
|
+
i.push(n.leftSE), i.push(n.rightSE);
|
|
1143
1852
|
}
|
|
1144
|
-
return
|
|
1853
|
+
return i;
|
|
1145
1854
|
}
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1855
|
+
}, qt = class {
|
|
1856
|
+
constructor(i, t) {
|
|
1857
|
+
M(this, "multiPoly");
|
|
1858
|
+
M(this, "exteriorRing");
|
|
1859
|
+
M(this, "interiorRings");
|
|
1860
|
+
M(this, "bbox");
|
|
1861
|
+
if (!Array.isArray(i))
|
|
1150
1862
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
1151
|
-
this.exteriorRing = new
|
|
1152
|
-
ll: {
|
|
1153
|
-
|
|
1154
|
-
y: this.exteriorRing.bbox.ll.y
|
|
1155
|
-
},
|
|
1156
|
-
ur: {
|
|
1157
|
-
x: this.exteriorRing.bbox.ur.x,
|
|
1158
|
-
y: this.exteriorRing.bbox.ur.y
|
|
1159
|
-
}
|
|
1863
|
+
this.exteriorRing = new Je(i[0], this, !0), this.bbox = {
|
|
1864
|
+
ll: { x: this.exteriorRing.bbox.ll.x, y: this.exteriorRing.bbox.ll.y },
|
|
1865
|
+
ur: { x: this.exteriorRing.bbox.ur.x, y: this.exteriorRing.bbox.ur.y }
|
|
1160
1866
|
}, this.interiorRings = [];
|
|
1161
|
-
for (let
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1867
|
+
for (let e = 1, n = i.length; e < n; e++) {
|
|
1868
|
+
const r = new Je(i[e], this, !1);
|
|
1869
|
+
r.bbox.ll.x.isLessThan(this.bbox.ll.x) && (this.bbox.ll.x = r.bbox.ll.x), r.bbox.ll.y.isLessThan(this.bbox.ll.y) && (this.bbox.ll.y = r.bbox.ll.y), r.bbox.ur.x.isGreaterThan(this.bbox.ur.x) && (this.bbox.ur.x = r.bbox.ur.x), r.bbox.ur.y.isGreaterThan(this.bbox.ur.y) && (this.bbox.ur.y = r.bbox.ur.y), this.interiorRings.push(r);
|
|
1164
1870
|
}
|
|
1165
|
-
this.multiPoly =
|
|
1871
|
+
this.multiPoly = t;
|
|
1166
1872
|
}
|
|
1167
1873
|
getSweepEvents() {
|
|
1168
|
-
const
|
|
1169
|
-
for (let
|
|
1170
|
-
const
|
|
1171
|
-
for (let
|
|
1172
|
-
|
|
1874
|
+
const i = this.exteriorRing.getSweepEvents();
|
|
1875
|
+
for (let t = 0, e = this.interiorRings.length; t < e; t++) {
|
|
1876
|
+
const n = this.interiorRings[t].getSweepEvents();
|
|
1877
|
+
for (let r = 0, f = n.length; r < f; r++)
|
|
1878
|
+
i.push(n[r]);
|
|
1173
1879
|
}
|
|
1174
|
-
return
|
|
1880
|
+
return i;
|
|
1175
1881
|
}
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1882
|
+
}, je = class {
|
|
1883
|
+
constructor(i, t) {
|
|
1884
|
+
M(this, "isSubject");
|
|
1885
|
+
M(this, "polys");
|
|
1886
|
+
M(this, "bbox");
|
|
1887
|
+
if (!Array.isArray(i))
|
|
1180
1888
|
throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
|
|
1181
1889
|
try {
|
|
1182
|
-
typeof
|
|
1890
|
+
typeof i[0][0][0] == "number" && (i = [i]);
|
|
1183
1891
|
} catch {
|
|
1184
1892
|
}
|
|
1185
1893
|
this.polys = [], this.bbox = {
|
|
1186
|
-
ll: {
|
|
1187
|
-
|
|
1188
|
-
y: Number.POSITIVE_INFINITY
|
|
1189
|
-
},
|
|
1190
|
-
ur: {
|
|
1191
|
-
x: Number.NEGATIVE_INFINITY,
|
|
1192
|
-
y: Number.NEGATIVE_INFINITY
|
|
1193
|
-
}
|
|
1894
|
+
ll: { x: new ne(Number.POSITIVE_INFINITY), y: new ne(Number.POSITIVE_INFINITY) },
|
|
1895
|
+
ur: { x: new ne(Number.NEGATIVE_INFINITY), y: new ne(Number.NEGATIVE_INFINITY) }
|
|
1194
1896
|
};
|
|
1195
|
-
for (let
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1897
|
+
for (let e = 0, n = i.length; e < n; e++) {
|
|
1898
|
+
const r = new qt(i[e], this);
|
|
1899
|
+
r.bbox.ll.x.isLessThan(this.bbox.ll.x) && (this.bbox.ll.x = r.bbox.ll.x), r.bbox.ll.y.isLessThan(this.bbox.ll.y) && (this.bbox.ll.y = r.bbox.ll.y), r.bbox.ur.x.isGreaterThan(this.bbox.ur.x) && (this.bbox.ur.x = r.bbox.ur.x), r.bbox.ur.y.isGreaterThan(this.bbox.ur.y) && (this.bbox.ur.y = r.bbox.ur.y), this.polys.push(r);
|
|
1198
1900
|
}
|
|
1199
|
-
this.isSubject =
|
|
1901
|
+
this.isSubject = t;
|
|
1200
1902
|
}
|
|
1201
1903
|
getSweepEvents() {
|
|
1202
|
-
const
|
|
1203
|
-
for (let
|
|
1204
|
-
const
|
|
1205
|
-
for (let
|
|
1206
|
-
|
|
1207
|
-
}
|
|
1208
|
-
return t;
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
class W {
|
|
1212
|
-
/* Given the segments from the sweep line pass, compute & return a series
|
|
1213
|
-
* of closed rings from all the segments marked to be part of the result */
|
|
1214
|
-
static factory(t) {
|
|
1215
|
-
const e = [];
|
|
1216
|
-
for (let n = 0, r = t.length; n < r; n++) {
|
|
1217
|
-
const i = t[n];
|
|
1218
|
-
if (!i.isInResult() || i.ringOut) continue;
|
|
1219
|
-
let u = null, l = i.leftSE, c = i.rightSE;
|
|
1220
|
-
const f = [l], a = l.point, s = [];
|
|
1221
|
-
for (; u = l, l = c, f.push(l), l.point !== a; )
|
|
1222
|
-
for (; ; ) {
|
|
1223
|
-
const h = l.getAvailableLinkedEvents();
|
|
1224
|
-
if (h.length === 0) {
|
|
1225
|
-
const p = f[0].point, d = f[f.length - 1].point;
|
|
1226
|
-
throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${d.x}, ${d.y}].`);
|
|
1227
|
-
}
|
|
1228
|
-
if (h.length === 1) {
|
|
1229
|
-
c = h[0].otherSE;
|
|
1230
|
-
break;
|
|
1231
|
-
}
|
|
1232
|
-
let g = null;
|
|
1233
|
-
for (let p = 0, d = s.length; p < d; p++)
|
|
1234
|
-
if (s[p].point === l.point) {
|
|
1235
|
-
g = p;
|
|
1236
|
-
break;
|
|
1237
|
-
}
|
|
1238
|
-
if (g !== null) {
|
|
1239
|
-
const p = s.splice(g)[0], d = f.splice(p.index);
|
|
1240
|
-
d.unshift(d[0].otherSE), e.push(new W(d.reverse()));
|
|
1241
|
-
continue;
|
|
1242
|
-
}
|
|
1243
|
-
s.push({
|
|
1244
|
-
index: f.length,
|
|
1245
|
-
point: l.point
|
|
1246
|
-
});
|
|
1247
|
-
const y = l.getLeftmostComparator(u);
|
|
1248
|
-
c = h.sort(y)[0].otherSE;
|
|
1249
|
-
break;
|
|
1250
|
-
}
|
|
1251
|
-
e.push(new W(f));
|
|
1252
|
-
}
|
|
1253
|
-
return e;
|
|
1254
|
-
}
|
|
1255
|
-
constructor(t) {
|
|
1256
|
-
this.events = t;
|
|
1257
|
-
for (let e = 0, n = t.length; e < n; e++)
|
|
1258
|
-
t[e].segment.ringOut = this;
|
|
1259
|
-
this.poly = null;
|
|
1260
|
-
}
|
|
1261
|
-
getGeom() {
|
|
1262
|
-
let t = this.events[0].point;
|
|
1263
|
-
const e = [t];
|
|
1264
|
-
for (let f = 1, a = this.events.length - 1; f < a; f++) {
|
|
1265
|
-
const s = this.events[f].point, h = this.events[f + 1].point;
|
|
1266
|
-
bt(s, t, h) !== 0 && (e.push(s), t = s);
|
|
1267
|
-
}
|
|
1268
|
-
if (e.length === 1) return null;
|
|
1269
|
-
const n = e[0], r = e[1];
|
|
1270
|
-
bt(n, t, r) === 0 && e.shift(), e.push(e[0]);
|
|
1271
|
-
const i = this.isExteriorRing() ? 1 : -1, u = this.isExteriorRing() ? 0 : e.length - 1, l = this.isExteriorRing() ? e.length : -1, c = [];
|
|
1272
|
-
for (let f = u; f != l; f += i) c.push([e[f].x, e[f].y]);
|
|
1273
|
-
return c;
|
|
1274
|
-
}
|
|
1275
|
-
isExteriorRing() {
|
|
1276
|
-
if (this._isExteriorRing === void 0) {
|
|
1277
|
-
const t = this.enclosingRing();
|
|
1278
|
-
this._isExteriorRing = t ? !t.isExteriorRing() : !0;
|
|
1279
|
-
}
|
|
1280
|
-
return this._isExteriorRing;
|
|
1281
|
-
}
|
|
1282
|
-
enclosingRing() {
|
|
1283
|
-
return this._enclosingRing === void 0 && (this._enclosingRing = this._calcEnclosingRing()), this._enclosingRing;
|
|
1284
|
-
}
|
|
1285
|
-
/* Returns the ring that encloses this one, if any */
|
|
1286
|
-
_calcEnclosingRing() {
|
|
1287
|
-
let t = this.events[0];
|
|
1288
|
-
for (let r = 1, i = this.events.length; r < i; r++) {
|
|
1289
|
-
const u = this.events[r];
|
|
1290
|
-
R.compare(t, u) > 0 && (t = u);
|
|
1291
|
-
}
|
|
1292
|
-
let e = t.segment.prevInResult(), n = e ? e.prevInResult() : null;
|
|
1293
|
-
for (; ; ) {
|
|
1294
|
-
if (!e) return null;
|
|
1295
|
-
if (!n) return e.ringOut;
|
|
1296
|
-
if (n.ringOut !== e.ringOut)
|
|
1297
|
-
return n.ringOut.enclosingRing() !== e.ringOut ? e.ringOut : e.ringOut.enclosingRing();
|
|
1298
|
-
e = n.prevInResult(), n = e ? e.prevInResult() : null;
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
class Rt {
|
|
1303
|
-
constructor(t) {
|
|
1304
|
-
this.exteriorRing = t, t.poly = this, this.interiorRings = [];
|
|
1305
|
-
}
|
|
1306
|
-
addInterior(t) {
|
|
1307
|
-
this.interiorRings.push(t), t.poly = this;
|
|
1308
|
-
}
|
|
1309
|
-
getGeom() {
|
|
1310
|
-
const t = [this.exteriorRing.getGeom()];
|
|
1311
|
-
if (t[0] === null) return null;
|
|
1312
|
-
for (let e = 0, n = this.interiorRings.length; e < n; e++) {
|
|
1313
|
-
const r = this.interiorRings[e].getGeom();
|
|
1314
|
-
r !== null && t.push(r);
|
|
1904
|
+
const i = [];
|
|
1905
|
+
for (let t = 0, e = this.polys.length; t < e; t++) {
|
|
1906
|
+
const n = this.polys[t].getSweepEvents();
|
|
1907
|
+
for (let r = 0, f = n.length; r < f; r++)
|
|
1908
|
+
i.push(n[r]);
|
|
1315
1909
|
}
|
|
1316
|
-
return
|
|
1910
|
+
return i;
|
|
1317
1911
|
}
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
this.rings = t, this.polys = this._composePolys(t);
|
|
1322
|
-
}
|
|
1323
|
-
getGeom() {
|
|
1324
|
-
const t = [];
|
|
1325
|
-
for (let e = 0, n = this.polys.length; e < n; e++) {
|
|
1326
|
-
const r = this.polys[e].getGeom();
|
|
1327
|
-
r !== null && t.push(r);
|
|
1328
|
-
}
|
|
1329
|
-
return t;
|
|
1330
|
-
}
|
|
1331
|
-
_composePolys(t) {
|
|
1332
|
-
const e = [];
|
|
1333
|
-
for (let n = 0, r = t.length; n < r; n++) {
|
|
1334
|
-
const i = t[n];
|
|
1335
|
-
if (!i.poly)
|
|
1336
|
-
if (i.isExteriorRing()) e.push(new Rt(i));
|
|
1337
|
-
else {
|
|
1338
|
-
const u = i.enclosingRing();
|
|
1339
|
-
u.poly || e.push(new Rt(u)), u.poly.addInterior(i);
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
return e;
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
class xe {
|
|
1346
|
-
constructor(t) {
|
|
1347
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : z.compare;
|
|
1348
|
-
this.queue = t, this.tree = new lt(e), this.segments = [];
|
|
1349
|
-
}
|
|
1350
|
-
process(t) {
|
|
1351
|
-
const e = t.segment, n = [];
|
|
1352
|
-
if (t.consumedBy)
|
|
1353
|
-
return t.isLeft ? this.queue.remove(t.otherSE) : this.tree.remove(e), n;
|
|
1354
|
-
const r = t.isLeft ? this.tree.add(e) : this.tree.find(e);
|
|
1355
|
-
if (!r) 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.`);
|
|
1356
|
-
let i = r, u = r, l, c;
|
|
1357
|
-
for (; l === void 0; )
|
|
1358
|
-
i = this.tree.prev(i), i === null ? l = null : i.key.consumedBy === void 0 && (l = i.key);
|
|
1359
|
-
for (; c === void 0; )
|
|
1360
|
-
u = this.tree.next(u), u === null ? c = null : u.key.consumedBy === void 0 && (c = u.key);
|
|
1361
|
-
if (t.isLeft) {
|
|
1362
|
-
let f = null;
|
|
1363
|
-
if (l) {
|
|
1364
|
-
const s = l.getIntersection(e);
|
|
1365
|
-
if (s !== null && (e.isAnEndpoint(s) || (f = s), !l.isAnEndpoint(s))) {
|
|
1366
|
-
const h = this._splitSafely(l, s);
|
|
1367
|
-
for (let g = 0, y = h.length; g < y; g++)
|
|
1368
|
-
n.push(h[g]);
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
let a = null;
|
|
1372
|
-
if (c) {
|
|
1373
|
-
const s = c.getIntersection(e);
|
|
1374
|
-
if (s !== null && (e.isAnEndpoint(s) || (a = s), !c.isAnEndpoint(s))) {
|
|
1375
|
-
const h = this._splitSafely(c, s);
|
|
1376
|
-
for (let g = 0, y = h.length; g < y; g++)
|
|
1377
|
-
n.push(h[g]);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
if (f !== null || a !== null) {
|
|
1381
|
-
let s = null;
|
|
1382
|
-
f === null ? s = a : a === null ? s = f : s = R.comparePoints(f, a) <= 0 ? f : a, this.queue.remove(e.rightSE), n.push(e.rightSE);
|
|
1383
|
-
const h = e.split(s);
|
|
1384
|
-
for (let g = 0, y = h.length; g < y; g++)
|
|
1385
|
-
n.push(h[g]);
|
|
1386
|
-
}
|
|
1387
|
-
n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = l);
|
|
1388
|
-
} else {
|
|
1389
|
-
if (l && c) {
|
|
1390
|
-
const f = l.getIntersection(c);
|
|
1391
|
-
if (f !== null) {
|
|
1392
|
-
if (!l.isAnEndpoint(f)) {
|
|
1393
|
-
const a = this._splitSafely(l, f);
|
|
1394
|
-
for (let s = 0, h = a.length; s < h; s++)
|
|
1395
|
-
n.push(a[s]);
|
|
1396
|
-
}
|
|
1397
|
-
if (!c.isAnEndpoint(f)) {
|
|
1398
|
-
const a = this._splitSafely(c, f);
|
|
1399
|
-
for (let s = 0, h = a.length; s < h; s++)
|
|
1400
|
-
n.push(a[s]);
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
this.tree.remove(e);
|
|
1405
|
-
}
|
|
1406
|
-
return n;
|
|
1407
|
-
}
|
|
1408
|
-
/* Safely split a segment that is currently in the datastructures
|
|
1409
|
-
* IE - a segment other than the one that is currently being processed. */
|
|
1410
|
-
_splitSafely(t, e) {
|
|
1411
|
-
this.tree.remove(t);
|
|
1412
|
-
const n = t.rightSE;
|
|
1413
|
-
this.queue.remove(n);
|
|
1414
|
-
const r = t.split(e);
|
|
1415
|
-
return r.push(n), t.consumedBy === void 0 && this.tree.add(t), r;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
const Lt = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, de = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
|
|
1419
|
-
class ve {
|
|
1420
|
-
run(t, e, n) {
|
|
1421
|
-
A.type = t, U.reset();
|
|
1422
|
-
const r = [new Mt(e, !0)];
|
|
1423
|
-
for (let s = 0, h = n.length; s < h; s++)
|
|
1424
|
-
r.push(new Mt(n[s], !1));
|
|
1425
|
-
if (A.numMultiPolys = r.length, A.type === "difference") {
|
|
1426
|
-
const s = r[0];
|
|
1427
|
-
let h = 1;
|
|
1428
|
-
for (; h < r.length; )
|
|
1429
|
-
it(r[h].bbox, s.bbox) !== null ? h++ : r.splice(h, 1);
|
|
1430
|
-
}
|
|
1431
|
-
if (A.type === "intersection")
|
|
1432
|
-
for (let s = 0, h = r.length; s < h; s++) {
|
|
1433
|
-
const g = r[s];
|
|
1434
|
-
for (let y = s + 1, p = r.length; y < p; y++)
|
|
1435
|
-
if (it(g.bbox, r[y].bbox) === null) return [];
|
|
1436
|
-
}
|
|
1437
|
-
const i = new lt(R.compare);
|
|
1438
|
-
for (let s = 0, h = r.length; s < h; s++) {
|
|
1439
|
-
const g = r[s].getSweepEvents();
|
|
1440
|
-
for (let y = 0, p = g.length; y < p; y++)
|
|
1441
|
-
if (i.insert(g[y]), i.size > Lt)
|
|
1442
|
-
throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
|
|
1443
|
-
}
|
|
1444
|
-
const u = new xe(i);
|
|
1445
|
-
let l = i.size, c = i.pop();
|
|
1446
|
-
for (; c; ) {
|
|
1447
|
-
const s = c.key;
|
|
1448
|
-
if (i.size === l) {
|
|
1449
|
-
const g = s.segment;
|
|
1450
|
-
throw new Error(`Unable to pop() ${s.isLeft ? "left" : "right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`);
|
|
1451
|
-
}
|
|
1452
|
-
if (i.size > Lt)
|
|
1453
|
-
throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
|
|
1454
|
-
if (u.segments.length > de)
|
|
1455
|
-
throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
|
|
1456
|
-
const h = u.process(s);
|
|
1457
|
-
for (let g = 0, y = h.length; g < y; g++) {
|
|
1458
|
-
const p = h[g];
|
|
1459
|
-
p.consumedBy === void 0 && i.insert(p);
|
|
1460
|
-
}
|
|
1461
|
-
l = i.size, c = i.pop();
|
|
1462
|
-
}
|
|
1463
|
-
U.reset();
|
|
1464
|
-
const f = W.factory(u.segments);
|
|
1465
|
-
return new ye(f).getGeom();
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
const A = new ve(), me = function(o) {
|
|
1469
|
-
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1470
|
-
e[n - 1] = arguments[n];
|
|
1471
|
-
return A.run("union", o, e);
|
|
1472
|
-
}, we = function(o) {
|
|
1473
|
-
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1474
|
-
e[n - 1] = arguments[n];
|
|
1475
|
-
return A.run("intersection", o, e);
|
|
1476
|
-
}, Ee = function(o) {
|
|
1477
|
-
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1478
|
-
e[n - 1] = arguments[n];
|
|
1479
|
-
return A.run("xor", o, e);
|
|
1480
|
-
}, be = function(o) {
|
|
1481
|
-
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
1482
|
-
e[n - 1] = arguments[n];
|
|
1483
|
-
return A.run("difference", o, e);
|
|
1484
|
-
};
|
|
1485
|
-
var Ft = {
|
|
1486
|
-
union: me,
|
|
1487
|
-
intersection: we,
|
|
1488
|
-
xor: Ee,
|
|
1489
|
-
difference: be
|
|
1490
|
-
};
|
|
1491
|
-
function Se(o) {
|
|
1912
|
+
}, Dt = (i, ...t) => Te.run("union", i, t), zt = (i, ...t) => Te.run("difference", i, t);
|
|
1913
|
+
le.set;
|
|
1914
|
+
function Ut(i) {
|
|
1492
1915
|
const t = [];
|
|
1493
|
-
if (
|
|
1916
|
+
if (Ge(i, (r) => {
|
|
1494
1917
|
t.push(r.coordinates);
|
|
1495
1918
|
}), t.length < 2)
|
|
1496
1919
|
throw new Error("Must have at least two features");
|
|
1497
|
-
const e =
|
|
1498
|
-
return n.length === 0 ? null : n.length === 1 ?
|
|
1920
|
+
const e = i.features[0].properties || {}, n = zt(t[0], ...t.slice(1));
|
|
1921
|
+
return n.length === 0 ? null : n.length === 1 ? Be(n[0], e) : rt(n, e);
|
|
1499
1922
|
}
|
|
1500
|
-
var
|
|
1501
|
-
function
|
|
1502
|
-
if (!
|
|
1503
|
-
throw new Error("geojson is required");
|
|
1923
|
+
var Vt = Ut;
|
|
1924
|
+
function $t(i) {
|
|
1925
|
+
if (!i) throw new Error("geojson is required");
|
|
1504
1926
|
var t = [];
|
|
1505
|
-
return
|
|
1927
|
+
return St(i, function(e) {
|
|
1506
1928
|
t.push(e);
|
|
1507
|
-
}),
|
|
1929
|
+
}), Ce(t);
|
|
1508
1930
|
}
|
|
1509
|
-
var
|
|
1510
|
-
function
|
|
1931
|
+
var Kt = $t;
|
|
1932
|
+
function Xt(i, t = {}) {
|
|
1511
1933
|
const e = [];
|
|
1512
|
-
if (
|
|
1934
|
+
if (Ge(i, (r) => {
|
|
1513
1935
|
e.push(r.coordinates);
|
|
1514
1936
|
}), e.length < 2)
|
|
1515
1937
|
throw new Error("Must have at least 2 geometries");
|
|
1516
|
-
const n =
|
|
1517
|
-
return n.length === 0 ? null : n.length === 1 ?
|
|
1938
|
+
const n = Dt(e[0], ...e.slice(1));
|
|
1939
|
+
return n.length === 0 ? null : n.length === 1 ? Be(n[0], t.properties) : rt(n, t.properties);
|
|
1518
1940
|
}
|
|
1519
|
-
var
|
|
1520
|
-
function
|
|
1521
|
-
const t = [...
|
|
1941
|
+
var Yt = Xt;
|
|
1942
|
+
function Qe(i) {
|
|
1943
|
+
const t = [...i];
|
|
1522
1944
|
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;
|
|
1523
1945
|
}
|
|
1524
|
-
function
|
|
1525
|
-
const e =
|
|
1526
|
-
|
|
1527
|
-
|
|
1946
|
+
function et(i, t) {
|
|
1947
|
+
const e = Vt(
|
|
1948
|
+
Ce([
|
|
1949
|
+
Be([
|
|
1528
1950
|
[
|
|
1529
1951
|
[180, 90],
|
|
1530
1952
|
[-180, 90],
|
|
@@ -1533,56 +1955,56 @@ function kt(o, t) {
|
|
|
1533
1955
|
[180, 90]
|
|
1534
1956
|
]
|
|
1535
1957
|
]),
|
|
1536
|
-
|
|
1958
|
+
i
|
|
1537
1959
|
])
|
|
1538
1960
|
);
|
|
1539
1961
|
if (!e)
|
|
1540
1962
|
return;
|
|
1541
1963
|
e.properties = { isMask: !0 };
|
|
1542
|
-
const n =
|
|
1543
|
-
if (
|
|
1544
|
-
for (const
|
|
1545
|
-
const
|
|
1546
|
-
if (
|
|
1547
|
-
for (const
|
|
1548
|
-
for (const
|
|
1549
|
-
|
|
1550
|
-
if (
|
|
1551
|
-
for (const
|
|
1552
|
-
for (const
|
|
1553
|
-
|
|
1964
|
+
const n = Qe(Ke(i)), r = (n[2] - n[0]) / 360 / 1e3, f = n[0] < -180, a = n[2] > 180, c = Kt(i);
|
|
1965
|
+
if (c.features.length > 1 && (f || a))
|
|
1966
|
+
for (const E of c.features) {
|
|
1967
|
+
const d = Qe(Ke(E));
|
|
1968
|
+
if (a && d[0] < -180 + r)
|
|
1969
|
+
for (const T of E.geometry.coordinates)
|
|
1970
|
+
for (const b of T)
|
|
1971
|
+
b[0] += 360 - r;
|
|
1972
|
+
if (f && d[2] > 180 - r)
|
|
1973
|
+
for (const T of E.geometry.coordinates)
|
|
1974
|
+
for (const b of T)
|
|
1975
|
+
b[0] -= 360 - r;
|
|
1554
1976
|
}
|
|
1555
1977
|
t(
|
|
1556
|
-
|
|
1557
|
-
|
|
1978
|
+
Ce([
|
|
1979
|
+
c.features.length < 2 ? i : Yt(c) ?? i,
|
|
1558
1980
|
e
|
|
1559
1981
|
])
|
|
1560
1982
|
);
|
|
1561
1983
|
}
|
|
1562
|
-
const
|
|
1563
|
-
function
|
|
1564
|
-
var
|
|
1565
|
-
const t =
|
|
1566
|
-
return new
|
|
1567
|
-
stroke: e ? void 0 : new
|
|
1984
|
+
const tt = "EPSG:4326";
|
|
1985
|
+
function Wt(i) {
|
|
1986
|
+
var f;
|
|
1987
|
+
const t = i.getProperties(), { isMask: e } = t, n = (f = i.getGeometry()) == null ? void 0 : f.getType(), r = e ? 0 : n === "LineString" || n === "MultiLineString" ? 3 : 2;
|
|
1988
|
+
return new wt({
|
|
1989
|
+
stroke: e ? void 0 : new $e({
|
|
1568
1990
|
color: "#3170fe",
|
|
1569
1991
|
lineDash: [r, r],
|
|
1570
1992
|
width: r,
|
|
1571
1993
|
lineCap: "butt"
|
|
1572
1994
|
}),
|
|
1573
|
-
fill: e ? new
|
|
1995
|
+
fill: e ? new Ve({
|
|
1574
1996
|
color: "#00000020"
|
|
1575
1997
|
}) : void 0,
|
|
1576
|
-
image: new
|
|
1998
|
+
image: new xt({
|
|
1577
1999
|
src: `/icons/marker_${t.isReverse ? "reverse" : t.isSelected ? "selected" : "unselected"}.svg`,
|
|
1578
2000
|
anchor: [0.5, 1]
|
|
1579
2001
|
}),
|
|
1580
2002
|
zIndex: t.isSelected ? 2 : t.isReverse ? 0 : 1,
|
|
1581
|
-
text: t.isSelected && t.tooltip ? new
|
|
1582
|
-
backgroundFill: new
|
|
2003
|
+
text: t.isSelected && t.tooltip ? new Et({
|
|
2004
|
+
backgroundFill: new Ve({ color: "white" }),
|
|
1583
2005
|
text: t.tooltip,
|
|
1584
2006
|
offsetY: -40,
|
|
1585
|
-
backgroundStroke: new
|
|
2007
|
+
backgroundStroke: new $e({
|
|
1586
2008
|
color: "white",
|
|
1587
2009
|
lineJoin: "round",
|
|
1588
2010
|
width: 3
|
|
@@ -1591,162 +2013,162 @@ function Ie(o) {
|
|
|
1591
2013
|
}) : void 0
|
|
1592
2014
|
});
|
|
1593
2015
|
}
|
|
1594
|
-
function
|
|
1595
|
-
let r = -1,
|
|
1596
|
-
const
|
|
2016
|
+
function oi(i, t = {}, e = {}, n = Wt) {
|
|
2017
|
+
let r = -1, f, a, c, E = !1;
|
|
2018
|
+
const d = new gt({
|
|
1597
2019
|
updateWhileAnimating: !0
|
|
1598
2020
|
});
|
|
1599
|
-
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
const
|
|
1604
|
-
if (
|
|
1605
|
-
return
|
|
2021
|
+
i.addLayer(d);
|
|
2022
|
+
const T = new dt({});
|
|
2023
|
+
d.setSource(T), d.setStyle(n), i.on("click", (_) => {
|
|
2024
|
+
i.forEachFeatureAtPixel(_.pixel, (L) => {
|
|
2025
|
+
const A = L.getId();
|
|
2026
|
+
if (A)
|
|
2027
|
+
return _.stopPropagation(), a == null || a({ type: "markerClick", id: A }), L;
|
|
1606
2028
|
});
|
|
1607
|
-
}),
|
|
1608
|
-
const
|
|
1609
|
-
|
|
2029
|
+
}), i.on("pointermove", (_) => {
|
|
2030
|
+
const L = i.forEachFeatureAtPixel(_.pixel, (A) => A.getId());
|
|
2031
|
+
f !== L && (f && (a == null || a({
|
|
1610
2032
|
type: "markerMouseLeave",
|
|
1611
|
-
id:
|
|
1612
|
-
})),
|
|
2033
|
+
id: f
|
|
2034
|
+
})), L && (a == null || a({
|
|
1613
2035
|
type: "markerMouseEnter",
|
|
1614
|
-
id:
|
|
1615
|
-
})),
|
|
2036
|
+
id: L
|
|
2037
|
+
})), i.getTargetElement().style.cursor = L ? "pointer" : E ? "crosshair" : "", f = L);
|
|
1616
2038
|
});
|
|
1617
|
-
function
|
|
1618
|
-
return
|
|
2039
|
+
function b() {
|
|
2040
|
+
return mt() ?? i.getView().getProjection();
|
|
1619
2041
|
}
|
|
1620
|
-
function
|
|
1621
|
-
return
|
|
2042
|
+
function P(_) {
|
|
2043
|
+
return _.transform(tt, b());
|
|
1622
2044
|
}
|
|
1623
|
-
const
|
|
1624
|
-
|
|
2045
|
+
const N = (_) => {
|
|
2046
|
+
a == null || a({
|
|
1625
2047
|
type: "mapClick",
|
|
1626
|
-
coordinates:
|
|
2048
|
+
coordinates: Ue(_.coordinate, b())
|
|
1627
2049
|
});
|
|
1628
2050
|
};
|
|
1629
2051
|
return {
|
|
1630
|
-
setEventHandler(
|
|
1631
|
-
|
|
2052
|
+
setEventHandler(_) {
|
|
2053
|
+
_ ? (a = _, i.on("click", N)) : (a = void 0, i.un("click", N));
|
|
1632
2054
|
},
|
|
1633
|
-
flyTo(
|
|
1634
|
-
|
|
1635
|
-
center:
|
|
1636
|
-
...
|
|
2055
|
+
flyTo(_, L) {
|
|
2056
|
+
i.getView().animate({
|
|
2057
|
+
center: me(_, b()),
|
|
2058
|
+
...L ? { zoom: L } : {},
|
|
1637
2059
|
duration: 2e3,
|
|
1638
2060
|
...t
|
|
1639
2061
|
});
|
|
1640
2062
|
},
|
|
1641
|
-
fitBounds(
|
|
1642
|
-
|
|
1643
|
-
padding: [
|
|
1644
|
-
...
|
|
2063
|
+
fitBounds(_, L, A) {
|
|
2064
|
+
i.getView().fit(yt(_, tt, b()), {
|
|
2065
|
+
padding: [L, L, L, L],
|
|
2066
|
+
...A ? { maxZoom: A } : {},
|
|
1645
2067
|
duration: 2e3,
|
|
1646
2068
|
...e
|
|
1647
2069
|
});
|
|
1648
2070
|
},
|
|
1649
|
-
indicateReverse(
|
|
1650
|
-
|
|
2071
|
+
indicateReverse(_) {
|
|
2072
|
+
E = _, i.getTargetElement().style.cursor = _ ? "crosshair" : "";
|
|
1651
2073
|
},
|
|
1652
|
-
setReverseMarker(
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
) : (
|
|
1656
|
-
new
|
|
1657
|
-
),
|
|
2074
|
+
setReverseMarker(_) {
|
|
2075
|
+
c ? _ ? c.getGeometry().setCoordinates(
|
|
2076
|
+
me(_, b())
|
|
2077
|
+
) : (T.removeFeature(c), c.dispose(), c = void 0) : _ && (c = new se(
|
|
2078
|
+
new Re(me(_, b()))
|
|
2079
|
+
), c.setProperties({ isReverse: !0 }), T.addFeature(c));
|
|
1658
2080
|
},
|
|
1659
|
-
setFeatures(
|
|
1660
|
-
function
|
|
1661
|
-
var
|
|
1662
|
-
if (
|
|
1663
|
-
for (const
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1666
|
-
new
|
|
1667
|
-
isMask: !!((
|
|
1668
|
-
geometry:
|
|
2081
|
+
setFeatures(_, L, A) {
|
|
2082
|
+
function V(S) {
|
|
2083
|
+
var F;
|
|
2084
|
+
if (S)
|
|
2085
|
+
for (const B of S.features) {
|
|
2086
|
+
const Y = B.geometry.type === "Polygon" ? new Fe(B.geometry.coordinates) : B.geometry.type === "MultiPolygon" ? new qe(B.geometry.coordinates) : null;
|
|
2087
|
+
Y && T.addFeature(
|
|
2088
|
+
new se({
|
|
2089
|
+
isMask: !!((F = B.properties) != null && F.isMask),
|
|
2090
|
+
geometry: P(Y)
|
|
1669
2091
|
})
|
|
1670
2092
|
);
|
|
1671
2093
|
}
|
|
1672
2094
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
let
|
|
1676
|
-
if (
|
|
1677
|
-
const
|
|
1678
|
-
(
|
|
1679
|
-
).filter((
|
|
1680
|
-
if (
|
|
1681
|
-
|
|
1682
|
-
new
|
|
1683
|
-
),
|
|
2095
|
+
T.clear(), c && T.addFeature(c);
|
|
2096
|
+
e: if (L) {
|
|
2097
|
+
let S = !1;
|
|
2098
|
+
if (L.geometry.type === "GeometryCollection") {
|
|
2099
|
+
const F = L.geometry.geometries.map(
|
|
2100
|
+
(B) => B.type === "Polygon" ? new Fe(B.coordinates) : B.type === "MultiPolygon" ? new qe(B.coordinates) : null
|
|
2101
|
+
).filter((B) => !!B);
|
|
2102
|
+
if (F.length > 0)
|
|
2103
|
+
T.addFeature(
|
|
2104
|
+
new se(P(new pt(F)))
|
|
2105
|
+
), S = !0;
|
|
1684
2106
|
else
|
|
1685
|
-
for (const
|
|
1686
|
-
|
|
1687
|
-
new
|
|
1688
|
-
|
|
2107
|
+
for (const B of L.geometry.geometries)
|
|
2108
|
+
B.type === "LineString" ? (T.addFeature(
|
|
2109
|
+
new se(
|
|
2110
|
+
P(new De(B.coordinates))
|
|
1689
2111
|
)
|
|
1690
|
-
),
|
|
1691
|
-
new
|
|
1692
|
-
|
|
2112
|
+
), S = !0) : B.type === "MultiLineString" && T.addFeature(
|
|
2113
|
+
new se(
|
|
2114
|
+
P(new ze(B.coordinates))
|
|
1693
2115
|
)
|
|
1694
|
-
),
|
|
2116
|
+
), S = !0;
|
|
1695
2117
|
}
|
|
1696
|
-
if (!
|
|
1697
|
-
if (
|
|
1698
|
-
|
|
1699
|
-
else if (
|
|
1700
|
-
|
|
1701
|
-
else if (
|
|
1702
|
-
|
|
1703
|
-
new
|
|
1704
|
-
|
|
2118
|
+
if (!S) {
|
|
2119
|
+
if (L.geometry.type === "Polygon")
|
|
2120
|
+
et(L, V);
|
|
2121
|
+
else if (L.geometry.type === "MultiPolygon")
|
|
2122
|
+
et(L, V);
|
|
2123
|
+
else if (L.geometry.type === "LineString") {
|
|
2124
|
+
T.addFeature(
|
|
2125
|
+
new se(
|
|
2126
|
+
P(new De(L.geometry.coordinates))
|
|
1705
2127
|
)
|
|
1706
2128
|
);
|
|
1707
|
-
break
|
|
1708
|
-
} else if (
|
|
1709
|
-
|
|
1710
|
-
new
|
|
1711
|
-
|
|
2129
|
+
break e;
|
|
2130
|
+
} else if (L.geometry.type === "MultiLineString") {
|
|
2131
|
+
T.addFeature(
|
|
2132
|
+
new se(
|
|
2133
|
+
P(new ze(L.geometry.coordinates))
|
|
1712
2134
|
)
|
|
1713
2135
|
);
|
|
1714
|
-
break
|
|
2136
|
+
break e;
|
|
1715
2137
|
}
|
|
1716
2138
|
}
|
|
1717
|
-
if (!
|
|
1718
|
-
break
|
|
1719
|
-
|
|
2139
|
+
if (!A && L.geometry.type !== "Point")
|
|
2140
|
+
break e;
|
|
2141
|
+
T.addFeature(new se(P(new Re(L.center))));
|
|
1720
2142
|
}
|
|
1721
|
-
for (const
|
|
1722
|
-
if (
|
|
2143
|
+
for (const S of _ ?? []) {
|
|
2144
|
+
if (S === L)
|
|
1723
2145
|
continue;
|
|
1724
|
-
const
|
|
1725
|
-
new
|
|
2146
|
+
const F = new se(
|
|
2147
|
+
new Re(me(S.center, b()))
|
|
1726
2148
|
);
|
|
1727
|
-
|
|
1728
|
-
fuzzy: !!
|
|
1729
|
-
tooltip:
|
|
1730
|
-
}),
|
|
2149
|
+
F.setId(S.id), F.setProperties({
|
|
2150
|
+
fuzzy: !!S.matching_text,
|
|
2151
|
+
tooltip: S.place_type[0] === "reverse" ? S.place_name : S.place_name.replace(/,.*/, "")
|
|
2152
|
+
}), T.addFeature(F);
|
|
1731
2153
|
}
|
|
1732
2154
|
},
|
|
1733
|
-
setSelectedMarker(
|
|
1734
|
-
var
|
|
1735
|
-
const
|
|
1736
|
-
r > -1 && ((
|
|
2155
|
+
setSelectedMarker(_) {
|
|
2156
|
+
var V, S, F;
|
|
2157
|
+
const L = T.getFeatures(), A = (V = L[0]) != null && V.getProperties().isReverse ? 1 : 0;
|
|
2158
|
+
r > -1 && ((S = L[r + A]) == null || S.setProperties({
|
|
1737
2159
|
isSelected: !1
|
|
1738
|
-
})),
|
|
2160
|
+
})), _ > -1 && ((F = L[_ + A]) == null || F.setProperties({
|
|
1739
2161
|
isSelected: !0
|
|
1740
|
-
})), r =
|
|
2162
|
+
})), r = _;
|
|
1741
2163
|
},
|
|
1742
2164
|
getCenterAndZoom() {
|
|
1743
|
-
const
|
|
1744
|
-
if (!(!
|
|
1745
|
-
return [
|
|
2165
|
+
const _ = i.getView(), L = _.getCenter(), A = _.getZoom();
|
|
2166
|
+
if (!(!L || A === void 0))
|
|
2167
|
+
return [A, ...Ue(L, b())];
|
|
1746
2168
|
}
|
|
1747
2169
|
};
|
|
1748
2170
|
}
|
|
1749
2171
|
export {
|
|
1750
|
-
|
|
2172
|
+
oi as createOpenLayersMapController
|
|
1751
2173
|
};
|
|
1752
2174
|
//# sourceMappingURL=openlayers-controller.js.map
|