@epam/ai-dial-skill-editor 1.2.5 → 1.3.0-dev.102

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,8 +1,8 @@
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
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
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";
4
+ import { IconArrowNarrowLeft as L, IconDatabase as re, IconFileText as ie, IconFileZip as ae, IconFolderPlus as oe, IconPhoto as se, IconPlus as R, IconTrashX as ce, IconUpload as le } from "@tabler/icons-react";
5
+ import { Suspense as ue, lazy as de, memo as fe, useCallback as z, useEffect as pe, useId as me, useMemo as B, useRef as V, useState as H } from "react";
6
6
  import { DialFileNodeType as he, DialFoldersTree as ge } from "@epam/ai-dial-react-file-manager";
7
7
  import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
8
8
  c("flex flex-col desktop:min-h-0 desktop:overflow-y-auto", {
@@ -56,7 +56,7 @@ var ve = {
56
56
  children: m
57
57
  }),
58
58
  /* @__PURE__ */ I("div", {
59
- 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
+ className: c("flex items-center justify-between gap-2 border-b px-4 py-2 desktop:px-8 desktop:pt-3 desktop:pb-3", xe.headerBorder),
60
60
  children: [/* @__PURE__ */ I("div", {
61
61
  className: "flex min-w-0 flex-1 items-center gap-2",
62
62
  children: [/* @__PURE__ */ F(w, {
@@ -132,7 +132,7 @@ var ve = {
132
132
  className: "flex flex-col gap-3",
133
133
  children: [/* @__PURE__ */ F(C, {
134
134
  size: b.Small,
135
- iconBefore: /* @__PURE__ */ F(ce, {
135
+ iconBefore: /* @__PURE__ */ F(R, {
136
136
  size: g.SM,
137
137
  stroke: _,
138
138
  "aria-hidden": !0
@@ -156,7 +156,7 @@ var ve = {
156
156
  s.deleteConfirmSingleText,
157
157
  " ",
158
158
  /* @__PURE__ */ I("span", {
159
- className: "break-words text-primary",
159
+ className: "wrap-break-word text-primary",
160
160
  children: [
161
161
  "\"",
162
162
  e[0].split("/").pop(),
@@ -181,7 +181,7 @@ var ve = {
181
181
  s.deleteConfirmMultipleText,
182
182
  s.deleteConfirmItemsLabel
183
183
  ]);
184
- return /* @__PURE__ */ F(de, {
184
+ return /* @__PURE__ */ F(ue, {
185
185
  fallback: null,
186
186
  children: e && /* @__PURE__ */ F(i, {
187
187
  isOpen: e,
@@ -223,15 +223,15 @@ var ve = {
223
223
  "description",
224
224
  "locales",
225
225
  "tags"
226
- ], De = (e, t, n) => ({
226
+ ], W = (e, t, n) => ({
227
227
  id: e,
228
228
  language: n.find((e) => !t.has(e.code))?.code ?? "",
229
229
  name: "",
230
230
  description: ""
231
- }), W = ({ 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" }) => {
231
+ }), 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" }) => {
232
232
  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);
233
233
  pe(() => {
234
- ne && L(e.length > 0 ? e : [De(`locale-row-${++re.current}`, /* @__PURE__ */ new Set(), n)]);
234
+ ne && L(e.length > 0 ? e : [W(`locale-row-${++re.current}`, /* @__PURE__ */ new Set(), n)]);
235
235
  }, [
236
236
  ne,
237
237
  e,
@@ -241,30 +241,30 @@ var ve = {
241
241
  t(P.filter((e) => e.language && e.name)), j(!1);
242
242
  }, se = () => {
243
243
  let e = new Set(P.map((e) => e.language).filter(Boolean));
244
- L((t) => [...t, De(`locale-row-${++re.current}`, e, n)]);
245
- }, ue = (e, t) => {
244
+ L((t) => [...t, W(`locale-row-${++re.current}`, e, n)]);
245
+ }, le = (e, t) => {
246
246
  L((n) => n.map((n) => n.id === e ? {
247
247
  ...n,
248
248
  ...t
249
249
  } : n));
250
- }, de = (e) => {
250
+ }, ue = (e) => {
251
251
  L((t) => t.filter((t) => t.id !== e));
252
- }, R = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), fe = P.some((e) => !e.language || !e.name);
252
+ }, de = (e) => n.find((t) => t.code === e)?.label ?? e.toUpperCase(), fe = P.some((e) => !e.language || !e.name);
253
253
  return n.length === 0 ? null : /* @__PURE__ */ I("div", {
254
254
  className: c("flex items-center gap-2", a),
255
255
  children: [
256
256
  e.length > 0 && /* @__PURE__ */ F("span", {
257
257
  className: o,
258
- children: `${l}: ${e.map((e) => `[${R(e.language)}]`).join(", ")}`
258
+ children: `${l}: ${e.map((e) => `[${de(e.language)}]`).join(", ")}`
259
259
  }),
260
260
  /* @__PURE__ */ F(D, {
261
261
  label: e.length > 0 ? d : u,
262
- iconBefore: /* @__PURE__ */ F(ce, {
262
+ iconBefore: /* @__PURE__ */ F(R, {
263
263
  size: g.SM,
264
264
  "aria-hidden": !0,
265
265
  stroke: _
266
266
  }),
267
- className: "!px-0",
267
+ className: "px-0!",
268
268
  onClick: ie
269
269
  }),
270
270
  /* @__PURE__ */ F(k, {
@@ -298,13 +298,13 @@ var ve = {
298
298
  }), /* @__PURE__ */ F(v, {
299
299
  appearance: f.Ghost,
300
300
  size: b.Small,
301
- icon: /* @__PURE__ */ F(le, {
301
+ icon: /* @__PURE__ */ F(ce, {
302
302
  size: g.SM,
303
303
  "aria-hidden": !0,
304
304
  stroke: _
305
305
  }),
306
306
  "aria-label": `${O} ${t + 1}`,
307
- onClick: () => de(e.id)
307
+ onClick: () => ue(e.id)
308
308
  })]
309
309
  }), /* @__PURE__ */ I("div", {
310
310
  role: "group",
@@ -325,13 +325,13 @@ var ve = {
325
325
  disabled: i.has(e.code)
326
326
  })),
327
327
  value: e.language,
328
- onChange: (t) => ue(e.id, { language: t })
328
+ onChange: (t) => le(e.id, { language: t })
329
329
  }), /* @__PURE__ */ F(T, {
330
330
  id: `${e.id}-name`,
331
331
  containerClassName: "min-w-0 flex-1",
332
332
  required: !0,
333
333
  value: e.name,
334
- onChange: (t) => ue(e.id, { name: t ?? "" }),
334
+ onChange: (t) => le(e.id, { name: t ?? "" }),
335
335
  labelProps: {
336
336
  label: S,
337
337
  required: !0
@@ -343,7 +343,7 @@ var ve = {
343
343
  className: r,
344
344
  resize: N.Vertical,
345
345
  value: e.description,
346
- onChange: (t) => ue(e.id, { description: t }),
346
+ onChange: (t) => le(e.id, { description: t }),
347
347
  labelProps: { label: w },
348
348
  placeholder: E
349
349
  })]
@@ -351,7 +351,7 @@ var ve = {
351
351
  }, e.id);
352
352
  }), /* @__PURE__ */ F(D, {
353
353
  label: h,
354
- iconBefore: /* @__PURE__ */ F(ce, {
354
+ iconBefore: /* @__PURE__ */ F(R, {
355
355
  size: g.SM,
356
356
  "aria-hidden": !0,
357
357
  stroke: _
@@ -364,40 +364,39 @@ var ve = {
364
364
  })
365
365
  ]
366
366
  });
367
- }, Oe = "Add tags, comma separated", ke = "deployment-creation-form-description", G = ({ 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, descriptionMaxLength: _, descriptionCaption: v, renderDescription: y, focusRequestKey: b }) => {
368
- let x = V(null), S = V(null), C = V(null), w = V(!1), E = (e) => p.includes(e), D = E(U.Name), O = E(U.Version), k = !!(t.name || t.version || t.description), ee = V(b);
367
+ }, 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, descriptionCaption: _, renderDescription: v, focusRequestKey: y }) => {
368
+ let b = V(null), x = V(null), S = V(null), C = V(!1), w = (e) => p.includes(e), E = w(U.Name), D = w(U.Version), O = !!(t.name || t.version || t.description), k = V(y);
369
369
  pe(() => {
370
370
  let e = () => {
371
- t.name ? x.current?.focus() : t.version ? S.current?.focus() : t.description && C.current?.focus();
371
+ t.name ? b.current?.focus() : t.version ? x.current?.focus() : t.description && S.current?.focus();
372
372
  };
373
- if (b !== void 0) {
374
- b !== ee.current && (ee.current = b, e());
373
+ if (y !== void 0) {
374
+ y !== k.current && (k.current = y, e());
375
375
  return;
376
376
  }
377
- k && !w.current && e(), w.current = k;
377
+ O && !C.current && e(), C.current = O;
378
378
  }, [
379
- b,
380
- k,
379
+ y,
380
+ O,
381
381
  t.name,
382
382
  t.version,
383
383
  t.description
384
384
  ]);
385
- let A = /* @__PURE__ */ F(M, {
386
- id: ke,
387
- ref: C,
385
+ let ee = /* @__PURE__ */ F(M, {
386
+ id: G,
387
+ ref: S,
388
388
  value: e.description,
389
389
  onChange: (e) => n({ description: e }),
390
390
  "aria-required": g || void 0,
391
- labelProps: y ? void 0 : {
391
+ labelProps: v ? void 0 : {
392
392
  label: u.description.label,
393
393
  required: g
394
394
  },
395
395
  placeholder: u.description.placeholder,
396
- maxLength: _,
397
- caption: v,
396
+ caption: _,
398
397
  error: t.description || void 0,
399
398
  invalid: !!t.description,
400
- containerClassName: y ? void 0 : d?.field,
399
+ containerClassName: v ? void 0 : d?.field,
401
400
  className: r,
402
401
  resize: N.Vertical
403
402
  });
@@ -406,7 +405,7 @@ var ve = {
406
405
  "aria-label": u.ariaLabel,
407
406
  className: c("flex flex-col gap-4", d?.root),
408
407
  children: [
409
- E(U.Avatar) && /* @__PURE__ */ F(we, {
408
+ w(U.Avatar) && /* @__PURE__ */ F(we, {
410
409
  label: u.iconUrl.label,
411
410
  avatarUrl: s,
412
411
  addAvatarLabel: u.iconUrl.addAvatarLabel,
@@ -414,11 +413,11 @@ var ve = {
414
413
  onAddAvatarClick: l,
415
414
  className: d?.field
416
415
  }),
417
- (D || O) && /* @__PURE__ */ I("div", {
416
+ (E || D) && /* @__PURE__ */ I("div", {
418
417
  className: c("flex items-start gap-4", d?.field),
419
- children: [D && /* @__PURE__ */ F(T, {
418
+ children: [E && /* @__PURE__ */ F(T, {
420
419
  id: "deployment-creation-form-name",
421
- inputRef: x,
420
+ inputRef: b,
422
421
  value: e.name,
423
422
  onChange: (e) => n({ name: e ?? "" }),
424
423
  onBlur: a,
@@ -431,10 +430,10 @@ var ve = {
431
430
  caption: h,
432
431
  error: t.name || void 0,
433
432
  invalid: !!t.name,
434
- containerClassName: O ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
435
- }), O && /* @__PURE__ */ F(T, {
433
+ containerClassName: D ? "min-w-0 basis-0 grow-[2]" : "min-w-0 flex-1"
434
+ }), D && /* @__PURE__ */ F(T, {
436
435
  id: "deployment-creation-form-version",
437
- inputRef: S,
436
+ inputRef: x,
438
437
  value: e.version,
439
438
  onChange: (e) => n({ version: e ?? "" }),
440
439
  onBlur: o,
@@ -442,21 +441,21 @@ var ve = {
442
441
  placeholder: u.version.placeholder,
443
442
  error: t.version || void 0,
444
443
  invalid: !!t.version,
445
- containerClassName: D ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
444
+ containerClassName: E ? "min-w-0 basis-0 grow-[1]" : "min-w-0 flex-1"
446
445
  })]
447
446
  }),
448
- E(U.Description) && (y ? /* @__PURE__ */ F("div", {
447
+ w(U.Description) && (v ? /* @__PURE__ */ F("div", {
449
448
  className: d?.field,
450
- children: y(A, ke)
451
- }) : A),
452
- E(U.Locales) && /* @__PURE__ */ F(W, {
449
+ children: v(ee, G)
450
+ }) : ee),
451
+ w(U.Locales) && /* @__PURE__ */ F(De, {
453
452
  value: e.otherLocales,
454
453
  onChange: (e) => n({ otherLocales: e }),
455
454
  availableLocaleOptions: f,
456
455
  labels: u.otherLocales,
457
456
  className: d?.field
458
457
  }),
459
- E(U.Tags) && /* @__PURE__ */ F("div", {
458
+ w(U.Tags) && /* @__PURE__ */ F("div", {
460
459
  className: d?.field,
461
460
  children: /* @__PURE__ */ F(j, {
462
461
  id: "deployment-creation-form-topics",
@@ -578,38 +577,37 @@ var ve = {
578
577
  deleteConfirmItemsLabel: "items?",
579
578
  deleteConfirmLabel: "Delete",
580
579
  deleteCancelLabel: "Cancel"
581
- }, 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, descriptionMaxLength: d, descriptionCaption: f, renderDescription: p, focusRequestKey: m, labels: h }) => {
582
- let [g, _] = H(!1), v = B(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), y = e.iconUrl, b = a?.resolveIconUrl, x = B(() => b ? b(y) : void 0, [y, b]), S = z(() => _(!0), []), C = z(() => _(!1), []), w = a?.resolveAttachedIconUrl, T = z((e) => {
583
- let t = w?.(e);
584
- t && n({ iconUrl: t }), _(!1);
585
- }, [n, w]);
586
- return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(G, {
580
+ }, 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, descriptionCaption: d, renderDescription: f, focusRequestKey: p, labels: m }) => {
581
+ let [h, g] = H(!1), _ = B(() => a ? s : s.filter((e) => e !== U.Avatar), [a, s]), v = e.iconUrl, y = a?.resolveIconUrl, b = B(() => y ? y(v) : void 0, [v, y]), x = z(() => g(!0), []), S = z(() => g(!1), []), C = a?.resolveAttachedIconUrl, w = z((e) => {
582
+ let t = C?.(e);
583
+ t && n({ iconUrl: t }), g(!1);
584
+ }, [n, C]);
585
+ return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(ke, {
587
586
  values: e,
588
587
  errors: t,
589
588
  onChange: n,
590
589
  onNameBlur: r,
591
590
  onVersionBlur: i,
592
- iconPreviewUrl: x,
593
- onAddAvatarClick: S,
594
- labels: h?.form ?? Pe,
591
+ iconPreviewUrl: b,
592
+ onAddAvatarClick: x,
593
+ labels: m?.form ?? Pe,
595
594
  availableLocaleOptions: o,
596
- fields: v,
595
+ fields: _,
597
596
  isNameReadOnly: c,
598
597
  nameCaption: l,
599
598
  isDescriptionRequired: u,
600
- descriptionMaxLength: d,
601
- descriptionCaption: f,
602
- renderDescription: p,
603
- focusRequestKey: m
599
+ descriptionCaption: d,
600
+ renderDescription: f,
601
+ focusRequestKey: p
604
602
  }), a && /* @__PURE__ */ F(Te, {
605
- isOpen: g,
606
- onClose: C,
607
- onAttach: T,
603
+ isOpen: h,
604
+ onClose: S,
605
+ onAttach: w,
608
606
  bucket: a.bucket,
609
607
  FileManagerModal: a.FileManagerModal,
610
608
  allowedMimeTypes: a.allowedMimeTypes,
611
609
  maxFileSizeBytes: a.maxFileSizeBytes,
612
- labels: h?.avatarPicker ?? Fe
610
+ labels: m?.avatarPicker ?? Fe
613
611
  })] });
614
612
  }), Le = /* @__PURE__ */ function(e) {
615
613
  return e.Required = "required", e.InvalidFormat = "invalid-format", e.TooLong = "too-long", e.ControlCharacters = "control-characters", e;
@@ -623,7 +621,7 @@ var Re = {
623
621
  }, K = "SKILL.md", q = /* @__PURE__ */ function(e) {
624
622
  return e.File = "file", e.Folder = "folder", e;
625
623
  }({}), ze = /* @__PURE__ */ function(e) {
626
- return e.Header = "header", e.Child = "child", e.Sibling = "sibling", e;
624
+ return e.Header = "header", e.Child = "child", e;
627
625
  }({}), J = (e) => {
628
626
  let t = e.lastIndexOf("/");
629
627
  return t === -1 ? null : e.slice(0, t);
@@ -671,14 +669,13 @@ var Re = {
671
669
  n ? n.items = [...n.items ?? [], e] : r.push(e);
672
670
  }
673
671
  return r;
674
- }, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e) => J(e) ?? "", We = (e, t) => {
672
+ }, He = (e, t) => e ? `${e}/${t}` : t, Ue = (e, t) => {
675
673
  if (!t) return "";
676
674
  switch (e) {
677
675
  case ze.Child: return t.path;
678
- case ze.Sibling: return Ue(t.path);
679
676
  case ze.Header: return t.kind === q.Folder ? t.path : "";
680
677
  }
681
- }, Ge = (e, t) => {
678
+ }, We = (e, t) => {
682
679
  let n = t ? `${t}/` : "", r = /* @__PURE__ */ new Set();
683
680
  for (let { path: i } of e) {
684
681
  if (!i.startsWith(n) || i === t) continue;
@@ -686,19 +683,19 @@ var Re = {
686
683
  r.add(e.split("/")[0]);
687
684
  }
688
685
  return r;
689
- }, Ke = (e, t, n) => {
686
+ }, Ge = (e, t, n) => {
690
687
  let r = e.trim();
691
688
  if (!r) return n.required;
692
689
  if (/[/\\]/.test(r) || r === "." || r === "..") return n.invalid;
693
690
  if (t.has(r)) return n.duplicate;
694
- }, qe = "\\new-folder", Je = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
695
- 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 : {
691
+ }, Ke = "\\new-folder", qe = ({ files: e, fileActions: t, defaultName: n, messages: r, onRevealFolder: i, onCreated: a }) => {
692
+ let [o, s] = H(null), c = o?.parentPath ?? null, l = V([]), u = c == null ? void 0 : He(c, Ke), d = B(() => u == null ? void 0 : {
696
693
  path: u,
697
694
  name: n,
698
695
  kind: q.Folder
699
696
  }, [u, n]), f = z((n, i) => {
700
- let a = Ge(e, i);
701
- return i === "" && a.add(K), Ke(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
697
+ let a = We(e, i);
698
+ return i === "" && a.add(K), Ge(n, a, r) ?? t.validateFolderPath?.(He(i, n.trim()));
702
699
  }, [
703
700
  e,
704
701
  r,
@@ -746,38 +743,38 @@ var Re = {
746
743
  handleSave: g,
747
744
  handleCancel: h
748
745
  };
749
- }, Ye = (e) => !!e.dataTransfer?.types.includes("Files"), Xe = (e) => {
746
+ }, Je = (e) => !!e.dataTransfer?.types.includes("Files"), Ye = (e) => {
750
747
  let [t, n] = H(!1), r = V(0);
751
748
  return {
752
749
  isDragActive: t,
753
750
  dropZoneHandlers: {
754
751
  onDragEnter: z((e) => {
755
- Ye(e) && (e.preventDefault(), r.current += 1, n(!0));
752
+ Je(e) && (e.preventDefault(), r.current += 1, n(!0));
756
753
  }, []),
757
754
  onDragLeave: z((e) => {
758
- Ye(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
755
+ Je(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
759
756
  }, []),
760
757
  onDragOver: z((e) => {
761
- Ye(e) && e.preventDefault();
758
+ Je(e) && e.preventDefault();
762
759
  }, []),
763
760
  onDrop: z((t) => {
764
- if (!Ye(t)) return;
761
+ if (!Je(t)) return;
765
762
  t.preventDefault(), r.current = 0, n(!1);
766
763
  let i = Array.from(t.dataTransfer?.files ?? []);
767
764
  i.length > 0 && e(i);
768
765
  }, [e])
769
766
  }
770
767
  };
771
- }, Ze = /* @__PURE__ */ function(e) {
768
+ }, Xe = /* @__PURE__ */ function(e) {
772
769
  return e.Files = "files", e.Archive = "archive", e;
773
770
  }({}), Y = /* @__PURE__ */ function(e) {
774
771
  return e.Mobile = "mobile", e.Desktop = "desktop", e;
775
- }({}), Qe = (e, t, n = g.MD) => /* @__PURE__ */ F(e, {
772
+ }({}), Ze = (e, t, n = g.MD) => /* @__PURE__ */ F(e, {
776
773
  size: n,
777
774
  className: t,
778
775
  "aria-hidden": !0,
779
776
  stroke: _
780
- }), $e = ({ isVisible: e, labels: t }) => {
777
+ }), Qe = ({ isVisible: e, labels: t }) => {
781
778
  if (!e) return null;
782
779
  let n = t ?? {};
783
780
  return /* @__PURE__ */ F("div", {
@@ -787,7 +784,7 @@ var Re = {
787
784
  children: /* @__PURE__ */ I("div", {
788
785
  className: "flex flex-col items-center text-center",
789
786
  children: [
790
- /* @__PURE__ */ F(ue, {
787
+ /* @__PURE__ */ F(le, {
791
788
  size: 100,
792
789
  className: "text-accent-primary",
793
790
  "aria-hidden": !0,
@@ -804,16 +801,16 @@ var Re = {
804
801
  ]
805
802
  })
806
803
  });
807
- }, et = /* @__PURE__ */ function(e) {
804
+ }, $e = /* @__PURE__ */ function(e) {
808
805
  return e.SupportingFile = "supporting-file", e.Manifest = "manifest", e;
809
- }({}), tt = /* @__PURE__ */ function(e) {
806
+ }({}), et = /* @__PURE__ */ function(e) {
810
807
  return e.Valid = "valid", e.Invalid = "invalid", e;
811
- }({}), nt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), rt = ".zip,application/zip", it = 0, X = () => `skill-file-candidate-${++it}`, Z = (e, t, n) => ({
808
+ }({}), tt = (e) => (e.webkitRelativePath || e.name).replace(/\\/g, "/"), nt = ".zip,application/zip", rt = 0, X = () => `skill-file-candidate-${++rt}`, Z = (e, t, n) => ({
812
809
  id: X(),
813
810
  file: e,
814
811
  path: He(n, t.replace(/\\/g, "/"))
815
- }), at = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Ze.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
816
- 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) => {
812
+ }), it = ({ isOpen: e, onClose: t, fileActions: n, mode: r = Xe.Files, targetFolderPath: i = "", initialFiles: a, initialEntries: o, labels: c }) => {
813
+ 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 === Xe.Archive, L = l.uploadArchiveErrorMessage ?? "Couldn't read this archive", re = me(), ae = (e) => {
817
814
  T(void 0), d((t) => [...t, ...e]);
818
815
  }, oe = async (e) => {
819
816
  let { extractArchive: t } = n;
@@ -840,12 +837,12 @@ var Re = {
840
837
  oe(e);
841
838
  return;
842
839
  }
843
- ae(e.map((e) => Z(e, nt(e), i)));
844
- }, ce = (e) => {
840
+ ae(e.map((e) => Z(e, tt(e), i)));
841
+ }, R = (e) => {
845
842
  d((t) => t.filter((t) => t.id !== e));
846
843
  };
847
844
  pe(() => {
848
- e && (M.current += 1, d([...(a ?? []).map((e) => Z(e, nt(e), i)), ...(o ?? []).map((e) => Z(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), j(0));
845
+ e && (M.current += 1, d([...(a ?? []).map((e) => Z(e, tt(e), i)), ...(o ?? []).map((e) => Z(e.file, e.path, i))]), h(/* @__PURE__ */ new Map()), v([]), T(void 0), A(void 0), j(0));
849
846
  }, [e]), pe(() => {
850
847
  if (!e) return;
851
848
  let t = !1;
@@ -861,11 +858,11 @@ var Re = {
861
858
  t = !0;
862
859
  };
863
860
  }, [u, e]);
864
- 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 () => {
861
+ 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), de = u.length > 0 && !le && g.length === 0 && !y && !E && te === 0, fe = async () => {
865
862
  D(!0), T(void 0);
866
863
  try {
867
864
  let { results: e, batchErrors: r } = await n.validateBatch(u), i = new Map(e.map((e) => [e.candidateId, e]));
868
- if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === tt.Invalid) || r.length > 0) return;
865
+ if (h(i), v(r.map((e) => e.message)), u.some((e) => i.get(e.id)?.status === et.Invalid) || r.length > 0) return;
869
866
  let a = await n.commitBatch(u);
870
867
  if (a.error) {
871
868
  T(a.error);
@@ -895,7 +892,7 @@ var Re = {
895
892
  ariaLabel: ""
896
893
  }) : void 0,
897
894
  onClick: () => void fe(),
898
- disabled: !R
895
+ disabled: !de
899
896
  }],
900
897
  children: /* @__PURE__ */ I("div", {
901
898
  className: "flex flex-col gap-4 px-6 py-4",
@@ -910,8 +907,8 @@ var Re = {
910
907
  })] }),
911
908
  ariaLabel: l.uploadDropZoneAriaLabel ?? "Upload files",
912
909
  multiple: !0,
913
- accept: N ? rt : void 0,
914
- className: de ? "border-error hover:border-error" : void 0,
910
+ accept: N ? nt : void 0,
911
+ className: ue ? "border-error hover:border-error" : void 0,
915
912
  onChange: se,
916
913
  onReject: N ? () => A(L) : void 0
917
914
  }),
@@ -931,7 +928,7 @@ var Re = {
931
928
  u.length > 0 && /* @__PURE__ */ F("ul", {
932
929
  className: "flex flex-col gap-2",
933
930
  children: u.map((e) => {
934
- let t = p.get(e.id), n = t?.kind === et.Manifest, r = t?.status === tt.Invalid;
931
+ let t = p.get(e.id), n = t?.kind === $e.Manifest, r = t?.status === et.Invalid;
935
932
  return /* @__PURE__ */ I("li", {
936
933
  className: "flex items-center gap-2 rounded-lg border border-tertiary p-2",
937
934
  children: [
@@ -959,13 +956,13 @@ var Re = {
959
956
  ]
960
957
  }),
961
958
  /* @__PURE__ */ F(w, {
962
- icon: /* @__PURE__ */ F(le, {
959
+ icon: /* @__PURE__ */ F(ce, {
963
960
  size: 16,
964
961
  "aria-hidden": !0,
965
962
  stroke: _
966
963
  }),
967
964
  "aria-label": l.uploadRemoveCandidateLabel?.(e.path) ?? `Remove ${e.path}`,
968
- onClick: () => ce(e.id)
965
+ onClick: () => R(e.id)
969
966
  })
970
967
  ]
971
968
  }, e.id);
@@ -975,32 +972,32 @@ var Re = {
975
972
  ]
976
973
  })
977
974
  });
978
- }, ot = {
975
+ }, at = {
979
976
  title: "_title_5md1a_1",
980
977
  helperText: "_helperText_5md1a_5",
981
978
  refineFeedback: "_refineFeedback_5md1a_9",
982
979
  refineError: "_refineError_5md1a_13"
983
- }, st = {
984
- mode: Ze.Files,
980
+ }, ot = {
981
+ mode: Xe.Files,
985
982
  targetFolderPath: ""
986
- }, ct = [U.Name, U.Description], lt = 24, ut = 300, dt = "desktop:px-8 desktop:py-6", 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 () => {
983
+ }, st = [U.Name, U.Description], ct = 24, lt = 300, ut = "desktop:px-8 desktop:py-6", dt = "desktop:px-8 desktop:py-6", ft = "gap-4 px-4 py-6 desktop:gap-5 desktop:px-8 desktop:py-6", pt = de(async () => {
987
984
  let { MarkdownEditor: e } = await _e();
988
985
  return { default: e };
989
- }), ht = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: _, expandedPaths: v, onExpandedPathsChange: S, 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, asideData: _e, onSubmit: ve, onCancel: ye, onBack: be, backAriaLabel: xe, title: Se, onRetry: Ce, onRetrySubmit: we, labels: Te, styles: U, dir: Ee, instructionsEditorTheme: De = y.light }) => {
990
- let [W, Oe] = H({
986
+ }), mt = ({ initialValues: r, files: i, selectedPath: s, onSelectedPathChange: _, expandedPaths: v, onExpandedPathsChange: S, 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: de, asideData: 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 }) => {
987
+ let [W, De] = H({
991
988
  name: r?.name ?? "",
992
989
  description: r?.description ?? "",
993
990
  instructions: r?.instructions ?? ""
994
- }), ke = me(), G = V(void 0), Ae = l({
995
- bottomGap: lt,
996
- minHeight: ut
997
- }), je = V(W), Me = (e) => {
991
+ }), Oe = me(), G = V(void 0), ke = l({
992
+ bottomGap: ct,
993
+ minHeight: lt
994
+ }), Ae = V(W), je = (e) => {
998
995
  let t = {
999
- ...je.current,
996
+ ...Ae.current,
1000
997
  ...e
1001
998
  };
1002
- je.current = t, Oe(t), L?.(t);
1003
- }, Fe = (e) => e ? async (t, n) => {
999
+ Ae.current = t, De(t), L?.(t);
1000
+ }, Me = (e) => e ? async (t, n) => {
1004
1001
  if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
1005
1002
  G.current = n;
1006
1003
  try {
@@ -1008,79 +1005,79 @@ var Re = {
1008
1005
  } finally {
1009
1006
  G.current === n && (G.current = void 0);
1010
1007
  }
1011
- } : void 0, Le = u({
1008
+ } : void 0, Fe = u({
1012
1009
  value: W.description,
1013
- onChange: (e) => Me({ description: e }),
1014
- onRefine: Fe(ie),
1010
+ onChange: (e) => je({ description: e }),
1011
+ onRefine: Me(ie),
1015
1012
  disabled: O || T || D,
1016
1013
  resetKey: r
1017
- }), J = u({
1014
+ }), Le = u({
1018
1015
  value: W.instructions,
1019
- onChange: (e) => Me({ instructions: e }),
1020
- onRefine: Fe(se),
1016
+ onChange: (e) => je({ instructions: e }),
1017
+ onRefine: Me(se),
1021
1018
  disabled: O || T || D,
1022
1019
  resetKey: r
1023
- }), Be = Le.isPending || J.isPending, He = () => {
1024
- Le.reset(), J.reset();
1025
- }, Ue = () => {
1026
- He(), ye();
1020
+ }), J = Fe.isPending || Le.isPending, Be = () => {
1021
+ Fe.reset(), Le.reset();
1022
+ }, He = () => {
1023
+ Be(), ve();
1024
+ }, We = () => {
1025
+ Be(), ye();
1027
1026
  }, Ge = () => {
1028
- He(), be();
1029
- }, Ke = () => {
1030
- O || T || D || G.current && !G.current.aborted || ve(W);
1031
- }, qe = V(r), Ye = qe.current !== r, et = V(i);
1027
+ O || T || D || G.current && !G.current.aborted || _e(W);
1028
+ }, Ke = V(r), Je = Ke.current !== r, $e = V(i);
1032
1029
  pe(() => {
1033
- qe.current = r;
1030
+ Ke.current = r;
1034
1031
  let e = {
1035
1032
  name: r?.name ?? "",
1036
1033
  description: r?.description ?? "",
1037
1034
  instructions: r?.instructions ?? ""
1038
1035
  };
1039
- je.current = e, Oe(e), et.current = i;
1036
+ Ae.current = e, De(e), $e.current = i;
1040
1037
  }, [r]);
1041
- let tt = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), nt = V(!1);
1038
+ let et = (e) => JSON.stringify([...e].sort((e, t) => e.path.localeCompare(t.path))), tt = V(!1);
1042
1039
  pe(() => {
1043
- if (Ye) return;
1040
+ if (Je) return;
1044
1041
  let e = {
1045
1042
  name: r?.name ?? "",
1046
1043
  description: r?.description ?? "",
1047
1044
  instructions: r?.instructions ?? ""
1048
- }, t = JSON.stringify(W) !== JSON.stringify(e) || tt(i) !== tt(et.current);
1049
- t !== nt.current && (nt.current = t, N?.(t));
1045
+ }, t = JSON.stringify(W) !== JSON.stringify(e) || et(i) !== et($e.current);
1046
+ t !== tt.current && (tt.current = t, N?.(t));
1050
1047
  }, [
1051
1048
  W,
1052
1049
  i,
1053
1050
  r,
1054
- Ye,
1051
+ Je,
1055
1052
  N
1056
1053
  ]);
1057
- let [rt, it] = H(K), X = s ?? rt, Z = z((e) => {
1058
- it(e), _?.(e);
1059
- }, [_]), [ht, gt] = H([]), _t = v ?? ht, vt = B(() => new Set(_t), [_t]), yt = z((e) => {
1054
+ let [nt, rt] = H(K), X = s ?? nt, Z = z((e) => {
1055
+ rt(e), _?.(e);
1056
+ }, [_]), [mt, ht] = H([]), gt = v ?? mt, _t = B(() => new Set(gt), [gt]), vt = z((e) => {
1060
1057
  let t = [...e];
1061
- gt(t), S?.(t);
1062
- }, [S]), [bt, xt] = H(!1), [St, Ct] = H(st), wt = z((e) => {
1063
- Ct(e), xt(!0);
1064
- }, []), [Tt, Et] = H(!1), { isDragActive: Dt, dropZoneHandlers: Ot } = Xe(z((e) => {
1065
- bt || wt({
1066
- ...st,
1058
+ ht(t), S?.(t);
1059
+ }, [S]), [yt, bt] = H(!1), [xt, St] = H(ot), Ct = z((e) => {
1060
+ St(e), bt(!0);
1061
+ }, []), [wt, Tt] = H(!1), { isDragActive: Et, dropZoneHandlers: Dt } = Ye(z((e) => {
1062
+ yt || Ct({
1063
+ ...ot,
1067
1064
  initialFiles: e
1068
1065
  });
1069
- }, [bt, wt])), Q = Te ?? {}, $ = U?.colors, kt = U?.typography ?? {}, At = kt.titleClassName ?? "dial-body-semi-text", jt = kt.helperTextClassName ?? "dial-tiny-semi-text", Mt = kt.removeIconClassName, Nt = kt.menuIconClassName ?? "text-secondary", Pt = o({
1066
+ }, [yt, Ct])), Q = we ?? {}, $ = Te?.colors, Ot = Te?.typography ?? {}, kt = Ot.titleClassName ?? "dial-body-semi-text", At = Ot.helperTextClassName ?? "dial-tiny-semi-text", jt = Ot.removeIconClassName, Mt = Ot.menuIconClassName ?? "text-secondary", Nt = o({
1070
1067
  "--se-title-color": $?.title,
1071
1068
  "--se-helper-text-color": $?.helperText,
1072
1069
  "--se-refine-action-text": $?.refineActionText,
1073
1070
  "--se-refine-error-text": $?.refineErrorText
1074
- }), Ft = {
1075
- feedbackClassName: c($?.refineActionText && ot.refineFeedback, kt.refineFeedbackClassName, Re.refineFeedback),
1076
- errorClassName: ot.refineError
1077
- }, It = {
1071
+ }), Pt = {
1072
+ feedbackClassName: c($?.refineActionText && at.refineFeedback, Ot.refineFeedbackClassName, Re.refineFeedback),
1073
+ errorClassName: at.refineError
1074
+ }, Ft = {
1078
1075
  layout: $?.border ? { colors: {
1079
1076
  headerBorderColor: $.border,
1080
1077
  sidebarBorderColor: $.border
1081
1078
  } } : void 0,
1082
1079
  section: $?.title ? { colors: { titleColor: $.title } } : void 0
1083
- }, Lt = B(() => ({
1080
+ }, It = B(() => ({
1084
1081
  required: Q.folderNameRequiredError ?? "Enter a folder name",
1085
1082
  invalid: Q.folderNameInvalidError ?? "Folder name can't contain / or \\, or be . or ..",
1086
1083
  duplicate: Q.folderNameDuplicateError ?? "An item with this name already exists here"
@@ -1088,180 +1085,174 @@ var Re = {
1088
1085
  Q.folderNameRequiredError,
1089
1086
  Q.folderNameInvalidError,
1090
1087
  Q.folderNameDuplicateError
1091
- ]), Rt = z((e) => {
1092
- vt.has(e) || yt(new Set([...vt, e]));
1093
- }, [vt, yt]), zt = Je({
1088
+ ]), Lt = z((e) => {
1089
+ _t.has(e) || vt(new Set([..._t, e]));
1090
+ }, [_t, vt]), Rt = qe({
1094
1091
  files: i,
1095
1092
  fileActions: R,
1096
1093
  defaultName: Q.newFolderDefaultName ?? "New folder",
1097
- messages: Lt,
1098
- onRevealFolder: Rt,
1094
+ messages: It,
1095
+ onRevealFolder: Lt,
1099
1096
  onCreated: Z
1100
- }), { draftNode: Bt, draftPath: Vt, draftPane: Ht } = zt, Ut = B(() => Ve([{
1097
+ }), { draftNode: zt, draftPath: Bt, draftPane: Vt } = Rt, Ht = B(() => Ve([{
1101
1098
  path: K,
1102
1099
  name: K,
1103
1100
  kind: q.File
1104
- }, ...i]), [i]), Wt = B(() => Bt ? Ve([
1101
+ }, ...i]), [i]), Ut = B(() => zt ? Ve([
1105
1102
  {
1106
1103
  path: K,
1107
1104
  name: K,
1108
1105
  kind: q.File
1109
1106
  },
1110
1107
  ...i,
1111
- Bt
1112
- ]) : Ut, [
1108
+ zt
1109
+ ]) : Ht, [
1113
1110
  i,
1114
- Bt,
1115
- Ut
1116
- ]), Gt = B(() => i.find((e) => e.path === X), [i, X]), Kt = z((e) => {
1117
- e.path !== Vt && Z(e.path);
1118
- }, [Z, Vt]), qt = z((e) => {
1111
+ zt,
1112
+ Ht
1113
+ ]), Wt = B(() => i.find((e) => e.path === X), [i, X]), Gt = z((e) => {
1114
+ e.path !== Bt && Z(e.path);
1115
+ }, [Z, Bt]), Kt = z((e) => {
1119
1116
  R.onRemoveNode(e), X === e && Z(K);
1120
1117
  }, [
1121
1118
  R,
1122
1119
  X,
1123
1120
  Z
1124
- ]), { startDraft: Jt } = zt, { onCreateFolder: Yt, extractArchive: Xt, pickFromFileSystem: Zt } = R, Qt = z(async (e) => {
1125
- if (!Zt) return;
1126
- let t = await Zt();
1127
- t?.length && wt({
1128
- mode: Ze.Files,
1121
+ ]), { startDraft: qt } = Rt, { onCreateFolder: Jt, extractArchive: Yt, pickFromFileSystem: Xt } = R, Zt = z(async (e) => {
1122
+ if (!Xt) return;
1123
+ let t = await Xt();
1124
+ t?.length && Ct({
1125
+ mode: Xe.Files,
1129
1126
  targetFolderPath: e,
1130
1127
  initialEntries: t
1131
1128
  });
1132
- }, [Zt, wt]), $t = z((e, t) => {
1133
- let n = (e) => Qe(e, Nt), r = [];
1134
- return Yt && r.push({
1129
+ }, [Xt, Ct]), Qt = z((e, t) => {
1130
+ let n = (e) => Ze(e, Mt), r = [];
1131
+ return Jt && r.push({
1135
1132
  key: "create-folder",
1136
1133
  label: Q.createFolderLabel ?? "Create folder",
1137
1134
  icon: n(oe),
1138
- onClick: () => Jt(e, t)
1135
+ onClick: () => qt(e, t)
1139
1136
  }), r.push({
1140
1137
  key: "upload-files",
1141
1138
  label: Q.uploadFilesLabel ?? "Upload files from device",
1142
- icon: n(ue),
1143
- onClick: () => wt({
1144
- mode: Ze.Files,
1139
+ icon: n(le),
1140
+ onClick: () => Ct({
1141
+ mode: Xe.Files,
1145
1142
  targetFolderPath: e
1146
1143
  })
1147
- }), Xt && r.push({
1144
+ }), Yt && r.push({
1148
1145
  key: "upload-archive",
1149
1146
  label: Q.uploadArchiveLabel ?? "Upload archive from device",
1150
1147
  icon: n(ae),
1151
- onClick: () => wt({
1152
- mode: Ze.Archive,
1148
+ onClick: () => Ct({
1149
+ mode: Xe.Archive,
1153
1150
  targetFolderPath: e
1154
1151
  })
1155
- }), Zt && r.push({
1152
+ }), Xt && r.push({
1156
1153
  key: "open-file-system",
1157
1154
  label: Q.openFileSystemLabel ?? "Open DIAL file system",
1158
1155
  icon: n(re),
1159
- onClick: () => void Qt(e)
1156
+ onClick: () => void Zt(e)
1160
1157
  }), r;
1161
1158
  }, [
1162
- Nt,
1159
+ Mt,
1160
+ Jt,
1163
1161
  Yt,
1164
1162
  Xt,
1165
- Zt,
1166
1163
  Q.createFolderLabel,
1167
1164
  Q.uploadFilesLabel,
1168
1165
  Q.uploadArchiveLabel,
1169
1166
  Q.openFileSystemLabel,
1170
- Jt,
1171
- wt,
1172
- Qt
1173
- ]), en = B(() => {
1174
- let e = We(ze.Header, i.find((e) => e.path === X));
1167
+ qt,
1168
+ Ct,
1169
+ Zt
1170
+ ]), $t = B(() => {
1171
+ let e = Ue(ze.Header, i.find((e) => e.path === X));
1175
1172
  return {
1176
- [Y.Mobile]: $t(e, Y.Mobile),
1177
- [Y.Desktop]: $t(e, Y.Desktop)
1173
+ [Y.Mobile]: Qt(e, Y.Mobile),
1174
+ [Y.Desktop]: Qt(e, Y.Desktop)
1178
1175
  };
1179
1176
  }, [
1180
- $t,
1177
+ Qt,
1181
1178
  i,
1182
1179
  X
1183
- ]), tn = z((e, t) => {
1184
- if (e.path === Vt || e.nodeType !== he.FOLDER) return [];
1180
+ ]), en = z((e, t) => {
1181
+ if (e.path === Bt || e.nodeType !== he.FOLDER) return [];
1185
1182
  let n = {
1186
1183
  path: e.path,
1187
1184
  name: e.name,
1188
1185
  kind: q.Folder
1189
- }, r = $t(We(ze.Child, n), t);
1186
+ }, r = Qt(Ue(ze.Child, n), t);
1190
1187
  return r.push({
1191
- key: "add-sibling",
1192
- icon: Qe(ce),
1193
- label: Q.addSiblingLabel ?? "Add sibling",
1194
- children: $t(We(ze.Sibling, n), t)
1195
- }, {
1196
1188
  key: "delete",
1197
1189
  label: Q.deleteLabel ?? "Delete",
1198
1190
  danger: !0,
1199
- icon: Qe(le, Mt),
1200
- onClick: () => qt(e.path)
1191
+ icon: Ze(ce, jt),
1192
+ onClick: () => Kt(e.path)
1201
1193
  }), r;
1202
1194
  }, [
1203
- Vt,
1204
- Q.addSiblingLabel,
1195
+ Bt,
1205
1196
  Q.deleteLabel,
1206
- Mt,
1207
- $t,
1208
- qt
1209
- ]), nn = B(() => ({
1210
- [Y.Mobile]: (e) => tn(e, Y.Mobile),
1211
- [Y.Desktop]: (e) => tn(e, Y.Desktop)
1212
- }), [tn]), rn = z((e) => e.nodeType === he.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(w, {
1197
+ jt,
1198
+ Qt,
1199
+ Kt
1200
+ ]), tn = B(() => ({
1201
+ [Y.Mobile]: (e) => en(e, Y.Mobile),
1202
+ [Y.Desktop]: (e) => en(e, Y.Desktop)
1203
+ }), [en]), nn = z((e) => e.nodeType === he.FOLDER || e.path === "SKILL.md" ? null : /* @__PURE__ */ F(w, {
1213
1204
  size: b.Small,
1214
- icon: Qe(le, Mt, g.SM),
1205
+ icon: Ze(ce, jt, g.SM),
1215
1206
  "aria-label": Q.deleteLabel ?? "Delete",
1216
- onClick: () => qt(e.path)
1207
+ onClick: () => Kt(e.path)
1217
1208
  }), [
1218
1209
  Q.deleteLabel,
1219
- Mt,
1220
- qt
1221
- ]), an = (e) => /* @__PURE__ */ I("div", {
1210
+ jt,
1211
+ Kt
1212
+ ]), rn = (e) => /* @__PURE__ */ I("div", {
1222
1213
  className: "flex flex-col gap-2 desktop:gap-5",
1223
1214
  children: [/* @__PURE__ */ I("div", {
1224
1215
  className: "flex items-center justify-between",
1225
1216
  children: [/* @__PURE__ */ F("span", {
1226
- className: c(ot.title, At),
1217
+ className: c(at.title, kt),
1227
1218
  children: Q.filesHeading ?? "Files"
1228
1219
  }), /* @__PURE__ */ F(p, {
1229
1220
  label: Q.addLabel ?? "Add",
1230
1221
  variant: m.Neutral,
1231
1222
  appearance: f.Solid,
1232
1223
  size: b.Small,
1233
- items: en[e]
1224
+ items: $t[e]
1234
1225
  })]
1235
1226
  }), /* @__PURE__ */ F("div", {
1236
1227
  role: "tree",
1237
1228
  "aria-label": Q.filesTreeAriaLabel ?? "Skill files",
1238
1229
  children: /* @__PURE__ */ F(ge, {
1239
- items: Ht === e ? Wt : Ut,
1230
+ items: Vt === e ? Ut : Ht,
1240
1231
  showFiles: !0,
1241
1232
  selectedPath: X,
1242
- expandedPaths: vt,
1243
- onExpandedPathsChange: yt,
1244
- onItemClick: Kt,
1245
- getContextMenuItems: nn[e],
1246
- renderItemActions: rn,
1247
- renamedPath: Ht === e ? Vt : void 0,
1248
- onRenameSave: zt.handleSave,
1249
- onRenameCancel: zt.handleCancel,
1250
- onRenameValidate: zt.handleValidate,
1233
+ expandedPaths: _t,
1234
+ onExpandedPathsChange: vt,
1235
+ onItemClick: Gt,
1236
+ getContextMenuItems: tn[e],
1237
+ renderItemActions: nn,
1238
+ renamedPath: Vt === e ? Bt : void 0,
1239
+ onRenameSave: Rt.handleSave,
1240
+ onRenameCancel: Rt.handleCancel,
1241
+ onRenameValidate: Rt.handleValidate,
1251
1242
  rootItemPath: ""
1252
1243
  })
1253
1244
  })]
1254
- }), on = B(() => ({
1245
+ }), an = B(() => ({
1255
1246
  name: W.name,
1256
1247
  description: W.description,
1257
1248
  iconUrl: "",
1258
1249
  version: "",
1259
1250
  topics: [],
1260
1251
  otherLocales: []
1261
- }), [W.name, W.description]), sn = B(() => ({
1252
+ }), [W.name, W.description]), on = B(() => ({
1262
1253
  name: k?.name,
1263
1254
  description: k?.description
1264
- }), [k?.name, k?.description]), cn = B(() => ({ form: {
1255
+ }), [k?.name, k?.description]), sn = B(() => ({ form: {
1265
1256
  ...Pe,
1266
1257
  name: {
1267
1258
  label: Q.nameLabel ?? "Name",
@@ -1277,38 +1268,38 @@ var Re = {
1277
1268
  Q.namePlaceholder,
1278
1269
  Q.descriptionLabel,
1279
1270
  Q.descriptionPlaceholder
1280
- ]), ln = (e) => {
1281
- e.name !== void 0 && Me({ name: e.name }), e.description !== void 0 && (Le.reset(), Me({ description: e.description }));
1282
- }, un = ie ? (e, t) => /* @__PURE__ */ F(a, {
1271
+ ]), cn = (e) => {
1272
+ e.name !== void 0 && je({ name: e.name }), e.description !== void 0 && (Fe.reset(), je({ description: e.description }));
1273
+ }, ln = ie ? (e, t) => /* @__PURE__ */ F(a, {
1283
1274
  isEnabled: !0,
1284
1275
  fieldId: t,
1285
1276
  required: !0,
1286
1277
  label: Q.descriptionLabel ?? "Description",
1287
1278
  labels: Q,
1288
- refinement: Le,
1289
- disabled: Be || O,
1290
- ...Ft,
1279
+ refinement: Fe,
1280
+ disabled: J || O,
1281
+ ...Pt,
1291
1282
  children: e
1292
- }) : void 0, dn = {
1293
- title: Se,
1294
- onBack: Ge,
1295
- onCancel: Ue,
1296
- onSubmit: Ke,
1283
+ }) : void 0, un = {
1284
+ title: xe,
1285
+ onBack: We,
1286
+ onCancel: He,
1287
+ onSubmit: Ge,
1297
1288
  submitLabel: Q.createLabel ?? "Create",
1298
- isSubmitDisabled: Be || T || D,
1289
+ isSubmitDisabled: J || T || D,
1299
1290
  labels: {
1300
1291
  cancelLabel: Q.cancelLabel ?? "Cancel",
1301
- backAriaLabel: xe ?? "Back",
1292
+ backAriaLabel: be ?? "Back",
1302
1293
  savingStatusLabel: Q.savingStatusLabel ?? "Saving"
1303
1294
  },
1304
- styles: It,
1295
+ styles: Ft,
1305
1296
  metadataTitle: null
1306
1297
  };
1307
1298
  if (T) return /* @__PURE__ */ F("div", {
1308
- dir: Ee,
1299
+ dir: U,
1309
1300
  className: "relative flex min-h-0 flex-1 flex-col",
1310
1301
  children: /* @__PURE__ */ F(Ne, {
1311
- ...dn,
1302
+ ...un,
1312
1303
  metadata: /* @__PURE__ */ F("div", {
1313
1304
  role: "status",
1314
1305
  "aria-label": Q.loadingAriaLabel ?? "Loading skill",
@@ -1318,27 +1309,27 @@ var Re = {
1318
1309
  })
1319
1310
  });
1320
1311
  if (D) return /* @__PURE__ */ F("div", {
1321
- dir: Ee,
1312
+ dir: U,
1322
1313
  className: "relative flex min-h-0 flex-1 flex-col",
1323
1314
  children: /* @__PURE__ */ F(Ne, {
1324
- ...dn,
1315
+ ...un,
1325
1316
  metadata: /* @__PURE__ */ I("div", {
1326
1317
  role: "alert",
1327
1318
  className: "flex flex-col items-center gap-4 p-8",
1328
1319
  children: [/* @__PURE__ */ F(x, { text: Q.loadErrorMessage ?? "Couldn't load this skill. Please try again." }), /* @__PURE__ */ F(A, {
1329
1320
  label: Q.retryLabel ?? "Retry",
1330
- onClick: Ce
1321
+ onClick: Se
1331
1322
  })]
1332
1323
  })
1333
1324
  })
1334
1325
  });
1335
- let fn = X === K, pn = fn ? K : Q.selectedFileHeading?.(Gt?.name ?? X) ?? Gt?.name ?? X, mn = ee != null || te != null ? /* @__PURE__ */ I("div", {
1326
+ let dn = X === K, fn = dn ? K : Q.selectedFileHeading?.(Wt?.name ?? X) ?? Wt?.name ?? X, pn = ee != null || te != null ? /* @__PURE__ */ I("div", {
1336
1327
  className: "flex flex-col gap-2",
1337
1328
  children: [ee != null && /* @__PURE__ */ I("div", {
1338
1329
  className: "flex items-center gap-2",
1339
- children: [/* @__PURE__ */ F(x, { text: ee }), we != null && /* @__PURE__ */ F(C, {
1330
+ children: [/* @__PURE__ */ F(x, { text: ee }), Ce != null && /* @__PURE__ */ F(C, {
1340
1331
  label: Q.retryLabel ?? "Retry",
1341
- onClick: we
1332
+ onClick: Ce
1342
1333
  })]
1343
1334
  }), te != null && /* @__PURE__ */ I("div", {
1344
1335
  className: "flex items-center gap-2",
@@ -1347,38 +1338,38 @@ var Re = {
1347
1338
  onClick: j
1348
1339
  })]
1349
1340
  })]
1350
- }) : void 0, hn = /* @__PURE__ */ F(a, {
1341
+ }) : void 0, mn = /* @__PURE__ */ F(a, {
1351
1342
  isEnabled: !!se,
1352
- fieldId: ke,
1343
+ fieldId: Oe,
1353
1344
  required: !0,
1354
- labelClassName: c(ot.helperText, jt),
1345
+ labelClassName: c(at.helperText, At),
1355
1346
  label: Q.instructionsLabel ?? "Instructions",
1356
1347
  labels: Q,
1357
- refinement: J,
1358
- disabled: Be || O,
1359
- ...Ft,
1348
+ refinement: Le,
1349
+ disabled: J || O,
1350
+ ...Pt,
1360
1351
  children: /* @__PURE__ */ I("div", {
1361
1352
  className: "flex flex-1 flex-col gap-2",
1362
1353
  children: [
1363
1354
  !se && /* @__PURE__ */ F(E, {
1364
- htmlFor: ke,
1365
- className: c(ot.helperText, jt),
1355
+ htmlFor: Oe,
1356
+ className: c(at.helperText, At),
1366
1357
  label: Q.instructionsLabel ?? "Instructions",
1367
1358
  required: !0
1368
1359
  }),
1369
1360
  /* @__PURE__ */ F("div", {
1370
- ref: Ae,
1361
+ ref: ke,
1371
1362
  className: c(t, e, n),
1372
- children: /* @__PURE__ */ F(de, {
1363
+ children: /* @__PURE__ */ F(ue, {
1373
1364
  fallback: /* @__PURE__ */ F(ne, { ariaLabel: Q.instructionsLoadingAriaLabel ?? "Loading" }),
1374
- children: /* @__PURE__ */ F(mt, {
1375
- id: ke,
1365
+ children: /* @__PURE__ */ F(pt, {
1366
+ id: Oe,
1376
1367
  ariaLabel: Q.instructionsLabel ?? "Instructions",
1377
1368
  value: W.instructions,
1378
1369
  onChange: (e) => {
1379
- J.reset(), Me({ instructions: e });
1370
+ Le.reset(), je({ instructions: e });
1380
1371
  },
1381
- theme: De,
1372
+ theme: Ee,
1382
1373
  showDragbar: !1,
1383
1374
  placeholder: Q.instructionsPlaceholder ?? "Write the skill instructions in Markdown"
1384
1375
  })
@@ -1389,65 +1380,65 @@ var Re = {
1389
1380
  })
1390
1381
  });
1391
1382
  return /* @__PURE__ */ I("div", {
1392
- dir: Ee,
1383
+ dir: U,
1393
1384
  className: c("relative flex min-h-0 flex-1 flex-col", Re.root),
1394
- style: Pt,
1395
- ...Ot,
1385
+ style: Nt,
1386
+ ...Dt,
1396
1387
  children: [
1397
- /* @__PURE__ */ F($e, {
1398
- isVisible: Dt && !bt,
1399
- labels: Te
1388
+ /* @__PURE__ */ F(Qe, {
1389
+ isVisible: Et && !yt,
1390
+ labels: we
1400
1391
  }),
1401
1392
  /* @__PURE__ */ F(Ne, {
1402
- ...dn,
1403
- asideData: _e,
1404
- asideSectionClassName: ft,
1393
+ ...un,
1394
+ asideData: fe,
1395
+ asideSectionClassName: dt,
1405
1396
  isSubmitting: O,
1406
- metadataSectionClassName: dt,
1397
+ metadataSectionClassName: ut,
1407
1398
  metadata: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
1408
1399
  className: "desktop:hidden",
1409
1400
  children: /* @__PURE__ */ F(d, {
1410
1401
  title: Q.editingFileLabel ?? "Editing file",
1411
- description: Gt?.name ?? "SKILL.md",
1412
- expanded: Tt,
1413
- onToggle: Et,
1402
+ description: Wt?.name ?? "SKILL.md",
1403
+ expanded: wt,
1404
+ onToggle: Tt,
1414
1405
  ariaLabel: Q.editingFileLabel ?? "Editing file",
1415
- children: an(Y.Mobile)
1406
+ children: rn(Y.Mobile)
1416
1407
  })
1417
1408
  }), /* @__PURE__ */ F("div", {
1418
1409
  className: "hidden desktop:block",
1419
- children: an(Y.Desktop)
1410
+ children: rn(Y.Desktop)
1420
1411
  })] }),
1421
- alert: mn,
1422
- setupTitle: pn,
1423
- setupSectionClassName: pt,
1424
- setup: fn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
1425
- values: on,
1426
- errors: sn,
1427
- onChange: ln,
1428
- fields: ct,
1412
+ alert: pn,
1413
+ setupTitle: fn,
1414
+ setupSectionClassName: ft,
1415
+ setup: dn ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ie, {
1416
+ values: an,
1417
+ errors: on,
1418
+ onChange: cn,
1419
+ fields: st,
1429
1420
  isDescriptionRequired: !0,
1430
1421
  isNameReadOnly: M,
1431
1422
  nameCaption: k?.name ? void 0 : Q.nameCaption ?? "Lowercase letters and hyphens only, no spaces. We'll reformat automatically if needed.",
1432
- renderDescription: un,
1433
- labels: cn
1434
- }), hn] }) : /* @__PURE__ */ F(P, { children: Gt?.kind === q.File && /* @__PURE__ */ F("div", {
1423
+ renderDescription: ln,
1424
+ labels: sn
1425
+ }), mn] }) : /* @__PURE__ */ F(P, { children: Wt?.kind === q.File && /* @__PURE__ */ F("div", {
1435
1426
  className: "flex min-h-0 flex-1 flex-col",
1436
- 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." })
1427
+ children: de ?? /* @__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." })
1437
1428
  }) })
1438
1429
  }),
1439
- /* @__PURE__ */ F(at, {
1440
- isOpen: bt,
1441
- onClose: () => xt(!1),
1430
+ /* @__PURE__ */ F(it, {
1431
+ isOpen: yt,
1432
+ onClose: () => bt(!1),
1442
1433
  fileActions: R,
1443
- mode: St.mode,
1444
- targetFolderPath: St.targetFolderPath,
1445
- initialFiles: St.initialFiles,
1446
- initialEntries: St.initialEntries,
1447
- labels: Te
1434
+ mode: xt.mode,
1435
+ targetFolderPath: xt.targetFolderPath,
1436
+ initialFiles: xt.initialFiles,
1437
+ initialEntries: xt.initialEntries,
1438
+ labels: we
1448
1439
  })
1449
1440
  ]
1450
1441
  });
1451
1442
  };
1452
1443
  //#endregion
1453
- export { Re as SKILL_EDITOR_CLASS, ht as SkillEditor, et as SkillFileCandidateKind, q as SkillFileNodeKind, Ze as SkillFileUploadMode, tt as SkillFileValidationStatus };
1444
+ export { Re as SKILL_EDITOR_CLASS, mt as SkillEditor, $e as SkillFileCandidateKind, q as SkillFileNodeKind, Xe as SkillFileUploadMode, et as SkillFileValidationStatus };