@nika-js/onlymap 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
  let Xe = null, Lt = null;
2
- function Ps(t) {
2
+ function As(t) {
3
3
  Xe = t;
4
4
  }
5
5
  function Lr() {
6
- return wt !== null;
6
+ return St !== null;
7
7
  }
8
- let wt = null;
9
- function Ct() {
10
- return wt;
8
+ let St = null;
9
+ function Mt() {
10
+ return St;
11
11
  }
12
12
  function Gs() {
13
- return wt ? Promise.resolve(wt) : Lt || (Xe ? (Lt = Promise.resolve(Xe()).then((t) => (wt = t, wt)).catch((t) => {
13
+ return St ? Promise.resolve(St) : Lt || (Xe ? (Lt = Promise.resolve(Xe()).then((t) => (St = t, St)).catch((t) => {
14
14
  throw Lt = null, t;
15
15
  }), Lt) : Promise.reject(
16
16
  new Error(
@@ -22,29 +22,29 @@ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22
22
  __proto__: null,
23
23
  isCoreLoaded: Lr,
24
24
  loadCore: Gs,
25
- peekCore: Ct,
26
- setCoreLoader: Ps
25
+ peekCore: Mt,
26
+ setCoreLoader: As
27
27
  }, Symbol.toStringTag, { value: "Module" }));
28
- function Si(t) {
28
+ function Ei(t) {
29
29
  return { scale: t / 96, pxPerMm: t / 25.4 };
30
30
  }
31
31
  function Re(t) {
32
32
  return typeof t?.paintCartograph == "function";
33
33
  }
34
- const _t = (t, e) => {
34
+ const pt = (t, e) => {
35
35
  const i = t.getAttribute(e);
36
36
  if (i == null || i.trim() === "") return null;
37
37
  const s = Number(i);
38
38
  return Number.isFinite(s) ? s : null;
39
39
  };
40
- function L(t) {
40
+ function $(t) {
41
41
  return {
42
- x: _t(t, "x") ?? 0,
43
- y: _t(t, "y") ?? 0,
44
- w: _t(t, "w") ?? 0,
45
- h: _t(t, "h") ?? 0,
46
- rotation: _t(t, "rotation") ?? 0,
47
- z: _t(t, "z")
42
+ x: pt(t, "x") ?? 0,
43
+ y: pt(t, "y") ?? 0,
44
+ w: pt(t, "w") ?? 0,
45
+ h: pt(t, "h") ?? 0,
46
+ rotation: pt(t, "rotation") ?? 0,
47
+ z: pt(t, "z")
48
48
  };
49
49
  }
50
50
  function Qe(t, e = 0) {
@@ -57,7 +57,7 @@ function Y(t) {
57
57
  const e = t.trim().toLowerCase();
58
58
  return e === "transparent" || e === "rgba(0, 0, 0, 0)" || e === "none" ? null : t;
59
59
  }
60
- const bt = 96 / 25.4, Ei = {
60
+ const ot = 96 / 25.4, xi = {
61
61
  A0: { widthMm: 841, heightMm: 1189 },
62
62
  A1: { widthMm: 594, heightMm: 841 },
63
63
  A2: { widthMm: 420, heightMm: 594 },
@@ -66,25 +66,25 @@ const bt = 96 / 25.4, Ei = {
66
66
  A5: { widthMm: 148, heightMm: 210 },
67
67
  Letter: { widthMm: 215.9, heightMm: 279.4 },
68
68
  Legal: { widthMm: 215.9, heightMm: 355.6 }
69
- }, xi = "A4";
69
+ }, Pi = "A4";
70
70
  function _e(t, e, i, s) {
71
71
  const r = e != null ? Number(e) : NaN, a = i != null ? Number(i) : NaN;
72
72
  if (Number.isFinite(r) && r > 0 && Number.isFinite(a) && a > 0) return { widthMm: r, heightMm: a };
73
- const n = Ei[t ?? xi] ?? Ei[xi];
73
+ const n = xi[t ?? Pi] ?? xi[Pi];
74
74
  return s === "landscape" ? { widthMm: n.heightMm, heightMm: n.widthMm } : { ...n };
75
75
  }
76
- let se = null;
76
+ let re = null;
77
77
  function Fr(t) {
78
- if (!se) {
79
- se = new Uint32Array(256);
78
+ if (!re) {
79
+ re = new Uint32Array(256);
80
80
  for (let i = 0; i < 256; i++) {
81
81
  let s = i;
82
82
  for (let r = 0; r < 8; r++) s = s & 1 ? 3988292384 ^ s >>> 1 : s >>> 1;
83
- se[i] = s >>> 0;
83
+ re[i] = s >>> 0;
84
84
  }
85
85
  }
86
86
  let e = 4294967295;
87
- for (let i = 0; i < t.length; i++) e = se[(e ^ t[i]) & 255] ^ e >>> 8;
87
+ for (let i = 0; i < t.length; i++) e = re[(e ^ t[i]) & 255] ^ e >>> 8;
88
88
  return (e ^ 4294967295) >>> 0;
89
89
  }
90
90
  function qr(t) {
@@ -115,19 +115,19 @@ const Ie = ["protanopia", "deuteranopia", "tritanopia", "achromatopsia"], Ns = {
115
115
  tritan: "tritanopia",
116
116
  achroma: "achromatopsia"
117
117
  };
118
- function hi(t) {
118
+ function li(t) {
119
119
  const e = t?.trim().toLowerCase();
120
120
  return !e || e === "none" ? null : Ie.includes(e) ? e : Ns[e] ?? null;
121
121
  }
122
- const jr = ["none", ...Ie, ...Object.keys(Ns)], li = {
122
+ const jr = ["none", ...Ie, ...Object.keys(Ns)], ci = {
123
123
  protanopia: [0.11238, 0.88762, 0, 0.11238, 0.88762, 0, 401e-5, -401e-5, 1],
124
124
  deuteranopia: [0.29275, 0.70725, 0, 0.29275, 0.70725, 0, -0.02234, 0.02234, 1],
125
125
  tritanopia: [1, 0.14461, -0.14461, 0, 0.85659, 0.14341, 0, 0.85659, 0.14341],
126
126
  achromatopsia: [0.2126, 0.7152, 0.0722, 0.2126, 0.7152, 0.0722, 0.2126, 0.7152, 0.0722]
127
- }, gt = (t) => {
127
+ }, vt = (t) => {
128
128
  const e = t / 255;
129
129
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
130
- }, me = (t) => {
130
+ }, de = (t) => {
131
131
  const e = Math.min(1, Math.max(0, t));
132
132
  return 255 * (e <= 31308e-7 ? e * 12.92 : 1.055 * e ** (1 / 2.4) - 0.055);
133
133
  };
@@ -141,30 +141,30 @@ function Dr(t) {
141
141
  return s ? { r: Number(s[1]), g: Number(s[2]), b: Number(s[3]) } : null;
142
142
  }
143
143
  function Ai(t, e) {
144
- const i = li[e], [s, r, a] = [gt(t.r), gt(t.g), gt(t.b)];
144
+ const i = ci[e], [s, r, a] = [vt(t.r), vt(t.g), vt(t.b)];
145
145
  return {
146
- r: me(i[0] * s + i[1] * r + i[2] * a),
147
- g: me(i[3] * s + i[4] * r + i[5] * a),
148
- b: me(i[6] * s + i[7] * r + i[8] * a)
146
+ r: de(i[0] * s + i[1] * r + i[2] * a),
147
+ g: de(i[3] * s + i[4] * r + i[5] * a),
148
+ b: de(i[6] * s + i[7] * r + i[8] * a)
149
149
  };
150
150
  }
151
- function Pi({ r: t, g: e, b: i }) {
152
- const [s, r, a] = [gt(t), gt(e), gt(i)], n = (s * 0.4124564 + r * 0.3575761 + a * 0.1804375) / 0.95047, o = s * 0.2126729 + r * 0.7151522 + a * 0.072175, h = (s * 0.0193339 + r * 0.119192 + a * 0.9503041) / 1.08883, l = (m) => m > 216 / 24389 ? Math.cbrt(m) : 841 / 108 * m + 4 / 29, [f, u, c] = [l(n), l(o), l(h)];
151
+ function Gi({ r: t, g: e, b: i }) {
152
+ const [s, r, a] = [vt(t), vt(e), vt(i)], n = (s * 0.4124564 + r * 0.3575761 + a * 0.1804375) / 0.95047, o = s * 0.2126729 + r * 0.7151522 + a * 0.072175, h = (s * 0.0193339 + r * 0.119192 + a * 0.9503041) / 1.08883, l = (m) => m > 216 / 24389 ? Math.cbrt(m) : 841 / 108 * m + 4 / 29, [f, u, c] = [l(n), l(o), l(h)];
153
153
  return [116 * u - 16, 500 * (f - u), 200 * (u - c)];
154
154
  }
155
- function Gi(t, e) {
156
- const [i, s, r] = Pi(t), [a, n, o] = Pi(e), h = Math.PI / 180, l = 180 / Math.PI, f = (Math.hypot(s, r) + Math.hypot(n, o)) / 2, u = 0.5 * (1 - Math.sqrt(f ** 7 / (f ** 7 + 25 ** 7))), [c, m] = [s * (1 + u), n * (1 + u)], [d, g] = [Math.hypot(c, r), Math.hypot(m, o)], M = (nt, ie) => {
157
- if (nt === 0 && ie === 0) return 0;
158
- const $t = Math.atan2(ie, nt) * l;
155
+ function Ni(t, e) {
156
+ const [i, s, r] = Gi(t), [a, n, o] = Gi(e), h = Math.PI / 180, l = 180 / Math.PI, f = (Math.hypot(s, r) + Math.hypot(n, o)) / 2, u = 0.5 * (1 - Math.sqrt(f ** 7 / (f ** 7 + 25 ** 7))), [c, m] = [s * (1 + u), n * (1 + u)], [d, g] = [Math.hypot(c, r), Math.hypot(m, o)], M = (nt, se) => {
157
+ if (nt === 0 && se === 0) return 0;
158
+ const $t = Math.atan2(se, nt) * l;
159
159
  return $t >= 0 ? $t : $t + 360;
160
160
  }, [v, _] = [M(c, r), M(m, o)], b = a - i, E = g - d;
161
161
  let S = 0;
162
162
  d * g !== 0 && (S = _ - v, S > 180 ? S -= 360 : S < -180 && (S += 360));
163
- const A = 2 * Math.sqrt(d * g) * Math.sin(S * h / 2), P = (i + a) / 2, G = (d + g) / 2;
163
+ const P = 2 * Math.sqrt(d * g) * Math.sin(S * h / 2), A = (i + a) / 2, G = (d + g) / 2;
164
164
  let N = v + _;
165
165
  d * g !== 0 && (Math.abs(v - _) > 180 && (N += v + _ < 360 ? 360 : -360), N /= 2);
166
- const F = 1 - 0.17 * Math.cos((N - 30) * h) + 0.24 * Math.cos(2 * N * h) + 0.32 * Math.cos((3 * N + 6) * h) - 0.2 * Math.cos((4 * N - 63) * h), x = 1 + 0.015 * (P - 50) ** 2 / Math.sqrt(20 + (P - 50) ** 2), C = 1 + 0.045 * G, R = 1 + 0.015 * G * F, U = -2 * Math.sqrt(G ** 7 / (G ** 7 + 25 ** 7)) * Math.sin(60 * Math.exp(-(((N - 275) / 25) ** 2)) * h);
167
- return Math.sqrt((b / x) ** 2 + (E / C) ** 2 + (A / R) ** 2 + U * (E / C) * (A / R));
166
+ const F = 1 - 0.17 * Math.cos((N - 30) * h) + 0.24 * Math.cos(2 * N * h) + 0.32 * Math.cos((3 * N + 6) * h) - 0.2 * Math.cos((4 * N - 63) * h), x = 1 + 0.015 * (A - 50) ** 2 / Math.sqrt(20 + (A - 50) ** 2), C = 1 + 0.045 * G, R = 1 + 0.015 * G * F, U = -2 * Math.sqrt(G ** 7 / (G ** 7 + 25 ** 7)) * Math.sin(60 * Math.exp(-(((N - 275) / 25) ** 2)) * h);
167
+ return Math.sqrt((b / x) ** 2 + (E / C) ** 2 + (P / R) ** 2 + U * (E / C) * (P / R));
168
168
  }
169
169
  const zr = 10;
170
170
  function Br(t, e = zr) {
@@ -180,8 +180,8 @@ function Br(t, e = zr) {
180
180
  for (const h of i.values())
181
181
  for (let l = 0; l < h.length; l++)
182
182
  for (let f = l + 1; f < h.length; f++) {
183
- if (Gi(h[l].rgb, h[f].rgb) < e) continue;
184
- const c = Gi(Ai(h[l].rgb, o), Ai(h[f].rgb, o));
183
+ if (Ni(h[l].rgb, h[f].rgb) < e) continue;
184
+ const c = Ni(Ai(h[l].rgb, o), Ai(h[f].rgb, o));
185
185
  c < e && (s.push({ type: o, a: h[l].entry, b: h[f].entry, distance: c }), r.set(o, (r.get(o) ?? 0) + 1));
186
186
  }
187
187
  let a = null, n = 0;
@@ -198,13 +198,13 @@ function Wr(t, e, i, s) {
198
198
  return !1;
199
199
  }
200
200
  const a = new Float64Array(256);
201
- for (let u = 0; u < 256; u++) a[u] = gt(u);
201
+ for (let u = 0; u < 256; u++) a[u] = vt(u);
202
202
  const n = 1024, o = new Float64Array(n + 1);
203
- for (let u = 0; u <= n; u++) o[u] = me(u / n);
203
+ for (let u = 0; u <= n; u++) o[u] = de(u / n);
204
204
  const h = (u) => {
205
205
  const c = Math.min(1, Math.max(0, u)) * n, m = Math.floor(c);
206
206
  return m >= n ? o[n] : o[m] + (o[m + 1] - o[m]) * (c - m);
207
- }, l = li[s], f = r.data;
207
+ }, l = ci[s], f = r.data;
208
208
  for (let u = 0; u < f.length; u += 4) {
209
209
  const c = a[f[u]], m = a[f[u + 1]], d = a[f[u + 2]];
210
210
  f[u] = h(l[0] * c + l[1] * m + l[2] * d), f[u + 1] = h(l[3] * c + l[4] * m + l[5] * d), f[u + 2] = h(l[6] * c + l[7] * m + l[8] * d);
@@ -221,7 +221,7 @@ function Hr(t) {
221
221
  s.id = Cs(i), s.setAttribute("color-interpolation-filters", "linearRGB");
222
222
  const r = t.createElementNS("http://www.w3.org/2000/svg", "feColorMatrix");
223
223
  r.setAttribute("type", "matrix");
224
- const a = li[i];
224
+ const a = ci[i];
225
225
  r.setAttribute("values", [a[0], a[1], a[2], 0, 0, a[3], a[4], a[5], 0, 0, a[6], a[7], a[8], 0, 0, 0, 0, 0, 1, 0].join(" ")), s.appendChild(r), e.appendChild(s);
226
226
  }
227
227
  t.body.appendChild(e);
@@ -243,9 +243,9 @@ async function Vr(t) {
243
243
  function Kr(t) {
244
244
  return [...t.children].filter(
245
245
  (e) => !e.hasAttribute("hidden") && !e.hasAttribute("data-om-carto-marks") && !e.hasAttribute("data-om-carto-flattened") && e.tagName.toLowerCase() !== "style" && e.tagName.toLowerCase() !== "script"
246
- ).map((e, i) => ({ el: e, index: i, z: L(e).z ?? 0 })).sort((e, i) => e.z - i.z || e.index - i.index).map((e) => e.el);
246
+ ).map((e, i) => ({ el: e, index: i, z: $(e).z ?? 0 })).sort((e, i) => e.z - i.z || e.index - i.index).map((e) => e.el);
247
247
  }
248
- async function ci(t, e = {}) {
248
+ async function ui(t, e = {}) {
249
249
  const i = t ?? document.querySelector("om-cartograph");
250
250
  if (!i) throw new Error("[onlymapjs/cartograph] renderCartograph: no <om-cartograph> to render.");
251
251
  const s = [], r = e.dpi ?? (Number(i.getAttribute("dpi")) || 300);
@@ -259,11 +259,11 @@ async function ci(t, e = {}) {
259
259
  let c = r;
260
260
  const m = Math.min(f / (h / 25.4), f / (l / 25.4)), d = Math.sqrt(u / (h / 25.4 * (l / 25.4))), g = Math.min(m, d);
261
261
  c > g && (c = Math.floor(g), s.push(`Requested ${r} dpi exceeds this browser's canvas budget for a ${h.toFixed(0)}×${l.toFixed(0)}mm page; rendered at ${c} dpi instead.`)), s.push(...await Vr(i)), typeof document < "u" && document.fonts?.ready && await document.fonts.ready;
262
- const M = Si(c), v = Math.max(1, Math.round(h * M.pxPerMm)), _ = Math.max(1, Math.round(l * M.pxPerMm)), b = Kr(i);
262
+ const M = Ei(c), v = Math.max(1, Math.round(h * M.pxPerMm)), _ = Math.max(1, Math.round(l * M.pxPerMm)), b = Kr(i);
263
263
  for (const x of b)
264
264
  if (!(!Re(x) || !x.prepareCartograph))
265
265
  try {
266
- await x.prepareCartograph(Si(c));
266
+ await x.prepareCartograph(Ei(c));
267
267
  } catch (C) {
268
268
  x.discardCartograph?.(), s.push(`${x.tagName.toLowerCase()}${x.id ? `#${x.id}` : ""} could not be captured: ${C.message}`);
269
269
  }
@@ -271,11 +271,11 @@ async function ci(t, e = {}) {
271
271
  E.width = v, E.height = _;
272
272
  const S = E.getContext("2d");
273
273
  if (!S) throw new Error("[onlymapjs/cartograph] renderCartograph: could not get a 2D canvas context.");
274
- const A = typeof getComputedStyle == "function" ? getComputedStyle(i) : null;
275
- S.fillStyle = Y(A?.backgroundColor) ?? "#ffffff", S.fillRect(0, 0, v, _);
274
+ const P = typeof getComputedStyle == "function" ? getComputedStyle(i) : null;
275
+ S.fillStyle = Y(P?.backgroundColor) ?? "#ffffff", S.fillRect(0, 0, v, _);
276
276
  for (const x of b) {
277
277
  if (!Re(x)) continue;
278
- const C = L(x);
278
+ const C = $(x);
279
279
  if (S.save(), S.translate((C.x + o) * M.pxPerMm, (C.y + o) * M.pxPerMm), C.rotation) {
280
280
  const R = C.w / 2 * M.pxPerMm, U = C.h / 2 * M.pxPerMm;
281
281
  S.translate(R, U), S.rotate(C.rotation * Math.PI / 180), S.translate(-R, -U);
@@ -287,12 +287,12 @@ async function ci(t, e = {}) {
287
287
  }
288
288
  S.restore();
289
289
  }
290
- const P = i.querySelector(":scope > [data-om-carto-marks]");
291
- for (const x of P?.querySelectorAll("line") ?? []) {
290
+ const A = i.querySelector(":scope > [data-om-carto-marks]");
291
+ for (const x of A?.querySelectorAll("line") ?? []) {
292
292
  const C = Number(x.getAttribute("x1")), R = Number(x.getAttribute("y1")), U = Number(x.getAttribute("x2")), nt = Number(x.getAttribute("y2"));
293
293
  [C, R, U, nt].every(Number.isFinite) && (S.save(), S.strokeStyle = x.getAttribute("stroke") || "#000000", S.lineWidth = (Number(x.getAttribute("stroke-width")) || 0.2) * M.pxPerMm, S.beginPath(), S.moveTo((C + o) * M.pxPerMm, (R + o) * M.pxPerMm), S.lineTo((U + o) * M.pxPerMm, (nt + o) * M.pxPerMm), S.stroke(), S.restore());
294
294
  }
295
- const G = hi(e.cvd === "page" ? i.getAttribute("cvd") : e.cvd);
295
+ const G = li(e.cvd === "page" ? i.getAttribute("cvd") : e.cvd);
296
296
  G && !Wr(S, v, _, G) && s.push("Colour-vision simulation was skipped: a cross-origin image on the page makes the export canvas unreadable.");
297
297
  for (const x of b) Re(x) && x.discardCartograph?.();
298
298
  const N = e.format === "jpeg" ? "image/jpeg" : "image/png";
@@ -317,14 +317,14 @@ async function Rs(t, e = {}) {
317
317
  if (!Number.isInteger(u) || u < 0 || u >= r)
318
318
  throw new Error(`[onlymapjs/cartograph] renderCartographAtlas: page ${e.page} is out of range (this atlas has ${r}).`);
319
319
  s.seek(u);
320
- const c = await Ni(i, e, o);
320
+ const c = await Ci(i, e, o);
321
321
  return { blob: c.blob, filenames: [n[u]], pages: 1, dpi: c.dpi, warnings: o };
322
322
  }
323
323
  const l = [];
324
324
  let f = e.dpi ?? 300;
325
325
  for (let u = 0; u < r; u++) {
326
326
  s.seek(u);
327
- const c = await Ni(i, e, o);
327
+ const c = await Ci(i, e, o);
328
328
  f = c.dpi, l.push({ name: n[u], data: c.blob }), e.onPage?.(u + 1, r);
329
329
  }
330
330
  return { blob: await Ur(l), filenames: n, pages: r, dpi: f, warnings: o };
@@ -332,27 +332,27 @@ async function Rs(t, e = {}) {
332
332
  s.seek(h);
333
333
  }
334
334
  }
335
- async function Ni(t, e, i) {
335
+ async function Ci(t, e, i) {
336
336
  for (const r of t.querySelectorAll("om-frame"))
337
337
  await r.mapElement?.whenSettled?.({ timeout: 2e4 });
338
- const s = await ci(t, e);
338
+ const s = await ui(t, e);
339
339
  return i.push(...s.warnings), s;
340
340
  }
341
341
  const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
342
342
  __proto__: null,
343
343
  MAX_CANVAS_AREA: Ts,
344
344
  MAX_CANVAS_DIMENSION: Is,
345
- renderCartograph: ci,
345
+ renderCartograph: ui,
346
346
  renderCartographAtlas: Rs
347
347
  }, Symbol.toStringTag, { value: "Module" }));
348
- function Ci(t, e, i = {}) {
348
+ function Ii(t, e, i = {}) {
349
349
  const s = URL.createObjectURL(t), r = document.createElement("a");
350
350
  r.href = s, r.download = e, document.body.appendChild(r), r.click(), r.remove();
351
351
  const a = i.revokeAfterMs ?? 0;
352
352
  a > 0 ? setTimeout(() => URL.revokeObjectURL(s), a) : URL.revokeObjectURL(s);
353
353
  }
354
354
  const Qr = 3e4;
355
- async function Ii(t, e = Qr) {
355
+ async function Ti(t, e = Qr) {
356
356
  let i = !1;
357
357
  const s = new Promise(
358
358
  (a) => setTimeout(() => {
@@ -380,7 +380,7 @@ async function Jr(t, e = {}) {
380
380
  r && t.setAttribute("cvd", r);
381
381
  const a = s.get("export");
382
382
  if (a) {
383
- await Ii(t, e.timeoutMs);
383
+ await Ti(t, e.timeoutMs);
384
384
  const n = a === "jpeg" ? "jpeg" : "png", o = Number(s.get("dpi")) || void 0, h = t.getAttribute("cartograph-id") || "cartograph", l = s.get("page");
385
385
  if (l != null) {
386
386
  const u = t.querySelector("om-atlas");
@@ -390,13 +390,13 @@ async function Jr(t, e = {}) {
390
390
  u.refresh?.();
391
391
  const m = await Rs(t, { dpi: o, format: n, page: c - 1 });
392
392
  for (const d of m.warnings) console.warn(`[onlymapjs/cartograph] ${d}`);
393
- return Ci(m.blob, m.filenames[0] ?? `${h}.${n === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
393
+ return Ii(m.blob, m.filenames[0] ?? `${h}.${n === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
394
394
  }
395
- const f = await ci(t, { dpi: o, format: n });
395
+ const f = await ui(t, { dpi: o, format: n });
396
396
  for (const u of f.warnings) console.warn(`[onlymapjs/cartograph] ${u}`);
397
- return Ci(f.blob, `${h}.${n === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
397
+ return Ii(f.blob, `${h}.${n === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
398
398
  }
399
- return s.get("print") === "1" ? (await Ii(t, e.timeoutMs), typeof t.print == "function" ? await t.print({ dpi: Number(s.get("dpi")) || void 0 }) : typeof window < "u" && window.print(), "print") : r ? "cvd" : null;
399
+ return s.get("print") === "1" ? (await Ti(t, e.timeoutMs), typeof t.print == "function" ? await t.print({ dpi: Number(s.get("dpi")) || void 0 }) : typeof window < "u" && window.print(), "print") : r ? "cvd" : null;
400
400
  }
401
401
  function Yr() {
402
402
  if (typeof document > "u") return;
@@ -450,23 +450,23 @@ class st extends Zr {
450
450
  o != null && Number.isInteger(o) ? this.style.zIndex = String(o) : this.style.removeProperty("z-index");
451
451
  }
452
452
  }
453
- const ke = "cartograph/2", Fc = ["default", "dark", "sepia", "blueprint", "minimal"], Ti = ["A0", "A1", "A2", "A3", "A4", "A5", "Letter", "Legal"], ea = /* @__PURE__ */ new Map([
453
+ const ke = "cartograph/2", qc = ["default", "dark", "sepia", "blueprint", "minimal"], Ri = ["A0", "A1", "A2", "A3", "A4", "A5", "Letter", "Legal"], ea = /* @__PURE__ */ new Map([
454
454
  ["projection", "live frames render Web Mercator (EPSG:3857) only — Globe support is design-only; use a static frame for other projections"]
455
- ]), ot = ["id", "x", "y", "w", "h", "rotation", "z", "locked", "hidden"], J = {
455
+ ]), ht = ["id", "x", "y", "w", "h", "rotation", "z", "locked", "hidden"], J = {
456
456
  "om-cartograph": ["cartograph-id", "format", "size", "width", "height", "orientation", "theme", "title", "attribution", "notes", "cvd", "bleed", "crop-marks", "safe-zone", "dpi", "flatten", "color-profile", "allow-url-actions"],
457
- "om-frame": [...ot, "src", "mode", "center", "zoom", "bearing", "pitch", "dpi", "crs", "corners", "crs-def", "overview-of", "overview-stroke", "atlas-fit", "atlas-margin", "frame-stroke", "frame-bg"],
458
- "om-legend": [...ot, "for", "title", "columns", "derived"],
457
+ "om-frame": [...ht, "src", "mode", "center", "zoom", "bearing", "pitch", "dpi", "crs", "corners", "crs-def", "overview-of", "overview-stroke", "atlas-fit", "atlas-margin", "frame-stroke", "frame-bg"],
458
+ "om-legend": [...ht, "for", "title", "columns", "derived"],
459
459
  "om-legend-row": ["layer", "match", "label", "hide", "order", "color", "shape"],
460
460
  // NOTE: the discriminator on furniture is `kind`, never `style` — `style` is
461
461
  // the global HTML attribute the runtime itself writes for mm placement, so
462
462
  // `style="double"` would be erased on the first render. `kind` also matches
463
463
  // om-text/om-shape, so the whole vocabulary has ONE discriminator word.
464
- "om-scalebar": [...ot, "for", "units", "segments", "segment-length", "kind"],
465
- "om-north": [...ot, "for", "kind"],
466
- "om-graticule": [...ot, "for", "crs", "crs-def", "interval", "interval-x", "interval-y", "kind", "labels", "format"],
467
- "om-text": [...ot, "kind", "font-size", "weight", "align", "font", "color", "bg"],
468
- "om-shape": [...ot, "kind", "fill", "fill-opacity", "stroke", "stroke-width", "radius"],
469
- "om-image": [...ot, "src", "fit"],
464
+ "om-scalebar": [...ht, "for", "units", "segments", "segment-length", "kind"],
465
+ "om-north": [...ht, "for", "kind"],
466
+ "om-graticule": [...ht, "for", "crs", "crs-def", "interval", "interval-x", "interval-y", "kind", "labels", "format"],
467
+ "om-text": [...ht, "kind", "font-size", "weight", "align", "font", "color", "bg"],
468
+ "om-shape": [...ht, "kind", "fill", "fill-opacity", "stroke", "stroke-width", "radius"],
469
+ "om-image": [...ht, "src", "fit"],
470
470
  "om-atlas": ["id", "for", "layer", "filter", "sort", "filename", "page-name"]
471
471
  }, $e = Object.keys(J), ia = ["metric", "imperial", "nautical"], sa = 0.3048, ra = 1609.344, aa = 1852;
472
472
  function na(t) {
@@ -477,7 +477,7 @@ function $s(t) {
477
477
  const e = Math.pow(10, Math.floor(Math.log10(t))), i = t / e;
478
478
  return (i >= 5 ? 5 : i >= 2 ? 2 : 1) * e;
479
479
  }
480
- const Ri = {
480
+ const ki = {
481
481
  // Finest first; the largest tier whose snapped length is ≥ 1 unit wins.
482
482
  metric: [
483
483
  { metersPerUnit: 1, label: "m" },
@@ -491,12 +491,12 @@ const Ri = {
491
491
  };
492
492
  function Ls({ groundMetersPerMm: t, maxWidthMm: e, segments: i = 4, units: s = "metric", segmentLengthMeters: r }) {
493
493
  if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(e) || e <= 0) return null;
494
- const a = Number.isInteger(i) && i > 0 ? i : 4, n = Ri[s] ?? Ri.metric, o = e / a * t;
494
+ const a = Number.isInteger(i) && i > 0 ? i : 4, n = ki[s] ?? ki.metric, o = e / a * t;
495
495
  let h, l;
496
496
  if (r != null && Number.isFinite(r) && r > 0)
497
- h = r, l = ki(n, h);
497
+ h = r, l = $i(n, h);
498
498
  else {
499
- l = ki(n, o);
499
+ l = $i(n, o);
500
500
  const d = $s(o / l.metersPerUnit);
501
501
  if (d <= 0) return null;
502
502
  h = d * l.metersPerUnit;
@@ -558,7 +558,7 @@ function oa(t, e, i) {
558
558
  }
559
559
  return { bars: l, strokes: f, labels: d, fontMm: s, strokeMm: r, segmentMeters: t.segmentMeters, unitLabel: t.unitLabel, scaleDenominator: t.scaleDenominator };
560
560
  }
561
- function ki(t, e) {
561
+ function $i(t, e) {
562
562
  let i = t[0];
563
563
  for (const s of t)
564
564
  e / s.metersPerUnit >= 1 && (i = s);
@@ -591,7 +591,7 @@ function Fs(t, e) {
591
591
  function ua(t) {
592
592
  return [...t.matchAll(Os)].map((e) => e[1]);
593
593
  }
594
- const $i = /* @__PURE__ */ new WeakMap();
594
+ const Li = /* @__PURE__ */ new WeakMap();
595
595
  function fa(t, e) {
596
596
  const i = [], s = t.ownerDocument ?? (typeof document < "u" ? document : null);
597
597
  if (!s) return i;
@@ -602,10 +602,10 @@ function fa(t, e) {
602
602
  ), a = [];
603
603
  for (let n = r.nextNode(); n; n = r.nextNode()) a.push(n);
604
604
  for (const n of a) {
605
- let o = $i.get(n);
605
+ let o = Li.get(n);
606
606
  if (o === void 0) {
607
607
  if (o = n.data, !o.includes("{{")) continue;
608
- $i.set(n, o);
608
+ Li.set(n, o);
609
609
  }
610
610
  const h = Fs(o, e);
611
611
  n.data !== h.text && (n.data = h.text), i.push(...h.unresolved);
@@ -639,7 +639,7 @@ function rt(t) {
639
639
  const e = t.getAttribute("for");
640
640
  return e ? Us(t, e) : da(t);
641
641
  }
642
- function Mt(t, e) {
642
+ function yt(t, e) {
643
643
  let i = t.querySelector(`:scope > [${Je}]`);
644
644
  if (!i) {
645
645
  for (const s of [...t.children])
@@ -651,7 +651,7 @@ function Mt(t, e) {
651
651
  function ga(t) {
652
652
  t.querySelector(`:scope > [${Je}]`)?.remove();
653
653
  }
654
- const Li = "data-om-carto-page", Oi = "data-om-carto-marks", Le = "data-om-carto-credit", Oe = "Built with OnlyMap by NIKA · free for non-commercial use", re = 2, Fi = 1.2, Fe = 2.4, qi = 1.5, qe = 1.2, Ui = 0.3, ji = 0.8, Ue = "http://www.w3.org/2000/svg", Ma = 6e4;
654
+ const Oi = "data-om-carto-page", Fi = "data-om-carto-marks", Le = "data-om-carto-credit", Oe = "Built with OnlyMap by NIKA · free for non-commercial use", ae = 2, qi = 1.2, Fe = 2.4, Ui = 1.5, qe = 1.2, ji = 0.3, Di = 0.8, Ue = "http://www.w3.org/2000/svg", Ma = 6e4;
655
655
  class Ds extends st {
656
656
  static observedAttributes = [...J["om-cartograph"]];
657
657
  frameListenerBound = !1;
@@ -689,7 +689,7 @@ class Ds extends st {
689
689
  * runtime's job (issue #41 §9: the om-map carries the key).
690
690
  */
691
691
  renderCredit() {
692
- const e = Ct();
692
+ const e = Mt();
693
693
  e && !this.unsubscribeLicense && typeof e.subscribeLicense == "function" && (this.unsubscribeLicense = e.subscribeLicense(() => this.renderCredit()));
694
694
  const i = e ? e.getEntitlements().hideBadge : !1, s = [...this.querySelectorAll("om-text")].some((n) => /onlymap/i.test(n.textContent ?? "")), r = this.querySelector(`:scope > [${Le}]`);
695
695
  if (i || s) {
@@ -701,15 +701,15 @@ class Ds extends st {
701
701
  return;
702
702
  }
703
703
  const a = this.ownerDocument.createElement("div");
704
- a.setAttribute(Le, ""), a.setAttribute("z", "2147483644"), a.textContent = Oe, a.style.cssText = `position:absolute;left:${re}mm;bottom:${Fi}mm;z-index:2147483644;font:${Fe}mm/${qi} system-ui,sans-serif;color:#374151;background:rgba(255,255,255,.72);padding:${Ui}mm ${qe}mm;border-radius:${ji}mm;pointer-events:none;`, this.armCreditPainter(a), this.appendChild(a);
704
+ a.setAttribute(Le, ""), a.setAttribute("z", "2147483644"), a.textContent = Oe, a.style.cssText = `position:absolute;left:${ae}mm;bottom:${qi}mm;z-index:2147483644;font:${Fe}mm/${Ui} system-ui,sans-serif;color:#374151;background:rgba(255,255,255,.72);padding:${ji}mm ${qe}mm;border-radius:${Di}mm;pointer-events:none;`, this.armCreditPainter(a), this.appendChild(a);
705
705
  }
706
706
  /** Give the runtime-owned DOM credit the same canvas paint contract as authored furniture. */
707
707
  armCreditPainter(e) {
708
708
  e.paintCartograph = (i, s) => {
709
- const r = (l) => l * s.pxPerMm, n = Fe * qi + Ui * 2, o = this.pageSize.heightMm - Fi - n;
709
+ const r = (l) => l * s.pxPerMm, n = Fe * Ui + ji * 2, o = this.pageSize.heightMm - qi - n;
710
710
  i.save(), i.font = `${r(Fe)}px system-ui, sans-serif`;
711
711
  const h = i.measureText(Oe).width / s.pxPerMm + qe * 2;
712
- i.fillStyle = "rgba(255,255,255,.72)", i.beginPath(), typeof i.roundRect == "function" ? i.roundRect(r(re), r(o), r(h), r(n), r(ji)) : i.rect(r(re), r(o), r(h), r(n)), i.fill(), i.fillStyle = "#374151", i.textAlign = "left", i.textBaseline = "middle", i.fillText(Oe, r(re + qe), r(o + n / 2)), i.restore();
712
+ i.fillStyle = "rgba(255,255,255,.72)", i.beginPath(), typeof i.roundRect == "function" ? i.roundRect(r(ae), r(o), r(h), r(n), r(Di)) : i.rect(r(ae), r(o), r(h), r(n)), i.fill(), i.fillStyle = "#374151", i.textAlign = "left", i.textBaseline = "middle", i.fillText(Oe, r(ae + qe), r(o + n / 2)), i.restore();
713
713
  };
714
714
  }
715
715
  /**
@@ -795,8 +795,8 @@ class Ds extends st {
795
795
  renderNow() {
796
796
  const { widthMm: e, heightMm: i } = this.pageSize, s = this.bleedMm;
797
797
  this.style.display = "block", this.style.position = "relative", this.style.width = `${e}mm`, this.style.height = `${i}mm`, this.style.margin = s > 0 ? `${s}mm` : "", this.style.overflow = s > 0 ? "visible" : "hidden";
798
- let r = this.querySelector(`style[${Li}]`);
799
- r || (r = document.createElement("style"), r.setAttribute(Li, ""), this.prepend(r));
798
+ let r = this.querySelector(`style[${Oi}]`);
799
+ r || (r = document.createElement("style"), r.setAttribute(Oi, ""), this.prepend(r));
800
800
  const a = e + s * 2, n = i + s * 2;
801
801
  r.textContent = `@page { size: ${a}mm ${n}mm; margin: 0; }
802
802
  @media print { html, body { margin: 0; padding: 0; } om-cartograph { break-after: page; } }`, this.renderPrintMarks(e, i, s), this.applyCvd(), this.refreshTokens(), this.renderCredit();
@@ -811,13 +811,13 @@ class Ds extends st {
811
811
  * worse than no guide.
812
812
  */
813
813
  renderPrintMarks(e, i, s) {
814
- const r = this.hasAttribute("crop-marks") && s > 0, a = Number(this.getAttribute("safe-zone")), n = Number.isFinite(a) && a > 0, o = this.querySelector(`:scope > [${Oi}]`);
814
+ const r = this.hasAttribute("crop-marks") && s > 0, a = Number(this.getAttribute("safe-zone")), n = Number.isFinite(a) && a > 0, o = this.querySelector(`:scope > [${Fi}]`);
815
815
  if (!r && !n) {
816
816
  o?.remove();
817
817
  return;
818
818
  }
819
819
  const h = this.ownerDocument, l = o ?? h.createElementNS(Ue, "svg");
820
- if (l.setAttribute(Oi, ""), l.setAttribute("viewBox", `${-s} ${-s} ${e + s * 2} ${i + s * 2}`), l.setAttribute("width", `${e + s * 2}mm`), l.setAttribute("height", `${i + s * 2}mm`), l.style.cssText = `position:absolute;left:${-s}mm;top:${-s}mm;pointer-events:none;z-index:2147483646;`, l.replaceChildren(), r) {
820
+ if (l.setAttribute(Fi, ""), l.setAttribute("viewBox", `${-s} ${-s} ${e + s * 2} ${i + s * 2}`), l.setAttribute("width", `${e + s * 2}mm`), l.setAttribute("height", `${i + s * 2}mm`), l.style.cssText = `position:absolute;left:${-s}mm;top:${-s}mm;pointer-events:none;z-index:2147483646;`, l.replaceChildren(), r) {
821
821
  const f = Math.min(s, 4), u = Math.min(s * 0.35, 1.5), c = [];
822
822
  for (const m of [0, e])
823
823
  for (const d of [0, i]) {
@@ -844,7 +844,7 @@ class Ds extends st {
844
844
  * injected only when a page actually asks for one.
845
845
  */
846
846
  applyCvd() {
847
- const e = hi(this.getAttribute("cvd"));
847
+ const e = li(this.getAttribute("cvd"));
848
848
  if (!e) {
849
849
  this.style.removeProperty("filter");
850
850
  return;
@@ -883,7 +883,7 @@ function va({ text: t, maxWidth: e, fontSizePx: i, lineHeightPx: s, measure: r }
883
883
  l.baselineY = o + f * a, l.width > h && (h = l.width);
884
884
  }), { lines: n, lineHeight: a, maxWidth: h };
885
885
  }
886
- function qc(t) {
886
+ function Uc(t) {
887
887
  if (typeof document > "u") return null;
888
888
  const i = document.createElement("canvas").getContext("2d");
889
889
  return i ? (i.font = t, (s) => i.measureText(s).width) : null;
@@ -914,7 +914,7 @@ class zs extends st {
914
914
  e && typeof e.tokenContext == "function" && fa(this, e.tokenContext());
915
915
  }
916
916
  paintCartograph(e, i) {
917
- const { w: s, h: r } = L(this), a = s * i.pxPerMm, n = r * i.pxPerMm;
917
+ const { w: s, h: r } = $(this), a = s * i.pxPerMm, n = r * i.pxPerMm;
918
918
  if (a <= 0 || n <= 0) return;
919
919
  const o = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, h = Y(o?.backgroundColor);
920
920
  h && (e.fillStyle = h, e.fillRect(0, 0, a, n));
@@ -939,15 +939,15 @@ class zs extends st {
939
939
  q("om-text", zs);
940
940
  const _a = 63710087714e-4;
941
941
  let ba = _a;
942
- const ae = Math.PI / 180;
942
+ const ne = Math.PI / 180;
943
943
  function Bs(t, e, i = ba) {
944
- const s = (e[1] - t[1]) * ae, r = (e[0] - t[0]) * ae, a = t[1] * ae, n = e[1] * ae, o = Math.sin(s / 2) ** 2 + Math.cos(a) * Math.cos(n) * Math.sin(r / 2) ** 2;
944
+ const s = (e[1] - t[1]) * ne, r = (e[0] - t[0]) * ne, a = t[1] * ne, n = e[1] * ne, o = Math.sin(s / 2) ** 2 + Math.cos(a) * Math.cos(n) * Math.sin(r / 2) ** 2;
945
945
  return 2 * i * Math.asin(Math.min(1, Math.sqrt(o)));
946
946
  }
947
- const be = 6378137, Di = Math.PI / 180, Ye = 180 / Math.PI, zi = 85.0511287798066;
947
+ const be = 6378137, zi = Math.PI / 180, Ye = 180 / Math.PI, Bi = 85.0511287798066;
948
948
  function pa([t, e]) {
949
- const i = Math.max(-zi, Math.min(zi, e));
950
- return [be * t * Di, be * Math.log(Math.tan(Math.PI / 4 + i * Di / 2))];
949
+ const i = Math.max(-Bi, Math.min(Bi, e));
950
+ return [be * t * zi, be * Math.log(Math.tan(Math.PI / 4 + i * zi / 2))];
951
951
  }
952
952
  function wa([t, e]) {
953
953
  return [t / be * Ye, (2 * Math.atan(Math.exp(e / be)) - Math.PI / 2) * Ye];
@@ -969,22 +969,22 @@ async function Hs(t, e) {
969
969
  if (i && !e) return i;
970
970
  const s = It(t) ?? "EPSG:3857", r = e?.trim() || await Ea(s);
971
971
  if (!r) return null;
972
- const a = (await Promise.resolve().then(() => Lc)).default, o = a(r, "+proj=longlat +datum=WGS84 +no_defs");
972
+ const a = (await Promise.resolve().then(() => Oc)).default, o = a(r, "+proj=longlat +datum=WGS84 +no_defs");
973
973
  return {
974
974
  code: s,
975
975
  forward: (h) => o.inverse(h),
976
976
  inverse: (h) => o.forward(h)
977
977
  };
978
978
  }
979
- function Bi(t, e) {
979
+ function Wi(t, e) {
980
980
  return !Number.isInteger(t) || t < 1 || t > 60 ? null : `+proj=utm +zone=${t}${e === "S" ? " +south" : ""} +datum=WGS84 +units=m +no_defs`;
981
981
  }
982
982
  async function Ea(t) {
983
983
  const e = Number(/^EPSG:(\d+)$/.exec(t)?.[1]);
984
984
  if (!Number.isFinite(e)) return null;
985
- if (e >= 32601 && e <= 32660) return Bi(e - 32600, "N");
986
- if (e >= 32701 && e <= 32760) return Bi(e - 32700, "S");
987
- const { CRS_DEFS: i } = await Promise.resolve().then(() => Oc);
985
+ if (e >= 32601 && e <= 32660) return Wi(e - 32600, "N");
986
+ if (e >= 32701 && e <= 32760) return Wi(e - 32700, "S");
987
+ const { CRS_DEFS: i } = await Promise.resolve().then(() => Fc);
988
988
  return i[e]?.def ?? null;
989
989
  }
990
990
  function xa(t, e) {
@@ -1003,7 +1003,7 @@ function xa(t, e) {
1003
1003
  }
1004
1004
  return s.map((r, a) => r[i] / r[a]);
1005
1005
  }
1006
- function Aa(t, e) {
1006
+ function Pa(t, e) {
1007
1007
  if (t.length !== 4 || e.length !== 4) return null;
1008
1008
  const i = t.reduce((u, c) => u + c[0], 0) / 4, s = t.reduce((u, c) => u + c[1], 0) / 4, r = t.reduce((u, c) => u + Math.hypot(c[0] - i, c[1] - s), 0) / 4, a = r > 1e-12 ? Math.SQRT2 / r : 1, n = (u) => [(u[0] - i) * a, (u[1] - s) * a], o = [], h = [];
1009
1009
  for (let u = 0; u < 4; u++) {
@@ -1015,11 +1015,11 @@ function Aa(t, e) {
1015
1015
  const f = (u) => [u[0] / a + i, u[1] / a + s];
1016
1016
  return { matrix: [l[0], l[1], l[2], l[3], l[4], l[5], l[6], l[7], 1], normalize: n, denormalize: f };
1017
1017
  }
1018
- function Wi(t, [e, i]) {
1018
+ function Hi(t, [e, i]) {
1019
1019
  const s = t[6] * e + t[7] * i + t[8];
1020
1020
  return Math.abs(s) < 1e-12 ? null : [(t[0] * e + t[1] * i + t[2]) / s, (t[3] * e + t[4] * i + t[5]) / s];
1021
1021
  }
1022
- function Pa(t) {
1022
+ function Aa(t) {
1023
1023
  const [e, i, s, r, a, n, o, h, l] = t, f = e * (a * l - n * h) - i * (r * l - n * o) + s * (r * h - a * o);
1024
1024
  return !Number.isFinite(f) || Math.abs(f) < 1e-15 ? null : [
1025
1025
  (a * l - n * h) / f,
@@ -1033,7 +1033,7 @@ function Pa(t) {
1033
1033
  (e * a - i * r) / f
1034
1034
  ];
1035
1035
  }
1036
- function Hi(t, e) {
1036
+ function Vi(t, e) {
1037
1037
  let i = t;
1038
1038
  for (; i - e > 180; ) i -= 360;
1039
1039
  for (; e - i > 180; ) i += 360;
@@ -1044,12 +1044,12 @@ const Ga = (t) => {
1044
1044
  return e === -180 && (e = 180), e;
1045
1045
  };
1046
1046
  function pe({ corners: t, widthMm: e, heightMm: i, crsForward: s }) {
1047
- const r = s ?? Ws, a = t[0][0], n = t.map(([m, d]) => [Hi(m, a), d]), o = n.map((m) => r.forward(m)), h = [
1047
+ const r = s ?? Ws, a = t[0][0], n = t.map(([m, d]) => [Vi(m, a), d]), o = n.map((m) => r.forward(m)), h = [
1048
1048
  [0, 0],
1049
1049
  [e, 0],
1050
1050
  [e, i],
1051
1051
  [0, i]
1052
- ], l = e > 0 && i > 0 ? Aa(o, h) : null, f = l ? Pa(l.matrix) : null, u = !l || !f, c = {
1052
+ ], l = e > 0 && i > 0 ? Pa(o, h) : null, f = l ? Aa(l.matrix) : null, u = !l || !f, c = {
1053
1053
  crs: r.code,
1054
1054
  corners: n,
1055
1055
  widthMm: e,
@@ -1057,12 +1057,12 @@ function pe({ corners: t, widthMm: e, heightMm: i, crsForward: s }) {
1057
1057
  degenerate: u,
1058
1058
  project(m) {
1059
1059
  if (!l) return null;
1060
- const d = r.forward([Hi(m[0], a), m[1]]), g = Wi(l.matrix, l.normalize(d));
1060
+ const d = r.forward([Vi(m[0], a), m[1]]), g = Hi(l.matrix, l.normalize(d));
1061
1061
  return g && Number.isFinite(g[0]) && Number.isFinite(g[1]) ? { xMm: g[0], yMm: g[1] } : null;
1062
1062
  },
1063
1063
  unproject(m, d) {
1064
1064
  if (!l || !f) return null;
1065
- const g = Wi(f, [m, d]);
1065
+ const g = Hi(f, [m, d]);
1066
1066
  if (!g) return null;
1067
1067
  const M = r.inverse(l.denormalize(g));
1068
1068
  return Number.isFinite(M[0]) && Number.isFinite(M[1]) ? [Ga(M[0]), M[1]] : null;
@@ -1130,7 +1130,7 @@ function Ca(t) {
1130
1130
  const r = Math.min(...s), a = Math.max(...s);
1131
1131
  return r > 0 ? (a - r) / r : null;
1132
1132
  }
1133
- function Uc(t, e, i, s) {
1133
+ function jc(t, e, i, s) {
1134
1134
  return [
1135
1135
  [t, s],
1136
1136
  [i, s],
@@ -1170,7 +1170,7 @@ async function Ra(t, e = document) {
1170
1170
  if (!n) throw new Error(`${t} could not be adopted`);
1171
1171
  return n;
1172
1172
  }
1173
- function de(t) {
1173
+ function qt(t) {
1174
1174
  const e = t.getAttribute("center"), i = t.getAttribute("zoom");
1175
1175
  if (!e || i == null || i.trim() === "") return null;
1176
1176
  const s = Number(i);
@@ -1191,7 +1191,18 @@ function de(t) {
1191
1191
  pitch: Number(t.getAttribute("pitch")) || 0
1192
1192
  };
1193
1193
  }
1194
- function Vi(t, e, i, s) {
1194
+ function ka(t, e, i, s, r = 60) {
1195
+ const a = (h) => Ze(t, { ...e, pitch: h }, i, s) !== null;
1196
+ if (a(r)) return r;
1197
+ if (!a(0)) return 0;
1198
+ let n = 0, o = r;
1199
+ for (; o - n > 1; ) {
1200
+ const h = Math.floor((n + o) / 2);
1201
+ a(h) ? n = h : o = h;
1202
+ }
1203
+ return n;
1204
+ }
1205
+ function Ze(t, e, i, s) {
1195
1206
  if (!(i > 0) || !(s > 0)) return null;
1196
1207
  const r = new t.WebMercatorViewport({
1197
1208
  width: i,
@@ -1214,7 +1225,7 @@ function Vi(t, e, i, s) {
1214
1225
  }
1215
1226
  return n;
1216
1227
  }
1217
- async function ka(t) {
1228
+ async function $a(t) {
1218
1229
  const e = await Gs(), i = t.querySelector(":scope > om-map");
1219
1230
  if (i) return { core: e, map: i };
1220
1231
  const s = t.getAttribute("src");
@@ -1223,9 +1234,9 @@ async function ka(t) {
1223
1234
  return { core: e, map: r };
1224
1235
  }
1225
1236
  function je(t, e) {
1226
- t.setAttribute("center", JSON.stringify(e.center)), t.setAttribute("zoom", String(e.zoom)), t.setAttribute("bearing", String(e.bearing)), t.setAttribute("pitch", String(e.pitch)), $a(t, e);
1237
+ t.setAttribute("center", JSON.stringify(e.center)), t.setAttribute("zoom", String(e.zoom)), t.setAttribute("bearing", String(e.bearing)), t.setAttribute("pitch", String(e.pitch)), La(t, e);
1227
1238
  }
1228
- function $a(t, e) {
1239
+ function La(t, e) {
1229
1240
  const i = t;
1230
1241
  typeof i.setViewInternal == "function" ? i.setViewInternal({ longitude: e.center[0], latitude: e.center[1], zoom: e.zoom, pitch: e.pitch, bearing: e.bearing }) : typeof i.flyTo == "function" && i.flyTo(e.center, e.zoom, { duration: 0 });
1231
1242
  }
@@ -1281,7 +1292,7 @@ class Vs extends st {
1281
1292
  * than caching it correctly.
1282
1293
  */
1283
1294
  get georef() {
1284
- const { w: e, h: i } = L(this);
1295
+ const { w: e, h: i } = $(this);
1285
1296
  if (e <= 0 || i <= 0) return null;
1286
1297
  if (this.mode === "live")
1287
1298
  return this.liveCorners ? pe({ corners: this.liveCorners, widthMm: e, heightMm: i }) : null;
@@ -1350,25 +1361,27 @@ class Vs extends st {
1350
1361
  // Live
1351
1362
  // -------------------------------------------------------------------------
1352
1363
  renderLive() {
1353
- const e = de(this);
1354
- if (!e) {
1364
+ const e = this.raster;
1365
+ e && (e.style.display = "none");
1366
+ const i = qt(this);
1367
+ if (!i) {
1355
1368
  this.showPlaceholder("no-camera", 'Live frame needs its own camera — center="[lng, lat]" and zoom=.');
1356
1369
  return;
1357
1370
  }
1358
- this.updateLiveCorners(e);
1359
- const i = this.liveSource();
1371
+ this.updateLiveCorners(i);
1372
+ const s = this.liveSource();
1360
1373
  if (this.liveMap)
1361
- if (this.mountedSource !== i)
1374
+ if (this.mountedSource !== s)
1362
1375
  this.releaseLiveMap();
1363
1376
  else {
1364
- je(this.liveMap, e), this.sizeLiveMap();
1377
+ je(this.liveMap, i), this.sizeLiveMap();
1365
1378
  return;
1366
1379
  }
1367
1380
  if (this.mounting) {
1368
- if (this.mountingSource === i) return;
1381
+ if (this.mountingSource === s) return;
1369
1382
  this.abandonMount();
1370
1383
  }
1371
- this.mountLive(i);
1384
+ this.mountLive(s);
1372
1385
  }
1373
1386
  /** Inline maps are identified by node identity; fetched maps by their src=. */
1374
1387
  liveSource() {
@@ -1383,11 +1396,11 @@ class Vs extends st {
1383
1396
  releaseLiveMap() {
1384
1397
  this.liveMapOwned ? this.liveMap?.remove() : this.liveMap && (this.liveMap.hidden = !0), this.liveMap = null, this.liveMapOwned = !1, this.mountedSource = null, this.liveCorners = null, this.captureImage = null;
1385
1398
  }
1386
- updateLiveCorners(e = de(this)) {
1399
+ updateLiveCorners(e = qt(this)) {
1387
1400
  if (!e) return;
1388
- const i = Ct();
1401
+ const i = Mt();
1389
1402
  if (!i) return;
1390
- const { w: s, h: r } = L(this), a = Vi(i, e, s * bt, r * bt);
1403
+ const { w: s, h: r } = $(this), a = Ze(i, e, s * ot, r * ot);
1391
1404
  this.liveCorners = a, a ? this.lastError === "degenerate-view" && this.clearPlaceholder() : this.showPlaceholder(
1392
1405
  "degenerate-view",
1393
1406
  "This camera cannot be georeferenced — the frame's top edge reaches the horizon. Reduce pitch below ~60°."
@@ -1397,15 +1410,15 @@ class Vs extends st {
1397
1410
  const i = ++this.mountToken;
1398
1411
  this.mounting = !0, this.mountingSource = e;
1399
1412
  try {
1400
- const { core: s, map: r } = await ka(this);
1413
+ const { core: s, map: r } = await $a(this);
1401
1414
  if (i !== this.mountToken || !this.isConnected || this.mode !== "live" || this.liveSource() !== e) return;
1402
- const a = de(this);
1415
+ const a = qt(this);
1403
1416
  if (!a) return;
1404
1417
  je(r, a);
1405
1418
  const n = r;
1406
1419
  n.style.position = "absolute", n.style.inset = "0", n.style.display = "block", this.liveMapOwned = r.parentElement !== this, this.liveMapOwned && this.appendChild(r), r.setAttribute("data-om-carto-frame", ""), this.liveMap = n, this.mountedSource = e, this.sizeLiveMap(), this.clearPlaceholder();
1407
- const { w: o, h } = L(this);
1408
- if (this.liveCorners = Vi(s, a, o * bt, h * bt), await n.ready, i !== this.mountToken || (je(r, a), await n.whenSettled?.({ timeout: 2e4 }), i !== this.mountToken)) return;
1420
+ const { w: o, h } = $(this);
1421
+ if (this.liveCorners = Ze(s, a, o * ot, h * ot), await n.ready, i !== this.mountToken || (je(r, a), await n.whenSettled?.({ timeout: 2e4 }), i !== this.mountToken)) return;
1409
1422
  this.signalReady();
1410
1423
  } catch (s) {
1411
1424
  if (i !== this.mountToken) return;
@@ -1416,7 +1429,22 @@ class Vs extends st {
1416
1429
  }
1417
1430
  }
1418
1431
  sizeLiveMap() {
1419
- this.liveMap && (this.liveMap.style.width = "100%", this.liveMap.style.height = "100%", this.liveMap.hidden = this.printing);
1432
+ this.liveMap && (this.liveMap.style.width = "100%", this.liveMap.style.height = "100%", this.liveMap.hidden = this.printing, this.capMapPitch());
1433
+ }
1434
+ /**
1435
+ * Stop the adopted map tilting past what this frame can georeference.
1436
+ *
1437
+ * A frame without a georeference has no scale bar, no north arrow, no
1438
+ * graticule and no export — so letting a host drive the camera past the
1439
+ * limit produces a frame that renders an error instead of a map. The ceiling
1440
+ * is the frame's own, recomputed whenever its box changes, because it
1441
+ * depends on the box's aspect and the current zoom.
1442
+ */
1443
+ capMapPitch() {
1444
+ const e = Mt(), i = qt(this);
1445
+ if (!e || !i || !this.liveMap) return;
1446
+ const { w: s, h: r } = $(this), a = ka(e, i, s * ot, r * ot);
1447
+ a >= 60 ? this.liveMap.removeAttribute("max-pitch") : this.liveMap.setAttribute("max-pitch", String(a));
1420
1448
  }
1421
1449
  // -------------------------------------------------------------------------
1422
1450
  // Locator inset (overview-of)
@@ -1438,7 +1466,7 @@ class Vs extends st {
1438
1466
  i?.remove();
1439
1467
  return;
1440
1468
  }
1441
- const { w: n, h: o } = L(this), h = [], [l, f, u, c] = a.corners, m = [
1469
+ const { w: n, h: o } = $(this), h = [], [l, f, u, c] = a.corners, m = [
1442
1470
  [l, f],
1443
1471
  [f, u],
1444
1472
  [u, c],
@@ -1446,8 +1474,8 @@ class Vs extends st {
1446
1474
  ];
1447
1475
  for (const [v, _] of m)
1448
1476
  for (let b = 0; b < Xi; b++) {
1449
- const E = b / Xi, S = [v[0] + (_[0] - v[0]) * E, v[1] + (_[1] - v[1]) * E], A = r.project(S);
1450
- A && h.push(`${A.xMm.toFixed(3)},${A.yMm.toFixed(3)}`);
1477
+ const E = b / Xi, S = [v[0] + (_[0] - v[0]) * E, v[1] + (_[1] - v[1]) * E], P = r.project(S);
1478
+ P && h.push(`${P.xMm.toFixed(3)},${P.yMm.toFixed(3)}`);
1451
1479
  }
1452
1480
  if (h.length < 3) {
1453
1481
  i?.remove();
@@ -1504,11 +1532,11 @@ class Vs extends st {
1504
1532
  * follows from the same source as any authored camera.
1505
1533
  */
1506
1534
  fitBounds(e) {
1507
- const [i, s, r, a] = e, { w: n, h: o } = L(this);
1535
+ const [i, s, r, a] = e, { w: n, h: o } = $(this);
1508
1536
  if (n <= 0 || o <= 0) return;
1509
- const h = Ct();
1537
+ const h = Mt();
1510
1538
  if (!h) return;
1511
- const l = new h.WebMercatorViewport({ width: n * bt, height: o * bt, longitude: 0, latitude: 0, zoom: 0 }).fitBounds([
1539
+ const l = new h.WebMercatorViewport({ width: n * ot, height: o * ot, longitude: 0, latitude: 0, zoom: 0 }).fitBounds([
1512
1540
  [i, s],
1513
1541
  [r, a]
1514
1542
  ]);
@@ -1537,7 +1565,7 @@ class Vs extends st {
1537
1565
  this.printing = !1, this.querySelector(":scope > img[data-om-carto-print]")?.remove(), this.liveMap && (this.liveMap.hidden = !1);
1538
1566
  }
1539
1567
  paintCartograph(e, i) {
1540
- const { w: s, h: r } = L(this), a = s * i.pxPerMm, n = r * i.pxPerMm;
1568
+ const { w: s, h: r } = $(this), a = s * i.pxPerMm, n = r * i.pxPerMm;
1541
1569
  if (a <= 0 || n <= 0) return;
1542
1570
  const o = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, h = Y(o?.backgroundColor);
1543
1571
  h && (e.fillStyle = h, e.fillRect(0, 0, a, n));
@@ -1555,14 +1583,14 @@ class Vs extends st {
1555
1583
  }
1556
1584
  }
1557
1585
  q("om-frame", Vs);
1558
- const ne = "http://www.w3.org/2000/svg", La = ["single", "double", "line", "ticks"];
1586
+ const oe = "http://www.w3.org/2000/svg", Oa = ["single", "double", "line", "ticks"];
1559
1587
  class Ks extends st {
1560
1588
  static observedAttributes = [...J["om-scalebar"]];
1561
1589
  /** The geometry currently drawn — reused by the canvas exporter. */
1562
1590
  get drawing() {
1563
1591
  const i = rt(this)?.georef;
1564
1592
  if (!i) return null;
1565
- const { w: s, h: r } = L(this), a = Ls({
1593
+ const { w: s, h: r } = $(this), a = Ls({
1566
1594
  groundMetersPerMm: i.groundMetersPerMm(),
1567
1595
  maxWidthMm: s,
1568
1596
  segments: Number(this.getAttribute("segments")) || void 0,
@@ -1573,7 +1601,7 @@ class Ks extends st {
1573
1601
  }
1574
1602
  get barStyle() {
1575
1603
  const e = this.getAttribute("kind");
1576
- return La.includes(e) ? e : "single";
1604
+ return Oa.includes(e) ? e : "single";
1577
1605
  }
1578
1606
  get unitSystem() {
1579
1607
  return na(this.getAttribute("units")) ?? "metric";
@@ -1581,30 +1609,30 @@ class Ks extends st {
1581
1609
  renderNow() {
1582
1610
  if (this.applyPlacement(), this.style.display = "block", !rt(this)) {
1583
1611
  const s = this.getAttribute("for");
1584
- Mt(this, s ? `Scale bar references no frame with id "${s}".` : "Scale bar has no frame to measure (set for=).");
1612
+ yt(this, s ? `Scale bar references no frame with id "${s}".` : "Scale bar has no frame to measure (set for=).");
1585
1613
  return;
1586
1614
  }
1587
1615
  const i = this.drawing;
1588
1616
  if (!i) {
1589
- Mt(this, "Scale bar cannot derive a scale from this frame yet.");
1617
+ yt(this, "Scale bar cannot derive a scale from this frame yet.");
1590
1618
  return;
1591
1619
  }
1592
1620
  this.renderSvg(i);
1593
1621
  }
1594
1622
  renderSvg(e) {
1595
- const { w: i, h: s } = L(this), r = this.ownerDocument, a = r.createElementNS(ne, "svg");
1623
+ const { w: i, h: s } = $(this), r = this.ownerDocument, a = r.createElementNS(oe, "svg");
1596
1624
  a.setAttribute("width", `${i}mm`), a.setAttribute("height", `${s}mm`), a.setAttribute("viewBox", `0 0 ${i} ${s}`), a.setAttribute("part", "scalebar"), a.style.display = "block", a.style.overflow = "visible";
1597
1625
  const n = "var(--om-carto-scalebar-ink)";
1598
1626
  for (const o of e.bars) {
1599
- const h = r.createElementNS(ne, "rect");
1627
+ const h = r.createElementNS(oe, "rect");
1600
1628
  h.setAttribute("x", String(o.x)), h.setAttribute("y", String(o.y)), h.setAttribute("width", String(o.w)), h.setAttribute("height", String(o.h)), h.setAttribute("fill", o.filled ? n : "none"), h.setAttribute("stroke", n), h.setAttribute("stroke-width", String(e.strokeMm)), a.appendChild(h);
1601
1629
  }
1602
1630
  for (const o of e.strokes) {
1603
- const h = r.createElementNS(ne, "line");
1631
+ const h = r.createElementNS(oe, "line");
1604
1632
  h.setAttribute("x1", String(o.x1)), h.setAttribute("y1", String(o.y1)), h.setAttribute("x2", String(o.x2)), h.setAttribute("y2", String(o.y2)), h.setAttribute("stroke", n), h.setAttribute("stroke-width", String(e.strokeMm)), a.appendChild(h);
1605
1633
  }
1606
1634
  for (const o of e.labels) {
1607
- const h = r.createElementNS(ne, "text");
1635
+ const h = r.createElementNS(oe, "text");
1608
1636
  h.setAttribute("x", String(o.x)), h.setAttribute("y", String(o.y)), h.setAttribute("font-size", String(e.fontMm)), h.setAttribute("fill", n), h.setAttribute("text-anchor", o.anchor), h.setAttribute("font-family", "var(--om-carto-font)"), h.textContent = o.text, a.appendChild(h);
1609
1637
  }
1610
1638
  this.replaceChildren(a);
@@ -1641,15 +1669,15 @@ class Xs extends st {
1641
1669
  renderNow() {
1642
1670
  if (this.applyPlacement(), this.style.display = "block", !rt(this)) {
1643
1671
  const h = this.getAttribute("for");
1644
- Mt(this, h ? `North indicator references no frame with id "${h}".` : "North indicator has no frame (set for=).");
1672
+ yt(this, h ? `North indicator references no frame with id "${h}".` : "North indicator has no frame (set for=).");
1645
1673
  return;
1646
1674
  }
1647
1675
  const i = this.bearing;
1648
1676
  if (i == null) {
1649
- Mt(this, "North indicator cannot derive a direction from this frame yet.");
1677
+ yt(this, "North indicator cannot derive a direction from this frame yet.");
1650
1678
  return;
1651
1679
  }
1652
- const { w: s, h: r } = L(this), a = this.ownerDocument, n = a.createElementNS(Ot, "svg");
1680
+ const { w: s, h: r } = $(this), a = this.ownerDocument, n = a.createElementNS(Ot, "svg");
1653
1681
  n.setAttribute("width", `${s}mm`), n.setAttribute("height", `${r}mm`), n.setAttribute("viewBox", `0 0 ${s} ${r}`), n.style.display = "block";
1654
1682
  const o = a.createElementNS(Ot, "g");
1655
1683
  o.setAttribute("transform", `rotate(${i.toFixed(3)} ${s / 2} ${r / 2})`);
@@ -1670,17 +1698,17 @@ class Xs extends st {
1670
1698
  paintCartograph(e, i) {
1671
1699
  const s = this.bearing;
1672
1700
  if (s == null) return;
1673
- const { w: r, h: a } = L(this), n = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, o = Y(n?.color) ?? "#000", h = (m) => m * i.pxPerMm, l = Math.min(3, a * 0.24), f = a - l * 1.2, u = r / 2, c = Math.min(r * 0.3, 4);
1701
+ const { w: r, h: a } = $(this), n = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, o = Y(n?.color) ?? "#000", h = (m) => m * i.pxPerMm, l = Math.min(3, a * 0.24), f = a - l * 1.2, u = r / 2, c = Math.min(r * 0.3, 4);
1674
1702
  e.save(), e.translate(h(u), h(a / 2)), e.rotate(s * Math.PI / 180), e.translate(-h(u), -h(a / 2)), e.fillStyle = o, e.strokeStyle = o, this.indicatorKind === "rose" && (e.lineWidth = h(0.2), e.beginPath(), e.arc(h(u), h(f / 2), h(Math.min(r, f) / 2), 0, Math.PI * 2), e.stroke()), e.beginPath(), e.moveTo(h(u), 0), e.lineTo(h(u + c), h(f)), e.lineTo(h(u), h(f - c * 0.55)), e.lineTo(h(u - c), h(f)), e.closePath(), e.fill(), e.font = `${h(l)}px ${n?.fontFamily || "system-ui, sans-serif"}`, e.textAlign = "center", e.textBaseline = "alphabetic", e.fillText("N", h(u), h(a)), e.restore();
1675
1703
  }
1676
1704
  }
1677
1705
  q("om-north", Xs);
1678
- const oe = "http://www.w3.org/2000/svg", Oa = ["rect", "ellipse", "line", "arrow"];
1706
+ const he = "http://www.w3.org/2000/svg", Fa = ["rect", "ellipse", "line", "arrow"];
1679
1707
  class Qs extends st {
1680
1708
  static observedAttributes = [...J["om-shape"]];
1681
1709
  get kind() {
1682
1710
  const e = this.getAttribute("kind");
1683
- return Oa.includes(e) ? e : "rect";
1711
+ return Fa.includes(e) ? e : "rect";
1684
1712
  }
1685
1713
  get fill() {
1686
1714
  return this.getAttribute("fill") || "var(--om-carto-shape-fill)";
@@ -1706,11 +1734,11 @@ class Qs extends st {
1706
1734
  }
1707
1735
  renderNow() {
1708
1736
  this.applyPlacement(), this.style.display = "block";
1709
- const { w: e, h: i } = L(this), s = this.ownerDocument, r = s.createElementNS(oe, "svg");
1737
+ const { w: e, h: i } = $(this), s = this.ownerDocument, r = s.createElementNS(he, "svg");
1710
1738
  r.setAttribute("width", `${e}mm`), r.setAttribute("height", `${i}mm`), r.setAttribute("viewBox", `0 0 ${e} ${i}`), r.style.display = "block", r.style.overflow = "visible";
1711
1739
  const a = this.strokeWidthMm / 2, n = this.kind;
1712
1740
  let o;
1713
- n === "ellipse" ? (o = s.createElementNS(oe, "ellipse"), o.setAttribute("cx", String(e / 2)), o.setAttribute("cy", String(i / 2)), o.setAttribute("rx", String(Math.max(0, e / 2 - a))), o.setAttribute("ry", String(Math.max(0, i / 2 - a)))) : n === "line" || n === "arrow" ? (o = s.createElementNS(oe, "path"), o.setAttribute("d", n === "arrow" ? this.arrowPath(e, i) : `M 0 0 L ${e} ${i}`)) : (o = s.createElementNS(oe, "rect"), o.setAttribute("x", String(a)), o.setAttribute("y", String(a)), o.setAttribute("width", String(Math.max(0, e - this.strokeWidthMm))), o.setAttribute("height", String(Math.max(0, i - this.strokeWidthMm))), this.radiusMm > 0 && o.setAttribute("rx", String(this.radiusMm)));
1741
+ n === "ellipse" ? (o = s.createElementNS(he, "ellipse"), o.setAttribute("cx", String(e / 2)), o.setAttribute("cy", String(i / 2)), o.setAttribute("rx", String(Math.max(0, e / 2 - a))), o.setAttribute("ry", String(Math.max(0, i / 2 - a)))) : n === "line" || n === "arrow" ? (o = s.createElementNS(he, "path"), o.setAttribute("d", n === "arrow" ? this.arrowPath(e, i) : `M 0 0 L ${e} ${i}`)) : (o = s.createElementNS(he, "rect"), o.setAttribute("x", String(a)), o.setAttribute("y", String(a)), o.setAttribute("width", String(Math.max(0, e - this.strokeWidthMm))), o.setAttribute("height", String(Math.max(0, i - this.strokeWidthMm))), this.radiusMm > 0 && o.setAttribute("rx", String(this.radiusMm)));
1714
1742
  const h = n === "rect" || n === "ellipse" || n === "arrow";
1715
1743
  o.setAttribute("fill", h ? this.fill : "none"), h && o.setAttribute("fill-opacity", String(this.fillOpacity)), o.setAttribute("stroke", this.stroke), o.setAttribute("stroke-width", String(this.strokeWidthMm)), r.appendChild(o), this.replaceChildren(r);
1716
1744
  }
@@ -1720,7 +1748,7 @@ class Qs extends st {
1720
1748
  return `M 0 0 L ${a} ${n} M ${a} ${n} L ${o.x} ${o.y} L ${h.x} ${h.y} Z`;
1721
1749
  }
1722
1750
  paintCartograph(e, i) {
1723
- const { w: s, h: r } = L(this);
1751
+ const { w: s, h: r } = $(this);
1724
1752
  if (s <= 0 || r <= 0) return;
1725
1753
  const a = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, n = (c) => c * i.pxPerMm, o = this.getAttribute("fill") || a?.getPropertyValue("--om-carto-shape-fill")?.trim() || "#cccccc", h = this.getAttribute("stroke") || a?.getPropertyValue("--om-carto-shape-stroke")?.trim() || "#333333", l = n(this.strokeWidthMm), f = l / 2, u = this.kind;
1726
1754
  if (e.save(), e.globalAlpha = this.fillOpacity, e.fillStyle = o, e.strokeStyle = h, e.lineWidth = l, u === "ellipse")
@@ -1738,12 +1766,12 @@ class Qs extends st {
1738
1766
  }
1739
1767
  }
1740
1768
  q("om-shape", Qs);
1741
- const Ji = "data-om-carto-owned", Fa = ["contain", "cover", "fill"];
1769
+ const Ji = "data-om-carto-owned", qa = ["contain", "cover", "fill"];
1742
1770
  class Js extends st {
1743
1771
  static observedAttributes = [...J["om-image"]];
1744
1772
  get fit() {
1745
1773
  const e = this.getAttribute("fit");
1746
- return Fa.includes(e ?? "") ? e : "contain";
1774
+ return qa.includes(e ?? "") ? e : "contain";
1747
1775
  }
1748
1776
  get image() {
1749
1777
  return this.querySelector(":scope > img");
@@ -1757,7 +1785,7 @@ class Js extends st {
1757
1785
  paintCartograph(e, i) {
1758
1786
  const s = this.image;
1759
1787
  if (!s || !s.complete || s.naturalWidth === 0) return;
1760
- const { w: r, h: a } = L(this), n = r * i.pxPerMm, o = a * i.pxPerMm;
1788
+ const { w: r, h: a } = $(this), n = r * i.pxPerMm, o = a * i.pxPerMm;
1761
1789
  if (n <= 0 || o <= 0) return;
1762
1790
  const h = this.fit;
1763
1791
  if (h === "fill") {
@@ -1769,12 +1797,12 @@ class Js extends st {
1769
1797
  }
1770
1798
  }
1771
1799
  q("om-image", Js);
1772
- const qa = /* @__PURE__ */ new Set(["PathLayer", "LineLayer", "ArcLayer", "TripsLayer", "GreatCircleLayer", "PathStyleLayer"]), Ua = /* @__PURE__ */ new Set(["ScatterplotLayer", "IconLayer", "TextLayer", "PointCloudLayer", "HeatmapLayer", "ScreenGridLayer"]), ja = /* @__PURE__ */ new Set(["COGLayer", "ZarrLayer", "BitmapLayer", "TerrainLayer", "ImageOverlay"]);
1773
- function Da(t) {
1800
+ const Ua = /* @__PURE__ */ new Set(["PathLayer", "LineLayer", "ArcLayer", "TripsLayer", "GreatCircleLayer", "PathStyleLayer"]), ja = /* @__PURE__ */ new Set(["ScatterplotLayer", "IconLayer", "TextLayer", "PointCloudLayer", "HeatmapLayer", "ScreenGridLayer"]), Da = /* @__PURE__ */ new Set(["COGLayer", "ZarrLayer", "BitmapLayer", "TerrainLayer", "ImageOverlay"]);
1801
+ function za(t) {
1774
1802
  const e = t.type ?? "";
1775
- if (ja.has(e)) return "ramp";
1776
- if (qa.has(e)) return "line";
1777
- if (Ua.has(e)) return "point";
1803
+ if (Da.has(e)) return "ramp";
1804
+ if (Ua.has(e)) return "line";
1805
+ if (ja.has(e)) return "point";
1778
1806
  if (e === "GeoJsonLayer") {
1779
1807
  const i = t.props ?? {}, s = i.getFillColor !== void 0, r = i.getLineColor !== void 0;
1780
1808
  if (s && !r) return "polygon";
@@ -1782,24 +1810,24 @@ function Da(t) {
1782
1810
  }
1783
1811
  return "polygon";
1784
1812
  }
1785
- function za(t) {
1813
+ function Ba(t) {
1786
1814
  const e = t.meta?.legend;
1787
1815
  return t.meta?.color ?? (e?.kind === "ramp" ? e.colors[0] : e?.entries[0]?.color) ?? "#999";
1788
1816
  }
1789
1817
  const Be = 12;
1790
- function Ba(t, e = []) {
1818
+ function Wa(t, e = []) {
1791
1819
  const i = [];
1792
1820
  for (const s of t) {
1793
1821
  if (s.props?.visible === !1) continue;
1794
1822
  const r = e.filter((o) => o.layer === s.id), a = r.find((o) => o.match == null);
1795
1823
  if (a?.hide) continue;
1796
- const n = Wa(s.meta?.legend);
1824
+ const n = Ha(s.meta?.legend);
1797
1825
  i.push({
1798
1826
  layerId: s.id,
1799
1827
  label: a?.label ?? s.meta?.label ?? s.id,
1800
- color: a?.color ?? za(s),
1801
- shape: a?.shape ?? Da(s),
1802
- legend: Ha(n, r),
1828
+ color: a?.color ?? Ba(s),
1829
+ shape: a?.shape ?? za(s),
1830
+ legend: Va(n, r),
1803
1831
  order: a?.order
1804
1832
  });
1805
1833
  }
@@ -1808,7 +1836,7 @@ function Ba(t, e = []) {
1808
1836
  return a - n || s.index - r.index;
1809
1837
  }).map((s) => s.row);
1810
1838
  }
1811
- function Wa(t) {
1839
+ function Ha(t) {
1812
1840
  if (!t || t.kind !== "categories" || t.entries.length <= Be) return t;
1813
1841
  const e = t.entries.slice(0, Be), i = t.entries.length - Be;
1814
1842
  return {
@@ -1816,7 +1844,7 @@ function Wa(t) {
1816
1844
  entries: [...e, { color: t.defaultColor ?? "#999", label: `+${i} more` }]
1817
1845
  };
1818
1846
  }
1819
- function Ha(t, e) {
1847
+ function Va(t, e) {
1820
1848
  const i = e.filter((r) => r.match != null);
1821
1849
  if (!t || t.kind === "ramp" || i.length === 0) return t;
1822
1850
  const s = [];
@@ -1826,7 +1854,7 @@ function Ha(t, e) {
1826
1854
  }
1827
1855
  return { ...t, entries: s };
1828
1856
  }
1829
- function Va(t) {
1857
+ function Ka(t) {
1830
1858
  const e = [];
1831
1859
  for (const i of t.querySelectorAll(":scope > om-legend-row")) {
1832
1860
  const s = i.getAttribute("layer");
@@ -1869,17 +1897,17 @@ class Zs extends st {
1869
1897
  get rows() {
1870
1898
  if (!this.derived) return Ys(this);
1871
1899
  const s = rt(this)?.mapElement?.getLayers?.();
1872
- return s ? Ba(s, Va(this)) : [];
1900
+ return s ? Wa(s, Ka(this)) : [];
1873
1901
  }
1874
1902
  renderNow() {
1875
1903
  if (this.applyPlacement(), this.style.display = "block", this.style.boxSizing = "border-box", this.style.overflow = "hidden", this.derived && !rt(this)) {
1876
1904
  const i = this.getAttribute("for");
1877
- Mt(this, i ? `Legend references no frame with id "${i}".` : "Legend has no frame to derive from (set for=).");
1905
+ yt(this, i ? `Legend references no frame with id "${i}".` : "Legend has no frame to derive from (set for=).");
1878
1906
  return;
1879
1907
  }
1880
1908
  const e = this.rows;
1881
1909
  if (e.length === 0 && this.derived) {
1882
- Mt(this, "Legend is waiting for its frame's layers.");
1910
+ yt(this, "Legend is waiting for its frame's layers.");
1883
1911
  return;
1884
1912
  }
1885
1913
  this.renderRows(e);
@@ -1919,20 +1947,20 @@ class Zs extends st {
1919
1947
  const n = e.createElement("div");
1920
1948
  n.style.cssText = `height:2.4mm;background:linear-gradient(to right, ${r.colors.join(", ")});border:0.15mm solid rgba(0,0,0,.25);`, s.appendChild(n);
1921
1949
  const o = e.createElement("div");
1922
- return o.style.cssText = "display:flex;justify-content:space-between;font-size:2.1mm;opacity:.75;", o.append(he(e, r.domain[0].toLocaleString("en-US")), he(e, r.domain[1].toLocaleString("en-US"))), s.appendChild(o), s;
1950
+ return o.style.cssText = "display:flex;justify-content:space-between;font-size:2.1mm;opacity:.75;", o.append(le(e, r.domain[0].toLocaleString("en-US")), le(e, r.domain[1].toLocaleString("en-US"))), s.appendChild(o), s;
1923
1951
  }
1924
1952
  for (const n of r.entries) {
1925
1953
  const o = e.createElement("div");
1926
- o.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", o.appendChild(this.buildSwatch(e, n.color, "polygon")), o.appendChild(he(e, n.label)), s.appendChild(o);
1954
+ o.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", o.appendChild(this.buildSwatch(e, n.color, "polygon")), o.appendChild(le(e, n.label)), s.appendChild(o);
1927
1955
  }
1928
1956
  if (r.kind === "categories" && r.defaultColor) {
1929
1957
  const n = e.createElement("div");
1930
- n.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", n.appendChild(this.buildSwatch(e, r.defaultColor, "polygon")), n.appendChild(he(e, "other")), s.appendChild(n);
1958
+ n.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", n.appendChild(this.buildSwatch(e, r.defaultColor, "polygon")), n.appendChild(le(e, "other")), s.appendChild(n);
1931
1959
  }
1932
1960
  return s;
1933
1961
  }
1934
1962
  paintCartograph(e, i) {
1935
- const { w: s, h: r } = L(this), a = s * i.pxPerMm, n = r * i.pxPerMm;
1963
+ const { w: s, h: r } = $(this), a = s * i.pxPerMm, n = r * i.pxPerMm;
1936
1964
  if (a <= 0 || n <= 0) return;
1937
1965
  const o = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, h = Y(o?.backgroundColor);
1938
1966
  h && (e.fillStyle = h, e.fillRect(0, 0, a, n));
@@ -1942,18 +1970,18 @@ class Zs extends st {
1942
1970
  let d = m(2);
1943
1971
  const g = this.getAttribute("title");
1944
1972
  g && (e.fillStyle = u, e.font = `600 ${m(2.6)}px ${c}`, e.textBaseline = "top", e.fillText(g, m(2), d), d += m(4));
1945
- const M = this.rows, v = Number(this.getAttribute("columns")), _ = Math.min(M.length || 1, Number.isFinite(v) && v > 1 ? Math.floor(v) : 1), b = Math.max(1, Math.ceil(M.length / _)), E = 3, S = Math.max(1, (s - 4 - E * (_ - 1)) / _), A = d;
1946
- let P = -1, G = 2;
1973
+ const M = this.rows, v = Number(this.getAttribute("columns")), _ = Math.min(M.length || 1, Number.isFinite(v) && v > 1 ? Math.floor(v) : 1), b = Math.max(1, Math.ceil(M.length / _)), E = 3, S = Math.max(1, (s - 4 - E * (_ - 1)) / _), P = d;
1974
+ let A = -1, G = 2;
1947
1975
  e.font = `${m(2.6)}px ${c}`;
1948
1976
  for (const [N, F] of M.entries()) {
1949
1977
  const x = Math.min(_ - 1, Math.floor(N / b));
1950
- if (x !== P && (P = x, G = 2 + P * (S + E), d = P === 0 ? A : m(2)), d > n || (e.fillStyle = F.color, F.shape === "line" ? e.fillRect(m(G), d + m(1.2), m(3.2), m(0.9)) : F.shape === "point" ? (e.beginPath(), e.arc(m(G + 1.6), d + m(1.6), m(1.6), 0, Math.PI * 2), e.fill()) : e.fillRect(m(G), d, m(3.2), m(3.2)), e.fillStyle = u, e.textBaseline = "top", e.fillText(F.label, m(G + 4.7), d + m(0.3)), d += m(4.2), !F.legend)) continue;
1978
+ if (x !== A && (A = x, G = 2 + A * (S + E), d = A === 0 ? P : m(2)), d > n || (e.fillStyle = F.color, F.shape === "line" ? e.fillRect(m(G), d + m(1.2), m(3.2), m(0.9)) : F.shape === "point" ? (e.beginPath(), e.arc(m(G + 1.6), d + m(1.6), m(1.6), 0, Math.PI * 2), e.fill()) : e.fillRect(m(G), d, m(3.2), m(3.2)), e.fillStyle = u, e.textBaseline = "top", e.fillText(F.label, m(G + 4.7), d + m(0.3)), d += m(4.2), !F.legend)) continue;
1951
1979
  const C = F.legend;
1952
1980
  if (e.save(), e.font = `${m(2.1)}px ${c}`, e.globalAlpha = 0.7, e.fillText(C.field, m(G + 2.7), d), e.globalAlpha = 1, d += m(2.8), C.kind === "ramp") {
1953
1981
  const R = Math.min(24, Math.max(1, S - 2.7)), U = G + 2.7, nt = e.createLinearGradient(m(U), 0, m(U + R), 0);
1954
1982
  C.colors.forEach(($t, $r) => nt.addColorStop(C.colors.length === 1 ? 0 : $r / (C.colors.length - 1), $t)), e.fillStyle = nt, e.fillRect(m(U), d, m(R), m(2.4)), d += m(3.4), e.fillStyle = u, e.font = `${m(2.1)}px ${c}`, e.fillText(C.domain[0].toLocaleString("en-US"), m(U), d);
1955
- const ie = C.domain[1].toLocaleString("en-US");
1956
- e.textAlign = "right", e.fillText(ie, m(U + R), d), e.textAlign = "left", d += m(3.2);
1983
+ const se = C.domain[1].toLocaleString("en-US");
1984
+ e.textAlign = "right", e.fillText(se, m(U + R), d), e.textAlign = "left", d += m(3.2);
1957
1985
  } else {
1958
1986
  const R = [...C.entries];
1959
1987
  C.kind === "categories" && C.defaultColor && R.push({ color: C.defaultColor, label: "other" }), e.font = `${m(2.3)}px ${c}`;
@@ -1967,7 +1995,7 @@ class Zs extends st {
1967
1995
  }
1968
1996
  }
1969
1997
  }
1970
- const he = (t, e) => {
1998
+ const le = (t, e) => {
1971
1999
  const i = t.createElement("span");
1972
2000
  return i.textContent = e, i;
1973
2001
  };
@@ -1979,13 +2007,13 @@ const Zi = 48, tr = {
1979
2007
  function ts(t, e = 5) {
1980
2008
  return !Number.isFinite(t) || t <= 0 ? 0 : $s(t / Math.max(1, e));
1981
2009
  }
1982
- function Ka({ georef: t, plane: e = tr, interval: i, intervalX: s, intervalY: r, labels: a = "outside", format: n }) {
2010
+ function Xa({ georef: t, plane: e = tr, interval: i, intervalX: s, intervalY: r, labels: a = "outside", format: n }) {
1983
2011
  if (t.degenerate) return null;
1984
2012
  const o = t.corners.map((b) => e.fromLngLat(b)), h = o.map((b) => b[0]), l = o.map((b) => b[1]);
1985
2013
  if (h.some((b) => !Number.isFinite(b)) || l.some((b) => !Number.isFinite(b))) return null;
1986
2014
  const f = Math.min(...h), u = Math.max(...h), c = Math.min(...l), m = Math.max(...l), d = es(s ?? i, ts(u - f)), g = es(r ?? i, ts(m - c));
1987
2015
  if (d <= 0 || g <= 0 || (u - f) / d > 500 || (m - c) / g > 500) return null;
1988
- const M = [], v = [], _ = n ?? Qa;
2016
+ const M = [], v = [], _ = n ?? Ja;
1989
2017
  for (let b = Math.ceil(f / d) * d; b <= u + 1e-9; b += d) {
1990
2018
  const E = is(t, e, b, c, m, "x");
1991
2019
  E && (M.push(E), a !== "none" && rs(v, E, t, _(b, "x"), "x", a));
@@ -2005,10 +2033,10 @@ function is(t, e, i, s, r, a) {
2005
2033
  const u = t.project(f);
2006
2034
  u && n.push(u);
2007
2035
  }
2008
- const o = Xa(n, t.widthMm, t.heightMm);
2036
+ const o = Qa(n, t.widthMm, t.heightMm);
2009
2037
  return o.length >= 2 ? { points: o, value: i, axis: a } : null;
2010
2038
  }
2011
- function Xa(t, e, i) {
2039
+ function Qa(t, e, i) {
2012
2040
  const s = (o) => o.xMm >= -0.01 && o.xMm <= e + 0.01 && o.yMm >= -0.01 && o.yMm <= i + 0.01, r = t.findIndex(s);
2013
2041
  if (r === -1) return [];
2014
2042
  let a = t.length - 1;
@@ -2027,16 +2055,16 @@ function rs(t, e, i, s, r, a) {
2027
2055
  t.push({ text: s, xMm: a === "outside" ? -1.2 : 1.2, yMm: n.yMm, edge: "left", axis: r });
2028
2056
  }
2029
2057
  }
2030
- function Qa(t, e) {
2058
+ function Ja(t, e) {
2031
2059
  if (Math.abs(t) >= 1e3) return Math.round(t).toLocaleString("en-US");
2032
2060
  const i = Math.abs(t) < 1 ? 3 : Math.abs(t) < 10 ? 2 : 1;
2033
2061
  return `${Number(t.toFixed(i))}°`;
2034
2062
  }
2035
- function Ja(t, e) {
2063
+ function Ya(t, e) {
2036
2064
  const i = e === "x" ? t < 0 ? "W" : "E" : t < 0 ? "S" : "N", s = Math.abs(t), r = Math.floor(s), a = (s - r) * 60, n = Math.floor(a), o = Math.round((a - n) * 60), h = o === 60 ? n + 1 : n, l = h === 60 ? r + 1 : r, f = h === 60 ? 0 : h, u = o === 60 ? 0 : o;
2037
2065
  return `${l}°${String(f).padStart(2, "0")}′${String(u).padStart(2, "0")}″${i}`;
2038
2066
  }
2039
- const le = "http://www.w3.org/2000/svg", Ya = ["solid", "cross", "markers"], ht = 1.4;
2067
+ const ce = "http://www.w3.org/2000/svg", Za = ["solid", "cross", "markers"], lt = 1.4;
2040
2068
  class er extends st {
2041
2069
  static observedAttributes = [...J["om-graticule"]];
2042
2070
  resolvedPlane = null;
@@ -2044,7 +2072,7 @@ class er extends st {
2044
2072
  resolveToken = 0;
2045
2073
  get kind() {
2046
2074
  const e = this.getAttribute("kind");
2047
- return Ya.includes(e) ? e : "solid";
2075
+ return Za.includes(e) ? e : "solid";
2048
2076
  }
2049
2077
  get labelPlacement() {
2050
2078
  const e = this.getAttribute("labels");
@@ -2060,14 +2088,14 @@ class er extends st {
2060
2088
  const a = Number(this.getAttribute(r));
2061
2089
  return Number.isFinite(a) && a > 0 ? a : null;
2062
2090
  };
2063
- return Ka({
2091
+ return Xa({
2064
2092
  georef: e,
2065
2093
  plane: i,
2066
2094
  interval: s("interval"),
2067
2095
  intervalX: s("interval-x"),
2068
2096
  intervalY: s("interval-y"),
2069
2097
  labels: this.labelPlacement,
2070
- format: this.getAttribute("format") === "dms" ? Ja : void 0
2098
+ format: this.getAttribute("format") === "dms" ? Ya : void 0
2071
2099
  });
2072
2100
  }
2073
2101
  /**
@@ -2094,7 +2122,7 @@ class er extends st {
2094
2122
  renderNow() {
2095
2123
  if (this.applyPlacement(), this.style.display = "block", this.style.pointerEvents = "none", !rt(this)) {
2096
2124
  const s = this.getAttribute("for");
2097
- Mt(this, s ? `Graticule references no frame with id "${s}".` : "Graticule has no frame to cover (set for=).");
2125
+ yt(this, s ? `Graticule references no frame with id "${s}".` : "Graticule has no frame to cover (set for=).");
2098
2126
  return;
2099
2127
  }
2100
2128
  const i = this.graticule;
@@ -2105,20 +2133,20 @@ class er extends st {
2105
2133
  this.renderSvg(i);
2106
2134
  }
2107
2135
  renderSvg(e) {
2108
- const { w: i, h: s } = L(this), r = this.ownerDocument, a = r.createElementNS(le, "svg");
2136
+ const { w: i, h: s } = $(this), r = this.ownerDocument, a = r.createElementNS(ce, "svg");
2109
2137
  a.setAttribute("width", `${i}mm`), a.setAttribute("height", `${s}mm`), a.setAttribute("viewBox", `0 0 ${i} ${s}`), a.style.cssText = "display:block;overflow:visible;";
2110
2138
  const n = "var(--om-carto-graticule-ink)", o = this.kind;
2111
2139
  for (const h of e.lines)
2112
2140
  if (o === "solid") {
2113
- const l = r.createElementNS(le, "polyline");
2141
+ const l = r.createElementNS(ce, "polyline");
2114
2142
  l.setAttribute("points", h.points.map((f) => `${f.xMm.toFixed(3)},${f.yMm.toFixed(3)}`).join(" ")), l.setAttribute("fill", "none"), l.setAttribute("stroke", n), l.setAttribute("stroke-width", "0.15"), a.appendChild(l);
2115
2143
  } else
2116
2144
  for (const l of this.tickPoints(h, o, e)) {
2117
- const f = r.createElementNS(le, "path");
2118
- f.setAttribute("d", `M ${l.xMm - ht} ${l.yMm} H ${l.xMm + ht} M ${l.xMm} ${l.yMm - ht} V ${l.yMm + ht}`), f.setAttribute("stroke", n), f.setAttribute("stroke-width", "0.15"), a.appendChild(f);
2145
+ const f = r.createElementNS(ce, "path");
2146
+ f.setAttribute("d", `M ${l.xMm - lt} ${l.yMm} H ${l.xMm + lt} M ${l.xMm} ${l.yMm - lt} V ${l.yMm + lt}`), f.setAttribute("stroke", n), f.setAttribute("stroke-width", "0.15"), a.appendChild(f);
2119
2147
  }
2120
2148
  for (const h of e.labels) {
2121
- const l = r.createElementNS(le, "text");
2149
+ const l = r.createElementNS(ce, "text");
2122
2150
  l.setAttribute("x", String(h.xMm)), l.setAttribute("y", String(h.yMm)), l.setAttribute("font-size", "2.2"), l.setAttribute("fill", n), l.setAttribute("font-family", "var(--om-carto-font)"), l.setAttribute("text-anchor", h.edge === "left" ? "end" : "middle"), l.textContent = h.text, a.appendChild(l);
2123
2151
  }
2124
2152
  this.replaceChildren(a);
@@ -2128,7 +2156,7 @@ class er extends st {
2128
2156
  if (i === "markers") return [e.points[0], e.points[e.points.length - 1]];
2129
2157
  const r = s.lines.filter((n) => n.axis !== e.axis), a = [];
2130
2158
  for (const n of r) {
2131
- const o = Za(e.points, n.points);
2159
+ const o = tn(e.points, n.points);
2132
2160
  o && a.push(o);
2133
2161
  }
2134
2162
  return a;
@@ -2143,14 +2171,14 @@ class er extends st {
2143
2171
  e.beginPath(), h.points.forEach((l, f) => f === 0 ? e.moveTo(n(l.xMm), n(l.yMm)) : e.lineTo(n(l.xMm), n(l.yMm))), e.stroke();
2144
2172
  else
2145
2173
  for (const l of this.tickPoints(h, o, s))
2146
- e.beginPath(), e.moveTo(n(l.xMm - ht), n(l.yMm)), e.lineTo(n(l.xMm + ht), n(l.yMm)), e.moveTo(n(l.xMm), n(l.yMm - ht)), e.lineTo(n(l.xMm), n(l.yMm + ht)), e.stroke();
2174
+ e.beginPath(), e.moveTo(n(l.xMm - lt), n(l.yMm)), e.lineTo(n(l.xMm + lt), n(l.yMm)), e.moveTo(n(l.xMm), n(l.yMm - lt)), e.lineTo(n(l.xMm), n(l.yMm + lt)), e.stroke();
2147
2175
  e.font = `${n(2.2)}px ${r?.fontFamily || "system-ui, sans-serif"}`, e.textBaseline = "alphabetic";
2148
2176
  for (const h of s.labels)
2149
2177
  e.textAlign = h.edge === "left" ? "right" : "center", e.fillText(h.text, n(h.xMm), n(h.yMm));
2150
2178
  e.restore();
2151
2179
  }
2152
2180
  }
2153
- function Za(t, e) {
2181
+ function tn(t, e) {
2154
2182
  let i = null, s = Number.POSITIVE_INFINITY;
2155
2183
  for (const r of t)
2156
2184
  for (const a of e) {
@@ -2160,27 +2188,27 @@ function Za(t, e) {
2160
2188
  return s <= 1 ? i : null;
2161
2189
  }
2162
2190
  q("om-graticule", er);
2163
- function tn(t, e) {
2191
+ function en(t, e) {
2164
2192
  if (t == null || typeof t != "object") return;
2165
2193
  const i = t.properties;
2166
2194
  return i && e in i ? i[e] : t[e];
2167
2195
  }
2168
- function Ze(t, e) {
2196
+ function ti(t, e) {
2169
2197
  if (Array.isArray(t)) {
2170
2198
  if (typeof t[0] == "number") {
2171
2199
  e.push([t[0], t[1]]);
2172
2200
  return;
2173
2201
  }
2174
- for (const i of t) Ze(i, e);
2202
+ for (const i of t) ti(i, e);
2175
2203
  }
2176
2204
  }
2177
- function en(t) {
2205
+ function sn(t) {
2178
2206
  return t ? t.tileData != null ? "tiled" : t.asset != null ? "asset" : null : "empty";
2179
2207
  }
2180
2208
  function tt(t, e) {
2181
- return tn(t, e);
2209
+ return en(t, e);
2182
2210
  }
2183
- function ti(t) {
2211
+ function ei(t) {
2184
2212
  const e = {}, i = (r) => {
2185
2213
  for (const [a, n] of Object.entries(r))
2186
2214
  n == null || typeof n == "object" || (e[a] = String(n));
@@ -2189,11 +2217,11 @@ function ti(t) {
2189
2217
  const s = t.properties;
2190
2218
  return s && typeof s == "object" && i(s), e;
2191
2219
  }
2192
- function sn(t) {
2220
+ function rn(t) {
2193
2221
  let e = 1 / 0, i = 1 / 0, s = -1 / 0, r = -1 / 0;
2194
2222
  const a = [], n = t.geometry;
2195
- if (n?.coordinates != null) Ze(n.coordinates, a);
2196
- else if (Array.isArray(t.coordinates)) Ze(t.coordinates, a);
2223
+ if (n?.coordinates != null) ti(n.coordinates, a);
2224
+ else if (Array.isArray(t.coordinates)) ti(t.coordinates, a);
2197
2225
  else {
2198
2226
  const o = Number(tt(t, "lng") ?? tt(t, "longitude") ?? tt(t, "lon") ?? tt(t, "x")), h = Number(tt(t, "lat") ?? tt(t, "latitude") ?? tt(t, "y"));
2199
2227
  Number.isFinite(o) && Number.isFinite(h) && a.push([o, h]);
@@ -2202,47 +2230,47 @@ function sn(t) {
2202
2230
  !Number.isFinite(o) || !Number.isFinite(h) || (e = Math.min(e, o), s = Math.max(s, o), i = Math.min(i, h), r = Math.max(r, h));
2203
2231
  return !Number.isFinite(e) || !Number.isFinite(i) ? null : [e, i, s, r];
2204
2232
  }
2205
- function rn(t, e) {
2233
+ function an(t, e) {
2206
2234
  const [i, s, r, a] = t, n = Math.max(r - i, 1e-4), o = Math.max(a - s, 1e-4), h = n * e, l = o * e;
2207
2235
  return [i - h, s - l, r + h, a + l];
2208
2236
  }
2209
- const jc = ([t, e, i, s]) => Math.max(0, i - t) * Math.max(0, s - e);
2210
- function an({ features: t, filter: e, sort: i }) {
2211
- let s = e ? t.filter((a) => nn(e, a)) : [...t];
2212
- const r = on(i);
2237
+ const Dc = ([t, e, i, s]) => Math.max(0, i - t) * Math.max(0, s - e);
2238
+ function nn({ features: t, filter: e, sort: i }) {
2239
+ let s = e ? t.filter((a) => on(e, a)) : [...t];
2240
+ const r = hn(i);
2213
2241
  return r.length > 0 && (s = [...s].sort((a, n) => {
2214
2242
  for (const { field: o, descending: h } of r) {
2215
2243
  const l = tt(a, o), f = tt(n, o);
2216
2244
  if (l == null && f == null) continue;
2217
2245
  if (l == null) return 1;
2218
2246
  if (f == null) return -1;
2219
- const u = hn(l, f);
2247
+ const u = ln(l, f);
2220
2248
  if (u !== 0) return h ? -u : u;
2221
2249
  }
2222
2250
  return 0;
2223
2251
  })), s;
2224
2252
  }
2225
- function nn(t, e) {
2253
+ function on(t, e) {
2226
2254
  try {
2227
2255
  return !!t(e);
2228
2256
  } catch {
2229
2257
  return !1;
2230
2258
  }
2231
2259
  }
2232
- function on(t) {
2260
+ function hn(t) {
2233
2261
  return t ? t.split(",").map((e) => e.trim()).filter(Boolean).map((e) => e.startsWith("-") ? { field: e.slice(1), descending: !0 } : { field: e, descending: !1 }) : [];
2234
2262
  }
2235
- function hn(t, e) {
2263
+ function ln(t, e) {
2236
2264
  return typeof t == "number" && typeof e == "number" ? t - e : String(t).localeCompare(String(e), void 0, { numeric: !0, sensitivity: "base" });
2237
2265
  }
2238
- function ln(t) {
2266
+ function cn(t) {
2239
2267
  const e = t.replace(/[\x00-\x1f<>:"/\\|?*]+/g, "-").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^[-.]+|[-.]+$/g, "").slice(0, 100);
2240
2268
  return e === "" ? "page" : e;
2241
2269
  }
2242
- function cn(t, e, i) {
2270
+ function un(t, e, i) {
2243
2271
  const s = /* @__PURE__ */ new Map();
2244
2272
  return e.map((r, a) => {
2245
- const n = ti(r), o = (t ?? "page-{{atlas.index}}").replace(/\{\{\s*atlas\.([\w]+)\s*\}\}/g, (f, u) => u === "index" ? String(a + 1) : u === "count" ? String(e.length) : n[u] ?? f), h = ln(o), l = s.get(h) ?? 0;
2273
+ const n = ei(r), o = (t ?? "page-{{atlas.index}}").replace(/\{\{\s*atlas\.([\w]+)\s*\}\}/g, (f, u) => u === "index" ? String(a + 1) : u === "count" ? String(e.length) : n[u] ?? f), h = cn(o), l = s.get(h) ?? 0;
2246
2274
  return s.set(h, l + 1), `${l === 0 ? h : `${h}-${l + 1}`}.${i}`;
2247
2275
  });
2248
2276
  }
@@ -2275,13 +2303,13 @@ class ir extends st {
2275
2303
  }
2276
2304
  /** Export filenames, one per page, already de-duplicated. */
2277
2305
  filenames(e = "png") {
2278
- return cn(this.getAttribute("filename"), this.ensurePages(), e);
2306
+ return un(this.getAttribute("filename"), this.ensurePages(), e);
2279
2307
  }
2280
2308
  /** Human page labels, for an editor's stepper and PDF bookmarks. */
2281
2309
  pageName(e) {
2282
2310
  const i = this.ensurePages()[e];
2283
2311
  if (!i) return `Page ${e + 1}`;
2284
- const s = ti(i), r = this.getAttribute("page-name");
2312
+ const s = ei(i), r = this.getAttribute("page-name");
2285
2313
  return r ? r.replace(
2286
2314
  /\{\{\s*atlas\.([\w]+)\s*\}\}/g,
2287
2315
  (a, n) => n === "index" ? String(e + 1) : n === "count" ? String(this.count) : s[n] ?? a
@@ -2299,11 +2327,11 @@ class ir extends st {
2299
2327
  }
2300
2328
  ensurePages() {
2301
2329
  if (this.pages) return this.pages;
2302
- const i = this.frame?.mapElement?.getLayers?.(), s = this.getAttribute("layer"), r = i?.find((o) => o.id === s), a = i ? en(r) : null;
2330
+ const i = this.frame?.mapElement?.getLayers?.(), s = this.getAttribute("layer"), r = i?.find((o) => o.id === s), a = i ? sn(r) : null;
2303
2331
  if (!i || a)
2304
2332
  return this.rejection = i ? a : null, this.pages = [];
2305
2333
  const n = this.materialize(r);
2306
- return this.pages = an({ features: n, filter: this.compileFilter(), sort: this.getAttribute("sort") }), this.currentIndex = Math.min(this.currentIndex, Math.max(0, this.pages.length - 1)), this.pages;
2334
+ return this.pages = nn({ features: n, filter: this.compileFilter(), sort: this.getAttribute("sort") }), this.currentIndex = Math.min(this.currentIndex, Math.max(0, this.pages.length - 1)), this.pages;
2307
2335
  }
2308
2336
  /**
2309
2337
  * Rows from the layer, with the layer's OWN declarative filters applied —
@@ -2311,7 +2339,7 @@ class ir extends st {
2311
2339
  * sheets for features the map itself is hiding.
2312
2340
  */
2313
2341
  materialize(e) {
2314
- const i = Ct(), s = e.data;
2342
+ const i = Mt(), s = e.data;
2315
2343
  if (!s) return [];
2316
2344
  const r = i?.asRows ? i.asRows(s) : Array.isArray(s) ? s : [], a = [e.filter, e.categoryFilter].filter(Boolean);
2317
2345
  return a.length === 0 ? r : r.filter(
@@ -2330,7 +2358,7 @@ class ir extends st {
2330
2358
  compileFilter() {
2331
2359
  const e = this.getAttribute("filter");
2332
2360
  if (!e) return;
2333
- const i = Ct();
2361
+ const i = Mt();
2334
2362
  if (i?.compileExpression)
2335
2363
  try {
2336
2364
  const s = i.compileExpression(e, { shape: "geojson", paramName: "d" });
@@ -2354,12 +2382,12 @@ class ir extends st {
2354
2382
  const i = this.closest("om-cartograph");
2355
2383
  for (const s of i?.querySelectorAll("om-frame") ?? []) {
2356
2384
  if (s.getAttribute("atlas-fit") !== "feature") continue;
2357
- const r = sn(e);
2385
+ const r = rn(e);
2358
2386
  if (!r) continue;
2359
- const a = Number(s.getAttribute("atlas-margin")), n = rn(r, Number.isFinite(a) && a > 0 ? a : 0.15);
2387
+ const a = Number(s.getAttribute("atlas-margin")), n = an(r, Number.isFinite(a) && a > 0 ? a : 0.15);
2360
2388
  s.fitBounds?.(n);
2361
2389
  }
2362
- i?.setAtlasFields({ ...ti(e), index: String(this.currentIndex + 1), count: String(this.count) }), i?.refreshFurniture(), this.dispatchEvent(
2390
+ i?.setAtlasFields({ ...ei(e), index: String(this.currentIndex + 1), count: String(this.count) }), i?.refreshFurniture(), this.dispatchEvent(
2363
2391
  new CustomEvent("om-atlas-page", {
2364
2392
  bubbles: !0,
2365
2393
  detail: { index: this.currentIndex, count: this.count, name: this.pageName(this.currentIndex), feature: e }
@@ -2371,21 +2399,21 @@ class ir extends st {
2371
2399
  }
2372
2400
  }
2373
2401
  q("om-atlas", ir);
2374
- const un = /* @__PURE__ */ new Set(["class", "style", "id", "hidden", "title", "lang", "dir", "slot", "part", "role", "tabindex"]), fn = /* @__PURE__ */ new Set(["style", "script", "img", "template", "om-map"]), mn = ["data-om-carto-credit", "data-om-carto-marks", "data-om-carto-flattened"], dn = /* @__PURE__ */ new Set(["om-text", "om-legend", "om-scalebar", "om-north", "om-shape", "om-image"]), gn = /* @__PURE__ */ new Set(["om-frame", "om-legend", "om-scalebar", "om-north", "om-graticule", "om-text", "om-shape", "om-image"]), Mn = 0.02, vn = (t) => Math.max(0, Number(t.getAttribute("bleed")) || 0);
2402
+ const fn = /* @__PURE__ */ new Set(["class", "style", "id", "hidden", "title", "lang", "dir", "slot", "part", "role", "tabindex"]), mn = /* @__PURE__ */ new Set(["style", "script", "img", "template", "om-map"]), dn = ["data-om-carto-credit", "data-om-carto-marks", "data-om-carto-flattened"], gn = /* @__PURE__ */ new Set(["om-text", "om-legend", "om-scalebar", "om-north", "om-shape", "om-image"]), Mn = /* @__PURE__ */ new Set(["om-frame", "om-legend", "om-scalebar", "om-north", "om-graticule", "om-text", "om-shape", "om-image"]), vn = 0.02, yn = (t) => Math.max(0, Number(t.getAttribute("bleed")) || 0);
2375
2403
  function sr(t) {
2376
2404
  const e = t.tagName.toLowerCase();
2377
2405
  return t.id ? `${e}#${t.id}` : e;
2378
2406
  }
2379
- function St(t, e) {
2407
+ function Et(t, e) {
2380
2408
  const i = t.getAttribute(e);
2381
2409
  if (i == null || i.trim() === "") return null;
2382
2410
  const s = Number(i);
2383
2411
  return Number.isFinite(s) ? s : null;
2384
2412
  }
2385
- function yn(t, e) {
2413
+ function _n(t, e) {
2386
2414
  return t.x < e.x + e.w && e.x < t.x + t.w && t.y < e.y + e.h && e.y < t.y + t.h;
2387
2415
  }
2388
- function _n(t, e) {
2416
+ function bn(t, e) {
2389
2417
  const i = t.getAttribute("style");
2390
2418
  if (!i) return null;
2391
2419
  const s = new RegExp(`(?:^|;)\\s*${e}\\s*:\\s*(-?[\\d.]+)mm`, "i").exec(i);
@@ -2397,45 +2425,45 @@ function rr(t) {
2397
2425
  }, s = [...t.querySelectorAll("om-cartograph")];
2398
2426
  if (s.length === 0 && t.tagName?.toLowerCase() === "om-cartograph" && s.push(t), s.length === 0)
2399
2427
  return { valid: !0, errors: [], warnings: [] };
2400
- for (const n of s) bn(n, i);
2428
+ for (const n of s) pn(n, i);
2401
2429
  const r = e.filter((n) => n.severity === "error"), a = e.filter((n) => n.severity === "warning");
2402
2430
  return { valid: r.length === 0, errors: r, warnings: a };
2403
2431
  }
2404
- function bn(t, e) {
2405
- const i = t.getAttribute("size"), s = St(t, "width") != null && St(t, "height") != null;
2406
- i && !Ti.includes(i) && !s && e(
2432
+ function pn(t, e) {
2433
+ const i = t.getAttribute("size"), s = Et(t, "width") != null && Et(t, "height") != null;
2434
+ i && !Ri.includes(i) && !s && e(
2407
2435
  "error",
2408
2436
  t,
2409
2437
  `Unknown page size "${i}" and no width/height to fall back on.`,
2410
- `Use one of ${Ti.join(", ")}, or give width= and height= in millimetres.`,
2438
+ `Use one of ${Ri.join(", ")}, or give width= and height= in millimetres.`,
2411
2439
  "size"
2412
2440
  );
2413
2441
  const r = t.getAttribute("cvd");
2414
- r && r.trim().toLowerCase() !== "none" && !hi(r) && e("warning", t, `Unknown cvd="${r}" — no simulation applied.`, `Use one of ${jr.join(", ")}.`, "cvd"), t.hasAttribute("crop-marks") && vn(t) <= 0 && e("warning", t, "crop-marks needs bleed to draw into — trim marks sit outside the page box.", 'Add bleed="3" (mm), or drop crop-marks.', "crop-marks");
2415
- const a = St(t, "safe-zone");
2442
+ r && r.trim().toLowerCase() !== "none" && !li(r) && e("warning", t, `Unknown cvd="${r}" — no simulation applied.`, `Use one of ${jr.join(", ")}.`, "cvd"), t.hasAttribute("crop-marks") && yn(t) <= 0 && e("warning", t, "crop-marks needs bleed to draw into — trim marks sit outside the page box.", 'Add bleed="3" (mm), or drop crop-marks.', "crop-marks");
2443
+ const a = Et(t, "safe-zone");
2416
2444
  if (a != null && a > 0) {
2417
2445
  const m = _e(t.getAttribute("size"), t.getAttribute("width"), t.getAttribute("height"), t.getAttribute("orientation"));
2418
2446
  a * 2 >= Math.min(m.widthMm, m.heightMm) && e("warning", t, `safe-zone=${a}mm leaves no usable area on a ${m.widthMm} × ${m.heightMm} mm page.`, "Use a smaller inset — 5–10mm is typical.", "safe-zone");
2419
2447
  }
2420
2448
  const n = t.getAttribute("format");
2421
2449
  n == null ? e("warning", t, "No format= on the cartograph root.", `Add format="${ke}" so future runtimes can migrate this document.`, "format") : n !== ke && e("warning", t, `Unrecognised document format "${n}".`, `This build understands "${ke}".`, "format");
2422
- const { widthMm: o, heightMm: h } = _e(i, t.getAttribute("width"), t.getAttribute("height"), t.getAttribute("orientation")), l = Math.max(0, St(t, "bleed") ?? 0), f = /* @__PURE__ */ new Set(), u = [...t.querySelectorAll("om-frame")];
2450
+ const { widthMm: o, heightMm: h } = _e(i, t.getAttribute("width"), t.getAttribute("height"), t.getAttribute("orientation")), l = Math.max(0, Et(t, "bleed") ?? 0), f = /* @__PURE__ */ new Set(), u = [...t.querySelectorAll("om-frame")];
2423
2451
  for (const m of u)
2424
2452
  m.id ? f.add(m.id) : e("error", m, "Frame has no id.", "Give every frame an id so furniture can reference it with for=.", "id");
2425
2453
  for (const m of t.children) {
2426
- if (mn.some((g) => m.hasAttribute(g))) continue;
2454
+ if (dn.some((g) => m.hasAttribute(g))) continue;
2427
2455
  const d = m.tagName.toLowerCase();
2428
- !$e.includes(d) && !fn.has(d) && e("error", m, `<${d}> is not a cartograph element.`, `Use one of ${$e.join(", ")}, or move this content inside an <om-text>.`);
2456
+ !$e.includes(d) && !mn.has(d) && e("error", m, `<${d}> is not a cartograph element.`, `Use one of ${$e.join(", ")}, or move this content inside an <om-text>.`);
2429
2457
  }
2430
2458
  const c = [];
2431
2459
  for (const m of [t, ...t.querySelectorAll("*")]) {
2432
2460
  const d = m.tagName.toLowerCase();
2433
2461
  if ($e.includes(d) && !m.closest("om-map")) {
2434
- if (pn(m, d, e), gn.has(d)) {
2435
- const g = L(m);
2436
- wn(m, g, o, h, l, e), dn.has(d) && !m.hasAttribute("hidden") && c.push({ el: m, box: g });
2462
+ if (wn(m, d, e), Mn.has(d)) {
2463
+ const g = $(m);
2464
+ Sn(m, g, o, h, l, e), gn.has(d) && !m.hasAttribute("hidden") && c.push({ el: m, box: g });
2437
2465
  }
2438
- d === "om-frame" && Sn(m, e), d === "om-legend" && En(m, u, e), d === "om-atlas" && xn(m, u, e), d === "om-scalebar" && An(m, u, e), d === "om-text" && Pn(m, u, e);
2466
+ d === "om-frame" && En(m, e), d === "om-legend" && xn(m, u, e), d === "om-atlas" && Pn(m, u, e), d === "om-scalebar" && An(m, u, e), d === "om-text" && Gn(m, u, e);
2439
2467
  for (const g of ["for", "overview-of"]) {
2440
2468
  const M = m.getAttribute(g);
2441
2469
  M && !f.has(M) && e("error", m, `${g}="${M}" references no frame on this page.`, `Point it at one of: ${[...f].join(", ") || "(no frames)"}.`, g);
@@ -2445,7 +2473,7 @@ function bn(t, e) {
2445
2473
  for (let m = 0; m < c.length; m++)
2446
2474
  for (let d = m + 1; d < c.length; d++) {
2447
2475
  const g = c[m], M = c[d];
2448
- g.box.w <= 0 || g.box.h <= 0 || M.box.w <= 0 || M.box.h <= 0 || yn(g.box, M.box) && e(
2476
+ g.box.w <= 0 || g.box.h <= 0 || M.box.w <= 0 || M.box.h <= 0 || _n(g.box, M.box) && e(
2449
2477
  "warning",
2450
2478
  g.el,
2451
2479
  `Overlaps ${sr(M.el)} on the page.`,
@@ -2453,11 +2481,11 @@ function bn(t, e) {
2453
2481
  );
2454
2482
  }
2455
2483
  }
2456
- function pn(t, e, i) {
2484
+ function wn(t, e, i) {
2457
2485
  const s = new Set(J[e] ?? []);
2458
2486
  for (const r of t.attributes) {
2459
2487
  const a = r.name.toLowerCase();
2460
- if (s.has(a) || un.has(a) || a.startsWith("data-") || a.startsWith("aria-")) continue;
2488
+ if (s.has(a) || fn.has(a) || a.startsWith("data-") || a.startsWith("aria-")) continue;
2461
2489
  const n = ea.get(a);
2462
2490
  if (n) {
2463
2491
  i("warning", t, `Attribute "${a}" has no effect: ${n}`, "Remove it, or use the documented alternative.", a);
@@ -2466,7 +2494,7 @@ function pn(t, e, i) {
2466
2494
  i("warning", t, `Unknown attribute "${a}" on <${e}> — likely a typo.`, `Valid attributes: ${[...s].join(", ")}.`, a);
2467
2495
  }
2468
2496
  }
2469
- function wn(t, e, i, s, r, a) {
2497
+ function Sn(t, e, i, s, r, a) {
2470
2498
  if (e.w <= 0 || e.h <= 0) {
2471
2499
  a("error", t, `Element has no size (w=${e.w}, h=${e.h}).`, "Give w= and h= in millimetres — both greater than zero.", e.w <= 0 ? "w" : "h");
2472
2500
  return;
@@ -2485,7 +2513,7 @@ function wn(t, e, i, s, r, a) {
2485
2513
  ["height", e.h]
2486
2514
  ];
2487
2515
  for (const [f, u] of l) {
2488
- const c = _n(t, f);
2516
+ const c = bn(t, f);
2489
2517
  c != null && Math.abs(c - u) > 0.01 && a(
2490
2518
  "error",
2491
2519
  t,
@@ -2495,7 +2523,7 @@ function wn(t, e, i, s, r, a) {
2495
2523
  );
2496
2524
  }
2497
2525
  }
2498
- function Sn(t, e) {
2526
+ function En(t, e) {
2499
2527
  if ((t.getAttribute("mode") === "static" ? "static" : "live") === "static") {
2500
2528
  const s = t.getAttribute("corners"), r = we(s);
2501
2529
  r || e(
@@ -2505,14 +2533,14 @@ function Sn(t, e) {
2505
2533
  'Give four lon/lat pairs in tl, tr, br, bl order — corners="[[lng,lat],[lng,lat],[lng,lat],[lng,lat]]".',
2506
2534
  "corners"
2507
2535
  ), t.querySelector(":scope > img") || e("error", t, "Static frame has no <img> child to place.", "Add the georeferenced raster as an <img> child — it is also what renders with JavaScript disabled.");
2508
- const a = L(t), n = Tt(t.getAttribute("crs"));
2536
+ const a = $(t), n = Tt(t.getAttribute("crs"));
2509
2537
  if (r && n && a.w > 0 && a.h > 0) {
2510
2538
  const o = pe({ corners: r, widthMm: a.w, heightMm: a.h, crsForward: n });
2511
2539
  if (o.degenerate)
2512
2540
  e("error", t, "Frame corners are degenerate (collinear or coincident) — nothing can be placed on this frame.", "Check the corner order: tl, tr, br, bl.", "corners");
2513
2541
  else {
2514
2542
  const h = Ca(o);
2515
- h != null && h > Mn && e(
2543
+ h != null && h > vn && e(
2516
2544
  "warning",
2517
2545
  t,
2518
2546
  `Ground scale varies ${(h * 100).toFixed(1)}% across this frame, so a single scale bar is only true near its anchor.`,
@@ -2521,7 +2549,7 @@ function Sn(t, e) {
2521
2549
  }
2522
2550
  }
2523
2551
  } else {
2524
- de(t) || e(
2552
+ qt(t) || e(
2525
2553
  "error",
2526
2554
  t,
2527
2555
  "Live frame has no valid camera.",
@@ -2540,12 +2568,12 @@ function Sn(t, e) {
2540
2568
  s && s !== "EPSG:3857" && e("error", t, `Live frame declares ${s}, but live frames render EPSG:3857.`, 'Use mode="static" with a georeferenced raster for other projections.', "crs");
2541
2569
  }
2542
2570
  }
2543
- function ui(t, e) {
2571
+ function fi(t, e) {
2544
2572
  const i = t.getAttribute("for");
2545
2573
  return i ? e.find((s) => s.id === i) : e.length === 1 ? e[0] : void 0;
2546
2574
  }
2547
- function En(t, e, i) {
2548
- const s = t.getAttribute("derived") !== "false", r = ui(t, e);
2575
+ function xn(t, e, i) {
2576
+ const s = t.getAttribute("derived") !== "false", r = fi(t, e);
2549
2577
  s && r?.getAttribute("mode") === "static" && i(
2550
2578
  "warning",
2551
2579
  t,
@@ -2566,10 +2594,10 @@ function En(t, e, i) {
2566
2594
  );
2567
2595
  }
2568
2596
  }
2569
- function xn(t, e, i) {
2597
+ function Pn(t, e, i) {
2570
2598
  const s = t.getAttribute("layer");
2571
2599
  s || i("error", t, "Atlas has no layer= to iterate.", 'Name a layer inside the frame, e.g. layer="parcels".', "layer");
2572
- const r = t.getAttribute("for"), a = ui(t, e);
2600
+ const r = t.getAttribute("for"), a = fi(t, e);
2573
2601
  if (!a) {
2574
2602
  !r && e.length !== 1 && i("error", t, `Atlas does not say which frame drives it, and the page has ${e.length} frames.`, 'Add for="<frame id>".', "for");
2575
2603
  return;
@@ -2602,16 +2630,16 @@ function xn(t, e, i) {
2602
2630
  }
2603
2631
  }
2604
2632
  function An(t, e, i) {
2605
- const s = St(t, "segment-length");
2633
+ const s = Et(t, "segment-length");
2606
2634
  if (s == null) return;
2607
- const r = ui(t, e);
2635
+ const r = fi(t, e);
2608
2636
  if (!r) return;
2609
- const a = we(r.getAttribute("corners")), n = Tt(r.getAttribute("crs")), o = L(r);
2637
+ const a = we(r.getAttribute("corners")), n = Tt(r.getAttribute("crs")), o = $(r);
2610
2638
  if (!a || !n || o.w <= 0 || o.h <= 0) return;
2611
- const h = pe({ corners: a, widthMm: o.w, heightMm: o.h, crsForward: n }), l = L(t), f = Ls({
2639
+ const h = pe({ corners: a, widthMm: o.w, heightMm: o.h, crsForward: n }), l = $(t), f = Ls({
2612
2640
  groundMetersPerMm: h.groundMetersPerMm(),
2613
2641
  maxWidthMm: l.w,
2614
- segments: St(t, "segments") ?? void 0,
2642
+ segments: Et(t, "segments") ?? void 0,
2615
2643
  segmentLengthMeters: s
2616
2644
  });
2617
2645
  f && f.totalMm > l.w + 1e-6 && i(
@@ -2622,7 +2650,7 @@ function An(t, e, i) {
2622
2650
  "segment-length"
2623
2651
  );
2624
2652
  }
2625
- function Pn(t, e, i) {
2653
+ function Gn(t, e, i) {
2626
2654
  const s = t.textContent ?? "", r = /* @__PURE__ */ new Set(["title", "attribution", "date", "notes", "scale", "crs"]), a = new Set(e.map((n) => n.id).filter(Boolean));
2627
2655
  for (const n of ua(s))
2628
2656
  if (!n.startsWith("atlas.")) {
@@ -2643,10 +2671,10 @@ function Pn(t, e, i) {
2643
2671
  r.has(n) || i("warning", t, `Unknown token {{${n}}} — it will render literally.`, `Known tokens: ${[...r].join(", ")}, frame.<id>.scale, frame.<id>.crs, atlas.<field>.`);
2644
2672
  }
2645
2673
  }
2646
- function Dc(t) {
2674
+ function zc(t) {
2647
2675
  return rr(ta(t));
2648
2676
  }
2649
- async function zc(t) {
2677
+ async function Bc(t) {
2650
2678
  const e = rr(t), i = [...t.querySelectorAll("om-frame")].filter((o) => o.querySelector(":scope > om-map"));
2651
2679
  if (i.length === 0) return e;
2652
2680
  const { loadCore: s } = await Promise.resolve().then(() => Or), r = await s(), a = [...e.errors], n = [...e.warnings];
@@ -2657,20 +2685,20 @@ async function zc(t) {
2657
2685
  }
2658
2686
  return { valid: a.length === 0, errors: a, warnings: n };
2659
2687
  }
2660
- function Bc() {
2688
+ function Wc() {
2661
2689
  q("om-cartograph", Ds), q("om-text", zs), q("om-frame", Vs), q("om-scalebar", Ks), q("om-north", Xs), q("om-shape", Qs), q("om-image", Js), q("om-legend", Zs), q("om-graticule", er), q("om-atlas", ir);
2662
2690
  }
2663
- Ps(() => import(/* webpackIgnore: true */ /* @vite-ignore */
2691
+ As(() => import(/* webpackIgnore: true */ /* @vite-ignore */
2664
2692
  new URL("./onlymap.standalone.js", import.meta.url).href
2665
2693
  ));
2666
2694
  Yr();
2667
- function Gn(t) {
2695
+ function Nn(t) {
2668
2696
  t("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), t("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), t("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
2669
2697
  for (var e = 1; e <= 60; ++e)
2670
2698
  t("EPSG:" + (32600 + e), "+proj=utm +zone=" + e + " +datum=WGS84 +units=m"), t("EPSG:" + (32700 + e), "+proj=utm +zone=" + e + " +south +datum=WGS84 +units=m");
2671
2699
  t("EPSG:5041", "+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"), t("EPSG:5042", "+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"), t.WGS84 = t["EPSG:4326"], t["EPSG:3785"] = t["EPSG:3857"], t.GOOGLE = t["EPSG:3857"], t["EPSG:900913"] = t["EPSG:3857"], t["EPSG:102113"] = t["EPSG:3857"];
2672
2700
  }
2673
- var vt = 1, yt = 2, Gt = 3, Nn = 4, ei = 5, as = 6378137, Cn = 6356752314e-3, ns = 0.0066943799901413165, Dt = 484813681109536e-20, y = Math.PI / 2, In = 0.16666666666666666, Tn = 0.04722222222222222, Rn = 0.022156084656084655, p = 1e-10, $ = 0.017453292519943295, H = 57.29577951308232, I = Math.PI / 4, Vt = Math.PI * 2, O = 3.14159265359, V = {};
2701
+ var _t = 1, bt = 2, Nt = 3, Cn = 4, ii = 5, as = 6378137, In = 6356752314e-3, ns = 0.0066943799901413165, zt = 484813681109536e-20, y = Math.PI / 2, Tn = 0.16666666666666666, Rn = 0.04722222222222222, kn = 0.022156084656084655, p = 1e-10, L = 0.017453292519943295, H = 57.29577951308232, I = Math.PI / 4, Kt = Math.PI * 2, O = 3.14159265359, V = {};
2674
2702
  V.greenwich = 0;
2675
2703
  V.lisbon = -9.131906111111;
2676
2704
  V.paris = 2.337229166667;
@@ -2684,7 +2712,7 @@ V.brussels = 4.367975;
2684
2712
  V.stockholm = 18.058277777778;
2685
2713
  V.athens = 23.7163375;
2686
2714
  V.oslo = 10.722916666667;
2687
- const kn = {
2715
+ const $n = {
2688
2716
  mm: { to_meter: 1e-3 },
2689
2717
  cm: { to_meter: 0.01 },
2690
2718
  ft: { to_meter: 0.3048 },
@@ -2707,14 +2735,14 @@ const kn = {
2707
2735
  "us-yd": { to_meter: 0.914401828803658 }
2708
2736
  };
2709
2737
  var os = /[\s_\-\/\(\)]/g;
2710
- function ct(t, e) {
2738
+ function ut(t, e) {
2711
2739
  if (t[e])
2712
2740
  return t[e];
2713
2741
  for (var i = Object.keys(t), s = e.toLowerCase().replace(os, ""), r = -1, a, n; ++r < i.length; )
2714
2742
  if (a = i[r], n = a.toLowerCase().replace(os, ""), n === s)
2715
2743
  return t[a];
2716
2744
  }
2717
- function ii(t) {
2745
+ function si(t) {
2718
2746
  var e = {}, i = t.split("+").map(function(o) {
2719
2747
  return o.trim();
2720
2748
  }).filter(function(o) {
@@ -2729,34 +2757,34 @@ function ii(t) {
2729
2757
  e.rf = parseFloat(o);
2730
2758
  },
2731
2759
  lat_0: function(o) {
2732
- e.lat0 = o * $;
2760
+ e.lat0 = o * L;
2733
2761
  },
2734
2762
  lat_1: function(o) {
2735
- e.lat1 = o * $;
2763
+ e.lat1 = o * L;
2736
2764
  },
2737
2765
  lat_2: function(o) {
2738
- e.lat2 = o * $;
2766
+ e.lat2 = o * L;
2739
2767
  },
2740
2768
  lat_ts: function(o) {
2741
- e.lat_ts = o * $;
2769
+ e.lat_ts = o * L;
2742
2770
  },
2743
2771
  lon_0: function(o) {
2744
- e.long0 = o * $;
2772
+ e.long0 = o * L;
2745
2773
  },
2746
2774
  lon_1: function(o) {
2747
- e.long1 = o * $;
2775
+ e.long1 = o * L;
2748
2776
  },
2749
2777
  lon_2: function(o) {
2750
- e.long2 = o * $;
2778
+ e.long2 = o * L;
2751
2779
  },
2752
2780
  alpha: function(o) {
2753
- e.alpha = parseFloat(o) * $;
2781
+ e.alpha = parseFloat(o) * L;
2754
2782
  },
2755
2783
  gamma: function(o) {
2756
- e.rectified_grid_angle = parseFloat(o) * $;
2784
+ e.rectified_grid_angle = parseFloat(o) * L;
2757
2785
  },
2758
2786
  lonc: function(o) {
2759
- e.longc = o * $;
2787
+ e.longc = o * L;
2760
2788
  },
2761
2789
  x_0: function(o) {
2762
2790
  e.x0 = parseFloat(o);
@@ -2798,15 +2826,15 @@ function ii(t) {
2798
2826
  },
2799
2827
  units: function(o) {
2800
2828
  e.units = o;
2801
- var h = ct(kn, o);
2829
+ var h = ut($n, o);
2802
2830
  h && (e.to_meter = h.to_meter);
2803
2831
  },
2804
2832
  from_greenwich: function(o) {
2805
- e.from_greenwich = o * $;
2833
+ e.from_greenwich = o * L;
2806
2834
  },
2807
2835
  pm: function(o) {
2808
- var h = ct(V, o);
2809
- e.from_greenwich = (h || parseFloat(o)) * $;
2836
+ var h = ut(V, o);
2837
+ e.from_greenwich = (h || parseFloat(o)) * L;
2810
2838
  },
2811
2839
  nadgrids: function(o) {
2812
2840
  o === "@null" ? e.datumCode = "none" : e.nadgrids = o;
@@ -2996,12 +3024,12 @@ class ar {
2996
3024
  return i;
2997
3025
  }
2998
3026
  }
2999
- class $n extends ar {
3027
+ class Ln extends ar {
3000
3028
  static convert(e, i = {}) {
3001
3029
  return super.convert(e, i), i.coordinate_system && i.coordinate_system.subtype === "Cartesian" && delete i.coordinate_system, i.usage && delete i.usage, i;
3002
3030
  }
3003
3031
  }
3004
- class Ln extends ar {
3032
+ class On extends ar {
3005
3033
  static convert(e, i = {}) {
3006
3034
  super.convert(e, i);
3007
3035
  const s = e.find((a) => Array.isArray(a) && a[0] === "CS");
@@ -3017,32 +3045,32 @@ class Ln extends ar {
3017
3045
  return i;
3018
3046
  }
3019
3047
  }
3020
- function On(t) {
3021
- return t.find((e) => Array.isArray(e) && e[0] === "USAGE") ? "2019" : (t.find((e) => Array.isArray(e) && e[0] === "CS") || t[0] === "BOUNDCRS" || t[0] === "PROJCRS" || t[0] === "GEOGCRS", "2015");
3022
- }
3023
3048
  function Fn(t) {
3024
- return (On(t) === "2019" ? Ln : $n).convert(t);
3049
+ return t.find((e) => Array.isArray(e) && e[0] === "USAGE") ? "2019" : (t.find((e) => Array.isArray(e) && e[0] === "CS") || t[0] === "BOUNDCRS" || t[0] === "PROJCRS" || t[0] === "GEOGCRS", "2015");
3025
3050
  }
3026
3051
  function qn(t) {
3052
+ return (Fn(t) === "2019" ? On : Ln).convert(t);
3053
+ }
3054
+ function Un(t) {
3027
3055
  const e = t.toUpperCase();
3028
3056
  return e.includes("PROJCRS") || e.includes("GEOGCRS") || e.includes("BOUNDCRS") || e.includes("VERTCRS") || e.includes("LENGTHUNIT") || e.includes("ANGLEUNIT") || e.includes("SCALEUNIT") ? "WKT2" : (e.includes("PROJCS") || e.includes("GEOGCS") || e.includes("LOCAL_CS") || e.includes("VERT_CS") || e.includes("UNIT"), "WKT1");
3029
3057
  }
3030
- var Kt = 1, nr = 2, or = 3, Se = 4, hr = 5, fi = -1, Un = /\s/, jn = /[A-Za-z]/, Dn = /[A-Za-z84_]/, Te = /[,\]]/, lr = /[\d\.E\-\+]/;
3058
+ var Xt = 1, nr = 2, or = 3, Se = 4, hr = 5, mi = -1, jn = /\s/, Dn = /[A-Za-z]/, zn = /[A-Za-z84_]/, Te = /[,\]]/, lr = /[\d\.E\-\+]/;
3031
3059
  function at(t) {
3032
3060
  if (typeof t != "string")
3033
3061
  throw new Error("not a string");
3034
- this.text = t.trim(), this.level = 0, this.place = 0, this.root = null, this.stack = [], this.currentObject = null, this.state = Kt;
3062
+ this.text = t.trim(), this.level = 0, this.place = 0, this.root = null, this.stack = [], this.currentObject = null, this.state = Xt;
3035
3063
  }
3036
3064
  at.prototype.readCharicter = function() {
3037
3065
  var t = this.text[this.place++];
3038
3066
  if (this.state !== Se)
3039
- for (; Un.test(t); ) {
3067
+ for (; jn.test(t); ) {
3040
3068
  if (this.place >= this.text.length)
3041
3069
  return;
3042
3070
  t = this.text[this.place++];
3043
3071
  }
3044
3072
  switch (this.state) {
3045
- case Kt:
3073
+ case Xt:
3046
3074
  return this.neutral(t);
3047
3075
  case nr:
3048
3076
  return this.keyword(t);
@@ -3052,7 +3080,7 @@ at.prototype.readCharicter = function() {
3052
3080
  return this.afterquote(t);
3053
3081
  case or:
3054
3082
  return this.number(t);
3055
- case fi:
3083
+ case mi:
3056
3084
  return;
3057
3085
  }
3058
3086
  };
@@ -3069,11 +3097,11 @@ at.prototype.afterquote = function(t) {
3069
3097
  };
3070
3098
  at.prototype.afterItem = function(t) {
3071
3099
  if (t === ",") {
3072
- this.word !== null && this.currentObject.push(this.word), this.word = null, this.state = Kt;
3100
+ this.word !== null && this.currentObject.push(this.word), this.word = null, this.state = Xt;
3073
3101
  return;
3074
3102
  }
3075
3103
  if (t === "]") {
3076
- this.level--, this.word !== null && (this.currentObject.push(this.word), this.word = null), this.state = Kt, this.currentObject = this.stack.pop(), this.currentObject || (this.state = fi);
3104
+ this.level--, this.word !== null && (this.currentObject.push(this.word), this.word = null), this.state = Xt, this.currentObject = this.stack.pop(), this.currentObject || (this.state = mi);
3077
3105
  return;
3078
3106
  }
3079
3107
  };
@@ -3096,13 +3124,13 @@ at.prototype.quoted = function(t) {
3096
3124
  this.word += t;
3097
3125
  };
3098
3126
  at.prototype.keyword = function(t) {
3099
- if (Dn.test(t)) {
3127
+ if (zn.test(t)) {
3100
3128
  this.word += t;
3101
3129
  return;
3102
3130
  }
3103
3131
  if (t === "[") {
3104
3132
  var e = [];
3105
- e.push(this.word), this.level++, this.root === null ? this.root = e : this.currentObject.push(e), this.stack.push(this.currentObject), this.currentObject = e, this.state = Kt;
3133
+ e.push(this.word), this.level++, this.root === null ? this.root = e : this.currentObject.push(e), this.stack.push(this.currentObject), this.currentObject = e, this.state = Xt;
3106
3134
  return;
3107
3135
  }
3108
3136
  if (Te.test(t)) {
@@ -3112,7 +3140,7 @@ at.prototype.keyword = function(t) {
3112
3140
  throw new Error(`havn't handled "` + t + '" in keyword yet, index ' + this.place);
3113
3141
  };
3114
3142
  at.prototype.neutral = function(t) {
3115
- if (jn.test(t)) {
3143
+ if (Dn.test(t)) {
3116
3144
  this.word = t, this.state = nr;
3117
3145
  return;
3118
3146
  }
@@ -3133,22 +3161,22 @@ at.prototype.neutral = function(t) {
3133
3161
  at.prototype.output = function() {
3134
3162
  for (; this.place < this.text.length; )
3135
3163
  this.readCharicter();
3136
- if (this.state === fi)
3164
+ if (this.state === mi)
3137
3165
  return this.root;
3138
3166
  throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
3139
3167
  };
3140
- function zn(t) {
3168
+ function Bn(t) {
3141
3169
  var e = new at(t);
3142
3170
  return e.output();
3143
3171
  }
3144
3172
  function We(t, e, i) {
3145
3173
  Array.isArray(e) && (i.unshift(e), e = null);
3146
3174
  var s = e ? {} : t, r = i.reduce(function(a, n) {
3147
- return Et(n, a), a;
3175
+ return xt(n, a), a;
3148
3176
  }, s);
3149
3177
  e && (t[e] = r);
3150
3178
  }
3151
- function Et(t, e) {
3179
+ function xt(t, e) {
3152
3180
  if (!Array.isArray(t)) {
3153
3181
  e[t] = !0;
3154
3182
  return;
@@ -3156,7 +3184,7 @@ function Et(t, e) {
3156
3184
  var i = t.shift();
3157
3185
  if (i === "PARAMETER" && (i = t.shift()), t.length === 1) {
3158
3186
  if (Array.isArray(t[0])) {
3159
- e[i] = {}, Et(t[0], e[i]);
3187
+ e[i] = {}, xt(t[0], e[i]);
3160
3188
  return;
3161
3189
  }
3162
3190
  e[i] = t[0];
@@ -3183,7 +3211,7 @@ function Et(t, e) {
3183
3211
  e[i] = {
3184
3212
  name: t[0].toLowerCase(),
3185
3213
  convert: t[1]
3186
- }, t.length === 3 && Et(t[2], e[i]);
3214
+ }, t.length === 3 && xt(t[2], e[i]);
3187
3215
  return;
3188
3216
  case "SPHEROID":
3189
3217
  case "ELLIPSOID":
@@ -3191,7 +3219,7 @@ function Et(t, e) {
3191
3219
  name: t[0],
3192
3220
  a: t[1],
3193
3221
  rf: t[2]
3194
- }, t.length === 4 && Et(t[3], e[i]);
3222
+ }, t.length === 4 && xt(t[3], e[i]);
3195
3223
  return;
3196
3224
  case "EDATUM":
3197
3225
  case "ENGINEERINGDATUM":
@@ -3223,13 +3251,13 @@ function Et(t, e) {
3223
3251
  default:
3224
3252
  for (s = -1; ++s < t.length; )
3225
3253
  if (!Array.isArray(t[s]))
3226
- return Et(t, e[i]);
3254
+ return xt(t, e[i]);
3227
3255
  return We(e, i, t);
3228
3256
  }
3229
3257
  }
3230
- var Bn = 0.017453292519943295;
3258
+ var Wn = 0.017453292519943295;
3231
3259
  function K(t) {
3232
- return t * Bn;
3260
+ return t * Wn;
3233
3261
  }
3234
3262
  function cr(t) {
3235
3263
  const e = (t.projName || "").toLowerCase().replace(/_/g, " ");
@@ -3308,7 +3336,7 @@ function Ee(t, e = {}) {
3308
3336
  }
3309
3337
  }), e.latitude_of_false_origin !== void 0 && (e.lat0 = e.latitude_of_false_origin), e.longitude_of_false_origin !== void 0 && (e.long0 = e.longitude_of_false_origin), e.latitude_of_standard_parallel !== void 0 && (e.lat0 = e.latitude_of_standard_parallel, e.lat1 = e.latitude_of_standard_parallel), e.latitude_of_1st_standard_parallel !== void 0 && (e.lat1 = e.latitude_of_1st_standard_parallel), e.latitude_of_2nd_standard_parallel !== void 0 && (e.lat2 = e.latitude_of_2nd_standard_parallel), e.latitude_of_projection_centre !== void 0 && (e.lat0 = e.latitude_of_projection_centre), e.longitude_of_projection_centre !== void 0 && (e.longc = e.longitude_of_projection_centre), e.easting_at_false_origin !== void 0 && (e.x0 = e.easting_at_false_origin), e.northing_at_false_origin !== void 0 && (e.y0 = e.northing_at_false_origin), e.latitude_of_natural_origin !== void 0 && (e.lat0 = e.latitude_of_natural_origin), e.longitude_of_natural_origin !== void 0 && (e.long0 = e.longitude_of_natural_origin), e.longitude_of_origin !== void 0 && (e.long0 = e.longitude_of_origin), e.false_easting !== void 0 && (e.x0 = e.false_easting), e.easting_at_projection_centre && (e.x0 = e.easting_at_projection_centre), e.false_northing !== void 0 && (e.y0 = e.false_northing), e.northing_at_projection_centre && (e.y0 = e.northing_at_projection_centre), e.standard_parallel_1 !== void 0 && (e.lat1 = e.standard_parallel_1), e.standard_parallel_2 !== void 0 && (e.lat2 = e.standard_parallel_2), e.scale_factor_at_natural_origin !== void 0 && (e.k0 = e.scale_factor_at_natural_origin), e.scale_factor_at_projection_centre !== void 0 && (e.k0 = e.scale_factor_at_projection_centre), e.scale_factor_on_pseudo_standard_parallel !== void 0 && (e.k0 = e.scale_factor_on_pseudo_standard_parallel), e.azimuth !== void 0 && (e.alpha = e.azimuth), e.azimuth_at_projection_centre !== void 0 && (e.alpha = e.azimuth_at_projection_centre), e.angle_from_rectified_to_skew_grid && (e.rectified_grid_angle = e.angle_from_rectified_to_skew_grid), cr(e), e);
3310
3338
  }
3311
- var Wn = [
3339
+ var Hn = [
3312
3340
  "PROJECTEDCRS",
3313
3341
  "PROJCRS",
3314
3342
  "GEOGCS",
@@ -3321,17 +3349,17 @@ var Wn = [
3321
3349
  "ENGCRS",
3322
3350
  "ENGINEERINGCRS"
3323
3351
  ];
3324
- function Hn(t, e) {
3352
+ function Vn(t, e) {
3325
3353
  var i = e[0], s = e[1];
3326
3354
  !(i in t) && s in t && (t[i] = t[s], e.length === 3 && (t[i] = e[2](t[i])));
3327
3355
  }
3328
3356
  function ur(t) {
3329
3357
  for (var e = Object.keys(t), i = 0, s = e.length; i < s; ++i) {
3330
3358
  var r = e[i];
3331
- Wn.indexOf(r) !== -1 && Vn(t[r]), typeof t[r] == "object" && ur(t[r]);
3359
+ Hn.indexOf(r) !== -1 && Kn(t[r]), typeof t[r] == "object" && ur(t[r]);
3332
3360
  }
3333
3361
  }
3334
- function Vn(t) {
3362
+ function Kn(t) {
3335
3363
  if (t.AUTHORITY) {
3336
3364
  var e = Object.keys(t.AUTHORITY)[0];
3337
3365
  e && e in t.AUTHORITY && (t.title = e + ":" + t.AUTHORITY[e]);
@@ -3351,7 +3379,7 @@ function Vn(t) {
3351
3379
  return f * u;
3352
3380
  }
3353
3381
  var h = function(f) {
3354
- return Hn(t, f);
3382
+ return Vn(t, f);
3355
3383
  }, l = [
3356
3384
  ["standard_parallel_1", "Standard_Parallel_1"],
3357
3385
  ["standard_parallel_1", "Latitude of 1st standard parallel"],
@@ -3394,14 +3422,14 @@ function Vn(t) {
3394
3422
  function xe(t) {
3395
3423
  if (typeof t == "object")
3396
3424
  return Ee(t);
3397
- const e = qn(t);
3398
- var i = zn(t);
3425
+ const e = Un(t);
3426
+ var i = Bn(t);
3399
3427
  if (e === "WKT2") {
3400
- const a = Fn(i);
3428
+ const a = qn(i);
3401
3429
  return Ee(a);
3402
3430
  }
3403
3431
  var s = i[0], r = {};
3404
- return Et(i, r), ur(r), r[s];
3432
+ return xt(i, r), ur(r), r[s];
3405
3433
  }
3406
3434
  function j(t) {
3407
3435
  var e = this;
@@ -3410,7 +3438,7 @@ function j(t) {
3410
3438
  typeof i == "string" ? i.charAt(0) === "+" ? j[
3411
3439
  /** @type {string} */
3412
3440
  t
3413
- ] = ii(arguments[1]) : j[
3441
+ ] = si(arguments[1]) : j[
3414
3442
  /** @type {string} */
3415
3443
  t
3416
3444
  ] = xe(arguments[1]) : i && typeof i == "object" && !("projName" in i) ? j[
@@ -3435,46 +3463,46 @@ function j(t) {
3435
3463
  return;
3436
3464
  }
3437
3465
  }
3438
- Gn(j);
3439
- function Kn(t) {
3466
+ Nn(j);
3467
+ function Xn(t) {
3440
3468
  return typeof t == "string";
3441
3469
  }
3442
- function Xn(t) {
3470
+ function Qn(t) {
3443
3471
  return t in j;
3444
3472
  }
3445
- function Qn(t) {
3473
+ function Jn(t) {
3446
3474
  return t.indexOf("+") !== 0 && t.indexOf("[") !== -1 || typeof t == "object" && !("srsCode" in t);
3447
3475
  }
3448
3476
  var us = ["3857", "900913", "3785", "102113"];
3449
- function Jn(t) {
3477
+ function Yn(t) {
3450
3478
  if (t.title)
3451
3479
  return t.title.toLowerCase().indexOf("epsg:") === 0 && us.indexOf(t.title.substr(5)) > -1;
3452
- var e = ct(t, "authority");
3480
+ var e = ut(t, "authority");
3453
3481
  if (e) {
3454
- var i = ct(e, "epsg");
3482
+ var i = ut(e, "epsg");
3455
3483
  return i && us.indexOf(i) > -1;
3456
3484
  }
3457
3485
  }
3458
- function Yn(t) {
3459
- var e = ct(t, "extension");
3486
+ function Zn(t) {
3487
+ var e = ut(t, "extension");
3460
3488
  if (e)
3461
- return ct(e, "proj4");
3489
+ return ut(e, "proj4");
3462
3490
  }
3463
- function Zn(t) {
3491
+ function to(t) {
3464
3492
  return t[0] === "+";
3465
3493
  }
3466
- function to(t) {
3494
+ function eo(t) {
3467
3495
  let e;
3468
- if (Kn(t))
3469
- if (Xn(t))
3496
+ if (Xn(t))
3497
+ if (Qn(t))
3470
3498
  e = j[t];
3471
- else if (Qn(t)) {
3499
+ else if (Jn(t)) {
3472
3500
  e = xe(t);
3473
- var i = Yn(e);
3474
- i && (e = ii(i));
3475
- } else Zn(t) && (e = ii(t));
3501
+ var i = Zn(e);
3502
+ i && (e = si(i));
3503
+ } else to(t) && (e = si(t));
3476
3504
  else "projName" in t ? e = t : e = xe(t);
3477
- return e && Jn(e) ? j["EPSG:3857"] : e;
3505
+ return e && Yn(e) ? j["EPSG:3857"] : e;
3478
3506
  }
3479
3507
  function fs(t, e) {
3480
3508
  t = t || {};
@@ -3489,27 +3517,27 @@ function it(t, e, i) {
3489
3517
  var s = t * e;
3490
3518
  return i / Math.sqrt(1 - s * s);
3491
3519
  }
3492
- function Jt(t) {
3520
+ function Yt(t) {
3493
3521
  return t < 0 ? -1 : 1;
3494
3522
  }
3495
3523
  function w(t, e) {
3496
- return e || Math.abs(t) <= O ? t : t - Jt(t) * Vt;
3524
+ return e || Math.abs(t) <= O ? t : t - Yt(t) * Kt;
3497
3525
  }
3498
3526
  function Z(t, e, i) {
3499
3527
  var s = t * i, r = 0.5 * t;
3500
3528
  return s = Math.pow((1 - s) / (1 + s), r), Math.tan(0.5 * (y - e)) / s;
3501
3529
  }
3502
- function Xt(t, e) {
3530
+ function Qt(t, e) {
3503
3531
  for (var i = 0.5 * t, s, r, a = y - 2 * Math.atan(e), n = 0; n <= 15; n++)
3504
3532
  if (s = t * Math.sin(a), r = y - 2 * Math.atan(e * Math.pow((1 - s) / (1 + s), i)) - a, a += r, Math.abs(r) <= 1e-10)
3505
3533
  return a;
3506
3534
  return -9999;
3507
3535
  }
3508
- function eo() {
3536
+ function io() {
3509
3537
  var t = this.b / this.a;
3510
3538
  this.es = 1 - t * t, "x0" in this || (this.x0 = 0), "y0" in this || (this.y0 = 0), this.e = Math.sqrt(this.es), this.lat_ts ? this.sphere ? this.k0 = Math.cos(this.lat_ts) : this.k0 = it(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) : this.k0 || (this.k ? this.k0 = this.k : this.k0 = 1);
3511
3539
  }
3512
- function io(t) {
3540
+ function so(t) {
3513
3541
  var e = t.x, i = t.y;
3514
3542
  if (i * H > 90 && i * H < -90 && e * H > 180 && e * H < -180)
3515
3543
  return null;
@@ -3524,60 +3552,60 @@ function io(t) {
3524
3552
  }
3525
3553
  return t.x = s, t.y = r, t;
3526
3554
  }
3527
- function so(t) {
3555
+ function ro(t) {
3528
3556
  var e = t.x - this.x0, i = t.y - this.y0, s, r;
3529
3557
  if (this.sphere)
3530
3558
  r = y - 2 * Math.atan(Math.exp(-i / (this.a * this.k0)));
3531
3559
  else {
3532
3560
  var a = Math.exp(-i / (this.a * this.k0));
3533
- if (r = Xt(this.e, a), r === -9999)
3561
+ if (r = Qt(this.e, a), r === -9999)
3534
3562
  return null;
3535
3563
  }
3536
3564
  return s = w(this.long0 + e / (this.a * this.k0), this.over), t.x = s, t.y = r, t;
3537
3565
  }
3538
- var ro = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"];
3539
- const ao = {
3540
- init: eo,
3541
- forward: io,
3542
- inverse: so,
3543
- names: ro
3566
+ var ao = ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"];
3567
+ const no = {
3568
+ init: io,
3569
+ forward: so,
3570
+ inverse: ro,
3571
+ names: ao
3544
3572
  };
3545
- function no() {
3573
+ function oo() {
3546
3574
  }
3547
3575
  function ms(t) {
3548
3576
  return t;
3549
3577
  }
3550
3578
  var fr = ["longlat", "identity"];
3551
- const oo = {
3552
- init: no,
3579
+ const ho = {
3580
+ init: oo,
3553
3581
  forward: ms,
3554
3582
  inverse: ms,
3555
3583
  names: fr
3556
3584
  };
3557
- var ho = [ao, oo], mt = {}, xt = [];
3585
+ var lo = [no, ho], dt = {}, Pt = [];
3558
3586
  function mr(t, e) {
3559
- var i = xt.length;
3560
- return t.names ? (xt[i] = t, t.names.forEach(function(s) {
3561
- mt[s.toLowerCase()] = i;
3587
+ var i = Pt.length;
3588
+ return t.names ? (Pt[i] = t, t.names.forEach(function(s) {
3589
+ dt[s.toLowerCase()] = i;
3562
3590
  }), this) : (console.log(e), !0);
3563
3591
  }
3564
3592
  function dr(t) {
3565
3593
  return t.replace(/[-\(\)\s]+/g, " ").trim().replace(/ /g, "_");
3566
3594
  }
3567
- function lo(t) {
3595
+ function co(t) {
3568
3596
  if (!t)
3569
3597
  return !1;
3570
3598
  var e = t.toLowerCase();
3571
- if (typeof mt[e] < "u" && xt[mt[e]] || (e = dr(e), e in mt && xt[mt[e]]))
3572
- return xt[mt[e]];
3599
+ if (typeof dt[e] < "u" && Pt[dt[e]] || (e = dr(e), e in dt && Pt[dt[e]]))
3600
+ return Pt[dt[e]];
3573
3601
  }
3574
- function co() {
3575
- ho.forEach(mr);
3602
+ function uo() {
3603
+ lo.forEach(mr);
3576
3604
  }
3577
- const uo = {
3578
- start: co,
3605
+ const fo = {
3606
+ start: uo,
3579
3607
  add: mr,
3580
- get: lo
3608
+ get: co
3581
3609
  };
3582
3610
  var gr = {
3583
3611
  MERIT: {
@@ -3802,10 +3830,10 @@ var gr = {
3802
3830
  ellipseName: "Normal Sphere (r=6370997)"
3803
3831
  }
3804
3832
  };
3805
- const fo = gr.WGS84;
3806
- function mo(t, e, i, s) {
3833
+ const mo = gr.WGS84;
3834
+ function go(t, e, i, s) {
3807
3835
  var r = t * t, a = e * e, n = (r - a) / r, o = 0;
3808
- s ? (t *= 1 - n * (In + n * (Tn + n * Rn)), r = t * t, n = 0) : o = Math.sqrt(n);
3836
+ s ? (t *= 1 - n * (Tn + n * (Rn + n * kn)), r = t * t, n = 0) : o = Math.sqrt(n);
3809
3837
  var h = (r - a) / a;
3810
3838
  return {
3811
3839
  es: n,
@@ -3813,10 +3841,10 @@ function mo(t, e, i, s) {
3813
3841
  ep2: h
3814
3842
  };
3815
3843
  }
3816
- function go(t, e, i, s, r) {
3844
+ function Mo(t, e, i, s, r) {
3817
3845
  if (!t) {
3818
- var a = ct(gr, s);
3819
- a || (a = fo), t = a.a, e = a.b, i = a.rf;
3846
+ var a = ut(gr, s);
3847
+ a || (a = mo), t = a.a, e = a.b, i = a.rf;
3820
3848
  }
3821
3849
  return i && !e && (e = (1 - 1 / i) * t), (i === 0 || Math.abs(t - e) < p) && (r = !0, e = t), {
3822
3850
  a: t,
@@ -5177,25 +5205,25 @@ var ge = {
5177
5205
  towgs84: "0,0,0"
5178
5206
  }
5179
5207
  };
5180
- for (var Mo in ge) {
5181
- var He = ge[Mo];
5208
+ for (var vo in ge) {
5209
+ var He = ge[vo];
5182
5210
  He.datumName && (ge[He.datumName] = He);
5183
5211
  }
5184
- function vo(t, e, i, s, r, a, n) {
5212
+ function yo(t, e, i, s, r, a, n) {
5185
5213
  var o = {};
5186
- return o.datum_type = ei, e && (o.datum_type = Nn, o.datum_params = e.map(parseFloat), (o.datum_params[0] !== 0 || o.datum_params[1] !== 0 || o.datum_params[2] !== 0) && (o.datum_type = vt), o.datum_params.length > 3 && (o.datum_params[3] !== 0 || o.datum_params[4] !== 0 || o.datum_params[5] !== 0 || o.datum_params[6] !== 0) && (o.datum_type = yt, o.datum_params[3] *= Dt, o.datum_params[4] *= Dt, o.datum_params[5] *= Dt, o.datum_params[6] = o.datum_params[6] / 1e6 + 1)), n && (o.datum_type = Gt, o.grids = n), o.a = i, o.b = s, o.es = r, o.ep2 = a, o;
5187
- }
5188
- var mi = {};
5189
- function yo(t, e, i) {
5190
- return e instanceof ArrayBuffer ? _o(t, e, i) : { ready: bo(t, e) };
5214
+ return o.datum_type = ii, e && (o.datum_type = Cn, o.datum_params = e.map(parseFloat), (o.datum_params[0] !== 0 || o.datum_params[1] !== 0 || o.datum_params[2] !== 0) && (o.datum_type = _t), o.datum_params.length > 3 && (o.datum_params[3] !== 0 || o.datum_params[4] !== 0 || o.datum_params[5] !== 0 || o.datum_params[6] !== 0) && (o.datum_type = bt, o.datum_params[3] *= zt, o.datum_params[4] *= zt, o.datum_params[5] *= zt, o.datum_params[6] = o.datum_params[6] / 1e6 + 1)), n && (o.datum_type = Nt, o.grids = n), o.a = i, o.b = s, o.es = r, o.ep2 = a, o;
5191
5215
  }
5216
+ var di = {};
5192
5217
  function _o(t, e, i) {
5218
+ return e instanceof ArrayBuffer ? bo(t, e, i) : { ready: po(t, e) };
5219
+ }
5220
+ function bo(t, e, i) {
5193
5221
  var s = !0;
5194
5222
  i !== void 0 && i.includeErrorFields === !1 && (s = !1);
5195
- var r = new DataView(e), a = So(r), n = Eo(r, a), o = xo(r, n, a, s), h = { header: n, subgrids: o };
5196
- return mi[t] = h, h;
5223
+ var r = new DataView(e), a = Eo(r), n = xo(r, a), o = Po(r, n, a, s), h = { header: n, subgrids: o };
5224
+ return di[t] = h, h;
5197
5225
  }
5198
- async function bo(t, e) {
5226
+ async function po(t, e) {
5199
5227
  for (var i = [], s = await e.getImageCount(), r = s - 1; r >= 0; r--) {
5200
5228
  var a = await e.getImage(r), n = await a.readRasters(), o = n, h = [a.getWidth(), a.getHeight()], l = a.getBoundingBox().map(ds), f = typeof a.fileDirectory.getValue == "function" ? a.fileDirectory.getValue("ModelPixelScale") : (
5201
5229
  /** @type {any} */
@@ -5204,7 +5232,7 @@ async function bo(t, e) {
5204
5232
  for (let b = h[1] - 1; b >= 0; b--)
5205
5233
  for (let E = h[0] - 1; E >= 0; E--) {
5206
5234
  var v = b * h[0] + E;
5207
- M.push([-lt(g[v]), lt(d[v])]);
5235
+ M.push([-ct(g[v]), ct(d[v])]);
5208
5236
  }
5209
5237
  i.push({
5210
5238
  del: u,
@@ -5219,60 +5247,60 @@ async function bo(t, e) {
5219
5247
  },
5220
5248
  subgrids: i
5221
5249
  };
5222
- return mi[t] = _, _;
5250
+ return di[t] = _, _;
5223
5251
  }
5224
- function po(t) {
5252
+ function wo(t) {
5225
5253
  if (t === void 0)
5226
5254
  return null;
5227
5255
  var e = t.split(",");
5228
- return e.map(wo);
5256
+ return e.map(So);
5229
5257
  }
5230
- function wo(t) {
5258
+ function So(t) {
5231
5259
  if (t.length === 0)
5232
5260
  return null;
5233
5261
  var e = t[0] === "@";
5234
5262
  return e && (t = t.slice(1)), t === "null" ? { name: "null", mandatory: !e, grid: null, isNull: !0 } : {
5235
5263
  name: t,
5236
5264
  mandatory: !e,
5237
- grid: mi[t] || null,
5265
+ grid: di[t] || null,
5238
5266
  isNull: !1
5239
5267
  };
5240
5268
  }
5241
5269
  function ds(t) {
5242
5270
  return t * Math.PI / 180;
5243
5271
  }
5244
- function lt(t) {
5272
+ function ct(t) {
5245
5273
  return t / 3600 * Math.PI / 180;
5246
5274
  }
5247
- function So(t) {
5275
+ function Eo(t) {
5248
5276
  var e = t.getInt32(8, !1);
5249
5277
  return e === 11 ? !1 : (e = t.getInt32(8, !0), e !== 11 && console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"), !0);
5250
5278
  }
5251
- function Eo(t, e) {
5279
+ function xo(t, e) {
5252
5280
  return {
5253
5281
  nFields: t.getInt32(8, e),
5254
5282
  nSubgridFields: t.getInt32(24, e),
5255
5283
  nSubgrids: t.getInt32(40, e),
5256
- shiftType: si(t, 56, 64).trim(),
5284
+ shiftType: ri(t, 56, 64).trim(),
5257
5285
  fromSemiMajorAxis: t.getFloat64(120, e),
5258
5286
  fromSemiMinorAxis: t.getFloat64(136, e),
5259
5287
  toSemiMajorAxis: t.getFloat64(152, e),
5260
5288
  toSemiMinorAxis: t.getFloat64(168, e)
5261
5289
  };
5262
5290
  }
5263
- function si(t, e, i) {
5291
+ function ri(t, e, i) {
5264
5292
  return String.fromCharCode.apply(null, new Uint8Array(t.buffer.slice(e, i)));
5265
5293
  }
5266
- function xo(t, e, i, s) {
5294
+ function Po(t, e, i, s) {
5267
5295
  for (var r = 176, a = [], n = 0; n < e.nSubgrids; n++) {
5268
- var o = Po(t, r, i), h = Go(t, r, o, i, s), l = Math.round(
5296
+ var o = Go(t, r, i), h = No(t, r, o, i, s), l = Math.round(
5269
5297
  1 + (o.upperLongitude - o.lowerLongitude) / o.longitudeInterval
5270
5298
  ), f = Math.round(
5271
5299
  1 + (o.upperLatitude - o.lowerLatitude) / o.latitudeInterval
5272
5300
  );
5273
5301
  a.push({
5274
- ll: [lt(o.lowerLongitude), lt(o.lowerLatitude)],
5275
- del: [lt(o.longitudeInterval), lt(o.latitudeInterval)],
5302
+ ll: [ct(o.lowerLongitude), ct(o.lowerLatitude)],
5303
+ del: [ct(o.longitudeInterval), ct(o.latitudeInterval)],
5276
5304
  lim: [l, f],
5277
5305
  count: o.gridNodeCount,
5278
5306
  cvs: Ao(h)
@@ -5284,13 +5312,13 @@ function xo(t, e, i, s) {
5284
5312
  }
5285
5313
  function Ao(t) {
5286
5314
  return t.map(function(e) {
5287
- return [lt(e.longitudeShift), lt(e.latitudeShift)];
5315
+ return [ct(e.longitudeShift), ct(e.latitudeShift)];
5288
5316
  });
5289
5317
  }
5290
- function Po(t, e, i) {
5318
+ function Go(t, e, i) {
5291
5319
  return {
5292
- name: si(t, e + 8, e + 16).trim(),
5293
- parent: si(t, e + 24, e + 24 + 8).trim(),
5320
+ name: ri(t, e + 8, e + 16).trim(),
5321
+ parent: ri(t, e + 24, e + 24 + 8).trim(),
5294
5322
  lowerLatitude: t.getFloat64(e + 72, i),
5295
5323
  upperLatitude: t.getFloat64(e + 88, i),
5296
5324
  lowerLongitude: t.getFloat64(e + 104, i),
@@ -5300,7 +5328,7 @@ function Po(t, e, i) {
5300
5328
  gridNodeCount: t.getInt32(e + 168, i)
5301
5329
  };
5302
5330
  }
5303
- function Go(t, e, i, s, r) {
5331
+ function No(t, e, i, s, r) {
5304
5332
  var a = e + 176, n = 16;
5305
5333
  r === !1 && (n = 8);
5306
5334
  for (var o = [], h = 0; h < i.gridNodeCount; h++) {
@@ -5319,7 +5347,7 @@ function Q(t, e) {
5319
5347
  if (l)
5320
5348
  throw l;
5321
5349
  };
5322
- var i = to(t);
5350
+ var i = eo(t);
5323
5351
  if (typeof i != "object") {
5324
5352
  e("Could not parse to valid json: " + t);
5325
5353
  return;
@@ -5330,11 +5358,11 @@ function Q(t, e) {
5330
5358
  return;
5331
5359
  }
5332
5360
  if (i.datumCode && i.datumCode !== "none") {
5333
- var r = ct(ge, i.datumCode);
5361
+ var r = ut(ge, i.datumCode);
5334
5362
  r && (i.datum_params = i.datum_params || (r.towgs84 ? r.towgs84.split(",") : null), i.ellps = r.ellipse, i.datumName = r.datumName ? r.datumName : i.datumCode);
5335
5363
  }
5336
5364
  i.k0 = i.k0 || 1, i.axis = i.axis || "enu", i.ellps = i.ellps || "wgs84", i.lat1 = i.lat1 || i.lat0;
5337
- var a = go(i.a, i.b, i.rf, i.ellps, i.sphere), n = mo(a.a, a.b, a.rf, i.R_A), o = po(i.nadgrids), h = i.datum || vo(
5365
+ var a = Mo(i.a, i.b, i.rf, i.ellps, i.sphere), n = go(a.a, a.b, a.rf, i.R_A), o = wo(i.nadgrids), h = i.datum || yo(
5338
5366
  i.datumCode,
5339
5367
  i.datum_params,
5340
5368
  a.a,
@@ -5345,10 +5373,10 @@ function Q(t, e) {
5345
5373
  );
5346
5374
  fs(this, i), fs(this, s), this.a = a.a, this.b = a.b, this.rf = a.rf, this.sphere = a.sphere, this.es = n.es, this.e = n.e, this.ep2 = n.ep2, this.datum = h, "init" in this && typeof this.init == "function" && this.init(), e(null, this);
5347
5375
  }
5348
- Q.projections = uo;
5376
+ Q.projections = fo;
5349
5377
  Q.projections.start();
5350
- function No(t, e) {
5351
- return t.datum_type !== e.datum_type || t.a !== e.a || Math.abs(t.es - e.es) > 5e-11 ? !1 : t.datum_type === vt ? t.datum_params[0] === e.datum_params[0] && t.datum_params[1] === e.datum_params[1] && t.datum_params[2] === e.datum_params[2] : t.datum_type === yt ? t.datum_params[0] === e.datum_params[0] && t.datum_params[1] === e.datum_params[1] && t.datum_params[2] === e.datum_params[2] && t.datum_params[3] === e.datum_params[3] && t.datum_params[4] === e.datum_params[4] && t.datum_params[5] === e.datum_params[5] && t.datum_params[6] === e.datum_params[6] : !0;
5378
+ function Co(t, e) {
5379
+ return t.datum_type !== e.datum_type || t.a !== e.a || Math.abs(t.es - e.es) > 5e-11 ? !1 : t.datum_type === _t ? t.datum_params[0] === e.datum_params[0] && t.datum_params[1] === e.datum_params[1] && t.datum_params[2] === e.datum_params[2] : t.datum_type === bt ? t.datum_params[0] === e.datum_params[0] && t.datum_params[1] === e.datum_params[1] && t.datum_params[2] === e.datum_params[2] && t.datum_params[3] === e.datum_params[3] && t.datum_params[4] === e.datum_params[4] && t.datum_params[5] === e.datum_params[5] && t.datum_params[6] === e.datum_params[6] : !0;
5352
5380
  }
5353
5381
  function Mr(t, e, i) {
5354
5382
  var s = t.x, r = t.y, a = t.z ? t.z : 0, n, o, h, l;
@@ -5369,34 +5397,34 @@ function Mr(t, e, i) {
5369
5397
  };
5370
5398
  }
5371
5399
  function vr(t, e, i, s) {
5372
- var r = 1e-12, a = r * r, n = 30, o, h, l, f, u, c, m, d, g, M, v, _, b, E = t.x, S = t.y, A = t.z ? t.z : 0, P, G, N;
5373
- if (o = Math.sqrt(E * E + S * S), h = Math.sqrt(E * E + S * S + A * A), o / i < r) {
5374
- if (P = 0, h / i < r)
5400
+ var r = 1e-12, a = r * r, n = 30, o, h, l, f, u, c, m, d, g, M, v, _, b, E = t.x, S = t.y, P = t.z ? t.z : 0, A, G, N;
5401
+ if (o = Math.sqrt(E * E + S * S), h = Math.sqrt(E * E + S * S + P * P), o / i < r) {
5402
+ if (A = 0, h / i < r)
5375
5403
  return G = y, N = -s, {
5376
5404
  x: t.x,
5377
5405
  y: t.y,
5378
5406
  z: t.z
5379
5407
  };
5380
5408
  } else
5381
- P = Math.atan2(S, E);
5382
- l = A / h, f = o / h, u = 1 / Math.sqrt(1 - e * (2 - e) * f * f), d = f * (1 - e) * u, g = l * u, b = 0;
5409
+ A = Math.atan2(S, E);
5410
+ l = P / h, f = o / h, u = 1 / Math.sqrt(1 - e * (2 - e) * f * f), d = f * (1 - e) * u, g = l * u, b = 0;
5383
5411
  do
5384
- b++, m = i / Math.sqrt(1 - e * g * g), N = o * d + A * g - m * (1 - e * g * g), c = e * m / (m + N), u = 1 / Math.sqrt(1 - c * (2 - c) * f * f), M = f * (1 - c) * u, v = l * u, _ = v * d - M * g, d = M, g = v;
5412
+ b++, m = i / Math.sqrt(1 - e * g * g), N = o * d + P * g - m * (1 - e * g * g), c = e * m / (m + N), u = 1 / Math.sqrt(1 - c * (2 - c) * f * f), M = f * (1 - c) * u, v = l * u, _ = v * d - M * g, d = M, g = v;
5385
5413
  while (_ * _ > a && b < n);
5386
5414
  return G = Math.atan(v / Math.abs(M)), {
5387
- x: P,
5415
+ x: A,
5388
5416
  y: G,
5389
5417
  z: N
5390
5418
  };
5391
5419
  }
5392
- function Co(t, e, i) {
5393
- if (e === vt)
5420
+ function Io(t, e, i) {
5421
+ if (e === _t)
5394
5422
  return {
5395
5423
  x: t.x + i[0],
5396
5424
  y: t.y + i[1],
5397
5425
  z: t.z + i[2]
5398
5426
  };
5399
- if (e === yt) {
5427
+ if (e === bt) {
5400
5428
  var s = i[0], r = i[1], a = i[2], n = i[3], o = i[4], h = i[5], l = i[6];
5401
5429
  return {
5402
5430
  x: l * (t.x - h * t.y + o * t.z) + s,
@@ -5405,14 +5433,14 @@ function Co(t, e, i) {
5405
5433
  };
5406
5434
  }
5407
5435
  }
5408
- function Io(t, e, i) {
5409
- if (e === vt)
5436
+ function To(t, e, i) {
5437
+ if (e === _t)
5410
5438
  return {
5411
5439
  x: t.x - i[0],
5412
5440
  y: t.y - i[1],
5413
5441
  z: t.z - i[2]
5414
5442
  };
5415
- if (e === yt) {
5443
+ if (e === bt) {
5416
5444
  var s = i[0], r = i[1], a = i[2], n = i[3], o = i[4], h = i[5], l = i[6], f = (t.x - s) / l, u = (t.y - r) / l, c = (t.z - a) / l;
5417
5445
  return {
5418
5446
  x: f + h * u - o * c,
@@ -5421,23 +5449,23 @@ function Io(t, e, i) {
5421
5449
  };
5422
5450
  }
5423
5451
  }
5424
- function ce(t) {
5425
- return t === vt || t === yt;
5452
+ function ue(t) {
5453
+ return t === _t || t === bt;
5426
5454
  }
5427
- function To(t, e, i) {
5428
- if (No(t, e) || t.datum_type === ei || e.datum_type === ei)
5455
+ function Ro(t, e, i) {
5456
+ if (Co(t, e) || t.datum_type === ii || e.datum_type === ii)
5429
5457
  return i;
5430
5458
  var s = t.a, r = t.es;
5431
- if (t.datum_type === Gt) {
5459
+ if (t.datum_type === Nt) {
5432
5460
  var a = gs(t, !1, i);
5433
5461
  if (a !== 0)
5434
5462
  return;
5435
5463
  s = as, r = ns;
5436
5464
  }
5437
5465
  var n = e.a, o = e.b, h = e.es;
5438
- if (e.datum_type === Gt && (n = as, o = Cn, h = ns), r === h && s === n && !ce(t.datum_type) && !ce(e.datum_type))
5466
+ if (e.datum_type === Nt && (n = as, o = In, h = ns), r === h && s === n && !ue(t.datum_type) && !ue(e.datum_type))
5439
5467
  return i;
5440
- if (i = Mr(i, r, s), ce(t.datum_type) && (i = Co(i, t.datum_type, t.datum_params)), ce(e.datum_type) && (i = Io(i, e.datum_type, e.datum_params)), i = vr(i, h, n, o), e.datum_type === Gt) {
5468
+ if (i = Mr(i, r, s), ue(t.datum_type) && (i = Io(i, t.datum_type, t.datum_params)), ue(e.datum_type) && (i = To(i, e.datum_type, e.datum_params)), i = vr(i, h, n, o), e.datum_type === Nt) {
5441
5469
  var l = gs(e, !0, i);
5442
5470
  if (l !== 0)
5443
5471
  return;
@@ -5462,13 +5490,13 @@ function gs(t, e, i) {
5462
5490
  }
5463
5491
  for (var h = o.grid.subgrids, l = 0, f = h.length; l < f; l++) {
5464
5492
  var u = h[l], c = (Math.abs(u.del[1]) + Math.abs(u.del[0])) / 1e4, m = u.ll[0] - c, d = u.ll[1] - c, g = u.ll[0] + (u.lim[0] - 1) * u.del[0] + c, M = u.ll[1] + (u.lim[1] - 1) * u.del[1] + c;
5465
- if (!(d > s.y || m > s.x || M < s.y || g < s.x) && (r = Ro(s, e, u), !isNaN(r.x)))
5493
+ if (!(d > s.y || m > s.x || M < s.y || g < s.x) && (r = ko(s, e, u), !isNaN(r.x)))
5466
5494
  break t;
5467
5495
  }
5468
5496
  }
5469
5497
  return isNaN(r.x) ? (console.log("Failed to find a grid shift table for location '" + -s.x * H + " " + s.y * H + " tried: '" + a + "'"), -1) : (i.x = -r.x, i.y = r.y, 0);
5470
5498
  }
5471
- function Ro(t, e, i) {
5499
+ function ko(t, e, i) {
5472
5500
  var s = { x: Number.NaN, y: Number.NaN };
5473
5501
  if (isNaN(t.x))
5474
5502
  return s;
@@ -5508,13 +5536,13 @@ function Ms(t, e) {
5508
5536
  var f = { x: e.cvs[n][0], y: e.cvs[n][1] }, u = r.x * r.y, c = r.x * (1 - r.y), m = (1 - r.x) * (1 - r.y), d = (1 - r.x) * r.y;
5509
5537
  return a.x = m * o.x + c * h.x + d * f.x + u * l.x, a.y = m * o.y + c * h.y + d * f.y + u * l.y, a;
5510
5538
  }
5511
- var dt = ["x", "y", "z"];
5512
- function ko(t, e) {
5539
+ var gt = ["x", "y", "z"];
5540
+ function $o(t, e) {
5513
5541
  const i = {};
5514
5542
  for (let s = 0, r = t.axis.length; s < r; s++) {
5515
5543
  if (s === 2 && e.z === void 0)
5516
5544
  continue;
5517
- let a = e[dt[s]];
5545
+ let a = e[gt[s]];
5518
5546
  switch (t.axis[s]) {
5519
5547
  case "e":
5520
5548
  i.x = a;
@@ -5540,7 +5568,7 @@ function ko(t, e) {
5540
5568
  }
5541
5569
  return i;
5542
5570
  }
5543
- function $o(t, e) {
5571
+ function Lo(t, e) {
5544
5572
  const i = (
5545
5573
  /** @type {import("./core").InterfaceCoordinates} */
5546
5574
  {}
@@ -5549,36 +5577,36 @@ function $o(t, e) {
5549
5577
  if (!(s === 2 && e.z === void 0))
5550
5578
  switch (t.axis[s]) {
5551
5579
  case "e":
5552
- i[dt[s]] = e.x;
5580
+ i[gt[s]] = e.x;
5553
5581
  break;
5554
5582
  case "w":
5555
- i[dt[s]] = -e.x;
5583
+ i[gt[s]] = -e.x;
5556
5584
  break;
5557
5585
  case "n":
5558
- i[dt[s]] = e.y;
5586
+ i[gt[s]] = e.y;
5559
5587
  break;
5560
5588
  case "s":
5561
- i[dt[s]] = -e.y;
5589
+ i[gt[s]] = -e.y;
5562
5590
  break;
5563
5591
  case "u":
5564
- i[dt[s]] = e.z;
5592
+ i[gt[s]] = e.z;
5565
5593
  break;
5566
5594
  case "d":
5567
- i[dt[s]] = -e.z;
5595
+ i[gt[s]] = -e.z;
5568
5596
  break;
5569
5597
  default:
5570
5598
  return null;
5571
5599
  }
5572
5600
  return i;
5573
5601
  }
5574
- function di(t) {
5602
+ function gi(t) {
5575
5603
  var e = {
5576
5604
  x: t[0],
5577
5605
  y: t[1]
5578
5606
  };
5579
5607
  return t.length > 2 && (e.z = t[2]), t.length > 3 && (e.m = t[3]), e;
5580
5608
  }
5581
- function Lo(t) {
5609
+ function Oo(t) {
5582
5610
  vs(t.x), vs(t.y);
5583
5611
  }
5584
5612
  function vs(t) {
@@ -5590,15 +5618,15 @@ function vs(t) {
5590
5618
  if (typeof t != "number" || t !== t || !isFinite(t))
5591
5619
  throw new TypeError("coordinates must be finite numbers");
5592
5620
  }
5593
- function Oo(t, e) {
5594
- return (t.datum.datum_type === vt || t.datum.datum_type === yt || t.datum.datum_type === Gt) && e.datumCode !== "WGS84" || (e.datum.datum_type === vt || e.datum.datum_type === yt || e.datum.datum_type === Gt) && t.datumCode !== "WGS84";
5621
+ function Fo(t, e) {
5622
+ return (t.datum.datum_type === _t || t.datum.datum_type === bt || t.datum.datum_type === Nt) && e.datumCode !== "WGS84" || (e.datum.datum_type === _t || e.datum.datum_type === bt || e.datum.datum_type === Nt) && t.datumCode !== "WGS84";
5595
5623
  }
5596
- function Ae(t, e, i, s) {
5624
+ function Pe(t, e, i, s) {
5597
5625
  var r, a = i.z !== void 0;
5598
- if (Lo(i), t.datum && e.datum && Oo(t, e) && (r = new Q("WGS84"), i = Ae(t, r, i, s), t = r), s && t.axis !== "enu" && (i = ko(t, i)), t.projName === "longlat")
5626
+ if (Oo(i), t.datum && e.datum && Fo(t, e) && (r = new Q("WGS84"), i = Pe(t, r, i, s), t = r), s && t.axis !== "enu" && (i = $o(t, i)), t.projName === "longlat")
5599
5627
  i = {
5600
- x: i.x * $,
5601
- y: i.y * $,
5628
+ x: i.x * L,
5629
+ y: i.y * L,
5602
5630
  z: i.z || 0
5603
5631
  };
5604
5632
  else if (t.to_meter && (i = {
@@ -5607,7 +5635,7 @@ function Ae(t, e, i, s) {
5607
5635
  z: i.z || 0
5608
5636
  }), i = t.inverse(i), !i)
5609
5637
  return;
5610
- if (t.from_greenwich && (i.x += t.from_greenwich), i = To(t.datum, e.datum, i), !!i)
5638
+ if (t.from_greenwich && (i.x += t.from_greenwich), i = Ro(t.datum, e.datum, i), !!i)
5611
5639
  return i = /** @type {import('./core').InterfaceCoordinates} */
5612
5640
  i, e.from_greenwich && (i = {
5613
5641
  x: i.x - e.from_greenwich,
@@ -5621,16 +5649,16 @@ function Ae(t, e, i, s) {
5621
5649
  x: i.x / e.to_meter,
5622
5650
  y: i.y / e.to_meter,
5623
5651
  z: i.z || 0
5624
- })), s && e.axis !== "enu" ? $o(e, i) : (i && !a && e.projName !== "geocent" && delete i.z, i);
5652
+ })), s && e.axis !== "enu" ? Lo(e, i) : (i && !a && e.projName !== "geocent" && delete i.z, i);
5625
5653
  }
5626
- function Fo(t, e, i, s) {
5654
+ function qo(t, e, i, s) {
5627
5655
  var r;
5628
- return Array.isArray(i) ? r = di(i) : r = { x: i.x, y: i.y, z: i.z, m: i.m }, Ae(t, e, r, s);
5656
+ return Array.isArray(i) ? r = gi(i) : r = { x: i.x, y: i.y, z: i.z, m: i.m }, Pe(t, e, r, s);
5629
5657
  }
5630
5658
  var ys = Q("WGS84");
5631
5659
  function Ve(t, e, i, s) {
5632
5660
  var r, a, n;
5633
- return Array.isArray(i) ? (r = Ae(t, e, di(i), s) || { x: NaN, y: NaN }, i.length > 2 ? (a = typeof t.name < "u" && t.name === "geocent" || typeof e.name < "u" && e.name === "geocent", a ? typeof r.z == "number" ? (
5661
+ return Array.isArray(i) ? (r = Pe(t, e, gi(i), s) || { x: NaN, y: NaN }, i.length > 2 ? (a = typeof t.name < "u" && t.name === "geocent" || typeof e.name < "u" && e.name === "geocent", a ? typeof r.z == "number" ? (
5634
5662
  /** @type {T} */
5635
5663
  [r.x, r.y, r.z].concat(i.slice(3))
5636
5664
  ) : (
@@ -5645,23 +5673,23 @@ function Ve(t, e, i, s) {
5645
5673
  )) : (
5646
5674
  /** @type {T} */
5647
5675
  [r.x, r.y]
5648
- )) : (r = Ae(t, e, { x: i.x, y: i.y, z: i.z, m: i.m }, s) || { x: NaN, y: NaN }, n = Object.keys(i), n.length === 2 || (a = typeof t.name < "u" && t.name === "geocent" || typeof e.name < "u" && e.name === "geocent", n.forEach(function(o) {
5676
+ )) : (r = Pe(t, e, { x: i.x, y: i.y, z: i.z, m: i.m }, s) || { x: NaN, y: NaN }, n = Object.keys(i), n.length === 2 || (a = typeof t.name < "u" && t.name === "geocent" || typeof e.name < "u" && e.name === "geocent", n.forEach(function(o) {
5649
5677
  o === "x" || o === "y" || o === "z" && (a || s) || (r[o] = i[o]);
5650
5678
  })), /** @type {T} */
5651
5679
  r);
5652
5680
  }
5653
- function ue(t) {
5681
+ function fe(t) {
5654
5682
  return t instanceof Q ? t : typeof t == "object" && "oProj" in t ? t.oProj : Q(
5655
5683
  /** @type {string | PROJJSONDefinition} */
5656
5684
  t
5657
5685
  );
5658
5686
  }
5659
- function qo(t, e, i) {
5687
+ function Uo(t, e, i) {
5660
5688
  var s, r, a = !1, n;
5661
- return typeof e > "u" ? (r = ue(t), s = ys, a = !0) : (typeof /** @type {?} */
5689
+ return typeof e > "u" ? (r = fe(t), s = ys, a = !0) : (typeof /** @type {?} */
5662
5690
  e.x < "u" || Array.isArray(e)) && (i = /** @type {T} */
5663
5691
  /** @type {?} */
5664
- e, r = ue(t), s = ys, a = !0), s || (s = ue(t)), r || (r = ue(
5692
+ e, r = fe(t), s = ys, a = !0), s || (s = fe(t)), r || (r = fe(
5665
5693
  /** @type {string | PROJJSONDefinition | proj } */
5666
5694
  e
5667
5695
  )), i ? Ve(s, r, i) : (n = {
@@ -5685,24 +5713,24 @@ function qo(t, e, i) {
5685
5713
  }
5686
5714
  }, a && (n.oProj = r), n);
5687
5715
  }
5688
- var _s = 6, yr = "AJSAJS", _r = "AFAFAF", At = 65, B = 73, X = 79, qt = 86, Ut = 90;
5689
- const Uo = {
5716
+ var _s = 6, yr = "AJSAJS", _r = "AFAFAF", At = 65, B = 73, X = 79, Ut = 86, jt = 90;
5717
+ const jo = {
5690
5718
  forward: br,
5691
- inverse: jo,
5719
+ inverse: Do,
5692
5720
  toPoint: pr
5693
5721
  };
5694
5722
  function br(t, e) {
5695
- return e = e || 5, Bo(Do({
5723
+ return e = e || 5, Wo(zo({
5696
5724
  lat: t[1],
5697
5725
  lon: t[0]
5698
5726
  }), e);
5699
5727
  }
5700
- function jo(t) {
5701
- var e = gi(Sr(t.toUpperCase()));
5728
+ function Do(t) {
5729
+ var e = Mi(Sr(t.toUpperCase()));
5702
5730
  return e.lat && e.lon ? [e.lon, e.lat, e.lon, e.lat] : [e.left, e.bottom, e.right, e.top];
5703
5731
  }
5704
5732
  function pr(t) {
5705
- var e = gi(Sr(t.toUpperCase()));
5733
+ var e = Mi(Sr(t.toUpperCase()));
5706
5734
  return e.lat && e.lon ? [e.lon, e.lat] : [(e.left + e.right) / 2, (e.top + e.bottom) / 2];
5707
5735
  }
5708
5736
  function Ke(t) {
@@ -5711,7 +5739,7 @@ function Ke(t) {
5711
5739
  function bs(t) {
5712
5740
  return 180 * (t / Math.PI);
5713
5741
  }
5714
- function Do(t) {
5742
+ function zo(t) {
5715
5743
  var e = t.lat, i = t.lon, s = 6378137, r = 669438e-8, a = 0.9996, n, o, h, l, f, u, c, m = Ke(e), d = Ke(i), g, M;
5716
5744
  M = Math.floor((i + 180) / 6) + 1, i === 180 && (M = 60), e >= 56 && e < 64 && i >= 3 && i < 12 && (M = 32), e >= 72 && e < 84 && (i >= 0 && i < 9 ? M = 31 : i >= 9 && i < 21 ? M = 33 : i >= 21 && i < 33 ? M = 35 : i >= 33 && i < 42 && (M = 37)), n = (M - 1) * 6 - 180 + 3, g = Ke(n), o = r / (1 - r), h = s / Math.sqrt(1 - r * Math.sin(m) * Math.sin(m)), l = Math.tan(m) * Math.tan(m), f = o * Math.cos(m) * Math.cos(m), u = Math.cos(m) * (d - g), c = s * ((1 - r / 4 - 3 * r * r / 64 - 5 * r * r * r / 256) * m - (3 * r / 8 + 3 * r * r / 32 + 45 * r * r * r / 1024) * Math.sin(2 * m) + (15 * r * r / 256 + 45 * r * r * r / 1024) * Math.sin(4 * m) - 35 * r * r * r / 3072 * Math.sin(6 * m));
5717
5745
  var v = a * h * (u + (1 - l + f) * u * u * u / 6 + (5 - 18 * l + l * l + 72 * f - 58 * o) * u * u * u * u * u / 120) + 5e5, _ = a * (c + h * Math.tan(m) * (u * u / 2 + (5 - l + 9 * f + 4 * f * f) * u * u * u * u / 24 + (61 - 58 * l + l * l + 600 * f - 330 * o) * u * u * u * u * u * u / 720));
@@ -5719,10 +5747,10 @@ function Do(t) {
5719
5747
  northing: Math.round(_),
5720
5748
  easting: Math.round(v),
5721
5749
  zoneNumber: M,
5722
- zoneLetter: zo(e)
5750
+ zoneLetter: Bo(e)
5723
5751
  };
5724
5752
  }
5725
- function gi(t) {
5753
+ function Mi(t) {
5726
5754
  var e = t.northing, i = t.easting, s = t.zoneLetter, r = t.zoneNumber;
5727
5755
  if (r < 0 || r > 60)
5728
5756
  return null;
@@ -5730,48 +5758,48 @@ function gi(t) {
5730
5758
  s < "N" && (E -= 1e7), M = (r - 1) * 6 - 180 + 3, h = o / (1 - o), g = E / a, v = g / (n * (1 - o / 4 - 3 * o * o / 64 - 5 * o * o * o / 256)), _ = v + (3 * l / 2 - 27 * l * l * l / 32) * Math.sin(2 * v) + (21 * l * l / 16 - 55 * l * l * l * l / 32) * Math.sin(4 * v) + 151 * l * l * l / 96 * Math.sin(6 * v), f = n / Math.sqrt(1 - o * Math.sin(_) * Math.sin(_)), u = Math.tan(_) * Math.tan(_), c = h * Math.cos(_) * Math.cos(_), m = n * (1 - o) / Math.pow(1 - o * Math.sin(_) * Math.sin(_), 1.5), d = b / (f * a);
5731
5759
  var S = _ - f * Math.tan(_) / m * (d * d / 2 - (5 + 3 * u + 10 * c - 4 * c * c - 9 * h) * d * d * d * d / 24 + (61 + 90 * u + 298 * c + 45 * u * u - 252 * h - 3 * c * c) * d * d * d * d * d * d / 720);
5732
5760
  S = bs(S);
5733
- var A = (d - (1 + 2 * u + c) * d * d * d / 6 + (5 - 2 * c + 28 * u - 3 * c * c + 8 * h + 24 * u * u) * d * d * d * d * d / 120) / Math.cos(_);
5734
- A = M + bs(A);
5735
- var P;
5761
+ var P = (d - (1 + 2 * u + c) * d * d * d / 6 + (5 - 2 * c + 28 * u - 3 * c * c + 8 * h + 24 * u * u) * d * d * d * d * d / 120) / Math.cos(_);
5762
+ P = M + bs(P);
5763
+ var A;
5736
5764
  if (t.accuracy) {
5737
- var G = gi({
5765
+ var G = Mi({
5738
5766
  northing: t.northing + t.accuracy,
5739
5767
  easting: t.easting + t.accuracy,
5740
5768
  zoneLetter: t.zoneLetter,
5741
5769
  zoneNumber: t.zoneNumber
5742
5770
  });
5743
- P = {
5771
+ A = {
5744
5772
  top: G.lat,
5745
5773
  right: G.lon,
5746
5774
  bottom: S,
5747
- left: A
5775
+ left: P
5748
5776
  };
5749
5777
  } else
5750
- P = {
5778
+ A = {
5751
5779
  lat: S,
5752
- lon: A
5780
+ lon: P
5753
5781
  };
5754
- return P;
5782
+ return A;
5755
5783
  }
5756
- function zo(t) {
5784
+ function Bo(t) {
5757
5785
  var e = "Z";
5758
5786
  return 84 >= t && t >= 72 ? e = "X" : 72 > t && t >= 64 ? e = "W" : 64 > t && t >= 56 ? e = "V" : 56 > t && t >= 48 ? e = "U" : 48 > t && t >= 40 ? e = "T" : 40 > t && t >= 32 ? e = "S" : 32 > t && t >= 24 ? e = "R" : 24 > t && t >= 16 ? e = "Q" : 16 > t && t >= 8 ? e = "P" : 8 > t && t >= 0 ? e = "N" : 0 > t && t >= -8 ? e = "M" : -8 > t && t >= -16 ? e = "L" : -16 > t && t >= -24 ? e = "K" : -24 > t && t >= -32 ? e = "J" : -32 > t && t >= -40 ? e = "H" : -40 > t && t >= -48 ? e = "G" : -48 > t && t >= -56 ? e = "F" : -56 > t && t >= -64 ? e = "E" : -64 > t && t >= -72 ? e = "D" : -72 > t && t >= -80 && (e = "C"), e;
5759
5787
  }
5760
- function Bo(t, e) {
5788
+ function Wo(t, e) {
5761
5789
  var i = "00000" + t.easting, s = "00000" + t.northing;
5762
- return t.zoneNumber + t.zoneLetter + Wo(t.easting, t.northing, t.zoneNumber) + i.substr(i.length - 5, e) + s.substr(s.length - 5, e);
5790
+ return t.zoneNumber + t.zoneLetter + Ho(t.easting, t.northing, t.zoneNumber) + i.substr(i.length - 5, e) + s.substr(s.length - 5, e);
5763
5791
  }
5764
- function Wo(t, e, i) {
5792
+ function Ho(t, e, i) {
5765
5793
  var s = wr(i), r = Math.floor(t / 1e5), a = Math.floor(e / 1e5) % 20;
5766
- return Ho(r, a, s);
5794
+ return Vo(r, a, s);
5767
5795
  }
5768
5796
  function wr(t) {
5769
5797
  var e = t % _s;
5770
5798
  return e === 0 && (e = _s), e;
5771
5799
  }
5772
- function Ho(t, e, i) {
5800
+ function Vo(t, e, i) {
5773
5801
  var s = i - 1, r = yr.charCodeAt(s), a = _r.charCodeAt(s), n = r + t - 1, o = a + e, h = !1;
5774
- n > Ut && (n = n - Ut + At - 1, h = !0), (n === B || r < B && n > B || (n > B || r < B) && h) && n++, (n === X || r < X && n > X || (n > X || r < X) && h) && (n++, n === B && n++), n > Ut && (n = n - Ut + At - 1), o > qt ? (o = o - qt + At - 1, h = !0) : h = !1, (o === B || a < B && o > B || (o > B || a < B) && h) && o++, (o === X || a < X && o > X || (o > X || a < X) && h) && (o++, o === B && o++), o > qt && (o = o - qt + At - 1);
5802
+ n > jt && (n = n - jt + At - 1, h = !0), (n === B || r < B && n > B || (n > B || r < B) && h) && n++, (n === X || r < X && n > X || (n > X || r < X) && h) && (n++, n === B && n++), n > jt && (n = n - jt + At - 1), o > Ut ? (o = o - Ut + At - 1, h = !0) : h = !1, (o === B || a < B && o > B || (o > B || a < B) && h) && o++, (o === X || a < X && o > X || (o > X || a < X) && h) && (o++, o === B && o++), o > Ut && (o = o - Ut + At - 1);
5775
5803
  var l = String.fromCharCode(n) + String.fromCharCode(o);
5776
5804
  return l;
5777
5805
  }
@@ -5790,7 +5818,7 @@ function Sr(t) {
5790
5818
  if (o <= "A" || o === "B" || o === "Y" || o >= "Z" || o === "I" || o === "O")
5791
5819
  throw "MGRSPoint zone letter " + o + " not handled: " + t;
5792
5820
  i = t.substring(a, a += 2);
5793
- for (var h = wr(n), l = Vo(i.charAt(0), h), f = Ko(i.charAt(1), h); f < Xo(o); )
5821
+ for (var h = wr(n), l = Ko(i.charAt(0), h), f = Xo(i.charAt(1), h); f < Qo(o); )
5794
5822
  f += 2e6;
5795
5823
  var u = e - a;
5796
5824
  if (u % 2 !== 0)
@@ -5807,9 +5835,9 @@ northing meters` + t;
5807
5835
  accuracy: g
5808
5836
  };
5809
5837
  }
5810
- function Vo(t, e) {
5838
+ function Ko(t, e) {
5811
5839
  for (var i = yr.charCodeAt(e - 1), s = 1e5, r = !1; i !== t.charCodeAt(0); ) {
5812
- if (i++, i === B && i++, i === X && i++, i > Ut) {
5840
+ if (i++, i === B && i++, i === X && i++, i > jt) {
5813
5841
  if (r)
5814
5842
  throw "Bad character: " + t;
5815
5843
  i = At, r = !0;
@@ -5818,11 +5846,11 @@ function Vo(t, e) {
5818
5846
  }
5819
5847
  return s;
5820
5848
  }
5821
- function Ko(t, e) {
5849
+ function Xo(t, e) {
5822
5850
  if (t > "V")
5823
5851
  throw "MGRSPoint given invalid Northing " + t;
5824
5852
  for (var i = _r.charCodeAt(e - 1), s = 0, r = !1; i !== t.charCodeAt(0); ) {
5825
- if (i++, i === B && i++, i === X && i++, i > qt) {
5853
+ if (i++, i === B && i++, i === X && i++, i > Ut) {
5826
5854
  if (r)
5827
5855
  throw "Bad character: " + t;
5828
5856
  i = At, r = !0;
@@ -5831,7 +5859,7 @@ function Ko(t, e) {
5831
5859
  }
5832
5860
  return s;
5833
5861
  }
5834
- function Xo(t) {
5862
+ function Qo(t) {
5835
5863
  var e;
5836
5864
  switch (t) {
5837
5865
  case "C":
@@ -5921,29 +5949,29 @@ Rt.fromMGRS = function(t) {
5921
5949
  Rt.prototype.toMGRS = function(t) {
5922
5950
  return br([this.x, this.y], t);
5923
5951
  };
5924
- var Qo = 1, Jo = 0.25, ps = 0.046875, ws = 0.01953125, Ss = 0.01068115234375, Yo = 0.75, Zo = 0.46875, th = 0.013020833333333334, eh = 0.007120768229166667, ih = 0.3645833333333333, sh = 0.005696614583333333, rh = 0.3076171875;
5925
- function Mi(t) {
5952
+ var Jo = 1, Yo = 0.25, ps = 0.046875, ws = 0.01953125, Ss = 0.01068115234375, Zo = 0.75, th = 0.46875, eh = 0.013020833333333334, ih = 0.007120768229166667, sh = 0.3645833333333333, rh = 0.005696614583333333, ah = 0.3076171875;
5953
+ function vi(t) {
5926
5954
  var e = [];
5927
- e[0] = Qo - t * (Jo + t * (ps + t * (ws + t * Ss))), e[1] = t * (Yo - t * (ps + t * (ws + t * Ss)));
5955
+ e[0] = Jo - t * (Yo + t * (ps + t * (ws + t * Ss))), e[1] = t * (Zo - t * (ps + t * (ws + t * Ss)));
5928
5956
  var i = t * t;
5929
- return e[2] = i * (Zo - t * (th + t * eh)), i *= t, e[3] = i * (ih - t * sh), e[4] = i * t * rh, e;
5957
+ return e[2] = i * (th - t * (eh + t * ih)), i *= t, e[3] = i * (sh - t * rh), e[4] = i * t * ah, e;
5930
5958
  }
5931
5959
  function kt(t, e, i, s) {
5932
5960
  return i *= e, e *= e, s[0] * t - i * (s[1] + e * (s[2] + e * (s[3] + e * s[4])));
5933
5961
  }
5934
- var ah = 20;
5935
- function vi(t, e, i) {
5936
- for (var s = 1 / (1 - e), r = t, a = ah; a; --a) {
5962
+ var nh = 20;
5963
+ function yi(t, e, i) {
5964
+ for (var s = 1 / (1 - e), r = t, a = nh; a; --a) {
5937
5965
  var n = Math.sin(r), o = 1 - e * n * n;
5938
5966
  if (o = (kt(r, n, Math.cos(r), i) - t) * (o * Math.sqrt(o)) * s, r -= o, Math.abs(o) < p)
5939
5967
  return r;
5940
5968
  }
5941
5969
  return r;
5942
5970
  }
5943
- function nh() {
5944
- this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.es && (this.en = Mi(this.es), this.ml0 = kt(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
5971
+ function oh() {
5972
+ this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.es && (this.en = vi(this.es), this.ml0 = kt(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en));
5945
5973
  }
5946
- function oh(t) {
5974
+ function hh(t) {
5947
5975
  var e = t.x, i = t.y, s = w(e - this.long0, this.over), r, a, n, o = Math.sin(i), h = Math.cos(i);
5948
5976
  if (this.es) {
5949
5977
  var f = h * s, u = Math.pow(f, 2), c = this.ep2 * Math.pow(h, 2), m = Math.pow(c, 2), d = Math.abs(h) > p ? Math.tan(i) : 0, g = Math.pow(d, 2), M = Math.pow(g, 2);
@@ -5964,28 +5992,28 @@ function oh(t) {
5964
5992
  }
5965
5993
  return t.x = a, t.y = n, t;
5966
5994
  }
5967
- function hh(t) {
5995
+ function lh(t) {
5968
5996
  var e, i, s, r, a = (t.x - this.x0) * (1 / this.a), n = (t.y - this.y0) * (1 / this.a);
5969
5997
  if (this.es)
5970
- if (e = this.ml0 + n / this.k0, i = vi(e, this.es, this.en), Math.abs(i) < y) {
5998
+ if (e = this.ml0 + n / this.k0, i = yi(e, this.es, this.en), Math.abs(i) < y) {
5971
5999
  var u = Math.sin(i), c = Math.cos(i), m = Math.abs(c) > p ? Math.tan(i) : 0, d = this.ep2 * Math.pow(c, 2), g = Math.pow(d, 2), M = Math.pow(m, 2), v = Math.pow(M, 2);
5972
6000
  e = 1 - this.es * Math.pow(u, 2);
5973
6001
  var _ = a * Math.sqrt(e) / this.k0, b = Math.pow(_, 2);
5974
6002
  e = e * m, s = i - e * b / (1 - this.es) * 0.5 * (1 - b / 12 * (5 + 3 * M - 9 * d * M + d - 4 * g - b / 30 * (61 + 90 * M - 252 * d * M + 45 * v + 46 * d - b / 56 * (1385 + 3633 * M + 4095 * v + 1574 * v * M)))), r = w(this.long0 + _ * (1 - b / 6 * (1 + 2 * M + d - b / 20 * (5 + 28 * M + 24 * v + 8 * d * M + 6 * d - b / 42 * (61 + 662 * M + 1320 * v + 720 * v * M)))) / c, this.over);
5975
6003
  } else
5976
- s = y * Jt(n), r = 0;
6004
+ s = y * Yt(n), r = 0;
5977
6005
  else {
5978
6006
  var o = Math.exp(a / this.k0), h = 0.5 * (o - 1 / o), l = this.lat0 + n / this.k0, f = Math.cos(l);
5979
6007
  e = Math.sqrt((1 - Math.pow(f, 2)) / (1 + Math.pow(h, 2))), s = Math.asin(e), n < 0 && (s = -s), h === 0 && f === 0 ? r = 0 : r = w(Math.atan2(h, f) + this.long0, this.over);
5980
6008
  }
5981
6009
  return t.x = r, t.y = s, t;
5982
6010
  }
5983
- var lh = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
6011
+ var ch = ["Fast_Transverse_Mercator", "Fast Transverse Mercator"];
5984
6012
  const Me = {
5985
- init: nh,
5986
- forward: oh,
5987
- inverse: hh,
5988
- names: lh
6013
+ init: oh,
6014
+ forward: hh,
6015
+ inverse: lh,
6016
+ names: ch
5989
6017
  };
5990
6018
  function Er(t) {
5991
6019
  var e = Math.exp(t);
@@ -5996,53 +6024,53 @@ function W(t, e) {
5996
6024
  var i = Math.max(t, e), s = Math.min(t, e) / (i || 1);
5997
6025
  return i * Math.sqrt(1 + Math.pow(s, 2));
5998
6026
  }
5999
- function ch(t) {
6027
+ function uh(t) {
6000
6028
  var e = 1 + t, i = e - 1;
6001
6029
  return i === 0 ? t : t * Math.log(e) / i;
6002
6030
  }
6003
- function uh(t) {
6031
+ function fh(t) {
6004
6032
  var e = Math.abs(t);
6005
- return e = ch(e * (1 + e / (W(1, e) + 1))), t < 0 ? -e : e;
6033
+ return e = uh(e * (1 + e / (W(1, e) + 1))), t < 0 ? -e : e;
6006
6034
  }
6007
- function yi(t, e) {
6035
+ function _i(t, e) {
6008
6036
  for (var i = 2 * Math.cos(2 * e), s = t.length - 1, r = t[s], a = 0, n; --s >= 0; )
6009
6037
  n = -a + i * r + t[s], a = r, r = n;
6010
6038
  return e + n * Math.sin(2 * e);
6011
6039
  }
6012
- function fh(t, e) {
6040
+ function mh(t, e) {
6013
6041
  for (var i = 2 * Math.cos(e), s = t.length - 1, r = t[s], a = 0, n; --s >= 0; )
6014
6042
  n = -a + i * r + t[s], a = r, r = n;
6015
6043
  return Math.sin(e) * n;
6016
6044
  }
6017
- function mh(t) {
6045
+ function dh(t) {
6018
6046
  var e = Math.exp(t);
6019
6047
  return e = (e + 1 / e) / 2, e;
6020
6048
  }
6021
6049
  function xr(t, e, i) {
6022
- for (var s = Math.sin(e), r = Math.cos(e), a = Er(i), n = mh(i), o = 2 * r * n, h = -2 * s * a, l = t.length - 1, f = t[l], u = 0, c = 0, m = 0, d, g; --l >= 0; )
6050
+ for (var s = Math.sin(e), r = Math.cos(e), a = Er(i), n = dh(i), o = 2 * r * n, h = -2 * s * a, l = t.length - 1, f = t[l], u = 0, c = 0, m = 0, d, g; --l >= 0; )
6023
6051
  d = c, g = u, c = f, u = m, f = -d + o * c - h * u + t[l], m = -g + h * c + o * u;
6024
6052
  return o = s * n, h = r * a, [o * f - h * m, o * m + h * f];
6025
6053
  }
6026
- function dh() {
6054
+ function gh() {
6027
6055
  if (!this.approx && (isNaN(this.es) || this.es <= 0))
6028
6056
  throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
6029
6057
  this.approx && (Me.init.apply(this), this.forward = Me.forward, this.inverse = Me.inverse), this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.lat0 = this.lat0 !== void 0 ? this.lat0 : 0, this.cgb = [], this.cbg = [], this.utg = [], this.gtu = [];
6030
6058
  var t = this.es / (1 + Math.sqrt(1 - this.es)), e = t / (2 - t), i = e;
6031
6059
  this.cgb[0] = e * (2 + e * (-2 / 3 + e * (-2 + e * (116 / 45 + e * (26 / 45 + e * (-2854 / 675)))))), this.cbg[0] = e * (-2 + e * (2 / 3 + e * (4 / 3 + e * (-82 / 45 + e * (32 / 45 + e * (4642 / 4725)))))), i = i * e, this.cgb[1] = i * (7 / 3 + e * (-8 / 5 + e * (-227 / 45 + e * (2704 / 315 + e * (2323 / 945))))), this.cbg[1] = i * (5 / 3 + e * (-16 / 15 + e * (-13 / 9 + e * (904 / 315 + e * (-1522 / 945))))), i = i * e, this.cgb[2] = i * (56 / 15 + e * (-136 / 35 + e * (-1262 / 105 + e * (73814 / 2835)))), this.cbg[2] = i * (-26 / 15 + e * (34 / 21 + e * (8 / 5 + e * (-12686 / 2835)))), i = i * e, this.cgb[3] = i * (4279 / 630 + e * (-332 / 35 + e * (-399572 / 14175))), this.cbg[3] = i * (1237 / 630 + e * (-12 / 5 + e * (-24832 / 14175))), i = i * e, this.cgb[4] = i * (4174 / 315 + e * (-144838 / 6237)), this.cbg[4] = i * (-734 / 315 + e * (109598 / 31185)), i = i * e, this.cgb[5] = i * (601676 / 22275), this.cbg[5] = i * (444337 / 155925), i = Math.pow(e, 2), this.Qn = this.k0 / (1 + e) * (1 + i * (1 / 4 + i * (1 / 64 + i / 256))), this.utg[0] = e * (-0.5 + e * (2 / 3 + e * (-37 / 96 + e * (1 / 360 + e * (81 / 512 + e * (-96199 / 604800)))))), this.gtu[0] = e * (0.5 + e * (-2 / 3 + e * (5 / 16 + e * (41 / 180 + e * (-127 / 288 + e * (7891 / 37800)))))), this.utg[1] = i * (-1 / 48 + e * (-1 / 15 + e * (437 / 1440 + e * (-46 / 105 + e * (1118711 / 3870720))))), this.gtu[1] = i * (13 / 48 + e * (-3 / 5 + e * (557 / 1440 + e * (281 / 630 + e * (-1983433 / 1935360))))), i = i * e, this.utg[2] = i * (-17 / 480 + e * (37 / 840 + e * (209 / 4480 + e * (-5569 / 90720)))), this.gtu[2] = i * (61 / 240 + e * (-103 / 140 + e * (15061 / 26880 + e * (167603 / 181440)))), i = i * e, this.utg[3] = i * (-4397 / 161280 + e * (11 / 504 + e * (830251 / 7257600))), this.gtu[3] = i * (49561 / 161280 + e * (-179 / 168 + e * (6601661 / 7257600))), i = i * e, this.utg[4] = i * (-4583 / 161280 + e * (108847 / 3991680)), this.gtu[4] = i * (34729 / 80640 + e * (-3418889 / 1995840)), i = i * e, this.utg[5] = i * (-20648693 / 638668800), this.gtu[5] = i * (212378941 / 319334400);
6032
- var s = yi(this.cbg, this.lat0);
6033
- this.Zb = -this.Qn * (s + fh(this.gtu, 2 * s));
6060
+ var s = _i(this.cbg, this.lat0);
6061
+ this.Zb = -this.Qn * (s + mh(this.gtu, 2 * s));
6034
6062
  }
6035
- function gh(t) {
6063
+ function Mh(t) {
6036
6064
  var e = w(t.x - this.long0, this.over), i = t.y;
6037
- i = yi(this.cbg, i);
6065
+ i = _i(this.cbg, i);
6038
6066
  var s = Math.sin(i), r = Math.cos(i), a = Math.sin(e), n = Math.cos(e);
6039
- i = Math.atan2(s, n * r), e = Math.atan2(a * r, W(s, r * n)), e = uh(Math.tan(e));
6067
+ i = Math.atan2(s, n * r), e = Math.atan2(a * r, W(s, r * n)), e = fh(Math.tan(e));
6040
6068
  var o = xr(this.gtu, 2 * i, 2 * e);
6041
6069
  i = i + o[0], e = e + o[1];
6042
6070
  var h, l;
6043
6071
  return Math.abs(e) <= 2.623395162778 ? (h = this.a * (this.Qn * e) + this.x0, l = this.a * (this.Qn * i + this.Zb) + this.y0) : (h = 1 / 0, l = 1 / 0), t.x = h, t.y = l, t;
6044
6072
  }
6045
- function Mh(t) {
6073
+ function vh(t) {
6046
6074
  var e = (t.x - this.x0) * (1 / this.a), i = (t.y - this.y0) * (1 / this.a);
6047
6075
  i = (i - this.Zb) / this.Qn, e = e / this.Qn;
6048
6076
  var s, r;
@@ -6050,19 +6078,19 @@ function Mh(t) {
6050
6078
  var a = xr(this.utg, 2 * i, 2 * e);
6051
6079
  i = i + a[0], e = e + a[1], e = Math.atan(Er(e));
6052
6080
  var n = Math.sin(i), o = Math.cos(i), h = Math.sin(e), l = Math.cos(e);
6053
- i = Math.atan2(n * l, W(h, l * o)), e = Math.atan2(h, l * o), s = w(e + this.long0, this.over), r = yi(this.cgb, i);
6081
+ i = Math.atan2(n * l, W(h, l * o)), e = Math.atan2(h, l * o), s = w(e + this.long0, this.over), r = _i(this.cgb, i);
6054
6082
  } else
6055
6083
  s = 1 / 0, r = 1 / 0;
6056
6084
  return t.x = s, t.y = r, t;
6057
6085
  }
6058
- var vh = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"];
6086
+ var yh = ["Extended_Transverse_Mercator", "Extended Transverse Mercator", "etmerc", "Transverse_Mercator", "Transverse Mercator", "Gauss Kruger", "Gauss_Kruger", "tmerc"];
6059
6087
  const ve = {
6060
- init: dh,
6061
- forward: gh,
6062
- inverse: Mh,
6063
- names: vh
6088
+ init: gh,
6089
+ forward: Mh,
6090
+ inverse: vh,
6091
+ names: yh
6064
6092
  };
6065
- function yh(t, e) {
6093
+ function _h(t, e) {
6066
6094
  if (t === void 0) {
6067
6095
  if (t = Math.floor((w(e) + Math.PI) * 30 / Math.PI) + 1, t < 0)
6068
6096
  return 0;
@@ -6071,75 +6099,75 @@ function yh(t, e) {
6071
6099
  }
6072
6100
  return t;
6073
6101
  }
6074
- var _h = "etmerc";
6075
- function bh() {
6076
- var t = yh(this.zone, this.long0);
6102
+ var bh = "etmerc";
6103
+ function ph() {
6104
+ var t = _h(this.zone, this.long0);
6077
6105
  if (t === void 0)
6078
6106
  throw new Error("unknown utm zone");
6079
- this.lat0 = 0, this.long0 = (6 * Math.abs(t) - 183) * $, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, ve.init.apply(this), this.forward = ve.forward, this.inverse = ve.inverse;
6107
+ this.lat0 = 0, this.long0 = (6 * Math.abs(t) - 183) * L, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, ve.init.apply(this), this.forward = ve.forward, this.inverse = ve.inverse;
6080
6108
  }
6081
- var ph = ["Universal Transverse Mercator System", "utm"];
6082
- const wh = {
6083
- init: bh,
6084
- names: ph,
6085
- dependsOn: _h
6109
+ var wh = ["Universal Transverse Mercator System", "utm"];
6110
+ const Sh = {
6111
+ init: ph,
6112
+ names: wh,
6113
+ dependsOn: bh
6086
6114
  };
6087
- function _i(t, e) {
6115
+ function bi(t, e) {
6088
6116
  return Math.pow((1 - t) / (1 + t), e);
6089
6117
  }
6090
- var Sh = 20;
6091
- function Eh() {
6118
+ var Eh = 20;
6119
+ function xh() {
6092
6120
  var t = Math.sin(this.lat0), e = Math.cos(this.lat0);
6093
- e *= e, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * t * t), this.C = Math.sqrt(1 + this.es * e * e / (1 - this.es)), this.phic0 = Math.asin(t / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + I) / (Math.pow(Math.tan(0.5 * this.lat0 + I), this.C) * _i(this.e * t, this.ratexp));
6121
+ e *= e, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * t * t), this.C = Math.sqrt(1 + this.es * e * e / (1 - this.es)), this.phic0 = Math.asin(t / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + I) / (Math.pow(Math.tan(0.5 * this.lat0 + I), this.C) * bi(this.e * t, this.ratexp));
6094
6122
  }
6095
- function xh(t) {
6123
+ function Ph(t) {
6096
6124
  var e = t.x, i = t.y;
6097
- return t.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * i + I), this.C) * _i(this.e * Math.sin(i), this.ratexp)) - y, t.x = this.C * e, t;
6125
+ return t.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * i + I), this.C) * bi(this.e * Math.sin(i), this.ratexp)) - y, t.x = this.C * e, t;
6098
6126
  }
6099
6127
  function Ah(t) {
6100
- for (var e = 1e-14, i = t.x / this.C, s = t.y, r = Math.pow(Math.tan(0.5 * s + I) / this.K, 1 / this.C), a = Sh; a > 0 && (s = 2 * Math.atan(r * _i(this.e * Math.sin(t.y), -0.5 * this.e)) - y, !(Math.abs(s - t.y) < e)); --a)
6128
+ for (var e = 1e-14, i = t.x / this.C, s = t.y, r = Math.pow(Math.tan(0.5 * s + I) / this.K, 1 / this.C), a = Eh; a > 0 && (s = 2 * Math.atan(r * bi(this.e * Math.sin(t.y), -0.5 * this.e)) - y, !(Math.abs(s - t.y) < e)); --a)
6101
6129
  t.y = s;
6102
6130
  return a ? (t.x = i, t.y = s, t) : null;
6103
6131
  }
6104
- const bi = {
6105
- init: Eh,
6106
- forward: xh,
6132
+ const pi = {
6133
+ init: xh,
6134
+ forward: Ph,
6107
6135
  inverse: Ah
6108
6136
  };
6109
- function Ph() {
6110
- bi.init.apply(this), this.rc && (this.sinc0 = Math.sin(this.phic0), this.cosc0 = Math.cos(this.phic0), this.R2 = 2 * this.rc, this.title || (this.title = "Oblique Stereographic Alternative"));
6137
+ function Gh() {
6138
+ pi.init.apply(this), this.rc && (this.sinc0 = Math.sin(this.phic0), this.cosc0 = Math.cos(this.phic0), this.R2 = 2 * this.rc, this.title || (this.title = "Oblique Stereographic Alternative"));
6111
6139
  }
6112
- function Gh(t) {
6140
+ function Nh(t) {
6113
6141
  var e, i, s, r;
6114
- return t.x = w(t.x - this.long0, this.over), bi.forward.apply(this, [t]), e = Math.sin(t.y), i = Math.cos(t.y), s = Math.cos(t.x), r = this.k0 * this.R2 / (1 + this.sinc0 * e + this.cosc0 * i * s), t.x = r * i * Math.sin(t.x), t.y = r * (this.cosc0 * e - this.sinc0 * i * s), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
6142
+ return t.x = w(t.x - this.long0, this.over), pi.forward.apply(this, [t]), e = Math.sin(t.y), i = Math.cos(t.y), s = Math.cos(t.x), r = this.k0 * this.R2 / (1 + this.sinc0 * e + this.cosc0 * i * s), t.x = r * i * Math.sin(t.x), t.y = r * (this.cosc0 * e - this.sinc0 * i * s), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
6115
6143
  }
6116
- function Nh(t) {
6144
+ function Ch(t) {
6117
6145
  var e, i, s, r, a;
6118
6146
  if (t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, t.x /= this.k0, t.y /= this.k0, a = W(t.x, t.y)) {
6119
6147
  var n = 2 * Math.atan2(a, this.R2);
6120
6148
  e = Math.sin(n), i = Math.cos(n), r = Math.asin(i * this.sinc0 + t.y * e * this.cosc0 / a), s = Math.atan2(t.x * e, a * this.cosc0 * i - t.y * this.sinc0 * e);
6121
6149
  } else
6122
6150
  r = this.phic0, s = 0;
6123
- return t.x = s, t.y = r, bi.inverse.apply(this, [t]), t.x = w(t.x + this.long0, this.over), t;
6124
- }
6125
- var Ch = ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
6126
- const Ih = {
6127
- init: Ph,
6128
- forward: Gh,
6129
- inverse: Nh,
6130
- names: Ch
6151
+ return t.x = s, t.y = r, pi.inverse.apply(this, [t]), t.x = w(t.x + this.long0, this.over), t;
6152
+ }
6153
+ var Ih = ["Stereographic_North_Pole", "Oblique_Stereographic", "sterea", "Oblique Stereographic Alternative", "Double_Stereographic"];
6154
+ const Th = {
6155
+ init: Gh,
6156
+ forward: Nh,
6157
+ inverse: Ch,
6158
+ names: Ih
6131
6159
  };
6132
- function pi(t, e, i) {
6160
+ function wi(t, e, i) {
6133
6161
  return e *= i, Math.tan(0.5 * (y + t)) * Math.pow((1 - e) / (1 + e), 0.5 * i);
6134
6162
  }
6135
- function Th() {
6136
- this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= p && (this.k0 = 0.5 * (1 + Jt(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= p && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= p && Math.abs(Math.cos(this.lat_ts)) > p && (this.k0 = 0.5 * this.cons * it(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / Z(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = it(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(pi(this.lat0, this.sinlat0, this.e)) - y, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
6163
+ function Rh() {
6164
+ this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.coslat0 = Math.cos(this.lat0), this.sinlat0 = Math.sin(this.lat0), this.sphere ? this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= p && (this.k0 = 0.5 * (1 + Yt(this.lat0) * Math.sin(this.lat_ts))) : (Math.abs(this.coslat0) <= p && (this.lat0 > 0 ? this.con = 1 : this.con = -1), this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e)), this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= p && Math.abs(Math.cos(this.lat_ts)) > p && (this.k0 = 0.5 * this.cons * it(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / Z(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts))), this.ms1 = it(this.e, this.sinlat0, this.coslat0), this.X0 = 2 * Math.atan(wi(this.lat0, this.sinlat0, this.e)) - y, this.cosX0 = Math.cos(this.X0), this.sinX0 = Math.sin(this.X0));
6137
6165
  }
6138
- function Rh(t) {
6166
+ function kh(t) {
6139
6167
  var e = t.x, i = t.y, s = Math.sin(i), r = Math.cos(i), a, n, o, h, l, f, u = w(e - this.long0, this.over);
6140
- return Math.abs(Math.abs(e - this.long0) - Math.PI) <= p && Math.abs(i + this.lat0) <= p ? (t.x = NaN, t.y = NaN, t) : this.sphere ? (a = 2 * this.k0 / (1 + this.sinlat0 * s + this.coslat0 * r * Math.cos(u)), t.x = this.a * a * r * Math.sin(u) + this.x0, t.y = this.a * a * (this.coslat0 * s - this.sinlat0 * r * Math.cos(u)) + this.y0, t) : (n = 2 * Math.atan(pi(i, s, this.e)) - y, h = Math.cos(n), o = Math.sin(n), Math.abs(this.coslat0) <= p ? (l = Z(this.e, i * this.con, this.con * s), f = 2 * this.a * this.k0 * l / this.cons, t.x = this.x0 + f * Math.sin(e - this.long0), t.y = this.y0 - this.con * f * Math.cos(e - this.long0), t) : (Math.abs(this.sinlat0) < p ? (a = 2 * this.a * this.k0 / (1 + h * Math.cos(u)), t.y = a * o) : (a = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * o + this.cosX0 * h * Math.cos(u))), t.y = a * (this.cosX0 * o - this.sinX0 * h * Math.cos(u)) + this.y0), t.x = a * h * Math.sin(u) + this.x0, t));
6168
+ return Math.abs(Math.abs(e - this.long0) - Math.PI) <= p && Math.abs(i + this.lat0) <= p ? (t.x = NaN, t.y = NaN, t) : this.sphere ? (a = 2 * this.k0 / (1 + this.sinlat0 * s + this.coslat0 * r * Math.cos(u)), t.x = this.a * a * r * Math.sin(u) + this.x0, t.y = this.a * a * (this.coslat0 * s - this.sinlat0 * r * Math.cos(u)) + this.y0, t) : (n = 2 * Math.atan(wi(i, s, this.e)) - y, h = Math.cos(n), o = Math.sin(n), Math.abs(this.coslat0) <= p ? (l = Z(this.e, i * this.con, this.con * s), f = 2 * this.a * this.k0 * l / this.cons, t.x = this.x0 + f * Math.sin(e - this.long0), t.y = this.y0 - this.con * f * Math.cos(e - this.long0), t) : (Math.abs(this.sinlat0) < p ? (a = 2 * this.a * this.k0 / (1 + h * Math.cos(u)), t.y = a * o) : (a = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * o + this.cosX0 * h * Math.cos(u))), t.y = a * (this.cosX0 * o - this.sinX0 * h * Math.cos(u)) + this.y0), t.x = a * h * Math.sin(u) + this.x0, t));
6141
6169
  }
6142
- function kh(t) {
6170
+ function $h(t) {
6143
6171
  t.x -= this.x0, t.y -= this.y0;
6144
6172
  var e, i, s, r, a, n = Math.sqrt(t.x * t.x + t.y * t.y);
6145
6173
  if (this.sphere) {
@@ -6148,20 +6176,20 @@ function kh(t) {
6148
6176
  } else if (Math.abs(this.coslat0) <= p) {
6149
6177
  if (n <= p)
6150
6178
  return i = this.lat0, e = this.long0, t.x = e, t.y = i, t;
6151
- t.x *= this.con, t.y *= this.con, s = n * this.cons / (2 * this.a * this.k0), i = this.con * Xt(this.e, s), e = this.con * w(this.con * this.long0 + Math.atan2(t.x, -1 * t.y), this.over);
6179
+ t.x *= this.con, t.y *= this.con, s = n * this.cons / (2 * this.a * this.k0), i = this.con * Qt(this.e, s), e = this.con * w(this.con * this.long0 + Math.atan2(t.x, -1 * t.y), this.over);
6152
6180
  } else
6153
- r = 2 * Math.atan(n * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), e = this.long0, n <= p ? a = this.X0 : (a = Math.asin(Math.cos(r) * this.sinX0 + t.y * Math.sin(r) * this.cosX0 / n), e = w(this.long0 + Math.atan2(t.x * Math.sin(r), n * this.cosX0 * Math.cos(r) - t.y * this.sinX0 * Math.sin(r)), this.over)), i = -1 * Xt(this.e, Math.tan(0.5 * (y + a)));
6181
+ r = 2 * Math.atan(n * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), e = this.long0, n <= p ? a = this.X0 : (a = Math.asin(Math.cos(r) * this.sinX0 + t.y * Math.sin(r) * this.cosX0 / n), e = w(this.long0 + Math.atan2(t.x * Math.sin(r), n * this.cosX0 * Math.cos(r) - t.y * this.sinX0 * Math.sin(r)), this.over)), i = -1 * Qt(this.e, Math.tan(0.5 * (y + a)));
6154
6182
  return t.x = e, t.y = i, t;
6155
6183
  }
6156
- var $h = ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"];
6157
- const Lh = {
6158
- init: Th,
6159
- forward: Rh,
6160
- inverse: kh,
6161
- names: $h,
6162
- ssfn_: pi
6184
+ var Lh = ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"];
6185
+ const Oh = {
6186
+ init: Rh,
6187
+ forward: kh,
6188
+ inverse: $h,
6189
+ names: Lh,
6190
+ ssfn_: wi
6163
6191
  };
6164
- function Oh() {
6192
+ function Fh() {
6165
6193
  var t = this.lat0;
6166
6194
  this.lambda0 = this.long0;
6167
6195
  var e = Math.sin(t), i = this.a, s = this.rf, r = 1 / s, a = 2 * r - Math.pow(r, 2), n = this.e = Math.sqrt(a);
@@ -6169,11 +6197,11 @@ function Oh() {
6169
6197
  var o = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2)), h = Math.log(Math.tan(Math.PI / 4 + t / 2)), l = Math.log((1 + n * e) / (1 - n * e));
6170
6198
  this.K = o - this.alpha * h + this.alpha * n / 2 * l;
6171
6199
  }
6172
- function Fh(t) {
6200
+ function qh(t) {
6173
6201
  var e = Math.log(Math.tan(Math.PI / 4 - t.y / 2)), i = this.e / 2 * Math.log((1 + this.e * Math.sin(t.y)) / (1 - this.e * Math.sin(t.y))), s = -this.alpha * (e + i) + this.K, r = 2 * (Math.atan(Math.exp(s)) - Math.PI / 4), a = this.alpha * (t.x - this.lambda0), n = Math.atan(Math.sin(a) / (Math.sin(this.b0) * Math.tan(r) + Math.cos(this.b0) * Math.cos(a))), o = Math.asin(Math.cos(this.b0) * Math.sin(r) - Math.sin(this.b0) * Math.cos(r) * Math.cos(a));
6174
6202
  return t.y = this.R / 2 * Math.log((1 + Math.sin(o)) / (1 - Math.sin(o))) + this.y0, t.x = this.R * n + this.x0, t;
6175
6203
  }
6176
- function qh(t) {
6204
+ function Uh(t) {
6177
6205
  for (var e = t.x - this.x0, i = t.y - this.y0, s = e / this.R, r = 2 * (Math.atan(Math.exp(i / this.R)) - Math.PI / 4), a = Math.asin(Math.cos(this.b0) * Math.sin(r) + Math.sin(this.b0) * Math.cos(r) * Math.cos(s)), n = Math.atan(Math.sin(s) / (Math.cos(this.b0) * Math.cos(s) - Math.sin(this.b0) * Math.tan(r))), o = this.lambda0 + n / this.alpha, h = 0, l = a, f = -1e3, u = 0; Math.abs(l - f) > 1e-7; ) {
6178
6206
  if (++u > 20)
6179
6207
  return;
@@ -6181,60 +6209,60 @@ function qh(t) {
6181
6209
  }
6182
6210
  return t.x = o, t.y = l, t;
6183
6211
  }
6184
- var Uh = ["somerc"];
6185
- const jh = {
6186
- init: Oh,
6187
- forward: Fh,
6188
- inverse: qh,
6189
- names: Uh
6212
+ var jh = ["somerc"];
6213
+ const Dh = {
6214
+ init: Fh,
6215
+ forward: qh,
6216
+ inverse: Uh,
6217
+ names: jh
6190
6218
  };
6191
- var pt = 1e-7;
6192
- function Dh(t) {
6219
+ var wt = 1e-7;
6220
+ function zh(t) {
6193
6221
  var e = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], i = typeof t.projName == "object" ? Object.keys(t.projName)[0] : t.projName;
6194
6222
  return "no_uoff" in t || "no_off" in t || e.indexOf(i) !== -1 || e.indexOf(dr(i)) !== -1;
6195
6223
  }
6196
- function zh() {
6224
+ function Bh() {
6197
6225
  var t, e, i, s, r, a, n, o, h, l, f = 0, u, c = 0, m = 0, d = 0, g = 0, M = 0, v = 0;
6198
- this.no_off = Dh(this), this.no_rot = "no_rot" in this;
6226
+ this.no_off = zh(this), this.no_rot = "no_rot" in this;
6199
6227
  var _ = !1;
6200
6228
  "alpha" in this && (_ = !0);
6201
6229
  var b = !1;
6202
6230
  if ("rectified_grid_angle" in this && (b = !0), _ && (v = this.alpha), b && (f = this.rectified_grid_angle, _ || (v = 0, _ = !0)), _ || b)
6203
6231
  c = this.longc;
6204
- else if (m = this.long1, g = this.lat1, d = this.long2, M = this.lat2, Math.abs(g - M) <= pt || (t = Math.abs(g)) <= pt || Math.abs(t - y) <= pt || Math.abs(Math.abs(this.lat0) - y) <= pt || Math.abs(Math.abs(M) - y) <= pt)
6232
+ else if (m = this.long1, g = this.lat1, d = this.long2, M = this.lat2, Math.abs(g - M) <= wt || (t = Math.abs(g)) <= wt || Math.abs(t - y) <= wt || Math.abs(Math.abs(this.lat0) - y) <= wt || Math.abs(Math.abs(M) - y) <= wt)
6205
6233
  throw new Error();
6206
6234
  var E = 1 - this.es;
6207
- e = Math.sqrt(E), Math.abs(this.lat0) > p ? (o = Math.sin(this.lat0), i = Math.cos(this.lat0), t = 1 - this.es * o * o, this.B = i * i, this.B = Math.sqrt(1 + this.es * this.B * this.B / E), this.A = this.B * this.k0 * e / t, s = this.B * e / (i * Math.sqrt(t)), r = s * s - 1, r <= 0 ? r = 0 : (r = Math.sqrt(r), this.lat0 < 0 && (r = -r)), this.E = r += s, this.E *= Math.pow(Z(this.e, this.lat0, o), this.B)) : (this.B = 1 / e, this.A = this.k0, this.E = s = r = 1), _ || b ? (_ ? (u = Math.asin(Math.sin(v) / s), b || (f = v)) : (u = f, v = Math.asin(s * Math.sin(u))), this.lam0 = c - Math.asin(0.5 * (r - 1 / r) * Math.tan(u)) / this.B) : (a = Math.pow(Z(this.e, g, Math.sin(g)), this.B), n = Math.pow(Z(this.e, M, Math.sin(M)), this.B), r = this.E / a, h = (n - a) / (n + a), l = this.E * this.E, l = (l - n * a) / (l + n * a), t = m - d, t < -Math.PI ? d -= Vt : t > Math.PI && (d += Vt), this.lam0 = w(0.5 * (m + d) - Math.atan(l * Math.tan(0.5 * this.B * (m - d)) / h) / this.B, this.over), u = Math.atan(2 * Math.sin(this.B * w(m - this.lam0, this.over)) / (r - 1 / r)), f = v = Math.asin(s * Math.sin(u))), this.singam = Math.sin(u), this.cosgam = Math.cos(u), this.sinrot = Math.sin(f), this.cosrot = Math.cos(f), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(s * s - 1) / Math.cos(v))), this.lat0 < 0 && (this.u_0 = -this.u_0)), r = 0.5 * u, this.v_pole_n = this.ArB * Math.log(Math.tan(I - r)), this.v_pole_s = this.ArB * Math.log(Math.tan(I + r));
6235
+ e = Math.sqrt(E), Math.abs(this.lat0) > p ? (o = Math.sin(this.lat0), i = Math.cos(this.lat0), t = 1 - this.es * o * o, this.B = i * i, this.B = Math.sqrt(1 + this.es * this.B * this.B / E), this.A = this.B * this.k0 * e / t, s = this.B * e / (i * Math.sqrt(t)), r = s * s - 1, r <= 0 ? r = 0 : (r = Math.sqrt(r), this.lat0 < 0 && (r = -r)), this.E = r += s, this.E *= Math.pow(Z(this.e, this.lat0, o), this.B)) : (this.B = 1 / e, this.A = this.k0, this.E = s = r = 1), _ || b ? (_ ? (u = Math.asin(Math.sin(v) / s), b || (f = v)) : (u = f, v = Math.asin(s * Math.sin(u))), this.lam0 = c - Math.asin(0.5 * (r - 1 / r) * Math.tan(u)) / this.B) : (a = Math.pow(Z(this.e, g, Math.sin(g)), this.B), n = Math.pow(Z(this.e, M, Math.sin(M)), this.B), r = this.E / a, h = (n - a) / (n + a), l = this.E * this.E, l = (l - n * a) / (l + n * a), t = m - d, t < -Math.PI ? d -= Kt : t > Math.PI && (d += Kt), this.lam0 = w(0.5 * (m + d) - Math.atan(l * Math.tan(0.5 * this.B * (m - d)) / h) / this.B, this.over), u = Math.atan(2 * Math.sin(this.B * w(m - this.lam0, this.over)) / (r - 1 / r)), f = v = Math.asin(s * Math.sin(u))), this.singam = Math.sin(u), this.cosgam = Math.cos(u), this.sinrot = Math.sin(f), this.cosrot = Math.cos(f), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(s * s - 1) / Math.cos(v))), this.lat0 < 0 && (this.u_0 = -this.u_0)), r = 0.5 * u, this.v_pole_n = this.ArB * Math.log(Math.tan(I - r)), this.v_pole_s = this.ArB * Math.log(Math.tan(I + r));
6208
6236
  }
6209
- function Bh(t) {
6237
+ function Wh(t) {
6210
6238
  var e = {}, i, s, r, a, n, o, h, l;
6211
6239
  if (t.x = t.x - this.lam0, Math.abs(Math.abs(t.y) - y) > p) {
6212
6240
  if (n = this.E / Math.pow(Z(this.e, t.y, Math.sin(t.y)), this.B), o = 1 / n, i = 0.5 * (n - o), s = 0.5 * (n + o), a = Math.sin(this.B * t.x), r = (i * this.singam - a * this.cosgam) / s, Math.abs(Math.abs(r) - 1) < p)
6213
6241
  throw new Error();
6214
- l = 0.5 * this.ArB * Math.log((1 - r) / (1 + r)), o = Math.cos(this.B * t.x), Math.abs(o) < pt ? h = this.A * t.x : h = this.ArB * Math.atan2(i * this.cosgam + a * this.singam, o);
6242
+ l = 0.5 * this.ArB * Math.log((1 - r) / (1 + r)), o = Math.cos(this.B * t.x), Math.abs(o) < wt ? h = this.A * t.x : h = this.ArB * Math.atan2(i * this.cosgam + a * this.singam, o);
6215
6243
  } else
6216
6244
  l = t.y > 0 ? this.v_pole_n : this.v_pole_s, h = this.ArB * t.y;
6217
6245
  return this.no_rot ? (e.x = h, e.y = l) : (h -= this.u_0, e.x = l * this.cosrot + h * this.sinrot, e.y = h * this.cosrot - l * this.sinrot), e.x = this.a * e.x + this.x0, e.y = this.a * e.y + this.y0, e;
6218
6246
  }
6219
- function Wh(t) {
6247
+ function Hh(t) {
6220
6248
  var e, i, s, r, a, n, o, h = {};
6221
6249
  if (t.x = (t.x - this.x0) * (1 / this.a), t.y = (t.y - this.y0) * (1 / this.a), this.no_rot ? (i = t.y, e = t.x) : (i = t.x * this.cosrot - t.y * this.sinrot, e = t.y * this.cosrot + t.x * this.sinrot + this.u_0), s = Math.exp(-this.BrA * i), r = 0.5 * (s - 1 / s), a = 0.5 * (s + 1 / s), n = Math.sin(this.BrA * e), o = (n * this.cosgam + r * this.singam) / a, Math.abs(Math.abs(o) - 1) < p)
6222
6250
  h.x = 0, h.y = o < 0 ? -y : y;
6223
6251
  else {
6224
- if (h.y = this.E / Math.sqrt((1 + o) / (1 - o)), h.y = Xt(this.e, Math.pow(h.y, 1 / this.B)), h.y === 1 / 0)
6252
+ if (h.y = this.E / Math.sqrt((1 + o) / (1 - o)), h.y = Qt(this.e, Math.pow(h.y, 1 / this.B)), h.y === 1 / 0)
6225
6253
  throw new Error();
6226
6254
  h.x = -this.rB * Math.atan2(r * this.cosgam - n * this.singam, Math.cos(this.BrA * e));
6227
6255
  }
6228
6256
  return h.x += this.lam0, h;
6229
6257
  }
6230
- var Hh = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
6231
- const Vh = {
6232
- init: zh,
6233
- forward: Bh,
6234
- inverse: Wh,
6235
- names: Hh
6258
+ var Vh = ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"];
6259
+ const Kh = {
6260
+ init: Bh,
6261
+ forward: Wh,
6262
+ inverse: Hh,
6263
+ names: Vh
6236
6264
  };
6237
- function Kh() {
6265
+ function Xh() {
6238
6266
  if (this.lat2 || (this.lat2 = this.lat1), this.k0 || (this.k0 = 1), this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, !(Math.abs(this.lat1 + this.lat2) < p)) {
6239
6267
  var t = this.b / this.a;
6240
6268
  this.e = Math.sqrt(1 - t * t);
@@ -6242,9 +6270,9 @@ function Kh() {
6242
6270
  Math.abs(this.lat1 - this.lat2) > p ? this.ns = Math.log(s / o) / Math.log(r / h) : this.ns = e, isNaN(this.ns) && (this.ns = e), this.f0 = s / (this.ns * Math.pow(r, this.ns)), this.rh = this.a * this.f0 * Math.pow(l, this.ns), this.title || (this.title = "Lambert Conformal Conic");
6243
6271
  }
6244
6272
  }
6245
- function Xh(t) {
6273
+ function Qh(t) {
6246
6274
  var e = t.x, i = t.y;
6247
- Math.abs(2 * Math.abs(i) - Math.PI) <= p && (i = Jt(i) * (y - 2 * p));
6275
+ Math.abs(2 * Math.abs(i) - Math.PI) <= p && (i = Yt(i) * (y - 2 * p));
6248
6276
  var s = Math.abs(Math.abs(i) - y), r, a;
6249
6277
  if (s > p)
6250
6278
  r = Z(this.e, i, Math.sin(i)), a = this.a * this.f0 * Math.pow(r, this.ns);
@@ -6256,18 +6284,18 @@ function Xh(t) {
6256
6284
  var n = this.ns * w(e - this.long0, this.over);
6257
6285
  return t.x = this.k0 * (a * Math.sin(n)) + this.x0, t.y = this.k0 * (this.rh - a * Math.cos(n)) + this.y0, t;
6258
6286
  }
6259
- function Qh(t) {
6287
+ function Jh(t) {
6260
6288
  var e, i, s, r, a, n = (t.x - this.x0) / this.k0, o = this.rh - (t.y - this.y0) / this.k0;
6261
6289
  this.ns > 0 ? (e = Math.sqrt(n * n + o * o), i = 1) : (e = -Math.sqrt(n * n + o * o), i = -1);
6262
6290
  var h = 0;
6263
6291
  if (e !== 0 && (h = Math.atan2(i * n, i * o)), e !== 0 || this.ns > 0) {
6264
- if (i = 1 / this.ns, s = Math.pow(e / (this.a * this.f0), i), r = Xt(this.e, s), r === -9999)
6292
+ if (i = 1 / this.ns, s = Math.pow(e / (this.a * this.f0), i), r = Qt(this.e, s), r === -9999)
6265
6293
  return null;
6266
6294
  } else
6267
6295
  r = -y;
6268
6296
  return a = w(h / this.ns + this.long0, this.over), t.x = a, t.y = r, t;
6269
6297
  }
6270
- var Jh = [
6298
+ var Yh = [
6271
6299
  "Lambert Tangential Conformal Conic Projection",
6272
6300
  "Lambert_Conformal_Conic",
6273
6301
  "Lambert_Conformal_Conic_1SP",
@@ -6276,20 +6304,20 @@ var Jh = [
6276
6304
  "Lambert Conic Conformal (1SP)",
6277
6305
  "Lambert Conic Conformal (2SP)"
6278
6306
  ];
6279
- const Yh = {
6280
- init: Kh,
6281
- forward: Xh,
6282
- inverse: Qh,
6283
- names: Jh
6307
+ const Zh = {
6308
+ init: Xh,
6309
+ forward: Qh,
6310
+ inverse: Jh,
6311
+ names: Yh
6284
6312
  };
6285
- function Zh() {
6313
+ function tl() {
6286
6314
  this.a = 6377397155e-3, this.es = 0.006674372230614, this.e = Math.sqrt(this.es), this.lat0 || (this.lat0 = 0.863937979737193), this.long0 || (this.long0 = 0.7417649320975901 - 0.308341501185665), this.k0 || (this.k0 = 0.9999), this.s45 = 0.785398163397448, this.s90 = 2 * this.s45, this.fi0 = this.lat0, this.e2 = this.es, this.e = Math.sqrt(this.e2), this.alfa = Math.sqrt(1 + this.e2 * Math.pow(Math.cos(this.fi0), 4) / (1 - this.e2)), this.uq = 1.04216856380474, this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa), this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2), this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g, this.k1 = this.k0, this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2)), this.s0 = 1.37008346281555, this.n = Math.sin(this.s0), this.ro0 = this.k1 * this.n0 / Math.tan(this.s0), this.ad = this.s90 - this.uq;
6287
6315
  }
6288
- function tl(t) {
6316
+ function el(t) {
6289
6317
  var e, i, s, r, a, n, o, h = t.x, l = t.y, f = w(h - this.long0, this.over);
6290
6318
  return e = Math.pow((1 + this.e * Math.sin(l)) / (1 - this.e * Math.sin(l)), this.alfa * this.e / 2), i = 2 * (Math.atan(this.k * Math.pow(Math.tan(l / 2 + this.s45), this.alfa) / e) - this.s45), s = -f * this.alfa, r = Math.asin(Math.cos(this.ad) * Math.sin(i) + Math.sin(this.ad) * Math.cos(i) * Math.cos(s)), a = Math.asin(Math.cos(i) * Math.sin(s) / Math.cos(r)), n = this.n * a, o = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(r / 2 + this.s45), this.n), t.y = o * Math.cos(n) / 1, t.x = o * Math.sin(n) / 1, this.czech || (t.y *= -1, t.x *= -1), t;
6291
6319
  }
6292
- function el(t) {
6320
+ function il(t) {
6293
6321
  var e, i, s, r, a, n, o, h, l = t.x;
6294
6322
  t.x = t.y, t.y = l, this.czech || (t.y *= -1, t.x *= -1), n = Math.sqrt(t.x * t.x + t.y * t.y), a = Math.atan2(t.y, t.x), r = a / Math.sin(this.s0), s = 2 * (Math.atan(Math.pow(this.ro0 / n, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45), e = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(r)), i = Math.asin(Math.cos(s) * Math.sin(r) / Math.cos(e)), t.x = this.long0 - i / this.alfa, o = e, h = 0;
6295
6323
  var f = 0;
@@ -6298,36 +6326,36 @@ function el(t) {
6298
6326
  while (h === 0 && f < 15);
6299
6327
  return f >= 15 ? null : t;
6300
6328
  }
6301
- var il = ["Krovak", "Krovak Modified", "Krovak (North Orientated)", "Krovak Modified (North Orientated)", "krovak"];
6302
- const sl = {
6303
- init: Zh,
6304
- forward: tl,
6305
- inverse: el,
6306
- names: il
6329
+ var sl = ["Krovak", "Krovak Modified", "Krovak (North Orientated)", "Krovak Modified (North Orientated)", "krovak"];
6330
+ const rl = {
6331
+ init: tl,
6332
+ forward: el,
6333
+ inverse: il,
6334
+ names: sl
6307
6335
  };
6308
6336
  function z(t, e, i, s, r) {
6309
6337
  return t * r - e * Math.sin(2 * r) + i * Math.sin(4 * r) - s * Math.sin(6 * r);
6310
6338
  }
6311
- function Yt(t) {
6339
+ function Zt(t) {
6312
6340
  return 1 - 0.25 * t * (1 + t / 16 * (3 + 1.25 * t));
6313
6341
  }
6314
- function Zt(t) {
6342
+ function te(t) {
6315
6343
  return 0.375 * t * (1 + 0.25 * t * (1 + 0.46875 * t));
6316
6344
  }
6317
- function te(t) {
6345
+ function ee(t) {
6318
6346
  return 0.05859375 * t * t * (1 + 0.75 * t);
6319
6347
  }
6320
- function ee(t) {
6348
+ function ie(t) {
6321
6349
  return t * t * t * (35 / 3072);
6322
6350
  }
6323
- function wi(t, e, i) {
6351
+ function Si(t, e, i) {
6324
6352
  var s = e * i;
6325
6353
  return t / Math.sqrt(1 - s * s);
6326
6354
  }
6327
- function ft(t) {
6328
- return Math.abs(t) < y ? t : t - Jt(t) * Math.PI;
6355
+ function mt(t) {
6356
+ return Math.abs(t) < y ? t : t - Yt(t) * Math.PI;
6329
6357
  }
6330
- function Pe(t, e, i, s, r) {
6358
+ function Ae(t, e, i, s, r) {
6331
6359
  var a, n;
6332
6360
  a = t / e;
6333
6361
  for (var o = 0; o < 15; o++)
@@ -6335,67 +6363,67 @@ function Pe(t, e, i, s, r) {
6335
6363
  return a;
6336
6364
  return NaN;
6337
6365
  }
6338
- function rl() {
6339
- this.sphere || (this.e0 = Yt(this.es), this.e1 = Zt(this.es), this.e2 = te(this.es), this.e3 = ee(this.es), this.ml0 = this.a * z(this.e0, this.e1, this.e2, this.e3, this.lat0));
6366
+ function al() {
6367
+ this.sphere || (this.e0 = Zt(this.es), this.e1 = te(this.es), this.e2 = ee(this.es), this.e3 = ie(this.es), this.ml0 = this.a * z(this.e0, this.e1, this.e2, this.e3, this.lat0));
6340
6368
  }
6341
- function al(t) {
6369
+ function nl(t) {
6342
6370
  var e, i, s = t.x, r = t.y;
6343
6371
  if (s = w(s - this.long0, this.over), this.sphere)
6344
6372
  e = this.a * Math.asin(Math.cos(r) * Math.sin(s)), i = this.a * (Math.atan2(Math.tan(r), Math.cos(s)) - this.lat0);
6345
6373
  else {
6346
- var a = Math.sin(r), n = Math.cos(r), o = wi(this.a, this.e, a), h = Math.tan(r) * Math.tan(r), l = s * Math.cos(r), f = l * l, u = this.es * n * n / (1 - this.es), c = this.a * z(this.e0, this.e1, this.e2, this.e3, r);
6374
+ var a = Math.sin(r), n = Math.cos(r), o = Si(this.a, this.e, a), h = Math.tan(r) * Math.tan(r), l = s * Math.cos(r), f = l * l, u = this.es * n * n / (1 - this.es), c = this.a * z(this.e0, this.e1, this.e2, this.e3, r);
6347
6375
  e = o * l * (1 - f * h * (1 / 6 - (8 - h + 8 * u) * f / 120)), i = c - this.ml0 + o * a / n * f * (0.5 + (5 - h + 6 * u) * f / 24);
6348
6376
  }
6349
6377
  return t.x = e + this.x0, t.y = i + this.y0, t;
6350
6378
  }
6351
- function nl(t) {
6379
+ function ol(t) {
6352
6380
  t.x -= this.x0, t.y -= this.y0;
6353
6381
  var e = t.x / this.a, i = t.y / this.a, s, r;
6354
6382
  if (this.sphere) {
6355
6383
  var a = i + this.lat0;
6356
6384
  s = Math.asin(Math.sin(a) * Math.cos(e)), r = Math.atan2(Math.tan(e), Math.cos(a));
6357
6385
  } else {
6358
- var n = this.ml0 / this.a + i, o = Pe(n, this.e0, this.e1, this.e2, this.e3);
6386
+ var n = this.ml0 / this.a + i, o = Ae(n, this.e0, this.e1, this.e2, this.e3);
6359
6387
  if (Math.abs(Math.abs(o) - y) <= p)
6360
6388
  return t.x = this.long0, t.y = y, i < 0 && (t.y *= -1), t;
6361
- var h = wi(this.a, this.e, Math.sin(o)), l = h * h * h / this.a / this.a * (1 - this.es), f = Math.pow(Math.tan(o), 2), u = e * this.a / h, c = u * u;
6389
+ var h = Si(this.a, this.e, Math.sin(o)), l = h * h * h / this.a / this.a * (1 - this.es), f = Math.pow(Math.tan(o), 2), u = e * this.a / h, c = u * u;
6362
6390
  s = o - h * Math.tan(o) / l * u * u * (0.5 - (1 + 3 * f) * u * u / 24), r = u * (1 - c * (f / 3 + (1 + 3 * f) * f * c / 15)) / Math.cos(o);
6363
6391
  }
6364
- return t.x = w(r + this.long0, this.over), t.y = ft(s), t;
6392
+ return t.x = w(r + this.long0, this.over), t.y = mt(s), t;
6365
6393
  }
6366
- var ol = ["Cassini", "Cassini_Soldner", "cass"];
6367
- const hl = {
6368
- init: rl,
6369
- forward: al,
6370
- inverse: nl,
6371
- names: ol
6394
+ var hl = ["Cassini", "Cassini_Soldner", "cass"];
6395
+ const ll = {
6396
+ init: al,
6397
+ forward: nl,
6398
+ inverse: ol,
6399
+ names: hl
6372
6400
  };
6373
6401
  function et(t, e) {
6374
6402
  var i;
6375
6403
  return t > 1e-7 ? (i = t * e, (1 - t * t) * (e / (1 - i * i) - 0.5 / t * Math.log((1 - i) / (1 + i)))) : 2 * e;
6376
6404
  }
6377
- var ll = 0.3333333333333333, cl = 0.17222222222222222, ul = 0.10257936507936508, fl = 0.06388888888888888, ml = 0.0664021164021164, dl = 0.016415012942191543;
6378
- function Ar(t) {
6405
+ var cl = 0.3333333333333333, ul = 0.17222222222222222, fl = 0.10257936507936508, ml = 0.06388888888888888, dl = 0.0664021164021164, gl = 0.016415012942191543;
6406
+ function Pr(t) {
6379
6407
  var e, i = [];
6380
- return i[0] = t * ll, e = t * t, i[0] += e * cl, i[1] = e * fl, e *= t, i[0] += e * ul, i[1] += e * ml, i[2] = e * dl, i;
6408
+ return i[0] = t * cl, e = t * t, i[0] += e * ul, i[1] = e * ml, e *= t, i[0] += e * fl, i[1] += e * dl, i[2] = e * gl, i;
6381
6409
  }
6382
- function Pr(t, e) {
6410
+ function Ar(t, e) {
6383
6411
  var i = t + t;
6384
6412
  return t + e[0] * Math.sin(i) + e[1] * Math.sin(i + i) + e[2] * Math.sin(i + i + i);
6385
6413
  }
6386
- var ri = 1, ai = 2, ni = 3, ye = 4;
6387
- function gl() {
6414
+ var ai = 1, ni = 2, oi = 3, ye = 4;
6415
+ function Ml() {
6388
6416
  var t = Math.abs(this.lat0);
6389
- if (Math.abs(t - y) < p ? this.mode = this.lat0 < 0 ? ri : ai : Math.abs(t) < p ? this.mode = ni : this.mode = ye, this.es > 0) {
6417
+ if (Math.abs(t - y) < p ? this.mode = this.lat0 < 0 ? ai : ni : Math.abs(t) < p ? this.mode = oi : this.mode = ye, this.es > 0) {
6390
6418
  var e;
6391
- switch (this.qp = et(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa = Ar(this.es), this.mode) {
6392
- case ai:
6419
+ switch (this.qp = et(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa = Pr(this.es), this.mode) {
6420
+ case ni:
6393
6421
  this.dd = 1;
6394
6422
  break;
6395
- case ri:
6423
+ case ai:
6396
6424
  this.dd = 1;
6397
6425
  break;
6398
- case ni:
6426
+ case oi:
6399
6427
  this.rq = Math.sqrt(0.5 * this.qp), this.dd = 1 / this.rq, this.xmf = 1, this.ymf = 0.5 * this.qp;
6400
6428
  break;
6401
6429
  case ye:
@@ -6405,7 +6433,7 @@ function gl() {
6405
6433
  } else
6406
6434
  this.mode === ye && (this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0));
6407
6435
  }
6408
- function Ml(t) {
6436
+ function vl(t) {
6409
6437
  var e, i, s, r, a, n, o, h, l, f, u = t.x, c = t.y;
6410
6438
  if (u = w(u - this.long0, this.over), this.sphere) {
6411
6439
  if (a = Math.sin(c), f = Math.cos(c), s = Math.cos(u), this.mode === this.OBLIQ || this.mode === this.EQUIT) {
@@ -6447,7 +6475,7 @@ function Ml(t) {
6447
6475
  }
6448
6476
  return t.x = this.a * e + this.x0, t.y = this.a * i + this.y0, t;
6449
6477
  }
6450
- function vl(t) {
6478
+ function yl(t) {
6451
6479
  t.x -= this.x0, t.y -= this.y0;
6452
6480
  var e = t.x / this.a, i = t.y / this.a, s, r, a, n, o, h, l;
6453
6481
  if (this.sphere) {
@@ -6479,39 +6507,39 @@ function vl(t) {
6479
6507
  return t.x = this.long0, t.y = this.lat0, t;
6480
6508
  l = 1 - o / this.qp, this.mode === this.S_POLE && (l = -l);
6481
6509
  }
6482
- s = Math.atan2(e, i), r = Pr(Math.asin(l), this.apa);
6510
+ s = Math.atan2(e, i), r = Ar(Math.asin(l), this.apa);
6483
6511
  }
6484
6512
  return t.x = w(this.long0 + s, this.over), t.y = r, t;
6485
6513
  }
6486
- var yl = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
6487
- const _l = {
6488
- init: gl,
6489
- forward: Ml,
6490
- inverse: vl,
6491
- names: yl,
6492
- S_POLE: ri,
6493
- N_POLE: ai,
6494
- EQUIT: ni,
6514
+ var _l = ["Lambert Azimuthal Equal Area", "Lambert_Azimuthal_Equal_Area", "laea"];
6515
+ const bl = {
6516
+ init: Ml,
6517
+ forward: vl,
6518
+ inverse: yl,
6519
+ names: _l,
6520
+ S_POLE: ai,
6521
+ N_POLE: ni,
6522
+ EQUIT: oi,
6495
6523
  OBLIQ: ye
6496
6524
  };
6497
- function ut(t) {
6525
+ function ft(t) {
6498
6526
  return Math.abs(t) > 1 && (t = t > 1 ? 1 : -1), Math.asin(t);
6499
6527
  }
6500
- function bl() {
6528
+ function pl() {
6501
6529
  Math.abs(this.lat1 + this.lat2) < p || (this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e3 = Math.sqrt(this.es), this.sin_po = Math.sin(this.lat1), this.cos_po = Math.cos(this.lat1), this.t1 = this.sin_po, this.con = this.sin_po, this.ms1 = it(this.e3, this.sin_po, this.cos_po), this.qs1 = et(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat2), this.cos_po = Math.cos(this.lat2), this.t2 = this.sin_po, this.ms2 = it(this.e3, this.sin_po, this.cos_po), this.qs2 = et(this.e3, this.sin_po), this.sin_po = Math.sin(this.lat0), this.cos_po = Math.cos(this.lat0), this.t3 = this.sin_po, this.qs0 = et(this.e3, this.sin_po), Math.abs(this.lat1 - this.lat2) > p ? this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1) : this.ns0 = this.con, this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1, this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0);
6502
6530
  }
6503
- function pl(t) {
6531
+ function wl(t) {
6504
6532
  var e = t.x, i = t.y;
6505
6533
  this.sin_phi = Math.sin(i), this.cos_phi = Math.cos(i);
6506
6534
  var s = et(this.e3, this.sin_phi), r = this.a * Math.sqrt(this.c - this.ns0 * s) / this.ns0, a = this.ns0 * w(e - this.long0, this.over), n = r * Math.sin(a) + this.x0, o = this.rh - r * Math.cos(a) + this.y0;
6507
6535
  return t.x = n, t.y = o, t;
6508
6536
  }
6509
- function wl(t) {
6537
+ function Sl(t) {
6510
6538
  var e, i, s, r, a, n;
6511
6539
  return t.x -= this.x0, t.y = this.rh - t.y + this.y0, this.ns0 >= 0 ? (e = Math.sqrt(t.x * t.x + t.y * t.y), s = 1) : (e = -Math.sqrt(t.x * t.x + t.y * t.y), s = -1), r = 0, e !== 0 && (r = Math.atan2(s * t.x, s * t.y)), s = e * this.ns0 / this.a, this.sphere ? n = Math.asin((this.c - s * s) / (2 * this.ns0)) : (i = (this.c - s * s) / this.ns0, n = this.phi1z(this.e3, i)), a = w(r / this.ns0 + this.long0, this.over), t.x = a, t.y = n, t;
6512
6540
  }
6513
- function Sl(t, e) {
6514
- var i, s, r, a, n, o = ut(0.5 * e);
6541
+ function El(t, e) {
6542
+ var i, s, r, a, n, o = ft(0.5 * e);
6515
6543
  if (t < p)
6516
6544
  return o;
6517
6545
  for (var h = t * t, l = 1; l <= 25; l++)
@@ -6519,33 +6547,33 @@ function Sl(t, e) {
6519
6547
  return o;
6520
6548
  return null;
6521
6549
  }
6522
- var El = ["Albers_Conic_Equal_Area", "Albers_Equal_Area", "Albers", "aea"];
6523
- const xl = {
6524
- init: bl,
6525
- forward: pl,
6526
- inverse: wl,
6527
- names: El,
6528
- phi1z: Sl
6550
+ var xl = ["Albers_Conic_Equal_Area", "Albers_Equal_Area", "Albers", "aea"];
6551
+ const Pl = {
6552
+ init: pl,
6553
+ forward: wl,
6554
+ inverse: Sl,
6555
+ names: xl,
6556
+ phi1z: El
6529
6557
  };
6530
6558
  function Al() {
6531
6559
  this.sin_p14 = Math.sin(this.lat0), this.cos_p14 = Math.cos(this.lat0), this.infinity_dist = 1e3 * this.a, this.rc = 1;
6532
6560
  }
6533
- function Pl(t) {
6561
+ function Gl(t) {
6534
6562
  var e, i, s, r, a, n, o, h, l = t.x, f = t.y;
6535
6563
  return s = w(l - this.long0, this.over), e = Math.sin(f), i = Math.cos(f), r = Math.cos(s), n = this.sin_p14 * e + this.cos_p14 * i * r, a = 1, n > 0 || Math.abs(n) <= p ? (o = this.x0 + this.a * a * i * Math.sin(s) / n, h = this.y0 + this.a * a * (this.cos_p14 * e - this.sin_p14 * i * r) / n) : (o = this.x0 + this.infinity_dist * i * Math.sin(s), h = this.y0 + this.infinity_dist * (this.cos_p14 * e - this.sin_p14 * i * r)), t.x = o, t.y = h, t;
6536
6564
  }
6537
- function Gl(t) {
6565
+ function Nl(t) {
6538
6566
  var e, i, s, r, a, n;
6539
- return t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, t.x /= this.k0, t.y /= this.k0, (e = Math.sqrt(t.x * t.x + t.y * t.y)) ? (r = Math.atan2(e, this.rc), i = Math.sin(r), s = Math.cos(r), n = ut(s * this.sin_p14 + t.y * i * this.cos_p14 / e), a = Math.atan2(t.x * i, e * this.cos_p14 * s - t.y * this.sin_p14 * i), a = w(this.long0 + a, this.over)) : (n = this.phic0, a = 0), t.x = a, t.y = n, t;
6567
+ return t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, t.x /= this.k0, t.y /= this.k0, (e = Math.sqrt(t.x * t.x + t.y * t.y)) ? (r = Math.atan2(e, this.rc), i = Math.sin(r), s = Math.cos(r), n = ft(s * this.sin_p14 + t.y * i * this.cos_p14 / e), a = Math.atan2(t.x * i, e * this.cos_p14 * s - t.y * this.sin_p14 * i), a = w(this.long0 + a, this.over)) : (n = this.phic0, a = 0), t.x = a, t.y = n, t;
6540
6568
  }
6541
- var Nl = ["gnom"];
6542
- const Cl = {
6569
+ var Cl = ["gnom"];
6570
+ const Il = {
6543
6571
  init: Al,
6544
- forward: Pl,
6545
- inverse: Gl,
6546
- names: Nl
6572
+ forward: Gl,
6573
+ inverse: Nl,
6574
+ names: Cl
6547
6575
  };
6548
- function Il(t, e) {
6576
+ function Tl(t, e) {
6549
6577
  var i = 1 - (1 - t * t) / (2 * t) * Math.log((1 - t) / (1 + t));
6550
6578
  if (Math.abs(Math.abs(e) - i) < 1e-6)
6551
6579
  return e < 0 ? -1 * y : y;
@@ -6554,10 +6582,10 @@ function Il(t, e) {
6554
6582
  return s;
6555
6583
  return NaN;
6556
6584
  }
6557
- function Tl() {
6585
+ function Rl() {
6558
6586
  this.sphere || (this.k0 = it(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
6559
6587
  }
6560
- function Rl(t) {
6588
+ function kl(t) {
6561
6589
  var e = t.x, i = t.y, s, r, a = w(e - this.long0, this.over);
6562
6590
  if (this.sphere)
6563
6591
  s = this.x0 + this.a * a * Math.cos(this.lat_ts), r = this.y0 + this.a * Math.sin(i) / Math.cos(this.lat_ts);
@@ -6567,53 +6595,53 @@ function Rl(t) {
6567
6595
  }
6568
6596
  return t.x = s, t.y = r, t;
6569
6597
  }
6570
- function kl(t) {
6598
+ function $l(t) {
6571
6599
  t.x -= this.x0, t.y -= this.y0;
6572
6600
  var e, i;
6573
- return this.sphere ? (e = w(this.long0 + t.x / this.a / Math.cos(this.lat_ts), this.over), i = Math.asin(t.y / this.a * Math.cos(this.lat_ts))) : (i = Il(this.e, 2 * t.y * this.k0 / this.a), e = w(this.long0 + t.x / (this.a * this.k0), this.over)), t.x = e, t.y = i, t;
6574
- }
6575
- var $l = ["cea"];
6576
- const Ll = {
6577
- init: Tl,
6578
- forward: Rl,
6579
- inverse: kl,
6580
- names: $l
6601
+ return this.sphere ? (e = w(this.long0 + t.x / this.a / Math.cos(this.lat_ts), this.over), i = Math.asin(t.y / this.a * Math.cos(this.lat_ts))) : (i = Tl(this.e, 2 * t.y * this.k0 / this.a), e = w(this.long0 + t.x / (this.a * this.k0), this.over)), t.x = e, t.y = i, t;
6602
+ }
6603
+ var Ll = ["cea"];
6604
+ const Ol = {
6605
+ init: Rl,
6606
+ forward: kl,
6607
+ inverse: $l,
6608
+ names: Ll
6581
6609
  };
6582
- function Ol() {
6610
+ function Fl() {
6583
6611
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
6584
6612
  }
6585
- function Fl(t) {
6586
- var e = t.x, i = t.y, s = w(e - this.long0, this.over), r = ft(i - this.lat0);
6613
+ function ql(t) {
6614
+ var e = t.x, i = t.y, s = w(e - this.long0, this.over), r = mt(i - this.lat0);
6587
6615
  return t.x = this.x0 + this.a * s * this.rc, t.y = this.y0 + this.a * r, t;
6588
6616
  }
6589
- function ql(t) {
6617
+ function Ul(t) {
6590
6618
  var e = t.x, i = t.y;
6591
- return t.x = w(this.long0 + (e - this.x0) / (this.a * this.rc), this.over), t.y = ft(this.lat0 + (i - this.y0) / this.a), t;
6592
- }
6593
- var Ul = ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"];
6594
- const jl = {
6595
- init: Ol,
6596
- forward: Fl,
6597
- inverse: ql,
6598
- names: Ul
6619
+ return t.x = w(this.long0 + (e - this.x0) / (this.a * this.rc), this.over), t.y = mt(this.lat0 + (i - this.y0) / this.a), t;
6620
+ }
6621
+ var jl = ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"];
6622
+ const Dl = {
6623
+ init: Fl,
6624
+ forward: ql,
6625
+ inverse: Ul,
6626
+ names: jl
6599
6627
  };
6600
6628
  var Es = 20;
6601
- function Dl() {
6602
- this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = Yt(this.es), this.e1 = Zt(this.es), this.e2 = te(this.es), this.e3 = ee(this.es), this.ml0 = this.a * z(this.e0, this.e1, this.e2, this.e3, this.lat0);
6629
+ function zl() {
6630
+ this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = Zt(this.es), this.e1 = te(this.es), this.e2 = ee(this.es), this.e3 = ie(this.es), this.ml0 = this.a * z(this.e0, this.e1, this.e2, this.e3, this.lat0);
6603
6631
  }
6604
- function zl(t) {
6632
+ function Bl(t) {
6605
6633
  var e = t.x, i = t.y, s, r, a, n = w(e - this.long0, this.over);
6606
6634
  if (a = n * Math.sin(i), this.sphere)
6607
- Math.abs(i) <= p ? (s = this.a * n, r = -1 * this.a * this.lat0) : (s = this.a * Math.sin(a) / Math.tan(i), r = this.a * (ft(i - this.lat0) + (1 - Math.cos(a)) / Math.tan(i)));
6635
+ Math.abs(i) <= p ? (s = this.a * n, r = -1 * this.a * this.lat0) : (s = this.a * Math.sin(a) / Math.tan(i), r = this.a * (mt(i - this.lat0) + (1 - Math.cos(a)) / Math.tan(i)));
6608
6636
  else if (Math.abs(i) <= p)
6609
6637
  s = this.a * n, r = -1 * this.ml0;
6610
6638
  else {
6611
- var o = wi(this.a, this.e, Math.sin(i)) / Math.tan(i);
6639
+ var o = Si(this.a, this.e, Math.sin(i)) / Math.tan(i);
6612
6640
  s = o * Math.sin(a), r = this.a * z(this.e0, this.e1, this.e2, this.e3, i) - this.ml0 + o * (1 - Math.cos(a));
6613
6641
  }
6614
6642
  return t.x = s + this.x0, t.y = r + this.y0, t;
6615
6643
  }
6616
- function Bl(t) {
6644
+ function Wl(t) {
6617
6645
  var e, i, s, r, a, n, o, h, l;
6618
6646
  if (s = t.x - this.x0, r = t.y - this.y0, this.sphere)
6619
6647
  if (Math.abs(r + this.a * this.lat0) <= p)
@@ -6642,18 +6670,18 @@ function Bl(t) {
6642
6670
  }
6643
6671
  return t.x = e, t.y = i, t;
6644
6672
  }
6645
- var Wl = ["Polyconic", "American_Polyconic", "poly"];
6646
- const Hl = {
6647
- init: Dl,
6648
- forward: zl,
6649
- inverse: Bl,
6650
- names: Wl
6673
+ var Hl = ["Polyconic", "American_Polyconic", "poly"];
6674
+ const Vl = {
6675
+ init: zl,
6676
+ forward: Bl,
6677
+ inverse: Wl,
6678
+ names: Hl
6651
6679
  };
6652
- function Vl() {
6680
+ function Kl() {
6653
6681
  this.A = [], this.A[1] = 0.6399175073, this.A[2] = -0.1358797613, this.A[3] = 0.063294409, this.A[4] = -0.02526853, this.A[5] = 0.0117879, this.A[6] = -55161e-7, this.A[7] = 26906e-7, this.A[8] = -1333e-6, this.A[9] = 67e-5, this.A[10] = -34e-5, this.B_re = [], this.B_im = [], this.B_re[1] = 0.7557853228, this.B_im[1] = 0, this.B_re[2] = 0.249204646, this.B_im[2] = 3371507e-9, this.B_re[3] = -1541739e-9, this.B_im[3] = 0.04105856, this.B_re[4] = -0.10162907, this.B_im[4] = 0.01727609, this.B_re[5] = -0.26623489, this.B_im[5] = -0.36249218, this.B_re[6] = -0.6870983, this.B_im[6] = -1.1651967, this.C_re = [], this.C_im = [], this.C_re[1] = 1.3231270439, this.C_im[1] = 0, this.C_re[2] = -0.577245789, this.C_im[2] = -7809598e-9, this.C_re[3] = 0.508307513, this.C_im[3] = -0.112208952, this.C_re[4] = -0.15094762, this.C_im[4] = 0.18200602, this.C_re[5] = 1.01418179, this.C_im[5] = 1.64497696, this.C_re[6] = 1.9660549, this.C_im[6] = 2.5127645, this.D = [], this.D[1] = 1.5627014243, this.D[2] = 0.5185406398, this.D[3] = -0.03333098, this.D[4] = -0.1052906, this.D[5] = -0.0368594, this.D[6] = 7317e-6, this.D[7] = 0.0122, this.D[8] = 394e-5, this.D[9] = -13e-4;
6654
6682
  }
6655
- function Kl(t) {
6656
- var e, i = t.x, s = t.y, r = s - this.lat0, a = i - this.long0, n = r / Dt * 1e-5, o = a, h = 1, l = 0;
6683
+ function Xl(t) {
6684
+ var e, i = t.x, s = t.y, r = s - this.lat0, a = i - this.long0, n = r / zt * 1e-5, o = a, h = 1, l = 0;
6657
6685
  for (e = 1; e <= 10; e++)
6658
6686
  h = h * n, l = l + this.A[e] * h;
6659
6687
  var f = l, u = o, c = 1, m = 0, d, g, M = 0, v = 0;
@@ -6661,7 +6689,7 @@ function Kl(t) {
6661
6689
  d = c * f - m * u, g = m * f + c * u, c = d, m = g, M = M + this.B_re[e] * c - this.B_im[e] * m, v = v + this.B_im[e] * c + this.B_re[e] * m;
6662
6690
  return t.x = v * this.a + this.x0, t.y = M * this.a + this.y0, t;
6663
6691
  }
6664
- function Xl(t) {
6692
+ function Ql(t) {
6665
6693
  var e, i = t.x, s = t.y, r = i - this.x0, a = s - this.y0, n = a / this.a, o = r / this.a, h = 1, l = 0, f, u, c = 0, m = 0;
6666
6694
  for (e = 1; e <= 6; e++)
6667
6695
  f = h * n - l * o, u = l * n + h * o, h = f, l = u, c = c + this.C_re[e] * h - this.C_im[e] * l, m = m + this.C_im[e] * h + this.C_re[e] * l;
@@ -6670,46 +6698,46 @@ function Xl(t) {
6670
6698
  for (e = 2; e <= 6; e++)
6671
6699
  v = g * c - M * m, _ = M * c + g * m, g = v, M = _, b = b + (e - 1) * (this.B_re[e] * g - this.B_im[e] * M), E = E + (e - 1) * (this.B_im[e] * g + this.B_re[e] * M);
6672
6700
  g = 1, M = 0;
6673
- var S = this.B_re[1], A = this.B_im[1];
6701
+ var S = this.B_re[1], P = this.B_im[1];
6674
6702
  for (e = 2; e <= 6; e++)
6675
- v = g * c - M * m, _ = M * c + g * m, g = v, M = _, S = S + e * (this.B_re[e] * g - this.B_im[e] * M), A = A + e * (this.B_im[e] * g + this.B_re[e] * M);
6676
- var P = S * S + A * A;
6677
- c = (b * S + E * A) / P, m = (E * S - b * A) / P;
6703
+ v = g * c - M * m, _ = M * c + g * m, g = v, M = _, S = S + e * (this.B_re[e] * g - this.B_im[e] * M), P = P + e * (this.B_im[e] * g + this.B_re[e] * M);
6704
+ var A = S * S + P * P;
6705
+ c = (b * S + E * P) / A, m = (E * S - b * P) / A;
6678
6706
  }
6679
6707
  var G = c, N = m, F = 1, x = 0;
6680
6708
  for (e = 1; e <= 9; e++)
6681
6709
  F = F * G, x = x + this.D[e] * F;
6682
- var C = this.lat0 + x * Dt * 1e5, R = this.long0 + N;
6710
+ var C = this.lat0 + x * zt * 1e5, R = this.long0 + N;
6683
6711
  return t.x = R, t.y = C, t;
6684
6712
  }
6685
- var Ql = ["New_Zealand_Map_Grid", "nzmg"];
6686
- const Jl = {
6687
- init: Vl,
6688
- forward: Kl,
6689
- inverse: Xl,
6690
- names: Ql
6713
+ var Jl = ["New_Zealand_Map_Grid", "nzmg"];
6714
+ const Yl = {
6715
+ init: Kl,
6716
+ forward: Xl,
6717
+ inverse: Ql,
6718
+ names: Jl
6691
6719
  };
6692
- function Yl() {
6720
+ function Zl() {
6693
6721
  }
6694
- function Zl(t) {
6722
+ function t0(t) {
6695
6723
  var e = t.x, i = t.y, s = w(e - this.long0, this.over), r = this.x0 + this.a * s, a = this.y0 + this.a * Math.log(Math.tan(Math.PI / 4 + i / 2.5)) * 1.25;
6696
6724
  return t.x = r, t.y = a, t;
6697
6725
  }
6698
- function t0(t) {
6726
+ function e0(t) {
6699
6727
  t.x -= this.x0, t.y -= this.y0;
6700
6728
  var e = w(this.long0 + t.x / this.a, this.over), i = 2.5 * (Math.atan(Math.exp(0.8 * t.y / this.a)) - Math.PI / 4);
6701
6729
  return t.x = e, t.y = i, t;
6702
6730
  }
6703
- var e0 = ["Miller_Cylindrical", "mill"];
6704
- const i0 = {
6705
- init: Yl,
6706
- forward: Zl,
6707
- inverse: t0,
6708
- names: e0
6731
+ var i0 = ["Miller_Cylindrical", "mill"];
6732
+ const s0 = {
6733
+ init: Zl,
6734
+ forward: t0,
6735
+ inverse: e0,
6736
+ names: i0
6709
6737
  };
6710
- var s0 = 20;
6711
- function r0() {
6712
- this.long0 = this.long0 || 0, this.sphere ? (this.n = 1, this.m = 0, this.es = 0, this.C_y = Math.sqrt((this.m + 1) / this.n), this.C_x = this.C_y / (this.m + 1)) : this.en = Mi(this.es);
6738
+ var r0 = 20;
6739
+ function a0() {
6740
+ this.long0 = this.long0 || 0, this.sphere ? (this.n = 1, this.m = 0, this.es = 0, this.C_y = Math.sqrt((this.m + 1) / this.n), this.C_x = this.C_y / (this.m + 1)) : this.en = vi(this.es);
6713
6741
  }
6714
6742
  function Gr(t) {
6715
6743
  var e, i, s = t.x, r = t.y;
@@ -6717,7 +6745,7 @@ function Gr(t) {
6717
6745
  if (!this.m)
6718
6746
  r = this.n !== 1 ? Math.asin(this.n * Math.sin(r)) : r;
6719
6747
  else
6720
- for (var a = this.n * Math.sin(r), n = s0; n; --n) {
6748
+ for (var a = this.n * Math.sin(r), n = r0; n; --n) {
6721
6749
  var o = (this.m * r + Math.sin(r) - a) / (this.m + Math.cos(r));
6722
6750
  if (r -= o, Math.abs(o) < p)
6723
6751
  break;
@@ -6731,29 +6759,29 @@ function Gr(t) {
6731
6759
  }
6732
6760
  function Nr(t) {
6733
6761
  var e, i, s, r;
6734
- return t.x -= this.x0, s = t.x / this.a, t.y -= this.y0, e = t.y / this.a, this.sphere ? (e /= this.C_y, s = s / (this.C_x * (this.m + Math.cos(e))), this.m ? e = ut((this.m * e + Math.sin(e)) / this.n) : this.n !== 1 && (e = ut(Math.sin(e) / this.n)), s = w(s + this.long0, this.over), e = ft(e)) : (e = vi(t.y / this.a, this.es, this.en), r = Math.abs(e), r < y ? (r = Math.sin(e), i = this.long0 + t.x * Math.sqrt(1 - this.es * r * r) / (this.a * Math.cos(e)), s = w(i, this.over)) : r - p < y && (s = this.long0)), t.x = s, t.y = e, t;
6762
+ return t.x -= this.x0, s = t.x / this.a, t.y -= this.y0, e = t.y / this.a, this.sphere ? (e /= this.C_y, s = s / (this.C_x * (this.m + Math.cos(e))), this.m ? e = ft((this.m * e + Math.sin(e)) / this.n) : this.n !== 1 && (e = ft(Math.sin(e) / this.n)), s = w(s + this.long0, this.over), e = mt(e)) : (e = yi(t.y / this.a, this.es, this.en), r = Math.abs(e), r < y ? (r = Math.sin(e), i = this.long0 + t.x * Math.sqrt(1 - this.es * r * r) / (this.a * Math.cos(e)), s = w(i, this.over)) : r - p < y && (s = this.long0)), t.x = s, t.y = e, t;
6735
6763
  }
6736
- var a0 = ["Sinusoidal", "sinu"];
6737
- const n0 = {
6738
- init: r0,
6764
+ var n0 = ["Sinusoidal", "sinu"];
6765
+ const o0 = {
6766
+ init: a0,
6739
6767
  forward: Gr,
6740
6768
  inverse: Nr,
6741
- names: a0
6769
+ names: n0
6742
6770
  };
6743
- function o0() {
6771
+ function h0() {
6744
6772
  this.sphere = !0, this.b = this.a, this.m = 1, this.n = 2.5707963267948966, this.es = 0, this.C_y = Math.sqrt((this.m + 1) / this.n), this.C_x = this.C_y / (this.m + 1);
6745
6773
  }
6746
- var h0 = Gr, l0 = Nr, c0 = ["Eckert_VI", "eck6"];
6747
- const u0 = {
6748
- init: o0,
6749
- forward: h0,
6750
- inverse: l0,
6751
- names: c0
6774
+ var l0 = Gr, c0 = Nr, u0 = ["Eckert_VI", "eck6"];
6775
+ const f0 = {
6776
+ init: h0,
6777
+ forward: l0,
6778
+ inverse: c0,
6779
+ names: u0
6752
6780
  };
6753
- function f0() {
6781
+ function m0() {
6754
6782
  this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.long0 = this.long0 !== void 0 ? this.long0 : 0;
6755
6783
  }
6756
- function m0(t) {
6784
+ function d0(t) {
6757
6785
  for (var e = t.x, i = t.y, s = w(e - this.long0, this.over), r = i, a = Math.PI * Math.sin(i); ; ) {
6758
6786
  var n = -(r + Math.sin(r) - a) / (1 + Math.cos(r));
6759
6787
  if (r += n, Math.abs(n) < p)
@@ -6763,7 +6791,7 @@ function m0(t) {
6763
6791
  var o = 0.900316316158 * this.a * s * Math.cos(r) + this.x0, h = 1.4142135623731 * this.a * Math.sin(r) + this.y0;
6764
6792
  return t.x = o, t.y = h, t;
6765
6793
  }
6766
- function d0(t) {
6794
+ function g0(t) {
6767
6795
  var e, i;
6768
6796
  t.x -= this.x0, t.y -= this.y0, i = t.y / (1.4142135623731 * this.a), Math.abs(i) > 0.999999999999 && (i = 0.999999999999), e = Math.asin(i);
6769
6797
  var s = w(this.long0 + t.x / (0.900316316158 * this.a * Math.cos(e)), this.over);
@@ -6771,17 +6799,17 @@ function d0(t) {
6771
6799
  var r = Math.asin(i);
6772
6800
  return t.x = s, t.y = r, t;
6773
6801
  }
6774
- var g0 = ["Mollweide", "moll"];
6775
- const M0 = {
6776
- init: f0,
6777
- forward: m0,
6778
- inverse: d0,
6779
- names: g0
6802
+ var M0 = ["Mollweide", "moll"];
6803
+ const v0 = {
6804
+ init: m0,
6805
+ forward: d0,
6806
+ inverse: g0,
6807
+ names: M0
6780
6808
  };
6781
- function v0() {
6782
- Math.abs(this.lat1 + this.lat2) < p || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = Yt(this.es), this.e1 = Zt(this.es), this.e2 = te(this.es), this.e3 = ee(this.es), this.sin_phi = Math.sin(this.lat1), this.cos_phi = Math.cos(this.lat1), this.ms1 = it(this.e, this.sin_phi, this.cos_phi), this.ml1 = z(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < p ? this.ns = this.sin_phi : (this.sin_phi = Math.sin(this.lat2), this.cos_phi = Math.cos(this.lat2), this.ms2 = it(this.e, this.sin_phi, this.cos_phi), this.ml2 = z(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = z(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
6809
+ function y0() {
6810
+ Math.abs(this.lat1 + this.lat2) < p || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = Zt(this.es), this.e1 = te(this.es), this.e2 = ee(this.es), this.e3 = ie(this.es), this.sin_phi = Math.sin(this.lat1), this.cos_phi = Math.cos(this.lat1), this.ms1 = it(this.e, this.sin_phi, this.cos_phi), this.ml1 = z(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < p ? this.ns = this.sin_phi : (this.sin_phi = Math.sin(this.lat2), this.cos_phi = Math.cos(this.lat2), this.ms2 = it(this.e, this.sin_phi, this.cos_phi), this.ml2 = z(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = z(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
6783
6811
  }
6784
- function y0(t) {
6812
+ function _0(t) {
6785
6813
  var e = t.x, i = t.y, s;
6786
6814
  if (this.sphere)
6787
6815
  s = this.a * (this.g - i);
@@ -6792,112 +6820,112 @@ function y0(t) {
6792
6820
  var a = this.ns * w(e - this.long0, this.over), n = this.x0 + s * Math.sin(a), o = this.y0 + this.rh - s * Math.cos(a);
6793
6821
  return t.x = n, t.y = o, t;
6794
6822
  }
6795
- function _0(t) {
6823
+ function b0(t) {
6796
6824
  t.x -= this.x0, t.y = this.rh - t.y + this.y0;
6797
6825
  var e, i, s, r;
6798
6826
  this.ns >= 0 ? (i = Math.sqrt(t.x * t.x + t.y * t.y), e = 1) : (i = -Math.sqrt(t.x * t.x + t.y * t.y), e = -1);
6799
6827
  var a = 0;
6800
6828
  if (i !== 0 && (a = Math.atan2(e * t.x, e * t.y)), this.sphere)
6801
- return r = w(this.long0 + a / this.ns, this.over), s = ft(this.g - i / this.a), t.x = r, t.y = s, t;
6829
+ return r = w(this.long0 + a / this.ns, this.over), s = mt(this.g - i / this.a), t.x = r, t.y = s, t;
6802
6830
  var n = this.g - i / this.a;
6803
- return s = Pe(n, this.e0, this.e1, this.e2, this.e3), r = w(this.long0 + a / this.ns, this.over), t.x = r, t.y = s, t;
6804
- }
6805
- var b0 = ["Equidistant_Conic", "eqdc"];
6806
- const p0 = {
6807
- init: v0,
6808
- forward: y0,
6809
- inverse: _0,
6810
- names: b0
6831
+ return s = Ae(n, this.e0, this.e1, this.e2, this.e3), r = w(this.long0 + a / this.ns, this.over), t.x = r, t.y = s, t;
6832
+ }
6833
+ var p0 = ["Equidistant_Conic", "eqdc"];
6834
+ const w0 = {
6835
+ init: y0,
6836
+ forward: _0,
6837
+ inverse: b0,
6838
+ names: p0
6811
6839
  };
6812
- function w0() {
6840
+ function S0() {
6813
6841
  this.R = this.a;
6814
6842
  }
6815
- function S0(t) {
6843
+ function E0(t) {
6816
6844
  var e = t.x, i = t.y, s = w(e - this.long0, this.over), r, a;
6817
6845
  Math.abs(i) <= p && (r = this.x0 + this.R * s, a = this.y0);
6818
- var n = ut(2 * Math.abs(i / Math.PI));
6846
+ var n = ft(2 * Math.abs(i / Math.PI));
6819
6847
  (Math.abs(s) <= p || Math.abs(Math.abs(i) - y) <= p) && (r = this.x0, i >= 0 ? a = this.y0 + Math.PI * this.R * Math.tan(0.5 * n) : a = this.y0 + Math.PI * this.R * -Math.tan(0.5 * n));
6820
6848
  var o = 0.5 * Math.abs(Math.PI / s - s / Math.PI), h = o * o, l = Math.sin(n), f = Math.cos(n), u = f / (l + f - 1), c = u * u, m = u * (2 / l - 1), d = m * m, g = Math.PI * this.R * (o * (u - d) + Math.sqrt(h * (u - d) * (u - d) - (d + h) * (c - d))) / (d + h);
6821
6849
  s < 0 && (g = -g), r = this.x0 + g;
6822
6850
  var M = h + u;
6823
6851
  return g = Math.PI * this.R * (m * M - o * Math.sqrt((d + h) * (h + 1) - M * M)) / (d + h), i >= 0 ? a = this.y0 + g : a = this.y0 - g, t.x = r, t.y = a, t;
6824
6852
  }
6825
- function E0(t) {
6853
+ function x0(t) {
6826
6854
  var e, i, s, r, a, n, o, h, l, f, u, c, m;
6827
6855
  return t.x -= this.x0, t.y -= this.y0, u = Math.PI * this.R, s = t.x / u, r = t.y / u, a = s * s + r * r, n = -Math.abs(r) * (1 + a), o = n - 2 * r * r + s * s, h = -2 * n + 1 + 2 * r * r + a * a, m = r * r / h + (2 * o * o * o / h / h / h - 9 * n * o / h / h) / 27, l = (n - o * o / 3 / h) / h, f = 2 * Math.sqrt(-l / 3), u = 3 * m / l / f, Math.abs(u) > 1 && (u >= 0 ? u = 1 : u = -1), c = Math.acos(u) / 3, t.y >= 0 ? i = (-f * Math.cos(c + Math.PI / 3) - o / 3 / h) * Math.PI : i = -(-f * Math.cos(c + Math.PI / 3) - o / 3 / h) * Math.PI, Math.abs(s) < p ? e = this.long0 : e = w(this.long0 + Math.PI * (a - 1 + Math.sqrt(1 + 2 * (s * s - r * r) + a * a)) / 2 / s, this.over), t.x = e, t.y = i, t;
6828
6856
  }
6829
- var x0 = ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"];
6857
+ var P0 = ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"];
6830
6858
  const A0 = {
6831
- init: w0,
6832
- forward: S0,
6833
- inverse: E0,
6834
- names: x0
6859
+ init: S0,
6860
+ forward: E0,
6861
+ inverse: x0,
6862
+ names: P0
6835
6863
  };
6836
- function P0(t, e, i, s, r, a) {
6864
+ function G0(t, e, i, s, r, a) {
6837
6865
  const n = s - e, o = Math.atan((1 - a) * Math.tan(t)), h = Math.atan((1 - a) * Math.tan(i)), l = Math.sin(o), f = Math.cos(o), u = Math.sin(h), c = Math.cos(h);
6838
- let m = n, d, g = 100, M, v, _, b, E, S, A, P, G, N, F, x, C, R;
6866
+ let m = n, d, g = 100, M, v, _, b, E, S, P, A, G, N, F, x, C, R;
6839
6867
  do {
6840
6868
  if (M = Math.sin(m), v = Math.cos(m), _ = Math.sqrt(
6841
6869
  c * M * (c * M) + (f * u - l * c * v) * (f * u - l * c * v)
6842
6870
  ), _ === 0)
6843
6871
  return { azi1: 0, s12: 0 };
6844
- b = l * u + f * c * v, E = Math.atan2(_, b), S = f * c * M / _, A = 1 - S * S, P = A !== 0 ? b - 2 * l * u / A : 0, G = a / 16 * A * (4 + a * (4 - 3 * A)), d = m, m = n + (1 - G) * a * S * (E + G * _ * (P + G * b * (-1 + 2 * P * P)));
6872
+ b = l * u + f * c * v, E = Math.atan2(_, b), S = f * c * M / _, P = 1 - S * S, A = P !== 0 ? b - 2 * l * u / P : 0, G = a / 16 * P * (4 + a * (4 - 3 * P)), d = m, m = n + (1 - G) * a * S * (E + G * _ * (A + G * b * (-1 + 2 * A * A)));
6845
6873
  } while (Math.abs(m - d) > 1e-12 && --g > 0);
6846
- return g === 0 ? { azi1: NaN, s12: NaN } : (N = A * (r * r - r * (1 - a) * (r * (1 - a))) / (r * (1 - a) * (r * (1 - a))), F = 1 + N / 16384 * (4096 + N * (-768 + N * (320 - 175 * N))), x = N / 1024 * (256 + N * (-128 + N * (74 - 47 * N))), C = x * _ * (P + x / 4 * (b * (-1 + 2 * P * P) - x / 6 * P * (-3 + 4 * _ * _) * (-3 + 4 * P * P))), R = r * (1 - a) * F * (E - C), { azi1: Math.atan2(c * M, f * u - l * c * v), s12: R });
6874
+ return g === 0 ? { azi1: NaN, s12: NaN } : (N = P * (r * r - r * (1 - a) * (r * (1 - a))) / (r * (1 - a) * (r * (1 - a))), F = 1 + N / 16384 * (4096 + N * (-768 + N * (320 - 175 * N))), x = N / 1024 * (256 + N * (-128 + N * (74 - 47 * N))), C = x * _ * (A + x / 4 * (b * (-1 + 2 * A * A) - x / 6 * A * (-3 + 4 * _ * _) * (-3 + 4 * A * A))), R = r * (1 - a) * F * (E - C), { azi1: Math.atan2(c * M, f * u - l * c * v), s12: R });
6847
6875
  }
6848
- function G0(t, e, i, s, r, a) {
6876
+ function N0(t, e, i, s, r, a) {
6849
6877
  const n = Math.atan((1 - a) * Math.tan(t)), o = Math.sin(n), h = Math.cos(n), l = Math.sin(i), f = Math.cos(i), u = Math.atan2(o, h * f), c = h * l, m = 1 - c * c, d = m * (r * r - r * (1 - a) * (r * (1 - a))) / (r * (1 - a) * (r * (1 - a))), g = 1 + d / 16384 * (4096 + d * (-768 + d * (320 - 175 * d))), M = d / 1024 * (256 + d * (-128 + d * (74 - 47 * d)));
6850
- let v = s / (r * (1 - a) * g), _, b = 100, E, S, A, P;
6878
+ let v = s / (r * (1 - a) * g), _, b = 100, E, S, P, A;
6851
6879
  do
6852
- E = Math.cos(2 * u + v), S = Math.sin(v), A = Math.cos(v), P = M * S * (E + M / 4 * (A * (-1 + 2 * E * E) - M / 6 * E * (-3 + 4 * S * S) * (-3 + 4 * E * E))), _ = v, v = s / (r * (1 - a) * g) + P;
6880
+ E = Math.cos(2 * u + v), S = Math.sin(v), P = Math.cos(v), A = M * S * (E + M / 4 * (P * (-1 + 2 * E * E) - M / 6 * E * (-3 + 4 * S * S) * (-3 + 4 * E * E))), _ = v, v = s / (r * (1 - a) * g) + A;
6853
6881
  while (Math.abs(v - _) > 1e-12 && --b > 0);
6854
6882
  if (b === 0)
6855
6883
  return { lat2: NaN, lon2: NaN };
6856
- const G = o * S - h * A * f, N = Math.atan2(
6857
- o * A + h * S * f,
6884
+ const G = o * S - h * P * f, N = Math.atan2(
6885
+ o * P + h * S * f,
6858
6886
  (1 - a) * Math.sqrt(c * c + G * G)
6859
6887
  ), F = Math.atan2(
6860
6888
  S * l,
6861
- h * A - o * S * f
6862
- ), x = a / 16 * m * (4 + a * (4 - 3 * m)), C = F - (1 - x) * a * c * (v + x * S * (E + x * A * (-1 + 2 * E * E))), R = e + C;
6889
+ h * P - o * S * f
6890
+ ), x = a / 16 * m * (4 + a * (4 - 3 * m)), C = F - (1 - x) * a * c * (v + x * S * (E + x * P * (-1 + 2 * E * E))), R = e + C;
6863
6891
  return { lat2: N, lon2: R };
6864
6892
  }
6865
- function N0() {
6893
+ function C0() {
6866
6894
  this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.f = this.es / (1 + Math.sqrt(1 - this.es));
6867
6895
  }
6868
- function C0(t) {
6896
+ function I0(t) {
6869
6897
  var e = t.x, i = t.y, s = Math.sin(t.y), r = Math.cos(t.y), a = w(e - this.long0, this.over), n, o, h, l, f, u, c, m, d, g, M;
6870
- return this.sphere ? Math.abs(this.sin_p12 - 1) <= p ? (t.x = this.x0 + this.a * (y - i) * Math.sin(a), t.y = this.y0 - this.a * (y - i) * Math.cos(a), t) : Math.abs(this.sin_p12 + 1) <= p ? (t.x = this.x0 + this.a * (y + i) * Math.sin(a), t.y = this.y0 + this.a * (y + i) * Math.cos(a), t) : (d = this.sin_p12 * s + this.cos_p12 * r * Math.cos(a), c = Math.acos(d), m = c ? c / Math.sin(c) : 1, t.x = this.x0 + this.a * m * r * Math.sin(a), t.y = this.y0 + this.a * m * (this.cos_p12 * s - this.sin_p12 * r * Math.cos(a)), t) : (n = Yt(this.es), o = Zt(this.es), h = te(this.es), l = ee(this.es), Math.abs(this.sin_p12 - 1) <= p ? (f = this.a * z(n, o, h, l, y), u = this.a * z(n, o, h, l, i), t.x = this.x0 + (f - u) * Math.sin(a), t.y = this.y0 - (f - u) * Math.cos(a), t) : Math.abs(this.sin_p12 + 1) <= p ? (f = this.a * z(n, o, h, l, y), u = this.a * z(n, o, h, l, i), t.x = this.x0 + (f + u) * Math.sin(a), t.y = this.y0 + (f + u) * Math.cos(a), t) : Math.abs(e) < p && Math.abs(i - this.lat0) < p ? (t.x = t.y = 0, t) : (g = P0(this.lat0, this.long0, i, e, this.a, this.f), M = g.azi1, t.x = g.s12 * Math.sin(M), t.y = g.s12 * Math.cos(M), t));
6898
+ return this.sphere ? Math.abs(this.sin_p12 - 1) <= p ? (t.x = this.x0 + this.a * (y - i) * Math.sin(a), t.y = this.y0 - this.a * (y - i) * Math.cos(a), t) : Math.abs(this.sin_p12 + 1) <= p ? (t.x = this.x0 + this.a * (y + i) * Math.sin(a), t.y = this.y0 + this.a * (y + i) * Math.cos(a), t) : (d = this.sin_p12 * s + this.cos_p12 * r * Math.cos(a), c = Math.acos(d), m = c ? c / Math.sin(c) : 1, t.x = this.x0 + this.a * m * r * Math.sin(a), t.y = this.y0 + this.a * m * (this.cos_p12 * s - this.sin_p12 * r * Math.cos(a)), t) : (n = Zt(this.es), o = te(this.es), h = ee(this.es), l = ie(this.es), Math.abs(this.sin_p12 - 1) <= p ? (f = this.a * z(n, o, h, l, y), u = this.a * z(n, o, h, l, i), t.x = this.x0 + (f - u) * Math.sin(a), t.y = this.y0 - (f - u) * Math.cos(a), t) : Math.abs(this.sin_p12 + 1) <= p ? (f = this.a * z(n, o, h, l, y), u = this.a * z(n, o, h, l, i), t.x = this.x0 + (f + u) * Math.sin(a), t.y = this.y0 + (f + u) * Math.cos(a), t) : Math.abs(e) < p && Math.abs(i - this.lat0) < p ? (t.x = t.y = 0, t) : (g = G0(this.lat0, this.long0, i, e, this.a, this.f), M = g.azi1, t.x = g.s12 * Math.sin(M), t.y = g.s12 * Math.cos(M), t));
6871
6899
  }
6872
- function I0(t) {
6900
+ function T0(t) {
6873
6901
  t.x -= this.x0, t.y -= this.y0;
6874
6902
  var e, i, s, r, a, n, o, h, l, f, u, c, m, d, g, M;
6875
- return this.sphere ? (e = Math.sqrt(t.x * t.x + t.y * t.y), e > 2 * y * this.a ? void 0 : (i = e / this.a, s = Math.sin(i), r = Math.cos(i), a = this.long0, Math.abs(e) <= p ? n = this.lat0 : (n = ut(r * this.sin_p12 + t.y * s * this.cos_p12 / e), o = Math.abs(this.lat0) - y, Math.abs(o) <= p ? this.lat0 >= 0 ? a = w(this.long0 + Math.atan2(t.x, -t.y), this.over) : a = w(this.long0 - Math.atan2(-t.x, t.y), this.over) : a = w(this.long0 + Math.atan2(t.x * s, e * this.cos_p12 * r - t.y * this.sin_p12 * s), this.over)), t.x = a, t.y = n, t)) : (h = Yt(this.es), l = Zt(this.es), f = te(this.es), u = ee(this.es), Math.abs(this.sin_p12 - 1) <= p ? (c = this.a * z(h, l, f, u, y), e = Math.sqrt(t.x * t.x + t.y * t.y), m = c - e, n = Pe(m / this.a, h, l, f, u), a = w(this.long0 + Math.atan2(t.x, -1 * t.y), this.over), t.x = a, t.y = n, t) : Math.abs(this.sin_p12 + 1) <= p ? (c = this.a * z(h, l, f, u, y), e = Math.sqrt(t.x * t.x + t.y * t.y), m = e - c, n = Pe(m / this.a, h, l, f, u), a = w(this.long0 + Math.atan2(t.x, t.y), this.over), t.x = a, t.y = n, t) : (d = Math.atan2(t.x, t.y), g = Math.sqrt(t.x * t.x + t.y * t.y), M = G0(this.lat0, this.long0, d, g, this.a, this.f), t.x = M.lon2, t.y = M.lat2, t));
6876
- }
6877
- var T0 = ["Azimuthal_Equidistant", "aeqd"];
6878
- const R0 = {
6879
- init: N0,
6880
- forward: C0,
6881
- inverse: I0,
6882
- names: T0
6903
+ return this.sphere ? (e = Math.sqrt(t.x * t.x + t.y * t.y), e > 2 * y * this.a ? void 0 : (i = e / this.a, s = Math.sin(i), r = Math.cos(i), a = this.long0, Math.abs(e) <= p ? n = this.lat0 : (n = ft(r * this.sin_p12 + t.y * s * this.cos_p12 / e), o = Math.abs(this.lat0) - y, Math.abs(o) <= p ? this.lat0 >= 0 ? a = w(this.long0 + Math.atan2(t.x, -t.y), this.over) : a = w(this.long0 - Math.atan2(-t.x, t.y), this.over) : a = w(this.long0 + Math.atan2(t.x * s, e * this.cos_p12 * r - t.y * this.sin_p12 * s), this.over)), t.x = a, t.y = n, t)) : (h = Zt(this.es), l = te(this.es), f = ee(this.es), u = ie(this.es), Math.abs(this.sin_p12 - 1) <= p ? (c = this.a * z(h, l, f, u, y), e = Math.sqrt(t.x * t.x + t.y * t.y), m = c - e, n = Ae(m / this.a, h, l, f, u), a = w(this.long0 + Math.atan2(t.x, -1 * t.y), this.over), t.x = a, t.y = n, t) : Math.abs(this.sin_p12 + 1) <= p ? (c = this.a * z(h, l, f, u, y), e = Math.sqrt(t.x * t.x + t.y * t.y), m = e - c, n = Ae(m / this.a, h, l, f, u), a = w(this.long0 + Math.atan2(t.x, t.y), this.over), t.x = a, t.y = n, t) : (d = Math.atan2(t.x, t.y), g = Math.sqrt(t.x * t.x + t.y * t.y), M = N0(this.lat0, this.long0, d, g, this.a, this.f), t.x = M.lon2, t.y = M.lat2, t));
6904
+ }
6905
+ var R0 = ["Azimuthal_Equidistant", "aeqd"];
6906
+ const k0 = {
6907
+ init: C0,
6908
+ forward: I0,
6909
+ inverse: T0,
6910
+ names: R0
6883
6911
  };
6884
- function k0() {
6912
+ function $0() {
6885
6913
  this.sin_p14 = Math.sin(this.lat0 || 0), this.cos_p14 = Math.cos(this.lat0 || 0);
6886
6914
  }
6887
- function $0(t) {
6915
+ function L0(t) {
6888
6916
  var e, i, s, r, a, n, o, h, l = t.x, f = t.y;
6889
6917
  return s = w(l - (this.long0 || 0), this.over), e = Math.sin(f), i = Math.cos(f), r = Math.cos(s), n = this.sin_p14 * e + this.cos_p14 * i * r, a = 1, (n > 0 || Math.abs(n) <= p) && (o = this.a * a * i * Math.sin(s), h = (this.y0 || 0) + this.a * a * (this.cos_p14 * e - this.sin_p14 * i * r)), t.x = o, t.y = h, t;
6890
6918
  }
6891
- function L0(t) {
6919
+ function O0(t) {
6892
6920
  var e, i, s, r, a, n, o, h, l;
6893
- return t.x -= this.x0 || 0, t.y -= this.y0 || 0, e = Math.sqrt(t.x * t.x + t.y * t.y), i = ut(e / this.a), s = Math.sin(i), r = Math.cos(i), h = this.long0 || 0, l = this.lat0 || 0, n = h, Math.abs(e) <= p ? (o = l, t.x = n, t.y = o, t) : (o = ut(r * this.sin_p14 + t.y * s * this.cos_p14 / e), a = Math.abs(l) - y, Math.abs(a) <= p ? (l >= 0 ? n = w(h + Math.atan2(t.x, -t.y), this.over) : n = w(h - Math.atan2(-t.x, t.y), this.over), t.x = n, t.y = o, t) : (n = w(h + Math.atan2(t.x * s, e * this.cos_p14 * r - t.y * this.sin_p14 * s), this.over), t.x = n, t.y = o, t));
6894
- }
6895
- var O0 = ["ortho"];
6896
- const F0 = {
6897
- init: k0,
6898
- forward: $0,
6899
- inverse: L0,
6900
- names: O0
6921
+ return t.x -= this.x0 || 0, t.y -= this.y0 || 0, e = Math.sqrt(t.x * t.x + t.y * t.y), i = ft(e / this.a), s = Math.sin(i), r = Math.cos(i), h = this.long0 || 0, l = this.lat0 || 0, n = h, Math.abs(e) <= p ? (o = l, t.x = n, t.y = o, t) : (o = ft(r * this.sin_p14 + t.y * s * this.cos_p14 / e), a = Math.abs(l) - y, Math.abs(a) <= p ? (l >= 0 ? n = w(h + Math.atan2(t.x, -t.y), this.over) : n = w(h - Math.atan2(-t.x, t.y), this.over), t.x = n, t.y = o, t) : (n = w(h + Math.atan2(t.x * s, e * this.cos_p14 * r - t.y * this.sin_p14 * s), this.over), t.x = n, t.y = o, t));
6922
+ }
6923
+ var F0 = ["ortho"];
6924
+ const q0 = {
6925
+ init: $0,
6926
+ forward: L0,
6927
+ inverse: O0,
6928
+ names: F0
6901
6929
  };
6902
6930
  var k = {
6903
6931
  FRONT: 1,
@@ -6912,10 +6940,10 @@ var k = {
6912
6940
  AREA_2: 3,
6913
6941
  AREA_3: 4
6914
6942
  };
6915
- function q0() {
6943
+ function U0() {
6916
6944
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Quadrilateralized Spherical Cube", this.lat0 >= y - I / 2 ? this.face = k.TOP : this.lat0 <= -(y - I / 2) ? this.face = k.BOTTOM : Math.abs(this.long0) <= I ? this.face = k.FRONT : Math.abs(this.long0) <= y + I ? this.face = this.long0 > 0 ? k.RIGHT : k.LEFT : this.face = k.BACK, this.es !== 0 && (this.one_minus_f = 1 - (this.a - this.b) / this.a, this.one_minus_f_squared = this.one_minus_f * this.one_minus_f);
6917
6945
  }
6918
- function U0(t) {
6946
+ function j0(t) {
6919
6947
  var e = { x: 0, y: 0 }, i, s, r, a, n, o, h = { value: 0 };
6920
6948
  if (t.x -= this.long0, this.es !== 0 ? i = Math.atan(this.one_minus_f_squared * Math.tan(t.y)) : i = t.y, s = t.x, this.face === k.TOP)
6921
6949
  a = y - i, s >= I && s <= y + I ? (h.value = T.AREA_0, r = s - y) : s > y + I || s <= -(y + I) ? (h.value = T.AREA_1, r = s > 0 ? s - O : s + O) : s > -(y + I) && s <= -I ? (h.value = T.AREA_2, r = s + y) : (h.value = T.AREA_3, r = s);
@@ -6923,11 +6951,11 @@ function U0(t) {
6923
6951
  a = y + i, s >= I && s <= y + I ? (h.value = T.AREA_0, r = -s + y) : s < I && s >= -I ? (h.value = T.AREA_1, r = -s) : s < -I && s >= -(y + I) ? (h.value = T.AREA_2, r = -s - y) : (h.value = T.AREA_3, r = s > 0 ? -s + O : -s - O);
6924
6952
  else {
6925
6953
  var l, f, u, c, m, d, g;
6926
- this.face === k.RIGHT ? s = Nt(s, +y) : this.face === k.BACK ? s = Nt(s, +O) : this.face === k.LEFT && (s = Nt(s, -y)), c = Math.sin(i), m = Math.cos(i), d = Math.sin(s), g = Math.cos(s), l = m * g, f = m * d, u = c, this.face === k.FRONT ? (a = Math.acos(l), r = fe(a, u, f, h)) : this.face === k.RIGHT ? (a = Math.acos(f), r = fe(a, u, -l, h)) : this.face === k.BACK ? (a = Math.acos(-l), r = fe(a, u, -f, h)) : this.face === k.LEFT ? (a = Math.acos(-f), r = fe(a, u, l, h)) : (a = r = 0, h.value = T.AREA_0);
6954
+ this.face === k.RIGHT ? s = Ct(s, +y) : this.face === k.BACK ? s = Ct(s, +O) : this.face === k.LEFT && (s = Ct(s, -y)), c = Math.sin(i), m = Math.cos(i), d = Math.sin(s), g = Math.cos(s), l = m * g, f = m * d, u = c, this.face === k.FRONT ? (a = Math.acos(l), r = me(a, u, f, h)) : this.face === k.RIGHT ? (a = Math.acos(f), r = me(a, u, -l, h)) : this.face === k.BACK ? (a = Math.acos(-l), r = me(a, u, -f, h)) : this.face === k.LEFT ? (a = Math.acos(-f), r = me(a, u, l, h)) : (a = r = 0, h.value = T.AREA_0);
6927
6955
  }
6928
6956
  return o = Math.atan(12 / O * (r + Math.acos(Math.sin(r) * Math.cos(I)) - y)), n = Math.sqrt((1 - Math.cos(a)) / (Math.cos(o) * Math.cos(o)) / (1 - Math.cos(Math.atan(1 / Math.cos(r))))), h.value === T.AREA_1 ? o += y : h.value === T.AREA_2 ? o += O : h.value === T.AREA_3 && (o += 1.5 * O), e.x = n * Math.cos(o), e.y = n * Math.sin(o), e.x = e.x * this.a + this.x0, e.y = e.y * this.a + this.y0, t.x = e.x, t.y = e.y, t;
6929
6957
  }
6930
- function j0(t) {
6958
+ function D0(t) {
6931
6959
  var e = { lam: 0, phi: 0 }, i, s, r, a, n, o, h, l, f, u = { value: 0 };
6932
6960
  if (t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, s = Math.atan(Math.sqrt(t.x * t.x + t.y * t.y)), i = Math.atan2(t.y, t.x), t.x >= 0 && t.x >= Math.abs(t.y) ? u.value = T.AREA_0 : t.y >= 0 && t.y >= Math.abs(t.x) ? (u.value = T.AREA_1, i -= y) : t.x < 0 && -t.x >= Math.abs(t.y) ? (u.value = T.AREA_2, i = i < 0 ? i + O : i - O) : (u.value = T.AREA_3, i += y), f = O / 12 * Math.tan(i), n = Math.sin(f) / (Math.cos(f) - 1 / Math.sqrt(2)), o = Math.atan(n), r = Math.cos(i), a = Math.tan(s), h = 1 - r * r * a * a * (1 - Math.cos(Math.atan(1 / Math.cos(o)))), h < -1 ? h = -1 : h > 1 && (h = 1), this.face === k.TOP)
6933
6961
  l = Math.acos(h), e.phi = y - l, u.value === T.AREA_0 ? e.lam = o + y : u.value === T.AREA_1 ? e.lam = o < 0 ? o + O : o - O : u.value === T.AREA_2 ? e.lam = o - y : e.lam = o;
@@ -6935,7 +6963,7 @@ function j0(t) {
6935
6963
  l = Math.acos(h), e.phi = l - y, u.value === T.AREA_0 ? e.lam = -o + y : u.value === T.AREA_1 ? e.lam = -o : u.value === T.AREA_2 ? e.lam = -o - y : e.lam = o < 0 ? -o - O : -o + O;
6936
6964
  else {
6937
6965
  var c, m, d;
6938
- c = h, f = c * c, f >= 1 ? d = 0 : d = Math.sqrt(1 - f) * Math.sin(o), f += d * d, f >= 1 ? m = 0 : m = Math.sqrt(1 - f), u.value === T.AREA_1 ? (f = m, m = -d, d = f) : u.value === T.AREA_2 ? (m = -m, d = -d) : u.value === T.AREA_3 && (f = m, m = d, d = -f), this.face === k.RIGHT ? (f = c, c = -m, m = f) : this.face === k.BACK ? (c = -c, m = -m) : this.face === k.LEFT && (f = c, c = m, m = -f), e.phi = Math.acos(-d) - y, e.lam = Math.atan2(m, c), this.face === k.RIGHT ? e.lam = Nt(e.lam, -y) : this.face === k.BACK ? e.lam = Nt(e.lam, -O) : this.face === k.LEFT && (e.lam = Nt(e.lam, +y));
6966
+ c = h, f = c * c, f >= 1 ? d = 0 : d = Math.sqrt(1 - f) * Math.sin(o), f += d * d, f >= 1 ? m = 0 : m = Math.sqrt(1 - f), u.value === T.AREA_1 ? (f = m, m = -d, d = f) : u.value === T.AREA_2 ? (m = -m, d = -d) : u.value === T.AREA_3 && (f = m, m = d, d = -f), this.face === k.RIGHT ? (f = c, c = -m, m = f) : this.face === k.BACK ? (c = -c, m = -m) : this.face === k.LEFT && (f = c, c = m, m = -f), e.phi = Math.acos(-d) - y, e.lam = Math.atan2(m, c), this.face === k.RIGHT ? e.lam = Ct(e.lam, -y) : this.face === k.BACK ? e.lam = Ct(e.lam, -O) : this.face === k.LEFT && (e.lam = Ct(e.lam, +y));
6939
6967
  }
6940
6968
  if (this.es !== 0) {
6941
6969
  var g, M, v;
@@ -6943,22 +6971,22 @@ function j0(t) {
6943
6971
  }
6944
6972
  return e.lam += this.long0, t.x = e.lam, t.y = e.phi, t;
6945
6973
  }
6946
- function fe(t, e, i, s) {
6974
+ function me(t, e, i, s) {
6947
6975
  var r;
6948
6976
  return t < p ? (s.value = T.AREA_0, r = 0) : (r = Math.atan2(e, i), Math.abs(r) <= I ? s.value = T.AREA_0 : r > I && r <= y + I ? (s.value = T.AREA_1, r -= y) : r > y + I || r <= -(y + I) ? (s.value = T.AREA_2, r = r >= 0 ? r - O : r + O) : (s.value = T.AREA_3, r += y)), r;
6949
6977
  }
6950
- function Nt(t, e) {
6978
+ function Ct(t, e) {
6951
6979
  var i = t + e;
6952
- return i < -O ? i += Vt : i > +O && (i -= Vt), i;
6953
- }
6954
- var D0 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
6955
- const z0 = {
6956
- init: q0,
6957
- forward: U0,
6958
- inverse: j0,
6959
- names: D0
6980
+ return i < -O ? i += Kt : i > +O && (i -= Kt), i;
6981
+ }
6982
+ var z0 = ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"];
6983
+ const B0 = {
6984
+ init: U0,
6985
+ forward: j0,
6986
+ inverse: D0,
6987
+ names: z0
6960
6988
  };
6961
- var oi = [
6989
+ var hi = [
6962
6990
  [1, 22199e-21, -715515e-10, 31103e-10],
6963
6991
  [0.9986, -482243e-9, -24897e-9, -13309e-10],
6964
6992
  [0.9954, -83103e-8, -448605e-10, -986701e-12],
@@ -6978,7 +7006,7 @@ var oi = [
6978
7006
  [0.6213, -0.010418, 883923e-10, 624051e-11],
6979
7007
  [0.5722, -906601e-8, 182e-6, 624051e-11],
6980
7008
  [0.5322, -677797e-8, 275608e-9, 624051e-11]
6981
- ], jt = [
7009
+ ], Dt = [
6982
7010
  [-520417e-23, 0.0124, 121431e-23, -845284e-16],
6983
7011
  [0.062, 0.0124, -126793e-14, 422642e-15],
6984
7012
  [0.124, 0.0124, 507171e-14, -160604e-14],
@@ -6998,12 +7026,12 @@ var oi = [
6998
7026
  [0.9394, 840947e-8, -192841e-9, -42106e-10],
6999
7027
  [0.9761, 616527e-8, -256e-6, -42106e-10],
7000
7028
  [1, 328947e-8, -319159e-9, -42106e-10]
7001
- ], Cr = 0.8487, Ir = 1.3523, Tr = H / 5, B0 = 1 / Tr, Pt = 18, Ge = function(t, e) {
7029
+ ], Cr = 0.8487, Ir = 1.3523, Tr = H / 5, W0 = 1 / Tr, Gt = 18, Ge = function(t, e) {
7002
7030
  return t[0] + e * (t[1] + e * (t[2] + e * t[3]));
7003
- }, W0 = function(t, e) {
7031
+ }, H0 = function(t, e) {
7004
7032
  return t[1] + e * (2 * t[2] + e * 3 * t[3]);
7005
7033
  };
7006
- function H0(t, e, i, s) {
7034
+ function V0(t, e, i, s) {
7007
7035
  for (var r = e; s; --s) {
7008
7036
  var a = t(r);
7009
7037
  if (r -= a, Math.abs(a) < i)
@@ -7011,65 +7039,65 @@ function H0(t, e, i, s) {
7011
7039
  }
7012
7040
  return r;
7013
7041
  }
7014
- function V0() {
7042
+ function K0() {
7015
7043
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.es = 0, this.title = this.title || "Robinson";
7016
7044
  }
7017
- function K0(t) {
7045
+ function X0(t) {
7018
7046
  var e = w(t.x - this.long0, this.over), i = Math.abs(t.y), s = Math.floor(i * Tr);
7019
- s < 0 ? s = 0 : s >= Pt && (s = Pt - 1), i = H * (i - B0 * s);
7047
+ s < 0 ? s = 0 : s >= Gt && (s = Gt - 1), i = H * (i - W0 * s);
7020
7048
  var r = {
7021
- x: Ge(oi[s], i) * e,
7022
- y: Ge(jt[s], i)
7049
+ x: Ge(hi[s], i) * e,
7050
+ y: Ge(Dt[s], i)
7023
7051
  };
7024
7052
  return t.y < 0 && (r.y = -r.y), r.x = r.x * this.a * Cr + this.x0, r.y = r.y * this.a * Ir + this.y0, r;
7025
7053
  }
7026
- function X0(t) {
7054
+ function Q0(t) {
7027
7055
  var e = {
7028
7056
  x: (t.x - this.x0) / (this.a * Cr),
7029
7057
  y: Math.abs(t.y - this.y0) / (this.a * Ir)
7030
7058
  };
7031
7059
  if (e.y >= 1)
7032
- e.x /= oi[Pt][0], e.y = t.y < 0 ? -y : y;
7060
+ e.x /= hi[Gt][0], e.y = t.y < 0 ? -y : y;
7033
7061
  else {
7034
- var i = Math.floor(e.y * Pt);
7035
- for (i < 0 ? i = 0 : i >= Pt && (i = Pt - 1); ; )
7036
- if (jt[i][0] > e.y)
7062
+ var i = Math.floor(e.y * Gt);
7063
+ for (i < 0 ? i = 0 : i >= Gt && (i = Gt - 1); ; )
7064
+ if (Dt[i][0] > e.y)
7037
7065
  --i;
7038
- else if (jt[i + 1][0] <= e.y)
7066
+ else if (Dt[i + 1][0] <= e.y)
7039
7067
  ++i;
7040
7068
  else
7041
7069
  break;
7042
- var s = jt[i], r = 5 * (e.y - s[0]) / (jt[i + 1][0] - s[0]);
7043
- r = H0(function(a) {
7044
- return (Ge(s, a) - e.y) / W0(s, a);
7045
- }, r, p, 100), e.x /= Ge(oi[i], r), e.y = (5 * i + r) * $, t.y < 0 && (e.y = -e.y);
7070
+ var s = Dt[i], r = 5 * (e.y - s[0]) / (Dt[i + 1][0] - s[0]);
7071
+ r = V0(function(a) {
7072
+ return (Ge(s, a) - e.y) / H0(s, a);
7073
+ }, r, p, 100), e.x /= Ge(hi[i], r), e.y = (5 * i + r) * L, t.y < 0 && (e.y = -e.y);
7046
7074
  }
7047
7075
  return e.x = w(e.x + this.long0, this.over), e;
7048
7076
  }
7049
- var Q0 = ["Robinson", "robin"];
7050
- const J0 = {
7051
- init: V0,
7052
- forward: K0,
7053
- inverse: X0,
7054
- names: Q0
7077
+ var J0 = ["Robinson", "robin"];
7078
+ const Y0 = {
7079
+ init: K0,
7080
+ forward: X0,
7081
+ inverse: Q0,
7082
+ names: J0
7055
7083
  };
7056
- function Y0() {
7084
+ function Z0() {
7057
7085
  this.name = "geocent";
7058
7086
  }
7059
- function Z0(t) {
7087
+ function tc(t) {
7060
7088
  var e = Mr(t, this.es, this.a);
7061
7089
  return e;
7062
7090
  }
7063
- function tc(t) {
7091
+ function ec(t) {
7064
7092
  var e = vr(t, this.es, this.a, this.b);
7065
7093
  return e;
7066
7094
  }
7067
- var ec = ["Geocentric", "geocentric", "geocent", "Geocent"];
7068
- const ic = {
7069
- init: Y0,
7070
- forward: Z0,
7071
- inverse: tc,
7072
- names: ec
7095
+ var ic = ["Geocentric", "geocentric", "geocent", "Geocent"];
7096
+ const sc = {
7097
+ init: Z0,
7098
+ forward: tc,
7099
+ inverse: ec,
7100
+ names: ic
7073
7101
  };
7074
7102
  var D = {
7075
7103
  N_POLE: 0,
@@ -7088,7 +7116,7 @@ var D = {
7088
7116
  lat0: { def: 0, num: !0 }
7089
7117
  // default is Equator, conversion to rad is automatic
7090
7118
  };
7091
- function sc() {
7119
+ function rc() {
7092
7120
  if (Object.keys(Ft).forEach(function(i) {
7093
7121
  if (typeof this[i] > "u")
7094
7122
  this[i] = Ft[i].def;
@@ -7097,14 +7125,14 @@ function sc() {
7097
7125
  throw new Error("Invalid parameter value, must be numeric " + i + " = " + this[i]);
7098
7126
  Ft[i].num && (this[i] = parseFloat(this[i]));
7099
7127
  }
7100
- Ft[i].degrees && (this[i] = this[i] * $);
7128
+ Ft[i].degrees && (this[i] = this[i] * L);
7101
7129
  }.bind(this)), Math.abs(Math.abs(this.lat0) - y) < p ? this.mode = this.lat0 < 0 ? D.S_POLE : D.N_POLE : Math.abs(this.lat0) < p ? this.mode = D.EQUIT : (this.mode = D.OBLIQ, this.sinph0 = Math.sin(this.lat0), this.cosph0 = Math.cos(this.lat0)), this.pn1 = this.h / this.a, this.pn1 <= 0 || this.pn1 > 1e10)
7102
7130
  throw new Error("Invalid height");
7103
7131
  this.p = 1 + this.pn1, this.rp = 1 / this.p, this.h1 = 1 / this.pn1, this.pfact = (this.p + 1) * this.h1, this.es = 0;
7104
7132
  var t = this.tilt, e = this.azi;
7105
7133
  this.cg = Math.cos(e), this.sg = Math.sin(e), this.cw = Math.cos(t), this.sw = Math.sin(t);
7106
7134
  }
7107
- function rc(t) {
7135
+ function ac(t) {
7108
7136
  t.x -= this.long0;
7109
7137
  var e = Math.sin(t.y), i = Math.cos(t.y), s = Math.cos(t.x), r, a;
7110
7138
  switch (this.mode) {
@@ -7138,7 +7166,7 @@ function rc(t) {
7138
7166
  var n, o;
7139
7167
  return n = a * this.cg + r * this.sg, o = 1 / (n * this.sw * this.h1 + this.cw), r = (r * this.cg - a * this.sg) * this.cw * o, a = n * o, t.x = r * this.a, t.y = a * this.a, t;
7140
7168
  }
7141
- function ac(t) {
7169
+ function nc(t) {
7142
7170
  t.x /= this.a, t.y /= this.a;
7143
7171
  var e = { x: t.x, y: t.y }, i, s, r;
7144
7172
  r = 1 / (this.pn1 - t.y * this.sw), i = this.pn1 * t.x * r, s = this.pn1 * t.y * this.cw * r, t.x = i * this.cg + s * this.sg, t.y = s * this.cg - i * this.sg;
@@ -7165,14 +7193,14 @@ function ac(t) {
7165
7193
  }
7166
7194
  return t.x = e.x + this.long0, t.y = e.y, t;
7167
7195
  }
7168
- var nc = ["Tilted_Perspective", "tpers"];
7169
- const oc = {
7170
- init: sc,
7171
- forward: rc,
7172
- inverse: ac,
7173
- names: nc
7196
+ var oc = ["Tilted_Perspective", "tpers"];
7197
+ const hc = {
7198
+ init: rc,
7199
+ forward: ac,
7200
+ inverse: nc,
7201
+ names: oc
7174
7202
  };
7175
- function hc() {
7203
+ function lc() {
7176
7204
  if (this.flip_axis = this.sweep === "x" ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
7177
7205
  throw new Error();
7178
7206
  if (this.radius_g = 1 + this.radius_g_1, this.C = this.radius_g * this.radius_g - 1, this.es !== 0) {
@@ -7182,7 +7210,7 @@ function hc() {
7182
7210
  this.radius_p = 1, this.radius_p2 = 1, this.radius_p_inv2 = 1, this.shape = "sphere";
7183
7211
  this.title || (this.title = "Geostationary Satellite View");
7184
7212
  }
7185
- function lc(t) {
7213
+ function cc(t) {
7186
7214
  var e = t.x, i = t.y, s, r, a, n;
7187
7215
  if (e = e - this.long0, this.shape === "ellipse") {
7188
7216
  i = Math.atan(this.radius_p2 * Math.tan(i));
@@ -7193,7 +7221,7 @@ function lc(t) {
7193
7221
  } else this.shape === "sphere" && (s = Math.cos(i), r = Math.cos(e) * s, a = Math.sin(e) * s, n = Math.sin(i), s = this.radius_g - r, this.flip_axis ? (t.x = this.radius_g_1 * Math.atan(a / W(n, s)), t.y = this.radius_g_1 * Math.atan(n / s)) : (t.x = this.radius_g_1 * Math.atan(a / s), t.y = this.radius_g_1 * Math.atan(n / W(a, s))));
7194
7222
  return t.x = t.x * this.a, t.y = t.y * this.a, t;
7195
7223
  }
7196
- function cc(t) {
7224
+ function uc(t) {
7197
7225
  var e = -1, i = 0, s = 0, r, a, n, o;
7198
7226
  if (t.x = t.x / this.a, t.y = t.y / this.a, this.shape === "ellipse") {
7199
7227
  this.flip_axis ? (s = Math.tan(t.y / this.radius_g_1), i = Math.tan(t.x / this.radius_g_1) * W(1, s)) : (i = Math.tan(t.x / this.radius_g_1), s = Math.tan(t.y / this.radius_g_1) * W(1, i));
@@ -7208,87 +7236,87 @@ function cc(t) {
7208
7236
  }
7209
7237
  return t.x = t.x + this.long0, t;
7210
7238
  }
7211
- var uc = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
7212
- const fc = {
7213
- init: hc,
7214
- forward: lc,
7215
- inverse: cc,
7216
- names: uc
7239
+ var fc = ["Geostationary Satellite View", "Geostationary_Satellite", "geos"];
7240
+ const mc = {
7241
+ init: lc,
7242
+ forward: cc,
7243
+ inverse: uc,
7244
+ names: fc
7217
7245
  };
7218
- var zt = 1.340264, Bt = -0.081106, Wt = 893e-6, Ht = 3796e-6, Ne = Math.sqrt(3) / 2;
7219
- function mc() {
7220
- this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.es !== 0 && (this.apa = Ar(this.es), this.qp = et(this.e, 1), this.rqda = Math.sqrt(0.5 * this.qp));
7246
+ var Bt = 1.340264, Wt = -0.081106, Ht = 893e-6, Vt = 3796e-6, Ne = Math.sqrt(3) / 2;
7247
+ function dc() {
7248
+ this.long0 = this.long0 !== void 0 ? this.long0 : 0, this.x0 = this.x0 !== void 0 ? this.x0 : 0, this.y0 = this.y0 !== void 0 ? this.y0 : 0, this.es !== 0 && (this.apa = Pr(this.es), this.qp = et(this.e, 1), this.rqda = Math.sqrt(0.5 * this.qp));
7221
7249
  }
7222
- function dc(t) {
7250
+ function gc(t) {
7223
7251
  var e = w(t.x - this.long0, this.over), i = t.y, s = Math.sin(i);
7224
7252
  this.es !== 0 && (s = et(this.e, s) / this.qp);
7225
7253
  var r = Math.asin(Ne * s), a = r * r, n = a * a * a;
7226
- return t.x = e * Math.cos(r) / (Ne * (zt + 3 * Bt * a + n * (7 * Wt + 9 * Ht * a))), t.y = r * (zt + Bt * a + n * (Wt + Ht * a)), this.es !== 0 && (t.x *= this.rqda, t.y *= this.rqda), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
7254
+ return t.x = e * Math.cos(r) / (Ne * (Bt + 3 * Wt * a + n * (7 * Ht + 9 * Vt * a))), t.y = r * (Bt + Wt * a + n * (Ht + Vt * a)), this.es !== 0 && (t.x *= this.rqda, t.y *= this.rqda), t.x = this.a * t.x + this.x0, t.y = this.a * t.y + this.y0, t;
7227
7255
  }
7228
- function gc(t) {
7256
+ function Mc(t) {
7229
7257
  t.x = (t.x - this.x0) / this.a, t.y = (t.y - this.y0) / this.a, this.es !== 0 && (t.x /= this.rqda, t.y /= this.rqda);
7230
7258
  var e = 1e-9, i = 12, s = t.y, r, a, n, o, h, l;
7231
- for (l = 0; l < i && (r = s * s, a = r * r * r, n = s * (zt + Bt * r + a * (Wt + Ht * r)) - t.y, o = zt + 3 * Bt * r + a * (7 * Wt + 9 * Ht * r), s -= h = n / o, !(Math.abs(h) < e)); ++l)
7259
+ for (l = 0; l < i && (r = s * s, a = r * r * r, n = s * (Bt + Wt * r + a * (Ht + Vt * r)) - t.y, o = Bt + 3 * Wt * r + a * (7 * Ht + 9 * Vt * r), s -= h = n / o, !(Math.abs(h) < e)); ++l)
7232
7260
  ;
7233
- return r = s * s, a = r * r * r, t.x = Ne * t.x * (zt + 3 * Bt * r + a * (7 * Wt + 9 * Ht * r)) / Math.cos(s), t.y = Math.asin(Math.sin(s) / Ne), this.es !== 0 && (t.y = Pr(t.y, this.apa)), t.x = w(t.x + this.long0, this.over), t;
7234
- }
7235
- var Mc = ["eqearth", "Equal Earth", "Equal_Earth"];
7236
- const vc = {
7237
- init: mc,
7238
- forward: dc,
7239
- inverse: gc,
7240
- names: Mc
7261
+ return r = s * s, a = r * r * r, t.x = Ne * t.x * (Bt + 3 * Wt * r + a * (7 * Ht + 9 * Vt * r)) / Math.cos(s), t.y = Math.asin(Math.sin(s) / Ne), this.es !== 0 && (t.y = Ar(t.y, this.apa)), t.x = w(t.x + this.long0, this.over), t;
7262
+ }
7263
+ var vc = ["eqearth", "Equal Earth", "Equal_Earth"];
7264
+ const yc = {
7265
+ init: dc,
7266
+ forward: gc,
7267
+ inverse: Mc,
7268
+ names: vc
7241
7269
  };
7242
- var Qt = 1e-10;
7243
- function yc() {
7270
+ var Jt = 1e-10;
7271
+ function _c() {
7244
7272
  var t;
7245
- if (this.phi1 = this.lat1, Math.abs(this.phi1) < Qt)
7273
+ if (this.phi1 = this.lat1, Math.abs(this.phi1) < Jt)
7246
7274
  throw new Error();
7247
- this.es ? (this.en = Mi(this.es), this.m1 = kt(
7275
+ this.es ? (this.en = vi(this.es), this.m1 = kt(
7248
7276
  this.phi1,
7249
7277
  this.am1 = Math.sin(this.phi1),
7250
7278
  t = Math.cos(this.phi1),
7251
7279
  this.en
7252
- ), this.am1 = t / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = bc, this.forward = _c) : (Math.abs(this.phi1) + Qt >= y ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = wc, this.forward = pc);
7280
+ ), this.am1 = t / (Math.sqrt(1 - this.es * this.am1 * this.am1) * this.am1), this.inverse = pc, this.forward = bc) : (Math.abs(this.phi1) + Jt >= y ? this.cphi1 = 0 : this.cphi1 = 1 / Math.tan(this.phi1), this.inverse = Sc, this.forward = wc);
7253
7281
  }
7254
- function _c(t) {
7282
+ function bc(t) {
7255
7283
  var e = w(t.x - (this.long0 || 0), this.over), i = t.y, s, r, a;
7256
7284
  return s = this.am1 + this.m1 - kt(i, r = Math.sin(i), a = Math.cos(i), this.en), r = a * e / (s * Math.sqrt(1 - this.es * r * r)), t.x = s * Math.sin(r), t.y = this.am1 - s * Math.cos(r), t.x = this.a * t.x + (this.x0 || 0), t.y = this.a * t.y + (this.y0 || 0), t;
7257
7285
  }
7258
- function bc(t) {
7286
+ function pc(t) {
7259
7287
  t.x = (t.x - (this.x0 || 0)) / this.a, t.y = (t.y - (this.y0 || 0)) / this.a;
7260
7288
  var e, i, s, r;
7261
- if (i = W(t.x, t.y = this.am1 - t.y), r = vi(this.am1 + this.m1 - i, this.es, this.en), (e = Math.abs(r)) < y)
7289
+ if (i = W(t.x, t.y = this.am1 - t.y), r = yi(this.am1 + this.m1 - i, this.es, this.en), (e = Math.abs(r)) < y)
7262
7290
  e = Math.sin(r), s = i * Math.atan2(t.x, t.y) * Math.sqrt(1 - this.es * e * e) / Math.cos(r);
7263
- else if (Math.abs(e - y) <= Qt)
7291
+ else if (Math.abs(e - y) <= Jt)
7264
7292
  s = 0;
7265
7293
  else
7266
7294
  throw new Error();
7267
- return t.x = w(s + (this.long0 || 0), this.over), t.y = ft(r), t;
7295
+ return t.x = w(s + (this.long0 || 0), this.over), t.y = mt(r), t;
7268
7296
  }
7269
- function pc(t) {
7297
+ function wc(t) {
7270
7298
  var e = w(t.x - (this.long0 || 0), this.over), i = t.y, s, r;
7271
- return r = this.cphi1 + this.phi1 - i, Math.abs(r) > Qt ? (t.x = r * Math.sin(s = e * Math.cos(i) / r), t.y = this.cphi1 - r * Math.cos(s)) : t.x = t.y = 0, t.x = this.a * t.x + (this.x0 || 0), t.y = this.a * t.y + (this.y0 || 0), t;
7299
+ return r = this.cphi1 + this.phi1 - i, Math.abs(r) > Jt ? (t.x = r * Math.sin(s = e * Math.cos(i) / r), t.y = this.cphi1 - r * Math.cos(s)) : t.x = t.y = 0, t.x = this.a * t.x + (this.x0 || 0), t.y = this.a * t.y + (this.y0 || 0), t;
7272
7300
  }
7273
- function wc(t) {
7301
+ function Sc(t) {
7274
7302
  t.x = (t.x - (this.x0 || 0)) / this.a, t.y = (t.y - (this.y0 || 0)) / this.a;
7275
7303
  var e, i, s = W(t.x, t.y = this.cphi1 - t.y);
7276
7304
  if (i = this.cphi1 + this.phi1 - s, Math.abs(i) > y)
7277
7305
  throw new Error();
7278
- return Math.abs(Math.abs(i) - y) <= Qt ? e = 0 : e = s * Math.atan2(t.x, t.y) / Math.cos(i), t.x = w(e + (this.long0 || 0), this.over), t.y = ft(i), t;
7306
+ return Math.abs(Math.abs(i) - y) <= Jt ? e = 0 : e = s * Math.atan2(t.x, t.y) / Math.cos(i), t.x = w(e + (this.long0 || 0), this.over), t.y = mt(i), t;
7279
7307
  }
7280
- var Sc = ["bonne", "Bonne (Werner lat_1=90)"];
7281
- const Ec = {
7282
- init: yc,
7283
- names: Sc
7308
+ var Ec = ["bonne", "Bonne (Werner lat_1=90)"];
7309
+ const xc = {
7310
+ init: _c,
7311
+ names: Ec
7284
7312
  }, xs = {
7285
7313
  OBLIQUE: {
7286
- forward: Nc,
7287
- inverse: Ic
7288
- },
7289
- TRANSVERSE: {
7290
7314
  forward: Cc,
7291
7315
  inverse: Tc
7316
+ },
7317
+ TRANSVERSE: {
7318
+ forward: Ic,
7319
+ inverse: Rc
7292
7320
  }
7293
7321
  }, Ce = {
7294
7322
  ROTATE: {
@@ -7307,7 +7335,7 @@ const Ec = {
7307
7335
  o_lat_2: "oLat2"
7308
7336
  }
7309
7337
  };
7310
- function xc() {
7338
+ function Pc() {
7311
7339
  if (this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.long0 = this.long0 || 0, this.title = this.title || "General Oblique Transformation", this.isIdentity = fr.includes(this.o_proj), !this.o_proj)
7312
7340
  throw new Error("Missing parameter: o_proj");
7313
7341
  if (this.o_proj === "ob_tran")
@@ -7320,7 +7348,7 @@ function xc() {
7320
7348
  const s = Object.keys(Ce), r = (o) => {
7321
7349
  if (typeof this[o] > "u")
7322
7350
  return;
7323
- const h = parseFloat(this[o]) * $;
7351
+ const h = parseFloat(this[o]) * L;
7324
7352
  if (isNaN(h))
7325
7353
  throw new Error("Invalid value for " + o + ": " + this[o]);
7326
7354
  return h;
@@ -7342,16 +7370,16 @@ function xc() {
7342
7370
  }
7343
7371
  if (!i)
7344
7372
  throw new Error("No valid parameters provided for ob_tran projection.");
7345
- const { lamp: a, phip: n } = Gc(this, i);
7373
+ const { lamp: a, phip: n } = Nc(this, i);
7346
7374
  this.lamp = a, Math.abs(n) > p ? (this.cphip = Math.cos(n), this.sphip = Math.sin(n), this.projectionType = xs.OBLIQUE) : this.projectionType = xs.TRANSVERSE;
7347
7375
  }
7348
7376
  function Ac(t) {
7349
7377
  return this.projectionType.forward(this, t);
7350
7378
  }
7351
- function Pc(t) {
7379
+ function Gc(t) {
7352
7380
  return this.projectionType.inverse(this, t);
7353
7381
  }
7354
- function Gc(t, e) {
7382
+ function Nc(t, e) {
7355
7383
  let i, s;
7356
7384
  if (e === Ce.ROTATE) {
7357
7385
  let r = t.oLongC, a = t.oLatC, n = t.oAlpha;
@@ -7377,7 +7405,7 @@ function Gc(t, e) {
7377
7405
  }
7378
7406
  return { lamp: s, phip: i };
7379
7407
  }
7380
- function Nc(t, e) {
7408
+ function Cc(t, e) {
7381
7409
  let { x: i, y: s } = e;
7382
7410
  i = w(i - t.long0, t.over);
7383
7411
  const r = Math.cos(i), a = Math.sin(s), n = Math.cos(s);
@@ -7392,7 +7420,7 @@ function Nc(t, e) {
7392
7420
  const o = t.obliqueProjection.forward(e);
7393
7421
  return t.isIdentity && (o.x *= H, o.y *= H), o;
7394
7422
  }
7395
- function Cc(t, e) {
7423
+ function Ic(t, e) {
7396
7424
  let { x: i, y: s } = e;
7397
7425
  i = w(i - t.long0, t.over);
7398
7426
  const r = Math.cos(s), a = Math.cos(i);
@@ -7405,8 +7433,8 @@ function Cc(t, e) {
7405
7433
  const n = t.obliqueProjection.forward(e);
7406
7434
  return t.isIdentity && (n.x *= H, n.y *= H), n;
7407
7435
  }
7408
- function Ic(t, e) {
7409
- t.isIdentity && (e.x *= $, e.y *= $);
7436
+ function Tc(t, e) {
7437
+ t.isIdentity && (e.x *= L, e.y *= L);
7410
7438
  const i = t.obliqueProjection.inverse(e);
7411
7439
  let { x: s, y: r } = i;
7412
7440
  if (s < Number.MAX_VALUE) {
@@ -7421,8 +7449,8 @@ function Ic(t, e) {
7421
7449
  }
7422
7450
  return e.x = w(e.x + t.long0), e;
7423
7451
  }
7424
- function Tc(t, e) {
7425
- t.isIdentity && (e.x *= $, e.y *= $);
7452
+ function Rc(t, e) {
7453
+ t.isIdentity && (e.x *= L, e.y *= L);
7426
7454
  const i = t.obliqueProjection.inverse(e);
7427
7455
  let { x: s, y: r } = i;
7428
7456
  if (s < Number.MAX_VALUE) {
@@ -7436,33 +7464,33 @@ function Tc(t, e) {
7436
7464
  }
7437
7465
  return e.x = w(e.x + t.long0), e;
7438
7466
  }
7439
- var Rc = ["General Oblique Transformation", "General_Oblique_Transformation", "ob_tran"];
7440
- const kc = {
7441
- init: xc,
7467
+ var kc = ["General Oblique Transformation", "General_Oblique_Transformation", "ob_tran"];
7468
+ const $c = {
7469
+ init: Pc,
7442
7470
  forward: Ac,
7443
- inverse: Pc,
7444
- names: Rc
7471
+ inverse: Gc,
7472
+ names: kc
7445
7473
  };
7446
- function $c(t) {
7447
- t.Proj.projections.add(Me), t.Proj.projections.add(ve), t.Proj.projections.add(wh), t.Proj.projections.add(Ih), t.Proj.projections.add(Lh), t.Proj.projections.add(jh), t.Proj.projections.add(Vh), t.Proj.projections.add(Yh), t.Proj.projections.add(sl), t.Proj.projections.add(hl), t.Proj.projections.add(_l), t.Proj.projections.add(xl), t.Proj.projections.add(Cl), t.Proj.projections.add(Ll), t.Proj.projections.add(jl), t.Proj.projections.add(Hl), t.Proj.projections.add(Jl), t.Proj.projections.add(i0), t.Proj.projections.add(n0), t.Proj.projections.add(u0), t.Proj.projections.add(M0), t.Proj.projections.add(p0), t.Proj.projections.add(A0), t.Proj.projections.add(R0), t.Proj.projections.add(F0), t.Proj.projections.add(z0), t.Proj.projections.add(J0), t.Proj.projections.add(ic), t.Proj.projections.add(oc), t.Proj.projections.add(fc), t.Proj.projections.add(vc), t.Proj.projections.add(Ec), t.Proj.projections.add(kc);
7474
+ function Lc(t) {
7475
+ t.Proj.projections.add(Me), t.Proj.projections.add(ve), t.Proj.projections.add(Sh), t.Proj.projections.add(Th), t.Proj.projections.add(Oh), t.Proj.projections.add(Dh), t.Proj.projections.add(Kh), t.Proj.projections.add(Zh), t.Proj.projections.add(rl), t.Proj.projections.add(ll), t.Proj.projections.add(bl), t.Proj.projections.add(Pl), t.Proj.projections.add(Il), t.Proj.projections.add(Ol), t.Proj.projections.add(Dl), t.Proj.projections.add(Vl), t.Proj.projections.add(Yl), t.Proj.projections.add(s0), t.Proj.projections.add(o0), t.Proj.projections.add(f0), t.Proj.projections.add(v0), t.Proj.projections.add(w0), t.Proj.projections.add(A0), t.Proj.projections.add(k0), t.Proj.projections.add(q0), t.Proj.projections.add(B0), t.Proj.projections.add(Y0), t.Proj.projections.add(sc), t.Proj.projections.add(hc), t.Proj.projections.add(mc), t.Proj.projections.add(yc), t.Proj.projections.add(xc), t.Proj.projections.add($c);
7448
7476
  }
7449
- const Rr = Object.assign(qo, {
7477
+ const Rr = Object.assign(Uo, {
7450
7478
  defaultDatum: "WGS84",
7451
7479
  Proj: Q,
7452
7480
  WGS84: new Q("WGS84"),
7453
7481
  Point: Rt,
7454
- toPoint: di,
7482
+ toPoint: gi,
7455
7483
  defs: j,
7456
- nadgrid: yo,
7457
- transform: Fo,
7458
- mgrs: Uo,
7484
+ nadgrid: _o,
7485
+ transform: qo,
7486
+ mgrs: jo,
7459
7487
  version: "__VERSION__"
7460
7488
  });
7461
- $c(Rr);
7462
- const Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7489
+ Lc(Rr);
7490
+ const Oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7463
7491
  __proto__: null,
7464
7492
  default: Rr
7465
- }, Symbol.toStringTag, { value: "Module" })), As = [
7493
+ }, Symbol.toStringTag, { value: "Module" })), Ps = [
7466
7494
  [33, 129.5],
7467
7495
  [33, 131],
7468
7496
  [36, 132.166666666667],
@@ -7523,14 +7551,14 @@ const Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7523
7551
  4326: { def: "+proj=longlat +datum=WGS84 +no_defs", geographic: !0 },
7524
7552
  3857: { def: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +no_defs" }
7525
7553
  };
7526
- for (let t = 0; t < As.length; t++) {
7527
- const [e, i] = As[t];
7554
+ for (let t = 0; t < Ps.length; t++) {
7555
+ const [e, i] = Ps[t];
7528
7556
  kr[6669 + t] = {
7529
7557
  def: `+proj=tmerc +lat_0=${e} +lon_0=${i} +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs`,
7530
7558
  swapXY: !0
7531
7559
  };
7532
7560
  }
7533
- const Oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7561
+ const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7534
7562
  __proto__: null,
7535
7563
  CRS_DEFS: kr
7536
7564
  }, Symbol.toStringTag, { value: "Module" }));
@@ -7538,9 +7566,9 @@ export {
7538
7566
  J as CARTOGRAPH_ELEMENT_ATTRS,
7539
7567
  ke as CARTOGRAPH_FORMAT,
7540
7568
  $e as CARTOGRAPH_TAG_NAMES,
7541
- Fc as CARTOGRAPH_THEMES,
7569
+ qc as CARTOGRAPH_THEMES,
7542
7570
  zr as COLLAPSE_THRESHOLD,
7543
- li as CVD_MATRICES,
7571
+ ci as CVD_MATRICES,
7544
7572
  Ie as CVD_TYPES,
7545
7573
  jr as CVD_VALUES,
7546
7574
  tr as GEOGRAPHIC_PLANE,
@@ -7558,10 +7586,10 @@ export {
7558
7586
  Ks as OmScalebarElement,
7559
7587
  Qs as OmShapeElement,
7560
7588
  zs as OmTextElement,
7561
- Ei as PAGE_PRESETS,
7562
- Ti as PAGE_SIZE_NAMES,
7563
- ot as PLACED_ATTR_NAMES,
7564
- bt as PX_PER_MM,
7589
+ xi as PAGE_PRESETS,
7590
+ Ri as PAGE_SIZE_NAMES,
7591
+ ht as PLACED_ATTR_NAMES,
7592
+ ot as PX_PER_MM,
7565
7593
  ha as SCALE_GROUP_SEPARATOR,
7566
7594
  Qr as URL_ACTION_TIMEOUT_MS,
7567
7595
  ya as alignOffset,
@@ -7569,28 +7597,28 @@ export {
7569
7597
  Wr as applyCvdToCanvas,
7570
7598
  fa as applyTokens,
7571
7599
  Jr as applyUrlActions,
7572
- ti as atlasFields,
7573
- jc as boundsArea,
7574
- L as boxMm,
7575
- Ka as buildGraticule,
7576
- an as buildPages,
7600
+ ei as atlasFields,
7601
+ Dc as boundsArea,
7602
+ $ as boxMm,
7603
+ Xa as buildGraticule,
7604
+ nn as buildPages,
7577
7605
  Ls as buildScalebar,
7578
7606
  oa as buildScalebarDrawing,
7579
7607
  Tt as builtinCrsForward,
7580
- qc as canvasMeasurer,
7608
+ Uc as canvasMeasurer,
7581
7609
  ga as clearUnlinked,
7582
- Uc as cornersFromBounds,
7583
- Vi as cornersFromCamera,
7610
+ jc as cornersFromBounds,
7611
+ Ze as cornersFromCamera,
7584
7612
  pe as createFrameGeoref,
7585
7613
  Ur as createZip,
7586
- Bc as defineCartographElements,
7587
- Gi as deltaE00,
7588
- Ba as deriveLegendRows,
7614
+ Wc as defineCartographElements,
7615
+ Ni as deltaE00,
7616
+ Wa as deriveLegendRows,
7589
7617
  Hr as ensureCvdFilters,
7590
- sn as featureBounds,
7618
+ rn as featureBounds,
7591
7619
  tt as fieldOf,
7592
7620
  Us as findFrame,
7593
- Ja as formatDms,
7621
+ Ya as formatDms,
7594
7622
  la as formatScaleDenominator,
7595
7623
  Yr as installUrlActions,
7596
7624
  Lr as isCoreLoaded,
@@ -7598,6 +7626,7 @@ export {
7598
7626
  va as layoutText,
7599
7627
  Br as lintLegendColours,
7600
7628
  Gs as loadCore,
7629
+ ka as maxGeoreferenceablePitch,
7601
7630
  pa as mercatorForward,
7602
7631
  wa as mercatorInverse,
7603
7632
  ts as niceInterval,
@@ -7605,36 +7634,36 @@ export {
7605
7634
  It as normalizeCrs,
7606
7635
  Na as northBearingDegrees,
7607
7636
  qs as ownerCartograph,
7608
- rn as padBounds,
7609
- Si as paintEnvForDpi,
7637
+ an as padBounds,
7638
+ Ei as paintEnvForDpi,
7610
7639
  Dr as parseColor,
7611
7640
  we as parseCorners,
7612
- on as parseSort,
7613
- Ct as peekCore,
7614
- de as readCamera,
7641
+ hn as parseSort,
7642
+ Mt as peekCore,
7643
+ qt as readCamera,
7615
7644
  Ys as readLiteralRows,
7616
- Va as readOverrides,
7645
+ Ka as readOverrides,
7617
7646
  rt as referencedFrame,
7618
- en as rejectionFor,
7619
- ci as renderCartograph,
7647
+ sn as rejectionFor,
7648
+ ui as renderCartograph,
7620
7649
  Rs as renderCartographAtlas,
7621
7650
  Hs as resolveCrsForward,
7622
- hi as resolveCvdType,
7623
- cn as resolveFilenames,
7651
+ li as resolveCvdType,
7652
+ un as resolveFilenames,
7624
7653
  _e as resolvePageSize,
7625
7654
  ca as resolveToken,
7626
7655
  Fs as resolveTokens,
7627
- za as rowColorFor,
7656
+ Ba as rowColorFor,
7628
7657
  Ta as sanitizeAdoptedMap,
7629
- ln as sanitizeFilename,
7658
+ cn as sanitizeFilename,
7630
7659
  Ca as scaleVariation,
7631
- Ps as setCoreLoader,
7660
+ As as setCoreLoader,
7632
7661
  Ai as simulate,
7633
- Da as swatchShapeFor,
7662
+ za as swatchShapeFor,
7634
7663
  ua as tokensIn,
7635
- Bi as utmDef,
7664
+ Wi as utmDef,
7636
7665
  rr as validateCartograph,
7637
- zc as validateCartographDeep,
7638
- Dc as validateCartographString,
7639
- Ii as whenPageReady
7666
+ Bc as validateCartographDeep,
7667
+ zc as validateCartographString,
7668
+ Ti as whenPageReady
7640
7669
  };