@epam/ai-dial-builder-form 1.3.5 → 1.4.0-dev.101

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.d.ts CHANGED
@@ -24,7 +24,7 @@ export type { AvatarPickerFileManagerModalProps, AvatarPickerModalColors, Avatar
24
24
  export type { DeploymentCreationFormFieldErrors, DeploymentCreationFormFieldLabels, DeploymentCreationFormIconLabels, DeploymentCreationFormLabels, DeploymentCreationFormLocaleEntry, DeploymentCreationFormLocaleLabels, DeploymentCreationFormLocaleOption, DeploymentCreationFormProps, DeploymentCreationFormStyles, DeploymentCreationFormValues, DeploymentLocalesFieldColors, } from './models/deployment-creation-form';
25
25
  export type { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions, } from './models/validation';
26
26
  export { DeploymentCreationFieldErrorCode } from './models/validation';
27
- export { DEFAULT_DEPLOYMENT_VERSION, NAME_PATTERN, SEMVER_VERSION_PATTERN, VERSION_PATTERN, validateDeploymentCreationFields, } from './utils/validate-deployment-creation-fields';
27
+ export { DEFAULT_DEPLOYMENT_VERSION, NAME_PATTERN, STORED_VERSION_PATTERN, VERSION_PATTERN, validateDeploymentCreationFields, withStoredVersionRule, } from './utils/validate-deployment-creation-fields';
28
28
  export { BUILDER_FORM_CLASS } from './constants/public-class-names';
29
29
  export { DEFAULT_METADATA_FORM_LABELS } from './constants/metadata-form';
30
30
  export { AVATAR_ALLOWED_MIME_TYPES, AVATAR_MAX_FILE_SIZE_BYTES, } from './constants/avatar-picker';
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACpF,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAC;AAC9G,YAAY,EACV,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,gCAAgC,EAChC,uCAAuC,GACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,gCAAgC,GACjC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACpF,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAC;AAC9G,YAAY,EACV,iCAAiC,EACjC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,4BAA4B,EAC5B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,gCAAgC,EAChC,uCAAuC,GACxC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC"}
package/index.js CHANGED
@@ -1,580 +1,580 @@
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, LiveRegion as y, LiveRegionElement as b, LiveRegionPoliteness as x, NeutralButton as S, Popup as C, PrimaryButton as w, ResizeHandle as T, Select as E, Spinner as D, TagInput as O, Textarea as k, TextareaResize as A } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
4
- import { IconArrowLeft as P, IconArrowNarrowLeft as F, IconPhoto as I, IconPlus as L, IconTrashX as ee } from "@tabler/icons-react";
5
- import { Suspense as R, memo as te, useCallback as z, useEffect as ne, useId as re, useLayoutEffect as ie, useMemo as B, useRef as V, useState as H } from "react";
1
+ import { ENTITY_DESCRIPTION_MAX_LENGTH as e, ENTITY_NAME_MAX_LENGTH as t, RESIZABLE_TEXTAREA_CLASS_NAME as n, RESOURCE_VERSION_PATTERN as r, STORED_RESOURCE_VERSION_PATTERN as i, TAG_INPUT_TAG_CLASS_NAME as a, buildCssVars as o, exceedsMaxLength as s, hasControlCharacters as c, mergeClasses as l } from "@epam/ai-dial-chat-shared";
2
+ import { ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, DangerIconButton as m, ElementSize as h, GhostButton as g, GhostIconButton as _, Input as v, Label as y, LinkButton as b, LiveRegion as x, LiveRegionElement as S, LiveRegionPoliteness as C, NeutralButton as w, Popup as T, PrimaryButton as E, ResizeHandle as D, Select as O, Spinner as k, TagInput as A, Textarea as j, TextareaResize as ee } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
4
+ import { IconArrowLeft as F, IconArrowNarrowLeft as I, IconPhoto as L, IconPlus as R, IconTrashX as te } from "@tabler/icons-react";
5
+ import { Suspense as ne, memo as re, useCallback as z, useEffect as ie, useId as B, useLayoutEffect as V, useMemo as H, useRef as U, useState as W } from "react";
6
6
  //#region src/models/builder-form-actions-order.ts
7
- var U = /* @__PURE__ */ function(e) {
7
+ var G = /* @__PURE__ */ function(e) {
8
8
  return e.CancelFirst = "cancelFirst", e.SubmitFirst = "submitFirst", e;
9
- }({}), W = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: o, order: s = U.CancelFirst }) => {
10
- let c = /* @__PURE__ */ M(S, {
9
+ }({}), ae = ({ labels: e, onCancel: t, onSubmit: n, isCancelDisabled: r = !1, isSubmitDisabled: i = !1, isSubmitting: a = !1, buttonClassName: o, order: s = G.CancelFirst }) => {
10
+ let c = /* @__PURE__ */ N(w, {
11
11
  label: e.cancelButtonLabel,
12
12
  onClick: t,
13
13
  disabled: r,
14
14
  className: o
15
15
  });
16
- return /* @__PURE__ */ N(j, { children: [
17
- s === U.CancelFirst && c,
18
- /* @__PURE__ */ M(w, {
16
+ return /* @__PURE__ */ P(M, { children: [
17
+ s === G.CancelFirst && c,
18
+ /* @__PURE__ */ N(E, {
19
19
  label: e.submitButtonLabel,
20
20
  onClick: n,
21
21
  disabled: i,
22
22
  "aria-busy": a,
23
23
  className: o,
24
- iconBefore: a ? /* @__PURE__ */ M("span", {
24
+ iconBefore: a ? /* @__PURE__ */ N("span", {
25
25
  "aria-hidden": !0,
26
- children: /* @__PURE__ */ M(D, { size: u.SM })
26
+ children: /* @__PURE__ */ N(k, { size: f.SM })
27
27
  }) : void 0
28
28
  }),
29
- s === U.SubmitFirst && c
29
+ s === G.SubmitFirst && c
30
30
  ] });
31
- }, G = {
31
+ }, K = {
32
32
  body: "_body_1xd7h_2",
33
33
  sideColumn: "_sideColumn_1xd7h_6",
34
34
  reservedColumn: "_reservedColumn_1xd7h_10"
35
- }, ae = s("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", G.sideColumn), oe = ({ left: e, children: t, metadata: n, layout: r }) => {
35
+ }, oe = l("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", K.sideColumn), se = ({ left: e, children: t, metadata: n, layout: r }) => {
36
36
  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;
37
- return /* @__PURE__ */ N("div", {
38
- className: s("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden", G.body),
37
+ return /* @__PURE__ */ P("div", {
38
+ className: l("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden", K.body),
39
39
  style: o,
40
40
  children: [
41
- e != null && /* @__PURE__ */ M("div", {
42
- className: ae,
41
+ e != null && /* @__PURE__ */ N("div", {
42
+ className: oe,
43
43
  style: a,
44
44
  children: e
45
45
  }),
46
- /* @__PURE__ */ M("div", {
46
+ /* @__PURE__ */ N("div", {
47
47
  className: "flex w-full min-w-0 flex-1 flex-col desktop:min-h-0 desktop:overflow-y-auto",
48
48
  children: t
49
49
  }),
50
- n != null && /* @__PURE__ */ M("div", {
51
- className: ae,
50
+ n != null && /* @__PURE__ */ N("div", {
51
+ className: oe,
52
52
  style: a,
53
53
  children: n
54
54
  }),
55
- i && /* @__PURE__ */ M("div", {
55
+ i && /* @__PURE__ */ N("div", {
56
56
  "aria-hidden": !0,
57
57
  style: a,
58
- className: s(G.reservedColumn, G.sideColumn)
58
+ className: l(K.reservedColumn, K.sideColumn)
59
59
  })
60
60
  ]
61
61
  });
62
- }, K = {
62
+ }, q = {
63
63
  header: "_header_lon83_4",
64
64
  actions: "_actions_lon83_18",
65
65
  title: "_title_lon83_27"
66
- }, se = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, backIcon: l, styles: f }) => {
67
- let { colors: p, typography: m } = f ?? {}, g = m?.fontClassName ?? "dial-h1-text", _ = !!m?.fontClassName, v = i({
68
- "--bfh-border": p?.borderColor,
69
- "--bfh-font-family": _ ? void 0 : m?.fontFamily
66
+ }, ce = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: i = !1, isSubmitDisabled: a = !1, isSubmitting: s = !1, backIcon: c, styles: u }) => {
67
+ let { colors: d, typography: m } = u ?? {}, h = m?.fontClassName ?? "dial-h1-text", g = !!m?.fontClassName, v = o({
68
+ "--bfh-border": d?.borderColor,
69
+ "--bfh-font-family": g ? void 0 : m?.fontFamily
70
70
  });
71
- return /* @__PURE__ */ N("div", {
71
+ return /* @__PURE__ */ P("div", {
72
72
  style: v,
73
- 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", K.header),
73
+ className: l("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),
74
74
  children: [
75
- /* @__PURE__ */ N("div", {
75
+ /* @__PURE__ */ P("div", {
76
76
  className: "flex min-w-0 flex-1 items-center gap-2",
77
- children: [/* @__PURE__ */ M(h, {
78
- icon: l === void 0 ? /* @__PURE__ */ M(P, {
79
- size: u.LG,
77
+ children: [/* @__PURE__ */ N(_, {
78
+ icon: c === void 0 ? /* @__PURE__ */ N(F, {
79
+ size: f.LG,
80
80
  className: "rtl:scale-x-[-1]",
81
81
  "aria-hidden": !0,
82
- stroke: d
83
- }) : l,
82
+ stroke: p
83
+ }) : c,
84
84
  "aria-label": e.backButtonLabel,
85
85
  onClick: t
86
- }), /* @__PURE__ */ M("h1", {
87
- className: s("truncate", K.title, g),
86
+ }), /* @__PURE__ */ N("h1", {
87
+ className: l("truncate", q.title, h),
88
88
  children: e.title
89
89
  })]
90
90
  }),
91
- /* @__PURE__ */ M("div", {
92
- className: s("items-center gap-2", K.actions),
93
- children: /* @__PURE__ */ M(W, {
91
+ /* @__PURE__ */ N("div", {
92
+ className: l("items-center gap-2", q.actions),
93
+ children: /* @__PURE__ */ N(ae, {
94
94
  labels: e,
95
95
  onCancel: n,
96
96
  onSubmit: r,
97
- isCancelDisabled: a,
98
- isSubmitDisabled: o,
99
- isSubmitting: c
97
+ isCancelDisabled: i,
98
+ isSubmitDisabled: a,
99
+ isSubmitting: s
100
100
  })
101
101
  }),
102
- /* @__PURE__ */ M(y, {
102
+ /* @__PURE__ */ N(x, {
103
103
  visuallyHidden: !0,
104
- as: b.Span,
105
- children: c ? e.submittingLabel ?? "Submitting" : ""
104
+ as: S.Span,
105
+ children: s ? e.submittingLabel ?? "Submitting" : ""
106
106
  })
107
107
  ]
108
108
  });
109
- }, q = {
109
+ }, J = {
110
110
  container: "_container_14mfe_1",
111
111
  footer: "_footer_14mfe_10"
112
- }, ce = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: a = !1, isSubmitDisabled: o = !1, isSubmitting: c = !1, footerActionsOrder: l, backIcon: u, className: d, left: f, children: p, metadata: m, layout: h, styles: g }) => {
112
+ }, le = ({ labels: e, onBack: t, onCancel: n, onSubmit: r, isCancelDisabled: i = !1, isSubmitDisabled: a = !1, isSubmitting: s = !1, footerActionsOrder: c, backIcon: u, className: d, left: f, children: p, metadata: m, layout: h, styles: g }) => {
113
113
  let { colors: _, header: v, cssVars: y } = g ?? {};
114
- return /* @__PURE__ */ N("div", {
114
+ return /* @__PURE__ */ P("div", {
115
115
  style: {
116
- ...i({ "--bfc-bg": _?.background }),
116
+ ...o({ "--bfc-bg": _?.background }),
117
117
  ...y
118
118
  },
119
- className: s("flex h-full min-h-0 w-full flex-col overflow-hidden", d, q.container),
119
+ className: l("flex h-full min-h-0 w-full flex-col overflow-hidden", d, J.container),
120
120
  children: [
121
- /* @__PURE__ */ M(se, {
121
+ /* @__PURE__ */ N(ce, {
122
122
  labels: e,
123
123
  onBack: t,
124
124
  onCancel: n,
125
125
  onSubmit: r,
126
- isCancelDisabled: a,
127
- isSubmitDisabled: o,
128
- isSubmitting: c,
126
+ isCancelDisabled: i,
127
+ isSubmitDisabled: a,
128
+ isSubmitting: s,
129
129
  backIcon: u,
130
130
  styles: v
131
131
  }),
132
- /* @__PURE__ */ M(oe, {
132
+ /* @__PURE__ */ N(se, {
133
133
  left: f,
134
134
  metadata: m,
135
135
  layout: h,
136
136
  children: p
137
137
  }),
138
- /* @__PURE__ */ M("div", {
139
- className: s("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm", q.footer),
140
- children: /* @__PURE__ */ M(W, {
138
+ /* @__PURE__ */ N("div", {
139
+ className: l("sticky bottom-0 z-10 items-center gap-2 p-3 shadow-sm", J.footer),
140
+ children: /* @__PURE__ */ N(ae, {
141
141
  labels: e,
142
142
  onCancel: n,
143
143
  onSubmit: r,
144
- isCancelDisabled: a,
145
- isSubmitDisabled: o,
146
- isSubmitting: c,
144
+ isCancelDisabled: i,
145
+ isSubmitDisabled: a,
146
+ isSubmitting: s,
147
147
  buttonClassName: "flex-1",
148
- order: l
148
+ order: c
149
149
  })
150
150
  })
151
151
  ]
152
152
  });
153
- }, J = {
153
+ }, Y = {
154
154
  layout: "dial-builder-form-layout",
155
155
  section: "dial-builder-form-section",
156
156
  metadataSection: "dial-builder-form-metadata-section",
157
157
  setupSection: "dial-builder-form-setup-section",
158
158
  asideSection: "dial-builder-form-aside-section"
159
- }, Y = {
159
+ }, ue = {
160
160
  section: "_section_l1mnx_1",
161
161
  title: "_title_l1mnx_5"
162
162
  }, X = ({ title: e, children: t, styles: n, className: r }) => {
163
- let a = re(), o = i({
163
+ let i = B(), a = o({
164
164
  "--es-border-color": n?.colors?.borderColor,
165
165
  "--es-title-color": n?.colors?.titleColor
166
166
  });
167
- return /* @__PURE__ */ N("section", {
168
- "aria-labelledby": e == null ? void 0 : a,
169
- className: s("flex h-full flex-col gap-4 rounded border", Y.section, r, J.section),
170
- style: o,
171
- children: [e != null && /* @__PURE__ */ M("h2", {
172
- id: a,
173
- className: s(n?.typography?.titleClassName ?? "dial-h3-text", Y.title),
167
+ return /* @__PURE__ */ P("section", {
168
+ "aria-labelledby": e == null ? void 0 : i,
169
+ className: l("flex h-full flex-col gap-4 rounded border", ue.section, r, Y.section),
170
+ style: a,
171
+ children: [e != null && /* @__PURE__ */ N("h2", {
172
+ id: i,
173
+ className: l(n?.typography?.titleClassName ?? "dial-h3-text", ue.title),
174
174
  children: e
175
175
  }), t]
176
176
  });
177
- }, le = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
177
+ }, de = (e, { min: t = 280, max: n = 640, containerWidth: r } = {}) => {
178
178
  let i = r != null && r > 0 ? r - 360 : n;
179
179
  return Math.round(Math.min(Math.max(t, Math.min(n, i)), Math.max(t, Number.isFinite(e) ? e : t)));
180
180
  }, Z = {
181
181
  headerBorder: "_headerBorder_1adw2_1",
182
182
  footerBorder: "_footerBorder_1adw2_5",
183
183
  columnBorder: "_columnBorder_1adw2_10"
184
- }, ue = ({ 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 }) => {
185
- let _ = re(), v = f ? p?.savingStatusLabel ?? "Saving" : "", x = V(null), [S, C] = H(), w = l != null && o != null, E = l?.minWidth, D = l?.maxWidth, O = {
186
- min: E,
187
- max: D,
188
- containerWidth: S
189
- }, k = w ? le(l.width, O) : void 0, A = le(D ?? 640, O);
190
- ne(() => {
191
- let e = x.current;
184
+ }, fe = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, centerContent: a, rightContent: s, resizableLeftColumn: c, isSaving: u = !1, labels: d, styles: m, dir: h }) => {
185
+ let g = B(), v = u ? d?.savingStatusLabel ?? "Saving" : "", y = U(null), [b, C] = W(), w = c != null && a != null, T = c?.minWidth, E = c?.maxWidth, O = {
186
+ min: T,
187
+ max: E,
188
+ containerWidth: b
189
+ }, k = w ? de(c.width, O) : void 0, A = de(E ?? 640, O);
190
+ ie(() => {
191
+ let e = y.current;
192
192
  if (!w || e == null || typeof ResizeObserver > "u") return;
193
193
  let t = new ResizeObserver(() => C(e.clientWidth));
194
194
  return t.observe(e), () => t.disconnect();
195
195
  }, [w]);
196
- let j = i({
196
+ let j = o({
197
197
  "--el-header-border-color": m?.colors?.headerBorderColor,
198
198
  "--el-sidebar-border-color": m?.colors?.sidebarBorderColor
199
199
  });
200
- return /* @__PURE__ */ N("div", {
201
- dir: g,
202
- className: s("flex min-h-0 flex-1 flex-col", J.layout),
200
+ return /* @__PURE__ */ P("div", {
201
+ dir: h,
202
+ className: l("flex min-h-0 flex-1 flex-col", Y.layout),
203
203
  style: j,
204
204
  children: [
205
- /* @__PURE__ */ M(y, {
205
+ /* @__PURE__ */ N(x, {
206
206
  visuallyHidden: !0,
207
- as: b.Span,
208
- id: _,
207
+ as: S.Span,
208
+ id: g,
209
209
  children: v
210
210
  }),
211
- /* @__PURE__ */ N("div", {
212
- 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),
213
- children: [/* @__PURE__ */ N("div", {
211
+ /* @__PURE__ */ P("div", {
212
+ className: l("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", Z.headerBorder),
213
+ children: [/* @__PURE__ */ P("div", {
214
214
  className: "flex min-w-0 flex-1 items-center gap-2",
215
- children: [/* @__PURE__ */ M(h, {
216
- icon: /* @__PURE__ */ M(F, {
217
- size: u.LG,
218
- stroke: d,
215
+ children: [/* @__PURE__ */ N(_, {
216
+ icon: /* @__PURE__ */ N(I, {
217
+ size: f.LG,
218
+ stroke: p,
219
219
  "aria-hidden": !0,
220
220
  className: "rtl:scale-x-[-1]"
221
221
  }),
222
222
  "aria-label": n,
223
223
  onClick: t
224
- }), /* @__PURE__ */ M("h1", {
225
- className: s(m?.typography?.titleClassName ?? "dial-h2-text", "min-w-0 truncate"),
224
+ }), /* @__PURE__ */ N("h1", {
225
+ className: l(m?.typography?.titleClassName ?? "dial-h2-text", "min-w-0 truncate"),
226
226
  children: e
227
227
  })]
228
- }), r != null && /* @__PURE__ */ M("div", {
228
+ }), r != null && /* @__PURE__ */ N("div", {
229
229
  className: "hidden shrink-0 items-center gap-2 desktop:flex",
230
230
  children: r
231
231
  })]
232
232
  }),
233
- /* @__PURE__ */ N("div", {
234
- ref: x,
233
+ /* @__PURE__ */ P("div", {
234
+ ref: y,
235
235
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
236
236
  children: [
237
- /* @__PURE__ */ M("div", {
238
- className: s(o == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", o != null && !w && "desktop:w-[400px]", w && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", o == null ? void 0 : Z.columnBorder),
237
+ /* @__PURE__ */ N("div", {
238
+ className: l(a == null ? "desktop:flex-1" : "desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", a != null && !w && "desktop:w-[400px]", w && "desktop:relative desktop:w-(--el-left-width)", "desktop:overflow-y-auto", a == null ? void 0 : Z.columnBorder),
239
239
  style: k == null ? void 0 : { "--el-left-width": `${k}px` },
240
- children: a
240
+ children: i
241
241
  }),
242
- w && k != null && /* @__PURE__ */ M("div", {
242
+ w && k != null && /* @__PURE__ */ N("div", {
243
243
  className: "relative hidden w-0 shrink-0 desktop:block",
244
- children: /* @__PURE__ */ M(T, {
244
+ children: /* @__PURE__ */ N(D, {
245
245
  width: k,
246
- minWidth: E ?? 280,
246
+ minWidth: T ?? 280,
247
247
  maxWidth: A,
248
- defaultWidth: l.defaultWidth ?? 400,
249
- onWidthChange: l.onWidthChange,
250
- label: p?.resizeHandleLabel ?? "Resize columns",
251
- tooltip: p?.resizeHandleTooltip ?? "Drag to resize"
248
+ defaultWidth: c.defaultWidth ?? 400,
249
+ onWidthChange: c.onWidthChange,
250
+ label: d?.resizeHandleLabel ?? "Resize columns",
251
+ tooltip: d?.resizeHandleTooltip ?? "Drag to resize"
252
252
  })
253
253
  }),
254
- o != null && /* @__PURE__ */ M("div", {
254
+ a != null && /* @__PURE__ */ N("div", {
255
255
  className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
256
- children: o
256
+ children: a
257
257
  }),
258
- c != null && /* @__PURE__ */ M("div", {
259
- className: s("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", Z.columnBorder),
260
- children: c
258
+ s != null && /* @__PURE__ */ N("div", {
259
+ className: l("desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s", Z.columnBorder),
260
+ children: s
261
261
  })
262
262
  ]
263
263
  }),
264
- r != null && /* @__PURE__ */ M("div", {
265
- className: s("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", Z.footerBorder),
264
+ r != null && /* @__PURE__ */ N("div", {
265
+ className: l("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 *:flex-1 desktop:hidden", Z.footerBorder),
266
266
  children: r
267
267
  })
268
268
  ]
269
269
  });
270
- }, de = {
270
+ }, pe = {
271
271
  box: "_box_c9as8_1",
272
272
  icon: "_icon_c9as8_6",
273
273
  caption: "_caption_c9as8_10"
274
- }, fe = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: a = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: o, captionClassName: c = "dial-tiny-text", styles: l, className: f }) => {
275
- let h = i({
276
- "--aa-box-bg": l?.colors?.boxBackgroundColor,
277
- "--aa-box-border": l?.colors?.boxBorderColor,
278
- "--aa-icon": l?.colors?.placeholderIconColor,
279
- "--aa-caption": l?.colors?.captionColor
274
+ }, me = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, captionClassName: s = "dial-tiny-text", styles: c, className: u }) => {
275
+ let d = o({
276
+ "--aa-box-bg": c?.colors?.boxBackgroundColor,
277
+ "--aa-box-border": c?.colors?.boxBorderColor,
278
+ "--aa-icon": c?.colors?.placeholderIconColor,
279
+ "--aa-caption": c?.colors?.captionColor
280
280
  });
281
- return /* @__PURE__ */ N("div", {
282
- className: s("flex flex-col gap-2", f),
283
- style: h,
284
- children: [/* @__PURE__ */ M(_, { label: e }), /* @__PURE__ */ N("div", {
281
+ return /* @__PURE__ */ P("div", {
282
+ className: l("flex flex-col gap-2", u),
283
+ style: d,
284
+ children: [/* @__PURE__ */ N(y, { label: e }), /* @__PURE__ */ P("div", {
285
285
  className: "flex items-start gap-3",
286
- children: [/* @__PURE__ */ M("div", {
287
- className: s("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", de.box),
288
- children: t ? /* @__PURE__ */ M("img", {
286
+ children: [/* @__PURE__ */ N("div", {
287
+ className: l("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", pe.box),
288
+ children: t ? /* @__PURE__ */ N("img", {
289
289
  src: t,
290
290
  alt: n,
291
291
  className: "h-16 w-16 object-cover"
292
- }) : /* @__PURE__ */ M(I, {
293
- size: u.LG,
294
- stroke: d,
292
+ }) : /* @__PURE__ */ N(L, {
293
+ size: f.LG,
294
+ stroke: p,
295
295
  "aria-hidden": !0,
296
- className: de.icon
296
+ className: pe.icon
297
297
  })
298
- }), /* @__PURE__ */ N("div", {
298
+ }), /* @__PURE__ */ P("div", {
299
299
  className: "flex flex-col gap-3",
300
- children: [/* @__PURE__ */ M(m, {
301
- size: p.Small,
302
- iconBefore: /* @__PURE__ */ M(L, {
303
- size: u.SM,
304
- stroke: d,
300
+ children: [/* @__PURE__ */ N(g, {
301
+ size: h.Small,
302
+ iconBefore: /* @__PURE__ */ N(R, {
303
+ size: f.SM,
304
+ stroke: p,
305
305
  "aria-hidden": !0
306
306
  }),
307
307
  className: "w-fit",
308
308
  label: r,
309
- onClick: o
310
- }), /* @__PURE__ */ M("span", {
311
- className: s(c, de.caption),
312
- children: a
309
+ onClick: a
310
+ }), /* @__PURE__ */ N("span", {
311
+ className: l(s, pe.caption),
312
+ children: i
313
313
  })]
314
314
  })]
315
315
  })]
316
316
  });
317
- }, pe = {
317
+ }, he = {
318
318
  confirmText: "_confirmText_19ec1_1",
319
319
  confirmItem: "_confirmItem_19ec1_5"
320
- }, me = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: a, allowedMimeTypes: o, maxFileSizeBytes: c, labels: l, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
321
- let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = z((e) => e.length === 1 ? l.deleteConfirmTitleSingle : l.deleteConfirmTitleMultiple, [l.deleteConfirmTitleSingle, l.deleteConfirmTitleMultiple]), h = z((e) => /* @__PURE__ */ M("div", {
322
- className: s(u, "px-6 py-3"),
323
- style: i({
320
+ }, ge = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: s, labels: c, confirmBodyClassName: u = "dial-small-text", styles: d }) => {
321
+ let f = d?.colors?.confirmText, p = d?.colors?.confirmItemText, m = z((e) => e.length === 1 ? c.deleteConfirmTitleSingle : c.deleteConfirmTitleMultiple, [c.deleteConfirmTitleSingle, c.deleteConfirmTitleMultiple]), h = z((e) => /* @__PURE__ */ N("div", {
322
+ className: l(u, "px-6 py-3"),
323
+ style: o({
324
324
  "--apm-confirm-text": f,
325
325
  "--apm-confirm-item-text": p
326
326
  }),
327
- children: /* @__PURE__ */ M("p", {
328
- className: s("mb-3", pe.confirmText),
329
- children: e.length === 1 ? /* @__PURE__ */ N(j, { children: [
330
- l.deleteConfirmSingleText,
327
+ children: /* @__PURE__ */ N("p", {
328
+ className: l("mb-3", he.confirmText),
329
+ children: e.length === 1 ? /* @__PURE__ */ P(M, { children: [
330
+ c.deleteConfirmSingleText,
331
331
  " ",
332
- /* @__PURE__ */ N("span", {
333
- className: s("wrap-break-word", pe.confirmItem),
332
+ /* @__PURE__ */ P("span", {
333
+ className: l("wrap-break-word", he.confirmItem),
334
334
  children: [
335
335
  "\"",
336
336
  e[0].split("/").pop(),
337
337
  "\"?"
338
338
  ]
339
339
  })
340
- ] }) : /* @__PURE__ */ N(j, { children: [
341
- l.deleteConfirmMultipleText,
340
+ ] }) : /* @__PURE__ */ P(M, { children: [
341
+ c.deleteConfirmMultipleText,
342
342
  " ",
343
- /* @__PURE__ */ N("span", {
344
- className: pe.confirmItem,
343
+ /* @__PURE__ */ P("span", {
344
+ className: he.confirmItem,
345
345
  children: [
346
346
  e.length,
347
347
  " ",
348
- l.deleteConfirmItemsLabel
348
+ c.deleteConfirmItemsLabel
349
349
  ]
350
350
  })
351
351
  ] })
352
352
  })
353
353
  }), [
354
- l.deleteConfirmSingleText,
355
- l.deleteConfirmMultipleText,
356
- l.deleteConfirmItemsLabel,
354
+ c.deleteConfirmSingleText,
355
+ c.deleteConfirmMultipleText,
356
+ c.deleteConfirmItemsLabel,
357
357
  f,
358
358
  p,
359
359
  u
360
360
  ]);
361
- return /* @__PURE__ */ M(R, {
361
+ return /* @__PURE__ */ N(ne, {
362
362
  fallback: null,
363
- children: e && /* @__PURE__ */ M(a, {
363
+ children: e && /* @__PURE__ */ N(i, {
364
364
  isOpen: e,
365
365
  onClose: t,
366
366
  onAttach: n,
367
367
  bucket: r,
368
- allowedTypes: o,
369
- maxSelectableFileSize: c,
368
+ allowedTypes: a,
369
+ maxSelectableFileSize: s,
370
370
  maximumAttachmentsAmount: 1,
371
371
  canAttachFolders: !1,
372
- title: l.title,
373
- attachLabel: l.attachLabel,
374
- emptyTitle: l.emptyTitle,
375
- emptyDescription: l.emptyDescription,
376
- errorMessage: l.errorMessage,
377
- retryLabel: l.retryLabel,
378
- hiddenFilesLabel: l.hiddenFilesLabel,
379
- showHiddenFilesLabel: l.showHiddenFilesLabel,
380
- hideHiddenFilesLabel: l.hideHiddenFilesLabel,
381
- getSelectionLabel: l.getSelectionLabel,
382
- uploadFilesLabel: l.uploadFilesLabel,
383
- newFolderLabel: l.newFolderLabel,
384
- downloadLabel: l.downloadLabel,
385
- downloadingLabel: l.downloadingLabel,
386
- deleteLabel: l.deleteLabel,
387
- deletingLabel: l.deletingLabel,
372
+ title: c.title,
373
+ attachLabel: c.attachLabel,
374
+ emptyTitle: c.emptyTitle,
375
+ emptyDescription: c.emptyDescription,
376
+ errorMessage: c.errorMessage,
377
+ retryLabel: c.retryLabel,
378
+ hiddenFilesLabel: c.hiddenFilesLabel,
379
+ showHiddenFilesLabel: c.showHiddenFilesLabel,
380
+ hideHiddenFilesLabel: c.hideHiddenFilesLabel,
381
+ getSelectionLabel: c.getSelectionLabel,
382
+ uploadFilesLabel: c.uploadFilesLabel,
383
+ newFolderLabel: c.newFolderLabel,
384
+ downloadLabel: c.downloadLabel,
385
+ downloadingLabel: c.downloadingLabel,
386
+ deleteLabel: c.deleteLabel,
387
+ deletingLabel: c.deletingLabel,
388
388
  deleteConfirmTitle: m,
389
389
  deleteConfirmBody: h,
390
- deleteConfirmLabel: l.deleteConfirmLabel,
391
- deleteCancelLabel: l.deleteCancelLabel
390
+ deleteConfirmLabel: c.deleteConfirmLabel,
391
+ deleteCancelLabel: c.deleteCancelLabel
392
392
  })
393
393
  });
394
394
  }, Q = /* @__PURE__ */ function(e) {
395
395
  return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
396
- }({}), he = [
396
+ }({}), _e = [
397
397
  "avatar",
398
398
  "name",
399
399
  "version",
400
400
  "description",
401
401
  "locales",
402
402
  "tags"
403
- ], ge = {
403
+ ], ve = {
404
404
  summary: "_summary_1hlc9_1",
405
405
  rowLabel: "_rowLabel_1hlc9_5"
406
- }, _e = (e, t, n) => ({
406
+ }, ye = (e, t, n) => ({
407
407
  id: e,
408
408
  language: n.find((e) => !t.has(e.code))?.code ?? "",
409
409
  name: "",
410
410
  description: ""
411
- }), ve = (e) => e.toUpperCase(), ye = ({ value: e, onChange: t, availableLocaleOptions: r = [], formatLocaleLabel: a = ve, labels: o, className: m, summaryClassName: h = "dial-body-text", rowLabelClassName: _ = "dial-tiny-lead-text", colors: y }) => {
412
- let b = i({
413
- "--dlf-summary-text": y?.summaryText,
414
- "--dlf-row-label-text": y?.rowLabelText
415
- }), { summaryLabel: x, addLabel: S, editLabel: w, popupTitle: T, addLocaleLabel: D, localeRowLabel: O = "Locale", languageLabel: j, nameLabel: P, namePlaceholder: F, descriptionLabel: I, descriptionPlaceholder: R, deleteAriaLabel: te, cancelLabel: z = "Cancel", saveLabel: re = "Save" } = o, [ie, B] = H(!1), [U, W] = H([]), G = V(0);
416
- ne(() => {
417
- ie && W(e.length > 0 ? e : [_e(`locale-row-${++G.current}`, /* @__PURE__ */ new Set(), r)]);
411
+ }), be = (e) => e.toUpperCase(), xe = ({ value: e, onChange: t, availableLocaleOptions: r = [], formatLocaleLabel: i = be, labels: a, className: s, summaryClassName: c = "dial-body-text", rowLabelClassName: g = "dial-tiny-lead-text", colors: _ }) => {
412
+ let y = o({
413
+ "--dlf-summary-text": _?.summaryText,
414
+ "--dlf-row-label-text": _?.rowLabelText
415
+ }), { summaryLabel: x, addLabel: S, editLabel: C, popupTitle: w, addLocaleLabel: E, localeRowLabel: D = "Locale", languageLabel: k, nameLabel: A, namePlaceholder: M, descriptionLabel: F, descriptionPlaceholder: I, deleteAriaLabel: L, cancelLabel: ne = "Cancel", saveLabel: re = "Save" } = a, [z, B] = W(!1), [V, H] = W([]), G = U(0);
416
+ ie(() => {
417
+ z && H(e.length > 0 ? e : [ye(`locale-row-${++G.current}`, /* @__PURE__ */ new Set(), r)]);
418
418
  }, [
419
- ie,
419
+ z,
420
420
  e,
421
421
  r
422
422
  ]);
423
- let ae = () => B(!0), oe = () => B(!1), K = () => {
424
- t(U.filter((e) => e.language && e.name)), B(!1);
423
+ let ae = () => B(!0), K = () => B(!1), oe = () => {
424
+ t(V.filter((e) => e.language && e.name)), B(!1);
425
425
  }, se = () => {
426
- let e = new Set(U.map((e) => e.language).filter(Boolean));
427
- W((t) => [...t, _e(`locale-row-${++G.current}`, e, r)]);
426
+ let e = new Set(V.map((e) => e.language).filter(Boolean));
427
+ H((t) => [...t, ye(`locale-row-${++G.current}`, e, r)]);
428
428
  }, q = (e, t) => {
429
- W((n) => n.map((n) => n.id === e ? {
429
+ H((n) => n.map((n) => n.id === e ? {
430
430
  ...n,
431
431
  ...t
432
432
  } : n));
433
433
  }, ce = (e) => {
434
- W((t) => t.filter((t) => t.id !== e));
435
- }, J = new Set(r.map((e) => e.code)), Y = (e) => e !== "" && !J.has(e), X = e.some((e) => Y(e.language)), le = new Set(U.map((e) => e.language).filter((e) => J.has(e))).size, Z = (t, n) => {
436
- let i = e.find((e) => e.id === t.id)?.language, o = [...new Set([i ?? "", t.language].filter(Y))];
434
+ H((t) => t.filter((t) => t.id !== e));
435
+ }, J = new Set(r.map((e) => e.code)), le = (e) => e !== "" && !J.has(e), Y = e.some((e) => le(e.language)), ue = new Set(V.map((e) => e.language).filter((e) => J.has(e))).size, X = (t, n) => {
436
+ let a = e.find((e) => e.id === t.id)?.language, o = [...new Set([a ?? "", t.language].filter(le))];
437
437
  return [...r.map((e) => ({
438
438
  value: e.code,
439
439
  label: e.label,
440
440
  disabled: n.has(e.code)
441
441
  })), ...o.map((e) => ({
442
442
  value: e,
443
- label: a(e),
443
+ label: i(e),
444
444
  disabled: n.has(e)
445
445
  }))];
446
- }, ue = U.some((e) => !e.language || !e.name);
447
- return r.length === 0 && !X ? null : /* @__PURE__ */ N("div", {
448
- className: s("flex items-center gap-2", m),
449
- style: b,
446
+ }, de = V.some((e) => !e.language || !e.name);
447
+ return r.length === 0 && !Y ? null : /* @__PURE__ */ P("div", {
448
+ className: l("flex items-center gap-2", s),
449
+ style: y,
450
450
  children: [
451
- e.length > 0 && /* @__PURE__ */ M("span", {
452
- className: s(ge.summary, h),
451
+ e.length > 0 && /* @__PURE__ */ N("span", {
452
+ className: l(ve.summary, c),
453
453
  children: `${x}: ${e.map((e) => `[${e.language.toUpperCase()}]`).join(", ")}`
454
454
  }),
455
- /* @__PURE__ */ M(v, {
456
- label: e.length > 0 ? w : S,
457
- iconBefore: /* @__PURE__ */ M(L, {
458
- size: u.SM,
455
+ /* @__PURE__ */ N(b, {
456
+ label: e.length > 0 ? C : S,
457
+ iconBefore: /* @__PURE__ */ N(R, {
458
+ size: f.SM,
459
459
  "aria-hidden": !0,
460
- stroke: d
460
+ stroke: p
461
461
  }),
462
462
  className: "px-0!",
463
463
  onClick: ae
464
464
  }),
465
- /* @__PURE__ */ M(C, {
466
- open: ie,
467
- header: T,
468
- onClose: oe,
465
+ /* @__PURE__ */ N(T, {
466
+ open: z,
467
+ header: w,
468
+ onClose: K,
469
469
  mainButtons: [{
470
- label: z,
471
- onClick: oe
470
+ label: ne,
471
+ onClick: K
472
472
  }, {
473
473
  label: re,
474
- variant: l.Primary,
475
- disabled: ue,
476
- onClick: K
474
+ variant: d.Primary,
475
+ disabled: de,
476
+ onClick: oe
477
477
  }],
478
- children: /* @__PURE__ */ N("div", {
478
+ children: /* @__PURE__ */ P("div", {
479
479
  className: "flex flex-col gap-8 px-6 py-3",
480
- style: b,
481
- children: [U.map((e, t) => {
482
- let r = new Set(U.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
483
- return /* @__PURE__ */ N("div", {
480
+ style: y,
481
+ children: [V.map((e, t) => {
482
+ let r = new Set(V.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
483
+ return /* @__PURE__ */ P("div", {
484
484
  className: "flex flex-col gap-2",
485
- children: [/* @__PURE__ */ N("div", {
485
+ children: [/* @__PURE__ */ P("div", {
486
486
  className: "flex items-center justify-between",
487
- children: [/* @__PURE__ */ N("span", {
488
- className: s(ge.rowLabel, _),
487
+ children: [/* @__PURE__ */ P("span", {
488
+ className: l(ve.rowLabel, g),
489
489
  children: [
490
- O,
490
+ D,
491
491
  " ",
492
492
  t + 1
493
493
  ]
494
- }), /* @__PURE__ */ M(f, {
495
- appearance: c.Ghost,
496
- size: p.Small,
497
- icon: /* @__PURE__ */ M(ee, {
498
- size: u.SM,
494
+ }), /* @__PURE__ */ N(m, {
495
+ appearance: u.Ghost,
496
+ size: h.Small,
497
+ icon: /* @__PURE__ */ N(te, {
498
+ size: f.SM,
499
499
  "aria-hidden": !0,
500
- stroke: d
500
+ stroke: p
501
501
  }),
502
- "aria-label": `${te} ${t + 1}`,
502
+ "aria-label": `${L} ${t + 1}`,
503
503
  onClick: () => ce(e.id)
504
504
  })]
505
- }), /* @__PURE__ */ N("div", {
505
+ }), /* @__PURE__ */ P("div", {
506
506
  role: "group",
507
- "aria-label": `${O} ${t + 1}`,
507
+ "aria-label": `${D} ${t + 1}`,
508
508
  className: "flex flex-col gap-5",
509
- children: [/* @__PURE__ */ N("div", {
509
+ children: [/* @__PURE__ */ P("div", {
510
510
  className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
511
- children: [/* @__PURE__ */ M(E, {
511
+ children: [/* @__PURE__ */ N(O, {
512
512
  id: `${e.id}-language`,
513
513
  labelProps: {
514
- label: j,
514
+ label: k,
515
515
  required: !0
516
516
  },
517
517
  className: "desktop:shrink-0 desktop:basis-40",
518
- options: Z(e, r),
518
+ options: X(e, r),
519
519
  value: e.language,
520
520
  onChange: (t) => q(e.id, { language: t })
521
- }), /* @__PURE__ */ M(g, {
521
+ }), /* @__PURE__ */ N(v, {
522
522
  id: `${e.id}-name`,
523
523
  containerClassName: "min-w-0 flex-1",
524
524
  required: !0,
525
525
  value: e.name,
526
526
  onChange: (t) => q(e.id, { name: t ?? "" }),
527
527
  labelProps: {
528
- label: P,
528
+ label: A,
529
529
  required: !0
530
530
  },
531
- placeholder: F
531
+ placeholder: M
532
532
  })]
533
- }), /* @__PURE__ */ M(k, {
533
+ }), /* @__PURE__ */ N(j, {
534
534
  id: `${e.id}-description`,
535
535
  className: n,
536
- resize: A.Vertical,
536
+ resize: ee.Vertical,
537
537
  value: e.description,
538
538
  onChange: (t) => q(e.id, { description: t }),
539
- labelProps: { label: I },
540
- placeholder: R
539
+ labelProps: { label: F },
540
+ placeholder: I
541
541
  })]
542
542
  })]
543
543
  }, e.id);
544
- }), /* @__PURE__ */ M(v, {
545
- label: D,
546
- iconBefore: /* @__PURE__ */ M(L, {
547
- size: u.SM,
544
+ }), /* @__PURE__ */ N(b, {
545
+ label: E,
546
+ iconBefore: /* @__PURE__ */ N(R, {
547
+ size: f.SM,
548
548
  "aria-hidden": !0,
549
- stroke: d
549
+ stroke: p
550
550
  }),
551
551
  className: "self-start",
552
552
  onClick: se,
553
- disabled: le >= r.length
553
+ disabled: ue >= r.length
554
554
  })]
555
555
  })
556
556
  })
557
557
  ]
558
558
  });
559
- }, be = "Add tags, comma separated", xe = "The version is changed with \"Save as new version\"", Se = "deployment-creation-form-description", Ce = ({ values: e, errors: t, onChange: i, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: c, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], formatLocaleLabel: p, fields: m = he, isNameReadOnly: h = !1, nameReadOnlyTooltip: _, isVersionReadOnly: v = !1, versionReadOnlyTooltip: y = xe, nameCaption: b, isDescriptionRequired: x = !1, descriptionCaption: S, renderDescription: C, focusRequestKey: w }) => {
560
- let T = V(null), E = V(null), D = V(null), j = V(!1), P = (e) => m.includes(e), F = P(Q.Name), I = P(Q.Version), L = !!(t.name || t.version || t.description), ee = V(w);
561
- ne(() => {
559
+ }, Se = "Add tags, comma separated", Ce = "The version is changed with \"Save as new version\"", we = "deployment-creation-form-description", Te = ({ values: e, errors: t, onChange: r, onNameBlur: i, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: c, labels: u, styles: d, availableLocaleOptions: f = [], formatLocaleLabel: p, fields: m = _e, isNameReadOnly: h = !1, nameReadOnlyTooltip: g, isVersionReadOnly: _ = !1, versionReadOnlyTooltip: y = Ce, nameCaption: b, isDescriptionRequired: x = !1, descriptionCaption: S, renderDescription: C, focusRequestKey: w }) => {
560
+ let T = U(null), E = U(null), D = U(null), O = U(!1), k = (e) => m.includes(e), M = k(Q.Name), F = k(Q.Version), I = !!(t.name || t.version || t.description), L = U(w);
561
+ ie(() => {
562
562
  let e = () => {
563
563
  t.name ? T.current?.focus() : t.version ? E.current?.focus() : t.description && D.current?.focus();
564
564
  };
565
- w === void 0 ? (L && !j.current && e(), j.current = L) : w !== ee.current && (ee.current = w, e());
565
+ w === void 0 ? (I && !O.current && e(), O.current = I) : w !== L.current && (L.current = w, e());
566
566
  }, [
567
567
  w,
568
- L,
568
+ I,
569
569
  t.name,
570
570
  t.version,
571
571
  t.description
572
572
  ]);
573
- let R = /* @__PURE__ */ M(k, {
574
- id: Se,
573
+ let R = /* @__PURE__ */ N(j, {
574
+ id: we,
575
575
  ref: D,
576
576
  value: e.description,
577
- onChange: (e) => i({ description: e }),
577
+ onChange: (e) => r({ description: e }),
578
578
  "aria-required": x || void 0,
579
579
  labelProps: C ? void 0 : {
580
580
  label: u.description.label,
@@ -586,31 +586,31 @@ var U = /* @__PURE__ */ function(e) {
586
586
  invalid: !!t.description,
587
587
  containerClassName: C ? void 0 : d?.field,
588
588
  className: n,
589
- resize: A.Vertical
589
+ resize: ee.Vertical
590
590
  });
591
- return /* @__PURE__ */ N("div", {
591
+ return /* @__PURE__ */ P("div", {
592
592
  role: u.ariaLabel ? "group" : void 0,
593
593
  "aria-label": u.ariaLabel,
594
- className: s("flex flex-col gap-4", d?.root),
594
+ className: l("flex flex-col gap-4", d?.root),
595
595
  children: [
596
- P(Q.Avatar) && /* @__PURE__ */ M(fe, {
596
+ k(Q.Avatar) && /* @__PURE__ */ N(me, {
597
597
  label: u.iconUrl.label,
598
- avatarUrl: c,
598
+ avatarUrl: s,
599
599
  addAvatarLabel: u.iconUrl.addAvatarLabel,
600
600
  captionText: u.iconUrl.captionText,
601
- onAddAvatarClick: l,
601
+ onAddAvatarClick: c,
602
602
  className: d?.field
603
603
  }),
604
- (F || I) && /* @__PURE__ */ N("div", {
605
- className: s("flex items-start gap-4", d?.field),
606
- children: [F && /* @__PURE__ */ M(g, {
604
+ (M || F) && /* @__PURE__ */ P("div", {
605
+ className: l("flex items-start gap-4", d?.field),
606
+ children: [M && /* @__PURE__ */ N(v, {
607
607
  id: "deployment-creation-form-name",
608
608
  inputRef: T,
609
609
  value: e.name,
610
- onChange: (e) => i({ name: e ?? "" }),
611
- onBlur: a,
610
+ onChange: (e) => r({ name: e ?? "" }),
611
+ onBlur: i,
612
612
  disabled: h,
613
- tooltipText: h ? _ : void 0,
613
+ tooltipText: h ? g : void 0,
614
614
  labelProps: {
615
615
  label: u.name.label,
616
616
  required: !0
@@ -619,102 +619,102 @@ var U = /* @__PURE__ */ function(e) {
619
619
  caption: b,
620
620
  error: t.name || void 0,
621
621
  invalid: !!t.name,
622
- containerClassName: I ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
623
- }), I && /* @__PURE__ */ M(g, {
622
+ containerClassName: F ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
623
+ }), F && /* @__PURE__ */ N(v, {
624
624
  id: "deployment-creation-form-version",
625
625
  inputRef: E,
626
626
  value: e.version,
627
627
  onChange: (e) => {
628
- v || i({ version: e ?? "" });
628
+ _ || r({ version: e ?? "" });
629
629
  },
630
- onBlur: v ? void 0 : o,
631
- readOnly: v,
632
- tooltipText: v ? y : void 0,
630
+ onBlur: _ ? void 0 : o,
631
+ readOnly: _,
632
+ tooltipText: _ ? y : void 0,
633
633
  labelProps: { label: u.version.label },
634
634
  placeholder: u.version.placeholder,
635
635
  error: t.version || void 0,
636
636
  invalid: !!t.version,
637
- containerClassName: F ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
637
+ containerClassName: M ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
638
638
  })]
639
639
  }),
640
- P(Q.Description) && (C ? /* @__PURE__ */ M("div", {
640
+ k(Q.Description) && (C ? /* @__PURE__ */ N("div", {
641
641
  className: d?.field,
642
- children: C(R, Se)
642
+ children: C(R, we)
643
643
  }) : R),
644
- P(Q.Locales) && /* @__PURE__ */ M(ye, {
644
+ k(Q.Locales) && /* @__PURE__ */ N(xe, {
645
645
  value: e.otherLocales,
646
- onChange: (e) => i({ otherLocales: e }),
646
+ onChange: (e) => r({ otherLocales: e }),
647
647
  availableLocaleOptions: f,
648
648
  formatLocaleLabel: p,
649
649
  labels: u.otherLocales,
650
650
  className: d?.field,
651
651
  colors: d?.localesColors
652
652
  }),
653
- P(Q.Tags) && /* @__PURE__ */ M("div", {
653
+ k(Q.Tags) && /* @__PURE__ */ N("div", {
654
654
  className: d?.field,
655
- children: /* @__PURE__ */ M(O, {
655
+ children: /* @__PURE__ */ N(A, {
656
656
  id: "deployment-creation-form-topics",
657
657
  labelProps: { label: u.topics.label },
658
- placeholder: u.topics.placeholder ?? be,
658
+ placeholder: u.topics.placeholder ?? Se,
659
659
  value: e.topics,
660
- onChange: (e) => i({ topics: e }),
661
- tagClassName: r
660
+ onChange: (e) => r({ topics: e }),
661
+ tagClassName: a
662
662
  })
663
663
  })
664
664
  ]
665
665
  });
666
- }, we = "border-0 p-4 desktop:p-8", Te = "border-0", Ee = "desktop:flex-1", De = "px-4 pt-4 desktop:px-6 desktop:pt-6", Oe = te(({ 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: C, setupSectionClassName: T, hasSetupSectionPadding: E = !0, labels: D, styles: O, dir: k }) => {
667
- let A = /* @__PURE__ */ M(y, {
668
- politeness: x.Assertive,
669
- className: v == null ? void 0 : De,
666
+ }, Ee = "border-0 p-4 desktop:p-8", De = "border-0", Oe = "desktop:flex-1", ke = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ae = re(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: c = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, asideData: h, asideTitle: g, asideSectionClassName: _, alert: v, resizableLeftColumn: y, metadataSectionClassName: b, setupSectionClassName: S, hasSetupSectionPadding: T = !0, labels: D, styles: O, dir: k }) => {
667
+ let A = /* @__PURE__ */ N(x, {
668
+ politeness: C.Assertive,
669
+ className: v == null ? void 0 : ke,
670
670
  children: v
671
- }), P = p != null;
672
- return /* @__PURE__ */ M(ue, {
671
+ }), j = p != null;
672
+ return /* @__PURE__ */ N(fe, {
673
673
  title: e,
674
674
  onBack: t,
675
675
  backAriaLabel: D?.backAriaLabel ?? "Back",
676
676
  isSaving: a,
677
- resizableLeftColumn: b,
677
+ resizableLeftColumn: y,
678
678
  labels: {
679
679
  savingStatusLabel: D?.savingStatusLabel ?? "Saving",
680
680
  resizeHandleLabel: D?.resizeHandleLabel,
681
681
  resizeHandleTooltip: D?.resizeHandleTooltip
682
682
  },
683
- rightContent: h == null ? void 0 : /* @__PURE__ */ M(X, {
683
+ rightContent: h == null ? void 0 : /* @__PURE__ */ N(X, {
684
684
  title: g,
685
685
  styles: O?.section,
686
- className: s(we, _, J.asideSection),
686
+ className: l(Ee, _, Y.asideSection),
687
687
  children: h
688
688
  }),
689
689
  styles: O?.layout,
690
690
  dir: k,
691
- actions: /* @__PURE__ */ N(j, { children: [c, !l && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(S, {
691
+ actions: /* @__PURE__ */ P(M, { children: [s, !c && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(w, {
692
692
  label: D?.cancelLabel ?? "Cancel",
693
693
  disabled: a,
694
694
  onClick: n
695
- }), /* @__PURE__ */ M(w, {
695
+ }), /* @__PURE__ */ N(E, {
696
696
  label: i,
697
697
  disabled: a || o,
698
698
  onClick: r
699
699
  })] })] }),
700
- leftContent: /* @__PURE__ */ N(j, { children: [
701
- !P && A,
702
- /* @__PURE__ */ M(X, {
700
+ leftContent: /* @__PURE__ */ P(M, { children: [
701
+ !j && A,
702
+ /* @__PURE__ */ N(X, {
703
703
  title: d === null ? void 0 : d ?? D?.metadataTitle ?? "Metadata",
704
704
  styles: O?.section,
705
- className: s(we, C, J.metadataSection),
705
+ className: l(Ee, b, Y.metadataSection),
706
706
  children: u
707
707
  }),
708
708
  f
709
709
  ] }),
710
- centerContent: P ? /* @__PURE__ */ N(j, { children: [A, /* @__PURE__ */ M(X, {
710
+ centerContent: j ? /* @__PURE__ */ P(M, { children: [A, /* @__PURE__ */ N(X, {
711
711
  title: m === null ? void 0 : m ?? D?.setupTitle ?? "Setup",
712
712
  styles: O?.section,
713
- className: s(E ? we : Te, Ee, T, J.setupSection),
713
+ className: l(T ? Ee : De, Oe, S, Y.setupSection),
714
714
  children: p
715
715
  })] }) : void 0
716
716
  });
717
- }), ke = {
717
+ }), je = {
718
718
  name: {
719
719
  label: "Name",
720
720
  placeholder: "Enter name"
@@ -753,7 +753,7 @@ var U = /* @__PURE__ */ function(e) {
753
753
  saveLabel: "Save"
754
754
  },
755
755
  ariaLabel: "Metadata"
756
- }, Ae = {
756
+ }, Me = {
757
757
  title: "Add avatar",
758
758
  attachLabel: "Attach",
759
759
  emptyTitle: "This folder is empty",
@@ -777,12 +777,12 @@ var U = /* @__PURE__ */ function(e) {
777
777
  deleteConfirmItemsLabel: "items?",
778
778
  deleteConfirmLabel: "Delete",
779
779
  deleteCancelLabel: "Cancel"
780
- }, je = te(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, formatLocaleLabel: s, fields: c = he, isNameReadOnly: l, nameReadOnlyTooltip: u, isVersionReadOnly: d, versionReadOnlyTooltip: f, nameCaption: p, isDescriptionRequired: m, descriptionCaption: h, renderDescription: g, focusRequestKey: _, labels: v }) => {
781
- let [y, b] = H(!1), x = B(() => a ? c : c.filter((e) => e !== Q.Avatar), [a, c]), S = e.iconUrl, C = a?.resolveIconUrl, w = B(() => C ? C(S) : void 0, [S, C]), T = z(() => b(!0), []), E = z(() => b(!1), []), D = a?.resolveAttachedIconUrl, O = z((e) => {
780
+ }, Ne = re(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, formatLocaleLabel: s, fields: c = _e, isNameReadOnly: l, nameReadOnlyTooltip: u, isVersionReadOnly: d, versionReadOnlyTooltip: f, nameCaption: p, isDescriptionRequired: m, descriptionCaption: h, renderDescription: g, focusRequestKey: _, labels: v }) => {
781
+ let [y, b] = W(!1), x = H(() => a ? c : c.filter((e) => e !== Q.Avatar), [a, c]), S = e.iconUrl, C = a?.resolveIconUrl, w = H(() => C ? C(S) : void 0, [S, C]), T = z(() => b(!0), []), E = z(() => b(!1), []), D = a?.resolveAttachedIconUrl, O = z((e) => {
782
782
  let t = D?.(e);
783
783
  t && n({ iconUrl: t }), b(!1);
784
784
  }, [n, D]);
785
- return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(Ce, {
785
+ return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(Te, {
786
786
  values: e,
787
787
  errors: t,
788
788
  onChange: n,
@@ -790,7 +790,7 @@ var U = /* @__PURE__ */ function(e) {
790
790
  onVersionBlur: i,
791
791
  iconPreviewUrl: w,
792
792
  onAddAvatarClick: T,
793
- labels: v?.form ?? ke,
793
+ labels: v?.form ?? je,
794
794
  availableLocaleOptions: o,
795
795
  formatLocaleLabel: s,
796
796
  fields: x,
@@ -803,7 +803,7 @@ var U = /* @__PURE__ */ function(e) {
803
803
  descriptionCaption: h,
804
804
  renderDescription: g,
805
805
  focusRequestKey: _
806
- }), a && /* @__PURE__ */ M(me, {
806
+ }), a && /* @__PURE__ */ N(ge, {
807
807
  isOpen: y,
808
808
  onClose: E,
809
809
  onAttach: O,
@@ -811,35 +811,38 @@ var U = /* @__PURE__ */ function(e) {
811
811
  FileManagerModal: a.FileManagerModal,
812
812
  allowedMimeTypes: a.allowedMimeTypes,
813
813
  maxFileSizeBytes: a.maxFileSizeBytes,
814
- labels: v?.avatarPicker ?? Ae
814
+ labels: v?.avatarPicker ?? Me
815
815
  })] });
816
816
  }), $ = /* @__PURE__ */ function(e) {
817
817
  return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
818
- }({}), Me = (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), Ne = (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]) && Me(e.otherLocales, t.otherLocales), Pe = (e) => Object.values(e).every((e) => e == null), Fe = /^[a-zA-Z0-9 _.-]+$/, Ie = /^[a-zA-Z0-9._-]+$/, Le = /^\d+(\.\d+)*$/, Re = "1.0.0", ze = (n, r = {}) => {
819
- let i = {}, s = n.name.trim();
820
- s ? a(s, t) ? i.name = $.TooLong : r.validateNamePattern && !Fe.test(s) ? i.name = $.InvalidFormat : o(s) && (i.name = $.ControlCharacters) : i.name = $.Required, a(n.description, e) && (i.description = $.TooLong);
821
- let c = n.version.trim();
822
- return r.validateVersionPattern && c && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern : Ie).test(c) || (i.version = $.InvalidFormat)), i;
823
- }, Be = /* @__PURE__ */ new Set([$.TooLong, $.ControlCharacters]), Ve = (e, t) => ({
818
+ }({}), Pe = (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), Fe = (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]) && Pe(e.otherLocales, t.otherLocales), Ie = (e) => Object.values(e).every((e) => e == null), Le = /^[a-zA-Z0-9 _.-]+$/, Re = r, ze = i, Be = (e, t) => t && e.validateVersionPattern === !0 ? {
819
+ ...e,
820
+ validateVersionPattern: ze
821
+ } : e, Ve = "1.0.0", He = (n, r = {}) => {
822
+ let i = {}, a = n.name.trim();
823
+ a ? s(a, t) ? i.name = $.TooLong : r.validateNamePattern && !Le.test(a) ? i.name = $.InvalidFormat : c(a) && (i.name = $.ControlCharacters) : i.name = $.Required, s(n.description, e) && (i.description = $.TooLong);
824
+ let o = n.version.trim();
825
+ return r.validateVersionPattern && o && ((r.validateVersionPattern instanceof RegExp ? r.validateVersionPattern : Re).test(o) || (i.version = $.InvalidFormat)), i;
826
+ }, Ue = /* @__PURE__ */ new Set([$.TooLong, $.ControlCharacters]), We = (e, t) => ({
824
827
  reseedKey: t,
825
828
  values: e,
826
829
  baseline: e,
827
830
  touched: {},
828
831
  hasAttemptedSubmit: !1,
829
832
  submitAttemptCount: 0
830
- }), He = ({ initialValues: e, validationOptions: t, reseedKey: n }) => {
831
- let [r, i] = H(() => Ve(e, n));
832
- r.reseedKey !== n && i(Ve(e, n));
833
- let a = t?.validateNamePattern, o = t?.validateVersionPattern, s = B(() => ze(r.values, {
833
+ }), Ge = ({ initialValues: e, validationOptions: t, reseedKey: n }) => {
834
+ let [r, i] = W(() => We(e, n));
835
+ r.reseedKey !== n && i(We(e, n));
836
+ let a = t?.validateNamePattern, o = t?.validateVersionPattern, s = H(() => He(r.values, {
834
837
  validateNamePattern: a,
835
838
  validateVersionPattern: o
836
839
  }), [
837
840
  r.values,
838
841
  a,
839
842
  o
840
- ]), c = B(() => {
843
+ ]), c = H(() => {
841
844
  if (r.hasAttemptedSubmit) return s;
842
- let e = (e, t) => e && (t || Be.has(e)) ? e : void 0;
845
+ let e = (e, t) => e && (t || Ue.has(e)) ? e : void 0;
843
846
  return {
844
847
  name: e(s.name, r.touched[Q.Name]),
845
848
  version: e(s.version, r.touched[Q.Version]),
@@ -849,8 +852,8 @@ var U = /* @__PURE__ */ function(e) {
849
852
  s,
850
853
  r.hasAttemptedSubmit,
851
854
  r.touched
852
- ]), l = V(s), u = V(e);
853
- ie(() => {
855
+ ]), l = U(s), u = U(e);
856
+ V(() => {
854
857
  l.current = s, u.current = e;
855
858
  });
856
859
  let d = z((e) => i((t) => ({
@@ -869,8 +872,8 @@ var U = /* @__PURE__ */ function(e) {
869
872
  ...e,
870
873
  hasAttemptedSubmit: !0,
871
874
  submitAttemptCount: e.submitAttemptCount + 1
872
- })), Pe(l.current)), []), m = z((e) => i((t) => Ve(e ?? u.current, t.reseedKey)), []), h = B(() => !Ne(r.values, r.baseline), [r.values, r.baseline]);
873
- return B(() => ({
875
+ })), Ie(l.current)), []), m = z((e) => i((t) => We(e ?? u.current, t.reseedKey)), []), h = H(() => !Fe(r.values, r.baseline), [r.values, r.baseline]);
876
+ return H(() => ({
874
877
  values: r.values,
875
878
  setValues: d,
876
879
  touched: r.touched,
@@ -893,10 +896,10 @@ var U = /* @__PURE__ */ function(e) {
893
896
  h,
894
897
  m
895
898
  ]);
896
- }, Ue = 1048576, We = [
899
+ }, Ke = 1048576, qe = [
897
900
  "image/png",
898
901
  "image/jpeg",
899
902
  "image/svg+xml"
900
903
  ];
901
904
  //#endregion
902
- export { We as AVATAR_ALLOWED_MIME_TYPES, Ue as AVATAR_MAX_FILE_SIZE_BYTES, fe as AddAvatar, me as AvatarPickerModal, J as BUILDER_FORM_CLASS, U as BuilderFormActionsOrder, ce as BuilderFormContainer, Re as DEFAULT_DEPLOYMENT_VERSION, ke as DEFAULT_METADATA_FORM_LABELS, $ as DeploymentCreationFieldErrorCode, Ce as DeploymentCreationForm, ye as DeploymentLocalesField, ue as EditorLayout, X as EditorSection, Oe as EntityEditor, Q as MetadataField, je as MetadataForm, Fe as NAME_PATTERN, Le as SEMVER_VERSION_PATTERN, Ie as VERSION_PATTERN, He as useMetadataForm, ze as validateDeploymentCreationFields };
905
+ export { qe as AVATAR_ALLOWED_MIME_TYPES, Ke as AVATAR_MAX_FILE_SIZE_BYTES, me as AddAvatar, ge as AvatarPickerModal, Y as BUILDER_FORM_CLASS, G as BuilderFormActionsOrder, le as BuilderFormContainer, Ve as DEFAULT_DEPLOYMENT_VERSION, je as DEFAULT_METADATA_FORM_LABELS, $ as DeploymentCreationFieldErrorCode, Te as DeploymentCreationForm, xe as DeploymentLocalesField, fe as EditorLayout, X as EditorSection, Ae as EntityEditor, Q as MetadataField, Ne as MetadataForm, Le as NAME_PATTERN, ze as STORED_VERSION_PATTERN, Re as VERSION_PATTERN, Ge as useMetadataForm, He as validateDeploymentCreationFields, Be as withStoredVersionRule };
@@ -25,8 +25,8 @@ export interface DeploymentCreationFormValidationOptions {
25
25
  /**
26
26
  * Whether to reject a non-empty version that doesn't match a pattern.
27
27
  * `true` checks against the default `VERSION_PATTERN`; passing a `RegExp`
28
- * checks against that pattern instead (e.g. `SEMVER_VERSION_PATTERN` for a
29
- * host that requires a strict dot-separated numeric version).
28
+ * checks against that pattern instead (e.g. a stricter pattern for a
29
+ * host that requires a dot-separated numeric version).
30
30
  */
31
31
  validateVersionPattern?: boolean | RegExp;
32
32
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-builder-form",
3
3
  "description": "Presentational builder form shells, editor layouts, and shared deployment field sets for composing and editing DIAL entities",
4
- "version": "1.3.5",
4
+ "version": "1.4.0-dev.101",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": [
7
7
  "**/*.css",
@@ -24,7 +24,7 @@
24
24
  "@tabler/icons-react": "^3.50.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@epam/ai-dial-chat-shared": "1.3.5",
27
+ "@epam/ai-dial-chat-shared": "1.4.0-dev.101",
28
28
  "@epam/ai-dial-ui-kit": "^0.16.0",
29
29
  "react": "^19.2.8"
30
30
  },
@@ -2,10 +2,16 @@ import { DeploymentCreationFormValues } from '../models/deployment-creation-form
2
2
  import { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions } from '../models/validation';
3
3
  /** Allowed characters for the name field: letters, digits, spaces, underscores, dots, dashes. */
4
4
  export declare const NAME_PATTERN: RegExp;
5
- /** Allowed characters for the version field: letters, digits, dots, underscores, dashes. */
5
+ /** Default version rule: `RESOURCE_VERSION_PATTERN` from `@epam/ai-dial-chat-shared` (1-64 of letters, digits, `_`, `.`, `+`, `-`; no trailing dot, no `__`, no leading `_`). */
6
6
  export declare const VERSION_PATTERN: RegExp;
7
- /** Stricter version shape: one or more dot-separated numeric segments (e.g. `0.0.1`). */
8
- export declare const SEMVER_VERSION_PATTERN: RegExp;
7
+ /** Version rule for a deployment that already exists: `STORED_RESOURCE_VERSION_PATTERN` from `@epam/ai-dial-chat-shared`. */
8
+ export declare const STORED_VERSION_PATTERN: RegExp;
9
+ /**
10
+ * Returns the validation options with the version check switched to `STORED_VERSION_PATTERN` in edit mode, so a version stored under the earlier, looser rules still saves unchanged.
11
+ * @param options - validation options of the create form
12
+ * @param isEditMode - whether an existing deployment is being edited
13
+ */
14
+ export declare const withStoredVersionRule: (options: DeploymentCreationFormValidationOptions, isEditMode: boolean) => DeploymentCreationFormValidationOptions;
9
15
  /** Version a new deployment's create form opens with; a SemVer 2.0.0 value the host seeds into its create-mode metadata. */
10
16
  export declare const DEFAULT_DEPLOYMENT_VERSION = "1.0.0";
11
17
  /** Validates the General-step fields and returns untranslated error codes; has no side effects. */
@@ -1 +1 @@
1
- {"version":3,"file":"validate-deployment-creation-fields.d.ts","sourceRoot":"","sources":["../../src/utils/validate-deployment-creation-fields.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EACV,gCAAgC,EAChC,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAG9B,iGAAiG;AACjG,eAAO,MAAM,YAAY,QAAuB,CAAC;AAEjD,4FAA4F;AAC5F,eAAO,MAAM,eAAe,QAAsB,CAAC;AAEnD,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,QAAkB,CAAC;AAEtD,4HAA4H;AAC5H,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAElD,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,4BAA4B,EACpC,UAAS,uCAA4C,KACpD,gCA8BF,CAAC"}
1
+ {"version":3,"file":"validate-deployment-creation-fields.d.ts","sourceRoot":"","sources":["../../src/utils/validate-deployment-creation-fields.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,KAAK,EACV,gCAAgC,EAChC,uCAAuC,EACxC,MAAM,sBAAsB,CAAC;AAG9B,iGAAiG;AACjG,eAAO,MAAM,YAAY,QAAuB,CAAC;AAEjD,iLAAiL;AACjL,eAAO,MAAM,eAAe,QAA2B,CAAC;AAExD,6HAA6H;AAC7H,eAAO,MAAM,sBAAsB,QAAkC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,uCAAuC,EAChD,YAAY,OAAO,KAClB,uCAGU,CAAC;AAEd,4HAA4H;AAC5H,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAElD,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,4BAA4B,EACpC,UAAS,uCAA4C,KACpD,gCA8BF,CAAC"}