@seed-ship/mcp-ui-solid 3.0.5 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +253 -280
  3. package/dist/components/ChartJSRenderer.cjs +37 -15
  4. package/dist/components/ChartJSRenderer.cjs.map +1 -1
  5. package/dist/components/ChartJSRenderer.d.ts.map +1 -1
  6. package/dist/components/ChartJSRenderer.js +37 -15
  7. package/dist/components/ChartJSRenderer.js.map +1 -1
  8. package/dist/components/DataPreviewSection.cjs +172 -0
  9. package/dist/components/DataPreviewSection.cjs.map +1 -0
  10. package/dist/components/DataPreviewSection.d.ts +19 -0
  11. package/dist/components/DataPreviewSection.d.ts.map +1 -0
  12. package/dist/components/DataPreviewSection.js +172 -0
  13. package/dist/components/DataPreviewSection.js.map +1 -0
  14. package/dist/components/MapRenderer.cjs +168 -26
  15. package/dist/components/MapRenderer.cjs.map +1 -1
  16. package/dist/components/MapRenderer.d.ts +2 -2
  17. package/dist/components/MapRenderer.d.ts.map +1 -1
  18. package/dist/components/MapRenderer.js +169 -27
  19. package/dist/components/MapRenderer.js.map +1 -1
  20. package/dist/components/ScratchpadPanel.cjs +74 -0
  21. package/dist/components/ScratchpadPanel.cjs.map +1 -1
  22. package/dist/components/ScratchpadPanel.d.ts.map +1 -1
  23. package/dist/components/ScratchpadPanel.js +75 -1
  24. package/dist/components/ScratchpadPanel.js.map +1 -1
  25. package/dist/components/VerifiedText.cjs +166 -0
  26. package/dist/components/VerifiedText.cjs.map +1 -0
  27. package/dist/components/VerifiedText.d.ts +22 -0
  28. package/dist/components/VerifiedText.d.ts.map +1 -0
  29. package/dist/components/VerifiedText.js +166 -0
  30. package/dist/components/VerifiedText.js.map +1 -0
  31. package/dist/components/index.d.ts +4 -0
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components.cjs +4 -0
  34. package/dist/components.cjs.map +1 -1
  35. package/dist/components.d.cts +4 -0
  36. package/dist/components.d.ts +4 -0
  37. package/dist/components.js +4 -0
  38. package/dist/components.js.map +1 -1
  39. package/dist/hooks/index.d.ts +2 -0
  40. package/dist/hooks/index.d.ts.map +1 -1
  41. package/dist/hooks/useDataValidator.cjs +31 -0
  42. package/dist/hooks/useDataValidator.cjs.map +1 -0
  43. package/dist/hooks/useDataValidator.d.ts +42 -0
  44. package/dist/hooks/useDataValidator.d.ts.map +1 -0
  45. package/dist/hooks/useDataValidator.js +31 -0
  46. package/dist/hooks/useDataValidator.js.map +1 -0
  47. package/dist/hooks.cjs +2 -0
  48. package/dist/hooks.cjs.map +1 -1
  49. package/dist/hooks.d.cts +2 -0
  50. package/dist/hooks.d.ts +2 -0
  51. package/dist/hooks.js +2 -0
  52. package/dist/hooks.js.map +1 -1
  53. package/dist/index.cjs +8 -0
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/index.d.cts +9 -5
  56. package/dist/index.d.ts +9 -5
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +8 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs +290 -0
  61. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs.map +1 -0
  62. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js +291 -0
  63. package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js.map +1 -0
  64. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs +243 -0
  65. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs.map +1 -0
  66. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js +243 -0
  67. package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js.map +1 -0
  68. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs +137 -0
  69. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs.map +1 -0
  70. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js +137 -0
  71. package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js.map +1 -0
  72. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.cjs +686 -0
  73. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.cjs.map +1 -0
  74. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.js +687 -0
  75. package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.js.map +1 -0
  76. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs +1366 -0
  77. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs.map +1 -0
  78. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.js +1366 -0
  79. package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.js.map +1 -0
  80. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.cjs +54 -0
  81. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.cjs.map +1 -0
  82. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.js +55 -0
  83. package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.js.map +1 -0
  84. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.cjs +1256 -0
  85. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.cjs.map +1 -0
  86. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.js +1256 -0
  87. package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.js.map +1 -0
  88. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.cjs +47 -0
  89. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.cjs.map +1 -0
  90. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +48 -0
  91. package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js.map +1 -0
  92. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.cjs +378 -0
  93. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.cjs.map +1 -0
  94. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.js +379 -0
  95. package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.js.map +1 -0
  96. package/dist/services/data-validator.cjs +85 -0
  97. package/dist/services/data-validator.cjs.map +1 -0
  98. package/dist/services/data-validator.d.ts +28 -0
  99. package/dist/services/data-validator.d.ts.map +1 -0
  100. package/dist/services/data-validator.js +85 -0
  101. package/dist/services/data-validator.js.map +1 -0
  102. package/dist/services/index.d.ts +1 -0
  103. package/dist/services/index.d.ts.map +1 -1
  104. package/dist/types/chat-bus.d.ts +88 -1
  105. package/dist/types/chat-bus.d.ts.map +1 -1
  106. package/dist/types/index.d.ts +135 -6
  107. package/dist/types/index.d.ts.map +1 -1
  108. package/dist/types.d.cts +135 -6
  109. package/dist/types.d.ts +135 -6
  110. package/package.json +5 -1
  111. package/src/components/ChartJSRenderer.tsx +35 -13
  112. package/src/components/DataPreviewSection.tsx +206 -0
  113. package/src/components/MapRenderer.test.tsx +94 -5
  114. package/src/components/MapRenderer.tsx +246 -45
  115. package/src/components/ScratchpadPanel.tsx +10 -2
  116. package/src/components/VerifiedText.tsx +187 -0
  117. package/src/components/index.ts +7 -0
  118. package/src/hooks/index.ts +7 -0
  119. package/src/hooks/useDataValidator.ts +68 -0
  120. package/src/index.ts +26 -1
  121. package/src/services/data-validator.test.ts +151 -0
  122. package/src/services/data-validator.ts +149 -0
  123. package/src/services/index.ts +2 -0
  124. package/src/types/chat-bus.ts +98 -1
  125. package/src/types/index.ts +145 -6
  126. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,1256 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const index = require("../../../../../@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs");
4
+ const index_exports_import_es = require("../../../../../color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs");
5
+ const index$4 = require("../../../../../@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs");
6
+ const index$5 = require("../../../../../pbf@4.0.1/node_modules/pbf/index.cjs");
7
+ const index$2 = require("../../../../../pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs");
8
+ const index$1 = require("../../../../../rbush@3.0.1/node_modules/rbush/index.cjs");
9
+ const index$3 = require("../../../../../potpack@1.0.2/node_modules/potpack/index.cjs");
10
+ var pt = Object.defineProperty;
11
+ var C = Math.pow;
12
+ var c = (a, e) => pt(a, "name", { value: e, configurable: true });
13
+ var D = (a, e, t) => new Promise((r, n) => {
14
+ var i = (o) => {
15
+ try {
16
+ l(t.next(o));
17
+ } catch (f) {
18
+ n(f);
19
+ }
20
+ }, s = (o) => {
21
+ try {
22
+ l(t.throw(o));
23
+ } catch (f) {
24
+ n(f);
25
+ }
26
+ }, l = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(i, s);
27
+ l((t = t.apply(a, e)).next());
28
+ });
29
+ var be = class be2 {
30
+ constructor(e, t) {
31
+ this.str = e != null ? e : t, this.perFeature = typeof this.str == "function" && this.str.length === 2;
32
+ }
33
+ get(e, t) {
34
+ return typeof this.str == "function" ? this.str(e, t) : this.str;
35
+ }
36
+ };
37
+ c(be, "StringAttr");
38
+ var O = be, he = class he2 {
39
+ constructor(e, t = 1) {
40
+ this.value = e != null ? e : t, this.perFeature = typeof this.value == "function" && this.value.length === 2;
41
+ }
42
+ get(e, t) {
43
+ return typeof this.value == "function" ? this.value(e, t) : this.value;
44
+ }
45
+ };
46
+ c(he, "NumberAttr");
47
+ var T = he, pe = class pe2 {
48
+ constructor(e) {
49
+ var t;
50
+ this.labelProps = (t = e == null ? void 0 : e.labelProps) != null ? t : ["name"], this.textTransform = e == null ? void 0 : e.textTransform;
51
+ }
52
+ get(e, t) {
53
+ let r, n;
54
+ typeof this.labelProps == "function" ? n = this.labelProps(e, t) : n = this.labelProps;
55
+ for (let s of n) if (Object.prototype.hasOwnProperty.call(t.props, s) && typeof t.props[s] == "string") {
56
+ r = t.props[s];
57
+ break;
58
+ }
59
+ let i;
60
+ return typeof this.textTransform == "function" ? i = this.textTransform(e, t) : i = this.textTransform, r && i === "uppercase" ? r = r.toUpperCase() : r && i === "lowercase" ? r = r.toLowerCase() : r && i === "capitalize" && (r = r.toLowerCase().split(" ").map((o) => o[0].toUpperCase() + o.slice(1)).join(" ")), r;
61
+ }
62
+ };
63
+ c(pe, "TextAttr");
64
+ var E = pe, ge = class ge2 {
65
+ constructor(e) {
66
+ var t, r;
67
+ e != null && e.font ? this.font = e.font : (this.family = (t = e == null ? void 0 : e.fontFamily) != null ? t : "sans-serif", this.size = (r = e == null ? void 0 : e.fontSize) != null ? r : 12, this.weight = e == null ? void 0 : e.fontWeight, this.style = e == null ? void 0 : e.fontStyle);
68
+ }
69
+ get(e, t) {
70
+ if (this.font) return typeof this.font == "function" ? this.font(e, t) : this.font;
71
+ let r = "";
72
+ this.style && (typeof this.style == "function" ? r = `${this.style(e, t)} ` : r = `${this.style} `);
73
+ let n = "";
74
+ this.weight && (typeof this.weight == "function" ? n = `${this.weight(e, t)} ` : n = `${this.weight} `);
75
+ let i;
76
+ typeof this.size == "function" ? i = this.size(e, t) : i = this.size;
77
+ let s;
78
+ return typeof this.family == "function" ? s = this.family(e, t) : s = this.family, `${r}${n}${i}px ${s}`;
79
+ }
80
+ };
81
+ c(ge, "FontAttr");
82
+ var N = ge, ye = class ye2 {
83
+ constructor(e, t = []) {
84
+ this.value = e != null ? e : t, this.perFeature = typeof this.value == "function" && this.value.length === 2;
85
+ }
86
+ get(e, t) {
87
+ return typeof this.value == "function" ? this.value(e, t) : this.value;
88
+ }
89
+ };
90
+ c(ye, "ArrayAttr");
91
+ var q = ye;
92
+ var gt = c((a, e, t) => {
93
+ let r = [], n, i, s, l = 0, o = 0, f = 0, u = 0, m = 0, d = 0, h = 0, g = 0, y = 0, _ = 0, k = 0, p = 0;
94
+ if (a.length < 2) return [];
95
+ if (a.length === 2) return f = Math.sqrt(C(a[1].x - a[0].x, 2) + C(a[1].y - a[0].y, 2)), [{ length: f, beginIndex: 0, beginDistance: 0, endIndex: 2, endDistance: f }];
96
+ for (u = Math.sqrt(C(a[1].x - a[0].x, 2) + C(a[1].y - a[0].y, 2)), l = 1, o = a.length - 1; l < o; l++) n = a[l - 1], i = a[l], s = a[l + 1], d = i.x - n.x, h = i.y - n.y, g = s.x - i.x, y = s.y - i.y, m = Math.sqrt(g * g + y * y), f += u, _ = Math.acos((d * g + h * y) / (u * m)), (_ > e || f - p > t) && (r.push({ length: f - p, beginDistance: p, beginIndex: k, endIndex: l + 1, endDistance: f }), k = l, p = f), u = m;
97
+ return l - k > 0 && r.push({ length: f - p + m, beginIndex: k, beginDistance: p, endIndex: l + 1, endDistance: f + m }), r;
98
+ }, "linelabel");
99
+ function Ue(a, e, t, r) {
100
+ let n = [];
101
+ for (let i of a) {
102
+ let s = gt(i, Math.PI / 45, e);
103
+ for (let l of s) if (l.length >= e + r) {
104
+ let o = new index(i[l.beginIndex].x, i[l.beginIndex].y), f = i[l.endIndex - 1], u = new index((f.x - o.x) / l.length, (f.y - o.y) / l.length);
105
+ for (let m = r; m < l.length - e; m += t) n.push({ start: o.add(u.mult(m)), end: o.add(u.mult(m + e)) });
106
+ }
107
+ }
108
+ return n;
109
+ }
110
+ c(Ue, "simpleLabel");
111
+ function Ge(a, e, t, r) {
112
+ let n = e.x - a.x, i = e.y - a.y, s = Math.sqrt(C(e.x - a.x, 2) + C(e.y - a.y, 2)), l = [];
113
+ for (let o = 0; o < t + r; o += 2 * r) {
114
+ let f = o * 1 / s;
115
+ l.push({ x: a.x + f * n, y: a.y + f * i });
116
+ }
117
+ return l;
118
+ }
119
+ c(Ge, "lineCells");
120
+ function xe(a, e) {
121
+ if (a.length <= e) return [a];
122
+ let t = e - 1, r = a.lastIndexOf(" ", t), n = a.indexOf(" ", t);
123
+ if (r === -1 && n === -1) return [a];
124
+ let i, s;
125
+ return n === -1 || r >= 0 && t - r < n - t ? (i = a.substring(0, r), s = a.substring(r + 1, a.length)) : (i = a.substring(0, n), s = a.substring(n + 1, a.length)), [i, ...xe(s, e)];
126
+ }
127
+ c(xe, "linebreak");
128
+ var rt = ((r) => (r[r.Point = 1] = "Point", r[r.Line = 2] = "Line", r[r.Polygon = 3] = "Polygon", r))(rt || {});
129
+ function Y(a) {
130
+ return `${a.x}:${a.y}:${a.z}`;
131
+ }
132
+ c(Y, "toIndex");
133
+ var kt = c((a, e, t) => {
134
+ a.pos = e;
135
+ let r = a.readVarint() + a.pos, n = 1, i = 0, s = 0, l = 0, o = 1 / 0, f = -1 / 0, u = 1 / 0, m = -1 / 0, d = [], h = [];
136
+ for (; a.pos < r; ) {
137
+ if (i <= 0) {
138
+ let g = a.readVarint();
139
+ n = g & 7, i = g >> 3;
140
+ }
141
+ if (i--, n === 1 || n === 2) s += a.readSVarint() * t, l += a.readSVarint() * t, s < o && (o = s), s > f && (f = s), l < u && (u = l), l > m && (m = l), n === 1 && (h.length > 0 && d.push(h), h = []), h.push(new index(s, l));
142
+ else if (n === 7) h && h.push(h[0].clone());
143
+ else throw new Error(`unknown command ${n}`);
144
+ }
145
+ return h && d.push(h), { geom: d, bbox: { minX: o, minY: u, maxX: f, maxY: m } };
146
+ }, "loadGeomAndBbox");
147
+ function nt(a, e) {
148
+ let t = new index$4.VectorTile(new index$5(a)), r = /* @__PURE__ */ new Map();
149
+ for (let [n, i] of Object.entries(t.layers)) {
150
+ let s = [], l = i;
151
+ for (let o = 0; o < l.length; o++) {
152
+ let f = kt(l.feature(o)._pbf, l.feature(o)._geometry, e / l.extent), u = 0;
153
+ for (let m of f.geom) u += m.length;
154
+ s.push({ id: l.feature(o).id, geomType: l.feature(o).type, geom: f.geom, numVertices: u, bbox: f.bbox, props: l.feature(o).properties });
155
+ }
156
+ r.set(n, s);
157
+ }
158
+ return r;
159
+ }
160
+ c(nt, "parseTile");
161
+ var we = class we2 {
162
+ constructor(e, t) {
163
+ typeof e == "string" ? this.p = new index$2.PMTiles(e) : this.p = e, this.zoomaborts = [], this.shouldCancelZooms = t;
164
+ }
165
+ get(e, t) {
166
+ return D(this, null, function* () {
167
+ this.shouldCancelZooms && (this.zoomaborts = this.zoomaborts.filter((s) => s.z !== e.z ? (s.controller.abort(), false) : true));
168
+ let r = new AbortController();
169
+ this.zoomaborts.push({ z: e.z, controller: r });
170
+ let n = r.signal, i = yield this.p.getZxy(e.z, e.x, e.y, n);
171
+ return i ? nt(i.data, t) : /* @__PURE__ */ new Map();
172
+ });
173
+ }
174
+ };
175
+ c(we, "PmtilesSource");
176
+ var H = we, ke = class ke2 {
177
+ constructor(e, t) {
178
+ this.url = e, this.zoomaborts = [], this.shouldCancelZooms = t;
179
+ }
180
+ get(e, t) {
181
+ return D(this, null, function* () {
182
+ this.shouldCancelZooms && (this.zoomaborts = this.zoomaborts.filter((s) => s.z !== e.z ? (s.controller.abort(), false) : true));
183
+ let r = this.url.replace("{z}", e.z.toString()).replace("{x}", e.x.toString()).replace("{y}", e.y.toString()), n = new AbortController();
184
+ this.zoomaborts.push({ z: e.z, controller: n });
185
+ let i = n.signal;
186
+ return new Promise((s, l) => {
187
+ fetch(r, { signal: i }).then((o) => o.arrayBuffer()).then((o) => {
188
+ let f = nt(o, t);
189
+ s(f);
190
+ }).catch((o) => {
191
+ l(o);
192
+ });
193
+ });
194
+ });
195
+ }
196
+ };
197
+ c(ke, "ZxySource");
198
+ var Q = ke, _e = 6378137, Qe = 85.0511287798, U = _e * Math.PI, zt = c((a) => {
199
+ let e = Math.PI / 180, t = Math.max(Math.min(Qe, a[0]), -Qe), r = Math.sin(t * e);
200
+ return new index(_e * a[1] * e, _e * Math.log((1 + r) / (1 - r)) / 2);
201
+ }, "project");
202
+ function et(a) {
203
+ return a * a;
204
+ }
205
+ c(et, "sqr");
206
+ function G(a, e) {
207
+ return et(a.x - e.x) + et(a.y - e.y);
208
+ }
209
+ c(G, "dist2");
210
+ function Tt(a, e, t) {
211
+ let r = G(e, t);
212
+ if (r === 0) return G(a, e);
213
+ let n = ((a.x - e.x) * (t.x - e.x) + (a.y - e.y) * (t.y - e.y)) / r;
214
+ return n = Math.max(0, Math.min(1, n)), G(a, new index(e.x + n * (t.x - e.x), e.y + n * (t.y - e.y)));
215
+ }
216
+ c(Tt, "distToSegmentSquared");
217
+ function tt(a, e) {
218
+ let t = false;
219
+ for (let r = 0, n = e.length - 1; r < e.length; n = r++) {
220
+ let i = e[r].x, s = e[r].y, l = e[n].x, o = e[n].y;
221
+ s > a.y != o > a.y && a.x < (l - i) * (a.y - s) / (o - s) + i && (t = !t);
222
+ }
223
+ return t;
224
+ }
225
+ c(tt, "isInRing");
226
+ function Pt(a) {
227
+ let e = 0;
228
+ for (let t = 0; t < a.length; t++) {
229
+ let r = (t + 1) % a.length;
230
+ e += a[t].x * a[r].y, e -= a[r].x * a[t].y;
231
+ }
232
+ return e < 0;
233
+ }
234
+ c(Pt, "isCcw");
235
+ function Lt(a, e) {
236
+ let t = false;
237
+ for (let r of e) if (Pt(r)) tt(a, r) && (t = false);
238
+ else {
239
+ if (t) return true;
240
+ tt(a, r) && (t = true);
241
+ }
242
+ return t;
243
+ }
244
+ c(Lt, "pointInPolygon");
245
+ function vt(a, e) {
246
+ let t = 1 / 0;
247
+ for (let r of e) {
248
+ let n = Math.sqrt(G(a, r[0]));
249
+ n < t && (t = n);
250
+ }
251
+ return t;
252
+ }
253
+ c(vt, "pointMinDistToPoints");
254
+ function Ct(a, e) {
255
+ let t = 1 / 0;
256
+ for (let r of e) for (let n = 0; n < r.length - 1; n++) {
257
+ let i = Math.sqrt(Tt(a, r[n], r[n + 1]));
258
+ i < t && (t = i);
259
+ }
260
+ return t;
261
+ }
262
+ c(Ct, "pointMinDistToLines");
263
+ var ze = class ze2 {
264
+ constructor(e, t) {
265
+ this.source = e, this.cache = /* @__PURE__ */ new Map(), this.inflight = /* @__PURE__ */ new Map(), this.tileSize = t;
266
+ }
267
+ get(e) {
268
+ return D(this, null, function* () {
269
+ let t = Y(e);
270
+ return new Promise((r, n) => {
271
+ let i = this.cache.get(t);
272
+ if (i) i.used = performance.now(), r(i.data);
273
+ else {
274
+ let s = this.inflight.get(t);
275
+ s ? s.push({ resolve: r, reject: n }) : (this.inflight.set(t, []), this.source.get(e, this.tileSize).then((l) => {
276
+ this.cache.set(t, { used: performance.now(), data: l });
277
+ let o = this.inflight.get(t);
278
+ if (o) for (let f of o) f.resolve(l);
279
+ if (this.inflight.delete(t), r(l), this.cache.size >= 64) {
280
+ let f = 1 / 0, u;
281
+ this.cache.forEach((m, d) => {
282
+ m.used < f && (f = m.used, u = d);
283
+ }), u && this.cache.delete(u);
284
+ }
285
+ }).catch((l) => {
286
+ let o = this.inflight.get(t);
287
+ if (o) for (let f of o) f.reject(l);
288
+ this.inflight.delete(t), n(l);
289
+ }));
290
+ }
291
+ });
292
+ });
293
+ }
294
+ queryFeatures(e, t, r, n) {
295
+ let i = zt([t, e]), s = new index((i.x + U) / (U * 2), 1 - (i.y + U) / (U * 2));
296
+ s.x > 1 && (s.x = s.x - Math.floor(s.x));
297
+ let l = s.mult(1 << r), o = Math.floor(l.x), f = Math.floor(l.y), u = Y({ z: r, x: o, y: f }), m = [], d = this.cache.get(u);
298
+ if (d) {
299
+ let h = new index((l.x - o) * this.tileSize, (l.y - f) * this.tileSize);
300
+ for (let [g, y] of d.data.entries()) for (let _ of y) _.geomType === 1 ? vt(h, _.geom) < n && m.push({ feature: _, layerName: g }) : _.geomType === 2 ? Ct(h, _.geom) < n && m.push({ feature: _, layerName: g }) : Lt(h, _.geom) && m.push({ feature: _, layerName: g });
301
+ }
302
+ return m;
303
+ }
304
+ };
305
+ c(ze, "TileCache");
306
+ var ee = ze;
307
+ var St = ((r) => (r[r.Left = 1] = "Left", r[r.Center = 2] = "Center", r[r.Right = 3] = "Right", r))(St || {}), At = ((o) => (o[o.N = 1] = "N", o[o.Ne = 2] = "Ne", o[o.E = 3] = "E", o[o.Se = 4] = "Se", o[o.S = 5] = "S", o[o.Sw = 6] = "Sw", o[o.W = 7] = "W", o[o.Nw = 8] = "Nw", o))(At || {}), zr = c((a, e, t) => {
308
+ let r = document.createElement("canvas"), n = r.getContext("2d");
309
+ return r.width = a, r.height = e, n !== null && t(r, n), r;
310
+ }, "createPattern"), ve = class ve2 {
311
+ constructor(e) {
312
+ var t;
313
+ this.pattern = e.pattern, this.fill = new O(e.fill, "black"), this.opacity = new T(e.opacity, 1), this.stroke = new O(e.stroke, "black"), this.width = new T(e.width, 0), this.perFeature = (t = this.fill.perFeature || this.opacity.perFeature || this.stroke.perFeature || this.width.perFeature || e.perFeature) != null ? t : false, this.doStroke = false;
314
+ }
315
+ before(e, t) {
316
+ if (!this.perFeature) {
317
+ e.globalAlpha = this.opacity.get(t), e.fillStyle = this.fill.get(t), e.strokeStyle = this.stroke.get(t);
318
+ let r = this.width.get(t);
319
+ r > 0 && (this.doStroke = true), e.lineWidth = r;
320
+ }
321
+ if (this.pattern) {
322
+ let r = e.createPattern(this.pattern, "repeat");
323
+ r && (e.fillStyle = r);
324
+ }
325
+ }
326
+ draw(e, t, r, n) {
327
+ let i = false;
328
+ if (this.perFeature) {
329
+ e.globalAlpha = this.opacity.get(r, n), e.fillStyle = this.fill.get(r, n);
330
+ let l = this.width.get(r, n);
331
+ l && (i = true, e.strokeStyle = this.stroke.get(r, n), e.lineWidth = l);
332
+ }
333
+ let s = c(() => {
334
+ e.fill(), (i || this.doStroke) && e.stroke();
335
+ }, "drawPath");
336
+ e.beginPath();
337
+ for (let l of t) for (let o = 0; o < l.length; o++) {
338
+ let f = l[o];
339
+ o === 0 ? e.moveTo(f.x, f.y) : e.lineTo(f.x, f.y);
340
+ }
341
+ s();
342
+ }
343
+ };
344
+ c(ve, "PolygonSymbolizer");
345
+ var P = ve;
346
+ function Tr(a, e) {
347
+ return (t) => {
348
+ let r = t - a;
349
+ return r >= 0 && r < e.length ? e[r] : 0;
350
+ };
351
+ }
352
+ c(Tr, "arr");
353
+ function Dt(a, e) {
354
+ let t = 0;
355
+ for (; e[t + 1][0] < a; ) t++;
356
+ return t;
357
+ }
358
+ c(Dt, "getStopIndex");
359
+ function Ot(a, e, t) {
360
+ return a * (t - e) + e;
361
+ }
362
+ c(Ot, "interpolate");
363
+ function Mt(a, e, t, r) {
364
+ let n = r[e + 1][0] - r[e][0], i = a - r[e][0];
365
+ return n === 0 ? 0 : t === 1 ? i / n : (C(t, i) - 1) / (C(t, n) - 1);
366
+ }
367
+ c(Mt, "computeInterpolationFactor");
368
+ function F(a, e) {
369
+ return (t) => {
370
+ if (e.length < 1) return 0;
371
+ if (t <= e[0][0]) return e[0][1];
372
+ if (t >= e[e.length - 1][0]) return e[e.length - 1][1];
373
+ let r = Dt(t, e), n = Mt(t, r, a, e);
374
+ return Ot(n, e[r][1], e[r + 1][1]);
375
+ };
376
+ }
377
+ c(F, "exp");
378
+ function Pr(a, e) {
379
+ return (t) => {
380
+ if (e.length < 1) return 0;
381
+ let r = a;
382
+ for (let n = 0; n < e.length; n++) t >= e[n][0] && (r = e[n][1]);
383
+ return r;
384
+ };
385
+ }
386
+ c(Pr, "step");
387
+ function Le(a) {
388
+ return F(1, a);
389
+ }
390
+ c(Le, "linear");
391
+ var Ce = class Ce2 {
392
+ constructor(e) {
393
+ var t;
394
+ this.color = new O(e.color, "black"), this.width = new T(e.width), this.opacity = new T(e.opacity), this.dash = e.dash ? new q(e.dash) : null, this.dashColor = new O(e.dashColor, "black"), this.dashWidth = new T(e.dashWidth, 1), this.lineCap = new O(e.lineCap, "butt"), this.lineJoin = new O(e.lineJoin, "miter"), this.skip = false, this.perFeature = !!((t = this.dash) != null && t.perFeature || this.color.perFeature || this.opacity.perFeature || this.width.perFeature || this.lineCap.perFeature || this.lineJoin.perFeature || e.perFeature);
395
+ }
396
+ before(e, t) {
397
+ this.perFeature || (e.strokeStyle = this.color.get(t), e.lineWidth = this.width.get(t), e.globalAlpha = this.opacity.get(t), e.lineCap = this.lineCap.get(t), e.lineJoin = this.lineJoin.get(t));
398
+ }
399
+ draw(e, t, r, n) {
400
+ if (this.skip) return;
401
+ let i = c(() => {
402
+ this.perFeature && (e.globalAlpha = this.opacity.get(r, n), e.lineCap = this.lineCap.get(r, n), e.lineJoin = this.lineJoin.get(r, n)), this.dash ? (e.save(), this.perFeature ? (e.lineWidth = this.dashWidth.get(r, n), e.strokeStyle = this.dashColor.get(r, n), e.setLineDash(this.dash.get(r, n))) : e.setLineDash(this.dash.get(r)), e.stroke(), e.restore()) : (e.save(), this.perFeature && (e.lineWidth = this.width.get(r, n), e.strokeStyle = this.color.get(r, n)), e.stroke(), e.restore());
403
+ }, "strokePath");
404
+ e.beginPath();
405
+ for (let s of t) for (let l = 0; l < s.length; l++) {
406
+ let o = s[l];
407
+ l === 0 ? e.moveTo(o.x, o.y) : e.lineTo(o.x, o.y);
408
+ }
409
+ i();
410
+ }
411
+ };
412
+ c(Ce, "LineSymbolizer");
413
+ var M = Ce, Se = class Se2 {
414
+ constructor(e) {
415
+ this.name = e.name, this.sheet = e.sheet, this.dpr = window.devicePixelRatio;
416
+ }
417
+ place(e, t, r) {
418
+ t[0];
419
+ let i = new index(t[0][0].x, t[0][0].y), s = this.sheet.get(this.name), l = s.w / this.dpr, o = s.h / this.dpr, f = { minX: i.x - l / 2, minY: i.y - o / 2, maxX: i.x + l / 2, maxY: i.y + o / 2 };
420
+ return [{ anchor: i, bboxes: [f], draw: c((m) => {
421
+ m.globalAlpha = 1, m.drawImage(this.sheet.canvas, s.x, s.y, s.w, s.h, -s.w / 2 / this.dpr, -s.h / 2 / this.dpr, s.w / 2, s.h / 2);
422
+ }, "draw") }];
423
+ }
424
+ };
425
+ c(Se, "IconSymbolizer");
426
+ var it = Se, Ae = class Ae2 {
427
+ constructor(e) {
428
+ this.radius = new T(e.radius, 3), this.fill = new O(e.fill, "black"), this.stroke = new O(e.stroke, "white"), this.width = new T(e.width, 0), this.opacity = new T(e.opacity);
429
+ }
430
+ draw(e, t, r, n) {
431
+ e.globalAlpha = this.opacity.get(r, n);
432
+ let i = this.radius.get(r, n), s = this.width.get(r, n);
433
+ s > 0 && (e.strokeStyle = this.stroke.get(r, n), e.lineWidth = s, e.beginPath(), e.arc(t[0][0].x, t[0][0].y, i + s / 2, 0, 2 * Math.PI), e.stroke()), e.fillStyle = this.fill.get(r, n), e.beginPath(), e.arc(t[0][0].x, t[0][0].y, i, 0, 2 * Math.PI), e.fill();
434
+ }
435
+ place(e, t, r) {
436
+ t[0];
437
+ let i = new index(t[0][0].x, t[0][0].y), s = this.radius.get(e.zoom, r), l = { minX: i.x - s, minY: i.y - s, maxX: i.x + s, maxY: i.y + s };
438
+ return [{ anchor: i, bboxes: [l], draw: c((f) => {
439
+ this.draw(f, [[new index(0, 0)]], e.zoom, r);
440
+ }, "draw") }];
441
+ }
442
+ };
443
+ c(Ae, "CircleSymbolizer");
444
+ var te = Ae, De = class De2 {
445
+ constructor(e) {
446
+ this.font = new N(e), this.text = new E(e), this.fill = new O(e.fill, "black"), this.background = new O(e.background, "white"), this.padding = new T(e.padding, 0);
447
+ }
448
+ place(e, t, r) {
449
+ let n = this.text.get(e.zoom, r);
450
+ if (!n) return;
451
+ let i = this.font.get(e.zoom, r);
452
+ e.scratch.font = i;
453
+ let s = e.scratch.measureText(n), l = s.width, o = s.actualBoundingBoxAscent, f = s.actualBoundingBoxDescent;
454
+ t[0];
455
+ let m = new index(t[0][0].x, t[0][0].y), d = this.padding.get(e.zoom, r), h = { minX: m.x - l / 2 - d, minY: m.y - o - d, maxX: m.x + l / 2 + d, maxY: m.y + f + d };
456
+ return [{ anchor: m, bboxes: [h], draw: c((y) => {
457
+ y.globalAlpha = 1, y.fillStyle = this.background.get(e.zoom, r), y.fillRect(-l / 2 - d, -o - d, l + 2 * d, o + f + 2 * d), y.fillStyle = this.fill.get(e.zoom, r), y.font = i, y.fillText(n, -l / 2, 0);
458
+ }, "draw") }];
459
+ }
460
+ };
461
+ c(De, "ShieldSymbolizer");
462
+ var at = De, Oe = class Oe2 {
463
+ constructor(e) {
464
+ this.list = e;
465
+ }
466
+ place(e, t, r) {
467
+ let n = this.list[0].place(e, t, r);
468
+ if (!n) return;
469
+ let i = n[0], s = i.anchor, l = i.bboxes[0], o = l.maxY - l.minY, f = [{ draw: i.draw, translate: { x: 0, y: 0 } }], u = [[new index(t[0][0].x, t[0][0].y + o)]];
470
+ for (let d = 1; d < this.list.length; d++) n = this.list[d].place(e, u, r), n && (i = n[0], l = lt(l, i.bboxes[0]), f.push({ draw: i.draw, translate: { x: 0, y: o } }));
471
+ return [{ anchor: s, bboxes: [l], draw: c((d) => {
472
+ for (let h of f) d.save(), d.translate(h.translate.x, h.translate.y), h.draw(d), d.restore();
473
+ }, "draw") }];
474
+ }
475
+ };
476
+ c(Oe, "FlexSymbolizer");
477
+ var st = Oe, lt = c((a, e) => ({ minX: Math.min(a.minX, e.minX), minY: Math.min(a.minY, e.minY), maxX: Math.max(a.maxX, e.maxX), maxY: Math.max(a.maxY, e.maxY) }), "mergeBbox"), Me = class Me2 {
478
+ constructor(e) {
479
+ this.list = e;
480
+ }
481
+ place(e, t, r) {
482
+ let n = this.list[0];
483
+ if (!n) return;
484
+ let i = n.place(e, t, r);
485
+ if (!i) return;
486
+ let s = i[0], l = s.anchor, o = s.bboxes[0], f = [s.draw];
487
+ for (let m = 1; m < this.list.length; m++) {
488
+ if (i = this.list[m].place(e, t, r), !i) return;
489
+ s = i[0], o = lt(o, s.bboxes[0]), f.push(s.draw);
490
+ }
491
+ return [{ anchor: l, bboxes: [o], draw: c((m) => {
492
+ for (let d of f) d(m);
493
+ }, "draw") }];
494
+ }
495
+ };
496
+ c(Me, "GroupSymbolizer");
497
+ var re = Me, Re = class Re2 {
498
+ constructor(e) {
499
+ this.symbolizer = e;
500
+ }
501
+ place(e, t, r) {
502
+ let n = t[0][0], i = this.symbolizer.place(e, [[new index(0, 0)]], r);
503
+ if (!i || i.length === 0) return;
504
+ let s = i[0], l = s.bboxes[0], o = l.maxX - l.minX, f = l.maxY - l.minY, u = { minX: n.x - o / 2, maxX: n.x + o / 2, minY: n.y - f / 2, maxY: n.y + f / 2 };
505
+ return [{ anchor: n, bboxes: [u], draw: c((d) => {
506
+ d.translate(-o / 2, f / 2 - l.maxY), s.draw(d, { justify: 2 });
507
+ }, "draw") }];
508
+ }
509
+ };
510
+ c(Re, "CenteredSymbolizer");
511
+ var Te = Re, Fe = class Fe2 {
512
+ constructor(e, t) {
513
+ this.padding = new T(e, 0), this.symbolizer = t;
514
+ }
515
+ place(e, t, r) {
516
+ let n = this.symbolizer.place(e, t, r);
517
+ if (!n || n.length === 0) return;
518
+ let i = this.padding.get(e.zoom, r);
519
+ for (let s of n) for (let l of s.bboxes) l.minX -= i, l.minY -= i, l.maxX += i, l.maxY += i;
520
+ return n;
521
+ }
522
+ };
523
+ c(Fe, "Padding");
524
+ var ot = Fe, je = class je2 {
525
+ constructor(e) {
526
+ this.font = new N(e), this.text = new E(e), this.fill = new O(e.fill, "black"), this.stroke = new O(e.stroke, "black"), this.width = new T(e.width, 0), this.lineHeight = new T(e.lineHeight, 1), this.letterSpacing = new T(e.letterSpacing, 0), this.maxLineCodeUnits = new T(e.maxLineChars, 15), this.justify = e.justify;
527
+ }
528
+ place(e, t, r) {
529
+ let n = this.text.get(e.zoom, r);
530
+ if (!n) return;
531
+ let i = this.font.get(e.zoom, r);
532
+ e.scratch.font = i;
533
+ let s = this.letterSpacing.get(e.zoom, r), l = xe(n, this.maxLineCodeUnits.get(e.zoom, r)), o = "", f = 0;
534
+ for (let p of l) p.length > f && (f = p.length, o = p);
535
+ let u = e.scratch.measureText(o), m = u.width + s * (f - 1), d = u.actualBoundingBoxAscent, h = u.actualBoundingBoxDescent, g = (d + h) * this.lineHeight.get(e.zoom, r), y = new index(t[0][0].x, t[0][0].y), _ = { minX: y.x, minY: y.y - d, maxX: y.x + m, maxY: y.y + h + (l.length - 1) * g };
536
+ return [{ anchor: y, bboxes: [_], draw: c((p, x) => {
537
+ p.globalAlpha = 1, p.font = i, p.fillStyle = this.fill.get(e.zoom, r);
538
+ let A = this.width.get(e.zoom, r), b = 0;
539
+ for (let v of l) {
540
+ let z = 0;
541
+ if (this.justify === 2 || x && x.justify === 2 ? z = (m - p.measureText(v).width) / 2 : (this.justify === 3 || x && x.justify === 3) && (z = m - p.measureText(v).width), A) if (p.lineWidth = A * 2, p.strokeStyle = this.stroke.get(e.zoom, r), s > 0) {
542
+ let w = z;
543
+ for (let S of v) p.strokeText(S, w, b), w += p.measureText(S).width + s;
544
+ } else p.strokeText(v, z, b);
545
+ if (s > 0) {
546
+ let w = z;
547
+ for (let S of v) p.fillText(S, w, b), w += p.measureText(S).width + s;
548
+ } else p.fillText(v, z, b);
549
+ b += g;
550
+ }
551
+ }, "draw") }];
552
+ }
553
+ };
554
+ c(je, "TextSymbolizer");
555
+ var ne = je, Xe = class Xe2 {
556
+ constructor(e) {
557
+ this.centered = new Te(new ne(e));
558
+ }
559
+ place(e, t, r) {
560
+ return this.centered.place(e, t, r);
561
+ }
562
+ };
563
+ c(Xe, "CenteredTextSymbolizer");
564
+ var I = Xe, Ye = class Ye2 {
565
+ constructor(e, t) {
566
+ var r, n, i;
567
+ this.symbolizer = e, this.offsetX = new T(t.offsetX, 0), this.offsetY = new T(t.offsetY, 0), this.justify = (r = t.justify) != null ? r : void 0, this.placements = (n = t.placements) != null ? n : [2, 6, 8, 4, 1, 3, 5, 7], this.ddValues = (i = t.ddValues) != null ? i : () => ({});
568
+ }
569
+ place(e, t, r) {
570
+ if (r.geomType !== 1) return;
571
+ let n = t[0][0], i = this.symbolizer.place(e, [[new index(0, 0)]], r);
572
+ if (!i || i.length === 0) return;
573
+ let s = i[0], l = s.bboxes[0], o = this.offsetX, f = this.offsetY, u = this.justify, m = this.placements, { offsetX: d, offsetY: h, justify: g, placements: y } = this.ddValues(e.zoom, r) || {};
574
+ d && (o = new T(d, 0)), h && (f = new T(h, 0)), g && (u = g), y && (m = y);
575
+ let _ = o.get(e.zoom, r), k = f.get(e.zoom, r), p = c((z, w) => ({ minX: z.x + w.x + l.minX, minY: z.y + w.y + l.minY, maxX: z.x + w.x + l.maxX, maxY: z.y + w.y + l.maxY }), "getBbox"), x = new index(_, k), A, b = c((z) => {
576
+ z.translate(x.x, x.y), s.draw(z, { justify: A });
577
+ }, "draw"), v = c((z, w) => {
578
+ let S = p(z, w);
579
+ if (!e.index.bboxCollides(S, e.order)) return [{ anchor: n, bboxes: [S], draw: b }];
580
+ }, "placeLabelInPoint");
581
+ for (let z of m) {
582
+ let w = this.computeXaxisOffset(_, l, z), S = this.computeYaxisOffset(k, l, z);
583
+ return A = this.computeJustify(u, z), x = new index(w, S), v(n, x);
584
+ }
585
+ }
586
+ computeXaxisOffset(e, t, r) {
587
+ let n = t.maxX, i = n / 2;
588
+ return [1, 5].includes(r) ? e - i : [8, 7, 6].includes(r) ? e - n : e;
589
+ }
590
+ computeYaxisOffset(e, t, r) {
591
+ let n = Math.abs(t.minY), i = t.maxY, s = (t.minY + t.maxY) / 2;
592
+ return [3, 7].includes(r) ? e - s : [8, 2, 1].includes(r) ? e - i : [6, 4, 5].includes(r) ? e + n : e;
593
+ }
594
+ computeJustify(e, t) {
595
+ return e || ([1, 5].includes(t) ? 2 : [2, 3, 4].includes(t) ? 1 : 3);
596
+ }
597
+ };
598
+ c(Ye, "OffsetSymbolizer");
599
+ var Pe = Ye, Ie = class Ie2 {
600
+ constructor(e) {
601
+ this.symbolizer = new Pe(new ne(e), e);
602
+ }
603
+ place(e, t, r) {
604
+ return this.symbolizer.place(e, t, r);
605
+ }
606
+ };
607
+ c(Ie, "OffsetTextSymbolizer");
608
+ var ie = Ie, Rt = ((r) => (r[r.Above = 1] = "Above", r[r.Center = 2] = "Center", r[r.Below = 3] = "Below", r))(Rt || {}), Be = class Be2 {
609
+ constructor(e) {
610
+ var t;
611
+ this.font = new N(e), this.text = new E(e), this.fill = new O(e.fill, "black"), this.stroke = new O(e.stroke, "black"), this.width = new T(e.width, 0), this.offset = new T(e.offset, 0), this.position = (t = e.position) != null ? t : 1, this.maxLabelCodeUnits = new T(e.maxLabelChars, 40), this.repeatDistance = new T(e.repeatDistance, 250);
612
+ }
613
+ place(e, t, r) {
614
+ let n = this.text.get(e.zoom, r);
615
+ if (!n || n.length > this.maxLabelCodeUnits.get(e.zoom, r)) return;
616
+ let i = 20, s = r.bbox;
617
+ if (s.maxY - s.minY < i && s.maxX - s.minX < i) return;
618
+ let l = this.font.get(e.zoom, r);
619
+ e.scratch.font = l;
620
+ let o = e.scratch.measureText(n), f = o.width, u = o.actualBoundingBoxAscent + o.actualBoundingBoxDescent, m = this.repeatDistance.get(e.zoom, r);
621
+ e.overzoom > 4 && (m *= 1 << e.overzoom - 4);
622
+ let d = u * 2, h = Ue(t, f, m, d);
623
+ if (h.length === 0) return;
624
+ let g = [];
625
+ for (let y of h) {
626
+ let _ = y.end.x - y.start.x, k = y.end.y - y.start.y, x = Ge(y.start, y.end, f, d / 2).map((b) => ({ minX: b.x - d / 2, minY: b.y - d / 2, maxX: b.x + d / 2, maxY: b.y + d / 2 })), A = c((b) => {
627
+ b.globalAlpha = 1, b.rotate(Math.atan2(k, _)), _ < 0 && (b.scale(-1, -1), b.translate(-f, 0));
628
+ let v = 0;
629
+ this.position === 3 ? v += u : this.position === 2 && (v += u / 2), b.translate(0, v - this.offset.get(e.zoom, r)), b.font = l;
630
+ let z = this.width.get(e.zoom, r);
631
+ z && (b.lineWidth = z, b.strokeStyle = this.stroke.get(e.zoom, r), b.strokeText(n, 0, 0)), b.fillStyle = this.fill.get(e.zoom, r), b.fillText(n, 0, 0);
632
+ }, "draw");
633
+ g.push({ anchor: y.start, bboxes: x, draw: A, deduplicationKey: n, deduplicationDistance: m });
634
+ }
635
+ return g;
636
+ }
637
+ };
638
+ c(Be, "LineLabelSymbolizer");
639
+ var $ = Be;
640
+ var R = c((a, e) => {
641
+ let t = a[e];
642
+ return typeof t == "string" ? t : "";
643
+ }, "getString"), ct = c((a, e) => {
644
+ let t = a[e];
645
+ return typeof t == "number" ? t : 0;
646
+ }, "getNumber"), ae = c((a) => [{ dataLayer: "earth", symbolizer: new P({ fill: a.earth }) }, { dataLayer: "landuse", symbolizer: new P({ fill: c((e, t) => index_exports_import_es.mix(a.park_a, a.park_b, Math.min(Math.max(e / 12, 12), 0)), "fill") }), filter: c((e, t) => {
647
+ let r = R(t.props, "pmap:kind");
648
+ return ["allotments", "village_green", "playground"].includes(r);
649
+ }, "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.park_b, opacity: 0.7 }), filter: c((e, t) => {
650
+ let r = R(t.props, "pmap:kind");
651
+ return ["national_park", "park", "cemetery", "protected_area", "nature_reserve", "forest", "golf_course"].includes(r);
652
+ }, "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.hospital }), filter: c((e, t) => t.props["pmap:kind"] === "hospital", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.industrial }), filter: c((e, t) => t.props["pmap:kind"] === "industrial", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.school }), filter: c((e, t) => {
653
+ let r = R(t.props, "pmap:kind");
654
+ return ["school", "university", "college"].includes(r);
655
+ }, "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.beach }), filter: c((e, t) => t.props["pmap:kind"] === "beach", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.zoo }), filter: c((e, t) => t.props["pmap:kind"] === "zoo", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.zoo }), filter: c((e, t) => {
656
+ let r = R(t.props, "pmap:kind");
657
+ return ["military", "naval_base", "airfield"].includes(r);
658
+ }, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: c((e, t) => index_exports_import_es.mix(a.wood_a, a.wood_b, Math.min(Math.max(e / 12, 12), 0)), "fill") }), filter: c((e, t) => {
659
+ let r = R(t.props, "pmap:kind");
660
+ return ["wood", "nature_reserve", "forest"].includes(r);
661
+ }, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: c((e, t) => index_exports_import_es.mix(a.scrub_a, a.scrub_b, Math.min(Math.max(e / 12, 12), 0)), "fill") }), filter: c((e, t) => {
662
+ let r = R(t.props, "pmap:kind");
663
+ return ["scrub", "grassland", "grass"].includes(r);
664
+ }, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: a.scrub_b }), filter: c((e, t) => {
665
+ let r = R(t.props, "pmap:kind");
666
+ return ["scrub", "grassland", "grass"].includes(r);
667
+ }, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: a.glacier }), filter: c((e, t) => t.props["pmap:kind"] === "glacier", "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: a.sand }), filter: c((e, t) => t.props["pmap:kind"] === "sand", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.aerodrome }), filter: c((e, t) => t.props["pmap:kind"] === "aerodrome", "filter") }, { dataLayer: "water", symbolizer: new P({ fill: a.water }) }, { dataLayer: "transit", symbolizer: new M({ color: a.runway, width: c((e, t) => F(1.6, [[11, 0], [13, 4], [19, 30]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind_detail"] === "runway", "filter") }, { dataLayer: "transit", symbolizer: new M({ color: a.runway, width: c((e, t) => F(1.6, [[14, 0], [14.5, 1], [16, 6]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind_detail"] === "taxiway", "filter") }, { dataLayer: "transit", symbolizer: new M({ color: a.pier, width: c((e, t) => F(1.6, [[13, 0], [13.5, 0, 5], [21, 16]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "pier", "filter") }, { dataLayer: "physical_line", minzoom: 14, symbolizer: new M({ color: a.water, width: c((e, t) => F(1.6, [[9, 0], [9.5, 1], [18, 12]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "river", "filter") }, { dataLayer: "physical_line", minzoom: 14, symbolizer: new M({ color: a.water, width: 0.5 }), filter: c((e, t) => t.props["pmap:kind"] === "stream", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.pedestrian }), filter: c((e, t) => t.props["pmap:kind"] === "pedestrian", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.pier }), filter: c((e, t) => t.props["pmap:kind"] === "pier", "filter") }, { dataLayer: "buildings", symbolizer: new P({ fill: a.buildings, opacity: 0.5 }) }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[14, 0], [20, 7]])(e), "width") }), filter: c((e, t) => {
668
+ let r = R(t.props, "pmap:kind");
669
+ return ["other", "path"].includes(r);
670
+ }, "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[13, 0], [18, 8]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "minor_road", "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[7, 0], [12, 1.2], [15, 3], [18, 13]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "medium_road", "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[6, 0], [12, 1.6], [15, 3], [18, 13]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "major_road", "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[3, 0], [6, 1.1], [12, 1.6], [15, 5], [18, 15]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "highway", "filter") }, { dataLayer: "boundaries", symbolizer: new M({ dash: [3, 2], color: a.boundaries, width: 1 }), filter: c((e, t) => {
671
+ let r = t.props["pmap:min_admin_level"];
672
+ return typeof r == "number" && r <= 2;
673
+ }, "filter") }, { dataLayer: "transit", symbolizer: new M({ dash: [0.3, 0.75], color: a.railway, dashWidth: c((e, t) => F(1.6, [[4, 0], [7, 0.15], [19, 9]])(e), "dashWidth"), opacity: 0.5 }), filter: c((e, t) => t.props["pmap:kind"] === "rail", "filter") }, { dataLayer: "boundaries", symbolizer: new M({ dash: [3, 2], color: a.boundaries, width: 0.5 }), filter: c((e, t) => {
674
+ let r = t.props["pmap:min_admin_level"];
675
+ return typeof r == "number" && r > 2;
676
+ }, "filter") }], "paintRules"), se = c((a) => {
677
+ let e = ["name"];
678
+ return [{ dataLayer: "roads", symbolizer: new $({ labelProps: e, fill: a.roads_label_minor, font: "400 12px sans-serif", width: 2, stroke: a.roads_label_minor_halo }), minzoom: 16, filter: c((t, r) => {
679
+ let n = R(r.props, "pmap:kind");
680
+ return ["minor_road", "other", "path"].includes(n);
681
+ }, "filter") }, { dataLayer: "roads", symbolizer: new $({ labelProps: e, fill: a.roads_label_major, font: "400 12px sans-serif", width: 2, stroke: a.roads_label_major_halo }), minzoom: 12, filter: c((t, r) => {
682
+ let n = R(r.props, "pmap:kind");
683
+ return ["highway", "major_road", "medium_road"].includes(n);
684
+ }, "filter") }, { dataLayer: "roads", symbolizer: new $({ labelProps: e, fill: a.roads_label_major, font: "400 12px sans-serif", width: 2, stroke: a.roads_label_major_halo }), minzoom: 12, filter: c((t, r) => {
685
+ let n = R(r.props, "pmap:kind");
686
+ return ["highway", "major_road", "medium_road"].includes(n);
687
+ }, "filter") }, { dataLayer: "physical_point", symbolizer: new I({ labelProps: e, fill: a.ocean_label, lineHeight: 1.5, letterSpacing: 1, font: c((t, r) => `400 ${Le([[3, 10], [10, 12]])(t)}px sans-serif`, "font"), textTransform: "uppercase" }), filter: c((t, r) => {
688
+ let n = R(r.props, "pmap:kind");
689
+ return ["ocean", "bay", "strait", "fjord"].includes(n);
690
+ }, "filter") }, { dataLayer: "physical_point", symbolizer: new I({ labelProps: e, fill: a.ocean_label, lineHeight: 1.5, letterSpacing: 1, font: c((t, r) => `400 ${Le([[3, 0], [6, 12], [10, 12]])(t)}px sans-serif`, "font") }), filter: c((t, r) => {
691
+ let n = R(r.props, "pmap:kind");
692
+ return ["sea", "lake", "water"].includes(n);
693
+ }, "filter") }, { dataLayer: "places", symbolizer: new I({ labelProps: c((t, r) => t < 6 ? ["name:short"] : e, "labelProps"), fill: a.state_label, stroke: a.state_label_halo, width: 1, lineHeight: 1.5, font: c((t, r) => t < 6 ? "400 16px sans-serif" : "400 12px sans-serif", "font"), textTransform: "uppercase" }), filter: c((t, r) => r.props["pmap:kind"] === "region", "filter") }, { dataLayer: "places", symbolizer: new I({ labelProps: e, fill: a.country_label, lineHeight: 1.5, font: c((t, r) => "600 12px sans-serif", "font"), textTransform: "uppercase" }), filter: c((t, r) => r.props["pmap:kind"] === "country", "filter") }, { dataLayer: "places", minzoom: 9, symbolizer: new I({ labelProps: e, fill: a.city_label, lineHeight: 1.5, font: c((t, r) => {
694
+ if (!r) return "400 12px sans-serif";
695
+ let n = r.props["pmap:min_zoom"], i = 400;
696
+ n && n <= 5 && (i = 600);
697
+ let s = 12, l = r.props["pmap:population_rank"];
698
+ return l && l > 9 && (s = 16), `${i} ${s}px sans-serif`;
699
+ }, "font") }), sort: c((t, r) => {
700
+ let n = ct(t, "pmap:population_rank"), i = ct(r, "pmap:population_rank");
701
+ return n - i;
702
+ }, "sort"), filter: c((t, r) => r.props["pmap:kind"] === "locality", "filter") }, { dataLayer: "places", maxzoom: 8, symbolizer: new re([new te({ radius: 2, fill: a.city_circle, stroke: a.city_circle_stroke, width: 1.5 }), new ie({ labelProps: e, fill: a.city_label, stroke: a.city_label_halo, width: 1, offsetX: 6, offsetY: 4.5, font: c((t, r) => "400 12px sans-serif", "font") })]), filter: c((t, r) => r.props["pmap:kind"] === "locality", "filter") }];
703
+ }, "labelRules");
704
+ var Ft = { background: "#cccccc", earth: "#e0e0e0", park_a: "#cfddd5", park_b: "#9cd3b4", hospital: "#e4dad9", industrial: "#d1dde1", school: "#e4ded7", wood_a: "#d0ded0", wood_b: "#a0d9a0", pedestrian: "#e3e0d4", scrub_a: "#cedcd7", scrub_b: "#99d2bb", glacier: "#e7e7e7", sand: "#e2e0d7", beach: "#e8e4d0", aerodrome: "#dadbdf", runway: "#e9e9ed", water: "#80deea", pier: "#e0e0e0", zoo: "#c6dcdc", military: "#dcdcdc", tunnel_other_casing: "#e0e0e0", tunnel_minor_casing: "#e0e0e0", tunnel_link_casing: "#e0e0e0", tunnel_medium_casing: "#e0e0e0", tunnel_major_casing: "#e0e0e0", tunnel_highway_casing: "#e0e0e0", tunnel_other: "#d5d5d5", tunnel_minor: "#d5d5d5", tunnel_link: "#d5d5d5", tunnel_medium: "#d5d5d5", tunnel_major: "#d5d5d5", tunnel_highway: "#d5d5d5", transit_pier: "#e0e0e0", buildings: "#cccccc", minor_service_casing: "#e0e0e0", minor_casing: "#e0e0e0", link_casing: "#e0e0e0", medium_casing: "#e0e0e0", major_casing_late: "#e0e0e0", highway_casing_late: "#e0e0e0", other: "#ebebeb", minor_service: "#ebebeb", minor_a: "#ebebeb", minor_b: "#ffffff", link: "#ffffff", medium: "#f5f5f5", major_casing_early: "#e0e0e0", major: "#ffffff", highway_casing_early: "#e0e0e0", highway: "#ffffff", railway: "#a7b1b3", boundaries: "#adadad", waterway_label: "#ffffff", bridges_other_casing: "#e0e0e0", bridges_minor_casing: "#e0e0e0", bridges_link_casing: "#e0e0e0", bridges_medium_casing: "#e0e0e0", bridges_major_casing: "#e0e0e0", bridges_highway_casing: "#e0e0e0", bridges_other: "#ebebeb", bridges_minor: "#ffffff", bridges_link: "#ffffff", bridges_medium: "#f0eded", bridges_major: "#f5f5f5", bridges_highway: "#ffffff", roads_label_minor: "#91888b", roads_label_minor_halo: "#ffffff", roads_label_major: "#938a8d", roads_label_major_halo: "#ffffff", ocean_label: "#ffffff", peak_label: "#7e9aa0", subplace_label: "#8f8f8f", subplace_label_halo: "#e0e0e0", city_circle: "#ffffff", city_circle_stroke: "#a3a3a3", city_label: "#5c5c5c", city_label_halo: "#e0e0e0", state_label: "#b3b3b3", state_label_halo: "#e0e0e0", country_label: "#a3a3a3" }, jt = { background: "#34373d", earth: "#1f1f1f", park_a: "#232325", park_b: "#232325", hospital: "#252424", industrial: "#222222", school: "#262323", wood_a: "#202121", wood_b: "#202121", pedestrian: "#1e1e1e", scrub_a: "#222323", scrub_b: "#222323", glacier: "#1c1c1c", sand: "#212123", beach: "#28282a", aerodrome: "#1e1e1e", runway: "#333333", water: "#34373d", pier: "#222222", zoo: "#222323", military: "#242323", tunnel_other_casing: "#141414", tunnel_minor_casing: "#141414", tunnel_link_casing: "#141414", tunnel_medium_casing: "#141414", tunnel_major_casing: "#141414", tunnel_highway_casing: "#141414", tunnel_other: "#292929", tunnel_minor: "#292929", tunnel_link: "#292929", tunnel_medium: "#292929", tunnel_major: "#292929", tunnel_highway: "#292929", transit_pier: "#333333", buildings: "#111111", minor_service_casing: "#1f1f1f", minor_casing: "#1f1f1f", link_casing: "#1f1f1f", medium_casing: "#1f1f1f", major_casing_late: "#1f1f1f", highway_casing_late: "#1f1f1f", other: "#333333", minor_service: "#333333", minor_a: "#3d3d3d", minor_b: "#333333", link: "#3d3d3d", medium: "#3d3d3d", major_casing_early: "#1f1f1f", major: "#3d3d3d", highway_casing_early: "#1f1f1f", highway: "#474747", railway: "#000000", boundaries: "#5b6374", waterway_label: "#717784", bridges_other_casing: "#2b2b2b", bridges_minor_casing: "#1f1f1f", bridges_link_casing: "#1f1f1f", bridges_medium_casing: "#1f1f1f", bridges_major_casing: "#1f1f1f", bridges_highway_casing: "#1f1f1f", bridges_other: "#333333", bridges_minor: "#333333", bridges_link: "#3d3d3d", bridges_medium: "#3d3d3d", bridges_major: "#3d3d3d", bridges_highway: "#474747", roads_label_minor: "#525252", roads_label_minor_halo: "#1f1f1f", roads_label_major: "#666666", roads_label_major_halo: "#1f1f1f", ocean_label: "#717784", peak_label: "#898080", subplace_label: "#525252", subplace_label_halo: "#1f1f1f", city_circle: "#000000", city_circle_stroke: "#7a7a7a", city_label: "#7a7a7a", city_label_halo: "#212121", state_label: "#3d3d3d", state_label_halo: "#1f1f1f", country_label: "#5c5c5c" }, Xt = { background: "#ffffff", earth: "#ffffff", park_a: "#fcfcfc", park_b: "#fcfcfc", hospital: "#f8f8f8", industrial: "#fcfcfc", school: "#f8f8f8", wood_a: "#fafafa", wood_b: "#fafafa", pedestrian: "#fdfdfd", scrub_a: "#fafafa", scrub_b: "#fafafa", glacier: "#fcfcfc", sand: "#fafafa", beach: "#f6f6f6", aerodrome: "#fdfdfd", runway: "#efefef", water: "#dcdcdc", pier: "#f5f5f5", zoo: "#f7f7f7", military: "#fcfcfc", tunnel_other_casing: "#d6d6d6", tunnel_minor_casing: "#fcfcfc", tunnel_link_casing: "#fcfcfc", tunnel_medium_casing: "#fcfcfc", tunnel_major_casing: "#fcfcfc", tunnel_highway_casing: "#fcfcfc", tunnel_other: "#d6d6d6", tunnel_minor: "#d6d6d6", tunnel_link: "#d6d6d6", tunnel_medium: "#d6d6d6", tunnel_major: "#d6d6d6", tunnel_highway: "#d6d6d6", transit_pier: "#efefef", buildings: "#efefef", minor_service_casing: "#ffffff", minor_casing: "#ffffff", link_casing: "#ffffff", medium_casing: "#ffffff", major_casing_late: "#ffffff", highway_casing_late: "#ffffff", other: "#f5f5f5", minor_service: "#f5f5f5", minor_a: "#ebebeb", minor_b: "#f5f5f5", link: "#ebebeb", medium: "#ebebeb", major_casing_early: "#ffffff", major: "#ebebeb", highway_casing_early: "#ffffff", highway: "#ebebeb", railway: "#d6d6d6", boundaries: "#adadad", waterway_label: "#adadad", bridges_other_casing: "#ffffff", bridges_minor_casing: "#ffffff", bridges_link_casing: "#ffffff", bridges_medium_casing: "#ffffff", bridges_major_casing: "#ffffff", bridges_highway_casing: "#ffffff", bridges_other: "#f5f5f5", bridges_minor: "#f5f5f5", bridges_link: "#ebebeb", bridges_medium: "#ebebeb", bridges_major: "#ebebeb", bridges_highway: "#ebebeb", roads_label_minor: "#adadad", roads_label_minor_halo: "#ffffff", roads_label_major: "#999999", roads_label_major_halo: "#ffffff", ocean_label: "#adadad", peak_label: "#adadad", subplace_label: "#8f8f8f", subplace_label_halo: "#ffffff", city_circle: "#ffffff", city_circle_stroke: "#adadad", city_label: "#5c5c5c", city_label_halo: "#ffffff", state_label: "#b3b3b3", state_label_halo: "#ffffff", country_label: "#b8b8b8" }, Yt = { background: "#a3a3a3", earth: "#cccccc", park_a: "#c2c2c2", park_b: "#c2c2c2", hospital: "#d0d0d0", industrial: "#c6c6c6", school: "#d0d0d0", wood_a: "#c2c2c2", wood_b: "#c2c2c2", pedestrian: "#c4c4c4", scrub_a: "#c2c2c2", scrub_b: "#c2c2c2", glacier: "#d2d2d2", sand: "#d2d2d2", beach: "#d2d2d2", aerodrome: "#c9c9c9", runway: "#f5f5f5", water: "#a3a3a3", pier: "#b8b8b8", zoo: "#c7c7c7", military: "#bfbfbf", tunnel_other_casing: "#b8b8b8", tunnel_minor_casing: "#b8b8b8", tunnel_link_casing: "#b8b8b8", tunnel_medium_casing: "#b8b8b8", tunnel_major_casing: "#b8b8b8", tunnel_highway_casing: "#b8b8b8", tunnel_other: "#d6d6d6", tunnel_minor: "#d6d6d6", tunnel_link: "#d6d6d6", tunnel_medium: "#d6d6d6", tunnel_major: "#d6d6d6", tunnel_highway: "#d6d6d6", transit_pier: "#b8b8b8", buildings: "#e0e0e0", minor_service_casing: "#cccccc", minor_casing: "#cccccc", link_casing: "#cccccc", medium_casing: "#cccccc", major_casing_late: "#cccccc", highway_casing_late: "#cccccc", other: "#e0e0e0", minor_service: "#e0e0e0", minor_a: "#ebebeb", minor_b: "#e0e0e0", link: "#ebebeb", medium: "#ebebeb", major_casing_early: "#cccccc", major: "#ebebeb", highway_casing_early: "#cccccc", highway: "#ebebeb", railway: "#f5f5f5", boundaries: "#5c5c5c", waterway_label: "#7a7a7a", bridges_other_casing: "#cccccc", bridges_minor_casing: "#cccccc", bridges_link_casing: "#cccccc", bridges_medium_casing: "#cccccc", bridges_major_casing: "#cccccc", bridges_highway_casing: "#cccccc", bridges_other: "#e0e0e0", bridges_minor: "#e0e0e0", bridges_link: "#ebebeb", bridges_medium: "#ebebeb", bridges_major: "#ebebeb", bridges_highway: "#ebebeb", roads_label_minor: "#999999", roads_label_minor_halo: "#e0e0e0", roads_label_major: "#8f8f8f", roads_label_major_halo: "#ebebeb", ocean_label: "#7a7a7a", peak_label: "#5c5c5c", subplace_label: "#7a7a7a", subplace_label_halo: "#cccccc", city_circle: "#c2c2c2", city_circle_stroke: "#7a7a7a", city_label: "#474747", city_label_halo: "#cccccc", state_label: "#999999", state_label_halo: "#cccccc", country_label: "#858585" }, It = { background: "#2b2b2b", earth: "#141414", park_a: "#181818", park_b: "#181818", hospital: "#1d1d1d", industrial: "#101010", school: "#111111", wood_a: "#1a1a1a", wood_b: "#1a1a1a", pedestrian: "#191919", scrub_a: "#1c1c1c", scrub_b: "#1c1c1c", glacier: "#191919", sand: "#161616", beach: "#1f1f1f", aerodrome: "#191919", runway: "#323232", water: "#333333", pier: "#0a0a0a", zoo: "#191919", military: "#121212", tunnel_other_casing: "#101010", tunnel_minor_casing: "#101010", tunnel_link_casing: "#101010", tunnel_medium_casing: "#101010", tunnel_major_casing: "#101010", tunnel_highway_casing: "#101010", tunnel_other: "#292929", tunnel_minor: "#292929", tunnel_link: "#292929", tunnel_medium: "#292929", tunnel_major: "#292929", tunnel_highway: "#292929", transit_pier: "#0a0a0a", buildings: "#0a0a0a", minor_service_casing: "#141414", minor_casing: "#141414", link_casing: "#141414", medium_casing: "#141414", major_casing_late: "#141414", highway_casing_late: "#141414", other: "#1f1f1f", minor_service: "#1f1f1f", minor_a: "#292929", minor_b: "#1f1f1f", link: "#1f1f1f", medium: "#292929", major_casing_early: "#141414", major: "#292929", highway_casing_early: "#141414", highway: "#292929", railway: "#292929", boundaries: "#707070", waterway_label: "#707070", bridges_other_casing: "#141414", bridges_minor_casing: "#141414", bridges_link_casing: "#141414", bridges_medium_casing: "#141414", bridges_major_casing: "#141414", bridges_highway_casing: "#141414", bridges_other: "#1f1f1f", bridges_minor: "#1f1f1f", bridges_link: "#292929", bridges_medium: "#292929", bridges_major: "#292929", bridges_highway: "#292929", roads_label_minor: "#525252", roads_label_minor_halo: "#141414", roads_label_major: "#5c5c5c", roads_label_major_halo: "#141414", ocean_label: "#707070", peak_label: "#707070", subplace_label: "#5c5c5c", subplace_label_halo: "#141414", city_circle: "#000000", city_circle_stroke: "#666666", city_label: "#999999", city_label_halo: "#141414", state_label: "#3d3d3d", state_label_halo: "#141414", country_label: "#707070" }, oe = { light: Ft, dark: jt, white: Xt, grayscale: Yt, black: It };
705
+ var ce = c((a, e, t) => {
706
+ let r = [];
707
+ for (let n of a) {
708
+ let i = [];
709
+ for (let s of n) i.push(s.clone().mult(e).add(t));
710
+ r.push(i);
711
+ }
712
+ return r;
713
+ }, "transformGeom"), le = c((a, e) => {
714
+ let t = 1 << e;
715
+ return a < 0 ? t + a : a >= t ? a % t : a;
716
+ }, "wrap"), $e = class $e2 {
717
+ constructor(e, t, r) {
718
+ this.tileCache = e, this.maxDataLevel = t, this.levelDiff = r;
719
+ }
720
+ dataTilesForBounds(e, t) {
721
+ let r = C(2, e) / C(2, Math.ceil(e)), n = [], i = 1, s = this.tileCache.tileSize;
722
+ if (e < this.levelDiff) i = 1 / (1 << this.levelDiff - e) * r, n.push({ dataTile: { z: 0, x: 0, y: 0 }, origin: new index(0, 0), scale: i, dim: s * i });
723
+ else if (e <= this.levelDiff + this.maxDataLevel) {
724
+ let l = 1 << this.levelDiff, o = 256 * r, f = Math.ceil(e) - this.levelDiff, u = Math.floor(t.minX / l / o), m = Math.floor(t.minY / l / o), d = Math.floor(t.maxX / l / o), h = Math.floor(t.maxY / l / o);
725
+ for (let g = u; g <= d; g++) for (let y = m; y <= h; y++) {
726
+ let _ = new index(g * l * o, y * l * o);
727
+ n.push({ dataTile: { z: f, x: le(g, f), y: le(y, f) }, origin: _, scale: r, dim: s * r });
728
+ }
729
+ } else {
730
+ let l = 1 << this.levelDiff;
731
+ i = (1 << Math.ceil(e) - this.maxDataLevel - this.levelDiff) * r;
732
+ let o = Math.floor(t.minX / l / 256 / i), f = Math.floor(t.minY / l / 256 / i), u = Math.floor(t.maxX / l / 256 / i), m = Math.floor(t.maxY / l / 256 / i);
733
+ for (let d = o; d <= u; d++) for (let h = f; h <= m; h++) {
734
+ let g = new index(d * l * 256 * i, h * l * 256 * i);
735
+ n.push({ dataTile: { z: this.maxDataLevel, x: le(d, this.maxDataLevel), y: le(h, this.maxDataLevel) }, origin: g, scale: i, dim: s * i });
736
+ }
737
+ }
738
+ return n;
739
+ }
740
+ dataTileForDisplayTile(e) {
741
+ let t, r = 1, n = this.tileCache.tileSize, i;
742
+ if (e.z < this.levelDiff) t = { z: 0, x: 0, y: 0 }, r = 1 / (1 << this.levelDiff - e.z), i = new index(0, 0), n = n * r;
743
+ else if (e.z <= this.levelDiff + this.maxDataLevel) {
744
+ let s = 1 << this.levelDiff;
745
+ t = { z: e.z - this.levelDiff, x: Math.floor(e.x / s), y: Math.floor(e.y / s) }, i = new index(t.x * s * 256, t.y * s * 256);
746
+ } else {
747
+ r = 1 << e.z - this.maxDataLevel - this.levelDiff;
748
+ let s = 1 << this.levelDiff;
749
+ t = { z: this.maxDataLevel, x: Math.floor(e.x / s / r), y: Math.floor(e.y / s / r) }, i = new index(t.x * s * r * 256, t.y * s * r * 256), n = n * r;
750
+ }
751
+ return { dataTile: t, scale: r, origin: i, dim: n };
752
+ }
753
+ getBbox(e, t) {
754
+ return D(this, null, function* () {
755
+ let r = this.dataTilesForBounds(e, t);
756
+ return (yield Promise.all(r.map((i) => this.tileCache.get(i.dataTile)))).map((i, s) => {
757
+ let l = r[s];
758
+ return { data: i, z: e, dataTile: l.dataTile, scale: l.scale, dim: l.dim, origin: l.origin };
759
+ });
760
+ });
761
+ }
762
+ getDisplayTile(e) {
763
+ return D(this, null, function* () {
764
+ let t = this.dataTileForDisplayTile(e);
765
+ return { data: yield this.tileCache.get(t.dataTile), z: e.z, dataTile: t.dataTile, scale: t.scale, origin: t.origin, dim: t.dim };
766
+ });
767
+ }
768
+ queryFeatures(e, t, r, n) {
769
+ let i = Math.round(r), s = Math.min(i - this.levelDiff, this.maxDataLevel), l = n / (1 << i - s);
770
+ return this.tileCache.queryFeatures(e, t, s, l);
771
+ }
772
+ };
773
+ c($e, "View");
774
+ var Ne = $e, fe = c((a) => {
775
+ let e = c((r) => {
776
+ let n = r.levelDiff === void 0 ? 1 : r.levelDiff, i = r.maxDataZoom || 15, s;
777
+ if (typeof r.url == "string") new URL(r.url, "http://example.com").pathname.endsWith(".pmtiles") ? s = new H(r.url, true) : s = new Q(r.url, true);
778
+ else if (r.url) s = new H(r.url, true);
779
+ else throw new Error(`Invalid source ${r.url}`);
780
+ let l = new ee(s, 256 * 1 << n);
781
+ return new Ne(l, i, n);
782
+ }, "sourceToViews"), t = /* @__PURE__ */ new Map();
783
+ if (a.sources) for (let r in a.sources) t.set(r, e(a.sources[r]));
784
+ else t.set("", e(a));
785
+ return t;
786
+ }, "sourcesToViews");
787
+ var Nt = c((a, e, t) => {
788
+ let n = e / 256, i = Math.floor(t.minX / 256), s = Math.floor(t.minY / 256), l = Math.floor(t.maxX / 256), o = Math.floor(t.maxY / 256), f = Math.log2(n), u = [];
789
+ for (let m = i; m <= l; m++) {
790
+ let d = m % (1 << a);
791
+ for (let h = s; h <= o; h++) u.push({ display: Y({ z: a, x: d, y: h }), key: Y({ z: a - f, x: Math.floor(d / n), y: Math.floor(h / n) }) });
792
+ }
793
+ return u;
794
+ }, "covering"), We = class We2 {
795
+ constructor(e, t) {
796
+ this.tree = new index$1(), this.current = /* @__PURE__ */ new Map(), this.dim = e, this.maxLabeledTiles = t;
797
+ }
798
+ hasPrefix(e) {
799
+ for (let t of this.current.keys()) if (t.startsWith(e)) return true;
800
+ return false;
801
+ }
802
+ has(e) {
803
+ return this.current.has(e);
804
+ }
805
+ size() {
806
+ return this.current.size;
807
+ }
808
+ keys() {
809
+ return this.current.keys();
810
+ }
811
+ searchBbox(e, t) {
812
+ let r = /* @__PURE__ */ new Set();
813
+ for (let n of this.tree.search(e)) n.indexedLabel.order <= t && r.add(n.indexedLabel);
814
+ return r;
815
+ }
816
+ searchLabel(e, t) {
817
+ let r = /* @__PURE__ */ new Set();
818
+ for (let n of e.bboxes) for (let i of this.tree.search(n)) i.indexedLabel.order <= t && r.add(i.indexedLabel);
819
+ return r;
820
+ }
821
+ bboxCollides(e, t) {
822
+ for (let r of this.tree.search(e)) if (r.indexedLabel.order <= t) return true;
823
+ return false;
824
+ }
825
+ labelCollides(e, t) {
826
+ for (let r of e.bboxes) for (let n of this.tree.search(r)) if (n.indexedLabel.order <= t) return true;
827
+ return false;
828
+ }
829
+ deduplicationCollides(e) {
830
+ if (!e.deduplicationKey || !e.deduplicationDistance) return false;
831
+ let t = e.deduplicationDistance, r = { minX: e.anchor.x - t, minY: e.anchor.y - t, maxX: e.anchor.x + t, maxY: e.anchor.y + t };
832
+ for (let n of this.tree.search(r)) if (n.indexedLabel.deduplicationKey === e.deduplicationKey && n.indexedLabel.anchor.dist(e.anchor) < t) return true;
833
+ return false;
834
+ }
835
+ makeEntry(e) {
836
+ this.current.get(e) && console.log("consistency error 1");
837
+ let t = /* @__PURE__ */ new Set();
838
+ this.current.set(e, t);
839
+ }
840
+ insert(e, t, r) {
841
+ let n = { anchor: e.anchor, bboxes: e.bboxes, draw: e.draw, order: t, tileKey: r, deduplicationKey: e.deduplicationKey, deduplicationDistance: e.deduplicationDistance }, i = this.current.get(r);
842
+ if (!i) {
843
+ let o = /* @__PURE__ */ new Set();
844
+ this.current.set(r, o), i = o;
845
+ }
846
+ i.add(n);
847
+ let s = false, l = false;
848
+ for (let o of e.bboxes) this.tree.insert({ minX: o.minX, minY: o.minY, maxX: o.maxX, maxY: o.maxY, indexedLabel: n }), o.minX < 0 && (s = true), o.maxX > this.dim && (l = true);
849
+ if (s || l) {
850
+ let o = s ? this.dim : -this.dim, f = [];
851
+ for (let d of e.bboxes) f.push({ minX: d.minX + o, minY: d.minY, maxX: d.maxX + o, maxY: d.maxY });
852
+ let u = { anchor: new index(e.anchor.x + o, e.anchor.y), bboxes: f, draw: e.draw, order: t, tileKey: r }, m = this.current.get(r);
853
+ m && m.add(u);
854
+ for (let d of f) this.tree.insert({ minX: d.minX, minY: d.minY, maxX: d.maxX, maxY: d.maxY, indexedLabel: u });
855
+ }
856
+ }
857
+ pruneOrNoop(e) {
858
+ let t = e.split(":"), r, n = 0, i = 0;
859
+ for (let s of this.current.keys()) {
860
+ let l = s.split(":");
861
+ if (l[3] === t[3]) {
862
+ i++;
863
+ let o = Math.sqrt(C(+l[0] - +t[0], 2) + C(+l[1] - +t[1], 2));
864
+ o > n && (n = o, r = s);
865
+ }
866
+ r && i > this.maxLabeledTiles && this.pruneKey(r);
867
+ }
868
+ }
869
+ pruneKey(e) {
870
+ let t = this.current.get(e);
871
+ if (!t) return;
872
+ let r = [];
873
+ for (let n of this.tree.all()) t.has(n.indexedLabel) && r.push(n);
874
+ for (let n of r) this.tree.remove(n);
875
+ this.current.delete(e);
876
+ }
877
+ removeLabel(e) {
878
+ let t = [];
879
+ for (let n of this.tree.all()) e === n.indexedLabel && t.push(n);
880
+ for (let n of t) this.tree.remove(n);
881
+ let r = this.current.get(e.tileKey);
882
+ r && r.delete(e);
883
+ }
884
+ };
885
+ c(We, "Index");
886
+ var Je = We, He = class He2 {
887
+ constructor(e, t, r, n, i) {
888
+ this.index = new Je(256 * 1 << e, n), this.z = e, this.scratch = t, this.labelRules = r, this.callback = i;
889
+ }
890
+ layout(e) {
891
+ let t = performance.now(), r = /* @__PURE__ */ new Set();
892
+ for (let [i, s] of e) for (let l of s) {
893
+ let o = `${Y(l.dataTile)}:${i}`;
894
+ this.index.has(o) || (this.index.makeEntry(o), r.add(o));
895
+ }
896
+ let n = /* @__PURE__ */ new Set();
897
+ for (let [i, s] of this.labelRules.entries()) {
898
+ if (s.visible === false || s.minzoom && this.z < s.minzoom || s.maxzoom && this.z > s.maxzoom) continue;
899
+ let l = s.dataSource || "", o = e.get(l);
900
+ if (o) for (let f of o) {
901
+ let u = `${Y(f.dataTile)}:${l}`;
902
+ if (!r.has(u)) continue;
903
+ let m = f.data.get(s.dataLayer);
904
+ if (m === void 0) continue;
905
+ let d = m;
906
+ s.sort && d.sort((g, y) => s.sort ? s.sort(g.props, y.props) : 0);
907
+ let h = { index: this.index, zoom: this.z, scratch: this.scratch, order: i, overzoom: this.z - f.dataTile.z };
908
+ for (let g of d) {
909
+ if (s.filter && !s.filter(this.z, g)) continue;
910
+ let y = ce(g.geom, f.scale, f.origin), _ = s.symbolizer.place(h, y, g);
911
+ if (_) for (let k of _) {
912
+ let p = false;
913
+ if (!(k.deduplicationKey && this.index.deduplicationCollides(k))) {
914
+ if (this.index.labelCollides(k, 1 / 0)) {
915
+ if (!this.index.labelCollides(k, i)) {
916
+ let x = this.index.searchLabel(k, 1 / 0);
917
+ for (let A of x) {
918
+ this.index.removeLabel(A);
919
+ for (let b of A.bboxes) this.findInvalidatedTiles(n, f.dim, b, u);
920
+ }
921
+ this.index.insert(k, i, u), p = true;
922
+ }
923
+ } else this.index.insert(k, i, u), p = true;
924
+ if (p) for (let x of k.bboxes) (x.maxX > f.origin.x + f.dim || x.minX < f.origin.x || x.minY < f.origin.y || x.maxY > f.origin.y + f.dim) && this.findInvalidatedTiles(n, f.dim, x, u);
925
+ }
926
+ }
927
+ }
928
+ }
929
+ }
930
+ for (let i of r) this.index.pruneOrNoop(i);
931
+ return n.size > 0 && this.callback && this.callback(n), performance.now() - t;
932
+ }
933
+ findInvalidatedTiles(e, t, r, n) {
934
+ let i = Nt(this.z, t, r);
935
+ for (let s of i) s.key !== n && this.index.hasPrefix(s.key) && e.add(s.display);
936
+ }
937
+ add(e) {
938
+ let t = true;
939
+ for (let [n, i] of e) for (let s of i) this.index.has(`${Y(s.dataTile)}:${n}`) || (t = false);
940
+ return t ? 0 : this.layout(e);
941
+ }
942
+ };
943
+ c(He, "Labeler");
944
+ var V = He, Ve = class Ve2 {
945
+ constructor(e, t, r, n) {
946
+ this.labelers = /* @__PURE__ */ new Map(), this.scratch = e, this.labelRules = t, this.maxLabeledTiles = r, this.callback = n;
947
+ }
948
+ add(e, t) {
949
+ let r = this.labelers.get(e);
950
+ return r || (r = new V(e, this.scratch, this.labelRules, this.maxLabeledTiles, this.callback), this.labelers.set(e, r)), r.add(t);
951
+ }
952
+ getIndex(e) {
953
+ let t = this.labelers.get(e);
954
+ if (t) return t.index;
955
+ }
956
+ };
957
+ c(Ve, "Labelers");
958
+ var Z = Ve;
959
+ function ue(a, e, t, r, n, i, s, l, o) {
960
+ let f = performance.now();
961
+ a.save(), a.miterLimit = 2;
962
+ for (let u of n) {
963
+ if (u.minzoom && e < u.minzoom || u.maxzoom && e > u.maxzoom) continue;
964
+ let m = t.get(u.dataSource || "");
965
+ if (m) for (let d of m) {
966
+ let h = d.data.get(u.dataLayer);
967
+ if (h === void 0) continue;
968
+ u.symbolizer.before && u.symbolizer.before(a, d.z);
969
+ let g = d.origin, y = d.dim, _ = d.scale;
970
+ if (a.save(), l) {
971
+ a.beginPath();
972
+ let k = Math.max(g.x - s.x, i.minX - s.x), p = Math.max(g.y - s.y, i.minY - s.y), x = Math.min(g.x - s.x + y, i.maxX - s.x), A = Math.min(g.y - s.y + y, i.maxY - s.y);
973
+ a.rect(k, p, x - k, A - p), a.clip();
974
+ }
975
+ a.translate(g.x - s.x, g.y - s.y);
976
+ for (let k of h) {
977
+ let p = k.geom, x = k.bbox;
978
+ x.maxX * _ + g.x < i.minX || x.minX * _ + g.x > i.maxX || x.minY * _ + g.y > i.maxY || x.maxY * _ + g.y < i.minY || u.filter && !u.filter(d.z, k) || (_ !== 1 && (p = ce(p, _, new index(0, 0))), u.symbolizer.draw(a, p, d.z, k));
979
+ }
980
+ a.restore();
981
+ }
982
+ }
983
+ if (l && (a.beginPath(), a.rect(i.minX - s.x, i.minY - s.y, i.maxX - i.minX, i.maxY - i.minY), a.clip()), r) {
984
+ let u = r.searchBbox(i, 1 / 0);
985
+ for (let m of u) if (a.save(), a.translate(m.anchor.x - s.x, m.anchor.y - s.y), m.draw(a), a.restore(), o) {
986
+ a.lineWidth = 0.5, a.strokeStyle = o, a.fillStyle = o, a.globalAlpha = 1, a.fillRect(m.anchor.x - s.x - 2, m.anchor.y - s.y - 2, 4, 4);
987
+ for (let d of m.bboxes) a.strokeRect(d.minX - s.x, d.minY - s.y, d.maxX - d.minX, d.maxY - d.minY);
988
+ }
989
+ }
990
+ return a.restore(), performance.now() - f;
991
+ }
992
+ c(ue, "paint");
993
+ var K = 6378137, ft = 85.0511287798, j = K * Math.PI, mt = c((a) => {
994
+ let e = Math.PI / 180, t = Math.max(Math.min(ft, a.y), -ft), r = Math.sin(t * e);
995
+ return new index(K * a.x * e, K * Math.log((1 + r) / (1 - r)) / 2);
996
+ }, "project"), Jt = c((a) => {
997
+ let e = 180 / Math.PI;
998
+ return { lat: (2 * Math.atan(Math.exp(a.y / K)) - Math.PI / 2) * e, lng: a.x * e / K };
999
+ }, "unproject"), Wt = c((a, e) => (t) => {
1000
+ let r = mt(t);
1001
+ return new index((r.x + j) / (j * 2), 1 - (r.y + j) / (j * 2)).mult(C(2, e) * 256).sub(a);
1002
+ }, "instancedProject"), Ht = c((a, e) => (t) => {
1003
+ let r = new index(t.x, t.y).add(a).div(C(2, e) * 256), n = new index(r.x * (j * 2) - j, (1 - r.y) * (j * 2) - j);
1004
+ return Jt(n);
1005
+ }, "instancedUnproject"), ut = c((a, e) => {
1006
+ let t = e * (360 / a);
1007
+ return Math.log2(t / 256);
1008
+ }, "getZoom"), Ze = class Ze2 {
1009
+ constructor(e) {
1010
+ if (e.theme) {
1011
+ let t = oe[e.theme];
1012
+ this.paintRules = ae(t), this.labelRules = se(t), this.backgroundColor = t.background;
1013
+ } else this.paintRules = e.paintRules || [], this.labelRules = e.labelRules || [], this.backgroundColor = e.backgroundColor;
1014
+ this.views = fe(e), this.debug = e.debug || "";
1015
+ }
1016
+ drawContext(e, t, r, n, i) {
1017
+ return D(this, null, function* () {
1018
+ let s = mt(n), o = new index((s.x + j) / (j * 2), 1 - (s.y + j) / (j * 2)).clone().mult(C(2, i) * 256).sub(new index(t / 2, r / 2)), f = { minX: o.x, minY: o.y, maxX: o.x + t, maxY: o.y + r }, u = [];
1019
+ for (let [p, x] of this.views) {
1020
+ let A = x.getBbox(i, f);
1021
+ u.push({ key: p, promise: A });
1022
+ }
1023
+ let m = yield Promise.all(u.map((p) => p.promise.then((x) => ({ status: "fulfilled", value: x, key: p.key }), (x) => ({ status: "rejected", value: [], reason: x, key: p.key })))), d = /* @__PURE__ */ new Map();
1024
+ for (let p of m) p.status === "fulfilled" && d.set(p.key, p.value);
1025
+ let h = performance.now(), g = new V(i, e, this.labelRules, 16, void 0);
1026
+ g.add(d);
1027
+ this.backgroundColor && (e.save(), e.fillStyle = this.backgroundColor, e.fillRect(0, 0, t, r), e.restore());
1028
+ let _ = this.paintRules;
1029
+ ue(e, i, d, g.index, _, f, o, true, this.debug);
1030
+ if (this.debug) {
1031
+ e.save(), e.translate(-o.x, -o.y), e.strokeStyle = this.debug, e.fillStyle = this.debug, e.font = "12px sans-serif";
1032
+ let p = 0;
1033
+ for (let [x, A] of d) {
1034
+ for (let b of A) {
1035
+ e.strokeRect(b.origin.x, b.origin.y, b.dim, b.dim);
1036
+ let v = b.dataTile;
1037
+ e.fillText(`${x + (x ? " " : "") + v.z} ${v.x} ${v.y}`, b.origin.x + 4, b.origin.y + 14 * (1 + p));
1038
+ }
1039
+ p++;
1040
+ }
1041
+ e.restore();
1042
+ }
1043
+ return { elapsed: performance.now() - h, project: Wt(o, i), unproject: Ht(o, i) };
1044
+ });
1045
+ }
1046
+ drawCanvas(i, s, l) {
1047
+ return D(this, arguments, function* (e, t, r, n = {}) {
1048
+ let o = window.devicePixelRatio, f = e.clientWidth, u = e.clientHeight;
1049
+ e.width === f * o && e.height === u * o || (e.width = f * o, e.height = u * o), n.lang && (e.lang = n.lang);
1050
+ let m = e.getContext("2d");
1051
+ if (!m) {
1052
+ console.error("Failed to initialize canvas2d context.");
1053
+ return;
1054
+ }
1055
+ return m.setTransform(o, 0, 0, o, 0, 0), this.drawContext(m, f, u, t, r);
1056
+ });
1057
+ }
1058
+ drawContextBounds(e, t, r, n, i) {
1059
+ return D(this, null, function* () {
1060
+ let s = r.x - t.x, l = new index((t.x + r.x) / 2, (t.y + r.y) / 2);
1061
+ return this.drawContext(e, n, i, l, ut(s, n));
1062
+ });
1063
+ }
1064
+ drawCanvasBounds(s, l, o, f) {
1065
+ return D(this, arguments, function* (e, t, r, n, i = {}) {
1066
+ let u = r.x - t.x, m = new index((t.x + r.x) / 2, (t.y + r.y) / 2);
1067
+ return this.drawCanvas(e, m, ut(u, n), i);
1068
+ });
1069
+ }
1070
+ };
1071
+ c(Ze, "Static");
1072
+ var dt = Ze;
1073
+ var Zt = c((a) => new Promise((e) => {
1074
+ setTimeout(() => {
1075
+ e();
1076
+ }, a);
1077
+ }), "timer"), Kt = c((a) => a.then((e) => ({ status: "fulfilled", value: e }), (e) => ({ status: "rejected", reason: e })), "reflect"), Pn = c((a = {}) => {
1078
+ let t = class t extends L.GridLayer {
1079
+ constructor(n = {}) {
1080
+ if (n.noWrap && !n.bounds && (n.bounds = [[-90, -180], [90, 180]]), n.attribution == null && (n.attribution = '<a href="https://protomaps.com">Protomaps</a> © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>'), super(n), n.theme) {
1081
+ let s = oe[n.theme];
1082
+ this.paintRules = ae(s), this.labelRules = se(s), this.backgroundColor = s.background;
1083
+ } else this.paintRules = n.paintRules || [], this.labelRules = n.labelRules || [], this.backgroundColor = n.backgroundColor;
1084
+ this.lastRequestedZ = void 0, this.tasks = n.tasks || [], this.views = fe(n), this.debug = n.debug;
1085
+ let i = document.createElement("canvas").getContext("2d");
1086
+ this.scratch = i, this.onTilesInvalidated = (s) => {
1087
+ for (let l of s) this.rerenderTile(l);
1088
+ }, this.labelers = new Z(this.scratch, this.labelRules, 16, this.onTilesInvalidated), this.tileSize = 256 * window.devicePixelRatio, this.tileDelay = n.tileDelay || 3, this.lang = n.lang;
1089
+ }
1090
+ renderTile(n, i, s, l = () => {
1091
+ }) {
1092
+ return D(this, null, function* () {
1093
+ this.lastRequestedZ = n.z;
1094
+ let o = [];
1095
+ for (let [w, S] of this.views) {
1096
+ let de = S.getDisplayTile(n);
1097
+ o.push({ key: w, promise: de });
1098
+ }
1099
+ let f = yield Promise.all(o.map((w) => w.promise.then((S) => ({ status: "fulfilled", value: S, key: w.key }), (S) => ({ status: "rejected", reason: S, key: w.key })))), u = /* @__PURE__ */ new Map();
1100
+ for (let w of f) w.status === "fulfilled" ? u.set(w.key, [w.value]) : w.reason.name === "AbortError" || console.error(w.reason);
1101
+ if (i.key !== s || this.lastRequestedZ !== n.z || (yield Promise.all(this.tasks.map(Kt)), i.key !== s) || this.lastRequestedZ !== n.z) return;
1102
+ let m = this.labelers.add(n.z, u);
1103
+ if (i.key !== s || this.lastRequestedZ !== n.z) return;
1104
+ let d = this.labelers.getIndex(n.z);
1105
+ if (!this._map) return;
1106
+ let h = this._map.getCenter().wrap(), g = this._getTiledPixelBounds(h), _ = this._pxBoundsToTileRange(g).getCenter(), k = n.distanceTo(_) * this.tileDelay;
1107
+ if (yield Zt(k), i.key !== s || this.lastRequestedZ !== n.z) return;
1108
+ let p = 16, x = { minX: 256 * n.x - p, minY: 256 * n.y - p, maxX: 256 * (n.x + 1) + p, maxY: 256 * (n.y + 1) + p }, A = new index(256 * n.x, 256 * n.y);
1109
+ i.width = this.tileSize, i.height = this.tileSize;
1110
+ let b = i.getContext("2d");
1111
+ if (!b) {
1112
+ console.error("Failed to get Canvas context");
1113
+ return;
1114
+ }
1115
+ b.setTransform(this.tileSize / 256, 0, 0, this.tileSize / 256, 0, 0), b.clearRect(0, 0, 256, 256), this.backgroundColor && (b.save(), b.fillStyle = this.backgroundColor, b.fillRect(0, 0, 256, 256), b.restore());
1116
+ let v = 0, z = this.paintRules;
1117
+ if (v = ue(b, n.z, u, this.xray ? null : d, z, x, A, false, this.debug), this.debug) {
1118
+ b.save(), b.fillStyle = this.debug, b.font = "600 12px sans-serif", b.fillText(`${n.z} ${n.x} ${n.y}`, 4, 14), b.font = "12px sans-serif";
1119
+ let w = 28;
1120
+ for (let [S, de] of u) {
1121
+ let me = de[0].dataTile;
1122
+ b.fillText(`${S + (S ? " " : "") + me.z} ${me.x} ${me.y}`, 4, w), w += 14;
1123
+ }
1124
+ b.font = "600 10px sans-serif", v > 8 && (b.fillText(`${v.toFixed()} ms paint`, 4, w), w += 14), m > 8 && b.fillText(`${m.toFixed()} ms layout`, 4, w), b.strokeStyle = this.debug, b.lineWidth = 0.5, b.beginPath(), b.moveTo(0, 0), b.lineTo(0, 256), b.stroke(), b.lineWidth = 0.5, b.beginPath(), b.moveTo(0, 0), b.lineTo(256, 0), b.stroke(), b.restore();
1125
+ }
1126
+ l();
1127
+ });
1128
+ }
1129
+ rerenderTile(n) {
1130
+ for (let i in this._tiles) {
1131
+ let s = this._wrapCoords(this._keyToTileCoords(i));
1132
+ n === this._tileCoordsToKey(s) && this.renderTile(s, this._tiles[i].el, n);
1133
+ }
1134
+ }
1135
+ queryTileFeaturesDebug(n, i, s = 16) {
1136
+ let l = /* @__PURE__ */ new Map();
1137
+ for (let [o, f] of this.views) l.set(o, f.queryFeatures(n, i, this._map.getZoom(), s));
1138
+ return l;
1139
+ }
1140
+ clearLayout() {
1141
+ this.labelers = new Z(this.scratch, this.labelRules, 16, this.onTilesInvalidated);
1142
+ }
1143
+ rerenderTiles() {
1144
+ for (let n in this._tiles) {
1145
+ let i = this._wrapCoords(this._keyToTileCoords(n)), s = this._tileCoordsToKey(i);
1146
+ this.renderTile(i, this._tiles[n].el, s);
1147
+ }
1148
+ }
1149
+ createTile(n, i) {
1150
+ let s = L.DomUtil.create("canvas", "leaflet-tile");
1151
+ s.lang = this.lang;
1152
+ let l = this._tileCoordsToKey(n);
1153
+ return s.key = l, this.renderTile(n, s, l, () => {
1154
+ i(void 0, s);
1155
+ }), s;
1156
+ }
1157
+ _removeTile(n) {
1158
+ let i = this._tiles[n];
1159
+ i && (i.el.removed = true, i.el.key = void 0, L.DomUtil.removeClass(i.el, "leaflet-tile-loaded"), i.el.width = i.el.height = 0, L.DomUtil.remove(i.el), delete this._tiles[n], this.fire("tileunload", { tile: i.el, coords: this._keyToTileCoords(n) }));
1160
+ }
1161
+ };
1162
+ c(t, "LeafletLayer");
1163
+ let e = t;
1164
+ return new e(a);
1165
+ }, "leafletLayer");
1166
+ var Sn = c((a, e, t) => {
1167
+ let r = new FontFace(a, `url(${e})`, { weight: t });
1168
+ return document.fonts.add(r), r.load();
1169
+ }, "Font"), bt = c((a) => D(void 0, null, function* () {
1170
+ return new Promise((e, t) => {
1171
+ let r = new Image();
1172
+ r.onload = () => e(r), r.onerror = () => t("Invalid SVG"), r.src = a;
1173
+ });
1174
+ }), "mkimg"), Ut = `
1175
+ <svg width="20px" height="20px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg">
1176
+ <rect width="50" height="50" fill="#cccccc"/>
1177
+ <g transform="translate(5,5)">
1178
+ <path fill="none" stroke="#666666" stroke-width="7" d="m11,12a8.5,8 0 1,1 17,0q0,4-4,6t-4.5,4.5-.4,4v.2m0,3v7"/>
1179
+ </g>
1180
+ </svg>
1181
+ `, Ke = class Ke2 {
1182
+ constructor(e) {
1183
+ this.src = e, this.canvas = document.createElement("canvas"), this.mapping = /* @__PURE__ */ new Map(), this.missingBox = { x: 0, y: 0, w: 0, h: 0 };
1184
+ }
1185
+ load() {
1186
+ return D(this, null, function* () {
1187
+ let e = this.src, t = window.devicePixelRatio;
1188
+ e.endsWith(".html") && (e = yield (yield fetch(e)).text());
1189
+ let r = new window.DOMParser().parseFromString(e, "text/html"), n = Array.from(r.body.children), i = yield bt(`data:image/svg+xml;base64,${btoa(Ut)}`), s = [{ w: i.width * t, h: i.height * t, img: i, id: "" }], l = new XMLSerializer();
1190
+ for (let u of n) {
1191
+ let d = `data:image/svg+xml;base64,${btoa(l.serializeToString(u))}`, h = yield bt(d);
1192
+ s.push({ w: h.width * t, h: h.height * t, img: h, id: u.id });
1193
+ }
1194
+ let o = index$3(s);
1195
+ this.canvas.width = o.w, this.canvas.height = o.h;
1196
+ let f = this.canvas.getContext("2d");
1197
+ if (f) for (let u of s) u.x !== void 0 && u.y !== void 0 && (f.drawImage(u.img, u.x, u.y, u.w, u.h), u.id ? this.mapping.set(u.id, { x: u.x, y: u.y, w: u.w, h: u.h }) : this.missingBox = { x: u.x, y: u.y, w: u.w, h: u.h });
1198
+ return this;
1199
+ });
1200
+ }
1201
+ get(e) {
1202
+ let t = this.mapping.get(e);
1203
+ return t || (t = this.missingBox), t;
1204
+ }
1205
+ };
1206
+ c(Ke, "Sheet");
1207
+ var ht = Ke;
1208
+ exports.CenteredSymbolizer = Te;
1209
+ exports.CenteredTextSymbolizer = I;
1210
+ exports.CircleSymbolizer = te;
1211
+ exports.FlexSymbolizer = st;
1212
+ exports.Font = Sn;
1213
+ exports.GeomType = rt;
1214
+ exports.GroupSymbolizer = re;
1215
+ exports.IconSymbolizer = it;
1216
+ exports.Index = Je;
1217
+ exports.Justify = St;
1218
+ exports.Labeler = V;
1219
+ exports.Labelers = Z;
1220
+ exports.LineLabelPlacement = Rt;
1221
+ exports.LineLabelSymbolizer = $;
1222
+ exports.LineSymbolizer = M;
1223
+ exports.OffsetSymbolizer = Pe;
1224
+ exports.OffsetTextSymbolizer = ie;
1225
+ exports.Padding = ot;
1226
+ exports.PmtilesSource = H;
1227
+ exports.PolygonSymbolizer = P;
1228
+ exports.Sheet = ht;
1229
+ exports.ShieldSymbolizer = at;
1230
+ exports.Static = dt;
1231
+ exports.TextPlacements = At;
1232
+ exports.TextSymbolizer = ne;
1233
+ exports.TileCache = ee;
1234
+ exports.View = Ne;
1235
+ exports.ZxySource = Q;
1236
+ exports.arr = Tr;
1237
+ exports.covering = Nt;
1238
+ exports.createPattern = zr;
1239
+ exports.exp = F;
1240
+ exports.getZoom = ut;
1241
+ exports.isCcw = Pt;
1242
+ exports.isInRing = tt;
1243
+ exports.labelRules = se;
1244
+ exports.leafletLayer = Pn;
1245
+ exports.linear = Le;
1246
+ exports.paint = ue;
1247
+ exports.paintRules = ae;
1248
+ exports.pointInPolygon = Lt;
1249
+ exports.pointMinDistToLines = Ct;
1250
+ exports.pointMinDistToPoints = vt;
1251
+ exports.sourcesToViews = fe;
1252
+ exports.step = Pr;
1253
+ exports.toIndex = Y;
1254
+ exports.transformGeom = ce;
1255
+ exports.wrap = le;
1256
+ //# sourceMappingURL=index.cjs.map