@epam/ai-dial-skills 1.3.0-dev.252 → 1.3.0-dev.256

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