@nika-js/onlymap 0.2.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/onlymap.code-snippets +13 -0
- package/LICENSE.md +4 -0
- package/README.md +30 -7
- package/THIRD-PARTY-LICENSES.md +7874 -0
- package/dist/{Arrow.dom-7AXne1TU.js → Arrow.dom-BNjbQ9jb.js} +23 -23
- package/dist/LercDecode.es-CVmNpXBp.js +303 -0
- package/dist/assets/LercDecode.es-BJb2dZu5.js +305 -0
- package/dist/assets/__vite-browser-external-DDArsqdc.js +29 -0
- package/dist/assets/lerc-wasm.wasm +0 -0
- package/dist/assets/lzw-BY5a_5nb.js +83 -0
- package/dist/assets/worker-DtIrTJB7.js +305 -0
- package/dist/assets/zstd-QGAv3PMm.js +383 -0
- package/dist/{basemap-BdvB-SHy.js → basemap-BSb-g03Z.js} +5729 -5684
- package/dist/basemap-registry.d.ts +10 -0
- package/dist/basemap.d.ts +23 -0
- package/dist/color.d.ts +9 -0
- package/dist/{convert-arrow-schema-CvZ3cT5m.js → convert-arrow-schema-DrAihRf9.js} +31 -31
- package/dist/ctx.d.ts +3 -0
- package/dist/deck.d.ts +28 -0
- package/dist/deck.js +16 -0
- package/dist/elements/om-map.d.ts +29 -0
- package/dist/html-data.d.ts +2 -2
- package/dist/index-CIEkseeV.js +3108 -0
- package/dist/index-D67FynN5.js +594 -0
- package/dist/{index-CJOMgp8k.js → index-QSkZjzIL.js} +4 -4
- package/dist/index-WeMwLoaQ.js +1446 -0
- package/dist/{index-BxzDKZpu.js → index-lV5eG2Xt.js} +22439 -21347
- package/dist/index.d.ts +13 -0
- package/dist/ir-snapshot.d.ts +2 -0
- package/dist/ir.d.ts +10 -0
- package/dist/layer-registry.d.ts +15 -1
- package/dist/legend-spec.d.ts +66 -0
- package/dist/lerc-DJzRIT6z.js +30 -0
- package/dist/lerc-wasm.wasm +0 -0
- package/dist/lzw-BY5a_5nb.js +83 -0
- package/dist/mgrs-BY9bIvp4.js +799 -0
- package/dist/onlymapjs.css +1 -1
- package/dist/onlymapjs.js +55 -35
- package/dist/programmatic.d.ts +35 -0
- package/dist/raster-BKf1dx54.js +8843 -0
- package/dist/raster.d.ts +61 -0
- package/dist/react/om-layer.d.ts +2 -0
- package/dist/react.js +18 -16
- package/dist/{recordbatch-HRu0SMKp.js → recordbatch-Bpc0uxFn.js} +200 -200
- package/dist/runtime-core.d.ts +73 -1
- package/dist/scene-lighting.d.ts +83 -0
- package/dist/selection.d.ts +1 -1
- package/dist/snapshot.d.ts +14 -0
- package/dist/{table-accessors-DBjWgN0C.js → table-accessors-CYWTzpQI.js} +71 -76
- package/dist/terrain.d.ts +113 -0
- package/dist/version.d.ts +1 -1
- package/dist/zstd-jXobGRcq.js +14 -0
- package/docs/custom-layers.md +99 -0
- package/llms.txt +5 -5
- package/onlymapjs.html-data.json +163 -29
- package/package.json +35 -15
- package/skills/onlymapjs/SKILL.md +3 -1
- package/skills/onlymapjs/references/syntax.md +53 -3
- package/dist/index-BVQ0s1Zh.js +0 -1457
- package/dist/index-CvBHiOGD.js +0 -605
- package/dist/index-Vc8QfNEf.js +0 -3907
- package/dist/onlymapjs.umd.cjs +0 -8634
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
import { i as E, j as S, k as R, n as N, o as h, p as w, q as O, s as W, r as x, t as I, v as B, w as _, x as P, y as k, A as $, B as z, E as v, F, H as C, I as U, J as p, K as M } from "./index-lV5eG2Xt.js";
|
|
2
|
+
import { N as $e, R as ze, _ as ve, O as Ce, P as Ue, Q as Me, S as je, T as De, U as Je, X as qe, Y as He, Z as Ve, $ as Ge, a0 as Ke, a1 as Qe, a2 as Xe, a3 as Ye, a4 as Ze, a5 as et, a6 as tt, a7 as nt, a8 as rt, a9 as at, aa as st, ab as ot } from "./index-lV5eG2Xt.js";
|
|
3
|
+
import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
|
|
4
|
+
async function J(t, e, n = {}, r = {}) {
|
|
5
|
+
const a = E(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
|
|
6
|
+
o || (c.url = R(t, n));
|
|
7
|
+
const i = s.getWorkerPool(c), u = n.jobName || t.name, d = await i.startJob(
|
|
8
|
+
u,
|
|
9
|
+
// eslint-disable-next-line
|
|
10
|
+
q.bind(null, r)
|
|
11
|
+
), y = N(n);
|
|
12
|
+
return d.postMessage("process", { input: e, options: y }), (await d.result).result;
|
|
13
|
+
}
|
|
14
|
+
async function q(t, e, n, r) {
|
|
15
|
+
switch (n) {
|
|
16
|
+
case "done":
|
|
17
|
+
e.done(r);
|
|
18
|
+
break;
|
|
19
|
+
case "error":
|
|
20
|
+
e.error(new Error(r.error));
|
|
21
|
+
break;
|
|
22
|
+
case "process":
|
|
23
|
+
const { id: a, input: s, options: o } = r;
|
|
24
|
+
try {
|
|
25
|
+
if (!t.process) {
|
|
26
|
+
e.postMessage("error", { id: a, error: "Worker not set up to process on main thread" });
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const c = await t.process(s, o);
|
|
30
|
+
e.postMessage("done", { id: a, result: c });
|
|
31
|
+
} catch (c) {
|
|
32
|
+
const i = c instanceof Error ? c.message : "unknown error";
|
|
33
|
+
e.postMessage("error", { id: a, error: i });
|
|
34
|
+
}
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
console.warn(`process-on-worker: unknown message ${n}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function H(t, e) {
|
|
41
|
+
if (!S.isSupported())
|
|
42
|
+
return !1;
|
|
43
|
+
const n = e?._nodeWorkers ?? e?.core?._nodeWorkers, r = e?.worker ?? e?.core?.worker;
|
|
44
|
+
return !h && !n ? !1 : !!(t.worker && r);
|
|
45
|
+
}
|
|
46
|
+
async function* me(t, e = {}) {
|
|
47
|
+
const n = new TextDecoder(void 0, e);
|
|
48
|
+
for await (const r of t)
|
|
49
|
+
yield typeof r == "string" ? r : n.decode(r, { stream: !0 });
|
|
50
|
+
}
|
|
51
|
+
async function* we(t) {
|
|
52
|
+
const e = new TextEncoder();
|
|
53
|
+
for await (const n of t)
|
|
54
|
+
yield typeof n == "string" ? e.encode(n).buffer : n;
|
|
55
|
+
}
|
|
56
|
+
async function* pe(t) {
|
|
57
|
+
let e = "";
|
|
58
|
+
for await (const n of t) {
|
|
59
|
+
e += n;
|
|
60
|
+
let r;
|
|
61
|
+
for (; (r = e.indexOf(`
|
|
62
|
+
`)) >= 0; ) {
|
|
63
|
+
const a = e.slice(0, r + 1);
|
|
64
|
+
e = e.slice(r + 1), yield a;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
e.length > 0 && (yield e);
|
|
68
|
+
}
|
|
69
|
+
async function* ge(t) {
|
|
70
|
+
let e = 1;
|
|
71
|
+
for await (const n of t)
|
|
72
|
+
yield { counter: e, line: n }, e++;
|
|
73
|
+
}
|
|
74
|
+
const V = "4.4.3", Te = {
|
|
75
|
+
dataType: null,
|
|
76
|
+
batchType: null,
|
|
77
|
+
name: "JSON",
|
|
78
|
+
id: "json",
|
|
79
|
+
module: "json",
|
|
80
|
+
version: V,
|
|
81
|
+
extensions: ["json", "geojson"],
|
|
82
|
+
mimeTypes: ["application/json"],
|
|
83
|
+
category: "json",
|
|
84
|
+
text: !0,
|
|
85
|
+
parseTextSync: g,
|
|
86
|
+
parse: async (t) => g(new TextDecoder().decode(t)),
|
|
87
|
+
options: {}
|
|
88
|
+
};
|
|
89
|
+
function g(t) {
|
|
90
|
+
return JSON.parse(t);
|
|
91
|
+
}
|
|
92
|
+
class G {
|
|
93
|
+
handle;
|
|
94
|
+
size;
|
|
95
|
+
bigsize;
|
|
96
|
+
url;
|
|
97
|
+
constructor(e) {
|
|
98
|
+
this.handle = e instanceof ArrayBuffer ? new Blob([e]) : e, this.size = e instanceof ArrayBuffer ? e.byteLength : e.size, this.bigsize = BigInt(this.size), this.url = e instanceof File ? e.name : "";
|
|
99
|
+
}
|
|
100
|
+
async close() {
|
|
101
|
+
}
|
|
102
|
+
async stat() {
|
|
103
|
+
return {
|
|
104
|
+
size: this.handle.size,
|
|
105
|
+
bigsize: BigInt(this.handle.size),
|
|
106
|
+
isDirectory: !1
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async read(e, n) {
|
|
110
|
+
return await this.handle.slice(Number(e), Number(e) + Number(n)).arrayBuffer();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const f = new Error("Not implemented");
|
|
114
|
+
class K {
|
|
115
|
+
handle;
|
|
116
|
+
size = 0;
|
|
117
|
+
bigsize = 0n;
|
|
118
|
+
url = "";
|
|
119
|
+
constructor(e, n, r) {
|
|
120
|
+
if (globalThis.loaders?.NodeFile)
|
|
121
|
+
return new globalThis.loaders.NodeFile(e, n, r);
|
|
122
|
+
throw h ? new Error("Can't instantiate NodeFile in browser.") : new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.");
|
|
123
|
+
}
|
|
124
|
+
/** Read data */
|
|
125
|
+
async read(e, n) {
|
|
126
|
+
throw f;
|
|
127
|
+
}
|
|
128
|
+
/** Write to file. The number of bytes written will be returned */
|
|
129
|
+
async write(e, n, r) {
|
|
130
|
+
throw f;
|
|
131
|
+
}
|
|
132
|
+
/** Get information about file */
|
|
133
|
+
async stat() {
|
|
134
|
+
throw f;
|
|
135
|
+
}
|
|
136
|
+
/** Truncates the file descriptor. Only available on NodeFile. */
|
|
137
|
+
async truncate(e) {
|
|
138
|
+
throw f;
|
|
139
|
+
}
|
|
140
|
+
/** Append data to a file. Only available on NodeFile. */
|
|
141
|
+
async append(e) {
|
|
142
|
+
throw f;
|
|
143
|
+
}
|
|
144
|
+
/** Close the file */
|
|
145
|
+
async close() {
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
async function be(t, e, n) {
|
|
149
|
+
t instanceof Blob || (t = new Blob([t]));
|
|
150
|
+
const r = t.slice(e, e + n);
|
|
151
|
+
return await Q(r);
|
|
152
|
+
}
|
|
153
|
+
async function Q(t) {
|
|
154
|
+
return await new Promise((e, n) => {
|
|
155
|
+
const r = new FileReader();
|
|
156
|
+
r.onload = (a) => e(a?.target?.result), r.onerror = (a) => n(a), r.readAsArrayBuffer(t);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function Se(t, e, n, r) {
|
|
160
|
+
!Array.isArray(e) && !w(e) && (r = void 0, n = e, e = void 0), n = n || {};
|
|
161
|
+
const s = O(e, r), o = W(t, s, n);
|
|
162
|
+
if (!o)
|
|
163
|
+
return null;
|
|
164
|
+
const c = x(n, o, s), i = I(t), u = () => {
|
|
165
|
+
throw new Error("parseSync called parse (which is async");
|
|
166
|
+
};
|
|
167
|
+
return r = B({ url: i, _parseSync: u, _parse: u, loaders: e }, c, r || null), X(o, t, c, r);
|
|
168
|
+
}
|
|
169
|
+
function X(t, e, n, r) {
|
|
170
|
+
if (e = _(e, t), t.parseTextSync && typeof e == "string")
|
|
171
|
+
return t.parseTextSync(e, n);
|
|
172
|
+
if (t.parseSync && e instanceof ArrayBuffer)
|
|
173
|
+
return t.parseSync(e, n, r);
|
|
174
|
+
throw new Error(`${t.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${r.url || ""}`);
|
|
175
|
+
}
|
|
176
|
+
function Y(t) {
|
|
177
|
+
return { ...t, length: j(t), batchType: "data" };
|
|
178
|
+
}
|
|
179
|
+
async function l(t, e, n, r) {
|
|
180
|
+
const a = Array.isArray(e) ? e : void 0;
|
|
181
|
+
!Array.isArray(e) && !w(e) && (r = void 0, n = e, e = void 0), t = await t, n = n || {};
|
|
182
|
+
const s = I(t), o = await P(t, e, n);
|
|
183
|
+
if (!o)
|
|
184
|
+
return [];
|
|
185
|
+
const c = x(n, o, a, s);
|
|
186
|
+
return r = B({ url: s, _parseInBatches: l, _parse: k, loaders: a }, c, r || null), await Z(o, t, c, r);
|
|
187
|
+
}
|
|
188
|
+
async function Z(t, e, n, r) {
|
|
189
|
+
const a = await ee(t, e, n, r);
|
|
190
|
+
if (!n?.core?.metadata)
|
|
191
|
+
return a;
|
|
192
|
+
const s = {
|
|
193
|
+
shape: "metadata",
|
|
194
|
+
batchType: "metadata",
|
|
195
|
+
metadata: {
|
|
196
|
+
_loader: t,
|
|
197
|
+
_context: r
|
|
198
|
+
},
|
|
199
|
+
// Populate with some default fields to avoid crashing
|
|
200
|
+
data: [],
|
|
201
|
+
bytesUsed: 0
|
|
202
|
+
};
|
|
203
|
+
async function* o(c) {
|
|
204
|
+
yield s, yield* c;
|
|
205
|
+
}
|
|
206
|
+
return o(a);
|
|
207
|
+
}
|
|
208
|
+
async function ee(t, e, n, r) {
|
|
209
|
+
const a = await $(e, n), s = await re(a, n?.core?.transforms || []);
|
|
210
|
+
return t.parseInBatches ? t.parseInBatches(s, n, r) : te(s, t, n, r);
|
|
211
|
+
}
|
|
212
|
+
async function* te(t, e, n, r) {
|
|
213
|
+
const a = await z(t), s = await k(
|
|
214
|
+
a,
|
|
215
|
+
e,
|
|
216
|
+
// TODO - Hack: supply loaders MIME type to ensure we match it
|
|
217
|
+
{ ...n, core: { ...n?.core, mimeType: e.mimeTypes[0] } },
|
|
218
|
+
r
|
|
219
|
+
);
|
|
220
|
+
yield ne(s, e);
|
|
221
|
+
}
|
|
222
|
+
function ne(t, e) {
|
|
223
|
+
const n = D(t) ? Y(t) : {
|
|
224
|
+
shape: "unknown",
|
|
225
|
+
batchType: "data",
|
|
226
|
+
data: t,
|
|
227
|
+
length: Array.isArray(t) ? t.length : 1
|
|
228
|
+
};
|
|
229
|
+
return n.mimeType = e.mimeTypes[0], n;
|
|
230
|
+
}
|
|
231
|
+
async function re(t, e = []) {
|
|
232
|
+
let n = t;
|
|
233
|
+
for await (const r of e)
|
|
234
|
+
n = r(n);
|
|
235
|
+
return n;
|
|
236
|
+
}
|
|
237
|
+
function xe(t, e, n, r) {
|
|
238
|
+
let a;
|
|
239
|
+
!Array.isArray(e) && !w(e) ? (n = e, a = void 0) : a = e;
|
|
240
|
+
const s = v(n || {});
|
|
241
|
+
return Array.isArray(t) ? t.map((c) => T(c, a, n || {}, s)) : T(t, a, n || {}, s);
|
|
242
|
+
}
|
|
243
|
+
async function T(t, e, n, r) {
|
|
244
|
+
if (typeof t == "string") {
|
|
245
|
+
const s = await r(t);
|
|
246
|
+
return Array.isArray(e) ? await l(s, e, n) : await l(s, e, n);
|
|
247
|
+
}
|
|
248
|
+
return Array.isArray(e) ? await l(t, e, n) : await l(t, e, n);
|
|
249
|
+
}
|
|
250
|
+
async function ae(t, e, n) {
|
|
251
|
+
if (e.encode)
|
|
252
|
+
return await e.encode(t, n);
|
|
253
|
+
if (e.encodeText) {
|
|
254
|
+
const r = await e.encodeText(t, n);
|
|
255
|
+
return F(new TextEncoder().encode(r));
|
|
256
|
+
}
|
|
257
|
+
if (e.encodeInBatches) {
|
|
258
|
+
const r = se(t, e, n), a = [];
|
|
259
|
+
for await (const s of r)
|
|
260
|
+
a.push(s);
|
|
261
|
+
return C(...a);
|
|
262
|
+
}
|
|
263
|
+
throw new Error("Writer could not encode data");
|
|
264
|
+
}
|
|
265
|
+
async function Ie(t, e, n) {
|
|
266
|
+
if (e.text && e.encodeText)
|
|
267
|
+
return await e.encodeText(t, n);
|
|
268
|
+
if (e.text) {
|
|
269
|
+
const r = await ae(t, e, n);
|
|
270
|
+
return new TextDecoder().decode(r);
|
|
271
|
+
}
|
|
272
|
+
throw new Error(`Writer ${e.name} could not encode data as text`);
|
|
273
|
+
}
|
|
274
|
+
function se(t, e, n) {
|
|
275
|
+
if (e.encodeInBatches) {
|
|
276
|
+
const r = oe(t);
|
|
277
|
+
return e.encodeInBatches(r, n);
|
|
278
|
+
}
|
|
279
|
+
throw new Error("Writer could not encode data in batches");
|
|
280
|
+
}
|
|
281
|
+
function oe(t) {
|
|
282
|
+
return [{ ...t, start: 0, end: t.length }];
|
|
283
|
+
}
|
|
284
|
+
async function Be(t, e, n) {
|
|
285
|
+
const a = { ...U(), ...n };
|
|
286
|
+
return e.encodeURLtoURL ? ue(e, t, a) : H(e, a) ? await J(e, t, a) : await e.encode(t, a);
|
|
287
|
+
}
|
|
288
|
+
function ce(t, e, n) {
|
|
289
|
+
if (e.encodeSync)
|
|
290
|
+
return e.encodeSync(t, n);
|
|
291
|
+
if (e.encodeTextSync)
|
|
292
|
+
return F(new TextEncoder().encode(e.encodeTextSync(t, n)));
|
|
293
|
+
throw new Error(`Writer ${e.name} could not synchronously encode data`);
|
|
294
|
+
}
|
|
295
|
+
async function ke(t, e, n) {
|
|
296
|
+
if (e.encodeText)
|
|
297
|
+
return await e.encodeText(t, n);
|
|
298
|
+
if (e.encodeTextSync)
|
|
299
|
+
return e.encodeTextSync(t, n);
|
|
300
|
+
if (e.text) {
|
|
301
|
+
const r = await e.encode(t, n);
|
|
302
|
+
return new TextDecoder().decode(r);
|
|
303
|
+
}
|
|
304
|
+
throw new Error(`Writer ${e.name} could not encode data as text`);
|
|
305
|
+
}
|
|
306
|
+
function Fe(t, e, n) {
|
|
307
|
+
if (e.encodeTextSync)
|
|
308
|
+
return e.encodeTextSync(t, n);
|
|
309
|
+
if (e.text && e.encodeSync) {
|
|
310
|
+
const r = ce(t, e, n);
|
|
311
|
+
return new TextDecoder().decode(r);
|
|
312
|
+
}
|
|
313
|
+
throw new Error(`Writer ${e.name} could not encode data as text`);
|
|
314
|
+
}
|
|
315
|
+
function Le(t, e, n) {
|
|
316
|
+
if (e.encodeInBatches) {
|
|
317
|
+
const r = fe(t);
|
|
318
|
+
return e.encodeInBatches(r, n);
|
|
319
|
+
}
|
|
320
|
+
throw new Error(`Writer ${e.name} could not encode in batches`);
|
|
321
|
+
}
|
|
322
|
+
async function ie(t, e, n, r) {
|
|
323
|
+
if (t = p(t), e = p(e), h || !n.encodeURLtoURL)
|
|
324
|
+
throw new Error();
|
|
325
|
+
return await n.encodeURLtoURL(t, e, r);
|
|
326
|
+
}
|
|
327
|
+
async function ue(t, e, n) {
|
|
328
|
+
if (h)
|
|
329
|
+
throw new Error(`Writer ${t.name} not supported in browser`);
|
|
330
|
+
const r = b("input");
|
|
331
|
+
await new K(r, "w").write(e);
|
|
332
|
+
const s = b("output"), o = await ie(r, s, t, n);
|
|
333
|
+
return (await M(o)).arrayBuffer();
|
|
334
|
+
}
|
|
335
|
+
function fe(t) {
|
|
336
|
+
return [{ ...t, start: 0, end: t.length }];
|
|
337
|
+
}
|
|
338
|
+
function b(t) {
|
|
339
|
+
return `/tmp/${t}`;
|
|
340
|
+
}
|
|
341
|
+
function Ae(t, e, n) {
|
|
342
|
+
const r = n?.type || "auto";
|
|
343
|
+
let a = null;
|
|
344
|
+
if (r === "auto") {
|
|
345
|
+
for (const s of e)
|
|
346
|
+
if (typeof t == "string" && s.testURL && s.testURL(t))
|
|
347
|
+
return s;
|
|
348
|
+
} else
|
|
349
|
+
a = le(r, e);
|
|
350
|
+
if (!a && !n?.nothrow)
|
|
351
|
+
throw new Error("Not a valid image source type");
|
|
352
|
+
return a;
|
|
353
|
+
}
|
|
354
|
+
function le(t, e) {
|
|
355
|
+
for (const n of e)
|
|
356
|
+
if (n.type === t)
|
|
357
|
+
return n;
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
function Ee(t, e) {
|
|
361
|
+
if (globalThis.loaders.makeNodeStream)
|
|
362
|
+
return globalThis.loaders.makeNodeStream(t, e);
|
|
363
|
+
const n = t[Symbol.asyncIterator] ? t[Symbol.asyncIterator]() : t[Symbol.iterator]();
|
|
364
|
+
return new ReadableStream(
|
|
365
|
+
{
|
|
366
|
+
// Create a byte stream (enables `Response(stream).arrayBuffer()`)
|
|
367
|
+
// Only supported on Chrome
|
|
368
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController
|
|
369
|
+
// @ts-ignore
|
|
370
|
+
type: "bytes",
|
|
371
|
+
async pull(r) {
|
|
372
|
+
try {
|
|
373
|
+
const { done: a, value: s } = await n.next();
|
|
374
|
+
a ? r.close() : r.enqueue(new Uint8Array(s));
|
|
375
|
+
} catch (a) {
|
|
376
|
+
r.error(a);
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
async cancel() {
|
|
380
|
+
await n?.return?.();
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
// options: QueingStrategy<Uint8Array>
|
|
384
|
+
{
|
|
385
|
+
// This is bytes, not chunks
|
|
386
|
+
highWaterMark: 2 ** 24,
|
|
387
|
+
...e
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
const L = "4.4.3", Re = {
|
|
392
|
+
dataType: null,
|
|
393
|
+
batchType: null,
|
|
394
|
+
name: "Null loader",
|
|
395
|
+
id: "null",
|
|
396
|
+
module: "core",
|
|
397
|
+
version: L,
|
|
398
|
+
worker: !0,
|
|
399
|
+
mimeTypes: ["application/x.empty"],
|
|
400
|
+
extensions: ["null"],
|
|
401
|
+
tests: [() => !1],
|
|
402
|
+
options: {
|
|
403
|
+
null: {}
|
|
404
|
+
}
|
|
405
|
+
}, Ne = {
|
|
406
|
+
dataType: null,
|
|
407
|
+
batchType: null,
|
|
408
|
+
name: "Null loader",
|
|
409
|
+
id: "null",
|
|
410
|
+
module: "core",
|
|
411
|
+
version: L,
|
|
412
|
+
mimeTypes: ["application/x.empty"],
|
|
413
|
+
extensions: ["null"],
|
|
414
|
+
parse: async (t, e, n) => m(),
|
|
415
|
+
parseSync: m,
|
|
416
|
+
parseInBatches: async function* (e, n, r) {
|
|
417
|
+
for await (const a of e)
|
|
418
|
+
yield m();
|
|
419
|
+
},
|
|
420
|
+
tests: [() => !1],
|
|
421
|
+
options: {
|
|
422
|
+
null: {}
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
function m(t, e, n) {
|
|
426
|
+
return null;
|
|
427
|
+
}
|
|
428
|
+
async function Oe(t, e, n = () => {
|
|
429
|
+
}, r = () => {
|
|
430
|
+
}) {
|
|
431
|
+
if (t = await t, !t.ok)
|
|
432
|
+
return t;
|
|
433
|
+
const a = t.body;
|
|
434
|
+
if (!a)
|
|
435
|
+
return t;
|
|
436
|
+
const s = t.headers.get("content-length") || 0, o = s ? parseInt(s) : 0;
|
|
437
|
+
if (!(o > 0) || typeof ReadableStream > "u" || !a.getReader)
|
|
438
|
+
return t;
|
|
439
|
+
const c = new ReadableStream({
|
|
440
|
+
async start(i) {
|
|
441
|
+
const u = a.getReader();
|
|
442
|
+
await A(i, u, 0, o, e, n, r);
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
return new Response(c);
|
|
446
|
+
}
|
|
447
|
+
async function A(t, e, n, r, a, s, o) {
|
|
448
|
+
try {
|
|
449
|
+
const { done: c, value: i } = await e.read();
|
|
450
|
+
if (c) {
|
|
451
|
+
s(), t.close();
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
n += i.byteLength;
|
|
455
|
+
const u = Math.round(n / r * 100);
|
|
456
|
+
a(u, { loadedBytes: n, totalBytes: r }), t.enqueue(i), await A(t, e, n, r, a, s, o);
|
|
457
|
+
} catch (c) {
|
|
458
|
+
t.error(c), o(c);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
class We {
|
|
462
|
+
_fetch;
|
|
463
|
+
files = {};
|
|
464
|
+
lowerCaseFiles = {};
|
|
465
|
+
usedFiles = {};
|
|
466
|
+
/**
|
|
467
|
+
* A FileSystem API wrapper around a list of browser 'File' objects
|
|
468
|
+
* @param files
|
|
469
|
+
* @param options
|
|
470
|
+
*/
|
|
471
|
+
constructor(e, n) {
|
|
472
|
+
this._fetch = n?.fetch || fetch;
|
|
473
|
+
for (let r = 0; r < e.length; ++r) {
|
|
474
|
+
const a = e[r];
|
|
475
|
+
this.files[a.name] = a, this.lowerCaseFiles[a.name.toLowerCase()] = a, this.usedFiles[a.name] = !1;
|
|
476
|
+
}
|
|
477
|
+
this.fetch = this.fetch.bind(this);
|
|
478
|
+
}
|
|
479
|
+
// implements IFileSystem
|
|
480
|
+
/**
|
|
481
|
+
* Implementation of fetch against this file system
|
|
482
|
+
* Delegates to global fetch for http{s}:// or data://
|
|
483
|
+
*/
|
|
484
|
+
async fetch(e, n) {
|
|
485
|
+
if (e.includes("://"))
|
|
486
|
+
return this._fetch(e, n);
|
|
487
|
+
const r = this.files[e];
|
|
488
|
+
if (!r)
|
|
489
|
+
return new Response(e, { status: 400, statusText: "NOT FOUND" });
|
|
490
|
+
const s = new Headers(n?.headers).get("Range"), o = s && /bytes=($1)-($2)/.exec(s);
|
|
491
|
+
if (o) {
|
|
492
|
+
const i = parseInt(o[1]), u = parseInt(o[2]), d = await r.slice(i, u).arrayBuffer(), y = new Response(d);
|
|
493
|
+
return Object.defineProperty(y, "url", { value: e }), y;
|
|
494
|
+
}
|
|
495
|
+
const c = new Response(r);
|
|
496
|
+
return Object.defineProperty(c, "url", { value: e }), c;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* List filenames in this filesystem
|
|
500
|
+
* @param dirname
|
|
501
|
+
* @returns
|
|
502
|
+
*/
|
|
503
|
+
async readdir(e) {
|
|
504
|
+
const n = [];
|
|
505
|
+
for (const r in this.files)
|
|
506
|
+
n.push(r);
|
|
507
|
+
return n;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Return information (size) about files in this file system
|
|
511
|
+
*/
|
|
512
|
+
async stat(e, n) {
|
|
513
|
+
const r = this.files[e];
|
|
514
|
+
if (!r)
|
|
515
|
+
throw new Error(e);
|
|
516
|
+
return { size: r.size };
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Just removes the file from the list
|
|
520
|
+
*/
|
|
521
|
+
async unlink(e) {
|
|
522
|
+
delete this.files[e], delete this.lowerCaseFiles[e], this.usedFiles[e] = !0;
|
|
523
|
+
}
|
|
524
|
+
// implements IRandomAccessFileSystem
|
|
525
|
+
// RANDOM ACCESS
|
|
526
|
+
async openReadableFile(e, n) {
|
|
527
|
+
return new G(this.files[e]);
|
|
528
|
+
}
|
|
529
|
+
// PRIVATE
|
|
530
|
+
// Supports case independent paths, and file usage tracking
|
|
531
|
+
_getFile(e, n) {
|
|
532
|
+
const r = this.files[e] || this.lowerCaseFiles[e];
|
|
533
|
+
return r && n && (this.usedFiles[e] = !0), r;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
export {
|
|
537
|
+
$e as FetchError,
|
|
538
|
+
Te as JSONLoader,
|
|
539
|
+
Ne as NullLoader,
|
|
540
|
+
Re as NullWorkerLoader,
|
|
541
|
+
ze as RequestScheduler,
|
|
542
|
+
We as _BrowserFileSystem,
|
|
543
|
+
Oe as _fetchProgress,
|
|
544
|
+
Ae as _selectSource,
|
|
545
|
+
ve as _unregisterLoaders,
|
|
546
|
+
Ce as assert,
|
|
547
|
+
z as concatenateArrayBuffersAsync,
|
|
548
|
+
Ue as createDataSource,
|
|
549
|
+
Me as document,
|
|
550
|
+
Be as encode,
|
|
551
|
+
Le as encodeInBatches,
|
|
552
|
+
ce as encodeSync,
|
|
553
|
+
ae as encodeTable,
|
|
554
|
+
Ie as encodeTableAsText,
|
|
555
|
+
se as encodeTableInBatches,
|
|
556
|
+
ke as encodeText,
|
|
557
|
+
Fe as encodeTextSync,
|
|
558
|
+
ie as encodeURLtoURL,
|
|
559
|
+
M as fetchFile,
|
|
560
|
+
je as forEach,
|
|
561
|
+
U as getLoaderOptions,
|
|
562
|
+
De as getPathPrefix,
|
|
563
|
+
Je as global,
|
|
564
|
+
qe as isAsyncIterable,
|
|
565
|
+
h as isBrowser,
|
|
566
|
+
He as isIterable,
|
|
567
|
+
Ve as isIterator,
|
|
568
|
+
Ge as isPromise,
|
|
569
|
+
Ke as isPureObject,
|
|
570
|
+
Qe as isReadableStream,
|
|
571
|
+
Xe as isResponse,
|
|
572
|
+
Ye as isWorker,
|
|
573
|
+
Ze as isWritableStream,
|
|
574
|
+
et as load,
|
|
575
|
+
xe as loadInBatches,
|
|
576
|
+
tt as makeIterator,
|
|
577
|
+
pe as makeLineIterator,
|
|
578
|
+
ge as makeNumberedLineIterator,
|
|
579
|
+
Ee as makeStream,
|
|
580
|
+
me as makeTextDecoderIterator,
|
|
581
|
+
we as makeTextEncoderIterator,
|
|
582
|
+
k as parse,
|
|
583
|
+
l as parseInBatches,
|
|
584
|
+
Se as parseSync,
|
|
585
|
+
be as readArrayBuffer,
|
|
586
|
+
nt as registerLoaders,
|
|
587
|
+
p as resolvePath,
|
|
588
|
+
P as selectLoader,
|
|
589
|
+
W as selectLoaderSync,
|
|
590
|
+
rt as self,
|
|
591
|
+
at as setLoaderOptions,
|
|
592
|
+
st as setPathPrefix,
|
|
593
|
+
ot as window
|
|
594
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ac as _t, ad as Ct } from "./index-lV5eG2Xt.js";
|
|
2
2
|
function Yt(e, r, t = 2, i, o = "xy") {
|
|
3
3
|
const s = r && r.length, l = s ? r[0] * t : e.length;
|
|
4
4
|
let c = Ut(e, 0, l, t, !0, i && i[0], o);
|
|
@@ -4774,7 +4774,7 @@ const $u = "4.4.3", Wu = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
4774
4774
|
}
|
|
4775
4775
|
};
|
|
4776
4776
|
function qt(e, r) {
|
|
4777
|
-
const t = new ft.DOMParser().parseFromString(e, "text/xml"), i = Bu(t), o = { ...Yu.options.gpx, ...r
|
|
4777
|
+
const t = new ft.DOMParser().parseFromString(e, "text/xml"), i = Bu(t), o = { ...Yu.options.gpx, ...r?.gpx };
|
|
4778
4778
|
switch (o.shape) {
|
|
4779
4779
|
case "object-row-table":
|
|
4780
4780
|
return {
|
|
@@ -4813,7 +4813,7 @@ const Ku = "4.4.3", Qu = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
4813
4813
|
}
|
|
4814
4814
|
};
|
|
4815
4815
|
function Lt(e, r) {
|
|
4816
|
-
const t = new ft.DOMParser().parseFromString(e, "text/xml"), i = ju(t), o = { ...Ju.options.kml, ...r
|
|
4816
|
+
const t = new ft.DOMParser().parseFromString(e, "text/xml"), i = ju(t), o = { ...Ju.options.kml, ...r?.kml };
|
|
4817
4817
|
switch (o.shape) {
|
|
4818
4818
|
case "geojson-table":
|
|
4819
4819
|
return {
|
|
@@ -4856,7 +4856,7 @@ const er = "4.4.3", tr = `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
4856
4856
|
}
|
|
4857
4857
|
};
|
|
4858
4858
|
function Ot(e, r) {
|
|
4859
|
-
const t = new ft.DOMParser().parseFromString(e, "text/xml"), i = Lu(t), o = { ...ur.options.tcx, ...r
|
|
4859
|
+
const t = new ft.DOMParser().parseFromString(e, "text/xml"), i = Lu(t), o = { ...ur.options.tcx, ...r?.tcx };
|
|
4860
4860
|
switch (o.shape) {
|
|
4861
4861
|
case "object-row-table":
|
|
4862
4862
|
return {
|