@epam/ai-dial-projects 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,304 +1,305 @@
1
- import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as e, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as t, MarkdownRenderer as n, PROHIBITED_CONVERSATION_NAME_CHARS_RE as r, PanelEmptyState as i, RequestStatus as a, TextRefinementField as o, buildCssVars as ee, getAttachmentTypeFromMime as s, inferMimeTypeFromPath as c, mergeClasses as l, useAvailableHeightCap as u, useTextRefinement as d } from "@epam/ai-dial-chat-shared";
2
- import { Button as te, ButtonAppearance as f, ButtonDropdown as p, ButtonVariant as m, CardShell as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as ne, EllipsisTooltip as y, ErrorText as b, FileDropzone as re, FolderPath as x, GhostButton as S, GhostIconButton as C, Highlight as w, Input as T, Label as E, LiveRegion as ie, LiveRegionElement as ae, LiveRegionPoliteness as oe, MenuItemMark as D, NeutralButton as se, ProgressBar as O, ProgressBarRole as ce, Search as le, Spinner as ue, Textarea as de } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowNarrowLeft as fe, IconArrowsSort as k, IconDotsVertical as pe, IconPin as A, IconPinFilled as j } from "@tabler/icons-react";
4
- import { Suspense as M, lazy as N, memo as P, useCallback as F, useEffect as I, useId as L, useMemo as R, useRef as z, useState as B } from "react";
5
- import { Fragment as me, jsx as V, jsxs as H } from "react/jsx-runtime";
6
- import { AttachmentCard as he, FileDndOverlay as ge } from "@epam/ai-dial-attachment-input";
7
- import { BuilderFormContainer as _e } from "@epam/ai-dial-builder-form";
8
- import { LazyMarkdownEditor as ve } from "@epam/ai-dial-ui-kit/editors";
1
+ import { DeleteConfirmationDialog as e, InitialsAvatar as t, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as n, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as r, MarkdownRenderer as i, PROHIBITED_CONVERSATION_NAME_CHARS_RE as a, PanelEmptyState as o, RequestStatus as s, TextRefinementField as c, buildCssVars as ee, getAttachmentTypeFromMime as l, inferMimeTypeFromPath as u, mergeClasses as d, useAvailableHeightCap as f, useTextRefinement as p } from "@epam/ai-dial-chat-shared";
2
+ import { Button as m, ButtonAppearance as h, ButtonDropdown as g, ButtonVariant as _, CardShell as v, DIAL_ICON_SIZE as y, DIAL_KIT_ICON_STROKE as b, Dropdown as x, ElementSize as S, EllipsisTooltip as C, ErrorText as w, FileDropzone as T, FolderPath as E, GhostButton as D, GhostIconButton as O, Highlight as k, Input as te, Label as A, LiveRegion as j, LiveRegionElement as ne, LiveRegionPoliteness as M, MenuItemMark as N, NeutralButton as re, Popup as P, PopupSize as ie, ProgressBar as F, ProgressBarRole as I, Search as L, Spinner as ae, Textarea as R } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowNarrowLeft as z, IconArrowsSort as oe, IconDotsVertical as se, IconPin as ce, IconPinFilled as le } from "@tabler/icons-react";
4
+ import { Suspense as ue, lazy as de, memo as B, useCallback as V, useEffect as fe, useId as H, useMemo as U, useRef as W, useState as G } from "react";
5
+ import { Fragment as pe, jsx as K, jsxs as q } from "react/jsx-runtime";
6
+ import { AttachmentCard as me, FileDndOverlay as he } from "@epam/ai-dial-attachment-input";
7
+ import { BuilderFormContainer as ge } from "@epam/ai-dial-builder-form";
8
+ import { LazyMarkdownEditor as _e } from "@epam/ai-dial-ui-kit/editors";
9
9
  //#region src/types/projects-sort-key.ts
10
- var U = /* @__PURE__ */ function(e) {
10
+ var ve = /* @__PURE__ */ function(e) {
11
11
  return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
12
- }({}), ye = (e, t) => {
12
+ }({}), J = (e, t) => {
13
13
  let n = t.trim().toLocaleLowerCase();
14
14
  return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
15
- }, be = (e, t, n) => {
15
+ }, ye = (e, t, n) => {
16
16
  let r = new Intl.Collator(n, {
17
17
  sensitivity: "base",
18
18
  numeric: !0
19
19
  }), i = (e, t) => r.compare(e.name, t.name), a = (e, t) => Number(t.isPinned ?? !1) - Number(e.isPinned ?? !1);
20
- if (t === U.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
- let o = t === U.Oldest ? 1 : -1;
20
+ if (t === ve.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
+ let o = t === ve.Oldest ? 1 : -1;
22
22
  return [...e].sort((e, t) => {
23
23
  let n = a(e, t);
24
24
  return n === 0 ? e.updatedAt == null && t.updatedAt == null ? i(e, t) : e.updatedAt == null ? 1 : t.updatedAt == null ? -1 : (e.updatedAt - t.updatedAt) * o || i(e, t) : n;
25
25
  });
26
- }, xe = 60, Se = 3600, W = 24 * Se, G = [
27
- ["year", 365 * W],
28
- ["month", 30 * W],
29
- ["week", 7 * W],
30
- ["day", W],
31
- ["hour", Se],
32
- ["minute", xe]
26
+ }, be = 60, xe = 3600, Y = 24 * xe, Se = [
27
+ ["year", 365 * Y],
28
+ ["month", 30 * Y],
29
+ ["week", 7 * Y],
30
+ ["day", Y],
31
+ ["hour", xe],
32
+ ["minute", be]
33
33
  ], Ce = (e, t, n) => {
34
34
  let r = (t - e) / 1e3;
35
- for (let [e, t] of G) {
35
+ for (let [e, t] of Se) {
36
36
  let i = Math.floor(r / t);
37
37
  if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
38
38
  }
39
39
  return new Intl.RelativeTimeFormat(n, { numeric: "auto" }).format(0, "second");
40
- }, K = {
41
- card: "_card_1o77o_1",
42
- title: "_title_1o77o_5",
43
- updatedAt: "_updatedAt_1o77o_9",
44
- path: "_path_1o77o_13",
45
- pin: "_pin_1o77o_17",
46
- link: "_link_1o77o_23",
47
- aboveLink: "_aboveLink_1o77o_39",
48
- interactive: "_interactive_1o77o_44"
49
- }, we = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Te = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ee = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, href: a, onOpen: o, now: ee, locale: s, updatedAtClassName: c, titleClassName: u, pathLabelClassName: d, pathLeafClassName: te }) => {
50
- let f = /* @__PURE__ */ V(w, {
40
+ }, X = {
41
+ card: "_card_1cdi4_1",
42
+ title: "_title_1cdi4_5",
43
+ updatedAt: "_updatedAt_1cdi4_9",
44
+ path: "_path_1cdi4_13",
45
+ pin: "_pin_1cdi4_17",
46
+ link: "_link_1cdi4_23",
47
+ aboveLink: "_aboveLink_1cdi4_39",
48
+ interactive: "_interactive_1cdi4_44"
49
+ }, we = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Te = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ee = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, href: a, onOpen: o, now: s, locale: c, updatedAtClassName: ee, titleClassName: l, pathLabelClassName: u, pathLeafClassName: f }) => {
50
+ let p = /* @__PURE__ */ K(k, {
51
51
  text: e.name,
52
52
  query: t,
53
53
  maxLines: 1,
54
- className: l("min-w-0", u, K.title, a != null && K.aboveLink)
54
+ className: d("min-w-0", l, X.title, a != null && X.aboveLink)
55
55
  });
56
- return /* @__PURE__ */ V("li", {
56
+ return /* @__PURE__ */ K("li", {
57
57
  className: "flex min-w-0",
58
- children: /* @__PURE__ */ H(h, {
58
+ children: /* @__PURE__ */ q(v, {
59
59
  "aria-label": e.name,
60
- className: l("relative flex w-full min-w-0 flex-col gap-2", K.card, a != null && "has-focus-visible:-translate-y-[3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", a != null && K.interactive),
60
+ className: d("relative flex w-full min-w-0 flex-col gap-2", X.card, a != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", a != null && X.interactive),
61
61
  children: [
62
- e.updatedAt != null && /* @__PURE__ */ V("time", {
62
+ e.updatedAt != null && /* @__PURE__ */ K("time", {
63
63
  dateTime: new Date(e.updatedAt).toISOString(),
64
- className: l(c, K.updatedAt),
65
- children: Ce(e.updatedAt, ee, s)
64
+ className: d(ee, X.updatedAt),
65
+ children: Ce(e.updatedAt, s, c)
66
66
  }),
67
- /* @__PURE__ */ H("div", {
67
+ /* @__PURE__ */ q("div", {
68
68
  className: "flex min-w-0 items-center gap-2",
69
- children: [a == null ? /* @__PURE__ */ V("div", {
69
+ children: [a == null ? /* @__PURE__ */ K("div", {
70
70
  className: "min-w-0 flex-1",
71
- children: f
72
- }) : /* @__PURE__ */ V("a", {
71
+ children: p
72
+ }) : /* @__PURE__ */ K("a", {
73
73
  href: a,
74
74
  onClick: (t) => {
75
75
  o != null && Te(t) && (t.preventDefault(), o(e.id));
76
76
  },
77
- className: l("min-w-0 flex-1", K.link),
78
- children: f
79
- }), e.isPinned && /* @__PURE__ */ H("span", {
80
- className: l("shrink-0", K.pin),
81
- children: [/* @__PURE__ */ V(j, {
82
- size: g.SM,
77
+ className: d("min-w-0 flex-1", X.link),
78
+ children: p
79
+ }), e.isPinned && /* @__PURE__ */ q("span", {
80
+ className: d("shrink-0", X.pin),
81
+ children: [/* @__PURE__ */ K(le, {
82
+ size: y.SM,
83
83
  "aria-hidden": !0
84
- }), /* @__PURE__ */ V("span", {
84
+ }), /* @__PURE__ */ K("span", {
85
85
  className: "sr-only",
86
86
  children: i
87
87
  })]
88
88
  })]
89
89
  }),
90
- /* @__PURE__ */ V(x, {
90
+ /* @__PURE__ */ K(E, {
91
91
  segments: we(n, e.parentPath),
92
92
  ariaLabel: r,
93
- labelClassName: l(d, K.path),
94
- leafClassName: l(te, K.path),
95
- className: l(a != null && K.aboveLink)
93
+ labelClassName: d(u, X.path),
94
+ leafClassName: d(f, X.path),
95
+ className: d(a != null && X.aboveLink)
96
96
  })
97
97
  ]
98
98
  })
99
99
  });
100
- }, q = {
100
+ }, Z = {
101
101
  container: "_container_qfuxj_1",
102
102
  subtitle: "_subtitle_qfuxj_5",
103
103
  sortButton: "_sortButton_qfuxj_9"
104
- }, J = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: a, onCreateProject: o, onOpenProject: s, getProjectHref: c, searchQuery: u, onSearchQueryChange: d, sortKey: h, onSortKeyChange: v, labels: y, locale: b, styles: re }) => {
105
- let { colors: x, typography: C } = re ?? {}, w = C?.titleClassName ?? "dial-h2-text", T = C?.subtitleClassName ?? "dial-body-text", E = C?.cardTitleClassName ?? "dial-body-semi-text", oe = C?.pathLabelClassName ?? "dial-tiny-text", se = C?.pathLeafClassName ?? "dial-tiny-semi-text", O = C?.updatedAtClassName ?? "dial-tiny-text", ce = C?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", de = ee({
106
- "--pr-bg": x?.background,
107
- "--pr-subtitle-text": x?.subtitleText,
108
- "--pr-sort-text": x?.sortButtonText,
109
- "--pr-card-bg": x?.cardBackground,
110
- "--pr-card-title-text": x?.cardTitleText,
111
- "--pr-updated-at-text": x?.updatedAtText,
112
- "--pr-path-text": x?.pathText
113
- }), [fe] = B(() => Date.now()), pe = u.trim(), A = r.length > 0, j = A && e.length === 0, M = R(() => be(ye(e, u), h, b), [
104
+ }, De = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onOpenProject: s, getProjectHref: c, searchQuery: l, onSearchQueryChange: u, sortKey: f, onSortKeyChange: p, labels: v, locale: x, styles: C }) => {
105
+ let { colors: w, typography: T } = C ?? {}, E = T?.titleClassName ?? "dial-h2-text", O = T?.subtitleClassName ?? "dial-body-text", k = T?.cardTitleClassName ?? "dial-body-semi-text", te = T?.pathLabelClassName ?? "dial-tiny-text", A = T?.pathLeafClassName ?? "dial-tiny-semi-text", M = T?.updatedAtClassName ?? "dial-tiny-text", re = T?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", P = ee({
106
+ "--pr-bg": w?.background,
107
+ "--pr-subtitle-text": w?.subtitleText,
108
+ "--pr-sort-text": w?.sortButtonText,
109
+ "--pr-card-bg": w?.cardBackground,
110
+ "--pr-card-title-text": w?.cardTitleText,
111
+ "--pr-updated-at-text": w?.updatedAtText,
112
+ "--pr-path-text": w?.pathText,
113
+ "--pr-card-focus-outline": w?.cardFocusOutline
114
+ }), [ie] = G(() => Date.now()), F = l.trim(), I = r.length > 0, R = I && e.length === 0, z = U(() => ye(J(e, l), f, x), [
114
115
  e,
115
- u,
116
- h,
117
- b
118
- ]), N = y.sortOptions.find((e) => e.value === h)?.label ?? y.sortLabel, P = R(() => y.sortOptions.map((e) => ({
116
+ l,
117
+ f,
118
+ x
119
+ ]), se = v.sortOptions.find((e) => e.value === f)?.label ?? v.sortLabel, ce = U(() => v.sortOptions.map((e) => ({
119
120
  key: e.value,
120
121
  label: e.label,
121
- mark: D.Check,
122
- checked: e.value === h,
123
- onClick: () => v(e.value)
122
+ mark: N.Check,
123
+ checked: e.value === f,
124
+ onClick: () => p(e.value)
124
125
  })), [
125
- y.sortOptions,
126
- h,
127
- v
128
- ]), F = (e) => {
129
- d(e ?? "");
130
- }, I = () => {
131
- if (!t) return n ? y.errorLabel : A ? y.incompleteLabel : e.length === 0 ? y.emptyStateLabel : M.length === 0 ? y.noResultsLabel : y.resultCountLabel(M.length);
132
- }, L = (e, t) => o ? /* @__PURE__ */ V(te, {
133
- label: y.createProjectLabel,
126
+ v.sortOptions,
127
+ f,
128
+ p
129
+ ]), le = (e) => {
130
+ u(e ?? "");
131
+ }, ue = () => {
132
+ if (!t) return n ? v.errorLabel : I ? v.incompleteLabel : e.length === 0 ? v.emptyStateLabel : z.length === 0 ? v.noResultsLabel : v.resultCountLabel(z.length);
133
+ }, de = (e, t) => a ? /* @__PURE__ */ K(m, {
134
+ label: v.createProjectLabel,
134
135
  variant: e,
135
- onClick: o,
136
- className: l("shrink-0", t)
137
- }) : void 0, z = () => t ? /* @__PURE__ */ V(ue, {}) : n || j ? /* @__PURE__ */ H("div", {
136
+ onClick: a,
137
+ className: d("shrink-0", t)
138
+ }) : void 0, B = () => t ? /* @__PURE__ */ K(ae, {}) : n || R ? /* @__PURE__ */ q("div", {
138
139
  className: "flex flex-col items-center gap-3",
139
- children: [/* @__PURE__ */ V("p", {
140
- className: l(T, q.subtitle),
141
- children: n ? y.errorLabel : y.incompleteLabel
142
- }), /* @__PURE__ */ V(S, {
143
- label: y.retryLabel,
144
- onClick: a
140
+ children: [/* @__PURE__ */ K("p", {
141
+ className: d(O, Z.subtitle),
142
+ children: n ? v.errorLabel : v.incompleteLabel
143
+ }), /* @__PURE__ */ K(D, {
144
+ label: v.retryLabel,
145
+ onClick: i
145
146
  })]
146
- }) : e.length === 0 ? /* @__PURE__ */ V(i, {
147
- label: y.emptyStateLabel,
148
- description: y.emptyStateDescription,
149
- action: L(m.Secondary, "mt-2"),
147
+ }) : e.length === 0 ? /* @__PURE__ */ K(o, {
148
+ label: v.emptyStateLabel,
149
+ description: v.emptyStateDescription,
150
+ action: de(_.Secondary, "mt-2"),
150
151
  containerClassName: "p-3",
151
152
  labelClassName: "mt-3",
152
- descriptionClassName: ce
153
- }) : M.length === 0 ? /* @__PURE__ */ V(i, {
154
- label: y.noResultsLabel,
153
+ descriptionClassName: re
154
+ }) : z.length === 0 ? /* @__PURE__ */ K(o, {
155
+ label: v.noResultsLabel,
155
156
  containerClassName: "p-3",
156
157
  labelClassName: "mt-3"
157
- }) : /* @__PURE__ */ V("ul", {
158
+ }) : /* @__PURE__ */ K("ul", {
158
159
  className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-5 p-0 desktop:grid-cols-3",
159
- children: M.map((e) => /* @__PURE__ */ V(Ee, {
160
+ children: z.map((e) => /* @__PURE__ */ K(Ee, {
160
161
  project: e,
161
- searchQuery: pe,
162
- sourceLabel: y.sourceLabels[e.source],
163
- folderPathLabel: y.folderPathLabel,
164
- pinnedLabel: y.pinnedLabel ?? "Pinned",
162
+ searchQuery: F,
163
+ sourceLabel: v.sourceLabels[e.source],
164
+ folderPathLabel: v.folderPathLabel,
165
+ pinnedLabel: v.pinnedLabel ?? "Pinned",
165
166
  href: c?.(e.id),
166
167
  onOpen: s,
167
- now: fe,
168
- locale: b,
169
- updatedAtClassName: O,
170
- titleClassName: E,
171
- pathLabelClassName: oe,
172
- pathLeafClassName: se
168
+ now: ie,
169
+ locale: x,
170
+ updatedAtClassName: M,
171
+ titleClassName: k,
172
+ pathLabelClassName: te,
173
+ pathLeafClassName: A
173
174
  }, e.id))
174
- }), me = t || n || j;
175
- return /* @__PURE__ */ H("div", {
176
- style: de,
177
- className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", q.container),
175
+ }), V = t || n || R;
176
+ return /* @__PURE__ */ q("div", {
177
+ style: P,
178
+ className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", Z.container),
178
179
  children: [
179
- /* @__PURE__ */ H("div", {
180
+ /* @__PURE__ */ q("div", {
180
181
  className: "flex min-w-0 items-center gap-2 px-4 py-4 desktop:px-8",
181
- children: [/* @__PURE__ */ H("div", {
182
+ children: [/* @__PURE__ */ q("div", {
182
183
  className: "min-w-0 flex-1",
183
- children: [/* @__PURE__ */ V("h1", {
184
- className: l("break-words", w),
185
- children: y.title
186
- }), y.subtitle && /* @__PURE__ */ V("p", {
187
- className: l("mt-0.5", T, q.subtitle),
188
- children: y.subtitle
184
+ children: [/* @__PURE__ */ K("h1", {
185
+ className: d("wrap-break-word", E),
186
+ children: v.title
187
+ }), v.subtitle && /* @__PURE__ */ K("p", {
188
+ className: d("mt-0.5", O, Z.subtitle),
189
+ children: v.subtitle
189
190
  })]
190
- }), L(m.Primary)]
191
+ }), de(_.Primary)]
191
192
  }),
192
- /* @__PURE__ */ H("div", {
193
+ /* @__PURE__ */ q("div", {
193
194
  className: "flex flex-col gap-3 px-4 pt-4 pb-5 desktop:flex-row desktop:items-center desktop:px-8",
194
- children: [/* @__PURE__ */ V("div", {
195
+ children: [/* @__PURE__ */ K("div", {
195
196
  role: "search",
196
197
  className: "min-w-0 flex-1",
197
- children: /* @__PURE__ */ V(le, {
198
- value: u,
199
- onChange: F,
200
- placeholder: y.searchPlaceholder,
201
- clearLabel: y.clearSearchLabel,
202
- "aria-label": y.searchAriaLabel,
203
- size: ne.Large
198
+ children: /* @__PURE__ */ K(L, {
199
+ value: l,
200
+ onChange: le,
201
+ placeholder: v.searchPlaceholder,
202
+ clearLabel: v.clearSearchLabel,
203
+ "aria-label": v.searchAriaLabel,
204
+ size: S.Large
204
205
  })
205
- }), y.sortOptions.length > 0 && /* @__PURE__ */ V("div", {
206
+ }), v.sortOptions.length > 0 && /* @__PURE__ */ K("div", {
206
207
  role: "group",
207
- "aria-label": y.sortLabel,
208
+ "aria-label": v.sortLabel,
208
209
  className: "shrink-0",
209
- children: /* @__PURE__ */ V(p, {
210
- items: P,
211
- label: N,
212
- variant: m.Primary,
213
- appearance: f.Ghost,
214
- iconBefore: /* @__PURE__ */ V(k, {
215
- size: g.SM,
210
+ children: /* @__PURE__ */ K(g, {
211
+ items: ce,
212
+ label: se,
213
+ variant: _.Primary,
214
+ appearance: h.Ghost,
215
+ iconBefore: /* @__PURE__ */ K(oe, {
216
+ size: y.SM,
216
217
  "aria-hidden": !0,
217
- stroke: _
218
+ stroke: b
218
219
  }),
219
- className: q.sortButton
220
+ className: Z.sortButton
220
221
  })
221
222
  })]
222
223
  }),
223
- /* @__PURE__ */ V(ie, {
224
+ /* @__PURE__ */ K(j, {
224
225
  visuallyHidden: !0,
225
- as: ae.Span,
226
- children: I()
226
+ as: ne.Span,
227
+ children: ue()
227
228
  }),
228
- /* @__PURE__ */ H("div", {
229
+ /* @__PURE__ */ q("div", {
229
230
  className: "flex w-full min-w-0 flex-1 flex-col items-center gap-5 px-4 pt-6 pb-8 desktop:px-8",
230
- children: [A && !t && !n && !j && /* @__PURE__ */ H("div", {
231
+ children: [I && !t && !n && !R && /* @__PURE__ */ q("div", {
231
232
  className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
232
- children: [/* @__PURE__ */ V("p", {
233
- className: l(T, q.subtitle),
234
- children: y.incompleteLabel
235
- }), /* @__PURE__ */ V(S, {
236
- label: y.retryLabel,
237
- onClick: a
233
+ children: [/* @__PURE__ */ K("p", {
234
+ className: d(O, Z.subtitle),
235
+ children: v.incompleteLabel
236
+ }), /* @__PURE__ */ K(D, {
237
+ label: v.retryLabel,
238
+ onClick: i
238
239
  })]
239
- }), /* @__PURE__ */ V("div", {
240
- className: l("flex w-full max-w-[1116px] min-w-0 flex-col items-center", me && "flex-1 justify-center"),
241
- children: z()
240
+ }), /* @__PURE__ */ K("div", {
241
+ className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", V && "flex-1 justify-center"),
242
+ children: B()
242
243
  })]
243
244
  })
244
245
  ]
245
246
  });
246
- }, De = /* @__PURE__ */ function(e) {
247
+ }, Oe = /* @__PURE__ */ function(e) {
247
248
  return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
248
- }({}), Oe = (e) => !!e.dataTransfer?.types.includes("Files"), ke = (e) => {
249
- let [t, n] = B(!1), r = z(0);
249
+ }({}), ke = (e) => !!e.dataTransfer?.types.includes("Files"), Ae = (e) => {
250
+ let [t, n] = G(!1), r = W(0);
250
251
  return {
251
252
  isDragActive: t,
252
253
  handlers: {
253
- onDragEnter: F((e) => {
254
- Oe(e) && (e.preventDefault(), r.current += 1, n(!0));
254
+ onDragEnter: V((e) => {
255
+ ke(e) && (e.preventDefault(), r.current += 1, n(!0));
255
256
  }, []),
256
- onDragLeave: F((e) => {
257
- Oe(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
257
+ onDragLeave: V((e) => {
258
+ ke(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
258
259
  }, []),
259
- onDragOver: F((e) => {
260
- Oe(e) && e.preventDefault();
260
+ onDragOver: V((e) => {
261
+ ke(e) && e.preventDefault();
261
262
  }, []),
262
- onDrop: F((t) => {
263
- if (!Oe(t)) return;
263
+ onDrop: V((t) => {
264
+ if (!ke(t)) return;
264
265
  t.preventDefault(), r.current = 0, n(!1);
265
266
  let i = Array.from(t.dataTransfer?.files ?? []);
266
267
  i.length > 0 && e(i);
267
268
  }, [e])
268
269
  }
269
270
  };
270
- }, Y = /* @__PURE__ */ function(e) {
271
+ }, Q = /* @__PURE__ */ function(e) {
271
272
  return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
272
- }({}), X = /* @__PURE__ */ function(e) {
273
+ }({}), je = /* @__PURE__ */ function(e) {
273
274
  return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
274
- }({}), Ae = 255, je = new RegExp(r.source, "u"), Me = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Ne = /* @__PURE__ */ new Set([
275
+ }({}), Me = 255, Ne = new RegExp(a.source, "u"), Pe = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Fe = /* @__PURE__ */ new Set([
275
276
  ".",
276
277
  "..",
277
278
  "v",
278
279
  "files",
279
280
  ".dial-resource",
280
281
  ".dial-folder"
281
- ]), Pe = (e) => new TextEncoder().encode(e).length, Fe = (e) => {
282
+ ]), Ie = (e) => new TextEncoder().encode(e).length, Le = (e) => {
282
283
  let t = e.trim();
283
- return t.length === 0 ? X.Required : Pe(t) > 255 ? X.TooLong : je.test(t) || Me.test(t) ? X.InvalidCharacters : Ne.has(t) ? X.Reserved : null;
284
- }, Ie = (e) => {
284
+ return t.length === 0 ? je.Required : Ie(t) > 255 ? je.TooLong : Ne.test(t) || Pe.test(t) ? je.InvalidCharacters : Fe.has(t) ? je.Reserved : null;
285
+ }, Re = (e) => {
285
286
  let t = e.lastIndexOf(".");
286
287
  return t > 0 ? e.slice(t + 1).toLowerCase() : "";
287
- }, Le = (e) => "isStored" in e && e.isStored, Z = (e) => Le(e) ? e.size : e.file.size, Re = (e) => e.reduce((e, t) => e + Z(t), 0), ze = 0, Be = () => (ze += 1, `project-context-${Date.now()}-${ze}`), Ve = (e) => {
288
- let t = e.type || c(e.name) || "application/octet-stream";
288
+ }, ze = (e) => "isStored" in e && e.isStored, Be = (e) => ze(e) ? e.size : e.file.size, Ve = (e) => e.reduce((e, t) => e + Be(t), 0), He = 0, Ue = () => (He += 1, `project-context-${Date.now()}-${He}`), We = (e) => {
289
+ let t = e.type || u(e.name) || "application/octet-stream";
289
290
  return {
290
- id: Be(),
291
+ id: Ue(),
291
292
  name: e.name,
292
293
  contentType: t,
293
- type: s(t),
294
- status: a.Idle,
294
+ type: l(t),
295
+ status: s.Idle,
295
296
  file: e
296
297
  };
297
- }, Q = (e, t, n, r) => Fe(e.name) != null || e.name.trim() !== e.name ? Y.InvalidName : r.allowedExtensions.includes(Ie(e.name)) ? t.has(e.name) ? Y.Duplicate : e.size > r.maxFileBytes ? Y.TooLarge : n + e.size > r.maxTotalBytes ? Y.CapacityExceeded : null : Y.UnsupportedType, He = (e, t, n) => {
298
- let r = new Set(t.map((e) => e.name)), i = Re(t), a = [], o = [];
298
+ }, Ge = (e, t, n, r) => Le(e.name) != null || e.name.trim() !== e.name ? Q.InvalidName : r.allowedExtensions.includes(Re(e.name)) ? t.has(e.name) ? Q.Duplicate : e.size > r.maxFileBytes ? Q.TooLarge : n + e.size > r.maxTotalBytes ? Q.CapacityExceeded : null : Q.UnsupportedType, Ke = (e, t, n) => {
299
+ let r = new Set(t.map((e) => e.name)), i = Ve(t), a = [], o = [];
299
300
  for (let t of e) {
300
- let e = Q(t, r, i, n);
301
- e == null ? (r.add(t.name), i += t.size, a.push(Ve(t))) : o.push({
301
+ let e = Ge(t, r, i, n);
302
+ e == null ? (r.add(t.name), i += t.size, a.push(We(t))) : o.push({
302
303
  name: t.name,
303
304
  reason: e
304
305
  });
@@ -307,283 +308,283 @@ var U = /* @__PURE__ */ function(e) {
307
308
  accepted: a,
308
309
  rejected: o
309
310
  };
310
- }, Ue = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), We = (e, t) => {
311
+ }, qe = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), Je = (e, t) => {
311
312
  let n = t.trim().toLowerCase();
312
313
  return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
313
- }, Ge = {
314
+ }, Ye = {
314
315
  track: "_track_1eyt2_1",
315
316
  text: "_text_1eyt2_11"
316
- }, Ke = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
317
+ }, Xe = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
317
318
  if (e <= 0) return null;
318
- let a = r(Ue(e, t));
319
- return /* @__PURE__ */ H("div", {
319
+ let a = r(qe(e, t));
320
+ return /* @__PURE__ */ q("div", {
320
321
  className: "flex min-w-0 items-center gap-2",
321
- children: [/* @__PURE__ */ V(O, {
322
- role: ce.Meter,
322
+ children: [/* @__PURE__ */ K(F, {
323
+ role: I.Meter,
323
324
  value: e,
324
325
  max: t,
325
- size: ne.Small,
326
+ size: S.Small,
326
327
  "aria-label": n,
327
328
  "aria-valuetext": a,
328
- className: l("w-[60px] shrink-0", Ge.track)
329
- }), /* @__PURE__ */ V("span", {
329
+ className: d("w-[60px] shrink-0", Ye.track)
330
+ }), /* @__PURE__ */ K("span", {
330
331
  "aria-hidden": !0,
331
- className: l("whitespace-nowrap", i, Ge.text),
332
+ className: d("whitespace-nowrap", i, Ye.text),
332
333
  children: a
333
334
  })]
334
335
  });
335
- }, qe = {
336
+ }, Ze = {
336
337
  formColumn: "_formColumn_1fxsc_1",
337
338
  helper: "_helper_1fxsc_10",
338
339
  label: "_label_1fxsc_14"
339
- }, Je = N(async () => ({ default: (await ve()).MarkdownEditor })), Ye = "device", Xe = "file-manager", Ze = ({ values: n, errors: r, onFieldChange: i, contextFiles: a, onContextFilesChange: s, allowedExtensions: c, maxFileBytes: te, maxTotalBytes: f, onPickFromFileManager: h, onRefineDescription: v, onRefineInstructions: y, onBack: x, onCancel: S, onSubmit: C, isSubmitting: w = !1, labels: D, markdownEditorTheme: se, className: O, styles: ce }) => {
340
- let le = L(), k = L(), pe = L(), A = L(), j = L(), N = z(null), P = z(null), me = u(), [ve, U] = B(!1), [ye, be] = B([]), [xe, Se] = B(""), W = z(void 0), G = F((e) => e ? async (t, n) => {
341
- if (W.current && !W.current.aborted) throw new DOMException("Busy", "AbortError");
342
- W.current = n;
340
+ }, Qe = de(async () => ({ default: (await _e()).MarkdownEditor })), $e = "device", et = "file-manager", tt = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, allowedExtensions: s, maxFileBytes: l, maxTotalBytes: u, onPickFromFileManager: m, onRefineDescription: h, onRefineInstructions: v, onBack: x, onCancel: C, onSubmit: E, isSubmitting: D = !1, labels: O, markdownEditorTheme: k, className: N, styles: re }) => {
341
+ let P = H(), ie = H(), F = H(), I = H(), L = H(), oe = W(null), se = W(null), ce = f(), [le, de] = G(!1), [B, pe] = G([]), [_e, ve] = G(""), J = W(void 0), ye = V((e) => e ? async (t, n) => {
342
+ if (J.current && !J.current.aborted) throw new DOMException("Busy", "AbortError");
343
+ J.current = n;
343
344
  try {
344
345
  return await e(t, n);
345
346
  } finally {
346
- W.current === n && (W.current = void 0);
347
+ J.current === n && (J.current = void 0);
347
348
  }
348
- } : void 0, []), Ce = R(() => G(v), [G, v]), K = R(() => G(y), [G, y]), we = d({
349
- value: n.description,
349
+ } : void 0, []), be = U(() => ye(h), [ye, h]), xe = U(() => ye(v), [ye, v]), Y = p({
350
+ value: e.description,
350
351
  onChange: (e) => i("description", e),
351
- onRefine: Ce,
352
- disabled: w
353
- }), Te = d({
354
- value: n.instructions,
352
+ onRefine: be,
353
+ disabled: D
354
+ }), Se = p({
355
+ value: e.instructions,
355
356
  onChange: (e) => i("instructions", e),
356
- onRefine: K,
357
- disabled: w
358
- }), Ee = we.isPending || Te.isPending, q = Fe(n.name), J = r.name ?? (ve && q != null ? D.nameErrors[q] : void 0), De = q != null || w || Ee;
359
- I(() => {
360
- r.name && N.current?.focus();
361
- }, [r.name]);
362
- let Oe = R(() => Re(a), [a]), Y = R(() => c.map((e) => `.${e}`).join(","), [c]), X = (e) => {
357
+ onRefine: xe,
358
+ disabled: D
359
+ }), Ce = Y.isPending || Se.isPending, X = Le(e.name), we = t.name ?? (le && X != null ? O.nameErrors[X] : void 0), Te = X != null || D || Ce;
360
+ fe(() => {
361
+ t.name && oe.current?.focus();
362
+ }, [t.name]);
363
+ let Ee = U(() => Ve(a), [a]), Z = U(() => s.map((e) => `.${e}`).join(","), [s]), De = (e) => {
363
364
  if (e.length === 0) return;
364
- let { accepted: t, rejected: n } = He(e, a, {
365
- allowedExtensions: c,
366
- maxFileBytes: te,
367
- maxTotalBytes: f
365
+ let { accepted: t, rejected: n } = Ke(e, a, {
366
+ allowedExtensions: s,
367
+ maxFileBytes: l,
368
+ maxTotalBytes: u
368
369
  });
369
- be(n), t.length > 0 && s([...a, ...t]), Se([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
370
- }, { isDragActive: Ae, handlers: je } = ke(X), Me = (e) => {
370
+ pe(n), t.length > 0 && o([...a, ...t]), ve([t.length > 0 ? O.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => O.fileRejections[t](e))].filter(Boolean).join(" "));
371
+ }, { isDragActive: Oe, handlers: ke } = Ae(De), Q = (e) => {
371
372
  let t = a.find((t) => t.id === e);
372
- s(a.filter((t) => t.id !== e)), be([]), t && Se(D.fileRemovedStatus(t.name));
373
- }, Ne = (e) => {
374
- X(Array.from(e.target.files ?? [])), e.target.value = "";
375
- }, Pe = async () => {
376
- if (h) try {
377
- let e = await h();
378
- e && X(e);
373
+ o(a.filter((t) => t.id !== e)), pe([]), t && ve(O.fileRemovedStatus(t.name));
374
+ }, je = (e) => {
375
+ De(Array.from(e.target.files ?? [])), e.target.value = "";
376
+ }, Me = async () => {
377
+ if (m) try {
378
+ let e = await m();
379
+ e && De(e);
379
380
  } catch {}
380
- }, Ie = [{
381
- key: Ye,
382
- label: D.addFromDeviceLabel,
383
- onClick: () => P.current?.click()
384
- }, ...h ? [{
385
- key: Xe,
386
- label: D.addFromFileManagerLabel,
387
- onClick: () => void Pe()
388
- }] : []], Le = () => {
389
- !De && (!W.current || W.current.aborted) && C();
390
- }, { colors: Z, typography: ze } = ce ?? {}, Be = ze?.titleClassName ?? "dial-h1-text", Ve = l(ze?.labelClassName ?? "dial-tiny-semi-text", qe.label), Q = ze?.helperClassName ?? "dial-tiny-text", Ue = ee({
391
- "--pcf-helper-text": Z?.helperText,
392
- "--pcf-label-text": Z?.labelText,
393
- "--pcf-meter-track": Z?.meterTrack,
394
- "--pcf-meter-fill": Z?.meterFill
395
- }), We = D.refinement, Ge = r.context, Ze = !!Ge;
396
- return /* @__PURE__ */ H("div", {
397
- className: l("relative flex h-full min-h-0 w-full", O),
398
- ...je,
381
+ }, Ne = [{
382
+ key: $e,
383
+ label: O.addFromDeviceLabel,
384
+ onClick: () => se.current?.click()
385
+ }, ...m ? [{
386
+ key: et,
387
+ label: O.addFromFileManagerLabel,
388
+ onClick: () => void Me()
389
+ }] : []], Pe = () => {
390
+ !Te && (!J.current || J.current.aborted) && E();
391
+ }, { colors: Fe, typography: Ie } = re ?? {}, Re = Ie?.titleClassName ?? "dial-h1-text", ze = d(Ie?.labelClassName ?? "dial-tiny-semi-text", Ze.label), Be = Ie?.helperClassName ?? "dial-tiny-text", He = ee({
392
+ "--pcf-helper-text": Fe?.helperText,
393
+ "--pcf-label-text": Fe?.labelText,
394
+ "--pcf-meter-track": Fe?.meterTrack,
395
+ "--pcf-meter-fill": Fe?.meterFill
396
+ }), Ue = O.refinement, We = t.context, Ge = !!We;
397
+ return /* @__PURE__ */ q("div", {
398
+ className: d("relative flex h-full min-h-0 w-full", N),
399
+ ...ke,
399
400
  children: [
400
- /* @__PURE__ */ V(ge, {
401
- isVisible: Ae,
401
+ /* @__PURE__ */ K(he, {
402
+ isVisible: Oe,
402
403
  labels: {
403
- title: D.dropOverlayTitle,
404
- subtitle: D.dropOverlaySubtitle
404
+ title: O.dropOverlayTitle,
405
+ subtitle: O.dropOverlaySubtitle
405
406
  }
406
407
  }),
407
- /* @__PURE__ */ V(_e, {
408
+ /* @__PURE__ */ K(ge, {
408
409
  labels: {
409
- title: D.title,
410
- backButtonLabel: D.backLabel,
411
- cancelButtonLabel: D.cancelLabel,
412
- submitButtonLabel: D.createLabel,
413
- submittingLabel: D.submittingLabel ?? D.createLabel
410
+ title: O.title,
411
+ backButtonLabel: O.backLabel,
412
+ cancelButtonLabel: O.cancelLabel,
413
+ submitButtonLabel: O.createLabel,
414
+ submittingLabel: O.submittingLabel ?? O.createLabel
414
415
  },
415
416
  onBack: x,
416
- onCancel: S,
417
- onSubmit: Le,
418
- isCancelDisabled: w,
419
- isSubmitDisabled: De,
420
- isSubmitting: w,
421
- backIcon: /* @__PURE__ */ V(fe, {
422
- size: g.LG,
423
- stroke: _,
417
+ onCancel: C,
418
+ onSubmit: Pe,
419
+ isCancelDisabled: D,
420
+ isSubmitDisabled: Te,
421
+ isSubmitting: D,
422
+ backIcon: /* @__PURE__ */ K(z, {
423
+ size: y.LG,
424
+ stroke: b,
424
425
  "aria-hidden": !0,
425
426
  className: "rtl:scale-x-[-1]"
426
427
  }),
427
428
  styles: {
428
- colors: { background: Z?.background },
429
+ colors: { background: Fe?.background },
429
430
  header: {
430
- colors: { borderColor: Z?.headerBorder },
431
- typography: { fontClassName: Be }
431
+ colors: { borderColor: Fe?.headerBorder },
432
+ typography: { fontClassName: Re }
432
433
  },
433
- cssVars: Ue
434
+ cssVars: He
434
435
  },
435
- children: /* @__PURE__ */ H("div", {
436
- className: l("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", qe.formColumn),
436
+ children: /* @__PURE__ */ q("div", {
437
+ className: d("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", Ze.formColumn),
437
438
  children: [
438
- /* @__PURE__ */ H("div", {
439
+ /* @__PURE__ */ q("div", {
439
440
  className: "flex flex-col gap-1",
440
441
  children: [
441
- /* @__PURE__ */ V(T, {
442
- id: le,
443
- inputRef: N,
444
- value: n.name,
442
+ /* @__PURE__ */ K(te, {
443
+ id: P,
444
+ inputRef: oe,
445
+ value: e.name,
445
446
  onChange: (e) => i("name", e ?? ""),
446
- onBlur: () => U(!0),
447
- placeholder: D.namePlaceholder,
447
+ onBlur: () => de(!0),
448
+ placeholder: O.namePlaceholder,
448
449
  labelProps: {
449
- label: D.nameLabel,
450
+ label: O.nameLabel,
450
451
  required: !0
451
452
  },
452
453
  required: !0,
453
454
  "aria-required": !0,
454
- invalid: !!J,
455
- "aria-invalid": !!J,
456
- "aria-describedby": J ? k : void 0
455
+ invalid: !!we,
456
+ "aria-invalid": !!we,
457
+ "aria-describedby": we ? ie : void 0
457
458
  }),
458
- /* @__PURE__ */ V(b, {
459
- announce: oe.Assertive,
460
- id: k,
461
- className: Q,
462
- text: r.name ?? ""
459
+ /* @__PURE__ */ K(w, {
460
+ announce: M.Assertive,
461
+ id: ie,
462
+ className: Be,
463
+ text: t.name ?? ""
463
464
  }),
464
- J && !r.name && /* @__PURE__ */ V(b, {
465
- id: k,
466
- className: Q,
467
- text: J
465
+ we && !t.name && /* @__PURE__ */ K(w, {
466
+ id: ie,
467
+ className: Be,
468
+ text: we
468
469
  })
469
470
  ]
470
471
  }),
471
- /* @__PURE__ */ V(o, {
472
- isEnabled: !!v,
473
- fieldId: pe,
474
- label: D.descriptionLabel,
475
- labelClassName: Ve,
476
- labels: We,
477
- refinement: we,
478
- disabled: w || Ee,
479
- children: /* @__PURE__ */ V(de, {
480
- id: pe,
481
- value: n.description,
472
+ /* @__PURE__ */ K(c, {
473
+ isEnabled: !!h,
474
+ fieldId: F,
475
+ label: O.descriptionLabel,
476
+ labelClassName: ze,
477
+ labels: Ue,
478
+ refinement: Y,
479
+ disabled: D || Ce,
480
+ children: /* @__PURE__ */ K(R, {
481
+ id: F,
482
+ value: e.description,
482
483
  onChange: (e) => {
483
- we.reset(), i("description", e);
484
+ Y.reset(), i("description", e);
484
485
  },
485
- placeholder: D.descriptionPlaceholder,
486
- labelProps: v ? void 0 : { label: D.descriptionLabel }
486
+ placeholder: O.descriptionPlaceholder,
487
+ labelProps: h ? void 0 : { label: O.descriptionLabel }
487
488
  })
488
489
  }),
489
- /* @__PURE__ */ V(o, {
490
- isEnabled: !!y,
491
- fieldId: A,
492
- label: D.instructionsLabel,
493
- labelClassName: Ve,
494
- labels: We,
495
- refinement: Te,
496
- disabled: w || Ee,
497
- children: /* @__PURE__ */ H("div", {
490
+ /* @__PURE__ */ K(c, {
491
+ isEnabled: !!v,
492
+ fieldId: I,
493
+ label: O.instructionsLabel,
494
+ labelClassName: ze,
495
+ labels: Ue,
496
+ refinement: Se,
497
+ disabled: D || Ce,
498
+ children: /* @__PURE__ */ q("div", {
498
499
  className: "flex flex-1 flex-col gap-2",
499
- children: [!y && /* @__PURE__ */ V(E, {
500
- htmlFor: A,
501
- className: Ve,
502
- label: D.instructionsLabel
503
- }), /* @__PURE__ */ V("div", {
504
- ref: me,
505
- className: l("w-full", e, t),
506
- children: /* @__PURE__ */ V(M, {
507
- fallback: /* @__PURE__ */ V(ue, {}),
508
- children: /* @__PURE__ */ V(Je, {
509
- id: A,
510
- value: n.instructions,
500
+ children: [!v && /* @__PURE__ */ K(A, {
501
+ htmlFor: I,
502
+ className: ze,
503
+ label: O.instructionsLabel
504
+ }), /* @__PURE__ */ K("div", {
505
+ ref: ce,
506
+ className: d("w-full", n, r),
507
+ children: /* @__PURE__ */ K(ue, {
508
+ fallback: /* @__PURE__ */ K(ae, {}),
509
+ children: /* @__PURE__ */ K(Qe, {
510
+ id: I,
511
+ value: e.instructions,
511
512
  onChange: (e) => {
512
- Te.reset(), i("instructions", e);
513
+ Se.reset(), i("instructions", e);
513
514
  },
514
515
  height: 176,
515
- theme: se,
516
- placeholder: D.instructionsPlaceholder
516
+ theme: k,
517
+ placeholder: O.instructionsPlaceholder
517
518
  })
518
519
  })
519
520
  })]
520
521
  })
521
522
  }),
522
- /* @__PURE__ */ H("section", {
523
- "aria-labelledby": j,
523
+ /* @__PURE__ */ q("section", {
524
+ "aria-labelledby": L,
524
525
  className: "flex flex-col gap-2",
525
526
  children: [
526
- /* @__PURE__ */ H("div", {
527
+ /* @__PURE__ */ q("div", {
527
528
  className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
528
- children: [/* @__PURE__ */ V("h2", {
529
- id: j,
530
- className: Ve,
531
- children: D.contextLabel
532
- }), /* @__PURE__ */ H("div", {
529
+ children: [/* @__PURE__ */ K("h2", {
530
+ id: L,
531
+ className: ze,
532
+ children: O.contextLabel
533
+ }), /* @__PURE__ */ q("div", {
533
534
  className: "flex min-w-0 items-center gap-4",
534
- children: [/* @__PURE__ */ V(Ke, {
535
- usedBytes: Oe,
536
- maxBytes: f,
537
- ariaLabel: D.capacityMeterLabel,
538
- formatLabel: D.capacityLabel,
539
- textClassName: Q
540
- }), /* @__PURE__ */ V(p, {
541
- items: Ie,
542
- label: D.addLabel,
543
- variant: m.Neutral,
544
- size: ne.Small,
545
- disabled: w
535
+ children: [/* @__PURE__ */ K(Xe, {
536
+ usedBytes: Ee,
537
+ maxBytes: u,
538
+ ariaLabel: O.capacityMeterLabel,
539
+ formatLabel: O.capacityLabel,
540
+ textClassName: Be
541
+ }), /* @__PURE__ */ K(g, {
542
+ items: Ne,
543
+ label: O.addLabel,
544
+ variant: _.Neutral,
545
+ size: S.Small,
546
+ disabled: D
546
547
  })]
547
548
  })]
548
549
  }),
549
- /* @__PURE__ */ V("input", {
550
- ref: P,
550
+ /* @__PURE__ */ K("input", {
551
+ ref: se,
551
552
  type: "file",
552
553
  multiple: !0,
553
- accept: Y,
554
+ accept: Z,
554
555
  tabIndex: -1,
555
556
  "aria-hidden": !0,
556
557
  className: "sr-only",
557
- onChange: Ne
558
+ onChange: je
558
559
  }),
559
- /* @__PURE__ */ V(re, {
560
- label: D.dropZoneLabel,
561
- description: D.dropZoneHint,
562
- accept: Y,
560
+ /* @__PURE__ */ K(T, {
561
+ label: O.dropZoneLabel,
562
+ description: O.dropZoneHint,
563
+ accept: Z,
563
564
  multiple: !0,
564
- disabled: w,
565
- onChange: X,
566
- onReject: X
565
+ disabled: D,
566
+ onChange: De,
567
+ onReject: De
567
568
  }),
568
- ye.length > 0 && /* @__PURE__ */ V("ul", {
569
- className: l("flex flex-col gap-1", Q, qe.helper),
570
- children: ye.map(({ name: e, reason: t }) => /* @__PURE__ */ V("li", { children: D.fileRejections[t](e) }, `${t}:${e}`))
569
+ B.length > 0 && /* @__PURE__ */ K("ul", {
570
+ className: d("flex flex-col gap-1", Be, Ze.helper),
571
+ children: B.map(({ name: e, reason: t }) => /* @__PURE__ */ K("li", { children: O.fileRejections[t](e) }, `${t}:${e}`))
571
572
  }),
572
- /* @__PURE__ */ V(ie, {
573
- politeness: oe.Assertive,
574
- children: Ze && /* @__PURE__ */ V("p", {
575
- className: l(Q, qe.helper),
576
- children: Ge
573
+ /* @__PURE__ */ K(j, {
574
+ politeness: M.Assertive,
575
+ children: Ge && /* @__PURE__ */ K("p", {
576
+ className: d(Be, Ze.helper),
577
+ children: We
577
578
  })
578
579
  }),
579
- a.length > 0 && /* @__PURE__ */ V("ul", {
580
+ a.length > 0 && /* @__PURE__ */ K("ul", {
580
581
  className: "flex min-w-0 flex-wrap gap-2 pt-1",
581
- children: a.map((e) => /* @__PURE__ */ V("li", {
582
+ children: a.map((e) => /* @__PURE__ */ K("li", {
582
583
  className: "min-w-0",
583
- children: /* @__PURE__ */ V(he, {
584
+ children: /* @__PURE__ */ K(me, {
584
585
  attachment: e,
585
- onRemove: Me,
586
- labels: { removeLabel: D.removeFileLabel(e.name) }
586
+ onRemove: Q,
587
+ labels: { removeLabel: O.removeFileLabel(e.name) }
587
588
  })
588
589
  }, e.id))
589
590
  })
@@ -592,10 +593,10 @@ var U = /* @__PURE__ */ function(e) {
592
593
  ]
593
594
  })
594
595
  }),
595
- /* @__PURE__ */ V(ie, {
596
+ /* @__PURE__ */ K(j, {
596
597
  visuallyHidden: !0,
597
- as: ae.Span,
598
- children: w ? D.creatingStatus : xe
598
+ as: ne.Span,
599
+ children: D ? O.creatingStatus : _e
599
600
  })
600
601
  ]
601
602
  });
@@ -606,21 +607,21 @@ var U = /* @__PURE__ */ function(e) {
606
607
  body: "_body_16lvl_13",
607
608
  secondary: "_secondary_16lvl_17",
608
609
  panel: "_panel_16lvl_21"
609
- }, Qe = (e) => ({
610
+ }, nt = (e) => ({
610
611
  id: e.name,
611
612
  name: e.name,
612
613
  contentType: e.contentType,
613
- type: s(e.contentType),
614
- status: a.Idle
615
- }), $e = P(({ project: e, isLoading: t = !1, hasError: r = !1, isNotFound: a = !1, isPinned: o, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: u, onBack: d, onTogglePin: f, onPublish: p, onEdit: h, onShare: ne, onDelete: b, onDownload: re, onOpenFile: x, onRetry: w, onBrowseProjects: T, labels: E, styles: oe }) => {
616
- let { colors: D, typography: O } = oe ?? {}, ce = O?.titleClassName ?? "dial-h2-text", de = O?.panelTitleClassName ?? "dial-body-semi-text", k = O?.sectionTitleClassName ?? "dial-tiny-text", M = O?.bodyClassName ?? "dial-small-text", N = O?.helperClassName ?? "dial-tiny-text", P = O?.instructionsHeadingClassName ?? "dial-small-semi-text", F = ee({
617
- "--pv-bg": D?.background,
618
- "--pv-border": D?.border,
619
- "--pv-heading-text": D?.headingText,
620
- "--pv-body-text": D?.bodyText,
621
- "--pv-secondary-text": D?.secondaryText
622
- }), I = R(() => e?.contextFiles ?? [], [e]), z = R(() => We(I, c), [I, c]), B = c.trim(), ge = L(), _e = R(() => {
623
- let e = l("mb-1 mt-3 first:mt-0", P);
614
+ type: l(e.contentType),
615
+ status: s.Idle
616
+ }), rt = B(({ project: e, isLoading: t = !1, hasError: n = !1, isNotFound: r = !1, isPinned: a, isPinPending: s = !1, contextSearchQuery: c, onContextSearchQueryChange: l, onBack: u, onTogglePin: f, onPublish: p, onEdit: h, onShare: g, onDelete: v, onDownload: S, onOpenFile: w, onRetry: T, onBrowseProjects: E, mainContent: k, mainContentLabel: te = "Project content", labels: A, styles: M }) => {
617
+ let { colors: N, typography: P } = M ?? {}, ie = P?.titleClassName ?? "dial-h2-text", F = P?.panelTitleClassName ?? "dial-body-semi-text", I = P?.sectionTitleClassName ?? "dial-tiny-text", R = P?.bodyClassName ?? "dial-small-text", oe = P?.helperClassName ?? "dial-tiny-text", ue = P?.instructionsHeadingClassName ?? "dial-small-semi-text", de = ee({
618
+ "--pv-bg": N?.background,
619
+ "--pv-border": N?.border,
620
+ "--pv-heading-text": N?.headingText,
621
+ "--pv-body-text": N?.bodyText,
622
+ "--pv-secondary-text": N?.secondaryText
623
+ }), B = U(() => e?.contextFiles ?? [], [e]), V = U(() => Je(B, c), [B, c]), fe = c.trim(), W = H(), G = U(() => {
624
+ let e = d("mb-1 mt-3 first:mt-0", ue);
624
625
  return {
625
626
  h1: e,
626
627
  h2: e,
@@ -628,199 +629,459 @@ var U = /* @__PURE__ */ function(e) {
628
629
  h4: e,
629
630
  h5: e,
630
631
  h6: e,
631
- p: M,
632
- ul: M,
633
- ol: M
632
+ p: R,
633
+ ul: R,
634
+ ol: R
634
635
  };
635
- }, [M, P]), ve = (e) => {
636
+ }, [R, ue]), he = (e) => {
636
637
  let t = [];
637
638
  return e && p && t.push({
638
639
  key: "publish",
639
- label: E.publishLabel,
640
+ label: A.publishLabel,
640
641
  onClick: p
641
642
  }), e && h && t.push({
642
643
  key: "edit",
643
- label: E.editLabel,
644
+ label: A.editLabel,
644
645
  onClick: h
645
- }), ne && t.push({
646
+ }), g && t.push({
646
647
  key: "share",
647
- label: E.shareLabel,
648
- onClick: ne
648
+ label: A.shareLabel,
649
+ onClick: g
649
650
  }), t.push({
650
651
  key: "download",
651
- label: E.downloadLabel,
652
- onClick: re
653
- }), b && t.push({
652
+ label: A.downloadLabel,
653
+ onClick: S
654
+ }), v && t.push({
654
655
  key: "delete",
655
- label: E.deleteLabel,
656
+ label: A.deleteLabel,
656
657
  danger: !0,
657
- onClick: b
658
+ onClick: v
658
659
  }), t;
659
- }, U = (e, t) => /* @__PURE__ */ V("div", {
660
+ }, ge = (e, t) => /* @__PURE__ */ K("div", {
660
661
  className: t,
661
- children: /* @__PURE__ */ V(v, {
662
- items: ve(e),
662
+ children: /* @__PURE__ */ K(x, {
663
+ items: he(e),
663
664
  matchReferenceWidth: !1,
664
665
  listClassName: "w-[200px]",
665
- children: /* @__PURE__ */ V(C, {
666
- icon: /* @__PURE__ */ V(pe, {
667
- size: g.MD,
666
+ children: /* @__PURE__ */ K(O, {
667
+ icon: /* @__PURE__ */ K(se, {
668
+ size: y.MD,
668
669
  "aria-hidden": !0,
669
- stroke: _
670
+ stroke: b
670
671
  }),
671
- "aria-label": E.moreActionsLabel
672
+ "aria-label": A.moreActionsLabel
672
673
  })
673
674
  })
674
675
  });
675
- return t || r || a || e == null ? /* @__PURE__ */ V("div", {
676
- style: F,
677
- className: l("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
678
- children: t ? /* @__PURE__ */ V(ue, {}) : r ? /* @__PURE__ */ H("div", {
676
+ return t || n || r || e == null ? /* @__PURE__ */ K("div", {
677
+ style: de,
678
+ className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
679
+ children: t ? /* @__PURE__ */ K(ae, {}) : n ? /* @__PURE__ */ q("div", {
679
680
  className: "flex flex-col items-center gap-3",
680
- children: [/* @__PURE__ */ V("p", {
681
+ children: [/* @__PURE__ */ K("p", {
681
682
  role: "status",
682
- className: l(M, $.body),
683
- children: E.errorLabel
684
- }), /* @__PURE__ */ V(S, {
685
- label: E.retryLabel,
686
- onClick: w
683
+ className: d(R, $.body),
684
+ children: A.errorLabel
685
+ }), /* @__PURE__ */ K(D, {
686
+ label: A.retryLabel,
687
+ onClick: T
687
688
  })]
688
- }) : /* @__PURE__ */ H("div", {
689
+ }) : /* @__PURE__ */ q("div", {
689
690
  className: "flex flex-col items-center gap-3",
690
- children: [/* @__PURE__ */ V("p", {
691
- className: l(M, $.body),
692
- children: E.notFoundLabel
693
- }), /* @__PURE__ */ V(S, {
694
- label: E.browseProjectsLabel,
695
- onClick: T
691
+ children: [/* @__PURE__ */ K("p", {
692
+ className: d(R, $.body),
693
+ children: A.notFoundLabel
694
+ }), /* @__PURE__ */ K(D, {
695
+ label: A.browseProjectsLabel,
696
+ onClick: E
696
697
  })]
697
698
  })
698
- }) : /* @__PURE__ */ H("div", {
699
- style: F,
700
- className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
701
- children: [/* @__PURE__ */ H("header", {
702
- className: l("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
699
+ }) : /* @__PURE__ */ q("div", {
700
+ style: de,
701
+ className: d("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
702
+ children: [/* @__PURE__ */ q("header", {
703
+ className: d("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
703
704
  children: [
704
- /* @__PURE__ */ V(C, {
705
- icon: /* @__PURE__ */ V(fe, {
706
- size: g.LG,
705
+ /* @__PURE__ */ K(O, {
706
+ icon: /* @__PURE__ */ K(z, {
707
+ size: y.LG,
707
708
  className: "rtl:scale-x-[-1]",
708
709
  "aria-hidden": !0,
709
- stroke: _
710
+ stroke: b
710
711
  }),
711
- "aria-label": E.backLabel,
712
- onClick: d
712
+ "aria-label": A.backLabel,
713
+ onClick: u
713
714
  }),
714
- /* @__PURE__ */ V("h1", {
715
- className: l("min-w-0 flex-1", ce, $.title),
716
- children: /* @__PURE__ */ V(y, { text: e.name })
715
+ /* @__PURE__ */ K("h1", {
716
+ className: d("min-w-0 flex-1", ie, $.title),
717
+ children: /* @__PURE__ */ K(C, { text: e.name })
717
718
  }),
718
- /* @__PURE__ */ V(C, {
719
- icon: o ? /* @__PURE__ */ V(j, {
720
- size: g.MD,
719
+ /* @__PURE__ */ K(O, {
720
+ icon: a ? /* @__PURE__ */ K(le, {
721
+ size: y.MD,
721
722
  "aria-hidden": !0
722
- }) : /* @__PURE__ */ V(A, {
723
- size: g.MD,
723
+ }) : /* @__PURE__ */ K(ce, {
724
+ size: y.MD,
724
725
  "aria-hidden": !0,
725
- stroke: _
726
+ stroke: b
726
727
  }),
727
- "aria-label": E.pinLabel,
728
- "aria-pressed": o,
728
+ "aria-label": A.pinLabel,
729
+ "aria-pressed": a,
729
730
  "aria-disabled": s || void 0,
730
731
  onClick: () => {
731
732
  s || f();
732
733
  }
733
734
  }),
734
- p && /* @__PURE__ */ V(se, {
735
- label: E.publishLabel,
735
+ p && /* @__PURE__ */ K(re, {
736
+ label: A.publishLabel,
736
737
  onClick: p,
737
738
  className: "hidden shrink-0 desktop:inline-flex"
738
739
  }),
739
- h && /* @__PURE__ */ V(te, {
740
- label: E.editLabel,
741
- variant: m.Primary,
740
+ h && /* @__PURE__ */ K(m, {
741
+ label: A.editLabel,
742
+ variant: _.Primary,
742
743
  onClick: h,
743
744
  className: "hidden shrink-0 desktop:inline-flex"
744
745
  }),
745
- U(!1, "hidden desktop:block"),
746
- U(!0, "desktop:hidden")
746
+ ge(!1, "hidden desktop:block"),
747
+ ge(!0, "desktop:hidden")
747
748
  ]
748
- }), /* @__PURE__ */ V("div", {
749
- className: "flex min-w-0 flex-1 flex-col desktop:flex-row desktop:justify-end",
750
- children: /* @__PURE__ */ H("aside", {
751
- "aria-labelledby": ge,
752
- className: l("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:w-[488px] desktop:shrink-0 desktop:border-s desktop:border-t-0 desktop:px-8", $.panel),
749
+ }), /* @__PURE__ */ q("div", {
750
+ className: d("flex min-w-0 flex-1 flex-col desktop:flex-row", k == null && "desktop:justify-end"),
751
+ children: [k != null && /* @__PURE__ */ K("section", {
752
+ "aria-label": te,
753
+ className: "flex min-w-0 flex-1 flex-col gap-6 px-4 py-6 desktop:px-8",
754
+ children: k
755
+ }), /* @__PURE__ */ q("aside", {
756
+ "aria-labelledby": W,
757
+ className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:w-[488px] desktop:shrink-0 desktop:border-s desktop:border-t-0 desktop:px-8", $.panel),
753
758
  children: [
754
- /* @__PURE__ */ V("h2", {
755
- id: ge,
756
- className: l(de, $.title),
757
- children: E.detailsLabel
759
+ /* @__PURE__ */ K("h2", {
760
+ id: W,
761
+ className: d(F, $.title),
762
+ children: A.detailsLabel
758
763
  }),
759
- e.description !== "" && /* @__PURE__ */ H("section", {
764
+ e.description !== "" && /* @__PURE__ */ q("section", {
760
765
  className: "flex min-w-0 flex-col gap-1",
761
- children: [/* @__PURE__ */ V("h3", {
762
- className: l(k, $.secondary),
763
- children: E.descriptionLabel
764
- }), /* @__PURE__ */ V("p", {
765
- className: l("break-words whitespace-pre-line", M, $.body),
766
+ children: [/* @__PURE__ */ K("h3", {
767
+ className: d(I, $.secondary),
768
+ children: A.descriptionLabel
769
+ }), /* @__PURE__ */ K("p", {
770
+ className: d("wrap-break-word whitespace-pre-line", R, $.body),
766
771
  children: e.description
767
772
  })]
768
773
  }),
769
- e.instructions !== "" && /* @__PURE__ */ H("section", {
774
+ e.instructions !== "" && /* @__PURE__ */ q("section", {
770
775
  className: "flex min-w-0 flex-col gap-1",
771
- children: [/* @__PURE__ */ V("h3", {
772
- className: l(k, $.secondary),
773
- children: E.instructionsLabel
774
- }), /* @__PURE__ */ V("div", {
775
- className: l("min-w-0 break-words", M, $.body),
776
- children: /* @__PURE__ */ V(n, {
776
+ children: [/* @__PURE__ */ K("h3", {
777
+ className: d(I, $.secondary),
778
+ children: A.instructionsLabel
779
+ }), /* @__PURE__ */ K("div", {
780
+ className: d("min-w-0 wrap-break-word", R, $.body),
781
+ children: /* @__PURE__ */ K(i, {
777
782
  content: e.instructions,
778
- classNames: _e
783
+ classNames: G
779
784
  })
780
785
  })]
781
786
  }),
782
- /* @__PURE__ */ H("section", {
787
+ /* @__PURE__ */ q("section", {
783
788
  className: "flex min-w-0 flex-col gap-2",
784
- children: [/* @__PURE__ */ V("h3", {
785
- className: l(k, $.secondary),
786
- children: E.contextLabel
787
- }), I.length === 0 ? /* @__PURE__ */ V(i, { label: E.emptyContextLabel }) : /* @__PURE__ */ H(me, { children: [
788
- /* @__PURE__ */ V("div", {
789
+ children: [/* @__PURE__ */ K("h3", {
790
+ className: d(I, $.secondary),
791
+ children: A.contextLabel
792
+ }), B.length === 0 ? /* @__PURE__ */ K(o, { label: A.emptyContextLabel }) : /* @__PURE__ */ q(pe, { children: [
793
+ /* @__PURE__ */ K("div", {
789
794
  role: "search",
790
- children: /* @__PURE__ */ V(le, {
795
+ children: /* @__PURE__ */ K(L, {
791
796
  value: c,
792
- onChange: (e) => u(e ?? ""),
793
- placeholder: E.contextSearchPlaceholder,
794
- clearLabel: E.clearSearchLabel,
795
- "aria-label": E.contextSearchAriaLabel
797
+ onChange: (e) => l(e ?? ""),
798
+ placeholder: A.contextSearchPlaceholder,
799
+ clearLabel: A.clearSearchLabel,
800
+ "aria-label": A.contextSearchAriaLabel
796
801
  })
797
802
  }),
798
- z.length === 0 ? /* @__PURE__ */ V("p", {
799
- className: l(N, $.secondary),
800
- children: E.noContextMatchesLabel
801
- }) : /* @__PURE__ */ V("ul", {
803
+ V.length === 0 ? /* @__PURE__ */ K("p", {
804
+ className: d(oe, $.secondary),
805
+ children: A.noContextMatchesLabel
806
+ }) : /* @__PURE__ */ K("ul", {
802
807
  className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
803
- children: z.map((e) => /* @__PURE__ */ V("li", {
808
+ children: V.map((e) => /* @__PURE__ */ K("li", {
804
809
  className: "min-w-0",
805
- children: /* @__PURE__ */ V(he, {
806
- attachment: Qe(e),
807
- searchQuery: B,
808
- onClick: x,
809
- labels: { clickLabel: E.openFileLabel(e.name) }
810
+ children: /* @__PURE__ */ K(me, {
811
+ attachment: nt(e),
812
+ searchQuery: fe,
813
+ onClick: w,
814
+ labels: { clickLabel: A.openFileLabel(e.name) }
810
815
  })
811
816
  }, e.name))
812
817
  }),
813
- /* @__PURE__ */ V(ie, {
818
+ /* @__PURE__ */ K(j, {
814
819
  visuallyHidden: !0,
815
- as: ae.Span,
816
- children: B === "" ? "" : E.contextResultCountLabel(z.length)
820
+ as: ne.Span,
821
+ children: fe === "" ? "" : A.contextResultCountLabel(V.length)
817
822
  })
818
823
  ] })]
819
824
  })
820
825
  ]
826
+ })]
827
+ })]
828
+ });
829
+ }), it = 24, at = ({ item: e, labels: n, rowTitleClassName: r, onOpen: i, onRename: a, onDelete: o }) => {
830
+ let s = U(() => [...a ? [{
831
+ key: "rename",
832
+ label: n.renameLabel,
833
+ onClick: () => a(e.id)
834
+ }] : [], ...o ? [{
835
+ key: "delete",
836
+ label: n.deleteLabel,
837
+ danger: !0,
838
+ onClick: () => o(e.id)
839
+ }] : []], [
840
+ e.id,
841
+ n.deleteLabel,
842
+ n.renameLabel,
843
+ o,
844
+ a
845
+ ]);
846
+ return /* @__PURE__ */ q("li", {
847
+ className: "flex min-w-0 items-center gap-1 rounded focus-within:bg-(--bg-accent-primary-alpha,rgba(92,141,234,0.15)) hover:bg-(--bg-accent-primary-alpha,rgba(92,141,234,0.15))",
848
+ children: [/* @__PURE__ */ q("button", {
849
+ type: "button",
850
+ "aria-label": n.openLabel(e.title, e.authorName),
851
+ className: "flex min-w-0 flex-1 items-center gap-3 rounded px-3 py-2 text-start focus-visible:outline-2 focus-visible:-outline-offset-2",
852
+ onClick: () => i(e.id),
853
+ children: [/* @__PURE__ */ K("span", {
854
+ "aria-hidden": !0,
855
+ className: "shrink-0",
856
+ children: /* @__PURE__ */ K(t, {
857
+ name: e.authorName ?? "",
858
+ size: it
859
+ })
860
+ }), /* @__PURE__ */ K(C, {
861
+ text: e.title,
862
+ className: d("min-w-0 flex-1", r)
863
+ })]
864
+ }), s.length > 0 && /* @__PURE__ */ K(x, {
865
+ items: s,
866
+ placement: "bottom-end",
867
+ children: /* @__PURE__ */ K(O, {
868
+ "aria-label": n.moreActionsLabel(e.title),
869
+ size: S.Small,
870
+ className: "me-2 shrink-0",
871
+ icon: /* @__PURE__ */ K(se, {
872
+ "aria-hidden": !0,
873
+ size: y.SM,
874
+ stroke: b
875
+ })
821
876
  })
822
877
  })]
823
878
  });
824
- });
879
+ }, ot = B(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, onOpen: c, onRename: ee, onDelete: l, labels: u, typography: f }) => {
880
+ let p = H(), m = f?.titleClassName ?? "dial-body-semi-text", h = f?.rowTitleClassName ?? "dial-body-text", g = f?.messageClassName ?? "dial-small-text", _ = !t && !n && e.length === 0;
881
+ return /* @__PURE__ */ q("section", {
882
+ "aria-labelledby": _ ? void 0 : p,
883
+ "aria-label": _ ? u.title : void 0,
884
+ className: "flex min-w-0 flex-col gap-2",
885
+ children: [!_ && /* @__PURE__ */ K("h2", {
886
+ id: p,
887
+ className: d("m-0", m),
888
+ children: u.title
889
+ }), t ? /* @__PURE__ */ q("div", {
890
+ role: "status",
891
+ className: "flex justify-center py-6",
892
+ children: [/* @__PURE__ */ K("span", {
893
+ "aria-hidden": !0,
894
+ children: /* @__PURE__ */ K(ae, {})
895
+ }), /* @__PURE__ */ K("span", {
896
+ className: "sr-only",
897
+ children: u.loadingLabel
898
+ })]
899
+ }) : n ? /* @__PURE__ */ q("div", {
900
+ role: "status",
901
+ className: "flex flex-col items-center gap-3 py-6 text-center",
902
+ children: [/* @__PURE__ */ K("p", {
903
+ className: d("m-0", g),
904
+ children: u.errorLabel
905
+ }), /* @__PURE__ */ K(D, {
906
+ label: u.retryLabel,
907
+ onClick: r
908
+ })]
909
+ }) : _ ? /* @__PURE__ */ K("div", {
910
+ role: "status",
911
+ children: /* @__PURE__ */ K(o, {
912
+ label: u.emptyTitle,
913
+ description: u.emptyDescription
914
+ })
915
+ }) : /* @__PURE__ */ q(pe, { children: [/* @__PURE__ */ K("ul", {
916
+ className: "m-0 flex min-w-0 list-none flex-col gap-1 p-0",
917
+ children: e.map((e) => /* @__PURE__ */ K(at, {
918
+ item: e,
919
+ labels: u,
920
+ rowTitleClassName: h,
921
+ onOpen: c,
922
+ onRename: ee,
923
+ onDelete: l
924
+ }, e.id))
925
+ }), i && s && /* @__PURE__ */ K(D, {
926
+ className: "self-center",
927
+ label: u.loadMoreLabel ?? "Show more",
928
+ disabled: a,
929
+ onClick: s
930
+ })] })]
931
+ });
932
+ }), st = B(({ composer: t, items: n, isLoading: r = !1, hasError: i = !1, onRetry: a, hasMore: o, isLoadingMore: s, onLoadMore: c, onOpen: ee, onRename: l, onDelete: u, labels: d, listTypography: f }) => {
933
+ let p = H(), m = W(null), [g, v] = G(null), [y, b] = G(""), [x, S] = G(), [C, w] = G(!1), [T, E] = G(null), [D, O] = G(!1), k = W(null), A = V(() => {
934
+ k.current = document.activeElement;
935
+ }, []), j = V(() => {
936
+ let e = k.current;
937
+ k.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
938
+ }, []), ne = V((e) => {
939
+ k.current = null, window.setTimeout(() => {
940
+ let t = m.current;
941
+ if (!t) return;
942
+ let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
943
+ r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
944
+ }, 0);
945
+ }, []), M = V((e) => n.find((t) => t.id === e) ?? null, [n]), N = V((e) => {
946
+ A();
947
+ let t = M(e);
948
+ v(t), b(t?.title ?? ""), S(void 0);
949
+ }, [M, A]), re = V((e) => {
950
+ A(), E(M(e));
951
+ }, [M, A]), F = V(() => {
952
+ C || (v(null), j());
953
+ }, [C, j]), I = V(() => {
954
+ D || (E(null), j());
955
+ }, [D, j]), L = V(async () => {
956
+ if (!g || !l || C) return;
957
+ let e = y.trim();
958
+ if (!e) S(d.renameEmptyError);
959
+ else {
960
+ w(!0);
961
+ try {
962
+ await l(g.id, e), v(null), j();
963
+ } catch {} finally {
964
+ w(!1);
965
+ }
966
+ }
967
+ }, [
968
+ C,
969
+ d.renameEmptyError,
970
+ l,
971
+ g,
972
+ y,
973
+ j
974
+ ]), ae = V((e) => {
975
+ e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), L());
976
+ }, [L]), R = V(async () => {
977
+ if (!T || !u) return;
978
+ let e = n.findIndex((e) => e.id === T.id);
979
+ O(!0);
980
+ try {
981
+ await u(T.id), E(null), ne(Math.max(e, 0));
982
+ } catch {} finally {
983
+ O(!1);
984
+ }
985
+ }, [
986
+ T,
987
+ ne,
988
+ n,
989
+ u
990
+ ]), z = U(() => [{
991
+ label: d.renameCancelLabel ?? "Cancel",
992
+ variant: _.Primary,
993
+ appearance: h.Ghost,
994
+ disabled: C,
995
+ onClick: F
996
+ }, {
997
+ label: d.renameSaveLabel,
998
+ variant: _.Primary,
999
+ disabled: C,
1000
+ onClick: () => {
1001
+ L();
1002
+ }
1003
+ }], [
1004
+ F,
1005
+ L,
1006
+ C,
1007
+ d.renameCancelLabel,
1008
+ d.renameSaveLabel
1009
+ ]);
1010
+ return /* @__PURE__ */ q(pe, { children: [
1011
+ t,
1012
+ /* @__PURE__ */ K("div", {
1013
+ ref: m,
1014
+ className: "contents",
1015
+ children: /* @__PURE__ */ K(ot, {
1016
+ items: n,
1017
+ isLoading: r,
1018
+ hasError: i,
1019
+ onRetry: a,
1020
+ hasMore: o,
1021
+ isLoadingMore: s,
1022
+ onLoadMore: c,
1023
+ onOpen: ee,
1024
+ onRename: l ? N : void 0,
1025
+ onDelete: u ? re : void 0,
1026
+ labels: d.list,
1027
+ typography: f
1028
+ })
1029
+ }),
1030
+ g && /* @__PURE__ */ K(P, {
1031
+ open: !0,
1032
+ header: d.renameTitle,
1033
+ size: ie.Sm,
1034
+ mainButtons: z,
1035
+ onClose: F,
1036
+ children: /* @__PURE__ */ K("div", {
1037
+ className: "px-6 py-4",
1038
+ children: /* @__PURE__ */ K(te, {
1039
+ id: p,
1040
+ value: y,
1041
+ labelProps: { label: d.renameInputLabel },
1042
+ error: x,
1043
+ disabled: C,
1044
+ onKeyDown: ae,
1045
+ onChange: (e) => {
1046
+ b(e ?? ""), S(void 0);
1047
+ }
1048
+ })
1049
+ })
1050
+ }),
1051
+ T && /* @__PURE__ */ K(e, {
1052
+ open: !0,
1053
+ title: d.deleteTitle(T.title),
1054
+ names: [T.title],
1055
+ message: d.deleteDescription,
1056
+ labels: d.deleteDialog,
1057
+ isLoading: D,
1058
+ onConfirm: () => {
1059
+ R();
1060
+ },
1061
+ onClose: I
1062
+ })
1063
+ ] });
1064
+ }), ct = B(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ q("nav", {
1065
+ "aria-label": i,
1066
+ className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1067
+ children: [/* @__PURE__ */ K(O, {
1068
+ "aria-label": i,
1069
+ icon: /* @__PURE__ */ K(z, {
1070
+ "aria-hidden": !0,
1071
+ size: y.MD,
1072
+ stroke: b,
1073
+ className: "rtl:scale-x-[-1]"
1074
+ }),
1075
+ onClick: n
1076
+ }), /* @__PURE__ */ K("a", {
1077
+ href: t,
1078
+ onClick: r,
1079
+ className: "min-w-0 hover:underline focus-visible:underline",
1080
+ children: /* @__PURE__ */ K(C, {
1081
+ text: e,
1082
+ className: d("min-w-0", o)
1083
+ })
1084
+ })]
1085
+ }));
825
1086
  //#endregion
826
- export { Y as ContextFileRejection, Ae as PROJECT_NAME_MAX_BYTES, Ze as ProjectCreateForm, X as ProjectNameError, De as ProjectSource, $e as ProjectView, J as Projects, U as ProjectsSortKey, He as checkContextFiles, We as filterContextFileItems, Re as getContextFilesSize, Le as isStoredContextFile, Fe as validateProjectName };
1087
+ export { Q as ContextFileRejection, Me as PROJECT_NAME_MAX_BYTES, ct as ProjectChatHeader, ot as ProjectConversationList, st as ProjectConversationsPanel, tt as ProjectCreateForm, je as ProjectNameError, Oe as ProjectSource, rt as ProjectView, De as Projects, ve as ProjectsSortKey, Ke as checkContextFiles, Je as filterContextFileItems, Ve as getContextFilesSize, ze as isStoredContextFile, Le as validateProjectName };