@questpie/admin 3.0.5 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +99 -1
  2. package/dist/client/builder/types/field-types.d.mts +11 -0
  3. package/dist/client/components/brand-logo.d.mts +25 -0
  4. package/dist/client/components/brand-logo.mjs +174 -0
  5. package/dist/client/create-admin-client.d.mts +7 -0
  6. package/dist/client/create-admin-client.mjs +25 -0
  7. package/dist/client/hooks/use-brand.d.mts +22 -0
  8. package/dist/client/hooks/use-brand.mjs +52 -0
  9. package/dist/client/runtime/index.mjs +1 -1
  10. package/dist/client/runtime/provider.d.mts +4 -0
  11. package/dist/client/runtime/provider.mjs +38 -8
  12. package/dist/client/styles/base.css +4 -0
  13. package/dist/client/types/admin-config.d.mts +24 -0
  14. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  15. package/dist/client/views/auth/auth-layout.d.mts +8 -3
  16. package/dist/client/views/auth/auth-layout.mjs +116 -102
  17. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  18. package/dist/client/views/auth/login-form.d.mts +2 -2
  19. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  20. package/dist/client/views/auth/setup-form.d.mts +2 -2
  21. package/dist/client/views/collection/auto-form-fields.mjs +2 -0
  22. package/dist/client/views/collection/field-renderer.mjs +3 -2
  23. package/dist/client/views/globals/global-form-view.mjs +908 -863
  24. package/dist/client/views/layout/admin-sidebar.mjs +153 -141
  25. package/dist/client/views/pages/accept-invite-page.mjs +122 -144
  26. package/dist/client/views/pages/forgot-password-page.mjs +22 -30
  27. package/dist/client/views/pages/invite-page.mjs +24 -33
  28. package/dist/client/views/pages/login-page.d.mts +2 -2
  29. package/dist/client/views/pages/login-page.mjs +24 -32
  30. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  31. package/dist/client/views/pages/reset-password-page.mjs +77 -92
  32. package/dist/client/views/pages/setup-page.mjs +31 -39
  33. package/dist/client.d.mts +6 -2
  34. package/dist/client.mjs +5 -2
  35. package/dist/index.d.mts +6 -2
  36. package/dist/index.mjs +5 -2
  37. package/dist/server/augmentation/dashboard.d.mts +23 -5
  38. package/dist/server/augmentation/form-layout.d.mts +10 -0
  39. package/dist/server/augmentation/index.d.mts +1 -1
  40. package/dist/server/augmentation.d.mts +1 -1
  41. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  42. package/dist/server/modules/admin/collections/user.d.mts +32 -32
  43. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  44. package/dist/server/modules/admin/dto/admin-config.dto.mjs +19 -1
  45. package/dist/server/modules/admin/index.d.mts +1 -1
  46. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  47. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  48. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  49. package/dist/server/modules/admin/routes/preview.mjs +1 -1
  50. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  51. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  52. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  53. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +23 -23
  54. package/dist/server.d.mts +4 -4
  55. package/dist/shared/preview-utils.d.mts +34 -1
  56. package/dist/shared/preview-utils.mjs +79 -1
  57. package/dist/shared.d.mts +2 -2
  58. package/dist/shared.mjs +2 -2
  59. package/package.json +3 -3
@@ -20,6 +20,7 @@ import { useGlobalServerValidation } from "../../hooks/use-server-validation.mjs
20
20
  import { useSidebarSearchParam } from "../../hooks/use-sidebar-search-param.mjs";
21
21
  import { useReactiveFields } from "../../hooks/use-reactive-fields.mjs";
22
22
  import { useTransitionStage } from "../../hooks/use-transition-stage.mjs";
23
+ import { detectManyToManyRelations, hasManyToManyRelations } from "../../utils/detect-relations.mjs";
23
24
  import { shouldHandleAdminShortcut } from "../../utils/keyboard-shortcuts.mjs";
24
25
  import { AdminViewHeader } from "../layout/admin-view-layout.mjs";
25
26
  import { useGlobalAuditHistory } from "../../hooks/use-audit-history.mjs";
@@ -127,196 +128,237 @@ function GlobalFormViewSkeleton() {
127
128
  * GlobalFormView - Default form-based edit view for globals
128
129
  */
129
130
  function GlobalFormView(t0) {
130
- const $ = c(302);
131
+ const $ = c(310);
131
132
  const { global: globalName, config, viewConfig, registry, showMeta: t1, headerActions, onSuccess, onError } = t0;
132
133
  const showMeta = t1 === void 0 ? true : t1;
133
134
  const { t } = useTranslation();
134
135
  const resolveText = useResolveText();
135
- const { data: globalData, isLoading: dataLoading, error: dataError } = useGlobal(globalName);
136
136
  const { fields: schemaFields, schema: globalSchema } = useGlobalFields(globalName);
137
+ config?.fields;
138
+ const t2 = config?.fields;
139
+ const t3 = globalSchema;
140
+ let t4;
141
+ if ($[0] !== t2 || $[1] !== t3) {
142
+ t4 = detectManyToManyRelations({
143
+ fields: t2,
144
+ schema: t3
145
+ });
146
+ $[0] = t2;
147
+ $[1] = t3;
148
+ $[2] = t4;
149
+ } else t4 = $[2];
150
+ const withRelations = t4;
151
+ let t5;
152
+ if ($[3] !== withRelations) {
153
+ t5 = hasManyToManyRelations(withRelations) ? { with: withRelations } : void 0;
154
+ $[3] = withRelations;
155
+ $[4] = t5;
156
+ } else t5 = $[4];
157
+ const { data: globalDataRaw, isLoading: dataLoading, error: dataError } = useGlobal(globalName, t5);
158
+ let t6;
159
+ bb0: {
160
+ if (!globalDataRaw || !hasManyToManyRelations(withRelations)) {
161
+ t6 = globalDataRaw;
162
+ break bb0;
163
+ }
164
+ const t7$1 = globalDataRaw;
165
+ let result;
166
+ if ($[5] !== t7$1 || $[6] !== withRelations) {
167
+ result = { ...t7$1 };
168
+ for (const key of Object.keys(withRelations)) {
169
+ const value = result[key];
170
+ if (Array.isArray(value) && value.length > 0 && typeof value[0] === "object" && value[0]?.id) result[key] = value.map(_temp);
171
+ }
172
+ $[5] = t7$1;
173
+ $[6] = withRelations;
174
+ $[7] = result;
175
+ } else result = $[7];
176
+ t6 = result;
177
+ }
178
+ const globalData = t6;
137
179
  const { locale: contentLocale, setLocale: setContentLocale } = useScopedLocale();
138
180
  const contentLocales = useSafeContentLocales();
139
- let t2;
140
- if ($[0] !== contentLocales?.locales) {
141
- t2 = contentLocales?.locales ?? [];
142
- $[0] = contentLocales?.locales;
143
- $[1] = t2;
144
- } else t2 = $[1];
145
- const localeOptions = t2;
146
- let t3;
147
- if ($[2] !== onSuccess || $[3] !== t) {
148
- t3 = (data) => {
181
+ let t7;
182
+ if ($[8] !== contentLocales?.locales) {
183
+ t7 = contentLocales?.locales ?? [];
184
+ $[8] = contentLocales?.locales;
185
+ $[9] = t7;
186
+ } else t7 = $[9];
187
+ const localeOptions = t7;
188
+ let t8;
189
+ if ($[10] !== onSuccess || $[11] !== t) {
190
+ t8 = (data) => {
149
191
  toast.success(t("toast.saveSuccess"));
150
192
  onSuccess?.(data);
151
193
  };
152
- $[2] = onSuccess;
153
- $[3] = t;
154
- $[4] = t3;
155
- } else t3 = $[4];
156
- let t4;
157
- if ($[5] !== onError) {
158
- t4 = (error) => {
194
+ $[10] = onSuccess;
195
+ $[11] = t;
196
+ $[12] = t8;
197
+ } else t8 = $[12];
198
+ let t9;
199
+ if ($[13] !== onError) {
200
+ t9 = (error) => {
159
201
  onError?.(error);
160
202
  };
161
- $[5] = onError;
162
- $[6] = t4;
163
- } else t4 = $[6];
164
- let t5;
165
- if ($[7] !== t3 || $[8] !== t4) {
166
- t5 = {
167
- onSuccess: t3,
168
- onError: t4
203
+ $[13] = onError;
204
+ $[14] = t9;
205
+ } else t9 = $[14];
206
+ let t10;
207
+ if ($[15] !== t8 || $[16] !== t9) {
208
+ t10 = {
209
+ onSuccess: t8,
210
+ onError: t9
169
211
  };
170
- $[7] = t3;
171
- $[8] = t4;
172
- $[9] = t5;
173
- } else t5 = $[9];
174
- const updateMutation = useGlobalUpdate(globalName, t5);
212
+ $[15] = t8;
213
+ $[16] = t9;
214
+ $[17] = t10;
215
+ } else t10 = $[17];
216
+ const updateMutation = useGlobalUpdate(globalName, t10);
175
217
  const revertVersionMutation = useGlobalRevertVersion(globalName);
176
- let t6;
177
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
178
- t6 = { legacyKey: "history" };
179
- $[10] = t6;
180
- } else t6 = $[10];
181
- const [isHistoryOpen, setIsHistoryOpen] = useSidebarSearchParam("history", t6);
218
+ let t11;
219
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
220
+ t11 = { legacyKey: "history" };
221
+ $[18] = t11;
222
+ } else t11 = $[18];
223
+ const [isHistoryOpen, setIsHistoryOpen] = useSidebarSearchParam("history", t11);
182
224
  const [pendingRevertVersion, setPendingRevertVersion] = React.useState(null);
183
- const t7 = globalData?.id;
184
- let t8;
185
- if ($[11] !== t7) {
186
- t8 = {
187
- id: t7,
225
+ const t12 = globalData?.id;
226
+ let t13;
227
+ if ($[19] !== t12) {
228
+ t13 = {
229
+ id: t12,
188
230
  limit: 50
189
231
  };
190
- $[11] = t7;
191
- $[12] = t8;
192
- } else t8 = $[12];
193
- const t9 = isHistoryOpen && !!globalSchema?.options?.versioning;
194
- let t10;
195
- if ($[13] !== t9) {
196
- t10 = { enabled: t9 };
197
- $[13] = t9;
198
- $[14] = t10;
199
- } else t10 = $[14];
200
- const { data: versionsData, isLoading: versionsLoading } = useGlobalVersions(globalName, t8, t10);
201
- let t11;
202
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
203
- t11 = { limit: 50 };
204
- $[15] = t11;
205
- } else t11 = $[15];
206
- let t12;
207
- if ($[16] !== isHistoryOpen) {
208
- t12 = { enabled: isHistoryOpen };
209
- $[16] = isHistoryOpen;
210
- $[17] = t12;
211
- } else t12 = $[17];
212
- const { data: auditData, isLoading: auditLoading } = useGlobalAuditHistory(globalName, t11, t12);
232
+ $[19] = t12;
233
+ $[20] = t13;
234
+ } else t13 = $[20];
235
+ const t14 = isHistoryOpen && !!globalSchema?.options?.versioning;
236
+ let t15;
237
+ if ($[21] !== t14) {
238
+ t15 = { enabled: t14 };
239
+ $[21] = t14;
240
+ $[22] = t15;
241
+ } else t15 = $[22];
242
+ const { data: versionsData, isLoading: versionsLoading } = useGlobalVersions(globalName, t13, t15);
243
+ let t16;
244
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
245
+ t16 = { limit: 50 };
246
+ $[23] = t16;
247
+ } else t16 = $[23];
248
+ let t17;
249
+ if ($[24] !== isHistoryOpen) {
250
+ t17 = { enabled: isHistoryOpen };
251
+ $[24] = isHistoryOpen;
252
+ $[25] = t17;
253
+ } else t17 = $[25];
254
+ const { data: auditData, isLoading: auditLoading } = useGlobalAuditHistory(globalName, t16, t17);
213
255
  const workflowConfig = globalSchema?.options?.workflow;
214
256
  const workflowEnabled = !!workflowConfig?.enabled;
215
- const t13 = globalData?.id;
216
- let t14;
217
- if ($[18] !== t13) {
218
- t14 = {
219
- id: t13,
257
+ const t18 = globalData?.id;
258
+ let t19;
259
+ if ($[26] !== t18) {
260
+ t19 = {
261
+ id: t18,
220
262
  limit: 1
221
263
  };
222
- $[18] = t13;
223
- $[19] = t14;
224
- } else t14 = $[19];
225
- const t15 = workflowEnabled && !!globalData?.id;
226
- let t16;
227
- if ($[20] !== t15) {
228
- t16 = { enabled: t15 };
229
- $[20] = t15;
230
- $[21] = t16;
231
- } else t16 = $[21];
232
- const { data: latestVersionData } = useGlobalVersions(globalName, t14, t16);
264
+ $[26] = t18;
265
+ $[27] = t19;
266
+ } else t19 = $[27];
267
+ const t20 = workflowEnabled && !!globalData?.id;
268
+ let t21;
269
+ if ($[28] !== t20) {
270
+ t21 = { enabled: t20 };
271
+ $[28] = t20;
272
+ $[29] = t21;
273
+ } else t21 = $[29];
274
+ const { data: latestVersionData } = useGlobalVersions(globalName, t19, t21);
233
275
  const currentStage = latestVersionData?.[0]?.versionStage ?? workflowConfig?.initialStage ?? null;
234
276
  workflowConfig?.stages;
235
- let t17;
236
- if ($[22] !== currentStage || $[23] !== workflowConfig?.stages) {
237
- t17 = workflowConfig?.stages?.find((s) => s.name === currentStage) ?? null;
238
- $[22] = currentStage;
239
- $[23] = workflowConfig?.stages;
240
- $[24] = t17;
241
- } else t17 = $[24];
242
- const currentStageConfig = t17;
277
+ let t22;
278
+ if ($[30] !== currentStage || $[31] !== workflowConfig?.stages) {
279
+ t22 = workflowConfig?.stages?.find((s) => s.name === currentStage) ?? null;
280
+ $[30] = currentStage;
281
+ $[31] = workflowConfig?.stages;
282
+ $[32] = t22;
283
+ } else t22 = $[32];
284
+ const currentStageConfig = t22;
243
285
  const currentStageLabel = currentStageConfig?.label ?? currentStage ?? "";
244
- let t18;
245
- bb0: {
286
+ let t23;
287
+ bb1: {
246
288
  if (!workflowConfig?.stages || !currentStage) {
247
- let t19$2;
248
- if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
249
- t19$2 = [];
250
- $[25] = t19$2;
251
- } else t19$2 = $[25];
252
- t18 = t19$2;
253
- break bb0;
289
+ let t24$2;
290
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
291
+ t24$2 = [];
292
+ $[33] = t24$2;
293
+ } else t24$2 = $[33];
294
+ t23 = t24$2;
295
+ break bb1;
254
296
  }
255
297
  const stageNames = currentStageConfig?.transitions;
256
298
  if (stageNames && stageNames.length > 0) {
257
- let t19$2;
258
- if ($[26] !== stageNames || $[27] !== workflowConfig) {
259
- let t20$1;
260
- if ($[29] !== workflowConfig) {
261
- t20$1 = (name) => workflowConfig.stages.find((s_0) => s_0.name === name);
262
- $[29] = workflowConfig;
263
- $[30] = t20$1;
264
- } else t20$1 = $[30];
265
- t19$2 = stageNames.map(t20$1).filter(Boolean);
266
- $[26] = stageNames;
267
- $[27] = workflowConfig;
268
- $[28] = t19$2;
269
- } else t19$2 = $[28];
270
- t18 = t19$2;
271
- break bb0;
299
+ let t24$2;
300
+ if ($[34] !== stageNames || $[35] !== workflowConfig) {
301
+ let t25$1;
302
+ if ($[37] !== workflowConfig) {
303
+ t25$1 = (name) => workflowConfig.stages.find((s_0) => s_0.name === name);
304
+ $[37] = workflowConfig;
305
+ $[38] = t25$1;
306
+ } else t25$1 = $[38];
307
+ t24$2 = stageNames.map(t25$1).filter(Boolean);
308
+ $[34] = stageNames;
309
+ $[35] = workflowConfig;
310
+ $[36] = t24$2;
311
+ } else t24$2 = $[36];
312
+ t23 = t24$2;
313
+ break bb1;
272
314
  }
273
- let t19$1;
274
- if ($[31] !== currentStage || $[32] !== workflowConfig.stages) {
275
- let t20$1;
276
- if ($[34] !== currentStage) {
277
- t20$1 = (s_1) => s_1.name !== currentStage;
278
- $[34] = currentStage;
279
- $[35] = t20$1;
280
- } else t20$1 = $[35];
281
- t19$1 = workflowConfig.stages.filter(t20$1);
282
- $[31] = currentStage;
283
- $[32] = workflowConfig.stages;
284
- $[33] = t19$1;
285
- } else t19$1 = $[33];
286
- t18 = t19$1;
315
+ let t24$1;
316
+ if ($[39] !== currentStage || $[40] !== workflowConfig.stages) {
317
+ let t25$1;
318
+ if ($[42] !== currentStage) {
319
+ t25$1 = (s_1) => s_1.name !== currentStage;
320
+ $[42] = currentStage;
321
+ $[43] = t25$1;
322
+ } else t25$1 = $[43];
323
+ t24$1 = workflowConfig.stages.filter(t25$1);
324
+ $[39] = currentStage;
325
+ $[40] = workflowConfig.stages;
326
+ $[41] = t24$1;
327
+ } else t24$1 = $[41];
328
+ t23 = t24$1;
287
329
  }
288
- const allowedTransitions = t18;
289
- let t19;
290
- if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
291
- t19 = { mode: "global" };
292
- $[36] = t19;
293
- } else t19 = $[36];
294
- const transitionMutation = useTransitionStage(globalName, t19);
330
+ const allowedTransitions = t23;
331
+ let t24;
332
+ if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
333
+ t24 = { mode: "global" };
334
+ $[44] = t24;
335
+ } else t24 = $[44];
336
+ const transitionMutation = useTransitionStage(globalName, t24);
295
337
  const [transitionTarget, setTransitionTarget] = React.useState(null);
296
338
  const [transitionSchedule, setTransitionSchedule] = React.useState(false);
297
339
  const [transitionScheduledAt, setTransitionScheduledAt] = React.useState(null);
298
340
  const { resolver } = useGlobalServerValidation(globalName);
299
- let t20;
300
- if ($[37] !== globalData) {
301
- t20 = globalData ?? {};
302
- $[37] = globalData;
303
- $[38] = t20;
304
- } else t20 = $[38];
305
- const t21 = t20;
306
- let t22;
307
- if ($[39] !== resolver || $[40] !== t21) {
308
- t22 = {
309
- defaultValues: t21,
341
+ let t25;
342
+ if ($[45] !== globalData) {
343
+ t25 = globalData ?? {};
344
+ $[45] = globalData;
345
+ $[46] = t25;
346
+ } else t25 = $[46];
347
+ const t26 = t25;
348
+ let t27;
349
+ if ($[47] !== resolver || $[48] !== t26) {
350
+ t27 = {
351
+ defaultValues: t26,
310
352
  resolver
311
353
  };
312
- $[39] = resolver;
313
- $[40] = t21;
314
- $[41] = t22;
315
- } else t22 = $[41];
316
- const form = useForm(t22);
317
- let t23;
318
- if ($[42] !== form || $[43] !== t || $[44] !== transitionMutation || $[45] !== transitionSchedule || $[46] !== transitionScheduledAt || $[47] !== transitionTarget) {
319
- t23 = () => {
354
+ $[47] = resolver;
355
+ $[48] = t26;
356
+ $[49] = t27;
357
+ } else t27 = $[49];
358
+ const form = useForm(t27);
359
+ let t28;
360
+ if ($[50] !== form || $[51] !== t || $[52] !== transitionMutation || $[53] !== transitionSchedule || $[54] !== transitionScheduledAt || $[55] !== transitionTarget) {
361
+ t28 = () => {
320
362
  if (!transitionTarget) return;
321
363
  const params = { stage: transitionTarget.name };
322
364
  if (transitionSchedule) {
@@ -328,9 +370,9 @@ function GlobalFormView(t0) {
328
370
  setTransitionSchedule(false);
329
371
  setTransitionScheduledAt(null);
330
372
  };
331
- transitionMutation.mutateAsync(params).then((result) => {
332
- if (result) {
333
- if (typeof result === "object") form.reset(result);
373
+ transitionMutation.mutateAsync(params).then((result_0) => {
374
+ if (result_0) {
375
+ if (typeof result_0 === "object") form.reset(result_0);
334
376
  }
335
377
  if (transitionSchedule) if (transitionScheduledAt) toast.success(t("workflow.scheduledSuccess", {
336
378
  stage: stageLabel,
@@ -347,31 +389,31 @@ function GlobalFormView(t0) {
347
389
  resetTransitionState();
348
390
  });
349
391
  };
350
- $[42] = form;
351
- $[43] = t;
352
- $[44] = transitionMutation;
353
- $[45] = transitionSchedule;
354
- $[46] = transitionScheduledAt;
355
- $[47] = transitionTarget;
356
- $[48] = t23;
357
- } else t23 = $[48];
358
- const confirmTransition = t23;
392
+ $[50] = form;
393
+ $[51] = t;
394
+ $[52] = transitionMutation;
395
+ $[53] = transitionSchedule;
396
+ $[54] = transitionScheduledAt;
397
+ $[55] = transitionTarget;
398
+ $[56] = t28;
399
+ } else t28 = $[56];
400
+ const confirmTransition = t28;
359
401
  const prevLocaleRef = React.useRef(contentLocale);
360
402
  const skipResetRef = React.useRef(false);
361
403
  const localeSnapshotRef = React.useRef(null);
362
- let t24;
363
- if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
364
- t24 = {
404
+ let t29;
405
+ if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
406
+ t29 = {
365
407
  open: false,
366
408
  pendingLocale: null
367
409
  };
368
- $[49] = t24;
369
- } else t24 = $[49];
370
- const [localeChangeDialog, setLocaleChangeDialog] = React.useState(t24);
371
- let t25;
372
- let t26;
373
- if ($[50] !== contentLocale || $[51] !== form || $[52] !== localeChangeDialog.open || $[53] !== setContentLocale) {
374
- t25 = () => {
410
+ $[57] = t29;
411
+ } else t29 = $[57];
412
+ const [localeChangeDialog, setLocaleChangeDialog] = React.useState(t29);
413
+ let t30;
414
+ let t31;
415
+ if ($[58] !== contentLocale || $[59] !== form || $[60] !== localeChangeDialog.open || $[61] !== setContentLocale) {
416
+ t30 = () => {
375
417
  if (prevLocaleRef.current !== contentLocale) if (form.formState.isDirty && !localeChangeDialog.open) {
376
418
  skipResetRef.current = true;
377
419
  localeSnapshotRef.current = form.getValues();
@@ -385,27 +427,27 @@ function GlobalFormView(t0) {
385
427
  skipResetRef.current = false;
386
428
  }
387
429
  };
388
- t26 = [
430
+ t31 = [
389
431
  contentLocale,
390
432
  form.formState.isDirty,
391
433
  localeChangeDialog.open,
392
434
  setContentLocale,
393
435
  form
394
436
  ];
395
- $[50] = contentLocale;
396
- $[51] = form;
397
- $[52] = localeChangeDialog.open;
398
- $[53] = setContentLocale;
399
- $[54] = t25;
400
- $[55] = t26;
437
+ $[58] = contentLocale;
438
+ $[59] = form;
439
+ $[60] = localeChangeDialog.open;
440
+ $[61] = setContentLocale;
441
+ $[62] = t30;
442
+ $[63] = t31;
401
443
  } else {
402
- t25 = $[54];
403
- t26 = $[55];
444
+ t30 = $[62];
445
+ t31 = $[63];
404
446
  }
405
- React.useEffect(t25, t26);
406
- let t27;
407
- if ($[56] !== localeChangeDialog.pendingLocale || $[57] !== setContentLocale) {
408
- t27 = () => {
447
+ React.useEffect(t30, t31);
448
+ let t32;
449
+ if ($[64] !== localeChangeDialog.pendingLocale || $[65] !== setContentLocale) {
450
+ t32 = () => {
409
451
  skipResetRef.current = false;
410
452
  localeSnapshotRef.current = null;
411
453
  if (localeChangeDialog.pendingLocale) {
@@ -417,14 +459,14 @@ function GlobalFormView(t0) {
417
459
  pendingLocale: null
418
460
  });
419
461
  };
420
- $[56] = localeChangeDialog.pendingLocale;
421
- $[57] = setContentLocale;
422
- $[58] = t27;
423
- } else t27 = $[58];
424
- const handleLocaleChangeConfirm = t27;
425
- let t28;
426
- if ($[59] !== form) {
427
- t28 = () => {
462
+ $[64] = localeChangeDialog.pendingLocale;
463
+ $[65] = setContentLocale;
464
+ $[66] = t32;
465
+ } else t32 = $[66];
466
+ const handleLocaleChangeConfirm = t32;
467
+ let t33;
468
+ if ($[67] !== form) {
469
+ t33 = () => {
428
470
  skipResetRef.current = false;
429
471
  if (localeSnapshotRef.current) form.reset(localeSnapshotRef.current, {
430
472
  keepDirty: true,
@@ -438,91 +480,91 @@ function GlobalFormView(t0) {
438
480
  pendingLocale: null
439
481
  });
440
482
  };
441
- $[59] = form;
442
- $[60] = t28;
443
- } else t28 = $[60];
444
- const handleLocaleChangeCancel = t28;
445
- let t29;
446
- let t30;
447
- if ($[61] !== form || $[62] !== globalData) {
448
- t29 = () => {
483
+ $[67] = form;
484
+ $[68] = t33;
485
+ } else t33 = $[68];
486
+ const handleLocaleChangeCancel = t33;
487
+ let t34;
488
+ let t35;
489
+ if ($[69] !== form || $[70] !== globalData) {
490
+ t34 = () => {
449
491
  if (skipResetRef.current) return;
450
492
  if (globalData) form.reset(globalData);
451
493
  };
452
- t30 = [form, globalData];
453
- $[61] = form;
454
- $[62] = globalData;
455
- $[63] = t29;
456
- $[64] = t30;
494
+ t35 = [form, globalData];
495
+ $[69] = form;
496
+ $[70] = globalData;
497
+ $[71] = t34;
498
+ $[72] = t35;
457
499
  } else {
458
- t29 = $[63];
459
- t30 = $[64];
500
+ t34 = $[71];
501
+ t35 = $[72];
460
502
  }
461
- React.useEffect(t29, t30);
462
- let t31;
463
- if ($[65] !== globalSchema) {
464
- t31 = extractReactiveConfigs(globalSchema);
465
- $[65] = globalSchema;
466
- $[66] = t31;
467
- } else t31 = $[66];
468
- const reactiveConfigs = t31;
469
- let t32;
470
- if ($[67] !== dataLoading || $[68] !== reactiveConfigs) {
471
- t32 = !dataLoading && Object.keys(reactiveConfigs).length > 0;
472
- $[67] = dataLoading;
473
- $[68] = reactiveConfigs;
474
- $[69] = t32;
475
- } else t32 = $[69];
476
- let t33;
477
- if ($[70] !== form || $[71] !== globalName || $[72] !== reactiveConfigs || $[73] !== t32) {
478
- t33 = {
503
+ React.useEffect(t34, t35);
504
+ let t36;
505
+ if ($[73] !== globalSchema) {
506
+ t36 = extractReactiveConfigs(globalSchema);
507
+ $[73] = globalSchema;
508
+ $[74] = t36;
509
+ } else t36 = $[74];
510
+ const reactiveConfigs = t36;
511
+ let t37;
512
+ if ($[75] !== dataLoading || $[76] !== reactiveConfigs) {
513
+ t37 = !dataLoading && Object.keys(reactiveConfigs).length > 0;
514
+ $[75] = dataLoading;
515
+ $[76] = reactiveConfigs;
516
+ $[77] = t37;
517
+ } else t37 = $[77];
518
+ let t38;
519
+ if ($[78] !== form || $[79] !== globalName || $[80] !== reactiveConfigs || $[81] !== t37) {
520
+ t38 = {
479
521
  collection: globalName,
480
522
  mode: "global",
481
523
  reactiveConfigs,
482
- enabled: t32,
524
+ enabled: t37,
483
525
  debounce: 300,
484
526
  form
485
527
  };
486
- $[70] = form;
487
- $[71] = globalName;
488
- $[72] = reactiveConfigs;
489
- $[73] = t32;
490
- $[74] = t33;
491
- } else t33 = $[74];
492
- useReactiveFields(t33);
493
- let t34;
494
- bb1: {
528
+ $[78] = form;
529
+ $[79] = globalName;
530
+ $[80] = reactiveConfigs;
531
+ $[81] = t37;
532
+ $[82] = t38;
533
+ } else t38 = $[82];
534
+ useReactiveFields(t38);
535
+ let t39;
536
+ bb2: {
495
537
  if (!viewConfig) {
496
- t34 = config;
497
- break bb1;
538
+ t39 = config;
539
+ break bb2;
498
540
  }
499
- let t35$1;
500
- if ($[75] !== config) {
501
- t35$1 = config ?? {};
502
- $[75] = config;
503
- $[76] = t35$1;
504
- } else t35$1 = $[76];
505
- let t36$1;
506
- if ($[77] !== t35$1 || $[78] !== viewConfig) {
507
- t36$1 = {
508
- ...t35$1,
541
+ let t40$1;
542
+ if ($[83] !== config) {
543
+ t40$1 = config ?? {};
544
+ $[83] = config;
545
+ $[84] = t40$1;
546
+ } else t40$1 = $[84];
547
+ let t41$1;
548
+ if ($[85] !== t40$1 || $[86] !== viewConfig) {
549
+ t41$1 = {
550
+ ...t40$1,
509
551
  form: viewConfig
510
552
  };
511
- $[77] = t35$1;
512
- $[78] = viewConfig;
513
- $[79] = t36$1;
514
- } else t36$1 = $[79];
515
- t34 = t36$1;
553
+ $[85] = t40$1;
554
+ $[86] = viewConfig;
555
+ $[87] = t41$1;
556
+ } else t41$1 = $[87];
557
+ t39 = t41$1;
516
558
  }
517
- const resolvedConfig = t34;
518
- let t35;
519
- if ($[80] !== form || $[81] !== t || $[82] !== updateMutation) {
520
- t35 = async (data_0) => {
559
+ const resolvedConfig = t39;
560
+ let t40;
561
+ if ($[88] !== form || $[89] !== t || $[90] !== updateMutation) {
562
+ t40 = async (data_0) => {
521
563
  try {
522
- const result_0 = await updateMutation.mutateAsync({ data: data_0 });
523
- if (result_0) form.reset(result_0);
524
- } catch (t36$1) {
525
- const error_0 = t36$1;
564
+ const result_1 = await updateMutation.mutateAsync({ data: data_0 });
565
+ if (result_1) form.reset(result_1);
566
+ } catch (t41$1) {
567
+ const error_0 = t41$1;
526
568
  if (error_0 instanceof QuestpieClientError && error_0.fieldErrors && error_0.fieldErrors.length > 0) {
527
569
  for (const fieldError of error_0.fieldErrors) form.setError(fieldError.path, {
528
570
  type: "server",
@@ -535,16 +577,16 @@ function GlobalFormView(t0) {
535
577
  toast.error(t("toast.settingsSaveFailed") || "Failed to save settings", { description: message });
536
578
  }
537
579
  };
538
- $[80] = form;
539
- $[81] = t;
540
- $[82] = updateMutation;
541
- $[83] = t35;
542
- } else t35 = $[83];
543
- const onSubmit = t35;
544
- let t36;
545
- let t37;
546
- if ($[84] !== form || $[85] !== onSubmit) {
547
- t36 = () => {
580
+ $[88] = form;
581
+ $[89] = t;
582
+ $[90] = updateMutation;
583
+ $[91] = t40;
584
+ } else t40 = $[91];
585
+ const onSubmit = t40;
586
+ let t41;
587
+ let t42;
588
+ if ($[92] !== form || $[93] !== onSubmit) {
589
+ t41 = () => {
548
590
  const handleKeyDown = (e) => {
549
591
  if (shouldHandleAdminShortcut(e, {
550
592
  allowEditableTarget: true,
@@ -557,130 +599,130 @@ function GlobalFormView(t0) {
557
599
  document.addEventListener("keydown", handleKeyDown);
558
600
  return () => document.removeEventListener("keydown", handleKeyDown);
559
601
  };
560
- t37 = [form, onSubmit];
561
- $[84] = form;
562
- $[85] = onSubmit;
563
- $[86] = t36;
564
- $[87] = t37;
602
+ t42 = [form, onSubmit];
603
+ $[92] = form;
604
+ $[93] = onSubmit;
605
+ $[94] = t41;
606
+ $[95] = t42;
565
607
  } else {
566
- t36 = $[86];
567
- t37 = $[87];
608
+ t41 = $[94];
609
+ t42 = $[95];
568
610
  }
569
- React.useEffect(t36, t37);
611
+ React.useEffect(t41, t42);
570
612
  const isSubmitting = updateMutation.isPending || form.formState.isSubmitting;
571
- let t38;
572
- if ($[88] !== form || $[89] !== globalData || $[90] !== pendingRevertVersion || $[91] !== revertVersionMutation || $[92] !== t) {
573
- t38 = async () => {
613
+ let t43;
614
+ if ($[96] !== form || $[97] !== globalData || $[98] !== pendingRevertVersion || $[99] !== revertVersionMutation || $[100] !== t) {
615
+ t43 = async () => {
574
616
  if (!pendingRevertVersion) return;
575
617
  const payload = {};
576
618
  if (typeof globalData?.id === "string") payload.id = globalData.id;
577
619
  if (typeof pendingRevertVersion.versionId === "string") payload.versionId = pendingRevertVersion.versionId;
578
620
  else if (typeof pendingRevertVersion.versionNumber === "number") payload.version = pendingRevertVersion.versionNumber;
579
- const result_1 = await revertVersionMutation.mutateAsync(payload);
580
- form.reset(result_1);
621
+ const result_2 = await revertVersionMutation.mutateAsync(payload);
622
+ form.reset(result_2);
581
623
  toast.success(t("version.revertSuccess"));
582
624
  setPendingRevertVersion(null);
583
625
  };
584
- $[88] = form;
585
- $[89] = globalData;
586
- $[90] = pendingRevertVersion;
587
- $[91] = revertVersionMutation;
588
- $[92] = t;
589
- $[93] = t38;
590
- } else t38 = $[93];
591
- const confirmRevertVersion = t38;
592
- const formatDate = _temp;
626
+ $[96] = form;
627
+ $[97] = globalData;
628
+ $[98] = pendingRevertVersion;
629
+ $[99] = revertVersionMutation;
630
+ $[100] = t;
631
+ $[101] = t43;
632
+ } else t43 = $[101];
633
+ const confirmRevertVersion = t43;
634
+ const formatDate = _temp2;
593
635
  if (dataError) {
594
- let t39$1;
595
- if ($[94] !== t) {
596
- t39$1 = t("error.failedToLoad");
597
- $[94] = t;
598
- $[95] = t39$1;
599
- } else t39$1 = $[95];
600
- const t40$1 = dataError instanceof Error ? dataError.message : void 0;
601
- let t41$1;
602
- if ($[96] === Symbol.for("react.memo_cache_sentinel")) {
603
- t41$1 = /* @__PURE__ */ jsx(Icon, {
636
+ let t44$1;
637
+ if ($[102] !== t) {
638
+ t44$1 = t("error.failedToLoad");
639
+ $[102] = t;
640
+ $[103] = t44$1;
641
+ } else t44$1 = $[103];
642
+ const t45$1 = dataError instanceof Error ? dataError.message : void 0;
643
+ let t46$1;
644
+ if ($[104] === Symbol.for("react.memo_cache_sentinel")) {
645
+ t46$1 = /* @__PURE__ */ jsx(Icon, {
604
646
  icon: "ph:arrow-clockwise",
605
647
  className: "size-3.5"
606
648
  });
607
- $[96] = t41$1;
608
- } else t41$1 = $[96];
609
- let t42$1;
610
- if ($[97] !== t) {
611
- t42$1 = t("common.retry");
612
- $[97] = t;
613
- $[98] = t42$1;
614
- } else t42$1 = $[98];
615
- let t43$1;
616
- if ($[99] !== t42$1) {
617
- t43$1 = /* @__PURE__ */ jsxs(Button, {
649
+ $[104] = t46$1;
650
+ } else t46$1 = $[104];
651
+ let t47$1;
652
+ if ($[105] !== t) {
653
+ t47$1 = t("common.retry");
654
+ $[105] = t;
655
+ $[106] = t47$1;
656
+ } else t47$1 = $[106];
657
+ let t48$1;
658
+ if ($[107] !== t47$1) {
659
+ t48$1 = /* @__PURE__ */ jsxs(Button, {
618
660
  variant: "outline",
619
661
  size: "sm",
620
662
  className: "gap-2",
621
- onClick: _temp2,
622
- children: [t41$1, t42$1]
663
+ onClick: _temp3,
664
+ children: [t46$1, t47$1]
623
665
  });
624
- $[99] = t42$1;
625
- $[100] = t43$1;
626
- } else t43$1 = $[100];
627
- let t44$1;
628
- if ($[101] !== t39$1 || $[102] !== t40$1 || $[103] !== t43$1) {
629
- t44$1 = /* @__PURE__ */ jsx(EmptyState, {
666
+ $[107] = t47$1;
667
+ $[108] = t48$1;
668
+ } else t48$1 = $[108];
669
+ let t49$1;
670
+ if ($[109] !== t44$1 || $[110] !== t45$1 || $[111] !== t48$1) {
671
+ t49$1 = /* @__PURE__ */ jsx(EmptyState, {
630
672
  variant: "error",
631
673
  iconName: "ph:warning-circle",
632
- title: t39$1,
633
- description: t40$1,
674
+ title: t44$1,
675
+ description: t45$1,
634
676
  height: "h-64",
635
- action: t43$1
677
+ action: t48$1
636
678
  });
637
- $[101] = t39$1;
638
- $[102] = t40$1;
639
- $[103] = t43$1;
640
- $[104] = t44$1;
641
- } else t44$1 = $[104];
642
- return t44$1;
679
+ $[109] = t44$1;
680
+ $[110] = t45$1;
681
+ $[111] = t48$1;
682
+ $[112] = t49$1;
683
+ } else t49$1 = $[112];
684
+ return t49$1;
643
685
  }
644
686
  if (dataLoading) {
645
- let t39$1;
646
- if ($[105] === Symbol.for("react.memo_cache_sentinel")) {
647
- t39$1 = /* @__PURE__ */ jsx(GlobalFormViewSkeleton, {});
648
- $[105] = t39$1;
649
- } else t39$1 = $[105];
650
- return t39$1;
687
+ let t44$1;
688
+ if ($[113] === Symbol.for("react.memo_cache_sentinel")) {
689
+ t44$1 = /* @__PURE__ */ jsx(GlobalFormViewSkeleton, {});
690
+ $[113] = t44$1;
691
+ } else t44$1 = $[113];
692
+ return t44$1;
651
693
  }
652
- const t39 = resolvedConfig?.label ?? schemaFields?._globalLabel;
653
- let t40;
654
- if ($[106] !== globalName || $[107] !== resolveText || $[108] !== t39) {
655
- t40 = resolveText(t39, globalName);
656
- $[106] = globalName;
657
- $[107] = resolveText;
658
- $[108] = t39;
659
- $[109] = t40;
660
- } else t40 = $[109];
661
- const globalLabel = t40;
662
- let t41;
663
- if ($[110] !== form || $[111] !== onSubmit) {
664
- t41 = form.handleSubmit(onSubmit);
665
- $[110] = form;
666
- $[111] = onSubmit;
667
- $[112] = t41;
668
- } else t41 = $[112];
669
- let t42;
670
- if ($[113] !== contentLocale || $[114] !== localeOptions || $[115] !== setContentLocale) {
671
- t42 = localeOptions.length > 0 && /* @__PURE__ */ jsx(LocaleSwitcher, {
694
+ const t44 = resolvedConfig?.label ?? schemaFields?._globalLabel;
695
+ let t45;
696
+ if ($[114] !== globalName || $[115] !== resolveText || $[116] !== t44) {
697
+ t45 = resolveText(t44, globalName);
698
+ $[114] = globalName;
699
+ $[115] = resolveText;
700
+ $[116] = t44;
701
+ $[117] = t45;
702
+ } else t45 = $[117];
703
+ const globalLabel = t45;
704
+ let t46;
705
+ if ($[118] !== form || $[119] !== onSubmit) {
706
+ t46 = form.handleSubmit(onSubmit);
707
+ $[118] = form;
708
+ $[119] = onSubmit;
709
+ $[120] = t46;
710
+ } else t46 = $[120];
711
+ let t47;
712
+ if ($[121] !== contentLocale || $[122] !== localeOptions || $[123] !== setContentLocale) {
713
+ t47 = localeOptions.length > 0 && /* @__PURE__ */ jsx(LocaleSwitcher, {
672
714
  locales: localeOptions,
673
715
  value: contentLocale,
674
716
  onChange: setContentLocale
675
717
  });
676
- $[113] = contentLocale;
677
- $[114] = localeOptions;
678
- $[115] = setContentLocale;
679
- $[116] = t42;
680
- } else t42 = $[116];
681
- let t43;
682
- if ($[117] !== currentStage || $[118] !== currentStageLabel || $[119] !== workflowEnabled) {
683
- t43 = workflowEnabled && currentStage && /* @__PURE__ */ jsxs(Badge, {
718
+ $[121] = contentLocale;
719
+ $[122] = localeOptions;
720
+ $[123] = setContentLocale;
721
+ $[124] = t47;
722
+ } else t47 = $[124];
723
+ let t48;
724
+ if ($[125] !== currentStage || $[126] !== currentStageLabel || $[127] !== workflowEnabled) {
725
+ t48 = workflowEnabled && currentStage && /* @__PURE__ */ jsxs(Badge, {
684
726
  variant: "outline",
685
727
  className: "gap-1.5",
686
728
  children: [/* @__PURE__ */ jsx(Icon, {
@@ -688,33 +730,33 @@ function GlobalFormView(t0) {
688
730
  className: "size-3"
689
731
  }), currentStageLabel]
690
732
  });
691
- $[117] = currentStage;
692
- $[118] = currentStageLabel;
693
- $[119] = workflowEnabled;
694
- $[120] = t43;
695
- } else t43 = $[120];
696
- let t44;
697
- if ($[121] !== t42 || $[122] !== t43) {
698
- t44 = /* @__PURE__ */ jsxs(Fragment, { children: [t42, t43] });
699
- $[121] = t42;
700
- $[122] = t43;
701
- $[123] = t44;
702
- } else t44 = $[123];
703
- let t45;
704
- if ($[124] !== globalData || $[125] !== showMeta || $[126] !== t) {
705
- t45 = showMeta && globalData?.updatedAt ? /* @__PURE__ */ jsxs("span", { children: [
733
+ $[125] = currentStage;
734
+ $[126] = currentStageLabel;
735
+ $[127] = workflowEnabled;
736
+ $[128] = t48;
737
+ } else t48 = $[128];
738
+ let t49;
739
+ if ($[129] !== t47 || $[130] !== t48) {
740
+ t49 = /* @__PURE__ */ jsxs(Fragment, { children: [t47, t48] });
741
+ $[129] = t47;
742
+ $[130] = t48;
743
+ $[131] = t49;
744
+ } else t49 = $[131];
745
+ let t50;
746
+ if ($[132] !== globalData || $[133] !== showMeta || $[134] !== t) {
747
+ t50 = showMeta && globalData?.updatedAt ? /* @__PURE__ */ jsxs("span", { children: [
706
748
  t("form.lastUpdated"),
707
749
  ": ",
708
750
  formatDate(globalData.updatedAt)
709
751
  ] }) : void 0;
710
- $[124] = globalData;
711
- $[125] = showMeta;
712
- $[126] = t;
713
- $[127] = t45;
714
- } else t45 = $[127];
715
- let t46;
716
- if ($[128] !== allowedTransitions || $[129] !== t || $[130] !== workflowEnabled) {
717
- t46 = workflowEnabled && allowedTransitions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
752
+ $[132] = globalData;
753
+ $[133] = showMeta;
754
+ $[134] = t;
755
+ $[135] = t50;
756
+ } else t50 = $[135];
757
+ let t51;
758
+ if ($[136] !== allowedTransitions || $[137] !== t || $[138] !== workflowEnabled) {
759
+ t51 = workflowEnabled && allowedTransitions.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
718
760
  render: /* @__PURE__ */ jsx(Button, {
719
761
  type: "button",
720
762
  variant: "outline",
@@ -738,64 +780,64 @@ function GlobalFormView(t0) {
738
780
  }), stage.label || stage.name]
739
781
  }, stage.name))
740
782
  })] });
741
- $[128] = allowedTransitions;
742
- $[129] = t;
743
- $[130] = workflowEnabled;
744
- $[131] = t46;
745
- } else t46 = $[131];
746
- let t47;
747
- if ($[132] !== setIsHistoryOpen) {
748
- t47 = () => setIsHistoryOpen(true);
749
- $[132] = setIsHistoryOpen;
750
- $[133] = t47;
751
- } else t47 = $[133];
752
- let t48;
753
- if ($[134] !== t) {
754
- t48 = t("history.title");
755
- $[134] = t;
756
- $[135] = t48;
757
- } else t48 = $[135];
758
- let t49;
759
- if ($[136] === Symbol.for("react.memo_cache_sentinel")) {
760
- t49 = /* @__PURE__ */ jsx(Icon, {
783
+ $[136] = allowedTransitions;
784
+ $[137] = t;
785
+ $[138] = workflowEnabled;
786
+ $[139] = t51;
787
+ } else t51 = $[139];
788
+ let t52;
789
+ if ($[140] !== setIsHistoryOpen) {
790
+ t52 = () => setIsHistoryOpen(true);
791
+ $[140] = setIsHistoryOpen;
792
+ $[141] = t52;
793
+ } else t52 = $[141];
794
+ let t53;
795
+ if ($[142] !== t) {
796
+ t53 = t("history.title");
797
+ $[142] = t;
798
+ $[143] = t53;
799
+ } else t53 = $[143];
800
+ let t54;
801
+ if ($[144] === Symbol.for("react.memo_cache_sentinel")) {
802
+ t54 = /* @__PURE__ */ jsx(Icon, {
761
803
  icon: "ph:clock-counter-clockwise",
762
804
  className: "size-3.5"
763
805
  });
764
- $[136] = t49;
765
- } else t49 = $[136];
766
- let t50;
767
- if ($[137] !== t) {
768
- t50 = t("history.title");
769
- $[137] = t;
770
- $[138] = t50;
771
- } else t50 = $[138];
772
- let t51;
773
- if ($[139] !== t50) {
774
- t51 = /* @__PURE__ */ jsx("span", {
806
+ $[144] = t54;
807
+ } else t54 = $[144];
808
+ let t55;
809
+ if ($[145] !== t) {
810
+ t55 = t("history.title");
811
+ $[145] = t;
812
+ $[146] = t55;
813
+ } else t55 = $[146];
814
+ let t56;
815
+ if ($[147] !== t55) {
816
+ t56 = /* @__PURE__ */ jsx("span", {
775
817
  className: "sr-only",
776
- children: t50
818
+ children: t55
777
819
  });
778
- $[139] = t50;
779
- $[140] = t51;
780
- } else t51 = $[140];
781
- let t52;
782
- if ($[141] !== t47 || $[142] !== t48 || $[143] !== t51) {
783
- t52 = /* @__PURE__ */ jsxs(Button, {
820
+ $[147] = t55;
821
+ $[148] = t56;
822
+ } else t56 = $[148];
823
+ let t57;
824
+ if ($[149] !== t52 || $[150] !== t53 || $[151] !== t56) {
825
+ t57 = /* @__PURE__ */ jsxs(Button, {
784
826
  type: "button",
785
827
  variant: "outline",
786
828
  size: "icon-sm",
787
- onClick: t47,
788
- title: t48,
789
- children: [t49, t51]
829
+ onClick: t52,
830
+ title: t53,
831
+ children: [t54, t56]
790
832
  });
791
- $[141] = t47;
792
- $[142] = t48;
793
- $[143] = t51;
794
- $[144] = t52;
795
- } else t52 = $[144];
796
- let t53;
797
- if ($[145] !== isSubmitting || $[146] !== t) {
798
- t53 = isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
833
+ $[149] = t52;
834
+ $[150] = t53;
835
+ $[151] = t56;
836
+ $[152] = t57;
837
+ } else t57 = $[152];
838
+ let t58;
839
+ if ($[153] !== isSubmitting || $[154] !== t) {
840
+ t58 = isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
799
841
  icon: "ph:spinner-gap",
800
842
  className: "size-4 animate-spin"
801
843
  }), t("common.loading")] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
@@ -803,297 +845,297 @@ function GlobalFormView(t0) {
803
845
  width: 16,
804
846
  height: 16
805
847
  }), t("common.save")] });
806
- $[145] = isSubmitting;
807
- $[146] = t;
808
- $[147] = t53;
809
- } else t53 = $[147];
810
- let t54;
811
- if ($[148] !== isSubmitting || $[149] !== t53) {
812
- t54 = /* @__PURE__ */ jsx(Button, {
848
+ $[153] = isSubmitting;
849
+ $[154] = t;
850
+ $[155] = t58;
851
+ } else t58 = $[155];
852
+ let t59;
853
+ if ($[156] !== isSubmitting || $[157] !== t58) {
854
+ t59 = /* @__PURE__ */ jsx(Button, {
813
855
  type: "submit",
814
856
  size: "sm",
815
857
  disabled: isSubmitting,
816
858
  className: "gap-2",
817
- children: t53
859
+ children: t58
818
860
  });
819
- $[148] = isSubmitting;
820
- $[149] = t53;
821
- $[150] = t54;
822
- } else t54 = $[150];
823
- let t55;
824
- if ($[151] !== headerActions || $[152] !== t46 || $[153] !== t52 || $[154] !== t54) {
825
- t55 = /* @__PURE__ */ jsxs(Fragment, { children: [
861
+ $[156] = isSubmitting;
862
+ $[157] = t58;
863
+ $[158] = t59;
864
+ } else t59 = $[158];
865
+ let t60;
866
+ if ($[159] !== headerActions || $[160] !== t51 || $[161] !== t57 || $[162] !== t59) {
867
+ t60 = /* @__PURE__ */ jsxs(Fragment, { children: [
826
868
  headerActions,
827
- t46,
828
- t52,
829
- t54
869
+ t51,
870
+ t57,
871
+ t59
830
872
  ] });
831
- $[151] = headerActions;
832
- $[152] = t46;
833
- $[153] = t52;
834
- $[154] = t54;
835
- $[155] = t55;
836
- } else t55 = $[155];
837
- let t56;
838
- if ($[156] !== globalLabel || $[157] !== t44 || $[158] !== t45 || $[159] !== t55) {
839
- t56 = /* @__PURE__ */ jsx(AdminViewHeader, {
873
+ $[159] = headerActions;
874
+ $[160] = t51;
875
+ $[161] = t57;
876
+ $[162] = t59;
877
+ $[163] = t60;
878
+ } else t60 = $[163];
879
+ let t61;
880
+ if ($[164] !== globalLabel || $[165] !== t49 || $[166] !== t50 || $[167] !== t60) {
881
+ t61 = /* @__PURE__ */ jsx(AdminViewHeader, {
840
882
  className: "qa-global-form__header",
841
883
  title: globalLabel,
842
- titleAccessory: t44,
843
- meta: t45,
844
- actions: t55
884
+ titleAccessory: t49,
885
+ meta: t50,
886
+ actions: t60
845
887
  });
846
- $[156] = globalLabel;
847
- $[157] = t44;
848
- $[158] = t45;
849
- $[159] = t55;
850
- $[160] = t56;
851
- } else t56 = $[160];
852
- let t57;
853
- if ($[161] !== globalName || $[162] !== registry || $[163] !== resolvedConfig) {
854
- t57 = /* @__PURE__ */ jsx(AutoFormFields, {
888
+ $[164] = globalLabel;
889
+ $[165] = t49;
890
+ $[166] = t50;
891
+ $[167] = t60;
892
+ $[168] = t61;
893
+ } else t61 = $[168];
894
+ let t62;
895
+ if ($[169] !== globalName || $[170] !== registry || $[171] !== resolvedConfig) {
896
+ t62 = /* @__PURE__ */ jsx(AutoFormFields, {
855
897
  collection: globalName,
856
898
  mode: "global",
857
899
  config: resolvedConfig,
858
900
  registry
859
901
  });
860
- $[161] = globalName;
861
- $[162] = registry;
862
- $[163] = resolvedConfig;
863
- $[164] = t57;
864
- } else t57 = $[164];
865
- let t58;
866
- if ($[165] !== t41 || $[166] !== t56 || $[167] !== t57) {
867
- t58 = /* @__PURE__ */ jsxs("form", {
868
- onSubmit: t41,
902
+ $[169] = globalName;
903
+ $[170] = registry;
904
+ $[171] = resolvedConfig;
905
+ $[172] = t62;
906
+ } else t62 = $[172];
907
+ let t63;
908
+ if ($[173] !== t46 || $[174] !== t61 || $[175] !== t62) {
909
+ t63 = /* @__PURE__ */ jsxs("form", {
910
+ onSubmit: t46,
869
911
  className: "qa-global-form w-full space-y-4",
870
- children: [t56, t57]
912
+ children: [t61, t62]
871
913
  });
872
- $[165] = t41;
873
- $[166] = t56;
874
- $[167] = t57;
875
- $[168] = t58;
876
- } else t58 = $[168];
877
- let t59;
878
- if ($[169] !== auditData) {
879
- t59 = auditData ?? [];
880
- $[169] = auditData;
881
- $[170] = t59;
882
- } else t59 = $[170];
883
- let t60;
884
- if ($[171] !== versionsData) {
885
- t60 = versionsData ?? [];
886
- $[171] = versionsData;
887
- $[172] = t60;
888
- } else t60 = $[172];
889
- const t61 = t60;
890
- const t62 = globalSchema?.fields;
891
- let t63;
892
- if ($[173] === Symbol.for("react.memo_cache_sentinel")) {
893
- t63 = async (version) => {
914
+ $[173] = t46;
915
+ $[174] = t61;
916
+ $[175] = t62;
917
+ $[176] = t63;
918
+ } else t63 = $[176];
919
+ let t64;
920
+ if ($[177] !== auditData) {
921
+ t64 = auditData ?? [];
922
+ $[177] = auditData;
923
+ $[178] = t64;
924
+ } else t64 = $[178];
925
+ let t65;
926
+ if ($[179] !== versionsData) {
927
+ t65 = versionsData ?? [];
928
+ $[179] = versionsData;
929
+ $[180] = t65;
930
+ } else t65 = $[180];
931
+ const t66 = t65;
932
+ const t67 = globalSchema?.fields;
933
+ let t68;
934
+ if ($[181] === Symbol.for("react.memo_cache_sentinel")) {
935
+ t68 = async (version) => {
894
936
  setPendingRevertVersion(version);
895
937
  };
896
- $[173] = t63;
897
- } else t63 = $[173];
898
- const t64 = !!globalSchema?.options?.versioning;
899
- let t65;
900
- if ($[174] !== auditLoading || $[175] !== isHistoryOpen || $[176] !== revertVersionMutation.isPending || $[177] !== setIsHistoryOpen || $[178] !== t59 || $[179] !== t61 || $[180] !== t62 || $[181] !== t64 || $[182] !== versionsLoading) {
901
- t65 = /* @__PURE__ */ jsx(HistorySidebar, {
938
+ $[181] = t68;
939
+ } else t68 = $[181];
940
+ const t69 = !!globalSchema?.options?.versioning;
941
+ let t70;
942
+ if ($[182] !== auditLoading || $[183] !== isHistoryOpen || $[184] !== revertVersionMutation.isPending || $[185] !== setIsHistoryOpen || $[186] !== t64 || $[187] !== t66 || $[188] !== t67 || $[189] !== t69 || $[190] !== versionsLoading) {
943
+ t70 = /* @__PURE__ */ jsx(HistorySidebar, {
902
944
  open: isHistoryOpen,
903
945
  onOpenChange: setIsHistoryOpen,
904
- auditEntries: t59,
946
+ auditEntries: t64,
905
947
  isLoadingAudit: auditLoading,
906
- versions: t61,
907
- fields: t62,
948
+ versions: t66,
949
+ fields: t67,
908
950
  isLoadingVersions: versionsLoading,
909
951
  isReverting: revertVersionMutation.isPending,
910
- onRevert: t63,
911
- showVersionsTab: t64
952
+ onRevert: t68,
953
+ showVersionsTab: t69
912
954
  });
913
- $[174] = auditLoading;
914
- $[175] = isHistoryOpen;
915
- $[176] = revertVersionMutation.isPending;
916
- $[177] = setIsHistoryOpen;
917
- $[178] = t59;
918
- $[179] = t61;
919
- $[180] = t62;
920
- $[181] = t64;
921
- $[182] = versionsLoading;
922
- $[183] = t65;
923
- } else t65 = $[183];
924
- const t66 = !!pendingRevertVersion;
925
- let t67;
926
- if ($[184] === Symbol.for("react.memo_cache_sentinel")) {
927
- t67 = (open) => {
955
+ $[182] = auditLoading;
956
+ $[183] = isHistoryOpen;
957
+ $[184] = revertVersionMutation.isPending;
958
+ $[185] = setIsHistoryOpen;
959
+ $[186] = t64;
960
+ $[187] = t66;
961
+ $[188] = t67;
962
+ $[189] = t69;
963
+ $[190] = versionsLoading;
964
+ $[191] = t70;
965
+ } else t70 = $[191];
966
+ const t71 = !!pendingRevertVersion;
967
+ let t72;
968
+ if ($[192] === Symbol.for("react.memo_cache_sentinel")) {
969
+ t72 = (open) => {
928
970
  if (!open) setPendingRevertVersion(null);
929
971
  };
930
- $[184] = t67;
931
- } else t67 = $[184];
932
- let t68;
933
- if ($[185] !== t) {
934
- t68 = t("version.revertConfirmTitle");
935
- $[185] = t;
936
- $[186] = t68;
937
- } else t68 = $[186];
938
- const t69 = pendingRevertVersion?.versionNumber ?? pendingRevertVersion?.versionId ?? "-";
939
- let t70;
940
- if ($[187] !== t || $[188] !== t69) {
941
- t70 = t("version.revertConfirmDescription", { number: t69 });
942
- $[187] = t;
943
- $[188] = t69;
944
- $[189] = t70;
945
- } else t70 = $[189];
946
- let t71;
947
- if ($[190] !== t) {
948
- t71 = t("version.revert");
949
- $[190] = t;
950
- $[191] = t71;
951
- } else t71 = $[191];
952
- let t72;
953
- if ($[192] !== t) {
954
- t72 = t("common.cancel");
955
- $[192] = t;
956
- $[193] = t72;
957
- } else t72 = $[193];
972
+ $[192] = t72;
973
+ } else t72 = $[192];
958
974
  let t73;
959
- if ($[194] !== t68 || $[195] !== t70 || $[196] !== t71 || $[197] !== t72) {
960
- t73 = {
961
- title: t68,
962
- description: t70,
963
- confirmLabel: t71,
964
- cancelLabel: t72,
975
+ if ($[193] !== t) {
976
+ t73 = t("version.revertConfirmTitle");
977
+ $[193] = t;
978
+ $[194] = t73;
979
+ } else t73 = $[194];
980
+ const t74 = pendingRevertVersion?.versionNumber ?? pendingRevertVersion?.versionId ?? "-";
981
+ let t75;
982
+ if ($[195] !== t || $[196] !== t74) {
983
+ t75 = t("version.revertConfirmDescription", { number: t74 });
984
+ $[195] = t;
985
+ $[196] = t74;
986
+ $[197] = t75;
987
+ } else t75 = $[197];
988
+ let t76;
989
+ if ($[198] !== t) {
990
+ t76 = t("version.revert");
991
+ $[198] = t;
992
+ $[199] = t76;
993
+ } else t76 = $[199];
994
+ let t77;
995
+ if ($[200] !== t) {
996
+ t77 = t("common.cancel");
997
+ $[200] = t;
998
+ $[201] = t77;
999
+ } else t77 = $[201];
1000
+ let t78;
1001
+ if ($[202] !== t73 || $[203] !== t75 || $[204] !== t76 || $[205] !== t77) {
1002
+ t78 = {
1003
+ title: t73,
1004
+ description: t75,
1005
+ confirmLabel: t76,
1006
+ cancelLabel: t77,
965
1007
  destructive: false
966
1008
  };
967
- $[194] = t68;
968
- $[195] = t70;
969
- $[196] = t71;
970
- $[197] = t72;
971
- $[198] = t73;
972
- } else t73 = $[198];
973
- let t74;
974
- if ($[199] !== confirmRevertVersion || $[200] !== revertVersionMutation.isPending || $[201] !== t66 || $[202] !== t73) {
975
- t74 = /* @__PURE__ */ jsx(ConfirmationDialog, {
976
- open: t66,
977
- onOpenChange: t67,
978
- config: t73,
1009
+ $[202] = t73;
1010
+ $[203] = t75;
1011
+ $[204] = t76;
1012
+ $[205] = t77;
1013
+ $[206] = t78;
1014
+ } else t78 = $[206];
1015
+ let t79;
1016
+ if ($[207] !== confirmRevertVersion || $[208] !== revertVersionMutation.isPending || $[209] !== t71 || $[210] !== t78) {
1017
+ t79 = /* @__PURE__ */ jsx(ConfirmationDialog, {
1018
+ open: t71,
1019
+ onOpenChange: t72,
1020
+ config: t78,
979
1021
  onConfirm: confirmRevertVersion,
980
1022
  loading: revertVersionMutation.isPending
981
1023
  });
982
- $[199] = confirmRevertVersion;
983
- $[200] = revertVersionMutation.isPending;
984
- $[201] = t66;
985
- $[202] = t73;
986
- $[203] = t74;
987
- } else t74 = $[203];
988
- const t75 = !!transitionTarget;
989
- let t76;
990
- if ($[204] === Symbol.for("react.memo_cache_sentinel")) {
991
- t76 = (open_0) => {
1024
+ $[207] = confirmRevertVersion;
1025
+ $[208] = revertVersionMutation.isPending;
1026
+ $[209] = t71;
1027
+ $[210] = t78;
1028
+ $[211] = t79;
1029
+ } else t79 = $[211];
1030
+ const t80 = !!transitionTarget;
1031
+ let t81;
1032
+ if ($[212] === Symbol.for("react.memo_cache_sentinel")) {
1033
+ t81 = (open_0) => {
992
1034
  if (!open_0) {
993
1035
  setTransitionTarget(null);
994
1036
  setTransitionSchedule(false);
995
1037
  setTransitionScheduledAt(null);
996
1038
  }
997
1039
  };
998
- $[204] = t76;
999
- } else t76 = $[204];
1000
- let t77;
1001
- if ($[205] === Symbol.for("react.memo_cache_sentinel")) {
1002
- t77 = /* @__PURE__ */ jsx(Icon, {
1040
+ $[212] = t81;
1041
+ } else t81 = $[212];
1042
+ let t82;
1043
+ if ($[213] === Symbol.for("react.memo_cache_sentinel")) {
1044
+ t82 = /* @__PURE__ */ jsx(Icon, {
1003
1045
  icon: "ph:arrows-left-right",
1004
1046
  className: "size-5"
1005
1047
  });
1006
- $[205] = t77;
1007
- } else t77 = $[205];
1008
- const t78 = transitionTarget?.label ?? transitionTarget?.name ?? "";
1009
- let t79;
1010
- if ($[206] !== t || $[207] !== t78) {
1011
- t79 = t("workflow.transitionTo", { stage: t78 });
1012
- $[206] = t;
1013
- $[207] = t78;
1014
- $[208] = t79;
1015
- } else t79 = $[208];
1016
- let t80;
1017
- if ($[209] !== t79) {
1018
- t80 = /* @__PURE__ */ jsxs(DialogTitle, {
1048
+ $[213] = t82;
1049
+ } else t82 = $[213];
1050
+ const t83 = transitionTarget?.label ?? transitionTarget?.name ?? "";
1051
+ let t84;
1052
+ if ($[214] !== t || $[215] !== t83) {
1053
+ t84 = t("workflow.transitionTo", { stage: t83 });
1054
+ $[214] = t;
1055
+ $[215] = t83;
1056
+ $[216] = t84;
1057
+ } else t84 = $[216];
1058
+ let t85;
1059
+ if ($[217] !== t84) {
1060
+ t85 = /* @__PURE__ */ jsxs(DialogTitle, {
1019
1061
  className: "flex items-center gap-2",
1020
- children: [t77, t79]
1062
+ children: [t82, t84]
1021
1063
  });
1022
- $[209] = t79;
1023
- $[210] = t80;
1024
- } else t80 = $[210];
1025
- const t81 = transitionTarget?.label ?? transitionTarget?.name ?? "";
1026
- let t82;
1027
- if ($[211] !== currentStageLabel || $[212] !== t || $[213] !== t81) {
1028
- t82 = t("workflow.transitionDescription", {
1064
+ $[217] = t84;
1065
+ $[218] = t85;
1066
+ } else t85 = $[218];
1067
+ const t86 = transitionTarget?.label ?? transitionTarget?.name ?? "";
1068
+ let t87;
1069
+ if ($[219] !== currentStageLabel || $[220] !== t || $[221] !== t86) {
1070
+ t87 = t("workflow.transitionDescription", {
1029
1071
  from: currentStageLabel,
1030
- to: t81
1072
+ to: t86
1031
1073
  });
1032
- $[211] = currentStageLabel;
1033
- $[212] = t;
1034
- $[213] = t81;
1035
- $[214] = t82;
1036
- } else t82 = $[214];
1037
- let t83;
1038
- if ($[215] !== t82) {
1039
- t83 = /* @__PURE__ */ jsx(DialogDescription, { children: t82 });
1040
- $[215] = t82;
1041
- $[216] = t83;
1042
- } else t83 = $[216];
1043
- let t84;
1044
- if ($[217] !== t80 || $[218] !== t83) {
1045
- t84 = /* @__PURE__ */ jsxs(DialogHeader, { children: [t80, t83] });
1046
- $[217] = t80;
1047
- $[218] = t83;
1048
- $[219] = t84;
1049
- } else t84 = $[219];
1050
- let t85;
1051
- if ($[220] === Symbol.for("react.memo_cache_sentinel")) {
1052
- t85 = (val) => {
1074
+ $[219] = currentStageLabel;
1075
+ $[220] = t;
1076
+ $[221] = t86;
1077
+ $[222] = t87;
1078
+ } else t87 = $[222];
1079
+ let t88;
1080
+ if ($[223] !== t87) {
1081
+ t88 = /* @__PURE__ */ jsx(DialogDescription, { children: t87 });
1082
+ $[223] = t87;
1083
+ $[224] = t88;
1084
+ } else t88 = $[224];
1085
+ let t89;
1086
+ if ($[225] !== t85 || $[226] !== t88) {
1087
+ t89 = /* @__PURE__ */ jsxs(DialogHeader, { children: [t85, t88] });
1088
+ $[225] = t85;
1089
+ $[226] = t88;
1090
+ $[227] = t89;
1091
+ } else t89 = $[227];
1092
+ let t90;
1093
+ if ($[228] === Symbol.for("react.memo_cache_sentinel")) {
1094
+ t90 = (val) => {
1053
1095
  setTransitionSchedule(!!val);
1054
1096
  if (!val) setTransitionScheduledAt(null);
1055
1097
  };
1056
- $[220] = t85;
1057
- } else t85 = $[220];
1058
- let t86;
1059
- if ($[221] !== transitionSchedule) {
1060
- t86 = /* @__PURE__ */ jsx(Checkbox, {
1098
+ $[228] = t90;
1099
+ } else t90 = $[228];
1100
+ let t91;
1101
+ if ($[229] !== transitionSchedule) {
1102
+ t91 = /* @__PURE__ */ jsx(Checkbox, {
1061
1103
  checked: transitionSchedule,
1062
- onCheckedChange: t85,
1104
+ onCheckedChange: t90,
1063
1105
  id: "global-transition-schedule"
1064
1106
  });
1065
- $[221] = transitionSchedule;
1066
- $[222] = t86;
1067
- } else t86 = $[222];
1068
- let t87;
1069
- if ($[223] !== t) {
1070
- t87 = t("workflow.scheduleLabel");
1071
- $[223] = t;
1072
- $[224] = t87;
1073
- } else t87 = $[224];
1074
- let t88;
1075
- if ($[225] !== t87) {
1076
- t88 = /* @__PURE__ */ jsx(Label, {
1107
+ $[229] = transitionSchedule;
1108
+ $[230] = t91;
1109
+ } else t91 = $[230];
1110
+ let t92;
1111
+ if ($[231] !== t) {
1112
+ t92 = t("workflow.scheduleLabel");
1113
+ $[231] = t;
1114
+ $[232] = t92;
1115
+ } else t92 = $[232];
1116
+ let t93;
1117
+ if ($[233] !== t92) {
1118
+ t93 = /* @__PURE__ */ jsx(Label, {
1077
1119
  htmlFor: "global-transition-schedule",
1078
1120
  className: "cursor-pointer text-sm",
1079
- children: t87
1121
+ children: t92
1080
1122
  });
1081
- $[225] = t87;
1082
- $[226] = t88;
1083
- } else t88 = $[226];
1084
- let t89;
1085
- if ($[227] !== t86 || $[228] !== t88) {
1086
- t89 = /* @__PURE__ */ jsxs("div", {
1123
+ $[233] = t92;
1124
+ $[234] = t93;
1125
+ } else t93 = $[234];
1126
+ let t94;
1127
+ if ($[235] !== t91 || $[236] !== t93) {
1128
+ t94 = /* @__PURE__ */ jsxs("div", {
1087
1129
  className: "flex items-center gap-2",
1088
- children: [t86, t88]
1130
+ children: [t91, t93]
1089
1131
  });
1090
- $[227] = t86;
1091
- $[228] = t88;
1092
- $[229] = t89;
1093
- } else t89 = $[229];
1094
- let t90;
1095
- if ($[230] !== t || $[231] !== transitionSchedule || $[232] !== transitionScheduledAt) {
1096
- t90 = transitionSchedule && /* @__PURE__ */ jsxs("div", {
1132
+ $[235] = t91;
1133
+ $[236] = t93;
1134
+ $[237] = t94;
1135
+ } else t94 = $[237];
1136
+ let t95;
1137
+ if ($[238] !== t || $[239] !== transitionSchedule || $[240] !== transitionScheduledAt) {
1138
+ t95 = transitionSchedule && /* @__PURE__ */ jsxs("div", {
1097
1139
  className: "space-y-1.5 pl-6",
1098
1140
  children: [
1099
1141
  /* @__PURE__ */ jsx(Label, {
@@ -1111,233 +1153,233 @@ function GlobalFormView(t0) {
1111
1153
  })
1112
1154
  ]
1113
1155
  });
1114
- $[230] = t;
1115
- $[231] = transitionSchedule;
1116
- $[232] = transitionScheduledAt;
1117
- $[233] = t90;
1118
- } else t90 = $[233];
1119
- let t91;
1120
- if ($[234] !== t89 || $[235] !== t90) {
1121
- t91 = /* @__PURE__ */ jsxs("div", {
1156
+ $[238] = t;
1157
+ $[239] = transitionSchedule;
1158
+ $[240] = transitionScheduledAt;
1159
+ $[241] = t95;
1160
+ } else t95 = $[241];
1161
+ let t96;
1162
+ if ($[242] !== t94 || $[243] !== t95) {
1163
+ t96 = /* @__PURE__ */ jsxs("div", {
1122
1164
  className: "space-y-3 py-2",
1123
- children: [t89, t90]
1165
+ children: [t94, t95]
1124
1166
  });
1125
- $[234] = t89;
1126
- $[235] = t90;
1127
- $[236] = t91;
1128
- } else t91 = $[236];
1129
- let t92;
1130
- if ($[237] === Symbol.for("react.memo_cache_sentinel")) {
1131
- t92 = () => {
1167
+ $[242] = t94;
1168
+ $[243] = t95;
1169
+ $[244] = t96;
1170
+ } else t96 = $[244];
1171
+ let t97;
1172
+ if ($[245] === Symbol.for("react.memo_cache_sentinel")) {
1173
+ t97 = () => {
1132
1174
  setTransitionTarget(null);
1133
1175
  setTransitionSchedule(false);
1134
1176
  setTransitionScheduledAt(null);
1135
1177
  };
1136
- $[237] = t92;
1137
- } else t92 = $[237];
1138
- let t93;
1139
- if ($[238] !== t) {
1140
- t93 = t("common.cancel");
1141
- $[238] = t;
1142
- $[239] = t93;
1143
- } else t93 = $[239];
1144
- let t94;
1145
- if ($[240] !== t93) {
1146
- t94 = /* @__PURE__ */ jsx(Button, {
1178
+ $[245] = t97;
1179
+ } else t97 = $[245];
1180
+ let t98;
1181
+ if ($[246] !== t) {
1182
+ t98 = t("common.cancel");
1183
+ $[246] = t;
1184
+ $[247] = t98;
1185
+ } else t98 = $[247];
1186
+ let t99;
1187
+ if ($[248] !== t98) {
1188
+ t99 = /* @__PURE__ */ jsx(Button, {
1147
1189
  type: "button",
1148
1190
  variant: "outline",
1149
- onClick: t92,
1150
- children: t93
1191
+ onClick: t97,
1192
+ children: t98
1151
1193
  });
1152
- $[240] = t93;
1153
- $[241] = t94;
1154
- } else t94 = $[241];
1155
- const t95 = transitionMutation.isPending || transitionSchedule && !transitionScheduledAt;
1156
- let t96;
1157
- if ($[242] !== transitionMutation.isPending) {
1158
- t96 = transitionMutation.isPending && /* @__PURE__ */ jsx(Icon, {
1194
+ $[248] = t98;
1195
+ $[249] = t99;
1196
+ } else t99 = $[249];
1197
+ const t100 = transitionMutation.isPending || transitionSchedule && !transitionScheduledAt;
1198
+ let t101;
1199
+ if ($[250] !== transitionMutation.isPending) {
1200
+ t101 = transitionMutation.isPending && /* @__PURE__ */ jsx(Icon, {
1159
1201
  icon: "ph:spinner-gap",
1160
1202
  className: "size-4 animate-spin"
1161
1203
  });
1162
- $[242] = transitionMutation.isPending;
1163
- $[243] = t96;
1164
- } else t96 = $[243];
1165
- let t97;
1166
- if ($[244] !== t || $[245] !== transitionSchedule) {
1167
- t97 = transitionSchedule ? t("workflow.scheduleLabel") : t("workflow.transition");
1168
- $[244] = t;
1169
- $[245] = transitionSchedule;
1170
- $[246] = t97;
1171
- } else t97 = $[246];
1172
- let t98;
1173
- if ($[247] !== confirmTransition || $[248] !== t95 || $[249] !== t96 || $[250] !== t97) {
1174
- t98 = /* @__PURE__ */ jsxs(Button, {
1204
+ $[250] = transitionMutation.isPending;
1205
+ $[251] = t101;
1206
+ } else t101 = $[251];
1207
+ let t102;
1208
+ if ($[252] !== t || $[253] !== transitionSchedule) {
1209
+ t102 = transitionSchedule ? t("workflow.scheduleLabel") : t("workflow.transition");
1210
+ $[252] = t;
1211
+ $[253] = transitionSchedule;
1212
+ $[254] = t102;
1213
+ } else t102 = $[254];
1214
+ let t103;
1215
+ if ($[255] !== confirmTransition || $[256] !== t100 || $[257] !== t101 || $[258] !== t102) {
1216
+ t103 = /* @__PURE__ */ jsxs(Button, {
1175
1217
  type: "button",
1176
1218
  onClick: confirmTransition,
1177
- disabled: t95,
1219
+ disabled: t100,
1178
1220
  className: "gap-2",
1179
- children: [t96, t97]
1180
- });
1181
- $[247] = confirmTransition;
1182
- $[248] = t95;
1183
- $[249] = t96;
1184
- $[250] = t97;
1185
- $[251] = t98;
1186
- } else t98 = $[251];
1187
- let t99;
1188
- if ($[252] !== t94 || $[253] !== t98) {
1189
- t99 = /* @__PURE__ */ jsxs(DialogFooter, { children: [t94, t98] });
1190
- $[252] = t94;
1191
- $[253] = t98;
1192
- $[254] = t99;
1193
- } else t99 = $[254];
1194
- let t100;
1195
- if ($[255] !== t84 || $[256] !== t91 || $[257] !== t99) {
1196
- t100 = /* @__PURE__ */ jsxs(DialogContent, { children: [
1197
- t84,
1198
- t91,
1199
- t99
1200
- ] });
1201
- $[255] = t84;
1202
- $[256] = t91;
1203
- $[257] = t99;
1204
- $[258] = t100;
1205
- } else t100 = $[258];
1206
- let t101;
1207
- if ($[259] !== t100 || $[260] !== t75) {
1208
- t101 = /* @__PURE__ */ jsx(Dialog, {
1209
- open: t75,
1210
- onOpenChange: t76,
1211
- children: t100
1221
+ children: [t101, t102]
1212
1222
  });
1213
- $[259] = t100;
1214
- $[260] = t75;
1215
- $[261] = t101;
1216
- } else t101 = $[261];
1217
- const t102 = localeChangeDialog.open;
1218
- let t103;
1219
- if ($[262] !== handleLocaleChangeCancel) {
1220
- t103 = (open_1) => !open_1 && handleLocaleChangeCancel();
1221
- $[262] = handleLocaleChangeCancel;
1222
- $[263] = t103;
1223
- } else t103 = $[263];
1223
+ $[255] = confirmTransition;
1224
+ $[256] = t100;
1225
+ $[257] = t101;
1226
+ $[258] = t102;
1227
+ $[259] = t103;
1228
+ } else t103 = $[259];
1224
1229
  let t104;
1225
- if ($[264] !== t) {
1226
- t104 = t("locale.unsavedChanges");
1227
- $[264] = t;
1228
- $[265] = t104;
1229
- } else t104 = $[265];
1230
+ if ($[260] !== t103 || $[261] !== t99) {
1231
+ t104 = /* @__PURE__ */ jsxs(DialogFooter, { children: [t99, t103] });
1232
+ $[260] = t103;
1233
+ $[261] = t99;
1234
+ $[262] = t104;
1235
+ } else t104 = $[262];
1230
1236
  let t105;
1231
- if ($[266] !== t104) {
1232
- t105 = /* @__PURE__ */ jsx(DialogTitle, { children: t104 });
1233
- $[266] = t104;
1234
- $[267] = t105;
1235
- } else t105 = $[267];
1237
+ if ($[263] !== t104 || $[264] !== t89 || $[265] !== t96) {
1238
+ t105 = /* @__PURE__ */ jsxs(DialogContent, { children: [
1239
+ t89,
1240
+ t96,
1241
+ t104
1242
+ ] });
1243
+ $[263] = t104;
1244
+ $[264] = t89;
1245
+ $[265] = t96;
1246
+ $[266] = t105;
1247
+ } else t105 = $[266];
1236
1248
  let t106;
1237
- if ($[268] !== t) {
1238
- t106 = t("locale.unsavedChangesDescription");
1239
- $[268] = t;
1249
+ if ($[267] !== t105 || $[268] !== t80) {
1250
+ t106 = /* @__PURE__ */ jsx(Dialog, {
1251
+ open: t80,
1252
+ onOpenChange: t81,
1253
+ children: t105
1254
+ });
1255
+ $[267] = t105;
1256
+ $[268] = t80;
1240
1257
  $[269] = t106;
1241
1258
  } else t106 = $[269];
1242
- let t107;
1243
- if ($[270] !== t106) {
1244
- t107 = /* @__PURE__ */ jsx(DialogDescription, { children: t106 });
1245
- $[270] = t106;
1246
- $[271] = t107;
1247
- } else t107 = $[271];
1259
+ const t107 = localeChangeDialog.open;
1248
1260
  let t108;
1249
- if ($[272] !== t105 || $[273] !== t107) {
1250
- t108 = /* @__PURE__ */ jsxs(DialogHeader, { children: [t105, t107] });
1251
- $[272] = t105;
1252
- $[273] = t107;
1253
- $[274] = t108;
1254
- } else t108 = $[274];
1261
+ if ($[270] !== handleLocaleChangeCancel) {
1262
+ t108 = (open_1) => !open_1 && handleLocaleChangeCancel();
1263
+ $[270] = handleLocaleChangeCancel;
1264
+ $[271] = t108;
1265
+ } else t108 = $[271];
1255
1266
  let t109;
1256
- if ($[275] !== t) {
1257
- t109 = t("common.cancel");
1258
- $[275] = t;
1259
- $[276] = t109;
1260
- } else t109 = $[276];
1267
+ if ($[272] !== t) {
1268
+ t109 = t("locale.unsavedChanges");
1269
+ $[272] = t;
1270
+ $[273] = t109;
1271
+ } else t109 = $[273];
1261
1272
  let t110;
1262
- if ($[277] !== handleLocaleChangeCancel || $[278] !== t109) {
1263
- t110 = /* @__PURE__ */ jsx(Button, {
1264
- variant: "outline",
1265
- onClick: handleLocaleChangeCancel,
1266
- children: t109
1267
- });
1268
- $[277] = handleLocaleChangeCancel;
1269
- $[278] = t109;
1270
- $[279] = t110;
1271
- } else t110 = $[279];
1273
+ if ($[274] !== t109) {
1274
+ t110 = /* @__PURE__ */ jsx(DialogTitle, { children: t109 });
1275
+ $[274] = t109;
1276
+ $[275] = t110;
1277
+ } else t110 = $[275];
1272
1278
  let t111;
1273
- if ($[280] !== t) {
1274
- t111 = t("locale.discardChanges");
1275
- $[280] = t;
1276
- $[281] = t111;
1277
- } else t111 = $[281];
1279
+ if ($[276] !== t) {
1280
+ t111 = t("locale.unsavedChangesDescription");
1281
+ $[276] = t;
1282
+ $[277] = t111;
1283
+ } else t111 = $[277];
1278
1284
  let t112;
1279
- if ($[282] !== handleLocaleChangeConfirm || $[283] !== t111) {
1280
- t112 = /* @__PURE__ */ jsx(Button, {
1281
- variant: "default",
1282
- onClick: handleLocaleChangeConfirm,
1283
- children: t111
1284
- });
1285
- $[282] = handleLocaleChangeConfirm;
1286
- $[283] = t111;
1287
- $[284] = t112;
1288
- } else t112 = $[284];
1285
+ if ($[278] !== t111) {
1286
+ t112 = /* @__PURE__ */ jsx(DialogDescription, { children: t111 });
1287
+ $[278] = t111;
1288
+ $[279] = t112;
1289
+ } else t112 = $[279];
1289
1290
  let t113;
1290
- if ($[285] !== t110 || $[286] !== t112) {
1291
- t113 = /* @__PURE__ */ jsxs(DialogFooter, { children: [t110, t112] });
1292
- $[285] = t110;
1293
- $[286] = t112;
1294
- $[287] = t113;
1295
- } else t113 = $[287];
1291
+ if ($[280] !== t110 || $[281] !== t112) {
1292
+ t113 = /* @__PURE__ */ jsxs(DialogHeader, { children: [t110, t112] });
1293
+ $[280] = t110;
1294
+ $[281] = t112;
1295
+ $[282] = t113;
1296
+ } else t113 = $[282];
1296
1297
  let t114;
1297
- if ($[288] !== t108 || $[289] !== t113) {
1298
- t114 = /* @__PURE__ */ jsxs(DialogContent, { children: [t108, t113] });
1299
- $[288] = t108;
1300
- $[289] = t113;
1301
- $[290] = t114;
1302
- } else t114 = $[290];
1298
+ if ($[283] !== t) {
1299
+ t114 = t("common.cancel");
1300
+ $[283] = t;
1301
+ $[284] = t114;
1302
+ } else t114 = $[284];
1303
1303
  let t115;
1304
- if ($[291] !== localeChangeDialog.open || $[292] !== t103 || $[293] !== t114) {
1305
- t115 = /* @__PURE__ */ jsx(Dialog, {
1306
- open: t102,
1307
- onOpenChange: t103,
1304
+ if ($[285] !== handleLocaleChangeCancel || $[286] !== t114) {
1305
+ t115 = /* @__PURE__ */ jsx(Button, {
1306
+ variant: "outline",
1307
+ onClick: handleLocaleChangeCancel,
1308
1308
  children: t114
1309
1309
  });
1310
- $[291] = localeChangeDialog.open;
1311
- $[292] = t103;
1312
- $[293] = t114;
1313
- $[294] = t115;
1314
- } else t115 = $[294];
1310
+ $[285] = handleLocaleChangeCancel;
1311
+ $[286] = t114;
1312
+ $[287] = t115;
1313
+ } else t115 = $[287];
1315
1314
  let t116;
1316
- if ($[295] !== form || $[296] !== t101 || $[297] !== t115 || $[298] !== t58 || $[299] !== t65 || $[300] !== t74) {
1317
- t116 = /* @__PURE__ */ jsxs(FormProvider, {
1315
+ if ($[288] !== t) {
1316
+ t116 = t("locale.discardChanges");
1317
+ $[288] = t;
1318
+ $[289] = t116;
1319
+ } else t116 = $[289];
1320
+ let t117;
1321
+ if ($[290] !== handleLocaleChangeConfirm || $[291] !== t116) {
1322
+ t117 = /* @__PURE__ */ jsx(Button, {
1323
+ variant: "default",
1324
+ onClick: handleLocaleChangeConfirm,
1325
+ children: t116
1326
+ });
1327
+ $[290] = handleLocaleChangeConfirm;
1328
+ $[291] = t116;
1329
+ $[292] = t117;
1330
+ } else t117 = $[292];
1331
+ let t118;
1332
+ if ($[293] !== t115 || $[294] !== t117) {
1333
+ t118 = /* @__PURE__ */ jsxs(DialogFooter, { children: [t115, t117] });
1334
+ $[293] = t115;
1335
+ $[294] = t117;
1336
+ $[295] = t118;
1337
+ } else t118 = $[295];
1338
+ let t119;
1339
+ if ($[296] !== t113 || $[297] !== t118) {
1340
+ t119 = /* @__PURE__ */ jsxs(DialogContent, { children: [t113, t118] });
1341
+ $[296] = t113;
1342
+ $[297] = t118;
1343
+ $[298] = t119;
1344
+ } else t119 = $[298];
1345
+ let t120;
1346
+ if ($[299] !== localeChangeDialog.open || $[300] !== t108 || $[301] !== t119) {
1347
+ t120 = /* @__PURE__ */ jsx(Dialog, {
1348
+ open: t107,
1349
+ onOpenChange: t108,
1350
+ children: t119
1351
+ });
1352
+ $[299] = localeChangeDialog.open;
1353
+ $[300] = t108;
1354
+ $[301] = t119;
1355
+ $[302] = t120;
1356
+ } else t120 = $[302];
1357
+ let t121;
1358
+ if ($[303] !== form || $[304] !== t106 || $[305] !== t120 || $[306] !== t63 || $[307] !== t70 || $[308] !== t79) {
1359
+ t121 = /* @__PURE__ */ jsxs(FormProvider, {
1318
1360
  ...form,
1319
1361
  children: [
1320
- t58,
1321
- t65,
1322
- t74,
1323
- t101,
1324
- t115
1362
+ t63,
1363
+ t70,
1364
+ t79,
1365
+ t106,
1366
+ t120
1325
1367
  ]
1326
1368
  });
1327
- $[295] = form;
1328
- $[296] = t101;
1329
- $[297] = t115;
1330
- $[298] = t58;
1331
- $[299] = t65;
1332
- $[300] = t74;
1333
- $[301] = t116;
1334
- } else t116 = $[301];
1335
- return t116;
1369
+ $[303] = form;
1370
+ $[304] = t106;
1371
+ $[305] = t120;
1372
+ $[306] = t63;
1373
+ $[307] = t70;
1374
+ $[308] = t79;
1375
+ $[309] = t121;
1376
+ } else t121 = $[309];
1377
+ return t121;
1336
1378
  }
1337
- function _temp2() {
1379
+ function _temp3() {
1338
1380
  return window.location.reload();
1339
1381
  }
1340
- function _temp(date) {
1382
+ function _temp2(date) {
1341
1383
  return new Date(date).toLocaleDateString(void 0, {
1342
1384
  year: "numeric",
1343
1385
  month: "short",
@@ -1346,6 +1388,9 @@ function _temp(date) {
1346
1388
  minute: "2-digit"
1347
1389
  });
1348
1390
  }
1391
+ function _temp(v) {
1392
+ return v.id;
1393
+ }
1349
1394
 
1350
1395
  //#endregion
1351
1396
  export { GlobalFormView as default };