@etl-corestream/react 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/components/abort-button/abort-button.d.ts +6 -0
  2. package/dist/components/data-view/data-view-context.d.ts +18 -0
  3. package/dist/components/data-view/data-view-remove-trigger.d.ts +7 -0
  4. package/dist/components/data-view/data-view-root.d.ts +7 -0
  5. package/dist/components/data-view/data-view.d.ts +34 -0
  6. package/dist/components/data-view/edit-view/edit-view-new-input.d.ts +11 -0
  7. package/dist/components/data-view/edit-view/edit-view-previus-input.d.ts +8 -0
  8. package/dist/components/data-view/edit-view/edit-view-root.d.ts +8 -0
  9. package/dist/components/data-view/edit-view/edit-view-trigger-cancel.d.ts +7 -0
  10. package/dist/components/data-view/edit-view/edit-view-trigger-submit.d.ts +7 -0
  11. package/dist/components/data-view/filter/data-view-filter-context.d.ts +8 -0
  12. package/dist/components/data-view/filter/data-view-filter-errors-selector.d.ts +9 -0
  13. package/dist/components/data-view/filter/data-view-filter-root.d.ts +7 -0
  14. package/dist/components/data-view/filter/data-view-filter-trigger.d.ts +6 -0
  15. package/dist/components/data-view/filter/data-view-filter.d.ts +7 -0
  16. package/dist/components/data-view/pagination/pagination-page-first-button.d.ts +6 -0
  17. package/dist/components/data-view/pagination/pagination-page-last-button.d.ts +6 -0
  18. package/dist/components/data-view/pagination/pagination-page-next-button.d.ts +6 -0
  19. package/dist/components/data-view/pagination/pagination-page-number-button.d.ts +7 -0
  20. package/dist/components/data-view/pagination/pagination-page-previous-button.d.ts +6 -0
  21. package/dist/components/data-view/pagination/pagination-root.d.ts +6 -0
  22. package/dist/components/data-view/table/data-view-table-body.d.ts +9 -0
  23. package/dist/components/data-view/table/data-view-table-cell.d.ts +12 -0
  24. package/dist/components/data-view/table/data-view-table-header-cell.d.ts +11 -0
  25. package/dist/components/data-view/table/data-view-table-headers.d.ts +12 -0
  26. package/dist/components/data-view/table/data-view-table-row.d.ts +15 -0
  27. package/dist/components/data-view/table/data-view-table.d.ts +7 -0
  28. package/dist/components/data-view/table/index.d.ts +4 -0
  29. package/dist/components/etl/etl-context.d.ts +6 -0
  30. package/dist/components/etl/etl-root.d.ts +8 -0
  31. package/dist/components/etl/index.d.ts +2747 -0
  32. package/dist/components/etl/storybook/components/etl-recover.d.ts +1 -0
  33. package/dist/components/exporter/exporter-trigger.d.ts +8 -0
  34. package/dist/components/importer/importer-context.d.ts +4078 -0
  35. package/dist/components/importer/importer-dropzone.d.ts +7 -0
  36. package/dist/components/importer/importer-input.d.ts +5 -0
  37. package/dist/components/importer/importer-root.d.ts +8 -0
  38. package/dist/components/importer/importer-trigger.d.ts +7 -0
  39. package/dist/components/importer/importer.d.ts +2045 -0
  40. package/dist/components/index.d.ts +1 -0
  41. package/dist/components/layout-view/index.d.ts +650 -0
  42. package/dist/components/layout-view/layout-view-context.d.ts +12 -0
  43. package/dist/components/layout-view/layout-view-layouts-selector.d.ts +6 -0
  44. package/dist/components/layout-view/layout-view-root.d.ts +10 -0
  45. package/dist/components/layout-view/layout-view-select-layout-trigger.d.ts +8 -0
  46. package/dist/components/layout-view/layout-view.d.ts +5 -0
  47. package/dist/components/log-view/log-view.d.ts +9 -0
  48. package/dist/components/mapper/mapper-context.d.ts +7 -0
  49. package/dist/components/mapper/mapper-headers-view/mapper-header.d.ts +7 -0
  50. package/dist/components/mapper/mapper-headers-view/mapper-headers-selector.d.ts +12 -0
  51. package/dist/components/mapper/mapper-headers-view/mapper-headers-view.d.ts +9 -0
  52. package/dist/components/mapper/mapper-root.d.ts +10 -0
  53. package/dist/components/mapper/mapper-trigger-cancel.d.ts +7 -0
  54. package/dist/components/mapper/mapper-trigger-confirm.d.ts +7 -0
  55. package/dist/components/mapper/mapper.d.ts +8 -0
  56. package/dist/components/metrics-view/metrics-view-root.d.ts +7 -0
  57. package/dist/components/notifications-handler/notifications-handler.d.ts +5 -0
  58. package/dist/components/progress-view/progress-view-root.d.ts +7 -0
  59. package/dist/components/recovery-view/recover-cancel-button.d.ts +6 -0
  60. package/dist/components/recovery-view/recover-view.d.ts +7 -0
  61. package/dist/components/recovery-view/recover.d.ts +5 -0
  62. package/dist/components/recovery-view/recovert-accept-button.d.ts +6 -0
  63. package/dist/components/recovery-view/recovery.d.ts +1 -0
  64. package/dist/components/reset-button/reset-button.d.ts +6 -0
  65. package/dist/components/state-view/state-view.d.ts +7 -0
  66. package/dist/hooks/index.d.ts +15 -0
  67. package/dist/hooks/props-getters/use-abort-button.d.ts +298 -0
  68. package/dist/hooks/props-getters/use-data-view.d.ts +3749 -0
  69. package/dist/hooks/props-getters/use-exporter.d.ts +593 -0
  70. package/dist/hooks/props-getters/use-importer.d.ts +2048 -0
  71. package/dist/hooks/props-getters/use-layout-view.d.ts +647 -0
  72. package/dist/hooks/props-getters/use-mapper.d.ts +1171 -0
  73. package/dist/hooks/props-getters/use-recovery-view.d.ts +17 -0
  74. package/dist/hooks/props-getters/use-reset-button.d.ts +297 -0
  75. package/dist/hooks/use-etl-orchestrator.d.ts +2 -0
  76. package/dist/hooks/use-etl-state.d.ts +4 -0
  77. package/dist/hooks/use-log.d.ts +5 -0
  78. package/dist/hooks/use-metrics.d.ts +3 -0
  79. package/dist/hooks/use-notifications.d.ts +3 -0
  80. package/dist/hooks/use-progress.d.ts +7 -0
  81. package/dist/hooks/use-state-flgs.d.ts +9 -0
  82. package/dist/index.css +1 -1
  83. package/dist/index.d.ts +3 -1
  84. package/dist/index.js +1670 -1
  85. package/dist/index.umd.cjs +2 -2
  86. package/dist/setup.d.ts +1 -0
  87. package/dist/utils/call-all-fn.d.ts +1 -0
  88. package/dist/utils/index.d.ts +1 -0
  89. package/package.json +8 -7
  90. package/dist/favicon.svg +0 -1
  91. package/dist/icons.svg +0 -24
package/dist/index.js CHANGED
@@ -1 +1,1670 @@
1
- import './index.css';
1
+ import * as e from "react";
2
+ import { createContext as t, forwardRef as n, useCallback as r, useContext as i, useEffect as a, useLayoutEffect as o, useMemo as s, useRef as c, useState as l, version as u } from "react";
3
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
4
+ import { ETLBrowserOrchestrator as p, STEPS as m } from "@etl-corestream/core";
5
+ import "@preact/signals-react";
6
+ import { bufferTime as ee, debounceTime as h, filter as g, scan as te } from "rxjs";
7
+ import './index.css';//#region \0rolldown/runtime.js
8
+ var _ = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ne = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
9
+ if (typeof require < "u") return require.apply(this, arguments);
10
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
11
+ });
12
+ //#endregion
13
+ //#region node_modules/@radix-ui/react-compose-refs/dist/index.mjs
14
+ function re(e, t) {
15
+ if (typeof e == "function") return e(t);
16
+ e != null && (e.current = t);
17
+ }
18
+ function ie(...e) {
19
+ return (t) => {
20
+ let n = !1, r = e.map((e) => {
21
+ let r = re(e, t);
22
+ return !n && typeof r == "function" && (n = !0), r;
23
+ });
24
+ if (n) return () => {
25
+ for (let t = 0; t < r.length; t++) {
26
+ let n = r[t];
27
+ typeof n == "function" ? n() : re(e[t], null);
28
+ }
29
+ };
30
+ };
31
+ }
32
+ //#endregion
33
+ //#region node_modules/@radix-ui/react-slot/dist/index.mjs
34
+ var ae = Symbol.for("react.lazy"), v = e.use;
35
+ function oe(e) {
36
+ return typeof e == "object" && !!e && "then" in e;
37
+ }
38
+ function y(e) {
39
+ return typeof e == "object" && !!e && "$$typeof" in e && e.$$typeof === ae && "_payload" in e && oe(e._payload);
40
+ }
41
+ /* @__NO_SIDE_EFFECTS__ */
42
+ function se(t) {
43
+ let n = /* @__PURE__ */ ce(t), r = e.forwardRef((t, r) => {
44
+ let { children: i, ...a } = t;
45
+ y(i) && typeof v == "function" && (i = v(i._payload));
46
+ let o = e.Children.toArray(i), s = o.find(ue);
47
+ if (s) {
48
+ let t = s.props.children, i = o.map((n) => n === s ? e.Children.count(t) > 1 ? e.Children.only(null) : e.isValidElement(t) ? t.props.children : null : n);
49
+ return /* @__PURE__ */ d(n, {
50
+ ...a,
51
+ ref: r,
52
+ children: e.isValidElement(t) ? e.cloneElement(t, void 0, i) : null
53
+ });
54
+ }
55
+ return /* @__PURE__ */ d(n, {
56
+ ...a,
57
+ ref: r,
58
+ children: i
59
+ });
60
+ });
61
+ return r.displayName = `${t}.Slot`, r;
62
+ }
63
+ var b = /* @__PURE__ */ se("Slot");
64
+ /* @__NO_SIDE_EFFECTS__ */
65
+ function ce(t) {
66
+ let n = e.forwardRef((t, n) => {
67
+ let { children: r, ...i } = t;
68
+ if (y(r) && typeof v == "function" && (r = v(r._payload)), e.isValidElement(r)) {
69
+ let t = fe(r), a = de(i, r.props);
70
+ return r.type !== e.Fragment && (a.ref = n ? ie(n, t) : t), e.cloneElement(r, a);
71
+ }
72
+ return e.Children.count(r) > 1 ? e.Children.only(null) : null;
73
+ });
74
+ return n.displayName = `${t}.SlotClone`, n;
75
+ }
76
+ var le = Symbol("radix.slottable");
77
+ function ue(t) {
78
+ return e.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === le;
79
+ }
80
+ function de(e, t) {
81
+ let n = { ...t };
82
+ for (let r in t) {
83
+ let i = e[r], a = t[r];
84
+ /^on[A-Z]/.test(r) ? i && a ? n[r] = (...e) => {
85
+ let t = a(...e);
86
+ return i(...e), t;
87
+ } : i && (n[r] = i) : r === "style" ? n[r] = {
88
+ ...i,
89
+ ...a
90
+ } : r === "className" && (n[r] = [i, a].filter(Boolean).join(" "));
91
+ }
92
+ return {
93
+ ...e,
94
+ ...n
95
+ };
96
+ }
97
+ function fe(e) {
98
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
99
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
100
+ }
101
+ //#endregion
102
+ //#region node_modules/@preact/signals-core/dist/signals-core.module.js
103
+ var pe = Symbol.for("preact-signals");
104
+ function x() {
105
+ if (w > 1) w--;
106
+ else {
107
+ var e, t = !1;
108
+ for ((function() {
109
+ var e = E;
110
+ for (E = void 0; e !== void 0;) e.S.v === e.v && (e.S.i = e.i), e = e.o;
111
+ })(); C !== void 0;) {
112
+ var n = C;
113
+ for (C = void 0, T++; n !== void 0;) {
114
+ var r = n.u;
115
+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && k(n)) try {
116
+ n.c();
117
+ } catch (n) {
118
+ t ||= (e = n, !0);
119
+ }
120
+ n = r;
121
+ }
122
+ }
123
+ if (T = 0, w--, t) throw e;
124
+ }
125
+ }
126
+ var S = void 0;
127
+ function me(e) {
128
+ var t = S;
129
+ S = void 0;
130
+ try {
131
+ return e();
132
+ } finally {
133
+ S = t;
134
+ }
135
+ }
136
+ var he, C = void 0, w = 0, T = 0, ge = 0, E = void 0, D = 0;
137
+ function _e(e) {
138
+ if (S !== void 0) {
139
+ var t = e.n;
140
+ if (t === void 0 || t.t !== S) return t = {
141
+ i: 0,
142
+ S: e,
143
+ p: S.s,
144
+ n: void 0,
145
+ t: S,
146
+ e: void 0,
147
+ x: void 0,
148
+ r: t
149
+ }, S.s !== void 0 && (S.s.n = t), S.s = t, e.n = t, 32 & S.f && e.S(t), t;
150
+ if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = S.s, t.n = void 0, S.s.n = t, S.s = t), t;
151
+ }
152
+ }
153
+ function O(e, t) {
154
+ this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
155
+ }
156
+ O.prototype.brand = pe, O.prototype.h = function() {
157
+ return !0;
158
+ }, O.prototype.S = function(e) {
159
+ var t = this, n = this.t;
160
+ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? me(function() {
161
+ var e;
162
+ (e = t.W) == null || e.call(t);
163
+ }) : n.e = e);
164
+ }, O.prototype.U = function(e) {
165
+ var t = this;
166
+ if (this.t !== void 0) {
167
+ var n = e.e, r = e.x;
168
+ n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && me(function() {
169
+ var e;
170
+ (e = t.Z) == null || e.call(t);
171
+ }));
172
+ }
173
+ }, O.prototype.subscribe = function(e) {
174
+ var t = this;
175
+ return I(function() {
176
+ var n = t.value, r = S;
177
+ S = void 0;
178
+ try {
179
+ e(n);
180
+ } finally {
181
+ S = r;
182
+ }
183
+ }, { name: "sub" });
184
+ }, O.prototype.valueOf = function() {
185
+ return this.value;
186
+ }, O.prototype.toString = function() {
187
+ return this.value + "";
188
+ }, O.prototype.toJSON = function() {
189
+ return this.value;
190
+ }, O.prototype.peek = function() {
191
+ var e = S;
192
+ S = void 0;
193
+ try {
194
+ return this.value;
195
+ } finally {
196
+ S = e;
197
+ }
198
+ }, Object.defineProperty(O.prototype, "value", {
199
+ get: function() {
200
+ var e = _e(this);
201
+ return e !== void 0 && (e.i = this.i), this.v;
202
+ },
203
+ set: function(e) {
204
+ if (e !== this.v) {
205
+ if (T > 100) throw Error("Cycle detected");
206
+ (function(e) {
207
+ w !== 0 && T === 0 && e.l !== ge && (e.l = ge, E = {
208
+ S: e,
209
+ v: e.v,
210
+ i: e.i,
211
+ o: E
212
+ });
213
+ })(this), this.v = e, this.i++, D++, w++;
214
+ try {
215
+ for (var t = this.t; t !== void 0; t = t.x) t.t.N();
216
+ } finally {
217
+ x();
218
+ }
219
+ }
220
+ }
221
+ });
222
+ function k(e) {
223
+ for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
224
+ return !1;
225
+ }
226
+ function A(e) {
227
+ for (var t = e.s; t !== void 0; t = t.n) {
228
+ var n = t.S.n;
229
+ if (n !== void 0 && (t.r = n), t.S.n = t, t.i = -1, t.n === void 0) {
230
+ e.s = t;
231
+ break;
232
+ }
233
+ }
234
+ }
235
+ function j(e) {
236
+ for (var t = e.s, n = void 0; t !== void 0;) {
237
+ var r = t.p;
238
+ t.i === -1 ? (t.S.U(t), r !== void 0 && (r.n = t.n), t.n !== void 0 && (t.n.p = r)) : n = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = r;
239
+ }
240
+ e.s = n;
241
+ }
242
+ function M(e, t) {
243
+ O.call(this, void 0), this.x = e, this.s = void 0, this.g = D - 1, this.f = 4, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
244
+ }
245
+ M.prototype = new O(), M.prototype.h = function() {
246
+ if (this.f &= -3, 1 & this.f) return !1;
247
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === D)) return !0;
248
+ if (this.g = D, this.f |= 1, this.i > 0 && !k(this)) return this.f &= -2, !0;
249
+ var e = S;
250
+ try {
251
+ A(this), S = this;
252
+ var t = this.x();
253
+ (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
254
+ } catch (e) {
255
+ this.v = e, this.f |= 16, this.i++;
256
+ }
257
+ return S = e, j(this), this.f &= -2, !0;
258
+ }, M.prototype.S = function(e) {
259
+ if (this.t === void 0) {
260
+ this.f |= 36;
261
+ for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);
262
+ }
263
+ O.prototype.S.call(this, e);
264
+ }, M.prototype.U = function(e) {
265
+ if (this.t !== void 0 && (O.prototype.U.call(this, e), this.t === void 0)) {
266
+ this.f &= -33;
267
+ for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);
268
+ }
269
+ }, M.prototype.N = function() {
270
+ if (!(2 & this.f)) {
271
+ this.f |= 6;
272
+ for (var e = this.t; e !== void 0; e = e.x) e.t.N();
273
+ }
274
+ }, Object.defineProperty(M.prototype, "value", { get: function() {
275
+ if (1 & this.f) throw Error("Cycle detected");
276
+ var e = _e(this);
277
+ if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
278
+ return this.v;
279
+ } });
280
+ function N(e) {
281
+ var t = e.m;
282
+ if (e.m = void 0, typeof t == "function") {
283
+ w++;
284
+ var n = S;
285
+ S = void 0;
286
+ try {
287
+ t();
288
+ } catch (t) {
289
+ throw e.f &= -2, e.f |= 8, P(e), t;
290
+ } finally {
291
+ S = n, x();
292
+ }
293
+ }
294
+ }
295
+ function P(e) {
296
+ for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
297
+ e.x = void 0, e.s = void 0, N(e);
298
+ }
299
+ function ve(e) {
300
+ if (S !== this) throw Error("Out-of-order effect");
301
+ j(this), S = e, this.f &= -2, 8 & this.f && P(this), x();
302
+ }
303
+ function F(e, t) {
304
+ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, he && he.push(this);
305
+ }
306
+ F.prototype.c = function() {
307
+ var e = this.S();
308
+ try {
309
+ if (8 & this.f || this.x === void 0) return;
310
+ var t = this.x();
311
+ typeof t == "function" && (this.m = t);
312
+ } finally {
313
+ e();
314
+ }
315
+ }, F.prototype.S = function() {
316
+ if (1 & this.f) throw Error("Cycle detected");
317
+ this.f |= 1, this.f &= -9, N(this), A(this), w++;
318
+ var e = S;
319
+ return S = this, ve.bind(this, e);
320
+ }, F.prototype.N = function() {
321
+ 2 & this.f || (this.f |= 2, this.u = C, C = this);
322
+ }, F.prototype.d = function() {
323
+ this.f |= 8, 1 & this.f || P(this);
324
+ }, F.prototype.dispose = function() {
325
+ this.d();
326
+ };
327
+ function I(e, t) {
328
+ var n = new F(e, t);
329
+ try {
330
+ n.c();
331
+ } catch (e) {
332
+ throw n.d(), e;
333
+ }
334
+ var r = n.d.bind(n);
335
+ return r[Symbol.dispose] = r, r;
336
+ }
337
+ //#endregion
338
+ //#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
339
+ var ye = /* @__PURE__ */ _(((e) => {
340
+ var t = ne("react");
341
+ function n(e, t) {
342
+ return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
343
+ }
344
+ var r = typeof Object.is == "function" ? Object.is : n, i = t.useState, a = t.useEffect, o = t.useLayoutEffect, s = t.useDebugValue;
345
+ function c(e, t) {
346
+ var n = t(), r = i({ inst: {
347
+ value: n,
348
+ getSnapshot: t
349
+ } }), c = r[0].inst, u = r[1];
350
+ return o(function() {
351
+ c.value = n, c.getSnapshot = t, l(c) && u({ inst: c });
352
+ }, [
353
+ e,
354
+ n,
355
+ t
356
+ ]), a(function() {
357
+ return l(c) && u({ inst: c }), e(function() {
358
+ l(c) && u({ inst: c });
359
+ });
360
+ }, [e]), s(n), n;
361
+ }
362
+ function l(e) {
363
+ var t = e.getSnapshot;
364
+ e = e.value;
365
+ try {
366
+ var n = t();
367
+ return !r(e, n);
368
+ } catch {
369
+ return !0;
370
+ }
371
+ }
372
+ function u(e, t) {
373
+ return t();
374
+ }
375
+ var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
376
+ e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
377
+ })), be = /* @__PURE__ */ _(((e) => {
378
+ process.env.NODE_ENV !== "production" && (function() {
379
+ function t(e, t) {
380
+ return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
381
+ }
382
+ function n(e, t) {
383
+ d || a.startTransition === void 0 || (d = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
384
+ var n = t();
385
+ if (!f) {
386
+ var i = t();
387
+ o(n, i) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0);
388
+ }
389
+ i = s({ inst: {
390
+ value: n,
391
+ getSnapshot: t
392
+ } });
393
+ var p = i[0].inst, m = i[1];
394
+ return l(function() {
395
+ p.value = n, p.getSnapshot = t, r(p) && m({ inst: p });
396
+ }, [
397
+ e,
398
+ n,
399
+ t
400
+ ]), c(function() {
401
+ return r(p) && m({ inst: p }), e(function() {
402
+ r(p) && m({ inst: p });
403
+ });
404
+ }, [e]), u(n), n;
405
+ }
406
+ function r(e) {
407
+ var t = e.getSnapshot;
408
+ e = e.value;
409
+ try {
410
+ var n = t();
411
+ return !o(e, n);
412
+ } catch {
413
+ return !0;
414
+ }
415
+ }
416
+ function i(e, t) {
417
+ return t();
418
+ }
419
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
420
+ var a = ne("react"), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
421
+ e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
422
+ })();
423
+ })), xe = (/* @__PURE__ */ _(((e, t) => {
424
+ process.env.NODE_ENV === "production" ? t.exports = ye() : t.exports = be();
425
+ })))(), Se = u.split(".").map(Number)[0], Ce = Symbol.for(Se >= 19 ? "react.transitional.element" : "react.element"), we = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, L, R = Symbol.dispose || Symbol.for("Symbol.dispose");
426
+ function z(e, t) {
427
+ var n = t.effect.S();
428
+ return L = t, Te.bind(t, e, n);
429
+ }
430
+ function Te(e, t) {
431
+ t(), L = e;
432
+ }
433
+ var Ee, De, Oe = function() {}, ke = ((Ee = {
434
+ u: 0,
435
+ effect: {
436
+ s: void 0,
437
+ c: function() {},
438
+ S: function() {
439
+ return Oe;
440
+ },
441
+ d: function() {}
442
+ },
443
+ subscribe: function() {
444
+ return Oe;
445
+ },
446
+ getSnapshot: function() {
447
+ return 0;
448
+ },
449
+ S: function() {},
450
+ f: function() {}
451
+ })[R] = function() {}, Ee), Ae = Promise.prototype.then.bind(Promise.resolve());
452
+ function je() {
453
+ De ||= Ae(Me);
454
+ }
455
+ function Me() {
456
+ var e;
457
+ De = void 0, (e = L) == null || e.f();
458
+ }
459
+ var Ne = typeof window < "u" ? o : a;
460
+ function Pe(e, t) {
461
+ e === void 0 && (e = 0), je();
462
+ var n = c();
463
+ n.current ?? (typeof window > "u" ? n.current = ke : n.current = function(e, t) {
464
+ var n, r, i, a, o = 0, s = I(function() {
465
+ r = this;
466
+ }, { name: t || "Component" });
467
+ return r.c = function() {
468
+ if (o = o + 1 | 0, we) {
469
+ var e;
470
+ (e = r.y) == null || e.call(r);
471
+ }
472
+ a && a();
473
+ }, (n = {
474
+ u: e,
475
+ effect: r,
476
+ subscribe: function(e) {
477
+ return a = e, function() {
478
+ o = o + 1 | 0, a = void 0, s();
479
+ };
480
+ },
481
+ getSnapshot: function() {
482
+ return o;
483
+ },
484
+ S: function() {
485
+ if (L != null) {
486
+ var e = L.u, t = this.u;
487
+ e == 0 && t == 0 || e == 0 && t == 1 ? (L.f(), i = z(void 0, this)) : e == 1 && t == 0 || e == 2 && t == 0 || (i = z(L, this));
488
+ } else i = z(void 0, this);
489
+ },
490
+ f: function() {
491
+ var e = i;
492
+ i = void 0, e?.();
493
+ }
494
+ })[R] = function() {
495
+ this.f();
496
+ }, n;
497
+ }(e, t));
498
+ var r = n.current;
499
+ return (0, xe.useSyncExternalStore)(r.subscribe, r.getSnapshot, r.getSnapshot), r.S(), e === 0 && Ne(Me), r;
500
+ }
501
+ Object.defineProperties(O.prototype, {
502
+ $$typeof: {
503
+ configurable: !0,
504
+ value: Ce
505
+ },
506
+ type: {
507
+ configurable: !0,
508
+ value: function(e) {
509
+ var t = e.data, n = Pe(1);
510
+ try {
511
+ return t.value;
512
+ } finally {
513
+ n.f();
514
+ }
515
+ }
516
+ },
517
+ props: {
518
+ configurable: !0,
519
+ get: function() {
520
+ var e = this;
521
+ return { data: { get value() {
522
+ return e.value;
523
+ } } };
524
+ }
525
+ },
526
+ ref: {
527
+ configurable: !0,
528
+ value: null
529
+ }
530
+ });
531
+ function B(e, t) {
532
+ return Pe(e, t);
533
+ }
534
+ //#endregion
535
+ //#region src/hooks/use-etl-orchestrator.ts
536
+ var Fe = {
537
+ recover: {
538
+ availableLayouts: [],
539
+ checkRecoveryPoint: !1
540
+ },
541
+ viewer: { defaultPageSize: 100 },
542
+ importer: {
543
+ importerChunkSize: 1024 * 1024 * 4,
544
+ allowedMimetypes: ["text/csv", "text/plain"]
545
+ },
546
+ mapper: {
547
+ allowRemapColumns: !0,
548
+ ignoreRemapUnrequired: !0,
549
+ preserveOriginalValue: !0
550
+ },
551
+ localStepEngine: { maxErrorCount: 100 },
552
+ persistence: { chunkSizeQtd: 1e4 }
553
+ }, Ie = (e) => {
554
+ let t = c({
555
+ ...Fe,
556
+ ...e
557
+ }), n = s(() => p(t.current), []);
558
+ return a(() => () => {
559
+ n.stop();
560
+ }, [n]), n;
561
+ }, V = t(null), H = () => {
562
+ let e = i(V);
563
+ if (!e) throw Error("useEtlContext must be used within a EtlCoreProvider");
564
+ return e;
565
+ }, U = (...e) => (...t) => e.forEach((e) => e && e(...t)), Le = () => {
566
+ B();
567
+ let { stop: e, step: t } = H(), n = !t.value.some((e) => m.INITIALIZING_MACHINE == e || m.READING_DATA.WAITING_LAYOUT == e);
568
+ return {
569
+ canStop: n,
570
+ getAbortButtonProps: (t) => ({
571
+ ...t,
572
+ onClick: U(t.onClick, e),
573
+ disabled: !n || t.disabled,
574
+ "data-role": "etl-abort-button"
575
+ })
576
+ };
577
+ }, Re = () => {
578
+ B();
579
+ let e = H(), t = () => e.step.value.some((e) => m.WAITING_INTERACTIONS.WAITING_USER == e), n = () => e.step.value.some((e) => m.WAITING_INTERACTIONS.WAITING_USER == e);
580
+ return {
581
+ getRootProps: (e = {}) => ({
582
+ ...e,
583
+ "data-role": "etl-data-view-root"
584
+ }),
585
+ getTableProps: (e, t = {}) => ({
586
+ ...t,
587
+ "data-layout-name": e
588
+ }),
589
+ getTableHeadersProps: (e = {}) => ({
590
+ ...e,
591
+ "data-role": "etl-data-view-table-headers"
592
+ }),
593
+ getRowProps: (e, t = {}) => ({
594
+ ...t,
595
+ "data-role": "etl-data-view-row",
596
+ "data-row-index": e.__rowId,
597
+ "data-row-is-error": e.__isError,
598
+ onClick: U(t.onClick, () => {})
599
+ }),
600
+ getCellProps: (e, t, n = {}) => ({
601
+ ...n,
602
+ "data-column-name": t,
603
+ "data-row-index": e.__rowId,
604
+ onClick: U(n.onClick, () => {})
605
+ }),
606
+ getTableHeaderProps: (e, t = {}) => ({
607
+ ...t,
608
+ "data-column-name": e.key,
609
+ "data-column-label": e.label,
610
+ "data-role": "etl-data-view-table-header"
611
+ }),
612
+ getPaginationPageNumberButtonProps: (n, r = {}) => ({
613
+ ...r,
614
+ "data-page-number": n,
615
+ "data-page-is-last": n === e.viewPaginationInfo.value.totalPages,
616
+ "data-page-is-first": n === 1,
617
+ disabled: !t(),
618
+ onClick: U(r.onClick, () => t() && e.changeViewPage(n))
619
+ }),
620
+ getPaginationPageNextButtonProps: (n = {}) => ({
621
+ ...n,
622
+ disabled: !t() || e.viewPaginationInfo.value.totalPages === e.viewPaginationInfo.value.currentPage,
623
+ onClick: U(n.onClick, () => t() && e.viewPaginationInfo.value.totalPages > e.viewPaginationInfo.value.currentPage && e.changeViewPage(e.viewPaginationInfo.value.currentPage + 1))
624
+ }),
625
+ getPaginationPagePreviousButtonProps: (n = {}) => ({
626
+ ...n,
627
+ disabled: !t() || e.viewPaginationInfo.value.currentPage === 1,
628
+ onClick: U(n.onClick, () => t() && e.viewPaginationInfo.value.currentPage > 1 && e.changeViewPage(e.viewPaginationInfo.value.currentPage - 1))
629
+ }),
630
+ getPaginationPageLastButtonProps: (n = {}) => ({
631
+ ...n,
632
+ "data-can-navigate": t(),
633
+ disabled: !t() || e.viewPaginationInfo.value.currentPage === e.viewPaginationInfo.value.totalPages,
634
+ onClick: U(n.onClick, () => t() && e.viewPaginationInfo.value.currentPage < e.viewPaginationInfo.value.totalPages && e.changeViewPage(e.viewPaginationInfo.value.totalPages))
635
+ }),
636
+ getPaginationPageFirstButtonProps: (n = {}) => ({
637
+ ...n,
638
+ disabled: !t() || e.viewPaginationInfo.value.currentPage === 1,
639
+ onClick: U(n.onClick, () => t() && e.viewPaginationInfo.value.currentPage > 1 && e.changeViewPage(1))
640
+ }),
641
+ getEditFormProps: (t, r, i = {}) => ({
642
+ ...i,
643
+ onSubmit: U(i.onSubmit, (i) => {
644
+ i.preventDefault();
645
+ let a = i.currentTarget, o = new FormData(a).get("value");
646
+ n() && e.editRow(t.__rowId, r, o);
647
+ }),
648
+ disabled: !n(),
649
+ "data-role": "etl-data-view-edit-form",
650
+ "data-row-index": t.__rowId,
651
+ "data-cell-header": r,
652
+ "data-row-is-error": t.__isError
653
+ }),
654
+ getRemoveRowButtonProps: (t, r = {}) => ({
655
+ ...r,
656
+ onClick: U(r.onClick, () => n() && e.removeRow(t)),
657
+ "data-role": "etl-data-view-remove-row-button",
658
+ "data-row-index": t
659
+ }),
660
+ getFilterFormProps: (e = {}) => ({}),
661
+ getHeadersLabels: () => e.layout.value?.headers.map((e) => ({
662
+ label: e.label,
663
+ key: e.key
664
+ })),
665
+ get currentRows() {
666
+ return e.currentRows;
667
+ },
668
+ get currentRows$() {
669
+ return e.currentRows$;
670
+ },
671
+ get canNavigate() {
672
+ return t;
673
+ },
674
+ get canEdit() {
675
+ return n;
676
+ },
677
+ get state() {
678
+ return e.state;
679
+ },
680
+ get layout() {
681
+ return e.layout;
682
+ }
683
+ };
684
+ }, ze = () => {
685
+ B();
686
+ let { state: e, layout: t, export: n, step: i } = H(), a = r((e) => ({
687
+ label: e.label || e.name,
688
+ description: e.description
689
+ }), []), o = s(() => t.value?.exports?.map((e) => a(e)) || [], [t, a]), c = s(() => i.value.some((e) => m.WAITING_INTERACTIONS.WAITING_USER == e), [i]);
690
+ return {
691
+ getExportDetails: a,
692
+ getExporterRootProps: (e) => ({
693
+ ...e,
694
+ "data-role": "exporter-root"
695
+ }),
696
+ getExporterExportButtonProps: (e, t, r) => ({
697
+ ...r,
698
+ disabled: !c || r.disabled,
699
+ onClick: U(r.onClick, () => {
700
+ n(t.name, e);
701
+ }),
702
+ "data-role": "exporter-export-button"
703
+ }),
704
+ availableExports: o,
705
+ canExport: c
706
+ };
707
+ }, Be = () => {
708
+ B();
709
+ let { selectFile: e, state: t, file: n, step: r } = H(), i = c(null), a = (e = {}) => ({
710
+ ...e,
711
+ "data-role": "etl-importer-root"
712
+ }), o = (e = {}) => {
713
+ let { onClick: t, ...n } = e;
714
+ return {
715
+ type: "button",
716
+ ...n,
717
+ "data-role": "etl-importer-trigger",
718
+ onClick: U(t, () => {
719
+ if (!i?.current) throw Error("Importer input reference not found");
720
+ i?.current?.click();
721
+ }),
722
+ disabled: n.disabled || !r.value.some((e) => m.READING_DATA.WAITING_FILE == e)
723
+ };
724
+ }, [s, u] = l(!1);
725
+ return {
726
+ getImporterTriggerProps: o,
727
+ getImporterRootProps: a,
728
+ getInputProps: (t = {}) => {
729
+ let { onChange: n, accept: a, ...o } = t;
730
+ return {
731
+ type: "file",
732
+ ref: i,
733
+ multiple: !1,
734
+ accept: a || ".csv, .xlsx, .xls",
735
+ ...o,
736
+ disabled: o.disabled || !r.value.some((e) => m.READING_DATA.WAITING_FILE == e),
737
+ style: {
738
+ display: "none",
739
+ ...o.style
740
+ },
741
+ "data-role": "etl-importer-input",
742
+ onChange: U(n, (t) => {
743
+ if (!r.value.some((e) => m.READING_DATA.WAITING_FILE == e)) return;
744
+ let n = t.target.files;
745
+ n?.length && (e(n[0]), t.target.value = "");
746
+ })
747
+ };
748
+ },
749
+ getDropZoneProps: (t = {}) => {
750
+ let { onDragOver: n, onDragLeave: i, onDrop: a, ...o } = t;
751
+ return {
752
+ ...o,
753
+ "data-role": "etl-importer-dropzone",
754
+ "data-dragging": s,
755
+ onDragOver: U(n, (e) => {
756
+ e.preventDefault(), e.dataTransfer.dropEffect = "copy", u(!0);
757
+ }),
758
+ onDragLeave: U(i, (e) => {
759
+ e.preventDefault(), u(!1);
760
+ }),
761
+ onDrop: U(a, (t) => {
762
+ if (t.preventDefault(), u(!1), !r.value.some((e) => m.READING_DATA.WAITING_FILE == e)) return;
763
+ let n = t.dataTransfer.files;
764
+ n?.length === 1 && e(n[0]);
765
+ })
766
+ };
767
+ },
768
+ isDragging: s,
769
+ canImport: r.value.some((e) => m.READING_DATA.WAITING_FILE == e) && n.value !== null,
770
+ file: n,
771
+ state: t
772
+ };
773
+ }, Ve = () => {
774
+ B();
775
+ let { layout: e, selectLayout: t, state: n, step: i } = H(), a = (e = {}) => ({
776
+ ...e,
777
+ "data-role": "etl-layout-view-root"
778
+ }), o = (e, n = {}) => ({
779
+ ...n,
780
+ "data-role": "etl-layout-view-select-layout-button",
781
+ disabled: e === null || !i.value.some((e) => m.READING_DATA.WAITING_LAYOUT == e) || n.disabled,
782
+ onClick: U(n.onClick, () => t(e))
783
+ }), s = r((e) => ({
784
+ layoutName: e.name,
785
+ layoutDescription: e.description,
786
+ layoutAllowUndefinedColumns: e.allowUndefinedColumns,
787
+ layoutHeaders: e.headers,
788
+ localSteps: e.localSteps?.map((e) => ({
789
+ name: e.name,
790
+ description: e.description,
791
+ order: e.order,
792
+ validations: e.validators.map((e) => ({
793
+ name: e.name,
794
+ target: e.headerKey
795
+ })),
796
+ transforms: e.transforms.map((e) => ({
797
+ name: e.name,
798
+ target: e.headerKey
799
+ }))
800
+ })) ?? [],
801
+ globalSteps: e.globalSteps?.map((e) => ({
802
+ name: e.name,
803
+ description: e.description,
804
+ order: e.order,
805
+ validations: e.validators.map((e) => ({ name: e.name })),
806
+ transforms: e.transforms.map((e) => ({ name: e.name }))
807
+ })) ?? [],
808
+ exporters: e.exports?.map((e) => ({
809
+ name: e.name,
810
+ description: e.description
811
+ })) ?? []
812
+ }), []);
813
+ return {
814
+ getSelectLayoutButtonProps: o,
815
+ getLayoutDetails: s,
816
+ getLayoutViewRootProps: a,
817
+ currentLayout: e.value ? s(e.value) : null,
818
+ layout: e,
819
+ state: n,
820
+ canSelectLayout: i.value.some((e) => m.READING_DATA.WAITING_LAYOUT == e)
821
+ };
822
+ }, W = () => {
823
+ B();
824
+ let e = H(), [t, n] = l(!1), [i, o] = l(!1), [s, u] = l(null), d = c(null), f = c(null), p = r((e, t) => new Promise((n, r) => {
825
+ d.current = n, f.current = r, u({
826
+ rowKeys: e,
827
+ headers: t
828
+ }), o(!0);
829
+ }), []);
830
+ a(() => {
831
+ if (e.step.value.some((e) => m.READING_DATA.WAITING_LAYOUT == e || m.INITIALIZING_MACHINE == e) && !t) {
832
+ let t = {
833
+ allowRemapColumns: !0,
834
+ onRemapFn: p
835
+ };
836
+ e.updateConfig("mapper", t), n(!0), console.log("Mapper configured");
837
+ }
838
+ }, [e.state, p]);
839
+ let ee = r((e) => {
840
+ let t = Object.entries(e);
841
+ d.current && (d.current(t), o(!1), u(null), e = {});
842
+ }, []), h = r(() => {
843
+ f.current && (f.current(/* @__PURE__ */ Error("Mapping cancelled")), o(!1), u(null));
844
+ }, []);
845
+ return {
846
+ showMapper: i,
847
+ rowKeys: s?.rowKeys ?? [],
848
+ headers: s?.headers ?? [],
849
+ getHeadersViewProps: (e) => ({
850
+ ...e,
851
+ "data-role": "etl-mapper-headers-view"
852
+ }),
853
+ getAcceptButtonProps: (t, n) => ({
854
+ ...n,
855
+ type: "button",
856
+ onClick: U(n.onClick, () => ee(t)),
857
+ disabled: !s && !e.step.value.some((e) => m.READING_DATA.MAPPING_DATA == e)
858
+ }),
859
+ getCancelButtonProps: (t) => ({
860
+ ...t,
861
+ type: "button",
862
+ onClick: U(t.onClick, () => h()),
863
+ disabled: !s && !e.step.value.some((e) => m.READING_DATA.MAPPING_DATA == e)
864
+ }),
865
+ getRootProps: (e) => ({
866
+ ...e,
867
+ "data-role": "etl-mapper-root"
868
+ })
869
+ };
870
+ }, G = () => {
871
+ B();
872
+ let { recoveryPoint: e, recoverStep: t, recoverActionChoosen: n } = H();
873
+ return {
874
+ getAcceptRecoveryButtonProps: (e) => ({
875
+ type: "button",
876
+ onClick: U(e.onClick, () => n("recover"))
877
+ }),
878
+ getCancelRecoveryButtonProps: (e) => ({
879
+ type: "button",
880
+ onClick: U(e.onClick, () => n("skip"))
881
+ }),
882
+ recoveryPoint: e,
883
+ recoverStep: t
884
+ };
885
+ }, He = (e = 100, t = !0) => {
886
+ let { logs$: n, getLogs: r } = H(), [i, o] = l([]);
887
+ return a(() => {
888
+ let r = n.pipe(g((e) => !t || e.level !== "debug"), ee(200), g((e) => e.length > 0), te((t, n) => [...t, ...n].slice(-e), [])).subscribe(o);
889
+ return () => r.unsubscribe();
890
+ }, [
891
+ n,
892
+ e,
893
+ t
894
+ ]), {
895
+ bufferLogs: i,
896
+ getLogs: r
897
+ };
898
+ }, Ue = () => {
899
+ B();
900
+ let { metrics: e } = H();
901
+ return { metrics: e };
902
+ }, We = () => {
903
+ let { notification$: e } = H();
904
+ return { notification$: e };
905
+ }, Ge = () => {
906
+ let { progress$: e } = H(), [t, n] = l([]), [r, i] = l(null);
907
+ return a(() => {
908
+ let t = e.pipe(h(400)).subscribe((e) => {
909
+ n(e.map((e) => ({
910
+ label: e.label,
911
+ value: e.value
912
+ })));
913
+ let t = e.reduce((e, t) => e + t.value, 0) / e.length;
914
+ t = Number(t.toFixed(2)), i(t);
915
+ });
916
+ return () => t.unsubscribe();
917
+ }, [e]), {
918
+ currentProgress: t,
919
+ totalProgress: r ?? 0
920
+ };
921
+ }, Ke = () => {
922
+ B();
923
+ let { state: e, step: t } = H();
924
+ return {
925
+ state: e.value,
926
+ steps: t.value
927
+ };
928
+ }, qe = (e) => {
929
+ B();
930
+ let t = e || H(), [n, r] = l({
931
+ readerStep: null,
932
+ viewerStep: null,
933
+ editorStep: null,
934
+ errorStep: null,
935
+ metricsStep: null,
936
+ recoverStep: null
937
+ });
938
+ return a(() => {
939
+ let e = t.step$.subscribe((e) => {
940
+ let t = new Set(e);
941
+ r({
942
+ readerStep: t.has(m.READING_DATA.WAITING_LAYOUT) ? m.READING_DATA.WAITING_LAYOUT : t.has(m.READING_DATA.WAITING_FILE) ? m.READING_DATA.WAITING_FILE : t.has(m.READING_DATA.PROCESSING_INPUTS) ? m.READING_DATA.PROCESSING_INPUTS : null,
943
+ viewerStep: Object.values(m.WAITING_INTERACTIONS).find((e) => t.has(e)) || null,
944
+ editorStep: Object.values(m.EDITING).find((e) => t.has(e)) || null,
945
+ errorStep: t.has(m.ERROR_HANDLING) ? m.ERROR_HANDLING : null,
946
+ metricsStep: t.has(m.UPDATING_METRICS) || t.has(m.WAITING_INTERACTIONS.WAITING_METRICS) ? m.UPDATING_METRICS : null,
947
+ recoverStep: t.has(m.RECOVERING.WAITING_TO_CHOOSE_RECOVER) ? m.RECOVERING.WAITING_TO_CHOOSE_RECOVER : t.has(m.RECOVERING.UPDATING_RECOVERY_POINT) ? m.RECOVERING.UPDATING_RECOVERY_POINT : t.has(m.RECOVERING.RECOVERING_FROM_RECOVERY_POINT) ? m.RECOVERING.RECOVERING_FROM_RECOVERY_POINT : t.has(m.RECOVERING.CHECKING_RECOVERY_POINT) ? m.RECOVERING.CHECKING_RECOVERY_POINT : null
948
+ });
949
+ });
950
+ return () => {
951
+ e.unsubscribe();
952
+ };
953
+ }, []), n;
954
+ }, Je = ({ children: e, asChild: t, ...n }) => {
955
+ let { getAbortButtonProps: r, canStop: i } = Le();
956
+ return /* @__PURE__ */ d(t ? b : "button", {
957
+ ...r(n),
958
+ children: e && (typeof e == "function" ? e({
959
+ canStop: i,
960
+ getAbortButtonProps: r
961
+ }) : e)
962
+ });
963
+ }, K = t(null), q = () => {
964
+ let e = i(K);
965
+ if (!e) throw Error("useDataViewContext must be used within a DataViewContext");
966
+ return e;
967
+ };
968
+ //#endregion
969
+ //#region node_modules/clsx/dist/clsx.mjs
970
+ function Ye(e) {
971
+ var t, n, r = "";
972
+ if (typeof e == "string" || typeof e == "number") r += e;
973
+ else if (typeof e == "object") if (Array.isArray(e)) {
974
+ var i = e.length;
975
+ for (t = 0; t < i; t++) e[t] && (n = Ye(e[t])) && (r && (r += " "), r += n);
976
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
977
+ return r;
978
+ }
979
+ function J() {
980
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Ye(e)) && (r && (r += " "), r += t);
981
+ return r;
982
+ }
983
+ //#endregion
984
+ //#region src/components/data-view/data-view-remove-trigger.tsx
985
+ var Xe = ({ rowId: e, className: t, children: n, asChild: r, ...i }) => {
986
+ let a = q();
987
+ return /* @__PURE__ */ d(r ? b : "button", {
988
+ ...a.getRemoveRowButtonProps(e, { ...i }),
989
+ className: J(t),
990
+ children: typeof n == "function" ? n({ ...a }) : n
991
+ });
992
+ }, Ze = ({ viewMode: e, className: t, ...n }) => {
993
+ let r = H(), i = Re(), a = n.asChild ? b : "div", [o, c] = l(null);
994
+ e ??= "modal";
995
+ let u = s(() => ({
996
+ ...i,
997
+ step: r.step,
998
+ state: i.state,
999
+ layout: i.layout,
1000
+ currentEditRow: o,
1001
+ setCurrentEditRow: c
1002
+ }), [o]);
1003
+ return /* @__PURE__ */ d(K.Provider, {
1004
+ value: u,
1005
+ children: /* @__PURE__ */ d(a, {
1006
+ ...i.getRootProps({ ...n }),
1007
+ className: J(t),
1008
+ children: typeof n.children == "function" ? n.children({ ...u }) : n.children
1009
+ })
1010
+ });
1011
+ }, Qe = ({ className: e, asChild: t, children: n, ...r }) => {
1012
+ let i = t ? b : "div", { row: a, column: o } = q().currentEditRow, s = a?.value?.[o] ?? "", c = "value", [u, f] = l(s);
1013
+ return t ? /* @__PURE__ */ d(i, {
1014
+ ...r,
1015
+ className: J(e),
1016
+ children: typeof n == "function" ? n({
1017
+ name: c,
1018
+ originalValue: s,
1019
+ newValue: u,
1020
+ setNewValue: (e) => f(e.target.value)
1021
+ }) : n
1022
+ }) : /* @__PURE__ */ d("input", {
1023
+ ...r,
1024
+ type: "text",
1025
+ name: c,
1026
+ value: u,
1027
+ onChange: (e) => f(e.target.value)
1028
+ });
1029
+ }, $e = ({ className: e, asChild: t, children: n, ...r }) => {
1030
+ let i = t ? b : "div", { row: a, column: o } = q().currentEditRow, s = a?.value?.[o] ?? "";
1031
+ return /* @__PURE__ */ d(i, {
1032
+ ...r,
1033
+ className: J(e),
1034
+ children: typeof n == "function" ? n({ previusValue: s }) : n
1035
+ });
1036
+ }, et = ({ className: e, children: t, asChild: n, onSubmit: r, ...i }) => {
1037
+ let a = n ? b : "div", o = q(), { row: s, column: c } = o.currentEditRow ?? {
1038
+ row: null,
1039
+ column: null
1040
+ };
1041
+ return !s || !c ? null : /* @__PURE__ */ d(a, {
1042
+ ...i,
1043
+ className: J(e),
1044
+ children: /* @__PURE__ */ d("form", {
1045
+ ...o.getEditFormProps(s, c, { onSubmit: r }),
1046
+ children: typeof t == "function" ? t(o) : t
1047
+ })
1048
+ });
1049
+ }, tt = ({ className: e, asChild: t, children: n, ...i }) => {
1050
+ let a = t ? b : "button", o = q(), s = r(() => {
1051
+ requestAnimationFrame(() => {
1052
+ o.setCurrentEditRow(null);
1053
+ });
1054
+ }, [o]), c = !t;
1055
+ return /* @__PURE__ */ d(a, {
1056
+ ...i,
1057
+ className: J(e),
1058
+ onClick: s,
1059
+ ...c ? { type: "button" } : {},
1060
+ children: typeof n == "function" ? n(o) : n
1061
+ });
1062
+ }, nt = ({ className: e, asChild: t, children: n, ...i }) => {
1063
+ let a = t ? b : "button", o = q(), s = r(() => {
1064
+ requestAnimationFrame(() => {
1065
+ o.canEdit && o.setCurrentEditRow(null);
1066
+ });
1067
+ }, [o]), c = !t;
1068
+ return /* @__PURE__ */ d(a, {
1069
+ ...i,
1070
+ className: J(e),
1071
+ onClick: s,
1072
+ ...c ? { type: "submit" } : {},
1073
+ children: typeof n == "function" ? n(o) : n
1074
+ });
1075
+ }, Y = t(null), rt = () => {
1076
+ let e = i(Y);
1077
+ if (!e) throw Error("It must be used between a DataViewFilterContext");
1078
+ return e;
1079
+ }, it = {
1080
+ root: ({ children: e, asChild: t, className: n, ...r }) => {
1081
+ B();
1082
+ let i = H(), [a, o] = l(i.viewFilter.value), s = {
1083
+ currentFilter: a,
1084
+ setCurrentFilter: o,
1085
+ triggerFilter: i.changeViewFilter
1086
+ }, c = t ? b : "div";
1087
+ return /* @__PURE__ */ d(Y.Provider, {
1088
+ value: s,
1089
+ children: /* @__PURE__ */ d(c, {
1090
+ ...r,
1091
+ className: J(n),
1092
+ children: typeof e == "function" ? e(s) : e
1093
+ })
1094
+ });
1095
+ },
1096
+ errorSelector: ({ asChild: e, children: t, onChange: n, ...r }) => {
1097
+ let { currentFilter: i, setCurrentFilter: o } = rt(), s = e ? b : "select", c = [
1098
+ {
1099
+ value: "all",
1100
+ label: "All"
1101
+ },
1102
+ {
1103
+ value: "only-invalid",
1104
+ label: "Only Invalids"
1105
+ },
1106
+ {
1107
+ value: "only-valid",
1108
+ label: "Only Valids"
1109
+ }
1110
+ ], [u, f] = l(null);
1111
+ a(() => {
1112
+ let e = i;
1113
+ e.withErrors && !e.withoutErrors ? f("only-invalid") : e.withoutErrors && !e.withErrors ? f("only-valid") : f("all");
1114
+ }, [i]);
1115
+ let p = (e) => {
1116
+ switch (e.currentTarget.value) {
1117
+ case "only-invalid":
1118
+ o({
1119
+ ...i,
1120
+ withErrors: !0,
1121
+ withoutErrors: !1
1122
+ });
1123
+ break;
1124
+ case "only-valid":
1125
+ o({
1126
+ ...i,
1127
+ withoutErrors: !0,
1128
+ withErrors: !1
1129
+ });
1130
+ break;
1131
+ default:
1132
+ o({
1133
+ ...i,
1134
+ withErrors: void 0,
1135
+ withoutErrors: void 0
1136
+ });
1137
+ break;
1138
+ }
1139
+ }, m = n ? U(n, p) : p;
1140
+ return t ? typeof t == "function" ? t({ valueOptions: c.map((e) => e.value) }) : t : /* @__PURE__ */ d(s, {
1141
+ ...r,
1142
+ value: u ?? "",
1143
+ onChange: m,
1144
+ children: c.map((e) => /* @__PURE__ */ d("option", {
1145
+ value: e.value,
1146
+ children: e.label
1147
+ }, e.value))
1148
+ });
1149
+ },
1150
+ context: Y,
1151
+ trigger: ({ asChild: e, children: t, onClick: n, ...r }) => {
1152
+ let { currentFilter: i, triggerFilter: a } = rt(), o = e ? b : "button", s = U(n, () => {
1153
+ a({ ...i });
1154
+ });
1155
+ return /* @__PURE__ */ d(o, {
1156
+ ...r,
1157
+ onClick: s,
1158
+ children: t
1159
+ });
1160
+ }
1161
+ }, at = ({ className: e, asChild: t, children: n, ...r }) => {
1162
+ let i = t ? b : "button", a = q();
1163
+ return /* @__PURE__ */ d(i, {
1164
+ ...a.getPaginationPageFirstButtonProps({ ...r }),
1165
+ className: J(e),
1166
+ children: typeof n == "function" ? n(a) : n ?? "First"
1167
+ });
1168
+ }, ot = ({ className: e, asChild: t, children: n, ...r }) => {
1169
+ let i = t ? b : "button", a = q();
1170
+ return /* @__PURE__ */ d(i, {
1171
+ ...a.getPaginationPageLastButtonProps({ ...r }),
1172
+ className: J(e),
1173
+ children: typeof n == "function" ? n(a) : n ?? "Last"
1174
+ });
1175
+ }, st = ({ className: e, asChild: t, children: n, ...r }) => {
1176
+ let i = t ? b : "button", a = q();
1177
+ return /* @__PURE__ */ d(i, {
1178
+ ...a.getPaginationPageNextButtonProps({ ...r }),
1179
+ className: J(e),
1180
+ children: typeof n == "function" ? n(a) : n ?? "Next"
1181
+ });
1182
+ }, ct = ({ page: e, className: t, asChild: n, children: r, ...i }) => {
1183
+ let a = n ? b : "button", o = q();
1184
+ return /* @__PURE__ */ d(a, {
1185
+ ...o.getPaginationPageNumberButtonProps(e, { ...i }),
1186
+ className: J(t),
1187
+ children: typeof r == "function" ? r(o) : r ?? e
1188
+ });
1189
+ }, lt = ({ className: e, asChild: t, children: n, ...r }) => {
1190
+ B();
1191
+ let i = t ? b : "button", a = q();
1192
+ return /* @__PURE__ */ d(i, {
1193
+ ...a.getPaginationPagePreviousButtonProps({ ...r }),
1194
+ className: J(e),
1195
+ children: typeof n == "function" ? n(a) : n ?? "Previous"
1196
+ });
1197
+ }, ut = ({ className: e, asChild: t, children: n, ...r }) => {
1198
+ let i = q();
1199
+ return /* @__PURE__ */ d(t ? b : "div", {
1200
+ ...r,
1201
+ className: J(e),
1202
+ "data-role": "etl-data-view-pagination",
1203
+ children: typeof n == "function" ? n(i) : n
1204
+ });
1205
+ }, dt = ({ className: e, ...t }) => {
1206
+ let n = q();
1207
+ return /* @__PURE__ */ d(t.asChild ? b : "table", {
1208
+ ...n.getTableProps(n.layout.value?.name, { ...t }),
1209
+ className: J(e),
1210
+ children: typeof t.children == "function" ? t.children({ ...n }) : t.children
1211
+ });
1212
+ }, ft = ({ className: e, asChild: t, children: n, row: i, column: a, generateContent: o, onClick: c, ...l }) => {
1213
+ let u = q();
1214
+ o ??= "before", c = r(() => {
1215
+ u.canEdit && u.setCurrentEditRow({
1216
+ row: i,
1217
+ column: a
1218
+ });
1219
+ }, [
1220
+ c,
1221
+ u,
1222
+ i,
1223
+ a
1224
+ ]);
1225
+ let f = t ? b : "td", p = r(() => !o || o === "none" ? null : i.value[a], [o, n]), m = s(() => {
1226
+ if (i.__isError && i.__isError.split(":")[0] == a) return i.__isError.split(":")[1];
1227
+ }, [i.__isError, a]);
1228
+ return /* @__PURE__ */ d(f, {
1229
+ ...u.getCellProps(i, a, { ...l }),
1230
+ className: J(e),
1231
+ "data-is-error": m,
1232
+ children: n ? typeof n == "function" ? n({
1233
+ ...u,
1234
+ isError: m
1235
+ }) : n : p()
1236
+ });
1237
+ }, pt = ({ className: e, children: t, rowObject: n, tdProps: i, generateCells: a, omitHeaders: o, tdElement: s, asChild: c, ...l }) => {
1238
+ let u = q(), f = c ? b : "tr";
1239
+ a ??= "before";
1240
+ let p = r(() => {
1241
+ if (!a || a === "none") return null;
1242
+ let e = u.getHeadersLabels().filter((e) => o ? !o?.includes(e.key) : !0).map((e) => ({
1243
+ row: n,
1244
+ column: e.key
1245
+ })), t = s || "td";
1246
+ return e.map((e) => /* @__PURE__ */ d(ft, {
1247
+ row: e.row,
1248
+ column: e.column,
1249
+ asChild: !0,
1250
+ ...i,
1251
+ children: /* @__PURE__ */ d(t, { children: e.row.value[e.column] })
1252
+ }, e.column));
1253
+ }, [
1254
+ u,
1255
+ n,
1256
+ o,
1257
+ s,
1258
+ i
1259
+ ]);
1260
+ return /* @__PURE__ */ d(f, {
1261
+ ...u.getRowProps(n, { ...l }),
1262
+ className: J(e),
1263
+ "data-is-error": n.__isError,
1264
+ children: t ? typeof t == "function" ? t({
1265
+ ...u,
1266
+ row: n
1267
+ }) : t : p()
1268
+ });
1269
+ }, mt = ({ className: e, asChild: t, rowProps: n, tdProps: r, children: i, ...a }) => {
1270
+ B();
1271
+ let o = q(), s = t ? b : "tbody", c = null;
1272
+ return c = !i && !t ? o.currentRows.value?.map((e) => /* @__PURE__ */ d(pt, {
1273
+ rowObject: e,
1274
+ tdProps: r,
1275
+ ...n
1276
+ }, e.value.__rowId)) : typeof i == "function" ? i({
1277
+ ...o,
1278
+ currentRows: o.currentRows
1279
+ }) : i, /* @__PURE__ */ d(s, {
1280
+ ...a,
1281
+ className: J(e),
1282
+ "data-role": "etl-data-view-table-body",
1283
+ children: c
1284
+ });
1285
+ }, ht = ({ className: e, asChild: t, children: n, column: i, generateContent: a, onClick: o, ...s }) => {
1286
+ let c = q();
1287
+ a ??= "before";
1288
+ let l = t ? b : "th", u = r(() => !a || a === "none" ? null : i.label, [a, n]);
1289
+ return /* @__PURE__ */ d(l, {
1290
+ ...c.getTableHeaderProps({
1291
+ key: i.key,
1292
+ label: i.label
1293
+ }, { ...s }),
1294
+ className: J(e),
1295
+ children: n ? typeof n == "function" ? n({ ...c }) : n : u()
1296
+ });
1297
+ }, gt = {
1298
+ Context: K,
1299
+ Root: Ze,
1300
+ Table: {
1301
+ Root: dt,
1302
+ THead: ({ className: e, omitHeaders: t, generateHeaders: n, children: i, thElement: a, trElement: o, thProps: s, ...c }) => {
1303
+ let l = q(), u = c.asChild ? b : "thead", f = a || ht, p = o || "tr";
1304
+ n ??= "before";
1305
+ let m = r(() => !n || n === "none" ? null : l.getHeadersLabels().filter((e) => t ? !t?.includes(e.key) : !0).map((e) => /* @__PURE__ */ d(f, {
1306
+ ...s,
1307
+ children: e.label
1308
+ }, e.key)), [
1309
+ l,
1310
+ t,
1311
+ s,
1312
+ f
1313
+ ]);
1314
+ return /* @__PURE__ */ d(u, {
1315
+ ...l.getTableHeadersProps({ ...c }),
1316
+ className: J(e),
1317
+ children: /* @__PURE__ */ d(p, { children: i ? typeof i == "function" ? i({ ...l }) : i : m() })
1318
+ });
1319
+ },
1320
+ TBody: mt,
1321
+ HeaderCell: ht,
1322
+ Row: pt,
1323
+ Cell: ft
1324
+ },
1325
+ Pagination: {
1326
+ Root: ut,
1327
+ PageNumberButton: ct,
1328
+ PageNextButton: st,
1329
+ PagePreviousButton: lt,
1330
+ PageLastButton: ot,
1331
+ PageFirstButton: at
1332
+ },
1333
+ Edit: {
1334
+ Root: et,
1335
+ TriggerSubmit: nt,
1336
+ TriggerCancel: tt,
1337
+ NewInput: Qe,
1338
+ PreviusInput: $e
1339
+ },
1340
+ RemoveTrigger: Xe,
1341
+ Filter: it
1342
+ }, _t = ({ className: e, children: t, typeExport: n, exporter: r, ...i }) => {
1343
+ let { getExporterExportButtonProps: a } = ze();
1344
+ return /* @__PURE__ */ d("button", {
1345
+ className: e,
1346
+ ...a(n, r, i),
1347
+ children: typeof t == "function" ? t(a(n, r, i)) : t
1348
+ });
1349
+ }, X = t(null), Z = () => {
1350
+ let e = i(X);
1351
+ if (!e) throw Error("useImporterContext must be used within a ImporterContext");
1352
+ return e;
1353
+ }, vt = {
1354
+ Root: ({ children: e, asChild: t, className: n, ...r }) => {
1355
+ let i = Be(), a = t ? b : "div";
1356
+ return /* @__PURE__ */ d(X.Provider, {
1357
+ value: i,
1358
+ children: /* @__PURE__ */ d(a, {
1359
+ ...i.getImporterRootProps(r),
1360
+ className: J("etl-importer", n),
1361
+ children: typeof e == "function" ? e({ ...i }) : e
1362
+ })
1363
+ });
1364
+ },
1365
+ Input: ({ asChild: e, ...t }) => {
1366
+ let { getInputProps: n } = Z();
1367
+ return /* @__PURE__ */ d(e ? b : "input", { ...n(t) });
1368
+ },
1369
+ Trigger: ({ asChild: e, children: t, ...n }) => {
1370
+ let r = Z();
1371
+ return /* @__PURE__ */ d(e ? b : "button", {
1372
+ ...r.getImporterTriggerProps(n),
1373
+ children: typeof t == "function" ? t({ ...r }) : t
1374
+ });
1375
+ },
1376
+ Dropzone: ({ asChild: e, children: t, className: n, ...r }) => {
1377
+ let i = Z();
1378
+ return /* @__PURE__ */ d(e ? b : "div", {
1379
+ ...i.getDropZoneProps(r),
1380
+ className: J(n, i.isDragging && "dragging"),
1381
+ children: typeof t == "function" ? t({ ...i }) : t
1382
+ });
1383
+ },
1384
+ Context: X
1385
+ }, Q = t(null), yt = () => {
1386
+ let e = i(Q);
1387
+ if (!e) throw Error("useLayoutViewContext must be used within a LayoutViewContext");
1388
+ return e;
1389
+ }, bt = {
1390
+ Root: ({ children: e, asChild: t, className: n, layouts: r, ...i }) => {
1391
+ let { state: a } = H(), o = Ve(), c = t ? b : "div", [u, f] = l(null), p = s(() => ({
1392
+ ...o,
1393
+ Layouts: r ?? [],
1394
+ setSelectedLayout: f,
1395
+ selectedLayout: u,
1396
+ state: a
1397
+ }), [
1398
+ o,
1399
+ r,
1400
+ a
1401
+ ]);
1402
+ return /* @__PURE__ */ d(Q.Provider, {
1403
+ value: p,
1404
+ children: /* @__PURE__ */ d(c, {
1405
+ ...o.getLayoutViewRootProps(i),
1406
+ className: J(n),
1407
+ children: typeof e == "function" ? e({ ...p }) : e
1408
+ })
1409
+ });
1410
+ },
1411
+ Context: Q,
1412
+ Selector: ({ asChild: e, className: t, placeholder: n, ...r }) => {
1413
+ let i = yt(), a = e ? b : "select", o = (e) => {
1414
+ let t = e.target.value, n = i.Layouts.find((e) => e.id === t);
1415
+ i.setSelectedLayout(n ?? null);
1416
+ };
1417
+ return /* @__PURE__ */ f(a, {
1418
+ ...r,
1419
+ className: J(t),
1420
+ onChange: o,
1421
+ "data-role": "etl-layout-view-layouts-selector",
1422
+ children: [/* @__PURE__ */ d("option", {
1423
+ value: "",
1424
+ children: n ?? "Select a layout"
1425
+ }), i.Layouts.map((e) => /* @__PURE__ */ d("option", {
1426
+ value: e.id,
1427
+ children: e.name
1428
+ }, e.id))]
1429
+ });
1430
+ },
1431
+ Trigger: ({ asChild: e, className: t, ...n }) => {
1432
+ let r = e ? b : "button", i = yt(), a = i.getSelectLayoutButtonProps;
1433
+ return /* @__PURE__ */ d(r, {
1434
+ ...a(i.selectedLayout, { ...n }),
1435
+ className: J(t),
1436
+ children: typeof n.children == "function" ? n.children({ ...i }) : n.children
1437
+ });
1438
+ }
1439
+ }, xt = n(({ asChild: e, children: t, bufferSize: n = 100, filterDebugLogs: r = !0, className: i, ...a }, o) => {
1440
+ let { bufferLogs: s } = He(n, r), c = e ? b : "div", l;
1441
+ return l = typeof t == "function" ? t(s) : t && !e ? t : /* @__PURE__ */ d("ul", { children: s.map((e) => /* @__PURE__ */ d("li", {
1442
+ className: "log-view-item",
1443
+ children: e.message
1444
+ }, e.id + new Date(e.timestamp).getMilliseconds())) }), /* @__PURE__ */ d(c, {
1445
+ className: J(i),
1446
+ ref: o,
1447
+ ...a,
1448
+ "data-role": "etl-log-view",
1449
+ children: l
1450
+ });
1451
+ });
1452
+ xt.displayName = "Etl.LogView";
1453
+ var St = {
1454
+ etlMapperHeadersView: "_etlMapperHeadersView_1tfxt_3",
1455
+ etlMapperHeadersViewHeader: "_etlMapperHeadersViewHeader_1tfxt_13"
1456
+ }, Ct = ({ className: e, ...t }) => /* @__PURE__ */ f(t.asChild ? b : "header", {
1457
+ ...t,
1458
+ className: J(St.etlMapperHeadersViewHeader, e),
1459
+ children: [/* @__PURE__ */ d("h4", { children: t.headersLabel || "Layout Headers" }), /* @__PURE__ */ d("h4", { children: t.rowKeysLabel || "Row Keys" })]
1460
+ }), wt = ({ header: e, rowKeys: t, onChange: n, placeholder: r, disabled: i, value: a, ...o }) => {
1461
+ let s = o.asChild ? b : "div", c = (t) => {
1462
+ n(e.key, t.target.value);
1463
+ };
1464
+ return /* @__PURE__ */ f(s, {
1465
+ ...o,
1466
+ children: [/* @__PURE__ */ f("span", { children: [e.label, e.required ? "*" : ""] }), /* @__PURE__ */ f("select", {
1467
+ value: a || "",
1468
+ onChange: c,
1469
+ disabled: i,
1470
+ children: [/* @__PURE__ */ d("option", {
1471
+ value: "",
1472
+ disabled: !0,
1473
+ children: r || "Select a header"
1474
+ }), t.map((e) => /* @__PURE__ */ d("option", {
1475
+ value: e,
1476
+ children: e
1477
+ }, e))]
1478
+ })]
1479
+ });
1480
+ }, Tt = t(null), $ = () => {
1481
+ let e = i(Tt);
1482
+ if (!e) throw Error("useMapperContext must be used within a MapperContext");
1483
+ return e;
1484
+ }, Et = {
1485
+ Root: ({ className: e, ...t }) => {
1486
+ let n = W(), [r, i] = l({}), a = t.asChild ? b : "div";
1487
+ return /* @__PURE__ */ d(Tt.Provider, {
1488
+ value: {
1489
+ ...n,
1490
+ headerMappings: r,
1491
+ setHeaderMappings: i
1492
+ },
1493
+ children: /* @__PURE__ */ d(a, {
1494
+ ...n.getRootProps({ ...t }),
1495
+ className: J(e),
1496
+ children: typeof t.children == "function" ? t.children({ ...n }) : t.children
1497
+ })
1498
+ });
1499
+ },
1500
+ HeadersView: ({ className: e, headersProps: t, headersSelectorProps: n, ...r }) => {
1501
+ let i = $(), a = r.asChild ? b : "div", o = i.headers, s = i.rowKeys, c = (e, t) => {
1502
+ i.setHeaderMappings({
1503
+ ...i.headerMappings,
1504
+ [e]: t
1505
+ });
1506
+ };
1507
+ return /* @__PURE__ */ d(a, {
1508
+ ...i.getHeadersViewProps({ ...r }),
1509
+ ...t,
1510
+ className: J(St.etlMapperHeadersView, e),
1511
+ children: o.map((e) => /* @__PURE__ */ d(wt, {
1512
+ header: e,
1513
+ rowKeys: s,
1514
+ value: i.headerMappings[e.key],
1515
+ ...n,
1516
+ onChange: c
1517
+ }, e.key))
1518
+ });
1519
+ },
1520
+ Header: Ct,
1521
+ HeaderSelector: wt,
1522
+ TriggerConfirm: ({ className: e, ...t }) => {
1523
+ let n = $(), r = t.asChild ? b : "button", i = () => {
1524
+ n.setHeaderMappings({});
1525
+ };
1526
+ return /* @__PURE__ */ d(r, {
1527
+ ...n.getAcceptButtonProps(n.headerMappings, {
1528
+ ...t,
1529
+ onClick: i
1530
+ }),
1531
+ className: J(e),
1532
+ children: typeof t.children == "function" ? t.children({ ...n }) : t.children
1533
+ });
1534
+ },
1535
+ TriggerCancel: ({ className: e, ...t }) => {
1536
+ let n = $();
1537
+ return /* @__PURE__ */ d(t.asChild ? b : "button", {
1538
+ ...n.getCancelButtonProps({ ...t }),
1539
+ className: J(e),
1540
+ children: typeof t.children == "function" ? t.children({ ...n }) : t.children
1541
+ });
1542
+ }
1543
+ }, Dt = ({ children: e, asChild: t, className: n, dicc: r, ...i }) => {
1544
+ let a = t ? b : "div", { currentProgress: o, totalProgress: s } = Ge(), c = null;
1545
+ return c = e ? typeof e == "function" ? e({
1546
+ currentProgress: o,
1547
+ totalProgress: s
1548
+ }) : e : o.map((e) => /* @__PURE__ */ f("div", { children: [
1549
+ r?.[e.label] || e.label,
1550
+ ": ",
1551
+ e.value,
1552
+ "%"
1553
+ ] }, e.label)), /* @__PURE__ */ d(a, {
1554
+ className: J("ior-progress-view-root", n),
1555
+ ...i,
1556
+ children: c
1557
+ });
1558
+ }, Ot = () => {
1559
+ let { reset: e } = H();
1560
+ return { getResetButtonProps: (t) => ({
1561
+ ...t,
1562
+ onClick: U(t.onClick, e),
1563
+ disabled: t.disabled,
1564
+ "data-role": "etl-reset-button"
1565
+ }) };
1566
+ }, kt = ({ children: e, asChild: t, className: n, ...r }) => {
1567
+ let { getResetButtonProps: i } = Ot();
1568
+ return /* @__PURE__ */ d(t ? b : "button", {
1569
+ ...r,
1570
+ ...i(r),
1571
+ children: e && (typeof e == "function" ? e({ getResetButtonProps: i }) : e)
1572
+ });
1573
+ }, At = ({ asChild: e, children: t, className: n, stateDiccionary: r, ...i }) => {
1574
+ B();
1575
+ let { state: a } = H(), o = e ? b : "div", s;
1576
+ if (typeof t == "function") s = t(a);
1577
+ else if (t && !e) s = t;
1578
+ else {
1579
+ let e = typeof a == "string" ? a : Object.keys(a)[0];
1580
+ s = r && r[e] || e;
1581
+ }
1582
+ return /* @__PURE__ */ d(o, {
1583
+ className: J(n),
1584
+ ...i,
1585
+ "data-role": "etl-state-view",
1586
+ children: s
1587
+ });
1588
+ }, jt = ({ configs: e, children: t, asChild: n, ...r }) => {
1589
+ B();
1590
+ let i = Ie(e), a = qe(i), o = n ? b : "div", s = null;
1591
+ return s = typeof t == "function" ? t(i) : t, /* @__PURE__ */ d(V.Provider, {
1592
+ value: {
1593
+ ...i,
1594
+ ...a
1595
+ },
1596
+ children: /* @__PURE__ */ d(o, {
1597
+ ...r,
1598
+ children: s
1599
+ })
1600
+ });
1601
+ }, Mt = ({ children: e, isChild: t, ...n }) => {
1602
+ let r = G();
1603
+ return /* @__PURE__ */ d(t ? b : "div", {
1604
+ ...n,
1605
+ children: typeof e == "function" ? e(r) : e
1606
+ });
1607
+ }, Nt = ({ children: e, isChild: t, ...n }) => {
1608
+ let { getCancelRecoveryButtonProps: r } = G();
1609
+ return /* @__PURE__ */ d(t ? b : "button", {
1610
+ ...n,
1611
+ ...r(n),
1612
+ children: typeof e == "function" ? e() : e
1613
+ });
1614
+ }, Pt = ({ children: e, isChild: t, ...n }) => {
1615
+ let { getAcceptRecoveryButtonProps: r } = G();
1616
+ return /* @__PURE__ */ d(t ? b : "button", {
1617
+ ...n,
1618
+ ...r(n),
1619
+ children: typeof e == "function" ? e() : e
1620
+ });
1621
+ }, Ft = {
1622
+ Root: jt,
1623
+ Importer: vt,
1624
+ StateView: At,
1625
+ Layout: bt,
1626
+ LogView: xt,
1627
+ DataView: gt,
1628
+ ResetButton: kt,
1629
+ Exporter: _t,
1630
+ Mapper: Et,
1631
+ Progress: Dt,
1632
+ Recover: () => {
1633
+ let { recoverStep: e, recoveryPoint: t } = G();
1634
+ if (e === m.RECOVERING.WAITING_TO_CHOOSE_RECOVER) {
1635
+ let e = t?.value;
1636
+ return /* @__PURE__ */ f(Mt, {
1637
+ className: "flex flex-col gap-2",
1638
+ children: [/* @__PURE__ */ f("div", {
1639
+ className: "flex gap-3 items-center ",
1640
+ children: [/* @__PURE__ */ d("h3", {
1641
+ className: "font-semibold",
1642
+ children: "Detected a recovery point:"
1643
+ }), /* @__PURE__ */ f("div", {
1644
+ className: "flex gap-1 items-center ",
1645
+ children: [/* @__PURE__ */ d("small", {
1646
+ className: "text-gray-500",
1647
+ children: "File name:"
1648
+ }), /* @__PURE__ */ d("span", { children: e?.fileName })]
1649
+ })]
1650
+ }), /* @__PURE__ */ f("div", {
1651
+ className: "flex flex-col gap-2 border border-gray-200 rounded-md p-2 w-min",
1652
+ children: [/* @__PURE__ */ d("p", {
1653
+ className: "text-nowrap",
1654
+ children: "Would you like to recover from the recovery point?"
1655
+ }), /* @__PURE__ */ f("div", {
1656
+ className: "flex gap-1 justify-end",
1657
+ children: [/* @__PURE__ */ d(Nt, {
1658
+ className: "!bg-red-500 !hover:bg-red-400 transition-colors duration-300 ",
1659
+ children: "Skip"
1660
+ }), /* @__PURE__ */ d(Pt, { children: "Recover" })]
1661
+ })]
1662
+ })]
1663
+ });
1664
+ }
1665
+ return null;
1666
+ },
1667
+ AbortButton: Je
1668
+ };
1669
+ //#endregion
1670
+ export { Ft as Etl, V as EtlContext, U as callAll, Le as useAbortButton, Re as useDataView, H as useEtlContext, Ie as useEtlOrchestrator, Ke as useEtlState, ze as useExporter, Be as useImporter, Ve as useLayoutView, He as useLogView, W as useMapperProps, Ue as useMetrics, We as useNotifications, Ge as useProgress, G as useRecoveryView, qe as useStepsFlgs };