@epam/ai-dial-publish-panel 1.3.0-dev.33 → 1.3.0-dev.331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/components/PublishAccessRuleEditor/PublishAccessRuleEditor.d.ts.map +1 -1
  2. package/components/PublishAccessRules/PublishAccessRules.d.ts.map +1 -1
  3. package/components/PublishFoldersTree/PublishFoldersTree.d.ts +1 -1
  4. package/components/PublishFoldersTree/PublishFoldersTree.d.ts.map +1 -1
  5. package/components/PublishHistoryList/PublishHistoryList.d.ts.map +1 -1
  6. package/components/PublishPanel/PublishFooter.d.ts +2 -0
  7. package/components/PublishPanel/PublishFooter.d.ts.map +1 -1
  8. package/components/PublishPanel/PublishPanel.d.ts +4 -2
  9. package/components/PublishPanel/PublishPanel.d.ts.map +1 -1
  10. package/components/PublishPanel/StandalonePublishPanel.d.ts +8 -1
  11. package/components/PublishPanel/StandalonePublishPanel.d.ts.map +1 -1
  12. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts +5 -0
  13. package/components/SaveToFolderPanel/SaveToFolderPanel.d.ts.map +1 -0
  14. package/components/SaveToFolderPanel/StandaloneSaveToFolderPanel.d.ts +5 -0
  15. package/components/SaveToFolderPanel/StandaloneSaveToFolderPanel.d.ts.map +1 -0
  16. package/index.css +3 -2
  17. package/index.d.ts +5 -0
  18. package/index.d.ts.map +1 -1
  19. package/index.js +859 -527
  20. package/models/folder-destination.d.ts +28 -0
  21. package/models/folder-destination.d.ts.map +1 -0
  22. package/models/publish-access-rule-editor.d.ts +1 -1
  23. package/models/publish-access-rule-editor.d.ts.map +1 -1
  24. package/models/publish-folders-tree.d.ts +19 -10
  25. package/models/publish-folders-tree.d.ts.map +1 -1
  26. package/models/publish.d.ts +3 -3
  27. package/models/save-to-folder-panel.d.ts +212 -0
  28. package/models/save-to-folder-panel.d.ts.map +1 -0
  29. package/package.json +5 -5
  30. package/types/save-to-folder.d.ts +15 -0
  31. package/types/save-to-folder.d.ts.map +1 -0
  32. package/utils/folder-destination.d.ts +17 -0
  33. package/utils/folder-destination.d.ts.map +1 -0
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, Highlight as p, Input as m, NeutralButton as h, Notification as g, NotificationType as _, NotificationVariant as v, Search as y, Select as b, SideDrawer as x, Spinner as S, Tag as C, TagInput as ee } 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 j, IconPlus as te, IconTrashX as ne } from "@tabler/icons-react";
6
- import { DialFileNodeType as re, DialFoldersTree as ie } 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, ElementSize as d, ErrorText as f, FolderName as p, GhostButton as m, GhostIconButton as h, Highlight as g, Input as _, LinkButton as ee, LiveRegion as v, LiveRegionElement as te, LiveRegionPoliteness as y, NeutralButton as b, Notification as x, NotificationType as S, NotificationVariant as C, PrimaryButton as ne, RadioGroup as re, Search as w, Select as T, SideDrawer as E, Spinner as D, Tag as O, TagInput as k } from "@epam/ai-dial-ui-kit";
3
+ import { ResourceSummary as A, TAG_INPUT_TAG_CLASS_NAME as j, buildCssVars as ie, mergeClasses as M } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
5
+ import { IconFolder as I, IconFolderPlus as ae, IconPlus as L, IconTrashX as oe } from "@tabler/icons-react";
6
+ import { DialFileNodeType as se, DialFoldersTree as ce } from "@epam/ai-dial-react-file-manager";
7
7
  //#region src/models/publish.ts
8
- var M = /* @__PURE__ */ function(e) {
8
+ var R = /* @__PURE__ */ function(e) {
9
9
  return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
10
- }({}), N = /* @__PURE__ */ function(e) {
10
+ }({}), z = /* @__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
+ }({}), B = (e) => e.isSubmitting ? {
13
+ calloutKind: z.None,
14
14
  isSubmitDisabled: !0,
15
15
  isSubmitLoading: !0
16
16
  } : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
17
- calloutKind: N.SubmitError,
17
+ calloutKind: z.SubmitError,
18
18
  isSubmitDisabled: !1,
19
19
  isSubmitLoading: !1
20
20
  } : e.hasExistingPublicationInFolder ? {
21
- calloutKind: N.ReplaceWarning,
21
+ calloutKind: z.ReplaceWarning,
22
22
  isSubmitDisabled: e.allowReplace === !1,
23
23
  isSubmitLoading: !1
24
24
  } : {
25
- calloutKind: N.Info,
25
+ calloutKind: z.Info,
26
26
  isSubmitDisabled: !1,
27
27
  isSubmitLoading: !1
28
28
  } : {
29
- calloutKind: N.NoAccess,
29
+ calloutKind: z.NoAccess,
30
30
  isSubmitDisabled: !0,
31
31
  isSubmitLoading: !1
32
32
  } : {
33
- calloutKind: N.None,
33
+ calloutKind: z.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
+ }, V = 864e5, H = (e, t = Date.now(), n) => {
37
+ let r = Math.floor((t - e) / V);
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
- }, L = (e, t, n) => t.length === 0 ? [...e, {
43
+ }, le = (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,310 +51,305 @@ var M = /* @__PURE__ */ function(e) {
51
51
  }]
52
52
  } : {
53
53
  ...e,
54
- children: e.children ? L(e.children, t, n) : e.children
55
- }), R = (e, t, n) => {
54
+ children: e.children ? le(e.children, t, n) : e.children
55
+ }), U = (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 ? U(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
+ }, ue = ({ 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([]), [ee, w] = a(!1), [T, E] = a(!1), [D, O] = a(c), [k, A] = a(!1), [j, te] = a(!1);
69
+ let [g, _] = a(), [ee, v] = a(!1), [te, y] = a(!1), [b, x] = a([]), [S, C] = a(!1), [ne, re] = a(!1), [w, T] = a(c), [E, D] = a(!1), [O, k] = a(!1);
70
70
  t(() => {
71
- j || O(c);
72
- }, [c, j]);
73
- let ne = e((e) => {
74
- te(!0), O(e);
71
+ O || T(c);
72
+ }, [c, O]);
73
+ let A = e((e) => {
74
+ k(!0), T(e);
75
75
  }, []);
76
76
  t(() => {
77
77
  if (g == null) {
78
- C([]), E(!1);
78
+ x([]), re(!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) => {
84
- e || C(t);
83
+ return C(!0), re(!1), p(g).then((t) => {
84
+ e || x(t);
85
85
  }).catch(() => {
86
- e || E(!0);
86
+ e || re(!0);
87
87
  }).finally(() => {
88
- e || w(!1);
88
+ e || C(!1);
89
89
  }), () => {
90
90
  e = !0;
91
91
  };
92
92
  }, [g]);
93
- let re = r(() => {
93
+ let j = r(() => {
94
94
  if (!g) return !1;
95
95
  let e = g.join("/");
96
- return i.some((t) => t.folderPath.join("/") === e ? n.version == null ? !0 : t.version === n.version : !1);
96
+ return i.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
97
97
  }, [
98
98
  i,
99
99
  n.version,
100
100
  g
101
101
  ]), ie = e(async (e, t) => {
102
- h((n) => L(n, e, t));
102
+ h((n) => le(n, e, t));
103
103
  try {
104
104
  await l?.(e, t);
105
105
  } catch {
106
- h((n) => R(n, e, t)), x(!0);
106
+ h((n) => U(n, e, t)), y(!0);
107
107
  }
108
108
  }, [l]), M = e(async () => {
109
109
  if (!g) return !1;
110
- y(!0), x(!1);
110
+ v(!0), y(!1);
111
111
  try {
112
- return await u(n, g, S, D.trim(), k), d?.(n, g), !0;
112
+ return await u(n, g, b, w.trim(), E), d?.(n, g), !0;
113
113
  } catch (e) {
114
- return x(!0), f?.(n, g, e), !1;
114
+ return y(!0), f?.(n, g, e), !1;
115
115
  } finally {
116
- y(!1);
116
+ v(!1);
117
117
  }
118
118
  }, [
119
- D,
119
+ w,
120
120
  n,
121
121
  u,
122
122
  f,
123
123
  d,
124
- k,
125
- S,
124
+ E,
125
+ b,
126
126
  g
127
127
  ]), N = e(() => {
128
- h(o), _(void 0), x(!1), C([]), E(!1), O(c), te(!1), A(!1);
128
+ h(o), _(void 0), y(!1), x([]), re(!1), T(c), k(!1), D(!1);
129
129
  }, [c, o]);
130
130
  return {
131
131
  folderItems: m,
132
132
  selectedFolderPath: g,
133
133
  setSelectedFolderPath: _,
134
134
  handleCreateFolder: ie,
135
- hasExistingPublicationInFolder: re,
136
- hasWriteAccess: g ? s(g) : !0,
137
- isSubmitting: v,
138
- hasSubmitError: b,
135
+ hasExistingPublicationInFolder: j,
136
+ hasWriteAccess: !g || s(g),
137
+ isSubmitting: ee,
138
+ hasSubmitError: te,
139
139
  handleSubmit: M,
140
140
  reset: N,
141
- rules: S,
142
- setRules: C,
143
- author: D,
144
- setAuthor: ne,
145
- publishCredentials: k,
146
- setPublishCredentials: A,
147
- isRulesLoading: ee,
148
- hasRulesLoadError: T
141
+ rules: b,
142
+ setRules: x,
143
+ author: w,
144
+ setAuthor: A,
145
+ publishCredentials: E,
146
+ setPublishCredentials: D,
147
+ isRulesLoading: S,
148
+ hasRulesLoadError: ne
149
149
  };
150
- }, ae = (e, t) => {
150
+ }, W = (e, t) => {
151
151
  let n = t.trim().toLowerCase();
152
152
  return n ? e.reduce((e, r) => {
153
- let i = r.children ? ae(r.children, t) : void 0;
153
+ let i = r.children ? W(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
+ }, de = (e, t) => e.localeCompare(t, void 0, {
160
160
  sensitivity: "base",
161
161
  numeric: !0
162
- }), oe = (e) => [...e].sort((e, t) => B(e.name, t.name)).map((e) => e.children ? {
162
+ }), fe = (e) => [...e].sort((e, t) => de(e.name, t.name)).map((e) => e.children ? {
163
163
  ...e,
164
- children: oe(e.children)
165
- } : e), V = (e, t, n) => {
164
+ children: fe(e.children)
165
+ } : e), G = (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: V(e.children ?? [], i, a)
171
+ children: G(e.children ?? [], i, a)
172
172
  } : e) : e : [...e, {
173
173
  path: a,
174
174
  name: r,
175
- children: i.length ? V([], i, a) : void 0
175
+ children: i.length ? G([], i, a) : void 0
176
176
  }];
177
- }, se = (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), G = (e) => e.map((e) => {
178
- let t = U(e.path);
177
+ }, K = (e, t) => t.reduce((e, t) => t.length ? G(e, t, []) : e, e), q = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? q(e.children) : []]), J = (e) => e.join("/"), pe = (e) => e.split("/").filter(Boolean), Y = (e) => e.map((e) => {
178
+ let t = J(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 ? G(e.children) : void 0
184
+ items: e.children ? Y(e.children) : void 0
185
185
  };
186
- }), K = /[/\\:;,={}&"]/, q = (e, t, n) => {
186
+ }), me = /[/\\:;,={}&"]/, he = (e, t, n) => {
187
187
  let r = e.trim();
188
- return r ? r.includes("..") || K.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
189
- }, ce = (e, t) => {
188
+ return r ? r.includes("..") || me.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
189
+ }, ge = (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
- }, J = (e, t) => {
195
+ }, _e = (e, t) => {
196
196
  if (t.length === 0) return e.map((e) => e.name);
197
- let n = U(t), r = (e) => {
197
+ let n = J(t), r = (e) => {
198
198
  for (let t of e) {
199
- if (U(t.path) === n) return t;
199
+ if (J(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
+ }, ve = {
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, ue = 200, de = 8, fe = (e) => {
210
+ }, X = 20, Z = 200, ye = 8, be = (e) => {
211
211
  let t = e.trim();
212
- if (t.length === 0 || t.length > ue) return !1;
212
+ if (t.length === 0 || t.length > Z) return !1;
213
213
  try {
214
214
  return new RegExp(t) instanceof RegExp;
215
215
  } catch {
216
216
  return !1;
217
217
  }
218
- }, pe = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = le, labels: u = {}, errorClassName: f = "dial-small-text", styles: g = {} }) => {
219
- let _ = {
220
- ...E({
221
- "--pare-mobile-bg": g.colors?.mobileBackground,
222
- "--pare-bg": g.colors?.background,
223
- "--pare-error-text": g.colors?.errorText,
224
- "--pare-select-border": g.colors?.selectBorder,
225
- "--pare-select-border-hover": g.colors?.selectBorderHover,
226
- "--pare-select-border-open": g.colors?.selectBorderOpen,
227
- "--pare-select-border-focus": g.colors?.selectBorderFocus
218
+ }, Q = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = X, labels: u = {}, errorClassName: d = "dial-tiny-text", styles: p = {} }) => {
219
+ let h = {
220
+ ...ie({
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
228
228
  }),
229
- ...g.cssVars
230
- }, { sourceLabel: v = "Source", sourcePlaceholder: y = "Select...", functionLabel: x = "Function", equalOptionLabel: S = "Equal", containOptionLabel: C = "Contain", regexOptionLabel: w = "Regex", targetsLabel: O = "Targets", targetsPlaceholder: j = "Add a target", targetsHintLabel: te = "Press Enter or comma to add a target.", patternLabel: ne = "Pattern", patternPlaceholder: re = "Enter a regular expression", invalidRegexError: ie = "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: L = "Add access rule" } = u, R = n(), z = n(), ae = n(), B = n(), oe = i(null);
229
+ ...p.cssVars
230
+ }, { sourceLabel: ee = "Source", sourcePlaceholder: v = "Select...", functionLabel: te = "Function", equalOptionLabel: y = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: S = "Regex", targetsLabel: C = "Targets", targetsPlaceholder: ne = "Add a target", targetsHintLabel: re = "Press Enter or comma to add a target.", patternLabel: w = "Pattern", patternPlaceholder: E = "Enter a regular expression", invalidRegexError: D = "Enter a valid regular expression.", requiredFieldError: O = "This field is required.", targetsRequiredError: A = "Add at least one target.", saveLabel: N = "Save", cancelLabel: I = "Cancel", dialogAriaLabel: ae = "Add access rule" } = u, L = n(), oe = n(), se = n(), ce = n(), z = i(null);
231
231
  t(() => {
232
- oe.current?.focus();
232
+ z.current?.focus();
233
233
  }, []);
234
- let [V, se] = a(), [H, U] = a(), [W, G] = a([]), [K, q] = a(""), [ce, J] = a(!1), [ue, pe] = a(""), [X, me] = a(!1), [Z, he] = a(!1), Q = D(Y.selectField, ce && Y.selectFieldOpen), ge = D(Y.selectField, X && Y.selectFieldOpen), _e = r(() => e.map((e) => ({
234
+ let [B, V] = a(), [H, le] = a(), [U, ue] = a([]), [W, de] = a(""), [fe, G] = a(!1), [K, q] = a(""), [J, pe] = a(!1), [Y, me] = a(!1), he = M(ve.selectField, fe && ve.selectFieldOpen), ge = M(ve.selectField, J && ve.selectFieldOpen), _e = r(() => e.map((e) => ({
235
235
  value: e,
236
236
  label: e,
237
- labelNode: ue.trim() ? /* @__PURE__ */ k(p, {
237
+ labelNode: K.trim() ? /* @__PURE__ */ P(g, {
238
238
  text: e,
239
- query: ue,
239
+ query: K,
240
240
  maxLines: 1
241
241
  }) : void 0
242
- })), [e, ue]), ve = r(() => [
242
+ })), [e, K]), Z = r(() => [
243
243
  {
244
- value: M.Equal,
245
- label: S
244
+ value: R.Equal,
245
+ label: y
246
246
  },
247
247
  {
248
- value: M.Contain,
249
- label: C
248
+ value: R.Contain,
249
+ label: x
250
250
  },
251
251
  {
252
- value: M.Regex,
253
- label: w
252
+ value: R.Regex,
253
+ label: S
254
254
  }
255
255
  ], [
256
- S,
257
- C,
258
- w
259
- ]), $ = H === M.Regex, ye = fe(K), be = V != null && H != null && ($ ? ye : W.length > 0);
260
- return /* @__PURE__ */ A("div", {
261
- ref: oe,
256
+ y,
257
+ x,
258
+ S
259
+ ]), Q = H === R.Regex, $ = be(W), xe = B != null && H != null && (Q ? $ : U.length > 0);
260
+ return /* @__PURE__ */ F("div", {
261
+ ref: z,
262
262
  role: "dialog",
263
263
  "aria-modal": "true",
264
- "aria-label": L,
264
+ "aria-label": ae,
265
265
  tabIndex: -1,
266
266
  onKeyDown: (e) => {
267
267
  e.key === "Escape" && (e.stopPropagation(), s());
268
268
  },
269
- style: _,
270
- 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", Y.dialog),
269
+ style: h,
270
+ className: M("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", ve.dialog),
271
271
  children: [
272
- /* @__PURE__ */ k(b, {
273
- id: z,
274
- labelProps: { label: v },
272
+ /* @__PURE__ */ P(T, {
273
+ id: oe,
274
+ labelProps: { label: ee },
275
275
  options: _e,
276
- value: V,
276
+ value: B,
277
277
  onChange: (e) => {
278
- se(Array.isArray(e) ? e[0] : e), J(!1);
278
+ V(Array.isArray(e) ? e[0] : e), G(!1);
279
279
  },
280
- placeholder: y,
281
- searchable: e.length > de,
282
- searchPlaceholder: y,
283
- onSearchQueryChange: pe,
280
+ placeholder: v,
281
+ searchable: e.length > ye,
282
+ searchPlaceholder: v,
283
+ onSearchQueryChange: q,
284
284
  disabled: c,
285
- open: ce,
286
- onOpenChange: J,
287
- fieldClassName: Q,
288
- invalid: Z && V == null,
289
- error: Z && V == null ? N : void 0
285
+ open: fe,
286
+ onOpenChange: G,
287
+ fieldClassName: he,
288
+ invalid: Y && B == null,
289
+ error: Y && B == null ? O : void 0
290
290
  }),
291
- /* @__PURE__ */ k(b, {
292
- labelProps: { label: x },
293
- id: ae,
294
- options: ve,
291
+ /* @__PURE__ */ P(T, {
292
+ labelProps: { label: te },
293
+ id: se,
294
+ options: Z,
295
295
  value: H,
296
296
  onChange: (e) => {
297
297
  let t = Array.isArray(e) ? e[0] : e;
298
- H === M.Regex != (t === M.Regex) && (G([]), q("")), U(t), me(!1);
298
+ H === R.Regex != (t === R.Regex) && (ue([]), de("")), le(t), pe(!1);
299
299
  },
300
- placeholder: x,
300
+ placeholder: te,
301
301
  disabled: c,
302
- open: X,
303
- onOpenChange: me,
302
+ open: J,
303
+ onOpenChange: pe,
304
304
  fieldClassName: ge,
305
- invalid: Z && H == null,
306
- error: Z && H == null ? N : void 0
305
+ invalid: Y && H == null,
306
+ error: Y && H == null ? O : void 0
307
307
  }),
308
- $ ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k(m, {
309
- id: `${R}-input`,
310
- labelProps: { label: ne },
311
- placeholder: re,
312
- value: K,
313
- onChange: (e) => q(e ?? ""),
314
- invalid: (K.length > 0 || Z) && !ye,
315
- "aria-describedby": (K.length > 0 || Z) && !ye ? R : void 0,
316
- disabled: c
317
- }), (K.length > 0 || Z) && !ye && /* @__PURE__ */ k("span", {
318
- id: R,
319
- role: "alert",
320
- className: D("mt-1 block", f, Y.error),
321
- children: ie
322
- })] }) : /* @__PURE__ */ k(ee, {
323
- id: B,
324
- labelProps: { label: O },
325
- placeholder: j,
326
- caption: Z && W.length === 0 ? void 0 : te,
327
- error: Z && W.length === 0 ? P : void 0,
328
- invalid: Z && W.length === 0,
308
+ Q ? /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P(_, {
309
+ id: `${L}-input`,
310
+ labelProps: { label: w },
311
+ placeholder: E,
329
312
  value: W,
313
+ onChange: (e) => de(e ?? ""),
314
+ invalid: (W.length > 0 || Y) && !$,
315
+ "aria-describedby": (W.length > 0 || Y) && !$ ? L : void 0,
316
+ disabled: c
317
+ }), (W.length > 0 || Y) && !$ && /* @__PURE__ */ P(f, {
318
+ id: L,
319
+ className: M("mt-1 block", d, ve.error),
320
+ text: D
321
+ })] }) : /* @__PURE__ */ P(k, {
322
+ id: ce,
323
+ labelProps: { label: C },
324
+ placeholder: ne,
325
+ caption: Y && U.length === 0 ? void 0 : re,
326
+ error: Y && U.length === 0 ? A : void 0,
327
+ invalid: Y && U.length === 0,
328
+ value: U,
330
329
  onChange: (e) => {
331
330
  let t = [];
332
331
  for (let n of e) {
333
332
  let e = n.trim();
334
333
  if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= l)) break;
335
334
  }
336
- G(t);
335
+ ue(t);
337
336
  },
338
337
  disabled: c,
339
- tagClassName: T
338
+ tagClassName: j
340
339
  }),
341
- /* @__PURE__ */ A("div", {
340
+ /* @__PURE__ */ F("div", {
342
341
  className: "mt-auto flex justify-end gap-2 desktop:mt-2",
343
- children: [/* @__PURE__ */ k(d, {
342
+ children: [/* @__PURE__ */ P(m, {
344
343
  label: I,
345
344
  onClick: s,
346
345
  disabled: c
347
- }), /* @__PURE__ */ k(h, {
348
- label: F,
346
+ }), /* @__PURE__ */ P(b, {
347
+ label: N,
349
348
  onClick: () => {
350
- if (!be || V == null || H == null) {
351
- he(!0);
352
- return;
353
- }
354
- o({
355
- source: V,
349
+ !xe || B == null || H == null ? me(!0) : o({
350
+ source: B,
356
351
  function: H,
357
- targets: $ ? [K.trim()] : W
352
+ targets: Q ? [W.trim()] : U
358
353
  });
359
354
  },
360
355
  disabled: c
@@ -362,165 +357,164 @@ var M = /* @__PURE__ */ function(e) {
362
357
  })
363
358
  ]
364
359
  });
365
- }, X = {
360
+ }, $ = {
366
361
  ruleRow: "_ruleRow_nx0en_1",
367
362
  heading: "_heading_nx0en_5",
368
363
  hint: "_hint_nx0en_9",
369
364
  loading: "_loading_nx0en_13",
370
365
  ruleText: "_ruleText_nx0en_17"
371
- }, me = 20, Z = (e, t) => e === M.Equal ? t.equal : e === M.Contain ? t.contain : t.regex, he = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: p = !1, isLoading: m = !1, hasLoadError: h = !1, maxRules: y = me, maxTargetsPerRule: b, labels: x = {}, headingClassName: C = "dial-body-semi-text", hintClassName: ee = "dial-small-text", loadingClassName: w = "dial-small-text", ruleTextClassName: T = "dial-small-text", ruleSourceClassName: O = "dial-small-semi-text", styles: j = {} }) => {
372
- let re = {
373
- ...E({
374
- "--par-rule-bg": j.colors?.ruleBackground,
375
- "--par-heading-text": j.colors?.headingText,
376
- "--par-hint-text": j.colors?.hintText,
377
- "--par-loading-text": j.colors?.loadingText,
378
- "--par-rule-text": j.colors?.ruleText
366
+ }, xe = 20, Se = (e, t) => e === R.Equal ? t.equal : e === R.Contain ? t.contain : t.regex, Ce = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: d = !1, isLoading: f = !1, hasLoadError: p = !1, maxRules: g = xe, maxTargetsPerRule: _, labels: ee = {}, headingClassName: y = "dial-body-semi-text", hintClassName: b = "dial-small-text", loadingClassName: ne = "dial-small-text", ruleTextClassName: re = "dial-small-text", ruleSourceClassName: w = "dial-small-semi-text", styles: T = {} }) => {
367
+ let E = {
368
+ ...ie({
369
+ "--par-rule-bg": T.colors?.ruleBackground,
370
+ "--par-heading-text": T.colors?.headingText,
371
+ "--par-hint-text": T.colors?.hintText,
372
+ "--par-loading-text": T.colors?.loadingText,
373
+ "--par-rule-text": T.colors?.ruleText
379
374
  }),
380
- ...j.cssVars
381
- }, { heading: ie = "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: z = "Remove rule for {source}: {targets}", equalFunctionLabel: ae = "Equal", containFunctionLabel: B = "Contain", regexFunctionLabel: oe = "Regex", loadingLabel: V = "Loading existing rules…", loadErrorLabel: se = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: H = "Rule added.", ruleRemovedAnnouncement: U = "Rule removed.", rulesClearedAnnouncement: W = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: K } = x, q = n(), [ce, J] = a(!1), [Y, le] = a(""), ue = i(null), de = i(m);
375
+ ...T.cssVars
376
+ }, { heading: O = "Allow access if all match", folderScopeHint: k = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: A = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: j = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: N = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: ae = "Clear all", orSeparatorLabel: se = "Or", removeRuleAriaLabelTemplate: ce = "Remove rule for {source}: {targets}", equalFunctionLabel: R = "Equal", containFunctionLabel: z = "Contain", regexFunctionLabel: B = "Regex", loadingLabel: V = "Loading existing rules…", loadErrorLabel: H = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: le = "Rule added.", ruleRemovedAnnouncement: U = "Rule removed.", rulesClearedAnnouncement: ue = "All rules cleared.", rulesLoadedAnnouncement: W = "Existing rules loaded for the selected folder.", editorLabels: de } = ee, fe = n(), [G, K] = a(!1), [q, J] = a(""), pe = i(null), Y = i(f);
382
377
  t(() => {
383
- de.current && !m && e.length > 0 && le(G), de.current = m;
378
+ Y.current && !f && e.length > 0 && J(W), Y.current = f;
384
379
  }, [
385
- m,
380
+ f,
386
381
  e,
387
- G
382
+ W
388
383
  ]);
389
- let fe = () => {
390
- ue.current = document.activeElement, J(!0);
384
+ let me = () => {
385
+ pe.current = document.activeElement, K(!0);
391
386
  }, he = () => {
392
- J(!1), ue.current?.focus?.();
393
- }, Q = (t) => {
394
- r([...e, t]), le(H), he();
387
+ K(!1), pe.current?.focus?.();
395
388
  }, ge = (t) => {
396
- r(e.filter((e, n) => n !== t)), le(U);
397
- }, _e = () => {
398
- r([]), le(W);
399
- }, ve = {
400
- equal: ae,
401
- contain: B,
402
- regex: oe
403
- }, $ = e.length >= y, ye = p || $, be = u != null && u !== "";
404
- return /* @__PURE__ */ A("div", {
389
+ r([...e, t]), J(le), he();
390
+ }, _e = (t) => {
391
+ r(e.filter((e, n) => n !== t)), J(U);
392
+ }, ve = () => {
393
+ r([]), J(ue);
394
+ }, X = {
395
+ equal: R,
396
+ contain: z,
397
+ regex: B
398
+ }, Z = e.length >= g, ye = d || Z, be = u != null && u !== "";
399
+ return /* @__PURE__ */ F("div", {
405
400
  role: "group",
406
- "aria-labelledby": q,
407
- style: re,
408
- className: D(p && "pointer-events-none opacity-60"),
401
+ "aria-labelledby": fe,
402
+ style: E,
403
+ className: M(d && "pointer-events-none opacity-60"),
409
404
  children: [
410
- /* @__PURE__ */ k("span", {
411
- role: "status",
412
- "aria-live": "polite",
413
- className: "sr-only",
414
- children: Y
405
+ /* @__PURE__ */ P(v, {
406
+ visuallyHidden: !0,
407
+ as: te.Span,
408
+ children: q
415
409
  }),
416
- /* @__PURE__ */ A("div", {
410
+ /* @__PURE__ */ F("div", {
417
411
  className: "mb-1 flex items-center justify-between gap-2",
418
- children: [/* @__PURE__ */ k("div", {
419
- id: q,
420
- className: D(C, X.heading),
421
- children: ie
422
- }), e.length > 0 && /* @__PURE__ */ k(d, {
412
+ children: [/* @__PURE__ */ P("div", {
413
+ id: fe,
414
+ className: M(y, $.heading),
415
+ children: O
416
+ }), e.length > 0 && /* @__PURE__ */ P(m, {
423
417
  variant: o.Primary,
424
- label: L,
425
- onClick: _e,
426
- disabled: p
418
+ label: ae,
419
+ onClick: ve,
420
+ disabled: d
427
421
  })]
428
422
  }),
429
- /* @__PURE__ */ k("p", {
430
- className: D("mb-2", ee, X.hint),
431
- children: be ? M.replace("{folder}", u) : N
423
+ /* @__PURE__ */ P("p", {
424
+ className: M("mb-2", b, $.hint),
425
+ children: be ? k.replace("{folder}", u) : A
432
426
  }),
433
- e.length > 0 && !be && /* @__PURE__ */ k("div", {
427
+ e.length > 0 && !be && /* @__PURE__ */ P("div", {
434
428
  className: "mb-2",
435
- children: /* @__PURE__ */ k(g, {
436
- type: _.SectionMessage,
437
- variant: v.Warning,
438
- message: P
429
+ children: /* @__PURE__ */ P(x, {
430
+ type: S.SectionMessage,
431
+ variant: C.Warning,
432
+ message: j
439
433
  })
440
434
  }),
441
- m && /* @__PURE__ */ A("div", {
442
- className: D("mb-2 flex items-center gap-2", w, X.loading),
443
- children: [/* @__PURE__ */ k(S, {
435
+ f && /* @__PURE__ */ F("div", {
436
+ className: M("mb-2 flex items-center gap-2", ne, $.loading),
437
+ children: [/* @__PURE__ */ P(D, {
444
438
  size: 16,
445
439
  ariaLabel: V
446
- }), /* @__PURE__ */ k("span", { children: V })]
440
+ }), /* @__PURE__ */ P("span", { children: V })]
447
441
  }),
448
- h && /* @__PURE__ */ k("div", {
442
+ p && /* @__PURE__ */ P("div", {
449
443
  className: "mb-2",
450
- children: /* @__PURE__ */ k(g, {
451
- type: _.SectionMessage,
452
- variant: v.Warning,
453
- message: se
444
+ children: /* @__PURE__ */ P(x, {
445
+ type: S.SectionMessage,
446
+ variant: C.Warning,
447
+ message: H
454
448
  })
455
449
  }),
456
- e.length > 0 && /* @__PURE__ */ k("ul", {
450
+ e.length > 0 && /* @__PURE__ */ P("ul", {
457
451
  className: "mb-3 flex flex-col gap-2",
458
452
  children: e.map((e, t) => {
459
- let n = e.targets.join(` ${R} `), r = z.replace("{source}", e.source).replace("{targets}", n);
460
- return /* @__PURE__ */ A("li", {
461
- className: D("flex items-center justify-between gap-2 rounded-lg px-3 py-2", X.ruleRow),
462
- children: [/* @__PURE__ */ A("span", {
463
- className: D("truncate", T, X.ruleText),
453
+ let n = e.targets.join(` ${se} `), r = ce.replace("{source}", e.source).replace("{targets}", n);
454
+ return /* @__PURE__ */ F("li", {
455
+ className: M("flex items-center justify-between gap-2 rounded-lg px-3 py-2", $.ruleRow),
456
+ children: [/* @__PURE__ */ F("span", {
457
+ className: M("truncate", re, $.ruleText),
464
458
  children: [
465
- /* @__PURE__ */ k("span", {
466
- className: O,
459
+ /* @__PURE__ */ P("span", {
460
+ className: w,
467
461
  children: e.source
468
462
  }),
469
463
  " ",
470
- Z(e.function, ve),
464
+ Se(e.function, X),
471
465
  ": ",
472
466
  n
473
467
  ]
474
- }), /* @__PURE__ */ k(f, {
475
- icon: /* @__PURE__ */ k(ne, {
468
+ }), /* @__PURE__ */ P(h, {
469
+ icon: /* @__PURE__ */ P(oe, {
476
470
  size: c.SM,
477
471
  "aria-hidden": !0,
478
472
  stroke: l
479
473
  }),
480
474
  "aria-label": r,
481
- onClick: () => ge(t),
482
- disabled: p
475
+ onClick: () => _e(t),
476
+ disabled: d
483
477
  })]
484
478
  }, t);
485
479
  })
486
480
  }),
487
- ce && /* @__PURE__ */ k(pe, {
481
+ G && /* @__PURE__ */ P(Q, {
488
482
  sourceOptions: s,
489
- onSave: Q,
483
+ onSave: ge,
490
484
  onCancel: he,
491
- disabled: p,
492
- maxTargets: b,
493
- labels: K,
494
- styles: j.editor
485
+ disabled: d,
486
+ maxTargets: _,
487
+ labels: de,
488
+ styles: T.editor
495
489
  }),
496
- /* @__PURE__ */ k("div", {
490
+ /* @__PURE__ */ P("div", {
497
491
  className: "flex flex-wrap items-center gap-2",
498
- children: /* @__PURE__ */ k(d, {
492
+ children: /* @__PURE__ */ P(m, {
499
493
  label: I,
500
- iconBefore: /* @__PURE__ */ k(te, {
494
+ iconBefore: /* @__PURE__ */ P(L, {
501
495
  size: c.SM,
502
496
  "aria-hidden": !0,
503
497
  stroke: l
504
498
  }),
505
- onClick: fe,
499
+ onClick: me,
506
500
  disabled: ye
507
501
  })
508
502
  }),
509
- $ && /* @__PURE__ */ k("p", {
510
- className: D("mt-2", ee, X.hint),
511
- children: F.replace("{max}", String(y))
503
+ Z && /* @__PURE__ */ P("p", {
504
+ className: M("mt-2", b, $.hint),
505
+ children: N.replace("{max}", String(g))
512
506
  })
513
507
  ]
514
508
  });
515
- }, Q = {
509
+ }, we = {
516
510
  currentBadge: "_currentBadge_d0adf_1",
517
511
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
518
512
  version: "_version_d0adf_13",
519
513
  date: "_date_d0adf_17",
520
514
  emptyState: "_emptyState_d0adf_21",
521
515
  stripedRow: "_stripedRow_d0adf_25"
522
- }, 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 }) => {
523
- let m = E({
516
+ }, Te = ({ 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 = ie({
524
518
  "--phl-badge-border": p?.currentBadgeBorder,
525
519
  "--phl-badge-bg": p?.currentBadgeBackground,
526
520
  "--phl-badge-text": p?.currentBadgeText,
@@ -531,233 +525,304 @@ var M = /* @__PURE__ */ function(e) {
531
525
  "--phl-date-text": p?.dateText,
532
526
  "--phl-empty-text": p?.emptyStateText,
533
527
  "--phl-striped-bg": p?.stripedBackground
534
- }), h = D(f, Q.emptyState);
535
- return n ? /* @__PURE__ */ k("p", {
536
- style: m,
537
- className: h,
538
- children: c
539
- }) : r ? /* @__PURE__ */ k("p", {
540
- style: m,
541
- className: h,
542
- role: "alert",
543
- children: l
544
- }) : e.length === 0 ? /* @__PURE__ */ k("p", {
545
- style: m,
546
- className: h,
547
- children: s
548
- }) : /* @__PURE__ */ k("ul", {
528
+ }), h = M(f, we.emptyState);
529
+ if (n || r || e.length === 0) {
530
+ let e = s;
531
+ return n ? e = c : r && (e = l), /* @__PURE__ */ P(v, {
532
+ as: te.P,
533
+ style: m,
534
+ className: h,
535
+ children: e
536
+ });
537
+ }
538
+ return /* @__PURE__ */ P("ul", {
549
539
  style: m,
550
- children: e.map((e, n) => /* @__PURE__ */ A("li", {
551
- className: D("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Q.stripedRow),
552
- children: [/* @__PURE__ */ A("span", {
540
+ children: e.map((e, n) => /* @__PURE__ */ F("li", {
541
+ className: M("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && we.stripedRow),
542
+ children: [/* @__PURE__ */ F("span", {
553
543
  className: "flex min-w-0 items-center gap-2",
554
544
  style: m,
555
545
  children: [
556
- /* @__PURE__ */ A("span", {
557
- className: D(u, Q.version),
546
+ /* @__PURE__ */ F("span", {
547
+ className: M(u, we.version),
558
548
  children: [
559
549
  i,
560
550
  " ",
561
551
  e.version
562
552
  ]
563
553
  }),
564
- e.version === t && /* @__PURE__ */ k(C, {
554
+ e.version === t && /* @__PURE__ */ P(O, {
565
555
  label: a,
566
- className: D("shrink-0 whitespace-nowrap", Q.currentBadge)
556
+ className: M("shrink-0 whitespace-nowrap", we.currentBadge)
567
557
  }),
568
- e.publishCredentials === !0 && /* @__PURE__ */ k(C, {
558
+ e.publishCredentials === !0 && /* @__PURE__ */ P(O, {
569
559
  label: o,
570
- className: D("shrink-0 whitespace-nowrap", Q.sharedCredentialsBadge)
560
+ className: M("shrink-0 whitespace-nowrap", we.sharedCredentialsBadge)
571
561
  })
572
562
  ]
573
- }), /* @__PURE__ */ k("span", {
574
- className: D(d, Q.date),
575
- children: I(e.publishedAt)
563
+ }), /* @__PURE__ */ P("span", {
564
+ className: M(d, we.date),
565
+ children: H(e.publishedAt)
576
566
  })]
577
567
  }, `${e.version}-${n}`))
578
568
  });
579
- }, _e = {
569
+ }, Ee = ":", De = (e) => `${Ee}${e}`, Oe = (e) => e?.startsWith(Ee) ? e.slice(1) : void 0, ke = (e) => [De(e.rootKey), ...e.path], Ae = (e) => {
570
+ let [t, ...n] = e, r = Oe(t);
571
+ return r == null ? void 0 : {
572
+ rootKey: r,
573
+ path: n
574
+ };
575
+ }, je = (e, t) => e.map((e) => ({
576
+ ...e,
577
+ path: [t, ...e.path],
578
+ children: e.children ? je(e.children, t) : void 0
579
+ })), Me = (e) => e.map((e) => {
580
+ let t = De(e.key);
581
+ return {
582
+ path: [t],
583
+ name: e.label,
584
+ children: je(fe(e.items), t)
585
+ };
586
+ }), Ne = (e) => e.map((e) => De(e.key)), Pe = (e, t) => {
587
+ let n = /* @__PURE__ */ new Set();
588
+ for (let r of e) {
589
+ let e = De(r.key);
590
+ for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
591
+ }
592
+ return n;
593
+ }, Fe = (e, t) => {
594
+ let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
595
+ for (let e of t) {
596
+ let [t, ...r] = e.split("/"), i = Oe(t);
597
+ i != null && r.length !== 0 && n.get(i)?.add(J(r));
598
+ }
599
+ return n;
600
+ }, Ie = {
580
601
  divider: "_divider_1gs31_1",
581
602
  tree: "_tree_1gs31_17"
582
- }, ve = ({ 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: b = "A folder with this name already exists.", rootLabel: x = "Organization", expandedPaths: S, onExpandedPathsChange: C, loadingPaths: ee, styles: w = {} }) => {
583
- let T = {
584
- ...E({ "--pft-divider": w.colors?.divider }),
585
- ...w.cssVars
586
- }, [O, ne] = a(() => new Set(t?.map((e, n) => U(t.slice(0, n + 1))) ?? [])), M = S ?? O, N = (e) => {
603
+ }, Le = "data-cancel-creating-folder", Re = "", ze = [], Be = ({ items: e = ze, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: u, destination: d, onDestinationChange: f, onCreateDestinationFolder: p, searchQuery: h, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: ee = "Cancel", addSiblingFolderLabel: v = "Add sibling", addChildFolderLabel: te = "Add child", newFolderDefaultName: y = "New folder", noResultsLabel: b = "No folders match \"{query}\".", emptyFolderNameError: x = "Folder name cannot be empty.", invalidFolderNameError: S = "Folder name contains invalid characters.", duplicateFolderNameError: C = "A folder with this name already exists.", rootLabel: ne = "Organization", expandedPaths: re, onExpandedPathsChange: w, loadingPaths: T, styles: E = {} }) => {
604
+ let D = {
605
+ ...ie({ "--pft-divider": E.colors?.divider }),
606
+ ...E.cssVars
607
+ }, O = u != null, k = r(() => u ? Me(u) : e, [u, e]), A = r(() => u ? Ne(u) : [Re], [u]), j = n;
608
+ O && (j = d ? ke(d) : void 0);
609
+ let N = (e) => {
610
+ O ? f?.(e ? Ae(e) : void 0) : o?.(e);
611
+ }, [I, oe] = a(() => new Set(j?.map((e, t) => J(j.slice(0, t + 1))) ?? [])), R = r(() => u ? /* @__PURE__ */ new Set([...I, ...Pe(u, (e) => e.expandedPaths)]) : void 0, [u, I]) ?? re ?? I, z = r(() => u ? Pe(u, (e) => e.loadingPaths) : T, [u, T]), B = (e) => {
587
612
  let t = new Set(e);
588
- t.delete(""), C ? C(t) : ne(t);
589
- }, [P, F] = a(null), [I, L] = a(g), R = i(null), z = s.trim(), B = P != null, V = r(() => ae(e, s), [e, s]), se = z.length > 0 && V.length === 0, K = !B && z.length > 0, Y = r(() => oe(K ? V : e), [
590
- K,
591
- V,
592
- e
593
- ]), le = r(() => new Set(["", ...H(Y)]), [Y]), ue = r(() => new Set(["", ...K ? le : M]), [
594
- K,
595
- le,
596
- M
597
- ]), de = r(() => G(Y), [Y]), fe = r(() => K && de.length === 0 ? [] : [{
598
- path: "",
599
- name: x,
600
- folderId: "",
601
- nodeType: re.FOLDER,
602
- items: de
613
+ for (let e of A) t.delete(e);
614
+ if (u) {
615
+ oe(t);
616
+ let e = Fe(u, t);
617
+ for (let t of u) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
618
+ } else w ? w(t) : oe(t);
619
+ }, [V, H] = a(null), [le, U] = a(y), ue = i(null), de = i(!1);
620
+ t(() => {
621
+ let e = (e) => {
622
+ e.target instanceof Element && e.target.closest(`[${Le}]`) && (de.current = !0);
623
+ };
624
+ return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
625
+ }, []);
626
+ let G = h.trim(), K = V != null, me = r(() => W(k, h), [k, h]), ve = G.length > 0 && me.length === 0, X = !K && G.length > 0, Z = r(() => {
627
+ let e = X ? me : k;
628
+ return O ? e : fe(e);
629
+ }, [
630
+ X,
631
+ me,
632
+ k,
633
+ O
634
+ ]), ye = r(() => /* @__PURE__ */ new Set([...A, ...q(Z)]), [A, Z]), be = r(() => /* @__PURE__ */ new Set([...A, ...X ? ye : R]), [
635
+ A,
636
+ X,
637
+ ye,
638
+ R
639
+ ]), Q = r(() => Y(Z), [Z]), $ = r(() => X && Q.length === 0 ? [] : O ? Q : [{
640
+ path: Re,
641
+ name: ne,
642
+ folderId: Re,
643
+ nodeType: se.FOLDER,
644
+ items: Q
603
645
  }], [
604
- de,
605
- x,
606
- K
607
- ]), pe = P ? U(P) : null, X = {
608
- empty: v,
609
- invalid: y,
610
- duplicate: b
611
- }, me = (t) => ce(se && q(z, [], X) == null ? z : g, J(e, t)), Z = (e) => {
612
- F(e), L(me(e)), R.current = null;
613
- let t = U(e);
614
- t && N(new Set(M).add(t));
615
- }, he = () => Z(t ?? []), Q = (e) => {
616
- let t = W(e.path), n = [{
646
+ Q,
647
+ ne,
648
+ X,
649
+ O
650
+ ]), xe = V ? J(V) : null, Se = {
651
+ empty: x,
652
+ invalid: S,
653
+ duplicate: C
654
+ }, Ce = (e) => {
655
+ if (!u) return !0;
656
+ let t = Ae(e), n = u.find((e) => e.key === t?.rootKey);
657
+ return n != null && n.canCreateFolders !== !1;
658
+ }, we = (() => {
659
+ if (!u) return j ?? [];
660
+ if (j && Ce(j)) return j;
661
+ let e = u.find((e) => e.canCreateFolders !== !1);
662
+ return e ? ke({
663
+ rootKey: e.key,
664
+ path: []
665
+ }) : void 0;
666
+ })(), Te = (e) => ge(ve && he(G, [], Se) == null ? G : y, _e(k, e)), Ee = (e) => {
667
+ H(e), U(Te(e)), ue.current = null, de.current = !1;
668
+ let t = J(e);
669
+ t && B(new Set(R).add(t));
670
+ }, De = () => {
671
+ we && Ee(we);
672
+ }, Oe = (e) => {
673
+ let t = pe(e.path);
674
+ if (!Ce(t)) return [];
675
+ let n = [{
617
676
  key: "add-child",
618
- label: h,
619
- icon: /* @__PURE__ */ k(j, {
677
+ label: te,
678
+ icon: /* @__PURE__ */ P(ae, {
620
679
  size: c.SM,
621
680
  "aria-hidden": !0,
622
681
  stroke: l
623
682
  }),
624
- onClick: () => Z(t)
683
+ onClick: () => Ee(t)
625
684
  }];
626
- return e.path !== "" && n.push({
685
+ return A.includes(e.path) || n.push({
627
686
  key: "add-sibling",
628
- label: m,
629
- icon: /* @__PURE__ */ k(te, {
687
+ label: v,
688
+ icon: /* @__PURE__ */ P(L, {
630
689
  size: c.SM,
631
690
  "aria-hidden": !0,
632
691
  stroke: l
633
692
  }),
634
- onClick: () => Z(t.slice(0, -1))
693
+ onClick: () => Ee(t.slice(0, -1))
635
694
  }), n;
636
- }, ge = (t) => {
637
- if (!P) return null;
638
- let n = q(t, J(e, P), X);
639
- return R.current = n, n;
640
- }, ve = (e) => {
641
- if (!P) return;
642
- let t = e.trim(), r = R.current;
643
- (ge(e) ?? r) || (o(P, t), n([...P, t])), F(null);
644
- }, $ = () => F(null);
645
- return /* @__PURE__ */ A("div", {
646
- style: T,
647
- className: D(u && "pointer-events-none opacity-60", w.className),
695
+ }, je = (e) => {
696
+ if (!V) return null;
697
+ let t = he(e, _e(k, V), Se);
698
+ return ue.current = t, t;
699
+ }, Be = (e) => {
700
+ if (!V || de.current) return;
701
+ let t = e.trim(), n = ue.current;
702
+ if (!(je(e) ?? n)) {
703
+ let e = u ? Ae(V) : void 0;
704
+ e ? p?.(e.rootKey, e.path, t) : s?.(V, t), N([...V, t]);
705
+ }
706
+ H(null);
707
+ }, Ve = () => H(null);
708
+ return /* @__PURE__ */ F("div", {
709
+ style: D,
710
+ className: M(g && "pointer-events-none opacity-60", E.className),
648
711
  children: [
649
- /* @__PURE__ */ k("div", {
650
- className: D("w-full min-w-0 max-w-full", _e.tree),
651
- children: /* @__PURE__ */ k(ie, {
652
- items: fe,
712
+ /* @__PURE__ */ P("div", {
713
+ className: M("w-full max-w-full min-w-0", Ie.tree),
714
+ children: /* @__PURE__ */ P(ce, {
715
+ items: $,
653
716
  showFiles: !1,
654
- selectedPath: t == null ? void 0 : U(t),
655
- expandedPaths: ue,
656
- onExpandedPathsChange: N,
657
- loadingPaths: ee,
717
+ selectedPath: j == null ? void 0 : J(j),
718
+ expandedPaths: be,
719
+ onExpandedPathsChange: B,
720
+ loadingPaths: z,
658
721
  onItemClick: (e) => {
659
- n(t != null && U(t) === e.path ? void 0 : W(e.path));
722
+ let t = j != null && J(j) === e.path;
723
+ N(t ? void 0 : pe(e.path));
660
724
  },
661
- getContextMenuItems: Q,
662
- createdFolderPath: pe,
663
- newFolderDefaultName: I,
664
- onCreateFolderSave: ve,
665
- onCreateFolderCancel: $,
666
- onRenameValidate: (e) => ge(e),
667
- emptyStateTitle: K ? _.replace("{query}", z) : void 0
725
+ getContextMenuItems: Oe,
726
+ createdFolderPath: xe,
727
+ newFolderDefaultName: le,
728
+ onCreateFolderSave: Be,
729
+ onCreateFolderCancel: Ve,
730
+ onRenameValidate: (e) => je(e),
731
+ emptyStateTitle: X ? b.replace("{query}", G) : void 0
668
732
  })
669
733
  }),
670
- /* @__PURE__ */ k("div", {
671
- className: D("my-2 h-px", _e.divider),
734
+ /* @__PURE__ */ P("div", {
735
+ className: M("my-2 h-px", Ie.divider),
672
736
  "aria-hidden": !0
673
737
  }),
674
- /* @__PURE__ */ A("div", {
738
+ /* @__PURE__ */ F("div", {
675
739
  className: "mb-4 flex flex-wrap items-center gap-2",
676
- children: [/* @__PURE__ */ k(d, {
677
- onClick: he,
678
- label: f,
679
- iconBefore: /* @__PURE__ */ k(te, {
740
+ children: [/* @__PURE__ */ P(m, {
741
+ onClick: De,
742
+ label: _,
743
+ iconBefore: /* @__PURE__ */ P(L, {
680
744
  size: c.SM,
681
745
  "aria-hidden": !0,
682
746
  stroke: l
683
747
  }),
684
- disabled: u || B
685
- }), B && /* @__PURE__ */ k(d, {
686
- label: p,
687
- onClick: $,
688
- disabled: u
748
+ disabled: g || K || !we
749
+ }), K && /* @__PURE__ */ P(m, {
750
+ label: ee,
751
+ onClick: Ve,
752
+ disabled: g,
753
+ [Le]: ""
689
754
  })]
690
755
  })
691
756
  ]
692
757
  });
693
- }, $ = { panel: "dial-publish-panel-panel" }, ye = {
758
+ }, Ve = { panel: "dial-publish-panel-panel" }, He = {
694
759
  summaryTitle: "_summaryTitle_tf20a_1",
695
760
  sectionHeading: "_sectionHeading_tf20a_5"
696
- }, be = 200, xe = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: h, isSubmitting: v, hasSubmitError: b = !1, allowReplace: x = !0, author: S, onAuthorChange: C, publishCredentials: ee = !1, onPublishCredentialsChange: T, rules: O, onRulesChange: j, ruleSourceOptions: te, isRulesLoading: ne = !1, hasRulesLoadError: re = !1, labels: ie = {}, summaryTitleClassName: M = "dial-body-semi-text", headingClassName: F = "dial-body-semi-text", styles: I = {} }) => {
697
- let { colors: L, folderTree: R, accessRules: z } = I, ae = {
698
- ...E({
699
- "--pp-summary-title-text": L?.summaryTitleText,
700
- "--pp-heading-text": L?.headingText
761
+ }, Ue = 200, We = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: ee = !0, author: v, onAuthorChange: te, publishCredentials: y = !1, onPublishCredentialsChange: b, rules: C, onRulesChange: ne, ruleSourceOptions: re, isRulesLoading: T = !1, hasRulesLoadError: E = !1, labels: D = {}, summaryTitleClassName: O = "dial-body-semi-text", headingClassName: k = "dial-body-semi-text", calloutFolderNameClassName: j = "dial-small-paragraph-semi-text", styles: N = {} }) => {
762
+ let { colors: I, folderTree: ae, accessRules: L } = N, oe = {
763
+ ...ie({
764
+ "--pp-summary-title-text": I?.summaryTitleText,
765
+ "--pp-heading-text": I?.headingText
701
766
  }),
702
- ...I.cssVars
703
- }, B = {
704
- border: L?.summaryBorder,
705
- background: L?.summaryBackground,
706
- versionTagBorder: L?.summaryVersionTagBorder,
707
- versionTagBackground: L?.summaryVersionTagBackground,
708
- versionTagText: L?.summaryVersionTagText
709
- }, { folderLabel: oe = "Publish to folder", replaceWarning: V = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: se = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: H = "Publishing failed. Please try again.", folderEmptyStateLabel: U, addSiblingFolderLabel: W, addChildFolderLabel: G, cancelCreatingFolderLabel: K, createFolderEmptyNameError: q, createFolderInvalidNameError: ce, createFolderDuplicateNameError: J, rootFolderLabel: Y = "Organization", summaryVersionLabel: le, accessRulesLabels: ue, searchPlaceholder: de, clearSearchAriaLabel: fe, authorLabel: pe = "Author", authorPlaceholder: X = "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: Q = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = ie, [ge, _e] = a(""), xe = n(), Ce = (e) => {
710
- _e(e ?? "");
711
- }, Te = o != null, Ee = r(() => P({
712
- hasSelectedFolder: Te,
767
+ ...N.cssVars
768
+ }, se = {
769
+ border: I?.summaryBorder,
770
+ background: I?.summaryBackground,
771
+ versionTagBorder: I?.summaryVersionTagBorder,
772
+ versionTagBackground: I?.summaryVersionTagBackground,
773
+ versionTagText: I?.summaryVersionTagText
774
+ }, { folderLabel: ce = "Publish to folder", replaceWarning: R = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: V = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: H = "Publishing failed. Please try again.", folderEmptyStateLabel: le, addSiblingFolderLabel: U, addChildFolderLabel: ue, cancelCreatingFolderLabel: W, createFolderEmptyNameError: de, createFolderInvalidNameError: fe, createFolderDuplicateNameError: G, rootFolderLabel: K = "Organization", summaryVersionLabel: q, accessRulesLabels: J, searchPlaceholder: pe, clearSearchAriaLabel: Y, authorLabel: me = "Author", authorPlaceholder: he = "Author name", authorHint: ge = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: _e = "Publish with my credentials", credentialsHint: ve = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = D, [X, Z] = a(""), ye = n(), be = (e) => {
775
+ Z(e ?? "");
776
+ }, Q = o != null, $ = r(() => B({
777
+ hasSelectedFolder: Q,
713
778
  hasExistingPublicationInFolder: p,
714
- hasWriteAccess: h,
715
- isSubmitting: v,
716
- hasSubmitError: b,
717
- allowReplace: x
779
+ hasWriteAccess: m,
780
+ isSubmitting: h,
781
+ hasSubmitError: g,
782
+ allowReplace: ee
718
783
  }), [
719
- Te,
784
+ Q,
720
785
  p,
786
+ m,
721
787
  h,
722
- v,
723
- b,
724
- x
725
- ]), De = Te ? o[o.length - 1] ?? Y : "", Oe = t ? t() : /* @__PURE__ */ k("span", {
726
- className: D("truncate", M, ye.summaryTitle),
788
+ g,
789
+ ee
790
+ ]), xe = Q ? o[o.length - 1] ?? K : "", Se = t ? t() : /* @__PURE__ */ P("span", {
791
+ className: M("truncate", O, He.summaryTitle),
727
792
  children: e?.title
728
793
  });
729
- return /* @__PURE__ */ A("div", {
730
- className: D("flex flex-col gap-5", $.panel),
731
- style: ae,
732
- children: [e?.type == null ? /* @__PURE__ */ k(w, {
733
- colors: B,
734
- children: Oe
735
- }) : /* @__PURE__ */ k(w, {
794
+ return /* @__PURE__ */ F("div", {
795
+ className: M("flex flex-col gap-5", Ve.panel),
796
+ style: oe,
797
+ children: [e?.type == null ? /* @__PURE__ */ P(A, {
798
+ colors: se,
799
+ children: Se
800
+ }) : /* @__PURE__ */ P(A, {
736
801
  item: {
737
802
  type: e.type,
738
803
  name: e.title,
739
804
  version: e.version ?? "",
740
805
  iconUrl: e.iconUrl
741
806
  },
742
- versionLabel: le,
743
- colors: B
744
- }), /* @__PURE__ */ A("div", { children: [
745
- /* @__PURE__ */ k("div", {
746
- className: D("mb-2", F, ye.sectionHeading),
747
- children: oe
807
+ versionLabel: q,
808
+ colors: se
809
+ }), /* @__PURE__ */ F("div", { children: [
810
+ /* @__PURE__ */ P("div", {
811
+ className: M("mb-2", k, He.sectionHeading),
812
+ children: ce
748
813
  }),
749
- /* @__PURE__ */ k("div", {
814
+ /* @__PURE__ */ P("div", {
750
815
  role: "search",
751
816
  className: "mb-3",
752
- children: /* @__PURE__ */ k(y, {
753
- value: ge,
754
- onChange: Ce,
755
- placeholder: de,
756
- clearLabel: fe,
757
- "aria-label": de
817
+ children: /* @__PURE__ */ P(w, {
818
+ value: X,
819
+ onChange: be,
820
+ placeholder: pe,
821
+ clearLabel: Y,
822
+ "aria-label": pe
758
823
  })
759
824
  }),
760
- /* @__PURE__ */ k(ve, {
825
+ /* @__PURE__ */ P(Be, {
761
826
  items: i,
762
827
  selectedPath: o,
763
828
  onSelectedPathChange: c,
@@ -765,114 +830,115 @@ var M = /* @__PURE__ */ function(e) {
765
830
  expandedPaths: u,
766
831
  onExpandedPathsChange: d,
767
832
  loadingPaths: f,
768
- searchQuery: ge,
769
- disabled: v,
770
- noResultsLabel: U,
771
- addSiblingFolderLabel: W,
772
- addChildFolderLabel: G,
773
- cancelCreatingFolderLabel: K,
774
- emptyFolderNameError: q,
775
- invalidFolderNameError: ce,
776
- duplicateFolderNameError: J,
777
- rootLabel: Y,
778
- styles: R
833
+ searchQuery: X,
834
+ disabled: h,
835
+ noResultsLabel: le,
836
+ addSiblingFolderLabel: U,
837
+ addChildFolderLabel: ue,
838
+ cancelCreatingFolderLabel: W,
839
+ emptyFolderNameError: de,
840
+ invalidFolderNameError: fe,
841
+ duplicateFolderNameError: G,
842
+ rootLabel: K,
843
+ styles: ae
779
844
  }),
780
- Ee.calloutKind !== N.None && Ee.calloutKind !== N.Info && /* @__PURE__ */ k("div", {
845
+ $.calloutKind !== z.None && $.calloutKind !== z.Info && /* @__PURE__ */ P("div", {
781
846
  className: "mt-3",
782
- children: /* @__PURE__ */ k(g, {
783
- type: _.SectionMessage,
784
- variant: Se(Ee.calloutKind),
785
- message: we(Ee.calloutKind, {
786
- replaceWarning: V,
787
- noAccessError: se,
847
+ children: /* @__PURE__ */ P(x, {
848
+ type: S.SectionMessage,
849
+ variant: Ge($.calloutKind),
850
+ message: qe($.calloutKind, {
851
+ replaceWarning: R,
852
+ noAccessError: V,
788
853
  submitError: H,
789
- folderName: De,
790
- version: e?.version
854
+ folderName: xe,
855
+ version: e?.version,
856
+ folderNameClassName: j
791
857
  })
792
858
  })
793
859
  }),
794
- /* @__PURE__ */ k("div", {
860
+ /* @__PURE__ */ P("div", {
795
861
  className: "mt-4",
796
- children: /* @__PURE__ */ k(m, {
797
- id: xe,
798
- labelProps: { label: pe },
799
- placeholder: X,
800
- caption: me,
801
- value: S,
802
- onChange: (e) => C(e ?? ""),
803
- maxLength: be,
804
- disabled: v
862
+ children: /* @__PURE__ */ P(_, {
863
+ id: ye,
864
+ labelProps: { label: me },
865
+ placeholder: he,
866
+ caption: ge,
867
+ value: v,
868
+ onChange: (e) => te(e ?? ""),
869
+ maxLength: Ue,
870
+ disabled: h
805
871
  })
806
872
  }),
807
- T != null && /* @__PURE__ */ k("div", {
873
+ b != null && /* @__PURE__ */ P("div", {
808
874
  className: "mt-4",
809
- children: /* @__PURE__ */ k(s, {
810
- labelProps: { label: Z },
811
- caption: Q,
812
- isSelected: ee,
813
- onChange: T,
814
- disabled: v
875
+ children: /* @__PURE__ */ P(s, {
876
+ labelProps: { label: _e },
877
+ caption: ve,
878
+ isSelected: y,
879
+ onChange: b,
880
+ disabled: h
815
881
  })
816
882
  }),
817
- /* @__PURE__ */ k("div", {
883
+ /* @__PURE__ */ P("div", {
818
884
  className: "mt-4",
819
- children: /* @__PURE__ */ k(he, {
820
- rules: O,
821
- onRulesChange: j,
822
- sourceOptions: te,
823
- folderName: Te ? De : void 0,
824
- disabled: v,
825
- isLoading: ne,
826
- hasLoadError: re,
827
- labels: ue,
828
- styles: z
885
+ children: /* @__PURE__ */ P(Ce, {
886
+ rules: C,
887
+ onRulesChange: ne,
888
+ sourceOptions: re,
889
+ folderName: Q ? xe : void 0,
890
+ disabled: h,
891
+ isLoading: T,
892
+ hasLoadError: E,
893
+ labels: J,
894
+ styles: L
829
895
  })
830
896
  })
831
897
  ] })]
832
898
  });
833
- }, Se = (e) => e === N.ReplaceWarning ? v.Warning : v.Error, Ce = (e, t) => {
834
- let [n, r, ...i] = e.split("{folder}");
835
- return r === void 0 || i.length > 0 ? e : /* @__PURE__ */ A(O, { children: [
836
- n,
837
- /* @__PURE__ */ k("strong", {
838
- className: "font-semibold",
899
+ }, Ge = (e) => e === z.ReplaceWarning ? C.Warning : C.Error, Ke = (e, t, n) => {
900
+ let [r, i, ...a] = e.split("{folder}");
901
+ return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ F(N, { children: [
902
+ r,
903
+ /* @__PURE__ */ P("strong", {
904
+ className: n,
839
905
  children: t
840
906
  }),
841
- r
907
+ i
842
908
  ] });
843
- }, 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 }) => {
844
- let l = E({ "--pf-border": s?.border }), { cancelLabel: u = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: m = "Publishing…" } = o, g = r ? m : t && e != null ? p.replace("{version}", e) : f;
845
- return /* @__PURE__ */ A("div", {
846
- style: l,
847
- className: D("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5 rtl:flex-row-reverse rtl:justify-start", Te.footer),
848
- children: [/* @__PURE__ */ k(d, {
849
- label: u,
909
+ }, qe = (e, t) => e === z.ReplaceWarning ? Ke(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === z.NoAccess ? Ke(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Je = { footer: "_footer_dks1v_1" }, Ye = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, labels: s = {}, colors: l }) => {
910
+ let u = ie({ "--pf-border": l?.border }), { cancelLabel: d = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: h = "Publishing…" } = s, g = i ? h : n && t && e != null ? p.replace("{version}", e) : f;
911
+ return /* @__PURE__ */ F("div", {
912
+ style: u,
913
+ className: M("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Je.footer),
914
+ children: [/* @__PURE__ */ P(m, {
915
+ label: d,
850
916
  className: "mobile:flex-1",
851
- disabled: r,
852
- onClick: i
853
- }), /* @__PURE__ */ k(h, {
917
+ disabled: i,
918
+ onClick: a
919
+ }), /* @__PURE__ */ P(b, {
854
920
  label: g,
855
921
  className: "mobile:flex-1",
856
- disabled: n,
857
- iconBefore: r ? /* @__PURE__ */ k(S, { size: c.SM }) : void 0,
858
- onClick: a
922
+ disabled: r,
923
+ iconBefore: i ? /* @__PURE__ */ P(D, { size: c.SM }) : void 0,
924
+ onClick: o
859
925
  })]
860
926
  });
861
- }, De = {
927
+ }, Xe = {
862
928
  backdrop: "_backdrop_16jmd_6",
863
929
  panel: "_panel_16jmd_10",
864
930
  divider: "_divider_16jmd_15",
865
931
  content: "_content_16jmd_19",
866
932
  title: "_title_16jmd_24"
867
- }, Oe = ({ 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: v, onAuthorChange: y, rules: b, onRulesChange: S, ruleSourceOptions: C, isRulesLoading: ee = !1, hasRulesLoadError: w = !1, onClose: T, returnFocusRef: O, onSubmit: j, panelLabels: te, panelStyles: ne, footerLabels: re, labels: ie = {}, titleClassName: M = "dial-body-semi-text", colors: N }) => {
868
- let F = E({
869
- "--spp-backdrop-bg": N?.backdropBackground,
870
- "--spp-panel-bg": N?.panelBackground,
871
- "--spp-panel-border": N?.panelBorder,
872
- "--spp-divider-border": N?.dividerBorder,
873
- "--spp-scrollbar-thumb": N?.scrollbarThumb,
874
- "--spp-title-text": N?.titleText
875
- }), [I, L] = a(null), { title: R = "Publish", ariaLabel: z = "Publish", closeAriaLabel: ae = "Close" } = ie, B = r(() => P({
933
+ }, Ze = ({ 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: te, onRulesChange: y, ruleSourceOptions: b, isRulesLoading: x = !1, hasRulesLoadError: S = !1, onClose: C, returnFocusRef: ne, onSubmit: re, panelLabels: w, panelStyles: T, panelSummaryTitleClassName: D, panelHeadingClassName: O, panelCalloutFolderNameClassName: k, footerLabels: A, labels: j = {}, titleClassName: N = "dial-body-semi-text", colors: I }) => {
934
+ let ae = ie({
935
+ "--spp-backdrop-bg": I?.backdropBackground,
936
+ "--spp-panel-bg": I?.panelBackground,
937
+ "--spp-panel-border": I?.panelBorder,
938
+ "--spp-divider-border": I?.dividerBorder,
939
+ "--spp-scrollbar-thumb": I?.scrollbarThumb,
940
+ "--spp-title-text": I?.titleText
941
+ }), [L, oe] = a(null), { title: se = "Publish", ariaLabel: ce = "Publish", closeAriaLabel: R = "Close" } = j, z = r(() => B({
876
942
  hasSelectedFolder: s != null,
877
943
  hasExistingPublicationInFolder: p,
878
944
  hasWriteAccess: m,
@@ -888,7 +954,7 @@ var M = /* @__PURE__ */ function(e) {
888
954
  _
889
955
  ]);
890
956
  return t(() => {
891
- let t = I?.closest("[role=\"dialog\"]");
957
+ let t = L?.closest("[role=\"dialog\"]");
892
958
  if (!e || !t) return;
893
959
  let n = () => t.focus({ preventScroll: !0 });
894
960
  n();
@@ -898,36 +964,36 @@ var M = /* @__PURE__ */ function(e) {
898
964
  document.addEventListener("focusin", r);
899
965
  let i = requestAnimationFrame(() => {
900
966
  document.removeEventListener("focusin", r);
901
- }), a = O?.current;
967
+ }), a = ne?.current;
902
968
  return () => {
903
969
  cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
904
970
  };
905
971
  }, [
906
972
  e,
907
- I,
908
- O
909
- ]), /* @__PURE__ */ A(x, {
973
+ L,
974
+ ne
975
+ ]), /* @__PURE__ */ F(E, {
910
976
  open: e,
911
- onClose: T,
912
- header: /* @__PURE__ */ k("span", {
913
- className: D("block truncate text-center", M, De.title),
914
- children: R
977
+ onClose: C,
978
+ header: /* @__PURE__ */ P("span", {
979
+ className: M("block truncate text-center", N, Xe.title),
980
+ children: se
915
981
  }),
916
- ariaLabel: z,
917
- closeAriaLabel: ae,
982
+ ariaLabel: ce,
983
+ closeAriaLabel: R,
918
984
  closeDisabled: h,
919
- style: F,
920
- overlayStyle: F,
921
- className: De.panel,
922
- overlayClassName: De.backdrop,
923
- headerClassName: D("px-[22px]", De.divider),
985
+ style: ae,
986
+ overlayStyle: ae,
987
+ className: M(Xe.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
988
+ overlayClassName: Xe.backdrop,
989
+ headerClassName: M("px-[22px]", Xe.divider),
924
990
  bodyClassName: "flex flex-col overflow-hidden",
925
- children: [/* @__PURE__ */ k("div", {
926
- ref: L,
927
- className: D("min-h-0 flex-1 overflow-y-auto", De.content),
928
- children: /* @__PURE__ */ k("div", {
991
+ children: [/* @__PURE__ */ P("div", {
992
+ ref: oe,
993
+ className: M("min-h-0 flex-1 overflow-y-auto", Xe.content),
994
+ children: /* @__PURE__ */ P("div", {
929
995
  className: "p-[22px]",
930
- children: /* @__PURE__ */ k(xe, {
996
+ children: /* @__PURE__ */ P(We, {
931
997
  resource: n,
932
998
  renderSummary: i,
933
999
  folderItems: o,
@@ -942,27 +1008,293 @@ var M = /* @__PURE__ */ function(e) {
942
1008
  isSubmitting: h,
943
1009
  hasSubmitError: g,
944
1010
  allowReplace: _,
945
- author: v,
946
- onAuthorChange: y,
947
- rules: b,
948
- onRulesChange: S,
949
- ruleSourceOptions: C,
950
- isRulesLoading: ee,
951
- hasRulesLoadError: w,
952
- labels: te,
953
- styles: ne
1011
+ author: ee,
1012
+ onAuthorChange: v,
1013
+ rules: te,
1014
+ onRulesChange: y,
1015
+ ruleSourceOptions: b,
1016
+ isRulesLoading: x,
1017
+ hasRulesLoadError: S,
1018
+ labels: w,
1019
+ styles: T,
1020
+ summaryTitleClassName: D,
1021
+ headingClassName: O,
1022
+ calloutFolderNameClassName: k
954
1023
  })
955
1024
  })
956
- }), /* @__PURE__ */ k(Ee, {
1025
+ }), /* @__PURE__ */ P(Ye, {
957
1026
  version: n?.version,
958
1027
  hasExistingPublicationInFolder: p,
959
- isSubmitDisabled: B.isSubmitDisabled,
960
- isSubmitLoading: B.isSubmitLoading,
961
- onCancel: T,
962
- onSubmit: j,
963
- labels: re
1028
+ allowReplace: _,
1029
+ isSubmitDisabled: z.isSubmitDisabled,
1030
+ isSubmitLoading: z.isSubmitLoading,
1031
+ onCancel: C,
1032
+ onSubmit: re,
1033
+ labels: A
1034
+ })]
1035
+ });
1036
+ }, Qe = /* @__PURE__ */ function(e) {
1037
+ return e.Keep = "keep", e.New = "new", e;
1038
+ }({}), $e = /* @__PURE__ */ function(e) {
1039
+ return e.Main = "main", e.ChangeFolder = "change-folder", e;
1040
+ }({}), et = {
1041
+ heading: "_heading_vk731_1",
1042
+ destination: "_destination_vk731_5"
1043
+ }, tt = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, onChangeFolderClick: u, changeFolderButtonRef: h, pendingDestination: g, onPendingDestinationChange: te, version: b, accessRules: x, isSubmitting: S = !1, submitError: C, foldersError: ne, onRetryFolders: T, panelLabels: E = {}, panelStyles: D = {}, headingClassName: O = "dial-body-semi-text", destinationClassName: k = "dial-small-semi-text" }) => {
1044
+ let { saveToFolderHeading: j = "Save to folder", changeFolderLabel: N = "Change", destinationAriaLabel: ae = "Destination folder", versionHeading: L = "Version", keepVersionLabel: oe = "Keep version {version}", saveAsNewVersionLabel: se = "Save as new version", newVersionLabel: ce = "Version", newVersionPlaceholder: R = "Enter new version", searchPlaceholder: z = "Search folders", clearSearchAriaLabel: B = "Clear search", folderEmptyStateLabel: V, createFolderLabel: H, cancelCreatingFolderLabel: le, addSiblingFolderLabel: U, addChildFolderLabel: ue, createFolderEmptyNameError: W, createFolderInvalidNameError: de, createFolderDuplicateNameError: fe, retryLabel: G = "Retry", summaryVersionLabel: K } = E, { colors: q, folderTree: J } = D, pe = {
1045
+ ...ie({
1046
+ "--stf-heading-text": q?.headingText,
1047
+ "--stf-destination-text": q?.destinationText
1048
+ }),
1049
+ ...D.cssVars
1050
+ }, Y = {
1051
+ border: q?.summaryBorder,
1052
+ background: q?.summaryBackground,
1053
+ versionTagBorder: q?.summaryVersionTagBorder,
1054
+ versionTagBackground: q?.summaryVersionTagBackground,
1055
+ versionTagText: q?.summaryVersionTagText
1056
+ }, [me, he] = a(""), ge = n(), _e = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), ve = i.find((e) => e.key === g?.rootKey), X = g ? g.path[g.path.length - 1] ?? ve?.label : void 0, Z = M(O, et.heading);
1057
+ if (e === $e.ChangeFolder) return /* @__PURE__ */ F("div", {
1058
+ className: "flex flex-col gap-3",
1059
+ style: pe,
1060
+ children: [
1061
+ /* @__PURE__ */ P("div", {
1062
+ role: "search",
1063
+ children: /* @__PURE__ */ P(w, {
1064
+ value: me,
1065
+ onChange: (e) => he(e ?? ""),
1066
+ placeholder: z,
1067
+ clearLabel: B,
1068
+ "aria-label": z
1069
+ })
1070
+ }),
1071
+ /* @__PURE__ */ P(v, {
1072
+ politeness: y.Assertive,
1073
+ children: ne && /* @__PURE__ */ F("div", {
1074
+ className: "flex flex-wrap items-center gap-2",
1075
+ children: [/* @__PURE__ */ P(f, { text: ne }), T && /* @__PURE__ */ P(ee, {
1076
+ label: G,
1077
+ onClick: T
1078
+ })]
1079
+ })
1080
+ }),
1081
+ /* @__PURE__ */ P(Be, {
1082
+ roots: i,
1083
+ destination: g,
1084
+ onDestinationChange: te,
1085
+ onCreateDestinationFolder: s,
1086
+ searchQuery: me,
1087
+ disabled: S,
1088
+ noResultsLabel: V,
1089
+ createFolderLabel: H,
1090
+ cancelCreatingFolderLabel: le,
1091
+ addSiblingFolderLabel: U,
1092
+ addChildFolderLabel: ue,
1093
+ emptyFolderNameError: W,
1094
+ invalidFolderNameError: de,
1095
+ duplicateFolderNameError: fe,
1096
+ styles: J
1097
+ }),
1098
+ x && ve?.hasAccessRules && /* @__PURE__ */ P("div", {
1099
+ className: "mt-1",
1100
+ children: /* @__PURE__ */ P(Ce, {
1101
+ rules: x.rules,
1102
+ onRulesChange: x.onRulesChange,
1103
+ sourceOptions: x.sourceOptions,
1104
+ folderName: X,
1105
+ disabled: S,
1106
+ isLoading: x.isLoading,
1107
+ hasLoadError: x.hasLoadError,
1108
+ labels: x.labels,
1109
+ styles: x.styles
1110
+ })
1111
+ })
1112
+ ]
1113
+ });
1114
+ let ye = b ? [{
1115
+ value: Qe.Keep,
1116
+ label: oe.replace("{version}", b.currentVersion)
1117
+ }, {
1118
+ value: Qe.New,
1119
+ label: se,
1120
+ content: /* @__PURE__ */ P(_, {
1121
+ id: ge,
1122
+ value: b.newVersion,
1123
+ onChange: (e) => b.onNewVersionChange(e ?? ""),
1124
+ onBlur: b.onNewVersionBlur,
1125
+ labelProps: {
1126
+ label: ce,
1127
+ required: !0
1128
+ },
1129
+ placeholder: R,
1130
+ error: b.newVersionError,
1131
+ invalid: !!b.newVersionError,
1132
+ disabled: S
1133
+ })
1134
+ }] : [];
1135
+ return /* @__PURE__ */ F("div", {
1136
+ className: "flex flex-col gap-5",
1137
+ style: pe,
1138
+ children: [
1139
+ t.type == null ? /* @__PURE__ */ P(A, {
1140
+ colors: Y,
1141
+ children: /* @__PURE__ */ P("span", {
1142
+ className: M("truncate", Z),
1143
+ children: t.title
1144
+ })
1145
+ }) : /* @__PURE__ */ P(A, {
1146
+ item: {
1147
+ type: t.type,
1148
+ name: t.title,
1149
+ version: t.version ?? "",
1150
+ iconUrl: t.iconUrl
1151
+ },
1152
+ versionLabel: K,
1153
+ colors: Y
1154
+ }),
1155
+ /* @__PURE__ */ F("section", {
1156
+ className: "flex flex-col gap-2",
1157
+ children: [/* @__PURE__ */ P("h2", {
1158
+ className: Z,
1159
+ children: j
1160
+ }), /* @__PURE__ */ F("div", {
1161
+ className: "flex min-w-0 items-center gap-2",
1162
+ children: [/* @__PURE__ */ P("div", {
1163
+ role: "group",
1164
+ "aria-label": ae,
1165
+ className: "min-w-0 flex-1",
1166
+ children: /* @__PURE__ */ P(p, {
1167
+ name: _e.join(" / "),
1168
+ nameClassName: M(k, et.destination)
1169
+ })
1170
+ }), /* @__PURE__ */ P(m, {
1171
+ ref: h,
1172
+ size: d.Small,
1173
+ label: N,
1174
+ iconBefore: /* @__PURE__ */ P(I, {
1175
+ size: c.SM,
1176
+ stroke: l,
1177
+ "aria-hidden": !0
1178
+ }),
1179
+ disabled: S,
1180
+ onClick: u
1181
+ })]
1182
+ })]
1183
+ }),
1184
+ b && /* @__PURE__ */ F("section", {
1185
+ className: "flex flex-col gap-2",
1186
+ children: [/* @__PURE__ */ P("h2", {
1187
+ className: Z,
1188
+ children: L
1189
+ }), /* @__PURE__ */ P(re, {
1190
+ ariaLabel: L,
1191
+ value: b.versionMode,
1192
+ onChange: (e) => b.onVersionModeChange(e),
1193
+ items: ye,
1194
+ disabled: S
1195
+ })]
1196
+ }),
1197
+ /* @__PURE__ */ P(v, {
1198
+ politeness: y.Assertive,
1199
+ children: C && /* @__PURE__ */ P(f, { text: C })
1200
+ })
1201
+ ]
1202
+ });
1203
+ }, nt = {
1204
+ backdrop: "_backdrop_1ie8s_6",
1205
+ panel: "_panel_1ie8s_10",
1206
+ divider: "_divider_1ie8s_15",
1207
+ footer: "_footer_1ie8s_19",
1208
+ content: "_content_1ie8s_23",
1209
+ title: "_title_1ie8s_28"
1210
+ }, rt = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: l = {}, colors: u, titleClassName: d = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: h = !1, onPendingDestinationChange: g, ..._ }) => {
1211
+ let { title: ee = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: te = "Close", backAriaLabel: y = "Back", cancelLabel: x = "Cancel", saveLabel: S = "Save", savingLabel: C = "Saving…", selectLabel: re = "Select" } = l, w = ie({
1212
+ "--sstf-backdrop-bg": u?.backdropBackground,
1213
+ "--sstf-panel-bg": u?.panelBackground,
1214
+ "--sstf-panel-border": u?.panelBorder,
1215
+ "--sstf-divider-border": u?.dividerBorder,
1216
+ "--sstf-scrollbar-thumb": u?.scrollbarThumb,
1217
+ "--sstf-title-text": u?.titleText
1218
+ }), [T, O] = a($e.Main), [k, A] = a(f), j = i(null), N = i(null);
1219
+ t(() => {
1220
+ e && O($e.Main);
1221
+ }, [e]);
1222
+ let I = i(T);
1223
+ t(() => {
1224
+ I.current !== T && (I.current = T, T === $e.ChangeFolder ? j.current?.focus({ preventScroll: !0 }) : N.current?.focus({ preventScroll: !0 }));
1225
+ }, [T]);
1226
+ let ae = i(e);
1227
+ t(() => {
1228
+ let t = ae.current;
1229
+ ae.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1230
+ }, [e, s]);
1231
+ let L = T === $e.ChangeFolder, oe = (e) => {
1232
+ A(e), g?.(e);
1233
+ }, se = () => {
1234
+ oe(f), O($e.ChangeFolder);
1235
+ }, ce = () => {
1236
+ g?.(f), O($e.Main);
1237
+ }, R = () => {
1238
+ k && p(k), O($e.Main);
1239
+ };
1240
+ return /* @__PURE__ */ F(E, {
1241
+ open: e,
1242
+ onClose: n,
1243
+ header: /* @__PURE__ */ P("span", {
1244
+ ref: j,
1245
+ tabIndex: -1,
1246
+ className: M("block truncate outline-none", d, nt.title),
1247
+ children: L ? v : ee
1248
+ }),
1249
+ ariaLabel: ee,
1250
+ onBack: L ? ce : void 0,
1251
+ backAriaLabel: y,
1252
+ backDisabled: h,
1253
+ closeAriaLabel: te,
1254
+ closeDisabled: h,
1255
+ style: w,
1256
+ overlayStyle: w,
1257
+ className: M(nt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1258
+ overlayClassName: nt.backdrop,
1259
+ headerClassName: M("px-[22px]", nt.divider),
1260
+ bodyClassName: "flex flex-col overflow-hidden",
1261
+ children: [/* @__PURE__ */ P("div", {
1262
+ className: M("min-h-0 flex-1 overflow-y-auto p-[22px]", nt.content),
1263
+ children: /* @__PURE__ */ P(tt, {
1264
+ ..._,
1265
+ view: T,
1266
+ destination: f,
1267
+ onDestinationChange: p,
1268
+ isSubmitting: h,
1269
+ onChangeFolderClick: se,
1270
+ changeFolderButtonRef: N,
1271
+ pendingDestination: k,
1272
+ onPendingDestinationChange: oe
1273
+ })
1274
+ }), /* @__PURE__ */ F("div", {
1275
+ className: M("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", nt.footer),
1276
+ children: [/* @__PURE__ */ P(m, {
1277
+ label: x,
1278
+ className: "mobile:flex-1",
1279
+ disabled: h,
1280
+ onClick: L ? ce : n
1281
+ }), L ? /* @__PURE__ */ P(b, {
1282
+ label: re,
1283
+ className: "mobile:flex-1",
1284
+ disabled: k == null,
1285
+ onClick: R
1286
+ }) : /* @__PURE__ */ P(ne, {
1287
+ label: h ? C : S,
1288
+ className: "mobile:flex-1",
1289
+ disabled: o || h,
1290
+ iconBefore: h ? /* @__PURE__ */ P("span", {
1291
+ "aria-hidden": !0,
1292
+ children: /* @__PURE__ */ P(D, { size: c.SM })
1293
+ }) : void 0,
1294
+ onClick: r
1295
+ })]
964
1296
  })]
965
1297
  });
966
1298
  };
967
1299
  //#endregion
968
- export { $ as PUBLISH_PANEL_CLASS, M as PublicationRuleFunction, pe as PublishAccessRuleEditor, he as PublishAccessRules, N as PublishCalloutKind, ve as PublishFoldersTree, Ee as PublishFooter, ge as PublishHistoryList, xe as PublishPanel, Oe as StandalonePublishPanel, H as collectFolderKeys, P as derivePublishState, ae as filterFolderTree, I as formatPublishedDate, W as fromFolderPathKey, J as getSiblingFolderNames, ce as getUniqueFolderName, se as mergeFolderPaths, oe as sortFolderTree, G as toDialFileTree, U as toFolderPathKey, z as usePublishFlow, q as validateFolderName };
1300
+ export { Ve as PUBLISH_PANEL_CLASS, R as PublicationRuleFunction, Q as PublishAccessRuleEditor, Ce as PublishAccessRules, z as PublishCalloutKind, Be as PublishFoldersTree, Ye as PublishFooter, Te as PublishHistoryList, We as PublishPanel, tt as SaveToFolderPanel, $e as SaveToFolderView, Qe as SaveVersionMode, Ze as StandalonePublishPanel, rt as StandaloneSaveToFolderPanel, q as collectFolderKeys, B as derivePublishState, W as filterFolderTree, H as formatPublishedDate, pe as fromFolderPathKey, _e as getSiblingFolderNames, ge as getUniqueFolderName, K as mergeFolderPaths, fe as sortFolderTree, Y as toDialFileTree, J as toFolderPathKey, ue as usePublishFlow, he as validateFolderName };