@burdenoff/microfe-export 2026.1107.1 → 2026.1107.2

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.
@@ -3,249 +3,249 @@ import { useTr as t } from "../hooks/useTr.js";
3
3
  import { useAvailableEntities as n, useCreateExportJob as r, useExportTemplates as i, useOrganizationExportPermission as ee } from "../hooks/useExportQueries.js";
4
4
  import { cn as a } from "../utils/cn.js";
5
5
  import { getFormatDisplayName as o } from "../constants/enums.js";
6
- import { PageLayout as te } from "../components/PageLayout.js";
7
- import { isExportEntityDisabled as s, isForeignProductEntity as c } from "../utils/disabledModules.js";
8
- import { useCallback as ne, useEffect as re, useRef as ie, useState as l } from "react";
9
- import { ArrowLeft as ae, ArrowRight as u, Building2 as d, CalendarRange as oe, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as se, Lock as ce, Package as le, User as g, Users as _ } from "lucide-react";
10
- import { useAppShell as ue, usePermission as de } from "@burdenoff/fe-libs/shared/providers/shell";
11
- import { useSearchParams as fe } from "react-router";
12
- import { isQuotaExhaustedError as pe } from "@burdenoff/fe-libs/shared/utils";
13
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
- import { AlertDialog as me, AlertDialogAction as b, AlertDialogCancel as x, AlertDialogContent as he, AlertDialogDescription as ge, AlertDialogFooter as _e, AlertDialogHeader as ve, AlertDialogTitle as ye, EmphasisPanel as be, IllustratedEmptyState as xe, PagePurpose as Se, ShowMore as Ce } from "@burdenoff/fe-libs/ui";
6
+ import { PageLayout as s } from "../components/PageLayout.js";
7
+ import { isExportEntityDisabled as c, isForeignProductEntity as l } from "../utils/disabledModules.js";
8
+ import { useCallback as u, useEffect as te, useRef as ne, useState as d } from "react";
9
+ import { ArrowLeft as re, ArrowRight as f, Building2 as p, CalendarRange as m, CheckCircle2 as h, Download as g, FileJson as _, FileSpreadsheet as v, Loader2 as ie, Lock as ae, Package as oe, User as y, Users as b } from "lucide-react";
10
+ import { useAppShell as se, usePermission as ce } from "@burdenoff/fe-libs/shared/providers/shell";
11
+ import { useSearchParams as le } from "react-router";
12
+ import { isQuotaExhaustedError as ue } from "@burdenoff/fe-libs/shared/utils";
13
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
14
+ import { AlertDialog as de, AlertDialogAction as C, AlertDialogCancel as fe, AlertDialogContent as pe, AlertDialogDescription as me, AlertDialogFooter as he, AlertDialogHeader as ge, AlertDialogTitle as _e, EmphasisPanel as ve, IllustratedEmptyState as ye, PagePurpose as be, ShowMore as xe } from "@burdenoff/fe-libs/ui";
15
15
  //#region src/export/pages/CreateExportPage.tsx
16
- var S = ["CSV", "JSON"], we = {
17
- CSV: h,
18
- JSON: m
19
- }, Te = {
20
- INDIVIDUAL: g,
21
- WORKSPACE_ADMIN: _,
22
- ORG_ADMIN: d
16
+ var w = ["CSV", "JSON"], Se = {
17
+ CSV: v,
18
+ JSON: _
19
+ }, Ce = {
20
+ INDIVIDUAL: y,
21
+ WORKSPACE_ADMIN: b,
22
+ ORG_ADMIN: p
23
23
  };
24
- function C() {
25
- let { basePath: d = "/", navigate: m, organizationId: h } = e(), g = t(), [_, C] = l("INDIVIDUAL"), { createJob: w, isPending: T } = r(_), { data: E } = n(), { data: D } = i(), [O] = fe(), { productSlug: k } = ue(), A = ne((e) => !s(e) && !c(e, k), [k]), Ee = de("export:workspace_admin"), j = ee(h), [M, N] = l("entities"), [P, F] = l([]), [I, L] = l(""), [R, z] = l("CSV"), [B, V] = l(O.get("templateId") ?? void 0), [H, De] = l(""), [U, Oe] = l(""), [W, G] = l(null), [ke, K] = l(!1), q = ie(null);
26
- re(() => {
24
+ function T() {
25
+ let { basePath: p = "/", navigate: _, organizationId: v } = e(), y = t(), { createJob: b, isPending: T } = r(), { data: E } = n(), { data: D } = i(), [O] = le(), { productSlug: k } = se(), A = u((e) => !c(e) && !l(e, k), [k]), we = ce("export:workspace_admin"), Te = ee(v), [j, M] = d("entities"), [N, P] = d([]), [F, I] = d(""), [L, R] = d("CSV"), [z, Ee] = d("INDIVIDUAL"), [B, V] = d(O.get("templateId") ?? void 0), [H, De] = d(""), [U, Oe] = d(""), [W, G] = d(null), [ke, K] = d(!1), q = ne(null);
26
+ te(() => {
27
27
  let e = O.get("templateId");
28
28
  if (!e || !D?.length || q.current === e) return;
29
29
  let t = D.find((t) => t.id === e);
30
30
  if (!t) return;
31
- q.current = e, V(t.id), F((t.entityTypes ?? []).filter(A));
31
+ q.current = e, V(t.id), P((t.entityTypes ?? []).filter(A));
32
32
  let n = t.format?.toUpperCase();
33
- n && S.includes(n) && z(n), t.name && L(t.name);
33
+ n && w.includes(n) && R(n), t.name && I(t.name);
34
34
  }, [
35
35
  A,
36
36
  O,
37
37
  D
38
38
  ]);
39
39
  let Ae = () => {
40
- M === "options" ? N("entities") : M === "review" ? N("options") : m?.(d);
40
+ j === "options" ? M("entities") : j === "review" ? M("options") : _?.(p);
41
41
  }, je = () => {
42
- if (M === "entities") {
43
- if (P.length === 0) {
44
- G(g("export.create.errors.selectEntity", "Please select at least one entity type to export"));
42
+ if (j === "entities") {
43
+ if (N.length === 0) {
44
+ G(y("export.create.errors.selectEntity", "Please select at least one entity type to export"));
45
45
  return;
46
46
  }
47
- G(null), N("options");
48
- } else if (M === "options") {
49
- if (!I.trim()) {
50
- G(g("export.create.errors.exportNameRequired", "Please provide a name for this export"));
47
+ G(null), M("options");
48
+ } else if (j === "options") {
49
+ if (!F.trim()) {
50
+ G(y("export.create.errors.exportNameRequired", "Please provide a name for this export"));
51
51
  return;
52
52
  }
53
- G(null), N("review");
53
+ G(null), M("review");
54
54
  }
55
55
  }, Me = async () => {
56
56
  try {
57
- G(null), await w({
58
- name: I,
59
- entityTypes: P,
60
- format: R,
61
- exportScope: _,
62
- organizationId: _ === "ORG_ADMIN" ? h : void 0,
57
+ G(null), await b({
58
+ name: F,
59
+ entityTypes: N,
60
+ format: L,
61
+ exportScope: z,
62
+ organizationId: z === "ORG_ADMIN" ? v : void 0,
63
63
  templateId: B,
64
64
  dateRangeStart: H ? new Date(H).toISOString() : null,
65
65
  dateRangeEnd: U ? new Date(U).toISOString() : null
66
- }), m?.(d);
66
+ }), _?.(p);
67
67
  } catch (e) {
68
- if (pe(e)) {
69
- K(!0), G(g("export.create.errors.quotaReached", "You have reached your export limit for this month."));
68
+ if (ue(e)) {
69
+ K(!0), G(y("export.create.errors.quotaReached", "You have reached your export limit for this month."));
70
70
  return;
71
71
  }
72
- G(e instanceof Error ? e.message : g("export.create.errors.createFailed", "Failed to create export"));
72
+ G(e instanceof Error ? e.message : y("export.create.errors.createFailed", "Failed to create export"));
73
73
  }
74
74
  }, Ne = (e) => {
75
- A(e) && F((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
75
+ A(e) && P((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
76
76
  }, J = (e) => {
77
77
  switch (e) {
78
- case "INDIVIDUAL": return g("export.create.scope.individual.label", "My Data Only");
79
- case "WORKSPACE_ADMIN": return g("export.create.scope.workspaceAdmin.label", "All Workspace Data");
80
- case "ORG_ADMIN": return g("export.create.scope.orgAdmin.label", "All Organization Data");
78
+ case "INDIVIDUAL": return y("export.create.scope.individual.label", "My Data Only");
79
+ case "WORKSPACE_ADMIN": return y("export.create.scope.workspaceAdmin.label", "All Workspace Data");
80
+ case "ORG_ADMIN": return y("export.create.scope.orgAdmin.label", "All Organization Data");
81
81
  default: return e;
82
82
  }
83
83
  }, Pe = (e) => {
84
84
  switch (e) {
85
- case "INDIVIDUAL": return g("export.create.scope.individual.description", "Export data you personally created across selected modules.");
86
- case "WORKSPACE_ADMIN": return g("export.create.scope.workspaceAdmin.description", "Export all data in this workspace regardless of who created it. Requires workspace admin access.");
87
- case "ORG_ADMIN": return g("export.create.scope.orgAdmin.description", "Export data from every workspace in your organization. Requires org-admin access.");
85
+ case "INDIVIDUAL": return y("export.create.scope.individual.description", "Export data you personally created across selected modules.");
86
+ case "WORKSPACE_ADMIN": return y("export.create.scope.workspaceAdmin.description", "Export all data in this workspace regardless of who created it. Requires workspace admin access.");
87
+ case "ORG_ADMIN": return y("export.create.scope.orgAdmin.description", "Export data from every workspace in your organization. Requires org-admin access.");
88
88
  default: return "";
89
89
  }
90
90
  }, Y = {
91
91
  users: {
92
- label: g("export.create.entities.users.label", "Users"),
93
- description: g("export.create.entities.users.description", "Workspace members and profiles")
92
+ label: y("export.create.entities.users.label", "Users"),
93
+ description: y("export.create.entities.users.description", "Workspace members and profiles")
94
94
  },
95
95
  projects: {
96
- label: g("export.create.entities.projects.label", "Projects"),
97
- description: g("export.create.entities.projects.description", "Projects and their metadata")
96
+ label: y("export.create.entities.projects.label", "Projects"),
97
+ description: y("export.create.entities.projects.description", "Projects and their metadata")
98
98
  },
99
99
  tasks: {
100
- label: g("export.create.entities.tasks.label", "Tasks"),
101
- description: g("export.create.entities.tasks.description", "Task items and assignments")
100
+ label: y("export.create.entities.tasks.label", "Tasks"),
101
+ description: y("export.create.entities.tasks.description", "Task items and assignments")
102
102
  },
103
103
  files: {
104
- label: g("export.create.entities.files.label", "Files"),
105
- description: g("export.create.entities.files.description", "File metadata and references")
104
+ label: y("export.create.entities.files.label", "Files"),
105
+ description: y("export.create.entities.files.description", "File metadata and references")
106
106
  },
107
107
  conversations: {
108
- label: g("export.create.entities.conversations.label", "Conversations"),
109
- description: g("export.create.entities.conversations.description", "Chat messages and threads")
108
+ label: y("export.create.entities.conversations.label", "Conversations"),
109
+ description: y("export.create.entities.conversations.description", "Chat messages and threads")
110
110
  },
111
111
  tags: {
112
- label: g("export.create.entities.tags.label", "Tags"),
113
- description: g("export.create.entities.tags.description", "Tags and vocabularies")
112
+ label: y("export.create.entities.tags.label", "Tags"),
113
+ description: y("export.create.entities.tags.description", "Tags and vocabularies")
114
114
  },
115
115
  activity: {
116
- label: g("export.create.entities.activity.label", "Activity Logs"),
117
- description: g("export.create.entities.activity.description", "Audit trail and activity history")
116
+ label: y("export.create.entities.activity.label", "Activity Logs"),
117
+ description: y("export.create.entities.activity.description", "Audit trail and activity history")
118
118
  },
119
119
  calendar: {
120
- label: g("export.create.entities.calendar.label", "Calendar Events"),
121
- description: g("export.create.entities.calendar.description", "Events and bookings")
120
+ label: y("export.create.entities.calendar.label", "Calendar Events"),
121
+ description: y("export.create.entities.calendar.description", "Events and bookings")
122
122
  }
123
- }, X = E.filter((e) => e.enabled !== !1 && !c(e.entityType, k)), Z = X.filter((e) => !s(e.entityType)), Q = X.filter((e) => s(e.entityType)), $ = (e, t) => {
124
- let n = !t && P.includes(e.entityType);
125
- return /* @__PURE__ */ y("button", {
123
+ }, X = E.filter((e) => e.enabled !== !1 && !l(e.entityType, k)), Z = X.filter((e) => !c(e.entityType)), Q = X.filter((e) => c(e.entityType)), $ = (e, t) => {
124
+ let n = !t && N.includes(e.entityType);
125
+ return /* @__PURE__ */ S("button", {
126
126
  type: "button",
127
127
  onClick: () => Ne(e.entityType),
128
128
  disabled: t,
129
129
  "aria-disabled": t,
130
- title: t ? g("export.create.select.unavailableHint", "Export for this product isn't available yet") : void 0,
130
+ title: t ? y("export.create.select.unavailableHint", "Export for this product isn't available yet") : void 0,
131
131
  className: a("text-left border-2 rounded-xl p-4 transition-all duration-200", t ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : n ? "border-primary bg-action-primary-bg/5 shadow-md" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
132
132
  children: [
133
- /* @__PURE__ */ y("div", {
133
+ /* @__PURE__ */ S("div", {
134
134
  className: "flex items-center justify-between mb-2 gap-2",
135
- children: [/* @__PURE__ */ v("h3", {
135
+ children: [/* @__PURE__ */ x("h3", {
136
136
  className: "font-semibold",
137
137
  children: Y[e.entityType]?.label ?? e.displayName
138
- }), t ? /* @__PURE__ */ v("span", {
138
+ }), t ? /* @__PURE__ */ x("span", {
139
139
  className: "shrink-0 text-xs font-medium px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
140
- children: g("export.create.select.unavailable", "Unavailable")
141
- }) : n && /* @__PURE__ */ v(f, {
140
+ children: y("export.create.select.unavailable", "Unavailable")
141
+ }) : n && /* @__PURE__ */ x(h, {
142
142
  size: 18,
143
143
  className: "text-primary"
144
144
  })]
145
145
  }),
146
- /* @__PURE__ */ v("p", {
146
+ /* @__PURE__ */ x("p", {
147
147
  className: "text-sm text-text-secondary",
148
148
  children: Y[e.entityType]?.description ?? e.description
149
149
  }),
150
- e.estimatedSize && /* @__PURE__ */ y("p", {
150
+ e.estimatedSize && /* @__PURE__ */ S("p", {
151
151
  className: "text-xs text-text-secondary mt-2",
152
152
  children: ["~", e.estimatedSize]
153
153
  })
154
154
  ]
155
155
  }, e.entityType);
156
156
  };
157
- return /* @__PURE__ */ y(te, {
157
+ return /* @__PURE__ */ S(s, {
158
158
  showHeader: !1,
159
159
  children: [
160
- /* @__PURE__ */ v("div", {
160
+ /* @__PURE__ */ x("div", {
161
161
  className: "relative overflow-hidden rounded-xl bg-accent-wash border border-border-seam p-6 shadow-[var(--shadow-pop)]",
162
- children: /* @__PURE__ */ y("div", {
162
+ children: /* @__PURE__ */ S("div", {
163
163
  className: "relative z-10 flex items-center gap-4",
164
- children: [/* @__PURE__ */ v("button", {
164
+ children: [/* @__PURE__ */ x("button", {
165
165
  type: "button",
166
- onClick: () => m?.(d),
166
+ onClick: () => _?.(p),
167
167
  className: "p-2.5 hover:bg-accent rounded-lg transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
168
- "aria-label": g("export.create.actions.backToDashboard", "Back to export dashboard"),
169
- children: /* @__PURE__ */ v(ae, { size: 20 })
170
- }), /* @__PURE__ */ y("div", {
168
+ "aria-label": y("export.create.actions.backToDashboard", "Back to export dashboard"),
169
+ children: /* @__PURE__ */ x(re, { size: 20 })
170
+ }), /* @__PURE__ */ S("div", {
171
171
  className: "flex items-center gap-3",
172
- children: [/* @__PURE__ */ v("div", {
172
+ children: [/* @__PURE__ */ x("div", {
173
173
  className: "p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm",
174
- children: /* @__PURE__ */ v(p, {
174
+ children: /* @__PURE__ */ x(g, {
175
175
  size: 24,
176
176
  className: "text-primary"
177
177
  })
178
- }), /* @__PURE__ */ v("h1", {
178
+ }), /* @__PURE__ */ x("h1", {
179
179
  className: "text-2xl sm:text-3xl font-bold",
180
- children: g("export.create.title", "New Export")
180
+ children: y("export.create.title", "New Export")
181
181
  })]
182
182
  })]
183
183
  })
184
184
  }),
185
- /* @__PURE__ */ v(Se, {
186
- icon: /* @__PURE__ */ v(p, { size: 16 }),
187
- children: g("export.create.purpose", "Build a one-off export in three steps: pick which data to include, choose a format and scope, then review and start it. The export runs in the background and produces a downloadable ZIP you can grab from History when it finishes.")
185
+ /* @__PURE__ */ x(be, {
186
+ icon: /* @__PURE__ */ x(g, { size: 16 }),
187
+ children: y("export.create.purpose", "Build a one-off export in three steps: pick which data to include, choose a format and scope, then review and start it. The export runs in the background and produces a downloadable ZIP you can grab from History when it finishes.")
188
188
  }),
189
- /* @__PURE__ */ v("div", {
189
+ /* @__PURE__ */ x("div", {
190
190
  className: "flex items-center gap-2 justify-center flex-wrap",
191
191
  children: [
192
192
  "entities",
193
193
  "options",
194
194
  "review"
195
- ].map((e, t) => /* @__PURE__ */ y("div", {
195
+ ].map((e, t) => /* @__PURE__ */ S("div", {
196
196
  className: "flex items-center gap-2",
197
- children: [t > 0 && /* @__PURE__ */ v(u, {
197
+ children: [t > 0 && /* @__PURE__ */ x(f, {
198
198
  size: 18,
199
199
  className: "text-text-secondary"
200
- }), /* @__PURE__ */ y("div", {
201
- className: a("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", M === e ? "bg-action-primary-bg text-action-primary-text border-primary shadow-[var(--shadow-pop)]" : "bg-bg-sunken/50 text-text-secondary border-border-seam"),
202
- children: [/* @__PURE__ */ v("div", {
200
+ }), /* @__PURE__ */ S("div", {
201
+ className: a("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", j === e ? "bg-action-primary-bg text-action-primary-text border-primary shadow-[var(--shadow-pop)]" : "bg-bg-sunken/50 text-text-secondary border-border-seam"),
202
+ children: [/* @__PURE__ */ x("div", {
203
203
  className: "flex items-center justify-center size-6 rounded-full bg-bg-surface/20 font-bold",
204
204
  children: t + 1
205
- }), /* @__PURE__ */ v("span", {
205
+ }), /* @__PURE__ */ x("span", {
206
206
  className: "hidden sm:inline capitalize",
207
- children: e === "entities" ? g("export.create.steps.entities", "Select Data") : e === "options" ? g("export.create.steps.options", "Options") : g("export.create.steps.review", "Review")
207
+ children: e === "entities" ? y("export.create.steps.entities", "Select Data") : e === "options" ? y("export.create.steps.options", "Options") : y("export.create.steps.review", "Review")
208
208
  })]
209
209
  })]
210
210
  }, e))
211
211
  }),
212
- W && /* @__PURE__ */ v("div", {
212
+ W && /* @__PURE__ */ x("div", {
213
213
  className: "border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm",
214
214
  children: W
215
215
  }),
216
- M === "entities" && /* @__PURE__ */ y("div", {
216
+ j === "entities" && /* @__PURE__ */ S("div", {
217
217
  className: "space-y-4",
218
218
  children: [
219
- /* @__PURE__ */ v("h2", {
219
+ /* @__PURE__ */ x("h2", {
220
220
  className: "text-lg font-bold",
221
- children: g("export.create.select.title", "Select data to export")
221
+ children: y("export.create.select.title", "Select data to export")
222
222
  }),
223
- /* @__PURE__ */ v("p", {
223
+ /* @__PURE__ */ x("p", {
224
224
  className: "text-sm text-text-secondary",
225
- children: g("export.create.select.description", "Choose which entity types to include in your export.")
225
+ children: y("export.create.select.description", "Choose which entity types to include in your export.")
226
226
  }),
227
- X.length === 0 ? /* @__PURE__ */ v(xe, {
227
+ X.length === 0 ? /* @__PURE__ */ x(ye, {
228
228
  illustration: "empty-data",
229
- title: g("export.create.select.emptyTitle", "Nothing to export yet"),
230
- description: g("export.create.select.empty", "No exportable entity types are configured for this workspace yet. Once your workspace has data in supported modules, they'll show up here to select.")
231
- }) : /* @__PURE__ */ y("div", {
229
+ title: y("export.create.select.emptyTitle", "Nothing to export yet"),
230
+ description: y("export.create.select.empty", "No exportable entity types are configured for this workspace yet. Once your workspace has data in supported modules, they'll show up here to select.")
231
+ }) : /* @__PURE__ */ S("div", {
232
232
  className: "space-y-6",
233
- children: [Z.length > 0 && /* @__PURE__ */ v("div", {
233
+ children: [Z.length > 0 && /* @__PURE__ */ x("div", {
234
234
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
235
235
  children: Z.map((e) => $(e, !1))
236
- }), Q.length > 0 && /* @__PURE__ */ y("div", {
236
+ }), Q.length > 0 && /* @__PURE__ */ S("div", {
237
237
  className: "space-y-3",
238
- children: [/* @__PURE__ */ y("div", {
238
+ children: [/* @__PURE__ */ S("div", {
239
239
  className: "flex items-center gap-3",
240
240
  children: [
241
- /* @__PURE__ */ v("div", { className: "h-px flex-1 bg-border/60" }),
242
- /* @__PURE__ */ v("span", {
241
+ /* @__PURE__ */ x("div", { className: "h-px flex-1 bg-border/60" }),
242
+ /* @__PURE__ */ x("span", {
243
243
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
244
- children: g("export.create.select.unavailableSection", "Not available yet")
244
+ children: y("export.create.select.unavailableSection", "Not available yet")
245
245
  }),
246
- /* @__PURE__ */ v("div", { className: "h-px flex-1 bg-border/60" })
246
+ /* @__PURE__ */ x("div", { className: "h-px flex-1 bg-border/60" })
247
247
  ]
248
- }), /* @__PURE__ */ v("div", {
248
+ }), /* @__PURE__ */ x("div", {
249
249
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
250
250
  children: Q.map((e) => $(e, !0))
251
251
  })]
@@ -253,55 +253,55 @@ function C() {
253
253
  })
254
254
  ]
255
255
  }),
256
- M === "options" && /* @__PURE__ */ v("div", {
256
+ j === "options" && /* @__PURE__ */ x("div", {
257
257
  className: "space-y-6",
258
- children: /* @__PURE__ */ y("div", {
258
+ children: /* @__PURE__ */ S("div", {
259
259
  className: "border border-border-seam rounded-xl p-6 space-y-5 bg-bg-surface",
260
260
  children: [
261
- /* @__PURE__ */ v("h2", {
261
+ /* @__PURE__ */ x("h2", {
262
262
  className: "text-lg font-bold",
263
- children: g("export.create.options.title", "Export Options")
263
+ children: y("export.create.options.title", "Export Options")
264
264
  }),
265
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
265
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
266
266
  className: "block text-sm font-semibold mb-2",
267
- children: g("export.create.options.scope", "Export Scope")
268
- }), /* @__PURE__ */ v("div", {
267
+ children: y("export.create.options.scope", "Export Scope")
268
+ }), /* @__PURE__ */ x("div", {
269
269
  className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
270
270
  children: [
271
271
  "INDIVIDUAL",
272
272
  "WORKSPACE_ADMIN",
273
273
  "ORG_ADMIN"
274
274
  ].map((e) => {
275
- let t = e === "WORKSPACE_ADMIN" && !Ee || e === "ORG_ADMIN" && !j, n = Te[e], r = e === "WORKSPACE_ADMIN" ? g("export.create.scope.workspaceAdmin.required", "Workspace admin access required") : g("export.create.scope.orgAdmin.required", "Organization admin access required");
276
- return /* @__PURE__ */ y("button", {
275
+ let t = e === "WORKSPACE_ADMIN" && !we || e === "ORG_ADMIN" && !Te, n = Ce[e], r = e === "WORKSPACE_ADMIN" ? y("export.create.scope.workspaceAdmin.required", "Workspace admin access required") : y("export.create.scope.orgAdmin.required", "Organization admin access required");
276
+ return /* @__PURE__ */ S("button", {
277
277
  type: "button",
278
- onClick: () => !t && C(e),
278
+ onClick: () => !t && Ee(e),
279
279
  disabled: t,
280
- className: a("text-left border-2 rounded-xl p-4 transition-all duration-200", _ === e ? "border-primary bg-action-primary-bg/5 shadow-md" : t ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
280
+ className: a("text-left border-2 rounded-xl p-4 transition-all duration-200", z === e ? "border-primary bg-action-primary-bg/5 shadow-md" : t ? "border-border-subtle/30 opacity-50 cursor-not-allowed" : "border-border-subtle/50 hover:border-primary/30 hover:shadow-sm"),
281
281
  title: t ? r : void 0,
282
282
  children: [
283
- /* @__PURE__ */ y("div", {
283
+ /* @__PURE__ */ S("div", {
284
284
  className: "flex items-center justify-between mb-2",
285
285
  children: [
286
- /* @__PURE__ */ v(n, {
286
+ /* @__PURE__ */ x(n, {
287
287
  size: 18,
288
- className: _ === e ? "text-primary" : t ? "text-text-secondary/50" : "text-text-secondary"
288
+ className: z === e ? "text-primary" : t ? "text-text-secondary/50" : "text-text-secondary"
289
289
  }),
290
- _ === e && /* @__PURE__ */ v(f, {
290
+ z === e && /* @__PURE__ */ x(h, {
291
291
  size: 16,
292
292
  className: "text-primary"
293
293
  }),
294
- t && /* @__PURE__ */ v(ce, {
294
+ t && /* @__PURE__ */ x(ae, {
295
295
  size: 14,
296
296
  className: "text-text-secondary/50"
297
297
  })
298
298
  ]
299
299
  }),
300
- /* @__PURE__ */ v("p", {
300
+ /* @__PURE__ */ x("p", {
301
301
  className: "font-semibold text-sm",
302
302
  children: J(e)
303
303
  }),
304
- /* @__PURE__ */ v("p", {
304
+ /* @__PURE__ */ x("p", {
305
305
  className: "text-xs text-text-secondary mt-1",
306
306
  children: Pe(e)
307
307
  })
@@ -309,156 +309,156 @@ function C() {
309
309
  }, e);
310
310
  })
311
311
  })] }),
312
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
312
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("label", {
313
313
  htmlFor: "exportName",
314
314
  className: "block text-sm font-semibold mb-2",
315
315
  children: [
316
- g("export.create.options.name", "Export Name"),
316
+ y("export.create.options.name", "Export Name"),
317
317
  " ",
318
- /* @__PURE__ */ v("span", {
318
+ /* @__PURE__ */ x("span", {
319
319
  className: "text-status-error-text",
320
320
  children: "*"
321
321
  })
322
322
  ]
323
- }), /* @__PURE__ */ v("input", {
323
+ }), /* @__PURE__ */ x("input", {
324
324
  type: "text",
325
325
  id: "exportName",
326
- "aria-label": g("export.create.options.name", "Export Name"),
327
- value: I,
328
- onChange: (e) => L(e.target.value),
326
+ "aria-label": y("export.create.options.name", "Export Name"),
327
+ value: F,
328
+ onChange: (e) => I(e.target.value),
329
329
  className: "w-full px-4 py-2.5 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",
330
- placeholder: g("export.create.options.namePlaceholder", "e.g., Monthly User Export")
330
+ placeholder: y("export.create.options.namePlaceholder", "e.g., Monthly User Export")
331
331
  })] }),
332
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
332
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
333
333
  className: "block text-sm font-semibold mb-2",
334
- children: g("export.create.options.outputFormat", "Output Format")
335
- }), /* @__PURE__ */ v("div", {
334
+ children: y("export.create.options.outputFormat", "Output Format")
335
+ }), /* @__PURE__ */ x("div", {
336
336
  className: "grid grid-cols-2 gap-3",
337
- children: S.map((e) => {
338
- let t = we[e];
339
- return /* @__PURE__ */ y("button", {
337
+ children: w.map((e) => {
338
+ let t = Se[e];
339
+ return /* @__PURE__ */ S("button", {
340
340
  type: "button",
341
- onClick: () => z(e),
342
- className: a("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", R === e ? "border-primary bg-action-primary-bg/5" : "border-border-subtle/50 hover:border-primary/30"),
343
- children: [/* @__PURE__ */ v(t, {
341
+ onClick: () => R(e),
342
+ className: a("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", L === e ? "border-primary bg-action-primary-bg/5" : "border-border-subtle/50 hover:border-primary/30"),
343
+ children: [/* @__PURE__ */ x(t, {
344
344
  size: 18,
345
- className: R === e ? "text-primary" : "text-text-secondary"
346
- }), /* @__PURE__ */ v("span", {
345
+ className: L === e ? "text-primary" : "text-text-secondary"
346
+ }), /* @__PURE__ */ x("span", {
347
347
  className: "font-medium text-sm",
348
348
  children: o(e)
349
349
  })]
350
350
  }, e);
351
351
  })
352
352
  })] }),
353
- /* @__PURE__ */ y("div", { children: [
354
- /* @__PURE__ */ v("label", {
353
+ /* @__PURE__ */ S("div", { children: [
354
+ /* @__PURE__ */ x("label", {
355
355
  className: "block text-sm font-semibold mb-2",
356
- children: g("export.create.options.archiveFormat", "Archive Format")
356
+ children: y("export.create.options.archiveFormat", "Archive Format")
357
357
  }),
358
- /* @__PURE__ */ v("div", {
358
+ /* @__PURE__ */ x("div", {
359
359
  className: "flex gap-3",
360
- children: /* @__PURE__ */ y("div", {
360
+ children: /* @__PURE__ */ S("div", {
361
361
  className: a("flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-action-primary-bg/5"),
362
- children: [/* @__PURE__ */ v(le, {
362
+ children: [/* @__PURE__ */ x(oe, {
363
363
  size: 16,
364
364
  className: "text-primary"
365
- }), /* @__PURE__ */ v("span", {
365
+ }), /* @__PURE__ */ x("span", {
366
366
  className: "font-medium text-sm",
367
- children: g("export.archive.zip", "ZIP")
367
+ children: y("export.archive.zip", "ZIP")
368
368
  })]
369
369
  })
370
370
  }),
371
- /* @__PURE__ */ v("p", {
371
+ /* @__PURE__ */ x("p", {
372
372
  className: "text-xs text-text-secondary mt-1.5",
373
- children: g("export.create.options.archiveDescription", "Exports are packaged as ZIP archives.")
373
+ children: y("export.create.options.archiveDescription", "Exports are packaged as ZIP archives.")
374
374
  })
375
375
  ] }),
376
- /* @__PURE__ */ v(Ce, {
376
+ /* @__PURE__ */ x(xe, {
377
377
  collapsedHeight: 0,
378
- label: g("export.create.options.advancedToggle", "Date range & template"),
379
- children: /* @__PURE__ */ y("div", {
378
+ label: y("export.create.options.advancedToggle", "Date range & template"),
379
+ children: /* @__PURE__ */ S("div", {
380
380
  className: "space-y-5 pt-1",
381
- children: [/* @__PURE__ */ y("div", { children: [
382
- /* @__PURE__ */ v("label", {
381
+ children: [/* @__PURE__ */ S("div", { children: [
382
+ /* @__PURE__ */ x("label", {
383
383
  className: "block text-sm font-semibold mb-2",
384
- children: /* @__PURE__ */ y("span", {
384
+ children: /* @__PURE__ */ S("span", {
385
385
  className: "inline-flex items-center gap-1.5",
386
386
  children: [
387
- /* @__PURE__ */ v(oe, { size: 15 }),
388
- g("export.create.options.dateRange", "Date Range"),
387
+ /* @__PURE__ */ x(m, { size: 15 }),
388
+ y("export.create.options.dateRange", "Date Range"),
389
389
  " ",
390
- /* @__PURE__ */ v("span", {
390
+ /* @__PURE__ */ x("span", {
391
391
  className: "font-normal text-text-secondary",
392
- children: g("export.create.shared.optional", "(optional)")
392
+ children: y("export.create.shared.optional", "(optional)")
393
393
  })
394
394
  ]
395
395
  })
396
396
  }),
397
- /* @__PURE__ */ y("div", {
397
+ /* @__PURE__ */ S("div", {
398
398
  className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
399
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
399
+ children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
400
400
  htmlFor: "dateFrom",
401
401
  className: "block text-xs text-text-secondary mb-1",
402
- children: g("export.create.options.dateFrom", "From")
403
- }), /* @__PURE__ */ v("input", {
402
+ children: y("export.create.options.dateFrom", "From")
403
+ }), /* @__PURE__ */ x("input", {
404
404
  type: "date",
405
405
  id: "dateFrom",
406
- "aria-label": g("export.create.options.dateFrom", "From"),
406
+ "aria-label": y("export.create.options.dateFrom", "From"),
407
407
  value: H,
408
408
  onChange: (e) => De(e.target.value),
409
409
  className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
410
- })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
410
+ })] }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
411
411
  htmlFor: "dateTo",
412
412
  className: "block text-xs text-text-secondary mb-1",
413
- children: g("export.create.options.dateTo", "To")
414
- }), /* @__PURE__ */ v("input", {
413
+ children: y("export.create.options.dateTo", "To")
414
+ }), /* @__PURE__ */ x("input", {
415
415
  type: "date",
416
416
  id: "dateTo",
417
- "aria-label": g("export.create.options.dateTo", "To"),
417
+ "aria-label": y("export.create.options.dateTo", "To"),
418
418
  value: U,
419
419
  min: H,
420
420
  onChange: (e) => Oe(e.target.value),
421
421
  className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
422
422
  })] })]
423
423
  }),
424
- /* @__PURE__ */ v("p", {
424
+ /* @__PURE__ */ x("p", {
425
425
  className: "text-xs text-text-secondary mt-1.5",
426
- children: g("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
426
+ children: y("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
427
427
  })
428
- ] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
428
+ ] }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("label", {
429
429
  className: "block text-sm font-semibold mb-2",
430
430
  children: [
431
- g("export.create.options.basedOnTemplate", "Based on Template"),
431
+ y("export.create.options.basedOnTemplate", "Based on Template"),
432
432
  " ",
433
- /* @__PURE__ */ v("span", {
433
+ /* @__PURE__ */ x("span", {
434
434
  className: "font-normal text-text-secondary",
435
- children: g("export.create.shared.optional", "(optional)")
435
+ children: y("export.create.shared.optional", "(optional)")
436
436
  })
437
437
  ]
438
- }), D.length > 0 ? /* @__PURE__ */ y("select", {
438
+ }), D.length > 0 ? /* @__PURE__ */ S("select", {
439
439
  value: B ?? "",
440
440
  onChange: (e) => V(e.target.value || void 0),
441
441
  className: "w-full px-3 py-2 border-2 border-border-subtle rounded-lg bg-bg-surface focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
442
- children: [/* @__PURE__ */ v("option", {
442
+ children: [/* @__PURE__ */ x("option", {
443
443
  value: "",
444
- children: g("export.create.options.noTemplate", "No template")
445
- }), D.map((e) => /* @__PURE__ */ v("option", {
444
+ children: y("export.create.options.noTemplate", "No template")
445
+ }), D.map((e) => /* @__PURE__ */ x("option", {
446
446
  value: e.id,
447
447
  children: e.name
448
448
  }, e.id))]
449
- }) : /* @__PURE__ */ y("p", {
449
+ }) : /* @__PURE__ */ S("p", {
450
450
  className: "text-sm text-text-secondary",
451
451
  children: [
452
- g("export.create.options.noTemplates", "No templates yet."),
452
+ y("export.create.options.noTemplates", "No templates yet."),
453
453
  " ",
454
- /* @__PURE__ */ v("button", {
454
+ /* @__PURE__ */ x("button", {
455
455
  type: "button",
456
- onClick: () => m?.(d + "/templates"),
456
+ onClick: () => _?.(p + "/templates"),
457
457
  className: "text-primary underline-offset-2 hover:underline",
458
- children: g("export.create.options.createTemplateLink", "Create one")
458
+ children: y("export.create.options.createTemplateLink", "Create one")
459
459
  }),
460
460
  " ",
461
- g("export.create.options.reuseTemplateHint", "to reuse export configurations.")
461
+ y("export.create.options.reuseTemplateHint", "to reuse export configurations.")
462
462
  ]
463
463
  })] })]
464
464
  })
@@ -466,53 +466,53 @@ function C() {
466
466
  ]
467
467
  })
468
468
  }),
469
- M === "review" && /* @__PURE__ */ v("div", {
469
+ j === "review" && /* @__PURE__ */ x("div", {
470
470
  className: "space-y-6",
471
- children: /* @__PURE__ */ y(be, {
471
+ children: /* @__PURE__ */ S(ve, {
472
472
  className: "p-6 space-y-4",
473
- children: [/* @__PURE__ */ y("h2", {
473
+ children: [/* @__PURE__ */ S("h2", {
474
474
  className: "text-lg font-bold flex items-center gap-2",
475
- children: [/* @__PURE__ */ v(f, {
475
+ children: [/* @__PURE__ */ x(h, {
476
476
  size: 20,
477
477
  className: "text-primary"
478
- }), g("export.create.review.title", "Review Export")]
479
- }), /* @__PURE__ */ v("dl", {
478
+ }), y("export.create.review.title", "Review Export")]
479
+ }), /* @__PURE__ */ x("dl", {
480
480
  className: "space-y-3 text-sm",
481
481
  children: [
482
482
  {
483
- label: g("export.create.review.fields.name", "Name"),
484
- value: I
483
+ label: y("export.create.review.fields.name", "Name"),
484
+ value: F
485
485
  },
486
486
  {
487
- label: g("export.create.review.fields.scope", "Scope"),
488
- value: J(_)
487
+ label: y("export.create.review.fields.scope", "Scope"),
488
+ value: J(z)
489
489
  },
490
490
  {
491
- label: g("export.create.review.fields.entityTypes", "Entity Types"),
492
- value: P.join(", ")
491
+ label: y("export.create.review.fields.entityTypes", "Entity Types"),
492
+ value: N.join(", ")
493
493
  },
494
494
  {
495
- label: g("export.create.review.fields.format", "Format"),
496
- value: o(R)
495
+ label: y("export.create.review.fields.format", "Format"),
496
+ value: o(L)
497
497
  },
498
498
  {
499
- label: g("export.create.review.fields.archive", "Archive"),
500
- value: g("export.archive.zip", "ZIP")
499
+ label: y("export.create.review.fields.archive", "Archive"),
500
+ value: y("export.archive.zip", "ZIP")
501
501
  },
502
502
  ...H || U ? [{
503
- label: g("export.create.review.fields.dateRange", "Date Range"),
503
+ label: y("export.create.review.fields.dateRange", "Date Range"),
504
504
  value: [H || "—", U || "—"].join(" → ")
505
505
  }] : [],
506
506
  ...B ? [{
507
- label: g("export.create.review.fields.template", "Template"),
507
+ label: y("export.create.review.fields.template", "Template"),
508
508
  value: D.find((e) => e.id === B)?.name ?? B
509
509
  }] : []
510
- ].map(({ label: e, value: t }) => /* @__PURE__ */ y("div", {
510
+ ].map(({ label: e, value: t }) => /* @__PURE__ */ S("div", {
511
511
  className: "flex flex-col sm:flex-row sm:justify-between gap-1",
512
- children: [/* @__PURE__ */ v("dt", {
512
+ children: [/* @__PURE__ */ x("dt", {
513
513
  className: "text-text-secondary",
514
514
  children: e
515
- }), /* @__PURE__ */ v("dd", {
515
+ }), /* @__PURE__ */ x("dd", {
516
516
  className: "font-semibold sm:text-right break-words",
517
517
  children: t
518
518
  })]
@@ -520,41 +520,41 @@ function C() {
520
520
  })]
521
521
  })
522
522
  }),
523
- /* @__PURE__ */ y("div", {
523
+ /* @__PURE__ */ S("div", {
524
524
  className: "flex flex-col sm:flex-row gap-3 pt-2",
525
- children: [/* @__PURE__ */ v("button", {
525
+ children: [/* @__PURE__ */ x("button", {
526
526
  type: "button",
527
527
  onClick: Ae,
528
528
  className: "px-6 py-3 border-2 border-border-subtle/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium",
529
- children: M === "entities" ? g("export.create.actions.cancel", "Cancel") : g("export.create.actions.back", "Back")
530
- }), M === "review" ? /* @__PURE__ */ y("button", {
529
+ children: j === "entities" ? y("export.create.actions.cancel", "Cancel") : y("export.create.actions.back", "Back")
530
+ }), j === "review" ? /* @__PURE__ */ S("button", {
531
531
  type: "button",
532
532
  onClick: Me,
533
533
  disabled: T,
534
534
  className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-all duration-200 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",
535
- children: [T ? /* @__PURE__ */ v(se, {
535
+ children: [T ? /* @__PURE__ */ x(ie, {
536
536
  size: 18,
537
537
  className: "animate-spin"
538
- }) : /* @__PURE__ */ v(p, { size: 18 }), g("export.create.actions.startExport", "Start Export")]
539
- }) : /* @__PURE__ */ y("button", {
538
+ }) : /* @__PURE__ */ x(g, { size: 18 }), y("export.create.actions.startExport", "Start Export")]
539
+ }) : /* @__PURE__ */ S("button", {
540
540
  type: "button",
541
541
  onClick: je,
542
542
  className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-action-primary-bg text-action-primary-text rounded-lg hover:bg-action-primary-bg/90 transition-all duration-200 font-bold shadow-lg",
543
- children: [g("export.create.actions.next", "Next"), /* @__PURE__ */ v(u, { size: 18 })]
543
+ children: [y("export.create.actions.next", "Next"), /* @__PURE__ */ x(f, { size: 18 })]
544
544
  })]
545
545
  }),
546
- /* @__PURE__ */ v(me, {
546
+ /* @__PURE__ */ x(de, {
547
547
  open: ke,
548
548
  onOpenChange: K,
549
- children: /* @__PURE__ */ y(he, { children: [/* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ v(ye, { children: g("export.create.quotaDialog.title", "Export Limit Reached") }), /* @__PURE__ */ v(ge, { children: g("export.create.quotaDialog.description", "You have reached your export limit for this month.") })] }), /* @__PURE__ */ y(_e, { children: [/* @__PURE__ */ v(x, { children: g("export.create.quotaDialog.dismiss", "Dismiss") }), /* @__PURE__ */ v(b, {
549
+ children: /* @__PURE__ */ S(pe, { children: [/* @__PURE__ */ S(ge, { children: [/* @__PURE__ */ x(_e, { children: y("export.create.quotaDialog.title", "Export Limit Reached") }), /* @__PURE__ */ x(me, { children: y("export.create.quotaDialog.description", "You have reached your export limit for this month.") })] }), /* @__PURE__ */ S(he, { children: [/* @__PURE__ */ x(fe, { children: y("export.create.quotaDialog.dismiss", "Dismiss") }), /* @__PURE__ */ x(C, {
550
550
  onClick: () => window.location.assign("/billing"),
551
- children: g("export.create.quotaDialog.viewBilling", "View Billing")
551
+ children: y("export.create.quotaDialog.viewBilling", "View Billing")
552
552
  })] })] })
553
553
  })
554
554
  ]
555
555
  });
556
556
  }
557
557
  //#endregion
558
- export { C as CreateExportPage };
558
+ export { T as CreateExportPage };
559
559
 
560
560
  //# sourceMappingURL=CreateExportPage.js.map