@epam/ai-dial-projects 1.3.0-dev.246 → 1.3.0-dev.248

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,38 +1,38 @@
1
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 ie, Label as T, MenuItemMark as E, NeutralButton as ae, Search as oe, Spinner as se, Textarea as D } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowNarrowLeft as ce, IconArrowsSort as O, IconDotsVertical as le, IconPin as ue, IconPinFilled as k } from "@tabler/icons-react";
4
- import { Suspense as de, lazy as A, memo as j, useCallback as M, useEffect as fe, useId as N, useMemo as P, useRef as F, useState as I } from "react";
5
- import { Fragment as pe, jsx as L, jsxs as R } from "react/jsx-runtime";
6
- import { AttachmentCard as me, FileDndOverlay as z } from "@epam/ai-dial-attachment-input";
7
- import { BuilderFormContainer as B } from "@epam/ai-dial-builder-form";
8
- import { LazyMarkdownEditor as V } from "@epam/ai-dial-ui-kit/editors";
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";
9
9
  //#region src/types/projects-sort-key.ts
10
- var H = /* @__PURE__ */ function(e) {
10
+ var U = /* @__PURE__ */ function(e) {
11
11
  return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
12
- }({}), he = (e, t) => {
12
+ }({}), ye = (e, t) => {
13
13
  let n = t.trim().toLocaleLowerCase();
14
14
  return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
15
- }, ge = (e, t, n) => {
15
+ }, be = (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 === H.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
- let o = t === H.Oldest ? 1 : -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;
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
- }, U = 60, _e = 3600, W = 24 * _e, ve = [
26
+ }, xe = 60, Se = 3600, W = 24 * Se, G = [
27
27
  ["year", 365 * W],
28
28
  ["month", 30 * W],
29
29
  ["week", 7 * W],
30
30
  ["day", W],
31
- ["hour", _e],
32
- ["minute", U]
33
- ], G = (e, t, n) => {
31
+ ["hour", Se],
32
+ ["minute", xe]
33
+ ], Ce = (e, t, n) => {
34
34
  let r = (t - e) / 1e3;
35
- for (let [e, t] of ve) {
35
+ for (let [e, t] of G) {
36
36
  let i = Math.floor(r / t);
37
37
  if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
38
38
  }
@@ -46,49 +46,49 @@ var H = /* @__PURE__ */ function(e) {
46
46
  link: "_link_1o77o_23",
47
47
  aboveLink: "_aboveLink_1o77o_39",
48
48
  interactive: "_interactive_1o77o_44"
49
- }, ye = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], be = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, xe = ({ 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__ */ L(w, {
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, {
51
51
  text: e.name,
52
52
  query: t,
53
53
  maxLines: 1,
54
54
  className: l("min-w-0", u, K.title, a != null && K.aboveLink)
55
55
  });
56
- return /* @__PURE__ */ L("li", {
56
+ return /* @__PURE__ */ V("li", {
57
57
  className: "flex min-w-0",
58
- children: /* @__PURE__ */ R(h, {
58
+ children: /* @__PURE__ */ H(h, {
59
59
  "aria-label": e.name,
60
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),
61
61
  children: [
62
- e.updatedAt != null && /* @__PURE__ */ L("time", {
62
+ e.updatedAt != null && /* @__PURE__ */ V("time", {
63
63
  dateTime: new Date(e.updatedAt).toISOString(),
64
64
  className: l(c, K.updatedAt),
65
- children: G(e.updatedAt, ee, s)
65
+ children: Ce(e.updatedAt, ee, s)
66
66
  }),
67
- /* @__PURE__ */ R("div", {
67
+ /* @__PURE__ */ H("div", {
68
68
  className: "flex min-w-0 items-center gap-2",
69
- children: [a == null ? /* @__PURE__ */ L("div", {
69
+ children: [a == null ? /* @__PURE__ */ V("div", {
70
70
  className: "min-w-0 flex-1",
71
71
  children: f
72
- }) : /* @__PURE__ */ L("a", {
72
+ }) : /* @__PURE__ */ V("a", {
73
73
  href: a,
74
74
  onClick: (t) => {
75
- o != null && be(t) && (t.preventDefault(), o(e.id));
75
+ o != null && Te(t) && (t.preventDefault(), o(e.id));
76
76
  },
77
77
  className: l("min-w-0 flex-1", K.link),
78
78
  children: f
79
- }), e.isPinned && /* @__PURE__ */ R("span", {
79
+ }), e.isPinned && /* @__PURE__ */ H("span", {
80
80
  className: l("shrink-0", K.pin),
81
- children: [/* @__PURE__ */ L(k, {
81
+ children: [/* @__PURE__ */ V(j, {
82
82
  size: g.SM,
83
83
  "aria-hidden": !0
84
- }), /* @__PURE__ */ L("span", {
84
+ }), /* @__PURE__ */ V("span", {
85
85
  className: "sr-only",
86
86
  children: i
87
87
  })]
88
88
  })]
89
89
  }),
90
- /* @__PURE__ */ L(x, {
91
- segments: ye(n, e.parentPath),
90
+ /* @__PURE__ */ V(x, {
91
+ segments: we(n, e.parentPath),
92
92
  ariaLabel: r,
93
93
  labelClassName: l(d, K.path),
94
94
  leafClassName: l(te, K.path),
@@ -101,8 +101,8 @@ var H = /* @__PURE__ */ function(e) {
101
101
  container: "_container_qfuxj_1",
102
102
  subtitle: "_subtitle_qfuxj_5",
103
103
  sortButton: "_sortButton_qfuxj_9"
104
- }, Se = ({ 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", ie = C?.subtitleClassName ?? "dial-body-text", T = C?.cardTitleClassName ?? "dial-body-semi-text", ae = C?.pathLabelClassName ?? "dial-tiny-text", D = C?.pathLeafClassName ?? "dial-tiny-semi-text", ce = C?.updatedAtClassName ?? "dial-tiny-text", le = C?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", ue = ee({
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
106
  "--pr-bg": x?.background,
107
107
  "--pr-subtitle-text": x?.subtitleText,
108
108
  "--pr-sort-text": x?.sortButtonText,
@@ -110,15 +110,15 @@ var H = /* @__PURE__ */ function(e) {
110
110
  "--pr-card-title-text": x?.cardTitleText,
111
111
  "--pr-updated-at-text": x?.updatedAtText,
112
112
  "--pr-path-text": x?.pathText
113
- }), [k] = I(() => Date.now()), de = u.trim(), A = r.length > 0, j = A && e.length === 0, M = P(() => ge(he(e, u), h, b), [
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), [
114
114
  e,
115
115
  u,
116
116
  h,
117
117
  b
118
- ]), fe = y.sortOptions.find((e) => e.value === h)?.label ?? y.sortLabel, N = P(() => y.sortOptions.map((e) => ({
118
+ ]), N = y.sortOptions.find((e) => e.value === h)?.label ?? y.sortLabel, P = R(() => y.sortOptions.map((e) => ({
119
119
  key: e.value,
120
120
  label: e.label,
121
- mark: E.Check,
121
+ mark: D.Check,
122
122
  checked: e.value === h,
123
123
  onClick: () => v(e.value)
124
124
  })), [
@@ -127,74 +127,74 @@ var H = /* @__PURE__ */ function(e) {
127
127
  v
128
128
  ]), F = (e) => {
129
129
  d(e ?? "");
130
- }, pe = () => {
130
+ }, I = () => {
131
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
- }, me = (e, t) => o ? /* @__PURE__ */ L(te, {
132
+ }, L = (e, t) => o ? /* @__PURE__ */ V(te, {
133
133
  label: y.createProjectLabel,
134
134
  variant: e,
135
135
  onClick: o,
136
136
  className: l("shrink-0", t)
137
- }) : void 0, z = () => t ? /* @__PURE__ */ L(se, {}) : n || j ? /* @__PURE__ */ R("div", {
137
+ }) : void 0, z = () => t ? /* @__PURE__ */ V(ue, {}) : n || j ? /* @__PURE__ */ H("div", {
138
138
  className: "flex flex-col items-center gap-3",
139
- children: [/* @__PURE__ */ L("p", {
140
- className: l(ie, q.subtitle),
139
+ children: [/* @__PURE__ */ V("p", {
140
+ className: l(T, q.subtitle),
141
141
  children: n ? y.errorLabel : y.incompleteLabel
142
- }), /* @__PURE__ */ L(S, {
142
+ }), /* @__PURE__ */ V(S, {
143
143
  label: y.retryLabel,
144
144
  onClick: a
145
145
  })]
146
- }) : e.length === 0 ? /* @__PURE__ */ L(i, {
146
+ }) : e.length === 0 ? /* @__PURE__ */ V(i, {
147
147
  label: y.emptyStateLabel,
148
148
  description: y.emptyStateDescription,
149
- action: me(m.Secondary, "mt-2"),
149
+ action: L(m.Secondary, "mt-2"),
150
150
  containerClassName: "p-3",
151
151
  labelClassName: "mt-3",
152
- descriptionClassName: le
153
- }) : M.length === 0 ? /* @__PURE__ */ L(i, {
152
+ descriptionClassName: ce
153
+ }) : M.length === 0 ? /* @__PURE__ */ V(i, {
154
154
  label: y.noResultsLabel,
155
155
  containerClassName: "p-3",
156
156
  labelClassName: "mt-3"
157
- }) : /* @__PURE__ */ L("ul", {
157
+ }) : /* @__PURE__ */ V("ul", {
158
158
  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__ */ L(xe, {
159
+ children: M.map((e) => /* @__PURE__ */ V(Ee, {
160
160
  project: e,
161
- searchQuery: de,
161
+ searchQuery: pe,
162
162
  sourceLabel: y.sourceLabels[e.source],
163
163
  folderPathLabel: y.folderPathLabel,
164
164
  pinnedLabel: y.pinnedLabel ?? "Pinned",
165
165
  href: c?.(e.id),
166
166
  onOpen: s,
167
- now: k,
167
+ now: fe,
168
168
  locale: b,
169
- updatedAtClassName: ce,
170
- titleClassName: T,
171
- pathLabelClassName: ae,
172
- pathLeafClassName: D
169
+ updatedAtClassName: O,
170
+ titleClassName: E,
171
+ pathLabelClassName: oe,
172
+ pathLeafClassName: se
173
173
  }, e.id))
174
- }), B = t || n || j;
175
- return /* @__PURE__ */ R("div", {
176
- style: ue,
174
+ }), me = t || n || j;
175
+ return /* @__PURE__ */ H("div", {
176
+ style: de,
177
177
  className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", q.container),
178
178
  children: [
179
- /* @__PURE__ */ R("div", {
179
+ /* @__PURE__ */ H("div", {
180
180
  className: "flex min-w-0 items-center gap-2 px-4 py-4 desktop:px-8",
181
- children: [/* @__PURE__ */ R("div", {
181
+ children: [/* @__PURE__ */ H("div", {
182
182
  className: "min-w-0 flex-1",
183
- children: [/* @__PURE__ */ L("h1", {
183
+ children: [/* @__PURE__ */ V("h1", {
184
184
  className: l("break-words", w),
185
185
  children: y.title
186
- }), y.subtitle && /* @__PURE__ */ L("p", {
187
- className: l("mt-0.5", ie, q.subtitle),
186
+ }), y.subtitle && /* @__PURE__ */ V("p", {
187
+ className: l("mt-0.5", T, q.subtitle),
188
188
  children: y.subtitle
189
189
  })]
190
- }), me(m.Primary)]
190
+ }), L(m.Primary)]
191
191
  }),
192
- /* @__PURE__ */ R("div", {
192
+ /* @__PURE__ */ H("div", {
193
193
  className: "flex flex-col gap-3 px-4 pt-4 pb-5 desktop:flex-row desktop:items-center desktop:px-8",
194
- children: [/* @__PURE__ */ L("div", {
194
+ children: [/* @__PURE__ */ V("div", {
195
195
  role: "search",
196
196
  className: "min-w-0 flex-1",
197
- children: /* @__PURE__ */ L(oe, {
197
+ children: /* @__PURE__ */ V(le, {
198
198
  value: u,
199
199
  onChange: F,
200
200
  placeholder: y.searchPlaceholder,
@@ -202,16 +202,16 @@ var H = /* @__PURE__ */ function(e) {
202
202
  "aria-label": y.searchAriaLabel,
203
203
  size: ne.Large
204
204
  })
205
- }), y.sortOptions.length > 0 && /* @__PURE__ */ L("div", {
205
+ }), y.sortOptions.length > 0 && /* @__PURE__ */ V("div", {
206
206
  role: "group",
207
207
  "aria-label": y.sortLabel,
208
208
  className: "shrink-0",
209
- children: /* @__PURE__ */ L(p, {
210
- items: N,
211
- label: fe,
209
+ children: /* @__PURE__ */ V(p, {
210
+ items: P,
211
+ label: N,
212
212
  variant: m.Primary,
213
213
  appearance: f.Ghost,
214
- iconBefore: /* @__PURE__ */ L(O, {
214
+ iconBefore: /* @__PURE__ */ V(k, {
215
215
  size: g.SM,
216
216
  "aria-hidden": !0,
217
217
  stroke: _
@@ -220,48 +220,47 @@ var H = /* @__PURE__ */ function(e) {
220
220
  })
221
221
  })]
222
222
  }),
223
- /* @__PURE__ */ L("span", {
224
- role: "status",
225
- "aria-live": "polite",
226
- className: "sr-only",
227
- children: pe()
223
+ /* @__PURE__ */ V(ie, {
224
+ visuallyHidden: !0,
225
+ as: ae.Span,
226
+ children: I()
228
227
  }),
229
- /* @__PURE__ */ R("div", {
228
+ /* @__PURE__ */ H("div", {
230
229
  className: "flex w-full min-w-0 flex-1 flex-col items-center gap-5 px-4 pt-6 pb-8 desktop:px-8",
231
- children: [A && !t && !n && !j && /* @__PURE__ */ R("div", {
230
+ children: [A && !t && !n && !j && /* @__PURE__ */ H("div", {
232
231
  className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
233
- children: [/* @__PURE__ */ L("p", {
234
- className: l(ie, q.subtitle),
232
+ children: [/* @__PURE__ */ V("p", {
233
+ className: l(T, q.subtitle),
235
234
  children: y.incompleteLabel
236
- }), /* @__PURE__ */ L(S, {
235
+ }), /* @__PURE__ */ V(S, {
237
236
  label: y.retryLabel,
238
237
  onClick: a
239
238
  })]
240
- }), /* @__PURE__ */ L("div", {
241
- className: l("flex w-full max-w-[1116px] min-w-0 flex-col items-center", B && "flex-1 justify-center"),
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"),
242
241
  children: z()
243
242
  })]
244
243
  })
245
244
  ]
246
245
  });
247
- }, Ce = /* @__PURE__ */ function(e) {
246
+ }, De = /* @__PURE__ */ function(e) {
248
247
  return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
249
- }({}), J = (e) => !!e.dataTransfer?.types.includes("Files"), we = (e) => {
250
- let [t, n] = I(!1), r = F(0);
248
+ }({}), Oe = (e) => !!e.dataTransfer?.types.includes("Files"), ke = (e) => {
249
+ let [t, n] = B(!1), r = z(0);
251
250
  return {
252
251
  isDragActive: t,
253
252
  handlers: {
254
- onDragEnter: M((e) => {
255
- J(e) && (e.preventDefault(), r.current += 1, n(!0));
253
+ onDragEnter: F((e) => {
254
+ Oe(e) && (e.preventDefault(), r.current += 1, n(!0));
256
255
  }, []),
257
- onDragLeave: M((e) => {
258
- J(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
256
+ onDragLeave: F((e) => {
257
+ Oe(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
259
258
  }, []),
260
- onDragOver: M((e) => {
261
- J(e) && e.preventDefault();
259
+ onDragOver: F((e) => {
260
+ Oe(e) && e.preventDefault();
262
261
  }, []),
263
- onDrop: M((t) => {
264
- if (!J(t)) return;
262
+ onDrop: F((t) => {
263
+ if (!Oe(t)) return;
265
264
  t.preventDefault(), r.current = 0, n(!1);
266
265
  let i = Array.from(t.dataTransfer?.files ?? []);
267
266
  i.length > 0 && e(i);
@@ -272,34 +271,34 @@ var H = /* @__PURE__ */ function(e) {
272
271
  return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
273
272
  }({}), X = /* @__PURE__ */ function(e) {
274
273
  return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
275
- }({}), Te = 255, Z = new RegExp(r.source, "u"), Ee = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, De = /* @__PURE__ */ new Set([
274
+ }({}), Ae = 255, je = new RegExp(r.source, "u"), Me = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Ne = /* @__PURE__ */ new Set([
276
275
  ".",
277
276
  "..",
278
277
  "v",
279
278
  "files",
280
279
  ".dial-resource",
281
280
  ".dial-folder"
282
- ]), Oe = (e) => new TextEncoder().encode(e).length, ke = (e) => {
281
+ ]), Pe = (e) => new TextEncoder().encode(e).length, Fe = (e) => {
283
282
  let t = e.trim();
284
- return t.length === 0 ? X.Required : Oe(t) > 255 ? X.TooLong : Z.test(t) || Ee.test(t) ? X.InvalidCharacters : De.has(t) ? X.Reserved : null;
285
- }, Ae = (e) => {
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) => {
286
285
  let t = e.lastIndexOf(".");
287
286
  return t > 0 ? e.slice(t + 1).toLowerCase() : "";
288
- }, je = (e) => "isStored" in e && e.isStored, Me = (e) => je(e) ? e.size : e.file.size, Ne = (e) => e.reduce((e, t) => e + Me(t), 0), Pe = 0, Q = () => (Pe += 1, `project-context-${Date.now()}-${Pe}`), Fe = (e) => {
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) => {
289
288
  let t = e.type || c(e.name) || "application/octet-stream";
290
289
  return {
291
- id: Q(),
290
+ id: Be(),
292
291
  name: e.name,
293
292
  contentType: t,
294
293
  type: s(t),
295
294
  status: a.Idle,
296
295
  file: e
297
296
  };
298
- }, Ie = (e, t, n, r) => ke(e.name) != null || e.name.trim() !== e.name ? Y.InvalidName : r.allowedExtensions.includes(Ae(e.name)) ? t.has(e.name) ? Y.Duplicate : e.size > r.maxFileBytes ? Y.TooLarge : n + e.size > r.maxTotalBytes ? Y.CapacityExceeded : null : Y.UnsupportedType, Le = (e, t, n) => {
299
- let r = new Set(t.map((e) => e.name)), i = Ne(t), a = [], o = [];
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 = [];
300
299
  for (let t of e) {
301
- let e = Ie(t, r, i, n);
302
- e == null ? (r.add(t.name), i += t.size, a.push(Fe(t))) : o.push({
300
+ let e = Q(t, r, i, n);
301
+ e == null ? (r.add(t.name), i += t.size, a.push(Ve(t))) : o.push({
303
302
  name: t.name,
304
303
  reason: e
305
304
  });
@@ -308,276 +307,283 @@ var H = /* @__PURE__ */ function(e) {
308
307
  accepted: a,
309
308
  rejected: o
310
309
  };
311
- }, Re = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), ze = (e, t) => {
310
+ }, Ue = (e, t) => e <= 0 ? 0 : t <= 0 ? 100 : Math.min(100, Math.max(1, Math.round(e / t * 100))), We = (e, t) => {
312
311
  let n = t.trim().toLowerCase();
313
312
  return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
314
- }, Be = {
315
- track: "_track_15unh_1",
316
- fill: "_fill_15unh_5",
317
- text: "_text_15unh_9"
318
- }, Ve = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
313
+ }, Ge = {
314
+ track: "_track_1eyt2_1",
315
+ text: "_text_1eyt2_11"
316
+ }, Ke = ({ usedBytes: e, maxBytes: t, ariaLabel: n, formatLabel: r, textClassName: i = "dial-tiny-text" }) => {
319
317
  if (e <= 0) return null;
320
- let a = Re(e, t), o = r(a);
321
- return /* @__PURE__ */ R("div", {
318
+ let a = r(Ue(e, t));
319
+ return /* @__PURE__ */ H("div", {
322
320
  className: "flex min-w-0 items-center gap-2",
323
- children: [/* @__PURE__ */ L("div", {
324
- role: "meter",
321
+ children: [/* @__PURE__ */ V(O, {
322
+ role: ce.Meter,
323
+ value: e,
324
+ max: t,
325
+ size: ne.Small,
325
326
  "aria-label": n,
326
- "aria-valuemin": 0,
327
- "aria-valuemax": t,
328
- "aria-valuenow": Math.min(e, t),
329
- "aria-valuetext": o,
330
- className: l("h-1 w-[60px] shrink-0 overflow-hidden rounded-full", Be.track),
331
- children: /* @__PURE__ */ L("div", {
332
- className: l("h-full rounded-full", Be.fill),
333
- style: { width: `${a}%` }
334
- })
335
- }), /* @__PURE__ */ L("span", {
327
+ "aria-valuetext": a,
328
+ className: l("w-[60px] shrink-0", Ge.track)
329
+ }), /* @__PURE__ */ V("span", {
336
330
  "aria-hidden": !0,
337
- className: l("whitespace-nowrap", i, Be.text),
338
- children: o
331
+ className: l("whitespace-nowrap", i, Ge.text),
332
+ children: a
339
333
  })]
340
334
  });
341
- }, He = {
335
+ }, qe = {
342
336
  formColumn: "_formColumn_1fxsc_1",
343
337
  helper: "_helper_1fxsc_10",
344
338
  label: "_label_1fxsc_14"
345
- }, Ue = A(async () => ({ default: (await V()).MarkdownEditor })), We = "device", Ge = "file-manager", Ke = ({ 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: E, markdownEditorTheme: ae, className: oe, styles: O }) => {
346
- let le = N(), ue = N(), k = N(), A = N(), j = N(), pe = F(null), V = F(null), H = u(), [he, ge] = I(!1), [U, _e] = I([]), [W, ve] = I(""), G = F(void 0), K = M((e) => e ? async (t, n) => {
347
- if (G.current && !G.current.aborted) throw new DOMException("Busy", "AbortError");
348
- G.current = n;
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;
349
343
  try {
350
344
  return await e(t, n);
351
345
  } finally {
352
- G.current === n && (G.current = void 0);
346
+ W.current === n && (W.current = void 0);
353
347
  }
354
- } : void 0, []), ye = P(() => K(v), [K, v]), be = P(() => K(y), [K, y]), xe = d({
348
+ } : void 0, []), Ce = R(() => G(v), [G, v]), K = R(() => G(y), [G, y]), we = d({
355
349
  value: n.description,
356
350
  onChange: (e) => i("description", e),
357
- onRefine: ye,
351
+ onRefine: Ce,
358
352
  disabled: w
359
- }), q = d({
353
+ }), Te = d({
360
354
  value: n.instructions,
361
355
  onChange: (e) => i("instructions", e),
362
- onRefine: be,
356
+ onRefine: K,
363
357
  disabled: w
364
- }), Se = xe.isPending || q.isPending, Ce = ke(n.name), J = r.name ?? (he && Ce != null ? E.nameErrors[Ce] : void 0), Y = Ce != null || w || Se;
365
- fe(() => {
366
- r.name && pe.current?.focus();
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();
367
361
  }, [r.name]);
368
- let X = P(() => Ne(a), [a]), Te = P(() => c.map((e) => `.${e}`).join(","), [c]), Z = (e) => {
362
+ let Oe = R(() => Re(a), [a]), Y = R(() => c.map((e) => `.${e}`).join(","), [c]), X = (e) => {
369
363
  if (e.length === 0) return;
370
- let { accepted: t, rejected: n } = Le(e, a, {
364
+ let { accepted: t, rejected: n } = He(e, a, {
371
365
  allowedExtensions: c,
372
366
  maxFileBytes: te,
373
367
  maxTotalBytes: f
374
368
  });
375
- _e(n), t.length > 0 && s([...a, ...t]), ve([t.length > 0 ? E.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => E.fileRejections[t](e))].filter(Boolean).join(" "));
376
- }, { isDragActive: Ee, handlers: De } = we(Z), Oe = (e) => {
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) => {
377
371
  let t = a.find((t) => t.id === e);
378
- s(a.filter((t) => t.id !== e)), _e([]), t && ve(E.fileRemovedStatus(t.name));
379
- }, Ae = (e) => {
380
- Z(Array.from(e.target.files ?? [])), e.target.value = "";
381
- }, je = async () => {
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 () => {
382
376
  if (h) try {
383
377
  let e = await h();
384
- e && Z(e);
378
+ e && X(e);
385
379
  } catch {}
386
- }, Me = [{
387
- key: We,
388
- label: E.addFromDeviceLabel,
389
- onClick: () => V.current?.click()
380
+ }, Ie = [{
381
+ key: Ye,
382
+ label: D.addFromDeviceLabel,
383
+ onClick: () => P.current?.click()
390
384
  }, ...h ? [{
391
- key: Ge,
392
- label: E.addFromFileManagerLabel,
393
- onClick: () => void je()
394
- }] : []], Pe = () => {
395
- !Y && (!G.current || G.current.aborted) && C();
396
- }, { colors: Q, typography: Fe } = O ?? {}, Ie = Fe?.titleClassName ?? "dial-h1-text", Re = l(Fe?.labelClassName ?? "dial-tiny-semi-text", He.label), ze = Fe?.helperClassName ?? "dial-tiny-text", Be = ee({
397
- "--pcf-helper-text": Q?.helperText,
398
- "--pcf-label-text": Q?.labelText,
399
- "--pcf-meter-track": Q?.meterTrack,
400
- "--pcf-meter-fill": Q?.meterFill
401
- }), Ke = E.refinement, $ = r.context, qe = !!$;
402
- return /* @__PURE__ */ R("div", {
403
- className: l("relative flex h-full min-h-0 w-full", oe),
404
- ...De,
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,
405
399
  children: [
406
- /* @__PURE__ */ L(z, {
407
- isVisible: Ee,
400
+ /* @__PURE__ */ V(ge, {
401
+ isVisible: Ae,
408
402
  labels: {
409
- title: E.dropOverlayTitle,
410
- subtitle: E.dropOverlaySubtitle
403
+ title: D.dropOverlayTitle,
404
+ subtitle: D.dropOverlaySubtitle
411
405
  }
412
406
  }),
413
- /* @__PURE__ */ L(B, {
407
+ /* @__PURE__ */ V(_e, {
414
408
  labels: {
415
- title: E.title,
416
- backButtonLabel: E.backLabel,
417
- cancelButtonLabel: E.cancelLabel,
418
- submitButtonLabel: E.createLabel,
419
- submittingLabel: E.submittingLabel ?? E.createLabel
409
+ title: D.title,
410
+ backButtonLabel: D.backLabel,
411
+ cancelButtonLabel: D.cancelLabel,
412
+ submitButtonLabel: D.createLabel,
413
+ submittingLabel: D.submittingLabel ?? D.createLabel
420
414
  },
421
415
  onBack: x,
422
416
  onCancel: S,
423
- onSubmit: Pe,
417
+ onSubmit: Le,
424
418
  isCancelDisabled: w,
425
- isSubmitDisabled: Y,
419
+ isSubmitDisabled: De,
426
420
  isSubmitting: w,
427
- backIcon: /* @__PURE__ */ L(ce, {
421
+ backIcon: /* @__PURE__ */ V(fe, {
428
422
  size: g.LG,
429
423
  stroke: _,
430
424
  "aria-hidden": !0,
431
425
  className: "rtl:scale-x-[-1]"
432
426
  }),
433
427
  styles: {
434
- colors: { background: Q?.background },
428
+ colors: { background: Z?.background },
435
429
  header: {
436
- colors: { borderColor: Q?.headerBorder },
437
- typography: { fontClassName: Ie }
430
+ colors: { borderColor: Z?.headerBorder },
431
+ typography: { fontClassName: Be }
438
432
  },
439
- cssVars: Be
433
+ cssVars: Ue
440
434
  },
441
- children: /* @__PURE__ */ R("div", {
442
- className: l("mx-auto flex w-full max-w-[1040px] min-w-0 flex-col gap-5 py-6", He.formColumn),
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),
443
437
  children: [
444
- /* @__PURE__ */ R("div", {
438
+ /* @__PURE__ */ H("div", {
445
439
  className: "flex flex-col gap-1",
446
- children: [/* @__PURE__ */ L(ie, {
447
- id: le,
448
- inputRef: pe,
449
- value: n.name,
450
- onChange: (e) => i("name", e ?? ""),
451
- onBlur: () => ge(!0),
452
- placeholder: E.namePlaceholder,
453
- labelProps: {
454
- label: E.nameLabel,
455
- required: !0
456
- },
457
- required: !0,
458
- "aria-required": !0,
459
- invalid: !!J,
460
- "aria-invalid": !!J,
461
- "aria-describedby": J ? ue : void 0
462
- }), J && /* @__PURE__ */ L(b, {
463
- id: ue,
464
- role: r.name ? "alert" : void 0,
465
- className: ze,
466
- text: J
467
- })]
440
+ children: [
441
+ /* @__PURE__ */ V(T, {
442
+ id: le,
443
+ inputRef: N,
444
+ value: n.name,
445
+ onChange: (e) => i("name", e ?? ""),
446
+ onBlur: () => U(!0),
447
+ placeholder: D.namePlaceholder,
448
+ labelProps: {
449
+ label: D.nameLabel,
450
+ required: !0
451
+ },
452
+ required: !0,
453
+ "aria-required": !0,
454
+ invalid: !!J,
455
+ "aria-invalid": !!J,
456
+ "aria-describedby": J ? k : void 0
457
+ }),
458
+ /* @__PURE__ */ V(b, {
459
+ announce: oe.Assertive,
460
+ id: k,
461
+ className: Q,
462
+ text: r.name ?? ""
463
+ }),
464
+ J && !r.name && /* @__PURE__ */ V(b, {
465
+ id: k,
466
+ className: Q,
467
+ text: J
468
+ })
469
+ ]
468
470
  }),
469
- /* @__PURE__ */ L(o, {
471
+ /* @__PURE__ */ V(o, {
470
472
  isEnabled: !!v,
471
- fieldId: k,
472
- label: E.descriptionLabel,
473
- labelClassName: Re,
474
- labels: Ke,
475
- refinement: xe,
476
- disabled: w || Se,
477
- children: /* @__PURE__ */ L(D, {
478
- id: k,
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,
479
481
  value: n.description,
480
482
  onChange: (e) => {
481
- xe.reset(), i("description", e);
483
+ we.reset(), i("description", e);
482
484
  },
483
- placeholder: E.descriptionPlaceholder,
484
- labelProps: v ? void 0 : { label: E.descriptionLabel }
485
+ placeholder: D.descriptionPlaceholder,
486
+ labelProps: v ? void 0 : { label: D.descriptionLabel }
485
487
  })
486
488
  }),
487
- /* @__PURE__ */ L(o, {
489
+ /* @__PURE__ */ V(o, {
488
490
  isEnabled: !!y,
489
491
  fieldId: A,
490
- label: E.instructionsLabel,
491
- labelClassName: Re,
492
- labels: Ke,
493
- refinement: q,
494
- disabled: w || Se,
495
- children: /* @__PURE__ */ R("div", {
492
+ label: D.instructionsLabel,
493
+ labelClassName: Ve,
494
+ labels: We,
495
+ refinement: Te,
496
+ disabled: w || Ee,
497
+ children: /* @__PURE__ */ H("div", {
496
498
  className: "flex flex-1 flex-col gap-2",
497
- children: [!y && /* @__PURE__ */ L(T, {
499
+ children: [!y && /* @__PURE__ */ V(E, {
498
500
  htmlFor: A,
499
- className: Re,
500
- label: E.instructionsLabel
501
- }), /* @__PURE__ */ L("div", {
502
- ref: H,
501
+ className: Ve,
502
+ label: D.instructionsLabel
503
+ }), /* @__PURE__ */ V("div", {
504
+ ref: me,
503
505
  className: l("w-full", e, t),
504
- children: /* @__PURE__ */ L(de, {
505
- fallback: /* @__PURE__ */ L(se, {}),
506
- children: /* @__PURE__ */ L(Ue, {
506
+ children: /* @__PURE__ */ V(M, {
507
+ fallback: /* @__PURE__ */ V(ue, {}),
508
+ children: /* @__PURE__ */ V(Je, {
507
509
  id: A,
508
510
  value: n.instructions,
509
511
  onChange: (e) => {
510
- q.reset(), i("instructions", e);
512
+ Te.reset(), i("instructions", e);
511
513
  },
512
514
  height: 176,
513
- theme: ae,
514
- placeholder: E.instructionsPlaceholder
515
+ theme: se,
516
+ placeholder: D.instructionsPlaceholder
515
517
  })
516
518
  })
517
519
  })]
518
520
  })
519
521
  }),
520
- /* @__PURE__ */ R("section", {
522
+ /* @__PURE__ */ H("section", {
521
523
  "aria-labelledby": j,
522
524
  className: "flex flex-col gap-2",
523
525
  children: [
524
- /* @__PURE__ */ R("div", {
526
+ /* @__PURE__ */ H("div", {
525
527
  className: "flex min-w-0 flex-wrap items-center justify-between gap-2",
526
- children: [/* @__PURE__ */ L("h2", {
528
+ children: [/* @__PURE__ */ V("h2", {
527
529
  id: j,
528
- className: Re,
529
- children: E.contextLabel
530
- }), /* @__PURE__ */ R("div", {
530
+ className: Ve,
531
+ children: D.contextLabel
532
+ }), /* @__PURE__ */ H("div", {
531
533
  className: "flex min-w-0 items-center gap-4",
532
- children: [/* @__PURE__ */ L(Ve, {
533
- usedBytes: X,
534
+ children: [/* @__PURE__ */ V(Ke, {
535
+ usedBytes: Oe,
534
536
  maxBytes: f,
535
- ariaLabel: E.capacityMeterLabel,
536
- formatLabel: E.capacityLabel,
537
- textClassName: ze
538
- }), /* @__PURE__ */ L(p, {
539
- items: Me,
540
- label: E.addLabel,
537
+ ariaLabel: D.capacityMeterLabel,
538
+ formatLabel: D.capacityLabel,
539
+ textClassName: Q
540
+ }), /* @__PURE__ */ V(p, {
541
+ items: Ie,
542
+ label: D.addLabel,
541
543
  variant: m.Neutral,
542
544
  size: ne.Small,
543
545
  disabled: w
544
546
  })]
545
547
  })]
546
548
  }),
547
- /* @__PURE__ */ L("input", {
548
- ref: V,
549
+ /* @__PURE__ */ V("input", {
550
+ ref: P,
549
551
  type: "file",
550
552
  multiple: !0,
551
- accept: Te,
553
+ accept: Y,
552
554
  tabIndex: -1,
553
555
  "aria-hidden": !0,
554
556
  className: "sr-only",
555
- onChange: Ae
557
+ onChange: Ne
556
558
  }),
557
- /* @__PURE__ */ L(re, {
558
- label: E.dropZoneLabel,
559
- description: E.dropZoneHint,
560
- accept: Te,
559
+ /* @__PURE__ */ V(re, {
560
+ label: D.dropZoneLabel,
561
+ description: D.dropZoneHint,
562
+ accept: Y,
561
563
  multiple: !0,
562
564
  disabled: w,
563
- onChange: Z,
564
- onReject: Z
565
+ onChange: X,
566
+ onReject: X
565
567
  }),
566
- (U.length > 0 || qe) && /* @__PURE__ */ R("ul", {
567
- className: l("flex flex-col gap-1", ze, He.helper),
568
- children: [U.map(({ name: e, reason: t }) => /* @__PURE__ */ L("li", { children: E.fileRejections[t](e) }, `${t}:${e}`)), qe && /* @__PURE__ */ L("li", {
569
- role: "alert",
570
- children: $
571
- })]
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}`))
571
+ }),
572
+ /* @__PURE__ */ V(ie, {
573
+ politeness: oe.Assertive,
574
+ children: Ze && /* @__PURE__ */ V("p", {
575
+ className: l(Q, qe.helper),
576
+ children: Ge
577
+ })
572
578
  }),
573
- a.length > 0 && /* @__PURE__ */ L("ul", {
579
+ a.length > 0 && /* @__PURE__ */ V("ul", {
574
580
  className: "flex min-w-0 flex-wrap gap-2 pt-1",
575
- children: a.map((e) => /* @__PURE__ */ L("li", {
581
+ children: a.map((e) => /* @__PURE__ */ V("li", {
576
582
  className: "min-w-0",
577
- children: /* @__PURE__ */ L(me, {
583
+ children: /* @__PURE__ */ V(he, {
578
584
  attachment: e,
579
- onRemove: Oe,
580
- labels: { removeLabel: E.removeFileLabel(e.name) }
585
+ onRemove: Me,
586
+ labels: { removeLabel: D.removeFileLabel(e.name) }
581
587
  })
582
588
  }, e.id))
583
589
  })
@@ -586,11 +592,10 @@ var H = /* @__PURE__ */ function(e) {
586
592
  ]
587
593
  })
588
594
  }),
589
- /* @__PURE__ */ L("span", {
590
- role: "status",
591
- "aria-live": "polite",
592
- className: "sr-only",
593
- children: w ? E.creatingStatus : W
595
+ /* @__PURE__ */ V(ie, {
596
+ visuallyHidden: !0,
597
+ as: ae.Span,
598
+ children: w ? D.creatingStatus : xe
594
599
  })
595
600
  ]
596
601
  });
@@ -601,21 +606,21 @@ var H = /* @__PURE__ */ function(e) {
601
606
  body: "_body_16lvl_13",
602
607
  secondary: "_secondary_16lvl_17",
603
608
  panel: "_panel_16lvl_21"
604
- }, qe = (e) => ({
609
+ }, Qe = (e) => ({
605
610
  id: e.name,
606
611
  name: e.name,
607
612
  contentType: e.contentType,
608
613
  type: s(e.contentType),
609
614
  status: a.Idle
610
- }), Je = j(({ 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: ie, labels: T, styles: E }) => {
611
- let { colors: D, typography: O } = E ?? {}, de = O?.titleClassName ?? "dial-h2-text", A = O?.panelTitleClassName ?? "dial-body-semi-text", j = O?.sectionTitleClassName ?? "dial-tiny-text", M = O?.bodyClassName ?? "dial-small-text", fe = O?.helperClassName ?? "dial-tiny-text", F = O?.instructionsHeadingClassName ?? "dial-small-semi-text", I = ee({
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({
612
617
  "--pv-bg": D?.background,
613
618
  "--pv-border": D?.border,
614
619
  "--pv-heading-text": D?.headingText,
615
620
  "--pv-body-text": D?.bodyText,
616
621
  "--pv-secondary-text": D?.secondaryText
617
- }), z = P(() => e?.contextFiles ?? [], [e]), B = P(() => ze(z, c), [z, c]), V = c.trim(), H = N(), he = P(() => {
618
- let e = l("mb-1 mt-3 first:mt-0", F);
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);
619
624
  return {
620
625
  h1: e,
621
626
  h2: e,
@@ -627,113 +632,112 @@ var H = /* @__PURE__ */ function(e) {
627
632
  ul: M,
628
633
  ol: M
629
634
  };
630
- }, [M, F]), ge = (e) => {
635
+ }, [M, P]), ve = (e) => {
631
636
  let t = [];
632
637
  return e && p && t.push({
633
638
  key: "publish",
634
- label: T.publishLabel,
639
+ label: E.publishLabel,
635
640
  onClick: p
636
641
  }), e && h && t.push({
637
642
  key: "edit",
638
- label: T.editLabel,
643
+ label: E.editLabel,
639
644
  onClick: h
640
645
  }), ne && t.push({
641
646
  key: "share",
642
- label: T.shareLabel,
647
+ label: E.shareLabel,
643
648
  onClick: ne
644
649
  }), t.push({
645
650
  key: "download",
646
- label: T.downloadLabel,
651
+ label: E.downloadLabel,
647
652
  onClick: re
648
653
  }), b && t.push({
649
654
  key: "delete",
650
- label: T.deleteLabel,
655
+ label: E.deleteLabel,
651
656
  danger: !0,
652
657
  onClick: b
653
658
  }), t;
654
- }, U = (e, t) => /* @__PURE__ */ L("div", {
659
+ }, U = (e, t) => /* @__PURE__ */ V("div", {
655
660
  className: t,
656
- children: /* @__PURE__ */ L(v, {
657
- items: ge(e),
661
+ children: /* @__PURE__ */ V(v, {
662
+ items: ve(e),
658
663
  matchReferenceWidth: !1,
659
664
  listClassName: "w-[200px]",
660
- children: /* @__PURE__ */ L(C, {
661
- icon: /* @__PURE__ */ L(le, {
665
+ children: /* @__PURE__ */ V(C, {
666
+ icon: /* @__PURE__ */ V(pe, {
662
667
  size: g.MD,
663
668
  "aria-hidden": !0,
664
669
  stroke: _
665
670
  }),
666
- "aria-label": T.moreActionsLabel
671
+ "aria-label": E.moreActionsLabel
667
672
  })
668
673
  })
669
674
  });
670
- return t || r || a || e == null ? /* @__PURE__ */ L("div", {
671
- style: I,
675
+ return t || r || a || e == null ? /* @__PURE__ */ V("div", {
676
+ style: F,
672
677
  className: l("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
673
- children: t ? /* @__PURE__ */ L(se, {}) : r ? /* @__PURE__ */ R("div", {
678
+ children: t ? /* @__PURE__ */ V(ue, {}) : r ? /* @__PURE__ */ H("div", {
674
679
  className: "flex flex-col items-center gap-3",
675
- children: [/* @__PURE__ */ L("p", {
676
- role: "alert",
680
+ children: [/* @__PURE__ */ V("p", {
681
+ role: "status",
677
682
  className: l(M, $.body),
678
- children: T.errorLabel
679
- }), /* @__PURE__ */ L(S, {
680
- label: T.retryLabel,
683
+ children: E.errorLabel
684
+ }), /* @__PURE__ */ V(S, {
685
+ label: E.retryLabel,
681
686
  onClick: w
682
687
  })]
683
- }) : /* @__PURE__ */ R("div", {
688
+ }) : /* @__PURE__ */ H("div", {
684
689
  className: "flex flex-col items-center gap-3",
685
- children: [/* @__PURE__ */ L("p", {
686
- role: "alert",
690
+ children: [/* @__PURE__ */ V("p", {
687
691
  className: l(M, $.body),
688
- children: T.notFoundLabel
689
- }), /* @__PURE__ */ L(S, {
690
- label: T.browseProjectsLabel,
691
- onClick: ie
692
+ children: E.notFoundLabel
693
+ }), /* @__PURE__ */ V(S, {
694
+ label: E.browseProjectsLabel,
695
+ onClick: T
692
696
  })]
693
697
  })
694
- }) : /* @__PURE__ */ R("div", {
695
- style: I,
698
+ }) : /* @__PURE__ */ H("div", {
699
+ style: F,
696
700
  className: l("flex h-full w-full min-w-0 flex-col overflow-y-auto", $.container),
697
- children: [/* @__PURE__ */ R("header", {
701
+ children: [/* @__PURE__ */ H("header", {
698
702
  className: l("flex min-w-0 items-center gap-2 px-4 py-3 desktop:px-8", $.header),
699
703
  children: [
700
- /* @__PURE__ */ L(C, {
701
- icon: /* @__PURE__ */ L(ce, {
704
+ /* @__PURE__ */ V(C, {
705
+ icon: /* @__PURE__ */ V(fe, {
702
706
  size: g.LG,
703
707
  className: "rtl:scale-x-[-1]",
704
708
  "aria-hidden": !0,
705
709
  stroke: _
706
710
  }),
707
- "aria-label": T.backLabel,
711
+ "aria-label": E.backLabel,
708
712
  onClick: d
709
713
  }),
710
- /* @__PURE__ */ L("h1", {
711
- className: l("min-w-0 flex-1", de, $.title),
712
- children: /* @__PURE__ */ L(y, { text: e.name })
714
+ /* @__PURE__ */ V("h1", {
715
+ className: l("min-w-0 flex-1", ce, $.title),
716
+ children: /* @__PURE__ */ V(y, { text: e.name })
713
717
  }),
714
- /* @__PURE__ */ L(C, {
715
- icon: o ? /* @__PURE__ */ L(k, {
718
+ /* @__PURE__ */ V(C, {
719
+ icon: o ? /* @__PURE__ */ V(j, {
716
720
  size: g.MD,
717
721
  "aria-hidden": !0
718
- }) : /* @__PURE__ */ L(ue, {
722
+ }) : /* @__PURE__ */ V(A, {
719
723
  size: g.MD,
720
724
  "aria-hidden": !0,
721
725
  stroke: _
722
726
  }),
723
- "aria-label": T.pinLabel,
727
+ "aria-label": E.pinLabel,
724
728
  "aria-pressed": o,
725
729
  "aria-disabled": s || void 0,
726
730
  onClick: () => {
727
731
  s || f();
728
732
  }
729
733
  }),
730
- p && /* @__PURE__ */ L(ae, {
731
- label: T.publishLabel,
734
+ p && /* @__PURE__ */ V(se, {
735
+ label: E.publishLabel,
732
736
  onClick: p,
733
737
  className: "hidden shrink-0 desktop:inline-flex"
734
738
  }),
735
- h && /* @__PURE__ */ L(te, {
736
- label: T.editLabel,
739
+ h && /* @__PURE__ */ V(te, {
740
+ label: E.editLabel,
737
741
  variant: m.Primary,
738
742
  onClick: h,
739
743
  className: "hidden shrink-0 desktop:inline-flex"
@@ -741,76 +745,75 @@ var H = /* @__PURE__ */ function(e) {
741
745
  U(!1, "hidden desktop:block"),
742
746
  U(!0, "desktop:hidden")
743
747
  ]
744
- }), /* @__PURE__ */ L("div", {
748
+ }), /* @__PURE__ */ V("div", {
745
749
  className: "flex min-w-0 flex-1 flex-col desktop:flex-row desktop:justify-end",
746
- children: /* @__PURE__ */ R("aside", {
747
- "aria-labelledby": H,
750
+ children: /* @__PURE__ */ H("aside", {
751
+ "aria-labelledby": ge,
748
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
753
  children: [
750
- /* @__PURE__ */ L("h2", {
751
- id: H,
752
- className: l(A, $.title),
753
- children: T.detailsLabel
754
+ /* @__PURE__ */ V("h2", {
755
+ id: ge,
756
+ className: l(de, $.title),
757
+ children: E.detailsLabel
754
758
  }),
755
- e.description !== "" && /* @__PURE__ */ R("section", {
759
+ e.description !== "" && /* @__PURE__ */ H("section", {
756
760
  className: "flex min-w-0 flex-col gap-1",
757
- children: [/* @__PURE__ */ L("h3", {
758
- className: l(j, $.secondary),
759
- children: T.descriptionLabel
760
- }), /* @__PURE__ */ L("p", {
761
+ children: [/* @__PURE__ */ V("h3", {
762
+ className: l(k, $.secondary),
763
+ children: E.descriptionLabel
764
+ }), /* @__PURE__ */ V("p", {
761
765
  className: l("break-words whitespace-pre-line", M, $.body),
762
766
  children: e.description
763
767
  })]
764
768
  }),
765
- e.instructions !== "" && /* @__PURE__ */ R("section", {
769
+ e.instructions !== "" && /* @__PURE__ */ H("section", {
766
770
  className: "flex min-w-0 flex-col gap-1",
767
- children: [/* @__PURE__ */ L("h3", {
768
- className: l(j, $.secondary),
769
- children: T.instructionsLabel
770
- }), /* @__PURE__ */ L("div", {
771
+ children: [/* @__PURE__ */ V("h3", {
772
+ className: l(k, $.secondary),
773
+ children: E.instructionsLabel
774
+ }), /* @__PURE__ */ V("div", {
771
775
  className: l("min-w-0 break-words", M, $.body),
772
- children: /* @__PURE__ */ L(n, {
776
+ children: /* @__PURE__ */ V(n, {
773
777
  content: e.instructions,
774
- classNames: he
778
+ classNames: _e
775
779
  })
776
780
  })]
777
781
  }),
778
- /* @__PURE__ */ R("section", {
782
+ /* @__PURE__ */ H("section", {
779
783
  className: "flex min-w-0 flex-col gap-2",
780
- children: [/* @__PURE__ */ L("h3", {
781
- className: l(j, $.secondary),
782
- children: T.contextLabel
783
- }), z.length === 0 ? /* @__PURE__ */ L(i, { label: T.emptyContextLabel }) : /* @__PURE__ */ R(pe, { children: [
784
- /* @__PURE__ */ L("div", {
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", {
785
789
  role: "search",
786
- children: /* @__PURE__ */ L(oe, {
790
+ children: /* @__PURE__ */ V(le, {
787
791
  value: c,
788
792
  onChange: (e) => u(e ?? ""),
789
- placeholder: T.contextSearchPlaceholder,
790
- clearLabel: T.clearSearchLabel,
791
- "aria-label": T.contextSearchAriaLabel
793
+ placeholder: E.contextSearchPlaceholder,
794
+ clearLabel: E.clearSearchLabel,
795
+ "aria-label": E.contextSearchAriaLabel
792
796
  })
793
797
  }),
794
- B.length === 0 ? /* @__PURE__ */ L("p", {
795
- className: l(fe, $.secondary),
796
- children: T.noContextMatchesLabel
797
- }) : /* @__PURE__ */ L("ul", {
798
+ z.length === 0 ? /* @__PURE__ */ V("p", {
799
+ className: l(N, $.secondary),
800
+ children: E.noContextMatchesLabel
801
+ }) : /* @__PURE__ */ V("ul", {
798
802
  className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
799
- children: B.map((e) => /* @__PURE__ */ L("li", {
803
+ children: z.map((e) => /* @__PURE__ */ V("li", {
800
804
  className: "min-w-0",
801
- children: /* @__PURE__ */ L(me, {
802
- attachment: qe(e),
803
- searchQuery: V,
805
+ children: /* @__PURE__ */ V(he, {
806
+ attachment: Qe(e),
807
+ searchQuery: B,
804
808
  onClick: x,
805
- labels: { clickLabel: T.openFileLabel(e.name) }
809
+ labels: { clickLabel: E.openFileLabel(e.name) }
806
810
  })
807
811
  }, e.name))
808
812
  }),
809
- /* @__PURE__ */ L("span", {
810
- role: "status",
811
- "aria-live": "polite",
812
- className: "sr-only",
813
- children: V === "" ? "" : T.contextResultCountLabel(B.length)
813
+ /* @__PURE__ */ V(ie, {
814
+ visuallyHidden: !0,
815
+ as: ae.Span,
816
+ children: B === "" ? "" : E.contextResultCountLabel(z.length)
814
817
  })
815
818
  ] })]
816
819
  })
@@ -820,4 +823,4 @@ var H = /* @__PURE__ */ function(e) {
820
823
  });
821
824
  });
822
825
  //#endregion
823
- export { Y as ContextFileRejection, Te as PROJECT_NAME_MAX_BYTES, Ke as ProjectCreateForm, X as ProjectNameError, Ce as ProjectSource, Je as ProjectView, Se as Projects, H as ProjectsSortKey, Le as checkContextFiles, ze as filterContextFileItems, Ne as getContextFilesSize, je as isStoredContextFile, ke as validateProjectName };
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 };