@epam/ai-dial-projects 1.4.0-dev.6 → 1.4.0-dev.63

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
- import { ActionMenu as e, DeleteConfirmationDialog 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, useIsMobile as p, useTextRefinement as m } from "@epam/ai-dial-chat-shared";
2
- import { Button as h, ButtonAppearance as g, ButtonDropdown as _, ButtonVariant as v, CaptionText as te, CardShell as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE 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 ne, Label as re, LinkButton as A, LiveRegion as j, LiveRegionElement as M, LiveRegionPoliteness as N, MenuItemMark as P, NeutralButton as F, Popup as I, PopupSize as L, Search as ie, Spinner as ae } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowNarrowLeft as oe, IconArrowsSort as R, IconDotsVertical as z, IconDownload as B, IconPencilMinus as V, IconPin as H, IconPinFilled as se, IconPlus as ce, IconShare as le, IconSparkles as U, IconTrashX as ue, IconWorldOff as de, IconWorldShare as fe, createReactComponent as pe } from "@tabler/icons-react";
4
- import { Suspense as me, lazy as he, memo as W, useCallback as G, useEffect as ge, useId as K, useMemo as q, useRef as J, useState as Y } from "react";
5
- import { Fragment as _e, jsx as X, jsxs as Z } from "react/jsx-runtime";
6
- import { AttachmentCard as ve, FileDndOverlay as ye } from "@epam/ai-dial-attachment-input";
7
- import { BuilderFormActionsOrder as be, BuilderFormContainer as xe } from "@epam/ai-dial-builder-form";
8
- import { LazyMarkdownEditor as Se } from "@epam/ai-dial-ui-kit/editors";
1
+ import { ActionMenu as e, ConfirmationDialog as t, ConfirmationIdentityRow as n, DeleteConfirmationDialog as r, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as i, MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as a, MarkdownRenderer as o, PROHIBITED_CONVERSATION_NAME_CHARS_RE as s, PanelEmptyState as c, RequestStatus as l, ResourceSummary as u, TextRefinementField as d, buildCssVars as f, getAttachmentTypeFromMime as p, inferMimeTypeFromPath as m, mergeClasses as h, useAvailableHeightCap as g, useIsMobile as _, useTextRefinement as v } from "@epam/ai-dial-chat-shared";
2
+ import { Button as y, ButtonAppearance as ee, ButtonDropdown as b, ButtonVariant as x, CaptionText as S, CardShell as C, ConfirmationPopupVariant as w, DIAL_ICON_SIZE as T, DIAL_KIT_ICON_STROKE as E, ElementSize as D, EllipsisTooltip as O, ErrorText as k, FileDropzone as te, FolderPath as ne, GhostButton as A, GhostIconButton as re, Highlight as j, Input as ie, Label as M, LinkButton as N, LiveRegion as P, LiveRegionElement as ae, LiveRegionPoliteness as F, MenuItemMark as I, NeutralButton as L, Popup as oe, PopupSize as se, Search as ce, Spinner as le } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowNarrowLeft as R, IconArrowsSort as ue, IconDotsVertical as de, IconDownload as fe, IconPencilMinus as pe, IconPin as z, IconPinFilled as B, IconPlus as V, IconShare as me, IconSparkles as he, IconTrashX as ge, IconUserOff as _e, IconWorldOff as ve, IconWorldShare as ye, createReactComponent as be } from "@tabler/icons-react";
4
+ import { Suspense as xe, lazy as Se, memo as H, useCallback as U, useEffect as Ce, useId as W, useMemo as G, useRef as K, useState as q } from "react";
5
+ import { Fragment as we, jsx as J, jsxs as Y } from "react/jsx-runtime";
6
+ import { AttachmentCard as Te, FileDndOverlay as Ee } from "@epam/ai-dial-attachment-input";
7
+ import { BuilderFormActionsOrder as X, BuilderFormContainer as De } from "@epam/ai-dial-builder-form";
8
+ import { LazyMarkdownEditor as Oe } from "@epam/ai-dial-ui-kit/editors";
9
9
  //#region src/types/projects-sort-key.ts
10
- var Ce = /* @__PURE__ */ function(e) {
10
+ var ke = /* @__PURE__ */ function(e) {
11
11
  return e.Newest = "newest", e.Oldest = "oldest", e.NameAsc = "name-asc", e;
12
- }({}), we = (e, t) => {
12
+ }({}), Ae = (e, t) => {
13
13
  let n = t.trim().toLocaleLowerCase();
14
14
  return n ? e.filter((e) => e.name.toLocaleLowerCase().includes(n)) : e;
15
- }, Te = (e, t, n) => {
15
+ }, je = (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 === Ce.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
- let o = t === Ce.Oldest ? 1 : -1;
20
+ if (t === ke.NameAsc) return [...e].sort((e, t) => a(e, t) || i(e, t));
21
+ let o = t === ke.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
- }, Ee = 60, De = 3600, Oe = 24 * De, ke = [
27
- ["year", 365 * Oe],
28
- ["month", 30 * Oe],
29
- ["week", 7 * Oe],
30
- ["day", Oe],
31
- ["hour", De],
32
- ["minute", Ee]
33
- ], Ae = (e, t, n) => {
26
+ }, Me = 60, Ne = 3600, Z = 24 * Ne, Pe = [
27
+ ["year", 365 * Z],
28
+ ["month", 30 * Z],
29
+ ["week", 7 * Z],
30
+ ["day", Z],
31
+ ["hour", Ne],
32
+ ["minute", Me]
33
+ ], Fe = (e, t, n) => {
34
34
  let r = (t - e) / 1e3;
35
- for (let [e, t] of ke) {
35
+ for (let [e, t] of Pe) {
36
36
  let i = Math.floor(r / t);
37
37
  if (i >= 1) return new Intl.RelativeTimeFormat(n).format(-i, e);
38
38
  }
@@ -48,71 +48,71 @@ var Ce = /* @__PURE__ */ function(e) {
48
48
  link: "_link_13sy6_41",
49
49
  aboveLink: "_aboveLink_13sy6_57",
50
50
  interactive: "_interactive_13sy6_62"
51
- }, je = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Me = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Ne = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: ee, locale: l, updatedAtClassName: u, titleClassName: f, pathLabelClassName: p, pathLeafClassName: m }) => {
52
- let h = /* @__PURE__ */ X(k, {
51
+ }, Ie = (e, t) => [e, ...(t ?? "").split("/").filter((e) => e.length > 0)], Le = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Re = ({ project: e, searchQuery: t, sourceLabel: n, folderPathLabel: r, pinnedLabel: i, pinLabel: a, onTogglePin: o, href: s, onOpen: c, now: l, locale: u, updatedAtClassName: d, titleClassName: f, pathLabelClassName: p, pathLeafClassName: m }) => {
52
+ let g = /* @__PURE__ */ J(j, {
53
53
  text: e.name,
54
54
  query: t,
55
55
  maxLines: 1,
56
- className: d("min-w-0", f, Q.title, s != null && Q.aboveLink)
57
- }), g = /* @__PURE__ */ X(E, {
58
- segments: je(n, e.parentPath),
56
+ className: h("min-w-0", f, Q.title, s != null && Q.aboveLink)
57
+ }), _ = /* @__PURE__ */ J(ne, {
58
+ segments: Ie(n, e.parentPath),
59
59
  ariaLabel: r,
60
- labelClassName: d(p, Q.path),
61
- leafClassName: d(m, Q.path)
62
- }), _ = J(null);
63
- return /* @__PURE__ */ X("li", {
60
+ labelClassName: h(p, Q.path),
61
+ leafClassName: h(m, Q.path)
62
+ }), v = K(null);
63
+ return /* @__PURE__ */ J("li", {
64
64
  className: "flex min-w-0",
65
- children: /* @__PURE__ */ Z(y, {
65
+ children: /* @__PURE__ */ Y(C, {
66
66
  "aria-label": e.name,
67
- className: d("relative flex w-full min-w-0 flex-col gap-2", Q.card, s != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", s != null && Q.interactive),
67
+ className: h("relative flex w-full min-w-0 flex-col gap-2", Q.card, s != null && "has-focus-visible:translate-y-[-3px] has-focus-visible:shadow-lg motion-reduce:has-focus-visible:translate-y-0", s != null && Q.interactive),
68
68
  children: [
69
- e.updatedAt != null && /* @__PURE__ */ X("time", {
69
+ e.updatedAt != null && /* @__PURE__ */ J("time", {
70
70
  dateTime: new Date(e.updatedAt).toISOString(),
71
- className: d(u, Q.updatedAt, (e.isPinned || o != null) && "pe-6"),
72
- children: Ae(e.updatedAt, ee, l)
71
+ className: h(d, Q.updatedAt, (e.isPinned || o != null) && "pe-6"),
72
+ children: Fe(e.updatedAt, l, u)
73
73
  }),
74
- /* @__PURE__ */ Z("div", {
75
- className: d("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
76
- children: [s == null ? /* @__PURE__ */ X("div", {
74
+ /* @__PURE__ */ Y("div", {
75
+ className: h("flex min-w-0 items-center", (e.isPinned || o != null) && "pe-6"),
76
+ children: [s == null ? /* @__PURE__ */ J("div", {
77
77
  className: "min-w-0 flex-1",
78
- children: h
79
- }) : /* @__PURE__ */ X("a", {
80
- ref: _,
78
+ children: g
79
+ }) : /* @__PURE__ */ J("a", {
80
+ ref: v,
81
81
  href: s,
82
82
  onClick: (t) => {
83
- c != null && Me(t) && (t.preventDefault(), c(e.id));
83
+ c != null && Le(t) && (t.preventDefault(), c(e.id));
84
84
  },
85
- className: d("min-w-0 flex-1", Q.link),
86
- children: h
87
- }), o == null ? e.isPinned && /* @__PURE__ */ Z("span", {
88
- className: d("absolute inset-e-5 top-5 flex", Q.pin),
89
- children: [/* @__PURE__ */ X(se, {
90
- size: b.SM,
85
+ className: h("min-w-0 flex-1", Q.link),
86
+ children: g
87
+ }), o == null ? e.isPinned && /* @__PURE__ */ Y("span", {
88
+ className: h("absolute inset-e-5 top-5 flex", Q.pin),
89
+ children: [/* @__PURE__ */ J(B, {
90
+ size: T.SM,
91
91
  "aria-hidden": !0
92
- }), /* @__PURE__ */ X("span", {
92
+ }), /* @__PURE__ */ J("span", {
93
93
  className: "sr-only",
94
94
  children: i
95
95
  })]
96
- }) : /* @__PURE__ */ X(O, {
97
- size: S.Small,
98
- icon: e.isPinned ? /* @__PURE__ */ X(se, {
99
- size: b.SM,
96
+ }) : /* @__PURE__ */ J(re, {
97
+ size: D.Small,
98
+ icon: e.isPinned ? /* @__PURE__ */ J(B, {
99
+ size: T.SM,
100
100
  "aria-hidden": !0
101
- }) : /* @__PURE__ */ X(H, {
102
- size: b.SM,
101
+ }) : /* @__PURE__ */ J(z, {
102
+ size: T.SM,
103
103
  "aria-hidden": !0,
104
- stroke: x
104
+ stroke: E
105
105
  }),
106
106
  "aria-label": a,
107
107
  "aria-pressed": e.isPinned === !0,
108
108
  onClick: () => o(e.id, !e.isPinned),
109
- className: d("absolute inset-e-4 top-4", Q.pinToggle, !e.isPinned && Q.pinToggleIdle)
109
+ className: h("absolute inset-e-4 top-4", Q.pinToggle, !e.isPinned && Q.pinToggleIdle)
110
110
  })]
111
111
  }),
112
- s == null ? g : /* @__PURE__ */ X("div", {
112
+ s == null ? _ : /* @__PURE__ */ J("div", {
113
113
  className: Q.aboveLink,
114
114
  onClick: (e) => {
115
- _.current?.dispatchEvent(new window.MouseEvent("click", {
115
+ v.current?.dispatchEvent(new window.MouseEvent("click", {
116
116
  bubbles: !0,
117
117
  cancelable: !0,
118
118
  button: e.button,
@@ -122,233 +122,233 @@ var Ce = /* @__PURE__ */ function(e) {
122
122
  altKey: e.altKey
123
123
  }));
124
124
  },
125
- children: g
125
+ children: _
126
126
  })
127
127
  ]
128
128
  })
129
129
  });
130
- }, Pe = {
130
+ }, ze = {
131
131
  container: "_container_4rer8_1",
132
132
  subtitle: "_subtitle_4rer8_5",
133
133
  sortButton: "_sortButton_4rer8_9"
134
- }, Fe = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onTogglePin: s, onOpenProject: c, getProjectHref: l, searchQuery: u, onSearchQueryChange: f, sortKey: m, onSortKeyChange: te, labels: y, locale: C, styles: w }) => {
135
- let { colors: T, typography: E } = w ?? {}, O = E?.titleClassName ?? "dial-h1-text", k = E?.subtitleClassName ?? "dial-body-text", ne = E?.cardTitleClassName ?? "dial-body-semi-text", re = E?.pathLabelClassName ?? "dial-tiny-text", A = E?.pathLeafClassName ?? "dial-tiny-semi-text", N = E?.updatedAtClassName ?? "dial-tiny-text", F = E?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", I = ee({
136
- "--pr-bg": T?.background,
137
- "--pr-subtitle-text": T?.subtitleText,
138
- "--pr-sort-text": T?.sortButtonText,
139
- "--pr-card-bg": T?.cardBackground,
140
- "--pr-card-title-text": T?.cardTitleText,
141
- "--pr-updated-at-text": T?.updatedAtText,
142
- "--pr-path-text": T?.pathText,
143
- "--pr-card-focus-outline": T?.cardFocusOutline
144
- }), L = p(), oe = q(() => Date.now(), [e]), z = u.trim(), B = r.length > 0, V = B && e.length === 0, H = q(() => Te(we(e, u), m, C), [
134
+ }, Be = ({ projects: e, isLoading: t = !1, hasError: n = !1, incompleteSources: r = [], onRetry: i, onCreateProject: a, onTogglePin: o, onOpenProject: s, getProjectHref: l, searchQuery: u, onSearchQueryChange: d, sortKey: p, onSortKeyChange: m, labels: g, locale: v, styles: S }) => {
135
+ let { colors: C, typography: w } = S ?? {}, O = w?.titleClassName ?? "dial-h1-text", k = w?.subtitleClassName ?? "dial-body-text", te = w?.cardTitleClassName ?? "dial-body-semi-text", ne = w?.pathLabelClassName ?? "dial-tiny-text", re = w?.pathLeafClassName ?? "dial-tiny-semi-text", j = w?.updatedAtClassName ?? "dial-tiny-text", ie = w?.emptyStateDescriptionClassName ?? "dial-small-paragraph-text", M = f({
136
+ "--pr-bg": C?.background,
137
+ "--pr-subtitle-text": C?.subtitleText,
138
+ "--pr-sort-text": C?.sortButtonText,
139
+ "--pr-card-bg": C?.cardBackground,
140
+ "--pr-card-title-text": C?.cardTitleText,
141
+ "--pr-updated-at-text": C?.updatedAtText,
142
+ "--pr-path-text": C?.pathText,
143
+ "--pr-card-focus-outline": C?.cardFocusOutline
144
+ }), N = _(), F = G(() => Date.now(), [e]), L = u.trim(), oe = r.length > 0, se = oe && e.length === 0, R = G(() => je(Ae(e, u), p, v), [
145
145
  e,
146
146
  u,
147
- m,
148
- C
149
- ]), se = y.sortOptions.find((e) => e.value === m)?.label ?? y.sortLabel, le = q(() => y.sortOptions.map((e) => ({
147
+ p,
148
+ v
149
+ ]), de = g.sortOptions.find((e) => e.value === p)?.label ?? g.sortLabel, fe = G(() => g.sortOptions.map((e) => ({
150
150
  key: e.value,
151
151
  label: e.label,
152
- mark: P.Check,
153
- checked: e.value === m,
154
- onClick: () => te(e.value)
152
+ mark: I.Check,
153
+ checked: e.value === p,
154
+ onClick: () => m(e.value)
155
155
  })), [
156
- y.sortOptions,
157
- m,
158
- te
159
- ]), U = (e) => {
160
- f(e ?? "");
161
- }, ue = () => {
162
- if (!t) return n ? y.errorLabel : B ? y.incompleteLabel : e.length === 0 ? y.emptyStateLabel : H.length === 0 ? y.noResultsLabel : y.resultCountLabel(H.length);
163
- }, de = (e, t) => a ? /* @__PURE__ */ X(h, {
164
- label: y.createProjectLabel,
156
+ g.sortOptions,
157
+ p,
158
+ m
159
+ ]), pe = (e) => {
160
+ d(e ?? "");
161
+ }, z = () => {
162
+ if (!t) return n ? g.errorLabel : oe ? g.incompleteLabel : e.length === 0 ? g.emptyStateLabel : R.length === 0 ? g.noResultsLabel : g.resultCountLabel(R.length);
163
+ }, B = (e, t) => a ? /* @__PURE__ */ J(y, {
164
+ label: g.createProjectLabel,
165
165
  variant: e,
166
166
  onClick: a,
167
- className: d("shrink-0", t)
168
- }) : void 0, fe = () => t ? /* @__PURE__ */ X(ae, { ariaLabel: y.loadingAriaLabel ?? "Loading projects" }) : n || V ? /* @__PURE__ */ Z("div", {
167
+ className: h("shrink-0", t)
168
+ }) : void 0, me = () => t ? /* @__PURE__ */ J(le, { ariaLabel: g.loadingAriaLabel ?? "Loading projects" }) : n || se ? /* @__PURE__ */ Y("div", {
169
169
  className: "flex flex-col items-center gap-3",
170
- children: [/* @__PURE__ */ X("p", {
171
- className: d(k, Pe.subtitle),
172
- children: n ? y.errorLabel : y.incompleteLabel
173
- }), /* @__PURE__ */ X(D, {
174
- label: y.retryLabel,
170
+ children: [/* @__PURE__ */ J("p", {
171
+ className: h(k, ze.subtitle),
172
+ children: n ? g.errorLabel : g.incompleteLabel
173
+ }), /* @__PURE__ */ J(A, {
174
+ label: g.retryLabel,
175
175
  onClick: i
176
176
  })]
177
- }) : e.length === 0 ? /* @__PURE__ */ X(o, {
178
- label: y.emptyStateLabel,
179
- description: y.emptyStateDescription,
180
- action: de(v.Secondary, "mt-2"),
181
- containerClassName: me,
177
+ }) : e.length === 0 ? /* @__PURE__ */ J(c, {
178
+ label: g.emptyStateLabel,
179
+ description: g.emptyStateDescription,
180
+ action: B(x.Secondary, "mt-2"),
181
+ containerClassName: ge,
182
182
  labelClassName: "mt-3",
183
- descriptionClassName: F
184
- }) : H.length === 0 ? /* @__PURE__ */ X(o, {
185
- label: y.noResultsLabel,
186
- containerClassName: me,
183
+ descriptionClassName: ie
184
+ }) : R.length === 0 ? /* @__PURE__ */ J(c, {
185
+ label: g.noResultsLabel,
186
+ containerClassName: ge,
187
187
  labelClassName: "mt-3"
188
- }) : /* @__PURE__ */ X("ul", {
188
+ }) : /* @__PURE__ */ J("ul", {
189
189
  className: "m-0 grid w-full min-w-0 list-none grid-cols-1 gap-4 p-0 desktop:grid-cols-3 desktop:gap-5",
190
- children: H.map((e) => /* @__PURE__ */ X(Ne, {
190
+ children: R.map((e) => /* @__PURE__ */ J(Re, {
191
191
  project: e,
192
- searchQuery: z,
193
- sourceLabel: y.sourceLabels[e.source],
194
- folderPathLabel: y.folderPathLabel,
195
- pinnedLabel: y.pinnedLabel ?? "Pinned",
196
- pinLabel: y.pinLabel ?? "Pin",
197
- onTogglePin: s,
192
+ searchQuery: L,
193
+ sourceLabel: g.sourceLabels[e.source],
194
+ folderPathLabel: g.folderPathLabel,
195
+ pinnedLabel: g.pinnedLabel ?? "Pinned",
196
+ pinLabel: g.pinLabel ?? "Pin",
197
+ onTogglePin: o,
198
198
  href: l?.(e.id),
199
- onOpen: c,
200
- now: oe,
201
- locale: C,
202
- updatedAtClassName: N,
203
- titleClassName: ne,
204
- pathLabelClassName: re,
205
- pathLeafClassName: A
199
+ onOpen: s,
200
+ now: F,
201
+ locale: v,
202
+ updatedAtClassName: j,
203
+ titleClassName: te,
204
+ pathLabelClassName: ne,
205
+ pathLeafClassName: re
206
206
  }, e.id))
207
- }), pe = t || n || V, me = "mt-6 p-3 desktop:mt-0";
208
- return /* @__PURE__ */ Z("div", {
209
- style: I,
210
- className: d("relative flex size-full min-h-0 min-w-0 flex-1 flex-col", Pe.container),
211
- children: [/* @__PURE__ */ Z("div", {
207
+ }), he = t || n || se, ge = "mt-6 p-3 desktop:mt-0";
208
+ return /* @__PURE__ */ Y("div", {
209
+ style: M,
210
+ className: h("relative flex size-full min-h-0 min-w-0 flex-1 flex-col", ze.container),
211
+ children: [/* @__PURE__ */ Y("div", {
212
212
  className: "flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto",
213
213
  children: [
214
- L ? /* @__PURE__ */ X("h1", {
214
+ N ? /* @__PURE__ */ J("h1", {
215
215
  className: "sr-only",
216
- children: y.title
217
- }) : /* @__PURE__ */ Z("div", {
216
+ children: g.title
217
+ }) : /* @__PURE__ */ Y("div", {
218
218
  className: "flex min-w-0 items-start gap-2 px-8 py-4",
219
- children: [/* @__PURE__ */ Z("div", {
219
+ children: [/* @__PURE__ */ Y("div", {
220
220
  className: "flex min-h-10 min-w-0 flex-1 flex-col justify-center gap-0.5",
221
- children: [/* @__PURE__ */ X("h1", {
222
- className: d("wrap-break-word", O),
223
- children: y.title
224
- }), y.subtitle && /* @__PURE__ */ X("p", {
225
- className: d(k, Pe.subtitle),
226
- children: y.subtitle
221
+ children: [/* @__PURE__ */ J("h1", {
222
+ className: h("wrap-break-word", O),
223
+ children: g.title
224
+ }), g.subtitle && /* @__PURE__ */ J("p", {
225
+ className: h(k, ze.subtitle),
226
+ children: g.subtitle
227
227
  })]
228
- }), de(v.Primary)]
228
+ }), B(x.Primary)]
229
229
  }),
230
- /* @__PURE__ */ Z("div", {
230
+ /* @__PURE__ */ Y("div", {
231
231
  className: "flex items-center gap-2 p-4 desktop:gap-3 desktop:px-8 desktop:pt-4 desktop:pb-5",
232
- children: [/* @__PURE__ */ X("div", {
232
+ children: [/* @__PURE__ */ J("div", {
233
233
  role: "search",
234
234
  className: "min-w-0 flex-1",
235
- children: /* @__PURE__ */ X(ie, {
235
+ children: /* @__PURE__ */ J(ce, {
236
236
  value: u,
237
- onChange: U,
238
- placeholder: y.searchPlaceholder,
239
- clearLabel: y.clearSearchLabel,
240
- "aria-label": y.searchAriaLabel,
241
- size: L ? S.Standard : S.Large
237
+ onChange: pe,
238
+ placeholder: g.searchPlaceholder,
239
+ clearLabel: g.clearSearchLabel,
240
+ "aria-label": g.searchAriaLabel,
241
+ size: N ? D.Standard : D.Large
242
242
  })
243
- }), y.sortOptions.length > 0 && /* @__PURE__ */ X("div", {
243
+ }), g.sortOptions.length > 0 && /* @__PURE__ */ J("div", {
244
244
  role: "group",
245
- "aria-label": y.sortLabel,
245
+ "aria-label": g.sortLabel,
246
246
  className: "shrink-0",
247
- children: /* @__PURE__ */ X(_, {
248
- items: le,
249
- label: se,
250
- variant: v.Primary,
251
- appearance: g.Ghost,
252
- size: L ? S.Small : S.Standard,
253
- iconBefore: /* @__PURE__ */ X(R, {
254
- size: L ? b.SM : b.MD,
247
+ children: /* @__PURE__ */ J(b, {
248
+ items: fe,
249
+ label: de,
250
+ variant: x.Primary,
251
+ appearance: ee.Ghost,
252
+ size: N ? D.Small : D.Standard,
253
+ iconBefore: /* @__PURE__ */ J(ue, {
254
+ size: N ? T.SM : T.MD,
255
255
  "aria-hidden": !0,
256
- stroke: x
256
+ stroke: E
257
257
  }),
258
- className: d("desktop:px-3", Pe.sortButton)
258
+ className: h("desktop:px-3", ze.sortButton)
259
259
  })
260
260
  })]
261
261
  }),
262
- /* @__PURE__ */ X(j, {
262
+ /* @__PURE__ */ J(P, {
263
263
  visuallyHidden: !0,
264
- as: M.Span,
265
- children: ue()
264
+ as: ae.Span,
265
+ children: z()
266
266
  }),
267
- /* @__PURE__ */ Z("div", {
267
+ /* @__PURE__ */ Y("div", {
268
268
  className: "flex w-full min-w-0 flex-1 flex-col items-center gap-4 px-4 pb-20 desktop:gap-5 desktop:px-8 desktop:pt-6 desktop:pb-8",
269
- children: [B && !t && !n && !V && /* @__PURE__ */ Z("div", {
269
+ children: [oe && !t && !n && !se && /* @__PURE__ */ Y("div", {
270
270
  className: "flex w-full max-w-[1116px] flex-wrap items-center gap-3",
271
- children: [/* @__PURE__ */ X("p", {
272
- className: d(k, Pe.subtitle),
273
- children: y.incompleteLabel
274
- }), /* @__PURE__ */ X(D, {
275
- label: y.retryLabel,
271
+ children: [/* @__PURE__ */ J("p", {
272
+ className: h(k, ze.subtitle),
273
+ children: g.incompleteLabel
274
+ }), /* @__PURE__ */ J(A, {
275
+ label: g.retryLabel,
276
276
  onClick: i
277
277
  })]
278
- }), /* @__PURE__ */ X("div", {
279
- className: d("flex w-full max-w-[1116px] min-w-0 flex-col items-center", pe && "flex-1 justify-center"),
280
- children: fe()
278
+ }), /* @__PURE__ */ J("div", {
279
+ className: h("flex w-full max-w-[1116px] min-w-0 flex-col items-center", he && "flex-1 justify-center"),
280
+ children: me()
281
281
  })]
282
282
  })
283
283
  ]
284
- }), L && a && /* @__PURE__ */ X(h, {
285
- variant: v.Primary,
286
- iconBefore: /* @__PURE__ */ X(ce, {
287
- size: b.LG,
284
+ }), N && a && /* @__PURE__ */ J(y, {
285
+ variant: x.Primary,
286
+ iconBefore: /* @__PURE__ */ J(V, {
287
+ size: T.LG,
288
288
  "aria-hidden": !0,
289
- stroke: x
289
+ stroke: E
290
290
  }),
291
- "aria-label": y.createProjectLabel,
291
+ "aria-label": g.createProjectLabel,
292
292
  onClick: a,
293
293
  className: "absolute inset-e-4 bottom-4 z-10 size-10 rounded-full px-0"
294
294
  })]
295
295
  });
296
- }, Ie = /* @__PURE__ */ function(e) {
296
+ }, Ve = /* @__PURE__ */ function(e) {
297
297
  return e.Personal = "personal", e.Shared = "shared", e.Organization = "organization", e;
298
- }({}), Le = (e) => !!e.dataTransfer?.types.includes("Files"), Re = (e) => {
299
- let [t, n] = Y(!1), r = J(0);
298
+ }({}), He = (e) => !!e.dataTransfer?.types.includes("Files"), Ue = (e) => {
299
+ let [t, n] = q(!1), r = K(0);
300
300
  return {
301
301
  isDragActive: t,
302
302
  handlers: {
303
- onDragEnter: G((e) => {
304
- Le(e) && (e.preventDefault(), r.current += 1, n(!0));
303
+ onDragEnter: U((e) => {
304
+ He(e) && (e.preventDefault(), r.current += 1, n(!0));
305
305
  }, []),
306
- onDragLeave: G((e) => {
307
- Le(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
306
+ onDragLeave: U((e) => {
307
+ He(e) && (--r.current, r.current <= 0 && (r.current = 0, n(!1)));
308
308
  }, []),
309
- onDragOver: G((e) => {
310
- Le(e) && e.preventDefault();
309
+ onDragOver: U((e) => {
310
+ He(e) && e.preventDefault();
311
311
  }, []),
312
- onDrop: G((t) => {
313
- if (!Le(t)) return;
312
+ onDrop: U((t) => {
313
+ if (!He(t)) return;
314
314
  t.preventDefault(), r.current = 0, n(!1);
315
315
  let i = Array.from(t.dataTransfer?.files ?? []);
316
316
  i.length > 0 && e(i);
317
317
  }, [e])
318
318
  }
319
319
  };
320
- }, ze = /* @__PURE__ */ function(e) {
320
+ }, We = /* @__PURE__ */ function(e) {
321
321
  return e.UnsupportedType = "unsupported-type", e.TooLarge = "too-large", e.CapacityExceeded = "capacity-exceeded", e.Duplicate = "duplicate", e.InvalidName = "invalid-name", e;
322
- }({}), Be = /* @__PURE__ */ function(e) {
322
+ }({}), Ge = /* @__PURE__ */ function(e) {
323
323
  return e.Required = "required", e.InvalidCharacters = "invalid-characters", e.Reserved = "reserved", e.TooLong = "too-long", e;
324
- }({}), Ve = 255, He = new RegExp(a.source, "u"), Ue = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, We = /* @__PURE__ */ new Set([
324
+ }({}), Ke = 255, qe = new RegExp(s.source, "u"), Je = /[\p{Cc}‎‏‪-‮⁦-⁩]/u, Ye = /* @__PURE__ */ new Set([
325
325
  ".",
326
326
  "..",
327
327
  "v",
328
328
  "files",
329
329
  ".dial-resource",
330
330
  ".dial-folder"
331
- ]), Ge = (e) => new TextEncoder().encode(e).length, Ke = (e) => {
331
+ ]), Xe = (e) => new TextEncoder().encode(e).length, Ze = (e) => {
332
332
  let t = e.trim();
333
- return t.length === 0 ? Be.Required : Ge(t) > 255 ? Be.TooLong : He.test(t) || Ue.test(t) ? Be.InvalidCharacters : We.has(t) ? Be.Reserved : null;
334
- }, qe = (e) => {
333
+ return t.length === 0 ? Ge.Required : Xe(t) > 255 ? Ge.TooLong : qe.test(t) || Je.test(t) ? Ge.InvalidCharacters : Ye.has(t) ? Ge.Reserved : null;
334
+ }, Qe = (e) => {
335
335
  let t = e.lastIndexOf(".");
336
336
  return t > 0 ? e.slice(t + 1).toLowerCase() : "";
337
- }, Je = (e) => "isStored" in e && e.isStored, Ye = (e) => Je(e) ? e.size : e.file.size, Xe = (e) => e.reduce((e, t) => e + Ye(t), 0), Ze = 0, Qe = () => (Ze += 1, `project-context-${Date.now()}-${Ze}`), $e = (e) => {
338
- let t = e.type || u(e.name) || "application/octet-stream";
337
+ }, $e = (e) => "isStored" in e && e.isStored, et = (e) => $e(e) ? e.size : e.file.size, tt = (e) => e.reduce((e, t) => e + et(t), 0), nt = 0, rt = () => (nt += 1, `project-context-${Date.now()}-${nt}`), it = (e) => {
338
+ let t = e.type || m(e.name) || "application/octet-stream";
339
339
  return {
340
- id: Qe(),
340
+ id: rt(),
341
341
  name: e.name,
342
342
  contentType: t,
343
- type: l(t),
344
- status: s.Idle,
343
+ type: p(t),
344
+ status: l.Idle,
345
345
  file: e
346
346
  };
347
- }, et = (e, t, n, r) => Ke(e.name) != null || e.name.trim() !== e.name ? ze.InvalidName : r.allowedExtensions.includes(qe(e.name)) ? t.has(e.name) ? ze.Duplicate : e.size > r.maxFileBytes ? ze.TooLarge : n + e.size > r.maxTotalBytes ? ze.CapacityExceeded : null : ze.UnsupportedType, tt = (e, t, n) => {
348
- let r = new Set(t.map((e) => e.name)), i = Xe(t), a = [], o = [];
347
+ }, at = (e, t, n, r) => Ze(e.name) != null || e.name.trim() !== e.name ? We.InvalidName : r.allowedExtensions.includes(Qe(e.name)) ? t.has(e.name) ? We.Duplicate : e.size > r.maxFileBytes ? We.TooLarge : n + e.size > r.maxTotalBytes ? We.CapacityExceeded : null : We.UnsupportedType, ot = (e, t, n) => {
348
+ let r = new Set(t.map((e) => e.name)), i = tt(t), a = [], o = [];
349
349
  for (let t of e) {
350
- let e = et(t, r, i, n);
351
- e == null ? (r.add(t.name), i += t.size, a.push($e(t))) : o.push({
350
+ let e = at(t, r, i, n);
351
+ e == null ? (r.add(t.name), i += t.size, a.push(it(t))) : o.push({
352
352
  name: t.name,
353
353
  reason: e
354
354
  });
@@ -357,216 +357,216 @@ var Ce = /* @__PURE__ */ function(e) {
357
357
  accepted: a,
358
358
  rejected: o
359
359
  };
360
- }, nt = (e, t) => {
360
+ }, st = (e, t) => {
361
361
  let n = t.trim().toLowerCase();
362
362
  return n === "" ? e : e.filter((e) => e.name.toLowerCase().includes(n));
363
- }, rt = {
363
+ }, ct = {
364
364
  formColumn: "_formColumn_ru73x_1",
365
365
  dropZone: "_dropZone_ru73x_11",
366
366
  label: "_label_ru73x_20",
367
367
  link: "_link_ru73x_24"
368
- }, it = he(async () => ({ default: (await Se()).MarkdownEditor })), at = (e) => `Preview ${e}`, ot = (e) => `Download ${e}`, st = "The project name can't be changed after creation", ct = ({ values: e, errors: t, onFieldChange: i, contextFiles: a, onContextFilesChange: o, onContextFileClick: s, onContextFileDownload: l, selectedContextFileId: u, allowedExtensions: p, maxFileBytes: h, maxTotalBytes: g, onPickFromFileManager: _, onRefineInstructions: v, onBack: y, onCancel: S, onSubmit: C, isSubmitting: E = !1, isNameReadOnly: D = !1, labels: O, markdownEditorTheme: k, className: A, styles: P }) => {
369
- let F = K(), I = K(), L = K(), ie = K(), R = K(), z = K(), B = J(null), V = f(), [H, se] = Y(!1), [ce, le] = Y([]), [U, ue] = Y(""), de = m({
368
+ }, lt = Se(async () => ({ default: (await Oe()).MarkdownEditor })), ut = (e) => `Preview ${e}`, dt = (e) => `Download ${e}`, ft = "The project name can't be changed after creation", pt = ({ values: e, errors: t, onFieldChange: n, contextFiles: r, onContextFilesChange: o, onContextFileClick: s, onContextFileDownload: c, selectedContextFileId: l, allowedExtensions: u, maxFileBytes: p, maxTotalBytes: m, onPickFromFileManager: _, onRefineInstructions: y, onBack: ee, onCancel: b, onSubmit: x, isSubmitting: C = !1, isNameReadOnly: w = !1, labels: D, markdownEditorTheme: O, className: ne, styles: A }) => {
369
+ let re = W(), j = W(), N = W(), I = W(), L = W(), oe = W(), se = K(null), ce = g(), [ue, de] = q(!1), [fe, pe] = q([]), [z, B] = q(""), V = v({
370
370
  value: e.instructions,
371
- onChange: (e) => i("instructions", e),
372
- onRefine: v,
373
- disabled: E
374
- }), fe = de.isPending, pe = Ke(e.name), he = O.nameReadOnlyHint ?? st, W = t.name ?? (H && pe != null ? O.nameErrors[pe] : void 0), G = !D && !!t.name, _e = pe != null || G || E || fe, Se;
375
- t.name ? Se = I : W && (Se = L);
376
- let Ce = [D && ie, Se].filter(Boolean).join(" ") || void 0;
377
- ge(() => {
378
- t.name && !D && B.current?.focus();
379
- }, [t.name, D]);
380
- let we = q(() => p.map((e) => `.${e}`).join(","), [p]), Te = (e) => {
371
+ onChange: (e) => n("instructions", e),
372
+ onRefine: y,
373
+ disabled: C
374
+ }), me = V.isPending, he = Ze(e.name), ge = D.nameReadOnlyHint ?? ft, _e = t.name ?? (ue && he != null ? D.nameErrors[he] : void 0), ve = !w && !!t.name, ye = he != null || ve || C || me, be;
375
+ t.name ? be = j : _e && (be = N);
376
+ let Se = [w && I, be].filter(Boolean).join(" ") || void 0;
377
+ Ce(() => {
378
+ t.name && !w && se.current?.focus();
379
+ }, [t.name, w]);
380
+ let H = G(() => u.map((e) => `.${e}`).join(","), [u]), U = (e) => {
381
381
  if (e.length === 0) return;
382
- let { accepted: t, rejected: n } = tt(e, a, {
383
- allowedExtensions: p,
384
- maxFileBytes: h,
385
- maxTotalBytes: g
382
+ let { accepted: t, rejected: n } = ot(e, r, {
383
+ allowedExtensions: u,
384
+ maxFileBytes: p,
385
+ maxTotalBytes: m
386
386
  });
387
- le(n), t.length > 0 && o([...a, ...t]), ue([t.length > 0 ? O.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => O.fileRejections[t](e))].filter(Boolean).join(" "));
388
- }, { isDragActive: Ee, handlers: De } = Re(Te), Oe = O.openFileLabel ?? at, ke = O.downloadFileLabel ?? ot, Ae = (e) => {
389
- let t = a.find((t) => t.id === e);
390
- o(a.filter((t) => t.id !== e)), le([]), t && ue(O.fileRemovedStatus(t.name));
391
- }, Q = async (e) => {
387
+ pe(n), t.length > 0 && o([...r, ...t]), B([t.length > 0 ? D.filesAddedStatus(t.length) : "", ...n.map(({ name: e, reason: t }) => D.fileRejections[t](e))].filter(Boolean).join(" "));
388
+ }, { isDragActive: we, handlers: Oe } = Ue(U), ke = D.openFileLabel ?? ut, Ae = D.downloadFileLabel ?? dt, je = (e) => {
389
+ let t = r.find((t) => t.id === e);
390
+ o(r.filter((t) => t.id !== e)), pe([]), t && B(D.fileRemovedStatus(t.name));
391
+ }, Me = async (e) => {
392
392
  if (e.preventDefault(), e.stopPropagation(), _) try {
393
393
  let e = await _();
394
- e && Te(e);
394
+ e && U(e);
395
395
  } catch {}
396
- }, je = () => {
397
- _e || C();
398
- }, { colors: Me, typography: Ne } = P ?? {}, Pe = Ne?.titleClassName ?? "dial-h1-text", Fe = d(Ne?.labelClassName ?? "dial-tiny-semi-text", rt.label), Ie = Ne?.helperClassName ?? "dial-tiny-text", Le = ee({
399
- "--pcf-label-text": Me?.labelText,
400
- "--pcf-link-text": Me?.linkText,
401
- "--pcf-dropzone-bg": Me?.dropZoneBackground
402
- }), ze = O.refinement, Be = t.context, Ve = [...ce.map(({ name: e, reason: t }) => O.fileRejections[t](e)), Be].filter(Boolean).join("\n"), He = O.dropZoneLabel({
403
- fromDevice: /* @__PURE__ */ X("span", { className: rt.link }),
404
- fileManager: _ ? /* @__PURE__ */ X("button", {
396
+ }, Ne = () => {
397
+ ye || x();
398
+ }, { colors: Z, typography: Pe } = A ?? {}, Fe = Pe?.titleClassName ?? "dial-h1-text", Q = h(Pe?.labelClassName ?? "dial-tiny-semi-text", ct.label), Ie = Pe?.helperClassName ?? "dial-tiny-text", Le = f({
399
+ "--pcf-label-text": Z?.labelText,
400
+ "--pcf-link-text": Z?.linkText,
401
+ "--pcf-dropzone-bg": Z?.dropZoneBackground
402
+ }), Re = D.refinement, ze = t.context, Be = [...fe.map(({ name: e, reason: t }) => D.fileRejections[t](e)), ze].filter(Boolean).join("\n"), Ve = D.dropZoneLabel({
403
+ fromDevice: /* @__PURE__ */ J("span", { className: ct.link }),
404
+ fileManager: _ ? /* @__PURE__ */ J("button", {
405
405
  type: "button",
406
- className: rt.link,
407
- disabled: E,
408
- onClick: (e) => void Q(e)
406
+ className: ct.link,
407
+ disabled: C,
408
+ onClick: (e) => void Me(e)
409
409
  }) : void 0
410
410
  });
411
- return /* @__PURE__ */ Z("div", {
412
- className: d("relative flex h-full min-h-0 w-full", A),
413
- ...De,
411
+ return /* @__PURE__ */ Y("div", {
412
+ className: h("relative flex h-full min-h-0 w-full", ne),
413
+ ...Oe,
414
414
  children: [
415
- /* @__PURE__ */ X(ye, {
416
- isVisible: Ee,
415
+ /* @__PURE__ */ J(Ee, {
416
+ isVisible: we,
417
417
  labels: {
418
- title: O.dropOverlayTitle,
419
- subtitle: O.dropOverlaySubtitle
418
+ title: D.dropOverlayTitle,
419
+ subtitle: D.dropOverlaySubtitle
420
420
  }
421
421
  }),
422
- /* @__PURE__ */ X(xe, {
422
+ /* @__PURE__ */ J(De, {
423
423
  labels: {
424
- title: O.title,
425
- backButtonLabel: O.backLabel,
426
- cancelButtonLabel: O.cancelLabel,
427
- submitButtonLabel: O.createLabel,
428
- submittingLabel: O.submittingLabel ?? O.createLabel
424
+ title: D.title,
425
+ backButtonLabel: D.backLabel,
426
+ cancelButtonLabel: D.cancelLabel,
427
+ submitButtonLabel: D.createLabel,
428
+ submittingLabel: D.submittingLabel ?? D.createLabel
429
429
  },
430
- onBack: y,
431
- onCancel: S,
432
- onSubmit: je,
433
- isCancelDisabled: E,
434
- isSubmitDisabled: _e,
435
- isSubmitting: E,
436
- footerActionsOrder: be.SubmitFirst,
437
- backIcon: /* @__PURE__ */ X(oe, {
438
- size: b.LG,
439
- stroke: x,
430
+ onBack: ee,
431
+ onCancel: b,
432
+ onSubmit: Ne,
433
+ isCancelDisabled: C,
434
+ isSubmitDisabled: ye,
435
+ isSubmitting: C,
436
+ footerActionsOrder: X.SubmitFirst,
437
+ backIcon: /* @__PURE__ */ J(R, {
438
+ size: T.LG,
439
+ stroke: E,
440
440
  "aria-hidden": !0,
441
441
  className: "rtl:scale-x-[-1]"
442
442
  }),
443
443
  styles: {
444
- colors: { background: Me?.background },
444
+ colors: { background: Z?.background },
445
445
  header: {
446
- colors: { borderColor: Me?.headerBorder },
447
- typography: { fontClassName: Pe }
446
+ colors: { borderColor: Z?.headerBorder },
447
+ typography: { fontClassName: Fe }
448
448
  },
449
449
  cssVars: Le
450
450
  },
451
- children: /* @__PURE__ */ Z("div", {
452
- className: d("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6", rt.formColumn),
451
+ children: /* @__PURE__ */ Y("div", {
452
+ className: h("mx-auto flex w-full max-w-262 min-w-0 flex-col gap-5 py-6", ct.formColumn),
453
453
  children: [
454
- /* @__PURE__ */ Z("div", {
454
+ /* @__PURE__ */ Y("div", {
455
455
  className: "flex flex-col gap-1",
456
456
  children: [
457
- /* @__PURE__ */ X(ne, {
458
- id: F,
459
- inputRef: B,
457
+ /* @__PURE__ */ J(ie, {
458
+ id: re,
459
+ inputRef: se,
460
460
  value: e.name,
461
461
  onChange: (e) => {
462
- D || i("name", e ?? "");
462
+ w || n("name", e ?? "");
463
463
  },
464
- onBlur: () => se(!0),
465
- placeholder: O.namePlaceholder,
464
+ onBlur: () => de(!0),
465
+ placeholder: D.namePlaceholder,
466
466
  labelProps: {
467
- label: O.nameLabel,
467
+ label: D.nameLabel,
468
468
  required: !0
469
469
  },
470
470
  required: !0,
471
471
  "aria-required": !0,
472
- readOnly: D,
473
- disabled: D,
474
- tooltipText: D ? he : void 0,
475
- invalid: !!W,
476
- "aria-invalid": !!W,
477
- "aria-describedby": Ce
472
+ readOnly: w,
473
+ disabled: w,
474
+ tooltipText: w ? ge : void 0,
475
+ invalid: !!_e,
476
+ "aria-invalid": !!_e,
477
+ "aria-describedby": Se
478
478
  }),
479
- D && /* @__PURE__ */ X(te, {
480
- id: ie,
479
+ w && /* @__PURE__ */ J(S, {
480
+ id: I,
481
481
  className: Ie,
482
- text: he
482
+ text: ge
483
483
  }),
484
- /* @__PURE__ */ X(w, {
485
- announce: N.Assertive,
486
- id: I,
484
+ /* @__PURE__ */ J(k, {
485
+ announce: F.Assertive,
486
+ id: j,
487
487
  className: Ie,
488
488
  text: t.name ?? ""
489
489
  }),
490
- W && !t.name && /* @__PURE__ */ X(w, {
491
- id: L,
490
+ _e && !t.name && /* @__PURE__ */ J(k, {
491
+ id: N,
492
492
  className: Ie,
493
- text: W
493
+ text: _e
494
494
  })
495
495
  ]
496
496
  }),
497
- /* @__PURE__ */ X(c, {
498
- isEnabled: !!v,
499
- fieldId: R,
500
- label: O.instructionsLabel,
501
- labelClassName: Fe,
502
- labels: ze,
503
- refinement: de,
504
- disabled: E || fe,
505
- children: /* @__PURE__ */ Z("div", {
497
+ /* @__PURE__ */ J(d, {
498
+ isEnabled: !!y,
499
+ fieldId: L,
500
+ label: D.instructionsLabel,
501
+ labelClassName: Q,
502
+ labels: Re,
503
+ refinement: V,
504
+ disabled: C || me,
505
+ children: /* @__PURE__ */ Y("div", {
506
506
  className: "flex flex-1 flex-col gap-2",
507
- children: [!v && /* @__PURE__ */ X(re, {
508
- htmlFor: R,
509
- className: Fe,
510
- label: O.instructionsLabel
511
- }), /* @__PURE__ */ X("div", {
512
- ref: V,
513
- className: d("w-full", n, r),
514
- children: /* @__PURE__ */ X(me, {
515
- fallback: /* @__PURE__ */ X(ae, { ariaLabel: O.editorLoadingAriaLabel ?? "Loading editor" }),
516
- children: /* @__PURE__ */ X(it, {
517
- id: R,
507
+ children: [!y && /* @__PURE__ */ J(M, {
508
+ htmlFor: L,
509
+ className: Q,
510
+ label: D.instructionsLabel
511
+ }), /* @__PURE__ */ J("div", {
512
+ ref: ce,
513
+ className: h("w-full", i, a),
514
+ children: /* @__PURE__ */ J(xe, {
515
+ fallback: /* @__PURE__ */ J(le, { ariaLabel: D.editorLoadingAriaLabel ?? "Loading editor" }),
516
+ children: /* @__PURE__ */ J(lt, {
517
+ id: L,
518
518
  value: e.instructions,
519
519
  onChange: (e) => {
520
- de.reset(), i("instructions", e);
520
+ V.reset(), n("instructions", e);
521
521
  },
522
522
  height: 176,
523
- theme: k,
524
- placeholder: O.instructionsPlaceholder
523
+ theme: O,
524
+ placeholder: D.instructionsPlaceholder
525
525
  })
526
526
  })
527
527
  })]
528
528
  })
529
529
  }),
530
- /* @__PURE__ */ Z("section", {
531
- "aria-labelledby": z,
530
+ /* @__PURE__ */ Y("section", {
531
+ "aria-labelledby": oe,
532
532
  className: "flex flex-col gap-2",
533
533
  children: [
534
- /* @__PURE__ */ X("h2", {
535
- id: z,
536
- className: Fe,
537
- children: O.contextLabel
534
+ /* @__PURE__ */ J("h2", {
535
+ id: oe,
536
+ className: Q,
537
+ children: D.contextLabel
538
538
  }),
539
- /* @__PURE__ */ X(T, {
540
- label: He,
541
- ariaLabel: O.dropZoneAriaLabel,
542
- description: O.dropZoneHint,
543
- accept: we,
539
+ /* @__PURE__ */ J(te, {
540
+ label: Ve,
541
+ ariaLabel: D.dropZoneAriaLabel,
542
+ description: D.dropZoneHint,
543
+ accept: H,
544
544
  multiple: !0,
545
- disabled: E,
546
- onChange: Te,
547
- onReject: Te,
548
- errorText: Ve || void 0,
549
- className: rt.dropZone
545
+ disabled: C,
546
+ onChange: U,
547
+ onReject: U,
548
+ errorText: Be || void 0,
549
+ className: ct.dropZone
550
550
  }),
551
- /* @__PURE__ */ X(j, {
551
+ /* @__PURE__ */ J(P, {
552
552
  visuallyHidden: !0,
553
- politeness: N.Assertive,
554
- children: Be
553
+ politeness: F.Assertive,
554
+ children: ze
555
555
  }),
556
- a.length > 0 && /* @__PURE__ */ X("ul", {
556
+ r.length > 0 && /* @__PURE__ */ J("ul", {
557
557
  className: "flex min-w-0 flex-wrap gap-2 pt-3",
558
- children: a.map((e) => /* @__PURE__ */ X("li", {
558
+ children: r.map((e) => /* @__PURE__ */ J("li", {
559
559
  className: "min-w-0",
560
- children: /* @__PURE__ */ X(ve, {
560
+ children: /* @__PURE__ */ J(Te, {
561
561
  attachment: e,
562
562
  onClick: s,
563
- isSelected: s == null ? void 0 : e.id === u,
564
- onRemove: Ae,
565
- onDownload: l,
563
+ isSelected: s == null ? void 0 : e.id === l,
564
+ onRemove: je,
565
+ onDownload: c,
566
566
  labels: {
567
- removeLabel: O.removeFileLabel(e.name),
568
- clickLabel: Oe(e.name),
569
- downloadLabel: ke(e.name)
567
+ removeLabel: D.removeFileLabel(e.name),
568
+ clickLabel: ke(e.name),
569
+ downloadLabel: Ae(e.name)
570
570
  }
571
571
  })
572
572
  }, e.id))
@@ -576,14 +576,14 @@ var Ce = /* @__PURE__ */ function(e) {
576
576
  ]
577
577
  })
578
578
  }),
579
- /* @__PURE__ */ X(j, {
579
+ /* @__PURE__ */ J(P, {
580
580
  visuallyHidden: !0,
581
- as: M.Span,
582
- children: E ? O.creatingStatus : U
581
+ as: ae.Span,
582
+ children: C ? D.creatingStatus : z
583
583
  })
584
584
  ]
585
585
  });
586
- }, lt = pe("outline", "pin-off", "PinOff", [
586
+ }, mt = be("outline", "pin-off", "PinOff", [
587
587
  ["path", {
588
588
  d: "M3 3l18 18",
589
589
  key: "svg-0"
@@ -619,21 +619,21 @@ var Ce = /* @__PURE__ */ function(e) {
619
619
  body: "_body_1j6j0_16",
620
620
  secondary: "_secondary_1j6j0_20",
621
621
  panel: "_panel_1j6j0_24"
622
- }, ut = (e) => ({
622
+ }, ht = (e) => ({
623
623
  id: e.name,
624
624
  name: e.name,
625
625
  contentType: e.contentType,
626
- type: l(e.contentType),
627
- status: s.Idle
628
- }), dt = (e) => `Download ${e}`, ft = W(({ project: t, isLoading: n = !1, hasError: r = !1, isNotFound: a = !1, isPinned: s, isPinPending: c = !1, contextSearchQuery: l, onContextSearchQueryChange: u, onBack: f, onTogglePin: p, onPublish: m, onUnpublish: h, onEdit: g, onShare: _, onDelete: v, onDownload: te, onContextFileClick: y, onContextFileDownload: S, selectedContextFileId: w, isDetailsStacked: T = !1, onRetry: E, onBrowseProjects: k, mainContent: ne, mainContentLabel: re = "Project content", labels: A, styles: N }) => {
629
- let { colors: P, typography: I } = N ?? {}, L = A.downloadFileLabel ?? dt, R = I?.titleClassName ?? "dial-h1-text", se = I?.panelTitleClassName ?? "dial-body-semi-text", ce = I?.sectionTitleClassName ?? "dial-tiny-text", U = I?.bodyClassName ?? "dial-small-text", pe = I?.helperClassName ?? "dial-tiny-text", me = I?.instructionsHeadingClassName ?? "dial-small-semi-text", he = ee({
630
- "--pv-bg": P?.background,
631
- "--pv-border": P?.border,
632
- "--pv-heading-text": P?.headingText,
633
- "--pv-body-text": P?.bodyText,
634
- "--pv-secondary-text": P?.secondaryText
635
- }), W = q(() => t?.contextFiles ?? [], [t]), G = q(() => nt(W, l), [W, l]), ge = l.trim(), J = K(), Y = q(() => {
636
- let e = d("mb-1 mt-3 first:mt-0", me);
626
+ type: p(e.contentType),
627
+ status: l.Idle
628
+ }), gt = (e) => `Download ${e}`, _t = H(({ project: t, isLoading: n = !1, hasError: r = !1, isNotFound: i = !1, isPinned: a, isPinPending: s = !1, contextSearchQuery: l, onContextSearchQueryChange: u, onBack: d, onTogglePin: p, onPublish: m, onUnpublish: g, onEdit: _, onShare: v, onRevokeAccess: y, onActionMenuOpenChange: ee, onDelete: b, onRemoveFromMyList: x, onDownload: S, onContextFileClick: C, onContextFileDownload: w, selectedContextFileId: D, isDetailsStacked: k = !1, onRetry: te, onBrowseProjects: ne, mainContent: j, mainContentLabel: ie = "Project content", labels: M, styles: N }) => {
629
+ let { colors: F, typography: I } = N ?? {}, oe = M.downloadFileLabel ?? gt, se = I?.titleClassName ?? "dial-h1-text", ue = I?.panelTitleClassName ?? "dial-body-semi-text", B = I?.sectionTitleClassName ?? "dial-tiny-text", V = I?.bodyClassName ?? "dial-small-text", he = I?.helperClassName ?? "dial-tiny-text", be = I?.instructionsHeadingClassName ?? "dial-small-semi-text", xe = f({
630
+ "--pv-bg": F?.background,
631
+ "--pv-border": F?.border,
632
+ "--pv-heading-text": F?.headingText,
633
+ "--pv-body-text": F?.bodyText,
634
+ "--pv-secondary-text": F?.secondaryText
635
+ }), Se = G(() => t?.contextFiles ?? [], [t]), H = G(() => st(Se, l), [Se, l]), U = l.trim(), Ce = W(), K = G(() => {
636
+ let e = h("mb-1 mt-3 first:mt-0", be);
637
637
  return {
638
638
  h1: e,
639
639
  h2: e,
@@ -641,259 +641,270 @@ var Ce = /* @__PURE__ */ function(e) {
641
641
  h4: e,
642
642
  h5: e,
643
643
  h6: e,
644
- p: U,
645
- ul: U,
646
- ol: U
644
+ p: V,
645
+ ul: V,
646
+ ol: V
647
647
  };
648
- }, [U, me]), ye = A.unpublishLabel ?? "Unpublish", be = () => {
649
- c || p();
650
- }, xe = (e) => /* @__PURE__ */ X(e, {
651
- size: b.SM,
648
+ }, [V, be]), q = M.unpublishLabel ?? "Unpublish", Ee = () => {
649
+ s || p();
650
+ }, X = (e) => /* @__PURE__ */ J(e, {
651
+ size: T.SM,
652
652
  "aria-hidden": !0,
653
- stroke: x
654
- }), Se = (e) => {
653
+ stroke: E
654
+ }), De = (e) => {
655
655
  let t = [];
656
656
  return e && t.push({
657
657
  key: "pin",
658
- label: s ? A.unpinLabel : A.pinLabel,
659
- icon: xe(s ? lt : H),
660
- onClick: be
661
- }), e && h ? t.push({
658
+ label: a ? M.unpinLabel : M.pinLabel,
659
+ icon: X(a ? mt : z),
660
+ onClick: Ee
661
+ }), e && g ? t.push({
662
662
  key: "unpublish",
663
- label: ye,
664
- icon: xe(de),
665
- onClick: h
663
+ label: q,
664
+ icon: X(ve),
665
+ onClick: g
666
666
  }) : e && m && t.push({
667
667
  key: "publish",
668
- label: A.publishLabel,
669
- icon: xe(fe),
668
+ label: M.publishLabel,
669
+ icon: X(ye),
670
670
  onClick: m
671
- }), e && g && t.push({
671
+ }), e && _ && t.push({
672
672
  key: "edit",
673
- label: A.editLabel,
674
- icon: xe(V),
675
- onClick: g
676
- }), _ && t.push({
677
- key: "share",
678
- label: A.shareLabel,
679
- icon: xe(le),
673
+ label: M.editLabel,
674
+ icon: X(pe),
680
675
  onClick: _
676
+ }), v && t.push({
677
+ key: "share",
678
+ label: M.shareLabel,
679
+ icon: X(me),
680
+ onClick: v
681
681
  }), t.push({
682
682
  key: "download",
683
- label: A.downloadLabel,
684
- icon: xe(B),
685
- onClick: te
686
- }), v && t.push({
683
+ label: M.downloadLabel,
684
+ icon: X(fe),
685
+ onClick: S
686
+ }), y && t.push({
687
+ key: "revokeAccess",
688
+ label: M.revokeAccessLabel ?? "Revoke access",
689
+ icon: X(_e),
690
+ onClick: y
691
+ }), x && t.push({
692
+ key: "removeFromMyList",
693
+ label: M.removeFromMyListLabel ?? "Remove from My List",
694
+ icon: X(ge),
695
+ onClick: x
696
+ }), b && t.push({
687
697
  key: "delete",
688
- label: A.deleteLabel,
689
- icon: xe(ue),
698
+ label: M.deleteLabel,
699
+ icon: X(ge),
690
700
  danger: !0,
691
- onClick: v
701
+ onClick: b
692
702
  }), t;
693
- }, Ce = (n, r) => /* @__PURE__ */ X("div", {
703
+ }, Oe = (n, r) => /* @__PURE__ */ J("div", {
694
704
  className: r,
695
- children: /* @__PURE__ */ X(e, {
696
- items: Se(n),
697
- title: n ? t?.name ?? A.moreActionsLabel : A.moreActionsLabel,
698
- closeLabel: A.closeLabel,
705
+ children: /* @__PURE__ */ J(e, {
706
+ onOpenChange: ee,
707
+ items: De(n),
708
+ title: n ? t?.name ?? M.moreActionsLabel : M.moreActionsLabel,
709
+ closeLabel: M.closeLabel,
699
710
  matchReferenceWidth: !1,
700
711
  listClassName: "w-[200px]",
701
- children: /* @__PURE__ */ X(O, {
702
- icon: /* @__PURE__ */ X(z, {
703
- size: b.MD,
712
+ children: /* @__PURE__ */ J(re, {
713
+ icon: /* @__PURE__ */ J(de, {
714
+ size: T.MD,
704
715
  "aria-hidden": !0,
705
- stroke: x
716
+ stroke: E
706
717
  }),
707
- "aria-label": A.moreActionsLabel
718
+ "aria-label": M.moreActionsLabel
708
719
  })
709
720
  })
710
- }), we = () => n ? /* @__PURE__ */ X(ae, { ariaLabel: A.loadingAriaLabel ?? "Loading project" }) : r ? /* @__PURE__ */ Z("div", {
721
+ }), ke = () => n ? /* @__PURE__ */ J(le, { ariaLabel: M.loadingAriaLabel ?? "Loading project" }) : r ? /* @__PURE__ */ Y("div", {
711
722
  className: "flex flex-col items-center gap-3",
712
- children: [/* @__PURE__ */ X("p", {
723
+ children: [/* @__PURE__ */ J("p", {
713
724
  "aria-hidden": !0,
714
- className: d(U, $.body),
715
- children: A.errorLabel
716
- }), /* @__PURE__ */ X(D, {
717
- label: A.retryLabel,
718
- onClick: E
725
+ className: h(V, $.body),
726
+ children: M.errorLabel
727
+ }), /* @__PURE__ */ J(A, {
728
+ label: M.retryLabel,
729
+ onClick: te
719
730
  })]
720
- }) : /* @__PURE__ */ Z("div", {
731
+ }) : /* @__PURE__ */ Y("div", {
721
732
  className: "flex flex-col items-center gap-3",
722
- children: [/* @__PURE__ */ X("p", {
723
- className: d(U, $.body),
724
- children: A.notFoundLabel
725
- }), /* @__PURE__ */ X(D, {
726
- label: A.browseProjectsLabel,
727
- onClick: k
733
+ children: [/* @__PURE__ */ J("p", {
734
+ className: h(V, $.body),
735
+ children: M.notFoundLabel
736
+ }), /* @__PURE__ */ J(A, {
737
+ label: M.browseProjectsLabel,
738
+ onClick: ne
728
739
  })]
729
740
  });
730
- if (n || r || a || t == null) return /* @__PURE__ */ Z("div", {
731
- style: he,
732
- className: d("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
733
- children: [/* @__PURE__ */ X(j, {
741
+ if (n || r || i || t == null) return /* @__PURE__ */ Y("div", {
742
+ style: xe,
743
+ className: h("flex h-full w-full min-w-0 items-center justify-center p-4", $.container),
744
+ children: [/* @__PURE__ */ J(P, {
734
745
  visuallyHidden: !0,
735
- children: !n && r && A.errorLabel
736
- }), we()]
746
+ children: !n && r && M.errorLabel
747
+ }), ke()]
737
748
  });
738
- let Te = () => W.length === 0 ? /* @__PURE__ */ X(o, { label: A.emptyContextLabel }) : /* @__PURE__ */ Z(_e, { children: [
739
- /* @__PURE__ */ X("div", {
749
+ let Ae = () => Se.length === 0 ? /* @__PURE__ */ J(c, { label: M.emptyContextLabel }) : /* @__PURE__ */ Y(we, { children: [
750
+ /* @__PURE__ */ J("div", {
740
751
  role: "search",
741
- children: /* @__PURE__ */ X(ie, {
752
+ children: /* @__PURE__ */ J(ce, {
742
753
  value: l,
743
754
  onChange: (e) => u(e ?? ""),
744
- placeholder: A.contextSearchPlaceholder,
745
- clearLabel: A.clearSearchLabel,
746
- "aria-label": A.contextSearchAriaLabel
755
+ placeholder: M.contextSearchPlaceholder,
756
+ clearLabel: M.clearSearchLabel,
757
+ "aria-label": M.contextSearchAriaLabel
747
758
  })
748
759
  }),
749
- G.length === 0 ? /* @__PURE__ */ X("p", {
750
- className: d(pe, $.secondary),
751
- children: A.noContextMatchesLabel
752
- }) : /* @__PURE__ */ X("ul", {
760
+ H.length === 0 ? /* @__PURE__ */ J("p", {
761
+ className: h(he, $.secondary),
762
+ children: M.noContextMatchesLabel
763
+ }) : /* @__PURE__ */ J("ul", {
753
764
  className: "m-0 flex min-w-0 list-none flex-wrap gap-2 p-0 pt-2",
754
- children: G.map((e) => /* @__PURE__ */ X("li", {
765
+ children: H.map((e) => /* @__PURE__ */ J("li", {
755
766
  className: "min-w-0",
756
- children: /* @__PURE__ */ X(ve, {
757
- attachment: ut(e),
758
- searchQuery: ge,
759
- onClick: y,
760
- onDownload: S,
761
- isSelected: e.name === w,
767
+ children: /* @__PURE__ */ J(Te, {
768
+ attachment: ht(e),
769
+ searchQuery: U,
770
+ onClick: C,
771
+ onDownload: w,
772
+ isSelected: e.name === D,
762
773
  labels: {
763
- clickLabel: A.openFileLabel(e.name),
764
- downloadLabel: L(e.name)
774
+ clickLabel: M.openFileLabel(e.name),
775
+ downloadLabel: oe(e.name)
765
776
  }
766
777
  })
767
778
  }, e.name))
768
779
  }),
769
- /* @__PURE__ */ X(j, {
780
+ /* @__PURE__ */ J(P, {
770
781
  visuallyHidden: !0,
771
- as: M.Span,
772
- children: ge === "" ? "" : A.contextResultCountLabel(G.length)
782
+ as: ae.Span,
783
+ children: U === "" ? "" : M.contextResultCountLabel(H.length)
773
784
  })
774
- ] }), Ee = !T;
775
- return /* @__PURE__ */ Z("div", {
776
- style: he,
777
- className: d("flex size-full min-h-0 min-w-0 flex-1 flex-col", $.container),
778
- children: [/* @__PURE__ */ Z("header", {
779
- className: d("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
785
+ ] }), je = !k;
786
+ return /* @__PURE__ */ Y("div", {
787
+ style: xe,
788
+ className: h("flex size-full min-h-0 min-w-0 flex-1 flex-col", $.container),
789
+ children: [/* @__PURE__ */ Y("header", {
790
+ className: h("flex min-w-0 shrink-0 items-center gap-2 px-4 py-3 desktop:px-8 desktop:py-4", $.header),
780
791
  children: [
781
- /* @__PURE__ */ X(O, {
782
- icon: /* @__PURE__ */ X(oe, {
783
- size: b.LG,
792
+ /* @__PURE__ */ J(re, {
793
+ icon: /* @__PURE__ */ J(R, {
794
+ size: T.LG,
784
795
  className: "rtl:scale-x-[-1]",
785
796
  "aria-hidden": !0,
786
- stroke: x
797
+ stroke: E
787
798
  }),
788
- "aria-label": A.backLabel,
789
- onClick: f
799
+ "aria-label": M.backLabel,
800
+ onClick: d
790
801
  }),
791
- /* @__PURE__ */ X("h1", {
792
- className: d("min-w-0 flex-1", R, $.title),
793
- children: /* @__PURE__ */ X(C, { text: t.name })
802
+ /* @__PURE__ */ J("h1", {
803
+ className: h("min-w-0 flex-1", se, $.title),
804
+ children: /* @__PURE__ */ J(O, { text: t.name })
794
805
  }),
795
- /* @__PURE__ */ X(D, {
796
- label: s ? A.unpinLabel : A.pinLabel,
797
- iconBefore: X(s ? lt : H, {
798
- size: b.MD,
806
+ /* @__PURE__ */ J(A, {
807
+ label: a ? M.unpinLabel : M.pinLabel,
808
+ iconBefore: J(a ? mt : z, {
809
+ size: T.MD,
799
810
  "aria-hidden": !0,
800
- stroke: x
811
+ stroke: E
801
812
  }),
802
- "aria-disabled": c || void 0,
803
- onClick: be,
813
+ "aria-disabled": s || void 0,
814
+ onClick: Ee,
804
815
  className: "hidden shrink-0 desktop:inline-flex"
805
816
  }),
806
- h && /* @__PURE__ */ X(F, {
807
- label: ye,
808
- iconBefore: /* @__PURE__ */ X(de, {
809
- size: b.MD,
817
+ g && /* @__PURE__ */ J(L, {
818
+ label: q,
819
+ iconBefore: /* @__PURE__ */ J(ve, {
820
+ size: T.MD,
810
821
  "aria-hidden": !0,
811
- stroke: x
822
+ stroke: E
812
823
  }),
813
- onClick: h,
824
+ onClick: g,
814
825
  className: "hidden shrink-0 desktop:inline-flex"
815
826
  }),
816
- !h && m && /* @__PURE__ */ X(F, {
817
- label: A.publishLabel,
818
- iconBefore: /* @__PURE__ */ X(fe, {
819
- size: b.MD,
827
+ !g && m && /* @__PURE__ */ J(L, {
828
+ label: M.publishLabel,
829
+ iconBefore: /* @__PURE__ */ J(ye, {
830
+ size: T.MD,
820
831
  "aria-hidden": !0,
821
- stroke: x
832
+ stroke: E
822
833
  }),
823
834
  onClick: m,
824
835
  className: "hidden shrink-0 desktop:inline-flex"
825
836
  }),
826
- g && /* @__PURE__ */ X(F, {
827
- label: A.editLabel,
828
- iconBefore: /* @__PURE__ */ X(V, {
829
- size: b.MD,
837
+ _ && /* @__PURE__ */ J(L, {
838
+ label: M.editLabel,
839
+ iconBefore: /* @__PURE__ */ J(pe, {
840
+ size: T.MD,
830
841
  "aria-hidden": !0,
831
- stroke: x
842
+ stroke: E
832
843
  }),
833
- onClick: g,
844
+ onClick: _,
834
845
  className: "hidden shrink-0 desktop:inline-flex"
835
846
  }),
836
- Ce(!1, "hidden desktop:block"),
837
- Ce(!0, "desktop:hidden")
847
+ Oe(!1, "hidden desktop:block"),
848
+ Oe(!0, "desktop:hidden")
838
849
  ]
839
- }), /* @__PURE__ */ Z("div", {
840
- className: d("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", Ee && "desktop:flex-row desktop:overflow-hidden", ne == null && Ee && "desktop:justify-end"),
841
- children: [ne != null && /* @__PURE__ */ X("section", {
842
- "aria-label": re,
843
- className: d("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", Ee && "desktop:overflow-y-auto"),
844
- children: /* @__PURE__ */ X("div", {
850
+ }), /* @__PURE__ */ Y("div", {
851
+ className: h("flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto", je && "desktop:flex-row desktop:overflow-hidden", j == null && je && "desktop:justify-end"),
852
+ children: [j != null && /* @__PURE__ */ J("section", {
853
+ "aria-label": ie,
854
+ className: h("flex min-w-0 flex-1 flex-col px-4 py-6 desktop:px-8", je && "desktop:overflow-y-auto"),
855
+ children: /* @__PURE__ */ J("div", {
845
856
  className: "mx-auto flex w-full max-w-[748px] min-w-0 flex-col gap-5",
846
- children: ne
857
+ children: j
847
858
  })
848
- }), /* @__PURE__ */ Z("aside", {
849
- "aria-labelledby": J,
850
- className: d("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", Ee && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
859
+ }), /* @__PURE__ */ Y("aside", {
860
+ "aria-labelledby": Ce,
861
+ className: h("flex w-full min-w-0 flex-col gap-5 border-t px-4 py-6 desktop:px-8", je && "desktop:w-[488px] desktop:shrink-0 desktop:overflow-y-auto desktop:border-s desktop:border-t-0", $.panel),
851
862
  children: [
852
- /* @__PURE__ */ X("h2", {
853
- id: J,
854
- className: d(se, $.title),
855
- children: A.detailsLabel
863
+ /* @__PURE__ */ J("h2", {
864
+ id: Ce,
865
+ className: h(ue, $.title),
866
+ children: M.detailsLabel
856
867
  }),
857
- t.description !== "" && /* @__PURE__ */ Z("section", {
868
+ t.description !== "" && /* @__PURE__ */ Y("section", {
858
869
  className: "flex min-w-0 flex-col gap-1",
859
- children: [/* @__PURE__ */ X("h3", {
860
- className: d(ce, $.secondary),
861
- children: A.descriptionLabel
862
- }), /* @__PURE__ */ X("p", {
863
- className: d("wrap-break-word whitespace-pre-line", U, $.body),
870
+ children: [/* @__PURE__ */ J("h3", {
871
+ className: h(B, $.secondary),
872
+ children: M.descriptionLabel
873
+ }), /* @__PURE__ */ J("p", {
874
+ className: h("wrap-break-word whitespace-pre-line", V, $.body),
864
875
  children: t.description
865
876
  })]
866
877
  }),
867
- t.instructions !== "" && /* @__PURE__ */ Z("section", {
878
+ t.instructions !== "" && /* @__PURE__ */ Y("section", {
868
879
  className: "flex min-w-0 flex-col gap-1",
869
- children: [/* @__PURE__ */ X("h3", {
870
- className: d(ce, $.secondary),
871
- children: A.instructionsLabel
872
- }), /* @__PURE__ */ X("div", {
873
- className: d("min-w-0 wrap-break-word", U, $.body),
874
- children: /* @__PURE__ */ X(i, {
880
+ children: [/* @__PURE__ */ J("h3", {
881
+ className: h(B, $.secondary),
882
+ children: M.instructionsLabel
883
+ }), /* @__PURE__ */ J("div", {
884
+ className: h("min-w-0 wrap-break-word", V, $.body),
885
+ children: /* @__PURE__ */ J(o, {
875
886
  content: t.instructions,
876
- classNames: Y
887
+ classNames: K
877
888
  })
878
889
  })]
879
890
  }),
880
- /* @__PURE__ */ Z("section", {
891
+ /* @__PURE__ */ Y("section", {
881
892
  className: "flex min-w-0 flex-col gap-2",
882
- children: [/* @__PURE__ */ X("h3", {
883
- className: d(ce, $.secondary),
884
- children: A.contextLabel
885
- }), Te()]
893
+ children: [/* @__PURE__ */ J("h3", {
894
+ className: h(B, $.secondary),
895
+ children: M.contextLabel
896
+ }), Ae()]
886
897
  })
887
898
  ]
888
899
  })]
889
900
  })]
890
901
  });
891
- }), pt = {
902
+ }), vt = {
892
903
  row: "_row_1030u_1",
893
904
  readDot: "_readDot_1030u_6",
894
905
  unreadDot: "_unreadDot_1030u_10"
895
- }, mt = ({ item: t, labels: n, rowTitleClassName: r, unreadRowTitleClassName: i, onOpen: a, onRename: o, onDelete: s }) => {
896
- let c = K(), [ee, l] = Y(!1), u = t.isUnread === !0, f = q(() => [...o ? [{
906
+ }, yt = ({ item: t, labels: n, rowTitleClassName: r, unreadRowTitleClassName: i, onOpen: a, onRename: o, onDelete: s }) => {
907
+ let c = W(), [l, u] = q(!1), d = t.isUnread === !0, f = G(() => [...o ? [{
897
908
  key: "rename",
898
909
  label: n.renameLabel,
899
910
  onClick: () => o(t.id)
@@ -909,399 +920,444 @@ var Ce = /* @__PURE__ */ function(e) {
909
920
  s,
910
921
  o
911
922
  ]);
912
- return /* @__PURE__ */ Z("li", {
913
- className: d("group/row flex min-w-0 items-center gap-1 rounded-xl", pt.row),
923
+ return /* @__PURE__ */ Y("li", {
924
+ className: h("group/row flex min-w-0 items-center gap-1 rounded-xl", vt.row),
914
925
  children: [
915
- /* @__PURE__ */ Z("button", {
926
+ /* @__PURE__ */ Y("button", {
916
927
  type: "button",
917
928
  "aria-label": n.openLabel(t.title, t.authorName),
918
- "aria-describedby": u ? c : void 0,
929
+ "aria-describedby": d ? c : void 0,
919
930
  className: "flex min-w-0 flex-1 items-center gap-3 rounded-xl p-3 text-start focus-visible:outline-2 focus-visible:-outline-offset-2",
920
931
  onClick: () => a(t.id),
921
932
  children: [
922
- t.leading ?? /* @__PURE__ */ X("span", {
933
+ t.leading ?? /* @__PURE__ */ J("span", {
923
934
  "aria-hidden": !0,
924
935
  className: "flex size-4 shrink-0 items-center justify-center",
925
- children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full", u ? pt.unreadDot : pt.readDot) })
936
+ children: /* @__PURE__ */ J("span", { className: h("size-[7.11px] rounded-full", d ? vt.unreadDot : vt.readDot) })
926
937
  }),
927
- /* @__PURE__ */ X(C, {
938
+ /* @__PURE__ */ J(O, {
928
939
  text: t.title,
929
- className: d("min-w-0 flex-1", u ? i : r)
940
+ className: h("min-w-0 flex-1", d ? i : r)
930
941
  }),
931
- t.trailing ?? (u && t.leading != null && /* @__PURE__ */ X("span", {
942
+ t.trailing ?? (d && t.leading != null && /* @__PURE__ */ J("span", {
932
943
  "aria-hidden": !0,
933
944
  className: "flex size-6 shrink-0 items-center justify-center",
934
- children: /* @__PURE__ */ X("span", { className: d("size-[7.11px] rounded-full", pt.unreadDot) })
945
+ children: /* @__PURE__ */ J("span", { className: h("size-[7.11px] rounded-full", vt.unreadDot) })
935
946
  }))
936
947
  ]
937
948
  }),
938
- u && /* @__PURE__ */ X("span", {
949
+ d && /* @__PURE__ */ J("span", {
939
950
  id: c,
940
951
  className: "sr-only",
941
952
  children: n.unreadLabel ?? "Unread"
942
953
  }),
943
- f.length > 0 && /* @__PURE__ */ X(e, {
954
+ f.length > 0 && /* @__PURE__ */ J(e, {
944
955
  items: f,
945
956
  title: n.moreActionsLabel(t.title),
946
957
  closeLabel: n.closeLabel,
947
958
  placement: "bottom-end",
948
- onOpenChange: l,
949
- children: /* @__PURE__ */ X(O, {
959
+ onOpenChange: u,
960
+ children: /* @__PURE__ */ J(re, {
950
961
  "aria-label": n.moreActionsLabel(t.title),
951
- size: S.Small,
952
- className: d("me-2 shrink-0", !ee && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
953
- icon: /* @__PURE__ */ X(z, {
962
+ size: D.Small,
963
+ className: h("me-2 shrink-0", !l && "desktop:opacity-0 desktop:group-focus-within/row:opacity-100 desktop:group-hover/row:opacity-100"),
964
+ icon: /* @__PURE__ */ J(de, {
954
965
  "aria-hidden": !0,
955
- size: b.SM,
956
- stroke: x
966
+ size: T.SM,
967
+ stroke: E
957
968
  })
958
969
  })
959
970
  })
960
971
  ]
961
972
  });
962
- }, ht = W(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: s, isEmptyStateShown: c = !0, onOpen: l, onRename: u, onDelete: f, labels: p, typography: m, colors: h }) => {
963
- let g = K(), _ = m?.titleClassName ?? "dial-body-semi-text", v = m?.rowTitleClassName ?? "dial-body-text", te = m?.unreadRowTitleClassName ?? "dial-body-semi-text", y = q(() => ee({
964
- "--pcl-read-dot": h?.readDot,
965
- "--pcl-unread-dot": h?.unreadDot,
966
- "--pcl-row-hover": h?.rowHoverBackground
973
+ }, bt = H(({ items: e, isLoading: t = !1, hasError: n = !1, onRetry: r, hasMore: i = !1, isLoadingMore: a = !1, onLoadMore: o, isEmptyStateShown: s = !0, onOpen: l, onRename: u, onDelete: d, labels: p, typography: m, colors: g }) => {
974
+ let _ = W(), v = m?.titleClassName ?? "dial-body-semi-text", y = m?.rowTitleClassName ?? "dial-body-text", ee = m?.unreadRowTitleClassName ?? "dial-body-semi-text", b = G(() => f({
975
+ "--pcl-read-dot": g?.readDot,
976
+ "--pcl-unread-dot": g?.unreadDot,
977
+ "--pcl-row-hover": g?.rowHoverBackground
967
978
  }), [
968
- h?.readDot,
969
- h?.unreadDot,
970
- h?.rowHoverBackground
971
- ]), b = m?.messageClassName ?? "dial-small-text", x = !t && !n && e.length === 0;
972
- return x && !c ? null : /* @__PURE__ */ Z("section", {
973
- "aria-labelledby": x ? void 0 : g,
974
- "aria-label": x ? p.title : void 0,
979
+ g?.readDot,
980
+ g?.unreadDot,
981
+ g?.rowHoverBackground
982
+ ]), x = m?.messageClassName ?? "dial-small-text", S = !t && !n && e.length === 0;
983
+ return S && !s ? null : /* @__PURE__ */ Y("section", {
984
+ "aria-labelledby": S ? void 0 : _,
985
+ "aria-label": S ? p.title : void 0,
975
986
  className: "flex min-w-0 flex-col gap-2 pt-3",
976
- style: y,
987
+ style: b,
977
988
  children: [
978
- !x && /* @__PURE__ */ X("h2", {
979
- id: g,
980
- className: d("m-0", _),
989
+ !S && /* @__PURE__ */ J("h2", {
990
+ id: _,
991
+ className: h("m-0", v),
981
992
  children: p.title
982
993
  }),
983
- /* @__PURE__ */ X(j, {
994
+ /* @__PURE__ */ J(P, {
984
995
  visuallyHidden: !0,
985
- children: t ? p.loadingLabel : n ? p.errorLabel : x ? /* @__PURE__ */ Z(_e, { children: [
986
- /* @__PURE__ */ X("span", { children: p.emptyTitle }),
996
+ children: t ? p.loadingLabel : n ? p.errorLabel : S ? /* @__PURE__ */ Y(we, { children: [
997
+ /* @__PURE__ */ J("span", { children: p.emptyTitle }),
987
998
  " ",
988
- /* @__PURE__ */ X("span", { children: p.emptyDescription })
999
+ /* @__PURE__ */ J("span", { children: p.emptyDescription })
989
1000
  ] }) : null
990
1001
  }),
991
- t ? /* @__PURE__ */ X("div", {
1002
+ t ? /* @__PURE__ */ J("div", {
992
1003
  className: "flex justify-center py-6",
993
- children: /* @__PURE__ */ X("span", {
1004
+ children: /* @__PURE__ */ J("span", {
994
1005
  "aria-hidden": !0,
995
- children: /* @__PURE__ */ X(ae, {})
1006
+ children: /* @__PURE__ */ J(le, {})
996
1007
  })
997
- }) : n ? /* @__PURE__ */ Z("div", {
1008
+ }) : n ? /* @__PURE__ */ Y("div", {
998
1009
  className: "flex flex-col items-center gap-3 py-6 text-center",
999
- children: [/* @__PURE__ */ X("p", {
1010
+ children: [/* @__PURE__ */ J("p", {
1000
1011
  "aria-hidden": !0,
1001
- className: d("m-0", b),
1012
+ className: h("m-0", x),
1002
1013
  children: p.errorLabel
1003
- }), /* @__PURE__ */ X(D, {
1014
+ }), /* @__PURE__ */ J(A, {
1004
1015
  label: p.retryLabel,
1005
1016
  onClick: r
1006
1017
  })]
1007
- }) : x ? /* @__PURE__ */ X("div", {
1018
+ }) : S ? /* @__PURE__ */ J("div", {
1008
1019
  "aria-hidden": !0,
1009
- children: /* @__PURE__ */ X(o, {
1020
+ children: /* @__PURE__ */ J(c, {
1010
1021
  label: p.emptyTitle,
1011
1022
  description: p.emptyDescription
1012
1023
  })
1013
- }) : /* @__PURE__ */ Z(_e, { children: [/* @__PURE__ */ X("ul", {
1024
+ }) : /* @__PURE__ */ Y(we, { children: [/* @__PURE__ */ J("ul", {
1014
1025
  className: "m-0 flex min-w-0 list-none flex-col gap-2 p-0",
1015
- children: e.map((e) => /* @__PURE__ */ X(mt, {
1026
+ children: e.map((e) => /* @__PURE__ */ J(yt, {
1016
1027
  item: e,
1017
1028
  labels: p,
1018
- rowTitleClassName: v,
1019
- unreadRowTitleClassName: te,
1029
+ rowTitleClassName: y,
1030
+ unreadRowTitleClassName: ee,
1020
1031
  onOpen: l,
1021
1032
  onRename: u,
1022
- onDelete: f
1033
+ onDelete: d
1023
1034
  }, e.id))
1024
- }), i && s && /* @__PURE__ */ X(A, {
1035
+ }), i && o && /* @__PURE__ */ J(N, {
1025
1036
  className: "self-start",
1026
1037
  label: p.loadMoreLabel ?? "See more",
1027
1038
  disabled: a,
1028
- onClick: s
1039
+ onClick: o
1029
1040
  })] })
1030
1041
  ]
1031
1042
  });
1032
- }), gt = W(({ composer: e, outputs: n, hasOutputs: r = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: ee, onLoadMore: l, onOpen: u, onRename: d, onGenerateTitle: f, onDelete: p, labels: m, listTypography: h, listColors: _ }) => {
1033
- let te = K(), y = J(null), [S, C] = Y(null), [w, T] = Y(""), [E, D] = Y(), [k, re] = Y(!1), [A, j] = Y(!1), M = J(0), [N, P] = Y(null), [F, ie] = Y(!1), oe = J(null), R = G(() => {
1034
- oe.current = document.activeElement;
1035
- }, []), z = G(() => {
1036
- let e = oe.current;
1037
- oe.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
1038
- }, []), B = G((e) => {
1039
- oe.current = null, window.setTimeout(() => {
1043
+ }), xt = H(({ composer: e, outputs: t, hasOutputs: n = !1, items: i, isLoading: a = !1, hasError: o = !1, onRetry: s, hasMore: c, isLoadingMore: l, onLoadMore: u, onOpen: d, onRename: f, onGenerateTitle: p, onDelete: m, labels: h, listTypography: g, listColors: _ }) => {
1044
+ let v = W(), y = K(null), [b, S] = q(null), [C, w] = q(""), [D, O] = q(), [k, te] = q(!1), [ne, A] = q(!1), j = K(0), [M, N] = q(null), [P, ae] = q(!1), F = K(null), I = U(() => {
1045
+ F.current = document.activeElement;
1046
+ }, []), L = U(() => {
1047
+ let e = F.current;
1048
+ F.current = null, e?.isConnected && window.setTimeout(() => e.focus(), 0);
1049
+ }, []), ce = U((e) => {
1050
+ F.current = null, window.setTimeout(() => {
1040
1051
  let t = y.current;
1041
1052
  if (!t) return;
1042
1053
  let n = t.querySelectorAll("li > button"), r = n[Math.min(e, n.length - 1)] ?? t.querySelector("h2, section");
1043
1054
  r && !r.matches("button") && (r.tabIndex = -1), r?.focus();
1044
1055
  }, 0);
1045
- }, []), V = G((e) => i.find((t) => t.id === e) ?? null, [i]);
1046
- ge(() => {
1056
+ }, []), R = U((e) => i.find((t) => t.id === e) ?? null, [i]);
1057
+ Ce(() => {
1047
1058
  let e = (e) => e != null && i.some((t) => t.id === e.id);
1048
- S && !k && !e(S) && (C(null), B(0)), N && !F && !e(N) && (P(null), B(0));
1059
+ b && !k && !e(b) && (S(null), ce(0)), M && !P && !e(M) && (N(null), ce(0));
1049
1060
  }, [
1050
- N,
1051
- B,
1052
- F,
1061
+ M,
1062
+ ce,
1063
+ P,
1053
1064
  k,
1054
1065
  i,
1055
- S
1066
+ b
1056
1067
  ]);
1057
- let H = G((e) => {
1058
- R();
1059
- let t = V(e);
1060
- M.current += 1, j(!1), C(t), T(t?.title ?? ""), D(void 0);
1061
- }, [V, R]), se = G((e) => {
1062
- R(), P(V(e));
1063
- }, [V, R]), ce = G(() => {
1064
- k || (M.current += 1, j(!1), C(null), z());
1065
- }, [k, z]), le = G(() => {
1066
- F || (P(null), z());
1067
- }, [F, z]), ue = G(async () => {
1068
- if (!S || !d || k) return;
1069
- let e = w.trim();
1070
- if (!e) D(m.renameEmptyError);
1068
+ let ue = U((e) => {
1069
+ I();
1070
+ let t = R(e);
1071
+ j.current += 1, A(!1), S(t), w(t?.title ?? ""), O(void 0);
1072
+ }, [R, I]), de = U((e) => {
1073
+ I(), N(R(e));
1074
+ }, [R, I]), fe = U(() => {
1075
+ k || (j.current += 1, A(!1), S(null), L());
1076
+ }, [k, L]), pe = U(() => {
1077
+ P || (N(null), L());
1078
+ }, [P, L]), z = b != null && C.trim() === b.title.trim(), B = U(async () => {
1079
+ if (!b || !f || k || z) return;
1080
+ let e = C.trim();
1081
+ if (!e) O(h.renameEmptyError);
1071
1082
  else {
1072
- re(!0);
1083
+ te(!0);
1073
1084
  try {
1074
- await d(S.id, e), C(null), z();
1085
+ await f(b.id, e), S(null), L();
1075
1086
  } catch {} finally {
1076
- re(!1);
1087
+ te(!1);
1077
1088
  }
1078
1089
  }
1079
1090
  }, [
1080
1091
  k,
1081
- m.renameEmptyError,
1082
- d,
1083
- S,
1084
- w,
1085
- z
1086
- ]), de = G(async () => {
1087
- if (!S || !f || A) return;
1088
- let e = ++M.current;
1089
- j(!0), D(void 0);
1092
+ z,
1093
+ h.renameEmptyError,
1094
+ f,
1095
+ b,
1096
+ C,
1097
+ L
1098
+ ]), V = U(async () => {
1099
+ if (!b || !p || ne) return;
1100
+ let e = ++j.current;
1101
+ A(!0), O(void 0);
1090
1102
  try {
1091
- let t = await f(S.id);
1092
- if (e !== M.current) return;
1093
- T(t);
1103
+ let t = await p(b.id);
1104
+ if (e !== j.current) return;
1105
+ w(t);
1094
1106
  } catch {
1095
- if (e !== M.current) return;
1096
- D(m.renameWithAiError ?? "Could not generate a name. Try again.");
1107
+ if (e !== j.current) return;
1108
+ O(h.renameWithAiError ?? "Could not generate a name. Try again.");
1097
1109
  } finally {
1098
- e === M.current && j(!1);
1110
+ e === j.current && A(!1);
1099
1111
  }
1100
1112
  }, [
1101
- A,
1102
- m.renameWithAiError,
1103
- f,
1104
- S
1105
- ]), fe = G((e) => {
1106
- e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), ue());
1107
- }, [ue]), pe = G(async () => {
1108
- if (!N || !p) return;
1109
- let e = i.findIndex((e) => e.id === N.id);
1110
- ie(!0);
1113
+ ne,
1114
+ h.renameWithAiError,
1115
+ p,
1116
+ b
1117
+ ]), me = U((e) => {
1118
+ e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), B());
1119
+ }, [B]), ge = U(async () => {
1120
+ if (!M || !m) return;
1121
+ let e = i.findIndex((e) => e.id === M.id);
1122
+ ae(!0);
1111
1123
  try {
1112
- await p(N.id), P(null), B(Math.max(e, 0));
1124
+ await m(M.id), N(null), ce(Math.max(e, 0));
1113
1125
  } catch {} finally {
1114
- ie(!1);
1126
+ ae(!1);
1115
1127
  }
1116
1128
  }, [
1117
- N,
1118
- B,
1129
+ M,
1130
+ ce,
1119
1131
  i,
1120
- p
1121
- ]), me = q(() => [{
1122
- label: m.renameCancelLabel ?? "Cancel",
1123
- variant: v.Primary,
1124
- appearance: g.Ghost,
1132
+ m
1133
+ ]), _e = G(() => [{
1134
+ label: h.renameCancelLabel ?? "Cancel",
1135
+ variant: x.Primary,
1136
+ appearance: ee.Ghost,
1125
1137
  disabled: k,
1126
- onClick: ce
1138
+ onClick: fe
1127
1139
  }, {
1128
- label: m.renameSaveLabel,
1129
- variant: v.Primary,
1130
- disabled: k,
1140
+ label: h.renameSaveLabel,
1141
+ variant: x.Primary,
1142
+ disabled: k || z || C.trim() === "",
1131
1143
  onClick: () => {
1132
- ue();
1144
+ B();
1133
1145
  }
1134
1146
  }], [
1135
- ce,
1136
- ue,
1147
+ fe,
1148
+ B,
1149
+ z,
1137
1150
  k,
1138
- m.renameCancelLabel,
1139
- m.renameSaveLabel
1151
+ C,
1152
+ h.renameCancelLabel,
1153
+ h.renameSaveLabel
1140
1154
  ]);
1141
- return /* @__PURE__ */ Z(_e, { children: [
1155
+ return /* @__PURE__ */ Y(we, { children: [
1142
1156
  e,
1143
- n,
1144
- /* @__PURE__ */ X("div", {
1157
+ t,
1158
+ /* @__PURE__ */ J("div", {
1145
1159
  ref: y,
1146
1160
  className: "contents",
1147
- children: /* @__PURE__ */ X(ht, {
1161
+ children: /* @__PURE__ */ J(bt, {
1148
1162
  items: i,
1149
1163
  isLoading: a,
1150
1164
  hasError: o,
1151
1165
  onRetry: s,
1152
1166
  hasMore: c,
1153
- isLoadingMore: ee,
1154
- onLoadMore: l,
1155
- isEmptyStateShown: !r,
1156
- onOpen: u,
1157
- onRename: d ? H : void 0,
1158
- onDelete: p ? se : void 0,
1159
- labels: m.list,
1160
- typography: h,
1167
+ isLoadingMore: l,
1168
+ onLoadMore: u,
1169
+ isEmptyStateShown: !n,
1170
+ onOpen: d,
1171
+ onRename: f ? ue : void 0,
1172
+ onDelete: m ? de : void 0,
1173
+ labels: h.list,
1174
+ typography: g,
1161
1175
  colors: _
1162
1176
  })
1163
1177
  }),
1164
- S && /* @__PURE__ */ X(I, {
1178
+ b && /* @__PURE__ */ J(oe, {
1165
1179
  open: !0,
1166
- header: m.renameTitle,
1167
- size: L.Sm,
1168
- mainButtons: me,
1169
- onClose: ce,
1170
- children: /* @__PURE__ */ Z("div", {
1180
+ header: h.renameTitle,
1181
+ size: se.Sm,
1182
+ mainButtons: _e,
1183
+ onClose: fe,
1184
+ children: /* @__PURE__ */ Y("div", {
1171
1185
  className: "flex items-end gap-2 px-6 py-4",
1172
- children: [/* @__PURE__ */ X("div", {
1186
+ children: [/* @__PURE__ */ J("div", {
1173
1187
  className: "min-w-0 flex-1",
1174
- children: /* @__PURE__ */ X(ne, {
1175
- id: te,
1176
- value: w,
1177
- labelProps: { label: m.renameInputLabel },
1178
- error: E,
1188
+ children: /* @__PURE__ */ J(ie, {
1189
+ id: v,
1190
+ value: C,
1191
+ labelProps: { label: h.renameInputLabel },
1192
+ error: D,
1179
1193
  disabled: k,
1180
- onKeyDown: fe,
1194
+ onKeyDown: me,
1181
1195
  onChange: (e) => {
1182
- T(e ?? ""), D(void 0);
1196
+ w(e ?? ""), O(void 0);
1183
1197
  }
1184
1198
  })
1185
- }), f && /* @__PURE__ */ X(O, {
1186
- "aria-label": m.renameWithAiLabel ?? "Rename with AI",
1187
- tooltipProps: { tooltip: m.renameWithAiLabel ?? "Rename with AI" },
1188
- disabled: A || k,
1189
- "aria-busy": A,
1199
+ }), p && /* @__PURE__ */ J(re, {
1200
+ "aria-label": h.renameWithAiLabel ?? "Rename with AI",
1201
+ tooltipProps: { tooltip: h.renameWithAiLabel ?? "Rename with AI" },
1202
+ disabled: ne || k,
1203
+ "aria-busy": ne,
1190
1204
  onClick: () => {
1191
- de();
1205
+ V();
1192
1206
  },
1193
- icon: A ? /* @__PURE__ */ X("span", {
1207
+ icon: ne ? /* @__PURE__ */ J("span", {
1194
1208
  className: "flex",
1195
1209
  "aria-hidden": !0,
1196
- children: /* @__PURE__ */ X(ae, { size: b.MD })
1197
- }) : /* @__PURE__ */ X(U, {
1198
- size: b.MD,
1199
- stroke: x,
1210
+ children: /* @__PURE__ */ J(le, { size: T.MD })
1211
+ }) : /* @__PURE__ */ J(he, {
1212
+ size: T.MD,
1213
+ stroke: E,
1200
1214
  "aria-hidden": !0
1201
1215
  })
1202
1216
  })]
1203
1217
  })
1204
1218
  }),
1205
- N && /* @__PURE__ */ X(t, {
1219
+ M && /* @__PURE__ */ J(r, {
1206
1220
  open: !0,
1207
- title: m.deleteTitle(N.title),
1208
- names: [N.title],
1209
- message: m.deleteDescription,
1210
- labels: m.deleteDialog,
1211
- isLoading: F,
1221
+ title: h.deleteTitle(M.title),
1222
+ names: [M.title],
1223
+ message: h.deleteDescription,
1224
+ labels: h.deleteDialog,
1225
+ isLoading: P,
1212
1226
  onConfirm: () => {
1213
- pe();
1227
+ ge();
1214
1228
  },
1215
- onClose: le
1229
+ onClose: pe
1216
1230
  })
1217
1231
  ] });
1218
- }), _t = {
1232
+ }), St = {
1219
1233
  title: "_title_17sbf_1",
1220
1234
  secondary: "_secondary_17sbf_5"
1221
- }, vt = 6, yt = (e) => ({
1235
+ }, Ct = 6, wt = (e) => ({
1222
1236
  id: e.name,
1223
1237
  name: e.name,
1224
1238
  contentType: e.contentType,
1225
- type: l(e.contentType),
1226
- status: s.Idle
1227
- }), bt = W(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = vt, labels: o, styles: s }) => {
1228
- let c = K(), l = K(), u = J(null), f = J(!1), [p, m] = Y(!1), { colors: h, typography: g } = s ?? {}, _ = g?.titleClassName ?? "dial-body-semi-text", v = g?.helperClassName ?? "dial-tiny-text", te = o?.title ?? "Outputs", y = o?.errorLabel ?? "Could not load outputs", b = q(() => ee({
1229
- "--po-heading-text": h?.headingText,
1230
- "--po-secondary-text": h?.secondaryText
1231
- }), [h?.headingText, h?.secondaryText]), x = G(() => m((e) => !e), []), S = G(() => {
1232
- f.current = !0, i?.();
1239
+ type: p(e.contentType),
1240
+ status: l.Idle
1241
+ }), Tt = H(({ items: e, onOpenOutput: t, selectedOutputName: n, hasError: r = !1, onRetry: i, previewLimit: a = Ct, labels: o, styles: s }) => {
1242
+ let c = W(), l = W(), u = K(null), d = K(!1), [p, m] = q(!1), { colors: g, typography: _ } = s ?? {}, v = _?.titleClassName ?? "dial-body-semi-text", y = _?.helperClassName ?? "dial-tiny-text", ee = o?.title ?? "Outputs", b = o?.errorLabel ?? "Could not load outputs", x = G(() => f({
1243
+ "--po-heading-text": g?.headingText,
1244
+ "--po-secondary-text": g?.secondaryText
1245
+ }), [g?.headingText, g?.secondaryText]), S = U(() => m((e) => !e), []), C = U(() => {
1246
+ d.current = !0, i?.();
1233
1247
  }, [i]);
1234
- ge(() => {
1235
- !r && f.current && (f.current = !1, u.current?.focus());
1248
+ Ce(() => {
1249
+ !r && d.current && (d.current = !1, u.current?.focus());
1236
1250
  }, [r]);
1237
- let C = r || e.length > 0, w = e.length > a, T = p || !w ? e : e.slice(0, a), E = o?.openOutputLabel ?? ((e) => `Preview ${e}`), O = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, k = o?.showLessLabel ?? "Show less";
1238
- return /* @__PURE__ */ Z("div", {
1251
+ let w = r || e.length > 0, T = e.length > a, E = p || !T ? e : e.slice(0, a), D = o?.openOutputLabel ?? ((e) => `Preview ${e}`), O = o?.seeAllLabel?.(e.length) ?? `See all (${e.length})`, k = o?.showLessLabel ?? "Show less";
1252
+ return /* @__PURE__ */ Y("div", {
1239
1253
  className: "contents",
1240
- style: b,
1241
- children: [C && /* @__PURE__ */ Z("section", {
1254
+ style: x,
1255
+ children: [w && /* @__PURE__ */ Y("section", {
1242
1256
  "aria-labelledby": c,
1243
1257
  className: "flex min-w-0 flex-col gap-2 pt-3",
1244
- children: [/* @__PURE__ */ Z("div", {
1258
+ children: [/* @__PURE__ */ Y("div", {
1245
1259
  className: "flex min-w-0 items-center justify-between gap-2",
1246
- children: [/* @__PURE__ */ X("h2", {
1260
+ children: [/* @__PURE__ */ J("h2", {
1247
1261
  ref: u,
1248
1262
  id: c,
1249
1263
  tabIndex: -1,
1250
- className: d("m-0", _t.title, _),
1251
- children: te
1252
- }), !r && w && /* @__PURE__ */ X(A, {
1264
+ className: h("m-0", St.title, v),
1265
+ children: ee
1266
+ }), !r && T && /* @__PURE__ */ J(N, {
1253
1267
  label: p ? k : O,
1254
1268
  "aria-expanded": p,
1255
1269
  "aria-controls": l,
1256
- onClick: x
1270
+ onClick: S
1257
1271
  })]
1258
- }), r ? /* @__PURE__ */ Z(_e, { children: [/* @__PURE__ */ X("p", {
1272
+ }), r ? /* @__PURE__ */ Y(we, { children: [/* @__PURE__ */ J("p", {
1259
1273
  "aria-hidden": !0,
1260
- className: d("m-0", _t.secondary, v),
1261
- children: y
1262
- }), i && /* @__PURE__ */ X(D, {
1274
+ className: h("m-0", St.secondary, y),
1275
+ children: b
1276
+ }), i && /* @__PURE__ */ J(A, {
1263
1277
  className: "self-start",
1264
1278
  label: o?.retryLabel ?? "Retry",
1265
- onClick: S
1266
- })] }) : /* @__PURE__ */ X("ul", {
1279
+ onClick: C
1280
+ })] }) : /* @__PURE__ */ J("ul", {
1267
1281
  id: l,
1268
- className: d("m-0 flex min-w-0 list-none gap-2 p-0", p ? "flex-wrap" : "flex-nowrap overflow-x-auto"),
1269
- children: T.map((e) => /* @__PURE__ */ X("li", {
1282
+ className: h("m-0 flex min-w-0 list-none gap-2 p-0", p ? "flex-wrap" : "flex-nowrap overflow-x-auto"),
1283
+ children: E.map((e) => /* @__PURE__ */ J("li", {
1270
1284
  className: "shrink-0",
1271
- children: /* @__PURE__ */ X(ve, {
1272
- attachment: yt(e),
1285
+ children: /* @__PURE__ */ J(Te, {
1286
+ attachment: wt(e),
1273
1287
  onClick: t,
1274
1288
  isSelected: e.name === n,
1275
- labels: { clickLabel: E(e.name) }
1289
+ labels: { clickLabel: D(e.name) }
1276
1290
  })
1277
1291
  }, e.name))
1278
1292
  })]
1279
- }), /* @__PURE__ */ X(j, {
1293
+ }), /* @__PURE__ */ J(P, {
1280
1294
  visuallyHidden: !0,
1281
- children: r ? y : ""
1295
+ children: r ? b : ""
1282
1296
  })]
1283
1297
  });
1284
- }), xt = W(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Z("nav", {
1298
+ }), Et = "Remove from My List", Dt = [
1299
+ "You will lose access to this item",
1300
+ "Other people keep their access",
1301
+ "You will need a new invitation to get it back"
1302
+ ], Ot = H(({ isOpen: e, projectName: r, isRemoving: i = !1, onConfirm: a, onClose: o, labels: s }) => /* @__PURE__ */ J(t, {
1303
+ open: e,
1304
+ title: s?.title ?? Et,
1305
+ variant: w.Info,
1306
+ identity: /* @__PURE__ */ J(u, { children: /* @__PURE__ */ J(n, { name: r }) }),
1307
+ message: s?.message?.(r) ?? /* @__PURE__ */ Y(we, { children: [
1308
+ "Remove ",
1309
+ /* @__PURE__ */ J("strong", { children: r }),
1310
+ " from your list? You'll need a new invitation to access it again."
1311
+ ] }),
1312
+ consequences: s?.consequences ?? Dt,
1313
+ confirmLabel: s?.confirmLabel ?? Et,
1314
+ cancelLabel: s?.cancelLabel ?? "Cancel",
1315
+ isLoading: i,
1316
+ loadingStatusLabel: s?.removingStatusLabel ?? "Removing…",
1317
+ onConfirm: a,
1318
+ onClose: o
1319
+ })), kt = H(({ projectName: e, projectHref: t, onBack: n, onProjectLinkClick: r, backLabel: i, className: a, nameClassName: o = "dial-body-text" }) => /* @__PURE__ */ Y("nav", {
1285
1320
  "aria-label": i,
1286
- className: d("flex min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1287
- children: [/* @__PURE__ */ X(O, {
1321
+ className: h("flex max-w-full min-w-0 shrink-0 items-center gap-2 border-b px-4 py-2", a),
1322
+ children: [/* @__PURE__ */ J(re, {
1288
1323
  "aria-label": i,
1289
- icon: /* @__PURE__ */ X(oe, {
1324
+ icon: /* @__PURE__ */ J(R, {
1290
1325
  "aria-hidden": !0,
1291
- size: b.MD,
1292
- stroke: x,
1326
+ size: T.MD,
1327
+ stroke: E,
1293
1328
  className: "rtl:scale-x-[-1]"
1294
1329
  }),
1295
1330
  onClick: n
1296
- }), /* @__PURE__ */ X("a", {
1331
+ }), /* @__PURE__ */ J("a", {
1297
1332
  href: t,
1298
1333
  onClick: r,
1299
- className: "min-w-0 hover:underline focus-visible:underline",
1300
- children: /* @__PURE__ */ X(C, {
1334
+ className: "block min-w-0 hover:underline focus-visible:underline",
1335
+ children: /* @__PURE__ */ J(O, {
1301
1336
  text: e,
1302
- className: d("min-w-0", o)
1337
+ className: h("min-w-0", o)
1303
1338
  })
1304
1339
  })]
1340
+ })), At = "Revoke access", jt = [
1341
+ "People you shared with will lose access",
1342
+ "Existing share links will stop working",
1343
+ "Your own copy will remain available"
1344
+ ], Mt = H(({ isOpen: e, projectName: r, isRevoking: i = !1, onConfirm: a, onClose: o, labels: s }) => /* @__PURE__ */ J(t, {
1345
+ open: e,
1346
+ title: s?.title ?? At,
1347
+ variant: w.Danger,
1348
+ identity: /* @__PURE__ */ J(u, { children: /* @__PURE__ */ J(n, { name: r }) }),
1349
+ message: s?.message?.(r) ?? /* @__PURE__ */ Y(we, { children: [
1350
+ "Revoke shared access to ",
1351
+ /* @__PURE__ */ J("strong", { children: r }),
1352
+ "? Anyone you shared it with will lose access."
1353
+ ] }),
1354
+ consequences: s?.consequences ?? jt,
1355
+ confirmLabel: s?.confirmLabel ?? At,
1356
+ cancelLabel: s?.cancelLabel ?? "Cancel",
1357
+ isLoading: i,
1358
+ loadingStatusLabel: s?.revokingStatusLabel ?? "Revoking access…",
1359
+ onConfirm: a,
1360
+ onClose: o
1305
1361
  }));
1306
1362
  //#endregion
1307
- export { ze as ContextFileRejection, Ve as PROJECT_NAME_MAX_BYTES, xt as ProjectChatHeader, ht as ProjectConversationList, gt as ProjectConversationsPanel, ct as ProjectCreateForm, Be as ProjectNameError, bt as ProjectOutputs, Ie as ProjectSource, ft as ProjectView, Fe as Projects, Ce as ProjectsSortKey, tt as checkContextFiles, nt as filterContextFileItems, Xe as getContextFilesSize, Je as isStoredContextFile, Ke as validateProjectName };
1363
+ export { We as ContextFileRejection, Ke as PROJECT_NAME_MAX_BYTES, kt as ProjectChatHeader, bt as ProjectConversationList, xt as ProjectConversationsPanel, pt as ProjectCreateForm, Ge as ProjectNameError, Tt as ProjectOutputs, Ot as ProjectRemoveFromListConfirmation, Mt as ProjectRevokeAccessConfirmation, Ve as ProjectSource, _t as ProjectView, Be as Projects, ke as ProjectsSortKey, ot as checkContextFiles, st as filterContextFileItems, tt as getContextFilesSize, $e as isStoredContextFile, Ze as validateProjectName };