@firecms/data_import_export 3.0.0-canary.52 → 3.0.0-canary.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,17 +1,17 @@
1
- import y, { useState as S, useRef as Je, useEffect as De, useCallback as v, useMemo as He } from "react";
1
+ import b, { useState as N, useRef as He, useEffect as Ne, useCallback as C, useMemo as Ue } from "react";
2
2
  import { jsxs as p, Fragment as M, jsx as i } from "react/jsx-runtime";
3
- import { getPropertyInPath as J, mergeDeep as Ve, resolveProperty as ze, isPropertyBuilder as ue, EntityReference as Ue, useSnackbarController as Ne, useCustomizationController as G, getFieldConfig as Se, ErrorBoundary as We, PropertyConfigBadge as Oe, useDataSource as ke, resolveCollection as Ie, getPropertiesWithPropertiesOrder as Xe, useSelectionController as Ge, EntityCollectionTable as Ye, slugify as qe, getArrayValuesCount as Qe, getValueInPath as Ze, useFireCMSContext as Ke, useNavigationController as et } from "@firecms/core";
4
- import { Table as me, TableHeader as fe, TableCell as w, TableBody as he, TableRow as ge, Typography as f, ChevronRightIcon as xe, ExpandablePanel as tt, Select as _e, SelectItem as H, TextField as re, BooleanSwitchWithLabel as se, DateTimeField as rt, FileUpload as nt, UploadIcon as at, IconButton as Y, EditIcon as st, CenteredView as ye, Button as O, CircularProgress as Ae, Tooltip as q, FileUploadIcon as it, Dialog as ie, DialogContent as le, DialogActions as oe, cn as k, defaultBorderMixin as lt, GetAppIcon as Ee, Alert as ot, focusedMixin as _ } from "@firecms/ui";
5
- import { inferTypeFromValue as ct, buildEntityPropertiesFromData as dt } from "@firecms/schema_inference";
6
- import * as V from "xlsx";
7
- import { getIn as Te, setIn as pt } from "@firecms/formex";
8
- const ut = () => {
9
- const [e, n] = S(!1), [s, t] = S({}), [r, a] = S(), [l, o] = S([]), [c, d] = S([]), [u, m] = S({}), [h, g] = S([]), [x, R] = S({});
3
+ import { getPropertyInPath as J, mergeDeep as ze, resolveProperty as We, isPropertyBuilder as me, EntityReference as Xe, useSnackbarController as Se, useCustomizationController as q, getFieldConfig as Oe, ErrorBoundary as Ge, PropertyConfigBadge as ke, useDataSource as Ie, resolveCollection as _e, getPropertiesWithPropertiesOrder as Ye, useSelectionController as qe, EntityCollectionTable as Qe, slugify as Ze, getArrayValuesCount as Ke, getValueInPath as et, useFireCMSContext as tt, useNavigationController as rt, getDefaultValuesFor as at } from "@firecms/core";
4
+ import { Table as fe, TableHeader as he, TableCell as w, TableBody as ge, TableRow as xe, Typography as f, ChevronRightIcon as ye, ExpandablePanel as nt, Select as Ae, SelectItem as H, TextField as re, BooleanSwitchWithLabel as Y, DateTimeField as st, FileUpload as it, UploadIcon as lt, IconButton as Q, EditIcon as ot, CenteredView as be, Button as S, CircularProgress as Ee, Tooltip as Z, FileUploadIcon as ct, Dialog as se, DialogContent as ie, DialogActions as le, cn as _, defaultBorderMixin as dt, GetAppIcon as Te, Alert as pt, focusedMixin as T } from "@firecms/ui";
5
+ import { inferTypeFromValue as ut, buildEntityPropertiesFromData as mt } from "@firecms/schema_inference";
6
+ import * as U from "xlsx";
7
+ import { getIn as Fe, setIn as ft } from "@firecms/formex";
8
+ const ht = () => {
9
+ const [e, a] = N(!1), [s, t] = N({}), [r, n] = N(), [l, o] = N([]), [c, d] = N([]), [u, m] = N({}), [h, g] = N([]), [y, A] = N({});
10
10
  return {
11
11
  inUse: e,
12
- setInUse: n,
12
+ setInUse: a,
13
13
  idColumn: r,
14
- setIdColumn: a,
14
+ setIdColumn: n,
15
15
  entities: c,
16
16
  setEntities: d,
17
17
  importData: l,
@@ -20,34 +20,34 @@ const ut = () => {
20
20
  setHeadingsOrder: g,
21
21
  headersMapping: u,
22
22
  setHeadersMapping: m,
23
- originProperties: x,
24
- setOriginProperties: R,
23
+ originProperties: y,
24
+ setOriginProperties: A,
25
25
  defaultValues: s,
26
26
  setDefaultValues: t
27
27
  };
28
28
  };
29
- function mt(e) {
30
- let n = 0;
29
+ function gt(e) {
30
+ let a = 0;
31
31
  const s = [], t = {};
32
32
  if (e == null || e["!ref"] == null)
33
33
  return [];
34
34
  const r = t.range !== void 0 ? t.range : e["!ref"];
35
- let a;
36
- switch (t.header === 1 ? n = 1 : t.header === "A" ? n = 2 : Array.isArray(t.header) && (n = 3), typeof r) {
35
+ let n;
36
+ switch (t.header === 1 ? a = 1 : t.header === "A" ? a = 2 : Array.isArray(t.header) && (a = 3), typeof r) {
37
37
  case "string":
38
- a = be(r);
38
+ n = ve(r);
39
39
  break;
40
40
  case "number":
41
- a = be(e["!ref"]), a.s.r = r;
41
+ n = ve(e["!ref"]), n.s.r = r;
42
42
  break;
43
43
  default:
44
- a = r;
44
+ n = r;
45
45
  }
46
- const l = V.utils.encode_row(a.s.r), o = new Array(a.e.c - a.s.c + 1);
47
- for (let c = a.s.c; c <= a.e.c; ++c) {
48
- o[c] = V.utils.encode_col(c);
46
+ const l = U.utils.encode_row(n.s.r), o = new Array(n.e.c - n.s.c + 1);
47
+ for (let c = n.s.c; c <= n.e.c; ++c) {
48
+ o[c] = U.utils.encode_col(c);
49
49
  const d = e[o[c] + l];
50
- switch (n) {
50
+ switch (a) {
51
51
  case 1:
52
52
  s.push(c);
53
53
  break;
@@ -55,18 +55,18 @@ function mt(e) {
55
55
  s.push(o[c]);
56
56
  break;
57
57
  case 3:
58
- s.push(t.header[c - a.s.c]);
58
+ s.push(t.header[c - n.s.c]);
59
59
  break;
60
60
  default:
61
61
  if (d === void 0)
62
62
  continue;
63
- s.push(V.utils.format_cell(d));
63
+ s.push(U.utils.format_cell(d));
64
64
  }
65
65
  }
66
66
  return s;
67
67
  }
68
- function be(e) {
69
- const n = {
68
+ function ve(e) {
69
+ const a = {
70
70
  s: {
71
71
  c: 0,
72
72
  r: 0
@@ -77,50 +77,50 @@ function be(e) {
77
77
  }
78
78
  };
79
79
  let s = 0, t = 0, r = 0;
80
- const a = e.length;
81
- for (s = 0; t < a && !((r = e.charCodeAt(t) - 64) < 1 || r > 26); ++t)
80
+ const n = e.length;
81
+ for (s = 0; t < n && !((r = e.charCodeAt(t) - 64) < 1 || r > 26); ++t)
82
82
  s = 26 * s + r;
83
- for (n.s.c = --s, s = 0; t < a && !((r = e.charCodeAt(t) - 48) < 0 || r > 9); ++t)
83
+ for (a.s.c = --s, s = 0; t < n && !((r = e.charCodeAt(t) - 48) < 0 || r > 9); ++t)
84
84
  s = 10 * s + r;
85
- if (n.s.r = --s, t === a || e.charCodeAt(++t) === 58)
86
- return n.e.c = n.s.c, n.e.r = n.s.r, n;
87
- for (s = 0; t !== a && !((r = e.charCodeAt(t) - 64) < 1 || r > 26); ++t)
85
+ if (a.s.r = --s, t === n || e.charCodeAt(++t) === 58)
86
+ return a.e.c = a.s.c, a.e.r = a.s.r, a;
87
+ for (s = 0; t !== n && !((r = e.charCodeAt(t) - 64) < 1 || r > 26); ++t)
88
88
  s = 26 * s + r;
89
- for (n.e.c = --s, s = 0; t !== a && !((r = e.charCodeAt(t) - 48) < 0 || r > 9); ++t)
89
+ for (a.e.c = --s, s = 0; t !== n && !((r = e.charCodeAt(t) - 48) < 0 || r > 9); ++t)
90
90
  s = 10 * s + r;
91
- return n.e.r = --s, n;
91
+ return a.e.r = --s, a;
92
92
  }
93
- function ft(e) {
94
- return new Promise((n, s) => {
93
+ function xt(e) {
94
+ return new Promise((a, s) => {
95
95
  if (e.type === "application/json") {
96
96
  console.debug("Converting JSON file to JSON", e.name);
97
97
  const t = new FileReader();
98
98
  t.onload = function(r) {
99
99
  try {
100
- const a = r.target?.result, l = JSON.parse(a);
100
+ const n = r.target?.result, l = JSON.parse(n);
101
101
  if (!Array.isArray(l))
102
102
  s(new Error("JSON file should contain an array of objects"));
103
103
  else {
104
104
  const o = l.length > 0 ? Object.keys(l[0]) : [];
105
- n({
105
+ a({
106
106
  data: l,
107
107
  propertiesOrder: o
108
108
  });
109
109
  }
110
- } catch (a) {
111
- console.error("Error parsing JSON file", a), s(a);
110
+ } catch (n) {
111
+ console.error("Error parsing JSON file", n), s(n);
112
112
  }
113
113
  }, t.readAsText(e);
114
114
  } else {
115
115
  console.debug("Converting Excel file to JSON", e.name);
116
116
  const t = new FileReader();
117
117
  t.onload = function(r) {
118
- const a = new Uint8Array(r.target?.result), l = V.read(a, {
118
+ const n = new Uint8Array(r.target?.result), l = U.read(n, {
119
119
  type: "array",
120
120
  codepage: 65001,
121
121
  cellDates: !0
122
- }), o = l.SheetNames[0], c = l.Sheets[o], d = V.utils.sheet_to_json(c), u = mt(c), h = d.map(ht).map(je);
123
- n({
122
+ }), o = l.SheetNames[0], c = l.Sheets[o], d = U.utils.sheet_to_json(c), u = gt(c), h = d.map(yt).map(je);
123
+ a({
124
124
  data: h,
125
125
  propertiesOrder: u
126
126
  });
@@ -128,71 +128,71 @@ function ft(e) {
128
128
  }
129
129
  });
130
130
  }
131
- function ht(e) {
132
- return Object.keys(e).reduce((n, s) => {
131
+ function yt(e) {
132
+ return Object.keys(e).reduce((a, s) => {
133
133
  try {
134
- n[s] = JSON.parse(e[s]);
134
+ a[s] = JSON.parse(e[s]);
135
135
  } catch {
136
- n[s] = e[s];
136
+ a[s] = e[s];
137
137
  }
138
- return n;
138
+ return a;
139
139
  }, {});
140
140
  }
141
141
  function je(e) {
142
- return Object.keys(e).reduce((n, s) => {
143
- let t = n;
142
+ return Object.keys(e).reduce((a, s) => {
143
+ let t = a;
144
144
  const r = s.split(".");
145
- return r.forEach((a, l) => {
146
- if (/^[\w]+\[\d+\]$/.test(a)) {
147
- const o = a.slice(0, a.indexOf("[")), c = parseInt(a.slice(a.indexOf("[") + 1, a.indexOf("]")));
145
+ return r.forEach((n, l) => {
146
+ if (/^[\w]+\[\d+\]$/.test(n)) {
147
+ const o = n.slice(0, n.indexOf("[")), c = parseInt(n.slice(n.indexOf("[") + 1, n.indexOf("]")));
148
148
  t[o] || (t[o] = []), l !== r.length - 1 ? (t[o][c] = t[o][c] || {}, t = t[o][c]) : t[o][c] = e[s];
149
149
  } else
150
- l !== r.length - 1 ? (t[a] = t[a] || {}, t = t[a]) : t[a] = e[s];
151
- }), n;
150
+ l !== r.length - 1 ? (t[n] = t[n] || {}, t = t[n]) : t[n] = e[s];
151
+ }), a;
152
152
  }, {});
153
153
  }
154
- function gt(e, n, s, t, r, a) {
155
- const l = Fe(e);
156
- n && delete l[n];
154
+ function bt(e, a, s, t, r, n) {
155
+ const l = Pe(e);
156
+ a && delete l[a];
157
157
  const o = Object.entries(l).map(([u, m]) => {
158
- const h = Te(s, u) ?? u, g = J(t, h);
158
+ const h = Fe(s, u) ?? u, g = J(t, h);
159
159
  if (!g)
160
160
  return {};
161
- const x = ne(m, g);
161
+ const y = ae(m, g);
162
162
  return {
163
- [h]: x
163
+ [h]: y
164
164
  };
165
- }).reduce((u, m) => ({ ...u, ...m }), {}), c = Ve(a ?? {}, je(o));
166
- let d = n ? e[n] : void 0;
165
+ }).reduce((u, m) => ({ ...u, ...m }), {}), c = ze(n ?? {}, je(o));
166
+ let d = a ? e[a] : void 0;
167
167
  return typeof d == "string" ? d = d.trim() : typeof d == "number" || typeof d == "boolean" ? d = d.toString() : d instanceof Date ? d = d.toISOString() : d && "toString" in d && (d = d.toString()), {
168
168
  id: d,
169
169
  values: c,
170
170
  path: r
171
171
  };
172
172
  }
173
- function Fe(e, n = "") {
173
+ function Pe(e, a = "") {
174
174
  return Object.keys(e).reduce((s, t) => {
175
- const r = n ? `${n}.${t}` : t;
176
- return typeof e[t] == "object" && !(e[t] instanceof Date) && e[t] !== null && !Array.isArray(e[t]) ? Object.assign(s, Fe(e[t], r)) : s[r] = e[t], s;
175
+ const r = a ? `${a}.${t}` : t;
176
+ return typeof e[t] == "object" && !(e[t] instanceof Date) && e[t] !== null && !Array.isArray(e[t]) ? Object.assign(s, Pe(e[t], r)) : s[r] = e[t], s;
177
177
  }, {});
178
178
  }
179
- function ne(e, n) {
179
+ function ae(e, a) {
180
180
  if (e === null)
181
181
  return null;
182
- if (n === void 0)
182
+ if (a === void 0)
183
183
  return e;
184
- const s = ze({
185
- propertyOrBuilder: n
184
+ const s = We({
185
+ propertyOrBuilder: a
186
186
  });
187
187
  if (s === null)
188
188
  return e;
189
- const t = ct(e), r = s.dataType;
190
- if (t === "array" && r === "array" && Array.isArray(e) && s.of && !ue(s.of))
191
- return e.map((a) => ne(a, s.of));
189
+ const t = ut(e), r = s.dataType;
190
+ if (t === "array" && r === "array" && Array.isArray(e) && s.of && !me(s.of))
191
+ return e.map((n) => ae(n, s.of));
192
192
  if (t === "string" && r === "number" && typeof e == "string")
193
193
  return Number(e);
194
- if (t === "string" && r === "array" && typeof e == "string" && s.of && !ue(s.of))
195
- return e.split(",").map((a) => ne(a, s.of));
194
+ if (t === "string" && r === "array" && typeof e == "string" && s.of && !me(s.of))
195
+ return e.split(",").map((n) => ae(n, s.of));
196
196
  if (t === "string" && r === "boolean")
197
197
  return e === "true";
198
198
  if (t === "number" && r === "boolean")
@@ -204,7 +204,7 @@ function ne(e, n) {
204
204
  if (t === "number" && r === "string" && typeof e == "number")
205
205
  return e.toString();
206
206
  if (t === "string" && r === "array" && typeof e == "string")
207
- return e.split(",").map((a) => a.trim());
207
+ return e.split(",").map((n) => n.trim());
208
208
  if (t === "string" && r === "date" && typeof e == "string")
209
209
  try {
210
210
  return new Date(e);
@@ -221,8 +221,8 @@ function ne(e, n) {
221
221
  return e;
222
222
  }
223
223
  else if (t === "string" && r === "reference" && typeof e == "string") {
224
- const a = e.split("/").slice(0, -1).join("/"), l = e.split("/").slice(-1)[0];
225
- return new Ue(l, a);
224
+ const n = e.split("/").slice(0, -1).join("/"), l = e.split("/").slice(-1)[0];
225
+ return new Xe(l, n);
226
226
  } else {
227
227
  if (t === r)
228
228
  return e;
@@ -232,37 +232,37 @@ function ne(e, n) {
232
232
  }
233
233
  return e;
234
234
  }
235
- function xt(e) {
235
+ function vt(e) {
236
236
  return typeof e == "number" ? "number" : typeof e == "string" ? "string" : typeof e == "boolean" ? "boolean" : e instanceof Date ? "date" : Array.isArray(e) ? "array" : "map";
237
237
  }
238
- function yt({
238
+ function Ct({
239
239
  importConfig: e,
240
- destinationProperties: n,
240
+ destinationProperties: a,
241
241
  buildPropertyView: s
242
242
  }) {
243
- const t = e.headersMapping, r = e.headingsOrder, a = e.idColumn, l = e.originProperties;
243
+ const t = e.headersMapping, r = e.headingsOrder, n = e.idColumn, l = e.originProperties;
244
244
  return /* @__PURE__ */ p(M, { children: [
245
245
  /* @__PURE__ */ i(
246
- bt,
246
+ wt,
247
247
  {
248
- idColumn: a,
248
+ idColumn: n,
249
249
  headersMapping: t,
250
250
  onChange: (o) => e.setIdColumn(o ?? void 0)
251
251
  }
252
252
  ),
253
253
  /* @__PURE__ */ i("div", { className: "h-4" }),
254
- /* @__PURE__ */ p(me, { style: {
254
+ /* @__PURE__ */ p(fe, { style: {
255
255
  tableLayout: "fixed"
256
256
  }, children: [
257
- /* @__PURE__ */ p(fe, { children: [
257
+ /* @__PURE__ */ p(he, { children: [
258
258
  /* @__PURE__ */ i(w, { header: !0, style: { width: "20%" }, children: "Column in file" }),
259
259
  /* @__PURE__ */ i(w, { header: !0 }),
260
260
  /* @__PURE__ */ i(w, { header: !0, style: { width: "75%" }, children: "Map to Property" })
261
261
  ] }),
262
- /* @__PURE__ */ i(he, { children: n && r.map(
262
+ /* @__PURE__ */ i(ge, { children: a && r.map(
263
263
  (o) => {
264
- const c = t[o], d = t[o], u = c ? J(n, c) : null, m = J(l, o), h = m ? m.dataType === "array" && typeof m.of == "object" ? `${m.dataType} - ${m.of.dataType}` : m.dataType : void 0;
265
- return /* @__PURE__ */ p(ge, { style: { height: "90px" }, children: [
264
+ const c = t[o], d = t[o], u = c ? J(a, c) : null, m = J(l, o), h = m ? m.dataType === "array" && typeof m.of == "object" ? `${m.dataType} - ${m.of.dataType}` : m.dataType : void 0;
265
+ return /* @__PURE__ */ p(xe, { style: { height: "90px" }, children: [
266
266
  /* @__PURE__ */ p(w, { style: { width: "20%" }, children: [
267
267
  /* @__PURE__ */ i(f, { variant: "body2", children: o }),
268
268
  m && /* @__PURE__ */ i(
@@ -274,14 +274,14 @@ function yt({
274
274
  }
275
275
  )
276
276
  ] }),
277
- /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(xe, {}) }),
277
+ /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(ye, {}) }),
278
278
  /* @__PURE__ */ i(
279
279
  w,
280
280
  {
281
- className: o === a ? "text-center" : void 0,
281
+ className: o === n ? "text-center" : void 0,
282
282
  style: { width: "75%" },
283
283
  children: s?.({
284
- isIdColumn: o === a,
284
+ isIdColumn: o === n,
285
285
  property: u,
286
286
  propertyKey: d,
287
287
  importKey: o
@@ -292,34 +292,34 @@ function yt({
292
292
  }
293
293
  ) })
294
294
  ] }),
295
- /* @__PURE__ */ p(tt, { title: "Default values", initiallyExpanded: !1, className: "p-4 mt-4", children: [
295
+ /* @__PURE__ */ p(nt, { title: "Default values", initiallyExpanded: !1, className: "p-4 mt-4", children: [
296
296
  /* @__PURE__ */ i("div", { className: "text-sm text-slate-500 dark:text-slate-300 font-medium ml-3.5 mb-1", children: "You can select a default value for unmapped columns and empty values:" }),
297
- /* @__PURE__ */ p(me, { style: {
297
+ /* @__PURE__ */ p(fe, { style: {
298
298
  tableLayout: "fixed"
299
299
  }, children: [
300
- /* @__PURE__ */ p(fe, { children: [
300
+ /* @__PURE__ */ p(he, { children: [
301
301
  /* @__PURE__ */ i(w, { header: !0, style: { width: "30%" }, children: "Property" }),
302
302
  /* @__PURE__ */ i(w, { header: !0 }),
303
303
  /* @__PURE__ */ i(w, { header: !0, style: { width: "65%" }, children: "Default value" })
304
304
  ] }),
305
- /* @__PURE__ */ i(he, { children: n && Pe(n).map(
305
+ /* @__PURE__ */ i(ge, { children: a && Me(a).map(
306
306
  (o) => {
307
- const c = J(n, o);
308
- return typeof c != "object" || c === null || !["number", "string", "boolean", "map"].includes(c.dataType) ? null : /* @__PURE__ */ p(ge, { style: { height: "70px" }, children: [
307
+ const c = J(a, o);
308
+ return typeof c != "object" || c === null || !["number", "string", "boolean", "map"].includes(c.dataType) ? null : /* @__PURE__ */ p(xe, { style: { height: "70px" }, children: [
309
309
  /* @__PURE__ */ i(w, { style: { width: "20%" }, children: /* @__PURE__ */ i(f, { variant: "body2", children: o }) }),
310
- /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(xe, {}) }),
310
+ /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(ye, {}) }),
311
311
  /* @__PURE__ */ i(
312
312
  w,
313
313
  {
314
- className: o === a ? "text-center" : void 0,
314
+ className: o === n ? "text-center" : void 0,
315
315
  style: { width: "75%" },
316
316
  children: /* @__PURE__ */ i(
317
- vt,
317
+ Dt,
318
318
  {
319
319
  property: c,
320
- defaultValue: Te(e.defaultValues, o),
320
+ defaultValue: Fe(e.defaultValues, o),
321
321
  onValueChange: (d) => {
322
- const u = pt(e.defaultValues, o, d);
322
+ const u = ft(e.defaultValues, o, d);
323
323
  e.setDefaultValues(u);
324
324
  }
325
325
  }
@@ -333,23 +333,23 @@ function yt({
333
333
  ] })
334
334
  ] });
335
335
  }
336
- function Pe(e, n) {
336
+ function Me(e, a) {
337
337
  return Object.entries(e).reduce((s, [t, r]) => {
338
- const a = n ? `${n}.${t}` : t;
338
+ const n = a ? `${a}.${t}` : t;
339
339
  if (typeof r != "function" && r.dataType === "map" && r.properties) {
340
- const l = Pe(r.properties, a);
340
+ const l = Me(r.properties, n);
341
341
  return [...s, ...l];
342
342
  }
343
- return [...s, a];
343
+ return [...s, n];
344
344
  }, []);
345
345
  }
346
- function bt({
346
+ function wt({
347
347
  idColumn: e,
348
- headersMapping: n,
348
+ headersMapping: a,
349
349
  onChange: s
350
350
  }) {
351
351
  return /* @__PURE__ */ i("div", { children: /* @__PURE__ */ p(
352
- _e,
352
+ Ae,
353
353
  {
354
354
  size: "small",
355
355
  value: e ?? "",
@@ -362,14 +362,14 @@ function bt({
362
362
  label: "Column that will be used as ID for each document",
363
363
  children: [
364
364
  /* @__PURE__ */ i(H, { value: "__none__", children: "Autogenerate ID" }),
365
- Object.entries(n).map(([t, r]) => /* @__PURE__ */ i(H, { value: t, children: t }, t))
365
+ Object.entries(a).map(([t, r]) => /* @__PURE__ */ i(H, { value: t, children: t }, t))
366
366
  ]
367
367
  }
368
368
  ) });
369
369
  }
370
- function vt({
370
+ function Dt({
371
371
  property: e,
372
- onValueChange: n,
372
+ onValueChange: a,
373
373
  defaultValue: s
374
374
  }) {
375
375
  return e.dataType === "string" ? /* @__PURE__ */ i(
@@ -378,7 +378,7 @@ function vt({
378
378
  size: "small",
379
379
  placeholder: "Default value",
380
380
  value: s ?? "",
381
- onChange: (t) => n(t.target.value)
381
+ onChange: (t) => a(t.target.value)
382
382
  }
383
383
  ) : e.dataType === "number" ? /* @__PURE__ */ i(
384
384
  re,
@@ -387,34 +387,34 @@ function vt({
387
387
  type: "number",
388
388
  value: s ?? "",
389
389
  placeholder: "Default value",
390
- onChange: (t) => n(t.target.value)
390
+ onChange: (t) => a(t.target.value)
391
391
  }
392
392
  ) : e.dataType === "boolean" ? /* @__PURE__ */ i(
393
- se,
393
+ Y,
394
394
  {
395
395
  value: s ?? null,
396
396
  allowIndeterminate: !0,
397
397
  size: "small",
398
- onValueChange: (t) => n(t === null ? void 0 : t),
398
+ onValueChange: (t) => a(t === null ? void 0 : t),
399
399
  label: s === void 0 ? "Do not set value" : s === !0 ? "Set value to true" : "Set value to false"
400
400
  }
401
401
  ) : e.dataType === "date" ? /* @__PURE__ */ i(
402
- rt,
402
+ st,
403
403
  {
404
404
  mode: e.mode ?? "date",
405
405
  size: "small",
406
406
  value: s ?? void 0,
407
407
  onChange: (t) => {
408
- n(t);
408
+ a(t);
409
409
  },
410
410
  clearable: !0
411
411
  }
412
412
  ) : null;
413
413
  }
414
- function Ct({ onDataAdded: e }) {
415
- const n = Ne();
414
+ function Nt({ onDataAdded: e }) {
415
+ const a = Se();
416
416
  return /* @__PURE__ */ i(
417
- nt,
417
+ it,
418
418
  {
419
419
  accept: {
420
420
  "text/*": [".csv", ".xls", ".xlsx"],
@@ -430,17 +430,17 @@ function Ct({ onDataAdded: e }) {
430
430
  size: "small",
431
431
  maxFiles: 1,
432
432
  uploadDescription: /* @__PURE__ */ p(M, { children: [
433
- /* @__PURE__ */ i(at, {}),
433
+ /* @__PURE__ */ i(lt, {}),
434
434
  "Drag and drop a file here or click to upload"
435
435
  ] }),
436
436
  onFilesAdded: (s) => {
437
- s.length > 0 && ft(s[0]).then(({
437
+ s.length > 0 && xt(s[0]).then(({
438
438
  data: t,
439
439
  propertiesOrder: r
440
440
  }) => {
441
441
  e(t, r);
442
442
  }).catch((t) => {
443
- console.error("Error parsing file", t), n.open({
443
+ console.error("Error parsing file", t), a.open({
444
444
  type: "error",
445
445
  message: t.message
446
446
  });
@@ -449,170 +449,170 @@ function Ct({ onDataAdded: e }) {
449
449
  }
450
450
  );
451
451
  }
452
- function Rt({
452
+ function Bt({
453
453
  propertyKey: e,
454
- property: n,
454
+ property: a,
455
455
  onEditClick: s,
456
456
  includeName: t = !0,
457
457
  onPropertyNameChanged: r,
458
- propertyTypeView: a
458
+ propertyTypeView: n
459
459
  }) {
460
- const { propertyConfigs: l } = G(), o = n ? Se(n, l) : null;
461
- return /* @__PURE__ */ i(We, { children: /* @__PURE__ */ p(
460
+ const { propertyConfigs: l } = q(), o = a ? Oe(a, l) : null;
461
+ return /* @__PURE__ */ i(Ge, { children: /* @__PURE__ */ p(
462
462
  "div",
463
463
  {
464
464
  className: "flex flex-row w-full items-center",
465
465
  children: [
466
- /* @__PURE__ */ i("div", { className: "mx-4", children: a ?? /* @__PURE__ */ i(Oe, { propertyConfig: o ?? void 0 }) }),
466
+ /* @__PURE__ */ i("div", { className: "mx-4", children: n ?? /* @__PURE__ */ i(ke, { propertyConfig: o ?? void 0 }) }),
467
467
  /* @__PURE__ */ i("div", { className: "w-full flex flex-col grow", children: /* @__PURE__ */ p("div", { className: "flex flex-row items-center gap-2", children: [
468
468
  t && /* @__PURE__ */ i(
469
469
  re,
470
470
  {
471
471
  size: "small",
472
472
  className: "text-base grow",
473
- value: n?.name ?? "",
473
+ value: a?.name ?? "",
474
474
  onChange: (c) => {
475
475
  r && e && r(e, c.target.value);
476
476
  }
477
477
  }
478
478
  ),
479
- /* @__PURE__ */ i(Y, { onClick: s, size: "small", children: /* @__PURE__ */ i(st, { size: "small" }) })
479
+ /* @__PURE__ */ i(Q, { onClick: s, size: "small", children: /* @__PURE__ */ i(ot, { size: "small" }) })
480
480
  ] }) })
481
481
  ]
482
482
  }
483
483
  ) });
484
484
  }
485
- function wt({
485
+ function St({
486
486
  path: e,
487
- importConfig: n,
487
+ importConfig: a,
488
488
  collection: s,
489
489
  onImportSuccess: t
490
490
  }) {
491
- const [r, a] = S(void 0), l = ke(), o = Je(!1), [c, d] = S(0);
491
+ const [r, n] = N(void 0), l = Ie(), o = He(!1), [c, d] = N(0);
492
492
  function u() {
493
- o.current || (o.current = !0, Me(
493
+ o.current || (o.current = !0, Re(
494
494
  l,
495
495
  s,
496
496
  e,
497
- n.entities,
497
+ a.entities,
498
498
  0,
499
499
  25,
500
500
  d
501
501
  ).then(() => {
502
502
  t(s), o.current = !1;
503
503
  }).catch((m) => {
504
- a(m), o.current = !1;
504
+ n(m), o.current = !1;
505
505
  }));
506
506
  }
507
- return De(() => {
507
+ return Ne(() => {
508
508
  u();
509
- }, []), r ? /* @__PURE__ */ p(ye, { className: "flex flex-col gap-4 items-center", children: [
509
+ }, []), r ? /* @__PURE__ */ p(be, { className: "flex flex-col gap-4 items-center", children: [
510
510
  /* @__PURE__ */ i(f, { variant: "h6", children: "Error saving data" }),
511
511
  /* @__PURE__ */ i(f, { variant: "body2", color: "error", children: r.message }),
512
512
  /* @__PURE__ */ i(
513
- O,
513
+ S,
514
514
  {
515
515
  onClick: u,
516
516
  variant: "outlined",
517
517
  children: "Retry"
518
518
  }
519
519
  )
520
- ] }) : /* @__PURE__ */ p(ye, { className: "flex flex-col gap-4 items-center", children: [
521
- /* @__PURE__ */ i(Ae, {}),
520
+ ] }) : /* @__PURE__ */ p(be, { className: "flex flex-col gap-4 items-center", children: [
521
+ /* @__PURE__ */ i(Ee, {}),
522
522
  /* @__PURE__ */ i(f, { variant: "h6", children: "Saving data" }),
523
523
  /* @__PURE__ */ p(f, { variant: "body2", children: [
524
524
  c,
525
525
  "/",
526
- n.entities.length,
526
+ a.entities.length,
527
527
  " entities saved"
528
528
  ] }),
529
529
  /* @__PURE__ */ i(f, { variant: "caption", children: "Do not close this tab or the import will be interrupted." })
530
530
  ] });
531
531
  }
532
- function Me(e, n, s, t, r = 0, a = 25, l) {
533
- console.debug("Saving imported data", r, a);
534
- const o = t.slice(r, r + a);
532
+ function Re(e, a, s, t, r = 0, n = 25, l) {
533
+ console.debug("Saving imported data", r, n);
534
+ const o = t.slice(r, r + n);
535
535
  return Promise.all(o.map((c) => e.saveEntity({
536
536
  path: s,
537
537
  values: c.values,
538
538
  entityId: c.id,
539
- collection: n,
539
+ collection: a,
540
540
  status: "new"
541
- }))).then(() => r + a < t.length ? (l(r + a), Me(e, n, s, t, r + a, a, l)) : (l(t.length), Promise.resolve()));
541
+ }))).then(() => r + n < t.length ? (l(r + n), Re(e, a, s, t, r + n, n, l)) : (l(t.length), Promise.resolve()));
542
542
  }
543
- function Dt({
543
+ function Ot({
544
544
  collection: e,
545
- path: n,
545
+ path: a,
546
546
  collectionEntitiesCount: s,
547
547
  onAnalyticsEvent: t
548
548
  }) {
549
- const r = G(), a = Ne(), [l, o] = y.useState(!1), [c, d] = y.useState("initial"), u = ut(), m = v(() => {
549
+ const r = q(), n = Se(), [l, o] = b.useState(!1), [c, d] = b.useState("initial"), u = ht(), m = C(() => {
550
550
  o(!0), t?.("import_open"), d("initial");
551
- }, [t]), h = v(() => {
551
+ }, [t]), h = C(() => {
552
552
  o(!1);
553
- }, [o]), g = v(() => {
553
+ }, [o]), g = C(() => {
554
554
  t?.("import_mapping_complete"), d("preview");
555
- }, [t]), x = v(() => {
555
+ }, [t]), y = C(() => {
556
556
  t?.("import_data_save"), d("import_data_saving");
557
- }, [t]), R = async (b) => {
558
- if (u.setImportData(b), b.length > 0) {
559
- const T = await dt(b, xt);
560
- u.setOriginProperties(T);
561
- const j = $e(b, e?.properties);
562
- u.setHeadersMapping(j);
563
- const F = Object.keys(j)?.[0];
564
- (F?.includes("id") || F?.includes("key")) && u.setIdColumn(F);
557
+ }, [t]), A = async (v) => {
558
+ if (u.setImportData(v), v.length > 0) {
559
+ const P = await mt(v, vt);
560
+ u.setOriginProperties(P);
561
+ const E = $e(v, e?.properties);
562
+ u.setHeadersMapping(E);
563
+ const O = Object.keys(E)?.[0];
564
+ (O?.includes("id") || O?.includes("key")) && u.setIdColumn(O);
565
565
  }
566
566
  setTimeout(() => {
567
567
  t?.("import_data_added"), d("mapping");
568
568
  }, 100);
569
- }, A = Ie({
569
+ }, F = _e({
570
570
  collection: e,
571
- path: n,
571
+ path: a,
572
572
  fields: r.propertyConfigs
573
- }), L = Xe(A.properties, A.propertiesOrder), E = Object.entries(L).flatMap(([b, T]) => Re(b, T, 0)), z = A.propertiesOrder ?? Object.keys(A.properties);
573
+ }), j = Ye(F.properties, F.propertiesOrder), z = Object.entries(j).flatMap(([v, P]) => Ve(v, P, 0)), ce = F.propertiesOrder ?? Object.keys(F.properties);
574
574
  return e.collectionGroup ? null : /* @__PURE__ */ p(M, { children: [
575
- /* @__PURE__ */ i(q, { title: "Import", children: /* @__PURE__ */ i(Y, { color: "primary", onClick: m, children: /* @__PURE__ */ i(it, {}) }) }),
575
+ /* @__PURE__ */ i(Z, { title: "Import", children: /* @__PURE__ */ i(Q, { color: "primary", onClick: m, children: /* @__PURE__ */ i(ct, {}) }) }),
576
576
  /* @__PURE__ */ p(
577
- ie,
577
+ se,
578
578
  {
579
579
  open: l,
580
580
  fullWidth: c === "preview",
581
581
  fullHeight: c === "preview",
582
582
  maxWidth: c === "initial" ? "lg" : "7xl",
583
583
  children: [
584
- /* @__PURE__ */ p(le, { className: "flex flex-col gap-4 my-4", fullHeight: c === "preview", children: [
584
+ /* @__PURE__ */ p(ie, { className: "flex flex-col gap-4 my-4", fullHeight: c === "preview", children: [
585
585
  c === "initial" && /* @__PURE__ */ p(M, { children: [
586
586
  /* @__PURE__ */ i(f, { variant: "h6", children: "Import data" }),
587
587
  /* @__PURE__ */ i(f, { variant: "body2", children: "Upload a CSV, Excel or JSON file and map it to your existing schema" }),
588
- /* @__PURE__ */ i(Ct, { onDataAdded: R })
588
+ /* @__PURE__ */ i(Nt, { onDataAdded: A })
589
589
  ] }),
590
590
  c === "mapping" && /* @__PURE__ */ p(M, { children: [
591
591
  /* @__PURE__ */ i(f, { variant: "h6", className: "ml-3.5", children: "Map fields" }),
592
592
  /* @__PURE__ */ i(
593
- yt,
593
+ Ct,
594
594
  {
595
595
  importConfig: u,
596
- destinationProperties: L,
596
+ destinationProperties: j,
597
597
  buildPropertyView: ({
598
- isIdColumn: b,
599
- property: T,
600
- propertyKey: j,
601
- importKey: F
598
+ isIdColumn: v,
599
+ property: P,
600
+ propertyKey: E,
601
+ importKey: O
602
602
  }) => /* @__PURE__ */ i(
603
- Nt,
603
+ kt,
604
604
  {
605
- selectedPropertyKey: j ?? "",
606
- properties: L,
607
- propertiesAndLevel: E,
608
- isIdColumn: b,
605
+ selectedPropertyKey: E ?? "",
606
+ properties: j,
607
+ propertiesAndLevel: z,
608
+ isIdColumn: v,
609
609
  onIdSelected: () => {
610
- u.setIdColumn(F);
610
+ u.setIdColumn(O);
611
611
  },
612
- onPropertySelected: ($) => {
612
+ onPropertySelected: (R) => {
613
613
  t?.("import_mapping_field_updated");
614
- const Q = Object.entries(u.headersMapping).map(([C, B]) => B === $ ? { [C]: null } : C === F ? { [C]: $ } : { [C]: B }).reduce((C, B) => ({ ...C, ...B }), {});
615
- u.setHeadersMapping(Q), $ === u.idColumn && u.setIdColumn(void 0);
614
+ const de = Object.entries(u.headersMapping).map(([k, V]) => V === R ? { [k]: null } : k === O ? { [k]: R } : { [k]: V }).reduce((k, V) => ({ ...k, ...V }), {});
615
+ u.setHeadersMapping(de), R === u.idColumn && u.setIdColumn(void 0);
616
616
  }
617
617
  }
618
618
  )
@@ -620,21 +620,21 @@ function Dt({
620
620
  )
621
621
  ] }),
622
622
  c === "preview" && /* @__PURE__ */ i(
623
- St,
623
+ It,
624
624
  {
625
625
  importConfig: u,
626
- properties: L,
627
- propertiesOrder: z
626
+ properties: j,
627
+ propertiesOrder: ce
628
628
  }
629
629
  ),
630
630
  c === "import_data_saving" && u && /* @__PURE__ */ i(
631
- wt,
631
+ St,
632
632
  {
633
633
  importConfig: u,
634
634
  collection: e,
635
- path: n,
636
- onImportSuccess: (b) => {
637
- h(), a.open({
635
+ path: a,
636
+ onImportSuccess: (v) => {
637
+ h(), n.open({
638
638
  type: "info",
639
639
  message: "Data imported successfully"
640
640
  });
@@ -642,9 +642,9 @@ function Dt({
642
642
  }
643
643
  )
644
644
  ] }),
645
- /* @__PURE__ */ p(oe, { children: [
645
+ /* @__PURE__ */ p(le, { children: [
646
646
  c === "mapping" && /* @__PURE__ */ i(
647
- O,
647
+ S,
648
648
  {
649
649
  onClick: () => d("initial"),
650
650
  variant: "text",
@@ -652,7 +652,7 @@ function Dt({
652
652
  }
653
653
  ),
654
654
  c === "preview" && /* @__PURE__ */ i(
655
- O,
655
+ S,
656
656
  {
657
657
  onClick: () => d("mapping"),
658
658
  variant: "text",
@@ -660,7 +660,7 @@ function Dt({
660
660
  }
661
661
  ),
662
662
  /* @__PURE__ */ i(
663
- O,
663
+ S,
664
664
  {
665
665
  onClick: h,
666
666
  variant: "text",
@@ -668,7 +668,7 @@ function Dt({
668
668
  }
669
669
  ),
670
670
  c === "mapping" && /* @__PURE__ */ i(
671
- O,
671
+ S,
672
672
  {
673
673
  variant: "filled",
674
674
  onClick: g,
@@ -676,10 +676,10 @@ function Dt({
676
676
  }
677
677
  ),
678
678
  c === "preview" && /* @__PURE__ */ i(
679
- O,
679
+ S,
680
680
  {
681
681
  variant: "filled",
682
- onClick: x,
682
+ onClick: y,
683
683
  children: "Save data"
684
684
  }
685
685
  )
@@ -689,33 +689,33 @@ function Dt({
689
689
  )
690
690
  ] });
691
691
  }
692
- const W = "__internal_id__";
693
- function Nt({
692
+ const X = "__internal_id__";
693
+ function kt({
694
694
  selectedPropertyKey: e,
695
- properties: n,
695
+ properties: a,
696
696
  onPropertySelected: s,
697
697
  onIdSelected: t,
698
698
  propertiesAndLevel: r,
699
- isIdColumn: a
699
+ isIdColumn: n
700
700
  }) {
701
- const l = e ? J(n, e) : null, o = v((d) => d === W ? /* @__PURE__ */ i(f, { variant: "body2", className: "p-4", children: "Use this column as ID" }) : !d || !l ? /* @__PURE__ */ i(f, { variant: "body2", color: "disabled", className: "p-4", children: "Do not import this property" }) : /* @__PURE__ */ i(
702
- ve,
701
+ const l = e ? J(a, e) : null, o = C((d) => d === X ? /* @__PURE__ */ i(f, { variant: "body2", className: "p-4", children: "Use this column as ID" }) : !d || !l ? /* @__PURE__ */ i(f, { variant: "body2", color: "disabled", className: "p-4", children: "Do not import this property" }) : /* @__PURE__ */ i(
702
+ Ce,
703
703
  {
704
704
  propertyKey: d,
705
705
  property: l
706
706
  }
707
707
  ), [l]);
708
708
  return /* @__PURE__ */ p(
709
- _e,
709
+ Ae,
710
710
  {
711
- value: a ? W : e ?? void 0,
711
+ value: n ? X : e ?? void 0,
712
712
  onValueChange: (d) => {
713
- d === W ? (t(), s(null)) : s(d === "__do_not_import" ? null : d);
713
+ d === X ? (t(), s(null)) : s(d === "__do_not_import" ? null : d);
714
714
  },
715
715
  renderValue: o,
716
716
  children: [
717
717
  /* @__PURE__ */ i(H, { value: "__do_not_import", children: /* @__PURE__ */ i(f, { variant: "body2", color: "disabled", className: "p-4", children: "Do not import this property" }) }),
718
- /* @__PURE__ */ i(H, { value: W, children: /* @__PURE__ */ i(f, { variant: "body2", className: "p-4", children: "Use this column as ID" }) }),
718
+ /* @__PURE__ */ i(H, { value: X, children: /* @__PURE__ */ i(f, { variant: "body2", className: "p-4", children: "Use this column as ID" }) }),
719
719
  r.map(({
720
720
  property: d,
721
721
  level: u,
@@ -726,7 +726,7 @@ function Nt({
726
726
  value: m,
727
727
  disabled: d.dataType === "map",
728
728
  children: /* @__PURE__ */ i(
729
- ve,
729
+ Ce,
730
730
  {
731
731
  propertyKey: m,
732
732
  property: d,
@@ -740,29 +740,29 @@ function Nt({
740
740
  }
741
741
  );
742
742
  }
743
- function Re(e, n, s) {
743
+ function Ve(e, a, s) {
744
744
  const t = [];
745
745
  return t.push({
746
- property: n,
746
+ property: a,
747
747
  level: s,
748
748
  propertyKey: e
749
- }), n.dataType === "map" && n.properties && Object.entries(n.properties).forEach(([r, a]) => {
750
- t.push(...Re(`${e}.${r}`, a, s + 1));
749
+ }), a.dataType === "map" && a.properties && Object.entries(a.properties).forEach(([r, n]) => {
750
+ t.push(...Ve(`${e}.${r}`, n, s + 1));
751
751
  }), t;
752
752
  }
753
- function ve({
753
+ function Ce({
754
754
  propertyKey: e,
755
- property: n,
755
+ property: a,
756
756
  level: s = 0
757
757
  }) {
758
- const { propertyConfigs: t } = G(), r = Se(n, t);
758
+ const { propertyConfigs: t } = q(), r = Oe(a, t);
759
759
  return /* @__PURE__ */ p(
760
760
  "div",
761
761
  {
762
762
  className: "flex flex-row w-full text-start items-center h-full",
763
763
  children: [
764
- new Array(s).fill(0).map((a, l) => /* @__PURE__ */ i("div", { className: k(lt, "ml-8 border-l h-12") }, l)),
765
- /* @__PURE__ */ i("div", { className: "m-4", children: /* @__PURE__ */ i(q, { title: r?.name, children: /* @__PURE__ */ i(Oe, { propertyConfig: r }) }) }),
764
+ new Array(s).fill(0).map((n, l) => /* @__PURE__ */ i("div", { className: _(dt, "ml-8 border-l h-12") }, l)),
765
+ /* @__PURE__ */ i("div", { className: "m-4", children: /* @__PURE__ */ i(Z, { title: r?.name, children: /* @__PURE__ */ i(ke, { propertyConfig: r }) }) }),
766
766
  /* @__PURE__ */ p("div", { className: "flex flex-col flex-grow p-2 pl-2", children: [
767
767
  /* @__PURE__ */ i(
768
768
  f,
@@ -770,7 +770,7 @@ function ve({
770
770
  variant: "body1",
771
771
  component: "span",
772
772
  className: "flex-grow pr-2",
773
- children: n.name ? n.name : " "
773
+ children: a.name ? a.name : " "
774
774
  }
775
775
  ),
776
776
  /* @__PURE__ */ i(
@@ -788,18 +788,18 @@ function ve({
788
788
  }
789
789
  );
790
790
  }
791
- function St({
791
+ function It({
792
792
  importConfig: e,
793
- properties: n,
793
+ properties: a,
794
794
  propertiesOrder: s
795
795
  }) {
796
- De(() => {
797
- const r = e.importData.map((a) => gt(a, e.idColumn, e.headersMapping, n, "TEMP_PATH", e.defaultValues));
796
+ Ne(() => {
797
+ const r = e.importData.map((n) => bt(n, e.idColumn, e.headersMapping, a, "TEMP_PATH", e.defaultValues));
798
798
  e.setEntities(r);
799
799
  }, []);
800
- const t = Ge();
800
+ const t = qe();
801
801
  return /* @__PURE__ */ i(
802
- Ye,
802
+ Qe,
803
803
  {
804
804
  title: /* @__PURE__ */ p("div", { children: [
805
805
  /* @__PURE__ */ i(f, { variant: "subtitle2", children: "Imported data preview" }),
@@ -815,186 +815,212 @@ function St({
815
815
  filterable: !1,
816
816
  sortable: !1,
817
817
  selectionController: t,
818
- properties: n
818
+ properties: a
819
819
  }
820
820
  );
821
821
  }
822
- function $e(e, n) {
822
+ function $e(e, a) {
823
823
  const s = {};
824
824
  return e.filter(Boolean).forEach((t) => {
825
825
  Object.keys(t).forEach((r) => {
826
- const a = t[r];
827
- if (typeof a == "object" && !Array.isArray(a)) {
828
- const l = n?.[r], o = l && "properties" in l ? l.properties : void 0, c = $e([a], o);
826
+ const n = t[r];
827
+ if (typeof n == "object" && !Array.isArray(n)) {
828
+ const l = a?.[r], o = l && "properties" in l ? l.properties : void 0, c = $e([n], o);
829
829
  Object.entries(c).forEach(([d, u]) => {
830
830
  s[`${r}.${d}`] = `${r}.${u}`;
831
831
  });
832
832
  }
833
- if (!n)
833
+ if (!a)
834
834
  s[r] = r;
835
- else if (r in n)
835
+ else if (r in a)
836
836
  s[r] = r;
837
837
  else {
838
- const l = qe(r);
839
- l in n ? s[r] = l : s[r] = r;
838
+ const l = Ze(r);
839
+ l in a ? s[r] = l : s[r] = r;
840
840
  }
841
841
  });
842
842
  }), s;
843
843
  }
844
- function Be(e, n, s, t, r, a, l, o, c) {
844
+ function Be({
845
+ data: e,
846
+ additionalData: a,
847
+ properties: s,
848
+ propertiesOrder: t,
849
+ name: r,
850
+ flattenArrays: n,
851
+ additionalHeaders: l,
852
+ exportType: o,
853
+ dateExportType: c
854
+ }) {
845
855
  if (console.debug("Downloading export", {
846
856
  dataLength: e.length,
847
857
  properties: s,
848
858
  exportType: o,
849
859
  dateExportType: c
850
860
  }), o === "csv") {
851
- const d = a ? Qe(e.map((x) => x.values)) : {}, u = It(s, t, l, d), m = Ot(e, n, s, u, c), h = Ce(u.map((x) => x.label)), g = m.map((x) => Ce(x));
852
- we([h, ...g], `${r}.csv`, "text/csv");
861
+ const d = n ? Ke(e.map((y) => y.values)) : {}, u = Et(s, t, l, d), m = _t(e, a, s, u, c), h = we(u.map((y) => y.label)), g = m.map((y) => we(y));
862
+ De([h, ...g], `${r}.csv`, "text/csv");
853
863
  } else {
854
- const d = kt(e, n, s, c), u = JSON.stringify(d, null, 2);
855
- we([u], `${r}.json`, "application/json");
864
+ const d = At(e, a, s, c), u = JSON.stringify(d, null, 2);
865
+ De([u], `${r}.json`, "application/json");
856
866
  }
857
867
  }
858
- function Ot(e, n, s, t, r) {
859
- const a = e.map((l) => ({
868
+ function _t(e, a, s, t, r) {
869
+ const n = e.map((l) => ({
860
870
  id: l.id,
861
- ...ce(l.values, s, "csv", r)
871
+ ...oe(l.values, s, "csv", r)
862
872
  }));
863
- return n && n.forEach((l, o) => {
864
- a[o] = { ...a[o], ...l };
865
- }), a && a.map((l) => t.map((o) => Ze(l, o.key)));
873
+ return a && a.forEach((l, o) => {
874
+ n[o] = { ...n[o], ...l };
875
+ }), n && n.map((l) => t.map((o) => et(l, o.key)));
866
876
  }
867
- function kt(e, n, s, t) {
868
- const r = e.map((a) => ({
869
- id: a.id,
870
- ...ce(a.values, s, "json", t)
877
+ function At(e, a, s, t) {
878
+ const r = e.map((n) => ({
879
+ id: n.id,
880
+ ...oe(n.values, s, "json", t)
871
881
  }));
872
- return n && n.forEach((a, l) => {
873
- r[l] = { ...r[l], ...a };
882
+ return a && a.forEach((n, l) => {
883
+ r[l] = { ...r[l], ...n };
874
884
  }), r;
875
885
  }
876
- function It(e, n, s, t) {
886
+ function Et(e, a, s, t) {
877
887
  const r = [
878
888
  {
879
889
  label: "id",
880
890
  key: "id"
881
891
  },
882
- ...(n ?? Object.keys(e)).flatMap((a) => {
883
- const l = e[a];
884
- return l ? t && t[a] > 1 ? Array.from(
885
- { length: t[a] },
886
- (o, c) => ae(l, `${a}[${c}]`, "")
887
- ).flat() : ae(l, a, "") : (console.warn("Property not found", a, e), []);
892
+ ...(a ?? Object.keys(e)).flatMap((n) => {
893
+ const l = e[n];
894
+ return l ? t && t[n] > 1 ? Array.from(
895
+ { length: t[n] },
896
+ (o, c) => ne(l, `${n}[${c}]`, "")
897
+ ).flat() : ne(l, n, "") : (console.warn("Property not found", n, e), []);
888
898
  })
889
899
  ];
890
- return s && r.push(...s.map((a) => ({
891
- label: a,
892
- key: a
900
+ return s && r.push(...s.map((n) => ({
901
+ label: n,
902
+ key: n
893
903
  }))), r;
894
904
  }
895
- function ae(e, n, s = "") {
896
- const t = s ? `${s}.${n}` : n;
897
- return e.dataType === "map" && e.properties ? Object.entries(e.properties).map(([r, a]) => ae(a, r, t)).flat() : [{
905
+ function ne(e, a, s = "") {
906
+ const t = s ? `${s}.${a}` : a;
907
+ return e.dataType === "map" && e.properties ? Object.entries(e.properties).map(([r, n]) => ne(n, r, t)).flat() : [{
898
908
  label: t,
899
909
  key: t
900
910
  }];
901
911
  }
902
- function X(e, n, s, t) {
912
+ function G(e, a, s, t) {
903
913
  let r;
904
- if (n.dataType === "map" && n.properties)
905
- r = ce(e, n.properties, s, t);
906
- else if (n.dataType === "array")
907
- n.of && Array.isArray(e) ? Array.isArray(n.of) ? r = n.of.map((a, l) => X(e[l], a, s, t)) : n.of.dataType === "map" ? r = s === "csv" ? e.map((a) => JSON.stringify(a)) : e.map((a) => X(a, n.of, s, t)) : r = e.map((a) => X(a, n.of, s, t)) : r = e;
908
- else if (n.dataType === "reference" && e && e.isEntityReference && e.isEntityReference()) {
909
- const a = e || void 0;
910
- r = a ? a.pathWithId : null;
914
+ if (a.dataType === "map" && a.properties)
915
+ r = oe(e, a.properties, s, t);
916
+ else if (a.dataType === "array")
917
+ a.of && Array.isArray(e) ? Array.isArray(a.of) ? r = a.of.map((n, l) => G(e[l], n, s, t)) : a.of.dataType === "map" ? r = s === "csv" ? e.map((n) => JSON.stringify(n)) : e.map((n) => G(n, a.of, s, t)) : r = e.map((n) => G(n, a.of, s, t)) : r = e;
918
+ else if (a.dataType === "reference" && e && e.isEntityReference && e.isEntityReference()) {
919
+ const n = e || void 0;
920
+ r = n ? n.pathWithId : null;
911
921
  } else
912
- n.dataType === "date" && e instanceof Date ? r = e ? t === "timestamp" ? e.getTime() : e.toISOString() : null : r = e;
922
+ a.dataType === "date" && e instanceof Date ? r = e ? t === "timestamp" ? e.getTime() : e.toISOString() : null : r = e;
913
923
  return r;
914
924
  }
915
- function ce(e, n, s, t) {
916
- const r = Object.entries(n).map(([a, l]) => {
917
- const o = e && e[a], c = X(o, l, s, t);
918
- return c === void 0 ? {} : { [a]: c };
919
- }).reduce((a, l) => ({ ...a, ...l }), {});
925
+ function oe(e, a, s, t) {
926
+ const r = Object.entries(a).map(([n, l]) => {
927
+ const o = e && e[n], c = G(o, l, s, t);
928
+ return c === void 0 ? {} : { [n]: c };
929
+ }).reduce((n, l) => ({ ...n, ...l }), {});
920
930
  return { ...e, ...r };
921
931
  }
922
- function Ce(e) {
923
- return e.map((n) => n == null ? "" : Array.isArray(n) ? '"' + JSON.stringify(n).replaceAll('"', '\\"') + '"' : '"' + String(n).replaceAll('"', '""') + '"').join(",") + `\r
932
+ function we(e) {
933
+ return e.map((a) => a == null ? "" : Array.isArray(a) ? '"' + JSON.stringify(a).replaceAll('"', '\\"') + '"' : '"' + String(a).replaceAll('"', '""') + '"').join(",") + `\r
924
934
  `;
925
935
  }
926
- function we(e, n, s) {
927
- const t = new Blob(e, { type: s }), r = URL.createObjectURL(t), a = document.createElement("a");
928
- a.href = r, a.setAttribute("download", n), a.click();
936
+ function De(e, a, s) {
937
+ const t = new Blob(e, { type: s }), r = URL.createObjectURL(t), n = document.createElement("a");
938
+ n.href = r, n.setAttribute("download", a), n.click();
929
939
  }
930
- const _t = 500;
931
- function At({
940
+ const Tt = 500;
941
+ function Ft({
932
942
  collection: e,
933
- path: n,
943
+ path: a,
934
944
  collectionEntitiesCount: s,
935
945
  onAnalyticsEvent: t,
936
946
  exportAllowed: r,
937
- notAllowedView: a
947
+ notAllowedView: n
938
948
  }) {
939
- const l = G(), o = typeof e.exportable == "object" ? e.exportable : void 0, c = y.useRef(/* @__PURE__ */ new Date()), [d, u] = y.useState(!0), [m, h] = y.useState("csv"), [g, x] = y.useState("string"), R = Ke(), A = ke(), E = et().resolveAliasesFrom(n), z = !r || r({
949
+ const l = q(), o = typeof e.exportable == "object" ? e.exportable : void 0, c = b.useRef(/* @__PURE__ */ new Date()), [d, u] = b.useState(!1), [m, h] = b.useState(!0), [g, y] = b.useState("csv"), [A, F] = b.useState("string"), j = tt(), z = Ie(), v = rt().resolveAliasesFrom(a), P = !r || r({
940
950
  collectionEntitiesCount: s,
941
- path: E,
951
+ path: v,
942
952
  collection: e
943
- }), b = y.useMemo(() => Ie({
953
+ }), E = b.useMemo(() => _e({
944
954
  collection: e,
945
- path: E,
955
+ path: v,
946
956
  fields: l.propertyConfigs
947
- }), [e, E]), [T, j] = y.useState(!1), [F, $] = y.useState(), [Q, C] = y.useState(!1), B = v(() => {
948
- C(!0);
949
- }, [C]), Z = v(() => {
950
- C(!1);
951
- }, [C]), de = v(async (D) => {
952
- const U = o?.additionalFields, I = b.additionalFields, K = U ? await Promise.all(D.map(async (P) => (await Promise.all(U.map(async (N) => ({
953
- [N.key]: await N.builder({
954
- entity: P,
955
- context: R
957
+ }), [e, v]), [O, R] = b.useState(!1), [de, k] = b.useState(), [V, $] = b.useState(!1), Le = C(() => {
958
+ $(!0);
959
+ }, [$]), K = C(() => {
960
+ $(!1);
961
+ }, [$]), pe = C(async (D) => {
962
+ const W = o?.additionalFields, I = E.additionalFields, ee = W ? await Promise.all(D.map(async (B) => (await Promise.all(W.map(async (x) => ({
963
+ [x.key]: await x.builder({
964
+ entity: B,
965
+ context: j
956
966
  })
957
- })))).reduce((N, te) => ({ ...N, ...te }), {}))) : [], ee = I ? await Promise.all(D.map(async (P) => (await Promise.all(I.map(async (N) => N.value ? {
958
- [N.key]: await N.value({
959
- entity: P,
960
- context: R
967
+ })))).reduce((x, L) => ({ ...x, ...L }), {}))) : [], te = I ? await Promise.all(D.map(async (B) => (await Promise.all(I.map(async (x) => x.value ? {
968
+ [x.key]: await x.value({
969
+ entity: B,
970
+ context: j
961
971
  })
962
- } : {}))).reduce((N, te) => ({ ...N, ...te }), {}))) : [];
963
- return [...K, ...ee];
964
- }, [o?.additionalFields]), pe = v(async (D, U) => {
972
+ } : {}))).reduce((x, L) => ({ ...x, ...L }), {}))) : [];
973
+ return [...ee, ...te];
974
+ }, [o?.additionalFields]), ue = C(async (D, W) => {
965
975
  t?.("export_collection", {
966
976
  collection: D.path
967
- }), j(!0), A.fetchCollection({
968
- path: E,
977
+ }), R(!0), z.fetchCollection({
978
+ path: v,
969
979
  collection: D
970
980
  }).then(async (I) => {
971
- $(void 0);
972
- const K = await de(I), ee = [
973
- ...U?.additionalFields?.map((P) => P.key) ?? [],
974
- ...D.additionalFields?.map((P) => P.key) ?? []
975
- ];
976
- Be(I, K, D.properties, D.propertiesOrder, D.name, d, ee, m, g), t?.("export_collection_success", {
981
+ k(void 0);
982
+ const ee = await pe(I), te = [
983
+ ...W?.additionalFields?.map((x) => x.key) ?? [],
984
+ ...D.additionalFields?.map((x) => x.key) ?? []
985
+ ], B = d ? I.map((x) => {
986
+ const L = at(D.properties);
987
+ return {
988
+ ...x,
989
+ values: { ...L, ...x.values }
990
+ };
991
+ }) : I;
992
+ Be({
993
+ data: B,
994
+ additionalData: ee,
995
+ properties: D.properties,
996
+ propertiesOrder: D.propertiesOrder,
997
+ name: D.name,
998
+ flattenArrays: m,
999
+ additionalHeaders: te,
1000
+ exportType: g,
1001
+ dateExportType: A
1002
+ }), t?.("export_collection_success", {
977
1003
  collection: D.path
978
1004
  });
979
1005
  }).catch((I) => {
980
- console.error("Error loading export data", I), $(I);
981
- }).finally(() => j(!1));
982
- }, [t, A, E, de, d, m, g]), Le = v(() => {
983
- pe(b, o), Z();
984
- }, [pe, b, o, Z]);
1006
+ console.error("Error loading export data", I), k(I);
1007
+ }).finally(() => R(!1));
1008
+ }, [t, z, v, pe, d, m, g, A]), Je = C(() => {
1009
+ ue(E, o), K();
1010
+ }, [ue, E, o, K]);
985
1011
  return /* @__PURE__ */ p(M, { children: [
986
- /* @__PURE__ */ i(q, { title: "Export", children: /* @__PURE__ */ i(Y, { color: "primary", onClick: B, children: /* @__PURE__ */ i(Ee, {}) }) }),
1012
+ /* @__PURE__ */ i(Z, { title: "Export", children: /* @__PURE__ */ i(Q, { color: "primary", onClick: Le, children: /* @__PURE__ */ i(Te, {}) }) }),
987
1013
  /* @__PURE__ */ p(
988
- ie,
1014
+ se,
989
1015
  {
990
- open: Q,
991
- onOpenChange: C,
1016
+ open: V,
1017
+ onOpenChange: $,
992
1018
  maxWidth: "xl",
993
1019
  children: [
994
- /* @__PURE__ */ p(le, { className: "flex flex-col gap-4 my-4", children: [
1020
+ /* @__PURE__ */ p(ie, { className: "flex flex-col gap-4 my-4", children: [
995
1021
  /* @__PURE__ */ i(f, { variant: "h6", children: "Export data" }),
996
1022
  /* @__PURE__ */ i("div", { children: "Download the the content of this table as a CSV" }),
997
- s > _t && /* @__PURE__ */ i(ot, { color: "warning", children: /* @__PURE__ */ p("div", { children: [
1023
+ s > Tt && /* @__PURE__ */ i(pt, { color: "warning", children: /* @__PURE__ */ p("div", { children: [
998
1024
  "This collections has a large number of documents (",
999
1025
  s,
1000
1026
  ")."
@@ -1009,9 +1035,9 @@ function At({
1009
1035
  type: "radio",
1010
1036
  value: "csv",
1011
1037
  name: "exportType",
1012
- checked: m === "csv",
1013
- onChange: () => h("csv"),
1014
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1038
+ checked: g === "csv",
1039
+ onChange: () => y("csv"),
1040
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1015
1041
  }
1016
1042
  ),
1017
1043
  /* @__PURE__ */ i(
@@ -1031,9 +1057,9 @@ function At({
1031
1057
  type: "radio",
1032
1058
  value: "json",
1033
1059
  name: "exportType",
1034
- checked: m === "json",
1035
- onChange: () => h("json"),
1036
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1060
+ checked: g === "json",
1061
+ onChange: () => y("json"),
1062
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1037
1063
  }
1038
1064
  ),
1039
1065
  /* @__PURE__ */ i(
@@ -1055,9 +1081,9 @@ function At({
1055
1081
  type: "radio",
1056
1082
  value: "timestamp",
1057
1083
  name: "dateExportType",
1058
- checked: g === "timestamp",
1059
- onChange: () => x("timestamp"),
1060
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1084
+ checked: A === "timestamp",
1085
+ onChange: () => F("timestamp"),
1086
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1061
1087
  }
1062
1088
  ),
1063
1089
  /* @__PURE__ */ p(
@@ -1081,9 +1107,9 @@ function At({
1081
1107
  type: "radio",
1082
1108
  value: "string",
1083
1109
  name: "dateExportType",
1084
- checked: g === "string",
1085
- onChange: () => x("string"),
1086
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1110
+ checked: A === "string",
1111
+ onChange: () => F("string"),
1112
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1087
1113
  }
1088
1114
  ),
1089
1115
  /* @__PURE__ */ p(
@@ -1102,33 +1128,42 @@ function At({
1102
1128
  ] })
1103
1129
  ] }),
1104
1130
  /* @__PURE__ */ i(
1105
- se,
1131
+ Y,
1132
+ {
1133
+ size: "small",
1134
+ disabled: g !== "csv",
1135
+ value: m,
1136
+ onValueChange: h,
1137
+ label: "Flatten arrays"
1138
+ }
1139
+ ),
1140
+ /* @__PURE__ */ i(
1141
+ Y,
1106
1142
  {
1107
1143
  size: "small",
1108
- disabled: m !== "csv",
1109
1144
  value: d,
1110
1145
  onValueChange: u,
1111
- label: "Flatten arrays"
1146
+ label: "Include undefined values"
1112
1147
  }
1113
1148
  ),
1114
- !z && a
1149
+ !P && n
1115
1150
  ] }),
1116
- /* @__PURE__ */ p(oe, { children: [
1117
- T && /* @__PURE__ */ i(Ae, { size: "small" }),
1151
+ /* @__PURE__ */ p(le, { children: [
1152
+ O && /* @__PURE__ */ i(Ee, { size: "small" }),
1118
1153
  /* @__PURE__ */ i(
1119
- O,
1154
+ S,
1120
1155
  {
1121
- onClick: Z,
1156
+ onClick: K,
1122
1157
  variant: "text",
1123
1158
  children: "Cancel"
1124
1159
  }
1125
1160
  ),
1126
1161
  /* @__PURE__ */ i(
1127
- O,
1162
+ S,
1128
1163
  {
1129
1164
  variant: "filled",
1130
- onClick: Le,
1131
- disabled: T || !z,
1165
+ onClick: Je,
1166
+ disabled: O || !P,
1132
1167
  children: "Download"
1133
1168
  }
1134
1169
  )
@@ -1138,37 +1173,47 @@ function At({
1138
1173
  )
1139
1174
  ] });
1140
1175
  }
1141
- function $t(e) {
1142
- return He(() => ({
1176
+ function Lt(e) {
1177
+ return Ue(() => ({
1143
1178
  key: "import_export",
1144
1179
  collectionView: {
1145
- CollectionActions: [Dt, At],
1180
+ CollectionActions: [Ot, Ft],
1146
1181
  collectionActionsProps: e
1147
1182
  }
1148
1183
  }), [e]);
1149
1184
  }
1150
- function Bt({
1185
+ function Jt({
1151
1186
  data: e,
1152
- properties: n,
1187
+ properties: a,
1153
1188
  propertiesOrder: s
1154
1189
  }) {
1155
- const t = y.useRef(/* @__PURE__ */ new Date()), [r, a] = y.useState(!0), [l, o] = y.useState("csv"), [c, d] = y.useState("string"), [u, m] = y.useState(!1), h = v(() => {
1190
+ const t = b.useRef(/* @__PURE__ */ new Date()), [r, n] = b.useState(!0), [l, o] = b.useState("csv"), [c, d] = b.useState("string"), [u, m] = b.useState(!1), h = C(() => {
1156
1191
  m(!0);
1157
- }, [m]), g = v(() => {
1192
+ }, [m]), g = C(() => {
1158
1193
  m(!1);
1159
- }, [m]), x = v(() => {
1160
- Be(e, [], n, s, "export.csv", r, [], l, c), g();
1194
+ }, [m]), y = C(() => {
1195
+ Be({
1196
+ data: e,
1197
+ additionalData: [],
1198
+ properties: a,
1199
+ propertiesOrder: s,
1200
+ name: "export.csv",
1201
+ flattenArrays: r,
1202
+ additionalHeaders: [],
1203
+ exportType: l,
1204
+ dateExportType: c
1205
+ }), g();
1161
1206
  }, []);
1162
1207
  return /* @__PURE__ */ p(M, { children: [
1163
- /* @__PURE__ */ i(q, { title: "Export", children: /* @__PURE__ */ i(Y, { color: "primary", onClick: h, children: /* @__PURE__ */ i(Ee, {}) }) }),
1208
+ /* @__PURE__ */ i(Z, { title: "Export", children: /* @__PURE__ */ i(Q, { color: "primary", onClick: h, children: /* @__PURE__ */ i(Te, {}) }) }),
1164
1209
  /* @__PURE__ */ p(
1165
- ie,
1210
+ se,
1166
1211
  {
1167
1212
  open: u,
1168
1213
  onOpenChange: m,
1169
1214
  maxWidth: "xl",
1170
1215
  children: [
1171
- /* @__PURE__ */ p(le, { className: "flex flex-col gap-4 my-4", children: [
1216
+ /* @__PURE__ */ p(ie, { className: "flex flex-col gap-4 my-4", children: [
1172
1217
  /* @__PURE__ */ i(f, { variant: "h6", children: "Export data" }),
1173
1218
  /* @__PURE__ */ i("div", { children: "Download the the content of this table as a CSV" }),
1174
1219
  /* @__PURE__ */ p("div", { className: "flex flex-row gap-4", children: [
@@ -1183,7 +1228,7 @@ function Bt({
1183
1228
  name: "exportType",
1184
1229
  checked: l === "csv",
1185
1230
  onChange: () => o("csv"),
1186
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1231
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1187
1232
  }
1188
1233
  ),
1189
1234
  /* @__PURE__ */ i(
@@ -1205,7 +1250,7 @@ function Bt({
1205
1250
  name: "exportType",
1206
1251
  checked: l === "json",
1207
1252
  onChange: () => o("json"),
1208
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1253
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1209
1254
  }
1210
1255
  ),
1211
1256
  /* @__PURE__ */ i(
@@ -1229,7 +1274,7 @@ function Bt({
1229
1274
  name: "dateExportType",
1230
1275
  checked: c === "timestamp",
1231
1276
  onChange: () => d("timestamp"),
1232
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1277
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1233
1278
  }
1234
1279
  ),
1235
1280
  /* @__PURE__ */ p(
@@ -1255,7 +1300,7 @@ function Bt({
1255
1300
  name: "dateExportType",
1256
1301
  checked: c === "string",
1257
1302
  onChange: () => d("string"),
1258
- className: k(_, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1303
+ className: _(T, "w-4 text-primary-dark bg-gray-100 border-gray-300 dark:bg-gray-700 dark:border-gray-600")
1259
1304
  }
1260
1305
  ),
1261
1306
  /* @__PURE__ */ p(
@@ -1274,19 +1319,19 @@ function Bt({
1274
1319
  ] })
1275
1320
  ] }),
1276
1321
  /* @__PURE__ */ i(
1277
- se,
1322
+ Y,
1278
1323
  {
1279
1324
  size: "small",
1280
1325
  disabled: l !== "csv",
1281
1326
  value: r,
1282
- onValueChange: a,
1327
+ onValueChange: n,
1283
1328
  label: "Flatten arrays"
1284
1329
  }
1285
1330
  )
1286
1331
  ] }),
1287
- /* @__PURE__ */ p(oe, { children: [
1332
+ /* @__PURE__ */ p(le, { children: [
1288
1333
  /* @__PURE__ */ i(
1289
- O,
1334
+ S,
1290
1335
  {
1291
1336
  onClick: g,
1292
1337
  variant: "text",
@@ -1294,10 +1339,10 @@ function Bt({
1294
1339
  }
1295
1340
  ),
1296
1341
  /* @__PURE__ */ i(
1297
- O,
1342
+ S,
1298
1343
  {
1299
1344
  variant: "filled",
1300
- onClick: x,
1345
+ onClick: y,
1301
1346
  children: "Download"
1302
1347
  }
1303
1348
  )
@@ -1308,26 +1353,26 @@ function Bt({
1308
1353
  ] });
1309
1354
  }
1310
1355
  export {
1311
- Bt as BasicExportAction,
1312
- yt as DataNewPropertiesMapping,
1313
- At as ExportCollectionAction,
1314
- Dt as ImportCollectionAction,
1315
- St as ImportDataPreview,
1316
- Ct as ImportFileUpload,
1317
- Rt as ImportNewPropertyFieldPreview,
1318
- wt as ImportSaveInProgress,
1319
- ve as PropertySelectEntry,
1320
- gt as convertDataToEntity,
1321
- ft as convertFileToJson,
1322
- we as downloadBlob,
1356
+ Jt as BasicExportAction,
1357
+ Ct as DataNewPropertiesMapping,
1358
+ Ft as ExportCollectionAction,
1359
+ Ot as ImportCollectionAction,
1360
+ It as ImportDataPreview,
1361
+ Nt as ImportFileUpload,
1362
+ Bt as ImportNewPropertyFieldPreview,
1363
+ St as ImportSaveInProgress,
1364
+ Ce as PropertySelectEntry,
1365
+ bt as convertDataToEntity,
1366
+ xt as convertFileToJson,
1367
+ De as downloadBlob,
1323
1368
  Be as downloadEntitiesExport,
1324
- Fe as flattenEntry,
1325
- Ot as getEntityCSVExportableData,
1326
- kt as getEntityJsonExportableData,
1327
- xt as getInferenceType,
1328
- ne as processValueMapping,
1369
+ Pe as flattenEntry,
1370
+ _t as getEntityCSVExportableData,
1371
+ At as getEntityJsonExportableData,
1372
+ vt as getInferenceType,
1373
+ ae as processValueMapping,
1329
1374
  je as unflattenObject,
1330
- ut as useImportConfig,
1331
- $t as useImportExportPlugin
1375
+ ht as useImportConfig,
1376
+ Lt as useImportExportPlugin
1332
1377
  };
1333
1378
  //# sourceMappingURL=index.es.js.map