@dpuse/dpuse-tool-rust-csv-core-parser 0.1.46 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,64 +1,416 @@
1
- //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js
2
- var e = class extends Error {
1
+ //#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared.es.js
2
+ function e(e) {
3
+ return new Map(Object.entries(e));
4
+ }
5
+ var t = {
6
+ lang: void 0,
7
+ message: void 0,
8
+ abortEarly: void 0,
9
+ abortPipeEarly: void 0
10
+ };
11
+ /* @__NO_SIDE_EFFECTS__ */
12
+ function n(e) {
13
+ return e ? {
14
+ lang: e?.lang ?? void 0,
15
+ message: e?.message,
16
+ abortEarly: e?.abortEarly ?? void 0,
17
+ abortPipeEarly: e?.abortPipeEarly ?? void 0
18
+ } : t;
19
+ }
20
+ /* @__NO_SIDE_EFFECTS__ */
21
+ function r(e) {
22
+ let t = typeof e;
23
+ return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
24
+ }
25
+ function i(e, t, n, i, a) {
26
+ let o = a && "input" in a ? a.input : n.value, s = a?.expected ?? e.expects ?? null, c = a?.received ?? /* @__PURE__ */ r(o), l = {
27
+ kind: e.kind,
28
+ type: e.type,
29
+ input: o,
30
+ expected: s,
31
+ received: c,
32
+ message: `Invalid ${t}: ${s ? `Expected ${s} but r` : "R"}eceived ${c}`,
33
+ requirement: e.requirement,
34
+ path: a?.path,
35
+ issues: a?.issues,
36
+ lang: i.lang,
37
+ abortEarly: i.abortEarly,
38
+ abortPipeEarly: i.abortPipeEarly
39
+ }, u = e.kind === "schema", d = a?.message ?? e.message ?? (e.reference, l.lang, void 0) ?? (u ? (l.lang, void 0) : null) ?? i.message ?? (l.lang, void 0);
40
+ d !== void 0 && (l.message = typeof d == "function" ? d(l) : d), u && (n.typed = !1), n.issues ? n.issues.push(l) : n.issues = [l];
41
+ }
42
+ /* @__NO_SIDE_EFFECTS__ */
43
+ function a(e, t) {
44
+ return e === t || Number.isNaN(e) && Number.isNaN(t);
45
+ }
46
+ /* @__NO_SIDE_EFFECTS__ */
47
+ function o(e, t) {
48
+ let n = [...new Set(e)];
49
+ return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
50
+ }
51
+ function s(e) {
52
+ return e["~standard"] = {
53
+ version: 1,
54
+ vendor: "valibot",
55
+ validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ n())
56
+ }, e;
57
+ }
58
+ /* @__NO_SIDE_EFFECTS__ */
59
+ function c(e, t, n) {
60
+ return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
61
+ }
62
+ /* @__NO_SIDE_EFFECTS__ */
63
+ function l(e, t, n) {
64
+ return typeof e.default == "function" ? e.default(t, n) : e.default;
65
+ }
66
+ /* @__NO_SIDE_EFFECTS__ */
67
+ function u(e, t) {
68
+ return s({
69
+ kind: "schema",
70
+ type: "literal",
71
+ reference: u,
72
+ expects: /* @__PURE__ */ r(e),
73
+ async: !1,
74
+ literal: e,
75
+ message: t,
76
+ "~run"(e, t) {
77
+ return /* @__PURE__ */ a(e.value, this.literal) ? e.typed = !0 : i(this, "type", e, t), e;
78
+ }
79
+ });
80
+ }
81
+ /* @__NO_SIDE_EFFECTS__ */
82
+ function d(e, t) {
83
+ return s({
84
+ kind: "schema",
85
+ type: "nullable",
86
+ reference: d,
87
+ expects: `(${e.expects} | null)`,
88
+ async: !1,
89
+ wrapped: e,
90
+ default: t,
91
+ "~run"(e, t) {
92
+ return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ l(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
93
+ }
94
+ });
95
+ }
96
+ /* @__NO_SIDE_EFFECTS__ */
97
+ function f(e) {
98
+ return s({
99
+ kind: "schema",
100
+ type: "number",
101
+ reference: f,
102
+ expects: "number",
103
+ async: !1,
104
+ message: e,
105
+ "~run"(e, t) {
106
+ return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : i(this, "type", e, t), e;
107
+ }
108
+ });
109
+ }
110
+ /* @__NO_SIDE_EFFECTS__ */
111
+ function p(e, t) {
112
+ return s({
113
+ kind: "schema",
114
+ type: "optional",
115
+ reference: p,
116
+ expects: `(${e.expects} | undefined)`,
117
+ async: !1,
118
+ wrapped: e,
119
+ default: t,
120
+ "~run"(e, t) {
121
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ l(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
122
+ }
123
+ });
124
+ }
125
+ /* @__NO_SIDE_EFFECTS__ */
126
+ function m(e, t) {
127
+ return s({
128
+ kind: "schema",
129
+ type: "strict_object",
130
+ reference: m,
131
+ expects: "Object",
132
+ async: !1,
133
+ entries: e,
134
+ message: t,
135
+ "~run"(e, t) {
136
+ let n = e.value;
137
+ if (n && typeof n == "object") {
138
+ e.typed = !0, e.value = {};
139
+ for (let r in this.entries) {
140
+ let a = this.entries[r];
141
+ if (r in n || (a.type === "exact_optional" || a.type === "optional" || a.type === "nullish") && a.default !== void 0) {
142
+ let i = r in n ? n[r] : /* @__PURE__ */ l(a), o = a["~run"]({ value: i }, t);
143
+ if (o.issues) {
144
+ let a = {
145
+ type: "object",
146
+ origin: "value",
147
+ input: n,
148
+ key: r,
149
+ value: i
150
+ };
151
+ for (let t of o.issues) t.path ? t.path.unshift(a) : t.path = [a], e.issues?.push(t);
152
+ if (e.issues ||= o.issues, t.abortEarly) {
153
+ e.typed = !1;
154
+ break;
155
+ }
156
+ }
157
+ o.typed || (e.typed = !1), e.value[r] = o.value;
158
+ } else if (a.fallback !== void 0) e.value[r] = /* @__PURE__ */ c(a);
159
+ else if (a.type !== "exact_optional" && a.type !== "optional" && a.type !== "nullish" && (i(this, "key", e, t, {
160
+ input: void 0,
161
+ expected: `"${r}"`,
162
+ path: [{
163
+ type: "object",
164
+ origin: "key",
165
+ input: n,
166
+ key: r,
167
+ value: n[r]
168
+ }]
169
+ }), t.abortEarly)) break;
170
+ }
171
+ if (!e.issues || !t.abortEarly) {
172
+ for (let r in n) if (!Object.prototype.hasOwnProperty.call(this.entries, r)) {
173
+ i(this, "key", e, t, {
174
+ input: r,
175
+ expected: "never",
176
+ path: [{
177
+ type: "object",
178
+ origin: "key",
179
+ input: n,
180
+ key: r,
181
+ value: n[r]
182
+ }]
183
+ });
184
+ break;
185
+ }
186
+ }
187
+ } else i(this, "type", e, t);
188
+ return e;
189
+ }
190
+ });
191
+ }
192
+ /* @__NO_SIDE_EFFECTS__ */
193
+ function h(e) {
194
+ return s({
195
+ kind: "schema",
196
+ type: "string",
197
+ reference: h,
198
+ expects: "string",
199
+ async: !1,
200
+ message: e,
201
+ "~run"(e, t) {
202
+ return typeof e.value == "string" ? e.typed = !0 : i(this, "type", e, t), e;
203
+ }
204
+ });
205
+ }
206
+ /* @__NO_SIDE_EFFECTS__ */
207
+ function g(e) {
208
+ let t;
209
+ if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
210
+ else t = n.issues;
211
+ return t;
212
+ }
213
+ /* @__NO_SIDE_EFFECTS__ */
214
+ function _(e, t) {
215
+ return s({
216
+ kind: "schema",
217
+ type: "union",
218
+ reference: _,
219
+ expects: /* @__PURE__ */ o(e.map((e) => e.expects), "|"),
220
+ async: !1,
221
+ options: e,
222
+ message: t,
223
+ "~run"(e, t) {
224
+ let n, r, a;
225
+ for (let i of this.options) {
226
+ let o = i["~run"]({ value: e.value }, t);
227
+ if (o.typed) {
228
+ if (o.issues) r ? r.push(o) : r = [o];
229
+ else {
230
+ n = o;
231
+ break;
232
+ }
233
+ } else a ? a.push(o) : a = [o];
234
+ }
235
+ if (n) return n;
236
+ if (r) {
237
+ if (r.length === 1) return r[0];
238
+ i(this, "type", e, t, { issues: /* @__PURE__ */ g(r) }), e.typed = !0;
239
+ } else if (a?.length === 1) return a[0];
240
+ else i(this, "type", e, t, { issues: /* @__PURE__ */ g(a) });
241
+ return e;
242
+ }
243
+ });
244
+ }
245
+ var v = {
246
+ id: /* @__PURE__ */ h(),
247
+ label: /* @__PURE__ */ m({
248
+ en: /* @__PURE__ */ p(/* @__PURE__ */ h()),
249
+ es: /* @__PURE__ */ p(/* @__PURE__ */ h())
250
+ }),
251
+ description: /* @__PURE__ */ m({
252
+ en: /* @__PURE__ */ p(/* @__PURE__ */ h()),
253
+ es: /* @__PURE__ */ p(/* @__PURE__ */ h())
254
+ }),
255
+ icon: /* @__PURE__ */ d(/* @__PURE__ */ h()),
256
+ iconDark: /* @__PURE__ */ d(/* @__PURE__ */ h())
257
+ }, y = (e) => /* @__PURE__ */ _(e.map((e) => /* @__PURE__ */ u(e))), b = y([
258
+ "app",
259
+ "connector",
260
+ "connectorConnection",
261
+ "context",
262
+ "contextArea",
263
+ "contextModel",
264
+ "contextModelDimension",
265
+ "contextModelDimensionHierarchy",
266
+ "contextModelEntity",
267
+ "contextModelEntityDataItem",
268
+ "contextModelEntityEvent",
269
+ "contextModelEntityPrimaryMeasure",
270
+ "contextModelSecondaryMeasure",
271
+ "cookbook",
272
+ "cookbookRecipe",
273
+ "dataView",
274
+ "engine",
275
+ "eventQuery",
276
+ "presenter",
277
+ "presenterPresentation",
278
+ "tool"
279
+ ]), x = y([
280
+ "danger",
281
+ "success",
282
+ "warning"
283
+ ]), S = y([
284
+ "alpha",
285
+ "beta",
286
+ "releaseCandidate",
287
+ "generalAvailability"
288
+ ]), C = /* @__PURE__ */ m({
289
+ color: x,
290
+ label: /* @__PURE__ */ h()
291
+ }), w = {
292
+ ...v,
293
+ typeId: b
294
+ };
295
+ ({ ...w });
296
+ var T = {
297
+ ...w,
298
+ firstCreatedAt: /* @__PURE__ */ d(/* @__PURE__ */ f()),
299
+ lastUpdatedAt: /* @__PURE__ */ d(/* @__PURE__ */ f()),
300
+ status: /* @__PURE__ */ d(C),
301
+ statusId: /* @__PURE__ */ d(S)
302
+ };
303
+ ({ ...T }), e({ en: "Data Positioning Events" }), e({ en: "Delimited Text" }), e({ en: "JSON" }), e({ en: "SPSS" }), e({ en: "XLSX" }), e({ en: "XML" }), e({ en: "Newline" }), e({ en: "Carriage Return" }), e({ en: "Carriage Return/Newline" }), e({ en: "Colon" }), e({ en: "Comma" }), e({ en: "Exclamation Mark" }), e({ en: "Record Separator" }), e({ en: "Semicolon" }), e({ en: "Space" }), e({ en: "Tab" }), e({ en: "Underscore" }), e({ en: "Unit Separator" }), e({ en: "Vertical Bar" }), y([
304
+ "app",
305
+ "engine",
306
+ "connector",
307
+ "cookbook",
308
+ "presenter",
309
+ "tool"
310
+ ]);
311
+ var E = {
312
+ ...T,
313
+ vendorAccountURL: /* @__PURE__ */ d(/* @__PURE__ */ h()),
314
+ vendorDocumentationURL: /* @__PURE__ */ d(/* @__PURE__ */ h()),
315
+ vendorHomeURL: /* @__PURE__ */ d(/* @__PURE__ */ h()),
316
+ version: /* @__PURE__ */ h()
317
+ };
318
+ ({ ...E }), y([
319
+ "abortOperation",
320
+ "auditObjectContent",
321
+ "createObject",
322
+ "describeConnection",
323
+ "dropObject",
324
+ "findObject",
325
+ "getInfo",
326
+ "getReadableStream",
327
+ "getRecord",
328
+ "listNodes",
329
+ "previewObject",
330
+ "removeRecords",
331
+ "retrieveChunks",
332
+ "retrieveRecords",
333
+ "upsertRecords"
334
+ ]), y([
335
+ "application",
336
+ "curatedDataset",
337
+ "database",
338
+ "fileStore"
339
+ ]), y([
340
+ "bidirectional",
341
+ "destination",
342
+ "source",
343
+ "unknown"
344
+ ]), y([
345
+ "apiKey",
346
+ "disabled",
347
+ "oAuth2",
348
+ "none"
349
+ ]), { ...E }, y(["list"]), { ...E }, y([
350
+ "list",
351
+ "render",
352
+ "setColorMode"
353
+ ]), { ...E };
354
+ var D = class extends Error {
3
355
  data;
4
356
  locator;
5
357
  constructor(e, t, n, r) {
6
358
  super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
7
359
  }
8
- }, t = class extends e {
360
+ }, O = class extends D {
9
361
  constructor(e, t, n, r) {
10
362
  super(e, t, n, r), this.name = "ConnectorError";
11
363
  }
12
- }, n = {
364
+ }, k = {
13
365
  id: "rust-csv-core",
14
366
  name: "Rust CSV Core",
15
367
  version: "0.1.0"
16
- }, r = { rustBindingsPromise: void 0 }, i = class {
17
- config = n;
18
- async processWithTransferableStream(e, n = {}, r) {
19
- let i = await a(), o = n.delimiter?.codePointAt(0) ?? 44, s = n.hasHeaders ?? !0, c = performance.now(), l = 0, u = (e) => {
20
- l += e, r && r(e);
368
+ }, A = { rustBindingsPromise: void 0 }, j = class {
369
+ config = k;
370
+ async processWithTransferableStream(e, t = {}, n) {
371
+ let r = await M(), i = t.delimiter?.codePointAt(0) ?? 44, a = t.hasHeaders ?? !0, o = performance.now(), s = 0, c = (e) => {
372
+ s += e, n && n(e);
21
373
  };
22
374
  try {
23
- return await i.stream_csv(e, u, o, s), {
24
- processedRowCount: l,
375
+ return await r.stream_csv(e, c, i, a), {
376
+ processedRowCount: s,
25
377
  failedRowCount: 0,
26
- durationMs: performance.now() - c
378
+ durationMs: performance.now() - o
27
379
  };
28
380
  } catch (e) {
29
- throw new t("Failed to process CSV stream.", "dpuse-tool-rust-csv-core-parser|Tool|processWithTransferableStream", { cause: e });
381
+ throw new O("Failed to process CSV stream.", "dpuse-tool-rust-csv-core-parser|Tool|processWithTransferableStream", { cause: e });
30
382
  }
31
383
  }
32
- async processWithChunks(e, n = {}, r) {
33
- let { CsvSession: i } = await a(), o = n.delimiter?.codePointAt(0) ?? 44, s = n.hasHeaders ?? !0, c = performance.now(), l = 0, u = new i(o, s);
384
+ async processWithChunks(e, t = {}, n) {
385
+ let { CsvSession: r } = await M(), i = t.delimiter?.codePointAt(0) ?? 44, a = t.hasHeaders ?? !0, o = performance.now(), s = 0, c = new r(i, a);
34
386
  try {
35
387
  let t = e.getReader();
36
388
  try {
37
389
  for (;;) {
38
- let { value: e, done: n } = await t.read();
39
- if (n) break;
40
- let i = u.pushChunk(e), a = Array.isArray(i) ? i.length : 0;
41
- l += a, r && a > 0 && r(a);
390
+ let { value: e, done: r } = await t.read();
391
+ if (r) break;
392
+ let i = c.pushChunk(e), a = Array.isArray(i) ? i.length : 0;
393
+ s += a, n && a > 0 && n(a);
42
394
  }
43
- let e = u.finish(), n = Array.isArray(e) ? e.length : 0;
44
- return l += n, r && n > 0 && r(n), {
45
- processedRowCount: l,
395
+ let e = c.finish(), r = Array.isArray(e) ? e.length : 0;
396
+ return s += r, n && r > 0 && n(r), {
397
+ processedRowCount: s,
46
398
  failedRowCount: 0,
47
- durationMs: performance.now() - c
399
+ durationMs: performance.now() - o
48
400
  };
49
401
  } finally {
50
402
  t.releaseLock();
51
403
  }
52
404
  } catch (e) {
53
- throw new t("Failed to process CSV chunks.", "dpuse-tool-rust-csv-core-parser|Tool|processWithChunks", { cause: e });
405
+ throw new O("Failed to process CSV chunks.", "dpuse-tool-rust-csv-core-parser|Tool|processWithChunks", { cause: e });
54
406
  }
55
407
  }
56
408
  };
57
- async function a() {
58
- return r.rustBindingsPromise ??= (async () => {
59
- let e = await import("./dpuse_tool_rust_csv_core_parser-b_YDk4hv.js");
409
+ async function M() {
410
+ return A.rustBindingsPromise ??= (async () => {
411
+ let e = await import("./dpuse_tool_rust_csv_core_parser-DcrBtHMJ.js");
60
412
  return await e.default(), e;
61
- })(), r.rustBindingsPromise;
413
+ })(), A.rustBindingsPromise;
62
414
  }
63
415
  //#endregion
64
- export { i as Tool, n as config };
416
+ export { j as Tool, k as config };
@@ -1 +1 @@
1
- {"version":3,"file":"dpuse-tool-rust-csv-core-parser.es.js","names":[],"sources":["../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js","../src/index.ts"],"sourcesContent":["//#region src/errors/index.ts\nvar e = 2048, t = class extends Error {\n\tdata;\n\tlocator;\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, r), this.name = \"DPUseError\", this.data = n, this.locator = t;\n\t}\n}, n = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"AppError\";\n\t}\n}, r = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"APIError\";\n\t}\n}, i = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"EngineError\";\n\t}\n}, a = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"ConnectorError\";\n\t}\n}, o = class extends t {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"FetchError\";\n\t}\n};\nasync function s(e, t, n) {\n\tlet r = ` - ${e.statusText}`, i = `${t} Response status '${String(e.status)}${e.statusText ? r : \"\"}' received.`, a;\n\ttry {\n\t\ta = await e.text();\n\t} catch (e) {\n\t\ta = `<body unavailable: ${u(e).message}>`;\n\t}\n\treturn new o(i, n, { body: h(a) });\n}\nfunction c(e) {\n\treturn e.map((e) => e.message).join(\" \");\n}\nfunction l(e) {\n\ttry {\n\t\te();\n\t} catch {}\n}\nfunction u(e) {\n\tif (e instanceof Error) return e;\n\tif (typeof e == \"string\") return Error(e);\n\tif (typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"bigint\") return Error(String(e));\n\tif (typeof e == \"symbol\") return Error(e.description ?? \"Unknown error\");\n\tif (typeof e == \"object\") try {\n\t\treturn Error(JSON.stringify(e));\n\t} catch {\n\t\treturn /* @__PURE__ */ Error(\"Unknown error\");\n\t}\n\treturn /* @__PURE__ */ Error(\"Unknown error\");\n}\nfunction d(e) {\n\tlet t = /* @__PURE__ */ new Set(), n = [], r = u(e);\n\tfor (; r != null && !t.has(r);) {\n\t\tt.add(r);\n\t\tlet [e, i] = g(r);\n\t\t/(?:\\.{3}|[.!?])$/.test(e.message) || (e.message += \".\"), n.push(e), r = i;\n\t}\n\treturn n;\n}\nfunction f(e) {\n\tlet t;\n\tfor (let n of e.toReversed()) {\n\t\tlet e = m(n, t);\n\t\tn.stack !== void 0 && (e.stack = n.stack), t = e;\n\t}\n\treturn t ?? /* @__PURE__ */ Error(\"No error to unserialise.\");\n}\nfunction p(e) {\n\tlet t;\n\ttry {\n\t\tt = JSON.stringify(e);\n\t} catch {\n\t\tt = typeof e == \"symbol\" ? e.description ?? \"Unknown error\" : typeof e == \"bigint\" ? e.toString() : \"Unknown error\";\n\t}\n\treturn t === \"\" && (t = \"Unknown error\"), t;\n}\nfunction m(e, t) {\n\tswitch (e.name) {\n\t\tcase \"APIError\": return new r(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"AppError\": return new n(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"ConnectorError\": return new a(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"EngineError\": return new i(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"FetchError\": return new o(e.message, e.locator, e.data, { cause: t });\n\t\tdefault: {\n\t\t\tlet n = e.name;\n\t\t\treturn new class extends Error {\n\t\t\t\tname = n;\n\t\t\t}(e.message, { cause: t });\n\t\t}\n\t}\n}\nfunction h(t) {\n\tif (t != null && t !== \"\") return t.length > e ? `${t.slice(0, e)}... [truncated]` : t;\n}\nfunction g(e) {\n\tlet n = e.cause == null ? null : u(e.cause);\n\tif (e instanceof t) return [{\n\t\tdata: e.data,\n\t\tlocator: e.locator,\n\t\tmessage: e.message,\n\t\tname: e.name,\n\t\tstack: e.stack\n\t}, n];\n\tlet r = Object.fromEntries(Object.entries(e).filter(([e]) => e !== \"cause\"));\n\treturn e.name ? [{\n\t\tdata: r,\n\t\tlocator: \"\",\n\t\tmessage: e.message,\n\t\tname: e.name,\n\t\tstack: e.stack\n\t}, n] : [{\n\t\tdata: r,\n\t\tlocator: \"\",\n\t\tmessage: p(e),\n\t\tname: \"Error\",\n\t\tstack: void 0\n\t}, null];\n}\n//#endregion\nexport { r as APIError, n as AppError, a as ConnectorError, t as DPUseError, i as EngineError, o as FetchError, s as buildFetchError, c as concatenateSerialisedErrorMessages, l as ignoreErrors, u as normalizeToError, d as serialiseError, f as unserialiseError };\n","/**\n * CSV Core Tool with Rust/WASM processing.\n *\n * Provides high-performance CSV parsing with two modes:\n * - Stream mode: For browsers supporting transferable ReadableStreams (Chromium)\n * - Chunk mode: For browsers without transferable stream support (Safari)\n */\n\n// Framework dependencies.\nimport { ConnectorError } from '@dpuse/dpuse-shared/errors'; // TODO: This should be Module or Tool error?\n\n// Tool dependencies - types.\nimport type * as RustModule from '../rust/dpuse_tool_rust_csv_core_parser/pkg/dpuse_tool_rust_csv_core_parser.js';\n\n/**\n * Tool configuration.\n */\nexport const config = {\n id: 'rust-csv-core',\n name: 'Rust CSV Core',\n version: '0.1.0'\n} as const;\n\n/**\n * Rust bindings type.\n */\ntype RustBindings = typeof RustModule;\n\n/**\n * Module state.\n */\nconst state: { rustBindingsPromise: Promise<RustBindings> | undefined } = {\n rustBindingsPromise: undefined\n};\n\n/**\n * CSV processing options.\n */\nexport interface CsvProcessingOptions {\n delimiter?: string;\n hasHeaders?: boolean;\n}\n\n/**\n * CSV processing result summary.\n */\nexport interface CsvProcessingSummary {\n processedRowCount: number;\n failedRowCount: number;\n durationMs?: number;\n}\n\n/**\n * Tool class implementing CSV parsing with Rust core.\n */\nclass Tool {\n readonly config = config;\n\n /**\n * Process CSV data using transferable ReadableStream (Chromium path).\n */\n async processWithTransferableStream(\n stream: ReadableStream<Uint8Array>,\n options: CsvProcessingOptions = {},\n onProgress?: (rowCount: number) => void\n ): Promise<CsvProcessingSummary> {\n const xxxx = await loadRustBindings();\n const delimiter = options.delimiter?.codePointAt(0) ?? 44; // Default comma\n const hasHeaders = options.hasHeaders ?? true;\n\n const startTime = performance.now();\n let processedRowCount = 0;\n\n const progressCallback = (count: number): void => {\n processedRowCount += count;\n if (onProgress) onProgress(count);\n };\n\n try {\n await xxxx.stream_csv(stream, progressCallback, delimiter, hasHeaders);\n return {\n processedRowCount,\n failedRowCount: 0,\n durationMs: performance.now() - startTime\n };\n } catch (error) {\n throw new ConnectorError('Failed to process CSV stream.', 'dpuse-tool-rust-csv-core-parser|Tool|processWithTransferableStream', { cause: error });\n }\n }\n\n /**\n * Process CSV data using chunk-by-chunk approach (Safari fallback).\n */\n async processWithChunks(stream: ReadableStream<Uint8Array>, options: CsvProcessingOptions = {}, onProgress?: (rowCount: number) => void): Promise<CsvProcessingSummary> {\n const { CsvSession } = await loadRustBindings();\n const delimiter = options.delimiter?.codePointAt(0) ?? 44;\n const hasHeaders = options.hasHeaders ?? true;\n\n const startTime = performance.now();\n let processedRowCount = 0;\n const session = new CsvSession(delimiter, hasHeaders);\n\n try {\n const reader = stream.getReader();\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n\n // if (value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const rows = session.pushChunk(value);\n const count = Array.isArray(rows) ? rows.length : 0;\n processedRowCount += count;\n if (onProgress && count > 0) onProgress(count);\n // }\n }\n\n // Finish processing\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const remainingRows = session.finish();\n const remainingCount = Array.isArray(remainingRows) ? remainingRows.length : 0;\n processedRowCount += remainingCount;\n if (onProgress && remainingCount > 0) onProgress(remainingCount);\n\n return {\n processedRowCount,\n failedRowCount: 0,\n durationMs: performance.now() - startTime\n };\n } finally {\n reader.releaseLock();\n }\n } catch (error) {\n throw new ConnectorError('Failed to process CSV chunks.', 'dpuse-tool-rust-csv-core-parser|Tool|processWithChunks', { cause: error });\n }\n }\n}\n\n/**\n * Load Rust bindings lazily.\n */\nasync function loadRustBindings(): Promise<RustBindings> {\n state.rustBindingsPromise ??= (async () => {\n const module = await import('../rust/dpuse_tool_rust_csv_core_parser/pkg/dpuse_tool_rust_csv_core_parser.js');\n await module.default();\n return module;\n })();\n return state.rustBindingsPromise;\n}\n\n// Exposures.\nexport { Tool };\n"],"x_google_ignoreList":[0],"mappings":";AACc,IAAA,IAAI,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;KAC1C,IAAI,GAAM;KAIV,IAAM,IAAO,EAAQ,UAAU,CAAK,GAC9B,IAAQ,MAAM,QAAQ,CAAI,IAAI,EAAK,SAAS;KAElD,AADA,KAAqB,GACjB,KAAc,IAAQ,KAAG,EAAW,CAAK;IAEjD;IAIA,IAAM,IAAgB,EAAQ,OAAO,GAC/B,IAAiB,MAAM,QAAQ,CAAa,IAAI,EAAc,SAAS;IAI7E,OAHA,KAAqB,GACjB,KAAc,IAAiB,KAAG,EAAW,CAAc,GAExD;KACH;KACA,gBAAgB;KAChB,YAAY,YAAY,IAAI,IAAI;IACpC;GACJ,UAAU;IACN,EAAO,YAAY;GACvB;EACJ,SAAS,GAAO;GACZ,MAAM,IAAI,EAAe,iCAAiC,0DAA0D,EAAE,OAAO,EAAM,CAAC;EACxI;CACJ;AACJ;AAKA,eAAe,IAA0C;CAMrD,OALA,EAAM,yBAAyB,YAAY;EACvC,IAAM,IAAS,MAAM,OAAO;EAE5B,OADA,MAAM,EAAO,QAAQ,GACd;CACX,EAAA,CAAG,GACI,EAAM;AACjB"}
1
+ {"version":3,"file":"dpuse-tool-rust-csv-core-parser.es.js","names":["ConnectorError","n","i","a","o","s","r","c","u","d","ee","f","h","g","_","v","b","x","S","C","te","T","ne","re","ie","ae","E","O","k","L","V","config","state","Tool","xxxx","loadRustBindings","delimiter","options","hasHeaders","startTime","processedRowCount","progressCallback","count","onProgress","stream","error","session","CsvSession","reader","done","rows","value","remainingRows","remainingCount","module"],"sources":["../node_modules/@dpuse/dpuse-shared/dist/dpuse-shared.es.js","../src/index.ts"],"sourcesContent":["//#region src/locale/label.ts\nvar e = \"en\", t = [{\n\tid: \"en\",\n\tflag: \"gb\",\n\tlabel: \"English\"\n}, {\n\tid: \"es\",\n\tflag: \"es\",\n\tlabel: \"Español\"\n}];\nfunction n(e) {\n\treturn new Map(Object.entries(e));\n}\nfunction r(e, t, n = \"en\") {\n\tlet r = e.get(t);\n\treturn r === void 0 ? n === t ? void 0 : e.get(n) : r;\n}\n//#endregion\n//#region node_modules/valibot/dist/index.mjs\nvar i = {\n\tlang: void 0,\n\tmessage: void 0,\n\tabortEarly: void 0,\n\tabortPipeEarly: void 0\n};\n/* @__NO_SIDE_EFFECTS__ */\nfunction a(e) {\n\treturn e ? {\n\t\tlang: e?.lang ?? void 0,\n\t\tmessage: e?.message,\n\t\tabortEarly: e?.abortEarly ?? void 0,\n\t\tabortPipeEarly: e?.abortPipeEarly ?? void 0\n\t} : i;\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction o(e) {\n\tlet t = typeof e;\n\treturn t === \"string\" ? `\"${e}\"` : t === \"number\" || t === \"bigint\" || t === \"boolean\" ? `${e}` : t === \"object\" || t === \"function\" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? \"null\" : t;\n}\nfunction s(e, t, n, r, i) {\n\tlet a = i && \"input\" in i ? i.input : n.value, s = i?.expected ?? e.expects ?? null, c = i?.received ?? /* @__PURE__ */ o(a), l = {\n\t\tkind: e.kind,\n\t\ttype: e.type,\n\t\tinput: a,\n\t\texpected: s,\n\t\treceived: c,\n\t\tmessage: `Invalid ${t}: ${s ? `Expected ${s} but r` : \"R\"}eceived ${c}`,\n\t\trequirement: e.requirement,\n\t\tpath: i?.path,\n\t\tissues: i?.issues,\n\t\tlang: r.lang,\n\t\tabortEarly: r.abortEarly,\n\t\tabortPipeEarly: r.abortPipeEarly\n\t}, u = e.kind === \"schema\", d = i?.message ?? e.message ?? (e.reference, l.lang, void 0) ?? (u ? (l.lang, void 0) : null) ?? r.message ?? (l.lang, void 0);\n\td !== void 0 && (l.message = typeof d == \"function\" ? d(l) : d), u && (n.typed = !1), n.issues ? n.issues.push(l) : n.issues = [l];\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction c(e, t) {\n\treturn e === t || Number.isNaN(e) && Number.isNaN(t);\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction l(e, t) {\n\treturn Object.prototype.hasOwnProperty.call(e, t) && t !== \"__proto__\" && t !== \"prototype\" && t !== \"constructor\";\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction u(e, t) {\n\tlet n = [...new Set(e)];\n\treturn n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? \"never\";\n}\nfunction d(e) {\n\treturn e[\"~standard\"] = {\n\t\tversion: 1,\n\t\tvendor: \"valibot\",\n\t\tvalidate: (t) => e[\"~run\"]({ value: t }, /* @__PURE__ */ a())\n\t}, e;\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction ee(e, t, n) {\n\treturn typeof e.fallback == \"function\" ? e.fallback(t, n) : e.fallback;\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction f(e, t, n) {\n\treturn typeof e.default == \"function\" ? e.default(t, n) : e.default;\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction p(e, t) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"array\",\n\t\treference: p,\n\t\texpects: \"Array\",\n\t\tasync: !1,\n\t\titem: e,\n\t\tmessage: t,\n\t\t\"~run\"(e, t) {\n\t\t\tlet n = e.value;\n\t\t\tif (Array.isArray(n)) {\n\t\t\t\te.typed = !0, e.value = [];\n\t\t\t\tfor (let r = 0; r < n.length; r++) {\n\t\t\t\t\tlet i = n[r], a = this.item[\"~run\"]({ value: i }, t);\n\t\t\t\t\tif (a.issues) {\n\t\t\t\t\t\tlet o = {\n\t\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: n,\n\t\t\t\t\t\t\tkey: r,\n\t\t\t\t\t\t\tvalue: i\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let t of a.issues) t.path ? t.path.unshift(o) : t.path = [o], e.issues?.push(t);\n\t\t\t\t\t\tif (e.issues ||= a.issues, t.abortEarly) {\n\t\t\t\t\t\t\te.typed = !1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ta.typed || (e.typed = !1), e.value.push(a.value);\n\t\t\t\t}\n\t\t\t} else s(this, \"type\", e, t);\n\t\t\treturn e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction m(e) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"boolean\",\n\t\treference: m,\n\t\texpects: \"boolean\",\n\t\tasync: !1,\n\t\tmessage: e,\n\t\t\"~run\"(e, t) {\n\t\t\treturn typeof e.value == \"boolean\" ? e.typed = !0 : s(this, \"type\", e, t), e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction h(e, t) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"literal\",\n\t\treference: h,\n\t\texpects: /* @__PURE__ */ o(e),\n\t\tasync: !1,\n\t\tliteral: e,\n\t\tmessage: t,\n\t\t\"~run\"(e, t) {\n\t\t\treturn /* @__PURE__ */ c(e.value, this.literal) ? e.typed = !0 : s(this, \"type\", e, t), e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction g(e, t) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"nullable\",\n\t\treference: g,\n\t\texpects: `(${e.expects} | null)`,\n\t\tasync: !1,\n\t\twrapped: e,\n\t\tdefault: t,\n\t\t\"~run\"(e, t) {\n\t\t\treturn e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ f(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped[\"~run\"](e, t);\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction _(e) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"number\",\n\t\treference: _,\n\t\texpects: \"number\",\n\t\tasync: !1,\n\t\tmessage: e,\n\t\t\"~run\"(e, t) {\n\t\t\treturn typeof e.value == \"number\" && !isNaN(e.value) ? e.typed = !0 : s(this, \"type\", e, t), e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction v(e, t) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"optional\",\n\t\treference: v,\n\t\texpects: `(${e.expects} | undefined)`,\n\t\tasync: !1,\n\t\twrapped: e,\n\t\tdefault: t,\n\t\t\"~run\"(e, t) {\n\t\t\treturn e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ f(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped[\"~run\"](e, t);\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction y(e, t, n) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"record\",\n\t\treference: y,\n\t\texpects: \"Object\",\n\t\tasync: !1,\n\t\tkey: e,\n\t\tvalue: t,\n\t\tmessage: n,\n\t\t\"~run\"(e, t) {\n\t\t\tlet n = e.value;\n\t\t\tif (n && typeof n == \"object\") {\n\t\t\t\te.typed = !0, e.value = {};\n\t\t\t\tfor (let r in n) if (/* @__PURE__ */ l(n, r)) {\n\t\t\t\t\tlet i = n[r], a = this.key[\"~run\"]({ value: r }, t);\n\t\t\t\t\tif (a.issues) {\n\t\t\t\t\t\tlet o = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput: n,\n\t\t\t\t\t\t\tkey: r,\n\t\t\t\t\t\t\tvalue: i\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let t of a.issues) t.path = [o], e.issues?.push(t);\n\t\t\t\t\t\tif (e.issues ||= a.issues, t.abortEarly) {\n\t\t\t\t\t\t\te.typed = !1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet o = this.value[\"~run\"]({ value: i }, t);\n\t\t\t\t\tif (o.issues) {\n\t\t\t\t\t\tlet a = {\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\tinput: n,\n\t\t\t\t\t\t\tkey: r,\n\t\t\t\t\t\t\tvalue: i\n\t\t\t\t\t\t};\n\t\t\t\t\t\tfor (let t of o.issues) t.path ? t.path.unshift(a) : t.path = [a], e.issues?.push(t);\n\t\t\t\t\t\tif (e.issues ||= o.issues, t.abortEarly) {\n\t\t\t\t\t\t\te.typed = !1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t(!a.typed || !o.typed) && (e.typed = !1), a.typed && (e.value[a.value] = o.value);\n\t\t\t\t}\n\t\t\t} else s(this, \"type\", e, t);\n\t\t\treturn e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction b(e, t) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"strict_object\",\n\t\treference: b,\n\t\texpects: \"Object\",\n\t\tasync: !1,\n\t\tentries: e,\n\t\tmessage: t,\n\t\t\"~run\"(e, t) {\n\t\t\tlet n = e.value;\n\t\t\tif (n && typeof n == \"object\") {\n\t\t\t\te.typed = !0, e.value = {};\n\t\t\t\tfor (let r in this.entries) {\n\t\t\t\t\tlet i = this.entries[r];\n\t\t\t\t\tif (r in n || (i.type === \"exact_optional\" || i.type === \"optional\" || i.type === \"nullish\") && i.default !== void 0) {\n\t\t\t\t\t\tlet a = r in n ? n[r] : /* @__PURE__ */ f(i), o = i[\"~run\"]({ value: a }, t);\n\t\t\t\t\t\tif (o.issues) {\n\t\t\t\t\t\t\tlet i = {\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"value\",\n\t\t\t\t\t\t\t\tinput: n,\n\t\t\t\t\t\t\t\tkey: r,\n\t\t\t\t\t\t\t\tvalue: a\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tfor (let t of o.issues) t.path ? t.path.unshift(i) : t.path = [i], e.issues?.push(t);\n\t\t\t\t\t\t\tif (e.issues ||= o.issues, t.abortEarly) {\n\t\t\t\t\t\t\t\te.typed = !1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\to.typed || (e.typed = !1), e.value[r] = o.value;\n\t\t\t\t\t} else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ ee(i);\n\t\t\t\t\telse if (i.type !== \"exact_optional\" && i.type !== \"optional\" && i.type !== \"nullish\" && (s(this, \"key\", e, t, {\n\t\t\t\t\t\tinput: void 0,\n\t\t\t\t\t\texpected: `\"${r}\"`,\n\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\tinput: n,\n\t\t\t\t\t\t\tkey: r,\n\t\t\t\t\t\t\tvalue: n[r]\n\t\t\t\t\t\t}]\n\t\t\t\t\t}), t.abortEarly)) break;\n\t\t\t\t}\n\t\t\t\tif (!e.issues || !t.abortEarly) {\n\t\t\t\t\tfor (let r in n) if (!Object.prototype.hasOwnProperty.call(this.entries, r)) {\n\t\t\t\t\t\ts(this, \"key\", e, t, {\n\t\t\t\t\t\t\tinput: r,\n\t\t\t\t\t\t\texpected: \"never\",\n\t\t\t\t\t\t\tpath: [{\n\t\t\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t\t\torigin: \"key\",\n\t\t\t\t\t\t\t\tinput: n,\n\t\t\t\t\t\t\t\tkey: r,\n\t\t\t\t\t\t\t\tvalue: n[r]\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else s(this, \"type\", e, t);\n\t\t\treturn e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction x(e) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"string\",\n\t\treference: x,\n\t\texpects: \"string\",\n\t\tasync: !1,\n\t\tmessage: e,\n\t\t\"~run\"(e, t) {\n\t\t\treturn typeof e.value == \"string\" ? e.typed = !0 : s(this, \"type\", e, t), e;\n\t\t}\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction S(e) {\n\tlet t;\n\tif (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);\n\telse t = n.issues;\n\treturn t;\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction C(e, t) {\n\treturn d({\n\t\tkind: \"schema\",\n\t\ttype: \"union\",\n\t\treference: C,\n\t\texpects: /* @__PURE__ */ u(e.map((e) => e.expects), \"|\"),\n\t\tasync: !1,\n\t\toptions: e,\n\t\tmessage: t,\n\t\t\"~run\"(e, t) {\n\t\t\tlet n, r, i;\n\t\t\tfor (let a of this.options) {\n\t\t\t\tlet o = a[\"~run\"]({ value: e.value }, t);\n\t\t\t\tif (o.typed) {\n\t\t\t\t\tif (o.issues) r ? r.push(o) : r = [o];\n\t\t\t\t\telse {\n\t\t\t\t\t\tn = o;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else i ? i.push(o) : i = [o];\n\t\t\t}\n\t\t\tif (n) return n;\n\t\t\tif (r) {\n\t\t\t\tif (r.length === 1) return r[0];\n\t\t\t\ts(this, \"type\", e, t, { issues: /* @__PURE__ */ S(r) }), e.typed = !0;\n\t\t\t} else if (i?.length === 1) return i[0];\n\t\t\telse s(this, \"type\", e, t, { issues: /* @__PURE__ */ S(i) });\n\t\t\treturn e;\n\t\t}\n\t});\n}\n//#endregion\n//#region src/locale/locale.schema.ts\nvar w = /* @__PURE__ */ b({\n\ten: /* @__PURE__ */ x(),\n\tes: /* @__PURE__ */ x()\n}), te = {\n\tid: /* @__PURE__ */ x(),\n\tlabel: /* @__PURE__ */ b({\n\t\ten: /* @__PURE__ */ v(/* @__PURE__ */ x()),\n\t\tes: /* @__PURE__ */ v(/* @__PURE__ */ x())\n\t}),\n\tdescription: /* @__PURE__ */ b({\n\t\ten: /* @__PURE__ */ v(/* @__PURE__ */ x()),\n\t\tes: /* @__PURE__ */ v(/* @__PURE__ */ x())\n\t}),\n\ticon: /* @__PURE__ */ g(/* @__PURE__ */ x()),\n\ticonDark: /* @__PURE__ */ g(/* @__PURE__ */ x())\n}, T = (e) => /* @__PURE__ */ C(e.map((e) => /* @__PURE__ */ h(e))), ne = T([\n\t\"app\",\n\t\"connector\",\n\t\"connectorConnection\",\n\t\"context\",\n\t\"contextArea\",\n\t\"contextModel\",\n\t\"contextModelDimension\",\n\t\"contextModelDimensionHierarchy\",\n\t\"contextModelEntity\",\n\t\"contextModelEntityDataItem\",\n\t\"contextModelEntityEvent\",\n\t\"contextModelEntityPrimaryMeasure\",\n\t\"contextModelSecondaryMeasure\",\n\t\"cookbook\",\n\t\"cookbookRecipe\",\n\t\"dataView\",\n\t\"engine\",\n\t\"eventQuery\",\n\t\"presenter\",\n\t\"presenterPresentation\",\n\t\"tool\"\n]), re = T([\n\t\"danger\",\n\t\"success\",\n\t\"warning\"\n]), ie = T([\n\t\"alpha\",\n\t\"beta\",\n\t\"releaseCandidate\",\n\t\"generalAvailability\"\n]), ae = /* @__PURE__ */ b({\n\tcolor: re,\n\tlabel: /* @__PURE__ */ x()\n}), E = {\n\t...te,\n\ttypeId: ne\n}, D = /* @__PURE__ */ b({\n\t...E,\n\torder: /* @__PURE__ */ _(),\n\tpath: /* @__PURE__ */ x()\n}), O = {\n\t...E,\n\tfirstCreatedAt: /* @__PURE__ */ g(/* @__PURE__ */ _()),\n\tlastUpdatedAt: /* @__PURE__ */ g(/* @__PURE__ */ _()),\n\tstatus: /* @__PURE__ */ g(ae),\n\tstatusId: /* @__PURE__ */ g(ie)\n}, oe = /* @__PURE__ */ b({ ...O }), se = [\n\t{\n\t\tid: \"alpha\",\n\t\tcolor: \"danger\",\n\t\tlabels: {\n\t\t\ten: \"alpha\",\n\t\t\tes: \"alfa\"\n\t\t}\n\t},\n\t{\n\t\tid: \"beta\",\n\t\tcolor: \"warning\",\n\t\tlabels: {\n\t\t\ten: \"beta\",\n\t\t\tes: \"beta\"\n\t\t}\n\t},\n\t{\n\t\tid: \"releaseCandidate\",\n\t\tcolor: \"success\",\n\t\tlabels: {\n\t\t\ten: \"release-candidate\",\n\t\t\tes: \"candidato-de-lanzamiento\"\n\t\t}\n\t},\n\t{\n\t\tid: \"generalAvailability\",\n\t\tcolor: \"success\",\n\t\tlabels: {\n\t\t\ten: \"\",\n\t\t\tes: \"\"\n\t\t}\n\t}\n];\nfunction ce(e, t = \"en\") {\n\tlet n = se.find((t) => t.id === e);\n\tif (n) {\n\t\tlet e = n.labels[t] ?? n.labels.en ?? n.id;\n\t\treturn {\n\t\t\tcolor: n.color,\n\t\t\tlabel: e\n\t\t};\n\t}\n\treturn {\n\t\tcolor: \"danger\",\n\t\tlabel: e\n\t};\n}\n//#endregion\n//#region src/component/dataView/index.ts\nn({ en: \"Data Positioning Events\" }), n({ en: \"Delimited Text\" }), n({ en: \"JSON\" }), n({ en: \"SPSS\" }), n({ en: \"XLSX\" }), n({ en: \"XML\" });\nvar le = [\n\t\",\",\n\t\";\",\n\t\"\t\",\n\t\"|\",\n\t\" \",\n\t\":\",\n\t\"_\",\n\t\"!\",\n\t\"0x1F\",\n\t\"0x1E\"\n];\nn({ en: \"Newline\" }), n({ en: \"Carriage Return\" }), n({ en: \"Carriage Return/Newline\" }), n({ en: \"Colon\" }), n({ en: \"Comma\" }), n({ en: \"Exclamation Mark\" }), n({ en: \"Record Separator\" }), n({ en: \"Semicolon\" }), n({ en: \"Space\" }), n({ en: \"Tab\" }), n({ en: \"Underscore\" }), n({ en: \"Unit Separator\" }), n({ en: \"Vertical Bar\" }), T([\n\t\"app\",\n\t\"engine\",\n\t\"connector\",\n\t\"cookbook\",\n\t\"presenter\",\n\t\"tool\"\n]);\n//#endregion\n//#region src/component/module/moduleConfig.schema.ts\nvar k = {\n\t...O,\n\tvendorAccountURL: /* @__PURE__ */ g(/* @__PURE__ */ x()),\n\tvendorDocumentationURL: /* @__PURE__ */ g(/* @__PURE__ */ x()),\n\tvendorHomeURL: /* @__PURE__ */ g(/* @__PURE__ */ x()),\n\tversion: /* @__PURE__ */ x()\n};\n({ ...k });\n//#endregion\n//#region src/component/module/connector/connectorConfig.schema.ts\nvar ue = T([\n\t\"abortOperation\",\n\t\"auditObjectContent\",\n\t\"createObject\",\n\t\"describeConnection\",\n\t\"dropObject\",\n\t\"findObject\",\n\t\"getInfo\",\n\t\"getReadableStream\",\n\t\"getRecord\",\n\t\"listNodes\",\n\t\"previewObject\",\n\t\"removeRecords\",\n\t\"retrieveChunks\",\n\t\"retrieveRecords\",\n\t\"upsertRecords\"\n]), de = T([\n\t\"application\",\n\t\"curatedDataset\",\n\t\"database\",\n\t\"fileStore\"\n]), fe = /* @__PURE__ */ b({ label: w }), pe = T([\n\t\"bidirectional\",\n\t\"destination\",\n\t\"source\",\n\t\"unknown\"\n]), me = /* @__PURE__ */ b({ label: w }), he = /* @__PURE__ */ b({\n\tauthMethodId: T([\n\t\t\"apiKey\",\n\t\t\"disabled\",\n\t\t\"oAuth2\",\n\t\t\"none\"\n\t]),\n\tactiveConnectionCount: /* @__PURE__ */ v(/* @__PURE__ */ _()),\n\tcanDescribe: /* @__PURE__ */ v(/* @__PURE__ */ m()),\n\tid: /* @__PURE__ */ v(/* @__PURE__ */ x()),\n\tlabel: /* @__PURE__ */ v(w),\n\tmaxConnectionCount: /* @__PURE__ */ g(/* @__PURE__ */ _()),\n\tparams: /* @__PURE__ */ v(/* @__PURE__ */ p(/* @__PURE__ */ y(/* @__PURE__ */ x(), /* @__PURE__ */ x())))\n}), ge = /* @__PURE__ */ b({\n\t...k,\n\ttypeId: /* @__PURE__ */ h(\"connector\"),\n\tactionNames: /* @__PURE__ */ p(ue),\n\tcategory: /* @__PURE__ */ g(fe),\n\tcategoryId: de,\n\timplementations: /* @__PURE__ */ y(/* @__PURE__ */ x(), he),\n\tusage: /* @__PURE__ */ g(me),\n\tusageId: /* @__PURE__ */ g(pe)\n}), _e = [\n\t{\n\t\tid: \"application\",\n\t\tlabel: {\n\t\t\ten: \"Application\",\n\t\t\tes: \"Aplicación\"\n\t\t}\n\t},\n\t{\n\t\tid: \"curatedDataset\",\n\t\tlabel: {\n\t\t\ten: \"Curated Dataset\",\n\t\t\tes: \"Conjunto de Datos Curado\"\n\t\t}\n\t},\n\t{\n\t\tid: \"database\",\n\t\tlabel: {\n\t\t\ten: \"Database\",\n\t\t\tes: \"Base de Datos\"\n\t\t}\n\t},\n\t{\n\t\tid: \"fileStore\",\n\t\tlabel: {\n\t\t\ten: \"File Store\",\n\t\t\tes: \"Almacén de Archivos\"\n\t\t}\n\t}\n], A = {\n\tabortOperation: \"Abort Operation\",\n\tauditObjectContent: \"Audit Object Content\",\n\tcreateObject: \"Create Object\",\n\tdescribeConnection: \"Describe Connection\",\n\tdropObject: \"Drop Object\",\n\tfindObject: \"Find Object\",\n\tgetInfo: \"Get Info\",\n\tgetReadableStream: \"Get Readable Stream\",\n\tgetRecord: \"Get Record\",\n\tlistNodes: \"List Nodes\",\n\tpreviewObject: \"Preview Object\",\n\tremoveRecords: \"Remove Records\",\n\tretrieveChunks: \"Retrieve Chunks\",\n\tretrieveRecords: \"Retrieve Records\",\n\tupsertRecords: \"Upsert Records\"\n}, ve = [\n\t{\n\t\tid: \"bidirectional\",\n\t\tlabel: {\n\t\t\ten: \"Bidirectional\",\n\t\t\tes: \"Bidireccional\"\n\t\t}\n\t},\n\t{\n\t\tid: \"destination\",\n\t\tlabel: {\n\t\t\ten: \"Destination\",\n\t\t\tes: \"Destino\"\n\t\t}\n\t},\n\t{\n\t\tid: \"source\",\n\t\tlabel: {\n\t\t\ten: \"Source\",\n\t\t\tes: \"Origen\"\n\t\t}\n\t},\n\t{\n\t\tid: \"unknown\",\n\t\tlabel: {\n\t\t\ten: \"Unknown\",\n\t\t\tes: \"Desconocido\"\n\t\t}\n\t}\n], ye = /* @__PURE__ */ new Set([\n\t\"createObject\",\n\t\"dropObject\",\n\t\"removeRecords\",\n\t\"upsertRecords\"\n]), be = /* @__PURE__ */ new Set([\n\t\"auditObjectContent\",\n\t\"findObject\",\n\t\"getInfo\",\n\t\"getReadableStream\",\n\t\"getRecord\",\n\t\"listNodes\",\n\t\"previewObject\",\n\t\"retrieveChunks\",\n\t\"retrieveRecords\"\n]);\nfunction j(e) {\n\tlet t = !1, n = !1;\n\tfor (let r of e) be.has(r) && (t = !0), ye.has(r) && (n = !0);\n\treturn t && n ? \"bidirectional\" : t ? \"source\" : n ? \"destination\" : \"unknown\";\n}\nvar M = (e, t = \"en\") => {\n\tlet i = _e.find((t) => t.id === e);\n\treturn i ? {\n\t\tlabel: r(n(i.label), t) ?? i.id,\n\t\tdescription: \"\"\n\t} : {\n\t\tlabel: e,\n\t\tdescription: \"\"\n\t};\n}, N = (e, t = \"en\") => {\n\tlet i = ve.find((t) => t.id === e);\n\treturn i ? {\n\t\tlabel: r(n(i.label), t) ?? i.id,\n\t\tdescription: \"\"\n\t} : {\n\t\tlabel: e,\n\t\tdescription: \"\"\n\t};\n};\nfunction xe(e) {\n\tlet t = new Set(e), n = \"|Action|Supported|\\n\";\n\tn += \"|:----|:-------:|\\n\";\n\tfor (let e of Object.keys(A)) n += `| ${A[e]} | ${t.has(e) ? \"✓\" : \"\"} |\\n`;\n\treturn n;\n}\n//#endregion\n//#region src/component/module/cookbook/cookbookConfig.schema.ts\nvar Se = T([\"list\"]), Ce = /* @__PURE__ */ b({\n\t...k,\n\ttypeId: /* @__PURE__ */ h(\"cookbook\"),\n\tactionNames: /* @__PURE__ */ p(Se),\n\trecipes: /* @__PURE__ */ p(D)\n}), we = T([\n\t\"list\",\n\t\"render\",\n\t\"setColorMode\"\n]), Te = /* @__PURE__ */ b({\n\t...k,\n\ttypeId: /* @__PURE__ */ h(\"presenter\"),\n\tactionNames: /* @__PURE__ */ p(we),\n\tpresentations: /* @__PURE__ */ p(D)\n}), P = 2048, F = \"[REDACTED]\", Ee = 10, I = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i, De = [\n\t[/\\b(Bearer|Basic) +[\\w.~+/=-]+/gi, (e, t) => `${t} ${F}`],\n\t[/(?<![\\w-])([\\w-]+)([\"']?[ \\t]*[:=][ \\t]*[\"']?)([^\\s\"'&,;}?#]+)/g, (e, t, n, r) => I.test(t) && !/^(?:Basic|Bearer)$/i.test(r) ? `${t}${n}${F}` : e],\n\t[/\\beyJ[\\w-]+\\.[\\w-]+\\.[\\w-]*/g, () => F],\n\t[/\\b(?:sk-|xaat-|xapt-|sl\\.)[\\w-]{16,}/g, () => F],\n\t[/(?<![\\w.+-])[\\w.+-]+@[\\w-]+\\.[\\w.-]+/g, () => F]\n], L = class extends Error {\n\tdata;\n\tlocator;\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, r), this.name = \"DPUseError\", this.data = n, this.locator = t;\n\t}\n}, R = class extends L {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"AppError\";\n\t}\n}, z = class extends L {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"APIError\";\n\t}\n}, B = class extends L {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"EngineError\";\n\t}\n}, V = class extends L {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"ConnectorError\";\n\t}\n}, H = class extends L {\n\tconstructor(e, t, n, r) {\n\t\tsuper(e, t, n, r), this.name = \"FetchError\";\n\t}\n};\nasync function Oe(e, t, n) {\n\tlet r = ` - ${e.statusText}`, i = `${t} Response status '${String(e.status)}${e.statusText ? r : \"\"}' received.`, a;\n\ttry {\n\t\ta = await e.text();\n\t} catch (e) {\n\t\ta = `<body unavailable: ${U(e).message}>`;\n\t}\n\treturn new H(i, n, { body: Ie(a) });\n}\nfunction ke(e) {\n\treturn e.map((e) => e.message).join(\" \");\n}\nfunction Ae(e) {\n\ttry {\n\t\te();\n\t} catch {}\n}\nfunction U(e) {\n\tif (e instanceof Error) return e;\n\tif (typeof e == \"string\") return Error(e);\n\tif (typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"bigint\") return Error(String(e));\n\tif (typeof e == \"symbol\") return Error(e.description ?? \"Unknown error\");\n\tif (typeof e == \"object\") try {\n\t\treturn Error(JSON.stringify(e));\n\t} catch {\n\t\treturn /* @__PURE__ */ Error(\"Unknown error\");\n\t}\n\treturn /* @__PURE__ */ Error(\"Unknown error\");\n}\nfunction je(e) {\n\tlet t = /* @__PURE__ */ new Set(), n = [], r = U(e);\n\tfor (; r != null && !t.has(r);) {\n\t\tt.add(r);\n\t\tlet [e, i] = Le(r);\n\t\t/(?:\\.{3}|[.!?])$/.test(e.message) || (e.message += \".\"), n.push(Fe(e)), r = i;\n\t}\n\treturn n;\n}\nfunction Me(e) {\n\tlet t;\n\tfor (let n of e.toReversed()) {\n\t\tlet e = Pe(n, t);\n\t\tn.stack !== void 0 && (e.stack = n.stack), t = e;\n\t}\n\treturn t ?? /* @__PURE__ */ Error(\"No error to unserialise.\");\n}\nfunction Ne(e) {\n\tlet t;\n\ttry {\n\t\tt = JSON.stringify(e);\n\t} catch {\n\t\tt = typeof e == \"symbol\" ? e.description ?? \"Unknown error\" : typeof e == \"bigint\" ? e.toString() : \"Unknown error\";\n\t}\n\treturn t === \"\" && (t = \"Unknown error\"), t;\n}\nfunction Pe(e, t) {\n\tswitch (e.name) {\n\t\tcase \"APIError\": return new z(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"AppError\": return new R(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"ConnectorError\": return new V(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"EngineError\": return new B(e.message, e.locator, e.data, { cause: t });\n\t\tcase \"FetchError\": return new H(e.message, e.locator, e.data, { cause: t });\n\t\tdefault: {\n\t\t\tlet n = e.name;\n\t\t\treturn new class extends Error {\n\t\t\t\tname = n;\n\t\t\t}(e.message, { cause: t });\n\t\t}\n\t}\n}\nfunction Fe(e) {\n\tlet { data: t, message: n, stack: r } = e;\n\treturn {\n\t\t...e,\n\t\tdata: t === void 0 ? void 0 : G(t, /* @__PURE__ */ new WeakSet(), 0),\n\t\tmessage: W(n),\n\t\tstack: r === void 0 ? void 0 : W(r)\n\t};\n}\nfunction W(e) {\n\tlet t = e;\n\tfor (let [e, n] of De) t = t.replaceAll(e, (e, ...t) => n(e, ...t));\n\treturn t;\n}\nfunction G(e, t, n) {\n\treturn typeof e == \"string\" ? W(e) : typeof e != \"object\" || !e ? e : n >= Ee ? F : t.has(e) ? \"[Circular]\" : (t.add(e), Array.isArray(e) ? e.map((e) => G(e, t, n + 1)) : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, r != null && I.test(e) ? F : G(r, t, n + 1)])));\n}\nfunction Ie(e) {\n\tif (e != null && e !== \"\") return e.length > P ? `${e.slice(0, P)}... [truncated]` : e;\n}\nfunction Le(e) {\n\tlet t = e.cause == null ? null : U(e.cause);\n\tif (e instanceof L) return [{\n\t\tdata: e.data,\n\t\tlocator: e.locator,\n\t\tmessage: e.message,\n\t\tname: e.name,\n\t\tstack: e.stack\n\t}, t];\n\tlet n = Object.fromEntries(Object.entries(e).filter(([e]) => e !== \"cause\"));\n\treturn e.name ? [{\n\t\tdata: n,\n\t\tlocator: \"\",\n\t\tmessage: e.message,\n\t\tname: e.name,\n\t\tstack: e.stack\n\t}, t] : [{\n\t\tdata: n,\n\t\tlocator: \"\",\n\t\tmessage: Ne(e),\n\t\tname: \"Error\",\n\t\tstack: void 0\n\t}, null];\n}\n//#endregion\n//#region src/component/module/tool/index.ts\nvar Re = \"https://engine-eu.dpuse.app/tools\";\nasync function ze(e, t) {\n\tlet n = `dpuse-tool-${t}`, r = e.find((e) => e.id === n);\n\tif (!r) {\n\t\tlet r = {\n\t\t\tavailableToolIds: e.map((e) => e.id),\n\t\t\ttoolName: n\n\t\t};\n\t\tthrow new R(`Tool '${t}' not found.`, \"dpuse-shared.component.module.tool.loadTool\", r);\n\t}\n\tlet i = `${Re}/${t}_v${r.version}/${n}.es.js`;\n\ttry {\n\t\treturn new (await (import(\n\t\t\t/* @vite-ignore */\n\t\t\ti\n))).Tool();\n\t} catch (e) {\n\t\tlet t = {\n\t\t\ttoolName: n,\n\t\t\turl: i,\n\t\t\tversion: r.version\n\t\t};\n\t\tthrow new R(`Failed to load tool '${n}' v${r.version}.`, \"dpuse-shared.component.module.tool.loadTool\", t, { cause: e });\n\t}\n}\n//#endregion\n//#region src/encoding/index.ts\nvar Be = {\n\tarabic: {\n\t\tid: \"arabic\",\n\t\tlabel: {\n\t\t\ten: \"Arabic\",\n\t\t\tes: \"Árabe\"\n\t\t}\n\t},\n\tbaltic: {\n\t\tid: \"baltic\",\n\t\tlabel: {\n\t\t\ten: \"Baltic\",\n\t\t\tes: \"Báltico\"\n\t\t}\n\t},\n\tceltic: {\n\t\tid: \"celtic\",\n\t\tlabel: {\n\t\t\ten: \"Celtic\",\n\t\t\tes: \"Celta\"\n\t\t}\n\t},\n\tcentralEuropean: {\n\t\tid: \"centralEuropean\",\n\t\tlabel: {\n\t\t\ten: \"Central European\",\n\t\t\tes: \"Centroeuropeo\"\n\t\t}\n\t},\n\tchineseSimplified: {\n\t\tid: \"chineseSimplified\",\n\t\tlabel: {\n\t\t\ten: \"Chinese Simplified\",\n\t\t\tes: \"Chino simplificado\"\n\t\t}\n\t},\n\tchineseTraditional: {\n\t\tid: \"chineseTraditional\",\n\t\tlabel: {\n\t\t\ten: \"Chinese Traditional\",\n\t\t\tes: \"Chino tradicional\"\n\t\t}\n\t},\n\tcyrillic: {\n\t\tid: \"cyrillic\",\n\t\tlabel: {\n\t\t\ten: \"Cyrillic\",\n\t\t\tes: \"Cirílico\"\n\t\t}\n\t},\n\tgreek: {\n\t\tid: \"greek\",\n\t\tlabel: {\n\t\t\ten: \"Greek\",\n\t\t\tes: \"Griego\"\n\t\t}\n\t},\n\thebrew: {\n\t\tid: \"hebrew\",\n\t\tlabel: {\n\t\t\ten: \"Hebrew\",\n\t\t\tes: \"Hebreo\"\n\t\t}\n\t},\n\tjapanese: {\n\t\tid: \"japanese\",\n\t\tlabel: {\n\t\t\ten: \"Japanese\",\n\t\t\tes: \"Japonés\"\n\t\t}\n\t},\n\tkorean: {\n\t\tid: \"korean\",\n\t\tlabel: {\n\t\t\ten: \"Korean\",\n\t\t\tes: \"Coreano\"\n\t\t}\n\t},\n\tnordic: {\n\t\tid: \"nordic\",\n\t\tlabel: {\n\t\t\ten: \"Nordic\",\n\t\t\tes: \"Nórdico\"\n\t\t}\n\t},\n\tother: {\n\t\tid: \"other\",\n\t\tlabel: {\n\t\t\ten: \"Other\",\n\t\t\tes: \"Otro\"\n\t\t}\n\t},\n\tromanian: {\n\t\tid: \"romanian\",\n\t\tlabel: {\n\t\t\ten: \"Romanian\",\n\t\t\tes: \"Rumano\"\n\t\t}\n\t},\n\tsouthernEuropean: {\n\t\tid: \"southernEuropean\",\n\t\tlabel: {\n\t\t\ten: \"Southern European\",\n\t\t\tes: \"Europeo meridional\"\n\t\t}\n\t},\n\tthai: {\n\t\tid: \"thai\",\n\t\tlabel: {\n\t\t\ten: \"Thai\",\n\t\t\tes: \"Tailandés\"\n\t\t}\n\t},\n\tturkish: {\n\t\tid: \"turkish\",\n\t\tlabel: {\n\t\t\ten: \"Turkish\",\n\t\t\tes: \"Turco\"\n\t\t}\n\t},\n\tunicode16: {\n\t\tid: \"unicode16\",\n\t\tlabel: {\n\t\t\ten: \"Unicode 16\",\n\t\t\tes: \"Unicode 16\"\n\t\t}\n\t},\n\tunicode32: {\n\t\tid: \"unicode32\",\n\t\tlabel: {\n\t\t\ten: \"Unicode 32\",\n\t\t\tes: \"Unicode 32\"\n\t\t}\n\t},\n\tvietnamese: {\n\t\tid: \"vietnamese\",\n\t\tlabel: {\n\t\t\ten: \"Vietnamese\",\n\t\t\tes: \"Vietnamita\"\n\t\t}\n\t},\n\twestern: {\n\t\tid: \"western\",\n\t\tlabel: {\n\t\t\ten: \"Western\",\n\t\t\tes: \"Occidental\"\n\t\t}\n\t}\n}, Ve = {\n\tascii: {\n\t\tid: \"ascii\",\n\t\tgroupId: null,\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\tbig5: {\n\t\tid: \"big5\",\n\t\tgroupId: \"chineseTraditional\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"euc-jp\": {\n\t\tid: \"euc-jp\",\n\t\tgroupId: \"japanese\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"euc-kr\": {\n\t\tid: \"euc-kr\",\n\t\tgroupId: \"korean\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\tgb18030: {\n\t\tid: \"gb18030\",\n\t\tgroupId: \"chineseSimplified\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\tgbk: {\n\t\tid: \"gbk\",\n\t\tgroupId: \"chineseSimplified\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\tibm866: {\n\t\tid: \"ibm866\",\n\t\tgroupId: \"cyrillic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-2022-cn\": {\n\t\tid: \"iso-2022-cn\",\n\t\tgroupId: \"chineseSimplified\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !1\n\t},\n\t\"iso-2022-jp\": {\n\t\tid: \"iso-2022-jp\",\n\t\tgroupId: \"japanese\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-2022-kr\": {\n\t\tid: \"iso-2022-kr\",\n\t\tgroupId: \"korean\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !1\n\t},\n\t\"iso-8859-1\": {\n\t\tid: \"iso-8859-1\",\n\t\tgroupId: \"western\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-2\": {\n\t\tid: \"iso-8859-2\",\n\t\tgroupId: \"centralEuropean\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-3\": {\n\t\tid: \"iso-8859-3\",\n\t\tgroupId: \"southernEuropean\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-4\": {\n\t\tid: \"iso-8859-4\",\n\t\tgroupId: \"baltic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-5\": {\n\t\tid: \"iso-8859-5\",\n\t\tgroupId: \"cyrillic\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-6\": {\n\t\tid: \"iso-8859-6\",\n\t\tgroupId: \"arabic\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-7\": {\n\t\tid: \"iso-8859-7\",\n\t\tgroupId: \"greek\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-8\": {\n\t\tid: \"iso-8859-8\",\n\t\tgroupId: \"hebrew\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-9\": {\n\t\tid: \"iso-8859-9\",\n\t\tgroupId: \"turkish\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-10\": {\n\t\tid: \"iso-8859-10\",\n\t\tgroupId: \"nordic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-11\": {\n\t\tid: \"iso-8859-11\",\n\t\tgroupId: \"thai\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-13\": {\n\t\tid: \"iso-8859-13\",\n\t\tgroupId: \"baltic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-14\": {\n\t\tid: \"iso-8859-14\",\n\t\tgroupId: \"celtic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-15\": {\n\t\tid: \"iso-8859-15\",\n\t\tgroupId: \"western\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"iso-8859-16\": {\n\t\tid: \"iso-8859-16\",\n\t\tgroupId: \"romanian\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"koi8-r\": {\n\t\tid: \"koi8-r\",\n\t\tgroupId: \"cyrillic\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"koi8-u\": {\n\t\tid: \"koi8-u\",\n\t\tgroupId: \"cyrillic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\tlatin1: {\n\t\tid: \"latin1\",\n\t\tgroupId: \"western\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\tmacintosh: {\n\t\tid: \"macintosh\",\n\t\tgroupId: \"western\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\tshift_jis: {\n\t\tid: \"shift_jis\",\n\t\tgroupId: \"japanese\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"tis-620\": {\n\t\tid: \"tis-620\",\n\t\tgroupId: \"thai\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"utf-16\": {\n\t\tid: \"utf-16\",\n\t\tgroupId: \"unicode16\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"utf-16be\": {\n\t\tid: \"utf-16be\",\n\t\tgroupId: \"unicode16\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"utf-16le\": {\n\t\tid: \"utf-16le\",\n\t\tgroupId: \"unicode16\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"utf-32be\": {\n\t\tid: \"utf-32be\",\n\t\tgroupId: \"unicode32\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !1\n\t},\n\t\"utf-32le\": {\n\t\tid: \"utf-32le\",\n\t\tgroupId: \"unicode32\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !1\n\t},\n\t\"utf-8\": {\n\t\tid: \"utf-8\",\n\t\tgroupId: null,\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1250\": {\n\t\tid: \"windows-1250\",\n\t\tgroupId: \"centralEuropean\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1251\": {\n\t\tid: \"windows-1251\",\n\t\tgroupId: \"cyrillic\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1252\": {\n\t\tid: \"windows-1252\",\n\t\tgroupId: \"western\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1253\": {\n\t\tid: \"windows-1253\",\n\t\tgroupId: \"greek\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1254\": {\n\t\tid: \"windows-1254\",\n\t\tgroupId: \"turkish\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1255\": {\n\t\tid: \"windows-1255\",\n\t\tgroupId: \"hebrew\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1256\": {\n\t\tid: \"windows-1256\",\n\t\tgroupId: \"arabic\",\n\t\tisDetectable: !0,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1257\": {\n\t\tid: \"windows-1257\",\n\t\tgroupId: \"baltic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"windows-1258\": {\n\t\tid: \"windows-1258\",\n\t\tgroupId: \"vietnamese\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"windows-874\": {\n\t\tid: \"windows-874\",\n\t\tgroupId: \"thai\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"x-mac-cyrillic\": {\n\t\tid: \"x-mac-cyrillic\",\n\t\tgroupId: \"cyrillic\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t},\n\t\"x-user-defined\": {\n\t\tid: \"x-user-defined\",\n\t\tgroupId: \"other\",\n\t\tisDetectable: !1,\n\t\tisDecodable: !0\n\t}\n}, K = Be, q = Ve;\nfunction He(e) {\n\treturn Object.hasOwn(q, e);\n}\nfunction Ue(e = \"en\") {\n\treturn Array.from(Object.values(q), ({ groupId: t, id: n, isDecodable: r, isDetectable: i }) => {\n\t\tlet a = t == null ? \"\" : We(t, e);\n\t\treturn {\n\t\t\tid: n,\n\t\t\tgroupLabel: a,\n\t\t\tlabel: a ? `${a} (${n})` : n,\n\t\t\tisDetectable: i,\n\t\t\tisDecodable: r\n\t\t};\n\t}).toSorted((t, n) => t.groupLabel.localeCompare(n.groupLabel, e) || t.label.localeCompare(n.label, e));\n}\nfunction We(e, t) {\n\tlet n = K[e].label;\n\treturn n[t] ?? n.en ?? e;\n}\n//#endregion\n//#region src/locale/index.ts\nfunction Ge(e, t) {\n\treturn {\n\t\t...e,\n\t\tlabel: e.label[t] ?? e.id,\n\t\tdescription: e.description[t] ?? e.description.en ?? \"\",\n\t\tverb: e.verb?.[t] ?? void 0\n\t};\n}\nfunction Ke(e, t, n = !1) {\n\tlet r = e.map((e) => ({\n\t\t...e,\n\t\tlabel: e.label[t] ?? e.id,\n\t\tdescription: e.description[t] ?? e.description.en ?? \"\",\n\t\tverb: e.verb?.[t] ?? void 0\n\t}));\n\treturn n ? r.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : r;\n}\nfunction J(e, t) {\n\treturn {\n\t\t...e,\n\t\tlabel: e.label[t] ?? e.id,\n\t\tdescription: e.description[t] ?? e.description.en ?? \"\"\n\t};\n}\n//#endregion\n//#region src/utilities/index.ts\nvar Y = [\n\t[\n\t\t\"days\",\n\t\t864e5,\n\t\t(e) => e === 1 ? \"1 day\" : `${$(e)} days`\n\t],\n\t[\n\t\t\"hrs\",\n\t\t36e5,\n\t\t(e) => e === 1 ? \"1 hr\" : `${$(e)} hrs`\n\t],\n\t[\n\t\t\"mins\",\n\t\t6e4,\n\t\t(e) => e === 1 ? \"1 min\" : `${$(e)} mins`\n\t],\n\t[\n\t\t\"secs\",\n\t\t1e3,\n\t\t(e) => e === 1 ? \"1 sec\" : `${$(e)} secs`\n\t],\n\t[\n\t\t\"ms\",\n\t\t0,\n\t\t(e) => `${$(e)} ms`\n\t]\n], X = \"en\", Z = /* @__PURE__ */ new Map();\nfunction qe(e) {\n\tswitch (e) {\n\t\tcase \"Edm.Binary\": return \"unknown\";\n\t\tcase \"Edm.Boolean\": return \"boolean\";\n\t\tcase \"Edm.Byte\": return \"wholeNumber\";\n\t\tcase \"Edm.DateTime\": return \"moment\";\n\t\tcase \"Edm.DateTimeOffset\": return \"moment\";\n\t\tcase \"Edm.Decimal\": return \"decimalNumber\";\n\t\tcase \"Edm.Double\": return \"decimalNumber\";\n\t\tcase \"Edm.Guid\": return \"string\";\n\t\tcase \"Edm.Int16\": return \"wholeNumber\";\n\t\tcase \"Edm.Int32\": return \"wholeNumber\";\n\t\tcase \"Edm.Int64\": return \"wholeNumber\";\n\t\tcase \"Edm.SByte\": return \"wholeNumber\";\n\t\tcase \"Edm.Single\": return \"decimalNumber\";\n\t\tcase \"Edm.String\": return \"string\";\n\t\tcase \"Edm.Time\": return \"momentTime\";\n\t\tdefault: return \"unknown\";\n\t}\n}\nfunction Je(e) {\n\tif (e) {\n\t\tlet t = e.lastIndexOf(\"/\") + 1, n = e.lastIndexOf(\".\");\n\t\treturn n <= t || n === -1 ? e : e.slice(0, Math.max(0, n));\n\t}\n}\nfunction Ye(e) {\n\tif (e) {\n\t\tlet t = e.lastIndexOf(\"/\") + 1, n = e.lastIndexOf(\".\");\n\t\tif (n <= t) return;\n\t\tif (n !== -1) return e.slice(Math.max(0, n + 1));\n\t}\n}\nfunction Q(e, t = 2, n = t, r = X) {\n\tif (e == null) return \"\";\n\tlet i = `${r}decimal${String(t)}.${String(n)}`, a = Z.get(i);\n\treturn a || (a = new Intl.NumberFormat(r, {\n\t\tlocaleMatcher: \"best fit\",\n\t\tmaximumFractionDigits: t,\n\t\tminimumFractionDigits: n,\n\t\tminimumIntegerDigits: 1,\n\t\tstyle: \"decimal\",\n\t\tuseGrouping: !0\n\t}), Z.set(i, a)), a.format(e);\n}\nfunction Xe(e, t = 1) {\n\treturn e == null ? \"\" : e < 1e3 ? $(e) : e < 1e6 ? `${Q(e / 1e3, t, 0)}K` : e < 1e9 ? `${Q(e / 1e6, t, 0)}M` : e < 0xe8d4a51000 ? `${Q(e / 1e9, t, 0)}B` : `${Q(e / 0xe8d4a51000, t, 0)}T`;\n}\nfunction Ze(e, t = 1) {\n\treturn e == null ? \"\" : e === 1 ? \"1 byte\" : e < 1024 ? `${$(e)} bytes` : e < 1048576 ? `${Q(e / 1024, t, 0)} KB` : e < 1073741824 ? `${Q(e / 1048576, t, 0)} MB` : e < 1099511627776 ? `${Q(e / 1073741824, t, 0)} GB` : `${Q(e / 1099511627776, t, 0)} TB`;\n}\nfunction Qe(e, t = \"ms\") {\n\tif (e == null) return \"\";\n\tlet n = Y.findIndex(([, t]) => e >= t), r = n === -1 ? Y.length - 1 : n, i = Y.findIndex(([e]) => e === t), a = Y.slice(r, Math.max(i, r) + 1), o = [], s = e;\n\tfor (let [, e, t] of a) s < e || s === 0 && o.length > 0 || (o.push(t(e > 0 ? Math.floor(s / e) : s)), s %= e > 0 ? e : 1);\n\treturn o.join(\" \");\n}\nfunction $(e, t = X) {\n\tif (e == null) return \"\";\n\tlet n = `${t}decimal0.0`, r = Z.get(n);\n\treturn r || (r = new Intl.NumberFormat(t, {\n\t\tlocaleMatcher: \"best fit\",\n\t\tmaximumFractionDigits: 0,\n\t\tminimumFractionDigits: 0,\n\t\tminimumIntegerDigits: 1,\n\t\tstyle: \"decimal\",\n\t\tuseGrouping: !0\n\t}), Z.set(n, r)), r.format(e);\n}\nfunction $e(e) {\n\tswitch (e?.toLowerCase()) {\n\t\tcase \"csv\": return \"text/csv\";\n\t\tcase \"tab\":\n\t\tcase \"tsv\": return \"text/tab-separated-values\";\n\t\tcase \"xls\": return \"application/vnd.ms-excel\";\n\t\tcase \"xlsx\": return \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n\t\tdefault: return \"application/octet-stream\";\n\t}\n}\n//#endregion\nexport { z as APIError, R as AppError, V as ConnectorError, e as DEFAULT_LOCALE_ID, K as ENCODING_GROUP_CONFIG_MAP, q as ENCODING_TYPE_CONFIG_MAP, B as EngineError, H as FetchError, le as ORDERED_VALUE_DELIMITER_IDS, t as SUPPORTED_LANGUAGES, Oe as buildFetchError, oe as componentInstanceConfigSchema, ke as concatenateSerialisedErrorMessages, ge as connectorConfigSchema, M as constructConnectorCategoryConfig, N as constructConnectorUsageConfig, qe as convertODataTypeIdToUsageTypeId, Ce as cookbookConfigSchema, n as createLabelMap, j as determineConnectorUsageId, Ye as extractExtensionFromPath, Je as extractNameFromPath, Q as formatNumberAsDecimalNumber, Qe as formatNumberAsDuration, Xe as formatNumberAsSize, Ze as formatNumberAsStorageSize, $ as formatNumberAsWholeNumber, ce as getComponentStatus, xe as getConnectorActionsTable, Ue as getEncodingTypeConfigs, Ae as ignoreErrors, He as isEncodingTypeId, ze as loadTool, Ge as localiseConfig, Ke as localiseConfigs, J as localiseReference, $e as lookupMimeTypeForExtension, U as normalizeToError, Te as presenterConfigSchema, r as resolveLabel, je as serialiseError, Me as unserialiseError };\n","// ── DPUse Framework\nimport { ConnectorError } from '@dpuse/dpuse-shared'; // TODO: This should be Module or Tool error?\n\n// ── Local Framework\nimport type * as RustModule from '../rust/dpuse_tool_rust_csv_core_parser/pkg/dpuse_tool_rust_csv_core_parser.js';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ntype RustBindings = typeof RustModule;\n\nexport interface CsvProcessingOptions {\n delimiter?: string;\n hasHeaders?: boolean;\n}\n\nexport interface CsvProcessingSummary {\n processedRowCount: number;\n failedRowCount: number;\n durationMs?: number;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport const config = {\n id: 'rust-csv-core',\n name: 'Rust CSV Core',\n version: '0.1.0'\n} as const;\n\n// ── State ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst state: { rustBindingsPromise: Promise<RustBindings> | undefined } = {\n rustBindingsPromise: undefined\n};\n\n// ── Tools ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n/**\n * Parses CSV with a Rust core compiled to WebAssembly, in one of two modes: a transferable ReadableStream where the\n * browser supports one (Chromium), or chunk by chunk where it does not (Safari).\n */\nexport class Tool {\n readonly config = config;\n\n /**\n * Process CSV data using transferable ReadableStream (Chromium path).\n */\n async processWithTransferableStream(\n stream: ReadableStream<Uint8Array>,\n options: CsvProcessingOptions = {},\n onProgress?: (rowCount: number) => void\n ): Promise<CsvProcessingSummary> {\n const xxxx = await loadRustBindings();\n const delimiter = options.delimiter?.codePointAt(0) ?? 44; // Default comma\n const hasHeaders = options.hasHeaders ?? true;\n\n const startTime = performance.now();\n let processedRowCount = 0;\n\n const progressCallback = (count: number): void => {\n processedRowCount += count;\n if (onProgress) onProgress(count);\n };\n\n try {\n await xxxx.stream_csv(stream, progressCallback, delimiter, hasHeaders);\n return {\n processedRowCount,\n failedRowCount: 0,\n durationMs: performance.now() - startTime\n };\n } catch (error) {\n throw new ConnectorError('Failed to process CSV stream.', 'dpuse-tool-rust-csv-core-parser|Tool|processWithTransferableStream', { cause: error });\n }\n }\n\n /**\n * Process CSV data using chunk-by-chunk approach (Safari fallback).\n */\n async processWithChunks(stream: ReadableStream<Uint8Array>, options: CsvProcessingOptions = {}, onProgress?: (rowCount: number) => void): Promise<CsvProcessingSummary> {\n const { CsvSession } = await loadRustBindings();\n const delimiter = options.delimiter?.codePointAt(0) ?? 44;\n const hasHeaders = options.hasHeaders ?? true;\n\n const startTime = performance.now();\n let processedRowCount = 0;\n const session = new CsvSession(delimiter, hasHeaders);\n\n try {\n const reader = stream.getReader();\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const { value, done } = await reader.read();\n if (done) break;\n\n // if (value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const rows = session.pushChunk(value);\n const count = Array.isArray(rows) ? rows.length : 0;\n processedRowCount += count;\n if (onProgress && count > 0) onProgress(count);\n // }\n }\n\n // Finish processing\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const remainingRows = session.finish();\n const remainingCount = Array.isArray(remainingRows) ? remainingRows.length : 0;\n processedRowCount += remainingCount;\n if (onProgress && remainingCount > 0) onProgress(remainingCount);\n\n return {\n processedRowCount,\n failedRowCount: 0,\n durationMs: performance.now() - startTime\n };\n } finally {\n reader.releaseLock();\n }\n } catch (error) {\n throw new ConnectorError('Failed to process CSV chunks.', 'dpuse-tool-rust-csv-core-parser|Tool|processWithChunks', { cause: error });\n }\n }\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The WebAssembly loads once, on first use; the promise is kept so callers that arrive together share one load.\nasync function loadRustBindings(): Promise<RustBindings> {\n state.rustBindingsPromise ??= (async () => {\n const module = await import('../rust/dpuse_tool_rust_csv_core_parser/pkg/dpuse_tool_rust_csv_core_parser.js');\n await module.default();\n return module;\n })();\n return state.rustBindingsPromise;\n}\n"],"ignoreList":[0],"mappings":";AAUA,SAASC,EAAE,GAAG;CACb,OAAO,IAAI,IAAI,OAAO,QAAQ,CAAC,CAAC;AACjC;AAOA,IAAIC,IAAI;CACP,MAAM,KAAK;CACX,SAAS,KAAK;CACd,YAAY,KAAK;CACjB,gBAAgB,KAAK;AACtB;;AAEA,SAASC,EAAE,GAAG;CACb,OAAO,IAAI;EACV,MAAM,GAAG,QAAQ,KAAK;EACtB,SAAS,GAAG;EACZ,YAAY,GAAG,cAAc,KAAK;EAClC,gBAAgB,GAAG,kBAAkB,KAAK;CAC3C,IAAID;AACL;;AAEA,SAASE,EAAE,GAAG;CACb,IAAI,IAAI,OAAO;CACf,OAAO,MAAM,WAAW,IAAI,EAAE,KAAK,MAAM,YAAY,MAAM,YAAY,MAAM,YAAY,GAAG,MAAM,MAAM,YAAY,MAAM,cAAc,KAAK,OAAO,eAAe,CAAC,CAAC,EAAE,aAAa,SAAS,SAAS;AACvM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