@dpuse/dpuse-shared 1.0.229 → 1.0.231

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.
@@ -432,7 +432,7 @@ function E(e, t) {
432
432
  });
433
433
  }
434
434
  /* @__NO_SIDE_EFFECTS__ */
435
- function ee(...e) {
435
+ function D(...e) {
436
436
  return d({
437
437
  ...e[0],
438
438
  pipe: e,
@@ -449,7 +449,7 @@ function ee(...e) {
449
449
  });
450
450
  }
451
451
  /* @__NO_SIDE_EFFECTS__ */
452
- function D(e, t, n) {
452
+ function ee(e, t, n) {
453
453
  let r = e["~run"]({ value: t }, /* @__PURE__ */ a(n));
454
454
  return {
455
455
  typed: r.typed,
@@ -462,7 +462,7 @@ function D(e, t, n) {
462
462
  var O = /* @__PURE__ */ C({
463
463
  en: /* @__PURE__ */ w(),
464
464
  es: /* @__PURE__ */ w()
465
- }), te = {
465
+ }), k = {
466
466
  id: /* @__PURE__ */ w(),
467
467
  label: /* @__PURE__ */ C({
468
468
  en: /* @__PURE__ */ x(/* @__PURE__ */ w()),
@@ -474,7 +474,7 @@ var O = /* @__PURE__ */ C({
474
474
  }),
475
475
  icon: /* @__PURE__ */ y(/* @__PURE__ */ w()),
476
476
  iconDark: /* @__PURE__ */ y(/* @__PURE__ */ w())
477
- }, k = (e) => /* @__PURE__ */ E(e.map((e) => /* @__PURE__ */ _(e))), ne = k([
477
+ }, A = (e) => /* @__PURE__ */ E(e.map((e) => /* @__PURE__ */ _(e))), te = A([
478
478
  "app",
479
479
  "connector",
480
480
  "connectorConnection",
@@ -496,32 +496,32 @@ var O = /* @__PURE__ */ C({
496
496
  "presenter",
497
497
  "presenterPresentation",
498
498
  "tool"
499
- ]), re = k([
499
+ ]), ne = A([
500
500
  "danger",
501
501
  "success",
502
502
  "warning"
503
- ]), ie = k([
503
+ ]), re = A([
504
504
  "alpha",
505
505
  "beta",
506
506
  "releaseCandidate",
507
507
  "generalAvailability"
508
- ]), ae = /* @__PURE__ */ C({
509
- color: re,
508
+ ]), ie = /* @__PURE__ */ C({
509
+ color: ne,
510
510
  label: /* @__PURE__ */ w()
511
- }), oe = {
512
- ...te,
513
- typeId: ne
514
- }, se = /* @__PURE__ */ C({
515
- ...oe,
511
+ }), ae = {
512
+ ...k,
513
+ typeId: te
514
+ }, oe = /* @__PURE__ */ C({
515
+ ...ae,
516
516
  order: /* @__PURE__ */ b(),
517
517
  path: /* @__PURE__ */ w()
518
- }), ce = {
519
- ...oe,
518
+ }), se = {
519
+ ...ae,
520
520
  firstCreatedAt: /* @__PURE__ */ y(/* @__PURE__ */ b()),
521
521
  lastUpdatedAt: /* @__PURE__ */ y(/* @__PURE__ */ b()),
522
- status: /* @__PURE__ */ y(ae),
523
- statusId: /* @__PURE__ */ y(ie)
524
- }, le = /* @__PURE__ */ C({ ...ce }), ue = [
522
+ status: /* @__PURE__ */ y(ie),
523
+ statusId: /* @__PURE__ */ y(re)
524
+ }, ce = /* @__PURE__ */ C({ ...se }), le = [
525
525
  {
526
526
  id: "alpha",
527
527
  color: "danger",
@@ -555,8 +555,8 @@ var O = /* @__PURE__ */ C({
555
555
  }
556
556
  }
557
557
  ];
558
- function de(e, t = "en") {
559
- let n = ue.find((t) => t.id === e);
558
+ function ue(e, t = "en") {
559
+ let n = le.find((t) => t.id === e);
560
560
  if (n) {
561
561
  let e = n.labels[t] ?? n.labels.en ?? n.id;
562
562
  return {
@@ -570,7 +570,7 @@ function de(e, t = "en") {
570
570
  };
571
571
  }
572
572
  // src/component/dataView/index.ts
573
- var fe = [
573
+ var de = [
574
574
  {
575
575
  id: "arrow",
576
576
  isStructured: !1,
@@ -662,7 +662,7 @@ var fe = [
662
662
  isText: !1,
663
663
  supportId: "unsupported"
664
664
  }
665
- ], A = [
665
+ ], j = [
666
666
  {
667
667
  id: ",",
668
668
  character: ","
@@ -703,7 +703,7 @@ var fe = [
703
703
  id: "0x1E",
704
704
  character: ""
705
705
  }
706
- ], pe = [
706
+ ], fe = [
707
707
  {
708
708
  id: "string",
709
709
  defaultSubtypeId: "plain",
@@ -760,11 +760,11 @@ var fe = [
760
760
  isChoosable: !1,
761
761
  subtypeIds: []
762
762
  }
763
- ], me = [",", "."];
764
- function he(e) {
765
- return A.find(({ id: t }) => t === e)?.character ?? e;
763
+ ], pe = [",", "."];
764
+ function me(e) {
765
+ return j.find(({ id: t }) => t === e)?.character ?? e;
766
766
  }
767
- k([
767
+ A([
768
768
  "app",
769
769
  "engine",
770
770
  "connector",
@@ -773,16 +773,16 @@ k([
773
773
  "tool"
774
774
  ]);
775
775
  // src/component/module/moduleConfig.schema.ts
776
- var j = {
777
- ...ce,
776
+ var M = {
777
+ ...se,
778
778
  vendorAccountURL: /* @__PURE__ */ y(/* @__PURE__ */ w()),
779
779
  vendorDocumentationURL: /* @__PURE__ */ y(/* @__PURE__ */ w()),
780
780
  vendorHomeURL: /* @__PURE__ */ y(/* @__PURE__ */ w()),
781
781
  version: /* @__PURE__ */ w()
782
782
  };
783
- ({ ...j });
783
+ ({ ...M });
784
784
  // src/component/module/connector/connectorConfig.schema.ts
785
- var ge = k([
785
+ var he = A([
786
786
  "auditObjectContent",
787
787
  "closeStore",
788
788
  "createObject",
@@ -803,22 +803,22 @@ var ge = k([
803
803
  "removeRecords",
804
804
  "retrieveRecords",
805
805
  "upsertRecords"
806
- ]), _e = k([
806
+ ]), ge = A([
807
807
  "application",
808
808
  "curatedDataset",
809
809
  "database",
810
810
  "fileStore"
811
- ]), ve = /* @__PURE__ */ C({ label: O }), ye = k([
811
+ ]), _e = /* @__PURE__ */ C({ label: O }), ve = A([
812
812
  "apiEndpoint",
813
813
  "file",
814
814
  "table"
815
- ]), be = k([
815
+ ]), ye = A([
816
816
  "bidirectional",
817
817
  "destination",
818
818
  "source",
819
819
  "unknown"
820
- ]), xe = /* @__PURE__ */ C({ label: O }), Se = /* @__PURE__ */ C({
821
- authMethodId: k([
820
+ ]), be = /* @__PURE__ */ C({ label: O }), xe = /* @__PURE__ */ C({
821
+ authMethodId: A([
822
822
  "apiKey",
823
823
  "disabled",
824
824
  "oAuth2",
@@ -830,74 +830,74 @@ var ge = k([
830
830
  label: /* @__PURE__ */ x(O),
831
831
  maxConnectionCount: /* @__PURE__ */ y(/* @__PURE__ */ b()),
832
832
  params: /* @__PURE__ */ x(/* @__PURE__ */ h(/* @__PURE__ */ S(/* @__PURE__ */ w(), /* @__PURE__ */ w())))
833
- }), Ce = /* @__PURE__ */ C({
834
- ...j,
833
+ }), Se = /* @__PURE__ */ C({
834
+ ...M,
835
835
  typeId: /* @__PURE__ */ _("connector"),
836
- actionNames: /* @__PURE__ */ h(ge),
837
- category: /* @__PURE__ */ y(ve),
838
- categoryId: _e,
839
- implementations: /* @__PURE__ */ S(/* @__PURE__ */ w(), Se),
840
- itemTypeId: ye,
841
- usage: /* @__PURE__ */ y(xe),
842
- usageId: /* @__PURE__ */ y(be)
843
- }), we = /* @__PURE__ */ new Set([
836
+ actionNames: /* @__PURE__ */ h(he),
837
+ category: /* @__PURE__ */ y(_e),
838
+ categoryId: ge,
839
+ implementations: /* @__PURE__ */ S(/* @__PURE__ */ w(), xe),
840
+ itemTypeId: ve,
841
+ usage: /* @__PURE__ */ y(be),
842
+ usageId: /* @__PURE__ */ y(ye)
843
+ }), Ce = /* @__PURE__ */ new Set([
844
844
  "APIError",
845
845
  "AppError",
846
846
  "ConnectorError",
847
847
  "DPUseError",
848
848
  "EngineError",
849
849
  "FetchError"
850
- ]), Te = 2048, M = "[REDACTED]", Ee = 10, De = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i, Oe = [
851
- [/\b(Bearer|Basic) +[\w.~+/=-]+/gi, (e, t) => `${t} ${M}`],
852
- [/(?<![\w-])([\w-]+)(["']?[ \t]*[:=][ \t]*["']?)([^\s"'&,;}?#]+)/g, (e, t, n, r) => De.test(t) && !/^(?:Basic|Bearer)$/i.test(r) ? `${t}${n}${M}` : e],
853
- [/\beyJ[\w-]+\.[\w-]+\.[\w-]*/g, () => M],
854
- [/\b(?:sk-|xaat-|xapt-|sl\.)[\w-]{16,}/g, () => M],
855
- [/(?<![\w.+-])[\w.+-]+@[\w-]+\.[\w.-]+/g, () => M]
856
- ], N = class extends Error {
850
+ ]), we = 2048, N = "[REDACTED]", Te = 10, Ee = /api[-_]?key|authori[sz]ation|cookie|credential|passw(?:or)?d|private[-_]?key|secret|token/i, De = [
851
+ [/\b(Bearer|Basic) +[\w.~+/=-]+/gi, (e, t) => `${t} ${N}`],
852
+ [/(?<![\w-])([\w-]+)(["']?[ \t]*[:=][ \t]*["']?)([^\s"'&,;}?#]+)/g, (e, t, n, r) => Ee.test(t) && !/^(?:Basic|Bearer)$/i.test(r) ? `${t}${n}${N}` : e],
853
+ [/\beyJ[\w-]+\.[\w-]+\.[\w-]*/g, () => N],
854
+ [/\b(?:sk-|xaat-|xapt-|sl\.)[\w-]{16,}/g, () => N],
855
+ [/(?<![\w.+-])[\w.+-]+@[\w-]+\.[\w.-]+/g, () => N]
856
+ ], P = class extends Error {
857
857
  data;
858
858
  locator;
859
859
  constructor(e, t, n, r) {
860
860
  super(e, r), this.name = "DPUseError", this.data = n, this.locator = t;
861
861
  }
862
- }, P = class extends N {
862
+ }, F = class extends P {
863
863
  constructor(e, t, n, r) {
864
864
  super(e, t, n, r), this.name = "AppError";
865
865
  }
866
- }, ke = class extends N {
866
+ }, Oe = class extends P {
867
867
  constructor(e, t, n, r) {
868
868
  super(e, t, n, r), this.name = "APIError";
869
869
  }
870
- }, Ae = class extends N {
870
+ }, ke = class extends P {
871
871
  constructor(e, t, n, r) {
872
872
  super(e, t, n, r), this.name = "EngineError";
873
873
  }
874
- }, F = class extends N {
874
+ }, I = class extends P {
875
875
  constructor(e, t, n, r) {
876
876
  super(e, t, n, r), this.name = "ConnectorError";
877
877
  }
878
- }, I = class extends N {
878
+ }, L = class extends P {
879
879
  constructor(e, t, n, r) {
880
880
  super(e, t, n, r), this.name = "FetchError";
881
881
  }
882
882
  };
883
- async function je(e, t, n) {
883
+ async function R(e, t, n) {
884
884
  let r = ` - ${e.statusText}`, i = `${t} Response status '${String(e.status)}${e.statusText ? r : ""}' received.`, a;
885
885
  try {
886
886
  a = await e.text();
887
887
  } catch (e) {
888
- a = `<body unavailable: ${L(e).message}>`;
888
+ a = `<body unavailable: ${z(e).message}>`;
889
889
  }
890
- return new I(i, n, { body: ze(a) });
890
+ return new L(i, n, { body: Le(a) });
891
891
  }
892
- function Me(e) {
892
+ function Ae(e) {
893
893
  return e.map((e) => e.message).join(" ");
894
894
  }
895
- function Ne(e) {
895
+ function je(e) {
896
896
  try {
897
897
  e();
898
898
  } catch {}
899
899
  }
900
- function L(e) {
900
+ function z(e) {
901
901
  if (e instanceof Error) return e;
902
902
  if (typeof e == "string") return Error(e);
903
903
  if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return Error(String(e));
@@ -909,24 +909,24 @@ function L(e) {
909
909
  }
910
910
  return /* @__PURE__ */ Error("Unknown error");
911
911
  }
912
- function Pe(e) {
913
- let t = /* @__PURE__ */ new Set(), n = [], r = L(e);
912
+ function Me(e) {
913
+ let t = /* @__PURE__ */ new Set(), n = [], r = z(e);
914
914
  for (; r != null && !t.has(r);) {
915
915
  t.add(r);
916
- let [e, i] = Ve(r), a = Re(e);
916
+ let [e, i] = ze(r), a = Ie(e);
917
917
  /(?:\.{3}|[.!?])$/.test(a.message) || (a.message += "."), n.push(a), r = i;
918
918
  }
919
919
  return n;
920
920
  }
921
- function Fe(e) {
921
+ function Ne(e) {
922
922
  let t;
923
923
  for (let n of e.toReversed()) {
924
- let e = Le(n, t);
924
+ let e = Fe(n, t);
925
925
  n.stack !== void 0 && (e.stack = n.stack), t = e;
926
926
  }
927
927
  return t ?? /* @__PURE__ */ Error("No error to unserialise.");
928
928
  }
929
- function Ie(e) {
929
+ function Pe(e) {
930
930
  let t;
931
931
  try {
932
932
  t = JSON.stringify(e);
@@ -935,13 +935,13 @@ function Ie(e) {
935
935
  }
936
936
  return t === "" && (t = "Unknown error"), t;
937
937
  }
938
- function Le(e, t) {
938
+ function Fe(e, t) {
939
939
  switch (e.name) {
940
- case "APIError": return new ke(e.message, e.locator, e.data, { cause: t });
941
- case "AppError": return new P(e.message, e.locator, e.data, { cause: t });
942
- case "ConnectorError": return new F(e.message, e.locator, e.data, { cause: t });
943
- case "EngineError": return new Ae(e.message, e.locator, e.data, { cause: t });
944
- case "FetchError": return new I(e.message, e.locator, e.data, { cause: t });
940
+ case "APIError": return new Oe(e.message, e.locator, e.data, { cause: t });
941
+ case "AppError": return new F(e.message, e.locator, e.data, { cause: t });
942
+ case "ConnectorError": return new I(e.message, e.locator, e.data, { cause: t });
943
+ case "EngineError": return new ke(e.message, e.locator, e.data, { cause: t });
944
+ case "FetchError": return new L(e.message, e.locator, e.data, { cause: t });
945
945
  default: {
946
946
  let n = e.name;
947
947
  return new class extends Error {
@@ -950,32 +950,32 @@ function Le(e, t) {
950
950
  }
951
951
  }
952
952
  }
953
- function Re(e) {
953
+ function Ie(e) {
954
954
  let { data: t, message: n, stack: r } = e;
955
955
  return {
956
956
  ...e,
957
- data: t === void 0 ? void 0 : z(t, /* @__PURE__ */ new WeakSet(), 0),
958
- message: R(n),
959
- stack: r === void 0 ? void 0 : R(r)
957
+ data: t === void 0 ? void 0 : V(t, /* @__PURE__ */ new WeakSet(), 0),
958
+ message: B(n),
959
+ stack: r === void 0 ? void 0 : B(r)
960
960
  };
961
961
  }
962
- function R(e) {
962
+ function B(e) {
963
963
  let t = e;
964
- for (let [e, n] of Oe) t = t.replaceAll(e, (e, ...t) => n(e, ...t));
964
+ for (let [e, n] of De) t = t.replaceAll(e, (e, ...t) => n(e, ...t));
965
965
  return t;
966
966
  }
967
- function z(e, t, n) {
968
- return typeof e == "string" ? R(e) : typeof e != "object" || !e ? e : n >= Ee ? M : t.has(e) ? "[Circular]" : (t.add(e), Array.isArray(e) ? e.map((e) => z(e, t, n + 1)) : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, r != null && De.test(e) ? M : z(r, t, n + 1)])));
967
+ function V(e, t, n) {
968
+ return typeof e == "string" ? B(e) : typeof e != "object" || !e ? e : n >= Te ? N : t.has(e) ? "[Circular]" : (t.add(e), Array.isArray(e) ? e.map((e) => V(e, t, n + 1)) : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, r != null && Ee.test(e) ? N : V(r, t, n + 1)])));
969
969
  }
970
- function ze(e) {
971
- if (e != null && e !== "") return e.length > Te ? `${e.slice(0, Te)}... [truncated]` : e;
970
+ function Le(e) {
971
+ if (e != null && e !== "") return e.length > we ? `${e.slice(0, we)}... [truncated]` : e;
972
972
  }
973
- function Be(e) {
974
- return e instanceof N || we.has(e.name) && typeof e.locator == "string";
973
+ function Re(e) {
974
+ return e instanceof P || Ce.has(e.name) && typeof e.locator == "string";
975
975
  }
976
- function Ve(e) {
977
- let t = e.cause == null ? null : L(e.cause);
978
- if (Be(e)) return [{
976
+ function ze(e) {
977
+ let t = e.cause == null ? null : z(e.cause);
978
+ if (Re(e)) return [{
979
979
  data: e.data,
980
980
  locator: e.locator,
981
981
  message: e.message,
@@ -992,46 +992,46 @@ function Ve(e) {
992
992
  }, t] : [{
993
993
  data: n,
994
994
  locator: "",
995
- message: Ie(e),
995
+ message: Pe(e),
996
996
  name: "Error",
997
997
  stack: void 0
998
998
  }, null];
999
999
  }
1000
1000
  // src/component/module/connector/objectFetching.ts
1001
- var He = 33554432, B = 416;
1002
- async function Ue(e, t) {
1003
- if (We()) {
1001
+ var Be = 33554432, H = 416;
1002
+ async function Ve(e, t) {
1003
+ if (He()) {
1004
1004
  let n = await fetch(e, {
1005
1005
  headers: t.headers ?? {},
1006
1006
  signal: t.signal
1007
1007
  });
1008
- if (!n.ok) throw await je(n, `Failed to fetch '${t.path}' file.`, t.locator);
1009
- return Ge(n, t);
1008
+ if (!n.ok) throw await R(n, `Failed to fetch '${t.path}' file.`, t.locator);
1009
+ return Ue(n, t);
1010
1010
  }
1011
- let n = await Ke(e, 0, t);
1012
- if (n.status !== 206 && n.status !== B) return Ge(n, t);
1011
+ let n = await We(e, 0, t);
1012
+ if (n.status !== 206 && n.status !== H) return Ue(n, t);
1013
1013
  let r = n, i = 0;
1014
1014
  return new ReadableStream({ pull: async (n) => {
1015
- let a = r ?? await Ke(e, i, t);
1016
- if (r = void 0, a.status === B) {
1015
+ let a = r ?? await We(e, i, t);
1016
+ if (r = void 0, a.status === H) {
1017
1017
  n.close();
1018
1018
  return;
1019
1019
  }
1020
- if (a.status !== 206) throw new F(`Failed to fetch part of '${t.path}' file.`, `${t.locator}.range`);
1020
+ if (a.status !== 206) throw new I(`Failed to fetch part of '${t.path}' file.`, `${t.locator}.range`);
1021
1021
  let o = new Uint8Array(await a.arrayBuffer());
1022
- i += o.length, o.length > 0 && n.enqueue(o), o.length < He && n.close();
1022
+ i += o.length, o.length > 0 && n.enqueue(o), o.length < Be && n.close();
1023
1023
  } }, { highWaterMark: 0 });
1024
1024
  }
1025
- function We() {
1025
+ function He() {
1026
1026
  let { userAgentData: e } = globalThis.navigator;
1027
1027
  return e?.brands.some(({ brand: e }) => e === "Chromium") === !0;
1028
1028
  }
1029
- function Ge(e, t) {
1030
- if (e.body == null) throw new F("Readable streams are not supported in this runtime.", `${t.locator}.unsupported`);
1029
+ function Ue(e, t) {
1030
+ if (e.body == null) throw new I("Readable streams are not supported in this runtime.", `${t.locator}.unsupported`);
1031
1031
  return e.body;
1032
1032
  }
1033
- async function Ke(e, t, n) {
1034
- let r = `bytes=${String(t)}-${String(t + He - 1)}`, i = await fetch(e, {
1033
+ async function We(e, t, n) {
1034
+ let r = `bytes=${String(t)}-${String(t + Be - 1)}`, i = await fetch(e, {
1035
1035
  cache: "no-store",
1036
1036
  headers: {
1037
1037
  ...n.headers,
@@ -1039,11 +1039,11 @@ async function Ke(e, t, n) {
1039
1039
  },
1040
1040
  signal: n.signal
1041
1041
  });
1042
- if (!i.ok && i.status !== B) throw await je(i, `Failed to fetch '${n.path}' file.`, n.locator);
1042
+ if (!i.ok && i.status !== H) throw await R(i, `Failed to fetch '${n.path}' file.`, n.locator);
1043
1043
  return i;
1044
1044
  }
1045
1045
  // src/encoding/index.ts
1046
- var qe = {
1046
+ var Ge = {
1047
1047
  arabic: {
1048
1048
  id: "arabic",
1049
1049
  label: {
@@ -1198,7 +1198,7 @@ var qe = {
1198
1198
  es: "Occidental"
1199
1199
  }
1200
1200
  }
1201
- }, Je = {
1201
+ }, Ke = {
1202
1202
  "armscii-8": {
1203
1203
  id: "armscii-8",
1204
1204
  groupId: "armenian",
@@ -1990,16 +1990,16 @@ var qe = {
1990
1990
  textDecoderId: "windows-1257",
1991
1991
  iconvLiteDecoderId: "windows1257"
1992
1992
  }
1993
- }, Ye = qe, V = Je;
1994
- function Xe(e) {
1995
- return Object.hasOwn(V, e);
1993
+ }, qe = Ge, U = Ke;
1994
+ function Je(e) {
1995
+ return Object.hasOwn(U, e);
1996
1996
  }
1997
- function Ze(e) {
1998
- return Xe(e) ? V[e].textDecoderId ?? e : e;
1997
+ function W(e) {
1998
+ return Je(e) ? U[e].textDecoderId ?? e : e;
1999
1999
  }
2000
- function Qe(e = "en") {
2001
- return Array.from(Object.values(V), ({ groupId: t, iconvLiteDecoderId: n, id: r, isDetectable: i, textDecoderId: a }) => {
2002
- let o = t == null ? "" : $e(t, e);
2000
+ function Ye(e = "en") {
2001
+ return Array.from(Object.values(U), ({ groupId: t, iconvLiteDecoderId: n, id: r, isDetectable: i, textDecoderId: a }) => {
2002
+ let o = t == null ? "" : Xe(t, e);
2003
2003
  return {
2004
2004
  id: r,
2005
2005
  groupLabel: o,
@@ -2011,11 +2011,11 @@ function Qe(e = "en") {
2011
2011
  };
2012
2012
  }).toSorted((t, n) => t.groupLabel.localeCompare(n.groupLabel, e) || t.id.localeCompare(n.id, e, { numeric: !0 }));
2013
2013
  }
2014
- function $e(e, t) {
2015
- let n = Ye[e].label;
2014
+ function Xe(e, t) {
2015
+ let n = qe[e].label;
2016
2016
  return n[t] ?? n.en ?? e;
2017
2017
  }
2018
- var et = /* @__PURE__ */ C({ dataFormatIds: /* @__PURE__ */ ee(/* @__PURE__ */ h(k([
2018
+ var Ze = /* @__PURE__ */ C({ dataFormatIds: /* @__PURE__ */ D(/* @__PURE__ */ h(A([
2019
2019
  "arrow",
2020
2020
  "avro",
2021
2021
  "dtv",
@@ -2028,32 +2028,36 @@ var et = /* @__PURE__ */ C({ dataFormatIds: /* @__PURE__ */ ee(/* @__PURE__ */ h
2028
2028
  "sqlite",
2029
2029
  "xlsx",
2030
2030
  "xml"
2031
- ])), /* @__PURE__ */ f(1)) }), tt = /* @__PURE__ */ h(/* @__PURE__ */ w()), nt = /* @__PURE__ */ C({
2032
- ...j,
2031
+ ])), /* @__PURE__ */ f(1)) }), Qe = /* @__PURE__ */ h(/* @__PURE__ */ w()), $e = /* @__PURE__ */ C({
2032
+ ...M,
2033
2033
  typeId: /* @__PURE__ */ _("tool"),
2034
- actionNames: /* @__PURE__ */ x(tt),
2035
- parser: /* @__PURE__ */ x(et)
2034
+ actionNames: /* @__PURE__ */ x(Qe),
2035
+ parser: /* @__PURE__ */ x(Ze)
2036
2036
  });
2037
2037
  // src/component/module/tool/delimitedText.ts
2038
- async function rt(e, t, n) {
2039
- let r = it(e), { issues: i, parsedRecords: a, valueDelimiterId: o } = await at(e, t.valueDelimiterIds, t.isComplete, n);
2038
+ async function et(e, t, n) {
2039
+ let r = new TextDecoder(W(t.encodingId)).decode(e), i = {
2040
+ bytes: e,
2041
+ encodingId: t.encodingId,
2042
+ text: r
2043
+ }, a = tt(r), { issues: o, parsedRecords: s, valueDelimiterId: c } = await nt(i, t.valueDelimiterIds, t.isComplete, n);
2040
2044
  return {
2041
- issues: i,
2042
- parsedRecords: a,
2043
- recordDelimiterId: r,
2044
- valueDelimiterId: o
2045
+ issues: o,
2046
+ parsedRecords: s,
2047
+ recordDelimiterId: a,
2048
+ valueDelimiterId: c
2045
2049
  };
2046
2050
  }
2047
- function it(e) {
2051
+ function tt(e) {
2048
2052
  let t = (e.match(/\r\n/g) ?? []).length, n = (e.match(/(?<!\r)\n/g) ?? []).length, r = (e.match(/\r(?!\n)/g) ?? []).length;
2049
2053
  return t >= n && t >= r ? "\r\n" : n >= t && n >= r ? "\n" : r >= t && r >= n ? "\r" : "\n";
2050
2054
  }
2051
- async function at(e, t, n, r) {
2055
+ async function nt(e, t, n, r) {
2052
2056
  let i, a, o, s = [], c, l = !1;
2053
2057
  for (let u of t) {
2054
2058
  let { issues: t, records: d } = await r(e, u, n);
2055
2059
  if (t.length > 0) {
2056
- c = ot(c, {
2060
+ c = rt(c, {
2057
2061
  delimiter: u,
2058
2062
  issues: t,
2059
2063
  records: d
@@ -2061,7 +2065,7 @@ async function at(e, t, n, r) {
2061
2065
  continue;
2062
2066
  }
2063
2067
  if (l = !0, d.length === 0) continue;
2064
- let { averageValueCount: f, sumOfValueCountDiffs: p } = st(d);
2068
+ let { averageValueCount: f, sumOfValueCountDiffs: p } = it(d);
2065
2069
  (a === void 0 || a <= 1 || p <= (o ?? 0)) && (a === void 0 || f > a) && (i = u, a = f, o = p, s = d);
2066
2070
  }
2067
2071
  if (!l && c != null) {
@@ -2069,19 +2073,19 @@ async function at(e, t, n, r) {
2069
2073
  return {
2070
2074
  issues: t,
2071
2075
  parsedRecords: n,
2072
- valueDelimiterId: ct(n) ? e : void 0
2076
+ valueDelimiterId: at(n) ? e : void 0
2073
2077
  };
2074
2078
  }
2075
2079
  return {
2076
2080
  issues: [],
2077
2081
  parsedRecords: s,
2078
- valueDelimiterId: i != null && ct(s) ? i : void 0
2082
+ valueDelimiterId: i != null && at(s) ? i : void 0
2079
2083
  };
2080
2084
  }
2081
- function ot(e, t) {
2085
+ function rt(e, t) {
2082
2086
  return e == null || t.issues.length < e.issues.length ? t : e;
2083
2087
  }
2084
- function st(e) {
2088
+ function it(e) {
2085
2089
  let t = 0, n = 0, r;
2086
2090
  for (let i of e) r != null && (n += Math.abs(i.length - r)), r = i.length, t += i.length;
2087
2091
  return {
@@ -2089,39 +2093,39 @@ function st(e) {
2089
2093
  sumOfValueCountDiffs: n
2090
2094
  };
2091
2095
  }
2092
- function ct(e) {
2096
+ function at(e) {
2093
2097
  let t = /* @__PURE__ */ new Map();
2094
2098
  for (let n of e) t.set(n.length, (t.get(n.length) ?? 0) + 1);
2095
2099
  let [n = 0, r = 0] = [...t].toSorted((e, t) => t[1] - e[1])[0] ?? [];
2096
2100
  return n > 1 && r * 2 > e.length;
2097
2101
  }
2098
2102
  // src/component/module/tool/index.ts
2099
- var lt = "https://engine-eu.dpuse.app/tools", ut = { dtv: "dpuse-tool-rust-csv-core-parser" }, H = "dpuse-tool-";
2100
- function U(e, t) {
2103
+ var ot = "https://engine-eu.dpuse.app/tools", st = { dtv: "dpuse-tool-rust-csv-core-parser" }, G = "dpuse-tool-";
2104
+ function K(e, t) {
2101
2105
  return e.filter((e) => e.parser?.dataFormatIds.some((e) => e === t) === !0).toSorted((e, t) => e.id.localeCompare(t.id, "en"));
2102
2106
  }
2103
- function dt(e, t, n) {
2104
- let r = U(e, t), [i] = r;
2107
+ function q(e, t, n) {
2108
+ let r = K(e, t), [i] = r;
2105
2109
  if (i === void 0) {
2106
2110
  let n = {
2107
2111
  availableToolIds: e.map((e) => e.id),
2108
2112
  dataFormatId: t
2109
2113
  };
2110
- throw new P(`No tool reads the '${t}' data format.`, "dpuse-shared.component.module.tool.resolveParserToolConfig", n);
2114
+ throw new F(`No tool reads the '${t}' data format.`, "dpuse-shared.component.module.tool.resolveParserToolConfig", n);
2111
2115
  }
2112
- let a = ut[t];
2116
+ let a = st[t];
2113
2117
  return r.find((e) => e.id === n) ?? r.find((e) => e.id === a) ?? i;
2114
2118
  }
2115
- async function ft(e, t) {
2116
- let n = `${H}${t}`, r = e.find((e) => e.id === n);
2119
+ async function ct(e, t) {
2120
+ let n = `${G}${t}`, r = e.find((e) => e.id === n);
2117
2121
  if (!r) {
2118
2122
  let r = {
2119
2123
  availableToolIds: e.map((e) => e.id),
2120
2124
  toolName: n
2121
2125
  };
2122
- throw new P(`Tool '${t}' not found.`, "dpuse-shared.component.module.tool.loadTool", r);
2126
+ throw new F(`Tool '${t}' not found.`, "dpuse-shared.component.module.tool.loadTool", r);
2123
2127
  }
2124
- let i = `${lt}/${t}_v${r.version}/${n}.es.js`;
2128
+ let i = `${ot}/${t}_v${r.version}/${n}.es.js`;
2125
2129
  try {
2126
2130
  return new (await (import(
2127
2131
  /* @vite-ignore */
@@ -2133,12 +2137,12 @@ async function ft(e, t) {
2133
2137
  url: i,
2134
2138
  version: r.version
2135
2139
  };
2136
- throw new P(`Failed to load tool '${n}' v${r.version}.`, "dpuse-shared.component.module.tool.loadTool", t, { cause: e });
2140
+ throw new F(`Failed to load tool '${n}' v${r.version}.`, "dpuse-shared.component.module.tool.loadTool", t, { cause: e });
2137
2141
  }
2138
2142
  }
2139
2143
  // src/component/module/connector/objectParsing.ts
2140
- var pt = "\n", W = ",", G = new Set(fe.filter(({ isStructured: e }) => e).map(({ id: e }) => e)), mt = 13, K = 10, ht = 34, q = 1048576;
2141
- async function gt(e) {
2144
+ var lt = "\n", J = ",", ut = new Set(de.filter(({ isStructured: e }) => e).map(({ id: e }) => e)), dt = 13, ft = 10, pt = 34, mt = 1048576;
2145
+ async function ht(e) {
2142
2146
  let { asAt: t, declaredColumnConfigs: n, declaredReadingConfig: r, filePreview: i, inferDataTypes: a, readingChoiceConfig: o, startedAt: s, toolConfigs: c } = e, { isComplete: l, text: u } = i, d = r != null, f = i.bytes.length, p = {
2143
2147
  decodedEncodingId: i.decodedEncodingId,
2144
2148
  replacementCharacterCount: i.replacementCharacterCount
@@ -2148,7 +2152,7 @@ async function gt(e) {
2148
2152
  encodingSourceId: r?.encodingId == null ? i.encodingSourceId : void 0
2149
2153
  };
2150
2154
  if (f === 0) return {
2151
- contentAuditConfig: St({
2155
+ contentAuditConfig: xt({
2152
2156
  asAt: t,
2153
2157
  columns: [],
2154
2158
  isComplete: !0,
@@ -2172,10 +2176,10 @@ async function gt(e) {
2172
2176
  hasHeaders: !1,
2173
2177
  parsedRecords: [],
2174
2178
  parserId: void 0,
2175
- recordDelimiterId: pt,
2179
+ recordDelimiterId: lt,
2176
2180
  size: 0,
2177
2181
  text: void 0,
2178
- valueDelimiterId: W
2182
+ valueDelimiterId: J
2179
2183
  },
2180
2184
  readingConfig: {
2181
2185
  dataFormatId: "dtv",
@@ -2185,19 +2189,21 @@ async function gt(e) {
2185
2189
  hasHeaders: !1,
2186
2190
  isDeclared: d,
2187
2191
  parserId: void 0,
2188
- recordDelimiterId: pt,
2189
- valueDelimiterId: W
2192
+ recordDelimiterId: lt,
2193
+ valueDelimiterId: J
2190
2194
  },
2191
2195
  encodingCandidates: m
2192
2196
  };
2193
- let g = r?.dataFormatId ?? i.dataFormatId, _ = r?.valueDelimiterId, v = { duration: 0 }, y = await Ot({
2197
+ let g = r?.dataFormatId ?? i.dataFormatId, _ = r?.valueDelimiterId, v = { duration: 0 }, y = await Dt({
2194
2198
  dataFormatId: g,
2195
2199
  filePreview: i,
2196
2200
  parserId: void 0,
2197
2201
  parseTiming: v,
2198
2202
  toolConfigs: c
2199
- }), b = await Dt({
2203
+ }), b = i.decodedEncodingId ?? "utf-8", x = await Et({
2204
+ bytes: i.bytes,
2200
2205
  dataFormatId: g,
2206
+ encodingId: b,
2201
2207
  isComplete: l,
2202
2208
  parserId: void 0,
2203
2209
  parseTiming: v,
@@ -2206,72 +2212,74 @@ async function gt(e) {
2206
2212
  text: u,
2207
2213
  toolConfigs: c,
2208
2214
  valueDelimiterId: _
2209
- }), x = o?.dataFormatId ?? g, S = o?.dataFormatId != null || o?.parserId != null, C = S || o?.valueDelimiterId != null || o?.structurePath != null, w = S ? await Ot({
2210
- dataFormatId: x,
2215
+ }), S = o?.dataFormatId ?? g, C = o?.dataFormatId != null || o?.parserId != null, w = C || o?.valueDelimiterId != null || o?.structurePath != null, T = C ? await Dt({
2216
+ dataFormatId: S,
2211
2217
  filePreview: i,
2212
2218
  parserId: o.parserId,
2213
2219
  parseTiming: v,
2214
2220
  toolConfigs: c
2215
- }) : y, T = C ? await Dt({
2216
- dataFormatId: x,
2221
+ }) : y, E = w ? await Et({
2222
+ bytes: i.bytes,
2223
+ dataFormatId: S,
2224
+ encodingId: b,
2217
2225
  isComplete: l,
2218
2226
  parserId: o.parserId,
2219
2227
  parseTiming: v,
2220
- structureIndex: w,
2221
- structurePath: o.structurePath ?? w?.suggestedStructurePath,
2228
+ structureIndex: T,
2229
+ structurePath: o.structurePath ?? T?.suggestedStructurePath,
2222
2230
  text: u,
2223
2231
  toolConfigs: c,
2224
2232
  valueDelimiterId: _ ?? o.valueDelimiterId
2225
- }) : b, E = T?.parseTextResult.parsedRecords ?? [], ee = T?.parseTextResult.hasHeaders ?? r?.hasHeaders, D = performance.now(), O = T == null ? void 0 : a(E, ee, n), te = C && b != null ? a(b.parseTextResult.parsedRecords, b.parseTextResult.hasHeaders ?? r?.hasHeaders, n) : O;
2233
+ }) : x, D = E?.parsePreviewResult.parsedRecords ?? [], ee = E?.parsePreviewResult.hasHeaders ?? r?.hasHeaders, O = performance.now(), k = E == null ? void 0 : a(D, ee, n), A = w && x != null ? a(x.parsePreviewResult.parsedRecords, x.parsePreviewResult.hasHeaders ?? r?.hasHeaders, n) : k;
2226
2234
  return {
2227
- contentAuditConfig: St({
2235
+ contentAuditConfig: xt({
2228
2236
  asAt: t,
2229
- columnAuditDuration: performance.now() - D,
2230
- columns: O?.columnConfigs ?? [],
2237
+ columnAuditDuration: performance.now() - O,
2238
+ columns: k?.columnConfigs ?? [],
2231
2239
  isComplete: l,
2232
2240
  parseDuration: v.duration,
2233
- recordCount: Math.max(0, E.length - +(O?.hasHeaders === !0)),
2241
+ recordCount: Math.max(0, D.length - +(k?.hasHeaders === !0)),
2234
2242
  size: f,
2235
2243
  startedAt: s
2236
2244
  }),
2237
2245
  sampleConfig: {
2238
2246
  ...p,
2239
- dataFormatId: x ?? "unknown",
2240
- hasHeaders: O?.hasHeaders,
2241
- issues: T?.parseTextResult.issues ?? [],
2242
- parsedRecords: E,
2243
- parserId: T?.parserId,
2244
- recordDelimiterId: T?.parseTextResult.recordDelimiterId,
2247
+ dataFormatId: S ?? "unknown",
2248
+ hasHeaders: k?.hasHeaders,
2249
+ issues: E?.parsePreviewResult.issues ?? [],
2250
+ parsedRecords: D,
2251
+ parserId: E?.parserId,
2252
+ recordDelimiterId: E?.parsePreviewResult.recordDelimiterId,
2245
2253
  size: f,
2246
- structurePath: T?.structurePath,
2254
+ structurePath: E?.structurePath,
2247
2255
  text: u,
2248
- valueDelimiterId: T?.valueDelimiterId
2256
+ valueDelimiterId: E?.valueDelimiterId
2249
2257
  },
2250
2258
  readingConfig: {
2251
2259
  dataFormatId: g ?? "unknown",
2252
2260
  dataFormatSourceId: r == null ? i.dataFormatSourceId : void 0,
2253
2261
  ...h,
2254
2262
  fileType: i.fileTypeConfig,
2255
- hasHeaders: te?.hasHeaders,
2263
+ hasHeaders: A?.hasHeaders,
2256
2264
  isDeclared: d,
2257
- parserId: b?.parserId,
2258
- recordDelimiterId: b?.parseTextResult.recordDelimiterId,
2265
+ parserId: x?.parserId,
2266
+ recordDelimiterId: x?.parsePreviewResult.recordDelimiterId,
2259
2267
  structurePath: y?.suggestedStructurePath,
2260
- valueDelimiterId: b?.valueDelimiterId
2268
+ valueDelimiterId: x?.valueDelimiterId
2261
2269
  },
2262
2270
  encodingCandidates: m,
2263
- structureIndex: w
2271
+ structureIndex: T
2264
2272
  };
2265
2273
  }
2266
- async function* _t(e) {
2267
- let { options: t, signal: n, stream: r, toolConfigs: i } = e, { encodingId: a, valueDelimiterId: o } = xt(t), { parser: s } = await Y(i, t.dataFormatId, t.parserId), c = Et(r), l = s.parseStream(c.stream, {
2274
+ async function* gt(e) {
2275
+ let { options: t, signal: n, stream: r, toolConfigs: i } = e, { encodingId: a, valueDelimiterId: o } = bt(t), { parser: s } = await X(i, t.dataFormatId, t.parserId), c = Tt(r), l = s.parseStream(c.stream, {
2268
2276
  abortSignal: n,
2269
2277
  chunkSize: t.chunkSize,
2270
2278
  dataFormatId: t.dataFormatId,
2271
2279
  encodingId: a,
2272
2280
  structurePath: t.structurePath,
2273
2281
  valueDelimiterId: o
2274
- }), u = kt(l), d = !1;
2282
+ }), u = Ot(l), d = !1;
2275
2283
  try {
2276
2284
  let e = await u.readNext();
2277
2285
  for (; e.done !== !0;) yield e.value, e = await u.readNext();
@@ -2286,8 +2294,8 @@ async function* _t(e) {
2286
2294
  d || await l.return?.();
2287
2295
  }
2288
2296
  }
2289
- async function vt(e) {
2290
- let { constructColumnAuditor: t, declaredColumnConfigs: n, onProgress: r, options: i, signal: a, stream: o, toolConfigs: s } = e, { encodingId: c, valueDelimiterId: l } = xt(i), u = Date.now(), d = performance.now(), f = t(i.hasHeaders, n), { parser: p } = await Y(s, i.dataFormatId, i.parserId), m = Et(o), h = G.has(i.dataFormatId), g = h ? Tt(m.stream) : Ct(m.stream, {
2297
+ async function _t(e) {
2298
+ let { constructColumnAuditor: t, declaredColumnConfigs: n, onProgress: r, options: i, signal: a, stream: o, toolConfigs: s } = e, { encodingId: c, valueDelimiterId: l } = bt(i), u = Date.now(), d = performance.now(), f = t(i.hasHeaders, n), { parser: p } = await X(s, i.dataFormatId, i.parserId), m = Tt(o), h = ut.has(i.dataFormatId), g = h ? wt(m.stream) : St(m.stream, {
2291
2299
  byteLimit: i.byteLimit,
2292
2300
  encodingId: c,
2293
2301
  stopSignal: i.stopSignal
@@ -2300,7 +2308,7 @@ async function vt(e) {
2300
2308
  stopSignal: h ? i.stopSignal : void 0,
2301
2309
  structurePath: i.structurePath,
2302
2310
  valueDelimiterId: l
2303
- }), v = kt(_), y = 0, b = await v.readNext();
2311
+ }), v = Ot(_), y = 0, b = await v.readNext();
2304
2312
  for (; b.done !== !0;) {
2305
2313
  try {
2306
2314
  let e = performance.now();
@@ -2330,8 +2338,8 @@ async function vt(e) {
2330
2338
  hasHeaders: T
2331
2339
  };
2332
2340
  }
2333
- async function yt(e) {
2334
- let { onProgress: t, options: n, signal: r, stream: i, toolConfigs: a } = e, o = await X(a, n.dataFormatId, n.parserId), s = n.encodingId ?? "utf-8";
2341
+ async function vt(e) {
2342
+ let { onProgress: t, options: n, signal: r, stream: i, toolConfigs: a } = e, o = await kt(a, n.dataFormatId, n.parserId), s = n.encodingId ?? "utf-8";
2335
2343
  return await o.buildStructureIndex(i, {
2336
2344
  abortSignal: r,
2337
2345
  dataFormatId: n.dataFormatId,
@@ -2341,9 +2349,9 @@ async function yt(e) {
2341
2349
  onProgress: t
2342
2350
  });
2343
2351
  }
2344
- async function bt(e) {
2352
+ async function yt(e) {
2345
2353
  let { options: t, signal: n, stream: r, toolConfigs: i } = e;
2346
- return await (await X(i, t.dataFormatId, t.parserId)).listStructureEntries(r, {
2354
+ return await (await kt(i, t.dataFormatId, t.parserId)).listStructureEntries(r, {
2347
2355
  abortSignal: n,
2348
2356
  dataFormatId: t.dataFormatId,
2349
2357
  entryCount: t.entryCount,
@@ -2352,15 +2360,15 @@ async function bt(e) {
2352
2360
  path: t.structurePath
2353
2361
  });
2354
2362
  }
2355
- function xt(e) {
2356
- let t = e.valueDelimiterId ?? (G.has(e.dataFormatId) ? "" : void 0);
2363
+ function bt(e) {
2364
+ let t = e.valueDelimiterId ?? (ut.has(e.dataFormatId) ? "" : void 0);
2357
2365
  if (t == null || e.encodingId == null) throw Error(`'${e.path}' has no encoding or value delimiter, which a parser needs to read it.`);
2358
2366
  return {
2359
2367
  encodingId: e.encodingId,
2360
2368
  valueDelimiterId: t
2361
2369
  };
2362
2370
  }
2363
- function St(e) {
2371
+ function xt(e) {
2364
2372
  let { asAt: t, columnAuditDuration: n, columns: r, isComplete: i, parseDuration: a, recordCount: o, size: s, startedAt: c } = e;
2365
2373
  return {
2366
2374
  asAt: t,
@@ -2378,8 +2386,8 @@ function St(e) {
2378
2386
  columnAuditDuration: n
2379
2387
  };
2380
2388
  }
2381
- function Ct(e, t) {
2382
- let n = e.getReader(), r = wt(t.encodingId), i = 0, a = !1, o;
2389
+ function St(e, t) {
2390
+ let n = e.getReader(), r = Ct(t.encodingId), i = 0, a = !1, o;
2383
2391
  return {
2384
2392
  byteCount: () => i,
2385
2393
  isComplete: () => a,
@@ -2394,8 +2402,8 @@ function Ct(e, t) {
2394
2402
  }
2395
2403
  s = t.value;
2396
2404
  }
2397
- let c = s.subarray(0, q);
2398
- o = s.length > q ? s.subarray(q) : void 0;
2405
+ let c = s.subarray(0, mt);
2406
+ o = s.length > mt ? s.subarray(mt) : void 0;
2399
2407
  let l = t.stopSignal?.aborted === !0 ? i : t.byteLimit ?? Infinity, u = r(c, i, l - i);
2400
2408
  u == null ? (i += c.length, e.enqueue(c)) : (i += u, o = void 0, e.enqueue(c.subarray(0, u)), e.close(), await n.cancel());
2401
2409
  },
@@ -2405,19 +2413,19 @@ function Ct(e, t) {
2405
2413
  }, { highWaterMark: 0 })
2406
2414
  };
2407
2415
  }
2408
- function wt(e) {
2409
- let t = Ze(e), n = t.startsWith("utf-16"), r = n ? 2 : 1, i = +(t === "utf-16be"), a = !1;
2416
+ function Ct(e) {
2417
+ let t = W(e), n = t.startsWith("utf-16"), r = n ? 2 : 1, i = +(t === "utf-16be"), a = !1;
2410
2418
  return (e, t, o) => {
2411
2419
  for (let s = 0; s < e.length; s++) {
2412
2420
  let c = e[s];
2413
- if ((c === ht || c === K || c === mt) && (!n || (t + s) % 2 === i && e[s + 1 - 2 * i] === 0)) {
2414
- if (c === ht) a = !a;
2415
- else if (!a && s >= o && (c === K || e[s + r] !== K)) return s + r - i;
2421
+ if ((c === pt || c === ft || c === dt) && (!n || (t + s) % 2 === i && e[s + 1 - 2 * i] === 0)) {
2422
+ if (c === pt) a = !a;
2423
+ else if (!a && s >= o && (c === ft || e[s + r] !== ft)) return s + r - i;
2416
2424
  }
2417
2425
  }
2418
2426
  };
2419
2427
  }
2420
- function Tt(e) {
2428
+ function wt(e) {
2421
2429
  let t = e.getReader(), n = 0, r = !1;
2422
2430
  return {
2423
2431
  byteCount: () => n,
@@ -2433,7 +2441,7 @@ function Tt(e) {
2433
2441
  }, { highWaterMark: 0 })
2434
2442
  };
2435
2443
  }
2436
- function Et(e) {
2444
+ function Tt(e) {
2437
2445
  let t = e.getReader(), n = 0;
2438
2446
  return {
2439
2447
  stream: new ReadableStream({
@@ -2448,16 +2456,16 @@ function Et(e) {
2448
2456
  waitDuration: () => n
2449
2457
  };
2450
2458
  }
2451
- async function Dt(e) {
2452
- let { dataFormatId: t, isComplete: n, parserId: r, parseTiming: i, structureIndex: a, structurePath: o, text: s, toolConfigs: c, valueDelimiterId: l } = e;
2453
- if (t == null || s == null || U(c, t).length === 0) return;
2454
- let { parser: u, parserId: d } = await Y(c, t, r);
2455
- if (a != null) {
2456
- let e = a.nodes.length === 0 && a.issues.length > 0;
2457
- return e || o == null ? {
2458
- parserId: d,
2459
- parseTextResult: {
2460
- issues: e ? a.issues : [],
2459
+ async function Et(e) {
2460
+ let { bytes: t, dataFormatId: n, encodingId: r, isComplete: i, parserId: a, parseTiming: o, structureIndex: s, structurePath: c, text: l, toolConfigs: u, valueDelimiterId: d } = e;
2461
+ if (n == null || l == null || K(u, n).length === 0) return;
2462
+ let { parser: f, parserId: p } = await X(u, n, a);
2463
+ if (s != null) {
2464
+ let e = s.nodes.length === 0 && s.issues.length > 0;
2465
+ return e || c == null ? {
2466
+ parserId: p,
2467
+ parsePreviewResult: {
2468
+ issues: e ? s.issues : [],
2461
2469
  parsedRecords: [],
2462
2470
  recordDelimiterId: "\n",
2463
2471
  valueDelimiterId: void 0
@@ -2465,38 +2473,41 @@ async function Dt(e) {
2465
2473
  structurePath: void 0,
2466
2474
  valueDelimiterId: void 0
2467
2475
  } : {
2468
- parserId: d,
2469
- parseTextResult: await J(i, () => u.parseText(s, {
2470
- dataFormatId: t,
2471
- isComplete: n,
2472
- structurePath: o,
2476
+ parserId: p,
2477
+ parsePreviewResult: await Y(o, () => f.parsePreview(t, {
2478
+ dataFormatId: n,
2479
+ encodingId: r,
2480
+ isComplete: i,
2481
+ structurePath: c,
2473
2482
  valueDelimiterIds: []
2474
2483
  })),
2475
- structurePath: o,
2484
+ structurePath: c,
2476
2485
  valueDelimiterId: void 0
2477
2486
  };
2478
2487
  }
2479
- let f = l == null ? A.map(({ id: e }) => e) : [l], p = await J(i, () => u.parseText(s, {
2480
- dataFormatId: t,
2481
- isComplete: n,
2482
- valueDelimiterIds: f
2483
- })), m = t === "dtv", h = m && l == null && p.valueDelimiterId == null ? await J(i, () => u.parseText(s, {
2484
- dataFormatId: t,
2485
- isComplete: n,
2486
- valueDelimiterIds: [W]
2487
- })) : p;
2488
+ let m = d == null ? j.map(({ id: e }) => e) : [d], h = await Y(o, () => f.parsePreview(t, {
2489
+ dataFormatId: n,
2490
+ encodingId: r,
2491
+ isComplete: i,
2492
+ valueDelimiterIds: m
2493
+ })), g = n === "dtv", _ = g && d == null && h.valueDelimiterId == null ? await Y(o, () => f.parsePreview(t, {
2494
+ dataFormatId: n,
2495
+ encodingId: r,
2496
+ isComplete: i,
2497
+ valueDelimiterIds: [J]
2498
+ })) : h;
2488
2499
  return {
2489
- parserId: d,
2490
- parseTextResult: h,
2500
+ parserId: p,
2501
+ parsePreviewResult: _,
2491
2502
  structurePath: void 0,
2492
- valueDelimiterId: m ? l ?? h.valueDelimiterId ?? W : h.valueDelimiterId
2503
+ valueDelimiterId: g ? d ?? _.valueDelimiterId ?? J : _.valueDelimiterId
2493
2504
  };
2494
2505
  }
2495
- async function Ot(e) {
2506
+ async function Dt(e) {
2496
2507
  let { dataFormatId: t, filePreview: n, parserId: r, parseTiming: i, toolConfigs: a } = e;
2497
- if (!(t != null && G.has(t) && U(a, t).length > 0 && dt(a, t, r).actionNames?.includes("buildStructureIndex") === !0)) return;
2498
- let o = await X(a, t, r), s = new Blob([n.bytes]).stream(), c = n.decodedEncodingId ?? "utf-8";
2499
- return await J(i, () => o.buildStructureIndex(s, {
2508
+ if (!(t != null && ut.has(t) && K(a, t).length > 0 && q(a, t, r).actionNames?.includes("buildStructureIndex") === !0)) return;
2509
+ let o = await kt(a, t, r), s = new Blob([n.bytes]).stream(), c = n.decodedEncodingId ?? "utf-8";
2510
+ return await Y(i, () => o.buildStructureIndex(s, {
2500
2511
  abortSignal: new AbortController().signal,
2501
2512
  dataFormatId: t,
2502
2513
  encodingId: c,
@@ -2505,7 +2516,7 @@ async function Ot(e) {
2505
2516
  onProgress: void 0
2506
2517
  }));
2507
2518
  }
2508
- function kt(e) {
2519
+ function Ot(e) {
2509
2520
  let t = 0;
2510
2521
  return {
2511
2522
  duration: () => t,
@@ -2515,7 +2526,7 @@ function kt(e) {
2515
2526
  }
2516
2527
  };
2517
2528
  }
2518
- async function J(e, t) {
2529
+ async function Y(e, t) {
2519
2530
  let n = performance.now();
2520
2531
  try {
2521
2532
  return await t();
@@ -2523,21 +2534,21 @@ async function J(e, t) {
2523
2534
  e.duration += performance.now() - n;
2524
2535
  }
2525
2536
  }
2526
- async function Y(e, t, n) {
2527
- let r = dt(e, t, n);
2537
+ async function X(e, t, n) {
2538
+ let r = q(e, t, n);
2528
2539
  return {
2529
- parser: await ft(e, r.id.slice(H.length)),
2540
+ parser: await ct(e, r.id.slice(G.length)),
2530
2541
  parserId: r.id
2531
2542
  };
2532
2543
  }
2533
- async function X(e, t, n) {
2534
- let { parser: r, parserId: i } = await Y(e, t, n);
2535
- if (!("buildStructureIndex" in r)) throw new P(`Tool '${i}' does not map the structure of '${t}' items.`, "dpuse-shared.component.module.connector.objectParsing.loadStructuredParser");
2544
+ async function kt(e, t, n) {
2545
+ let { parser: r, parserId: i } = await X(e, t, n);
2546
+ if (!("buildStructureIndex" in r)) throw new F(`Tool '${i}' does not map the structure of '${t}' items.`, "dpuse-shared.component.module.connector.objectParsing.loadStructuredParser");
2536
2547
  return r;
2537
2548
  }
2538
2549
  // src/component/module/connector/storeErrors.ts
2539
2550
  function At(e, t, n, r) {
2540
- return new F(t, n, { storeErrorId: e }, r);
2551
+ return new I(t, n, { storeErrorId: e }, r);
2541
2552
  }
2542
2553
  function jt(e) {
2543
2554
  let t = /* @__PURE__ */ new Set();
@@ -2634,10 +2645,10 @@ var Lt = /* @__PURE__ */ v({ fields: /* @__PURE__ */ h(/* @__PURE__ */ v({
2634
2645
  uuid: "uuid"
2635
2646
  };
2636
2647
  function Vt(e) {
2637
- let t = /* @__PURE__ */ D(Lt, e.schema);
2638
- if (!t.success) throw new P("The table schema is not valid.", "dpuse-shared.component.module.connector.tableSchema.readTableSchema");
2639
- let n = /* @__PURE__ */ D(Rt, e.dialect ?? {});
2640
- if (!n.success) throw new P("The table dialect is not valid.", "dpuse-shared.component.module.connector.tableSchema.readTableSchema");
2648
+ let t = /* @__PURE__ */ ee(Lt, e.schema);
2649
+ if (!t.success) throw new F("The table schema is not valid.", "dpuse-shared.component.module.connector.tableSchema.readTableSchema");
2650
+ let n = /* @__PURE__ */ ee(Rt, e.dialect ?? {});
2651
+ if (!n.success) throw new F("The table dialect is not valid.", "dpuse-shared.component.module.connector.tableSchema.readTableSchema");
2641
2652
  let r = t.output.fields.map((e) => {
2642
2653
  let t = Ht(e.type, e.format);
2643
2654
  return {
@@ -2653,7 +2664,7 @@ function Vt(e) {
2653
2664
  dataFormatId: "dtv",
2654
2665
  encodingId: e.encoding?.toLowerCase(),
2655
2666
  hasHeaders: a && o.length > 0,
2656
- valueDelimiterId: A.find(({ character: e }) => e === i)?.id
2667
+ valueDelimiterId: j.find(({ character: e }) => e === i)?.id
2657
2668
  }
2658
2669
  };
2659
2670
  }
@@ -2829,26 +2840,26 @@ function $t(e) {
2829
2840
  return n;
2830
2841
  }
2831
2842
  // src/component/module/cookbook/cookbookConfig.schema.ts
2832
- var en = k(["list"]), tn = /* @__PURE__ */ C({
2833
- ...j,
2843
+ var en = A(["list"]), tn = /* @__PURE__ */ C({
2844
+ ...M,
2834
2845
  typeId: /* @__PURE__ */ _("cookbook"),
2835
2846
  actionNames: /* @__PURE__ */ h(en),
2836
- recipes: /* @__PURE__ */ h(se)
2847
+ recipes: /* @__PURE__ */ h(oe)
2837
2848
  });
2838
2849
  // src/component/module/engine/index.ts
2839
2850
  function nn(e) {
2840
2851
  return e.signal ?? new AbortController().signal;
2841
2852
  }
2842
2853
  // src/component/module/presenter/presenterConfig.schema.ts
2843
- var rn = k([
2854
+ var rn = A([
2844
2855
  "list",
2845
2856
  "render",
2846
2857
  "setColorMode"
2847
2858
  ]), an = /* @__PURE__ */ C({
2848
- ...j,
2859
+ ...M,
2849
2860
  typeId: /* @__PURE__ */ _("presenter"),
2850
2861
  actionNames: /* @__PURE__ */ h(rn),
2851
- presentations: /* @__PURE__ */ h(se)
2862
+ presentations: /* @__PURE__ */ h(oe)
2852
2863
  }), on = "https://engine-eu.dpuse.app/presenters";
2853
2864
  async function sn(e, t, n, r) {
2854
2865
  let i = e.id, a = `${on}/${i.split("-").slice(2).join("-")}_v${e.version}/${i}.es.js`;
@@ -2863,7 +2874,7 @@ async function sn(e, t, n, r) {
2863
2874
  url: a,
2864
2875
  version: e.version
2865
2876
  };
2866
- throw new P(`Failed to load presenter '${i}' v${e.version}.`, "dpuse-shared.component.module.presenter.loadPresenter", n, { cause: t });
2877
+ throw new F(`Failed to load presenter '${i}' v${e.version}.`, "dpuse-shared.component.module.presenter.loadPresenter", n, { cause: t });
2867
2878
  }
2868
2879
  }
2869
2880
  // src/locale/index.ts
@@ -3027,4 +3038,4 @@ function Dn(e, t) {
3027
3038
  let n = 10 ** t;
3028
3039
  return Math.round(e * n) / n;
3029
3040
  }
3030
- export { ke as APIError, P as AppError, F as ConnectorError, fe as DATA_FORMAT_CONFIGS, pe as DATA_TYPE_CONFIGS, me as DECIMAL_SEPARATOR_IDS, e as DEFAULT_LOCALE_ID, Ye as ENCODING_GROUP_CONFIG_MAP, V as ENCODING_TYPE_CONFIG_MAP, Ae as EngineError, I as FetchError, t as SUPPORTED_LANGUAGES, H as TOOL_NAME_PREFIX, A as VALUE_DELIMITER_CONFIGS, It as acquireWebLock, vt as auditObjectContentWithParser, je as buildFetchError, gt as buildPreviewObjectResult, le as componentInstanceConfigSchema, Me as concatenateSerialisedErrorMessages, Ce as connectorConfigSchema, Xt as constructConnectorCategoryConfig, Zt as constructConnectorItemTypeConfig, Qt as constructConnectorUsageConfig, At as constructStoreError, wn as convertODataTypeIdToUsageTypeId, Pt as convertStoreRecordToParsedRecord, Ft as convertStoreValueToText, tn as cookbookConfigSchema, n as createLabelMap, Yt as determineConnectorUsageId, xn as extractExtensionFromPath, bn as extractPathWithoutExtension, Ue as fetchObjectContentStream, jt as findStoreErrorId, hn as formatNumberAsDecimalNumber, yn as formatNumberAsDuration, _n as formatNumberAsSize, vn as formatNumberAsStorageSize, gn as formatNumberAsWholeNumber, de as getComponentStatus, $t as getConnectorActionsTable, Qe as getEncodingTypeConfigs, he as getValueDelimiterCharacter, Sn as hasMimeTypeForExtension, Ne as ignoreErrors, yt as indexObjectStructureWithParser, Xe as isEncodingTypeId, bt as listObjectStructureEntriesWithParser, U as listParserToolConfigs, sn as loadPresenter, ft as loadTool, cn as localiseConfig, ln as localiseConfigs, un as localiseReference, Cn as lookupMimeTypeForExtension, L as normalizeToError, rt as parseDelimitedText, an as presenterConfigSchema, Vt as readTableSchema, Ze as resolveDecoderId, r as resolveLabel, dt as resolveParserToolConfig, nn as resolveRequestSignal, Nt as resolveStorePath, _t as retrieveRecordsWithParser, Pe as serialiseError, nt as toolConfigSchema, Fe as unserialiseError };
3041
+ export { Oe as APIError, F as AppError, I as ConnectorError, de as DATA_FORMAT_CONFIGS, fe as DATA_TYPE_CONFIGS, pe as DECIMAL_SEPARATOR_IDS, e as DEFAULT_LOCALE_ID, qe as ENCODING_GROUP_CONFIG_MAP, U as ENCODING_TYPE_CONFIG_MAP, ke as EngineError, L as FetchError, t as SUPPORTED_LANGUAGES, G as TOOL_NAME_PREFIX, j as VALUE_DELIMITER_CONFIGS, It as acquireWebLock, _t as auditObjectContentWithParser, R as buildFetchError, ht as buildPreviewObjectResult, ce as componentInstanceConfigSchema, Ae as concatenateSerialisedErrorMessages, Se as connectorConfigSchema, Xt as constructConnectorCategoryConfig, Zt as constructConnectorItemTypeConfig, Qt as constructConnectorUsageConfig, At as constructStoreError, wn as convertODataTypeIdToUsageTypeId, Pt as convertStoreRecordToParsedRecord, Ft as convertStoreValueToText, tn as cookbookConfigSchema, n as createLabelMap, Yt as determineConnectorUsageId, xn as extractExtensionFromPath, bn as extractPathWithoutExtension, Ve as fetchObjectContentStream, jt as findStoreErrorId, hn as formatNumberAsDecimalNumber, yn as formatNumberAsDuration, _n as formatNumberAsSize, vn as formatNumberAsStorageSize, gn as formatNumberAsWholeNumber, ue as getComponentStatus, $t as getConnectorActionsTable, Ye as getEncodingTypeConfigs, me as getValueDelimiterCharacter, Sn as hasMimeTypeForExtension, je as ignoreErrors, vt as indexObjectStructureWithParser, Je as isEncodingTypeId, yt as listObjectStructureEntriesWithParser, K as listParserToolConfigs, sn as loadPresenter, ct as loadTool, cn as localiseConfig, ln as localiseConfigs, un as localiseReference, Cn as lookupMimeTypeForExtension, z as normalizeToError, et as parseDelimitedPreview, an as presenterConfigSchema, Vt as readTableSchema, W as resolveDecoderId, r as resolveLabel, q as resolveParserToolConfig, nn as resolveRequestSignal, Nt as resolveStorePath, gt as retrieveRecordsWithParser, Me as serialiseError, $e as toolConfigSchema, Ne as unserialiseError };