@septkit/ui 0.0.88 → 0.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/dialecte/composables/change-id-window.js +14 -0
  2. package/dist/dialecte/composables/use-live-data.js +154 -31
  3. package/dist/dialecte/create-document-store.js +16 -7
  4. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/dialecte-DHj8__Ch.js +7293 -0
  5. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/helpers-Bfv2XDC-.js +351 -0
  6. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/index.js +6 -0
  7. package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/open-connections-D59wm6nb.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/open-connections-ClJo0-Af.js} +2 -2
  8. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/project-key-DD8DyQ8-.js +1751 -0
  9. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/qname-definition-C6GUFWL8.js +56 -0
  10. package/dist/external/.pnpm/{@dialecte_core@0.11.0 → @dialecte_core@0.12.1}/node_modules/@dialecte/core/dist/rolldown-runtime-CYdcPHCu.js +1 -1
  11. package/dist/external/.pnpm/{@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/same-json-value-boJ4pSRe.js → @dialecte_core@0.12.1/node_modules/@dialecte/core/dist/same-json-value-DTtSsGUF.js} +491 -370
  12. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils-Q5zsKl3Y.js +2449 -0
  13. package/dist/external/.pnpm/@dialecte_core@0.12.1/node_modules/@dialecte/core/dist/utils.js +2 -0
  14. package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/index.js +627 -0
  15. package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js +31 -0
  16. package/dist/external/.pnpm/@tanstack_virtual-core@3.17.3/node_modules/@tanstack/virtual-core/dist/esm/utils.js +38 -0
  17. package/dist/external/.pnpm/@tanstack_vue-virtual@3.13.31_vue@3.5.39_typescript@5.8.3_/node_modules/@tanstack/vue-virtual/dist/esm/index.js +28 -0
  18. package/dist/external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js +24 -2
  19. package/dist/index.d.ts +266 -7
  20. package/dist/index.js +7 -1
  21. package/dist/ui.css +1 -1
  22. package/dist/virtual/grid-aria.js +16 -0
  23. package/dist/virtual/grid-navigation.js +84 -0
  24. package/dist/virtual/index.js +6 -0
  25. package/dist/virtual/kept-range.js +32 -0
  26. package/dist/virtual/use-virtual-scroller.js +180 -0
  27. package/dist/virtual/virtual.constants.js +7 -0
  28. package/package.json +6 -4
  29. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/dialecte-Cs_XRP4I.js +0 -4426
  30. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/helpers-D8p0KiJu.js +0 -130
  31. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/index.js +0 -6
  32. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/project-key-sr4wkl2Q.js +0 -1371
  33. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils-Cv4oHia0.js +0 -865
  34. package/dist/external/.pnpm/@dialecte_core@0.11.0/node_modules/@dialecte/core/dist/utils.js +0 -2
@@ -1,29 +1,94 @@
1
- import { G as e, V as t, W as n, f as r, j as i, k as a, z as o } from "./utils-Cv4oHia0.js";
1
+ import { $ as e, H as t, O as n, ct as r, f as i, it as a, st as o } from "./utils-Q5zsKl3Y.js";
2
2
  import { n as s, t as c } from "./rolldown-runtime-CYdcPHCu.js";
3
- import { A as l, B as u, K as d, L as f, M as p, P as m, V as h, a as g, c as _, f as v, m as y, o as b, p as x, s as S } from "./project-key-sr4wkl2Q.js";
4
- import { l as C } from "./helpers-D8p0KiJu.js";
5
- //#region node_modules/.pnpm/@dialecte+core@0.11.0/node_modules/@dialecte/core/dist/same-json-value-boJ4pSRe.js
6
- var w = 1e3, T = "start";
7
- function E(e) {
3
+ import { A as l, F as u, H as d, M as f, R as p, V as m, a as h, c as g, f as _, m as v, o as y, p as b, q as x, s as S } from "./project-key-DD8DyQ8-.js";
4
+ import { l as C } from "./helpers-Bfv2XDC-.js";
5
+ //#region node_modules/.pnpm/@dialecte+core@0.12.1/node_modules/@dialecte/core/dist/same-json-value-DTtSsGUF.js
6
+ var w = [
7
+ "get",
8
+ "getMany",
9
+ "getByTagNameInDocument",
10
+ "getByAttributes",
11
+ "getByDocumentId"
12
+ ];
13
+ async function T(e) {
14
+ let { reads: t, read: n, versionOf: r } = e;
15
+ i(w.includes(n.member), {
16
+ detail: `"${n.member}" is not a read a version is answered with`,
17
+ meta: { member: n.member }
18
+ });
19
+ let a = t[n.member].apply(t, n.args), o = r();
20
+ return {
21
+ value: await a,
22
+ version: o
23
+ };
24
+ }
25
+ var E = 1e3, D = "start";
26
+ function O(e) {
8
27
  let { documents: t, writeId: n, isRunning: r } = e, i = t.find((e) => e.writeId === n);
9
28
  return i ? i.status === "importing" ? r?.({ writeId: n }) === !1 ? "not-applied" : "running" : "applied" : "not-applied";
10
29
  }
11
- function D(e) {
12
- let { documents: t, writeId: n, committed: r, isRunning: i } = e, a = E({
30
+ function k(e) {
31
+ let { documents: t, writeId: n, committed: r, isRunning: i } = e, a = O({
13
32
  documents: t,
14
33
  writeId: n,
15
34
  isRunning: i
16
35
  });
17
36
  return a === "not-applied" ? r ? "applied" : "not-applied" : a;
18
37
  }
19
- var O = 1024, k = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u, A = [
38
+ function A(e) {
39
+ let { creates: t, updates: n, deletes: r } = e;
40
+ return t.length + n.length + r.length > 5e3 ? { unknown: !0 } : {
41
+ created: t.map(M),
42
+ updated: n.map(M),
43
+ deleted: r.map(j)
44
+ };
45
+ }
46
+ function j(e) {
47
+ return {
48
+ id: e.id,
49
+ tagName: e.tagName,
50
+ parentId: e.parentId
51
+ };
52
+ }
53
+ function M(e) {
54
+ return {
55
+ id: e.id,
56
+ tagName: e.tagName,
57
+ parentId: e.parent?.id ?? null
58
+ };
59
+ }
60
+ function N(e) {
61
+ let { images: t, direction: n } = e, { creates: r, befores: i, afters: a, deletes: o } = t;
62
+ return A(n === "forward" ? {
63
+ creates: r,
64
+ updates: a,
65
+ deletes: o.map(M)
66
+ } : {
67
+ creates: o,
68
+ updates: i,
69
+ deletes: r.map(M)
70
+ });
71
+ }
72
+ function P(e) {
73
+ let { operations: t, direction: n } = e;
74
+ return N({
75
+ images: {
76
+ creates: t.creates,
77
+ befores: t.updates.map((e) => e.before),
78
+ afters: t.updates.map((e) => e.after),
79
+ deletes: t.deletes
80
+ },
81
+ direction: n
82
+ });
83
+ }
84
+ var F = 1024, I = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u, L = [
20
85
  "name",
21
86
  "path",
22
87
  "metadata"
23
- ], j = ".xml";
24
- function M(e) {
25
- let { path: t } = e, n = B({ path: t });
26
- n !== void 0 && u({
88
+ ], ee = ".xml";
89
+ function R(e) {
90
+ let { path: t } = e, n = te({ path: t });
91
+ n !== void 0 && m({
27
92
  path: t,
28
93
  reason: n
29
94
  });
@@ -33,16 +98,16 @@ function M(e) {
33
98
  fileName: r.pop()
34
99
  };
35
100
  }
36
- function N(e) {
101
+ function z(e) {
37
102
  let { extensions: t } = e;
38
- return t.includes(".xml") ? t : [...t, j];
103
+ return t.includes(".xml") ? t : [...t, ee];
39
104
  }
40
- function P(e) {
41
- let { path: t, extensions: n } = e, { fileName: r } = M({ path: t }), i = r.lastIndexOf(".");
42
- return (i < 1 || i === r.length - 1) && u({
105
+ function B(e) {
106
+ let { path: t, extensions: n } = e, { fileName: r } = R({ path: t }), i = r.lastIndexOf(".");
107
+ return (i < 1 || i === r.length - 1) && m({
43
108
  path: t,
44
109
  reason: "its file name has no extension after a name"
45
- }), n && !n.some((e) => r.toLowerCase().endsWith(e)) && u({
110
+ }), n && !n.some((e) => r.toLowerCase().endsWith(e)) && m({
46
111
  path: t,
47
112
  reason: `its extension is not one the document's config reads (${n.join(", ")})`
48
113
  }), {
@@ -50,77 +115,77 @@ function P(e) {
50
115
  extension: r.slice(i)
51
116
  };
52
117
  }
53
- function F(e) {
118
+ function V(e) {
54
119
  let { name: t, extension: n, path: r } = e.document;
55
120
  if (r === void 0) return;
56
- let { fileName: i } = M({ path: r });
57
- (typeof t != "string" || typeof n != "string") && u({
121
+ let { fileName: i } = R({ path: r });
122
+ (typeof t != "string" || typeof n != "string") && m({
58
123
  path: r,
59
124
  reason: "a path names a file of a name and an extension that are strings"
60
- }), (t === "" || i !== `${t}${n}`) && u({
125
+ }), (t === "" || i !== `${t}${n}`) && m({
61
126
  path: r,
62
127
  reason: `it does not end with the document's file name ${JSON.stringify(`${t}${n}`)}`
63
128
  });
64
129
  }
65
- function I(e) {
66
- let { document: t } = e, n = Object.fromEntries(A.filter((t) => e.updates[t] !== void 0).map((t) => [t, e.updates[t]])), r = {
130
+ function H(e) {
131
+ let { document: t } = e, n = Object.fromEntries(L.filter((t) => e.updates[t] !== void 0).map((t) => [t, e.updates[t]])), r = {
67
132
  ...t,
68
133
  ...n
69
134
  };
70
135
  if (n.path !== void 0) {
71
- let { fileName: e } = M({ path: n.path }), { extension: i } = t;
72
- e.endsWith(i) && e.length !== i.length || u({
136
+ let { fileName: e } = R({ path: n.path }), { extension: i } = t;
137
+ e.endsWith(i) && e.length !== i.length || m({
73
138
  path: n.path,
74
139
  reason: `it does not end with the document's extension ${JSON.stringify(i)}`
75
140
  }), r.name = n.name ?? e.slice(0, e.length - i.length);
76
141
  } else if (n.name !== void 0 && t.path !== void 0) {
77
- let { folders: e } = M({ path: t.path });
142
+ let { folders: e } = R({ path: t.path });
78
143
  r.path = [...e, `${n.name}${t.extension}`].join("/");
79
144
  }
80
- return (n.path !== void 0 || n.name !== void 0) && F({ document: r }), r;
145
+ return (n.path !== void 0 || n.name !== void 0) && V({ document: r }), r;
81
146
  }
82
- function L(e) {
147
+ function U(e) {
83
148
  let { document: t, documents: n } = e;
84
- F({ document: t });
149
+ V({ document: t });
85
150
  let { id: r, path: i } = t;
86
151
  if (i === void 0) return;
87
- let a = R({
152
+ let a = W({
88
153
  path: i,
89
154
  documents: n,
90
155
  documentId: r
91
156
  });
92
- a !== void 0 && h({
157
+ a !== void 0 && d({
93
158
  documentId: r,
94
159
  path: i,
95
160
  takenBy: a
96
161
  });
97
162
  }
98
- function R(e) {
163
+ function W(e) {
99
164
  let { path: t, documents: n, documentId: r } = e;
100
- return n.find((e) => e.id !== r && e.path !== void 0 && z({
165
+ return n.find((e) => e.id !== r && e.path !== void 0 && G({
101
166
  path: t,
102
167
  other: e.path
103
168
  }))?.id;
104
169
  }
105
- function z(e) {
170
+ function G(e) {
106
171
  let { path: t, other: n } = e;
107
172
  return t === n || t.startsWith(`${n}/`) || n.startsWith(`${t}/`);
108
173
  }
109
- function B(e) {
174
+ function te(e) {
110
175
  let { path: t } = e;
111
176
  if (typeof t != "string") return "it is not a string";
112
177
  if (t.includes("\\")) return "it holds a backslash, a folder separator on Windows";
113
- if (k.test(t)) return "it holds an invisible format, separator or control character (Unicode Cc, Cf, Zl or Zp)";
114
- if (!t.isWellFormed()) return `it is ${d}`;
178
+ if (I.test(t)) return "it holds an invisible format, separator or control character (Unicode Cc, Cf, Zl or Zp)";
179
+ if (!t.isWellFormed()) return `it is ${x}`;
115
180
  if (t.normalize("NFC") !== t) return "it is not in Unicode NFC";
116
181
  let n = t.split("/");
117
182
  if (n.some((e) => e === "")) return "it holds an empty folder or file name";
118
183
  if (n.some((e) => e === "." || e === "..")) return "it holds a folder or file name \".\" or \"..\"";
119
184
  let r = new TextEncoder();
120
185
  if (n.some((e) => r.encode(e).length > 255)) return "it holds a folder or file name of more than 255 bytes (UTF-8)";
121
- if (r.encode(t).length > 1024) return `it is more than ${O} bytes long (UTF-8)`;
186
+ if (r.encode(t).length > 1024) return `it is more than ${F} bytes long (UTF-8)`;
122
187
  }
123
- function V(e) {
188
+ function K(e) {
124
189
  let { record: t } = e, { id: n, tagName: r, namespace: i, attributes: a, value: o, parent: s, children: c } = t;
125
190
  return {
126
191
  id: n,
@@ -138,23 +203,23 @@ function V(e) {
138
203
  children: c
139
204
  };
140
205
  }
141
- function H(e) {
142
- return f({ value: e.records }).map((e) => V({ record: e }));
206
+ function ne(e) {
207
+ return p({ value: e.records }).map((e) => K({ record: e }));
143
208
  }
144
- function U(e) {
209
+ function re(e) {
145
210
  let { record: t, patch: n } = e, { recordId: r, attributes: i, children: a, removeAttributes: o, ...s } = n, c = { ...t };
146
211
  for (let [e, t] of Object.entries(s)) t !== void 0 && Object.assign(c, { [e]: t });
147
- return i && (c.attributes = W({
212
+ return i && (c.attributes = q({
148
213
  held: t.attributes,
149
214
  given: i,
150
215
  key: "name"
151
- })), o?.length && (c.attributes = c.attributes.filter((e) => !o.includes(e.name))), a && (c.children = W({
216
+ })), o?.length && (c.attributes = c.attributes.filter((e) => !o.includes(e.name))), a && (c.children = q({
152
217
  held: t.children,
153
218
  given: a,
154
219
  key: "id"
155
- })), V({ record: c });
220
+ })), K({ record: c });
156
221
  }
157
- function W(e) {
222
+ function q(e) {
158
223
  let { held: t, given: n, key: r } = e, i = [...t];
159
224
  for (let e of n) {
160
225
  let t = i.findIndex((t) => t[r] === e[r]);
@@ -162,9 +227,9 @@ function W(e) {
162
227
  }
163
228
  return i;
164
229
  }
165
- function G(e) {
230
+ function ie(e) {
166
231
  let { onProgress: t, parts: n } = e, r = n.reduce((e, t) => e + t, 0), i = 0, a = {};
167
- for (let e of n) i += e, p({
232
+ for (let e of n) i += e, f({
168
233
  listener: function(e) {
169
234
  return t?.(e, r);
170
235
  },
@@ -173,13 +238,13 @@ function G(e) {
173
238
  call: a
174
239
  });
175
240
  }
176
- function K(e) {
177
- let { totalBytes: t, listener: n, perf: r = y, intervalMs: i = 50, now: a = () => performance.now(), schedule: o = ee } = e, s = {}, c = 0, u, d = -Infinity, f, m, h, g = !1, _;
178
- function v(e) {
179
- f = void 0, _?.(), _ = void 0, u && ae({
241
+ function J(e) {
242
+ let { totalBytes: t, listener: n, perf: r = v, intervalMs: i = 50, now: a = () => performance.now(), schedule: o = ae } = e, s = {}, c = 0, u, d = -Infinity, p, m, h, g = !1, _;
243
+ function y(e) {
244
+ p = void 0, _?.(), _ = void 0, u && ue({
180
245
  left: u,
181
246
  right: e
182
- }) || (u = e, d = a(), p({
247
+ }) || (u = e, d = a(), f({
183
248
  listener: n,
184
249
  value: e,
185
250
  of: l.importProgress,
@@ -196,40 +261,40 @@ function K(e) {
196
261
  tell: function(e) {
197
262
  if (g) return;
198
263
  e.phase === "storing" && (c = e.bytesRead);
199
- let n = te({
264
+ let n = oe({
200
265
  report: e,
201
266
  bytesRead: c,
202
267
  totalBytes: t
203
268
  });
204
269
  n.phase !== "indexing" && b(n);
205
- let r = !u || !ne({
270
+ let r = !u || !se({
206
271
  left: u,
207
272
  right: n
208
273
  });
209
- if (r && f && v(f), r || !re(n) || ie(n)) {
210
- v(n);
274
+ if (r && p && y(p), r || !ce(n) || le(n)) {
275
+ y(n);
211
276
  return;
212
277
  }
213
278
  let s = a() - d;
214
- s >= i ? v(n) : (f = n, _ ??= o({
279
+ s >= i ? y(n) : (p = n, _ ??= o({
215
280
  work: function() {
216
- _ = void 0, f && v(f);
281
+ _ = void 0, p && y(p);
217
282
  },
218
283
  afterMs: i - s
219
284
  }));
220
285
  },
221
286
  close: function() {
222
- g || (g = !0, f = void 0, _?.(), _ = void 0, x(), m !== void 0 && r.stop(`import::phase.${m}`), m = void 0);
287
+ g || (g = !0, p = void 0, _?.(), _ = void 0, x(), m !== void 0 && r.stop(`import::phase.${m}`), m = void 0);
223
288
  }
224
289
  };
225
290
  }
226
- function ee(e) {
291
+ function ae(e) {
227
292
  let t = setTimeout(e.work, e.afterMs);
228
293
  return t.unref?.(), function() {
229
294
  clearTimeout(t);
230
295
  };
231
296
  }
232
- function te(e) {
297
+ function oe(e) {
233
298
  let { report: t, bytesRead: n, totalBytes: r } = e;
234
299
  return {
235
300
  ...t,
@@ -237,30 +302,30 @@ function te(e) {
237
302
  totalBytes: r
238
303
  };
239
304
  }
240
- function ne(e) {
305
+ function se(e) {
241
306
  let { left: t, right: n } = e;
242
307
  return t.phase === n.phase ? t.phase === "processing" && n.phase === "processing" ? t.step === n.step : t.phase === "indexing" && n.phase === "indexing" ? t.index === n.index : !0 : !1;
243
308
  }
244
- function re(e) {
309
+ function ce(e) {
245
310
  return "done" in e && e.done !== void 0;
246
311
  }
247
- function ie(e) {
312
+ function le(e) {
248
313
  return "done" in e && "total" in e && e.done === e.total;
249
314
  }
250
- function ae(e) {
315
+ function ue(e) {
251
316
  let { left: t, right: n } = e, r = Object.entries(t);
252
317
  return r.length === Object.keys(n).length && r.every(([e, t]) => n[e] === t);
253
318
  }
254
- function oe(e) {
319
+ function de(e) {
255
320
  let { ops: t, control: n } = e, r = (t.creates?.length ?? 0) + (t.updates?.length ?? 0) + (t.deletes?.length ?? 0);
256
321
  n?.onProgress?.({
257
322
  done: r,
258
323
  total: r
259
324
  });
260
325
  }
261
- var se = /* @__PURE__ */ c(((e, t) => {
326
+ var fe = /* @__PURE__ */ c(((e, t) => {
262
327
  t.exports = {};
263
- })), ce = /* @__PURE__ */ s((/* @__PURE__ */ c(((e, t, n) => {
328
+ })), pe = /* @__PURE__ */ s((/* @__PURE__ */ c(((e, t, n) => {
264
329
  (function(e) {
265
330
  e.parser = function(e, t) {
266
331
  return new n(e, t);
@@ -341,7 +406,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
341
406
  end: function() {
342
407
  I(this);
343
408
  },
344
- write: K,
409
+ write: G,
345
410
  resume: function() {
346
411
  return this.error = null, this;
347
412
  },
@@ -354,7 +419,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
354
419
  };
355
420
  var o;
356
421
  try {
357
- o = se().Stream;
422
+ o = fe().Stream;
358
423
  } catch {
359
424
  o = function() {};
360
425
  }
@@ -785,7 +850,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
785
850
  if (typeof e != "object" || !(e instanceof n)) throw Error("bad call to strictFail");
786
851
  e.strict && F(e, t);
787
852
  }
788
- function R(e) {
853
+ function ee(e) {
789
854
  e.strict || (e.tagName = e.tagName[e.looseCase]());
790
855
  var t = e.tags[e.tags.length - 1] || e, n = e.tag = {
791
856
  name: e.tagName,
@@ -793,18 +858,18 @@ var se = /* @__PURE__ */ c(((e, t) => {
793
858
  };
794
859
  e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, M(e, "onopentagstart", n);
795
860
  }
796
- function z(e, t) {
861
+ function R(e, t) {
797
862
  var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), r = n[0], i = n[1];
798
863
  return t && e === "xmlns" && (r = "xmlns", i = ""), {
799
864
  prefix: r,
800
865
  local: i
801
866
  };
802
867
  }
803
- function B(e) {
868
+ function z(e) {
804
869
  if (e.strict || (e.attribName = e.attribName[e.looseCase]()), e.attribList.indexOf(e.attribName) !== -1 || e.tag.attributes.hasOwnProperty(e.attribName)) e.attribName = e.attribValue = "";
805
870
  else {
806
871
  if (e.opt.xmlns) {
807
- var t = z(e.attribName, !0), n = t.prefix, r = t.local;
872
+ var t = R(e.attribName, !0), n = t.prefix, r = t.local;
808
873
  if (n === "xmlns") if (r === "xml" && e.attribValue !== p) L(e, "xml: prefix must be bound to " + p + "\nActual: " + e.attribValue);
809
874
  else if (r === "xmlns" && e.attribValue !== m) L(e, "xmlns: prefix must be bound to " + m + "\nActual: " + e.attribValue);
810
875
  else {
@@ -819,9 +884,9 @@ var se = /* @__PURE__ */ c(((e, t) => {
819
884
  e.attribName = e.attribValue = "";
820
885
  }
821
886
  }
822
- function V(e, t) {
887
+ function B(e, t) {
823
888
  if (e.opt.xmlns) {
824
- var n = e.tag, r = z(e.tagName);
889
+ var n = e.tag, r = R(e.tagName);
825
890
  n.prefix = r.prefix, n.local = r.local, n.uri = n.ns[r.prefix] || "", n.prefix && !n.uri && (L(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = r.prefix);
826
891
  var i = e.tags[e.tags.length - 1] || e;
827
892
  n.ns && i.ns !== n.ns && Object.keys(n.ns).forEach(function(t) {
@@ -831,7 +896,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
831
896
  });
832
897
  });
833
898
  for (var a = 0, o = e.attribList.length; a < o; a++) {
834
- var s = e.attribList[a], c = s[0], l = s[1], u = z(c, !0), d = u.prefix, f = u.local, p = d === "" ? "" : n.ns[d] || "", m = {
899
+ var s = e.attribList[a], c = s[0], l = s[1], u = R(c, !0), d = u.prefix, f = u.local, p = d === "" ? "" : n.ns[d] || "", m = {
835
900
  name: c,
836
901
  value: l,
837
902
  prefix: d,
@@ -844,7 +909,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
844
909
  }
845
910
  e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), M(e, "onopentag", e.tag), t || (e.state = !e.noscript && e.tagName.toLowerCase() === "script" ? T.SCRIPT : T.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
846
911
  }
847
- function H(e) {
912
+ function V(e) {
848
913
  if (!e.tagName) L(e, "Weird empty close tag."), e.textNode += "</>", e.state = T.TEXT;
849
914
  else {
850
915
  if (e.script) {
@@ -878,34 +943,34 @@ var se = /* @__PURE__ */ c(((e, t) => {
878
943
  }
879
944
  }
880
945
  }
881
- function U(e) {
946
+ function H(e) {
882
947
  var t = e.entity, n = t.toLowerCase(), r, i = "";
883
948
  return e.ENTITIES[t] ? e.ENTITIES[t] : e.ENTITIES[n] ? e.ENTITIES[n] : (t = n, t.charAt(0) === "#" && (t.charAt(1) === "x" ? (t = t.slice(2), r = parseInt(t, 16), i = r.toString(16)) : (t = t.slice(1), r = parseInt(t, 10), i = r.toString(10))), t = t.replace(/^0+/, ""), isNaN(r) || i.toLowerCase() !== t || r < 0 || r > 1114111 ? (L(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(r));
884
949
  }
885
- function W(e, t) {
950
+ function U(e, t) {
886
951
  t === "<" ? (e.state = T.OPEN_WAKA, e.startTagPosition = e.position) : b(t) || (L(e, "Non-whitespace before first tag."), e.textNode = t, e.state = T.TEXT);
887
952
  }
888
- function G(e, t) {
953
+ function W(e, t) {
889
954
  var n = "";
890
955
  return t < e.length && (n = e.charAt(t)), n;
891
956
  }
892
- function K(t) {
957
+ function G(t) {
893
958
  var n = this;
894
959
  if (this.error) throw this.error;
895
960
  if (n.closed) return F(n, "Cannot write after close. Assign an onready handler.");
896
961
  if (t === null) return I(n);
897
962
  typeof t == "object" && (t = t.toString());
898
- for (var i = 0, a = ""; a = G(t, i++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
963
+ for (var i = 0, a = ""; a = W(t, i++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
899
964
  case T.BEGIN:
900
965
  if (n.state = T.BEGIN_WHITESPACE, a === "") continue;
901
- W(n, a);
966
+ U(n, a);
902
967
  continue;
903
968
  case T.BEGIN_WHITESPACE:
904
- W(n, a);
969
+ U(n, a);
905
970
  continue;
906
971
  case T.TEXT:
907
972
  if (n.sawRoot && !n.closedRoot) {
908
- for (var o = i - 1; a && a !== "<" && a !== "&";) a = G(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
973
+ for (var o = i - 1; a && a !== "<" && a !== "&";) a = W(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
909
974
  n.textNode += t.substring(o, i - 1);
910
975
  }
911
976
  a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = T.OPEN_WAKA, n.startTagPosition = n.position) : (b(a) || n.sawRoot && !n.closedRoot || L(n, "Text data outside of root node."), a === "&" ? n.state = T.TEXT_ENTITY : n.textNode += a);
@@ -961,7 +1026,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
961
1026
  a === ">" ? n.state = n.doctype && n.doctype !== !0 ? T.DOCTYPE_DTD : T.TEXT : (L(n, "Malformed comment"), n.comment += "--" + a, n.state = T.COMMENT);
962
1027
  continue;
963
1028
  case T.CDATA:
964
- for (var o = i - 1; a && a !== "]";) a = G(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
1029
+ for (var o = i - 1; a && a !== "]";) a = W(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
965
1030
  n.cdata += t.substring(o, i - 1), a === "]" && (n.state = T.CDATA_ENDING);
966
1031
  continue;
967
1032
  case T.CDATA_ENDING:
@@ -987,17 +1052,17 @@ var se = /* @__PURE__ */ c(((e, t) => {
987
1052
  } else n.procInstBody += "?" + a, n.state = T.PROC_INST_BODY;
988
1053
  continue;
989
1054
  case T.OPEN_TAG:
990
- C(_, a) ? n.tagName += a : (R(n), a === ">" ? V(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : (b(a) || L(n, "Invalid character in tag name"), n.state = T.ATTRIB));
1055
+ C(_, a) ? n.tagName += a : (ee(n), a === ">" ? B(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : (b(a) || L(n, "Invalid character in tag name"), n.state = T.ATTRIB));
991
1056
  continue;
992
1057
  case T.OPEN_TAG_SLASH:
993
- a === ">" ? (V(n, !0), H(n)) : (L(n, "Forward-slash in opening tag not followed by >"), n.state = T.ATTRIB);
1058
+ a === ">" ? (B(n, !0), V(n)) : (L(n, "Forward-slash in opening tag not followed by >"), n.state = T.ATTRIB);
994
1059
  continue;
995
1060
  case T.ATTRIB:
996
1061
  if (b(a)) continue;
997
- a === ">" ? V(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : C(g, a) ? (n.attribName = a, n.attribValue = "", n.state = T.ATTRIB_NAME) : L(n, "Invalid attribute name");
1062
+ a === ">" ? B(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : C(g, a) ? (n.attribName = a, n.attribValue = "", n.state = T.ATTRIB_NAME) : L(n, "Invalid attribute name");
998
1063
  continue;
999
1064
  case T.ATTRIB_NAME:
1000
- a === "=" ? n.state = T.ATTRIB_VALUE : a === ">" ? (L(n, "Attribute without value"), n.attribValue = n.attribName, B(n), V(n)) : b(a) ? n.state = T.ATTRIB_NAME_SAW_WHITE : C(_, a) ? n.attribName += a : L(n, "Invalid attribute name");
1065
+ a === "=" ? n.state = T.ATTRIB_VALUE : a === ">" ? (L(n, "Attribute without value"), n.attribValue = n.attribName, z(n), B(n)) : b(a) ? n.state = T.ATTRIB_NAME_SAW_WHITE : C(_, a) ? n.attribName += a : L(n, "Invalid attribute name");
1001
1066
  continue;
1002
1067
  case T.ATTRIB_NAME_SAW_WHITE:
1003
1068
  if (a === "=") n.state = T.ATTRIB_VALUE;
@@ -1005,7 +1070,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
1005
1070
  else L(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", M(n, "onattribute", {
1006
1071
  name: n.attribName,
1007
1072
  value: ""
1008
- }), n.attribName = "", a === ">" ? V(n) : C(g, a) ? (n.attribName = a, n.state = T.ATTRIB_NAME) : (L(n, "Invalid attribute name"), n.state = T.ATTRIB);
1073
+ }), n.attribName = "", a === ">" ? B(n) : C(g, a) ? (n.attribName = a, n.state = T.ATTRIB_NAME) : (L(n, "Invalid attribute name"), n.state = T.ATTRIB);
1009
1074
  continue;
1010
1075
  case T.ATTRIB_VALUE:
1011
1076
  if (b(a)) continue;
@@ -1016,20 +1081,20 @@ var se = /* @__PURE__ */ c(((e, t) => {
1016
1081
  a === "&" ? n.state = T.ATTRIB_VALUE_ENTITY_Q : n.attribValue += a;
1017
1082
  continue;
1018
1083
  }
1019
- B(n), n.q = "", n.state = T.ATTRIB_VALUE_CLOSED;
1084
+ z(n), n.q = "", n.state = T.ATTRIB_VALUE_CLOSED;
1020
1085
  continue;
1021
1086
  case T.ATTRIB_VALUE_CLOSED:
1022
- b(a) ? n.state = T.ATTRIB : a === ">" ? V(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : C(g, a) ? (L(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = T.ATTRIB_NAME) : L(n, "Invalid attribute name");
1087
+ b(a) ? n.state = T.ATTRIB : a === ">" ? B(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : C(g, a) ? (L(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = T.ATTRIB_NAME) : L(n, "Invalid attribute name");
1023
1088
  continue;
1024
1089
  case T.ATTRIB_VALUE_UNQUOTED:
1025
1090
  if (!S(a)) {
1026
1091
  a === "&" ? n.state = T.ATTRIB_VALUE_ENTITY_U : n.attribValue += a;
1027
1092
  continue;
1028
1093
  }
1029
- B(n), a === ">" ? V(n) : n.state = T.ATTRIB;
1094
+ z(n), a === ">" ? B(n) : n.state = T.ATTRIB;
1030
1095
  continue;
1031
1096
  case T.CLOSE_TAG:
1032
- if (n.tagName) a === ">" ? H(n) : C(_, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = T.SCRIPT) : (b(a) || L(n, "Invalid tagname in closing tag"), n.state = T.CLOSE_TAG_SAW_WHITE);
1097
+ if (n.tagName) a === ">" ? V(n) : C(_, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = T.SCRIPT) : (b(a) || L(n, "Invalid tagname in closing tag"), n.state = T.CLOSE_TAG_SAW_WHITE);
1033
1098
  else {
1034
1099
  if (b(a)) continue;
1035
1100
  w(g, a) ? n.script ? (n.script += "</" + a, n.state = T.SCRIPT) : L(n, "Invalid tagname in closing tag.") : n.tagName = a;
@@ -1037,7 +1102,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
1037
1102
  continue;
1038
1103
  case T.CLOSE_TAG_SAW_WHITE:
1039
1104
  if (b(a)) continue;
1040
- a === ">" ? H(n) : L(n, "Invalid characters in closing tag");
1105
+ a === ">" ? V(n) : L(n, "Invalid characters in closing tag");
1041
1106
  continue;
1042
1107
  case T.TEXT_ENTITY:
1043
1108
  case T.ATTRIB_VALUE_ENTITY_Q:
@@ -1053,7 +1118,7 @@ var se = /* @__PURE__ */ c(((e, t) => {
1053
1118
  case T.ATTRIB_VALUE_ENTITY_U: c = T.ATTRIB_VALUE_UNQUOTED, l = "attribValue";
1054
1119
  }
1055
1120
  if (a === ";") {
1056
- var u = U(n);
1121
+ var u = H(n);
1057
1122
  n.opt.unparsedEntities && !Object.values(e.XML_ENTITIES).includes(u) ? ((n.entityCount += 1) > n.opt.maxEntityCount && F(n, "Parsed entity count exceeds max entity count"), (n.entityDepth += 1) > n.opt.maxEntityDepth && F(n, "Parsed entity depth exceeds max entity depth"), n.entity = "", n.state = c, n.write(u), --n.entityDepth) : (n[l] += u, n.entity = "", n.state = c);
1058
1123
  } else C(n.entity.length ? y : v, a) ? n.entity += a : (L(n, "Invalid character in entity name"), n[l] += "&" + n.entity + a, n.entity = "", n.state = c);
1059
1124
  continue;
@@ -1081,174 +1146,212 @@ var se = /* @__PURE__ */ c(((e, t) => {
1081
1146
  }) : String.fromCodePoint = n;
1082
1147
  })();
1083
1148
  })(e === void 0 ? n.sax = {} : e);
1084
- })))(), 1), q = class {
1085
- constructor() {
1086
- this.pendingChildren = /* @__PURE__ */ new Map();
1087
- }
1088
- registerPendingChild(e, t) {
1089
- let n = this.pendingChildren.get(e);
1090
- n ? n.push(t) : this.pendingChildren.set(e, [t]);
1091
- }
1092
- resolveChildrenForBatch(e) {
1093
- for (let t of e) {
1094
- let e = this.pendingChildren.get(t.id);
1095
- e && e.length > 0 && (t.children.push(...e), this.pendingChildren.delete(t.id));
1096
- }
1097
- return e;
1098
- }
1099
- get pendingCount() {
1100
- return this.pendingChildren.size;
1101
- }
1102
- };
1103
- function le(e) {
1104
- return "prefix" in e && "uri" in e && !!e.prefix && !!e.uri;
1105
- }
1106
- var ue = {
1149
+ })))(), 1), me = {
1107
1150
  lowercase: !1,
1108
1151
  trim: !1,
1109
1152
  normalize: !1,
1110
1153
  position: !1,
1111
1154
  xmlns: !0
1112
1155
  };
1113
- function de(e) {
1114
- let { dialecteConfig: t, useCustomRecordsIds: n, session: r, hooks: i, importSession: a, perf: o = y } = e, s = {
1156
+ function he() {
1157
+ let e = /* @__PURE__ */ new Map();
1158
+ function t(t) {
1159
+ e = ge({
1160
+ pending: e,
1161
+ ...t
1162
+ });
1163
+ }
1164
+ function n(t) {
1165
+ let n = _e({
1166
+ pending: e,
1167
+ batch: t.batch
1168
+ });
1169
+ return e = n.pending, n.batch;
1170
+ }
1171
+ return {
1172
+ register: t,
1173
+ resolve: n
1174
+ };
1175
+ }
1176
+ function ge(e) {
1177
+ let { pending: t, parentId: n, child: r } = e;
1178
+ return new Map(t).set(n, [...t.get(n) ?? [], r]);
1179
+ }
1180
+ function _e(e) {
1181
+ let { pending: t, batch: n } = e;
1182
+ if (t.size === 0) return {
1183
+ pending: t,
1184
+ batch: n
1185
+ };
1186
+ let r = new Map(t);
1187
+ for (let e of n) {
1188
+ let t = r.get(e.id);
1189
+ t && t.length !== 0 && (e.children.push(...t), r.delete(e.id));
1190
+ }
1191
+ return {
1192
+ pending: r,
1193
+ batch: n
1194
+ };
1195
+ }
1196
+ function ve(e) {
1197
+ let { dialecteConfig: t, useCustomRecordsIds: n, hooks: r, importSession: i, perf: a = v } = e, o = he(), s = {
1115
1198
  defaultNamespace: null,
1116
1199
  stack: [],
1117
1200
  recordsBatch: [],
1118
1201
  sawRoot: !1
1119
- }, c = ce.parser(!0, ue), l = a?.recordTagNames && new Set(a.recordTagNames);
1120
- c.onopentag = (e) => {
1121
- fe({
1202
+ }, c = [], l = pe.parser(!0, me), u = i?.recordTagNames && new Set(i.recordTagNames);
1203
+ l.onopentag = (e) => {
1204
+ c.push(ye({
1122
1205
  node: e,
1123
1206
  state: s,
1124
1207
  dialecteConfig: t,
1125
1208
  useCustomRecordsIds: n
1126
- });
1127
- }, c.ontext = (e) => {
1128
- pe({
1209
+ }));
1210
+ }, l.ontext = (e) => {
1211
+ be({
1129
1212
  text: e,
1130
1213
  state: s
1131
1214
  });
1132
- }, c.oncdata = (e) => {
1133
- J({
1215
+ }, l.oncdata = (e) => {
1216
+ Y({
1134
1217
  text: e,
1135
1218
  state: s
1136
1219
  });
1137
- }, c.onclosetag = () => {
1138
- he({
1220
+ }, l.onclosetag = () => {
1221
+ Se({
1139
1222
  state: s,
1140
- hooks: i,
1141
- importSession: a,
1142
- sessionTags: l,
1143
- session: r,
1223
+ namespaceOf: c.pop(),
1224
+ hooks: r,
1225
+ importSession: i,
1226
+ sessionTags: u,
1227
+ pendingChildren: o,
1144
1228
  dialecteConfig: t,
1145
- perf: o
1229
+ perf: a
1146
1230
  });
1147
- }, c.onerror = ge;
1148
- function u() {
1231
+ }, l.onerror = Ce;
1232
+ function d() {
1149
1233
  let e = s.recordsBatch;
1150
- return s.recordsBatch = [], e;
1234
+ return s.recordsBatch = [], o.resolve({ batch: e });
1151
1235
  }
1152
- function d() {
1236
+ function f() {
1153
1237
  return s.recordsBatch.length;
1154
1238
  }
1155
1239
  return {
1156
- parser: c,
1157
- drainBatch: u,
1158
- getSize: d
1240
+ parser: l,
1241
+ drainBatch: d,
1242
+ getSize: f
1159
1243
  };
1160
1244
  }
1161
- function fe(e) {
1162
- let { node: t, state: r, dialecteConfig: i, useCustomRecordsIds: o } = e, s = _e(t);
1163
- r.stack.length === 0 && (r.sawRoot && n("PARSE_ERROR", {
1245
+ function ye(e) {
1246
+ let { node: t, state: r, dialecteConfig: i, useCustomRecordsIds: a } = e, s = we(t);
1247
+ r.stack.length === 0 && (r.sawRoot && o("PARSE_ERROR", {
1164
1248
  detail: `XML parsing error: a second root element <${t.name}> after the root was closed`,
1165
1249
  meta: {
1166
1250
  reason: "second-root",
1167
1251
  tagName: t.name
1168
1252
  }
1169
- }), r.sawRoot = !0), r.defaultNamespace ||= ve({
1253
+ }), r.sawRoot = !0), r.defaultNamespace ||= Te({
1170
1254
  element: t,
1171
1255
  defaultNamespace: i.namespaces.default,
1172
1256
  rootElementName: i.rootElementName
1173
1257
  });
1174
- let c = ye(t, r.defaultNamespace), l = {
1175
- id: Se({
1176
- attributes: t.attributes,
1177
- useCustomRecordsIds: o,
1178
- tagName: s
1179
- }),
1258
+ let c = r.defaultNamespace, l = Ee({
1259
+ element: t,
1260
+ defaultNamespace: c
1261
+ }), u = je({
1262
+ attributes: t.attributes,
1263
+ useCustomRecordsIds: a,
1264
+ tagName: s
1265
+ }), d = Me({
1266
+ attributes: t.attributes,
1267
+ useCustomRecordsIds: a
1268
+ });
1269
+ Oe({
1270
+ attributes: t.attributes,
1271
+ tagName: s
1272
+ });
1273
+ function f(e) {
1274
+ return ke({
1275
+ node: t,
1276
+ prefix: e,
1277
+ documentDefault: c
1278
+ });
1279
+ }
1280
+ let p = {
1281
+ id: u,
1180
1282
  tagName: s,
1181
- namespace: c,
1182
- attributes: a({
1283
+ namespace: l,
1284
+ attributes: n({
1183
1285
  dialecteConfig: i,
1184
- attributes: be(Ce({
1185
- attributes: t.attributes,
1186
- useCustomRecordsIds: o
1187
- })),
1188
- namespaceOf: (e) => t.ns[e]
1286
+ attributes: De(d),
1287
+ namespaceOf: f
1189
1288
  }),
1190
1289
  value: "",
1191
- parent: xe(r.stack),
1290
+ parent: Ae(r.stack),
1192
1291
  children: []
1193
1292
  };
1194
- r.stack.push(l);
1293
+ return r.stack.push(p), f;
1195
1294
  }
1196
- function pe(e) {
1197
- let { state: t } = e;
1198
- J({
1199
- text: o({ text: e.text }),
1200
- state: t
1295
+ function be(t) {
1296
+ let { state: n } = t;
1297
+ Y({
1298
+ text: e({ text: t.text }),
1299
+ state: n
1201
1300
  });
1202
1301
  }
1203
- function J(e) {
1302
+ function Y(e) {
1204
1303
  let { text: t, state: n } = e;
1205
1304
  t && n.stack.length > 0 && (n.stack[n.stack.length - 1].value += t);
1206
1305
  }
1207
- function me(e) {
1306
+ function xe(e) {
1208
1307
  let { record: t } = e, n = S({ record: t });
1209
1308
  if (!n) return;
1210
- let r = b({
1309
+ let r = y({
1211
1310
  place: n,
1212
1311
  element: `<${t.tagName}>`
1213
1312
  });
1214
- Y({
1313
+ X({
1215
1314
  character: n.character,
1216
1315
  where: r
1217
1316
  });
1218
1317
  }
1219
- function Y(e) {
1220
- let { character: t, where: r } = e;
1221
- n("PARSE_ERROR", {
1222
- detail: `XML parsing error: ${r} holds ${t}, a character XML does not allow (as written or as a character reference)`,
1318
+ function X(e) {
1319
+ let { character: t, where: n } = e;
1320
+ o("PARSE_ERROR", {
1321
+ detail: `XML parsing error: ${n} holds ${t}, a character XML does not allow (as written or as a character reference)`,
1223
1322
  meta: {
1224
1323
  reason: "not-xml-character",
1225
1324
  character: t
1226
1325
  }
1227
1326
  });
1228
1327
  }
1229
- function he(e) {
1230
- let { state: t, hooks: n, importSession: r, sessionTags: i, session: a, dialecteConfig: o, perf: s = y } = e, c = t.stack.pop();
1231
- if (!c) return;
1232
- let l = s.time("import::standardize", () => C({
1233
- dialecteConfig: o,
1234
- hooks: n,
1235
- record: c
1236
- })), u = r?.beforeImportRecord;
1237
- u && (!i || i.has(l.tagName)) && s.time("import::hooks.record", () => u({
1238
- record: l,
1328
+ function Se(e) {
1329
+ let { state: t, namespaceOf: n, hooks: r, importSession: i, sessionTags: a, pendingChildren: o, dialecteConfig: s, perf: c = v } = e, l = t.stack.pop();
1330
+ if (!l) return;
1331
+ let u = c.time("import::standardize", () => C({
1332
+ dialecteConfig: s,
1333
+ hooks: r,
1334
+ namespaceOf: n,
1335
+ record: l
1336
+ })), d = i?.beforeImportRecord;
1337
+ d && (!a || a.has(u.tagName)) && c.time("import::hooks.record", () => d({
1338
+ record: u,
1239
1339
  ancestry: t.stack
1240
- })), me({ record: l });
1241
- let d = t.stack[t.stack.length - 1];
1242
- d ? d.children.push({
1243
- id: l.id,
1244
- tagName: l.tagName
1245
- }) : l.parent && a.registerPendingChild(l.parent.id, {
1246
- id: l.id,
1247
- tagName: l.tagName
1248
- }), t.recordsBatch.push(l);
1340
+ })), xe({ record: u });
1341
+ let f = t.stack[t.stack.length - 1];
1342
+ f ? f.children.push({
1343
+ id: u.id,
1344
+ tagName: u.tagName
1345
+ }) : u.parent && o.register({
1346
+ parentId: u.parent.id,
1347
+ child: {
1348
+ id: u.id,
1349
+ tagName: u.tagName
1350
+ }
1351
+ }), t.recordsBatch.push(u);
1249
1352
  }
1250
- function ge(e) {
1251
- n("PARSE_ERROR", {
1353
+ function Ce(e) {
1354
+ o("PARSE_ERROR", {
1252
1355
  detail: `XML parsing error: ${e.message}`,
1253
1356
  meta: {
1254
1357
  reason: "malformed-xml",
@@ -1256,36 +1359,57 @@ function ge(e) {
1256
1359
  }
1257
1360
  });
1258
1361
  }
1259
- function _e(e) {
1362
+ function we(e) {
1260
1363
  return e.local;
1261
1364
  }
1262
- function ve(e) {
1263
- let { element: t, defaultNamespace: n, rootElementName: i } = e;
1264
- return r(t.name === i, { detail: `Expected root element <${i}>, got <${t.name}>` }), t.attributes?.xmlns?.value ? {
1365
+ function Te(e) {
1366
+ let { element: t, defaultNamespace: n, rootElementName: r } = e;
1367
+ return i(t.name === r, { detail: `Expected root element <${r}>, got <${t.name}>` }), t.attributes?.xmlns?.value ? {
1265
1368
  prefix: "",
1266
1369
  uri: t.attributes.xmlns.value
1267
1370
  } : n;
1268
1371
  }
1269
- function ye(e, t) {
1270
- return le(e) ? {
1271
- prefix: e.prefix,
1272
- uri: e.uri
1273
- } : t;
1372
+ function Ee(e) {
1373
+ let { element: t, defaultNamespace: n } = e;
1374
+ if (t.prefix) return {
1375
+ prefix: t.prefix,
1376
+ uri: t.uri
1377
+ };
1378
+ let r = t.ns[""];
1379
+ return r === void 0 ? n : {
1380
+ prefix: "",
1381
+ uri: r
1382
+ };
1274
1383
  }
1275
- function be(e) {
1276
- return e.map((e) => {
1384
+ function De(e) {
1385
+ return e.filter((e) => e.prefix !== "xmlns").map((e) => {
1277
1386
  let t = e.prefix && e.uri ? {
1278
1387
  prefix: e.prefix,
1279
1388
  uri: e.uri
1280
1389
  } : void 0;
1281
1390
  return {
1282
- name: e.prefix === "xmlns" && e.local === "" ? "xmlns" : t ? e.local : e.name,
1391
+ name: t ? e.local : e.name,
1283
1392
  value: e.value,
1284
1393
  ...t && { namespace: t }
1285
1394
  };
1286
1395
  });
1287
1396
  }
1288
- function xe(e) {
1397
+ function Oe(e) {
1398
+ let { attributes: t, tagName: n } = e;
1399
+ for (let e of Object.values(t)) {
1400
+ if (e.prefix !== "xmlns") continue;
1401
+ let t = g({ text: e.value });
1402
+ t && X({
1403
+ character: t,
1404
+ where: `The attribute ${e.name} of <${n}>`
1405
+ });
1406
+ }
1407
+ }
1408
+ function ke(e) {
1409
+ let { node: t, prefix: n, documentDefault: r } = e, i = t.ns[n];
1410
+ return i !== void 0 || n !== "" ? i : r.uri;
1411
+ }
1412
+ function Ae(e) {
1289
1413
  if (e.length === 0) return null;
1290
1414
  let t = e[e.length - 1];
1291
1415
  return t ? {
@@ -1293,27 +1417,27 @@ function xe(e) {
1293
1417
  tagName: t.tagName
1294
1418
  } : null;
1295
1419
  }
1296
- function Se(e) {
1297
- let { attributes: t, useCustomRecordsIds: n, tagName: r } = e, a = t[i];
1298
- if (!n || !a || !a.value) return crypto.randomUUID();
1299
- let o = _({ text: a.value });
1300
- return o && Y({
1420
+ function je(e) {
1421
+ let { attributes: n, useCustomRecordsIds: r, tagName: i } = e, a = n[t];
1422
+ if (!r || !a || !a.value) return crypto.randomUUID();
1423
+ let o = g({ text: a.value });
1424
+ return o && X({
1301
1425
  character: o,
1302
- where: `The attribute ${i} of <${r}>`
1426
+ where: `The attribute ${t} of <${i}>`
1303
1427
  }), a.value;
1304
1428
  }
1305
- function Ce(e) {
1306
- let { attributes: t, useCustomRecordsIds: n } = e;
1307
- return n ? Object.values(t).filter((e) => e.name !== i) : Object.values(t);
1429
+ function Me(e) {
1430
+ let { attributes: n, useCustomRecordsIds: r } = e;
1431
+ return r ? Object.values(n).filter((e) => e.name !== t) : Object.values(n);
1308
1432
  }
1309
- async function X(e, t = {}) {
1310
- let { file: n, perf: r = y } = e, i = e.reporter ? void 0 : K({
1433
+ async function Z(e, t = {}) {
1434
+ let { file: n, perf: r = v } = e, i = e.reporter ? void 0 : J({
1311
1435
  totalBytes: n.size,
1312
1436
  listener: t.onProgress,
1313
1437
  perf: r
1314
1438
  }), a = e.reporter ?? i;
1315
1439
  try {
1316
- return await we({
1440
+ return await Ne({
1317
1441
  ...e,
1318
1442
  reporter: a
1319
1443
  }, t);
@@ -1321,9 +1445,9 @@ async function X(e, t = {}) {
1321
1445
  i?.close();
1322
1446
  }
1323
1447
  }
1324
- async function we(e, t) {
1325
- let { documentId: n, configKey: i, store: a, config: o, useCustomRecordsIds: s = !1, chunkOptions: c, hooks: l, perf: u = y, reporter: d } = e, { file: f } = e;
1326
- if (r(N({ extensions: o.io.supportedFileExtensions }).some((e) => f.name.toLowerCase().endsWith(e)), {
1448
+ async function Ne(e, t) {
1449
+ let { documentId: n, configKey: r, store: a, config: o, useCustomRecordsIds: s = !1, chunkOptions: c, hooks: l, perf: u = v, reporter: d } = e, { file: f } = e;
1450
+ if (i(z({ extensions: o.io.supportedFileExtensions }).some((e) => f.name.toLowerCase().endsWith(e)), {
1327
1451
  key: "ASSERTION_FAILED",
1328
1452
  detail: `Unsupported file type: ${f.name}`
1329
1453
  }), f.size === 0) return {
@@ -1336,20 +1460,18 @@ async function we(e, t) {
1336
1460
  let e = p(await f.text());
1337
1461
  f = new File([e], f.name, { type: f.type });
1338
1462
  }
1339
- let m = c?.chunkSize ?? 32768, h = c?.batchSize ?? 2e3, g = new q(), _ = l?.createImportSession?.({
1463
+ let m = c?.chunkSize ?? 32768, h = c?.batchSize ?? 2e3, g = l?.createImportSession?.({
1340
1464
  documentId: n,
1341
- configKey: i
1342
- }), v = de({
1465
+ configKey: r
1466
+ }), _ = ve({
1343
1467
  dialecteConfig: o,
1344
1468
  useCustomRecordsIds: s,
1345
- session: g,
1346
1469
  hooks: l,
1347
- importSession: _,
1470
+ importSession: g,
1348
1471
  perf: u
1349
- }), b = await Te({
1472
+ }), y = await Pe({
1350
1473
  file: f,
1351
- sax: v,
1352
- session: g,
1474
+ sax: _,
1353
1475
  store: a,
1354
1476
  documentId: n,
1355
1477
  chunkSize: m,
@@ -1357,8 +1479,8 @@ async function we(e, t) {
1357
1479
  perf: u,
1358
1480
  control: t,
1359
1481
  reporter: d
1360
- }), { recordDelta: x, diagnostics: S } = await Ee({
1361
- importSession: _,
1482
+ }), { recordDelta: b, diagnostics: x } = await Fe({
1483
+ importSession: g,
1362
1484
  store: a,
1363
1485
  documentId: n,
1364
1486
  file: f,
@@ -1368,72 +1490,71 @@ async function we(e, t) {
1368
1490
  });
1369
1491
  return {
1370
1492
  documentId: n,
1371
- recordCount: b + x,
1372
- diagnostics: S
1493
+ recordCount: y + b,
1494
+ diagnostics: x
1373
1495
  };
1374
1496
  }
1375
- async function Te(e) {
1376
- let { file: t, sax: n, session: r, store: i, documentId: a, chunkSize: o, batchSize: s, perf: c, control: l, reporter: u } = e, d = {
1497
+ async function Pe(e) {
1498
+ let { file: t, sax: n, store: r, documentId: i, chunkSize: a, batchSize: o, perf: s, control: c, reporter: l } = e, u = {
1377
1499
  sax: n,
1378
- session: r,
1379
- store: i,
1380
- documentId: a,
1500
+ store: r,
1501
+ documentId: i,
1381
1502
  file: t,
1382
- perf: c,
1383
- control: l,
1384
- reporter: u
1385
- }, f = 0, p = 0, m = t.stream().getReader(), h = new TextDecoder(), g = /* @__PURE__ */ new Uint8Array(), _ = !1;
1386
- for (; !_;) {
1387
- let e = await m.read();
1388
- if (_ = e.done, e.value) {
1389
- let t = g.length === 0 ? e.value : je(g, e.value), r = 0;
1390
- for (; r + o <= t.length;) {
1391
- let e = c.time("import::decode", () => h.decode(t.subarray(r, r + o), { stream: !0 }));
1392
- r += o, p += o, c.time("import::parse", () => n.parser.write(e)), f += await $({
1393
- ...d,
1394
- threshold: s,
1395
- bytesRead: p
1503
+ perf: s,
1504
+ control: c,
1505
+ reporter: l
1506
+ }, d = 0, f = 0, p = t.stream().getReader(), m = new TextDecoder(), h = /* @__PURE__ */ new Uint8Array(), g = !1;
1507
+ for (; !g;) {
1508
+ let e = await p.read();
1509
+ if (g = e.done, e.value) {
1510
+ let t = h.length === 0 ? e.value : Be(h, e.value), r = 0;
1511
+ for (; r + a <= t.length;) {
1512
+ let e = s.time("import::decode", () => m.decode(t.subarray(r, r + a), { stream: !0 }));
1513
+ r += a, f += a, s.time("import::parse", () => n.parser.write(e)), d += await Ve({
1514
+ ...u,
1515
+ threshold: o,
1516
+ bytesRead: f
1396
1517
  });
1397
1518
  }
1398
- g = r < t.length ? t.slice(r) : /* @__PURE__ */ new Uint8Array();
1519
+ h = r < t.length ? t.slice(r) : /* @__PURE__ */ new Uint8Array();
1399
1520
  }
1400
- if (_) {
1401
- if (g.length > 0) {
1402
- let e = c.time("import::decode", () => h.decode(g));
1403
- p += g.length, c.time("import::parse", () => n.parser.write(e));
1521
+ if (g) {
1522
+ if (h.length > 0) {
1523
+ let e = s.time("import::decode", () => m.decode(h));
1524
+ f += h.length, s.time("import::parse", () => n.parser.write(e));
1404
1525
  }
1405
- c.time("import::parse", () => n.parser.close()), f += await $({
1406
- ...d,
1526
+ s.time("import::parse", () => n.parser.close()), d += await Ve({
1527
+ ...u,
1407
1528
  threshold: 0,
1408
- bytesRead: p
1529
+ bytesRead: f
1409
1530
  });
1410
1531
  }
1411
1532
  }
1412
- return f;
1533
+ return d;
1413
1534
  }
1414
- async function Ee(e) {
1535
+ async function Fe(e) {
1415
1536
  let { importSession: t, store: n, documentId: r, file: i, perf: a, reporter: o } = e, s = e.signal ?? new AbortController().signal;
1416
- if (Q({
1537
+ if ($({
1417
1538
  signal: s,
1418
1539
  file: i
1419
1540
  }), o.tell({
1420
1541
  phase: "processing",
1421
- step: T
1542
+ step: D
1422
1543
  }), !t?.afterImport) return {
1423
1544
  recordDelta: 0,
1424
1545
  diagnostics: []
1425
1546
  };
1426
- let { creates: c, updates: l, deletes: u, diagnostics: d = [] } = await De({
1547
+ let { creates: c, updates: l, deletes: u, diagnostics: d = [] } = await Ie({
1427
1548
  afterImport: t.afterImport,
1428
1549
  file: i,
1429
1550
  perf: a,
1430
1551
  signal: s,
1431
1552
  reporter: o
1432
1553
  });
1433
- Q({
1554
+ $({
1434
1555
  signal: s,
1435
1556
  file: i
1436
- }), ke({
1557
+ }), Re({
1437
1558
  diagnostics: d,
1438
1559
  creates: c,
1439
1560
  updates: l,
@@ -1441,7 +1562,7 @@ async function Ee(e) {
1441
1562
  });
1442
1563
  let f = (c?.length ?? 0) + (l?.length ?? 0) + (u?.length ?? 0);
1443
1564
  if (f > 0) {
1444
- Q({
1565
+ $({
1445
1566
  signal: s,
1446
1567
  file: i
1447
1568
  }), o.tell({
@@ -1474,12 +1595,12 @@ async function Ee(e) {
1474
1595
  diagnostics: d
1475
1596
  };
1476
1597
  }
1477
- async function De(e) {
1598
+ async function Ie(e) {
1478
1599
  let { afterImport: t, file: n, perf: r, signal: i, reporter: a } = e, o = {
1479
1600
  report: function(e) {
1480
1601
  i.aborted || a.tell({
1481
1602
  phase: "processing",
1482
- ...Oe({ step: e })
1603
+ ...Le({ step: e })
1483
1604
  });
1484
1605
  },
1485
1606
  signal: i
@@ -1488,7 +1609,7 @@ async function De(e) {
1488
1609
  try {
1489
1610
  return await t(o);
1490
1611
  } catch (e) {
1491
- throw Q({
1612
+ throw $({
1492
1613
  signal: i,
1493
1614
  file: n
1494
1615
  }), e;
@@ -1496,7 +1617,7 @@ async function De(e) {
1496
1617
  r.stop("import::hooks.after");
1497
1618
  }
1498
1619
  }
1499
- function Oe(e) {
1620
+ function Le(e) {
1500
1621
  let { step: t, done: n, total: r } = e.step;
1501
1622
  return {
1502
1623
  step: String(t),
@@ -1504,16 +1625,16 @@ function Oe(e) {
1504
1625
  ...typeof r == "number" && { total: r }
1505
1626
  };
1506
1627
  }
1507
- function ke(e) {
1628
+ function Re(e) {
1508
1629
  let { diagnostics: t, creates: n = [], updates: r = [], reporter: i } = e, a = t.length + n.length + r.length, o = 0;
1509
1630
  i.tell({
1510
1631
  phase: "checking",
1511
1632
  done: o,
1512
1633
  total: a
1513
1634
  });
1514
- for (let e = 0; e < t.length; e += w) {
1515
- let n = t.slice(e, e + w);
1516
- Ae({
1635
+ for (let e = 0; e < t.length; e += E) {
1636
+ let n = t.slice(e, e + E);
1637
+ ze({
1517
1638
  diagnostics: n,
1518
1639
  offset: e
1519
1640
  }), o += n.length, i.tell({
@@ -1522,90 +1643,90 @@ function ke(e) {
1522
1643
  total: a
1523
1644
  });
1524
1645
  }
1525
- for (let e = 0; e < n.length; e += w) {
1526
- let t = n.slice(e, e + w);
1527
- Z({ creates: t }), o += t.length, i.tell({
1646
+ for (let e = 0; e < n.length; e += E) {
1647
+ let t = n.slice(e, e + E);
1648
+ Q({ creates: t }), o += t.length, i.tell({
1528
1649
  phase: "checking",
1529
1650
  done: o,
1530
1651
  total: a
1531
1652
  });
1532
1653
  }
1533
- for (let e = 0; e < r.length; e += w) {
1534
- let t = r.slice(e, e + w);
1535
- Z({ updates: t }), o += t.length, i.tell({
1654
+ for (let e = 0; e < r.length; e += E) {
1655
+ let t = r.slice(e, e + E);
1656
+ Q({ updates: t }), o += t.length, i.tell({
1536
1657
  phase: "checking",
1537
1658
  done: o,
1538
1659
  total: a
1539
1660
  });
1540
1661
  }
1541
1662
  }
1542
- function Ae(t) {
1543
- let { diagnostics: r, offset: i } = t;
1663
+ function ze(e) {
1664
+ let { diagnostics: t, offset: n } = e;
1544
1665
  try {
1545
- m({ value: r });
1546
- } catch (t) {
1547
- let a = `among the diagnostics ${i}-${i + r.length - 1}`;
1548
- n("STORE_VALUE_NOT_JSON", {
1549
- detail: `A diagnostic of the import session: ${e(t)?.detail ?? String(t)} (${a})`,
1550
- cause: t instanceof Error ? t : void 0
1666
+ u({ value: t });
1667
+ } catch (e) {
1668
+ let i = `among the diagnostics ${n}-${n + t.length - 1}`;
1669
+ o("STORE_VALUE_NOT_JSON", {
1670
+ detail: `A diagnostic of the import session: ${r(e)?.detail ?? String(e)} (${i})`,
1671
+ cause: e instanceof Error ? e : void 0
1551
1672
  });
1552
1673
  }
1553
1674
  }
1554
- function Z(e) {
1675
+ function Q(e) {
1555
1676
  let { creates: t = [], updates: n = [] } = e;
1556
- for (let e of t) g({ record: e });
1557
- for (let e of n) g({ record: {
1677
+ for (let e of t) h({ record: e });
1678
+ for (let e of n) h({ record: {
1558
1679
  ...e,
1559
1680
  id: e.recordId
1560
1681
  } });
1561
1682
  }
1562
- function Q(e) {
1563
- let { signal: t, file: r } = e;
1564
- t?.aborted && n("IMPORT_ABORTED", {
1565
- detail: `The import of "${r.name}" was aborted`,
1566
- meta: { fileName: r.name }
1683
+ function $(e) {
1684
+ let { signal: t, file: n } = e;
1685
+ t?.aborted && o("IMPORT_ABORTED", {
1686
+ detail: `The import of "${n.name}" was aborted`,
1687
+ meta: { fileName: n.name }
1567
1688
  });
1568
1689
  }
1569
- function je(e, t) {
1690
+ function Be(e, t) {
1570
1691
  let n = new Uint8Array(e.length + t.length);
1571
1692
  return n.set(e), n.set(t, e.length), n;
1572
1693
  }
1573
- async function $(e) {
1574
- let { sax: t, session: n, store: r, documentId: i, file: a, threshold: o, perf: s, control: c, reporter: l, bytesRead: u } = e;
1575
- if (t.getSize() < o) return 0;
1576
- Q({
1577
- signal: c.signal,
1578
- file: a
1579
- }), s.start("import::insert");
1580
- let d;
1694
+ async function Ve(e) {
1695
+ let { sax: t, store: n, documentId: r, file: i, threshold: a, perf: o, control: s, reporter: c, bytesRead: l } = e;
1696
+ if (t.getSize() < a) return 0;
1697
+ $({
1698
+ signal: s.signal,
1699
+ file: i
1700
+ }), o.start("import::insert");
1701
+ let u;
1581
1702
  try {
1582
- let e = n.resolveChildrenForBatch(t.drainBatch());
1583
- await r.bulkWrite(i, { creates: e }), d = e.length;
1703
+ let e = t.drainBatch();
1704
+ await n.bulkWrite(r, { creates: e }), u = e.length;
1584
1705
  } finally {
1585
- s.stop("import::insert");
1706
+ o.stop("import::insert");
1586
1707
  }
1587
- return l.tell({
1708
+ return c.tell({
1588
1709
  phase: "storing",
1589
- bytesRead: u
1590
- }), d;
1710
+ bytesRead: l
1711
+ }), u;
1591
1712
  }
1592
- async function Me(n, r = {}) {
1593
- let { runtime: i, file: a, options: o, writeId: s } = n, c = n.perf ?? x({
1594
- enabled: i.perf ?? !1,
1713
+ async function He(e, t = {}) {
1714
+ let { runtime: n, file: i, options: o, writeId: s } = e, c = e.perf ?? b({
1715
+ enabled: n.perf ?? !1,
1595
1716
  timeline: !1
1596
1717
  });
1597
- Q({
1598
- signal: r.signal,
1599
- file: a
1718
+ $({
1719
+ signal: t.signal,
1720
+ file: i
1600
1721
  });
1601
- let { configKey: l, config: u } = v({
1602
- configs: i.configs,
1603
- defaultConfigKey: i.defaultConfigKey,
1722
+ let { configKey: l, config: u } = _({
1723
+ configs: n.configs,
1724
+ defaultConfigKey: n.defaultConfigKey,
1604
1725
  configKey: o?.configKey
1605
1726
  }), d = {
1606
1727
  id: crypto.randomUUID(),
1607
- ...Ne({
1608
- file: a,
1728
+ ...Ue({
1729
+ file: i,
1609
1730
  path: o?.path,
1610
1731
  config: u
1611
1732
  }),
@@ -1615,47 +1736,47 @@ async function Me(n, r = {}) {
1615
1736
  status: "importing",
1616
1737
  writeId: s,
1617
1738
  ...o?.path !== void 0 && { path: o.path }
1618
- }, f = K({
1619
- totalBytes: a.size,
1620
- listener: r.onProgress,
1739
+ }, f = J({
1740
+ totalBytes: i.size,
1741
+ listener: t.onProgress,
1621
1742
  perf: c
1622
1743
  });
1623
1744
  c.start("import");
1624
1745
  let p;
1625
1746
  try {
1626
- p = await Pe({
1627
- ...n,
1628
- control: r,
1747
+ p = await We({
1748
+ ...e,
1749
+ control: t,
1629
1750
  registered: d,
1630
1751
  config: u,
1631
1752
  perf: c,
1632
1753
  reporter: f
1633
1754
  });
1634
- } catch (n) {
1635
- throw e(n) ? n : t("IMPORT_FAILED", {
1636
- detail: n instanceof Error ? n.message : String(n),
1637
- cause: n instanceof Error ? n : void 0
1755
+ } catch (e) {
1756
+ throw r(e) ? e : a("IMPORT_FAILED", {
1757
+ detail: e instanceof Error ? e.message : String(e),
1758
+ cause: e instanceof Error ? e : void 0
1638
1759
  });
1639
1760
  } finally {
1640
1761
  f.close(), c.stop("import");
1641
1762
  }
1642
1763
  return {
1643
1764
  ...p,
1644
- ...i.perf && { perf: c.snapshot() }
1765
+ ...n.perf && { perf: c.snapshot() }
1645
1766
  };
1646
1767
  }
1647
- function Ne(e) {
1648
- let { file: t, path: n, config: r } = e, i = N({ extensions: r.io.supportedFileExtensions });
1768
+ function Ue(e) {
1769
+ let { file: t, path: n, config: r } = e, i = z({ extensions: r.io.supportedFileExtensions });
1649
1770
  return n === void 0 ? {
1650
1771
  name: t.name.replace(/\.[^.]+$/, "") || "untitled",
1651
1772
  extension: t.name.includes(".") ? `.${t.name.split(".").pop()}` : i[0]
1652
- } : P({
1773
+ } : B({
1653
1774
  path: n,
1654
1775
  extensions: i
1655
1776
  });
1656
1777
  }
1657
- async function Pe(e) {
1658
- let { store: t, runtime: r, file: i, options: a, control: o, registered: s, config: c, perf: l, reporter: u } = e;
1778
+ async function We(e) {
1779
+ let { store: t, runtime: n, file: r, options: i, control: a, registered: s, config: c, perf: l, reporter: u } = e;
1659
1780
  l.start("import::register");
1660
1781
  try {
1661
1782
  await t.registerDocument(s);
@@ -1663,25 +1784,25 @@ async function Pe(e) {
1663
1784
  l.stop("import::register");
1664
1785
  }
1665
1786
  try {
1666
- let e = await X({
1667
- file: i,
1787
+ let e = await Z({
1788
+ file: r,
1668
1789
  documentId: s.id,
1669
1790
  configKey: s.configKey,
1670
1791
  store: t,
1671
1792
  config: c,
1672
- useCustomRecordsIds: a?.useCustomRecordsIds,
1673
- chunkOptions: a?.chunkOptions,
1674
- hooks: r.hooks,
1793
+ useCustomRecordsIds: i?.useCustomRecordsIds,
1794
+ chunkOptions: i?.chunkOptions,
1795
+ hooks: n.hooks,
1675
1796
  perf: l,
1676
1797
  reporter: u
1677
- }, o);
1678
- Q({
1679
- signal: o.signal,
1680
- file: i
1798
+ }, a);
1799
+ $({
1800
+ signal: a.signal,
1801
+ file: r
1681
1802
  }), u.tell({ phase: "finishing" }), l.start("import::finalize");
1682
1803
  try {
1683
- await t.getDocument(s.id) || n("DOCUMENT_NOT_REGISTERED", {
1684
- detail: `Document "${s.id}" of "${i.name}" was removed while it imported`,
1804
+ await t.getDocument(s.id) || o("DOCUMENT_NOT_REGISTERED", {
1805
+ detail: `Document "${s.id}" of "${r.name}" was removed while it imported`,
1685
1806
  meta: { documentId: s.id }
1686
1807
  }), await t.markReady(s.id);
1687
1808
  } finally {
@@ -1696,33 +1817,33 @@ async function Pe(e) {
1696
1817
  diagnostics: e.diagnostics
1697
1818
  };
1698
1819
  } catch (e) {
1699
- throw await Fe({
1820
+ throw await Ge({
1700
1821
  store: t,
1701
1822
  documentId: s.id
1702
1823
  }), e;
1703
1824
  }
1704
1825
  }
1705
- async function Fe(e) {
1826
+ async function Ge(e) {
1706
1827
  let { store: t, documentId: n } = e;
1707
1828
  try {
1708
1829
  await t.removeDocument(n);
1709
1830
  } catch {}
1710
1831
  }
1711
- var Ie = {
1832
+ var Ke = {
1712
1833
  import: "IMPORT_FAILED",
1713
1834
  export: "ASSERTION_FAILED"
1714
1835
  };
1715
- function Le(e) {
1716
- let { runtime: t, storeName: r, operation: i } = e;
1717
- return t || n(Ie[i], { detail: `Store "${r}" has no dialecte to ${i} with: build it with a runtime` }), t;
1836
+ function qe(e) {
1837
+ let { runtime: t, storeName: n, operation: r } = e;
1838
+ return t || o(Ke[r], { detail: `Store "${n}" has no dialecte to ${r} with: build it with a runtime` }), t;
1718
1839
  }
1719
- function Re(e, t) {
1840
+ function Je(e, t) {
1720
1841
  return e.id < t.id ? -1 : +(e.id > t.id);
1721
1842
  }
1722
- function ze(e) {
1723
- return Be({ value: e.first }) === Be({ value: e.second });
1843
+ function Ye(e) {
1844
+ return Xe({ value: e.first }) === Xe({ value: e.second });
1724
1845
  }
1725
- function Be(e) {
1846
+ function Xe(e) {
1726
1847
  return JSON.stringify(e.value, function(e, t) {
1727
1848
  return typeof t != "object" || !t || Array.isArray(t) ? t : Object.fromEntries(Object.entries(t).sort(function([e], [t]) {
1728
1849
  return e < t ? -1 : +(e > t);
@@ -1730,4 +1851,4 @@ function Be(e) {
1730
1851
  });
1731
1852
  }
1732
1853
  //#endregion
1733
- export { D as E, E as T, R as _, X as a, k as b, G as d, U as f, M as g, L as h, Me as i, I as m, Re as n, Q as o, H as p, Le as r, q as s, ze as t, oe as u, N as v, A as w, O as x, P as y };
1854
+ export { O as A, L as C, N as D, A as E, T as N, w as P, P as T, z as _, Z as a, F as b, re as d, ne as f, W as g, R as h, He as i, k as j, de as l, U as m, Je as n, $ as o, H as p, qe as r, Ye as t, ie as u, B as v, M as w, I as y };