@epam/ai-dial-skills 1.2.0-dev.20 → 1.2.0-dev.207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/components/ChatSkill/ChatSkill.d.ts +3 -2
  2. package/components/ChatSkill/ChatSkill.d.ts.map +1 -1
  3. package/components/FavoriteSkillsPanel/FavoriteSkillsPanel.d.ts.map +1 -1
  4. package/components/SkillArchiveUploadDialog/SkillArchiveUploadDialog.d.ts +9 -0
  5. package/components/SkillArchiveUploadDialog/SkillArchiveUploadDialog.d.ts.map +1 -0
  6. package/components/SkillContentFileTree/SkillContentFileTree.d.ts +11 -0
  7. package/components/SkillContentFileTree/SkillContentFileTree.d.ts.map +1 -0
  8. package/components/SkillDetailsSidePanel/SkillDetailsSidePanel.d.ts +2 -1
  9. package/components/SkillDetailsSidePanel/SkillDetailsSidePanel.d.ts.map +1 -1
  10. package/components/SkillInfoTooltipContent/SkillInfoTooltipContent.d.ts +1 -1
  11. package/components/SkillInfoTooltipContent/SkillInfoTooltipContent.d.ts.map +1 -1
  12. package/components/SkillSelectorField/SkillSelectorField.d.ts +5 -0
  13. package/components/SkillSelectorField/SkillSelectorField.d.ts.map +1 -0
  14. package/constants/public-class-names.d.ts +15 -0
  15. package/constants/public-class-names.d.ts.map +1 -0
  16. package/hooks/useSkillMentions/useSkillMentions.d.ts +50 -0
  17. package/hooks/useSkillMentions/useSkillMentions.d.ts.map +1 -0
  18. package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts +5 -4
  19. package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts.map +1 -1
  20. package/index.css +2 -2
  21. package/index.d.ts +16 -1
  22. package/index.d.ts.map +1 -1
  23. package/index.js +647 -246
  24. package/models/chat-skill-props.d.ts +29 -0
  25. package/models/chat-skill-props.d.ts.map +1 -1
  26. package/models/favorite-skills-panel-props.d.ts +32 -5
  27. package/models/favorite-skills-panel-props.d.ts.map +1 -1
  28. package/models/skill-archive-upload-dialog-props.d.ts +37 -0
  29. package/models/skill-archive-upload-dialog-props.d.ts.map +1 -0
  30. package/models/skill-info-tooltip-content-props.d.ts +19 -0
  31. package/models/skill-info-tooltip-content-props.d.ts.map +1 -1
  32. package/models/skill-mention-anchor.d.ts +12 -0
  33. package/models/skill-mention-anchor.d.ts.map +1 -0
  34. package/models/skill-selector-field-props.d.ts +80 -0
  35. package/models/skill-selector-field-props.d.ts.map +1 -0
  36. package/models/skill-selector-overlay.d.ts +128 -57
  37. package/models/skill-selector-overlay.d.ts.map +1 -1
  38. package/package.json +6 -5
  39. package/test-setup.d.ts +1 -0
  40. package/types/skill-unresolved-reason.d.ts +8 -0
  41. package/types/skill-unresolved-reason.d.ts.map +1 -0
  42. package/utils/catalog-content-dial-files.d.ts +10 -0
  43. package/utils/catalog-content-dial-files.d.ts.map +1 -0
  44. package/utils/skill-mention-matching.d.ts +25 -0
  45. package/utils/skill-mention-matching.d.ts.map +1 -0
  46. package/utils/skill-mention-tracking.d.ts +51 -0
  47. package/utils/skill-mention-tracking.d.ts.map +1 -0
  48. package/utils/skill-url.d.ts +1 -0
  49. package/utils/skill-url.d.ts.map +1 -1
package/index.js CHANGED
@@ -1,340 +1,741 @@
1
- import { DeploymentIcon as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as r, Button as i, ButtonAppearance as a, ButtonVariant as o, DIAL_ICON_SIZE as s, DIAL_KIT_ICON_STROKE as c, GhostButton as l, Highlight as u, InteractiveTooltip as d, Popup as f, PopupSize as p, ToggleIconButton as m, TooltipPlacement as h } from "@epam/ai-dial-ui-kit";
3
- import { Suspense as g, useCallback as _, useEffect as v, useLayoutEffect as y, useMemo as b, useRef as x, useState as S } from "react";
4
- import { IconBlocks as C, IconEye as w, IconStarFilled as T } from "@tabler/icons-react";
5
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
6
- import { DetailsPanel as O } from "@epam/ai-dial-catalog";
7
- //#region src/components/SkillInfoTooltipContent/SkillInfoTooltipContent.tsx
8
- var k = ({ description: e, unsupportedMessage: t, viewDetailsLabel: n = "View details", onViewDetails: r }) => t == null ? /* @__PURE__ */ D("div", {
9
- className: "flex flex-col gap-3",
10
- children: [e != null && e !== "" && /* @__PURE__ */ E("p", {
1
+ import { DeploymentIcon as e, buildCssVars as t, isSkillSelectionUnsupported as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
+ import { BASE_ICON_SIZE as i, Button as a, ButtonAppearance as o, ButtonVariant as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, Dropdown as u, FileDropzone as d, GhostButton as f, Highlight as p, Input as m, InteractiveTooltip as h, Popup as g, PopupSize as _, Search as v, Spinner as y, ToggleIconButton as b, TooltipPlacement as x } from "@epam/ai-dial-ui-kit";
3
+ import { Suspense as S, useCallback as C, useEffect as w, useId as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
4
+ import { IconBlocks as ee, IconChevronDown as te, IconEye as A, IconLock as j, IconStarFilled as ne, IconTrash as M, IconX as N } from "@tabler/icons-react";
5
+ import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
6
+ import { DialFileNodeType as L, DialFoldersTree as R } from "@epam/ai-dial-react-file-manager";
7
+ import { CatalogContentNodeType as z, DetailsPanel as B } from "@epam/ai-dial-catalog";
8
+ //#region src/constants/public-class-names.ts
9
+ var V = {
10
+ selectorField: "dial-skills-selector-field",
11
+ favoritesPanel: "dial-skills-favorites-panel",
12
+ chip: "dial-skills-chip"
13
+ }, H = /* @__PURE__ */ function(e) {
14
+ return e.Deleted = "deleted", e.NotShared = "not-shared", e;
15
+ }({}), U = ({ description: e, unsupportedMessage: t, unresolvedReason: n, deletedMessage: r, notSharedMessage: i, viewDetailsLabel: u = "View details", onViewDetails: d, viewDetailsTabIndex: f }) => {
16
+ if (n != null) {
17
+ let e = n === H.Deleted, t = e ? M : j, a = e ? r : i;
18
+ return /* @__PURE__ */ I("div", {
19
+ className: "flex flex-row items-center gap-2",
20
+ children: [/* @__PURE__ */ F(t, {
21
+ size: c.MD,
22
+ stroke: l,
23
+ "aria-hidden": !0,
24
+ className: "shrink-0 text-secondary"
25
+ }), /* @__PURE__ */ F("p", {
26
+ className: "dial-tiny-text text-start text-primary",
27
+ children: a
28
+ })]
29
+ });
30
+ }
31
+ return t == null ? /* @__PURE__ */ I("div", {
32
+ className: "flex flex-col gap-3",
33
+ children: [e != null && e !== "" && /* @__PURE__ */ F("p", {
34
+ className: "text-start",
35
+ children: e
36
+ }), /* @__PURE__ */ F(a, {
37
+ variant: s.Primary,
38
+ appearance: o.Link,
39
+ className: "h-[24px] self-start",
40
+ label: u,
41
+ iconBefore: /* @__PURE__ */ F(A, {
42
+ size: c.SM,
43
+ stroke: l,
44
+ "aria-hidden": !0
45
+ }),
46
+ onClick: d,
47
+ tabIndex: f
48
+ })]
49
+ }) : /* @__PURE__ */ F("p", {
11
50
  className: "text-start",
12
- children: e
13
- }), /* @__PURE__ */ E(i, {
14
- variant: o.Primary,
15
- appearance: a.Link,
16
- className: "h-[24px] self-start",
17
- label: n,
18
- iconBefore: /* @__PURE__ */ E(w, {
19
- size: s.SM,
20
- stroke: c,
21
- "aria-hidden": !0
22
- }),
23
- onClick: r
24
- })]
25
- }) : /* @__PURE__ */ E("p", {
26
- className: "text-start",
27
- children: t
28
- }), A = ({ name: e, path: t, description: r, isUnsupported: i = !1, labelClassName: a = "dial-body-paragraph-text", unsupportedLabelClassName: o = "text-error", unsupportedClassName: s = "bg-error", onViewDetails: c, labels: u = {} }) => {
29
- let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: p = "Selected model does not support skills. Remove the skill or select different model to proceed." } = u, [m, g] = S(0);
30
- return /* @__PURE__ */ E(d, {
51
+ children: t
52
+ });
53
+ }, W = ({ name: e, path: t, description: n, isUnsupported: i = !1, unresolvedReason: a, labelClassName: o = "dial-body-paragraph-text text-accent", unsupportedLabelClassName: s = "text-error", unsupportedClassName: c = "bg-error", detailsTrigger: l = "hover", onViewDetails: u, labels: d = {} }) => {
54
+ let { viewDetailsLabel: f = "View details", unsupportedTooltipLabel: p = "Selected model does not support skills. Remove the skill or select different model to proceed.", deletedTooltipLabel: m = "This skill has been deleted. Its details are no longer available.", notSharedTooltipLabel: g = "You don't have access to this skill, so its details aren't shown. Ask the chat owner to share it with you." } = d, [_, v] = k(0), [y, b] = k(!1), S = l === "click", C = () => {
55
+ b(!1), v((e) => e + 1), u(t);
56
+ }, w = (e) => {
57
+ !S || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), b(!0));
58
+ }, T = O(null), [D, ee] = k(null);
59
+ return E(() => {
60
+ ee(T.current?.getBoundingClientRect().width ?? null);
61
+ }, [o]), /* @__PURE__ */ F(h, {
31
62
  asChild: !0,
32
- placement: h.Top,
63
+ placement: x.Top,
64
+ open: S ? y : void 0,
65
+ onOpenChange: S ? b : void 0,
33
66
  contentClassName: "max-w-[550px]",
34
- content: i ? /* @__PURE__ */ E(k, { unsupportedMessage: p }) : /* @__PURE__ */ E(k, {
35
- description: r,
67
+ content: a == null ? i ? /* @__PURE__ */ F(U, { unsupportedMessage: p }) : /* @__PURE__ */ F(U, {
68
+ description: n,
36
69
  viewDetailsLabel: f,
37
- onViewDetails: () => {
38
- g((e) => e + 1), c(t);
39
- }
70
+ onViewDetails: C
71
+ }) : /* @__PURE__ */ F(U, {
72
+ unresolvedReason: a,
73
+ deletedMessage: m,
74
+ notSharedMessage: g
40
75
  }),
41
- children: /* @__PURE__ */ E("span", {
42
- className: "inline-flex items-center",
43
- children: /* @__PURE__ */ E(l, {
44
- label: `/${e}`,
45
- textClassName: i ? n(a, o) : a,
46
- className: i ? n("h-auto px-2 py-0", s) : "h-auto px-2 py-0"
47
- })
76
+ children: /* @__PURE__ */ I("span", {
77
+ tabIndex: 0,
78
+ className: r("relative -me-1 -ms-1 inline-block cursor-pointer select-text rounded-full pe-1 ps-1", i ? c : "hover:bg-info focus-visible:bg-info active:bg-info", i ? r(o, s) : o, V.chip),
79
+ "aria-label": `/${e}`,
80
+ onClick: S ? () => b(!0) : void 0,
81
+ onKeyDown: w,
82
+ children: [/* @__PURE__ */ F("span", {
83
+ ref: T,
84
+ "aria-hidden": !0,
85
+ className: "inset-inline-start-0 pointer-events-none absolute top-0 select-none",
86
+ children: "/"
87
+ }), /* @__PURE__ */ F("span", {
88
+ "aria-hidden": !0,
89
+ className: "select-none",
90
+ style: { paddingInlineStart: D ?? void 0 },
91
+ children: e
92
+ })]
48
93
  })
49
- }, m);
50
- }, j = {
51
- row: "_row_1ovug_1",
52
- header: "_header_1ovug_5",
53
- emptyHint: "_emptyHint_1ovug_9",
54
- star: "_star_1ovug_13",
55
- footer: "_footer_1ovug_17",
56
- rowEnter: "_rowEnter_1ovug_25",
57
- rowFadeIn: "_rowFadeIn_1ovug_1",
58
- rowLeaving: "_rowLeaving_1ovug_29",
59
- rowFadeOut: "_rowFadeOut_1ovug_1",
60
- listContent: "_listContent_1ovug_57"
61
- }, M = "px-3 pb-0.5 pt-2", N = 180, P = 288, F = ({ favorites: r, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: c, searchQuery: f, labels: p = {}, colors: h, nameClassName: g = "dial-small-text", headerClassName: _ = "dial-tiny-lead-semi-text", emptyHintClassName: b = "dial-small-text" }) => {
62
- let { myCollectionLabel: C = "My Collection", emptyHintLabel: w = "Star a skill to pin it here", browseLabel: O = "Browse", removeFromFavoritesLabel: A = "Remove from favorites", viewDetailsLabel: F = "View details", noMatchingSkillsLabel: I = "No matching skills" } = p, L = t({
63
- "--fs-row-hover-bg": h?.rowHoverBackground,
64
- "--fs-header-text": h?.headerText,
65
- "--fs-empty-hint-text": h?.emptyHintText,
66
- "--fs-star-color": h?.starColor,
67
- "--fs-footer-border": h?.footerBorder
68
- }), [R, z] = S(/* @__PURE__ */ new Set()), B = x(/* @__PURE__ */ new Map());
69
- v(() => {
70
- let e = B.current;
94
+ }, _);
95
+ }, G = {
96
+ row: "_row_1v431_1",
97
+ header: "_header_1v431_8",
98
+ emptyHint: "_emptyHint_1v431_12",
99
+ star: "_star_1v431_16",
100
+ footer: "_footer_1v431_20",
101
+ rowEnter: "_rowEnter_1v431_28",
102
+ rowFadeIn: "_rowFadeIn_1v431_1",
103
+ rowLeaving: "_rowLeaving_1v431_32",
104
+ rowFadeOut: "_rowFadeOut_1v431_1",
105
+ listContent: "_listContent_1v431_60"
106
+ }, K = "px-3 pb-0.5 pt-2", re = 180, q = 288, J = ({ favorites: n, onSelect: i, onToggleFavorite: a, onBrowse: o, onViewDetails: s, className: l, rowClassName: u, searchQuery: d, listboxId: m, activeOptionId: g, isMenu: _ = !1, labels: v = {}, colors: y, nameClassName: x = "dial-small-text", headerClassName: S = "dial-tiny-lead-semi-text", emptyHintClassName: C = "dial-small-text" }) => {
107
+ let { myCollectionLabel: D = "My Collection", emptyHintLabel: ee = "Star a skill to pin it here", browseLabel: te = "Browse", removeFromFavoritesLabel: A = "Remove from favorites", viewDetailsLabel: j = "View details", noMatchingSkillsLabel: M = "No matching skills" } = v, N = t({
108
+ "--fs-row-hover-bg": y?.rowHoverBackground,
109
+ "--fs-header-text": y?.headerText,
110
+ "--fs-empty-hint-text": y?.emptyHintText,
111
+ "--fs-star-color": y?.starColor,
112
+ "--fs-footer-border": y?.footerBorder
113
+ }), [P, L] = k(/* @__PURE__ */ new Set()), R = O(/* @__PURE__ */ new Map());
114
+ w(() => {
115
+ let e = R.current;
71
116
  return () => {
72
117
  e.forEach((e) => clearTimeout(e)), e.clear();
73
118
  };
74
119
  }, []);
75
- let V = f != null, H = f?.toLowerCase() ?? "", U = V ? r.filter((e) => e.name.toLowerCase().includes(H)) : r, W = x(null), [G, K] = S();
76
- y(() => {
77
- W.current && K(Math.min(W.current.scrollHeight, P));
78
- }, [r, f]);
79
- let q = (e, t) => {
120
+ let z = m != null, B = _ && !z, H = z || B ? "none" : void 0, W = "button";
121
+ z ? W = "option" : B && (W = "menuitem");
122
+ let J = T(), Y = d != null, X = d?.toLowerCase() ?? "", Z = Y ? n.filter((e) => e.name.toLowerCase().includes(X)) : n, Q = O(null), [ie, ae] = k();
123
+ E(() => {
124
+ Q.current && ae(Math.min(Q.current.scrollHeight, q));
125
+ }, [n, d]);
126
+ let oe = (e, t) => {
80
127
  e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i(t));
81
- }, J = (e) => {
82
- z((t) => new Set(t).add(e));
128
+ }, se = (e) => {
129
+ L((t) => new Set(t).add(e));
83
130
  let t = setTimeout(() => {
84
- a(e), z((t) => {
131
+ a?.(e), L((t) => {
85
132
  let n = new Set(t);
86
133
  return n.delete(e), n;
87
- }), B.current.delete(e);
88
- }, N);
89
- B.current.set(e, t);
134
+ }), R.current.delete(e);
135
+ }, re);
136
+ R.current.set(e, t);
90
137
  };
91
- return /* @__PURE__ */ D("div", {
92
- className: "flex w-full flex-col desktop:w-[280px]",
93
- style: L,
138
+ return /* @__PURE__ */ I("div", {
139
+ className: r("flex w-full flex-col desktop:w-[280px]", l, V.favoritesPanel),
140
+ style: N,
94
141
  children: [
95
- /* @__PURE__ */ E("p", {
96
- className: n(_, M, j.header),
97
- children: C
142
+ /* @__PURE__ */ F("p", {
143
+ id: J,
144
+ className: r(S, K, G.header),
145
+ children: D
98
146
  }),
99
- /* @__PURE__ */ E("div", {
100
- className: n("max-h-72 min-h-0 flex-1 overflow-y-auto", j.listContent),
101
- style: { maxHeight: G },
102
- children: /* @__PURE__ */ E("div", {
103
- ref: W,
104
- children: U.length > 0 ? /* @__PURE__ */ E("ul", {
147
+ /* @__PURE__ */ F("div", {
148
+ className: r("max-h-72 min-h-0 flex-1 overflow-y-auto", G.listContent),
149
+ style: { maxHeight: ie },
150
+ children: /* @__PURE__ */ F("div", {
151
+ ref: Q,
152
+ children: Z.length > 0 ? /* @__PURE__ */ F("ul", {
153
+ id: m,
154
+ role: z ? "listbox" : H,
155
+ "aria-labelledby": z ? J : void 0,
105
156
  className: "flex flex-col gap-1 px-1 pb-1",
106
- children: U.map((t) => {
107
- let r = /* @__PURE__ */ D("div", {
108
- role: "button",
157
+ children: Z.map((t) => {
158
+ let n = z ? `${m}-${encodeURIComponent(t.id)}` : void 0, o = z ? -1 : void 0, l = /* @__PURE__ */ I("div", {
159
+ role: W,
160
+ id: n,
161
+ "aria-selected": z ? n === g : void 0,
162
+ "aria-label": t.name,
109
163
  tabIndex: 0,
110
- className: n("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", j.row),
164
+ className: r("flex cursor-pointer items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors", G.row, u),
111
165
  onClick: () => i(t),
112
- onKeyDown: (e) => q(e, t),
166
+ onKeyDown: (e) => oe(e, t),
113
167
  children: [
114
- /* @__PURE__ */ E(e, {
115
- size: s.MD,
168
+ /* @__PURE__ */ F(e, {
169
+ size: c.MD,
116
170
  initialsName: t.name
117
171
  }),
118
- f == null ? /* @__PURE__ */ E("span", {
119
- className: n(g, "min-w-0 flex-1 truncate text-start"),
172
+ d == null ? /* @__PURE__ */ F("span", {
173
+ className: r(x, "min-w-0 flex-1 truncate text-start"),
120
174
  children: t.name
121
- }) : /* @__PURE__ */ E(u, {
175
+ }) : /* @__PURE__ */ F(p, {
122
176
  text: t.name,
123
- query: f,
177
+ query: d,
124
178
  maxLines: 1,
125
- className: n(g, "min-w-0 flex-1 text-start")
179
+ className: r(x, "min-w-0 flex-1 text-start")
126
180
  }),
127
- /* @__PURE__ */ E(m, {
128
- icon: /* @__PURE__ */ E(T, {
129
- size: s.SM,
130
- className: j.star,
181
+ a && /* @__PURE__ */ F(b, {
182
+ icon: /* @__PURE__ */ F(ne, {
183
+ size: c.SM,
184
+ className: G.star,
131
185
  "aria-hidden": !0
132
186
  }),
133
187
  "aria-label": A,
134
188
  isSelected: !0,
189
+ tabIndex: o,
135
190
  onClick: (e) => {
136
- e.stopPropagation(), J(t.id);
191
+ e.stopPropagation(), se(t.id);
137
192
  }
138
193
  })
139
194
  ]
140
195
  });
141
- return /* @__PURE__ */ E("li", {
142
- className: R.has(t.id) ? j.rowLeaving : j.rowEnter,
143
- children: /* @__PURE__ */ E(d, {
196
+ return /* @__PURE__ */ F("li", {
197
+ role: H,
198
+ className: P.has(t.id) ? G.rowLeaving : G.rowEnter,
199
+ children: s ? /* @__PURE__ */ F(h, {
144
200
  asChild: !0,
145
201
  contentClassName: "max-w-[550px]",
146
- content: /* @__PURE__ */ E(k, {
202
+ content: /* @__PURE__ */ F(U, {
147
203
  description: t.description,
148
- viewDetailsLabel: F,
149
- onViewDetails: () => c(t)
204
+ viewDetailsLabel: j,
205
+ onViewDetails: () => s(t),
206
+ viewDetailsTabIndex: o
150
207
  }),
151
- children: r
152
- })
208
+ children: l
209
+ }) : l
153
210
  }, t.id);
154
211
  })
155
- }) : V && H !== "" ? /* @__PURE__ */ E("p", {
212
+ }) : Y && X !== "" ? /* @__PURE__ */ F("p", {
156
213
  role: "status",
157
214
  "aria-live": "polite",
158
- className: n(b, "px-4 py-4 text-start", j.emptyHint),
159
- children: I
160
- }) : /* @__PURE__ */ E("p", {
161
- className: n(b, "px-4 py-4 text-start", j.emptyHint),
162
- children: w
215
+ className: r(C, "px-4 py-4 text-start", G.emptyHint),
216
+ children: M
217
+ }) : /* @__PURE__ */ F("p", {
218
+ className: r(C, "px-4 py-4 text-start", G.emptyHint),
219
+ children: ee
163
220
  })
164
221
  })
165
222
  }),
166
- /* @__PURE__ */ E("div", {
167
- className: n("border-t px-2 py-3", j.footer),
168
- children: /* @__PURE__ */ E(l, {
169
- label: O,
223
+ /* @__PURE__ */ F("div", {
224
+ className: r("border-t px-2 py-3", G.footer),
225
+ children: /* @__PURE__ */ F(f, {
226
+ role: B ? "menuitem" : void 0,
227
+ label: te,
170
228
  className: "w-full justify-center",
171
229
  onClick: o
172
230
  })
173
231
  })
174
232
  ]
175
233
  });
176
- }, I = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ E(f, {
234
+ }, Y = ".zip,.md", X = ({ isOpen: e, errorText: t, isUploading: n = !1, accept: r = Y, labels: i, onClose: a, onFilesSelected: o, onFilesRejected: s }) => {
235
+ let { dialogTitle: c = "Upload skill", dropZoneLabel: l = "Drag and drop it or click here to upload", dropZoneMobileLabel: u = "Click here to upload", formatsLabel: f = "File formats .zip and SKILL.md", fileInputAriaLabel: p = "Upload a skill ZIP archive or a SKILL.md file", closeAriaLabel: m = "Close", uploadingAriaLabel: h = "Uploading skill" } = i ?? {};
236
+ return /* @__PURE__ */ F(g, {
237
+ open: e,
238
+ size: _.Sm,
239
+ header: c,
240
+ closeAriaLabel: m,
241
+ onClose: a,
242
+ children: /* @__PURE__ */ I("div", {
243
+ className: "flex flex-col gap-4 px-6 py-4",
244
+ children: [/* @__PURE__ */ F(d, {
245
+ label: /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
246
+ className: "desktop:hidden",
247
+ children: u
248
+ }), /* @__PURE__ */ F("span", {
249
+ className: "hidden desktop:inline",
250
+ children: l
251
+ })] }),
252
+ description: f,
253
+ ariaLabel: p,
254
+ accept: r,
255
+ disabled: n,
256
+ errorText: n ? void 0 : t,
257
+ onChange: o,
258
+ onReject: s
259
+ }), n && /* @__PURE__ */ F(y, { ariaLabel: h })]
260
+ })
261
+ });
262
+ }, Z = ({ isOpen: e, onClose: t, onSelect: n, title: r, renderContent: i }) => /* @__PURE__ */ F(g, {
177
263
  open: e,
178
264
  header: r,
179
- size: p.Lg,
265
+ size: _.Lg,
180
266
  className: "h-[min(90vh,860px)] !max-w-[min(95vw,1200px)] overflow-hidden",
181
267
  onClose: t,
182
- children: /* @__PURE__ */ E("div", {
268
+ children: /* @__PURE__ */ F("div", {
183
269
  className: "h-[min(80vh,840px)] overflow-auto",
184
- children: /* @__PURE__ */ E(g, {
270
+ children: /* @__PURE__ */ F(S, {
185
271
  fallback: null,
186
272
  children: e && i(n, t)
187
273
  })
188
274
  })
189
- }), L = (e) => /* @__PURE__ */ E(O, { ...e }), R = (e) => ({
275
+ }), Q = (e, t = null) => e.map((e) => e.type === z.Folder ? {
276
+ path: e.id,
277
+ name: e.name,
278
+ nodeType: L.FOLDER,
279
+ parentPath: t,
280
+ folderId: e.id,
281
+ items: Q(e.items, e.id)
282
+ } : {
283
+ path: e.id,
284
+ name: e.name,
285
+ nodeType: L.ITEM,
286
+ parentPath: t,
287
+ folderId: t ?? ""
288
+ }), ie = ({ nodes: e, selectedFileId: t, expandedFolderIds: n, onToggleFolder: r, onSelectFile: i, onClose: a, ariaLabel: o }) => /* @__PURE__ */ F(R, {
289
+ items: D(() => Q(e), [e]),
290
+ showFiles: !0,
291
+ areHiddenFilesVisible: !0,
292
+ selectedPath: t,
293
+ expandedPaths: D(() => new Set(n), [n]),
294
+ onExpandedPathsChange: (e) => {
295
+ for (let t of e) n.has(t) || r(t);
296
+ for (let t of n) e.has(t) || r(t);
297
+ },
298
+ onItemClick: (e) => {
299
+ e.nodeType === L.ITEM && i(e.path);
300
+ },
301
+ ariaLabel: o,
302
+ autoFocus: !0,
303
+ onEscape: a
304
+ }), ae = (e) => /* @__PURE__ */ F(B, {
305
+ ...e,
306
+ renderContentFileTree: (e) => /* @__PURE__ */ F(ie, { ...e })
307
+ }), oe = (e) => e == null || /[\s/]/.test(e), se = (e, t, n) => {
308
+ let r = [], i = 0;
309
+ return t.forEach((t, a) => {
310
+ let o = `/${n(t.url)}`, s = i;
311
+ for (; s <= e.length;) {
312
+ let t = e.indexOf(o, s);
313
+ if (t === -1) return;
314
+ let n = t + o.length;
315
+ if (oe(e[n])) {
316
+ r.push({
317
+ skillIndex: a,
318
+ start: t,
319
+ length: o.length
320
+ }), i = n;
321
+ return;
322
+ }
323
+ s = t + 1;
324
+ }
325
+ }), r;
326
+ }, ce = (e, t) => {
327
+ let n = Math.min(e.length, t.length), r = 0;
328
+ for (; r < n && e[r] === t[r];) r += 1;
329
+ let i = n - r, a = 0;
330
+ for (; a < i && e[e.length - 1 - a] === t[t.length - 1 - a];) a += 1;
331
+ return {
332
+ start: r,
333
+ deletedLength: e.length - r - a,
334
+ insertedLength: t.length - r - a
335
+ };
336
+ }, le = (e, t) => {
337
+ let n = t.start + t.deletedLength, r = t.insertedLength - t.deletedLength;
338
+ return e.reduce((e, i) => i.start + i.length <= t.start ? (e.push(i), e) : (i.start >= n && e.push({
339
+ ...i,
340
+ start: i.start + r
341
+ }), e), []);
342
+ }, ue = (e, t, n, r, i) => {
343
+ let a = r.length + 1, o = a + +!!i, s = e.map((e) => e.start >= t ? {
344
+ ...e,
345
+ start: e.start + o
346
+ } : e), c = {
347
+ url: n,
348
+ name: r,
349
+ start: t,
350
+ length: a
351
+ };
352
+ return [...s, c].sort((e, t) => e.start - t.start);
353
+ }, de = (e, t) => e.find((e) => e.start + e.length === t), fe = (e, t, n) => {
354
+ let r = t;
355
+ for (; r > 0 && !/\s/.test(e[r - 1]);) r--;
356
+ let i = r;
357
+ for (; i < e.length && !/\s/.test(e[i]);) i++;
358
+ let a = e.slice(r, i);
359
+ if (!(!a.startsWith(n) || a.slice(n.length).includes(n))) return {
360
+ start: r,
361
+ end: i
362
+ };
363
+ }, pe = () => {
364
+ let [e, t] = k(""), [n, r] = k([]), i = O(e);
365
+ i.current = e;
366
+ let a = O(n);
367
+ a.current = n;
368
+ let o = C((e) => {
369
+ let n = ce(i.current, e);
370
+ r((e) => le(e, n)), i.current = e, t(e);
371
+ }, []), s = C((e, n, a) => {
372
+ let o = i.current, s = !/^\s/.test(o.slice(a)), c = `/${n}${s ? " " : ""}`, l = o.slice(0, a) + c + o.slice(a);
373
+ return i.current = l, t(l), r((t) => ue(t, a, e, n, s)), s;
374
+ }, []), c = C((e) => de(a.current, e), []), l = D(() => {
375
+ if (n.length !== 0) return n.map((e) => ({ url: e.url }));
376
+ }, [n]), u = C(() => {
377
+ t(""), r([]);
378
+ }, []), d = C((e, n, i) => {
379
+ let a = n ?? [], o = se(e, a, i);
380
+ t(e), r(o.map((e) => {
381
+ let t = a[e.skillIndex];
382
+ return {
383
+ url: t.url,
384
+ name: i(t.url),
385
+ start: e.start,
386
+ length: e.length
387
+ };
388
+ }));
389
+ }, []);
390
+ return D(() => ({
391
+ draft: e,
392
+ anchors: n,
393
+ onDraftChange: o,
394
+ insertMention: s,
395
+ onBackspaceAtCaret: c,
396
+ orderedSkills: l,
397
+ reset: u,
398
+ seedFromMessage: d
399
+ }), [
400
+ e,
401
+ n,
402
+ o,
403
+ s,
404
+ c,
405
+ l,
406
+ u,
407
+ d
408
+ ]);
409
+ }, me = (e) => ({
190
410
  id: e.url,
191
411
  name: e.name,
192
412
  description: e.description
193
- }), z = (e) => {
413
+ }), he = (e) => {
194
414
  let t = e.split("/").filter((e) => e.length > 0);
195
415
  return t[t.length - 1] ?? e;
196
- }, B = ({ isEnabled: e, isSkillsSupported: t, skills: n, sharedWithMe: i, publicSkills: a, favoriteIds: o, onToggleFavorite: s, labels: l, historyChipLabelClassName: u, renderCatalogContent: d, detailsPanelComponent: f }) => {
197
- let { addMenuLabel: p = "Skills", backLabel: m = "Back", catalogModalTitleLabel: h = "Use skill", emptyQueryHintLabel: v = "Type to filter", unsupportedTooltipLabel: y = "Selected model does not support skills. Remove the skill or select different model to proceed.", panelLabels: x } = l ?? {}, w = e && t, [T, D] = S(!1), [O, k] = S(null), [j, M] = S(null), N = b(() => [
198
- ...n,
199
- ...i ?? [],
200
- ...a ?? []
416
+ }, ge = (e) => {
417
+ let t = e.split("/").filter((e) => e.length > 0);
418
+ return t[0] !== "skills" || t.length < 3 ? null : t[1];
419
+ }, _e = (e, t) => ge(e) === t ? H.Deleted : H.NotShared, ve = "/", ye = ({ isSkillsSupported: e, skills: t, sharedWithMe: n, publicSkills: r, favoriteIds: a, viewerBucket: o, onToggleFavorite: s, labels: c, historyChipLabelClassName: u, activeMentionDetailsTrigger: d, renderCatalogContent: f, detailsPanelComponent: p }) => {
420
+ let { addMenuLabel: m = "Skills", backLabel: h = "Back", catalogModalTitleLabel: g = "Use skill", emptyQueryHintLabel: _ = "Type to filter", deletedTooltipLabel: v, notSharedTooltipLabel: y, panelLabels: b } = c ?? {}, [x, w] = k(!1), [T, E] = k(null), [O, te] = k(0), [A, j] = k(0), [ne, M] = k(void 0), N = pe(), P = D(() => [
421
+ ...t,
422
+ ...n ?? [],
423
+ ...r ?? []
201
424
  ], [
425
+ t,
202
426
  n,
203
- i,
204
- a
205
- ]), P = b(() => new Map(N.map((e) => [e.url, e])), [N]), L = b(() => N.filter((e) => o.has(e.url)).map((e) => R(e)), [N, o]), B = b(() => j == null ? null : P.get(j) ?? null, [P, j]), V = B != null && !t, H = _((e) => {
206
- M(e);
207
- }, []), U = _(() => {
208
- M(null);
209
- }, []), W = j, G = b(() => j == null ? void 0 : [{ url: j }], [j]), K = b(() => B == null ? null : /* @__PURE__ */ E(A, {
210
- name: B.name,
211
- path: B.url,
212
- description: B.description,
213
- isUnsupported: V,
214
- onViewDetails: k,
215
- labels: {
216
- viewDetailsLabel: x?.viewDetailsLabel,
217
- unsupportedTooltipLabel: y
218
- }
219
- }), [
220
- B,
221
- V,
222
- x,
427
+ r
428
+ ]), I = D(() => new Map(P.map((e) => [e.url, e])), [P]), L = C((e) => I.get(e)?.name ?? he(e), [I]), R = D(() => P.filter((e) => a.has(e.url)).map((e) => me(e)), [P, a]), z = N.anchors.length > 0 && !e, B = D(() => N.anchors.map((t) => ({
429
+ start: t.start,
430
+ length: t.length,
431
+ isUnsupported: !e,
432
+ render: () => /* @__PURE__ */ F(W, {
433
+ name: t.name,
434
+ path: t.url,
435
+ labelClassName: u,
436
+ description: I.get(t.url)?.description,
437
+ isUnsupported: !e,
438
+ detailsTrigger: d,
439
+ onViewDetails: E,
440
+ labels: { viewDetailsLabel: b?.viewDetailsLabel }
441
+ })
442
+ })), [
443
+ N.anchors,
444
+ e,
445
+ I,
446
+ u,
447
+ d,
448
+ b
449
+ ]), V = C((e, t, n) => {
450
+ let r = N.insertMention(e, t, n);
451
+ j((e) => e + 1), M(n + 1 + t.length + +!!r);
452
+ }, [N]), H = C((e) => {
453
+ let t = fe(N.draft, e, ve);
454
+ return t == null ? e : (N.onDraftChange(N.draft.slice(0, t.start) + N.draft.slice(t.end)), t.start);
455
+ }, [N]), U = C(() => {
456
+ N.reset(), j((e) => e + 1), M(void 0);
457
+ }, [N]), G = C((e, t) => {
458
+ N.seedFromMessage(e, t, L), j((e) => e + 1), M(void 0);
459
+ }, [N, L]), K = C((e, t) => {
460
+ if (t == null || t.length === 0) return null;
461
+ let n = se(e, t, L), r = [], i = 0;
462
+ return n.forEach((n) => {
463
+ n.start > i && r.push(e.slice(i, n.start));
464
+ let a = t[n.skillIndex], s = I.get(a.url), c = s?.name ?? he(a.url), l = s == null ? _e(a.url, o) : void 0;
465
+ r.push(/* @__PURE__ */ F(W, {
466
+ name: c,
467
+ path: a.url,
468
+ labelClassName: u,
469
+ description: s?.description,
470
+ unresolvedReason: l,
471
+ onViewDetails: E,
472
+ labels: {
473
+ viewDetailsLabel: b?.viewDetailsLabel,
474
+ deletedTooltipLabel: v,
475
+ notSharedTooltipLabel: y
476
+ }
477
+ }, `${a.url}-${n.start}`)), i = n.start + n.length;
478
+ }), i < e.length && r.push(e.slice(i)), r;
479
+ }, [
480
+ L,
481
+ I,
482
+ u,
483
+ b,
484
+ o,
485
+ v,
223
486
  y
224
- ]), q = _((e) => e == null || e.length === 0 ? null : e.map((e) => {
225
- let t = P.get(e.url);
226
- return /* @__PURE__ */ E(A, {
227
- name: t?.name ?? z(e.url),
487
+ ]), re = C((e) => e == null || e.length === 0 ? null : e.map((e) => {
488
+ let t = I.get(e.url), n = t?.name ?? he(e.url), r = t == null ? _e(e.url, o) : void 0;
489
+ return /* @__PURE__ */ F(W, {
490
+ name: n,
228
491
  path: e.url,
229
492
  labelClassName: u,
230
493
  description: t?.description,
231
- onViewDetails: k,
232
- labels: { viewDetailsLabel: x?.viewDetailsLabel }
494
+ unresolvedReason: r,
495
+ onViewDetails: E,
496
+ labels: {
497
+ viewDetailsLabel: b?.viewDetailsLabel,
498
+ deletedTooltipLabel: v,
499
+ notSharedTooltipLabel: y
500
+ }
233
501
  }, e.url);
234
502
  }), [
235
- P,
503
+ I,
236
504
  u,
237
- x
238
- ]), J = _((e) => /* @__PURE__ */ E(F, {
239
- favorites: L,
240
- onSelect: (t) => {
241
- H(t.id), e();
505
+ b,
506
+ o,
507
+ v,
508
+ y
509
+ ]), q = C((e, t) => /* @__PURE__ */ F(J, {
510
+ favorites: R,
511
+ isMenu: !0,
512
+ onSelect: (n) => {
513
+ V(n.id, n.name, H(t)), e();
242
514
  },
243
515
  onToggleFavorite: s,
244
516
  onBrowse: () => {
245
- e(), D(!0);
517
+ te(H(t)), e(), w(!0);
246
518
  },
247
- onViewDetails: (t) => {
248
- e(), k(t.id);
519
+ onViewDetails: (n) => {
520
+ H(t), e(), E(n.id);
249
521
  },
250
- labels: x
522
+ labels: b
251
523
  }), [
252
- L,
253
- H,
254
- s,
255
- x
256
- ]), Y = b(() => w ? {
257
- key: "skills",
258
- title: p,
259
- icon: /* @__PURE__ */ E(C, {
260
- size: r,
261
- "aria-hidden": !0,
262
- stroke: c
263
- }),
264
- renderOverlay: J,
265
- backLabel: m
266
- } : void 0, [
267
- w,
268
- p,
269
- m,
270
- J
271
- ]), X = b(() => w ? {
272
- triggerPrefix: "/",
273
- menuLabel: p,
274
- emptyQueryHint: v,
275
- renderMenu: ({ query: e, close: t }) => /* @__PURE__ */ E(F, {
276
- favorites: L,
277
- searchQuery: e,
278
- onSelect: (e) => {
279
- t({ consumeQuery: !0 }), H(e.id);
280
- },
281
- onToggleFavorite: s,
282
- onBrowse: () => {
283
- t({ consumeQuery: !0 }), D(!0);
284
- },
285
- onViewDetails: (e) => {
286
- t({ consumeQuery: !0 }), k(e.id);
287
- },
288
- labels: x
289
- })
290
- } : void 0, [
291
- w,
292
- p,
293
- v,
294
- L,
524
+ R,
525
+ V,
295
526
  H,
296
527
  s,
297
- x
528
+ b
298
529
  ]);
299
- return e ? {
300
- skillMenuOverlay: Y,
301
- commandMenu: X,
302
- skillCatalogModal: /* @__PURE__ */ E(I, {
303
- isOpen: T,
304
- onClose: () => D(!1),
530
+ return {
531
+ skillMenuOverlay: D(() => e ? {
532
+ key: "skills",
533
+ title: m,
534
+ icon: /* @__PURE__ */ F(ee, {
535
+ size: i,
536
+ "aria-hidden": !0,
537
+ stroke: l
538
+ }),
539
+ renderOverlay: q,
540
+ backLabel: h
541
+ } : void 0, [
542
+ e,
543
+ m,
544
+ h,
545
+ q
546
+ ]),
547
+ commandMenu: D(() => e ? {
548
+ triggerPrefix: ve,
549
+ menuLabel: m,
550
+ emptyQueryHint: _,
551
+ renderMenu: ({ query: e, caretPosition: t, close: n, listboxId: r, activeOptionId: i }) => /* @__PURE__ */ F(J, {
552
+ favorites: R,
553
+ searchQuery: e,
554
+ listboxId: r,
555
+ activeOptionId: i,
556
+ onSelect: (e) => {
557
+ n({ consumeQuery: !0 }), V(e.id, e.name, t);
558
+ },
559
+ onToggleFavorite: s,
560
+ onBrowse: () => {
561
+ n({ consumeQuery: !0 }), te(t), w(!0);
562
+ },
563
+ onViewDetails: (e) => {
564
+ n({ consumeQuery: !0 }), E(e.id);
565
+ },
566
+ labels: b
567
+ })
568
+ } : void 0, [
569
+ e,
570
+ m,
571
+ _,
572
+ R,
573
+ V,
574
+ s,
575
+ b
576
+ ]),
577
+ skillCatalogModal: /* @__PURE__ */ F(Z, {
578
+ isOpen: x,
579
+ onClose: () => w(!1),
305
580
  onSelect: (e) => {
306
- H(e), D(!1);
581
+ V(e, L(e), O), w(!1);
307
582
  },
308
- title: h,
309
- renderContent: d
583
+ title: g,
584
+ renderContent: f
310
585
  }),
311
- skillDetailsPanel: /* @__PURE__ */ E(g, {
586
+ skillDetailsPanel: /* @__PURE__ */ F(S, {
312
587
  fallback: null,
313
- children: /* @__PURE__ */ E(f, {
314
- skillId: O,
315
- onClose: () => k(null)
588
+ children: /* @__PURE__ */ F(p, {
589
+ skillId: T,
590
+ onClose: () => E(null)
316
591
  })
317
592
  }),
318
- selectedSkillElement: K,
319
- selectedSkillPath: W,
320
- selectedSkills: G,
321
- isSkillUnsupported: V,
322
- selectSkill: H,
323
- removeSelectedSkill: U,
324
- renderHistorySkills: q
325
- } : {
326
- skillMenuOverlay: void 0,
327
- commandMenu: void 0,
328
- skillCatalogModal: null,
329
- skillDetailsPanel: null,
330
- selectedSkillElement: null,
331
- selectedSkillPath: null,
332
- selectedSkills: void 0,
333
- isSkillUnsupported: !1,
334
- selectSkill: () => void 0,
335
- removeSelectedSkill: () => void 0,
336
- renderHistorySkills: () => null
593
+ message: N.draft,
594
+ messageRevision: A,
595
+ activeMentions: B,
596
+ onDraftChange: N.onDraftChange,
597
+ onBackspaceAtCaret: N.onBackspaceAtCaret,
598
+ caretPositionOverride: ne,
599
+ isSkillUnsupported: z,
600
+ selectedSkills: N.orderedSkills,
601
+ resetSkillMentions: U,
602
+ seedSkillMentions: G,
603
+ renderHistorySkillSegments: K,
604
+ renderHistorySkills: re
605
+ };
606
+ }, $ = {
607
+ background: "_background_14zdf_1",
608
+ border: "_border_14zdf_5",
609
+ value: "_value_14zdf_9",
610
+ clear: "_clear_14zdf_13",
611
+ invalid: "_invalid_14zdf_17"
612
+ }, be = [], xe = ({ value: e, onChange: i, displayName: a, favorites: o = be, onToggleFavorite: s, onViewDetails: c, renderOverlay: d, isSkillsSupported: p, isDisabled: h = !1, isInvalid: g = !1, labelledById: _, describedById: y, labels: b, renderCatalogContent: x, className: S, styles: C }) => {
613
+ let [E, D] = k(!1), [ee, A] = k(!1), [j, ne] = k(""), M = O(null), L = T(), R = O(null), z = O(!1), B = n(e, p), H = p && !h, U = E && H, W = ee && H, G = () => {
614
+ R.current && !R.current.disabled ? R.current.focus() : M.current?.querySelector("button:not(:disabled)")?.focus();
337
615
  };
616
+ w(() => {
617
+ z.current && !U && !W && ((document.activeElement === document.body || M.current?.contains(document.activeElement)) && G(), D(!1), A(!1)), z.current = U || W;
618
+ }, [U, W]);
619
+ let K = (e) => {
620
+ e && !H || (ne(""), D(e));
621
+ }, re = (e) => {
622
+ H && i(e), D(!1), A(!1);
623
+ }, q = {
624
+ ...t({
625
+ "--ssf-text": C?.colors?.text,
626
+ "--ssf-bg": C?.colors?.background,
627
+ "--ssf-border": C?.colors?.border,
628
+ "--ssf-error": C?.colors?.error
629
+ }),
630
+ ...C?.cssVars
631
+ }, Y = /* @__PURE__ */ I("div", {
632
+ id: L,
633
+ className: "w-full min-w-0",
634
+ children: [/* @__PURE__ */ F("div", {
635
+ className: "p-2",
636
+ children: /* @__PURE__ */ F(v, {
637
+ value: j,
638
+ onChange: (e) => ne(e ?? ""),
639
+ placeholder: b.searchPlaceholder ?? "Search skills",
640
+ "aria-label": b.searchPlaceholder ?? "Search skills",
641
+ clearLabel: b.clearSearchLabel ?? "Clear search"
642
+ })
643
+ }), /* @__PURE__ */ F(J, {
644
+ className: "min-w-0 desktop:w-full",
645
+ rowClassName: "min-h-11",
646
+ favorites: o,
647
+ searchQuery: j,
648
+ labels: b.panelLabels,
649
+ onSelect: (e) => re(e.id),
650
+ onToggleFavorite: s,
651
+ onViewDetails: c ? (e) => {
652
+ D(!1), c(e);
653
+ } : void 0,
654
+ onBrowse: () => {
655
+ D(!1), A(!0);
656
+ }
657
+ })]
658
+ }), X = /* @__PURE__ */ F(m, {
659
+ inputRef: R,
660
+ readOnly: !0,
661
+ role: "combobox",
662
+ "aria-haspopup": "dialog",
663
+ "aria-expanded": U,
664
+ "aria-controls": U ? L : void 0,
665
+ "aria-labelledby": _,
666
+ "aria-describedby": y,
667
+ "aria-invalid": g || B,
668
+ disabled: !H,
669
+ invalid: g || B,
670
+ value: e ? a || e : "",
671
+ placeholder: b.placeholder,
672
+ title: p ? e ? a || e : void 0 : b.unsupportedTooltipLabel,
673
+ containerClassName: "w-full min-w-0",
674
+ wrapperClassName: r("cursor-pointer", "--ssf-bg" in q && $.background, "--ssf-border" in q && $.border, (g || B) && $.invalid, C?.triggerClassName),
675
+ className: r("min-w-0 cursor-pointer text-ellipsis", "--ssf-text" in q && $.value, C?.typography?.fontClassName ?? "dial-small-text"),
676
+ onKeyDown: (e) => {
677
+ [
678
+ "Enter",
679
+ " ",
680
+ "ArrowDown"
681
+ ].includes(e.key) ? (e.preventDefault(), e.stopPropagation(), K(e.key === "ArrowDown" || !U)) : e.key === "Escape" && K(!1);
682
+ },
683
+ iconAfter: /* @__PURE__ */ I("span", {
684
+ className: "flex shrink-0 items-center",
685
+ children: [e && /* @__PURE__ */ F(f, {
686
+ type: "button",
687
+ className: r("size-11 shrink-0", $.clear),
688
+ disabled: h,
689
+ "aria-label": b.removeSkillLabel,
690
+ onKeyDown: (e) => e.stopPropagation(),
691
+ onClick: (e) => {
692
+ e.stopPropagation(), i(void 0), D(!1), H ? R.current?.focus() : M.current?.focus();
693
+ },
694
+ iconBefore: /* @__PURE__ */ F(N, {
695
+ "aria-hidden": !0,
696
+ size: 18,
697
+ stroke: l
698
+ })
699
+ }), /* @__PURE__ */ F(te, {
700
+ "aria-hidden": !0,
701
+ size: 20,
702
+ stroke: l,
703
+ className: r("transition-transform", U && "rotate-180")
704
+ })]
705
+ })
706
+ });
707
+ return /* @__PURE__ */ I("div", {
708
+ ref: M,
709
+ role: "group",
710
+ "aria-labelledby": _,
711
+ tabIndex: -1,
712
+ className: r("min-w-0", S, V.selectorField),
713
+ style: q,
714
+ children: [d ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("div", {
715
+ className: "w-full min-w-0",
716
+ onClick: () => K(!U),
717
+ children: X
718
+ }), d(Y, U, () => K(!1))] }) : /* @__PURE__ */ F(u, {
719
+ open: U,
720
+ onOpenChange: K,
721
+ disabled: !H,
722
+ className: "w-full min-w-0",
723
+ listClassName: "w-[min(var(--reference-width),calc(100vw-2rem))] max-w-full",
724
+ renderOverlay: () => /* @__PURE__ */ F("div", {
725
+ role: "dialog",
726
+ "aria-labelledby": _,
727
+ children: Y
728
+ }),
729
+ initialFocus: 0,
730
+ children: X
731
+ }), W && /* @__PURE__ */ F(Z, {
732
+ isOpen: !0,
733
+ onClose: () => A(!1),
734
+ title: b.modalTitle,
735
+ onSelect: re,
736
+ renderContent: x
737
+ })]
738
+ });
338
739
  };
339
740
  //#endregion
340
- export { A as ChatSkill, F as FavoriteSkillsPanel, I as SkillCatalogModal, L as SkillDetailsSidePanel, k as SkillInfoTooltipContent, R as buildFavoriteSkillItem, B as useSkillSelectorOverlay };
741
+ export { W as ChatSkill, J as FavoriteSkillsPanel, V as SKILLS_CLASS, X as SkillArchiveUploadDialog, Z as SkillCatalogModal, ie as SkillContentFileTree, ae as SkillDetailsSidePanel, U as SkillInfoTooltipContent, xe as SkillSelectorField, H as SkillUnresolvedReason, me as buildFavoriteSkillItem, ce as diffTextChange, de as findMentionAtCaret, he as getSkillFallbackName, ue as insertAnchor, se as matchSkillMentions, le as reconcileAnchors, pe as useSkillMentions, ye as useSkillSelectorOverlay };