@epam/ai-dial-publish-panel 1.4.0-dev.151 → 1.4.0-dev.154

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,56 +1,56 @@
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 { Badge as o, Checkbox as s, ConfirmationPopupVariant as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, DialItemType as f, ElementSize as p, EllipsisTooltip as m, ErrorText as h, FileIcon as g, FolderName as _, GhostButton as v, Input as y, LinkButton as b, LiveRegion as x, LiveRegionElement as S, LiveRegionPoliteness as C, NeutralButton as w, Notification as T, NotificationType as E, NotificationVariant as D, PrimaryButton as ee, RadioGroup as O, Search as k, SideDrawer as te, Skeleton as A, SkeletonVariant as j, Spinner as M, Tag as N } from "@epam/ai-dial-ui-kit";
3
- import { ConfirmationDialog as P, DeploymentIcon as F, ResourceSummary as I, buildCssVars as L, mergeClasses as R } from "@epam/ai-dial-chat-shared";
4
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
5
- import { DialFileNodeType as ne, DialFoldersTree as re } from "@epam/ai-dial-react-file-manager";
6
- import { IconFolder as ie, IconFolderPlus as ae, IconPlus as H } from "@tabler/icons-react";
2
+ import { Badge as o, Checkbox as s, ConfirmationPopupVariant as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, DialItemType as f, ElementSize as p, EllipsisTooltip as m, ErrorText as h, FileIcon as g, FolderName as _, GhostButton as v, Input as y, LinkButton as b, LiveRegion as x, LiveRegionElement as S, LiveRegionPoliteness as C, NeutralButton as w, Notification as T, NotificationType as E, NotificationVariant as D, PrimaryButton as O, RadioGroup as k, SideDrawer as ee, Skeleton as A, SkeletonVariant as te, Spinner as j, Tag as M } from "@epam/ai-dial-ui-kit";
3
+ import { ConfirmationDialog as N, DeploymentIcon as ne, EntityHeader as P, ResourceSummary as re, buildCssVars as F, mergeClasses as I } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
5
+ import { FolderDestinationPanel as ie, FolderDestinationPanelBody as ae, FolderDestinationView as oe } from "@epam/ai-dial-react-file-manager";
6
+ import { IconFolder as se } from "@tabler/icons-react";
7
7
  //#region src/models/publish.ts
8
- var U = /* @__PURE__ */ function(e) {
8
+ var B = /* @__PURE__ */ function(e) {
9
9
  return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.TargetTaken = "targetTaken", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
10
- }({}), W = /* @__PURE__ */ function(e) {
10
+ }({}), V = /* @__PURE__ */ function(e) {
11
11
  return e.Application = "application", e.Toolset = "toolset", e.Prompt = "prompt", e.Skill = "skill", e.File = "file", e;
12
- }({}), oe = /* @__PURE__ */ function(e) {
12
+ }({}), H = /* @__PURE__ */ function(e) {
13
13
  return e.Warning = "warning", e.Published = "published", e;
14
- }({}), se = (e) => e.isSubmitting ? {
15
- calloutKind: U.None,
14
+ }({}), ce = (e) => e.isSubmitting ? {
15
+ calloutKind: B.None,
16
16
  isSubmitDisabled: !0,
17
17
  isSubmitLoading: !0
18
18
  } : e.hasSelectedFolder ? e.hasWriteAccess ? e.isTargetChecking ? {
19
- calloutKind: U.None,
19
+ calloutKind: B.None,
20
20
  isSubmitDisabled: !0,
21
21
  isSubmitLoading: !1
22
22
  } : e.hasSubmitError ? {
23
- calloutKind: U.SubmitError,
23
+ calloutKind: B.SubmitError,
24
24
  isSubmitDisabled: !1,
25
25
  isSubmitLoading: !1
26
26
  } : e.hasExistingPublicationInFolder ? {
27
- calloutKind: U.ReplaceWarning,
27
+ calloutKind: B.ReplaceWarning,
28
28
  isSubmitDisabled: e.allowReplace === !1,
29
29
  isSubmitLoading: !1
30
30
  } : e.isTargetTaken ? {
31
- calloutKind: U.TargetTaken,
31
+ calloutKind: B.TargetTaken,
32
32
  isSubmitDisabled: !0,
33
33
  isSubmitLoading: !1
34
34
  } : {
35
- calloutKind: U.Info,
35
+ calloutKind: B.Info,
36
36
  isSubmitDisabled: !1,
37
37
  isSubmitLoading: !1
38
38
  } : {
39
- calloutKind: U.NoAccess,
39
+ calloutKind: B.NoAccess,
40
40
  isSubmitDisabled: !0,
41
41
  isSubmitLoading: !1
42
42
  } : {
43
- calloutKind: U.None,
43
+ calloutKind: B.None,
44
44
  isSubmitDisabled: !0,
45
45
  isSubmitLoading: !1
46
- }, G = 864e5, ce = (e, t = Date.now(), n) => {
47
- let r = Math.floor((t - e) / G);
46
+ }, le = 864e5, ue = (e, t = Date.now(), n) => {
47
+ let r = Math.floor((t - e) / le);
48
48
  return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
49
49
  month: "short",
50
50
  day: "numeric",
51
51
  year: "numeric"
52
52
  });
53
- }, le = (e, t, n) => t.length === 0 ? [...e, {
53
+ }, de = (e, t, n) => t.length === 0 ? [...e, {
54
54
  path: [n],
55
55
  name: n
56
56
  }] : e.map((e) => e.path.join("/") === t.join("/") ? {
@@ -61,30 +61,30 @@ var U = /* @__PURE__ */ function(e) {
61
61
  }]
62
62
  } : {
63
63
  ...e,
64
- children: e.children ? le(e.children, t, n) : e.children
65
- }), ue = (e, t, n) => {
64
+ children: e.children ? de(e.children, t, n) : e.children
65
+ }), fe = (e, t, n) => {
66
66
  let r = [...t, n].join("/");
67
67
  return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
68
68
  ...e,
69
69
  children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
70
70
  } : {
71
71
  ...e,
72
- children: e.children ? ue(e.children, t, n) : e.children
72
+ children: e.children ? fe(e.children, t, n) : e.children
73
73
  });
74
- }, de = ({ item: n, history: o, folderItems: s, hasWriteAccess: c = () => !0, defaultAuthor: l = "", onCreateFolder: u, onPublish: d, onPublishSuccess: f, onPublishError: p, onCheckTargetExists: m, isTargetTakenError: h, canPublishDirectlyTo: g, onPublishDirectly: _ }) => {
74
+ }, pe = ({ item: n, history: o, folderItems: s, hasWriteAccess: c = () => !0, defaultAuthor: l = "", onCreateFolder: u, onPublish: d, onPublishSuccess: f, onPublishError: p, onCheckTargetExists: m, isTargetTakenError: h, canPublishDirectlyTo: g, onPublishDirectly: _ }) => {
75
75
  let [v, y] = a(s);
76
76
  t(() => {
77
77
  y(s);
78
78
  }, [s]);
79
- let [b, x] = a(), [S, C] = a(!1), [w, T] = a(!1), [E, D] = a(l), [ee, O] = a(!1), [k, te] = a(!1);
79
+ let [b, x] = a(), [S, C] = a(!1), [w, T] = a(!1), [E, D] = a(l), [O, k] = a(!1), [ee, A] = a(!1);
80
80
  t(() => {
81
- k || D(l);
82
- }, [l, k]);
83
- let A = e((e) => {
84
- te(!0), D(e);
81
+ ee || D(l);
82
+ }, [l, ee]);
83
+ let te = e((e) => {
84
+ A(!0), D(e);
85
85
  }, []), j = b != null && g != null && _ != null && g(b);
86
86
  t(() => {
87
- j && O(!1);
87
+ j && k(!1);
88
88
  }, [j]);
89
89
  let M = r(() => {
90
90
  if (!b || j) return !1;
@@ -95,45 +95,45 @@ var U = /* @__PURE__ */ function(e) {
95
95
  j,
96
96
  n.version,
97
97
  b
98
- ]), N = i(/* @__PURE__ */ new Set()), [P, F] = a(), [I, L] = a(), [R, z] = a(!1), B = b == null ? void 0 : `${n.id ?? ""}\u0000${b.join("/")}\u0000${n.version ?? ""}`, V = B != null && (P === B || I === B);
98
+ ]), N = i(/* @__PURE__ */ new Set()), [ne, P] = a(), [re, F] = a(), [I, L] = a(!1), R = b == null ? void 0 : `${n.id ?? ""}\u0000${b.join("/")}\u0000${n.version ?? ""}`, z = R != null && (ne === R || re === R);
99
99
  t(() => {
100
- if (b == null || B == null || !m || M) {
101
- z(!1);
100
+ if (b == null || R == null || !m || M) {
101
+ L(!1);
102
102
  return;
103
103
  }
104
104
  let e = b.join("/");
105
105
  if ([...N.current].some((t) => e === t || e.startsWith(`${t}/`))) {
106
- z(!1);
106
+ L(!1);
107
107
  return;
108
108
  }
109
109
  let t = !1;
110
- return z(!0), m(n, b).then((e) => {
111
- t || F((t) => e ? B : t === B ? void 0 : t);
110
+ return L(!0), m(n, b).then((e) => {
111
+ t || P((t) => e ? R : t === R ? void 0 : t);
112
112
  }).catch(() => void 0).finally(() => {
113
- t || z(!1);
113
+ t || L(!1);
114
114
  }), () => {
115
115
  t = !0;
116
116
  };
117
117
  }, [
118
- B,
118
+ R,
119
119
  M,
120
120
  m == null
121
121
  ]);
122
- let ne = e(async (e, t) => {
122
+ let ie = e(async (e, t) => {
123
123
  let n = [...e, t].join("/");
124
- N.current.add(n), y((n) => le(n, e, t));
124
+ N.current.add(n), y((n) => de(n, e, t));
125
125
  try {
126
126
  await u?.(e, t);
127
127
  } catch {
128
- N.current.delete(n), y((n) => ue(n, e, t)), T(!0);
128
+ N.current.delete(n), y((n) => fe(n, e, t)), T(!0);
129
129
  }
130
- }, [u]), re = e(async () => {
130
+ }, [u]), ae = e(async () => {
131
131
  if (!b) return !1;
132
132
  C(!0), T(!1);
133
133
  try {
134
- return j && _ ? await _(n, b) : await d(n, b, E.trim(), ee), f?.(n, b, j), !0;
134
+ return j && _ ? await _(n, b) : await d(n, b, E.trim(), O), f?.(n, b, j), !0;
135
135
  } catch (e) {
136
- return h?.(e) && B != null ? L(B) : T(!0), p?.(n, b, e), !1;
136
+ return h?.(e) && R != null ? F(R) : T(!0), p?.(n, b, e), !1;
137
137
  } finally {
138
138
  C(!1);
139
139
  }
@@ -146,114 +146,114 @@ var U = /* @__PURE__ */ function(e) {
146
146
  _,
147
147
  p,
148
148
  f,
149
- ee,
149
+ O,
150
150
  b,
151
- B
152
- ]), ie = e(() => {
153
- y(s), x(void 0), T(!1), D(l), te(!1), O(!1), N.current.clear(), F(void 0), L(void 0), z(!1);
151
+ R
152
+ ]), oe = e(() => {
153
+ y(s), x(void 0), T(!1), D(l), A(!1), k(!1), N.current.clear(), P(void 0), F(void 0), L(!1);
154
154
  }, [l, s]);
155
155
  return {
156
156
  folderItems: v,
157
157
  selectedFolderPath: b,
158
158
  setSelectedFolderPath: x,
159
- handleCreateFolder: ne,
159
+ handleCreateFolder: ie,
160
160
  hasExistingPublicationInFolder: M,
161
161
  hasWriteAccess: !b || c(b),
162
162
  isSubmitting: S,
163
163
  hasSubmitError: w,
164
- handleSubmit: re,
165
- reset: ie,
164
+ handleSubmit: ae,
165
+ reset: oe,
166
166
  author: E,
167
- setAuthor: A,
168
- publishCredentials: ee,
169
- setPublishCredentials: O,
170
- isTargetTaken: V,
171
- isTargetChecking: R,
167
+ setAuthor: te,
168
+ publishCredentials: O,
169
+ setPublishCredentials: k,
170
+ isTargetTaken: z,
171
+ isTargetChecking: I,
172
172
  isDirectWrite: j
173
173
  };
174
- }, K = /* @__PURE__ */ function(e) {
174
+ }, U = /* @__PURE__ */ function(e) {
175
175
  return e.Main = "main", e.ChangeFolder = "change-folder", e;
176
- }({}), q = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
177
- let [i, o] = a(K.Main), [s, c] = a();
176
+ }({}), me = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
177
+ let [i, o] = a(U.Main), [s, c] = a();
178
178
  return t(() => {
179
- e && o(K.Main);
179
+ e && o(U.Main);
180
180
  }, [e]), {
181
181
  view: i,
182
182
  pendingFolderPath: s,
183
183
  setPendingFolderPath: c,
184
184
  openFolderView: () => {
185
- c(n), o(K.ChangeFolder);
185
+ c(n), o(U.ChangeFolder);
186
186
  },
187
- backToMain: () => o(K.Main),
187
+ backToMain: () => o(U.Main),
188
188
  selectFolder: () => {
189
- s != null && r(s), o(K.Main);
189
+ s != null && r(s), o(U.Main);
190
190
  }
191
191
  };
192
- }, fe = (e, t) => {
192
+ }, he = (e, t) => {
193
193
  let n = t.trim().toLowerCase();
194
194
  return n ? e.reduce((e, r) => {
195
- let i = r.children ? fe(r.children, t) : void 0;
195
+ let i = r.children ? he(r.children, t) : void 0;
196
196
  return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
197
197
  ...r,
198
198
  children: i
199
199
  }), e;
200
200
  }, []) : e;
201
- }, pe = (e, t) => e.localeCompare(t, void 0, {
201
+ }, W = (e, t) => e.localeCompare(t, void 0, {
202
202
  sensitivity: "base",
203
203
  numeric: !0
204
- }), me = (e) => [...e].sort((e, t) => pe(e.name, t.name)).map((e) => e.children ? {
204
+ }), ge = (e) => [...e].sort((e, t) => W(e.name, t.name)).map((e) => e.children ? {
205
205
  ...e,
206
- children: me(e.children)
207
- } : e), he = (e, t, n) => {
206
+ children: ge(e.children)
207
+ } : e), _e = (e, t, n) => {
208
208
  let [r, ...i] = t;
209
209
  if (r == null) return e;
210
210
  let a = [...n, r], o = e.find((e) => e.name === r);
211
211
  return o ? i.length ? e.map((e) => e === o ? {
212
212
  ...e,
213
- children: he(e.children ?? [], i, a)
213
+ children: _e(e.children ?? [], i, a)
214
214
  } : e) : e : [...e, {
215
215
  path: a,
216
216
  name: r,
217
- children: i.length ? he([], i, a) : void 0
217
+ children: i.length ? _e([], i, a) : void 0
218
218
  }];
219
- }, ge = (e, t) => t.reduce((e, t) => t.length ? he(e, t, []) : e, e), _e = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? _e(e.children) : []]), J = (e) => e.join("/"), ve = (e) => e.split("/").filter(Boolean), Y = (e, t) => ve(e).at(-1) ?? t, ye = (e) => e.map((e) => {
220
- let t = J(e.path);
219
+ }, G = (e, t) => t.reduce((e, t) => t.length ? _e(e, t, []) : e, e), ve = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? ve(e.children) : []]), K = (e) => e.join("/"), ye = (e) => e.split("/").filter(Boolean), be = (e, t) => ye(e).at(-1) ?? t, xe = (e) => e.map((e) => {
220
+ let t = K(e.path);
221
221
  return {
222
222
  path: t,
223
223
  name: e.name,
224
224
  folderId: t,
225
225
  nodeType: d.FOLDER,
226
- items: e.children ? ye(e.children) : void 0
226
+ items: e.children ? xe(e.children) : void 0
227
227
  };
228
- }), X = /[/\\:;,={}&"]/, be = (e, t, n, r) => {
228
+ }), Se = /[/\\:;,={}&"]/, Ce = (e, t, n, r) => {
229
229
  let i = e.trim();
230
- return i ? i.includes("..") || X.test(i) ? n.invalid : t.some((e) => e.toLowerCase() === i.toLowerCase()) ? n.duplicate : r?.toLowerCase() === i.toLowerCase() ? n.sameAsParent ?? n.duplicate : null : n.empty;
231
- }, xe = (e, t) => {
230
+ return i ? i.includes("..") || Se.test(i) ? n.invalid : t.some((e) => e.toLowerCase() === i.toLowerCase()) ? n.duplicate : r?.toLowerCase() === i.toLowerCase() ? n.sameAsParent ?? n.duplicate : null : n.empty;
231
+ }, we = (e, t) => {
232
232
  let n = new Set(t.map((e) => e.toLowerCase()));
233
233
  if (!n.has(e.toLowerCase())) return e;
234
234
  let r = 2;
235
235
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
236
236
  return `${e} ${r}`;
237
- }, Se = (e, t) => {
237
+ }, Te = (e, t) => {
238
238
  if (t.length === 0) return e.map((e) => e.name);
239
- let n = J(t), r = (e) => {
239
+ let n = K(t), r = (e) => {
240
240
  for (let t of e) {
241
- if (J(t.path) === n) return t;
241
+ if (K(t.path) === n) return t;
242
242
  let e = t.children ? r(t.children) : void 0;
243
243
  if (e) return e;
244
244
  }
245
245
  };
246
246
  return (r(e)?.children ?? []).map((e) => e.name);
247
- }, Ce = /* @__PURE__ */ function(e) {
247
+ }, Ee = /* @__PURE__ */ function(e) {
248
248
  return e.NotPublished = "not-published", e.InReview = "in-review", e.Published = "published", e.Unknown = "unknown", e;
249
- }({}), Z = {
249
+ }({}), q = {
250
250
  skeletonColor: "var(--pp-vh-skeleton, var(--bg-control-disable-primary, #dce0e8))",
251
251
  heading: "_heading_s0cgn_2",
252
252
  version: "_version_s0cgn_6",
253
253
  date: "_date_s0cgn_10",
254
254
  meta: "_meta_s0cgn_15",
255
255
  row: "_row_s0cgn_19"
256
- }, we = {
256
+ }, De = {
257
257
  heading: "Versions history",
258
258
  inReviewLabel: "In review",
259
259
  publishedLabel: "Published",
@@ -262,21 +262,21 @@ var U = /* @__PURE__ */ function(e) {
262
262
  emptyLabel: "No saved versions yet.",
263
263
  errorLabel: "Could not load publication statuses.",
264
264
  retryLabel: "Retry"
265
- }, Te = (e, t) => {
265
+ }, Oe = (e, t) => {
266
266
  switch (e.status) {
267
- case Ce.InReview: return t.inReviewLabel;
268
- case Ce.Unknown: return t.unknownLabel;
269
- case Ce.Published: return t.publishedLabel;
267
+ case Ee.InReview: return t.inReviewLabel;
268
+ case Ee.Unknown: return t.unknownLabel;
269
+ case Ee.Published: return t.publishedLabel;
270
270
  default: return;
271
271
  }
272
- }, Ee = ({ rows: e, isLoading: r = !1, hasError: i = !1, onRetry: s, labels: c = {}, headingClassName: l = "dial-body-semi-text", versionClassName: u = "dial-small-semi-text", dateClassName: d = "dial-small-text", metaClassName: f = "dial-tiny-text", styles: g = {} }) => {
272
+ }, ke = ({ rows: e, isLoading: r = !1, hasError: i = !1, onRetry: s, labels: c = {}, headingClassName: l = "dial-body-semi-text", versionClassName: u = "dial-small-semi-text", dateClassName: d = "dial-small-text", metaClassName: f = "dial-tiny-text", styles: g = {} }) => {
273
273
  let v = n(), [y, S] = a(!1);
274
274
  t(() => S(!0), []);
275
275
  let w = {
276
- ...we,
276
+ ...De,
277
277
  ...c
278
278
  }, { colors: T } = g, E = {
279
- ...L({
279
+ ...F({
280
280
  "--pp-vh-heading-text": T?.headingText,
281
281
  "--pp-vh-version-text": T?.versionText,
282
282
  "--pp-vh-date-text": T?.dateText,
@@ -286,69 +286,69 @@ var U = /* @__PURE__ */ function(e) {
286
286
  }),
287
287
  ...g.cssVars
288
288
  };
289
- return /* @__PURE__ */ V("section", {
289
+ return /* @__PURE__ */ z("section", {
290
290
  "aria-labelledby": v,
291
291
  className: "flex flex-col gap-2",
292
292
  style: E,
293
293
  children: [
294
- /* @__PURE__ */ B("h2", {
294
+ /* @__PURE__ */ R("h2", {
295
295
  id: v,
296
- className: R(l, Z.heading),
296
+ className: I(l, q.heading),
297
297
  children: w.heading
298
298
  }),
299
- /* @__PURE__ */ B(x, {
299
+ /* @__PURE__ */ R(x, {
300
300
  visuallyHidden: !0,
301
301
  politeness: C.Polite,
302
302
  children: y && r && !i ? w.loadingLabel : ""
303
303
  }),
304
- /* @__PURE__ */ B(x, {
304
+ /* @__PURE__ */ R(x, {
305
305
  politeness: C.Assertive,
306
- children: i && /* @__PURE__ */ V("div", {
306
+ children: i && /* @__PURE__ */ z("div", {
307
307
  className: "flex flex-wrap items-center gap-2",
308
- children: [/* @__PURE__ */ B(h, { text: w.errorLabel }), s && /* @__PURE__ */ B(b, {
308
+ children: [/* @__PURE__ */ R(h, { text: w.errorLabel }), s && /* @__PURE__ */ R(b, {
309
309
  label: w.retryLabel,
310
310
  size: p.Small,
311
311
  onClick: s
312
312
  })]
313
313
  })
314
314
  }),
315
- e.length === 0 ? /* @__PURE__ */ B("p", {
316
- className: R(f, Z.meta),
315
+ e.length === 0 ? /* @__PURE__ */ R("p", {
316
+ className: I(f, q.meta),
317
317
  children: w.emptyLabel
318
- }) : /* @__PURE__ */ B("ul", { children: e.map((e) => {
319
- let t = Te(e, w), n = e.status == null && r && !i;
320
- return /* @__PURE__ */ V("li", {
321
- className: R("flex flex-col gap-1 py-2", Z.row),
322
- children: [/* @__PURE__ */ V("div", {
318
+ }) : /* @__PURE__ */ R("ul", { children: e.map((e) => {
319
+ let t = Oe(e, w), n = e.status == null && r && !i;
320
+ return /* @__PURE__ */ z("li", {
321
+ className: I("flex flex-col gap-1 py-2", q.row),
322
+ children: [/* @__PURE__ */ z("div", {
323
323
  className: "flex min-h-6 min-w-0 items-center gap-2",
324
324
  children: [
325
- /* @__PURE__ */ B(m, {
325
+ /* @__PURE__ */ R(m, {
326
326
  text: e.version,
327
- className: R("flex-initial!", u, Z.version)
327
+ className: I("flex-initial!", u, q.version)
328
328
  }),
329
- t && /* @__PURE__ */ B(o, { label: t }),
330
- n && /* @__PURE__ */ B("span", {
329
+ t && /* @__PURE__ */ R(o, { label: t }),
330
+ n && /* @__PURE__ */ R("span", {
331
331
  "aria-hidden": !0,
332
332
  className: "shrink-0",
333
- children: /* @__PURE__ */ B(A, {
334
- variant: j.Text,
333
+ children: /* @__PURE__ */ R(A, {
334
+ variant: te.Text,
335
335
  width: "84px",
336
336
  height: "24px",
337
- color: Z.skeletonColor
337
+ color: q.skeletonColor
338
338
  })
339
339
  }),
340
- e.modifiedAt && /* @__PURE__ */ B("span", {
341
- className: R("ms-auto shrink-0", d, Z.date),
340
+ e.modifiedAt && /* @__PURE__ */ R("span", {
341
+ className: I("ms-auto shrink-0", d, q.date),
342
342
  children: e.modifiedAt
343
343
  })
344
344
  ]
345
- }), (e.folder || e.author) && /* @__PURE__ */ V("div", {
345
+ }), (e.folder || e.author) && /* @__PURE__ */ z("div", {
346
346
  className: "flex min-w-0 items-center justify-between gap-2",
347
- children: [e.folder && /* @__PURE__ */ B(_, {
347
+ children: [e.folder && /* @__PURE__ */ R(_, {
348
348
  name: e.folder,
349
- nameClassName: R(f, Z.meta)
350
- }), e.author && /* @__PURE__ */ B("span", {
351
- className: R("ms-auto shrink-0", f, Z.meta),
349
+ nameClassName: I(f, q.meta)
350
+ }), e.author && /* @__PURE__ */ R("span", {
351
+ className: I("ms-auto shrink-0", f, q.meta),
352
352
  children: e.author
353
353
  })]
354
354
  })]
@@ -356,51 +356,51 @@ var U = /* @__PURE__ */ function(e) {
356
356
  }) })
357
357
  ]
358
358
  });
359
- }, Q = {
359
+ }, J = {
360
360
  panel: "dial-publish-panel-panel",
361
361
  dependencies: "dial-publish-panel-dependencies",
362
362
  dependenciesList: "dial-publish-panel-dependencies-list",
363
363
  dependenciesItem: "dial-publish-panel-dependencies-item"
364
- }, De = "Private dependencies", $ = {
364
+ }, Ae = "Private dependencies", Y = {
365
365
  heading: "_heading_18b5e_1",
366
366
  name: "_name_18b5e_5",
367
367
  meta: "_meta_18b5e_9",
368
368
  caption: "_caption_18b5e_13",
369
369
  type: "_type_18b5e_17",
370
370
  row: "_row_18b5e_21"
371
- }, Oe = {
372
- [W.Application]: "Application",
373
- [W.Toolset]: "Toolset",
374
- [W.Prompt]: "Prompt",
375
- [W.Skill]: "Skill",
376
- [W.File]: "File"
377
- }, ke = 32, Ae = 24, je = 40, Me = 32, Ne = (e, t) => {
378
- let n = t ? je : ke;
379
- return /* @__PURE__ */ B("span", {
371
+ }, je = {
372
+ [V.Application]: "Application",
373
+ [V.Toolset]: "Toolset",
374
+ [V.Prompt]: "Prompt",
375
+ [V.Skill]: "Skill",
376
+ [V.File]: "File"
377
+ }, Me = 32, Ne = 24, Pe = 40, Fe = 32, Ie = (e, t) => {
378
+ let n = t ? Pe : Me;
379
+ return /* @__PURE__ */ R("span", {
380
380
  "aria-hidden": "true",
381
381
  className: "shrink-0",
382
- children: e.type === W.File ? /* @__PURE__ */ B("span", {
382
+ children: e.type === V.File ? /* @__PURE__ */ R("span", {
383
383
  className: "flex items-center justify-center",
384
384
  style: {
385
385
  width: n,
386
386
  height: n
387
387
  },
388
- children: /* @__PURE__ */ B(g, {
388
+ children: /* @__PURE__ */ R(g, {
389
389
  decorative: !0,
390
- size: t ? Me : Ae,
390
+ size: t ? Fe : Ne,
391
391
  name: e.name,
392
392
  type: e.isFolder ? f.Folder : f.File
393
393
  })
394
- }) : /* @__PURE__ */ B(F, {
394
+ }) : /* @__PURE__ */ R(ne, {
395
395
  size: n,
396
396
  src: e.iconUrl,
397
397
  initialsName: e.name,
398
398
  styles: { badgeClassName: t ? "rounded-xl" : "rounded-lg" }
399
399
  })
400
400
  });
401
- }, Pe = "This item depends on personal private resources (listed below). After publishing, other users may not be able to use it fully, or may run into problems.", Fe = (e) => `${e} ${e === 1 ? "dependency is" : "dependencies are"} not public yet`, Ie = ({ dependencies: e, labels: t = {}, headingClassName: r = "dial-body-semi-text", nameClassName: i, metaClassName: a = "dial-small-text", captionClassName: o = "dial-tiny-text", typeClassName: s = "dial-tiny-lead-semi-text", styles: c = {} }) => {
402
- let l = n(), { title: u = De, description: d = Pe, appearance: f = oe.Warning, typeLabels: p = {}, getAnnouncement: m = Fe } = t, h = f === oe.Published, g = i ?? (h ? "dial-body-semi-text" : "dial-small-semi-text"), { colors: _ } = c, v = {
403
- ...L({
401
+ }, Le = "This item depends on personal private resources (listed below). After publishing, other users may not be able to use it fully, or may run into problems.", Re = (e) => `${e} ${e === 1 ? "dependency is" : "dependencies are"} not public yet`, ze = ({ dependencies: e, labels: t = {}, headingClassName: r = "dial-body-semi-text", nameClassName: i, metaClassName: a = "dial-small-text", captionClassName: o = "dial-tiny-text", typeClassName: s = "dial-tiny-lead-semi-text", styles: c = {} }) => {
402
+ let l = n(), { title: u = Ae, description: d = Le, appearance: f = H.Warning, typeLabels: p = {}, getAnnouncement: m = Re } = t, h = f === H.Published, g = i ?? (h ? "dial-body-semi-text" : "dial-small-semi-text"), { colors: _ } = c, v = {
403
+ ...F({
404
404
  "--pp-dependencies-heading-text": _?.headingText,
405
405
  "--pp-dependencies-name-text": _?.nameText,
406
406
  "--pp-dependencies-meta-text": _?.metaText,
@@ -410,66 +410,66 @@ var U = /* @__PURE__ */ function(e) {
410
410
  }),
411
411
  ...c.cssVars
412
412
  }, y = e.length;
413
- return /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(x, {
413
+ return /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(x, {
414
414
  visuallyHidden: !0,
415
415
  as: S.Span,
416
416
  children: y > 0 ? m(y) : ""
417
- }), y > 0 && /* @__PURE__ */ V("section", {
417
+ }), y > 0 && /* @__PURE__ */ z("section", {
418
418
  "aria-labelledby": l,
419
- className: R("flex flex-col", h ? "gap-2" : "gap-3", Q.dependencies),
419
+ className: I("flex flex-col", h ? "gap-2" : "gap-3", J.dependencies),
420
420
  style: v,
421
421
  children: [
422
- /* @__PURE__ */ B("h2", {
422
+ /* @__PURE__ */ R("h2", {
423
423
  id: l,
424
- className: R(r, $.heading),
424
+ className: I(r, Y.heading),
425
425
  children: u
426
426
  }),
427
- h ? /* @__PURE__ */ B("p", {
428
- className: R(o, $.caption),
427
+ h ? /* @__PURE__ */ R("p", {
428
+ className: I(o, Y.caption),
429
429
  children: d
430
- }) : /* @__PURE__ */ B(T, {
430
+ }) : /* @__PURE__ */ R(T, {
431
431
  type: E.SectionMessage,
432
432
  variant: D.Warning,
433
433
  message: d,
434
434
  role: "note"
435
435
  }),
436
- /* @__PURE__ */ B("ul", {
437
- className: Q.dependenciesList,
436
+ /* @__PURE__ */ R("ul", {
437
+ className: J.dependenciesList,
438
438
  children: e.map(h ? (e) => {
439
- let t = p[e.type] ?? Oe[e.type];
440
- return /* @__PURE__ */ V("li", {
441
- className: R("flex items-center gap-3 py-3", $.row, Q.dependenciesItem),
442
- children: [Ne(e, !0), /* @__PURE__ */ V("div", {
439
+ let t = p[e.type] ?? je[e.type];
440
+ return /* @__PURE__ */ z("li", {
441
+ className: I("flex items-center gap-3 py-3", Y.row, J.dependenciesItem),
442
+ children: [Ie(e, !0), /* @__PURE__ */ z("div", {
443
443
  className: "flex min-w-0 flex-col",
444
- children: [/* @__PURE__ */ V("span", {
445
- className: R("truncate", s, $.type),
446
- children: [t, e.location && /* @__PURE__ */ B("span", {
447
- className: R("ms-1 normal-case", a, $.meta),
444
+ children: [/* @__PURE__ */ z("span", {
445
+ className: I("truncate", s, Y.type),
446
+ children: [t, e.location && /* @__PURE__ */ R("span", {
447
+ className: I("ms-1 normal-case", a, Y.meta),
448
448
  children: `· ${e.location}`
449
449
  })]
450
- }), /* @__PURE__ */ V("span", {
451
- className: R("truncate", g, $.name),
452
- children: [e.name, e.version != null && /* @__PURE__ */ B("span", {
453
- className: R("ms-2", a, $.meta),
450
+ }), /* @__PURE__ */ z("span", {
451
+ className: I("truncate", g, Y.name),
452
+ children: [e.name, e.version != null && /* @__PURE__ */ R("span", {
453
+ className: I("ms-2", a, Y.meta),
454
454
  children: e.version
455
455
  })]
456
456
  })]
457
457
  })]
458
458
  }, e.id);
459
459
  } : (e) => {
460
- let t = p[e.type] ?? Oe[e.type];
461
- return /* @__PURE__ */ V("li", {
462
- className: R("flex items-center gap-3 py-2", Q.dependenciesItem),
463
- children: [Ne(e, !1), /* @__PURE__ */ V("div", {
460
+ let t = p[e.type] ?? je[e.type];
461
+ return /* @__PURE__ */ z("li", {
462
+ className: I("flex items-center gap-3 py-2", J.dependenciesItem),
463
+ children: [Ie(e, !1), /* @__PURE__ */ z("div", {
464
464
  className: "flex min-w-0 flex-col",
465
- children: [/* @__PURE__ */ V("span", {
466
- className: R("truncate", g, $.name),
467
- children: [e.name, e.version != null && /* @__PURE__ */ B("span", {
468
- className: R("ms-2", a, $.meta),
465
+ children: [/* @__PURE__ */ z("span", {
466
+ className: I("truncate", g, Y.name),
467
+ children: [e.name, e.version != null && /* @__PURE__ */ R("span", {
468
+ className: I("ms-2", a, Y.meta),
469
469
  children: e.version
470
470
  })]
471
- }), /* @__PURE__ */ B("span", {
472
- className: R("truncate", a, $.meta),
471
+ }), /* @__PURE__ */ R("span", {
472
+ className: I("truncate", a, Y.meta),
473
473
  children: e.location ? `${t} · ${e.location}` : t
474
474
  })]
475
475
  })]
@@ -478,15 +478,15 @@ var U = /* @__PURE__ */ function(e) {
478
478
  })
479
479
  ]
480
480
  })] });
481
- }, Le = {
481
+ }, X = {
482
482
  currentBadge: "_currentBadge_d0adf_1",
483
483
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
484
484
  version: "_version_d0adf_13",
485
485
  date: "_date_d0adf_17",
486
486
  emptyState: "_emptyState_d0adf_21",
487
487
  stripedRow: "_stripedRow_d0adf_25"
488
- }, Re = ({ 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 }) => {
489
- let m = L({
488
+ }, Be = ({ 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 }) => {
489
+ let m = F({
490
490
  "--phl-badge-border": p?.currentBadgeBorder,
491
491
  "--phl-badge-bg": p?.currentBadgeBackground,
492
492
  "--phl-badge-text": p?.currentBadgeText,
@@ -497,524 +497,331 @@ var U = /* @__PURE__ */ function(e) {
497
497
  "--phl-date-text": p?.dateText,
498
498
  "--phl-empty-text": p?.emptyStateText,
499
499
  "--phl-striped-bg": p?.stripedBackground
500
- }), h = R(f, Le.emptyState);
500
+ }), h = I(f, X.emptyState);
501
501
  if (n || r || e.length === 0) {
502
502
  let e = s;
503
- return n ? e = c : r && (e = l), /* @__PURE__ */ B(x, {
503
+ return n ? e = c : r && (e = l), /* @__PURE__ */ R(x, {
504
504
  as: S.P,
505
505
  style: m,
506
506
  className: h,
507
507
  children: e
508
508
  });
509
509
  }
510
- return /* @__PURE__ */ B("ul", {
510
+ return /* @__PURE__ */ R("ul", {
511
511
  style: m,
512
- children: e.map((e, n) => /* @__PURE__ */ V("li", {
513
- className: R("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Le.stripedRow),
514
- children: [/* @__PURE__ */ V("span", {
512
+ children: e.map((e, n) => /* @__PURE__ */ z("li", {
513
+ className: I("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && X.stripedRow),
514
+ children: [/* @__PURE__ */ z("span", {
515
515
  className: "flex min-w-0 items-center gap-2",
516
516
  style: m,
517
517
  children: [
518
- /* @__PURE__ */ V("span", {
519
- className: R(u, Le.version),
518
+ /* @__PURE__ */ z("span", {
519
+ className: I(u, X.version),
520
520
  children: [
521
521
  i,
522
522
  " ",
523
523
  e.version
524
524
  ]
525
525
  }),
526
- e.version === t && /* @__PURE__ */ B(N, {
526
+ e.version === t && /* @__PURE__ */ R(M, {
527
527
  label: a,
528
- className: R("shrink-0 whitespace-nowrap", Le.currentBadge)
528
+ className: I("shrink-0 whitespace-nowrap", X.currentBadge)
529
529
  }),
530
- e.publishCredentials === !0 && /* @__PURE__ */ B(N, {
530
+ e.publishCredentials === !0 && /* @__PURE__ */ R(M, {
531
531
  label: o,
532
- className: R("shrink-0 whitespace-nowrap", Le.sharedCredentialsBadge)
532
+ className: I("shrink-0 whitespace-nowrap", X.sharedCredentialsBadge)
533
533
  })
534
534
  ]
535
- }), /* @__PURE__ */ B("span", {
536
- className: R(d, Le.date),
537
- children: ce(e.publishedAt)
535
+ }), /* @__PURE__ */ R("span", {
536
+ className: I(d, X.date),
537
+ children: ue(e.publishedAt)
538
538
  })]
539
539
  }, `${e.version}-${n}`))
540
540
  });
541
- }, ze = ":", Be = (e) => `${ze}${e}`, Ve = (e) => e?.startsWith(ze) ? e.slice(1) : void 0, He = (e) => [Be(e.rootKey), ...e.path], Ue = (e) => {
542
- let [t, ...n] = e, r = Ve(t);
543
- return r == null ? void 0 : {
544
- rootKey: r,
545
- path: n
546
- };
547
- }, We = (e, t) => e.map((e) => ({
548
- ...e,
549
- path: [t, ...e.path],
550
- children: e.children ? We(e.children, t) : void 0
551
- })), Ge = (e) => e.map((e) => {
552
- let t = Be(e.key);
553
- return {
554
- path: [t],
555
- name: e.label,
556
- children: We(me(e.items), t)
557
- };
558
- }), Ke = (e) => e.map((e) => Be(e.key)), qe = (e, t) => {
559
- let n = /* @__PURE__ */ new Set();
560
- for (let r of e) {
561
- let e = Be(r.key);
562
- for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
563
- }
564
- return n;
565
- }, Je = (e, t) => {
566
- let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
567
- for (let e of t) {
568
- let [t, ...r] = e.split("/"), i = Ve(t);
569
- i != null && r.length !== 0 && n.get(i)?.add(J(r));
570
- }
571
- return n;
572
- }, Ye = {
573
- divider: "_divider_1gs31_1",
574
- tree: "_tree_1gs31_17"
575
- }, Xe = "data-cancel-creating-folder", Ze = "", Qe = [], $e = ({ items: e = Qe, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: d, onDestinationChange: f, onCreateDestinationFolder: p, searchQuery: m, getDisabledReason: h, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: y = "Cancel", addSiblingFolderLabel: b = "Add sibling", addChildFolderLabel: x = "Add child", newFolderDefaultName: S = "New folder", noResultsLabel: C = "No folders match \"{query}\".", emptyFolderNameError: w = "Folder name cannot be empty.", invalidFolderNameError: T = "Folder name contains invalid characters.", duplicateFolderNameError: E = "A folder with this name already exists.", sameAsParentFolderNameError: D = "A folder cannot have the same name as its parent folder.", rootLabel: ee = "Organization", expandedPaths: O, onExpandedPathsChange: k, loadingPaths: te, styles: A = {} }) => {
576
- let j = {
577
- ...L({ "--pft-divider": A.colors?.divider }),
578
- ...A.cssVars
579
- }, M = c != null, N = r(() => c ? Ge(c) : e, [c, e]), P = i(N);
580
- t(() => {
581
- P.current = N;
582
- }, [N]);
583
- let F = r(() => c ? Ke(c) : [Ze], [c]), I = n;
584
- M && (I = d ? He(d) : void 0);
585
- let z = (e) => {
586
- M ? f?.(e ? Ue(e) : void 0) : o?.(e);
587
- }, [ie, U] = a(() => new Set(I?.map((e, t) => J(I.slice(0, t + 1))) ?? [])), W = r(() => c ? /* @__PURE__ */ new Set([...ie, ...qe(c, (e) => e.expandedPaths)]) : void 0, [c, ie]) ?? O ?? ie, oe = r(() => c ? qe(c, (e) => e.loadingPaths) : te, [c, te]), se = (e) => {
588
- let t = new Set(e);
589
- for (let e of F) t.delete(e);
590
- if (c) {
591
- U(t);
592
- let e = Je(c, t);
593
- for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
594
- } else k ? k(t) : U(t);
595
- }, [G, ce] = a(null), [le, ue] = a(S), de = i(null), K = i(!1);
596
- t(() => {
597
- let e = (e) => {
598
- e.target instanceof Element && e.target.closest(`[${Xe}]`) && (K.current = !0);
599
- };
600
- return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
601
- }, []);
602
- let q = m.trim(), pe = G != null, he = r(() => fe(N, m), [N, m]), ge = q.length > 0 && he.length === 0, Y = !pe && q.length > 0, X = r(() => {
603
- let e = Y ? he : N;
604
- return M ? e : me(e);
605
- }, [
606
- Y,
607
- he,
608
- N,
609
- M
610
- ]), Ce = r(() => /* @__PURE__ */ new Set([...F, ..._e(X)]), [F, X]), Z = r(() => /* @__PURE__ */ new Set([...F, ...Y ? Ce : W]), [
611
- F,
612
- Y,
613
- Ce,
614
- W
615
- ]), we = r(() => ye(X), [X]), Te = r(() => Y && we.length === 0 ? [] : M ? we : [{
616
- path: Ze,
617
- name: ee,
618
- folderId: Ze,
619
- nodeType: ne.FOLDER,
620
- items: we
621
- }], [
622
- we,
623
- ee,
624
- Y,
625
- M
626
- ]), Ee = G ? J(G) : null, Q = {
627
- empty: w,
628
- invalid: T,
629
- duplicate: E,
630
- sameAsParent: D
631
- }, De = (e) => F.includes(J(e)) ? void 0 : e.at(-1), $ = (e) => c ? Ue(e) : {
632
- rootKey: Ze,
633
- path: e
634
- }, Oe = (e) => {
635
- if (!h) return;
636
- let t = $(ve(e.path));
637
- return t && h(t) || void 0;
638
- }, ke = (e) => {
639
- let t = $(e);
640
- return t != null && !!h?.(t);
641
- }, Ae = (e) => {
642
- if (ke(e)) return !1;
643
- if (!c) return !0;
644
- let t = Ue(e), n = c.find((e) => e.key === t?.rootKey);
645
- return n != null && n.canCreateFolders !== !1;
646
- }, je = (() => {
647
- if (!c) {
648
- let e = I ?? [];
649
- return Ae(e) ? e : void 0;
650
- }
651
- if (I && Ae(I)) return I;
652
- let e = c.find((e) => e.canCreateFolders !== !1);
653
- return e ? He({
654
- rootKey: e.key,
655
- path: []
656
- }) : void 0;
657
- })(), Me = (e) => {
658
- let t = ge && be(q, [], Q) == null, n = De(e);
659
- return xe(t ? q : S, [...Se(N, e), ...n ? [n] : []]);
660
- }, [Ne, Pe] = a(null);
661
- Ne != null && !oe?.has(J(Ne)) && (Pe(null), ce(Ne), ue(Me(Ne)));
662
- let Fe = (e) => {
663
- ce(null), Pe(e), de.current = null, K.current = !1;
664
- let t = J(e);
665
- t && se(new Set(W).add(t));
666
- }, Ie = () => {
667
- je && Fe(je);
668
- }, Le = (e) => {
669
- let t = ve(e.path);
670
- if (!Ae(t)) return [];
671
- let n = [{
672
- key: "add-child",
673
- label: x,
674
- icon: /* @__PURE__ */ B(ae, {
675
- size: l.SM,
676
- "aria-hidden": !0,
677
- stroke: u
678
- }),
679
- onClick: () => Fe(t)
680
- }];
681
- return F.includes(e.path) || n.push({
682
- key: "add-sibling",
683
- label: b,
684
- icon: /* @__PURE__ */ B(H, {
685
- size: l.SM,
686
- "aria-hidden": !0,
687
- stroke: u
688
- }),
689
- onClick: () => Fe(t.slice(0, -1))
690
- }), n;
691
- }, Re = (e) => {
692
- if (!G) return null;
693
- let t = be(e, Se(P.current, G), Q, De(G));
694
- return de.current = t, t;
695
- }, ze = (e) => {
696
- if (!G || K.current) return;
697
- let t = e.trim(), n = de.current;
698
- if (!(Re(e) ?? n)) {
699
- let e = c ? Ue(G) : void 0;
700
- e ? p?.(e.rootKey, e.path, t) : s?.(G, t), z([...G, t]);
701
- }
702
- ce(null);
703
- }, Be = () => ce(null);
704
- return /* @__PURE__ */ V("div", {
705
- style: j,
706
- className: R(g && "pointer-events-none opacity-60", A.className),
707
- children: [
708
- /* @__PURE__ */ B("div", {
709
- className: R("w-full max-w-full min-w-0", Ye.tree),
710
- children: /* @__PURE__ */ B(re, {
711
- items: Te,
712
- showFiles: !1,
713
- selectedPath: I == null ? void 0 : J(I),
714
- expandedPaths: Z,
715
- onExpandedPathsChange: se,
716
- loadingPaths: oe,
717
- onItemClick: (e) => {
718
- if (g || Oe(e)) return;
719
- let t = I != null && J(I) === e.path;
720
- z(t ? void 0 : ve(e.path));
721
- },
722
- getDisabledTooltip: h ? Oe : void 0,
723
- getContextMenuItems: Le,
724
- createdFolderPath: Ee,
725
- newFolderDefaultName: le,
726
- onCreateFolderSave: ze,
727
- onCreateFolderCancel: Be,
728
- onRenameValidate: (e) => Re(e),
729
- searchQuery: Y ? q : void 0,
730
- emptyStateTitle: Y ? C.replace("{query}", q) : void 0
731
- })
732
- }),
733
- /* @__PURE__ */ B("div", {
734
- className: R("my-2 h-px", Ye.divider),
735
- "aria-hidden": !0
736
- }),
737
- /* @__PURE__ */ V("div", {
738
- className: "mb-4 flex flex-wrap items-center gap-2",
739
- children: [/* @__PURE__ */ B(v, {
740
- onClick: Ie,
741
- label: _,
742
- iconBefore: /* @__PURE__ */ B(H, {
743
- size: l.SM,
744
- "aria-hidden": !0,
745
- stroke: u
746
- }),
747
- disabled: g || pe || !je
748
- }), pe && /* @__PURE__ */ B(v, {
749
- label: y,
750
- onClick: Be,
751
- disabled: g,
752
- [Xe]: ""
753
- })]
754
- })
755
- ]
756
- });
757
- }, et = {
541
+ }, Ve = {
758
542
  summaryTitle: "_summaryTitle_hp97x_1",
759
543
  sectionHeading: "_sectionHeading_hp97x_5",
760
544
  destination: "_destination_hp97x_9",
761
545
  directNote: "_directNote_hp97x_13"
762
- }, tt = 200, nt = ({ view: e = K.Main, onChangeFolderClick: o, resource: c, renderSummary: d, dependencies: f, versionHistory: m, folderItems: h, selectedFolderPath: g, pendingFolderPath: b, onPendingFolderPathChange: x, onCreateFolder: S, getDisabledReason: C, expandedPaths: w, onExpandedPathsChange: ee, loadingPaths: O, hasExistingPublicationInFolder: te, hasWriteAccess: A, isSubmitting: j, hasSubmitError: M = !1, isTargetTaken: N = !1, isTargetChecking: P = !1, allowReplace: F = !0, author: z = "", onAuthorChange: ne, publishCredentials: re = !1, onPublishCredentialsChange: ae, isDirectWrite: H = !1, directUnavailableNote: W, labels: oe = {}, summaryTitleClassName: G = "dial-body-semi-text", headingClassName: ce = "dial-body-semi-text", directNoteClassName: le = "dial-small-text", destinationClassName: ue = "dial-small-semi-text", calloutFolderNameClassName: de = "dial-small-paragraph-semi-text", styles: q = {} }) => {
763
- let { colors: fe, folderTree: pe, dependencies: me } = q, he = {
764
- ...L({
765
- "--pp-summary-title-text": fe?.summaryTitleText,
766
- "--pp-heading-text": fe?.headingText,
767
- "--pp-destination-text": fe?.destinationText,
768
- "--pp-direct-note-text": fe?.directNoteText
546
+ }, He = "", Ue = () => void 0, We = (e) => e == null ? void 0 : {
547
+ rootKey: He,
548
+ path: e
549
+ }, Ge = 200, Ke = ({ view: e = U.Main, onChangeFolderClick: a, resource: o, renderSummary: c, dependencies: d, versionHistory: f, folderItems: m, selectedFolderPath: h, pendingFolderPath: g, onPendingFolderPathChange: b, onCreateFolder: x, getDisabledReason: S, expandedPaths: C, onExpandedPathsChange: w, loadingPaths: O, hasExistingPublicationInFolder: k, hasWriteAccess: ee, isSubmitting: A, hasSubmitError: te = !1, isTargetTaken: j = !1, isTargetChecking: M = !1, allowReplace: N = !0, author: ne = "", onAuthorChange: P, publishCredentials: L = !1, onPublishCredentialsChange: ie, isDirectWrite: V = !1, directUnavailableNote: H, labels: le = {}, summaryTitleClassName: ue = "dial-body-semi-text", headingClassName: de = "dial-body-semi-text", directNoteClassName: fe = "dial-small-text", destinationClassName: pe = "dial-small-semi-text", calloutFolderNameClassName: me = "dial-small-paragraph-semi-text", styles: he = {} }) => {
550
+ let { colors: W, folderTree: ge, dependencies: _e } = he, G = {
551
+ ...F({
552
+ "--pp-summary-title-text": W?.summaryTitleText,
553
+ "--pp-heading-text": W?.headingText,
554
+ "--pp-destination-text": W?.destinationText,
555
+ "--pp-direct-note-text": W?.directNoteText
769
556
  }),
770
- ...q.cssVars
771
- }, ge = {
772
- border: fe?.summaryBorder,
773
- background: fe?.summaryBackground
774
- }, { folderLabel: _e = "Publish to folder", destinationAriaLabel: J = "Destination folder", noFolderSelectedLabel: ve = "No folder selected", changeFolderLabel: Y = "Change", chooseFolderLabel: ye = "Choose", replaceWarning: X = "Version {version} is already published in {folder}. Publishing will replace it.", targetTakenLabel: be = "A resource with this name already exists in {folder}. Rename it or choose another folder.", targetTakenVersionedLabel: xe = "Version {version} of a resource with this name already exists in {folder}. Rename it, change its version or choose another folder.", noAccessError: Se = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: Ce = "Publishing failed. Please try again.", adminApprovalTitle: Z = "Admin approval required", adminApprovalMessage: we = "We’ll send a request to your organization’s admin. If approved, it will appear in the folder.", folderEmptyStateLabel: Te, addSiblingFolderLabel: De, addChildFolderLabel: $, cancelCreatingFolderLabel: Oe, createFolderEmptyNameError: ke, createFolderInvalidNameError: Ae, createFolderDuplicateNameError: je, createFolderSameAsParentNameError: Me, rootFolderLabel: Ne = "Organization", dependenciesLabels: Pe, searchPlaceholder: Fe, clearSearchAriaLabel: Le, authorLabel: Re = "Author", authorPlaceholder: ze = "Author name", authorHint: Be = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ve = "Publish with my credentials", directWriteNote: He, credentialsHint: Ue = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = oe, [We, Ge] = a(""), Ke = n(), qe = i(null), Je = i(null), Ye = (e) => {
775
- Ge(e ?? "");
776
- }, Xe = i(e);
557
+ ...he.cssVars
558
+ }, ve = {
559
+ border: W?.summaryBorder,
560
+ background: W?.summaryBackground
561
+ }, { folderLabel: K = "Publish to folder", destinationAriaLabel: ye = "Destination folder", noFolderSelectedLabel: be = "No folder selected", changeFolderLabel: xe = "Change", chooseFolderLabel: Se = "Choose", replaceWarning: Ce = "Version {version} is already published in {folder}. Publishing will replace it.", targetTakenLabel: we = "A resource with this name already exists in {folder}. Rename it or choose another folder.", targetTakenVersionedLabel: Te = "Version {version} of a resource with this name already exists in {folder}. Rename it, change its version or choose another folder.", noAccessError: Ee = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: q = "Publishing failed. Please try again.", adminApprovalTitle: De = "Admin approval required", adminApprovalMessage: Oe = "We’ll send a request to your organization’s admin. If approved, it will appear in the folder.", folderEmptyStateLabel: Ae, addSiblingFolderLabel: Y, addChildFolderLabel: je, cancelCreatingFolderLabel: Me, createFolderEmptyNameError: Ne, createFolderInvalidNameError: Pe, createFolderDuplicateNameError: Fe, createFolderSameAsParentNameError: Ie, rootFolderLabel: Le = "Organization", dependenciesLabels: Re, searchPlaceholder: X, clearSearchAriaLabel: Be, authorLabel: Ke = "Author", authorPlaceholder: Je = "Author name", authorHint: Xe = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ze = "Publish with my credentials", directWriteNote: Z, credentialsHint: Qe = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = le, $e = n(), et = i(null), tt = i(null), nt = i(e);
777
562
  t(() => {
778
- Xe.current !== e && (Xe.current = e, e === K.ChangeFolder ? Je.current?.focus({ preventScroll: !0 }) : qe.current?.focus({ preventScroll: !0 }));
563
+ nt.current !== e && (nt.current = e, e === U.ChangeFolder ? tt.current?.focus({ preventScroll: !0 }) : et.current?.focus({ preventScroll: !0 }));
779
564
  }, [e]);
780
- let Ze = g != null, Qe = r(() => se({
781
- hasSelectedFolder: Ze,
782
- hasExistingPublicationInFolder: te,
783
- hasWriteAccess: A,
784
- isSubmitting: j,
785
- hasSubmitError: M,
786
- isTargetTaken: N,
787
- isTargetChecking: P,
788
- allowReplace: F
565
+ let Q = h != null, $ = r(() => ce({
566
+ hasSelectedFolder: Q,
567
+ hasExistingPublicationInFolder: k,
568
+ hasWriteAccess: ee,
569
+ isSubmitting: A,
570
+ hasSubmitError: te,
571
+ isTargetTaken: j,
572
+ isTargetChecking: M,
573
+ allowReplace: N
789
574
  }), [
790
- Ze,
791
- te,
575
+ Q,
576
+ k,
577
+ ee,
792
578
  A,
579
+ te,
793
580
  j,
794
581
  M,
795
- N,
796
- P,
797
- F
798
- ]), nt = Ze ? g[g.length - 1] ?? Ne : "", it = d ? d() : /* @__PURE__ */ B("span", {
799
- className: R("truncate", G, et.summaryTitle),
800
- children: c?.title
801
- });
802
- if (e === K.ChangeFolder) return /* @__PURE__ */ V("div", {
803
- ref: Je,
582
+ N
583
+ ]), rt = Q ? h[h.length - 1] ?? Le : "", it = c ? c() : /* @__PURE__ */ R("span", {
584
+ className: I("truncate", ue, Ve.summaryTitle),
585
+ children: o?.title
586
+ }), at = r(() => [{
587
+ key: He,
588
+ label: Le,
589
+ items: m,
590
+ expandedPaths: C,
591
+ onExpandedPathsChange: w,
592
+ loadingPaths: O
593
+ }], [
594
+ Le,
595
+ m,
596
+ C,
597
+ w,
598
+ O
599
+ ]), ot = r(() => ({
600
+ searchPlaceholder: X,
601
+ clearSearchAriaLabel: Be,
602
+ folderEmptyStateLabel: Ae,
603
+ addSiblingFolderLabel: Y,
604
+ addChildFolderLabel: je,
605
+ cancelCreatingFolderLabel: Me,
606
+ createFolderEmptyNameError: Ne,
607
+ createFolderInvalidNameError: Pe,
608
+ createFolderDuplicateNameError: Fe,
609
+ createFolderSameAsParentNameError: Ie
610
+ }), [
611
+ X,
612
+ Be,
613
+ Ae,
614
+ Y,
615
+ je,
616
+ Me,
617
+ Ne,
618
+ Pe,
619
+ Fe,
620
+ Ie
621
+ ]), st = (e) => b(e?.path), ct = (e, t, n) => x(t, n);
622
+ if (e === U.ChangeFolder) return /* @__PURE__ */ R("div", {
623
+ ref: tt,
804
624
  tabIndex: -1,
805
625
  role: "group",
806
- "aria-label": _e,
807
- className: R("flex flex-col gap-3 outline-none", Q.panel),
808
- style: he,
809
- children: [/* @__PURE__ */ B("div", {
810
- role: "search",
811
- children: /* @__PURE__ */ B(k, {
812
- value: We,
813
- onChange: Ye,
814
- placeholder: Fe,
815
- clearLabel: Le,
816
- "aria-label": Fe
817
- })
818
- }), /* @__PURE__ */ B($e, {
819
- items: h,
820
- selectedPath: b,
821
- onSelectedPathChange: x,
822
- onCreateFolder: S,
823
- getDisabledReason: C,
824
- expandedPaths: w,
825
- onExpandedPathsChange: ee,
826
- loadingPaths: O,
827
- searchQuery: We,
828
- disabled: j,
829
- noResultsLabel: Te,
830
- addSiblingFolderLabel: De,
831
- addChildFolderLabel: $,
832
- cancelCreatingFolderLabel: Oe,
833
- emptyFolderNameError: ke,
834
- invalidFolderNameError: Ae,
835
- duplicateFolderNameError: je,
836
- sameAsParentFolderNameError: Me,
837
- rootLabel: Ne,
838
- styles: pe
839
- })]
626
+ "aria-label": K,
627
+ className: I("flex flex-col gap-3 outline-none", J.panel),
628
+ style: G,
629
+ children: /* @__PURE__ */ R(ae, {
630
+ view: oe.ChangeFolder,
631
+ item: { title: o?.title ?? "" },
632
+ roots: at,
633
+ destination: {
634
+ rootKey: He,
635
+ path: h ?? []
636
+ },
637
+ onDestinationChange: Ue,
638
+ onChangeFolderClick: Ue,
639
+ pendingDestination: We(g),
640
+ onPendingDestinationChange: st,
641
+ onCreateFolder: ct,
642
+ getDisabledReason: S,
643
+ isSubmitting: A,
644
+ panelLabels: ot,
645
+ panelStyles: { folderTree: ge }
646
+ })
840
647
  });
841
- let ot = R(ue, et.destination);
842
- return /* @__PURE__ */ V("div", {
843
- className: R("flex flex-col gap-5", Q.panel),
844
- style: he,
648
+ let lt = I(pe, Ve.destination);
649
+ return /* @__PURE__ */ z("div", {
650
+ className: I("flex flex-col gap-5", J.panel),
651
+ style: G,
845
652
  children: [
846
- c?.type == null ? /* @__PURE__ */ B(I, {
847
- colors: ge,
653
+ o?.type == null ? /* @__PURE__ */ R(re, {
654
+ colors: ve,
848
655
  children: it
849
- }) : /* @__PURE__ */ B(I, {
656
+ }) : /* @__PURE__ */ R(re, {
850
657
  item: {
851
- type: c.type,
852
- name: c.title,
853
- version: c.version ?? "",
854
- iconUrl: c.iconUrl
658
+ type: o.type,
659
+ name: o.title,
660
+ version: o.version ?? "",
661
+ iconUrl: o.iconUrl
855
662
  },
856
663
  hasVersionTag: !1,
857
- colors: ge
664
+ colors: ve
858
665
  }),
859
- /* @__PURE__ */ V("section", { children: [
860
- /* @__PURE__ */ B("h2", {
861
- className: R("mb-2", ce, et.sectionHeading),
862
- children: _e
666
+ /* @__PURE__ */ z("section", { children: [
667
+ /* @__PURE__ */ R("h2", {
668
+ className: I("mb-2", de, Ve.sectionHeading),
669
+ children: K
863
670
  }),
864
- /* @__PURE__ */ V("div", {
671
+ /* @__PURE__ */ z("div", {
865
672
  className: "flex min-w-0 items-center gap-2",
866
- children: [/* @__PURE__ */ B("div", {
673
+ children: [/* @__PURE__ */ R("div", {
867
674
  role: "group",
868
- "aria-label": J,
675
+ "aria-label": ye,
869
676
  className: "min-w-0 flex-1",
870
- children: Ze ? /* @__PURE__ */ B(_, {
871
- name: [Ne, ...g].join(" / "),
872
- nameClassName: ot
873
- }) : /* @__PURE__ */ B("span", {
874
- className: R("block truncate", ot),
875
- children: ve
677
+ children: Q ? /* @__PURE__ */ R(_, {
678
+ name: [Le, ...h].join(" / "),
679
+ nameClassName: lt
680
+ }) : /* @__PURE__ */ R("span", {
681
+ className: I("block truncate", lt),
682
+ children: be
876
683
  })
877
- }), /* @__PURE__ */ B(v, {
878
- ref: qe,
684
+ }), /* @__PURE__ */ R(v, {
685
+ ref: et,
879
686
  size: p.Small,
880
- label: Ze ? Y : ye,
881
- iconBefore: /* @__PURE__ */ B(ie, {
687
+ label: Q ? xe : Se,
688
+ iconBefore: /* @__PURE__ */ R(se, {
882
689
  size: l.SM,
883
690
  stroke: u,
884
691
  "aria-hidden": !0
885
692
  }),
886
- disabled: j,
887
- onClick: o
693
+ disabled: A,
694
+ onClick: a
888
695
  })]
889
696
  }),
890
- Qe.calloutKind === U.Info && !H && /* @__PURE__ */ B("div", {
697
+ $.calloutKind === B.Info && !V && /* @__PURE__ */ R("div", {
891
698
  className: "my-4",
892
- children: /* @__PURE__ */ B(T, {
699
+ children: /* @__PURE__ */ R(T, {
893
700
  type: E.SectionMessage,
894
701
  variant: D.Info,
895
- title: Z,
896
- message: we
702
+ title: De,
703
+ message: Oe
897
704
  })
898
705
  }),
899
- Qe.calloutKind !== U.None && Qe.calloutKind !== U.Info && /* @__PURE__ */ B("div", {
706
+ $.calloutKind !== B.None && $.calloutKind !== B.Info && /* @__PURE__ */ R("div", {
900
707
  className: "mt-3",
901
- children: /* @__PURE__ */ B(T, {
708
+ children: /* @__PURE__ */ R(T, {
902
709
  type: E.SectionMessage,
903
- variant: rt(Qe.calloutKind),
904
- message: at(Qe.calloutKind, {
905
- replaceWarning: X,
906
- targetTaken: c?.version ? xe : be,
907
- noAccessError: Se,
908
- submitError: Ce,
909
- folderName: nt,
910
- version: c?.version,
911
- folderNameClassName: de
710
+ variant: qe($.calloutKind),
711
+ message: Ye($.calloutKind, {
712
+ replaceWarning: Ce,
713
+ targetTaken: o?.version ? Te : we,
714
+ noAccessError: Ee,
715
+ submitError: q,
716
+ folderName: rt,
717
+ version: o?.version,
718
+ folderNameClassName: me
912
719
  })
913
720
  })
914
721
  }),
915
- W != null && !H && /* @__PURE__ */ B("div", {
722
+ H != null && !V && /* @__PURE__ */ R("div", {
916
723
  className: "mt-4",
917
- children: /* @__PURE__ */ B(T, {
724
+ children: /* @__PURE__ */ R(T, {
918
725
  type: E.SectionMessage,
919
726
  variant: D.Info,
920
- message: W
727
+ message: H
921
728
  })
922
729
  }),
923
- ne != null && !H && /* @__PURE__ */ B("div", {
730
+ P != null && !V && /* @__PURE__ */ R("div", {
924
731
  className: "mt-4",
925
- children: /* @__PURE__ */ B(y, {
926
- id: Ke,
927
- labelProps: { label: Re },
928
- placeholder: ze,
929
- caption: Be,
930
- value: z,
931
- onChange: (e) => ne(e ?? ""),
932
- maxLength: tt,
933
- disabled: j
732
+ children: /* @__PURE__ */ R(y, {
733
+ id: $e,
734
+ labelProps: { label: Ke },
735
+ placeholder: Je,
736
+ caption: Xe,
737
+ value: ne,
738
+ onChange: (e) => P(e ?? ""),
739
+ maxLength: Ge,
740
+ disabled: A
934
741
  })
935
742
  }),
936
- H && He != null && /* @__PURE__ */ B("p", {
937
- className: R("mt-4", et.directNote, le),
938
- children: He
743
+ V && Z != null && /* @__PURE__ */ R("p", {
744
+ className: I("mt-4", Ve.directNote, fe),
745
+ children: Z
939
746
  }),
940
- ae != null && !H && /* @__PURE__ */ B("div", {
747
+ ie != null && !V && /* @__PURE__ */ R("div", {
941
748
  className: "mt-4",
942
- children: /* @__PURE__ */ B(s, {
943
- labelProps: { label: Ve },
944
- caption: Ue,
945
- isSelected: re,
946
- onChange: ae,
947
- disabled: j
749
+ children: /* @__PURE__ */ R(s, {
750
+ labelProps: { label: Ze },
751
+ caption: Qe,
752
+ isSelected: L,
753
+ onChange: ie,
754
+ disabled: A
948
755
  })
949
756
  })
950
757
  ] }),
951
- f != null && /* @__PURE__ */ B(Ie, {
952
- dependencies: f,
953
- labels: Pe,
954
- headingClassName: ce,
955
- styles: me
758
+ d != null && /* @__PURE__ */ R(ze, {
759
+ dependencies: d,
760
+ labels: Re,
761
+ headingClassName: de,
762
+ styles: _e
956
763
  }),
957
- m != null && /* @__PURE__ */ B(Ee, {
958
- headingClassName: ce,
959
- ...m
764
+ f != null && /* @__PURE__ */ R(ke, {
765
+ headingClassName: de,
766
+ ...f
960
767
  })
961
768
  ]
962
769
  });
963
- }, rt = (e) => e === U.ReplaceWarning || e === U.TargetTaken ? D.Warning : D.Error, it = (e, t, n) => {
770
+ }, qe = (e) => e === B.ReplaceWarning || e === B.TargetTaken ? D.Warning : D.Error, Je = (e, t, n) => {
964
771
  let [r, i, ...a] = e.split("{folder}");
965
- return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ V(z, { children: [
772
+ return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ z(L, { children: [
966
773
  r,
967
- /* @__PURE__ */ B("strong", {
774
+ /* @__PURE__ */ R("strong", {
968
775
  className: n,
969
776
  children: t
970
777
  }),
971
778
  i
972
779
  ] });
973
- }, at = (e, t) => e === U.ReplaceWarning ? it(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === U.TargetTaken ? it(t.targetTaken.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === U.NoAccess ? it(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, ot = { footer: "_footer_dks1v_1" }, st = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = K.Main, onSelectFolder: c, isSelectFolderDisabled: u = !1, labels: d = {}, colors: f }) => {
974
- let p = L({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: g = "Update version {version}", publishingInProgressLabel: _ = "Publishing…", selectFolderLabel: y = "Select" } = d, b = s === K.ChangeFolder, x = i ? _ : n && t && e != null ? g.replace("{version}", e) : h;
975
- return /* @__PURE__ */ V("div", {
780
+ }, Ye = (e, t) => e === B.ReplaceWarning ? Je(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === B.TargetTaken ? Je(t.targetTaken.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === B.NoAccess ? Je(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Xe = { footer: "_footer_dks1v_1" }, Ze = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = U.Main, onSelectFolder: c, isSelectFolderDisabled: u = !1, labels: d = {}, colors: f }) => {
781
+ let p = F({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: g = "Update version {version}", publishingInProgressLabel: _ = "Publishing…", selectFolderLabel: y = "Select" } = d, b = s === U.ChangeFolder, x = i ? _ : n && t && e != null ? g.replace("{version}", e) : h;
782
+ return /* @__PURE__ */ z("div", {
976
783
  style: p,
977
- className: R("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", ot.footer),
978
- children: [/* @__PURE__ */ B(v, {
784
+ className: I("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Xe.footer),
785
+ children: [/* @__PURE__ */ R(v, {
979
786
  label: m,
980
787
  className: "mobile:flex-1",
981
788
  disabled: i,
982
789
  onClick: a
983
- }), b ? /* @__PURE__ */ B(w, {
790
+ }), b ? /* @__PURE__ */ R(w, {
984
791
  label: y,
985
792
  className: "mobile:flex-1",
986
793
  disabled: u,
987
794
  onClick: c
988
- }) : /* @__PURE__ */ B(ee, {
795
+ }) : /* @__PURE__ */ R(O, {
989
796
  label: x,
990
797
  className: "mobile:flex-1",
991
798
  disabled: r,
992
- iconBefore: i ? /* @__PURE__ */ B("span", {
799
+ iconBefore: i ? /* @__PURE__ */ R("span", {
993
800
  "aria-hidden": !0,
994
- children: /* @__PURE__ */ B(M, { size: l.SM })
801
+ children: /* @__PURE__ */ R(j, { size: l.SM })
995
802
  }) : void 0,
996
803
  onClick: o
997
804
  })]
998
805
  });
999
- }, ct = {
806
+ }, Z = {
1000
807
  backdrop: "_backdrop_16jmd_6",
1001
808
  panel: "_panel_16jmd_10",
1002
809
  divider: "_divider_16jmd_15",
1003
810
  content: "_content_16jmd_19",
1004
811
  title: "_title_16jmd_24"
1005
- }, lt = ({ isOpen: e, resource: n, renderSummary: i, dependencies: o, versionHistory: s, folderItems: c, selectedFolderPath: l, onSelectedFolderPathChange: u, onCreateFolder: d, getDisabledReason: f, expandedPaths: p, onExpandedPathsChange: m, loadingPaths: h, hasExistingPublicationInFolder: g, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, isTargetTaken: b = !1, isTargetChecking: x = !1, allowReplace: S = !0, author: C, onAuthorChange: w, onClose: T, returnFocusRef: E, onSubmit: D, panelLabels: ee, panelStyles: O, panelSummaryTitleClassName: k, panelHeadingClassName: A, panelCalloutFolderNameClassName: j, footerLabels: M, labels: N = {}, titleClassName: P = "dial-body-semi-text", colors: F }) => {
1006
- let I = L({
1007
- "--spp-backdrop-bg": F?.backdropBackground,
1008
- "--spp-panel-bg": F?.panelBackground,
1009
- "--spp-panel-border": F?.panelBorder,
1010
- "--spp-divider-border": F?.dividerBorder,
1011
- "--spp-scrollbar-thumb": F?.scrollbarThumb,
1012
- "--spp-title-text": F?.titleText
1013
- }), [z, ne] = a(null), { title: re = "Publish", changeFolderTitle: ie = "Change folder", backAriaLabel: ae = "Back", ariaLabel: H = "Publish", closeAriaLabel: U = "Close" } = N, W = q({
812
+ }, Qe = ({ isOpen: e, resource: n, renderSummary: i, dependencies: o, versionHistory: s, folderItems: c, selectedFolderPath: l, onSelectedFolderPathChange: u, onCreateFolder: d, getDisabledReason: f, expandedPaths: p, onExpandedPathsChange: m, loadingPaths: h, hasExistingPublicationInFolder: g, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, isTargetTaken: b = !1, isTargetChecking: x = !1, allowReplace: S = !0, author: C, onAuthorChange: w, onClose: T, returnFocusRef: E, onSubmit: D, panelLabels: O, panelStyles: k, panelSummaryTitleClassName: A, panelHeadingClassName: te, panelCalloutFolderNameClassName: j, footerLabels: M, labels: N = {}, titleClassName: ne = "dial-body-semi-text", colors: P }) => {
813
+ let re = F({
814
+ "--spp-backdrop-bg": P?.backdropBackground,
815
+ "--spp-panel-bg": P?.panelBackground,
816
+ "--spp-panel-border": P?.panelBorder,
817
+ "--spp-divider-border": P?.dividerBorder,
818
+ "--spp-scrollbar-thumb": P?.scrollbarThumb,
819
+ "--spp-title-text": P?.titleText
820
+ }), [L, ie] = a(null), { title: ae = "Publish", changeFolderTitle: oe = "Change folder", backAriaLabel: se = "Back", ariaLabel: B = "Publish", closeAriaLabel: V = "Close" } = N, H = me({
1014
821
  isOpen: e,
1015
822
  selectedFolderPath: l,
1016
823
  onSelectedFolderPathChange: u
1017
- }), oe = W.view === K.ChangeFolder, G = r(() => se({
824
+ }), le = H.view === U.ChangeFolder, ue = r(() => ce({
1018
825
  hasSelectedFolder: l != null,
1019
826
  hasExistingPublicationInFolder: g,
1020
827
  hasWriteAccess: _,
@@ -1034,7 +841,7 @@ var U = /* @__PURE__ */ function(e) {
1034
841
  S
1035
842
  ]);
1036
843
  return t(() => {
1037
- let t = z?.closest("[role=\"dialog\"]");
844
+ let t = L?.closest("[role=\"dialog\"]");
1038
845
  if (!e || !t) return;
1039
846
  let n = () => t.focus({ preventScroll: !0 });
1040
847
  n();
@@ -1050,43 +857,43 @@ var U = /* @__PURE__ */ function(e) {
1050
857
  };
1051
858
  }, [
1052
859
  e,
1053
- z,
860
+ L,
1054
861
  E
1055
- ]), /* @__PURE__ */ V(te, {
862
+ ]), /* @__PURE__ */ z(ee, {
1056
863
  open: e,
1057
864
  onClose: T,
1058
- header: /* @__PURE__ */ B("span", {
1059
- className: R("block truncate text-center", P, ct.title),
1060
- children: oe ? ie : re
865
+ header: /* @__PURE__ */ R("span", {
866
+ className: I("block truncate text-center", ne, Z.title),
867
+ children: le ? oe : ae
1061
868
  }),
1062
- ariaLabel: H,
1063
- onBack: oe ? W.backToMain : void 0,
1064
- backAriaLabel: ae,
869
+ ariaLabel: B,
870
+ onBack: le ? H.backToMain : void 0,
871
+ backAriaLabel: se,
1065
872
  backDisabled: v,
1066
- closeAriaLabel: U,
873
+ closeAriaLabel: V,
1067
874
  closeDisabled: v,
1068
- style: I,
1069
- overlayStyle: I,
1070
- className: R(ct.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1071
- overlayClassName: ct.backdrop,
1072
- headerClassName: R("px-[22px]", ct.divider),
875
+ style: re,
876
+ overlayStyle: re,
877
+ className: I(Z.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
878
+ overlayClassName: Z.backdrop,
879
+ headerClassName: I("px-[22px]", Z.divider),
1073
880
  bodyClassName: "flex flex-col overflow-hidden",
1074
- children: [/* @__PURE__ */ B("div", {
1075
- ref: ne,
1076
- className: R("min-h-0 flex-1 overflow-y-auto", ct.content),
1077
- children: /* @__PURE__ */ B("div", {
881
+ children: [/* @__PURE__ */ R("div", {
882
+ ref: ie,
883
+ className: I("min-h-0 flex-1 overflow-y-auto", Z.content),
884
+ children: /* @__PURE__ */ R("div", {
1078
885
  className: "p-[22px]",
1079
- children: /* @__PURE__ */ B(nt, {
886
+ children: /* @__PURE__ */ R(Ke, {
1080
887
  resource: n,
1081
888
  renderSummary: i,
1082
889
  dependencies: o,
1083
890
  versionHistory: s,
1084
- view: W.view,
1085
- onChangeFolderClick: W.openFolderView,
891
+ view: H.view,
892
+ onChangeFolderClick: H.openFolderView,
1086
893
  folderItems: c,
1087
894
  selectedFolderPath: l,
1088
- pendingFolderPath: W.pendingFolderPath,
1089
- onPendingFolderPathChange: W.setPendingFolderPath,
895
+ pendingFolderPath: H.pendingFolderPath,
896
+ onPendingFolderPathChange: H.setPendingFolderPath,
1090
897
  onCreateFolder: d,
1091
898
  getDisabledReason: f,
1092
899
  expandedPaths: p,
@@ -1101,30 +908,30 @@ var U = /* @__PURE__ */ function(e) {
1101
908
  allowReplace: S,
1102
909
  author: C,
1103
910
  onAuthorChange: w,
1104
- labels: ee,
1105
- styles: O,
1106
- summaryTitleClassName: k,
1107
- headingClassName: A,
911
+ labels: O,
912
+ styles: k,
913
+ summaryTitleClassName: A,
914
+ headingClassName: te,
1108
915
  calloutFolderNameClassName: j
1109
916
  })
1110
917
  })
1111
- }), /* @__PURE__ */ B(st, {
918
+ }), /* @__PURE__ */ R(Ze, {
1112
919
  version: n?.version,
1113
920
  hasExistingPublicationInFolder: g,
1114
921
  allowReplace: S,
1115
- isSubmitDisabled: G.isSubmitDisabled,
1116
- isSubmitLoading: G.isSubmitLoading,
1117
- onCancel: oe ? W.backToMain : T,
922
+ isSubmitDisabled: ue.isSubmitDisabled,
923
+ isSubmitLoading: ue.isSubmitLoading,
924
+ onCancel: le ? H.backToMain : T,
1118
925
  onSubmit: D,
1119
- view: W.view,
1120
- onSelectFolder: W.selectFolder,
1121
- isSelectFolderDisabled: W.pendingFolderPath == null,
926
+ view: H.view,
927
+ onSelectFolder: H.selectFolder,
928
+ isSelectFolderDisabled: H.pendingFolderPath == null,
1122
929
  labels: M
1123
930
  })]
1124
931
  });
1125
- }, ut = { option: "_option_skygm_1" }, dt = (e, t) => `Unpublish "${e}" from "${t}"?`, ft = (e) => `Choose which folder to unpublish "${e}" from.`, pt = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: l, onConfirm: u, onClose: d }) => {
1126
- let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = dt, selectFolderMessage: y = ft } = o ?? {}, b = n.length > 1;
1127
- return /* @__PURE__ */ B(P, {
932
+ }, $e = { option: "_option_skygm_1" }, et = (e, t) => `Unpublish "${e}" from "${t}"?`, tt = (e) => `Choose which folder to unpublish "${e}" from.`, nt = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: l, onConfirm: u, onClose: d }) => {
933
+ let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = et, selectFolderMessage: y = tt } = o ?? {}, b = n.length > 1;
934
+ return /* @__PURE__ */ R(N, {
1128
935
  open: e,
1129
936
  title: f,
1130
937
  confirmLabel: p,
@@ -1133,319 +940,162 @@ var U = /* @__PURE__ */ function(e) {
1133
940
  isLoading: a,
1134
941
  isConfirmDisabled: b && r == null,
1135
942
  loadingStatusLabel: _,
1136
- message: /* @__PURE__ */ B("span", {
943
+ message: /* @__PURE__ */ R("span", {
1137
944
  className: "wrap-break-word",
1138
- children: b ? y(t) : v(t, Y(n[0] ?? "", h))
945
+ children: b ? y(t) : v(t, be(n[0] ?? "", h))
1139
946
  }),
1140
947
  onConfirm: u,
1141
948
  onClose: d,
1142
- children: b && /* @__PURE__ */ B("div", {
949
+ children: b && /* @__PURE__ */ R("div", {
1143
950
  className: "mt-3",
1144
- style: L({ "--ucd-option-text": l?.optionText }),
1145
- children: /* @__PURE__ */ B(O, {
951
+ style: F({ "--ucd-option-text": l?.optionText }),
952
+ children: /* @__PURE__ */ R(k, {
1146
953
  ariaLabel: g,
1147
954
  value: r ?? void 0,
1148
955
  onChange: i,
1149
956
  disabled: a,
1150
957
  items: n.map((e) => ({
1151
958
  value: e,
1152
- label: Y(e, h)
959
+ label: be(e, h)
1153
960
  })),
1154
- radioClassName: R(s, ut.option)
961
+ radioClassName: I(s, $e.option)
1155
962
  })
1156
963
  })
1157
964
  });
1158
- }, mt = /* @__PURE__ */ function(e) {
965
+ }, Q = /* @__PURE__ */ function(e) {
1159
966
  return e.Keep = "keep", e.New = "new", e;
1160
- }({}), ht = /* @__PURE__ */ function(e) {
1161
- return e.Main = "main", e.ChangeFolder = "change-folder", e;
1162
- }({}), gt = {
1163
- heading: "_heading_1no2p_1",
1164
- destination: "_destination_1no2p_5",
1165
- note: "_note_1no2p_9"
1166
- }, _t = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, getDisabledReason: c, onChangeFolderClick: d, changeFolderButtonRef: f, pendingDestination: m, onPendingDestinationChange: g, version: S, dependencies: w, dependenciesLabels: ee, dependenciesStyles: te, dependenciesNote: A, destinationNote: j, noteClassName: M = "dial-small-text", versionHistory: N, isSubmitting: P = !1, submitError: F, foldersError: z, onRetryFolders: ne, panelLabels: re = {}, panelStyles: ae = {}, headingClassName: H = "dial-body-semi-text", destinationClassName: U = "dial-small-semi-text" }) => {
1167
- let { saveToFolderHeading: W = "Save to folder", changeFolderLabel: oe = "Change", destinationAriaLabel: se = "Destination folder", versionHeading: G = "Version", keepVersionLabel: ce = "Keep version {version}", saveAsNewVersionLabel: le = "Save as new version", newVersionLabel: ue = "Version", newVersionPlaceholder: de = "Enter new version", searchPlaceholder: K = "Search folders", clearSearchAriaLabel: q = "Clear search", folderEmptyStateLabel: fe, createFolderLabel: pe, cancelCreatingFolderLabel: me, addSiblingFolderLabel: he, addChildFolderLabel: ge, createFolderEmptyNameError: _e, createFolderInvalidNameError: J, createFolderDuplicateNameError: ve, createFolderSameAsParentNameError: Y, retryLabel: ye = "Retry" } = re, { colors: X, folderTree: be } = ae, xe = {
1168
- ...L({
1169
- "--stf-heading-text": X?.headingText,
1170
- "--stf-destination-text": X?.destinationText,
1171
- "--stf-note-text": X?.noteText
967
+ }({}), $ = {
968
+ heading: "_heading_jh4a2_1",
969
+ note: "_note_jh4a2_5"
970
+ }, rt = ({ isOpen: t, onClose: r, onSubmit: i, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, titleClassName: l = "dial-body-semi-text", resource: u, roots: d, destination: f, onDestinationChange: p, onPendingDestinationChange: m, getDisabledReason: h, onCreateFolder: g, onCreateFolderError: _, version: v, dependencies: b, dependenciesLabels: x, dependenciesStyles: S, dependenciesNote: C, destinationNote: w, noteClassName: T = "dial-small-text", versionHistory: E, isSubmitting: D = !1, submitError: O, foldersError: ee, onRetryFolders: A, panelLabels: te = {}, panelStyles: j = {}, headingClassName: M = "dial-body-semi-text", destinationClassName: N = "dial-small-semi-text" }) => {
971
+ let { title: ne = "Save", changeFolderTitle: re = "Change folder", closeAriaLabel: L = "Close", backAriaLabel: ae = "Back", cancelLabel: oe = "Cancel", saveLabel: se = "Save", savingLabel: B = "Saving…", selectLabel: V = "Select" } = c, { saveToFolderHeading: H = "Save to folder", versionHeading: ce = "Version", keepVersionLabel: le = "Keep version {version}", saveAsNewVersionLabel: ue = "Save as new version", newVersionLabel: de = "Version", newVersionPlaceholder: fe = "Enter new version", createFolderFailedMessage: pe = "Failed to create the folder. Please try again.", ...U } = te, { colors: me, folderTree: he, cssVars: W } = j, ge = {
972
+ ...F({
973
+ "--stf-heading-text": me?.headingText,
974
+ "--stf-note-text": me?.noteText
1172
975
  }),
1173
- ...ae.cssVars
1174
- }, Se = {
1175
- border: X?.summaryBorder,
1176
- background: X?.summaryBackground
1177
- }, [Ce, Z] = a(""), we = n(), Te = n(), Q = n(), De = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), $ = R(H, gt.heading), Oe = c?.(o), ke = !!A && (w?.length ?? 0) === 0;
1178
- if (e === ht.ChangeFolder) return /* @__PURE__ */ V("div", {
1179
- className: "flex flex-col gap-3",
1180
- style: xe,
1181
- children: [
1182
- /* @__PURE__ */ B("div", {
1183
- role: "search",
1184
- children: /* @__PURE__ */ B(k, {
1185
- value: Ce,
1186
- onChange: (e) => Z(e ?? ""),
1187
- placeholder: K,
1188
- clearLabel: q,
1189
- "aria-label": K
1190
- })
1191
- }),
1192
- /* @__PURE__ */ B(x, {
1193
- politeness: C.Assertive,
1194
- children: z && /* @__PURE__ */ V("div", {
1195
- className: "flex flex-wrap items-center gap-2",
1196
- children: [/* @__PURE__ */ B(h, { text: z }), ne && /* @__PURE__ */ B(b, {
1197
- label: ye,
1198
- onClick: ne
1199
- })]
1200
- })
1201
- }),
1202
- /* @__PURE__ */ B($e, {
1203
- roots: i,
1204
- destination: m,
1205
- onDestinationChange: g,
1206
- onCreateDestinationFolder: s,
1207
- getDisabledReason: c,
1208
- searchQuery: Ce,
1209
- disabled: P,
1210
- noResultsLabel: fe,
1211
- createFolderLabel: pe,
1212
- cancelCreatingFolderLabel: me,
1213
- addSiblingFolderLabel: he,
1214
- addChildFolderLabel: ge,
1215
- emptyFolderNameError: _e,
1216
- invalidFolderNameError: J,
1217
- duplicateFolderNameError: ve,
1218
- sameAsParentFolderNameError: Y,
1219
- styles: be
1220
- })
1221
- ]
1222
- });
1223
- let Ae = S ? [{
1224
- value: mt.Keep,
1225
- label: ce.replace("{version}", S.currentVersion)
976
+ ...W
977
+ }, [_e, G] = a(), ve = e((e, t, n) => (G(void 0), g(e, t, n)), [g]), K = e((e) => {
978
+ G(pe), _?.(e);
979
+ }, [pe, _]), ye = e((e) => {
980
+ G(void 0), p(e);
981
+ }, [p]), be = n(), xe = n(), Se = I(M, $.heading), Ce = I(T, $.note), we = !!C && (b?.length ?? 0) === 0, Te = u.type == null ? void 0 : /* @__PURE__ */ R(P, {
982
+ item: {
983
+ type: u.type,
984
+ name: u.title,
985
+ version: u.version ?? "",
986
+ iconUrl: u.iconUrl
987
+ },
988
+ iconSize: 40,
989
+ hasFeaturedTag: !1,
990
+ showVersion: !0
991
+ }), Ee = v ? [{
992
+ value: Q.Keep,
993
+ label: le.replace("{version}", v.currentVersion)
1226
994
  }, {
1227
- value: mt.New,
1228
- label: le,
1229
- content: /* @__PURE__ */ B(y, {
1230
- id: we,
1231
- value: S.newVersion,
1232
- onChange: (e) => S.onNewVersionChange(e ?? ""),
1233
- onBlur: S.onNewVersionBlur,
995
+ value: Q.New,
996
+ label: ue,
997
+ content: /* @__PURE__ */ R(y, {
998
+ id: be,
999
+ value: v.newVersion,
1000
+ onChange: (e) => v.onNewVersionChange(e ?? ""),
1001
+ onBlur: v.onNewVersionBlur,
1234
1002
  labelProps: {
1235
- label: ue,
1003
+ label: de,
1236
1004
  required: !0
1237
1005
  },
1238
- placeholder: de,
1239
- error: S.newVersionError,
1240
- invalid: !!S.newVersionError,
1241
- disabled: P
1006
+ placeholder: fe,
1007
+ error: v.newVersionError,
1008
+ invalid: !!v.newVersionError,
1009
+ disabled: D
1242
1010
  })
1243
- }] : [];
1244
- return /* @__PURE__ */ V("div", {
1011
+ }] : [], q = /* @__PURE__ */ z("div", {
1245
1012
  className: "flex flex-col gap-5",
1246
- style: xe,
1013
+ style: ge,
1247
1014
  children: [
1248
- t.type == null ? /* @__PURE__ */ B(I, {
1249
- colors: Se,
1250
- children: /* @__PURE__ */ B("span", {
1251
- className: R("truncate", $),
1252
- children: t.title
1253
- })
1254
- }) : /* @__PURE__ */ B(I, {
1255
- item: {
1256
- type: t.type,
1257
- name: t.title,
1258
- version: t.version ?? "",
1259
- iconUrl: t.iconUrl
1260
- },
1261
- hasVersionTag: !1,
1262
- colors: Se
1263
- }),
1264
- /* @__PURE__ */ V("section", {
1265
- className: "flex flex-col gap-2",
1266
- children: [
1267
- /* @__PURE__ */ B("h2", {
1268
- className: $,
1269
- children: W
1270
- }),
1271
- /* @__PURE__ */ V("div", {
1272
- className: "flex min-w-0 items-center gap-2",
1273
- children: [/* @__PURE__ */ B("div", {
1274
- role: "group",
1275
- "aria-label": se,
1276
- "aria-describedby": Oe ? Te : void 0,
1277
- className: "min-w-0 flex-1",
1278
- children: /* @__PURE__ */ B(_, {
1279
- name: De.join(" / "),
1280
- nameClassName: R(U, gt.destination)
1281
- })
1282
- }), /* @__PURE__ */ B(v, {
1283
- ref: f,
1284
- size: p.Small,
1285
- label: oe,
1286
- iconBefore: /* @__PURE__ */ B(ie, {
1287
- size: l.SM,
1288
- stroke: u,
1289
- "aria-hidden": !0
1290
- }),
1291
- disabled: P,
1292
- onClick: d
1293
- })]
1294
- }),
1295
- /* @__PURE__ */ B(x, {
1296
- politeness: C.Assertive,
1297
- children: Oe && /* @__PURE__ */ B("div", {
1298
- id: Te,
1299
- children: /* @__PURE__ */ B(T, {
1300
- type: E.SectionMessage,
1301
- variant: D.Error,
1302
- role: "none",
1303
- message: Oe
1304
- })
1305
- })
1306
- }),
1307
- j && /* @__PURE__ */ B("p", {
1308
- className: R(M, gt.note),
1309
- children: j
1310
- })
1311
- ]
1015
+ w && /* @__PURE__ */ R("p", {
1016
+ className: Ce,
1017
+ children: w
1312
1018
  }),
1313
- S && /* @__PURE__ */ V("section", {
1019
+ v && /* @__PURE__ */ z("section", {
1314
1020
  className: "flex flex-col gap-2",
1315
- children: [/* @__PURE__ */ B("h2", {
1316
- className: $,
1317
- children: G
1318
- }), /* @__PURE__ */ B(O, {
1319
- ariaLabel: G,
1320
- value: S.versionMode,
1321
- onChange: (e) => S.onVersionModeChange(e),
1322
- items: Ae,
1323
- disabled: P
1021
+ children: [/* @__PURE__ */ R("h2", {
1022
+ className: Se,
1023
+ children: ce
1024
+ }), /* @__PURE__ */ R(k, {
1025
+ ariaLabel: ce,
1026
+ value: v.versionMode,
1027
+ onChange: (e) => v.onVersionModeChange(e),
1028
+ items: Ee,
1029
+ disabled: D
1324
1030
  })]
1325
1031
  }),
1326
- /* @__PURE__ */ B(x, {
1327
- politeness: C.Assertive,
1328
- children: F && /* @__PURE__ */ B(h, { text: F })
1329
- }),
1330
- ke && /* @__PURE__ */ V("section", {
1032
+ we && /* @__PURE__ */ z("section", {
1331
1033
  className: "flex flex-col gap-2",
1332
- "aria-labelledby": Q,
1333
- children: [/* @__PURE__ */ B("h2", {
1334
- id: Q,
1335
- className: $,
1336
- children: ee?.title ?? "Private dependencies"
1337
- }), /* @__PURE__ */ B("p", {
1338
- className: R(M, gt.note),
1339
- children: A
1034
+ "aria-labelledby": xe,
1035
+ children: [/* @__PURE__ */ R("h2", {
1036
+ id: xe,
1037
+ className: Se,
1038
+ children: x?.title ?? "Private dependencies"
1039
+ }), /* @__PURE__ */ R("p", {
1040
+ className: Ce,
1041
+ children: C
1340
1042
  })]
1341
1043
  }),
1342
- !ke && w != null && /* @__PURE__ */ B(Ie, {
1343
- dependencies: w,
1344
- labels: ee,
1345
- headingClassName: H,
1346
- styles: te
1044
+ !we && b != null && /* @__PURE__ */ R(ze, {
1045
+ dependencies: b,
1046
+ labels: x,
1047
+ headingClassName: M,
1048
+ styles: S
1347
1049
  }),
1348
- N != null && /* @__PURE__ */ B(Ee, {
1349
- headingClassName: H,
1350
- ...N
1050
+ E != null && /* @__PURE__ */ R(ke, {
1051
+ headingClassName: M,
1052
+ ...E
1351
1053
  })
1352
1054
  ]
1353
1055
  });
1354
- }, vt = {
1355
- backdrop: "_backdrop_1ie8s_6",
1356
- panel: "_panel_1ie8s_10",
1357
- divider: "_divider_1ie8s_15",
1358
- footer: "_footer_1ie8s_19",
1359
- content: "_content_1ie8s_23",
1360
- title: "_title_1ie8s_28"
1361
- }, yt = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: u, titleClassName: d = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: h, ...g }) => {
1362
- let { title: _ = "Save", changeFolderTitle: y = "Change folder", closeAriaLabel: b = "Close", backAriaLabel: x = "Back", cancelLabel: S = "Cancel", saveLabel: C = "Save", savingLabel: T = "Saving…", selectLabel: E = "Select" } = c, D = L({
1363
- "--sstf-backdrop-bg": u?.backdropBackground,
1364
- "--sstf-panel-bg": u?.panelBackground,
1365
- "--sstf-panel-border": u?.panelBorder,
1366
- "--sstf-divider-border": u?.dividerBorder,
1367
- "--sstf-scrollbar-thumb": u?.scrollbarThumb,
1368
- "--sstf-title-text": u?.titleText
1369
- }), [O, k] = a(ht.Main), [A, j] = a(f), N = i(null), P = i(null);
1370
- t(() => {
1371
- e && k(ht.Main);
1372
- }, [e]);
1373
- let F = i(O);
1374
- t(() => {
1375
- F.current !== O && (F.current = O, O === ht.ChangeFolder ? N.current?.focus({ preventScroll: !0 }) : P.current?.focus({ preventScroll: !0 }));
1376
- }, [O]);
1377
- let I = i(e);
1378
- t(() => {
1379
- let t = I.current;
1380
- I.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1381
- }, [e, s]);
1382
- let z = O === ht.ChangeFolder, ne = (e) => {
1383
- j(e), h?.(e);
1384
- }, re = () => {
1385
- ne(f), k(ht.ChangeFolder);
1386
- }, ie = () => {
1387
- h?.(f), k(ht.Main);
1388
- }, ae = () => {
1389
- A && p(A), k(ht.Main);
1390
- };
1391
- return /* @__PURE__ */ V(te, {
1392
- open: e,
1393
- onClose: n,
1394
- header: /* @__PURE__ */ B("span", {
1395
- ref: N,
1396
- tabIndex: -1,
1397
- className: R("block truncate outline-none", d, vt.title),
1398
- children: z ? y : _
1399
- }),
1400
- ariaLabel: _,
1401
- onBack: z ? ie : void 0,
1402
- backAriaLabel: x,
1403
- backDisabled: m,
1404
- closeAriaLabel: b,
1405
- closeDisabled: m,
1406
- style: D,
1407
- overlayStyle: D,
1408
- className: R(vt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1409
- overlayClassName: vt.backdrop,
1410
- headerClassName: R("px-[22px]", vt.divider),
1411
- bodyClassName: "flex flex-col overflow-hidden",
1412
- children: [/* @__PURE__ */ B("div", {
1413
- className: R("min-h-0 flex-1 overflow-y-auto p-[22px]", vt.content),
1414
- children: /* @__PURE__ */ B(_t, {
1415
- ...g,
1416
- view: O,
1417
- destination: f,
1418
- onDestinationChange: p,
1419
- isSubmitting: m,
1420
- onChangeFolderClick: re,
1421
- changeFolderButtonRef: P,
1422
- pendingDestination: A,
1423
- onPendingDestinationChange: ne
1424
- })
1425
- }), /* @__PURE__ */ V("div", {
1426
- className: R("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", vt.footer),
1427
- children: [/* @__PURE__ */ B(v, {
1428
- label: S,
1429
- className: "mobile:flex-1",
1430
- disabled: m,
1431
- onClick: z ? ie : n
1432
- }), z ? /* @__PURE__ */ B(w, {
1433
- label: E,
1434
- className: "mobile:flex-1",
1435
- disabled: A == null,
1436
- onClick: ae
1437
- }) : /* @__PURE__ */ B(ee, {
1438
- label: m ? T : C,
1439
- className: "mobile:flex-1",
1440
- disabled: o || m,
1441
- iconBefore: m ? /* @__PURE__ */ B("span", {
1442
- "aria-hidden": !0,
1443
- children: /* @__PURE__ */ B(M, { size: l.SM })
1444
- }) : void 0,
1445
- onClick: r
1446
- })]
1447
- })]
1056
+ return /* @__PURE__ */ R(ie, {
1057
+ isOpen: t,
1058
+ onClose: r,
1059
+ returnFocusRef: s,
1060
+ onPendingDestinationChange: m,
1061
+ labels: {
1062
+ title: ne,
1063
+ changeFolderTitle: re,
1064
+ closeAriaLabel: L,
1065
+ backAriaLabel: ae,
1066
+ cancelLabel: oe,
1067
+ selectLabel: V
1068
+ },
1069
+ titleClassName: l,
1070
+ action: {
1071
+ label: se,
1072
+ busyLabel: B,
1073
+ isDisabled: o,
1074
+ onClick: i
1075
+ },
1076
+ item: {
1077
+ title: u.title,
1078
+ summary: Te
1079
+ },
1080
+ roots: d,
1081
+ destination: f,
1082
+ onDestinationChange: ye,
1083
+ onCreateFolder: ve,
1084
+ onCreateFolderError: K,
1085
+ getDisabledReason: h,
1086
+ mainSections: q,
1087
+ isSubmitting: D,
1088
+ submitError: O ?? _e,
1089
+ foldersError: ee,
1090
+ onRetryFolders: A,
1091
+ panelLabels: {
1092
+ destinationHeading: H,
1093
+ ...U
1094
+ },
1095
+ panelStyles: { folderTree: he },
1096
+ headingClassName: M,
1097
+ destinationClassName: N
1448
1098
  });
1449
1099
  };
1450
1100
  //#endregion
1451
- export { Q as PUBLISH_PANEL_CLASS, U as PublishCalloutKind, oe as PublishDependenciesAppearance, Ie as PublishDependenciesList, W as PublishDependencyType, $e as PublishFoldersTree, st as PublishFooter, Re as PublishHistoryList, nt as PublishPanel, K as PublishPanelView, _t as SaveToFolderPanel, ht as SaveToFolderView, mt as SaveVersionMode, lt as StandalonePublishPanel, yt as StandaloneSaveToFolderPanel, pt as UnpublishConfirmationDialog, Ee as VersionHistorySection, Ce as VersionHistoryStatus, _e as collectFolderKeys, se as derivePublishState, fe as filterFolderTree, ce as formatPublishedDate, ve as fromFolderPathKey, Se as getSiblingFolderNames, xe as getUniqueFolderName, ge as mergeFolderPaths, me as sortFolderTree, ye as toDialFileTree, J as toFolderPathKey, de as usePublishFlow, q as usePublishFolderView, be as validateFolderName };
1101
+ export { J as PUBLISH_PANEL_CLASS, B as PublishCalloutKind, H as PublishDependenciesAppearance, ze as PublishDependenciesList, V as PublishDependencyType, Ze as PublishFooter, Be as PublishHistoryList, Ke as PublishPanel, U as PublishPanelView, Q as SaveVersionMode, Qe as StandalonePublishPanel, rt as StandaloneSaveToFolderPanel, nt as UnpublishConfirmationDialog, ke as VersionHistorySection, Ee as VersionHistoryStatus, ve as collectFolderKeys, ce as derivePublishState, he as filterFolderTree, ue as formatPublishedDate, ye as fromFolderPathKey, Te as getSiblingFolderNames, we as getUniqueFolderName, G as mergeFolderPaths, ge as sortFolderTree, xe as toDialFileTree, K as toFolderPathKey, pe as usePublishFlow, me as usePublishFolderView, Ce as validateFolderName };