@epam/ai-dial-publish-panel 1.2.0-dev.274 → 1.2.0-dev.276

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,46 +1,46 @@
1
1
  import { useCallback as e, useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
2
- import { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, GhostButton as d, GhostIconButton as f, Input as p, NeutralButton as m, Notification as h, NotificationType as g, NotificationVariant as _, Search as v, Select as y, SideDrawer as ee, Spinner as b, Tag as x, TagInput as S } from "@epam/ai-dial-ui-kit";
3
- import { ResourceSummary as C, TAG_INPUT_TAG_CLASS_NAME as w, buildCssVars as T, mergeClasses as E } from "@epam/ai-dial-chat-shared";
4
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
5
- import { IconFolderPlus as te, IconPlus as A, IconTrashX as j } from "@tabler/icons-react";
6
- import { DialFileNodeType as M, DialFoldersTree as ne } from "@epam/ai-dial-react-file-manager";
2
+ import { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, GhostButton as d, GhostIconButton as f, Input as p, NeutralButton as m, Notification as h, NotificationType as g, NotificationVariant as _, Search as ee, Select as v, SideDrawer as y, Spinner as b, Tag as x, TagInput as S } from "@epam/ai-dial-ui-kit";
3
+ import { ResourceSummary as C, TAG_INPUT_TAG_CLASS_NAME as w, buildCssVars as te, mergeClasses as T } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
5
+ import { IconFolderPlus as ne, IconPlus as k, IconTrashX as re } from "@tabler/icons-react";
6
+ import { DialFileNodeType as A, DialFoldersTree as ie } from "@epam/ai-dial-react-file-manager";
7
7
  //#region src/models/publish.ts
8
- var N = /* @__PURE__ */ function(e) {
8
+ var j = /* @__PURE__ */ function(e) {
9
9
  return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
10
- }({}), P = /* @__PURE__ */ function(e) {
10
+ }({}), M = /* @__PURE__ */ function(e) {
11
11
  return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
12
- }({}), F = (e) => e.isSubmitting ? {
13
- calloutKind: P.None,
12
+ }({}), N = (e) => e.isSubmitting ? {
13
+ calloutKind: M.None,
14
14
  isSubmitDisabled: !0,
15
15
  isSubmitLoading: !0
16
16
  } : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
17
- calloutKind: P.SubmitError,
17
+ calloutKind: M.SubmitError,
18
18
  isSubmitDisabled: !1,
19
19
  isSubmitLoading: !1
20
20
  } : e.hasExistingPublicationInFolder ? {
21
- calloutKind: P.ReplaceWarning,
21
+ calloutKind: M.ReplaceWarning,
22
22
  isSubmitDisabled: e.allowReplace === !1,
23
23
  isSubmitLoading: !1
24
24
  } : {
25
- calloutKind: P.Info,
25
+ calloutKind: M.Info,
26
26
  isSubmitDisabled: !1,
27
27
  isSubmitLoading: !1
28
28
  } : {
29
- calloutKind: P.NoAccess,
29
+ calloutKind: M.NoAccess,
30
30
  isSubmitDisabled: !0,
31
31
  isSubmitLoading: !1
32
32
  } : {
33
- calloutKind: P.None,
33
+ calloutKind: M.None,
34
34
  isSubmitDisabled: !0,
35
35
  isSubmitLoading: !1
36
- }, I = 1440 * 60 * 1e3, L = (e, t = Date.now(), n) => {
37
- let r = Math.floor((t - e) / I);
36
+ }, P = 1440 * 60 * 1e3, F = (e, t = Date.now(), n) => {
37
+ let r = Math.floor((t - e) / P);
38
38
  return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
39
39
  month: "short",
40
40
  day: "numeric",
41
41
  year: "numeric"
42
42
  });
43
- }, re = (e, t, n) => t.length === 0 ? [...e, {
43
+ }, I = (e, t, n) => t.length === 0 ? [...e, {
44
44
  path: [n],
45
45
  name: n
46
46
  }] : e.map((e) => e.path.join("/") === t.join("/") ? {
@@ -51,46 +51,46 @@ var N = /* @__PURE__ */ function(e) {
51
51
  }]
52
52
  } : {
53
53
  ...e,
54
- children: e.children ? re(e.children, t, n) : e.children
55
- }), R = (e, t, n) => {
54
+ children: e.children ? I(e.children, t, n) : e.children
55
+ }), L = (e, t, n) => {
56
56
  let r = [...t, n].join("/");
57
57
  return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
58
58
  ...e,
59
59
  children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
60
60
  } : {
61
61
  ...e,
62
- children: e.children ? R(e.children, t, n) : e.children
62
+ children: e.children ? L(e.children, t, n) : e.children
63
63
  });
64
- }, z = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
64
+ }, R = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
65
65
  let [m, h] = a(o);
66
66
  t(() => {
67
67
  h(o);
68
68
  }, [o]);
69
- let [g, _] = a(), [v, y] = a(!1), [ee, b] = a(!1), [x, S] = a([]), [C, w] = a(!1), [T, E] = a(!1), [D, O] = a(c), [k, te] = a(!1), [A, j] = a(!1);
69
+ let [g, _] = a(), [ee, v] = a(!1), [y, b] = a(!1), [x, S] = a([]), [C, w] = a(!1), [te, T] = a(!1), [E, D] = a(c), [O, ne] = a(!1), [k, re] = a(!1);
70
70
  t(() => {
71
- A || O(c);
72
- }, [c, A]);
73
- let M = e((e) => {
74
- j(!0), O(e);
71
+ k || D(c);
72
+ }, [c, k]);
73
+ let A = e((e) => {
74
+ re(!0), D(e);
75
75
  }, []);
76
76
  t(() => {
77
77
  if (g == null) {
78
- S([]), E(!1);
78
+ S([]), T(!1);
79
79
  return;
80
80
  }
81
81
  if (!p) return;
82
82
  let e = !1;
83
- return w(!0), E(!1), p(g).then((t) => {
83
+ return w(!0), T(!1), p(g).then((t) => {
84
84
  e || S(t);
85
85
  }).catch(() => {
86
- e || E(!0);
86
+ e || T(!0);
87
87
  }).finally(() => {
88
88
  e || w(!1);
89
89
  }), () => {
90
90
  e = !0;
91
91
  };
92
92
  }, [g]);
93
- let ne = r(() => {
93
+ let ie = r(() => {
94
94
  if (!g) return !1;
95
95
  let e = g.join("/");
96
96
  return i.some((t) => t.folderPath.join("/") === e ? n.version == null ? !0 : t.version === n.version : !1);
@@ -98,126 +98,126 @@ var N = /* @__PURE__ */ function(e) {
98
98
  i,
99
99
  n.version,
100
100
  g
101
- ]), N = e(async (e, t) => {
102
- h((n) => re(n, e, t));
101
+ ]), j = e(async (e, t) => {
102
+ h((n) => I(n, e, t));
103
103
  try {
104
104
  await l?.(e, t);
105
105
  } catch {
106
- h((n) => R(n, e, t)), b(!0);
106
+ h((n) => L(n, e, t)), b(!0);
107
107
  }
108
- }, [l]), P = e(async () => {
108
+ }, [l]), M = e(async () => {
109
109
  if (!g) return !1;
110
- y(!0), b(!1);
110
+ v(!0), b(!1);
111
111
  try {
112
- return await u(n, g, x, D.trim(), k), d?.(n, g), !0;
112
+ return await u(n, g, x, E.trim(), O), d?.(n, g), !0;
113
113
  } catch (e) {
114
114
  return b(!0), f?.(n, g, e), !1;
115
115
  } finally {
116
- y(!1);
116
+ v(!1);
117
117
  }
118
118
  }, [
119
- D,
119
+ E,
120
120
  n,
121
121
  u,
122
122
  f,
123
123
  d,
124
- k,
124
+ O,
125
125
  x,
126
126
  g
127
- ]), F = e(() => {
128
- h(o), _(void 0), b(!1), S([]), E(!1), O(c), j(!1), te(!1);
127
+ ]), N = e(() => {
128
+ h(o), _(void 0), b(!1), S([]), T(!1), D(c), re(!1), ne(!1);
129
129
  }, [c, o]);
130
130
  return {
131
131
  folderItems: m,
132
132
  selectedFolderPath: g,
133
133
  setSelectedFolderPath: _,
134
- handleCreateFolder: N,
135
- hasExistingPublicationInFolder: ne,
134
+ handleCreateFolder: j,
135
+ hasExistingPublicationInFolder: ie,
136
136
  hasWriteAccess: g ? s(g) : !0,
137
- isSubmitting: v,
138
- hasSubmitError: ee,
139
- handleSubmit: P,
140
- reset: F,
137
+ isSubmitting: ee,
138
+ hasSubmitError: y,
139
+ handleSubmit: M,
140
+ reset: N,
141
141
  rules: x,
142
142
  setRules: S,
143
- author: D,
144
- setAuthor: M,
145
- publishCredentials: k,
146
- setPublishCredentials: te,
143
+ author: E,
144
+ setAuthor: A,
145
+ publishCredentials: O,
146
+ setPublishCredentials: ne,
147
147
  isRulesLoading: C,
148
- hasRulesLoadError: T
148
+ hasRulesLoadError: te
149
149
  };
150
- }, B = (e, t) => {
150
+ }, ae = (e, t) => {
151
151
  let n = t.trim().toLowerCase();
152
152
  return n ? e.reduce((e, r) => {
153
- let i = r.children ? B(r.children, t) : void 0;
153
+ let i = r.children ? ae(r.children, t) : void 0;
154
154
  return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
155
155
  ...r,
156
156
  children: i
157
157
  }), e;
158
158
  }, []) : e;
159
- }, V = (e, t) => e.localeCompare(t, void 0, {
159
+ }, z = (e, t) => e.localeCompare(t, void 0, {
160
160
  sensitivity: "base",
161
161
  numeric: !0
162
- }), H = (e) => [...e].sort((e, t) => V(e.name, t.name)).map((e) => e.children ? {
162
+ }), B = (e) => [...e].sort((e, t) => z(e.name, t.name)).map((e) => e.children ? {
163
163
  ...e,
164
- children: H(e.children)
165
- } : e), U = (e, t, n) => {
164
+ children: B(e.children)
165
+ } : e), V = (e, t, n) => {
166
166
  let [r, ...i] = t;
167
167
  if (r == null) return e;
168
168
  let a = [...n, r], o = e.find((e) => e.name === r);
169
169
  return o ? i.length ? e.map((e) => e === o ? {
170
170
  ...e,
171
- children: U(e.children ?? [], i, a)
171
+ children: V(e.children ?? [], i, a)
172
172
  } : e) : e : [...e, {
173
173
  path: a,
174
174
  name: r,
175
- children: i.length ? U([], i, a) : void 0
175
+ children: i.length ? V([], i, a) : void 0
176
176
  }];
177
- }, W = (e, t) => t.reduce((e, t) => t.length ? U(e, t, []) : e, e), G = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? G(e.children) : []]), K = (e) => e.join("/"), q = (e) => e.split("/").filter(Boolean), ie = (e) => e.map((e) => {
178
- let t = K(e.path);
177
+ }, oe = (e, t) => t.reduce((e, t) => t.length ? V(e, t, []) : e, e), H = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? H(e.children) : []]), U = (e) => e.join("/"), W = (e) => e.split("/").filter(Boolean), se = (e) => e.map((e) => {
178
+ let t = U(e.path);
179
179
  return {
180
180
  path: t,
181
181
  name: e.name,
182
182
  folderId: t,
183
183
  nodeType: u.FOLDER,
184
- items: e.children ? ie(e.children) : void 0
184
+ items: e.children ? se(e.children) : void 0
185
185
  };
186
- }), J = /[/\\:;,={}&"]/, ae = (e, t, n) => {
186
+ }), G = /[/\\:;,={}&"]/, ce = (e, t, n) => {
187
187
  let r = e.trim();
188
- return r ? r.includes("..") || J.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
189
- }, oe = (e, t) => {
188
+ return r ? r.includes("..") || G.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
189
+ }, le = (e, t) => {
190
190
  let n = new Set(t.map((e) => e.toLowerCase()));
191
191
  if (!n.has(e.toLowerCase())) return e;
192
192
  let r = 2;
193
193
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
194
194
  return `${e} ${r}`;
195
- }, se = (e, t) => {
195
+ }, ue = (e, t) => {
196
196
  if (t.length === 0) return e.map((e) => e.name);
197
- let n = K(t), r = (e) => {
197
+ let n = U(t), r = (e) => {
198
198
  for (let t of e) {
199
- if (K(t.path) === n) return t;
199
+ if (U(t.path) === n) return t;
200
200
  let e = t.children ? r(t.children) : void 0;
201
201
  if (e) return e;
202
202
  }
203
203
  };
204
204
  return (r(e)?.children ?? []).map((e) => e.name);
205
- }, Y = {
205
+ }, K = {
206
206
  dialog: "_dialog_jqcm2_5",
207
207
  error: "_error_jqcm2_14",
208
208
  selectField: "_selectField_jqcm2_28",
209
209
  selectFieldOpen: "_selectFieldOpen_jqcm2_40"
210
- }, ce = 20, X = 200, le = 8, ue = (e) => {
210
+ }, q = 20, J = 200, de = 8, Y = (e) => {
211
211
  let t = e.trim();
212
- if (t.length === 0 || t.length > X) return !1;
212
+ if (t.length === 0 || t.length > J) return !1;
213
213
  try {
214
214
  return new RegExp(t) instanceof RegExp;
215
215
  } catch {
216
216
  return !1;
217
217
  }
218
- }, de = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = ce, labels: u = {}, errorClassName: f = "dial-small-text", styles: h = {} }) => {
218
+ }, fe = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = q, labels: u = {}, errorClassName: f = "dial-small-text", styles: h = {} }) => {
219
219
  let g = {
220
- ...T({
220
+ ...te({
221
221
  "--pare-mobile-bg": h.colors?.mobileBackground,
222
222
  "--pare-bg": h.colors?.background,
223
223
  "--pare-error-text": h.colors?.errorText,
@@ -227,128 +227,128 @@ var N = /* @__PURE__ */ function(e) {
227
227
  "--pare-select-border-focus": h.colors?.selectBorderFocus
228
228
  }),
229
229
  ...h.cssVars
230
- }, { sourceLabel: _ = "Source", sourcePlaceholder: v = "Select...", functionLabel: ee = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: D = "Targets", targetsPlaceholder: te = "Add a target", targetsHintLabel: A = "Press Enter or comma to add a target.", patternLabel: j = "Pattern", patternPlaceholder: M = "Enter a regular expression", invalidRegexError: ne = "Enter a valid regular expression.", requiredFieldError: P = "This field is required.", targetsRequiredError: F = "Add at least one target.", saveLabel: I = "Save", cancelLabel: L = "Cancel", dialogAriaLabel: re = "Add access rule" } = u, R = n(), z = n(), B = n(), V = n(), H = i(null);
230
+ }, { sourceLabel: _ = "Source", sourcePlaceholder: ee = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: E = "Targets", targetsPlaceholder: ne = "Add a target", targetsHintLabel: k = "Press Enter or comma to add a target.", patternLabel: re = "Pattern", patternPlaceholder: A = "Enter a regular expression", invalidRegexError: ie = "Enter a valid regular expression.", requiredFieldError: M = "This field is required.", targetsRequiredError: N = "Add at least one target.", saveLabel: P = "Save", cancelLabel: F = "Cancel", dialogAriaLabel: I = "Add access rule" } = u, L = n(), R = n(), ae = n(), z = n(), B = i(null);
231
231
  t(() => {
232
- H.current?.focus();
232
+ B.current?.focus();
233
233
  }, []);
234
- let [U, W] = a(), [G, K] = a(), [q, ie] = a([]), [J, ae] = a(""), [oe, se] = a(!1), [X, de] = a(!1), [Z, fe] = a(!1), pe = E(Y.selectField, oe && Y.selectFieldOpen), me = E(Y.selectField, X && Y.selectFieldOpen), Q = r(() => e.map((e) => ({
234
+ let [V, oe] = a(), [H, U] = a(), [W, se] = a([]), [G, ce] = a(""), [le, ue] = a(!1), [J, fe] = a(!1), [X, pe] = a(!1), me = T(K.selectField, le && K.selectFieldOpen), he = T(K.selectField, J && K.selectFieldOpen), Z = r(() => e.map((e) => ({
235
235
  value: e,
236
236
  label: e
237
- })), [e]), he = r(() => [
237
+ })), [e]), ge = r(() => [
238
238
  {
239
- value: N.Equal,
239
+ value: j.Equal,
240
240
  label: b
241
241
  },
242
242
  {
243
- value: N.Contain,
243
+ value: j.Contain,
244
244
  label: x
245
245
  },
246
246
  {
247
- value: N.Regex,
247
+ value: j.Regex,
248
248
  label: C
249
249
  }
250
250
  ], [
251
251
  b,
252
252
  x,
253
253
  C
254
- ]), ge = G === N.Regex, $ = ue(J), _e = U != null && G != null && (ge ? $ : q.length > 0);
255
- return /* @__PURE__ */ k("div", {
256
- ref: H,
254
+ ]), _e = H === j.Regex, Q = Y(G), ve = V != null && H != null && (_e ? Q : W.length > 0);
255
+ return /* @__PURE__ */ O("div", {
256
+ ref: B,
257
257
  role: "dialog",
258
258
  "aria-modal": "true",
259
- "aria-label": re,
259
+ "aria-label": I,
260
260
  tabIndex: -1,
261
261
  onKeyDown: (e) => {
262
262
  e.key === "Escape" && (e.stopPropagation(), s());
263
263
  },
264
264
  style: g,
265
- className: E("fixed inset-0 z-[60] flex flex-col gap-3 overflow-y-auto p-4", "desktop:static desktop:z-auto desktop:flex-none desktop:overflow-visible desktop:rounded-lg desktop:p-3", Y.dialog),
265
+ className: T("fixed inset-0 z-[60] flex flex-col gap-3 overflow-y-auto p-4", "desktop:static desktop:z-auto desktop:flex-none desktop:overflow-visible desktop:rounded-lg desktop:p-3", K.dialog),
266
266
  children: [
267
- /* @__PURE__ */ O(y, {
268
- id: z,
267
+ /* @__PURE__ */ D(v, {
268
+ id: R,
269
269
  labelProps: { label: _ },
270
- options: Q,
271
- value: U,
270
+ options: Z,
271
+ value: V,
272
272
  onChange: (e) => {
273
- W(Array.isArray(e) ? e[0] : e), se(!1);
273
+ oe(Array.isArray(e) ? e[0] : e), ue(!1);
274
274
  },
275
- placeholder: v,
276
- searchable: e.length > le,
277
- searchPlaceholder: v,
275
+ placeholder: ee,
276
+ searchable: e.length > de,
277
+ searchPlaceholder: ee,
278
278
  disabled: c,
279
- open: oe,
280
- onOpenChange: se,
281
- fieldClassName: pe,
282
- invalid: Z && U == null,
283
- error: Z && U == null ? P : void 0
279
+ open: le,
280
+ onOpenChange: ue,
281
+ fieldClassName: me,
282
+ invalid: X && V == null,
283
+ error: X && V == null ? M : void 0
284
284
  }),
285
- /* @__PURE__ */ O(y, {
286
- labelProps: { label: ee },
287
- id: B,
288
- options: he,
289
- value: G,
285
+ /* @__PURE__ */ D(v, {
286
+ labelProps: { label: y },
287
+ id: ae,
288
+ options: ge,
289
+ value: H,
290
290
  onChange: (e) => {
291
291
  let t = Array.isArray(e) ? e[0] : e;
292
- G === N.Regex != (t === N.Regex) && (ie([]), ae("")), K(t), de(!1);
292
+ H === j.Regex != (t === j.Regex) && (se([]), ce("")), U(t), fe(!1);
293
293
  },
294
- placeholder: ee,
294
+ placeholder: y,
295
295
  disabled: c,
296
- open: X,
297
- onOpenChange: de,
298
- fieldClassName: me,
299
- invalid: Z && G == null,
300
- error: Z && G == null ? P : void 0
296
+ open: J,
297
+ onOpenChange: fe,
298
+ fieldClassName: he,
299
+ invalid: X && H == null,
300
+ error: X && H == null ? M : void 0
301
301
  }),
302
- ge ? /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O(p, {
303
- id: `${R}-input`,
304
- labelProps: { label: j },
305
- placeholder: M,
306
- value: J,
307
- onChange: (e) => ae(e ?? ""),
308
- invalid: (J.length > 0 || Z) && !$,
309
- "aria-describedby": (J.length > 0 || Z) && !$ ? R : void 0,
302
+ _e ? /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D(p, {
303
+ id: `${L}-input`,
304
+ labelProps: { label: re },
305
+ placeholder: A,
306
+ value: G,
307
+ onChange: (e) => ce(e ?? ""),
308
+ invalid: (G.length > 0 || X) && !Q,
309
+ "aria-describedby": (G.length > 0 || X) && !Q ? L : void 0,
310
310
  disabled: c
311
- }), (J.length > 0 || Z) && !$ && /* @__PURE__ */ O("span", {
312
- id: R,
311
+ }), (G.length > 0 || X) && !Q && /* @__PURE__ */ D("span", {
312
+ id: L,
313
313
  role: "alert",
314
- className: E("mt-1 block", f, Y.error),
315
- children: ne
316
- })] }) : /* @__PURE__ */ O(S, {
317
- id: V,
318
- labelProps: { label: D },
319
- placeholder: te,
320
- caption: Z && q.length === 0 ? void 0 : A,
321
- error: Z && q.length === 0 ? F : void 0,
322
- invalid: Z && q.length === 0,
323
- value: q,
314
+ className: T("mt-1 block", f, K.error),
315
+ children: ie
316
+ })] }) : /* @__PURE__ */ D(S, {
317
+ id: z,
318
+ labelProps: { label: E },
319
+ placeholder: ne,
320
+ caption: X && W.length === 0 ? void 0 : k,
321
+ error: X && W.length === 0 ? N : void 0,
322
+ invalid: X && W.length === 0,
323
+ value: W,
324
324
  onChange: (e) => {
325
325
  let t = [];
326
326
  for (let n of e) {
327
327
  let e = n.trim();
328
328
  if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= l)) break;
329
329
  }
330
- ie(t);
330
+ se(t);
331
331
  },
332
332
  disabled: c,
333
333
  tagClassName: w
334
334
  }),
335
- /* @__PURE__ */ k("div", {
335
+ /* @__PURE__ */ O("div", {
336
336
  className: "mt-auto flex justify-end gap-2 desktop:mt-2",
337
- children: [/* @__PURE__ */ O(d, {
338
- label: L,
337
+ children: [/* @__PURE__ */ D(d, {
338
+ label: F,
339
339
  onClick: s,
340
340
  disabled: c
341
- }), /* @__PURE__ */ O(m, {
342
- label: I,
341
+ }), /* @__PURE__ */ D(m, {
342
+ label: P,
343
343
  onClick: () => {
344
- if (!_e || U == null || G == null) {
345
- fe(!0);
344
+ if (!ve || V == null || H == null) {
345
+ pe(!0);
346
346
  return;
347
347
  }
348
348
  o({
349
- source: U,
350
- function: G,
351
- targets: ge ? [J.trim()] : q
349
+ source: V,
350
+ function: H,
351
+ targets: _e ? [G.trim()] : W
352
352
  });
353
353
  },
354
354
  disabled: c
@@ -356,165 +356,165 @@ var N = /* @__PURE__ */ function(e) {
356
356
  })
357
357
  ]
358
358
  });
359
- }, Z = {
359
+ }, X = {
360
360
  ruleRow: "_ruleRow_nx0en_1",
361
361
  heading: "_heading_nx0en_5",
362
362
  hint: "_hint_nx0en_9",
363
363
  loading: "_loading_nx0en_13",
364
364
  ruleText: "_ruleText_nx0en_17"
365
- }, fe = 20, pe = (e, t) => e === N.Equal ? t.equal : e === N.Contain ? t.contain : t.regex, me = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: p = !1, isLoading: m = !1, hasLoadError: v = !1, maxRules: y = fe, maxTargetsPerRule: ee, labels: x = {}, headingClassName: S = "dial-body-semi-text", hintClassName: C = "dial-small-text", loadingClassName: w = "dial-small-text", ruleTextClassName: D = "dial-small-text", ruleSourceClassName: te = "dial-small-semi-text", styles: M = {} }) => {
366
- let ne = {
367
- ...T({
368
- "--par-rule-bg": M.colors?.ruleBackground,
369
- "--par-heading-text": M.colors?.headingText,
370
- "--par-hint-text": M.colors?.hintText,
371
- "--par-loading-text": M.colors?.loadingText,
372
- "--par-rule-text": M.colors?.ruleText
365
+ }, pe = 20, me = (e, t) => e === j.Equal ? t.equal : e === j.Contain ? t.contain : t.regex, he = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: p = !1, isLoading: m = !1, hasLoadError: ee = !1, maxRules: v = pe, maxTargetsPerRule: y, labels: x = {}, headingClassName: S = "dial-body-semi-text", hintClassName: C = "dial-small-text", loadingClassName: w = "dial-small-text", ruleTextClassName: E = "dial-small-text", ruleSourceClassName: ne = "dial-small-semi-text", styles: A = {} }) => {
366
+ let ie = {
367
+ ...te({
368
+ "--par-rule-bg": A.colors?.ruleBackground,
369
+ "--par-heading-text": A.colors?.headingText,
370
+ "--par-hint-text": A.colors?.hintText,
371
+ "--par-loading-text": A.colors?.loadingText,
372
+ "--par-rule-text": A.colors?.ruleText
373
373
  }),
374
- ...M.cssVars
375
- }, { heading: N = "Allow access if all match", folderScopeHint: P = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: F = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: I = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: L = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: re = "Add rule", clearAllLabel: R = "Clear all", orSeparatorLabel: z = "Or", removeRuleAriaLabelTemplate: B = "Remove rule for {source}: {targets}", equalFunctionLabel: V = "Equal", containFunctionLabel: H = "Contain", regexFunctionLabel: U = "Regex", loadingLabel: W = "Loading existing rules…", loadErrorLabel: G = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: K = "Rule added.", ruleRemovedAnnouncement: q = "Rule removed.", rulesClearedAnnouncement: ie = "All rules cleared.", rulesLoadedAnnouncement: J = "Existing rules loaded for the selected folder.", editorLabels: ae } = x, oe = n(), [se, Y] = a(!1), [ce, X] = a(""), le = i(null), ue = i(m);
374
+ ...A.cssVars
375
+ }, { heading: j = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: N = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: P = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: F = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: R = "Or", removeRuleAriaLabelTemplate: ae = "Remove rule for {source}: {targets}", equalFunctionLabel: z = "Equal", containFunctionLabel: B = "Contain", regexFunctionLabel: V = "Regex", loadingLabel: oe = "Loading existing rules…", loadErrorLabel: H = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: U = "Rule added.", ruleRemovedAnnouncement: W = "Rule removed.", rulesClearedAnnouncement: se = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: ce } = x, le = n(), [ue, K] = a(!1), [q, J] = a(""), de = i(null), Y = i(m);
376
376
  t(() => {
377
- ue.current && !m && e.length > 0 && X(J), ue.current = m;
377
+ Y.current && !m && e.length > 0 && J(G), Y.current = m;
378
378
  }, [
379
379
  m,
380
380
  e,
381
- J
381
+ G
382
382
  ]);
383
- let me = () => {
384
- le.current = document.activeElement, Y(!0);
385
- }, Q = () => {
386
- Y(!1), le.current?.focus?.();
387
- }, he = (t) => {
388
- r([...e, t]), X(K), Q();
383
+ let he = () => {
384
+ de.current = document.activeElement, K(!0);
385
+ }, Z = () => {
386
+ K(!1), de.current?.focus?.();
389
387
  }, ge = (t) => {
390
- r(e.filter((e, n) => n !== t)), X(q);
391
- }, $ = () => {
392
- r([]), X(ie);
393
- }, _e = {
394
- equal: V,
395
- contain: H,
396
- regex: U
397
- }, ve = e.length >= y, ye = p || ve, be = u != null && u !== "";
398
- return /* @__PURE__ */ k("div", {
388
+ r([...e, t]), J(U), Z();
389
+ }, _e = (t) => {
390
+ r(e.filter((e, n) => n !== t)), J(W);
391
+ }, Q = () => {
392
+ r([]), J(se);
393
+ }, ve = {
394
+ equal: z,
395
+ contain: B,
396
+ regex: V
397
+ }, ye = e.length >= v, be = p || ye, xe = u != null && u !== "";
398
+ return /* @__PURE__ */ O("div", {
399
399
  role: "group",
400
- "aria-labelledby": oe,
401
- style: ne,
402
- className: E(p && "pointer-events-none opacity-60"),
400
+ "aria-labelledby": le,
401
+ style: ie,
402
+ className: T(p && "pointer-events-none opacity-60"),
403
403
  children: [
404
- /* @__PURE__ */ O("span", {
404
+ /* @__PURE__ */ D("span", {
405
405
  role: "status",
406
406
  "aria-live": "polite",
407
407
  className: "sr-only",
408
- children: ce
408
+ children: q
409
409
  }),
410
- /* @__PURE__ */ k("div", {
410
+ /* @__PURE__ */ O("div", {
411
411
  className: "mb-1 flex items-center justify-between gap-2",
412
- children: [/* @__PURE__ */ O("div", {
413
- id: oe,
414
- className: E(S, Z.heading),
415
- children: N
416
- }), e.length > 0 && /* @__PURE__ */ O(d, {
412
+ children: [/* @__PURE__ */ D("div", {
413
+ id: le,
414
+ className: T(S, X.heading),
415
+ children: j
416
+ }), e.length > 0 && /* @__PURE__ */ D(d, {
417
417
  variant: o.Primary,
418
- label: R,
419
- onClick: $,
418
+ label: L,
419
+ onClick: Q,
420
420
  disabled: p
421
421
  })]
422
422
  }),
423
- /* @__PURE__ */ O("p", {
424
- className: E("mb-2", C, Z.hint),
425
- children: be ? P.replace("{folder}", u) : F
423
+ /* @__PURE__ */ D("p", {
424
+ className: T("mb-2", C, X.hint),
425
+ children: xe ? M.replace("{folder}", u) : N
426
426
  }),
427
- e.length > 0 && !be && /* @__PURE__ */ O("div", {
427
+ e.length > 0 && !xe && /* @__PURE__ */ D("div", {
428
428
  className: "mb-2",
429
- children: /* @__PURE__ */ O(h, {
429
+ children: /* @__PURE__ */ D(h, {
430
430
  type: g.SectionMessage,
431
431
  variant: _.Warning,
432
- message: I
432
+ message: P
433
433
  })
434
434
  }),
435
- m && /* @__PURE__ */ k("div", {
436
- className: E("mb-2 flex items-center gap-2", w, Z.loading),
437
- children: [/* @__PURE__ */ O(b, {
435
+ m && /* @__PURE__ */ O("div", {
436
+ className: T("mb-2 flex items-center gap-2", w, X.loading),
437
+ children: [/* @__PURE__ */ D(b, {
438
438
  size: 16,
439
- ariaLabel: W
440
- }), /* @__PURE__ */ O("span", { children: W })]
439
+ ariaLabel: oe
440
+ }), /* @__PURE__ */ D("span", { children: oe })]
441
441
  }),
442
- v && /* @__PURE__ */ O("div", {
442
+ ee && /* @__PURE__ */ D("div", {
443
443
  className: "mb-2",
444
- children: /* @__PURE__ */ O(h, {
444
+ children: /* @__PURE__ */ D(h, {
445
445
  type: g.SectionMessage,
446
446
  variant: _.Warning,
447
- message: G
447
+ message: H
448
448
  })
449
449
  }),
450
- e.length > 0 && /* @__PURE__ */ O("ul", {
450
+ e.length > 0 && /* @__PURE__ */ D("ul", {
451
451
  className: "mb-3 flex flex-col gap-2",
452
452
  children: e.map((e, t) => {
453
- let n = e.targets.join(` ${z} `), r = B.replace("{source}", e.source).replace("{targets}", n);
454
- return /* @__PURE__ */ k("li", {
455
- className: E("flex items-center justify-between gap-2 rounded-lg px-3 py-2", Z.ruleRow),
456
- children: [/* @__PURE__ */ k("span", {
457
- className: E("truncate", D, Z.ruleText),
453
+ let n = e.targets.join(` ${R} `), r = ae.replace("{source}", e.source).replace("{targets}", n);
454
+ return /* @__PURE__ */ O("li", {
455
+ className: T("flex items-center justify-between gap-2 rounded-lg px-3 py-2", X.ruleRow),
456
+ children: [/* @__PURE__ */ O("span", {
457
+ className: T("truncate", E, X.ruleText),
458
458
  children: [
459
- /* @__PURE__ */ O("span", {
460
- className: te,
459
+ /* @__PURE__ */ D("span", {
460
+ className: ne,
461
461
  children: e.source
462
462
  }),
463
463
  " ",
464
- pe(e.function, _e),
464
+ me(e.function, ve),
465
465
  ": ",
466
466
  n
467
467
  ]
468
- }), /* @__PURE__ */ O(f, {
469
- icon: /* @__PURE__ */ O(j, {
468
+ }), /* @__PURE__ */ D(f, {
469
+ icon: /* @__PURE__ */ D(re, {
470
470
  size: c.SM,
471
471
  "aria-hidden": !0,
472
472
  stroke: l
473
473
  }),
474
474
  "aria-label": r,
475
- onClick: () => ge(t),
475
+ onClick: () => _e(t),
476
476
  disabled: p
477
477
  })]
478
478
  }, t);
479
479
  })
480
480
  }),
481
- se && /* @__PURE__ */ O(de, {
481
+ ue && /* @__PURE__ */ D(fe, {
482
482
  sourceOptions: s,
483
- onSave: he,
484
- onCancel: Q,
483
+ onSave: ge,
484
+ onCancel: Z,
485
485
  disabled: p,
486
- maxTargets: ee,
487
- labels: ae,
488
- styles: M.editor
486
+ maxTargets: y,
487
+ labels: ce,
488
+ styles: A.editor
489
489
  }),
490
- /* @__PURE__ */ O("div", {
490
+ /* @__PURE__ */ D("div", {
491
491
  className: "flex flex-wrap items-center gap-2",
492
- children: /* @__PURE__ */ O(d, {
493
- label: re,
494
- iconBefore: /* @__PURE__ */ O(A, {
492
+ children: /* @__PURE__ */ D(d, {
493
+ label: I,
494
+ iconBefore: /* @__PURE__ */ D(k, {
495
495
  size: c.SM,
496
496
  "aria-hidden": !0,
497
497
  stroke: l
498
498
  }),
499
- onClick: me,
500
- disabled: ye
499
+ onClick: he,
500
+ disabled: be
501
501
  })
502
502
  }),
503
- ve && /* @__PURE__ */ O("p", {
504
- className: E("mt-2", C, Z.hint),
505
- children: L.replace("{max}", String(y))
503
+ ye && /* @__PURE__ */ D("p", {
504
+ className: T("mt-2", C, X.hint),
505
+ children: F.replace("{max}", String(v))
506
506
  })
507
507
  ]
508
508
  });
509
- }, Q = {
509
+ }, Z = {
510
510
  currentBadge: "_currentBadge_d0adf_1",
511
511
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
512
512
  version: "_version_d0adf_13",
513
513
  date: "_date_d0adf_17",
514
514
  emptyState: "_emptyState_d0adf_21",
515
515
  stripedRow: "_stripedRow_d0adf_25"
516
- }, he = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
517
- let m = T({
516
+ }, ge = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
517
+ let m = te({
518
518
  "--phl-badge-border": p?.currentBadgeBorder,
519
519
  "--phl-badge-bg": p?.currentBadgeBackground,
520
520
  "--phl-badge-text": p?.currentBadgeText,
@@ -525,362 +525,362 @@ var N = /* @__PURE__ */ function(e) {
525
525
  "--phl-date-text": p?.dateText,
526
526
  "--phl-empty-text": p?.emptyStateText,
527
527
  "--phl-striped-bg": p?.stripedBackground
528
- }), h = E(f, Q.emptyState);
529
- return n ? /* @__PURE__ */ O("p", {
528
+ }), h = T(f, Z.emptyState);
529
+ return n ? /* @__PURE__ */ D("p", {
530
530
  style: m,
531
531
  className: h,
532
532
  children: c
533
- }) : r ? /* @__PURE__ */ O("p", {
533
+ }) : r ? /* @__PURE__ */ D("p", {
534
534
  style: m,
535
535
  className: h,
536
536
  role: "alert",
537
537
  children: l
538
- }) : e.length === 0 ? /* @__PURE__ */ O("p", {
538
+ }) : e.length === 0 ? /* @__PURE__ */ D("p", {
539
539
  style: m,
540
540
  className: h,
541
541
  children: s
542
- }) : /* @__PURE__ */ O("ul", {
542
+ }) : /* @__PURE__ */ D("ul", {
543
543
  style: m,
544
- children: e.map((e, n) => /* @__PURE__ */ k("li", {
545
- className: E("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Q.stripedRow),
546
- children: [/* @__PURE__ */ k("span", {
544
+ children: e.map((e, n) => /* @__PURE__ */ O("li", {
545
+ className: T("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Z.stripedRow),
546
+ children: [/* @__PURE__ */ O("span", {
547
547
  className: "flex min-w-0 items-center gap-2",
548
548
  style: m,
549
549
  children: [
550
- /* @__PURE__ */ k("span", {
551
- className: E(u, Q.version),
550
+ /* @__PURE__ */ O("span", {
551
+ className: T(u, Z.version),
552
552
  children: [
553
553
  i,
554
554
  " ",
555
555
  e.version
556
556
  ]
557
557
  }),
558
- e.version === t && /* @__PURE__ */ O(x, {
558
+ e.version === t && /* @__PURE__ */ D(x, {
559
559
  label: a,
560
- className: E("shrink-0 whitespace-nowrap", Q.currentBadge)
560
+ className: T("shrink-0 whitespace-nowrap", Z.currentBadge)
561
561
  }),
562
- e.publishCredentials === !0 && /* @__PURE__ */ O(x, {
562
+ e.publishCredentials === !0 && /* @__PURE__ */ D(x, {
563
563
  label: o,
564
- className: E("shrink-0 whitespace-nowrap", Q.sharedCredentialsBadge)
564
+ className: T("shrink-0 whitespace-nowrap", Z.sharedCredentialsBadge)
565
565
  })
566
566
  ]
567
- }), /* @__PURE__ */ O("span", {
568
- className: E(d, Q.date),
569
- children: L(e.publishedAt)
567
+ }), /* @__PURE__ */ D("span", {
568
+ className: T(d, Z.date),
569
+ children: F(e.publishedAt)
570
570
  })]
571
571
  }, `${e.version}-${n}`))
572
572
  });
573
- }, ge = {
573
+ }, _e = {
574
574
  divider: "_divider_1gs31_1",
575
575
  tree: "_tree_1gs31_17"
576
- }, $ = ({ items: e, selectedPath: t, onSelectedPathChange: n, onCreateFolder: o, searchQuery: s, disabled: u = !1, createFolderLabel: f = "Create new folder", cancelCreatingFolderLabel: p = "Cancel", addSiblingFolderLabel: m = "Add sibling", addChildFolderLabel: h = "Add child", newFolderDefaultName: g = "New folder", noResultsLabel: _ = "No folders match \"{query}\".", emptyFolderNameError: v = "Folder name cannot be empty.", invalidFolderNameError: y = "Folder name contains invalid characters.", duplicateFolderNameError: ee = "A folder with this name already exists.", rootLabel: b = "Organization", expandedPaths: x, onExpandedPathsChange: S, loadingPaths: C, styles: w = {} }) => {
577
- let D = {
578
- ...T({ "--pft-divider": w.colors?.divider }),
576
+ }, Q = ({ items: e, selectedPath: t, onSelectedPathChange: n, onCreateFolder: o, searchQuery: s, disabled: u = !1, createFolderLabel: f = "Create new folder", cancelCreatingFolderLabel: p = "Cancel", addSiblingFolderLabel: m = "Add sibling", addChildFolderLabel: h = "Add child", newFolderDefaultName: g = "New folder", noResultsLabel: _ = "No folders match \"{query}\".", emptyFolderNameError: ee = "Folder name cannot be empty.", invalidFolderNameError: v = "Folder name contains invalid characters.", duplicateFolderNameError: y = "A folder with this name already exists.", rootLabel: b = "Organization", expandedPaths: x, onExpandedPathsChange: S, loadingPaths: C, styles: w = {} }) => {
577
+ let E = {
578
+ ...te({ "--pft-divider": w.colors?.divider }),
579
579
  ...w.cssVars
580
- }, [j, N] = a(() => new Set(t?.map((e, n) => K(t.slice(0, n + 1))) ?? [])), P = x ?? j, F = (e) => {
580
+ }, [re, j] = a(() => new Set(t?.map((e, n) => U(t.slice(0, n + 1))) ?? [])), M = x ?? re, N = (e) => {
581
581
  let t = new Set(e);
582
- t.delete(""), S ? S(t) : N(t);
583
- }, [I, L] = a(null), [re, R] = a(g), z = i(null), V = s.trim(), U = I != null, W = r(() => B(e, s), [e, s]), J = V.length > 0 && W.length === 0, Y = !U && V.length > 0, ce = r(() => H(Y ? W : e), [
584
- Y,
585
- W,
582
+ t.delete(""), S ? S(t) : j(t);
583
+ }, [P, F] = a(null), [I, L] = a(g), R = i(null), z = s.trim(), V = P != null, oe = r(() => ae(e, s), [e, s]), G = z.length > 0 && oe.length === 0, K = !V && z.length > 0, q = r(() => B(K ? oe : e), [
584
+ K,
585
+ oe,
586
586
  e
587
- ]), X = r(() => new Set(["", ...G(ce)]), [ce]), le = r(() => new Set(["", ...Y ? X : P]), [
588
- Y,
589
- X,
590
- P
591
- ]), ue = r(() => ie(ce), [ce]), de = r(() => Y && ue.length === 0 ? [] : [{
587
+ ]), J = r(() => new Set(["", ...H(q)]), [q]), de = r(() => new Set(["", ...K ? J : M]), [
588
+ K,
589
+ J,
590
+ M
591
+ ]), Y = r(() => se(q), [q]), fe = r(() => K && Y.length === 0 ? [] : [{
592
592
  path: "",
593
593
  name: b,
594
594
  folderId: "",
595
- nodeType: M.FOLDER,
596
- items: ue
595
+ nodeType: A.FOLDER,
596
+ items: Y
597
597
  }], [
598
- ue,
598
+ Y,
599
599
  b,
600
- Y
601
- ]), Z = I ? K(I) : null, fe = {
602
- empty: v,
603
- invalid: y,
604
- duplicate: ee
605
- }, pe = (t) => oe(J && ae(V, [], fe) == null ? V : g, se(e, t)), me = (e) => {
606
- L(e), R(pe(e)), z.current = null;
607
- let t = K(e);
608
- t && F(new Set(P).add(t));
609
- }, Q = () => me(t ?? []), he = (e) => {
610
- let t = q(e.path), n = [{
600
+ K
601
+ ]), X = P ? U(P) : null, pe = {
602
+ empty: ee,
603
+ invalid: v,
604
+ duplicate: y
605
+ }, me = (t) => le(G && ce(z, [], pe) == null ? z : g, ue(e, t)), he = (e) => {
606
+ F(e), L(me(e)), R.current = null;
607
+ let t = U(e);
608
+ t && N(new Set(M).add(t));
609
+ }, Z = () => he(t ?? []), ge = (e) => {
610
+ let t = W(e.path), n = [{
611
611
  key: "add-child",
612
612
  label: h,
613
- icon: /* @__PURE__ */ O(te, {
613
+ icon: /* @__PURE__ */ D(ne, {
614
614
  size: c.SM,
615
615
  "aria-hidden": !0,
616
616
  stroke: l
617
617
  }),
618
- onClick: () => me(t)
618
+ onClick: () => he(t)
619
619
  }];
620
620
  return e.path !== "" && n.push({
621
621
  key: "add-sibling",
622
622
  label: m,
623
- icon: /* @__PURE__ */ O(A, {
623
+ icon: /* @__PURE__ */ D(k, {
624
624
  size: c.SM,
625
625
  "aria-hidden": !0,
626
626
  stroke: l
627
627
  }),
628
- onClick: () => me(t.slice(0, -1))
628
+ onClick: () => he(t.slice(0, -1))
629
629
  }), n;
630
- }, $ = (t) => {
631
- if (!I) return null;
632
- let n = ae(t, se(e, I), fe);
633
- return z.current = n, n;
634
- }, _e = (e) => {
635
- if (!I) return;
636
- let t = e.trim(), r = z.current;
637
- ($(e) ?? r) || (o(I, t), n([...I, t])), L(null);
638
- }, ve = () => L(null);
639
- return /* @__PURE__ */ k("div", {
640
- style: D,
641
- className: E(u && "pointer-events-none opacity-60", w.className),
630
+ }, Q = (t) => {
631
+ if (!P) return null;
632
+ let n = ce(t, ue(e, P), pe);
633
+ return R.current = n, n;
634
+ }, ve = (e) => {
635
+ if (!P) return;
636
+ let t = e.trim(), r = R.current;
637
+ (Q(e) ?? r) || (o(P, t), n([...P, t])), F(null);
638
+ }, ye = () => F(null);
639
+ return /* @__PURE__ */ O("div", {
640
+ style: E,
641
+ className: T(u && "pointer-events-none opacity-60", w.className),
642
642
  children: [
643
- /* @__PURE__ */ O("div", {
644
- className: E("w-full min-w-0 max-w-full", ge.tree),
645
- children: /* @__PURE__ */ O(ne, {
646
- items: de,
643
+ /* @__PURE__ */ D("div", {
644
+ className: T("w-full min-w-0 max-w-full", _e.tree),
645
+ children: /* @__PURE__ */ D(ie, {
646
+ items: fe,
647
647
  showFiles: !1,
648
- selectedPath: t == null ? void 0 : K(t),
649
- expandedPaths: le,
650
- onExpandedPathsChange: F,
648
+ selectedPath: t == null ? void 0 : U(t),
649
+ expandedPaths: de,
650
+ onExpandedPathsChange: N,
651
651
  loadingPaths: C,
652
652
  onItemClick: (e) => {
653
- n(t != null && K(t) === e.path ? void 0 : q(e.path));
653
+ n(t != null && U(t) === e.path ? void 0 : W(e.path));
654
654
  },
655
- getContextMenuItems: he,
656
- createdFolderPath: Z,
657
- newFolderDefaultName: re,
658
- onCreateFolderSave: _e,
659
- onCreateFolderCancel: ve,
660
- onRenameValidate: (e) => $(e),
661
- emptyStateTitle: Y ? _.replace("{query}", V) : void 0
655
+ getContextMenuItems: ge,
656
+ createdFolderPath: X,
657
+ newFolderDefaultName: I,
658
+ onCreateFolderSave: ve,
659
+ onCreateFolderCancel: ye,
660
+ onRenameValidate: (e) => Q(e),
661
+ emptyStateTitle: K ? _.replace("{query}", z) : void 0
662
662
  })
663
663
  }),
664
- /* @__PURE__ */ O("div", {
665
- className: E("my-2 h-px", ge.divider),
664
+ /* @__PURE__ */ D("div", {
665
+ className: T("my-2 h-px", _e.divider),
666
666
  "aria-hidden": !0
667
667
  }),
668
- /* @__PURE__ */ k("div", {
668
+ /* @__PURE__ */ O("div", {
669
669
  className: "mb-4 flex flex-wrap items-center gap-2",
670
- children: [/* @__PURE__ */ O(d, {
671
- onClick: Q,
670
+ children: [/* @__PURE__ */ D(d, {
671
+ onClick: Z,
672
672
  label: f,
673
- iconBefore: /* @__PURE__ */ O(A, {
673
+ iconBefore: /* @__PURE__ */ D(k, {
674
674
  size: c.SM,
675
675
  "aria-hidden": !0,
676
676
  stroke: l
677
677
  }),
678
- disabled: u || U
679
- }), U && /* @__PURE__ */ O(d, {
678
+ disabled: u || V
679
+ }), V && /* @__PURE__ */ D(d, {
680
680
  label: p,
681
- onClick: ve,
681
+ onClick: ye,
682
682
  disabled: u
683
683
  })]
684
684
  })
685
685
  ]
686
686
  });
687
- }, _e = { panel: "dial-publish-panel-panel" }, ve = {
687
+ }, ve = { panel: "dial-publish-panel-panel" }, ye = {
688
688
  summaryTitle: "_summaryTitle_tf20a_1",
689
689
  sectionHeading: "_sectionHeading_tf20a_5"
690
- }, ye = 200, be = ({ resource: e, renderSummary: t, history: i, isHistoryLoading: o = !1, hasHistoryError: c = !1, folderItems: l, selectedFolderPath: u, onSelectedFolderPathChange: d, onCreateFolder: f, expandedPaths: m, onExpandedPathsChange: _, loadingPaths: y, hasExistingPublicationInFolder: ee, hasWriteAccess: b, isSubmitting: x, hasSubmitError: S = !1, allowReplace: w = !0, author: D, onAuthorChange: te, publishCredentials: A = !1, onPublishCredentialsChange: j, rules: M, onRulesChange: ne, ruleSourceOptions: N, isRulesLoading: I = !1, hasRulesLoadError: L = !1, labels: re = {}, summaryTitleClassName: R = "dial-body-semi-text", headingClassName: z = "dial-body-semi-text", styles: B = {} }) => {
691
- let { colors: V, folderTree: H, accessRules: U } = B, W = {
692
- ...T({
693
- "--pp-summary-title-text": V?.summaryTitleText,
694
- "--pp-heading-text": V?.headingText
690
+ }, be = 200, xe = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: m, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, allowReplace: b = !0, author: x, onAuthorChange: S, publishCredentials: w = !1, onPublishCredentialsChange: E, rules: ne, onRulesChange: k, ruleSourceOptions: re, isRulesLoading: A = !1, hasRulesLoadError: ie = !1, labels: j = {}, summaryTitleClassName: P = "dial-body-semi-text", headingClassName: F = "dial-body-semi-text", styles: I = {} }) => {
691
+ let { colors: L, folderTree: R, accessRules: ae } = I, z = {
692
+ ...te({
693
+ "--pp-summary-title-text": L?.summaryTitleText,
694
+ "--pp-heading-text": L?.headingText
695
695
  }),
696
- ...B.cssVars
697
- }, G = {
698
- border: V?.summaryBorder,
699
- background: V?.summaryBackground,
700
- versionTagBorder: V?.summaryVersionTagBorder,
701
- versionTagBackground: V?.summaryVersionTagBackground,
702
- versionTagText: V?.summaryVersionTagText
703
- }, { folderLabel: K = "Publish to folder", replaceWarning: q = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: ie = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: J = "Publishing failed. Please try again.", folderEmptyStateLabel: ae, addSiblingFolderLabel: oe, addChildFolderLabel: se, cancelCreatingFolderLabel: Y, createFolderEmptyNameError: ce, createFolderInvalidNameError: X, createFolderDuplicateNameError: le, rootFolderLabel: ue = "Organization", summaryVersionLabel: de, accessRulesLabels: Z, searchPlaceholder: fe, clearSearchAriaLabel: pe, authorLabel: Q = "Author", authorPlaceholder: he = "Author name", authorHint: ge = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: be = "Publish with my credentials", credentialsHint: Se = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = re, [we, Te] = a(""), Ee = n(), De = (e) => {
704
- Te(e ?? "");
705
- }, Oe = u != null, ke = r(() => F({
706
- hasSelectedFolder: Oe,
707
- hasExistingPublicationInFolder: ee,
708
- hasWriteAccess: b,
709
- isSubmitting: x,
710
- hasSubmitError: S,
711
- allowReplace: w
696
+ ...I.cssVars
697
+ }, B = {
698
+ border: L?.summaryBorder,
699
+ background: L?.summaryBackground,
700
+ versionTagBorder: L?.summaryVersionTagBorder,
701
+ versionTagBackground: L?.summaryVersionTagBackground,
702
+ versionTagText: L?.summaryVersionTagText
703
+ }, { folderLabel: V = "Publish to folder", replaceWarning: oe = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: H = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: U = "Publishing failed. Please try again.", folderEmptyStateLabel: W, addSiblingFolderLabel: se, addChildFolderLabel: G, cancelCreatingFolderLabel: ce, createFolderEmptyNameError: le, createFolderInvalidNameError: ue, createFolderDuplicateNameError: K, rootFolderLabel: q = "Organization", summaryVersionLabel: J, accessRulesLabels: de, searchPlaceholder: Y, clearSearchAriaLabel: fe, authorLabel: X = "Author", authorPlaceholder: pe = "Author name", authorHint: me = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Z = "Publish with my credentials", credentialsHint: ge = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = j, [_e, xe] = a(""), Ce = n(), Te = (e) => {
704
+ xe(e ?? "");
705
+ }, Ee = o != null, $ = r(() => N({
706
+ hasSelectedFolder: Ee,
707
+ hasExistingPublicationInFolder: m,
708
+ hasWriteAccess: _,
709
+ isSubmitting: v,
710
+ hasSubmitError: y,
711
+ allowReplace: b
712
712
  }), [
713
- Oe,
714
- ee,
715
- b,
716
- x,
717
- S,
718
- w
719
- ]), Ae = Oe ? u[u.length - 1] ?? ue : "", je = t ? t() : /* @__PURE__ */ O("span", {
720
- className: E("truncate", R, ve.summaryTitle),
713
+ Ee,
714
+ m,
715
+ _,
716
+ v,
717
+ y,
718
+ b
719
+ ]), De = Ee ? o[o.length - 1] ?? q : "", Oe = t ? t() : /* @__PURE__ */ D("span", {
720
+ className: T("truncate", P, ye.summaryTitle),
721
721
  children: e?.title
722
722
  });
723
- return /* @__PURE__ */ k("div", {
724
- className: E("flex flex-col gap-5", _e.panel),
725
- style: W,
726
- children: [e?.type == null ? /* @__PURE__ */ O(C, {
727
- colors: G,
728
- children: je
729
- }) : /* @__PURE__ */ O(C, {
723
+ return /* @__PURE__ */ O("div", {
724
+ className: T("flex flex-col gap-5", ve.panel),
725
+ style: z,
726
+ children: [e?.type == null ? /* @__PURE__ */ D(C, {
727
+ colors: B,
728
+ children: Oe
729
+ }) : /* @__PURE__ */ D(C, {
730
730
  item: {
731
731
  type: e.type,
732
732
  name: e.title,
733
733
  version: e.version ?? "",
734
734
  iconUrl: e.iconUrl
735
735
  },
736
- versionLabel: de,
737
- colors: G
738
- }), /* @__PURE__ */ k("div", { children: [
739
- /* @__PURE__ */ O("div", {
740
- className: E("mb-2", z, ve.sectionHeading),
741
- children: K
736
+ versionLabel: J,
737
+ colors: B
738
+ }), /* @__PURE__ */ O("div", { children: [
739
+ /* @__PURE__ */ D("div", {
740
+ className: T("mb-2", F, ye.sectionHeading),
741
+ children: V
742
742
  }),
743
- /* @__PURE__ */ O("div", {
743
+ /* @__PURE__ */ D("div", {
744
744
  role: "search",
745
745
  className: "mb-3",
746
- children: /* @__PURE__ */ O(v, {
747
- value: we,
748
- onChange: De,
749
- placeholder: fe,
750
- clearLabel: pe,
751
- "aria-label": fe
746
+ children: /* @__PURE__ */ D(ee, {
747
+ value: _e,
748
+ onChange: Te,
749
+ placeholder: Y,
750
+ clearLabel: fe,
751
+ "aria-label": Y
752
752
  })
753
753
  }),
754
- /* @__PURE__ */ O($, {
755
- items: l,
756
- selectedPath: u,
757
- onSelectedPathChange: d,
758
- onCreateFolder: f,
759
- expandedPaths: m,
760
- onExpandedPathsChange: _,
761
- loadingPaths: y,
762
- searchQuery: we,
763
- disabled: x,
764
- noResultsLabel: ae,
765
- addSiblingFolderLabel: oe,
766
- addChildFolderLabel: se,
767
- cancelCreatingFolderLabel: Y,
768
- emptyFolderNameError: ce,
769
- invalidFolderNameError: X,
770
- duplicateFolderNameError: le,
771
- rootLabel: ue,
772
- styles: H
754
+ /* @__PURE__ */ D(Q, {
755
+ items: i,
756
+ selectedPath: o,
757
+ onSelectedPathChange: c,
758
+ onCreateFolder: l,
759
+ expandedPaths: u,
760
+ onExpandedPathsChange: d,
761
+ loadingPaths: f,
762
+ searchQuery: _e,
763
+ disabled: v,
764
+ noResultsLabel: W,
765
+ addSiblingFolderLabel: se,
766
+ addChildFolderLabel: G,
767
+ cancelCreatingFolderLabel: ce,
768
+ emptyFolderNameError: le,
769
+ invalidFolderNameError: ue,
770
+ duplicateFolderNameError: K,
771
+ rootLabel: q,
772
+ styles: R
773
773
  }),
774
- ke.calloutKind !== P.None && ke.calloutKind !== P.Info && /* @__PURE__ */ O("div", {
774
+ $.calloutKind !== M.None && $.calloutKind !== M.Info && /* @__PURE__ */ D("div", {
775
775
  className: "mt-3",
776
- children: /* @__PURE__ */ O(h, {
776
+ children: /* @__PURE__ */ D(h, {
777
777
  type: g.SectionMessage,
778
- variant: xe(ke.calloutKind),
779
- message: Ce(ke.calloutKind, {
780
- replaceWarning: q,
781
- noAccessError: ie,
782
- submitError: J,
783
- folderName: Ae,
778
+ variant: Se($.calloutKind),
779
+ message: we($.calloutKind, {
780
+ replaceWarning: oe,
781
+ noAccessError: H,
782
+ submitError: U,
783
+ folderName: De,
784
784
  version: e?.version
785
785
  })
786
786
  })
787
787
  }),
788
- /* @__PURE__ */ O("div", {
788
+ /* @__PURE__ */ D("div", {
789
789
  className: "mt-4",
790
- children: /* @__PURE__ */ O(p, {
791
- id: Ee,
792
- labelProps: { label: Q },
793
- placeholder: he,
794
- caption: ge,
795
- value: D,
796
- onChange: (e) => te(e ?? ""),
797
- maxLength: ye,
798
- disabled: x
790
+ children: /* @__PURE__ */ D(p, {
791
+ id: Ce,
792
+ labelProps: { label: X },
793
+ placeholder: pe,
794
+ caption: me,
795
+ value: x,
796
+ onChange: (e) => S(e ?? ""),
797
+ maxLength: be,
798
+ disabled: v
799
799
  })
800
800
  }),
801
- j != null && /* @__PURE__ */ O("div", {
801
+ E != null && /* @__PURE__ */ D("div", {
802
802
  className: "mt-4",
803
- children: /* @__PURE__ */ O(s, {
804
- labelProps: { label: be },
805
- caption: Se,
806
- isSelected: A,
807
- onChange: j,
808
- disabled: x
803
+ children: /* @__PURE__ */ D(s, {
804
+ labelProps: { label: Z },
805
+ caption: ge,
806
+ isSelected: w,
807
+ onChange: E,
808
+ disabled: v
809
809
  })
810
810
  }),
811
- /* @__PURE__ */ O("div", {
811
+ /* @__PURE__ */ D("div", {
812
812
  className: "mt-4",
813
- children: /* @__PURE__ */ O(me, {
814
- rules: M,
815
- onRulesChange: ne,
816
- sourceOptions: N,
817
- folderName: Oe ? Ae : void 0,
818
- disabled: x,
819
- isLoading: I,
820
- hasLoadError: L,
821
- labels: Z,
822
- styles: U
813
+ children: /* @__PURE__ */ D(he, {
814
+ rules: ne,
815
+ onRulesChange: k,
816
+ sourceOptions: re,
817
+ folderName: Ee ? De : void 0,
818
+ disabled: v,
819
+ isLoading: A,
820
+ hasLoadError: ie,
821
+ labels: de,
822
+ styles: ae
823
823
  })
824
824
  })
825
825
  ] })]
826
826
  });
827
- }, xe = (e) => e === P.ReplaceWarning ? _.Warning : _.Error, Se = (e, t) => {
827
+ }, Se = (e) => e === M.ReplaceWarning ? _.Warning : _.Error, Ce = (e, t) => {
828
828
  let [n, r, ...i] = e.split("{folder}");
829
- return r === void 0 || i.length > 0 ? e : /* @__PURE__ */ k(D, { children: [
829
+ return r === void 0 || i.length > 0 ? e : /* @__PURE__ */ O(E, { children: [
830
830
  n,
831
- /* @__PURE__ */ O("strong", {
831
+ /* @__PURE__ */ D("strong", {
832
832
  className: "font-semibold",
833
833
  children: t
834
834
  }),
835
835
  r
836
836
  ] });
837
- }, Ce = (e, t) => e === P.ReplaceWarning ? Se(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName) : e === P.NoAccess ? Se(t.noAccessError, t.folderName) : t.submitError, we = { footer: "_footer_dks1v_1" }, Te = ({ version: e, hasExistingPublicationInFolder: t, isSubmitDisabled: n, isSubmitLoading: r, onCancel: i, onSubmit: a, labels: o = {}, colors: s }) => {
838
- let l = T({ "--pf-border": s?.border }), { cancelLabel: u = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: h = "Publishing…" } = o, g = r ? h : t && e != null ? p.replace("{version}", e) : f;
839
- return /* @__PURE__ */ k("div", {
837
+ }, we = (e, t) => e === M.ReplaceWarning ? Ce(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName) : e === M.NoAccess ? Ce(t.noAccessError, t.folderName) : t.submitError, Te = { footer: "_footer_dks1v_1" }, Ee = ({ version: e, hasExistingPublicationInFolder: t, isSubmitDisabled: n, isSubmitLoading: r, onCancel: i, onSubmit: a, labels: o = {}, colors: s }) => {
838
+ let l = te({ "--pf-border": s?.border }), { cancelLabel: u = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: h = "Publishing…" } = o, g = r ? h : t && e != null ? p.replace("{version}", e) : f;
839
+ return /* @__PURE__ */ O("div", {
840
840
  style: l,
841
- className: E("flex items-center justify-end gap-2 border-t px-3.5 py-4 rtl:flex-row-reverse rtl:justify-start", we.footer),
842
- children: [/* @__PURE__ */ O(d, {
841
+ className: T("flex items-center justify-end gap-2 border-t px-3.5 py-4 rtl:flex-row-reverse rtl:justify-start", Te.footer),
842
+ children: [/* @__PURE__ */ D(d, {
843
843
  label: u,
844
844
  disabled: r,
845
845
  onClick: i
846
- }), /* @__PURE__ */ O(m, {
846
+ }), /* @__PURE__ */ D(m, {
847
847
  label: g,
848
848
  disabled: n,
849
- iconBefore: r ? /* @__PURE__ */ O(b, { size: c.SM }) : void 0,
849
+ iconBefore: r ? /* @__PURE__ */ D(b, { size: c.SM }) : void 0,
850
850
  onClick: a
851
851
  })]
852
852
  });
853
- }, Ee = {
853
+ }, $ = {
854
854
  backdrop: "_backdrop_16jmd_6",
855
855
  panel: "_panel_16jmd_10",
856
856
  divider: "_divider_16jmd_15",
857
857
  content: "_content_16jmd_19",
858
858
  title: "_title_16jmd_24"
859
- }, De = ({ isOpen: e, resource: n, renderSummary: i, history: o, isHistoryLoading: s = !1, hasHistoryError: c = !1, folderItems: l, selectedFolderPath: u, onSelectedFolderPathChange: d, onCreateFolder: f, expandedPaths: p, onExpandedPathsChange: m, loadingPaths: h, hasExistingPublicationInFolder: g, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, allowReplace: b = !0, author: x, onAuthorChange: S, rules: C, onRulesChange: w, ruleSourceOptions: D, isRulesLoading: te = !1, hasRulesLoadError: A = !1, onClose: j, returnFocusRef: M, onSubmit: ne, panelLabels: N, panelStyles: P, footerLabels: I, labels: L = {}, titleClassName: re = "dial-body-semi-text", colors: R }) => {
860
- let z = T({
861
- "--spp-backdrop-bg": R?.backdropBackground,
862
- "--spp-panel-bg": R?.panelBackground,
863
- "--spp-panel-border": R?.panelBorder,
864
- "--spp-divider-border": R?.dividerBorder,
865
- "--spp-scrollbar-thumb": R?.scrollbarThumb,
866
- "--spp-title-text": R?.titleText
867
- }), [B, V] = a(null), { title: H = "Publish", ariaLabel: U = "Publish", closeAriaLabel: W = "Close" } = L, G = r(() => F({
868
- hasSelectedFolder: u != null,
869
- hasExistingPublicationInFolder: g,
870
- hasWriteAccess: _,
871
- isSubmitting: v,
872
- hasSubmitError: y,
873
- allowReplace: b
859
+ }, De = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: b, onRulesChange: x, ruleSourceOptions: S, isRulesLoading: C = !1, hasRulesLoadError: w = !1, onClose: E, returnFocusRef: ne, onSubmit: k, panelLabels: re, panelStyles: A, footerLabels: ie, labels: j = {}, titleClassName: M = "dial-body-semi-text", colors: P }) => {
860
+ let F = te({
861
+ "--spp-backdrop-bg": P?.backdropBackground,
862
+ "--spp-panel-bg": P?.panelBackground,
863
+ "--spp-panel-border": P?.panelBorder,
864
+ "--spp-divider-border": P?.dividerBorder,
865
+ "--spp-scrollbar-thumb": P?.scrollbarThumb,
866
+ "--spp-title-text": P?.titleText
867
+ }), [I, L] = a(null), { title: R = "Publish", ariaLabel: ae = "Publish", closeAriaLabel: z = "Close" } = j, B = r(() => N({
868
+ hasSelectedFolder: s != null,
869
+ hasExistingPublicationInFolder: p,
870
+ hasWriteAccess: m,
871
+ isSubmitting: h,
872
+ hasSubmitError: g,
873
+ allowReplace: _
874
874
  }), [
875
- u,
875
+ s,
876
+ p,
877
+ m,
878
+ h,
876
879
  g,
877
- _,
878
- v,
879
- y,
880
- b
880
+ _
881
881
  ]);
882
882
  return t(() => {
883
- let t = B?.closest("[role=\"dialog\"]");
883
+ let t = I?.closest("[role=\"dialog\"]");
884
884
  if (!e || !t) return;
885
885
  let n = () => t.focus({ preventScroll: !0 });
886
886
  n();
@@ -890,74 +890,71 @@ var N = /* @__PURE__ */ function(e) {
890
890
  document.addEventListener("focusin", r);
891
891
  let i = requestAnimationFrame(() => {
892
892
  document.removeEventListener("focusin", r);
893
- }), a = M?.current;
893
+ }), a = ne?.current;
894
894
  return () => {
895
895
  cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
896
896
  };
897
897
  }, [
898
898
  e,
899
- B,
900
- M
901
- ]), /* @__PURE__ */ k(ee, {
899
+ I,
900
+ ne
901
+ ]), /* @__PURE__ */ O(y, {
902
902
  open: e,
903
- onClose: j,
904
- header: /* @__PURE__ */ O("span", {
905
- className: E("block truncate text-center", re, Ee.title),
906
- children: H
903
+ onClose: E,
904
+ header: /* @__PURE__ */ D("span", {
905
+ className: T("block truncate text-center", M, $.title),
906
+ children: R
907
907
  }),
908
- ariaLabel: U,
909
- closeAriaLabel: W,
910
- closeDisabled: v,
911
- style: z,
912
- overlayStyle: z,
913
- className: Ee.panel,
914
- overlayClassName: Ee.backdrop,
915
- headerClassName: E("px-[22px]", Ee.divider),
908
+ ariaLabel: ae,
909
+ closeAriaLabel: z,
910
+ closeDisabled: h,
911
+ style: F,
912
+ overlayStyle: F,
913
+ className: $.panel,
914
+ overlayClassName: $.backdrop,
915
+ headerClassName: T("px-[22px]", $.divider),
916
916
  bodyClassName: "flex flex-col overflow-hidden",
917
- children: [/* @__PURE__ */ O("div", {
918
- ref: V,
919
- className: E("min-h-0 flex-1 overflow-y-auto", Ee.content),
920
- children: /* @__PURE__ */ O("div", {
917
+ children: [/* @__PURE__ */ D("div", {
918
+ ref: L,
919
+ className: T("min-h-0 flex-1 overflow-y-auto", $.content),
920
+ children: /* @__PURE__ */ D("div", {
921
921
  className: "p-[22px]",
922
- children: /* @__PURE__ */ O(be, {
922
+ children: /* @__PURE__ */ D(xe, {
923
923
  resource: n,
924
924
  renderSummary: i,
925
- history: o,
926
- isHistoryLoading: s,
927
- hasHistoryError: c,
928
- folderItems: l,
929
- selectedFolderPath: u,
930
- onSelectedFolderPathChange: d,
931
- onCreateFolder: f,
932
- expandedPaths: p,
933
- onExpandedPathsChange: m,
934
- loadingPaths: h,
935
- hasExistingPublicationInFolder: g,
936
- hasWriteAccess: _,
937
- isSubmitting: v,
938
- hasSubmitError: y,
939
- allowReplace: b,
940
- author: x,
941
- onAuthorChange: S,
942
- rules: C,
943
- onRulesChange: w,
944
- ruleSourceOptions: D,
945
- isRulesLoading: te,
946
- hasRulesLoadError: A,
947
- labels: N,
948
- styles: P
925
+ folderItems: o,
926
+ selectedFolderPath: s,
927
+ onSelectedFolderPathChange: c,
928
+ onCreateFolder: l,
929
+ expandedPaths: u,
930
+ onExpandedPathsChange: d,
931
+ loadingPaths: f,
932
+ hasExistingPublicationInFolder: p,
933
+ hasWriteAccess: m,
934
+ isSubmitting: h,
935
+ hasSubmitError: g,
936
+ allowReplace: _,
937
+ author: ee,
938
+ onAuthorChange: v,
939
+ rules: b,
940
+ onRulesChange: x,
941
+ ruleSourceOptions: S,
942
+ isRulesLoading: C,
943
+ hasRulesLoadError: w,
944
+ labels: re,
945
+ styles: A
949
946
  })
950
947
  })
951
- }), /* @__PURE__ */ O(Te, {
948
+ }), /* @__PURE__ */ D(Ee, {
952
949
  version: n?.version,
953
- hasExistingPublicationInFolder: g,
954
- isSubmitDisabled: G.isSubmitDisabled,
955
- isSubmitLoading: G.isSubmitLoading,
956
- onCancel: j,
957
- onSubmit: ne,
958
- labels: I
950
+ hasExistingPublicationInFolder: p,
951
+ isSubmitDisabled: B.isSubmitDisabled,
952
+ isSubmitLoading: B.isSubmitLoading,
953
+ onCancel: E,
954
+ onSubmit: k,
955
+ labels: ie
959
956
  })]
960
957
  });
961
958
  };
962
959
  //#endregion
963
- export { _e as PUBLISH_PANEL_CLASS, N as PublicationRuleFunction, de as PublishAccessRuleEditor, me as PublishAccessRules, P as PublishCalloutKind, $ as PublishFoldersTree, Te as PublishFooter, he as PublishHistoryList, be as PublishPanel, De as StandalonePublishPanel, G as collectFolderKeys, F as derivePublishState, B as filterFolderTree, L as formatPublishedDate, q as fromFolderPathKey, se as getSiblingFolderNames, oe as getUniqueFolderName, W as mergeFolderPaths, H as sortFolderTree, ie as toDialFileTree, K as toFolderPathKey, z as usePublishFlow, ae as validateFolderName };
960
+ export { ve as PUBLISH_PANEL_CLASS, j as PublicationRuleFunction, fe as PublishAccessRuleEditor, he as PublishAccessRules, M as PublishCalloutKind, Q as PublishFoldersTree, Ee as PublishFooter, ge as PublishHistoryList, xe as PublishPanel, De as StandalonePublishPanel, H as collectFolderKeys, N as derivePublishState, ae as filterFolderTree, F as formatPublishedDate, W as fromFolderPathKey, ue as getSiblingFolderNames, le as getUniqueFolderName, oe as mergeFolderPaths, B as sortFolderTree, se as toDialFileTree, U as toFolderPathKey, R as usePublishFlow, ce as validateFolderName };