@lunora/studio 1.0.0-alpha.37 → 1.0.0-alpha.39

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 (140) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +10 -10
  3. package/dist/mount.js +1 -1
  4. package/dist/packem_chunks/ApiTab.js +3 -3
  5. package/dist/packem_chunks/AuditPanel.js +3 -3
  6. package/dist/packem_chunks/ExportImportPanel.js +2 -2
  7. package/dist/packem_chunks/FileBrowser.js +2 -2
  8. package/dist/packem_chunks/FunctionRunner.js +1 -1
  9. package/dist/packem_chunks/FunctionStatsPanel.js +3 -3
  10. package/dist/packem_chunks/HealthPanel.js +2 -2
  11. package/dist/packem_chunks/InsightsPanel.js +3 -3
  12. package/dist/packem_chunks/LogsPanel.js +2 -2
  13. package/dist/packem_chunks/MailPanel.js +3 -3
  14. package/dist/packem_chunks/MetricsPanel.js +2 -2
  15. package/dist/packem_chunks/MigrationsPanel.js +3 -3
  16. package/dist/packem_chunks/PitrPanel.js +1 -1
  17. package/dist/packem_chunks/SchemaViewer.js +1 -1
  18. package/dist/packem_chunks/SecurityAdvisorPanel.js +2 -2
  19. package/dist/packem_chunks/SettingsPanel.js +2 -2
  20. package/dist/packem_chunks/SqlEditorPanel.js +149 -139
  21. package/dist/packem_chunks/TableEditor.js +3 -3
  22. package/dist/packem_chunks/analytics-panel.js +1 -1
  23. package/dist/packem_chunks/auth-config-panel.js +291 -105
  24. package/dist/packem_chunks/auth-sessions-panel.js +2 -2
  25. package/dist/packem_chunks/containers-panel.js +1 -1
  26. package/dist/packem_chunks/dashboards-panel.js +2 -2
  27. package/dist/packem_chunks/fanout-panel.js +2 -2
  28. package/dist/packem_chunks/flags-panel.js +2 -2
  29. package/dist/packem_chunks/kv-browser.js +2 -2
  30. package/dist/packem_chunks/log-drains-panel.js +1 -1
  31. package/dist/packem_chunks/organizations-panel.js +3003 -495
  32. package/dist/packem_chunks/payments-panel.js +3 -3
  33. package/dist/packem_chunks/permissions-panel.js +3 -3
  34. package/dist/packem_chunks/queues-panel.js +242 -219
  35. package/dist/packem_chunks/rls-panel.js +2 -2
  36. package/dist/packem_chunks/schedule-panel.js +3 -3
  37. package/dist/packem_chunks/storage-rules-panel.js +2 -2
  38. package/dist/packem_chunks/subscriptions-panel.js +2 -2
  39. package/dist/packem_chunks/users-panel.js +577 -111
  40. package/dist/packem_chunks/vector-browser.js +1 -1
  41. package/dist/packem_chunks/workflows-panel.js +2 -2
  42. package/dist/packem_shared/{ApiDocsPanel-D4CJf2ad.js → ApiDocsPanel-CBma-lnp.js} +1 -1
  43. package/dist/packem_shared/{ApiReferencePanel-Co_wpRF2.js → ApiReferencePanel-CQM3pPN7.js} +1 -1
  44. package/dist/packem_shared/{CommandPalette-BUPpbpMc.js → CommandPalette-X2tkbyHk.js} +1 -1
  45. package/dist/packem_shared/{DataBrowser-BeVNxSVm.js → DataBrowser-D2ywrdId.js} +5 -5
  46. package/dist/packem_shared/{GlobalDataBrowser-ErfvIs1S.js → GlobalDataBrowser-BkTPLzAY.js} +3 -3
  47. package/dist/packem_shared/{HomePanel-D9MQk8I7.js → HomePanel-D1Q9LZgK.js} +3 -3
  48. package/dist/packem_shared/{OpenRpcReferencePanel-DLWzrIx9.js → OpenRpcReferencePanel-Dno-hfDb.js} +1 -1
  49. package/dist/packem_shared/{ScheduledJobs-ClaNpZsg.js → ScheduledJobs-Ctw4jYtU.js} +2 -2
  50. package/dist/packem_shared/{Studio-C48P1K5W.js → Studio-lJhzDAze.js} +4 -4
  51. package/dist/packem_shared/{StudioApp-Cqh-SYm2.js → StudioApp-DiMkupvZ.js} +3 -12
  52. package/dist/packem_shared/{advisor-view-D3-U4kRR.js → advisor-view-BX8OhG0w.js} +1 -1
  53. package/dist/packem_shared/{browser-storage-tLOxkIHd.js → browser-storage-BTrX4y3B.js} +32 -2
  54. package/dist/packem_shared/{data-grid-Jz8FqQ2C.js → data-grid-CdXztApG.js} +1 -1
  55. package/dist/packem_shared/{error-alert-BBT6D22d.js → error-alert-CXjqyGw9.js} +1 -1
  56. package/dist/packem_shared/{grid-features-CUr8Z1_O.js → grid-features-BF-KBDFz.js} +128 -65
  57. package/dist/packem_shared/{home-panel-CoGxi-oj.js → home-panel-TFcRf9Ui.js} +272 -22
  58. package/dist/packem_shared/{internal-DTsYVn-g.js → internal-CYcbqMjX.js} +15 -3
  59. package/dist/packem_shared/{reference-view-CSKyUyPl.js → reference-view-DUiJcILV.js} +1 -1
  60. package/dist/packem_shared/{studio-CPHA_-3I.js → studio-Dh9UlaF_.js} +3 -3
  61. package/dist/packem_shared/{table-list-sidebar-B5psdSV1.js → table-list-sidebar-UVIXQJdU.js} +1 -1
  62. package/dist/packem_shared/{use-admin-query-BHPKmPuj.js → use-admin-query-CfHYWx5n.js} +1 -1
  63. package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
  64. package/dist/standalone/{chunk-M55U7NHO.js → chunk-23C4TCRO.js} +1 -1
  65. package/dist/standalone/{chunk-TO4JQX7W.js → chunk-5ZAA2PVR.js} +1 -1
  66. package/dist/standalone/{chunk-MPTM7ZU3.js → chunk-676HEBIR.js} +1 -1
  67. package/dist/standalone/{chunk-Y2ZPNDL7.js → chunk-6VO23MMW.js} +1 -1
  68. package/dist/standalone/{chunk-OIZ4CHPN.js → chunk-7RE5UW27.js} +1 -1
  69. package/dist/standalone/chunk-7YXOPTWI.js +1 -0
  70. package/dist/standalone/{chunk-QLM6FYZW.js → chunk-AAVIFQ4Y.js} +1 -1
  71. package/dist/standalone/{chunk-ATYUMPDM.js → chunk-AJFQ3LNM.js} +1 -1
  72. package/dist/standalone/chunk-AJULNB46.js +4 -0
  73. package/dist/standalone/{chunk-6GFEVKJP.js → chunk-BGXOXASQ.js} +1 -1
  74. package/dist/standalone/{chunk-2THHW7BC.js → chunk-BKW7FFEO.js} +1 -1
  75. package/dist/standalone/{chunk-YEVCU7TB.js → chunk-BXOYVWJR.js} +1 -1
  76. package/dist/standalone/{chunk-DVKPRFIJ.js → chunk-C7WTJLC3.js} +1 -1
  77. package/dist/standalone/{chunk-AJIUI7DD.js → chunk-CACB34RQ.js} +1 -1
  78. package/dist/standalone/{chunk-DVC6YWVP.js → chunk-CICVBMEN.js} +1 -1
  79. package/dist/standalone/{chunk-DWTBY343.js → chunk-CWEAJUHW.js} +1 -1
  80. package/dist/standalone/{chunk-TOJ3TC35.js → chunk-DECHEGIC.js} +1 -1
  81. package/dist/standalone/{chunk-PVZI3CXP.js → chunk-E75ANNWX.js} +7 -7
  82. package/dist/standalone/{chunk-OCHNCAXJ.js → chunk-ERJNDIXC.js} +1 -1
  83. package/dist/standalone/{chunk-RRAFQ5G2.js → chunk-FKACHRWO.js} +1 -1
  84. package/dist/standalone/{chunk-46K3NKPA.js → chunk-FSGCANAU.js} +1 -1
  85. package/dist/standalone/chunk-GLUNBZRI.js +1 -0
  86. package/dist/standalone/{chunk-5OH3VPZF.js → chunk-H6RKXQZU.js} +1 -1
  87. package/dist/standalone/chunk-HZTGDL4L.js +1 -0
  88. package/dist/standalone/{chunk-FCSPAJW4.js → chunk-I7ZZRM7I.js} +1 -1
  89. package/dist/standalone/{chunk-764T6X6X.js → chunk-IXDH4GL5.js} +1 -1
  90. package/dist/standalone/{chunk-ZU4DZ6NK.js → chunk-J46WXQYL.js} +1 -1
  91. package/dist/standalone/{chunk-PACH5AHG.js → chunk-JVODY4EP.js} +1 -1
  92. package/dist/standalone/chunk-KSKXW5PX.js +1 -0
  93. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  94. package/dist/standalone/chunk-LNZIB2MD.js +1 -0
  95. package/dist/standalone/{chunk-LD2R263D.js → chunk-LYB5L53X.js} +1 -1
  96. package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
  97. package/dist/standalone/chunk-MT2J3H7O.js +3 -0
  98. package/dist/standalone/{chunk-VTGBPW24.js → chunk-N746FOQP.js} +1 -1
  99. package/dist/standalone/{chunk-U4OAQPBT.js → chunk-NC6MBMSI.js} +1 -1
  100. package/dist/standalone/chunk-NN27EDQB.js +1 -0
  101. package/dist/standalone/chunk-NY6GDADQ.js +1 -0
  102. package/dist/standalone/{chunk-JE2YOAB7.js → chunk-OY3HD7BJ.js} +1 -1
  103. package/dist/standalone/{chunk-ILCTSAOB.js → chunk-P5HJXCZS.js} +1 -1
  104. package/dist/standalone/chunk-PTS5TW3J.js +1 -0
  105. package/dist/standalone/chunk-QDBOPDJ7.js +1 -0
  106. package/dist/standalone/{chunk-7SLSB2TS.js → chunk-QHFTGJPS.js} +2 -2
  107. package/dist/standalone/chunk-SSI4G2MY.js +1 -0
  108. package/dist/standalone/chunk-TH45YG6Q.js +1 -0
  109. package/dist/standalone/{chunk-WXPWVBIY.js → chunk-UGUEC6BC.js} +1 -1
  110. package/dist/standalone/{chunk-K3GNLVYK.js → chunk-UKDJ4H7I.js} +1 -1
  111. package/dist/standalone/chunk-V6IWFYAQ.js +1 -0
  112. package/dist/standalone/{chunk-BQUQS7QN.js → chunk-V7SRH36W.js} +1 -1
  113. package/dist/standalone/chunk-VON7JUPG.js +1 -0
  114. package/dist/standalone/{chunk-X5P2WRYI.js → chunk-WPNXY7IS.js} +1 -1
  115. package/dist/standalone/{chunk-PZ7HD5T2.js → chunk-X33MSJPP.js} +1 -1
  116. package/dist/standalone/{chunk-BI35RXKQ.js → chunk-XRNXOIVZ.js} +1 -1
  117. package/dist/standalone/{chunk-TDL7NEWA.js → chunk-YBGC4PPD.js} +1 -1
  118. package/dist/standalone/{chunk-XLQ4BHBD.js → chunk-YNZ7ARWW.js} +1 -1
  119. package/dist/standalone/{chunk-SLKF2L74.js → chunk-YTO65GHS.js} +1 -1
  120. package/dist/standalone/{chunk-6WRZP62V.js → chunk-ZE6FT5Z3.js} +1 -1
  121. package/dist/standalone/studio.js +31 -31
  122. package/dist/styles.css +1 -1
  123. package/package.json +4 -4
  124. package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
  125. package/dist/standalone/chunk-22W5VKZ6.js +0 -1
  126. package/dist/standalone/chunk-2GGMGPEP.js +0 -1
  127. package/dist/standalone/chunk-7VF3IAAW.js +0 -2
  128. package/dist/standalone/chunk-BACPICH6.js +0 -1
  129. package/dist/standalone/chunk-DORBUITF.js +0 -1
  130. package/dist/standalone/chunk-EUIHTPKI.js +0 -1
  131. package/dist/standalone/chunk-IOFMK4D7.js +0 -1
  132. package/dist/standalone/chunk-LI43EKM6.js +0 -1
  133. package/dist/standalone/chunk-MPYFGAOW.js +0 -1
  134. package/dist/standalone/chunk-NKJDGOM3.js +0 -1
  135. package/dist/standalone/chunk-OY3GVYS7.js +0 -4
  136. package/dist/standalone/chunk-PN5NCZDX.js +0 -1
  137. package/dist/standalone/chunk-RSEEHNFI.js +0 -1
  138. package/dist/standalone/chunk-X7MMBSNW.js +0 -1
  139. package/dist/standalone/chunk-XUGSA2NG.js +0 -1
  140. package/dist/standalone/chunk-ZYRGPDZB.js +0 -1
@@ -6,141 +6,607 @@ import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
6
6
  import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
7
7
  import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
8
8
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
9
- import { a as useClientQuery } from '../packem_shared/use-admin-query-BHPKmPuj.js';
10
- import { u as useAuthCapabilities } from '../packem_shared/use-auth-capabilities-C-VH0oJJ.js';
9
+ import { a as useClientQuery } from '../packem_shared/use-admin-query-CfHYWx5n.js';
10
+ import { c } from 'react/compiler-runtime';
11
+ import { a as useAuthConfig, u as useAsyncSubmit } from '../packem_shared/use-async-submit-DJQiPc-_.js';
11
12
  import { useAutoRefresh } from '../packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
12
13
  import useDebounced from '../packem_shared/useDebounced-Dxncpg6z.js';
13
14
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
14
- import { f as fireAndForget, e as errorMessage, i as formatTimestamp, h as formatCell } from '../packem_shared/internal-DTsYVn-g.js';
15
+ import { i as formatTimestamp, h as formatCell, f as fireAndForget, e as errorMessage } from '../packem_shared/internal-CYcbqMjX.js';
16
+ import { C as Checkbox } from '../packem_shared/checkbox-UNkzAxl-.js';
15
17
  import { L as Label } from '../packem_shared/label-D8ykjn5J.js';
16
18
  import { M as ModalShell } from '../packem_shared/modal-shell-hyaJvIJ6.js';
17
19
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
18
- import { c } from 'react/compiler-runtime';
19
20
 
20
- const UserCreateDialog = ({
21
- onClose,
22
- onCreated
23
- }) => {
21
+ const useAuthCapabilities = () => {
22
+ const $ = c(3);
23
+ const {
24
+ config,
25
+ ready
26
+ } = useAuthConfig();
27
+ let t0;
28
+ if ($[0] !== config.capabilities || $[1] !== ready) {
29
+ t0 = {
30
+ capabilities: config.capabilities,
31
+ ready
32
+ };
33
+ $[0] = config.capabilities;
34
+ $[1] = ready;
35
+ $[2] = t0;
36
+ } else {
37
+ t0 = $[2];
38
+ }
39
+ return t0;
40
+ };
41
+
42
+ const INPUT_TYPE_BY_FIELD = {
43
+ boolean: "checkbox",
44
+ date: "datetime-local",
45
+ number: "number",
46
+ string: "text"
47
+ };
48
+ const isFieldFilled = (field, value) => {
49
+ if (field.type === "boolean") {
50
+ return true;
51
+ }
52
+ if (typeof value !== "string" || value.trim() === "") {
53
+ return false;
54
+ }
55
+ return field.type !== "number" || !Number.isNaN(Number(value.trim()));
56
+ };
57
+ const coerceFieldValue = (field, raw) => {
58
+ if (field.type === "boolean") {
59
+ if (raw === true) {
60
+ return {
61
+ value: true
62
+ };
63
+ }
64
+ return field.required ? {
65
+ value: false
66
+ } : void 0;
67
+ }
68
+ const text = typeof raw === "string" ? raw.trim() : "";
69
+ if (text === "") {
70
+ return void 0;
71
+ }
72
+ if (field.type === "number") {
73
+ const numeric = Number(text);
74
+ return Number.isNaN(numeric) ? void 0 : {
75
+ value: numeric
76
+ };
77
+ }
78
+ return {
79
+ value: text
80
+ };
81
+ };
82
+ const UserCreateDialog = (t0) => {
83
+ const $ = c(105);
84
+ const {
85
+ onClose,
86
+ onCreated
87
+ } = t0;
24
88
  const client = useLunora();
25
89
  const t = useT();
90
+ const {
91
+ config
92
+ } = useAuthConfig();
93
+ const {
94
+ busy,
95
+ error,
96
+ run
97
+ } = useAsyncSubmit();
26
98
  const [email, setEmail] = useState("");
27
99
  const [name, setName] = useState("");
28
100
  const [password, setPassword] = useState("");
29
101
  const [role, setRole] = useState("");
30
- const [busy, setBusy] = useState(false);
31
- const [error, setError] = useState(null);
32
- const onEmailChange = (event) => {
33
- setEmail(event.target.value);
34
- };
35
- const onNameChange = (event_0) => {
36
- setName(event_0.target.value);
37
- };
38
- const onPasswordChange = (event_1) => {
39
- setPassword(event_1.target.value);
40
- };
41
- const onRoleChange = (event_2) => {
42
- setRole(event_2.target.value);
43
- };
44
- const submit = async () => {
45
- setBusy(true);
46
- setError(null);
47
- try {
48
- await client.createAuthUser({
49
- email: email.trim(),
50
- name: name.trim(),
51
- password: password === "" ? void 0 : password,
52
- role: role.trim() === "" ? void 0 : role.trim()
53
- });
54
- onCreated();
55
- onClose();
56
- } catch (error_) {
57
- setError(errorMessage(error_));
58
- } finally {
59
- setBusy(false);
102
+ let t1;
103
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
104
+ t1 = {};
105
+ $[0] = t1;
106
+ } else {
107
+ t1 = $[0];
108
+ }
109
+ const [fieldValues, setFieldValues] = useState(t1);
110
+ let t2;
111
+ if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
112
+ t2 = (event) => {
113
+ setEmail(event.target.value);
114
+ };
115
+ $[1] = t2;
116
+ } else {
117
+ t2 = $[1];
118
+ }
119
+ const onEmailChange = t2;
120
+ let t3;
121
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
122
+ t3 = (event_0) => {
123
+ setName(event_0.target.value);
124
+ };
125
+ $[2] = t3;
126
+ } else {
127
+ t3 = $[2];
128
+ }
129
+ const onNameChange = t3;
130
+ let t4;
131
+ if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
132
+ t4 = (event_1) => {
133
+ setPassword(event_1.target.value);
134
+ };
135
+ $[3] = t4;
136
+ } else {
137
+ t4 = $[3];
138
+ }
139
+ const onPasswordChange = t4;
140
+ let t5;
141
+ if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
142
+ t5 = (event_2) => {
143
+ setRole(event_2.target.value);
144
+ };
145
+ $[4] = t5;
146
+ } else {
147
+ t5 = $[4];
148
+ }
149
+ const onRoleChange = t5;
150
+ let t6;
151
+ if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
152
+ t6 = (fieldName, value) => {
153
+ setFieldValues((previous) => ({
154
+ ...previous,
155
+ [fieldName]: value
156
+ }));
157
+ };
158
+ $[5] = t6;
159
+ } else {
160
+ t6 = $[5];
161
+ }
162
+ const setFieldValue = t6;
163
+ let t7;
164
+ if ($[6] !== fieldValues) {
165
+ t7 = (field) => fieldValues[field.name] ?? (field.type === "boolean" ? false : "");
166
+ $[6] = fieldValues;
167
+ $[7] = t7;
168
+ } else {
169
+ t7 = $[7];
170
+ }
171
+ const fieldValue = t7;
172
+ let t8;
173
+ if ($[8] !== config.userFields || $[9] !== fieldValue) {
174
+ let t92;
175
+ if ($[11] !== fieldValue) {
176
+ t92 = (field_0) => !field_0.required || isFieldFilled(field_0, fieldValue(field_0));
177
+ $[11] = fieldValue;
178
+ $[12] = t92;
179
+ } else {
180
+ t92 = $[12];
60
181
  }
61
- };
62
- const onSubmit = () => {
63
- fireAndForget(submit());
64
- };
65
- return /* @__PURE__ */ jsxDEV(ModalShell, {
66
- label: t("Create user"),
67
- onClose,
68
- panelTestId: "uc-dialog",
69
- testId: "uc-overlay",
70
- variant: "dialog",
71
- children: [/* @__PURE__ */ jsxDEV("h2", {
182
+ t8 = config.userFields.every(t92);
183
+ $[8] = config.userFields;
184
+ $[9] = fieldValue;
185
+ $[10] = t8;
186
+ } else {
187
+ t8 = $[10];
188
+ }
189
+ const requiredFieldsFilled = t8;
190
+ let t9;
191
+ if ($[13] !== busy || $[14] !== email || $[15] !== name || $[16] !== requiredFieldsFilled) {
192
+ t9 = !busy && email.trim() !== "" && name.trim() !== "" && requiredFieldsFilled;
193
+ $[13] = busy;
194
+ $[14] = email;
195
+ $[15] = name;
196
+ $[16] = requiredFieldsFilled;
197
+ $[17] = t9;
198
+ } else {
199
+ t9 = $[17];
200
+ }
201
+ const canSubmit = t9;
202
+ let t10;
203
+ if ($[18] !== config.userFields || $[19] !== fieldValue) {
204
+ t10 = () => {
205
+ const data = {};
206
+ for (const field_1 of config.userFields) {
207
+ const coerced = coerceFieldValue(field_1, fieldValue(field_1));
208
+ if (coerced !== void 0) {
209
+ data[field_1.name] = coerced.value;
210
+ }
211
+ }
212
+ return Object.keys(data).length === 0 ? void 0 : data;
213
+ };
214
+ $[18] = config.userFields;
215
+ $[19] = fieldValue;
216
+ $[20] = t10;
217
+ } else {
218
+ t10 = $[20];
219
+ }
220
+ const buildData = t10;
221
+ let t11;
222
+ if ($[21] !== buildData || $[22] !== client || $[23] !== email || $[24] !== name || $[25] !== onClose || $[26] !== onCreated || $[27] !== password || $[28] !== role || $[29] !== run) {
223
+ t11 = () => {
224
+ run(async () => {
225
+ await client.createAuthUser({
226
+ data: buildData(),
227
+ email: email.trim(),
228
+ name: name.trim(),
229
+ password: password === "" ? void 0 : password,
230
+ role: role.trim() === "" ? void 0 : role.trim()
231
+ });
232
+ onCreated();
233
+ onClose();
234
+ });
235
+ };
236
+ $[21] = buildData;
237
+ $[22] = client;
238
+ $[23] = email;
239
+ $[24] = name;
240
+ $[25] = onClose;
241
+ $[26] = onCreated;
242
+ $[27] = password;
243
+ $[28] = role;
244
+ $[29] = run;
245
+ $[30] = t11;
246
+ } else {
247
+ t11 = $[30];
248
+ }
249
+ const onSubmit = t11;
250
+ let t12;
251
+ if ($[31] !== t) {
252
+ t12 = t("Create user");
253
+ $[31] = t;
254
+ $[32] = t12;
255
+ } else {
256
+ t12 = $[32];
257
+ }
258
+ let t13;
259
+ if ($[33] !== t) {
260
+ t13 = t("Create user");
261
+ $[33] = t;
262
+ $[34] = t13;
263
+ } else {
264
+ t13 = $[34];
265
+ }
266
+ let t14;
267
+ if ($[35] !== t13) {
268
+ t14 = /* @__PURE__ */ jsxDEV("h2", {
72
269
  className: "text-sm font-semibold text-foreground",
73
- children: t("Create user")
74
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
270
+ children: t13
271
+ }, void 0, false);
272
+ $[35] = t13;
273
+ $[36] = t14;
274
+ } else {
275
+ t14 = $[36];
276
+ }
277
+ let t15;
278
+ if ($[37] !== t) {
279
+ t15 = t("email");
280
+ $[37] = t;
281
+ $[38] = t15;
282
+ } else {
283
+ t15 = $[38];
284
+ }
285
+ let t16;
286
+ if ($[39] !== t15) {
287
+ t16 = /* @__PURE__ */ jsxDEV(Label, {
288
+ htmlFor: "uc-email",
289
+ children: t15
290
+ }, void 0, false);
291
+ $[39] = t15;
292
+ $[40] = t16;
293
+ } else {
294
+ t16 = $[40];
295
+ }
296
+ let t17;
297
+ if ($[41] !== email) {
298
+ t17 = /* @__PURE__ */ jsxDEV(Input, {
299
+ "data-testid": "uc-email",
300
+ id: "uc-email",
301
+ onChange: onEmailChange,
302
+ type: "email",
303
+ value: email
304
+ }, void 0, false);
305
+ $[41] = email;
306
+ $[42] = t17;
307
+ } else {
308
+ t17 = $[42];
309
+ }
310
+ let t18;
311
+ if ($[43] !== t16 || $[44] !== t17) {
312
+ t18 = /* @__PURE__ */ jsxDEV("div", {
75
313
  className: "flex flex-col gap-1",
76
- children: [/* @__PURE__ */ jsxDEV(Label, {
77
- htmlFor: "uc-email",
78
- children: t("email")
79
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
80
- "data-testid": "uc-email",
81
- id: "uc-email",
82
- onChange: onEmailChange,
83
- type: "email",
84
- value: email
85
- }, void 0, false)]
86
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
314
+ children: [t16, t17]
315
+ }, void 0, true);
316
+ $[43] = t16;
317
+ $[44] = t17;
318
+ $[45] = t18;
319
+ } else {
320
+ t18 = $[45];
321
+ }
322
+ let t19;
323
+ if ($[46] !== t) {
324
+ t19 = t("name");
325
+ $[46] = t;
326
+ $[47] = t19;
327
+ } else {
328
+ t19 = $[47];
329
+ }
330
+ let t20;
331
+ if ($[48] !== t19) {
332
+ t20 = /* @__PURE__ */ jsxDEV(Label, {
333
+ htmlFor: "uc-name",
334
+ children: t19
335
+ }, void 0, false);
336
+ $[48] = t19;
337
+ $[49] = t20;
338
+ } else {
339
+ t20 = $[49];
340
+ }
341
+ let t21;
342
+ if ($[50] !== name) {
343
+ t21 = /* @__PURE__ */ jsxDEV(Input, {
344
+ "data-testid": "uc-name",
345
+ id: "uc-name",
346
+ onChange: onNameChange,
347
+ value: name
348
+ }, void 0, false);
349
+ $[50] = name;
350
+ $[51] = t21;
351
+ } else {
352
+ t21 = $[51];
353
+ }
354
+ let t22;
355
+ if ($[52] !== t20 || $[53] !== t21) {
356
+ t22 = /* @__PURE__ */ jsxDEV("div", {
87
357
  className: "flex flex-col gap-1",
88
- children: [/* @__PURE__ */ jsxDEV(Label, {
89
- htmlFor: "uc-name",
90
- children: t("name")
91
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
92
- "data-testid": "uc-name",
93
- id: "uc-name",
94
- onChange: onNameChange,
95
- value: name
96
- }, void 0, false)]
97
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
358
+ children: [t20, t21]
359
+ }, void 0, true);
360
+ $[52] = t20;
361
+ $[53] = t21;
362
+ $[54] = t22;
363
+ } else {
364
+ t22 = $[54];
365
+ }
366
+ let t23;
367
+ if ($[55] !== t) {
368
+ t23 = t("Password (optional)");
369
+ $[55] = t;
370
+ $[56] = t23;
371
+ } else {
372
+ t23 = $[56];
373
+ }
374
+ let t24;
375
+ if ($[57] !== t23) {
376
+ t24 = /* @__PURE__ */ jsxDEV(Label, {
377
+ htmlFor: "uc-password",
378
+ children: t23
379
+ }, void 0, false);
380
+ $[57] = t23;
381
+ $[58] = t24;
382
+ } else {
383
+ t24 = $[58];
384
+ }
385
+ let t25;
386
+ if ($[59] !== password) {
387
+ t25 = /* @__PURE__ */ jsxDEV(Input, {
388
+ "data-testid": "uc-password",
389
+ id: "uc-password",
390
+ onChange: onPasswordChange,
391
+ type: "password",
392
+ value: password
393
+ }, void 0, false);
394
+ $[59] = password;
395
+ $[60] = t25;
396
+ } else {
397
+ t25 = $[60];
398
+ }
399
+ let t26;
400
+ if ($[61] !== t24 || $[62] !== t25) {
401
+ t26 = /* @__PURE__ */ jsxDEV("div", {
98
402
  className: "flex flex-col gap-1",
99
- children: [/* @__PURE__ */ jsxDEV(Label, {
100
- htmlFor: "uc-password",
101
- children: t("Password (optional)")
102
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
103
- "data-testid": "uc-password",
104
- id: "uc-password",
105
- onChange: onPasswordChange,
106
- type: "password",
107
- value: password
108
- }, void 0, false)]
109
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
403
+ children: [t24, t25]
404
+ }, void 0, true);
405
+ $[61] = t24;
406
+ $[62] = t25;
407
+ $[63] = t26;
408
+ } else {
409
+ t26 = $[63];
410
+ }
411
+ let t27;
412
+ if ($[64] !== t) {
413
+ t27 = t("Role (optional)");
414
+ $[64] = t;
415
+ $[65] = t27;
416
+ } else {
417
+ t27 = $[65];
418
+ }
419
+ let t28;
420
+ if ($[66] !== t27) {
421
+ t28 = /* @__PURE__ */ jsxDEV(Label, {
422
+ htmlFor: "uc-role",
423
+ children: t27
424
+ }, void 0, false);
425
+ $[66] = t27;
426
+ $[67] = t28;
427
+ } else {
428
+ t28 = $[67];
429
+ }
430
+ let t29;
431
+ if ($[68] !== role) {
432
+ t29 = /* @__PURE__ */ jsxDEV(Input, {
433
+ "data-testid": "uc-role",
434
+ id: "uc-role",
435
+ onChange: onRoleChange,
436
+ value: role
437
+ }, void 0, false);
438
+ $[68] = role;
439
+ $[69] = t29;
440
+ } else {
441
+ t29 = $[69];
442
+ }
443
+ let t30;
444
+ if ($[70] !== t28 || $[71] !== t29) {
445
+ t30 = /* @__PURE__ */ jsxDEV("div", {
110
446
  className: "flex flex-col gap-1",
111
- children: [/* @__PURE__ */ jsxDEV(Label, {
112
- htmlFor: "uc-role",
113
- children: t("Role (optional)")
114
- }, void 0, false), /* @__PURE__ */ jsxDEV(Input, {
115
- "data-testid": "uc-role",
116
- id: "uc-role",
117
- onChange: onRoleChange,
118
- value: role
119
- }, void 0, false)]
120
- }, void 0, true), error !== null && /* @__PURE__ */ jsxDEV("p", {
447
+ children: [t28, t29]
448
+ }, void 0, true);
449
+ $[70] = t28;
450
+ $[71] = t29;
451
+ $[72] = t30;
452
+ } else {
453
+ t30 = $[72];
454
+ }
455
+ let t31;
456
+ if ($[73] !== config.userFields || $[74] !== fieldValue || $[75] !== t) {
457
+ t31 = config.userFields.length > 0 && /* @__PURE__ */ jsxDEV("div", {
458
+ className: "flex flex-col gap-3 border-t border-border pt-3",
459
+ "data-testid": "uc-plugin-fields",
460
+ children: [/* @__PURE__ */ jsxDEV("span", {
461
+ className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
462
+ children: t("Plugin fields")
463
+ }, void 0, false), config.userFields.map((field_2) => {
464
+ const inputId = `uc-field-${field_2.name}`;
465
+ const suffix = field_2.required ? "" : ` (${t("optional")})`;
466
+ if (field_2.type === "boolean") {
467
+ const checked = fieldValue(field_2) === true;
468
+ return /* @__PURE__ */ jsxDEV("label", {
469
+ className: "flex items-center gap-2",
470
+ htmlFor: inputId,
471
+ children: [/* @__PURE__ */ jsxDEV(Checkbox, {
472
+ checked,
473
+ "data-testid": inputId,
474
+ id: inputId,
475
+ onCheckedChange: (next) => {
476
+ setFieldValue(field_2.name, next);
477
+ }
478
+ }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
479
+ className: "text-sm",
480
+ children: [field_2.name, suffix]
481
+ }, void 0, true)]
482
+ }, field_2.name, true);
483
+ }
484
+ const value_0 = fieldValue(field_2);
485
+ return /* @__PURE__ */ jsxDEV("div", {
486
+ className: "flex flex-col gap-1",
487
+ children: [/* @__PURE__ */ jsxDEV(Label, {
488
+ htmlFor: inputId,
489
+ children: [field_2.name, suffix]
490
+ }, void 0, true), /* @__PURE__ */ jsxDEV(Input, {
491
+ "data-testid": inputId,
492
+ id: inputId,
493
+ onChange: (event_3) => {
494
+ setFieldValue(field_2.name, event_3.target.value);
495
+ },
496
+ type: INPUT_TYPE_BY_FIELD[field_2.type],
497
+ value: typeof value_0 === "string" ? value_0 : ""
498
+ }, void 0, false)]
499
+ }, field_2.name, true);
500
+ })]
501
+ }, void 0, true);
502
+ $[73] = config.userFields;
503
+ $[74] = fieldValue;
504
+ $[75] = t;
505
+ $[76] = t31;
506
+ } else {
507
+ t31 = $[76];
508
+ }
509
+ let t32;
510
+ if ($[77] !== error) {
511
+ t32 = error !== null && /* @__PURE__ */ jsxDEV("p", {
121
512
  className: "text-sm text-destructive",
122
513
  "data-testid": "uc-error",
123
514
  role: "alert",
124
515
  children: error
125
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
516
+ }, void 0, false);
517
+ $[77] = error;
518
+ $[78] = t32;
519
+ } else {
520
+ t32 = $[78];
521
+ }
522
+ let t33;
523
+ if ($[79] !== t) {
524
+ t33 = t("Cancel");
525
+ $[79] = t;
526
+ $[80] = t33;
527
+ } else {
528
+ t33 = $[80];
529
+ }
530
+ let t34;
531
+ if ($[81] !== onClose || $[82] !== t33) {
532
+ t34 = /* @__PURE__ */ jsxDEV(Button, {
533
+ "data-testid": "uc-cancel",
534
+ onClick: onClose,
535
+ size: "sm",
536
+ type: "button",
537
+ variant: "outline",
538
+ children: t33
539
+ }, void 0, false);
540
+ $[81] = onClose;
541
+ $[82] = t33;
542
+ $[83] = t34;
543
+ } else {
544
+ t34 = $[83];
545
+ }
546
+ const t35 = !canSubmit;
547
+ let t36;
548
+ if ($[84] !== busy || $[85] !== t) {
549
+ t36 = busy ? t("Creating…") : t("Create");
550
+ $[84] = busy;
551
+ $[85] = t;
552
+ $[86] = t36;
553
+ } else {
554
+ t36 = $[86];
555
+ }
556
+ let t37;
557
+ if ($[87] !== onSubmit || $[88] !== t35 || $[89] !== t36) {
558
+ t37 = /* @__PURE__ */ jsxDEV(Button, {
559
+ "data-testid": "uc-submit",
560
+ disabled: t35,
561
+ onClick: onSubmit,
562
+ size: "sm",
563
+ type: "button",
564
+ children: t36
565
+ }, void 0, false);
566
+ $[87] = onSubmit;
567
+ $[88] = t35;
568
+ $[89] = t36;
569
+ $[90] = t37;
570
+ } else {
571
+ t37 = $[90];
572
+ }
573
+ let t38;
574
+ if ($[91] !== t34 || $[92] !== t37) {
575
+ t38 = /* @__PURE__ */ jsxDEV("div", {
126
576
  className: "flex justify-end gap-2 pt-1",
127
- children: [/* @__PURE__ */ jsxDEV(Button, {
128
- "data-testid": "uc-cancel",
129
- onClick: onClose,
130
- size: "sm",
131
- type: "button",
132
- variant: "outline",
133
- children: t("Cancel")
134
- }, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
135
- "data-testid": "uc-submit",
136
- disabled: busy || email.trim() === "" || name.trim() === "",
137
- onClick: onSubmit,
138
- size: "sm",
139
- type: "button",
140
- children: busy ? t("Creating…") : t("Create")
141
- }, void 0, false)]
142
- }, void 0, true)]
143
- }, void 0, true);
577
+ children: [t34, t37]
578
+ }, void 0, true);
579
+ $[91] = t34;
580
+ $[92] = t37;
581
+ $[93] = t38;
582
+ } else {
583
+ t38 = $[93];
584
+ }
585
+ let t39;
586
+ if ($[94] !== onClose || $[95] !== t12 || $[96] !== t14 || $[97] !== t18 || $[98] !== t22 || $[99] !== t26 || $[100] !== t30 || $[101] !== t31 || $[102] !== t32 || $[103] !== t38) {
587
+ t39 = /* @__PURE__ */ jsxDEV(ModalShell, {
588
+ label: t12,
589
+ onClose,
590
+ panelTestId: "uc-dialog",
591
+ testId: "uc-overlay",
592
+ variant: "dialog",
593
+ children: [t14, t18, t22, t26, t30, t31, t32, t38]
594
+ }, void 0, true);
595
+ $[94] = onClose;
596
+ $[95] = t12;
597
+ $[96] = t14;
598
+ $[97] = t18;
599
+ $[98] = t22;
600
+ $[99] = t26;
601
+ $[100] = t30;
602
+ $[101] = t31;
603
+ $[102] = t32;
604
+ $[103] = t38;
605
+ $[104] = t39;
606
+ } else {
607
+ t39 = $[104];
608
+ }
609
+ return t39;
144
610
  };
145
611
 
146
612
  const SectionHeading = (t0) => {