@epam/ai-dial-skill-editor 1.2.0-dev.306 → 1.2.0-dev.308

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,10 +1,10 @@
1
1
  import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as t, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, TAG_INPUT_TAG_CLASS_NAME as i, TextRefinementField as a, buildCssVars as o, formatFileSize as s, mergeClasses as c, useAvailableHeightCap as l, useTextRefinement as u } from "@epam/ai-dial-chat-shared";
2
- import { Accordion as d, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CaptionText as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, DangerIconButton as v, EditorThemes as y, ElementSize as b, ErrorText as x, FileDropzone as S, GhostButton as C, GhostIconButton as w, Input as T, Label as E, LinkButton as D, NeutralButton as O, Popup as k, PopupSize as ee, PrimaryButton as A, Select as te, Spinner as ne, TagInput as j, Textarea as M, TextareaResize as N } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
4
- import { IconArrowNarrowLeft as L, IconDatabase as re, IconFileText as ie, IconFileZip as ae, IconFolderPlus as oe, IconPhoto as se, IconPlus as ce, IconTrashX as le, IconUpload as ue } from "@tabler/icons-react";
5
- import { Suspense as de, lazy as R, memo as fe, useCallback as z, useEffect as pe, useId as me, useMemo as B, useRef as V, useState as H } from "react";
6
- import { DialFileNodeType as he, DialFoldersTree as ge } from "@epam/ai-dial-react-file-manager";
7
- import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
2
+ import { Accordion as d, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CaptionText as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, DangerIconButton as v, EditorThemes as y, ElementSize as b, ErrorText as x, FileDropzone as S, GhostButton as C, GhostIconButton as w, Input as T, Label as E, LinkButton as D, NeutralButton as O, Popup as k, PopupSize as ee, PrimaryButton as A, Select as te, Spinner as j, TagInput as M, Textarea as N, TextareaResize as P } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
4
+ import { IconArrowNarrowLeft as R, IconDatabase as ne, IconFileText as re, IconFileZip as ie, IconFolderPlus as ae, IconPhoto as oe, IconPlus as se, IconTrashX as ce, IconUpload as le } from "@tabler/icons-react";
5
+ import { Suspense as ue, lazy as z, memo as de, useCallback as B, useEffect as fe, useId as pe, useMemo as V, useRef as H, useState as U } from "react";
6
+ import { DialFileNodeType as me, DialFoldersTree as he } from "@epam/ai-dial-react-file-manager";
7
+ import { LazyMarkdownEditor as ge } from "@epam/ai-dial-ui-kit/editors";
8
8
  c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
9
9
  body: "_body_1xd7h_2",
10
10
  sideColumn: "_sideColumn_1xd7h_6",
@@ -12,54 +12,54 @@ c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
12
12
  }.sideColumn);
13
13
  //#endregion
14
14
  //#region ../builder-form/src/constants/public-class-names.ts
15
- var ve = {
15
+ var _e = {
16
16
  layout: "dial-builder-form-layout",
17
17
  section: "dial-builder-form-section",
18
18
  metadataSection: "dial-builder-form-metadata-section",
19
19
  setupSection: "dial-builder-form-setup-section"
20
- }, ye = {
20
+ }, ve = {
21
21
  section: "_section_l1mnx_1",
22
22
  title: "_title_l1mnx_5"
23
- }, be = ({ title: e, children: t, styles: n, className: r }) => {
23
+ }, ye = ({ title: e, children: t, styles: n, className: r }) => {
24
24
  let i = o({
25
25
  "--es-border-color": n?.colors?.borderColor,
26
26
  "--es-title-color": n?.colors?.titleColor
27
27
  });
28
- return /* @__PURE__ */ I("section", {
29
- className: c("flex h-full flex-col gap-4 rounded border p-6", ye.section, r, ve.section),
28
+ return /* @__PURE__ */ L("section", {
29
+ className: c("flex h-full flex-col gap-4 rounded border p-6", ve.section, r, _e.section),
30
30
  style: i,
31
- children: [e != null && /* @__PURE__ */ F("h2", {
32
- className: c("dial-h3-text", ye.title),
31
+ children: [e != null && /* @__PURE__ */ I("h2", {
32
+ className: c("dial-h3-text", ve.title),
33
33
  children: e
34
34
  }), t]
35
35
  });
36
- }, xe = {
36
+ }, be = {
37
37
  headerBorder: "_headerBorder_1kidu_1",
38
38
  footerBorder: "_footerBorder_1kidu_5",
39
39
  sidebarBorder: "_sidebarBorder_1kidu_9"
40
- }, Se = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, rightContent: a, isSaving: s = !1, labels: l, styles: u, dir: d }) => {
41
- let f = me(), p = s ? l?.savingStatusLabel ?? "Saving" : "", m = o({
40
+ }, xe = ({ title: e, onBack: t, backAriaLabel: n = "Back", actions: r, leftContent: i, rightContent: a, isSaving: s = !1, labels: l, styles: u, dir: d }) => {
41
+ let f = pe(), p = s ? l?.savingStatusLabel ?? "Saving" : "", m = o({
42
42
  "--el-header-border-color": u?.colors?.headerBorderColor,
43
43
  "--el-sidebar-border-color": u?.colors?.sidebarBorderColor
44
44
  });
45
- return /* @__PURE__ */ I("div", {
45
+ return /* @__PURE__ */ L("div", {
46
46
  dir: d,
47
- className: c("flex min-h-0 flex-1 flex-col", ve.layout),
47
+ className: c("flex min-h-0 flex-1 flex-col", _e.layout),
48
48
  style: m,
49
49
  children: [
50
- /* @__PURE__ */ F("span", {
50
+ /* @__PURE__ */ I("span", {
51
51
  role: "status",
52
52
  "aria-live": "polite",
53
53
  className: "sr-only",
54
54
  id: f,
55
55
  children: p
56
56
  }),
57
- /* @__PURE__ */ I("div", {
58
- className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", xe.headerBorder),
59
- children: [/* @__PURE__ */ I("div", {
57
+ /* @__PURE__ */ L("div", {
58
+ className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pb-3 desktop:pt-3", be.headerBorder),
59
+ children: [/* @__PURE__ */ L("div", {
60
60
  className: "flex min-w-0 flex-1 items-center gap-2",
61
- children: [/* @__PURE__ */ F(w, {
62
- icon: /* @__PURE__ */ F(L, {
61
+ children: [/* @__PURE__ */ I(w, {
62
+ icon: /* @__PURE__ */ I(R, {
63
63
  size: g.LG,
64
64
  stroke: _,
65
65
  "aria-hidden": !0,
@@ -67,64 +67,64 @@ var ve = {
67
67
  }),
68
68
  "aria-label": n,
69
69
  onClick: t
70
- }), /* @__PURE__ */ F("h1", {
70
+ }), /* @__PURE__ */ I("h1", {
71
71
  className: "dial-h2-text min-w-0 truncate",
72
72
  children: e
73
73
  })]
74
- }), r != null && /* @__PURE__ */ F("div", {
74
+ }), r != null && /* @__PURE__ */ I("div", {
75
75
  className: "hidden shrink-0 items-center gap-2 desktop:flex",
76
76
  children: r
77
77
  })]
78
78
  }),
79
- /* @__PURE__ */ I("div", {
79
+ /* @__PURE__ */ L("div", {
80
80
  className: "flex flex-1 flex-col overflow-y-auto desktop:flex-row desktop:overflow-hidden",
81
- children: [/* @__PURE__ */ F("div", {
82
- className: c(a == null ? "desktop:flex-1" : "desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", a == null ? void 0 : xe.sidebarBorder),
81
+ children: [/* @__PURE__ */ I("div", {
82
+ className: c(a == null ? "desktop:flex-1" : "desktop:w-[400px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-e", "desktop:overflow-y-auto", a == null ? void 0 : be.sidebarBorder),
83
83
  children: i
84
- }), a != null && /* @__PURE__ */ F("div", {
84
+ }), a != null && /* @__PURE__ */ I("div", {
85
85
  className: "desktop:flex desktop:min-h-0 desktop:flex-1 desktop:flex-col desktop:overflow-y-auto",
86
86
  children: a
87
87
  })]
88
88
  }),
89
- r != null && /* @__PURE__ */ F("div", {
90
- className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", xe.footerBorder),
89
+ r != null && /* @__PURE__ */ I("div", {
90
+ className: c("flex shrink-0 flex-row-reverse items-center gap-2 border-t px-4 py-2 desktop:hidden [&>*]:flex-1", be.footerBorder),
91
91
  children: r
92
92
  })
93
93
  ]
94
94
  });
95
- }, Ce = {
95
+ }, Se = {
96
96
  box: "_box_c9as8_1",
97
97
  icon: "_icon_c9as8_6",
98
98
  caption: "_caption_c9as8_10"
99
- }, we = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, styles: s, className: l }) => {
99
+ }, Ce = ({ label: e, avatarUrl: t, avatarAlt: n = "", addAvatarLabel: r = "Add avatar", captionText: i = "PNG, JPG or SVG (max 1 MB)", onAddAvatarClick: a, styles: s, className: l }) => {
100
100
  let u = o({
101
101
  "--aa-box-bg": s?.colors?.boxBackgroundColor,
102
102
  "--aa-box-border": s?.colors?.boxBorderColor,
103
103
  "--aa-icon": s?.colors?.placeholderIconColor,
104
104
  "--aa-caption": s?.colors?.captionColor
105
105
  });
106
- return /* @__PURE__ */ I("div", {
106
+ return /* @__PURE__ */ L("div", {
107
107
  className: c("flex flex-col gap-2", l),
108
108
  style: u,
109
- children: [/* @__PURE__ */ F(E, { label: e }), /* @__PURE__ */ I("div", {
109
+ children: [/* @__PURE__ */ I(E, { label: e }), /* @__PURE__ */ L("div", {
110
110
  className: "flex items-start gap-3",
111
- children: [/* @__PURE__ */ F("div", {
112
- className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Ce.box),
113
- children: t ? /* @__PURE__ */ F("img", {
111
+ children: [/* @__PURE__ */ I("div", {
112
+ className: c("flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border", Se.box),
113
+ children: t ? /* @__PURE__ */ I("img", {
114
114
  src: t,
115
115
  alt: n,
116
116
  className: "h-16 w-16 object-cover"
117
- }) : /* @__PURE__ */ F(se, {
117
+ }) : /* @__PURE__ */ I(oe, {
118
118
  size: g.LG,
119
119
  stroke: _,
120
120
  "aria-hidden": !0,
121
- className: Ce.icon
121
+ className: Se.icon
122
122
  })
123
- }), /* @__PURE__ */ I("div", {
123
+ }), /* @__PURE__ */ L("div", {
124
124
  className: "flex flex-col gap-3",
125
- children: [/* @__PURE__ */ F(C, {
125
+ children: [/* @__PURE__ */ I(C, {
126
126
  size: b.Small,
127
- iconBefore: /* @__PURE__ */ F(ce, {
127
+ iconBefore: /* @__PURE__ */ I(se, {
128
128
  size: g.SM,
129
129
  stroke: _,
130
130
  "aria-hidden": !0
@@ -132,22 +132,22 @@ var ve = {
132
132
  className: "w-fit",
133
133
  label: r,
134
134
  onClick: a
135
- }), /* @__PURE__ */ F("span", {
136
- className: c("dial-tiny-text", Ce.caption),
135
+ }), /* @__PURE__ */ I("span", {
136
+ className: c("dial-tiny-text", Se.caption),
137
137
  children: i
138
138
  })]
139
139
  })]
140
140
  })]
141
141
  });
142
- }, Te = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
143
- let c = z((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = z((e) => /* @__PURE__ */ F("div", {
142
+ }, we = ({ isOpen: e, onClose: t, onAttach: n, bucket: r, FileManagerModal: i, allowedMimeTypes: a, maxFileSizeBytes: o, labels: s }) => {
143
+ let c = B((e) => e.length === 1 ? s.deleteConfirmTitleSingle : s.deleteConfirmTitleMultiple, [s.deleteConfirmTitleSingle, s.deleteConfirmTitleMultiple]), l = B((e) => /* @__PURE__ */ I("div", {
144
144
  className: "dial-small-text px-6 py-3",
145
- children: /* @__PURE__ */ F("p", {
145
+ children: /* @__PURE__ */ I("p", {
146
146
  className: "mb-3 text-secondary",
147
- children: e.length === 1 ? /* @__PURE__ */ I(P, { children: [
147
+ children: e.length === 1 ? /* @__PURE__ */ L(F, { children: [
148
148
  s.deleteConfirmSingleText,
149
149
  " ",
150
- /* @__PURE__ */ I("span", {
150
+ /* @__PURE__ */ L("span", {
151
151
  className: "break-words text-primary",
152
152
  children: [
153
153
  "\"",
@@ -155,10 +155,10 @@ var ve = {
155
155
  "\"?"
156
156
  ]
157
157
  })
158
- ] }) : /* @__PURE__ */ I(P, { children: [
158
+ ] }) : /* @__PURE__ */ L(F, { children: [
159
159
  s.deleteConfirmMultipleText,
160
160
  " ",
161
- /* @__PURE__ */ I("span", {
161
+ /* @__PURE__ */ L("span", {
162
162
  className: "text-primary",
163
163
  children: [
164
164
  e.length,
@@ -173,9 +173,9 @@ var ve = {
173
173
  s.deleteConfirmMultipleText,
174
174
  s.deleteConfirmItemsLabel
175
175
  ]);
176
- return /* @__PURE__ */ F(de, {
176
+ return /* @__PURE__ */ I(ue, {
177
177
  fallback: null,
178
- children: e && /* @__PURE__ */ F(i, {
178
+ children: e && /* @__PURE__ */ I(i, {
179
179
  isOpen: e,
180
180
  onClose: t,
181
181
  onAttach: n,
@@ -206,105 +206,105 @@ var ve = {
206
206
  deleteCancelLabel: s.deleteCancelLabel
207
207
  })
208
208
  });
209
- }, U = /* @__PURE__ */ function(e) {
209
+ }, W = /* @__PURE__ */ function(e) {
210
210
  return e.Avatar = "avatar", e.Name = "name", e.Version = "version", e.Description = "description", e.Locales = "locales", e.Tags = "tags", e;
211
- }({}), Ee = [
211
+ }({}), Te = [
212
212
  "avatar",
213
213
  "name",
214
214
  "version",
215
215
  "description",
216
216
  "locales",
217
217
  "tags"
218
- ], W = (e, t, n) => ({
218
+ ], G = (e, t, n) => ({
219
219
  id: e,
220
220
  language: n.find((e) => !t.has(e.code))?.code ?? "",
221
221
  name: "",
222
222
  description: ""
223
- }), De = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: s = "dial-tiny-lead-text text-secondary" }) => {
224
- let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: p, addLocaleLabel: h, localeRowLabel: y = "Locale", languageLabel: x, nameLabel: S, namePlaceholder: C, descriptionLabel: w, descriptionPlaceholder: E, deleteAriaLabel: O, cancelLabel: ee = "Cancel", saveLabel: A = "Save" } = i, [ne, j] = H(!1), [P, L] = H([]), re = V(0);
225
- pe(() => {
226
- ne && L(e.length > 0 ? e : [W(`locale-row-${++re.current}`, /* @__PURE__ */ new Set(), n)]);
223
+ }), Ee = ({ value: e, onChange: t, availableLocaleOptions: n = [], labels: i, className: a, summaryClassName: o = "dial-body-text text-secondary", rowLabelClassName: s = "dial-tiny-lead-text text-secondary" }) => {
224
+ let { summaryLabel: l, addLabel: u, editLabel: d, popupTitle: p, addLocaleLabel: h, localeRowLabel: y = "Locale", languageLabel: x, nameLabel: S, namePlaceholder: C, descriptionLabel: w, descriptionPlaceholder: E, deleteAriaLabel: O, cancelLabel: ee = "Cancel", saveLabel: A = "Save" } = i, [j, M] = U(!1), [F, R] = U([]), ne = H(0);
225
+ fe(() => {
226
+ j && R(e.length > 0 ? e : [G(`locale-row-${++ne.current}`, /* @__PURE__ */ new Set(), n)]);
227
227
  }, [
228
- ne,
228
+ j,
229
229
  e,
230
230
  n
231
231
  ]);
232
- let ie = () => j(!0), ae = () => j(!1), oe = () => {
233
- t(P.filter((e) => e.language && e.name)), j(!1);
234
- }, se = () => {
235
- let e = new Set(P.map((e) => e.language).filter(Boolean));
236
- L((t) => [...t, W(`locale-row-${++re.current}`, e, n)]);
237
- }, ue = (e, t) => {
238
- L((n) => n.map((n) => n.id === e ? {
232
+ let re = () => M(!0), ie = () => M(!1), ae = () => {
233
+ t(F.filter((e) => e.language && e.name)), M(!1);
234
+ }, oe = () => {
235
+ let e = new Set(F.map((e) => e.language).filter(Boolean));
236
+ R((t) => [...t, G(`locale-row-${++ne.current}`, e, n)]);
237
+ }, le = (e, t) => {
238
+ R((n) => n.map((n) => n.id === e ? {
239
239
  ...n,
240
240
  ...t
241
241
  } : n));
242
- }, de = (e) => {
243
- L((t) => t.filter((t) => t.id !== e));
244
- }, R = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), fe = P.some((e) => !e.language || !e.name);
245
- return n.length === 0 ? null : /* @__PURE__ */ I("div", {
242
+ }, ue = (e) => {
243
+ R((t) => t.filter((t) => t.id !== e));
244
+ }, z = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), de = F.some((e) => !e.language || !e.name);
245
+ return n.length === 0 ? null : /* @__PURE__ */ L("div", {
246
246
  className: c("flex items-center gap-2", a),
247
247
  children: [
248
- e.length > 0 && /* @__PURE__ */ F("span", {
248
+ e.length > 0 && /* @__PURE__ */ I("span", {
249
249
  className: o,
250
- children: `${l}: ${e.map((e) => `[${R(e.language)}]`).join(", ")}`
250
+ children: `${l}: ${e.map((e) => `[${z(e.language)}]`).join(", ")}`
251
251
  }),
252
- /* @__PURE__ */ F(D, {
252
+ /* @__PURE__ */ I(D, {
253
253
  label: e.length > 0 ? d : u,
254
- iconBefore: /* @__PURE__ */ F(ce, {
254
+ iconBefore: /* @__PURE__ */ I(se, {
255
255
  size: g.SM,
256
256
  "aria-hidden": !0,
257
257
  stroke: _
258
258
  }),
259
259
  className: "!px-0",
260
- onClick: ie
260
+ onClick: re
261
261
  }),
262
- /* @__PURE__ */ F(k, {
263
- open: ne,
262
+ /* @__PURE__ */ I(k, {
263
+ open: j,
264
264
  header: p,
265
- onClose: ae,
265
+ onClose: ie,
266
266
  mainButtons: [{
267
267
  label: ee,
268
- onClick: ae
268
+ onClick: ie
269
269
  }, {
270
270
  label: A,
271
271
  variant: m.Primary,
272
- disabled: fe,
273
- onClick: oe
272
+ disabled: de,
273
+ onClick: ae
274
274
  }],
275
- children: /* @__PURE__ */ I("div", {
275
+ children: /* @__PURE__ */ L("div", {
276
276
  className: "flex flex-col gap-8 px-6 py-3",
277
- children: [P.map((e, t) => {
278
- let i = new Set(P.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
279
- return /* @__PURE__ */ I("div", {
277
+ children: [F.map((e, t) => {
278
+ let i = new Set(F.filter((t) => t.id !== e.id).map((e) => e.language).filter(Boolean));
279
+ return /* @__PURE__ */ L("div", {
280
280
  className: "flex flex-col gap-2",
281
- children: [/* @__PURE__ */ I("div", {
281
+ children: [/* @__PURE__ */ L("div", {
282
282
  className: "flex items-center justify-between",
283
- children: [/* @__PURE__ */ I("span", {
283
+ children: [/* @__PURE__ */ L("span", {
284
284
  className: s,
285
285
  children: [
286
286
  y,
287
287
  " ",
288
288
  t + 1
289
289
  ]
290
- }), /* @__PURE__ */ F(v, {
290
+ }), /* @__PURE__ */ I(v, {
291
291
  appearance: f.Ghost,
292
292
  size: b.Small,
293
- icon: /* @__PURE__ */ F(le, {
293
+ icon: /* @__PURE__ */ I(ce, {
294
294
  size: g.SM,
295
295
  "aria-hidden": !0,
296
296
  stroke: _
297
297
  }),
298
298
  "aria-label": `${O} ${t + 1}`,
299
- onClick: () => de(e.id)
299
+ onClick: () => ue(e.id)
300
300
  })]
301
- }), /* @__PURE__ */ I("div", {
301
+ }), /* @__PURE__ */ L("div", {
302
302
  role: "group",
303
303
  "aria-label": `${y} ${t + 1}`,
304
304
  className: "flex flex-col gap-5",
305
- children: [/* @__PURE__ */ I("div", {
305
+ children: [/* @__PURE__ */ L("div", {
306
306
  className: "flex flex-col gap-5 desktop:flex-row desktop:items-start",
307
- children: [/* @__PURE__ */ F(te, {
307
+ children: [/* @__PURE__ */ I(te, {
308
308
  id: `${e.id}-language`,
309
309
  labelProps: {
310
310
  label: x,
@@ -317,48 +317,48 @@ var ve = {
317
317
  disabled: i.has(e.code)
318
318
  })),
319
319
  value: e.language,
320
- onChange: (t) => ue(e.id, { language: t })
321
- }), /* @__PURE__ */ F(T, {
320
+ onChange: (t) => le(e.id, { language: t })
321
+ }), /* @__PURE__ */ I(T, {
322
322
  id: `${e.id}-name`,
323
323
  containerClassName: "min-w-0 flex-1",
324
324
  required: !0,
325
325
  value: e.name,
326
- onChange: (t) => ue(e.id, { name: t ?? "" }),
326
+ onChange: (t) => le(e.id, { name: t ?? "" }),
327
327
  labelProps: {
328
328
  label: S,
329
329
  required: !0
330
330
  },
331
331
  placeholder: C
332
332
  })]
333
- }), /* @__PURE__ */ F(M, {
333
+ }), /* @__PURE__ */ I(N, {
334
334
  id: `${e.id}-description`,
335
335
  className: r,
336
- resize: N.Vertical,
336
+ resize: P.Vertical,
337
337
  value: e.description,
338
- onChange: (t) => ue(e.id, { description: t }),
338
+ onChange: (t) => le(e.id, { description: t }),
339
339
  labelProps: { label: w },
340
340
  placeholder: E
341
341
  })]
342
342
  })]
343
343
  }, e.id);
344
- }), /* @__PURE__ */ F(D, {
344
+ }), /* @__PURE__ */ I(D, {
345
345
  label: h,
346
- iconBefore: /* @__PURE__ */ F(ce, {
346
+ iconBefore: /* @__PURE__ */ I(se, {
347
347
  size: g.SM,
348
348
  "aria-hidden": !0,
349
349
  stroke: _
350
350
  }),
351
351
  className: "self-start",
352
- onClick: se,
353
- disabled: P.length >= n.length
352
+ onClick: oe,
353
+ disabled: F.length >= n.length
354
354
  })]
355
355
  })
356
356
  })
357
357
  ]
358
358
  });
359
- }, Oe = "Add tags, comma separated", G = "deployment-creation-form-description", ke = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Ee, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: g = !1, renderDescription: _, focusRequestKey: v }) => {
360
- let y = V(null), b = V(null), x = V(null), S = V(!1), C = (e) => p.includes(e), w = C(U.Name), E = C(U.Version), D = !!(t.name || t.version || t.description), O = V(v);
361
- pe(() => {
359
+ }, De = "Add tags, comma separated", K = "deployment-creation-form-description", Oe = ({ values: e, errors: t, onChange: n, onNameBlur: a, onVersionBlur: o, iconPreviewUrl: s, onAddAvatarClick: l, labels: u, styles: d, availableLocaleOptions: f = [], fields: p = Te, isNameReadOnly: m = !1, nameCaption: h, isDescriptionRequired: g = !1, renderDescription: _, focusRequestKey: v }) => {
360
+ let y = H(null), b = H(null), x = H(null), S = H(!1), C = (e) => p.includes(e), w = C(W.Name), E = C(W.Version), D = !!(t.name || t.version || t.description), O = H(v);
361
+ fe(() => {
362
362
  let e = () => {
363
363
  t.name ? y.current?.focus() : t.version ? b.current?.focus() : t.description && x.current?.focus();
364
364
  };
@@ -374,8 +374,8 @@ var ve = {
374
374
  t.version,
375
375
  t.description
376
376
  ]);
377
- let k = /* @__PURE__ */ F(M, {
378
- id: G,
377
+ let k = /* @__PURE__ */ I(N, {
378
+ id: K,
379
379
  ref: x,
380
380
  value: e.description,
381
381
  onChange: (e) => n({ description: e }),
@@ -389,14 +389,14 @@ var ve = {
389
389
  invalid: !!t.description,
390
390
  containerClassName: _ ? void 0 : d?.field,
391
391
  className: r,
392
- resize: N.Vertical
392
+ resize: P.Vertical
393
393
  });
394
- return /* @__PURE__ */ I("div", {
394
+ return /* @__PURE__ */ L("div", {
395
395
  role: u.ariaLabel ? "group" : void 0,
396
396
  "aria-label": u.ariaLabel,
397
397
  className: c("flex flex-col gap-4", d?.root),
398
398
  children: [
399
- C(U.Avatar) && /* @__PURE__ */ F(we, {
399
+ C(W.Avatar) && /* @__PURE__ */ I(Ce, {
400
400
  label: u.iconUrl.label,
401
401
  avatarUrl: s,
402
402
  addAvatarLabel: u.iconUrl.addAvatarLabel,
@@ -404,9 +404,9 @@ var ve = {
404
404
  onAddAvatarClick: l,
405
405
  className: d?.field
406
406
  }),
407
- (w || E) && /* @__PURE__ */ I("div", {
407
+ (w || E) && /* @__PURE__ */ L("div", {
408
408
  className: c("flex items-start gap-4", d?.field),
409
- children: [w && /* @__PURE__ */ F(T, {
409
+ children: [w && /* @__PURE__ */ I(T, {
410
410
  id: "deployment-creation-form-name",
411
411
  inputRef: y,
412
412
  value: e.name,
@@ -422,7 +422,7 @@ var ve = {
422
422
  error: t.name || void 0,
423
423
  invalid: !!t.name,
424
424
  containerClassName: E ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
425
- }), E && /* @__PURE__ */ F(T, {
425
+ }), E && /* @__PURE__ */ I(T, {
426
426
  id: "deployment-creation-form-version",
427
427
  inputRef: b,
428
428
  value: e.version,
@@ -435,23 +435,23 @@ var ve = {
435
435
  containerClassName: w ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
436
436
  })]
437
437
  }),
438
- C(U.Description) && (_ ? /* @__PURE__ */ F("div", {
438
+ C(W.Description) && (_ ? /* @__PURE__ */ I("div", {
439
439
  className: d?.field,
440
- children: _(k, G)
440
+ children: _(k, K)
441
441
  }) : k),
442
- C(U.Locales) && /* @__PURE__ */ F(De, {
442
+ C(W.Locales) && /* @__PURE__ */ I(Ee, {
443
443
  value: e.otherLocales,
444
444
  onChange: (e) => n({ otherLocales: e }),
445
445
  availableLocaleOptions: f,
446
446
  labels: u.otherLocales,
447
447
  className: d?.field
448
448
  }),
449
- C(U.Tags) && /* @__PURE__ */ F("div", {
449
+ C(W.Tags) && /* @__PURE__ */ I("div", {
450
450
  className: d?.field,
451
- children: /* @__PURE__ */ F(j, {
451
+ children: /* @__PURE__ */ I(M, {
452
452
  id: "deployment-creation-form-topics",
453
453
  labelProps: { label: u.topics.label },
454
- placeholder: u.topics.placeholder ?? Oe,
454
+ placeholder: u.topics.placeholder ?? De,
455
455
  value: e.topics,
456
456
  onChange: (e) => n({ topics: e }),
457
457
  tagClassName: i
@@ -459,13 +459,13 @@ var ve = {
459
459
  })
460
460
  ]
461
461
  });
462
- }, Ae = "border-0 p-4 desktop:p-8", je = "desktop:flex-1", Me = "px-4 pt-4 desktop:px-6 desktop:pt-6", Ne = fe(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, alert: h, metadataSectionClassName: g, setupSectionClassName: _, labels: v, styles: y, dir: b }) => {
463
- let x = h == null ? null : /* @__PURE__ */ F("div", {
462
+ }, ke = "border-0 p-4 desktop:p-8", Ae = "desktop:flex-1", je = "px-4 pt-4 desktop:px-6 desktop:pt-6", Me = de(({ title: e, onBack: t, onCancel: n, onSubmit: r, submitLabel: i, isSubmitting: a = !1, isSubmitDisabled: o = !1, extraActions: s, hideStandardActions: l = !1, metadata: u, metadataTitle: d, metadataFooter: f, setup: p, setupTitle: m, alert: h, metadataSectionClassName: g, setupSectionClassName: _, labels: v, styles: y, dir: b }) => {
463
+ let x = h == null ? null : /* @__PURE__ */ I("div", {
464
464
  role: "alert",
465
- className: Me,
465
+ className: je,
466
466
  children: h
467
467
  }), S = p != null;
468
- return /* @__PURE__ */ F(Se, {
468
+ return /* @__PURE__ */ I(xe, {
469
469
  title: e,
470
470
  onBack: t,
471
471
  backAriaLabel: v?.backAriaLabel ?? "Back",
@@ -473,33 +473,33 @@ var ve = {
473
473
  labels: { savingStatusLabel: v?.savingStatusLabel ?? "Saving" },
474
474
  styles: y?.layout,
475
475
  dir: b,
476
- actions: /* @__PURE__ */ I(P, { children: [s, !l && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(O, {
476
+ actions: /* @__PURE__ */ L(F, { children: [s, !l && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(O, {
477
477
  label: v?.cancelLabel ?? "Cancel",
478
478
  disabled: a,
479
479
  onClick: n
480
- }), /* @__PURE__ */ F(A, {
480
+ }), /* @__PURE__ */ I(A, {
481
481
  label: i,
482
482
  disabled: a || o,
483
483
  onClick: r
484
484
  })] })] }),
485
- leftContent: /* @__PURE__ */ I(P, { children: [
485
+ leftContent: /* @__PURE__ */ L(F, { children: [
486
486
  !S && x,
487
- /* @__PURE__ */ F(be, {
487
+ /* @__PURE__ */ I(ye, {
488
488
  title: d === null ? void 0 : d ?? v?.metadataTitle ?? "Metadata",
489
489
  styles: y?.section,
490
- className: c(Ae, g, ve.metadataSection),
490
+ className: c(ke, g, _e.metadataSection),
491
491
  children: u
492
492
  }),
493
493
  f
494
494
  ] }),
495
- rightContent: S ? /* @__PURE__ */ I(P, { children: [x, /* @__PURE__ */ F(be, {
495
+ rightContent: S ? /* @__PURE__ */ L(F, { children: [x, /* @__PURE__ */ I(ye, {
496
496
  title: m === null ? void 0 : m ?? v?.setupTitle ?? "Setup",
497
497
  styles: y?.section,
498
- className: c(Ae, je, _, ve.setupSection),
498
+ className: c(ke, Ae, _, _e.setupSection),
499
499
  children: p
500
500
  })] }) : void 0
501
501
  });
502
- }), Pe = {
502
+ }), Ne = {
503
503
  name: {
504
504
  label: "Name",
505
505
  placeholder: "Enter name"
@@ -538,7 +538,7 @@ var ve = {
538
538
  saveLabel: "Save"
539
539
  },
540
540
  ariaLabel: "Metadata"
541
- }, Fe = {
541
+ }, Pe = {
542
542
  title: "Add avatar",
543
543
  attachLabel: "Attach",
544
544
  emptyTitle: "This folder is empty",
@@ -562,12 +562,12 @@ var ve = {
562
562
  deleteConfirmItemsLabel: "items?",
563
563
  deleteConfirmLabel: "Delete",
564
564
  deleteCancelLabel: "Cancel"
565
- }, Ie = fe(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Ee, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, renderDescription: d, focusRequestKey: f, labels: p }) => {
566
- let [m, h] = H(!1), g = B(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), _ = e.iconUrl, v = a?.resolveIconUrl, y = B(() => v ? v(_) : void 0, [_, v]), b = z(() => h(!0), []), x = z(() => h(!1), []), S = a?.resolveAttachedIconUrl, C = z((e) => {
565
+ }, Fe = de(({ values: e, errors: t, onChange: n, onNameBlur: r, onVersionBlur: i, avatarPicker: a, availableLocaleOptions: o, fields: s = Te, isNameReadOnly: c, nameCaption: l, isDescriptionRequired: u, renderDescription: d, focusRequestKey: f, labels: p }) => {
566
+ let [m, h] = U(!1), g = V(() => a ? s : s.filter((e) => e !== W.Avatar), [a, s]), _ = e.iconUrl, v = a?.resolveIconUrl, y = V(() => v ? v(_) : void 0, [_, v]), b = B(() => h(!0), []), x = B(() => h(!1), []), S = a?.resolveAttachedIconUrl, C = B((e) => {
567
567
  let t = S?.(e);
568
568
  t && n({ iconUrl: t }), h(!1);
569
569
  }, [n, S]);
570
- return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ke, {
570
+ return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(Oe, {
571
571
  values: e,
572
572
  errors: t,
573
573
  onChange: n,
@@ -575,7 +575,7 @@ var ve = {
575
575
  onVersionBlur: i,
576
576
  iconPreviewUrl: y,
577
577
  onAddAvatarClick: b,
578
- labels: p?.form ?? Pe,
578
+ labels: p?.form ?? Ne,
579
579
  availableLocaleOptions: o,
580
580
  fields: g,
581
581
  isNameReadOnly: c,
@@ -583,7 +583,7 @@ var ve = {
583
583
  isDescriptionRequired: u,
584
584
  renderDescription: d,
585
585
  focusRequestKey: f
586
- }), a && /* @__PURE__ */ F(Te, {
586
+ }), a && /* @__PURE__ */ I(we, {
587
587
  isOpen: m,
588
588
  onClose: x,
589
589
  onAttach: C,
@@ -591,57 +591,57 @@ var ve = {
591
591
  FileManagerModal: a.FileManagerModal,
592
592
  allowedMimeTypes: a.allowedMimeTypes,
593
593
  maxFileSizeBytes: a.maxFileSizeBytes,
594
- labels: p?.avatarPicker ?? Fe
594
+ labels: p?.avatarPicker ?? Pe
595
595
  })] });
596
- }), Le = /* @__PURE__ */ function(e) {
596
+ }), Ie = /* @__PURE__ */ function(e) {
597
597
  return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
598
598
  }({});
599
- new Set([Le.TooLong, Le.ControlCharacters]);
599
+ new Set([Ie.TooLong, Ie.ControlCharacters]);
600
600
  //#endregion
601
601
  //#region src/constants/public-class-names.ts
602
- var Re = {
602
+ var Le = {
603
603
  root: "dial-skill-editor-root",
604
604
  refineFeedback: "dial-skill-editor-refine-feedback"
605
- }, K = "SKILL.md", q = /* @__PURE__ */ function(e) {
605
+ }, q = "SKILL.md", J = /* @__PURE__ */ function(e) {
606
606
  return e.File = "file", e.Folder = "folder", e;
607
- }({}), ze = /* @__PURE__ */ function(e) {
607
+ }({}), Re = /* @__PURE__ */ function(e) {
608
608
  return e.Header = "header", e.Child = "child", e.Sibling = "sibling", e;
609
- }({}), J = (e) => {
609
+ }({}), Y = (e) => {
610
610
  let t = e.lastIndexOf("/");
611
611
  return t === -1 ? null : e.slice(0, t);
612
- }, Be = (e) => {
612
+ }, ze = (e) => {
613
613
  let t = e.lastIndexOf("/");
614
614
  return t === -1 ? e : e.slice(t + 1);
615
- }, Ve = (e) => {
615
+ }, Be = (e) => {
616
616
  let t = /* @__PURE__ */ new Map(), n = (e) => {
617
617
  let n = t.get(e);
618
618
  if (n) return n;
619
619
  let r = {
620
620
  path: e,
621
- name: Be(e),
622
- nodeType: he.FOLDER,
623
- parentPath: J(e),
621
+ name: ze(e),
622
+ nodeType: me.FOLDER,
623
+ parentPath: Y(e),
624
624
  folderId: e,
625
625
  items: []
626
626
  };
627
627
  return t.set(e, r), r;
628
628
  };
629
629
  for (let r of e) {
630
- if (r.kind === q.Folder) {
630
+ if (r.kind === J.Folder) {
631
631
  n(r.path).name = r.name;
632
632
  continue;
633
633
  }
634
634
  t.set(r.path, {
635
635
  path: r.path,
636
636
  name: r.name,
637
- nodeType: he.ITEM,
638
- parentPath: J(r.path),
639
- folderId: J(r.path) ?? ""
637
+ nodeType: me.ITEM,
638
+ parentPath: Y(r.path),
639
+ folderId: Y(r.path) ?? ""
640
640
  });
641
641
  }
642
642
  for (let t of [...e]) {
643
- let e = J(t.path);
644
- for (; e != null;) n(e), e = J(e);
643
+ let e = Y(t.path);
644
+ for (; e != null;) n(e), e = Y(e);
645
645
  }
646
646
  let r = [];
647
647
  for (let e of t.values()) {
@@ -653,14 +653,14 @@ var Re = {
653
653
  n ? n.items = [...n.items ?? [], e] : r.push(e);
654
654
  }
655
655
  return r;
656
- }, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e) => J(e) ?? "", We = (e, t) => {
656
+ }, Ve = (e, t) => e ? `${e}/${t}` : t, He = (e) => Y(e) ?? "", Ue = (e, t) => {
657
657
  if (!t) return "";
658
658
  switch (e) {
659
- case ze.Child: return t.path;
660
- case ze.Sibling: return Ue(t.path);
661
- case ze.Header: return t.kind === q.Folder ? t.path : "";
659
+ case Re.Child: return t.path;
660
+ case Re.Sibling: return He(t.path);
661
+ case Re.Header: return t.kind === J.Folder ? t.path : "";
662
662
  }
663
- }, Ge = (e, t) => {
663
+ }, We = (e, t) => {
664
664
  let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
665
665
  for (let { path: i } of e) {
666
666
  if (!i.startsWith(n) || i === t) continue;
@@ -668,29 +668,29 @@ var Re = {
668
668
  r.add(e.split("/")[0]);
669
669
  }
670
670
  return r;
671
- }, Ke = (e, t, n) => {
671
+ }, Ge = (e, t, n) => {
672
672
  let r = e.trim();
673
673
  if (!r) return n.required;
674
674
  if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
675
675
  if (t.has(r)) return n.duplicate;
676
- }, qe = "\\new-folder", Je = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
677
- let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : He(c, qe), d = B(() => u == null ? void 0 : {
676
+ }, Ke = "\\new-folder", qe = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
677
+ let [o, s] = U(null), c = o?.parentPath ?? null, l = H([]), u = c == null ? void 0 : Ve(c, Ke), d = V(() => u == null ? void 0 : {
678
678
  path: u,
679
679
  name: n,
680
- kind: q.Folder
681
- }, [u, n]), f = z((n, i) => {
682
- let a = Ge(e, i);
683
- return i === "" && a.add(K), Ke(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
680
+ kind: J.Folder
681
+ }, [u, n]), f = B((n, i) => {
682
+ let a = We(e, i);
683
+ return i === "" && a.add(q), Ge(n, a, r) ?? t.validateFolderPath?.(Ve(i, n.trim()));
684
684
  }, [
685
685
  e,
686
686
  r,
687
687
  t
688
- ]), p = z((e, t) => {
688
+ ]), p = B((e, t) => {
689
689
  l.current = [], s({
690
690
  parentPath: e,
691
691
  pane: t
692
692
  }), e !== "" && i(e);
693
- }, [i]), m = z((e, t) => {
693
+ }, [i]), m = B((e, t) => {
694
694
  if (c == null || t.path !== u) return null;
695
695
  let n = f(e, c);
696
696
  return l.current = [...l.current.slice(-1), {
@@ -701,16 +701,16 @@ var Re = {
701
701
  c,
702
702
  u,
703
703
  f
704
- ]), h = z(() => {
704
+ ]), h = B(() => {
705
705
  l.current = [], s(null);
706
- }, []), g = z((e) => {
706
+ }, []), g = B((e) => {
707
707
  if (c == null) return;
708
708
  let [n] = l.current;
709
709
  if (l.current.length === 2 && n != null && !n.isValid && n.value !== e || f(e, c) != null) {
710
710
  h();
711
711
  return;
712
712
  }
713
- let r = He(c, e.trim());
713
+ let r = Ve(c, e.trim());
714
714
  h(), t.onCreateFolder?.(r), a(r);
715
715
  }, [
716
716
  c,
@@ -728,107 +728,107 @@ var Re = {
728
728
  handleSave: g,
729
729
  handleCancel: h
730
730
  };
731
- }, Ye = (e) => !!e.dataTransfer?.types.includes("Files"), Xe = (e) => {
732
- let [t, n] = H(!1), r = V(0);
731
+ }, Je = (e) => !!e.dataTransfer?.types.includes("Files"), Ye = (e) => {
732
+ let [t, n] = U(!1), r = H(0);
733
733
  return {
734
734
  isDragActive: t,
735
735
  dropZoneHandlers: {
736
- onDragEnter: z((e) => {
737
- Ye(e) && (e.preventDefault(), r.current += 1, n(!0));
736
+ onDragEnter: B((e) => {
737
+ Je(e) && (e.preventDefault(), r.current += 1, n(!0));
738
738
  }, []),
739
- onDragLeave: z((e) => {
740
- Ye(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
739
+ onDragLeave: B((e) => {
740
+ Je(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
741
741
  }, []),
742
- onDragOver: z((e) => {
743
- Ye(e) && e.preventDefault();
742
+ onDragOver: B((e) => {
743
+ Je(e) && e.preventDefault();
744
744
  }, []),
745
- onDrop: z((t) => {
746
- if (!Ye(t)) return;
745
+ onDrop: B((t) => {
746
+ if (!Je(t)) return;
747
747
  t.preventDefault(), r.current = 0, n(!1);
748
748
  let i = Array.from(t.dataTransfer?.files ?? []);
749
749
  i.length > 0 && e(i);
750
750
  }, [e])
751
751
  }
752
752
  };
753
- }, Ze = /* @__PURE__ */ function(e) {
753
+ }, Xe = /* @__PURE__ */ function(e) {
754
754
  return e.Files = "files", e.Archive = "archive", e;
755
- }({}), Y = /* @__PURE__ */ function(e) {
755
+ }({}), X = /* @__PURE__ */ function(e) {
756
756
  return e.Mobile = "mobile", e.Desktop = "desktop", e;
757
- }({}), Qe = (e, t, n = g.MD) => /* @__PURE__ */ F(e, {
757
+ }({}), Ze = (e, t, n = g.MD) => /* @__PURE__ */ I(e, {
758
758
  size: n,
759
759
  className: t,
760
760
  "aria-hidden": !0,
761
761
  stroke: _
762
- }), $e = ({ isVisible: e, labels: t }) => {
762
+ }), Qe = ({ isVisible: e, labels: t }) => {
763
763
  if (!e) return null;
764
764
  let n = t ?? {};
765
- return /* @__PURE__ */ F("div", {
765
+ return /* @__PURE__ */ I("div", {
766
766
  role: "status",
767
767
  "aria-live": "polite",
768
768
  className: c("pointer-events-none absolute inset-0 z-[100] flex items-center justify-center backdrop-blur-sm"),
769
- children: /* @__PURE__ */ I("div", {
769
+ children: /* @__PURE__ */ L("div", {
770
770
  className: "flex flex-col items-center text-center",
771
771
  children: [
772
- /* @__PURE__ */ F(ue, {
772
+ /* @__PURE__ */ I(le, {
773
773
  size: 100,
774
774
  className: "text-accent-primary",
775
775
  "aria-hidden": !0,
776
776
  stroke: _
777
777
  }),
778
- /* @__PURE__ */ F("span", {
778
+ /* @__PURE__ */ I("span", {
779
779
  className: "dial-h3-text mt-5",
780
780
  children: n.dropOverlayTitle ?? "Upload files"
781
781
  }),
782
- /* @__PURE__ */ F("span", {
782
+ /* @__PURE__ */ I("span", {
783
783
  className: "dial-small-text mt-4",
784
784
  children: n.dropOverlaySubtitle ?? "Drop files here to add them to this skill"
785
785
  })
786
786
  ]
787
787
  })
788
788
  });
789
- }, et = /* @__PURE__ */ function(e) {
789
+ }, $e = /* @__PURE__ */ function(e) {
790
790
  return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
791
- }({}), tt = /* @__PURE__ */ function(e) {
791
+ }({}), et = /* @__PURE__ */ function(e) {
792
792
  return e.Valid = "valid", e.Invalid = "invalid", e;
793
- }({}), nt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), rt = ".zip,application/zip", X = 0, it = () => `skill-file-candidate-${++X}`, at = (e, t, n) => ({
794
- id: it(),
793
+ }({}), tt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), nt = ".zip,application/zip", Z = 0, rt = () => `skill-file-candidate-${++Z}`, it = (e, t, n) => ({
794
+ id: rt(),
795
795
  file: e,
796
- path: He(n, t.replace(/\\/g, "/"))
797
- }), ot = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Ze.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
798
- let l = c ?? {}, [u, d] = H([]), [p, h] = H(/* @__PURE__ */ new Map()), [g, v] = H([]), [y, b] = H(!1), [C, T] = H(), [E, D] = H(!1), [O, A] = H(), [te, j] = H(0), M = V(0), N = r === Ze.Archive, L = l.uploadArchiveErrorMessage ?? "Couldn't read this archive", re = me(), ae = (e) => {
796
+ path: Ve(n, t.replace(/\\/g, "/"))
797
+ }), at = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Xe.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
798
+ let l = c ?? {}, [u, d] = U([]), [p, h] = U(/* @__PURE__ */ new Map()), [g, v] = U([]), [y, b] = U(!1), [C, T] = U(), [E, D] = U(!1), [O, A] = U(), [te, M] = U(0), N = H(0), P = r === Xe.Archive, R = l.uploadArchiveErrorMessage ?? "Couldn't read this archive", ne = pe(), ie = (e) => {
799
799
  T(void 0), d((t) => [...t, ...e]);
800
- }, oe = async (e) => {
800
+ }, ae = async (e) => {
801
801
  let { extractArchive: t } = n;
802
802
  if (!t) return;
803
- let r = M.current;
804
- A(void 0), j((e) => e + 1);
803
+ let r = N.current;
804
+ A(void 0), M((e) => e + 1);
805
805
  try {
806
806
  let n = await Promise.all(e.map((e) => t(e)));
807
- if (r !== M.current) return;
807
+ if (r !== N.current) return;
808
808
  let a = n.flat();
809
809
  if (a.length === 0) {
810
810
  A(l.uploadArchiveEmptyMessage ?? "This archive has no files");
811
811
  return;
812
812
  }
813
- ae(a.map((e) => at(e.file, e.path, i)));
813
+ ie(a.map((e) => it(e.file, e.path, i)));
814
814
  } catch {
815
- if (r !== M.current) return;
816
- A(L);
815
+ if (r !== N.current) return;
816
+ A(R);
817
817
  } finally {
818
- r === M.current && j((e) => e - 1);
818
+ r === N.current && M((e) => e - 1);
819
819
  }
820
- }, se = (e) => {
821
- if (N) {
822
- oe(e);
820
+ }, oe = (e) => {
821
+ if (P) {
822
+ ae(e);
823
823
  return;
824
824
  }
825
- ae(e.map((e) => at(e, nt(e), i)));
826
- }, ce = (e) => {
825
+ ie(e.map((e) => it(e, tt(e), i)));
826
+ }, se = (e) => {
827
827
  d((t) => t.filter((t) => t.id !== e));
828
828
  };
829
- pe(() => {
830
- e && (M.current += 1, d([...(a ?? []).map((e) => at(e, nt(e), i)), ...(o ?? []).map((e) => at(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), j(0));
831
- }, [e]), pe(() => {
829
+ fe(() => {
830
+ e && (N.current += 1, d([...(a ?? []).map((e) => it(e, tt(e), i)), ...(o ?? []).map((e) => it(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), M(0));
831
+ }, [e]), fe(() => {
832
832
  if (!e) return;
833
833
  let t = !1;
834
834
  if (u.length === 0) {
@@ -843,11 +843,11 @@ var Re = {
843
843
  t = !0;
844
844
  };
845
845
  }, [u, e]);
846
- let ue = u.some((e) => p.get(e.id)?.status === tt.Invalid), de = u.length > 0 && u.every((e) => p.get(e.id)?.status === tt.Invalid), R = u.length > 0 && !ue && g.length === 0 && !y && !E && te === 0, fe = async () => {
846
+ let le = u.some((e) => p.get(e.id)?.status === et.Invalid), ue = u.length > 0 && u.every((e) => p.get(e.id)?.status === et.Invalid), z = u.length > 0 && !le && g.length === 0 && !y && !E && te === 0, de = async () => {
847
847
  D(!0), T(void 0);
848
848
  try {
849
849
  let { results: e, batchErrors: r } = await n.validateBatch(u), i = new Map(e.map((e) => [e.candidateId, e]));
850
- if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === tt.Invalid) || r.length > 0) return;
850
+ if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === et.Invalid) || r.length > 0) return;
851
851
  let a = await n.commitBatch(u);
852
852
  if (a.error) {
853
853
  T(a.error);
@@ -858,9 +858,9 @@ var Re = {
858
858
  D(!1);
859
859
  }
860
860
  };
861
- return /* @__PURE__ */ F(k, {
861
+ return /* @__PURE__ */ I(k, {
862
862
  open: e,
863
- header: N ? l.uploadArchiveDialogTitle ?? "Upload archive from device" : l.uploadDialogTitle ?? "Upload files from device",
863
+ header: P ? l.uploadArchiveDialogTitle ?? "Upload archive from device" : l.uploadDialogTitle ?? "Upload files from device",
864
864
  size: ee.Sm,
865
865
  closeAriaLabel: l.uploadDialogCloseAriaLabel ?? "Close",
866
866
  onClose: t,
@@ -872,197 +872,197 @@ var Re = {
872
872
  }, {
873
873
  label: l.uploadConfirmLabel ?? "Add",
874
874
  variant: m.Primary,
875
- iconBefore: E ? /* @__PURE__ */ F(ne, {
875
+ iconBefore: E ? /* @__PURE__ */ I(j, {
876
876
  size: 16,
877
877
  ariaLabel: ""
878
878
  }) : void 0,
879
- onClick: () => void fe(),
880
- disabled: !R
879
+ onClick: () => void de(),
880
+ disabled: !z
881
881
  }],
882
- children: /* @__PURE__ */ I("div", {
882
+ children: /* @__PURE__ */ L("div", {
883
883
  className: "flex flex-col gap-4 px-6 py-4",
884
884
  children: [
885
- /* @__PURE__ */ F(S, {
886
- label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
885
+ /* @__PURE__ */ I(S, {
886
+ label: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("span", {
887
887
  className: "desktop:hidden",
888
- children: N ? l.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : l.uploadDropZoneMobileLabel ?? "Click here to upload"
889
- }), /* @__PURE__ */ F("span", {
888
+ children: P ? l.uploadArchiveDropZoneMobileLabel ?? "Click here to upload a .zip archive" : l.uploadDropZoneMobileLabel ?? "Click here to upload"
889
+ }), /* @__PURE__ */ I("span", {
890
890
  className: "hidden desktop:inline",
891
- children: N ? l.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : l.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
891
+ children: P ? l.uploadArchiveDropZoneLabel ?? "Drag and drop a .zip archive or click here to upload" : l.uploadDropZoneLabel ?? "Drag and drop it or click here to upload"
892
892
  })] }),
893
893
  ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
894
894
  multiple: !0,
895
- accept: N ? rt : void 0,
896
- className: de ? "border-error hover:border-error" : void 0,
897
- onChange: se,
898
- onReject: N ? () => A(L) : void 0
895
+ accept: P ? nt : void 0,
896
+ className: ue ? "border-error hover:border-error" : void 0,
897
+ onChange: oe,
898
+ onReject: P ? () => A(R) : void 0
899
899
  }),
900
- te > 0 && /* @__PURE__ */ F(ne, { ariaLabel: l.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
901
- /* @__PURE__ */ F("div", {
900
+ te > 0 && /* @__PURE__ */ I(j, { ariaLabel: l.uploadArchiveExtractingAriaLabel ?? "Reading archive" }),
901
+ /* @__PURE__ */ I("div", {
902
902
  role: "alert",
903
- children: O && /* @__PURE__ */ F(x, { text: O })
903
+ children: O && /* @__PURE__ */ I(x, { text: O })
904
904
  }),
905
- /* @__PURE__ */ F("span", {
905
+ /* @__PURE__ */ I("span", {
906
906
  role: "status",
907
907
  "aria-live": "polite",
908
908
  className: "sr-only",
909
- id: re,
909
+ id: ne,
910
910
  children: g.map((e) => `${l.uploadBatchErrorAriaPrefix ?? "Upload error: "}${e}`).join(" ")
911
911
  }),
912
- g.map((e) => /* @__PURE__ */ F(x, { text: e }, e)),
913
- u.length > 0 && /* @__PURE__ */ F("ul", {
912
+ g.map((e) => /* @__PURE__ */ I(x, { text: e }, e)),
913
+ u.length > 0 && /* @__PURE__ */ I("ul", {
914
914
  className: "flex flex-col gap-2",
915
915
  children: u.map((e) => {
916
- let t = p.get(e.id), n = t?.kind === et.Manifest, r = t?.status === tt.Invalid;
917
- return /* @__PURE__ */ I("li", {
916
+ let t = p.get(e.id), n = t?.kind === $e.Manifest, r = t?.status === et.Invalid;
917
+ return /* @__PURE__ */ L("li", {
918
918
  className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
919
919
  children: [
920
- /* @__PURE__ */ F(ie, {
920
+ /* @__PURE__ */ I(re, {
921
921
  size: 20,
922
922
  "aria-hidden": !0,
923
923
  stroke: _
924
924
  }),
925
- /* @__PURE__ */ I("div", {
925
+ /* @__PURE__ */ L("div", {
926
926
  className: "flex min-w-0 flex-1 flex-col",
927
927
  children: [
928
- /* @__PURE__ */ F("span", {
928
+ /* @__PURE__ */ I("span", {
929
929
  className: "dial-small-text truncate",
930
930
  children: e.path
931
931
  }),
932
- /* @__PURE__ */ F("span", {
932
+ /* @__PURE__ */ I("span", {
933
933
  className: "dial-tiny-text text-secondary",
934
934
  children: s(e.file.size)
935
935
  }),
936
- r && t?.error && /* @__PURE__ */ F(x, { text: t.error }),
937
- n && !r && /* @__PURE__ */ F("span", {
936
+ r && t?.error && /* @__PURE__ */ I(x, { text: t.error }),
937
+ n && !r && /* @__PURE__ */ I("span", {
938
938
  className: "dial-tiny-text text-secondary",
939
939
  children: l.uploadManifestRowNote ?? "Will replace this Skill's name, description, and instructions"
940
940
  })
941
941
  ]
942
942
  }),
943
- /* @__PURE__ */ F(w, {
944
- icon: /* @__PURE__ */ F(le, {
943
+ /* @__PURE__ */ I(w, {
944
+ icon: /* @__PURE__ */ I(ce, {
945
945
  size: 16,
946
946
  "aria-hidden": !0,
947
947
  stroke: _
948
948
  }),
949
949
  "aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
950
- onClick: () => ce(e.id)
950
+ onClick: () => se(e.id)
951
951
  })
952
952
  ]
953
953
  }, e.id);
954
954
  })
955
955
  }),
956
- C && /* @__PURE__ */ F(x, { text: C })
956
+ C && /* @__PURE__ */ I(x, { text: C })
957
957
  ]
958
958
  })
959
959
  });
960
- }, st = {
960
+ }, ot = {
961
961
  title: "_title_5md1a_1",
962
962
  helperText: "_helperText_5md1a_5",
963
963
  refineFeedback: "_refineFeedback_5md1a_9",
964
964
  refineError: "_refineError_5md1a_13"
965
- }, ct = {
966
- mode: Ze.Files,
965
+ }, st = {
966
+ mode: Xe.Files,
967
967
  targetFolderPath: ""
968
- }, lt = [U.Name, U.Description], ut = 24, dt = 300, ft = "desktop:px-8 desktop:py-6", pt = "gap-4 px-4 py-6 desktop:gap-5 desktop:px-8 desktop:py-6", mt = R(async () => {
969
- let { MarkdownEditor: e } = await _e();
968
+ }, ct = [W.Name, W.Description], lt = 24, ut = 300, dt = "desktop:px-8 desktop:py-6", ft = "gap-4 px-4 py-6 desktop:gap-5 desktop:px-8 desktop:py-6", pt = z(async () => {
969
+ let { MarkdownEditor: e } = await ge();
970
970
  return { default: e };
971
- }), ht = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: v, expandedPaths: S, onExpandedPathsChange: w, isLoading: T = !1, hasLoadError: D = !1, isSubmitting: O = !1, errors: k, submitError: ee, conflict: te, onReloadLatest: j, isNameReadOnly: M = !1, onDirtyChange: N, onValuesChange: L, onRefineDescription: ie, onRefineInstructions: se, fileActions: R, supportingFileContent: fe, onSubmit: _e, onCancel: ve, onBack: ye, backAriaLabel: be, title: xe, onRetry: Se, onRetrySubmit: Ce, labels: we, styles: Te, dir: U, instructionsEditorTheme: Ee = y.light }) => {
972
- let [W, De] = H({
971
+ }), mt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: v, expandedPaths: S, onExpandedPathsChange: w, isLoading: T = !1, hasLoadError: D = !1, isSubmitting: O = !1, errors: k, submitError: ee, conflict: te, onReloadLatest: M, isNameReadOnly: N = !1, onDirtyChange: P, onValuesChange: R, onRefineDescription: re, onRefineInstructions: oe, fileActions: z, supportingFileContent: de, onSubmit: ge, onCancel: _e, onBack: ve, backAriaLabel: ye, title: be, onRetry: xe, onRetrySubmit: Se, labels: Ce, styles: we, dir: W, instructionsEditorTheme: Te = y.light }) => {
972
+ let [G, Ee] = U({
973
973
  name: r?.name ?? "",
974
974
  description: r?.description ?? "",
975
975
  instructions: r?.instructions ?? ""
976
- }), Oe = me(), G = V(void 0), ke = l({
977
- bottomGap: ut,
978
- minHeight: dt
979
- }), Ae = V(W), je = (e) => {
976
+ }), De = pe(), K = H(void 0), Oe = l({
977
+ bottomGap: lt,
978
+ minHeight: ut
979
+ }), ke = H(G), Ae = (e) => {
980
980
  let t = {
981
- ...Ae.current,
981
+ ...ke.current,
982
982
  ...e
983
983
  };
984
- Ae.current = t, De(t), L?.(t);
985
- }, Me = (e) => e ? async (t, n) => {
986
- if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
987
- G.current = n;
984
+ ke.current = t, Ee(t), R?.(t);
985
+ }, je = (e) => e ? async (t, n) => {
986
+ if (K.current && !K.current.aborted) throw new DOMException("Busy", "AbortError");
987
+ K.current = n;
988
988
  try {
989
989
  return await e(t, n);
990
990
  } finally {
991
- G.current === n && (G.current = void 0);
991
+ K.current === n && (K.current = void 0);
992
992
  }
993
- } : void 0, Fe = u({
994
- value: W.description,
995
- onChange: (e) => je({ description: e }),
996
- onRefine: Me(ie),
993
+ } : void 0, Pe = u({
994
+ value: G.description,
995
+ onChange: (e) => Ae({ description: e }),
996
+ onRefine: je(re),
997
997
  disabled: O || T || D,
998
998
  resetKey: r
999
- }), Le = u({
1000
- value: W.instructions,
1001
- onChange: (e) => je({ instructions: e }),
1002
- onRefine: Me(se),
999
+ }), Ie = u({
1000
+ value: G.instructions,
1001
+ onChange: (e) => Ae({ instructions: e }),
1002
+ onRefine: je(oe),
1003
1003
  disabled: O || T || D,
1004
1004
  resetKey: r
1005
- }), J = Fe.isPending || Le.isPending, Be = () => {
1006
- Fe.reset(), Le.reset();
1005
+ }), Y = Pe.isPending || Ie.isPending, ze = () => {
1006
+ Pe.reset(), Ie.reset();
1007
+ }, Ve = () => {
1008
+ ze(), _e();
1007
1009
  }, He = () => {
1008
- Be(), ve();
1009
- }, Ue = () => {
1010
- Be(), ye();
1011
- }, Ge = () => {
1012
- O || T || D || G.current && !G.current.aborted || _e(W);
1013
- }, Ke = V(r), qe = Ke.current !== r, Ye = V(i);
1014
- pe(() => {
1015
- Ke.current = r;
1010
+ ze(), ve();
1011
+ }, We = () => {
1012
+ O || T || D || K.current && !K.current.aborted || ge(G);
1013
+ }, Ge = H(r), Ke = Ge.current !== r, Je = H(i);
1014
+ fe(() => {
1015
+ Ge.current = r;
1016
1016
  let e = {
1017
1017
  name: r?.name ?? "",
1018
1018
  description: r?.description ?? "",
1019
1019
  instructions: r?.instructions ?? ""
1020
1020
  };
1021
- Ae.current = e, De(e), Ye.current = i;
1021
+ ke.current = e, Ee(e), Je.current = i;
1022
1022
  }, [r]);
1023
- let et = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = V(!1);
1024
- pe(() => {
1025
- if (qe) return;
1023
+ let $e = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), et = H(!1);
1024
+ fe(() => {
1025
+ if (Ke) return;
1026
1026
  let e = {
1027
1027
  name: r?.name ?? "",
1028
1028
  description: r?.description ?? "",
1029
1029
  instructions: r?.instructions ?? ""
1030
- }, t = JSON.stringify(W) !== JSON.stringify(e) || et(i) !== et(Ye.current);
1031
- t !== tt.current && (tt.current = t, N?.(t));
1030
+ }, t = JSON.stringify(G) !== JSON.stringify(e) || $e(i) !== $e(Je.current);
1031
+ t !== et.current && (et.current = t, P?.(t));
1032
1032
  }, [
1033
- W,
1033
+ G,
1034
1034
  i,
1035
1035
  r,
1036
- qe,
1037
- N
1036
+ Ke,
1037
+ P
1038
1038
  ]);
1039
- let [nt, rt] = H(K), X = s ?? nt, it = z((e) => {
1040
- rt(e), v?.(e);
1041
- }, [v]), [at, ht] = H([]), gt = S ?? at, _t = B(() => new Set(gt), [gt]), vt = z((e) => {
1039
+ let [tt, nt] = U(q), Z = s ?? tt, rt = B((e) => {
1040
+ nt(e), v?.(e);
1041
+ }, [v]), [it, mt] = U([]), ht = S ?? it, gt = V(() => new Set(ht), [ht]), _t = B((e) => {
1042
1042
  let t = [...e];
1043
- ht(t), w?.(t);
1044
- }, [w]), [yt, bt] = H(!1), [xt, St] = H(ct), Z = z((e) => {
1045
- St(e), bt(!0);
1046
- }, []), [Ct, wt] = H(!1), { isDragActive: Tt, dropZoneHandlers: Et } = Xe(z((e) => {
1047
- yt || Z({
1048
- ...ct,
1043
+ mt(t), w?.(t);
1044
+ }, [w]), [vt, yt] = U(!1), [bt, xt] = U(st), St = B((e) => {
1045
+ xt(e), yt(!0);
1046
+ }, []), [Ct, wt] = U(!1), { isDragActive: Tt, dropZoneHandlers: Et } = Ye(B((e) => {
1047
+ vt || St({
1048
+ ...st,
1049
1049
  initialFiles: e
1050
1050
  });
1051
- }, [yt, Z])), Q = we ?? {}, $ = Te?.colors, Dt = Te?.typography ?? {}, Ot = Dt.titleClassName ?? "dial-body-semi-text", kt = Dt.helperTextClassName ?? "dial-tiny-semi-text", At = Dt.removeIconClassName, jt = Dt.menuIconClassName ?? "text-secondary", Mt = o({
1051
+ }, [vt, St])), Q = Ce ?? {}, $ = we?.colors, Dt = we?.typography ?? {}, Ot = Dt.titleClassName ?? "dial-body-semi-text", kt = Dt.helperTextClassName ?? "dial-tiny-semi-text", At = Dt.removeIconClassName, jt = Dt.menuIconClassName ?? "text-secondary", Mt = o({
1052
1052
  "--se-title-color": $?.title,
1053
1053
  "--se-helper-text-color": $?.helperText,
1054
1054
  "--se-refine-action-text": $?.refineActionText,
1055
1055
  "--se-refine-error-text": $?.refineErrorText
1056
1056
  }), Nt = {
1057
- feedbackClassName: c($?.refineActionText && st.refineFeedback, Dt.refineFeedbackClassName, Re.refineFeedback),
1058
- errorClassName: st.refineError
1057
+ feedbackClassName: c($?.refineActionText && ot.refineFeedback, Dt.refineFeedbackClassName, Le.refineFeedback),
1058
+ errorClassName: ot.refineError
1059
1059
  }, Pt = {
1060
1060
  layout: $?.border ? { colors: {
1061
1061
  headerBorderColor: $.border,
1062
1062
  sidebarBorderColor: $.border
1063
1063
  } } : void 0,
1064
1064
  section: $?.title ? { colors: { titleColor: $.title } } : void 0
1065
- }, Ft = B(() => ({
1065
+ }, Ft = V(() => ({
1066
1066
  required: Q.folderNameRequiredError ?? "Enter a folder name",
1067
1067
  invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
1068
1068
  duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
@@ -1070,24 +1070,24 @@ var Re = {
1070
1070
  Q.folderNameRequiredError,
1071
1071
  Q.folderNameInvalidError,
1072
1072
  Q.folderNameDuplicateError
1073
- ]), It = z((e) => {
1074
- _t.has(e) || vt(new Set([..._t, e]));
1075
- }, [_t, vt]), Lt = Je({
1073
+ ]), It = B((e) => {
1074
+ gt.has(e) || _t(new Set([...gt, e]));
1075
+ }, [gt, _t]), Lt = qe({
1076
1076
  files: i,
1077
- fileActions: R,
1077
+ fileActions: z,
1078
1078
  defaultName: Q.newFolderDefaultName ?? "New folder",
1079
1079
  messages: Ft,
1080
1080
  onRevealFolder: It,
1081
- onCreated: it
1082
- }), { draftNode: Rt, draftPath: zt, draftPane: Bt } = Lt, Vt = B(() => Ve([{
1083
- path: K,
1084
- name: K,
1085
- kind: q.File
1086
- }, ...i]), [i]), Ht = B(() => Rt ? Ve([
1081
+ onCreated: rt
1082
+ }), { draftNode: Rt, draftPath: zt, draftPane: Bt } = Lt, Vt = V(() => Be([{
1083
+ path: q,
1084
+ name: q,
1085
+ kind: J.File
1086
+ }, ...i]), [i]), Ht = V(() => Rt ? Be([
1087
1087
  {
1088
- path: K,
1089
- name: K,
1090
- kind: q.File
1088
+ path: q,
1089
+ name: q,
1090
+ kind: J.File
1091
1091
  },
1092
1092
  ...i,
1093
1093
  Rt
@@ -1095,49 +1095,49 @@ var Re = {
1095
1095
  i,
1096
1096
  Rt,
1097
1097
  Vt
1098
- ]), Ut = B(() => i.find((e) => e.path === X), [i, X]), Wt = z((e) => {
1099
- e.path !== zt && it(e.path);
1100
- }, [it, zt]), Gt = z((e) => {
1101
- R.onRemoveNode(e), X === e && it(K);
1098
+ ]), Ut = V(() => i.find((e) => e.path === Z), [i, Z]), Wt = B((e) => {
1099
+ e.path !== zt && rt(e.path);
1100
+ }, [rt, zt]), Gt = B((e) => {
1101
+ z.onRemoveNode(e), Z === e && rt(q);
1102
1102
  }, [
1103
- R,
1104
- X,
1105
- it
1106
- ]), { startDraft: Kt } = Lt, { onCreateFolder: qt, extractArchive: Jt, pickFromFileSystem: Yt } = R, Xt = z(async (e) => {
1103
+ z,
1104
+ Z,
1105
+ rt
1106
+ ]), { startDraft: Kt } = Lt, { onCreateFolder: qt, extractArchive: Jt, pickFromFileSystem: Yt } = z, Xt = B(async (e) => {
1107
1107
  if (!Yt) return;
1108
1108
  let t = await Yt();
1109
- t?.length && Z({
1110
- mode: Ze.Files,
1109
+ t?.length && St({
1110
+ mode: Xe.Files,
1111
1111
  targetFolderPath: e,
1112
1112
  initialEntries: t
1113
1113
  });
1114
- }, [Yt, Z]), Zt = z((e, t) => {
1115
- let n = (e) => Qe(e, jt), r = [];
1114
+ }, [Yt, St]), Zt = B((e, t) => {
1115
+ let n = (e) => Ze(e, jt), r = [];
1116
1116
  return qt && r.push({
1117
1117
  key: "create-folder",
1118
1118
  label: Q.createFolderLabel ?? "Create folder",
1119
- icon: n(oe),
1119
+ icon: n(ae),
1120
1120
  onClick: () => Kt(e, t)
1121
1121
  }), r.push({
1122
1122
  key: "upload-files",
1123
1123
  label: Q.uploadFilesLabel ?? "Upload files from device",
1124
- icon: n(ue),
1125
- onClick: () => Z({
1126
- mode: Ze.Files,
1124
+ icon: n(le),
1125
+ onClick: () => St({
1126
+ mode: Xe.Files,
1127
1127
  targetFolderPath: e
1128
1128
  })
1129
1129
  }), Jt && r.push({
1130
1130
  key: "upload-archive",
1131
1131
  label: Q.uploadArchiveLabel ?? "Upload archive from device",
1132
- icon: n(ae),
1133
- onClick: () => Z({
1134
- mode: Ze.Archive,
1132
+ icon: n(ie),
1133
+ onClick: () => St({
1134
+ mode: Xe.Archive,
1135
1135
  targetFolderPath: e
1136
1136
  })
1137
1137
  }), Yt && r.push({
1138
1138
  key: "open-file-system",
1139
1139
  label: Q.openFileSystemLabel ?? "Open DIAL file system",
1140
- icon: n(re),
1140
+ icon: n(ne),
1141
1141
  onClick: () => void Xt(e)
1142
1142
  }), r;
1143
1143
  }, [
@@ -1150,81 +1150,75 @@ var Re = {
1150
1150
  Q.uploadArchiveLabel,
1151
1151
  Q.openFileSystemLabel,
1152
1152
  Kt,
1153
- Z,
1153
+ St,
1154
1154
  Xt
1155
- ]), Qt = B(() => {
1156
- let e = We(ze.Header, i.find((e) => e.path === X));
1155
+ ]), Qt = V(() => {
1156
+ let e = Ue(Re.Header, i.find((e) => e.path === Z));
1157
1157
  return {
1158
- [Y.Mobile]: Zt(e, Y.Mobile),
1159
- [Y.Desktop]: Zt(e, Y.Desktop)
1158
+ [X.Mobile]: Zt(e, X.Mobile),
1159
+ [X.Desktop]: Zt(e, X.Desktop)
1160
1160
  };
1161
1161
  }, [
1162
1162
  Zt,
1163
1163
  i,
1164
- X
1165
- ]), $t = z((e, t) => {
1164
+ Z
1165
+ ]), $t = B((e, t) => {
1166
1166
  if (e.path === "SKILL.md" || e.path === zt) return [];
1167
1167
  let n = {
1168
1168
  path: e.path,
1169
1169
  name: e.name,
1170
- kind: e.nodeType === he.FOLDER ? q.Folder : q.File
1171
- }, r = [];
1172
- return n.kind === q.Folder && r.push({
1173
- key: "add-child",
1174
- icon: Qe(ce),
1175
- label: Q.addChildLabel ?? "Add child",
1176
- children: Zt(We(ze.Child, n), t)
1177
- }), r.push({
1170
+ kind: e.nodeType === me.FOLDER ? J.Folder : J.File
1171
+ }, r = n.kind === J.Folder ? Zt(Ue(Re.Child, n), t) : [];
1172
+ return r.push({
1178
1173
  key: "add-sibling",
1179
- icon: Qe(ce),
1174
+ icon: Ze(se),
1180
1175
  label: Q.addSiblingLabel ?? "Add sibling",
1181
- children: Zt(We(ze.Sibling, n), t)
1176
+ children: Zt(Ue(Re.Sibling, n), t)
1182
1177
  }, {
1183
1178
  key: "delete",
1184
1179
  label: Q.deleteLabel ?? "Delete",
1185
1180
  danger: !0,
1186
- icon: Qe(le, At),
1181
+ icon: Ze(ce, At),
1187
1182
  onClick: () => Gt(e.path)
1188
1183
  }), r;
1189
1184
  }, [
1190
1185
  zt,
1191
- Q.addChildLabel,
1192
1186
  Q.addSiblingLabel,
1193
1187
  Q.deleteLabel,
1194
1188
  At,
1195
1189
  Zt,
1196
1190
  Gt
1197
- ]), en = B(() => ({
1198
- [Y.Mobile]: (e) => $t(e, Y.Mobile),
1199
- [Y.Desktop]: (e) => $t(e, Y.Desktop)
1200
- }), [$t]), tn = (e) => /* @__PURE__ */ I("div", {
1191
+ ]), en = V(() => ({
1192
+ [X.Mobile]: (e) => $t(e, X.Mobile),
1193
+ [X.Desktop]: (e) => $t(e, X.Desktop)
1194
+ }), [$t]), tn = (e) => /* @__PURE__ */ L("div", {
1201
1195
  className: "flex flex-col gap-2 desktop:gap-5",
1202
- children: [/* @__PURE__ */ I("div", {
1196
+ children: [/* @__PURE__ */ L("div", {
1203
1197
  className: "flex items-center justify-between",
1204
- children: [/* @__PURE__ */ F("span", {
1205
- className: c(st.title, Ot),
1198
+ children: [/* @__PURE__ */ I("span", {
1199
+ className: c(ot.title, Ot),
1206
1200
  children: Q.filesHeading ?? "Files"
1207
- }), /* @__PURE__ */ F(p, {
1201
+ }), /* @__PURE__ */ I(p, {
1208
1202
  label: Q.addLabel ?? "Add",
1209
1203
  variant: m.Neutral,
1210
1204
  appearance: f.Solid,
1211
1205
  size: b.Small,
1212
- iconBefore: /* @__PURE__ */ F(ce, {
1206
+ iconBefore: /* @__PURE__ */ I(se, {
1213
1207
  size: g.SM,
1214
1208
  "aria-hidden": !0,
1215
1209
  stroke: _
1216
1210
  }),
1217
1211
  items: Qt[e]
1218
1212
  })]
1219
- }), /* @__PURE__ */ F("div", {
1213
+ }), /* @__PURE__ */ I("div", {
1220
1214
  role: "tree",
1221
1215
  "aria-label": Q.filesTreeAriaLabel ?? "Skill files",
1222
- children: /* @__PURE__ */ F(ge, {
1216
+ children: /* @__PURE__ */ I(he, {
1223
1217
  items: Bt === e ? Ht : Vt,
1224
1218
  showFiles: !0,
1225
- selectedPath: X,
1226
- expandedPaths: _t,
1227
- onExpandedPathsChange: vt,
1219
+ selectedPath: Z,
1220
+ expandedPaths: gt,
1221
+ onExpandedPathsChange: _t,
1228
1222
  onItemClick: Wt,
1229
1223
  getContextMenuItems: en[e],
1230
1224
  renamedPath: Bt === e ? zt : void 0,
@@ -1234,18 +1228,18 @@ var Re = {
1234
1228
  rootItemPath: ""
1235
1229
  })
1236
1230
  })]
1237
- }), nn = B(() => ({
1238
- name: W.name,
1239
- description: W.description,
1231
+ }), nn = V(() => ({
1232
+ name: G.name,
1233
+ description: G.description,
1240
1234
  iconUrl: "",
1241
1235
  version: "",
1242
1236
  topics: [],
1243
1237
  otherLocales: []
1244
- }), [W.name, W.description]), rn = B(() => ({
1238
+ }), [G.name, G.description]), rn = V(() => ({
1245
1239
  name: k?.name,
1246
1240
  description: k?.description
1247
- }), [k?.name, k?.description]), an = B(() => ({ form: {
1248
- ...Pe,
1241
+ }), [k?.name, k?.description]), an = V(() => ({ form: {
1242
+ ...Ne,
1249
1243
  name: {
1250
1244
  label: Q.nameLabel ?? "Name",
1251
1245
  placeholder: Q.namePlaceholder ?? "good-morning-breakfast"
@@ -1261,173 +1255,173 @@ var Re = {
1261
1255
  Q.descriptionLabel,
1262
1256
  Q.descriptionPlaceholder
1263
1257
  ]), on = (e) => {
1264
- e.name !== void 0 && je({ name: e.name }), e.description !== void 0 && (Fe.reset(), je({ description: e.description }));
1265
- }, sn = ie ? (e, t) => /* @__PURE__ */ F(a, {
1258
+ e.name !== void 0 && Ae({ name: e.name }), e.description !== void 0 && (Pe.reset(), Ae({ description: e.description }));
1259
+ }, sn = re ? (e, t) => /* @__PURE__ */ I(a, {
1266
1260
  isEnabled: !0,
1267
1261
  fieldId: t,
1268
1262
  required: !0,
1269
1263
  label: Q.descriptionLabel ?? "Description",
1270
1264
  labels: Q,
1271
- refinement: Fe,
1272
- disabled: J || O,
1265
+ refinement: Pe,
1266
+ disabled: Y || O,
1273
1267
  ...Nt,
1274
1268
  children: e
1275
1269
  }) : void 0, cn = {
1276
- title: xe,
1277
- onBack: Ue,
1278
- onCancel: He,
1279
- onSubmit: Ge,
1270
+ title: be,
1271
+ onBack: He,
1272
+ onCancel: Ve,
1273
+ onSubmit: We,
1280
1274
  submitLabel: Q.createLabel ?? "Create",
1281
- isSubmitDisabled: J || T || D,
1275
+ isSubmitDisabled: Y || T || D,
1282
1276
  labels: {
1283
1277
  cancelLabel: Q.cancelLabel ?? "Cancel",
1284
- backAriaLabel: be ?? "Back",
1278
+ backAriaLabel: ye ?? "Back",
1285
1279
  savingStatusLabel: Q.savingStatusLabel ?? "Saving"
1286
1280
  },
1287
1281
  styles: Pt,
1288
1282
  metadataTitle: null
1289
1283
  };
1290
- if (T) return /* @__PURE__ */ F("div", {
1291
- dir: U,
1284
+ if (T) return /* @__PURE__ */ I("div", {
1285
+ dir: W,
1292
1286
  className: "relative flex min-h-0 flex-1 flex-col",
1293
- children: /* @__PURE__ */ F(Ne, {
1287
+ children: /* @__PURE__ */ I(Me, {
1294
1288
  ...cn,
1295
- metadata: /* @__PURE__ */ F("div", {
1289
+ metadata: /* @__PURE__ */ I("div", {
1296
1290
  role: "status",
1297
1291
  "aria-label": Q.loadingAriaLabel ?? "Loading skill",
1298
1292
  className: "flex flex-1 items-center justify-center p-8",
1299
- children: /* @__PURE__ */ F(ne, {})
1293
+ children: /* @__PURE__ */ I(j, {})
1300
1294
  })
1301
1295
  })
1302
1296
  });
1303
- if (D) return /* @__PURE__ */ F("div", {
1304
- dir: U,
1297
+ if (D) return /* @__PURE__ */ I("div", {
1298
+ dir: W,
1305
1299
  className: "relative flex min-h-0 flex-1 flex-col",
1306
- children: /* @__PURE__ */ F(Ne, {
1300
+ children: /* @__PURE__ */ I(Me, {
1307
1301
  ...cn,
1308
- metadata: /* @__PURE__ */ I("div", {
1302
+ metadata: /* @__PURE__ */ L("div", {
1309
1303
  role: "alert",
1310
1304
  className: "flex flex-col items-center gap-4 p-8",
1311
- children: [/* @__PURE__ */ F(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ F(A, {
1305
+ children: [/* @__PURE__ */ I(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ I(A, {
1312
1306
  label: Q.retryLabel ?? "Retry",
1313
- onClick: Se
1307
+ onClick: xe
1314
1308
  })]
1315
1309
  })
1316
1310
  })
1317
1311
  });
1318
- let ln = X === K, un = ln ? K : Q.selectedFileHeading?.(Ut?.name ?? X) ?? Ut?.name ?? X, dn = ee != null || te != null ? /* @__PURE__ */ I("div", {
1312
+ let ln = Z === q, un = ln ? q : Q.selectedFileHeading?.(Ut?.name ?? Z) ?? Ut?.name ?? Z, dn = ee != null || te != null ? /* @__PURE__ */ L("div", {
1319
1313
  className: "flex flex-col gap-2",
1320
- children: [ee != null && /* @__PURE__ */ I("div", {
1314
+ children: [ee != null && /* @__PURE__ */ L("div", {
1321
1315
  className: "flex items-center gap-2",
1322
- children: [/* @__PURE__ */ F(x, { text: ee }), Ce != null && /* @__PURE__ */ F(C, {
1316
+ children: [/* @__PURE__ */ I(x, { text: ee }), Se != null && /* @__PURE__ */ I(C, {
1323
1317
  label: Q.retryLabel ?? "Retry",
1324
- onClick: Ce
1318
+ onClick: Se
1325
1319
  })]
1326
- }), te != null && /* @__PURE__ */ I("div", {
1320
+ }), te != null && /* @__PURE__ */ L("div", {
1327
1321
  className: "flex items-center gap-2",
1328
- children: [/* @__PURE__ */ F(x, { text: te.message }), /* @__PURE__ */ F(C, {
1322
+ children: [/* @__PURE__ */ I(x, { text: te.message }), /* @__PURE__ */ I(C, {
1329
1323
  label: Q.reloadLatestLabel ?? "Reload latest",
1330
- onClick: j
1324
+ onClick: M
1331
1325
  })]
1332
1326
  })]
1333
- }) : void 0, fn = /* @__PURE__ */ F(a, {
1334
- isEnabled: !!se,
1335
- fieldId: Oe,
1327
+ }) : void 0, fn = /* @__PURE__ */ I(a, {
1328
+ isEnabled: !!oe,
1329
+ fieldId: De,
1336
1330
  required: !0,
1337
- labelClassName: c(st.helperText, kt),
1331
+ labelClassName: c(ot.helperText, kt),
1338
1332
  label: Q.instructionsLabel ?? "Instructions",
1339
1333
  labels: Q,
1340
- refinement: Le,
1341
- disabled: J || O,
1334
+ refinement: Ie,
1335
+ disabled: Y || O,
1342
1336
  ...Nt,
1343
- children: /* @__PURE__ */ I("div", {
1337
+ children: /* @__PURE__ */ L("div", {
1344
1338
  className: "flex flex-1 flex-col gap-2",
1345
1339
  children: [
1346
- !se && /* @__PURE__ */ F(E, {
1347
- htmlFor: Oe,
1348
- className: c(st.helperText, kt),
1340
+ !oe && /* @__PURE__ */ I(E, {
1341
+ htmlFor: De,
1342
+ className: c(ot.helperText, kt),
1349
1343
  label: Q.instructionsLabel ?? "Instructions",
1350
1344
  required: !0
1351
1345
  }),
1352
- /* @__PURE__ */ F("div", {
1353
- ref: ke,
1346
+ /* @__PURE__ */ I("div", {
1347
+ ref: Oe,
1354
1348
  className: c(t, e, n),
1355
- children: /* @__PURE__ */ F(de, {
1356
- fallback: /* @__PURE__ */ F(ne, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
1357
- children: /* @__PURE__ */ F(mt, {
1358
- id: Oe,
1349
+ children: /* @__PURE__ */ I(ue, {
1350
+ fallback: /* @__PURE__ */ I(j, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
1351
+ children: /* @__PURE__ */ I(pt, {
1352
+ id: De,
1359
1353
  ariaLabel: Q.instructionsLabel ?? "Instructions",
1360
- value: W.instructions,
1354
+ value: G.instructions,
1361
1355
  onChange: (e) => {
1362
- Le.reset(), je({ instructions: e });
1356
+ Ie.reset(), Ae({ instructions: e });
1363
1357
  },
1364
- theme: Ee,
1358
+ theme: Te,
1365
1359
  placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
1366
1360
  })
1367
1361
  })
1368
1362
  }),
1369
- k?.instructions != null && /* @__PURE__ */ F(x, { text: k.instructions })
1363
+ k?.instructions != null && /* @__PURE__ */ I(x, { text: k.instructions })
1370
1364
  ]
1371
1365
  })
1372
1366
  });
1373
- return /* @__PURE__ */ I("div", {
1374
- dir: U,
1375
- className: c("relative flex min-h-0 flex-1 flex-col", Re.root),
1367
+ return /* @__PURE__ */ L("div", {
1368
+ dir: W,
1369
+ className: c("relative flex min-h-0 flex-1 flex-col", Le.root),
1376
1370
  style: Mt,
1377
1371
  ...Et,
1378
1372
  children: [
1379
- /* @__PURE__ */ F($e, {
1380
- isVisible: Tt && !yt,
1381
- labels: we
1373
+ /* @__PURE__ */ I(Qe, {
1374
+ isVisible: Tt && !vt,
1375
+ labels: Ce
1382
1376
  }),
1383
- /* @__PURE__ */ F(Ne, {
1377
+ /* @__PURE__ */ I(Me, {
1384
1378
  ...cn,
1385
1379
  isSubmitting: O,
1386
- metadataSectionClassName: ft,
1387
- metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
1380
+ metadataSectionClassName: dt,
1381
+ metadata: /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
1388
1382
  className: "desktop:hidden",
1389
- children: /* @__PURE__ */ F(d, {
1383
+ children: /* @__PURE__ */ I(d, {
1390
1384
  title: Q.editingFileLabel ?? "Editing file",
1391
1385
  description: Ut?.name ?? "SKILL.md",
1392
1386
  expanded: Ct,
1393
1387
  onToggle: wt,
1394
1388
  ariaLabel: Q.editingFileLabel ?? "Editing file",
1395
- children: tn(Y.Mobile)
1389
+ children: tn(X.Mobile)
1396
1390
  })
1397
- }), /* @__PURE__ */ F("div", {
1391
+ }), /* @__PURE__ */ I("div", {
1398
1392
  className: "hidden desktop:block",
1399
- children: tn(Y.Desktop)
1393
+ children: tn(X.Desktop)
1400
1394
  })] }),
1401
1395
  alert: dn,
1402
1396
  setupTitle: un,
1403
- setupSectionClassName: pt,
1404
- setup: ln ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
1397
+ setupSectionClassName: ft,
1398
+ setup: ln ? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(Fe, {
1405
1399
  values: nn,
1406
1400
  errors: rn,
1407
1401
  onChange: on,
1408
- fields: lt,
1402
+ fields: ct,
1409
1403
  isDescriptionRequired: !0,
1410
- isNameReadOnly: M,
1404
+ isNameReadOnly: N,
1411
1405
  nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
1412
1406
  renderDescription: sn,
1413
1407
  labels: an
1414
- }), fn] }) : /* @__PURE__ */ F(P, { children: Ut?.kind === q.File && /* @__PURE__ */ F("div", {
1408
+ }), fn] }) : /* @__PURE__ */ I(F, { children: Ut?.kind === J.File && /* @__PURE__ */ I("div", {
1415
1409
  className: "flex min-h-0 flex-1 flex-col",
1416
- children: fe ?? /* @__PURE__ */ F(h, { text: Q.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
1410
+ children: de ?? /* @__PURE__ */ I(h, { text: Q.supportingFileNote ?? "This supporting file is included in the skill package as-is. Remove it from the Files panel to replace its content." })
1417
1411
  }) })
1418
1412
  }),
1419
- /* @__PURE__ */ F(ot, {
1420
- isOpen: yt,
1421
- onClose: () => bt(!1),
1422
- fileActions: R,
1423
- mode: xt.mode,
1424
- targetFolderPath: xt.targetFolderPath,
1425
- initialFiles: xt.initialFiles,
1426
- initialEntries: xt.initialEntries,
1427
- labels: we
1413
+ /* @__PURE__ */ I(at, {
1414
+ isOpen: vt,
1415
+ onClose: () => yt(!1),
1416
+ fileActions: z,
1417
+ mode: bt.mode,
1418
+ targetFolderPath: bt.targetFolderPath,
1419
+ initialFiles: bt.initialFiles,
1420
+ initialEntries: bt.initialEntries,
1421
+ labels: Ce
1428
1422
  })
1429
1423
  ]
1430
1424
  });
1431
1425
  };
1432
1426
  //#endregion
1433
- export { Re as SKILL_EDITOR_CLASS, ht as SkillEditor, et as SkillFileCandidateKind, q as SkillFileNodeKind, Ze as SkillFileUploadMode, tt as SkillFileValidationStatus };
1427
+ export { Le as SKILL_EDITOR_CLASS, mt as SkillEditor, $e as SkillFileCandidateKind, J as SkillFileNodeKind, Xe as SkillFileUploadMode, et as SkillFileValidationStatus };