@epam/ai-dial-publish-panel 1.2.0-dev.252 → 1.2.0-dev.256

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