@parallelworks/tandem-web 0.194.0 → 0.194.2

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/pages/issues.js CHANGED
@@ -1,88 +1,89 @@
1
- import { cyclesQuery as e, issueCountsQuery as t, issueOrders as n, issuePagesQuery as r, labelsQuery as i, meQuery as ee, projectsQuery as te, statusesQuery as ne, teamsQuery as re, viewsQuery as a } from "../api/queries.js";
2
- import { DisplayMenu as ie } from "../components/DisplayMenu.js";
3
- import { FavoriteStar as ae } from "../components/FavoriteStar.js";
4
- import { IssueBoard as oe } from "../components/IssueBoard.js";
5
- import { BreakdownFilterBar as se, IssueBreakdown as ce, breakdownCount as le, formatBreakdown as ue, inBreakdown as de, parseBreakdown as fe } from "../components/IssueBreakdown.js";
6
- import { useIssueFilters as pe, withIssueFilters as me } from "../components/IssueFilters.js";
7
- import { IssueGroupList as he } from "../components/IssueGroupList.js";
8
- import { IssueInsights as ge } from "../components/IssueInsights.js";
9
- import { IssueRow as o } from "../components/IssueRow.js";
10
- import { BoardIcon as _e, ChartIcon as ve, CloseIcon as ye, ListViewIcon as be, SidePanelIcon as xe, usePriorityNames as Se } from "../components/icons.js";
11
- import { ErrorMessage as Ce } from "../components/status.js";
12
- import { ViewDialog as we } from "../components/ViewDialog.js";
13
- import { useBoardMove as Te } from "../lib/boardMove.js";
14
- import { customFieldsQuery as Ee, fieldRef as De, fieldsForTeams as Oe, groupableKinds as ke, sortableKinds as Ae } from "../lib/customFields.js";
15
- import { insightsKey as je, listTabs as Me, panelKey as Ne, shownFields as Pe, storeDisplay as Fe, storeShownFields as Ie, storedDisplay as Le, withParam as s } from "../lib/issueDisplay.js";
16
- import { groupIssues as Re, groupings as ze, isGrouping as Be, isOrder as Ve, issueFilterOf as He, orders as Ue, sortIssues as We, views as Ge } from "../lib/issueList.js";
17
- import { useIssueMenu as Ke } from "../lib/issueMenu.js";
18
- import { issueTypesQuery as qe } from "../lib/issueTypes.js";
19
- import { useLive as Je } from "../lib/live.js";
20
- import { useNewIssue as Ye } from "../lib/newIssue.js";
21
- import { pagedGroupings as Xe, usePagedGroups as Ze } from "../lib/pagedGroups.js";
22
- import { usePageTitle as Qe } from "../lib/pageTitle.js";
23
- import { usePaletteSelection as $e } from "../lib/palette.js";
24
- import { usePeople as et } from "../lib/people.js";
25
- import { projectRef as tt } from "../lib/projects.js";
26
- import { isViewAt as nt, viewRef as rt } from "../lib/refs.js";
27
- import { useCan as it } from "../lib/roles.js";
28
- import { useNavigate as at } from "../lib/router.js";
29
- import { useShortcuts as ot } from "../lib/shortcuts.js";
30
- import { issuesHref as c } from "../lib/teamPaths.js";
1
+ import { cyclesQuery as e, issueCountsQuery as t, issueOrders as n, issuePagesQuery as r, labelsQuery as i, meQuery as a, projectsQuery as o, statusesQuery as ee, teamsQuery as te, viewsQuery as s } from "../api/queries.js";
2
+ import { DisplayMenu as ne } from "../components/DisplayMenu.js";
3
+ import { FavoriteStar as re } from "../components/FavoriteStar.js";
4
+ import { IssueBoard as ie } from "../components/IssueBoard.js";
5
+ import { BreakdownFilterBar as ae, IssueBreakdown as oe, breakdownCount as se, formatBreakdown as ce, inBreakdown as le, parseBreakdown as ue } from "../components/IssueBreakdown.js";
6
+ import { useIssueFilters as de, withIssueFilters as fe } from "../components/IssueFilters.js";
7
+ import { IssueGroupList as pe } from "../components/IssueGroupList.js";
8
+ import { IssueInsights as me } from "../components/IssueInsights.js";
9
+ import { IssueRow as c } from "../components/IssueRow.js";
10
+ import { BoardIcon as he, ChartIcon as ge, CloseIcon as _e, ListViewIcon as ve, SidePanelIcon as ye, usePriorityNames as be } from "../components/icons.js";
11
+ import { ErrorMessage as xe } from "../components/status.js";
12
+ import { ViewDialog as Se } from "../components/ViewDialog.js";
13
+ import { useBoardMove as Ce } from "../lib/boardMove.js";
14
+ import { knownPicks as we } from "../lib/breakdownPicks.js";
15
+ import { customFieldsQuery as Te, fieldRef as Ee, fieldsForTeams as De, groupableKinds as Oe, sortableKinds as ke } from "../lib/customFields.js";
16
+ import { insightsKey as Ae, listTabs as je, panelKey as Me, shownFields as Ne, storeDisplay as Pe, storeShownFields as Fe, storedDisplay as Ie, withParam as l } from "../lib/issueDisplay.js";
17
+ import { groupIssues as Le, groupings as Re, isGrouping as ze, isOrder as Be, issueFilterOf as Ve, orders as He, sortIssues as Ue, views as We } from "../lib/issueList.js";
18
+ import { useIssueMenu as Ge } from "../lib/issueMenu.js";
19
+ import { issueTypesQuery as Ke } from "../lib/issueTypes.js";
20
+ import { useLive as qe } from "../lib/live.js";
21
+ import { useNewIssue as Je } from "../lib/newIssue.js";
22
+ import { pagedGroupings as Ye, usePagedGroups as Xe } from "../lib/pagedGroups.js";
23
+ import { usePageTitle as Ze } from "../lib/pageTitle.js";
24
+ import { usePaletteSelection as Qe } from "../lib/palette.js";
25
+ import { usePeople as $e } from "../lib/people.js";
26
+ import { projectRef as et } from "../lib/projects.js";
27
+ import { isViewAt as tt, viewRef as nt } from "../lib/refs.js";
28
+ import { useCan as rt } from "../lib/roles.js";
29
+ import { useNavigate as it } from "../lib/router.js";
30
+ import { useShortcuts as at } from "../lib/shortcuts.js";
31
+ import { issuesHref as ot } from "../lib/teamPaths.js";
31
32
  import { filtersOf as st, sameFilters as ct, useSavedViews as lt, useViewMenu as ut, viewSearch as dt } from "../lib/views.js";
32
- import { ActionMenu as ft, Button as l, ConfirmModal as pt, Field as mt, IconButton as ht, SearchInput as gt, Select as _t, Tabs as vt, useOpenMenu as yt } from "@parallelworks/ui";
33
+ import { ActionMenu as ft, Button as u, ConfirmModal as pt, Field as mt, IconButton as ht, SearchInput as gt, Select as _t, Tabs as vt, useOpenMenu as yt } from "@parallelworks/ui";
33
34
  import { useParams as bt, useSearch as xt } from "@tanstack/react-router";
34
- import { memo as u, useCallback as St, useEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as Ct } from "react";
35
+ import { memo as d, useCallback as St, useEffect as Ct, useMemo as f, useRef as p, useState as m, useSyncExternalStore as wt } from "react";
35
36
  import { useTranslations as h } from "use-intl";
36
- import { Fragment as wt, jsx as g, jsxs as _ } from "react/jsx-runtime";
37
- import { keepPreviousData as Tt, useInfiniteQuery as Et, useQuery as v, useSuspenseQuery as Dt } from "@tanstack/react-query";
38
- import { ListFilterBar as Ot, ListFilterMenu as kt, ListSkeleton as At, MoreButton as jt } from "@parallelworks/ui/list";
37
+ import { Fragment as Tt, jsx as g, jsxs as _ } from "react/jsx-runtime";
38
+ import { keepPreviousData as Et, useInfiniteQuery as Dt, useQuery as v, useSuspenseQuery as Ot } from "@tanstack/react-query";
39
+ import { ListFilterBar as kt, ListFilterMenu as At, ListSkeleton as jt, MoreButton as Mt } from "@parallelworks/ui/list";
39
40
  // src/pages/issues.tsx
40
- var Mt = {
41
+ var Nt = {
41
42
  status: "status",
42
43
  priority: "priority",
43
44
  project: "project",
44
45
  type: "type"
45
- }, Nt = [];
46
- function Pt({ team: e, ...t }) {
46
+ }, Pt = [];
47
+ function Ft({ team: e, ...t }) {
47
48
  return t;
48
49
  }
49
- var Ft = 3, It = "(max-width: 639px)", Lt = () => globalThis.matchMedia?.(It).matches ?? !1, Rt = (e) => {
50
- let t = globalThis.matchMedia?.(It);
50
+ var It = 3, Lt = "(max-width: 639px)", Rt = () => globalThis.matchMedia?.(Lt).matches ?? !1, zt = (e) => {
51
+ let t = globalThis.matchMedia?.(Lt);
51
52
  return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
52
- }, zt = (e) => `saved:${rt(e)}`;
53
- function Bt(e, t, n) {
53
+ }, Bt = (e) => `saved:${nt(e)}`;
54
+ function Vt(e, t, n) {
54
55
  let r = t && !e.some((e) => e.id === t.id) ? [...e, t] : e, i = r.slice(0, n);
55
56
  return t && !i.some((e) => e.id === t.id) && (i = [...i.slice(0, n - 1), t]), {
56
57
  shown: i,
57
58
  more: r.filter((e) => !i.some((t) => t.id === e.id))
58
59
  };
59
60
  }
60
- function Vt(e) {
61
+ function Ht(e) {
61
62
  let { assignee: t, creator: n, ...r } = e;
62
63
  return n ? {
63
64
  ...r,
64
65
  creator: n
65
66
  } : r;
66
67
  }
67
- function Ht({ person: o } = {}) {
68
- let u = h("issues"), It = h("planning"), Ht = h("common"), { workspace: y, key: b } = bt({ strict: !1 }), x = xt({ strict: !1 }), S = b ? {
68
+ function Ut({ person: c } = {}) {
69
+ let d = h("issues"), Lt = h("planning"), Ut = h("common"), { workspace: y, key: b } = bt({ strict: !1 }), x = xt({ strict: !1 }), S = b ? {
69
70
  ...x,
70
71
  team: b
71
- } : o ? x.creator ? {
72
- ...Vt(x),
73
- creator: o
72
+ } : c ? x.creator ? {
73
+ ...Ht(x),
74
+ creator: c
74
75
  } : {
75
76
  ...x,
76
- assignee: o
77
- } : x, Gt = at(), Kt = (e) => o ? c(y, { ...Vt(e) }).replace(`/${y}/issues`, `/${y}/people/${encodeURIComponent(o)}`) : c(y, { ...e }), C = (e, t) => {
77
+ assignee: c
78
+ } : x, Kt = it(), qt = (e) => c ? ot(y, { ...Ht(e) }).replace(`/${y}/issues`, `/${y}/people/${encodeURIComponent(c)}`) : ot(y, { ...e }), C = (e, t) => {
78
79
  let { team: n, ...r } = e;
79
- return Gt(o ? {
80
+ return Kt(c ? {
80
81
  to: "/$workspace/people/$username",
81
82
  params: {
82
83
  workspace: y,
83
- username: o
84
+ username: c
84
85
  },
85
- search: Vt(r),
86
+ search: Ht(r),
86
87
  ...t && { replace: t }
87
88
  } : n ? {
88
89
  to: "/$workspace/teams/$key/issues",
@@ -98,100 +99,100 @@ function Ht({ person: o } = {}) {
98
99
  search: r,
99
100
  ...t && { replace: t }
100
101
  });
101
- }, qt = p((e) => C(e, !0));
102
- qt.current = (e) => C(e, !0);
103
- let Jt = p((e) => C(s(S, "q", e), !0));
104
- Jt.current = (e) => C(s(S, "q", e), !0);
105
- let { data: Yt } = Dt(ee), { data: w } = Dt(re(y)), Xt = Ye(), T = S.view ?? "active", [Zt, Qt] = m(S.q ?? ""), $t = p(null);
106
- d(() => {
102
+ }, Jt = p((e) => C(e, !0));
103
+ Jt.current = (e) => C(e, !0);
104
+ let Yt = p((e) => C(l(S, "q", e), !0));
105
+ Yt.current = (e) => C(l(S, "q", e), !0);
106
+ let { data: Xt } = Ot(a), { data: w } = Ot(te(y)), Zt = Je(), T = S.view ?? "active", [Qt, $t] = m(S.q ?? ""), en = p(null);
107
+ Ct(() => {
107
108
  let e = setTimeout(() => {
108
- (S.q ?? "") !== Zt && Jt.current(Zt);
109
+ (S.q ?? "") !== Qt && Yt.current(Qt);
109
110
  }, 250);
110
111
  return () => clearTimeout(e);
111
- }, [Zt, S.q]);
112
- let { data: en } = v({
113
- ...ne(y, S.team ?? ""),
112
+ }, [Qt, S.q]);
113
+ let { data: tn } = v({
114
+ ...ee(y, S.team ?? ""),
114
115
  enabled: !!S.status && !!S.team
115
- }), tn = He(S, en), nn = !S.status || !S.team || !!en, rn = Se(), { nameOf: an, avatarOf: on } = et(y), E = S.saved ? {} : Le(), { data: sn } = v(Ee(y)), D = w.find((e) => e.key === S.team), O = f(() => Oe(sn, D ? [D.id] : w.map((e) => e.id)), [
116
- sn,
116
+ }), nn = Ve(S, tn), rn = !S.status || !S.team || !!tn, an = be(), { nameOf: on, avatarOf: sn } = $e(y), E = S.saved ? {} : Ie(), { data: cn } = v(Te(y)), D = w.find((e) => e.key === S.team), O = f(() => De(cn, D ? [D.id] : w.map((e) => e.id)), [
117
+ cn,
117
118
  D,
118
119
  w
119
- ]), k = h("customFields"), cn = h("issueTypes"), { data: ln } = v(qe(y)), un = f(() => (ln ?? []).filter((e) => !e.archivedAt && (!D || e.teamIds.length === 0 || e.teamIds.includes(D.id))), [ln, D]), A = Ve(S.order, O) ? S.order : Ve(E.order, O) ? E.order : "updated", j = Be(S.group, O) ? S.group : Be(E.group, O) ? E.group : "status", dn = O.find((e) => e.id === De(j)), [fn, pn] = m(() => Pe(y)), mn = f(() => O.filter((e) => fn.includes(e.id)), [O, fn]), M = S.layout === "board" || !S.layout && E.layout === "board", [N, hn] = m(() => {
120
+ ]), k = h("customFields"), ln = h("issueTypes"), { data: un } = v(Ke(y)), dn = f(() => (un ?? []).filter((e) => !e.archivedAt && (!D || e.teamIds.length === 0 || e.teamIds.includes(D.id))), [un, D]), A = Be(S.order, O) ? S.order : Be(E.order, O) ? E.order : "updated", j = ze(S.group, O) ? S.group : ze(E.group, O) ? E.group : "status", fn = O.find((e) => e.id === Ee(j)), [pn, mn] = m(() => Ne(y)), hn = f(() => O.filter((e) => pn.includes(e.id)), [O, pn]), M = S.layout === "board" || !S.layout && E.layout === "board", [N, gn] = m(() => {
120
121
  try {
121
- return localStorage.getItem(Ne) !== "hidden";
122
+ return localStorage.getItem(Me) !== "hidden";
122
123
  } catch {
123
124
  return !0;
124
125
  }
125
- }), gn = () => hn((e) => {
126
+ }), _n = () => gn((e) => {
126
127
  try {
127
- localStorage.setItem(Ne, e ? "hidden" : "shown");
128
+ localStorage.setItem(Me, e ? "hidden" : "shown");
128
129
  } catch {}
129
130
  return !e;
130
- }), [_n, vn] = m(() => {
131
+ }), [vn, yn] = m(() => {
131
132
  try {
132
- return localStorage.getItem(je) === "shown";
133
+ return localStorage.getItem(Ae) === "shown";
133
134
  } catch {
134
135
  return !1;
135
136
  }
136
- }), yn = () => vn((e) => {
137
+ }), bn = () => yn((e) => {
137
138
  try {
138
- localStorage.setItem(je, e ? "hidden" : "shown");
139
+ localStorage.setItem(Ae, e ? "hidden" : "shown");
139
140
  } catch {}
140
141
  return !e;
141
- }), [bn, xn] = m("assignees"), Sn = f(() => fe(S.breakdown), [S.breakdown]), Cn = (e) => C(s(S, "breakdown", ue(e) ?? ""), !0), wn = le(Sn) > 0, P = !M && !wn && !S.status && Xe.includes(j) && n.includes(A) ? j : void 0, F = Et({
142
- ...r(y, tn),
143
- placeholderData: Tt,
144
- enabled: nn && (!P || N)
145
- }), { hasNextPage: Tn, isFetchingNextPage: En, fetchNextPage: Dn } = F, On = !P || N;
146
- d(() => {
147
- On && Tn && !En && !F.error && Dn();
142
+ }), [xn, Sn] = m("assignees"), Cn = f(() => ue(S.breakdown), [S.breakdown]), wn = (e) => C(l(S, "breakdown", ce(e) ?? ""), !0), Tn = se(Cn) > 0, P = !M && !Tn && !S.status && Ye.includes(j) && n.includes(A) ? j : void 0, F = Dt({
143
+ ...r(y, nn),
144
+ placeholderData: Et,
145
+ enabled: rn && (!P || N)
146
+ }), { hasNextPage: En, isFetchingNextPage: Dn, fetchNextPage: On } = F, kn = !P || N;
147
+ Ct(() => {
148
+ kn && En && !Dn && !F.error && On();
148
149
  }, [
149
- On,
150
- Tn,
150
+ kn,
151
151
  En,
152
+ Dn,
152
153
  F.error,
153
- Dn
154
+ On
154
155
  ]);
155
156
  let I = v({
156
157
  ...t(y, st(S), P ?? "status"),
157
- placeholderData: Tt,
158
- enabled: nn && !!P
159
- }), L = Ze(y, tn, P ?? "status", A, I.data?.byKey, nn && !!P), kn = P ? I.data : F.data, An = P ? I.error ?? L.error : F.error, jn = P ? I.isFetching : F.isFetching, R = P ? L.fetching : !!Tn, z = P ? L.complete : !Tn, Mn = f(() => F.data?.pages.flatMap((e) => e.issues) ?? [], [F.data]), B = f(() => P ? [...L.issues.values()].flat() : Mn, [
158
+ placeholderData: Et,
159
+ enabled: rn && !!P
160
+ }), L = Xe(y, nn, P ?? "status", A, I.data?.byKey, rn && !!P), R = P ? I.data : F.data, An = P ? I.error ?? L.error : F.error, jn = P ? I.isFetching : F.isFetching, z = P ? L.fetching : !!En, B = P ? L.complete : !En, Mn = f(() => F.data?.pages.flatMap((e) => e.issues) ?? [], [F.data]), V = f(() => P ? [...L.issues.values()].flat() : Mn, [
160
161
  P,
161
162
  L.issues,
162
163
  Mn
163
164
  ]), { data: Nn } = v({
164
- ...te(y),
165
+ ...o(y),
165
166
  enabled: P === "project"
166
- }), Pn = wn ? B.filter((e) => de(e, Sn)) : B, Fn = f(() => Re(We(Pn, A, O), j, {
167
- status: (e) => u(`groups.${e}`),
168
- priority: (e) => rn[e] ?? "",
169
- person: an,
170
- avatar: on,
167
+ }), Pn = Tn ? V.filter((e) => le(e, Cn)) : V, Fn = f(() => Le(Ue(Pn, A, O), j, {
168
+ status: (e) => d(`groups.${e}`),
169
+ priority: (e) => an[e] ?? "",
170
+ person: on,
171
+ avatar: sn,
171
172
  none: {
172
- assignee: u("noAssignee"),
173
- project: u("noProject"),
174
- label: u("noLabel"),
175
- all: u("all")
173
+ assignee: d("noAssignee"),
174
+ project: d("noProject"),
175
+ label: d("noLabel"),
176
+ all: d("all")
176
177
  },
177
178
  noField: (e) => k("noField", { name: e }),
178
179
  yes: k("yes"),
179
- noType: cn("noType")
180
- }, M || !!P, O, un), [
180
+ noType: ln("noType")
181
+ }, M || !!P, O, dn), [
181
182
  P,
182
183
  Pn,
183
184
  A,
184
185
  j,
185
- u,
186
+ d,
186
187
  k,
187
- cn,
188
- rn,
188
+ ln,
189
189
  an,
190
190
  on,
191
+ sn,
191
192
  M,
192
193
  O,
193
- un
194
- ]), V = f(() => {
194
+ dn
195
+ ]), H = f(() => {
195
196
  if (!P) return Fn;
196
197
  let e = I.data?.byKey, t = Fn;
197
198
  if (P === "project") {
@@ -212,87 +213,87 @@ function Ht({ person: o } = {}) {
212
213
  I.data,
213
214
  Nn,
214
215
  L.more
215
- ]), H = f(() => V.flatMap((e) => e.issues), [V]), In = f(() => new Map(H.map((e, t) => [e.id, t])), [H]), Ln = !wn && !S.status ? Mt[j] : void 0, { data: Rn } = v({
216
+ ]), U = f(() => H.flatMap((e) => e.issues), [H]), In = f(() => new Map(U.map((e, t) => [e.id, t])), [U]), Ln = !Tn && !S.status ? Nt[j] : void 0, { data: Rn } = v({
216
217
  ...t(y, st(S), Ln ?? "status"),
217
- enabled: R && !!Ln
218
- }), zn = St((e) => P ? I.data?.byKey.get(e.key) ?? e.issues.length : R && Rn?.byKey.get(e.key) || e.issues.length, [
218
+ enabled: z && !!Ln
219
+ }), zn = St((e) => P ? I.data?.byKey.get(e.key) ?? e.issues.length : z && Rn?.byKey.get(e.key) || e.issues.length, [
219
220
  P,
220
221
  I.data,
221
- R,
222
+ z,
222
223
  Rn
223
- ]), Bn = f(() => new Map(w.map((e) => [e.id, e])), [w]), [Vn, Hn] = m(0), U = H[Math.min(Vn, H.length - 1)], [W, G] = m(/* @__PURE__ */ new Set()), Un = p(null), Wn = Ke(y), Gn = Te(y, w), { people: Kn } = Je(), qn = f(() => {
224
+ ]), Bn = f(() => new Map(w.map((e) => [e.id, e])), [w]), [Vn, Hn] = m(0), W = U[Math.min(Vn, U.length - 1)], [G, K] = m(/* @__PURE__ */ new Set()), Un = p(null), Wn = Ge(y), Gn = Ce(y, w), { people: Kn } = qe(), qn = f(() => {
224
225
  let e = /* @__PURE__ */ new Map();
225
226
  for (let t of Kn) {
226
- if (!t.identifier || t.username === Yt?.user.username) continue;
227
+ if (!t.identifier || t.username === Xt?.user.username) continue;
227
228
  let n = e.get(t.identifier) ?? /* @__PURE__ */ new Set();
228
229
  n.add(t.username), e.set(t.identifier, n);
229
230
  }
230
231
  return new Map([...e].map(([e, t]) => [e, [...t]]));
231
- }, [Kn, Yt?.user.username]), Jn = yt(), Yn = f(() => H.filter((e) => W.has(e.id)), [H, W]);
232
- $e(Yn);
233
- let Xn = (e) => G((t) => {
232
+ }, [Kn, Xt?.user.username]), Jn = yt(), Yn = f(() => U.filter((e) => G.has(e.id)), [U, G]);
233
+ Qe(Yn);
234
+ let Xn = (e) => K((t) => {
234
235
  let n = new Set(t);
235
236
  return n.has(e) ? n.delete(e) : n.add(e), n;
236
237
  }), Zn = (e) => {
237
- (Un.current === null || W.size === 0) && (Un.current = Math.max(Vn, 0));
238
+ (Un.current === null || G.size === 0) && (Un.current = Math.max(Vn, 0));
238
239
  let t = Un.current, [n, r] = t < e ? [t, e] : [e, t];
239
- G(new Set(H.slice(n, r + 1).map((e) => e.id)));
240
- }, K = (e, t) => {
241
- let n = H[e];
240
+ K(new Set(U.slice(n, r + 1).map((e) => e.id)));
241
+ }, Qn = (e, t) => {
242
+ let n = U[e];
242
243
  if (n) {
243
244
  if (t) return Zn(e);
244
245
  Xn(n.id), Un.current = e;
245
246
  }
246
- }, Qn = (e, t) => {
247
- (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), K(t, e.shiftKey));
247
+ }, $n = (e, t) => {
248
+ (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), Qn(t, e.shiftKey));
248
249
  }, q = (e, t) => {
249
- let n = Math.min(Math.max(Vn + e, 0), H.length - 1);
250
+ let n = Math.min(Math.max(Vn + e, 0), U.length - 1);
250
251
  t && Zn(n), Hn(n);
251
- }, $n = (e, t) => {
252
- let n = W.has(t.id) ? H.filter((e) => W.has(e.id)) : [t];
253
- W.has(t.id) || G(/* @__PURE__ */ new Set()), Jn(e, Wn(n));
254
- }, er = p({
255
- pick: K,
252
+ }, er = (e, t) => {
253
+ let n = G.has(t.id) ? U.filter((e) => G.has(e.id)) : [t];
254
+ G.has(t.id) || K(/* @__PURE__ */ new Set()), Jn(e, Wn(n));
255
+ }, tr = p({
256
+ pick: Qn,
256
257
  select: Hn,
257
- click: Qn,
258
- menu: $n
258
+ click: $n,
259
+ menu: er
259
260
  });
260
- er.current = {
261
- pick: K,
261
+ tr.current = {
262
+ pick: Qn,
262
263
  select: Hn,
263
- click: Qn,
264
- menu: $n
264
+ click: $n,
265
+ menu: er
265
266
  };
266
- let [J, tr] = m(!1);
267
- d(() => {
268
- J && (z || An) && (G(new Set(H.map((e) => e.id))), tr(!1));
267
+ let [J, nr] = m(!1);
268
+ Ct(() => {
269
+ J && (B || An) && (K(new Set(U.map((e) => e.id))), nr(!1));
269
270
  }, [
270
271
  J,
271
- z,
272
+ B,
272
273
  An,
273
- H
274
+ U
274
275
  ]);
275
- let { data: nr } = v({
276
+ let { data: rr } = v({
276
277
  ...t(y, st(S), "status"),
277
278
  enabled: J
278
- }), rr = () => {
279
- G(new Set(H.map((e) => e.id))), P && L.loadAll(), tr(!z);
280
- }, ir = () => {
281
- G(/* @__PURE__ */ new Set()), tr(!1);
282
- }, ar = p(null), or = (e) => {
279
+ }), ir = () => {
280
+ K(new Set(U.map((e) => e.id))), P && L.loadAll(), nr(!B);
281
+ }, ar = () => {
282
+ K(/* @__PURE__ */ new Set()), nr(!1);
283
+ }, or = p(null), sr = (e) => {
283
284
  if (J) return;
284
- let t = W.size > 0 ? Yn : U ? [U] : [];
285
+ let t = G.size > 0 ? Yn : W ? [W] : [];
285
286
  if (t.length === 0) return;
286
287
  let n = Wn(t).find((t) => "shortcut" in t && t.shortcut === e);
287
288
  return n && "label" in n && !n.disabled ? n : void 0;
288
289
  }, Y = (e) => () => {
289
- let t = or(e), n = W.size > 0 && ar.current || U && document.getElementById(`row-${U.id}`);
290
+ let t = sr(e), n = G.size > 0 && or.current || W && document.getElementById(`row-${W.id}`);
290
291
  t && "items" in t && t.items && n && Jn(n, t.items);
291
- }, [sr, cr] = m(null), lr = () => {
292
- let e = or("⌫");
293
- e && "onClick" in e && cr(() => e.onClick);
292
+ }, [cr, lr] = m(null), ur = () => {
293
+ let e = sr("⌫");
294
+ e && "onClick" in e && lr(() => e.onClick);
294
295
  };
295
- ot({
296
+ at({
296
297
  ...!M && {
297
298
  j: () => q(1, !1),
298
299
  k: () => q(-1, !1),
@@ -300,78 +301,87 @@ function Ht({ person: o } = {}) {
300
301
  K: () => q(-1, !0),
301
302
  ArrowDown: (e) => q(1, e.shiftKey),
302
303
  ArrowUp: (e) => q(-1, e.shiftKey),
303
- x: () => U && K(H.indexOf(U), !1),
304
- X: () => U && K(H.indexOf(U), !0),
305
- "Mod+a": rr,
306
- "Shift+Mod+a": ir,
304
+ x: () => W && Qn(U.indexOf(W), !1),
305
+ X: () => W && Qn(U.indexOf(W), !0),
306
+ "Mod+a": ir,
307
+ "Shift+Mod+a": ar,
307
308
  s: Y("S"),
308
309
  p: Y("P"),
309
310
  a: Y("A"),
310
311
  l: Y("L"),
311
312
  m: Y("M"),
312
313
  d: Y("D"),
313
- Backspace: lr,
314
- Delete: lr,
315
- Enter: () => U && Gt({
314
+ Backspace: ur,
315
+ Delete: ur,
316
+ Enter: () => W && Kt({
316
317
  to: "/$workspace/issues/$identifier",
317
318
  params: {
318
319
  workspace: y,
319
- identifier: U.identifier
320
+ identifier: W.identifier
320
321
  }
321
322
  })
322
323
  },
323
- Escape: ir,
324
- "/": () => $t.current?.focus()
325
- }), d(() => {
324
+ Escape: ar,
325
+ "/": () => en.current?.focus()
326
+ }), Ct(() => {
326
327
  let e = (e) => {
327
- (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), $t.current?.focus(), $t.current?.select());
328
+ (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), en.current?.focus(), en.current?.select());
328
329
  };
329
330
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
330
331
  }, []);
331
- let ur = p(null), X = w.find((e) => e.key === S.team), dr = pe(y, S, (e) => C(me(S, e), !0), !!b && !S.assignee && !S.creator && !S.saved && !S.scope), fr = c(y, { ...s(S, "q", void 0) }), { views: pr, create: mr, update: hr } = lt(y), Z = pr.find((e) => nt(e, S.saved)), { data: gr = [] } = v({
332
- ...a(y, S.team ?? ""),
333
- enabled: !!b && !o
334
- }), _r = ut(y), { data: vr } = v(i(y)), { data: yr } = v(te(y)), { data: br } = v({
332
+ let dr = p(null), X = w.find((e) => e.key === S.team), fr = de(y, S, (e) => C(fe(S, e), !0), !!b && !S.assignee && !S.creator && !S.saved && !S.scope), pr = ot(y, { ...l(S, "q", void 0) }), { views: mr, create: hr, update: gr } = lt(y), Z = mr.find((e) => tt(e, S.saved)), { data: _r = [] } = v({
333
+ ...s(y, S.team ?? ""),
334
+ enabled: !!b && !c
335
+ }), vr = ut(y), { data: yr } = v(i(y)), { data: br } = v(o(y)), { data: xr } = v({
335
336
  ...e(y, X?.key ?? ""),
336
337
  enabled: !!X
337
338
  });
338
- d(() => {
339
- let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...S }, n = vr?.find((e) => e.id === S.label);
339
+ Ct(() => {
340
+ let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...S }, n = yr?.find((e) => e.id === S.label);
340
341
  S.label && e.test(S.label) && n && (t.label = n.name);
341
- let r = yr?.find((e) => e.id === S.project);
342
- S.project && e.test(S.project) && r && (t.project = tt(r));
343
- let i = br?.find((e) => String(e.number) === S.cycle);
344
- i && (t.cycle = i.id), S.saved && e.test(S.saved) && Z && (t.saved = rt(Z)), JSON.stringify(t) !== JSON.stringify(S) && qt.current(t);
342
+ let r = br?.find((e) => e.id === S.project);
343
+ S.project && e.test(S.project) && r && (t.project = et(r));
344
+ let i = xr?.find((e) => String(e.number) === S.cycle);
345
+ i && (t.cycle = i.id), S.saved && e.test(S.saved) && Z && (t.saved = nt(Z));
346
+ let a = ue(S.breakdown), o = we(a, {
347
+ ...yr && { labels: new Set(yr.map((e) => e.id)) },
348
+ ...br && { projects: new Set(br.map((e) => e.id)) }
349
+ });
350
+ if (o !== a) {
351
+ let e = ce(o);
352
+ e ? t.breakdown = e : delete t.breakdown;
353
+ }
354
+ JSON.stringify(t) !== JSON.stringify(S) && Jt.current(t);
345
355
  }, [
346
356
  S,
347
- vr,
348
357
  yr,
349
358
  br,
359
+ xr,
350
360
  Z
351
361
  ]);
352
- let xr = st({
362
+ let Sr = st({
353
363
  ...S,
354
364
  ...A !== "updated" && { order: A },
355
365
  ...j !== "status" && { group: j },
356
366
  ...M && { layout: "board" }
357
- }), Sr = Z && {
367
+ }), Cr = Z && {
358
368
  ...S.team && { team: S.team },
359
369
  ...Z.filters
360
- }, Cr = Sr ? !ct(Sr, xr) : Object.keys(xr).length > 0, wr = it(y, "save_views"), [Tr, Er] = m(!1), Q = h("savedViews"), $ = Yt?.user.username, Dr = !Z && !X && (!S.assigneeKind && S.assignee === $ && !S.creator || S.creator === $ && !S.assignee), Or = o ?? (Dr ? $ : void 0), kr = Z?.name ?? X?.name ?? (o && o !== $ ? u("personIssues", { name: an("user", o) }) : !S.assigneeKind && S.assignee === $ || S.creator === $ ? u("mine") : u("all")), Ar = h("workspace");
361
- Qe(...X && !Z ? [Ar("issues"), X.name] : [kr]);
362
- let jr = Ct(Rt, Lt), Mr = Bt(b && !o ? gr : [], Z, jr ? +!!Z : Ft), Nr = Cr && /* @__PURE__ */ _(wt, { children: [Z?.canEdit && /* @__PURE__ */ g(l, {
370
+ }, wr = Cr ? !ct(Cr, Sr) : Object.keys(Sr).length > 0, Tr = rt(y, "save_views"), [Er, Dr] = m(!1), Q = h("savedViews"), $ = Xt?.user.username, Or = !Z && !X && (!S.assigneeKind && S.assignee === $ && !S.creator || S.creator === $ && !S.assignee), kr = c ?? (Or ? $ : void 0), Ar = Z?.name ?? X?.name ?? (c && c !== $ ? d("personIssues", { name: on("user", c) }) : !S.assigneeKind && S.assignee === $ || S.creator === $ ? d("mine") : d("all")), jr = h("workspace");
371
+ Ze(...X && !Z ? [jr("issues"), X.name] : [Ar]);
372
+ let Mr = wt(zt, Rt), Nr = Vt(b && !c ? _r : [], Z, Mr ? +!!Z : It), Pr = wr && /* @__PURE__ */ _(Tt, { children: [Z?.canEdit && /* @__PURE__ */ g(u, {
363
373
  type: "button",
364
374
  size: "sm",
365
- loading: hr.isPending,
366
- onClick: () => hr.mutate({
375
+ loading: gr.isPending,
376
+ onClick: () => gr.mutate({
367
377
  id: Z.id,
368
- filters: Z.filters.team ? xr : Pt(xr)
378
+ filters: Z.filters.team ? Sr : Ft(Sr)
369
379
  }),
370
380
  children: Q("update")
371
- }), /* @__PURE__ */ g(l, {
381
+ }), /* @__PURE__ */ g(u, {
372
382
  type: "button",
373
383
  size: "sm",
374
- onClick: () => Er(!0),
384
+ onClick: () => Dr(!0),
375
385
  children: Q(Z ? "saveAsNew" : "save")
376
386
  })] });
377
387
  return /* @__PURE__ */ _("div", {
@@ -382,138 +392,138 @@ function Ht({ person: o } = {}) {
382
392
  children: [
383
393
  /* @__PURE__ */ g("h1", {
384
394
  className: "text-sm font-semibold whitespace-nowrap",
385
- children: kr
395
+ children: Ar
386
396
  }),
387
- /* @__PURE__ */ g(ae, {
397
+ /* @__PURE__ */ g(re, {
388
398
  workspace: y,
389
399
  kind: "view",
390
- target: fr,
391
- label: T === "active" ? kr : u("favoriteLabel", {
392
- title: kr,
393
- view: u(`views.${T}`)
400
+ target: pr,
401
+ label: T === "active" ? Ar : d("favoriteLabel", {
402
+ title: Ar,
403
+ view: d(`views.${T}`)
394
404
  })
395
405
  }),
396
- Or && /* @__PURE__ */ g(vt, {
406
+ kr && /* @__PURE__ */ g(vt, {
397
407
  variant: "segmented",
398
408
  size: "sm",
399
- label: u("mineScope"),
409
+ label: d("mineScope"),
400
410
  items: ["assigned", "created"].map((e) => ({
401
411
  value: e,
402
- label: u(`mineScopes.${e}`),
403
- href: Kt({
412
+ label: d(`mineScopes.${e}`),
413
+ href: qt({
404
414
  ...S.view && { view: S.view },
405
- ...e === "assigned" ? { assignee: Or } : { creator: Or }
415
+ ...e === "assigned" ? { assignee: kr } : { creator: kr }
406
416
  })
407
417
  })),
408
418
  value: S.creator ? "created" : "assigned"
409
419
  }),
410
- Z && /* @__PURE__ */ g(jt, {
420
+ Z && /* @__PURE__ */ g(Mt, {
411
421
  visible: !0,
412
- items: () => _r.menu(Z),
413
- label: Ht("moreActionsFor", { name: Z.name })
422
+ items: () => vr.menu(Z),
423
+ label: Ut("moreActionsFor", { name: Z.name })
414
424
  }),
415
425
  /* @__PURE__ */ g(vt, {
416
426
  variant: "segmented",
417
427
  size: "sm",
418
- label: u("view"),
419
- items: [...Object.keys(Ge).map((e) => ({
428
+ label: d("view"),
429
+ items: [...Object.keys(We).map((e) => ({
420
430
  value: e,
421
- label: u(`views.${e}`),
422
- href: Kt(Z ? {
431
+ label: d(`views.${e}`),
432
+ href: qt(Z ? {
423
433
  ...S.team && { team: S.team },
424
434
  ...e !== "active" && { view: e }
425
- } : s(S, "view", e === "active" ? void 0 : e))
426
- })), ...Mr.shown.map((e) => ({
427
- value: zt(e),
435
+ } : l(S, "view", e === "active" ? void 0 : e))
436
+ })), ...Nr.shown.map((e) => ({
437
+ value: Bt(e),
428
438
  label: e.name,
429
- href: c(y, {
439
+ href: ot(y, {
430
440
  ...dt(e),
431
441
  team: e.filters.team ?? S.team
432
442
  })
433
443
  }))],
434
- value: Z ? zt(Z) : T,
444
+ value: Z ? Bt(Z) : T,
435
445
  className: "max-w-full flex-wrap",
436
- end: Mr.more.length > 0 && /* @__PURE__ */ g(ft, {
446
+ end: Nr.more.length > 0 && /* @__PURE__ */ g(ft, {
437
447
  label: Q("title"),
438
- items: Mr.more.map((e) => ({
448
+ items: Nr.more.map((e) => ({
439
449
  label: e.name,
440
- href: c(y, {
450
+ href: ot(y, {
441
451
  ...dt(e),
442
452
  team: e.filters.team ?? S.team
443
453
  })
444
454
  })),
445
- trigger: /* @__PURE__ */ g(l, {
455
+ trigger: /* @__PURE__ */ g(u, {
446
456
  size: "sm",
447
457
  variant: "ghost",
448
- children: Q("more", { count: Mr.more.length })
458
+ children: Q("more", { count: Nr.more.length })
449
459
  })
450
460
  })
451
461
  }),
452
462
  /* @__PURE__ */ _("div", {
453
463
  className: "flex w-full min-w-0 flex-wrap items-center gap-2 md:ml-auto md:w-auto md:flex-nowrap",
454
464
  children: [
455
- dr.count === 0 && Nr,
465
+ fr.count === 0 && Pr,
456
466
  /* @__PURE__ */ g(gt, {
457
- ref: $t,
458
- value: Zt,
459
- onValueChange: Qt,
460
- onKeyDown: (e) => e.key === "Escape" && !Zt && e.currentTarget.blur(),
461
- placeholder: u("search"),
462
- label: u("search"),
467
+ ref: en,
468
+ value: Qt,
469
+ onValueChange: $t,
470
+ onKeyDown: (e) => e.key === "Escape" && !Qt && e.currentTarget.blur(),
471
+ placeholder: d("search"),
472
+ label: d("search"),
463
473
  "aria-keyshortcuts": "/ Meta+F Control+F",
464
474
  size: "sm",
465
475
  className: "min-w-0 flex-1 max-md:order-first max-md:basis-full md:w-56 md:flex-initial"
466
476
  }),
467
- /* @__PURE__ */ g(kt, { filters: dr }),
468
- /* @__PURE__ */ _(ie, {
477
+ /* @__PURE__ */ g(At, { filters: fr }),
478
+ /* @__PURE__ */ _(ne, {
469
479
  layouts: [{
470
480
  value: "list",
471
- label: u("layouts.list"),
472
- icon: /* @__PURE__ */ g(be, {})
481
+ label: d("layouts.list"),
482
+ icon: /* @__PURE__ */ g(ve, {})
473
483
  }, {
474
484
  value: "board",
475
- label: u("layouts.board"),
476
- icon: /* @__PURE__ */ g(_e, {})
485
+ label: d("layouts.board"),
486
+ icon: /* @__PURE__ */ g(he, {})
477
487
  }],
478
488
  layout: M ? "board" : "list",
479
489
  onLayoutChange: (e) => {
480
- Fe({ layout: e }), C(s(S, "layout", e === "board" ? "board" : void 0));
490
+ Pe({ layout: e }), C(l(S, "layout", e === "board" ? "board" : void 0));
481
491
  },
482
492
  changed: A !== "updated" || j !== "status" || M,
483
493
  children: [
484
494
  /* @__PURE__ */ g(mt, {
485
- label: u("orderBy"),
495
+ label: d("orderBy"),
486
496
  children: /* @__PURE__ */ g(_t, {
487
497
  value: A,
488
- items: [...Ue.map((e) => ({
498
+ items: [...He.map((e) => ({
489
499
  value: e,
490
- label: u(`order.${e}`)
491
- })), ...O.filter((e) => Ae.includes(e.kind)).map((e) => ({
500
+ label: d(`order.${e}`)
501
+ })), ...O.filter((e) => ke.includes(e.kind)).map((e) => ({
492
502
  value: `field:${e.id}`,
493
503
  label: e.name
494
504
  }))],
495
505
  onValueChange: (e) => {
496
- Fe({ order: e }), C(s(S, "order", e === "updated" ? void 0 : e));
506
+ Pe({ order: e }), C(l(S, "order", e === "updated" ? void 0 : e));
497
507
  },
498
- "aria-label": u("orderBy"),
508
+ "aria-label": d("orderBy"),
499
509
  size: "sm"
500
510
  })
501
511
  }),
502
512
  /* @__PURE__ */ g(mt, {
503
- label: u("groupBy"),
513
+ label: d("groupBy"),
504
514
  children: /* @__PURE__ */ g(_t, {
505
515
  value: j,
506
- items: [...ze.map((e) => ({
516
+ items: [...Re.map((e) => ({
507
517
  value: e,
508
- label: u(`grouping.${e}`)
509
- })), ...O.filter((e) => ke.includes(e.kind)).map((e) => ({
518
+ label: d(`grouping.${e}`)
519
+ })), ...O.filter((e) => Oe.includes(e.kind)).map((e) => ({
510
520
  value: `field:${e.id}`,
511
521
  label: e.name
512
522
  }))],
513
523
  onValueChange: (e) => {
514
- Fe({ group: e }), C(s(S, "group", e === "status" ? void 0 : e));
524
+ Pe({ group: e }), C(l(S, "group", e === "status" ? void 0 : e));
515
525
  },
516
- "aria-label": u("groupBy"),
526
+ "aria-label": d("groupBy"),
517
527
  size: "sm"
518
528
  })
519
529
  }),
@@ -521,13 +531,13 @@ function Ht({ person: o } = {}) {
521
531
  label: k("onRows"),
522
532
  children: /* @__PURE__ */ g(_t, {
523
533
  multiple: !0,
524
- value: fn.filter((e) => O.some((t) => t.id === e)),
534
+ value: pn.filter((e) => O.some((t) => t.id === e)),
525
535
  items: O.map((e) => ({
526
536
  value: e.id,
527
537
  label: e.name
528
538
  })),
529
539
  onValueChange: (e) => {
530
- Ie(y, e), pn(e);
540
+ Fe(y, e), mn(e);
531
541
  },
532
542
  placeholder: k("noneOnRows"),
533
543
  "aria-label": k("onRows"),
@@ -539,191 +549,191 @@ function Ht({ person: o } = {}) {
539
549
  /* @__PURE__ */ g(ht, {
540
550
  variant: "secondary",
541
551
  size: "sm",
542
- icon: /* @__PURE__ */ g(xe, { className: "size-3.5" }),
543
- label: u(N ? "hidePanel" : "showPanel"),
552
+ icon: /* @__PURE__ */ g(ye, { className: "size-3.5" }),
553
+ label: d(N ? "hidePanel" : "showPanel"),
544
554
  "aria-pressed": N,
545
- onClick: gn,
555
+ onClick: _n,
546
556
  className: "max-xl:hidden"
547
557
  }),
548
558
  /* @__PURE__ */ g(ht, {
549
559
  variant: "secondary",
550
560
  size: "sm",
551
- icon: /* @__PURE__ */ g(ve, { className: "size-3.5" }),
552
- label: u(_n ? "hideInsights" : "showInsights"),
553
- "aria-pressed": _n,
554
- onClick: yn
561
+ icon: /* @__PURE__ */ g(ge, { className: "size-3.5" }),
562
+ label: d(vn ? "hideInsights" : "showInsights"),
563
+ "aria-pressed": vn,
564
+ onClick: bn
555
565
  })
556
566
  ]
557
567
  })
558
568
  ]
559
569
  }),
560
- /* @__PURE__ */ g(Ot, {
561
- filters: dr,
562
- trailing: Nr,
570
+ /* @__PURE__ */ g(kt, {
571
+ filters: fr,
572
+ trailing: Pr,
563
573
  className: "shrink-0 border-b border-border px-4 py-2 md:px-5"
564
574
  }),
565
- _n && /* @__PURE__ */ g(ge, {
575
+ vn && /* @__PURE__ */ g(me, {
566
576
  workspace: y,
567
577
  issues: Pn
568
578
  }),
569
- Tr && /* @__PURE__ */ g(we, {
579
+ Er && /* @__PURE__ */ g(Se, {
570
580
  title: Q("saveTitle"),
571
581
  submitLabel: Q("save"),
572
- share: { allowed: wr },
573
- onClose: () => Er(!1),
582
+ share: { allowed: Tr },
583
+ onClose: () => Dr(!1),
574
584
  onSubmit: async ({ name: e, shared: t }) => {
575
- let n = await mr.mutateAsync({
585
+ let n = await hr.mutateAsync({
576
586
  name: e,
577
587
  shared: t,
578
- filters: xr
588
+ filters: Sr
579
589
  });
580
590
  C(dt(n), !0);
581
591
  }
582
592
  }),
583
593
  /* @__PURE__ */ g(pt, {
584
- open: !!sr,
585
- onClose: () => cr(null),
594
+ open: !!cr,
595
+ onClose: () => lr(null),
586
596
  onConfirm: () => {
587
- sr?.(), cr(null), ir();
597
+ cr?.(), lr(null), ar();
588
598
  },
589
- title: u("archiveTitle", { count: W.size || 1 }),
590
- description: u("archiveDescription"),
591
- confirmLabel: u("archiveConfirm"),
599
+ title: d("archiveTitle", { count: G.size || 1 }),
600
+ description: d("archiveDescription"),
601
+ confirmLabel: d("archiveConfirm"),
592
602
  destructive: !0
593
603
  }),
594
604
  /* @__PURE__ */ _("div", {
595
605
  className: "relative flex min-h-0 flex-1",
596
606
  children: [
597
- W.size > 0 && /* @__PURE__ */ _("div", {
598
- ref: ar,
607
+ G.size > 0 && /* @__PURE__ */ _("div", {
608
+ ref: or,
599
609
  role: "toolbar",
600
- "aria-label": u("selected", { count: W.size }),
610
+ "aria-label": d("selected", { count: G.size }),
601
611
  className: "absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-1 rounded-xl border border-border bg-popover py-1 pr-1 pl-3 text-sm shadow-md",
602
612
  children: [
603
613
  /* @__PURE__ */ g("span", {
604
614
  className: "whitespace-nowrap tabular-nums",
605
- children: J ? nr ? u("selectingAll", { count: nr.total }) : u("selectingAllUncounted") : u("selected", { count: W.size })
615
+ children: J ? rr ? d("selectingAll", { count: rr.total }) : d("selectingAllUncounted") : d("selected", { count: G.size })
606
616
  }),
607
- !J && (W.size < H.length || !z) && /* @__PURE__ */ g(l, {
617
+ !J && (G.size < U.length || !B) && /* @__PURE__ */ g(u, {
608
618
  size: "sm",
609
619
  variant: "ghost",
610
620
  className: "shrink-0",
611
- onClick: rr,
612
- children: z ? u("selectAll", { count: H.length }) : u("selectAllMatching")
621
+ onClick: ir,
622
+ children: B ? d("selectAll", { count: U.length }) : d("selectAllMatching")
613
623
  }),
614
624
  /* @__PURE__ */ g(ft, {
615
- label: u("actions"),
625
+ label: d("actions"),
616
626
  items: Wn(Yn),
617
627
  side: "top",
618
- trigger: /* @__PURE__ */ g(l, {
628
+ trigger: /* @__PURE__ */ g(u, {
619
629
  size: "sm",
620
630
  variant: "outline",
621
631
  className: "shrink-0",
622
- children: u("actions")
632
+ children: d("actions")
623
633
  })
624
634
  }),
625
635
  /* @__PURE__ */ g(ht, {
626
636
  size: "sm",
627
637
  variant: "ghost",
628
- icon: /* @__PURE__ */ g(ye, {}),
629
- label: u("clear"),
630
- onClick: ir
638
+ icon: /* @__PURE__ */ g(_e, {}),
639
+ label: d("clear"),
640
+ onClick: ar
631
641
  })
632
642
  ]
633
643
  }),
634
644
  /* @__PURE__ */ _("div", {
635
- ref: ur,
636
- className: `min-h-0 min-w-0 flex-1 ${M ? "overflow-hidden" : "overflow-y-auto"} ${W.size > 0 ? "pb-16" : ""} transition-opacity ${jn && !kn ? "opacity-50" : ""}`,
645
+ ref: dr,
646
+ className: `min-h-0 min-w-0 flex-1 ${M ? "overflow-hidden" : "overflow-y-auto"} ${G.size > 0 ? "pb-16" : ""} transition-opacity ${jn && !R ? "opacity-50" : ""}`,
637
647
  children: [
638
- /* @__PURE__ */ g(se, {
648
+ /* @__PURE__ */ g(ae, {
639
649
  workspace: y,
640
650
  issues: Mn,
641
- tabs: Me,
642
- focus: Sn,
643
- onFocus: Cn,
651
+ tabs: je,
652
+ focus: Cn,
653
+ onFocus: wn,
644
654
  className: "border-b border-border px-5 py-1.5"
645
655
  }),
646
- M && kn && /* @__PURE__ */ g(oe, {
656
+ M && R && /* @__PURE__ */ g(ie, {
647
657
  workspace: y,
648
- columns: j === "status" && Ge[T].categories.length > 0 ? V.filter((e) => e.issues.length > 0 || e.key === "completed" || Ge[T].categories.includes(e.key)) : V,
649
- onMove: j === "none" ? void 0 : (e, t, n) => Gn(e, j, t, n, V.find((e) => e.key === n)?.issues[0], dn),
650
- onContextMenu: $n
658
+ columns: j === "status" && We[T].categories.length > 0 ? H.filter((e) => e.issues.length > 0 || e.key === "completed" || We[T].categories.includes(e.key)) : H,
659
+ onMove: j === "none" ? void 0 : (e, t, n) => Gn(e, j, t, n, H.find((e) => e.key === n)?.issues[0], fn),
660
+ onContextMenu: er
651
661
  }),
652
- !M && /* @__PURE__ */ g(he, {
653
- groups: V,
662
+ !M && /* @__PURE__ */ g(pe, {
663
+ groups: H,
654
664
  count: zn,
655
- scrollRef: ur,
656
- keepInView: U?.id,
665
+ scrollRef: dr,
666
+ keepInView: W?.id,
657
667
  onMore: L.loadMore,
658
- moreLabel: Ht("loading"),
659
- renderRow: (e, t) => /* @__PURE__ */ g(Ut, {
668
+ moreLabel: Ut("loading"),
669
+ renderRow: (e, t) => /* @__PURE__ */ g(Wt, {
660
670
  issue: e,
661
671
  index: In.get(e.id) ?? -1,
662
672
  place: t,
663
673
  team: Bn.get(e.teamId),
664
674
  workspace: y,
665
- selected: e.id === U?.id,
666
- picked: W.has(e.id),
667
- viewers: qn.get(e.identifier) ?? Nt,
668
- fields: mn,
669
- actions: er
675
+ selected: e.id === W?.id,
676
+ picked: G.has(e.id),
677
+ viewers: qn.get(e.identifier) ?? Pt,
678
+ fields: hn,
679
+ actions: tr
670
680
  }, e.id)
671
681
  }),
672
- kn && R && /* @__PURE__ */ g("p", {
682
+ R && z && /* @__PURE__ */ g("p", {
673
683
  className: "flex h-10 items-center gap-2 px-5 text-xs text-muted-foreground",
674
684
  role: "status",
675
- children: Rn ? u("loadingCount", {
676
- loaded: B.length,
685
+ children: Rn ? d("loadingCount", {
686
+ loaded: V.length,
677
687
  total: Rn.total
678
- }) : u("loadingMore", { loaded: B.length })
688
+ }) : d("loadingMore", { loaded: V.length })
679
689
  }),
680
- !kn && (An ? /* @__PURE__ */ g(Ce, { error: An }) : /* @__PURE__ */ g(At, { rows: 8 })),
681
- kn && !R && B.length === 0 && /* @__PURE__ */ g(Wt, {
690
+ !R && (An ? /* @__PURE__ */ g(xe, { error: An }) : /* @__PURE__ */ g(jt, { rows: 8 })),
691
+ R && !z && V.length === 0 && /* @__PURE__ */ g(Gt, {
682
692
  workspace: y,
683
- filtered: !!S.q || T !== "active" || dr.count > +!!b,
684
- onCreate: () => Xt(S.team ? { team: S.team } : void 0)
693
+ filtered: !!S.q || T !== "active" || fr.count > +!!b,
694
+ onCreate: () => Zt(S.team ? { team: S.team } : void 0)
685
695
  })
686
696
  ]
687
697
  }),
688
698
  N && F.data && /* @__PURE__ */ g("aside", {
689
- "aria-label": It("issueBreakdown.label"),
699
+ "aria-label": Lt("issueBreakdown.label"),
690
700
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-4 xl:block",
691
- children: /* @__PURE__ */ g(ce, {
701
+ children: /* @__PURE__ */ g(oe, {
692
702
  workspace: y,
693
703
  issues: Mn,
694
- tabs: Me,
695
- tab: bn,
696
- onTabChange: xn,
697
- focus: Sn,
698
- onFocus: Cn
704
+ tabs: je,
705
+ tab: xn,
706
+ onTabChange: Sn,
707
+ focus: Cn,
708
+ onFocus: wn
699
709
  })
700
710
  })
701
711
  ]
702
712
  }),
703
- _r.dialogs
713
+ vr.dialogs
704
714
  ]
705
715
  });
706
716
  }
707
- var Ut = u(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: ee, picked: te, viewers: ne, fields: re, actions: a }) {
708
- return /* @__PURE__ */ g(o, {
717
+ var Wt = d(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: a, picked: o, viewers: ee, fields: te, actions: s }) {
718
+ return /* @__PURE__ */ g(c, {
709
719
  ref: n.ref,
710
720
  style: n.style,
711
721
  index: n.index,
712
722
  issue: e,
713
723
  team: r,
714
724
  workspace: i,
715
- selected: ee,
716
- picked: te,
717
- viewers: ne,
718
- fields: re,
719
- onPick: (e) => a.current.pick(t, e),
720
- onHover: () => a.current.select(t),
721
- onClick: (e) => a.current.click(e, t),
722
- onContextMenu: (t) => a.current.menu(t, e)
725
+ selected: a,
726
+ picked: o,
727
+ viewers: ee,
728
+ fields: te,
729
+ onPick: (e) => s.current.pick(t, e),
730
+ onHover: () => s.current.select(t),
731
+ onClick: (e) => s.current.click(e, t),
732
+ onContextMenu: (t) => s.current.menu(t, e)
723
733
  });
724
734
  });
725
- function Wt({ workspace: e, filtered: t, onCreate: n }) {
726
- let r = h("issues.empty"), { data: i = [] } = v(re(e)), ee = it(e, "manage_teams");
735
+ function Gt({ workspace: e, filtered: t, onCreate: n }) {
736
+ let r = h("issues.empty"), { data: i = [] } = v(te(e)), a = rt(e, "manage_teams");
727
737
  return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ _("div", {
728
738
  className: "mx-auto max-w-sm px-4 py-24 text-center",
729
739
  children: [
@@ -735,7 +745,7 @@ function Wt({ workspace: e, filtered: t, onCreate: n }) {
735
745
  className: "mt-1 text-sm text-muted-foreground",
736
746
  children: r(t ? "tryAnother" : "pressC")
737
747
  }),
738
- !t && /* @__PURE__ */ g(l, {
748
+ !t && /* @__PURE__ */ g(u, {
739
749
  type: "button",
740
750
  variant: "primary",
741
751
  onClick: n,
@@ -752,9 +762,9 @@ function Wt({ workspace: e, filtered: t, onCreate: n }) {
752
762
  }),
753
763
  /* @__PURE__ */ g("p", {
754
764
  className: "mt-1 text-sm text-muted-foreground",
755
- children: r(ee ? "noTeamsDescription" : "noTeamsAskAdmin")
765
+ children: r(a ? "noTeamsDescription" : "noTeamsAskAdmin")
756
766
  }),
757
- ee && /* @__PURE__ */ g(l, {
767
+ a && /* @__PURE__ */ g(u, {
758
768
  type: "button",
759
769
  variant: "primary",
760
770
  onClick: n,
@@ -764,4 +774,4 @@ function Wt({ workspace: e, filtered: t, onCreate: n }) {
764
774
  ]
765
775
  });
766
776
  }
767
- export { Ht as IssueList };
777
+ export { Ut as IssueList };