@epam/ai-dial-builder-form 1.3.0-dev.13 → 1.3.0-dev.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,72 +1,72 @@
1
1
  import { ENTITY_DESCRIPTION_MAX_LENGTH as e, ENTITY_NAME_MAX_LENGTH as t, RESIZABLE_TEXTAREA_CLASS_NAME as n, TAG_INPUT_TAG_CLASS_NAME as r, buildCssVars as i, exceedsMaxLength as a, hasControlCharacters as o, mergeClasses as s } from "@epam/ai-dial-chat-shared";
2
- import { ButtonAppearance as c, ButtonVariant as l, DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, DangerIconButton as f, ElementSize as p, GhostButton as m, GhostIconButton as h, Input as g, Label as _, LinkButton as v, NeutralButton as y, Popup as b, PrimaryButton as x, Select as S, Spinner as C, TagInput as w, Textarea as T, TextareaResize as E } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
4
- import { IconArrowLeft as A, IconArrowNarrowLeft as j, IconPhoto as M, IconPlus as N, IconTrashX as P } from "@tabler/icons-react";
5
- import { Suspense as ee, memo as F, useCallback as I, useEffect as te, useId as ne, useLayoutEffect as L, useMemo as R, useRef as z, useState as B } from "react";
2
+ import { ButtonAppearance as c, ButtonVariant as l, DIAL_ICON_SIZE as u, DIAL_KIT_ICON_STROKE as d, DangerIconButton as f, ElementSize as p, GhostButton as m, GhostIconButton as h, Input as g, Label as _, LinkButton as v, NeutralButton as y, Popup as b, PrimaryButton as x, ResizeHandle as S, Select as C, Spinner as w, TagInput as T, Textarea as E, TextareaResize as D } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
4
+ import { IconArrowLeft as j, IconArrowNarrowLeft as M, IconPhoto as N, IconPlus as P, IconTrashX as F } from "@tabler/icons-react";
5
+ import { Suspense as ee, memo as I, useCallback as L, useEffect as te, useId as R, useLayoutEffect as z, useMemo as B, useRef as V, useState as H } from "react";
6
6
  //#region src/components/BuilderFormActions/BuilderFormActions.tsx
7
- var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: o }) => /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(y, {
7
+ var U = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: o }) => /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(y, {
8
8
  label: e.cancelButtonLabel,
9
9
  onClick: t,
10
10
  disabled: r,
11
11
  className: o
12
- }), /* @__PURE__ */ O(x, {
12
+ }), /* @__PURE__ */ k(x, {
13
13
  label: e.submitButtonLabel,
14
14
  onClick: n,
15
15
  disabled: i,
16
16
  "aria-busy": a,
17
17
  className: o,
18
- iconBefore: a ? /* @__PURE__ */ O("span", {
18
+ iconBefore: a ? /* @__PURE__ */ k("span", {
19
19
  "aria-hidden": !0,
20
- children: /* @__PURE__ */ O(C, { size: u.SM })
20
+ children: /* @__PURE__ */ k(w, { size: u.SM })
21
21
  }) : void 0
22
- })] }), H = {
22
+ })] }), W = {
23
23
  body: "_body_1xd7h_2",
24
24
  sideColumn: "_sideColumn_1xd7h_6",
25
25
  reservedColumn: "_reservedColumn_1xd7h_10"
26
- }, U = s("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", H.sideColumn), re = ({ left: e, children: t, metadata: n, layout: r }) => {
26
+ }, G = s("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", W.sideColumn), K = ({ left: e, children: t, metadata: n, layout: r }) => {
27
27
  let i = e != null && n == null && r?.reserveEndColumn !== !1, a = r ? { "--bfb-side-column-width": r.sideColumnWidth ?? "400px" } : void 0, o = r ? { columnGap: r.columnGap ?? "0px" } : void 0;
28
- return /* @__PURE__ */ k("div", {
29
- className: s("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden", H.body),
28
+ return /* @__PURE__ */ A("div", {
29
+ className: s("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden", W.body),
30
30
  style: o,
31
31
  children: [
32
- e != null && /* @__PURE__ */ O("div", {
33
- className: U,
32
+ e != null && /* @__PURE__ */ k("div", {
33
+ className: G,
34
34
  style: a,
35
35
  children: e
36
36
  }),
37
- /* @__PURE__ */ O("div", {
37
+ /* @__PURE__ */ k("div", {
38
38
  className: "flex w-full min-w-0 flex-1 flex-col desktop:min-h-0 desktop:overflow-y-auto",
39
39
  children: t
40
40
  }),
41
- n != null && /* @__PURE__ */ O("div", {
42
- className: U,
41
+ n != null && /* @__PURE__ */ k("div", {
42
+ className: G,
43
43
  style: a,
44
44
  children: n
45
45
  }),
46
- i && /* @__PURE__ */ O("div", {
46
+ i && /* @__PURE__ */ k("div", {
47
47
  "aria-hidden": !0,
48
48
  style: a,
49
- className: s(H.reservedColumn, H.sideColumn)
49
+ className: s(W.reservedColumn, W.sideColumn)
50
50
  })
51
51
  ]
52
52
  });
53
- }, W = {
53
+ }, q = {
54
54
  header: "_header_lon83_4",
55
55
  actions: "_actions_lon83_18",
56
56
  title: "_title_lon83_27"
57
- }, ie = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, styles: f }) => {
58
- let { colors: p, typography: m } = f ?? {}, g = m?.fontClassName ?? "dial-h1-text", _ = !!m?.fontClassName;
59
- return /* @__PURE__ */ k("div", {
60
- style: i({
61
- "--bfh-border": p?.borderColor,
62
- "--bfh-font-family": _ ? void 0 : m?.fontFamily
63
- }),
64
- className: s("flex min-h-16 shrink-0 items-center justify-between gap-2 px-4 py-2 desktop:h-16 desktop:flex-nowrap desktop:px-8 desktop:py-0", W.header),
57
+ }, ne = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, styles: f }) => {
58
+ let { colors: p, typography: m } = f ?? {}, g = m?.fontClassName ?? "dial-h1-text", _ = !!m?.fontClassName, v = i({
59
+ "--bfh-border": p?.borderColor,
60
+ "--bfh-font-family": _ ? void 0 : m?.fontFamily
61
+ });
62
+ return /* @__PURE__ */ A("div", {
63
+ style: v,
64
+ className: s("flex min-h-16 shrink-0 items-center justify-between gap-2 px-4 py-2 desktop:h-16 desktop:flex-nowrap desktop:px-8 desktop:py-0", q.header),
65
65
  children: [
66
- /* @__PURE__ */ k("div", {
66
+ /* @__PURE__ */ A("div", {
67
67
  className: "flex min-w-0 flex-1 items-center gap-2",
68
- children: [/* @__PURE__ */ O(h, {
69
- icon: l === void 0 ? /* @__PURE__ */ O(A, {
68
+ children: [/* @__PURE__ */ k(h, {
69
+ icon: l === void 0 ? /* @__PURE__ */ k(j, {
70
70
  size: u.LG,
71
71
  className: "rtl:scale-x-[-1]",
72
72
  "aria-hidden": !0,
@@ -74,14 +74,14 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
74
74
  }) : l,
75
75
  "aria-label": e.backButtonLabel,
76
76
  onClick: t
77
- }), /* @__PURE__ */ O("h1", {
78
- className: s("truncate", W.title, g),
77
+ }), /* @__PURE__ */ k("h1", {
78
+ className: s("truncate", q.title, g),
79
79
  children: e.title
80
80
  })]
81
81
  }),
82
- /* @__PURE__ */ O("div", {
83
- className: s("items-center gap-2", W.actions),
84
- children: /* @__PURE__ */ O(V, {
82
+ /* @__PURE__ */ k("div", {
83
+ className: s("items-center gap-2", q.actions),
84
+ children: /* @__PURE__ */ k(U, {
85
85
  labels: e,
86
86
  onCancel: n,
87
87
  onSubmit: r,
@@ -90,7 +90,7 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
90
90
  isSubmitting: c
91
91
  })
92
92
  }),
93
- /* @__PURE__ */ O("span", {
93
+ /* @__PURE__ */ k("span", {
94
94
  role: "status",
95
95
  "aria-live": "polite",
96
96
  className: "sr-only",
@@ -98,19 +98,19 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
98
98
  })
99
99
  ]
100
100
  });
101
- }, G = {
101
+ }, J = {
102
102
  container: "_container_14mfe_1",
103
103
  footer: "_footer_14mfe_10"
104
- }, K = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, className: u, left: d, children: f, metadata: p, layout: m, styles: h }) => {
104
+ }, re = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, className: u, left: d, children: f, metadata: p, layout: m, styles: h }) => {
105
105
  let { colors: g, header: _, cssVars: v } = h ?? {};
106
- return /* @__PURE__ */ k("div", {
106
+ return /* @__PURE__ */ A("div", {
107
107
  style: {
108
108
  ...i({ "--bfc-bg": g?.background }),
109
109
  ...v
110
110
  },
111
- className: s("flex h-full min-h-0 w-full flex-col overflow-hidden", u, G.container),
111
+ className: s("flex h-full min-h-0 w-full flex-col overflow-hidden", u, J.container),
112
112
  children: [
113
- /* @__PURE__ */ O(ie, {
113
+ /* @__PURE__ */ k(ne, {
114
114
  labels: e,
115
115
  onBack: t,
116
116
  onCancel: n,
@@ -121,15 +121,15 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
121
121
  backIcon: l,
122
122
  styles: _
123
123
  }),
124
- /* @__PURE__ */ O(re, {
124
+ /* @__PURE__ */ k(K, {
125
125
  left: d,
126
126
  metadata: p,
127
127
  layout: m,
128
128
  children: f
129
129
  }),
130
- /* @__PURE__ */ O("div", {
131
- className: s("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm", G.footer),
132
- children: /* @__PURE__ */ O(V, {
130
+ /* @__PURE__ */ k("div", {
131
+ className: s("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm", J.footer),
132
+ children: /* @__PURE__ */ k(U, {
133
133
  labels: e,
134
134
  onCancel: n,
135
135
  onSubmit: r,
@@ -141,55 +141,69 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
141
141
  })
142
142
  ]
143
143
  });
144
- }, q = {
144
+ }, Y = {
145
145
  layout: "dial-builder-form-layout",
146
146
  section: "dial-builder-form-section",
147
147
  metadataSection: "dial-builder-form-metadata-section",
148
148
  setupSection: "dial-builder-form-setup-section",
149
149
  asideSection: "dial-builder-form-aside-section"
150
- }, J = {
150
+ }, ie = {
151
151
  section: "_section_l1mnx_1",
152
152
  title: "_title_l1mnx_5"
153
- }, Y = ({ title: e, children: t, styles: n, className: r }) => {
153
+ }, X = ({ title: e, children: t, styles: n, className: r }) => {
154
154
  let a = i({
155
155
  "--es-border-color": n?.colors?.borderColor,
156
156
  "--es-title-color": n?.colors?.titleColor
157
157
  });
158
- return /* @__PURE__ */ k("section", {
159
- className: s("flex h-full flex-col gap-4 rounded border p-6", J.section, r, q.section),
158
+ return /* @__PURE__ */ A("section", {
159
+ className: s("flex h-full flex-col gap-4 rounded border p-6", ie.section, r, Y.section),
160
160
  style: a,
161
- children: [e != null && /* @__PURE__ */ O("h2", {
162
- className: s("dial-h3-text", J.title),
161
+ children: [e != null && /* @__PURE__ */ k("h2", {
162
+ className: s("dial-h3-text", ie.title),
163
163
  children: e
164
164
  }), t]
165
165
  });
166
- }, X = {
166
+ }, ae = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
167
+ let i = r != null && r > 0 ? r - 360 : n;
168
+ return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
169
+ }, Z = {
167
170
  headerBorder: "_headerBorder_1adw2_1",
168
171
  footerBorder: "_footerBorder_1adw2_5",
169
172
  columnBorder: "_columnBorder_1adw2_10"
170
- }, ae = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: a, centerContent: o, rightContent: c, isSaving: l = !1, labels: f, styles: p, dir: m }) => {
171
- let g = ne(), _ = l ? f?.savingStatusLabel ?? "Saving" : "", v = i({
172
- "--el-header-border-color": p?.colors?.headerBorderColor,
173
- "--el-sidebar-border-color": p?.colors?.sidebarBorderColor
173
+ }, oe = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: a, centerContent: o, rightContent: c, resizableLeftColumn: l, isSaving: f = !1, labels: p, styles: m, dir: g }) => {
174
+ let _ = R(), v = f ? p?.savingStatusLabel ?? "Saving" : "", y = V(null), [b, x] = H(), C = l != null && o != null, w = l?.minWidth, T = l?.maxWidth, E = {
175
+ min: w,
176
+ max: T,
177
+ containerWidth: b
178
+ }, D = C ? ae(l.width, E) : void 0, O = ae(T ?? 640, E);
179
+ te(() => {
180
+ let e = y.current;
181
+ if (!C || e == null || typeof ResizeObserver > "u") return;
182
+ let t = new ResizeObserver(() => x(e.clientWidth));
183
+ return t.observe(e), () => t.disconnect();
184
+ }, [C]);
185
+ let j = i({
186
+ "--el-header-border-color": m?.colors?.headerBorderColor,
187
+ "--el-sidebar-border-color": m?.colors?.sidebarBorderColor
174
188
  });
175
- return /* @__PURE__ */ k("div", {
176
- dir: m,
177
- className: s("flex min-h-0 flex-1 flex-col", q.layout),
178
- style: v,
189
+ return /* @__PURE__ */ A("div", {
190
+ dir: g,
191
+ className: s("flex min-h-0 flex-1 flex-col", Y.layout),
192
+ style: j,
179
193
  children: [
180
- /* @__PURE__ */ O("span", {
194
+ /* @__PURE__ */ k("span", {
181
195
  role: "status",
182
196
  "aria-live": "polite",
183
197
  className: "sr-only",
184
- id: g,
185
- children: _
198
+ id: _,
199
+ children: v
186
200
  }),
187
- /* @__PURE__ */ k("div", {
188
- className: s("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", X.headerBorder),
189
- children: [/* @__PURE__ */ k("div", {
201
+ /* @__PURE__ */ A("div", {
202
+ className: s("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", Z.headerBorder),
203
+ children: [/* @__PURE__ */ A("div", {
190
204
  className: "flex min-w-0 flex-1 items-center gap-2",
191
- children: [/* @__PURE__ */ O(h, {
192
- icon: /* @__PURE__ */ O(j, {
205
+ children: [/* @__PURE__ */ k(h, {
206
+ icon: /* @__PURE__ */ k(M, {
193
207
  size: u.LG,
194
208
  stroke: d,
195
209
  "aria-hidden": !0,
@@ -197,71 +211,85 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
197
211
  }),
198
212
  "aria-label": n,
199
213
  onClick: t
200
- }), /* @__PURE__ */ O("h1", {
214
+ }), /* @__PURE__ */ k("h1", {
201
215
  className: "dial-h2-text min-w-0 truncate",
202
216
  children: e
203
217
  })]
204
- }), r != null && /* @__PURE__ */ O("div", {
218
+ }), r != null && /* @__PURE__ */ k("div", {
205
219
  className: "hidden shrink-0 items-center gap-2 desktop:flex",
206
220
  children: r
207
221
  })]
208
222
  }),
209
- /* @__PURE__ */ k("div", {
223
+ /* @__PURE__ */ A("div", {
224
+ ref: y,
210
225
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
211
226
  children: [
212
- /* @__PURE__ */ O("div", {
213
- className: s(o == null ? "desktop:flex-1" : "desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", o == null ? void 0 : X.columnBorder),
227
+ /* @__PURE__ */ k("div", {
228
+ className: s(o == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", o != null && !C && "desktop:w-[400px]", C && "desktop:relative desktop:w-[var(--el-left-width)]", "desktop:overflow-y-auto", o == null ? void 0 : Z.columnBorder),
229
+ style: D == null ? void 0 : { "--el-left-width": `${D}px` },
214
230
  children: a
215
231
  }),
216
- o != null && /* @__PURE__ */ O("div", {
232
+ C && D != null && /* @__PURE__ */ k("div", {
233
+ className: "relative hidden w-0 shrink-0 desktop:block",
234
+ children: /* @__PURE__ */ k(S, {
235
+ width: D,
236
+ minWidth: w ?? 280,
237
+ maxWidth: O,
238
+ defaultWidth: l.defaultWidth ?? 400,
239
+ onWidthChange: l.onWidthChange,
240
+ label: p?.resizeHandleLabel ?? "Resize columns",
241
+ tooltip: p?.resizeHandleTooltip ?? "Drag to resize"
242
+ })
243
+ }),
244
+ o != null && /* @__PURE__ */ k("div", {
217
245
  className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
218
246
  children: o
219
247
  }),
220
- c != null && /* @__PURE__ */ O("div", {
221
- className: s("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", X.columnBorder),
248
+ c != null && /* @__PURE__ */ k("div", {
249
+ className: s("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", Z.columnBorder),
222
250
  children: c
223
251
  })
224
252
  ]
225
253
  }),
226
- r != null && /* @__PURE__ */ O("div", {
227
- className: s("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", X.footerBorder),
254
+ r != null && /* @__PURE__ */ k("div", {
255
+ className: s("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", Z.footerBorder),
228
256
  children: r
229
257
  })
230
258
  ]
231
259
  });
232
- }, Z = {
260
+ }, se = {
233
261
  box: "_box_c9as8_1",
234
262
  icon: "_icon_c9as8_6",
235
263
  caption: "_caption_c9as8_10"
236
- }, oe = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: a = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: o, styles: c, className: l }) => {
264
+ }, ce = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: a = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: o, styles: c, className: l }) => {
237
265
  let f = i({
238
266
  "--aa-box-bg": c?.colors?.boxBackgroundColor,
239
267
  "--aa-box-border": c?.colors?.boxBorderColor,
240
268
  "--aa-icon": c?.colors?.placeholderIconColor,
241
269
  "--aa-caption": c?.colors?.captionColor
242
270
  });
243
- return /* @__PURE__ */ k("div", {
271
+ return /* @__PURE__ */ A("div", {
244
272
  className: s("flex flex-col gap-2", l),
245
273
  style: f,
246
- children: [/* @__PURE__ */ O(_, { label: e }), /* @__PURE__ */ k("div", {
274
+ children: [/* @__PURE__ */ k(_, { label: e }), /* @__PURE__ */ A("div", {
247
275
  className: "flex items-start gap-3",
248
- children: [/* @__PURE__ */ O("div", {
249
- className: s("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Z.box),
250
- children: t ? /* @__PURE__ */ O("img", {
276
+ children: [/* @__PURE__ */ k("div", {
277
+ className: s("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", se.box),
278
+ children: t ? /* @__PURE__ */ k("img", {
251
279
  src: t,
252
280
  alt: n,
253
281
  className: "h-16 w-16 object-cover"
254
- }) : /* @__PURE__ */ O(M, {
282
+ }) : /* @__PURE__ */ k(N, {
255
283
  size: u.LG,
256
284
  stroke: d,
257
285
  "aria-hidden": !0,
258
- className: Z.icon
286
+ className: se.icon
259
287
  })
260
- }), /* @__PURE__ */ k("div", {
288
+ }), /* @__PURE__ */ A("div", {
261
289
  className: "flex flex-col gap-3",
262
- children: [/* @__PURE__ */ O(m, {
290
+ children: [/* @__PURE__ */ k(m, {
263
291
  size: p.Small,
264
- iconBefore: /* @__PURE__ */ O(N, {
292
+ iconBefore: /* @__PURE__ */ k(P, {
265
293
  size: u.SM,
266
294
  stroke: d,
267
295
  "aria-hidden": !0
@@ -269,33 +297,33 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
269
297
  className: "w-fit",
270
298
  label: r,
271
299
  onClick: o
272
- }), /* @__PURE__ */ O("span", {
273
- className: s("dial-tiny-text", Z.caption),
300
+ }), /* @__PURE__ */ k("span", {
301
+ className: s("dial-tiny-text", se.caption),
274
302
  children: a
275
303
  })]
276
304
  })]
277
305
  })]
278
306
  });
279
- }, se = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
280
- let c = I((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = I((e) => /* @__PURE__ */ O("div", {
307
+ }, le = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
308
+ let c = L((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = L((e) => /* @__PURE__ */ k("div", {
281
309
  className: "dial-small-text px-6 py-3",
282
- children: /* @__PURE__ */ O("p", {
310
+ children: /* @__PURE__ */ k("p", {
283
311
  className: "mb-3 text-secondary",
284
- children: e.length === 1 ? /* @__PURE__ */ k(D, { children: [
312
+ children: e.length === 1 ? /* @__PURE__ */ A(O, { children: [
285
313
  s.deleteConfirmSingleText,
286
314
  " ",
287
- /* @__PURE__ */ k("span", {
288
- className: "break-words text-primary",
315
+ /* @__PURE__ */ A("span", {
316
+ className: "wrap-break-word text-primary",
289
317
  children: [
290
318
  "\"",
291
319
  e[0].split("/").pop(),
292
320
  "\"?"
293
321
  ]
294
322
  })
295
- ] }) : /* @__PURE__ */ k(D, { children: [
323
+ ] }) : /* @__PURE__ */ A(O, { children: [
296
324
  s.deleteConfirmMultipleText,
297
325
  " ",
298
- /* @__PURE__ */ k("span", {
326
+ /* @__PURE__ */ A("span", {
299
327
  className: "text-primary",
300
328
  children: [
301
329
  e.length,
@@ -310,9 +338,9 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
310
338
  s.deleteConfirmMultipleText,
311
339
  s.deleteConfirmItemsLabel
312
340
  ]);
313
- return /* @__PURE__ */ O(ee, {
341
+ return /* @__PURE__ */ k(ee, {
314
342
  fallback: null,
315
- children: e && /* @__PURE__ */ O(i, {
343
+ children: e && /* @__PURE__ */ k(i, {
316
344
  isOpen: e,
317
345
  onClose: t,
318
346
  onAttach: n,
@@ -345,106 +373,106 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
345
373
  });
346
374
  }, Q = /* @__PURE__ */ function(e) {
347
375
  return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
348
- }({}), ce = [
376
+ }({}), ue = [
349
377
  "avatar",
350
378
  "name",
351
379
  "version",
352
380
  "description",
353
381
  "locales",
354
382
  "tags"
355
- ], le = (e, t, n) => ({
383
+ ], de = (e, t, n) => ({
356
384
  id: e,
357
385
  language: n.find((e) => !t.has(e.code))?.code ?? "",
358
386
  name: "",
359
387
  description: ""
360
- }), ue = ({ value: e, onChange: t, availableLocaleOptions: r = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: m = "dial-tiny-lead-text text-secondary" }) => {
361
- let { summaryLabel: h, addLabel: _, editLabel: y, popupTitle: x, addLocaleLabel: C, localeRowLabel: w = "Locale", languageLabel: D, nameLabel: A, namePlaceholder: j, descriptionLabel: M, descriptionPlaceholder: ee, deleteAriaLabel: F, cancelLabel: I = "Cancel", saveLabel: ne = "Save" } = i, [L, R] = B(!1), [V, H] = B([]), U = z(0);
388
+ }), fe = ({ value: e, onChange: t, availableLocaleOptions: r = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: m = "dial-tiny-lead-text text-secondary" }) => {
389
+ let { summaryLabel: h, addLabel: _, editLabel: y, popupTitle: x, addLocaleLabel: S, localeRowLabel: w = "Locale", languageLabel: T, nameLabel: O, namePlaceholder: j, descriptionLabel: M, descriptionPlaceholder: N, deleteAriaLabel: ee, cancelLabel: I = "Cancel", saveLabel: L = "Save" } = i, [R, z] = H(!1), [B, U] = H([]), W = V(0);
362
390
  te(() => {
363
- L && H(e.length > 0 ? e : [le(`locale-row-${++U.current}`, /* @__PURE__ */ new Set(), r)]);
391
+ R && U(e.length > 0 ? e : [de(`locale-row-${++W.current}`, /* @__PURE__ */ new Set(), r)]);
364
392
  }, [
365
- L,
393
+ R,
366
394
  e,
367
395
  r
368
396
  ]);
369
- let re = () => R(!0), W = () => R(!1), ie = () => {
370
- t(V.filter((e) => e.language && e.name)), R(!1);
371
- }, G = () => {
372
- let e = new Set(V.map((e) => e.language).filter(Boolean));
373
- H((t) => [...t, le(`locale-row-${++U.current}`, e, r)]);
374
- }, K = (e, t) => {
375
- H((n) => n.map((n) => n.id === e ? {
397
+ let G = () => z(!0), K = () => z(!1), q = () => {
398
+ t(B.filter((e) => e.language && e.name)), z(!1);
399
+ }, ne = () => {
400
+ let e = new Set(B.map((e) => e.language).filter(Boolean));
401
+ U((t) => [...t, de(`locale-row-${++W.current}`, e, r)]);
402
+ }, J = (e, t) => {
403
+ U((n) => n.map((n) => n.id === e ? {
376
404
  ...n,
377
405
  ...t
378
406
  } : n));
379
- }, q = (e) => {
380
- H((t) => t.filter((t) => t.id !== e));
381
- }, J = (e) => r.find((t) => t.code === e)?.label ?? e.toUpperCase(), Y = V.some((e) => !e.language || !e.name);
382
- return r.length === 0 ? null : /* @__PURE__ */ k("div", {
407
+ }, re = (e) => {
408
+ U((t) => t.filter((t) => t.id !== e));
409
+ }, Y = (e) => r.find((t) => t.code === e)?.label ?? e.toUpperCase(), ie = B.some((e) => !e.language || !e.name);
410
+ return r.length === 0 ? null : /* @__PURE__ */ A("div", {
383
411
  className: s("flex items-center gap-2", a),
384
412
  children: [
385
- e.length > 0 && /* @__PURE__ */ O("span", {
413
+ e.length > 0 && /* @__PURE__ */ k("span", {
386
414
  className: o,
387
- children: `${h}: ${e.map((e) => `[${J(e.language)}]`).join(", ")}`
415
+ children: `${h}: ${e.map((e) => `[${Y(e.language)}]`).join(", ")}`
388
416
  }),
389
- /* @__PURE__ */ O(v, {
417
+ /* @__PURE__ */ k(v, {
390
418
  label: e.length > 0 ? y : _,
391
- iconBefore: /* @__PURE__ */ O(N, {
419
+ iconBefore: /* @__PURE__ */ k(P, {
392
420
  size: u.SM,
393
421
  "aria-hidden": !0,
394
422
  stroke: d
395
423
  }),
396
- className: "!px-0",
397
- onClick: re
424
+ className: "px-0!",
425
+ onClick: G
398
426
  }),
399
- /* @__PURE__ */ O(b, {
400
- open: L,
427
+ /* @__PURE__ */ k(b, {
428
+ open: R,
401
429
  header: x,
402
- onClose: W,
430
+ onClose: K,
403
431
  mainButtons: [{
404
432
  label: I,
405
- onClick: W
433
+ onClick: K
406
434
  }, {
407
- label: ne,
435
+ label: L,
408
436
  variant: l.Primary,
409
- disabled: Y,
410
- onClick: ie
437
+ disabled: ie,
438
+ onClick: q
411
439
  }],
412
- children: /* @__PURE__ */ k("div", {
440
+ children: /* @__PURE__ */ A("div", {
413
441
  className: "flex flex-col gap-8 px-6 py-3",
414
- children: [V.map((e, t) => {
415
- let i = new Set(V.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
416
- return /* @__PURE__ */ k("div", {
442
+ children: [B.map((e, t) => {
443
+ let i = new Set(B.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
444
+ return /* @__PURE__ */ A("div", {
417
445
  className: "flex flex-col gap-2",
418
- children: [/* @__PURE__ */ k("div", {
446
+ children: [/* @__PURE__ */ A("div", {
419
447
  className: "flex items-center justify-between",
420
- children: [/* @__PURE__ */ k("span", {
448
+ children: [/* @__PURE__ */ A("span", {
421
449
  className: m,
422
450
  children: [
423
451
  w,
424
452
  " ",
425
453
  t + 1
426
454
  ]
427
- }), /* @__PURE__ */ O(f, {
455
+ }), /* @__PURE__ */ k(f, {
428
456
  appearance: c.Ghost,
429
457
  size: p.Small,
430
- icon: /* @__PURE__ */ O(P, {
458
+ icon: /* @__PURE__ */ k(F, {
431
459
  size: u.SM,
432
460
  "aria-hidden": !0,
433
461
  stroke: d
434
462
  }),
435
- "aria-label": `${F} ${t + 1}`,
436
- onClick: () => q(e.id)
463
+ "aria-label": `${ee} ${t + 1}`,
464
+ onClick: () => re(e.id)
437
465
  })]
438
- }), /* @__PURE__ */ k("div", {
466
+ }), /* @__PURE__ */ A("div", {
439
467
  role: "group",
440
468
  "aria-label": `${w} ${t + 1}`,
441
469
  className: "flex flex-col gap-5",
442
- children: [/* @__PURE__ */ k("div", {
470
+ children: [/* @__PURE__ */ A("div", {
443
471
  className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
444
- children: [/* @__PURE__ */ O(S, {
472
+ children: [/* @__PURE__ */ k(C, {
445
473
  id: `${e.id}-language`,
446
474
  labelProps: {
447
- label: D,
475
+ label: T,
448
476
  required: !0
449
477
  },
450
478
  className: "desktop:shrink-0 desktop:basis-40",
@@ -454,86 +482,83 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
454
482
  disabled: i.has(e.code)
455
483
  })),
456
484
  value: e.language,
457
- onChange: (t) => K(e.id, { language: t })
458
- }), /* @__PURE__ */ O(g, {
485
+ onChange: (t) => J(e.id, { language: t })
486
+ }), /* @__PURE__ */ k(g, {
459
487
  id: `${e.id}-name`,
460
488
  containerClassName: "min-w-0 flex-1",
461
489
  required: !0,
462
490
  value: e.name,
463
- onChange: (t) => K(e.id, { name: t ?? "" }),
491
+ onChange: (t) => J(e.id, { name: t ?? "" }),
464
492
  labelProps: {
465
- label: A,
493
+ label: O,
466
494
  required: !0
467
495
  },
468
496
  placeholder: j
469
497
  })]
470
- }), /* @__PURE__ */ O(T, {
498
+ }), /* @__PURE__ */ k(E, {
471
499
  id: `${e.id}-description`,
472
500
  className: n,
473
- resize: E.Vertical,
501
+ resize: D.Vertical,
474
502
  value: e.description,
475
- onChange: (t) => K(e.id, { description: t }),
503
+ onChange: (t) => J(e.id, { description: t }),
476
504
  labelProps: { label: M },
477
- placeholder: ee
505
+ placeholder: N
478
506
  })]
479
507
  })]
480
508
  }, e.id);
481
- }), /* @__PURE__ */ O(v, {
482
- label: C,
483
- iconBefore: /* @__PURE__ */ O(N, {
509
+ }), /* @__PURE__ */ k(v, {
510
+ label: S,
511
+ iconBefore: /* @__PURE__ */ k(P, {
484
512
  size: u.SM,
485
513
  "aria-hidden": !0,
486
514
  stroke: d
487
515
  }),
488
516
  className: "self-start",
489
- onClick: G,
490
- disabled: V.length >= r.length
517
+ onClick: ne,
518
+ disabled: B.length >= r.length
491
519
  })]
492
520
  })
493
521
  })
494
522
  ]
495
523
  });
496
- }, de = "Add tags, comma separated", fe = "deployment-creation-form-description", pe = ({ values: e, errors: t, onChange: i, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: c, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = ce, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: _ = !1, renderDescription: v, focusRequestKey: y }) => {
497
- let b = z(null), x = z(null), S = z(null), C = z(!1), D = (e) => p.includes(e), A = D(Q.Name), j = D(Q.Version), M = !!(t.name || t.version || t.description), N = z(y);
524
+ }, pe = "Add tags, comma separated", me = "deployment-creation-form-description", he = ({ values: e, errors: t, onChange: i, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: c, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = ue, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: _ = !1, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
525
+ let x = V(null), S = V(null), C = V(null), w = V(!1), O = (e) => p.includes(e), j = O(Q.Name), M = O(Q.Version), N = !!(t.name || t.version || t.description), P = V(b);
498
526
  te(() => {
499
527
  let e = () => {
500
- t.name ? b.current?.focus() : t.version ? x.current?.focus() : t.description && S.current?.focus();
528
+ t.name ? x.current?.focus() : t.version ? S.current?.focus() : t.description && C.current?.focus();
501
529
  };
502
- if (y !== void 0) {
503
- y !== N.current && (N.current = y, e());
504
- return;
505
- }
506
- M && !C.current && e(), C.current = M;
530
+ b === void 0 ? (N && !w.current && e(), w.current = N) : b !== P.current && (P.current = b, e());
507
531
  }, [
508
- y,
509
- M,
532
+ b,
533
+ N,
510
534
  t.name,
511
535
  t.version,
512
536
  t.description
513
537
  ]);
514
- let P = /* @__PURE__ */ O(T, {
515
- id: fe,
516
- ref: S,
538
+ let F = /* @__PURE__ */ k(E, {
539
+ id: me,
540
+ ref: C,
517
541
  value: e.description,
518
542
  onChange: (e) => i({ description: e }),
519
543
  "aria-required": _ || void 0,
520
- labelProps: v ? void 0 : {
544
+ labelProps: y ? void 0 : {
521
545
  label: u.description.label,
522
546
  required: _
523
547
  },
524
548
  placeholder: u.description.placeholder,
549
+ caption: v,
525
550
  error: t.description || void 0,
526
551
  invalid: !!t.description,
527
- containerClassName: v ? void 0 : d?.field,
552
+ containerClassName: y ? void 0 : d?.field,
528
553
  className: n,
529
- resize: E.Vertical
554
+ resize: D.Vertical
530
555
  });
531
- return /* @__PURE__ */ k("div", {
556
+ return /* @__PURE__ */ A("div", {
532
557
  role: u.ariaLabel ? "group" : void 0,
533
558
  "aria-label": u.ariaLabel,
534
559
  className: s("flex flex-col gap-4", d?.root),
535
560
  children: [
536
- D(Q.Avatar) && /* @__PURE__ */ O(oe, {
561
+ O(Q.Avatar) && /* @__PURE__ */ k(ce, {
537
562
  label: u.iconUrl.label,
538
563
  avatarUrl: c,
539
564
  addAvatarLabel: u.iconUrl.addAvatarLabel,
@@ -541,11 +566,11 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
541
566
  onAddAvatarClick: l,
542
567
  className: d?.field
543
568
  }),
544
- (A || j) && /* @__PURE__ */ k("div", {
569
+ (j || M) && /* @__PURE__ */ A("div", {
545
570
  className: s("flex items-start gap-4", d?.field),
546
- children: [A && /* @__PURE__ */ O(g, {
571
+ children: [j && /* @__PURE__ */ k(g, {
547
572
  id: "deployment-creation-form-name",
548
- inputRef: b,
573
+ inputRef: x,
549
574
  value: e.name,
550
575
  onChange: (e) => i({ name: e ?? "" }),
551
576
  onBlur: a,
@@ -558,10 +583,10 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
558
583
  caption: h,
559
584
  error: t.name || void 0,
560
585
  invalid: !!t.name,
561
- containerClassName: j ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
562
- }), j && /* @__PURE__ */ O(g, {
586
+ containerClassName: M ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
587
+ }), M && /* @__PURE__ */ k(g, {
563
588
  id: "deployment-creation-form-version",
564
- inputRef: x,
589
+ inputRef: S,
565
590
  value: e.version,
566
591
  onChange: (e) => i({ version: e ?? "" }),
567
592
  onBlur: o,
@@ -569,26 +594,26 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
569
594
  placeholder: u.version.placeholder,
570
595
  error: t.version || void 0,
571
596
  invalid: !!t.version,
572
- containerClassName: A ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
597
+ containerClassName: j ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
573
598
  })]
574
599
  }),
575
- D(Q.Description) && (v ? /* @__PURE__ */ O("div", {
600
+ O(Q.Description) && (y ? /* @__PURE__ */ k("div", {
576
601
  className: d?.field,
577
- children: v(P, fe)
578
- }) : P),
579
- D(Q.Locales) && /* @__PURE__ */ O(ue, {
602
+ children: y(F, me)
603
+ }) : F),
604
+ O(Q.Locales) && /* @__PURE__ */ k(fe, {
580
605
  value: e.otherLocales,
581
606
  onChange: (e) => i({ otherLocales: e }),
582
607
  availableLocaleOptions: f,
583
608
  labels: u.otherLocales,
584
609
  className: d?.field
585
610
  }),
586
- D(Q.Tags) && /* @__PURE__ */ O("div", {
611
+ O(Q.Tags) && /* @__PURE__ */ k("div", {
587
612
  className: d?.field,
588
- children: /* @__PURE__ */ O(w, {
613
+ children: /* @__PURE__ */ k(T, {
589
614
  id: "deployment-creation-form-topics",
590
615
  labelProps: { label: u.topics.label },
591
- placeholder: u.topics.placeholder ?? de,
616
+ placeholder: u.topics.placeholder ?? pe,
592
617
  value: e.topics,
593
618
  onChange: (e) => i({ topics: e }),
594
619
  tagClassName: r
@@ -596,53 +621,58 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
596
621
  })
597
622
  ]
598
623
  });
599
- }, me = "border-0 p-4 desktop:p-8", he = "desktop:flex-1", ge = "px-4 pt-4 desktop:px-6 desktop:pt-6", _e = F(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: c, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, metadataSectionClassName: b, setupSectionClassName: S, labels: C, styles: w, dir: T }) => {
600
- let E = v == null ? null : /* @__PURE__ */ O("div", {
624
+ }, ge = "border-0 p-4 desktop:p-8", _e = "desktop:flex-1", ve = "px-4 pt-4 desktop:px-6 desktop:pt-6", ye = I(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: c, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: b, metadataSectionClassName: S, setupSectionClassName: C, labels: w, styles: T, dir: E }) => {
625
+ let D = v == null ? null : /* @__PURE__ */ k("div", {
601
626
  role: "alert",
602
- className: ge,
627
+ className: ve,
603
628
  children: v
604
- }), A = p != null;
605
- return /* @__PURE__ */ O(ae, {
629
+ }), j = p != null;
630
+ return /* @__PURE__ */ k(oe, {
606
631
  title: e,
607
632
  onBack: t,
608
- backAriaLabel: C?.backAriaLabel ?? "Back",
633
+ backAriaLabel: w?.backAriaLabel ?? "Back",
609
634
  isSaving: a,
610
- labels: { savingStatusLabel: C?.savingStatusLabel ?? "Saving" },
611
- rightContent: h == null ? void 0 : /* @__PURE__ */ O(Y, {
635
+ resizableLeftColumn: b,
636
+ labels: {
637
+ savingStatusLabel: w?.savingStatusLabel ?? "Saving",
638
+ resizeHandleLabel: w?.resizeHandleLabel,
639
+ resizeHandleTooltip: w?.resizeHandleTooltip
640
+ },
641
+ rightContent: h == null ? void 0 : /* @__PURE__ */ k(X, {
612
642
  title: g,
613
- styles: w?.section,
614
- className: s(me, _, q.asideSection),
643
+ styles: T?.section,
644
+ className: s(ge, _, Y.asideSection),
615
645
  children: h
616
646
  }),
617
- styles: w?.layout,
618
- dir: T,
619
- actions: /* @__PURE__ */ k(D, { children: [c, !l && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(y, {
620
- label: C?.cancelLabel ?? "Cancel",
647
+ styles: T?.layout,
648
+ dir: E,
649
+ actions: /* @__PURE__ */ A(O, { children: [c, !l && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(y, {
650
+ label: w?.cancelLabel ?? "Cancel",
621
651
  disabled: a,
622
652
  onClick: n
623
- }), /* @__PURE__ */ O(x, {
653
+ }), /* @__PURE__ */ k(x, {
624
654
  label: i,
625
655
  disabled: a || o,
626
656
  onClick: r
627
657
  })] })] }),
628
- leftContent: /* @__PURE__ */ k(D, { children: [
629
- !A && E,
630
- /* @__PURE__ */ O(Y, {
631
- title: d === null ? void 0 : d ?? C?.metadataTitle ?? "Metadata",
632
- styles: w?.section,
633
- className: s(me, b, q.metadataSection),
658
+ leftContent: /* @__PURE__ */ A(O, { children: [
659
+ !j && D,
660
+ /* @__PURE__ */ k(X, {
661
+ title: d === null ? void 0 : d ?? w?.metadataTitle ?? "Metadata",
662
+ styles: T?.section,
663
+ className: s(ge, S, Y.metadataSection),
634
664
  children: u
635
665
  }),
636
666
  f
637
667
  ] }),
638
- centerContent: A ? /* @__PURE__ */ k(D, { children: [E, /* @__PURE__ */ O(Y, {
639
- title: m === null ? void 0 : m ?? C?.setupTitle ?? "Setup",
640
- styles: w?.section,
641
- className: s(me, he, S, q.setupSection),
668
+ centerContent: j ? /* @__PURE__ */ A(O, { children: [D, /* @__PURE__ */ k(X, {
669
+ title: m === null ? void 0 : m ?? w?.setupTitle ?? "Setup",
670
+ styles: T?.section,
671
+ className: s(ge, _e, C, Y.setupSection),
642
672
  children: p
643
673
  })] }) : void 0
644
674
  });
645
- }), ve = {
675
+ }), be = {
646
676
  name: {
647
677
  label: "Name",
648
678
  placeholder: "Enter name"
@@ -681,7 +711,7 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
681
711
  saveLabel: "Save"
682
712
  },
683
713
  ariaLabel: "Metadata"
684
- }, ye = {
714
+ }, xe = {
685
715
  title: "Add avatar",
686
716
  attachLabel: "Attach",
687
717
  emptyTitle: "This folder is empty",
@@ -705,64 +735,65 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
705
735
  deleteConfirmItemsLabel: "items?",
706
736
  deleteConfirmLabel: "Delete",
707
737
  deleteCancelLabel: "Cancel"
708
- }, be = F(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = ce, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, renderDescription: d, focusRequestKey: f, labels: p }) => {
709
- let [m, h] = B(!1), g = R(() => a ? s : s.filter((e) => e !== Q.Avatar), [a, s]), _ = e.iconUrl, v = a?.resolveIconUrl, y = R(() => v ? v(_) : void 0, [_, v]), b = I(() => h(!0), []), x = I(() => h(!1), []), S = a?.resolveAttachedIconUrl, C = I((e) => {
710
- let t = S?.(e);
711
- t && n({ iconUrl: t }), h(!1);
712
- }, [n, S]);
713
- return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(pe, {
738
+ }, Se = I(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = ue, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, descriptionCaption: d, renderDescription: f, focusRequestKey: p, labels: m }) => {
739
+ let [h, g] = H(!1), _ = B(() => a ? s : s.filter((e) => e !== Q.Avatar), [a, s]), v = e.iconUrl, y = a?.resolveIconUrl, b = B(() => y ? y(v) : void 0, [v, y]), x = L(() => g(!0), []), S = L(() => g(!1), []), C = a?.resolveAttachedIconUrl, w = L((e) => {
740
+ let t = C?.(e);
741
+ t && n({ iconUrl: t }), g(!1);
742
+ }, [n, C]);
743
+ return /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(he, {
714
744
  values: e,
715
745
  errors: t,
716
746
  onChange: n,
717
747
  onNameBlur: r,
718
748
  onVersionBlur: i,
719
- iconPreviewUrl: y,
720
- onAddAvatarClick: b,
721
- labels: p?.form ?? ve,
749
+ iconPreviewUrl: b,
750
+ onAddAvatarClick: x,
751
+ labels: m?.form ?? be,
722
752
  availableLocaleOptions: o,
723
- fields: g,
753
+ fields: _,
724
754
  isNameReadOnly: c,
725
755
  nameCaption: l,
726
756
  isDescriptionRequired: u,
727
- renderDescription: d,
728
- focusRequestKey: f
729
- }), a && /* @__PURE__ */ O(se, {
730
- isOpen: m,
731
- onClose: x,
732
- onAttach: C,
757
+ descriptionCaption: d,
758
+ renderDescription: f,
759
+ focusRequestKey: p
760
+ }), a && /* @__PURE__ */ k(le, {
761
+ isOpen: h,
762
+ onClose: S,
763
+ onAttach: w,
733
764
  bucket: a.bucket,
734
765
  FileManagerModal: a.FileManagerModal,
735
766
  allowedMimeTypes: a.allowedMimeTypes,
736
767
  maxFileSizeBytes: a.maxFileSizeBytes,
737
- labels: p?.avatarPicker ?? ye
768
+ labels: m?.avatarPicker ?? xe
738
769
  })] });
739
770
  }), $ = /* @__PURE__ */ function(e) {
740
771
  return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
741
- }({}), xe = (e, t) => e.length === t.length && e.every((e, n) => e.id === t[n].id && e.language === t[n].language && e.name === t[n].name && e.description === t[n].description), Se = (e, t) => e.name === t.name && e.description === t.description && e.iconUrl === t.iconUrl && e.version === t.version && e.topics.length === t.topics.length && e.topics.every((e, n) => e === t.topics[n]) && xe(e.otherLocales, t.otherLocales), Ce = (e) => Object.values(e).every((e) => e == null), we = /^[a-zA-Z0-9 _.-]+$/, Te = /^[a-zA-Z0-9._-]+$/, Ee = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/, De = "1.0.0", Oe = (n, r = {}) => {
772
+ }({}), Ce = (e, t) => e.length === t.length && e.every((e, n) => e.id === t[n].id && e.language === t[n].language && e.name === t[n].name && e.description === t[n].description), we = (e, t) => e.name === t.name && e.description === t.description && e.iconUrl === t.iconUrl && e.version === t.version && e.topics.length === t.topics.length && e.topics.every((e, n) => e === t.topics[n]) && Ce(e.otherLocales, t.otherLocales), Te = (e) => Object.values(e).every((e) => e == null), Ee = /^[a-zA-Z0-9 _.-]+$/, De = /^[a-zA-Z0-9._-]+$/, Oe = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/, ke = "1.0.0", Ae = (n, r = {}) => {
742
773
  let i = {}, s = n.name.trim();
743
- s ? a(s, t) ? i.name = $.TooLong : r.validateNamePattern && !we.test(s) ? i.name = $.InvalidFormat : o(s) && (i.name = $.ControlCharacters) : i.name = $.Required, a(n.description, e) && (i.description = $.TooLong);
774
+ s ? a(s, t) ? i.name = $.TooLong : r.validateNamePattern && !Ee.test(s) ? i.name = $.InvalidFormat : o(s) && (i.name = $.ControlCharacters) : i.name = $.Required, a(n.description, e) && (i.description = $.TooLong);
744
775
  let c = n.version.trim();
745
- return r.validateVersionPattern && c && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern : Te).test(c) || (i.version = $.InvalidFormat)), i;
746
- }, ke = new Set([$.TooLong, $.ControlCharacters]), Ae = (e, t) => ({
776
+ return r.validateVersionPattern && c && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern : De).test(c) || (i.version = $.InvalidFormat)), i;
777
+ }, je = /* @__PURE__ */ new Set([$.TooLong, $.ControlCharacters]), Me = (e, t) => ({
747
778
  reseedKey: t,
748
779
  values: e,
749
780
  baseline: e,
750
781
  touched: {},
751
782
  hasAttemptedSubmit: !1,
752
783
  submitAttemptCount: 0
753
- }), je = ({ initialValues: e, validationOptions: t, reseedKey: n }) => {
754
- let [r, i] = B(() => Ae(e, n));
755
- r.reseedKey !== n && i(Ae(e, n));
756
- let a = t?.validateNamePattern, o = t?.validateVersionPattern, s = R(() => Oe(r.values, {
784
+ }), Ne = ({ initialValues: e, validationOptions: t, reseedKey: n }) => {
785
+ let [r, i] = H(() => Me(e, n));
786
+ r.reseedKey !== n && i(Me(e, n));
787
+ let a = t?.validateNamePattern, o = t?.validateVersionPattern, s = B(() => Ae(r.values, {
757
788
  validateNamePattern: a,
758
789
  validateVersionPattern: o
759
790
  }), [
760
791
  r.values,
761
792
  a,
762
793
  o
763
- ]), c = R(() => {
794
+ ]), c = B(() => {
764
795
  if (r.hasAttemptedSubmit) return s;
765
- let e = (e, t) => e && (t || ke.has(e)) ? e : void 0;
796
+ let e = (e, t) => e && (t || je.has(e)) ? e : void 0;
766
797
  return {
767
798
  name: e(s.name, r.touched[Q.Name]),
768
799
  version: e(s.version, r.touched[Q.Version]),
@@ -772,28 +803,28 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
772
803
  s,
773
804
  r.hasAttemptedSubmit,
774
805
  r.touched
775
- ]), l = z(s), u = z(e);
776
- L(() => {
806
+ ]), l = V(s), u = V(e);
807
+ z(() => {
777
808
  l.current = s, u.current = e;
778
809
  });
779
- let d = I((e) => i((t) => ({
810
+ let d = L((e) => i((t) => ({
780
811
  ...t,
781
812
  values: {
782
813
  ...t.values,
783
814
  ...e
784
815
  }
785
- })), []), f = I((e) => i((t) => t.touched[e] ? t : {
816
+ })), []), f = L((e) => i((t) => t.touched[e] ? t : {
786
817
  ...t,
787
818
  touched: {
788
819
  ...t.touched,
789
820
  [e]: !0
790
821
  }
791
- }), []), p = I(() => (i((e) => ({
822
+ }), []), p = L(() => (i((e) => ({
792
823
  ...e,
793
824
  hasAttemptedSubmit: !0,
794
825
  submitAttemptCount: e.submitAttemptCount + 1
795
- })), Ce(l.current)), []), m = I((e) => i((t) => Ae(e ?? u.current, t.reseedKey)), []), h = R(() => !Se(r.values, r.baseline), [r.values, r.baseline]);
796
- return R(() => ({
826
+ })), Te(l.current)), []), m = L((e) => i((t) => Me(e ?? u.current, t.reseedKey)), []), h = B(() => !we(r.values, r.baseline), [r.values, r.baseline]);
827
+ return B(() => ({
797
828
  values: r.values,
798
829
  setValues: d,
799
830
  touched: r.touched,
@@ -818,4 +849,4 @@ var V = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubm
818
849
  ]);
819
850
  };
820
851
  //#endregion
821
- export { oe as AddAvatar, se as AvatarPickerModal, q as BUILDER_FORM_CLASS, K as BuilderFormContainer, De as DEFAULT_DEPLOYMENT_VERSION, ve as DEFAULT_METADATA_FORM_LABELS, $ as DeploymentCreationFieldErrorCode, pe as DeploymentCreationForm, ue as DeploymentLocalesField, ae as EditorLayout, Y as EditorSection, _e as EntityEditor, Q as MetadataField, be as MetadataForm, we as NAME_PATTERN, Ee as SEMVER_VERSION_PATTERN, Te as VERSION_PATTERN, je as useMetadataForm, Oe as validateDeploymentCreationFields };
852
+ export { ce as AddAvatar, le as AvatarPickerModal, Y as BUILDER_FORM_CLASS, re as BuilderFormContainer, ke as DEFAULT_DEPLOYMENT_VERSION, be as DEFAULT_METADATA_FORM_LABELS, $ as DeploymentCreationFieldErrorCode, he as DeploymentCreationForm, fe as DeploymentLocalesField, oe as EditorLayout, X as EditorSection, ye as EntityEditor, Q as MetadataField, Se as MetadataForm, Ee as NAME_PATTERN, Oe as SEMVER_VERSION_PATTERN, De as VERSION_PATTERN, Ne as useMetadataForm, Ae as validateDeploymentCreationFields };