@parallelworks/tandem-web 0.184.0 → 0.186.0

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.
@@ -4,45 +4,47 @@ import { invalidateIssueViews as i } from "../../../api/mutations.js";
4
4
  import { issuesQuery as a, meQuery as o, projectEventsQuery as s, projectOf as c, projectQuery as l, projectUpdatesQuery as u, projectsQuery as d, teamsQuery as f } from "../../../api/queries.js";
5
5
  import { Timeline as p, TimelineItem as m, activityIcon as h } from "../../../components/ActivityTimeline.js";
6
6
  import { ProjectFields as g } from "../../../components/CustomFields.js";
7
- import { Editor as ee } from "../../../components/Editor.js";
8
- import { EntityIcon as te } from "../../../components/EntityIcon.js";
9
- import { FavoriteStar as _ } from "../../../components/FavoriteStar.js";
10
- import { FollowButton as v } from "../../../components/FollowButton.js";
11
- import { IconUpload as y } from "../../../components/IconUpload.js";
12
- import { IssueBreakdown as b } from "../../../components/IssueBreakdown.js";
13
- import { StatusGroups as x } from "../../../components/IssueGroup.js";
14
- import { AddIcon as S, AddUserIcon as C, CalendarIcon as w, LinkIcon as T, PriorityIcon as E, ProjectIcon as ne, RemoveUserIcon as re, RenameIcon as ie, UsersIcon as D, usePriorityNames as ae } from "../../../components/icons.js";
15
- import { HealthIcon as O, ProgressBar as k, ProjectStatusIcon as A, healthOf as j } from "../../../components/Planning.js";
7
+ import { Editor as _ } from "../../../components/Editor.js";
8
+ import { EntityIcon as v } from "../../../components/EntityIcon.js";
9
+ import { FavoriteStar as y } from "../../../components/FavoriteStar.js";
10
+ import { FollowButton as b } from "../../../components/FollowButton.js";
11
+ import { IconUpload as x } from "../../../components/IconUpload.js";
12
+ import { IssueBreakdown as S } from "../../../components/IssueBreakdown.js";
13
+ import { StatusGroups as C } from "../../../components/IssueGroup.js";
14
+ import { AddIcon as w, AddUserIcon as T, CalendarIcon as E, LinkIcon as D, PriorityIcon as O, ProjectIcon as ee, RemoveUserIcon as te, RenameIcon as ne, UsersIcon as k, usePriorityNames as re } from "../../../components/icons.js";
15
+ import { NewProjectDialog as A } from "../../../components/NewProjectDialog.js";
16
+ import { ParentProjectSelect as ie } from "../../../components/ParentProjectSelect.js";
17
+ import { HealthIcon as j, ProgressBar as ae, ProjectStatusIcon as M, healthOf as N } from "../../../components/Planning.js";
16
18
  import { ProjectAccessDialog as oe } from "../../../components/ProjectAccess.js";
17
- import { Updates as M } from "../../../components/Updates.js";
19
+ import { Updates as P } from "../../../components/Updates.js";
18
20
  import { useConfirm as se } from "../../../lib/confirm.js";
19
- import { useIssuePicker as ce } from "../../../lib/issuePicker.js";
20
- import { copyItem as le, useLinkItems as ue } from "../../../lib/menus.js";
21
- import { usePageTitle as de } from "../../../lib/pageTitle.js";
22
- import { usePeople as N } from "../../../lib/people.js";
23
- import { projectStatuses as fe } from "../../../lib/projectStates.js";
24
- import { projectRef as P, projectsUnder as F } from "../../../lib/projects.js";
21
+ import { useIssuePicker as F } from "../../../lib/issuePicker.js";
22
+ import { copyItem as ce, useLinkItems as le } from "../../../lib/menus.js";
23
+ import { usePageTitle as ue } from "../../../lib/pageTitle.js";
24
+ import { usePeople as I } from "../../../lib/people.js";
25
+ import { projectStatuses as de } from "../../../lib/projectStates.js";
26
+ import { projectLevel as fe, projectRef as L } from "../../../lib/projects.js";
25
27
  import { useCan as pe } from "../../../lib/roles.js";
26
- import { Link as I, useNavigate as me } from "../../../lib/router.js";
27
- import { useTime as L } from "../../../lib/time.js";
28
- import { Route as R } from "./_projectId2.js";
29
- import { Avatar as z, AvatarGroup as B, Button as V, Card as he, Combobox as H, DatePicker as ge, EmptyState as _e, ErrorText as U, Input as ve, PageHeader as ye, Select as be, Switch as xe, buttonClasses as W, menuDivider as G, useOpenMenu as Se } from "@parallelworks/ui";
30
- import { useEffect as Ce, useState as K } from "react";
31
- import { useErrorMessage as we } from "@parallelworks/problem/react";
28
+ import { Link as R, useNavigate as me } from "../../../lib/router.js";
29
+ import { useTime as z } from "../../../lib/time.js";
30
+ import { Route as B } from "./_projectId2.js";
31
+ import { Avatar as V, AvatarGroup as H, Button as U, Card as he, Combobox as W, DatePicker as ge, EmptyState as _e, ErrorText as ve, Input as ye, PageHeader as be, Select as xe, Switch as Se, buttonClasses as G, menuDivider as Ce, useOpenMenu as we } from "@parallelworks/ui";
32
+ import { useEffect as Te, useState as K } from "react";
33
+ import { useErrorMessage as Ee } from "@parallelworks/problem/react";
32
34
  import { useTranslations as q } from "use-intl";
33
35
  import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
34
- import { useMutation as Z, useQuery as Q, useQueryClient as $, useSuspenseQuery as Te } from "@tanstack/react-query";
35
- import { MoreButton as Ee } from "@parallelworks/ui/list";
36
+ import { useMutation as Z, useQuery as Q, useQueryClient as $, useSuspenseQuery as De } from "@tanstack/react-query";
37
+ import { MoreButton as Oe } from "@parallelworks/ui/list";
36
38
  // src/routes/$workspace/projects/$projectId.tsx?tsr-split=component
37
- var De = [
39
+ var ke = [
38
40
  "assignees",
39
41
  "labels",
40
42
  "cycles"
41
43
  ];
42
- function Oe() {
43
- let { workspace: i, projectId: s } = R.useParams(), u = q("planning"), f = q("common"), p = we(), { data: m } = Te(l(i, s)), h = P(m);
44
- de(m.name);
45
- let x = pe(i, "manage_projects", { project: m.id }), S = pe(i, "delete_projects", { project: m.id }), C = $(), w = me(), T = ue(), { confirm: E, dialog: re } = se(), [ie, D] = K(!1), { data: ae } = Te(o), O = !!R.useSearch().own, { data: A } = Q(a(i, e(m.id, O))), { data: j = [] } = Q(d(i)), M = j.filter((e) => e.parentId === m.id), ce = O || M.length === 0 ? m.progress : m.treeProgress, [N, fe] = K("assignees"), F = Z({
44
+ function Ae() {
45
+ let { workspace: i, projectId: s } = B.useParams(), u = q("planning"), f = q("common"), p = Ee(), { data: m } = De(l(i, s)), h = L(m);
46
+ ue(m.name);
47
+ let C = pe(i, "manage_projects", { project: m.id }), w = pe(i, "delete_projects", { project: m.id }), T = $(), E = me(), D = le(), { confirm: O, dialog: te } = se(), [ne, k] = K(!1), { data: re } = De(o), A = !!B.useSearch().own, { data: ie } = Q(a(i, e(m.id, A))), { data: j = [] } = Q(d(i)), M = j.filter((e) => e.parentId === m.id), N = A || M.length === 0 ? m.progress : m.treeProgress, [P, F] = K("assignees"), I = Z({
46
48
  mutationFn: async (e) => r(await n.PATCH("/api/v1/workspaces/{workspace}/projects/{projectId}", {
47
49
  params: { path: {
48
50
  workspace: i,
@@ -50,17 +52,17 @@ function Oe() {
50
52
  } },
51
53
  body: e
52
54
  })),
53
- onSuccess: (e) => C.setQueryData(l(i, s).queryKey, c(e)),
55
+ onSuccess: (e) => T.setQueryData(l(i, s).queryKey, c(e)),
54
56
  onSettled: () => {
55
- C.invalidateQueries({ queryKey: d(i).queryKey });
57
+ T.invalidateQueries({ queryKey: d(i).queryKey });
56
58
  }
57
- }), L = Z({
59
+ }), de = Z({
58
60
  mutationFn: async () => r(await n.DELETE("/api/v1/workspaces/{workspace}/projects/{projectId}", { params: { path: {
59
61
  workspace: i,
60
62
  projectId: s
61
63
  } } })),
62
64
  onSuccess: () => {
63
- C.invalidateQueries({ queryKey: ["workspace", i] }), w({
65
+ T.invalidateQueries({ queryKey: ["workspace", i] }), E({
64
66
  to: "/$workspace/projects",
65
67
  params: { workspace: i }
66
68
  });
@@ -68,7 +70,7 @@ function Oe() {
68
70
  }), z = () => [
69
71
  {
70
72
  label: u("viewIssues"),
71
- onClick: () => w({
73
+ onClick: () => E({
72
74
  to: "/$workspace/projects/$projectId",
73
75
  params: {
74
76
  workspace: i,
@@ -77,30 +79,30 @@ function Oe() {
77
79
  search: { tab: "issues" }
78
80
  })
79
81
  },
80
- ...x ? [{
82
+ ...C ? [{
81
83
  label: m.template ? u("stopTemplate") : u("useAsTemplate"),
82
- onClick: () => F.mutate({ template: !m.template })
84
+ onClick: () => I.mutate({ template: !m.template })
83
85
  }] : [],
84
- ...ae?.mode === "platform" ? [] : [{
86
+ ...re?.mode === "platform" ? [] : [{
85
87
  label: u("manageAccess"),
86
- onClick: () => D(!0)
88
+ onClick: () => k(!0)
87
89
  }],
88
- G,
89
- ...T(`/${i}/projects/${h}`),
90
- le(f("copyName"), m.name),
91
- ...S ? [G, {
90
+ Ce,
91
+ ...D(`/${i}/projects/${h}`),
92
+ ce(f("copyName"), m.name),
93
+ ...w ? [Ce, {
92
94
  label: u("deleteProject"),
93
95
  destructive: !0,
94
- onClick: () => E({
96
+ onClick: () => O({
95
97
  title: u("deleteProjectTitle", { name: m.name }),
96
98
  description: u("deleteProjectDescription"),
97
99
  confirmLabel: u("deleteProject"),
98
- onConfirm: () => L.mutateAsync()
100
+ onConfirm: () => de.mutateAsync()
99
101
  })
100
102
  }] : []
101
- ], B = R.useSearch().tab ?? "overview", V = A?.issues ?? [];
102
- return Ce(() => {
103
- s !== h && w({
103
+ ], V = B.useSearch().tab ?? "overview", H = ie?.issues ?? [];
104
+ return Te(() => {
105
+ s !== h && E({
104
106
  to: "/$workspace/projects/$projectId",
105
107
  params: {
106
108
  workspace: i,
@@ -110,50 +112,50 @@ function Oe() {
110
112
  replace: !0
111
113
  });
112
114
  }, [
113
- w,
115
+ E,
114
116
  i,
115
117
  s,
116
118
  h
117
119
  ]), /* @__PURE__ */ X("div", {
118
120
  className: "flex h-full min-h-0 flex-col",
119
121
  children: [
120
- /* @__PURE__ */ Y(ye, {
122
+ /* @__PURE__ */ Y(be, {
121
123
  heading: !1,
122
124
  breadcrumbs: [
123
125
  {
124
126
  label: u("projects"),
125
127
  href: `/${i}/projects`
126
128
  },
127
- ...Be(j, m).map((e) => ({
129
+ ...Ve(j, m).map((e) => ({
128
130
  label: e.name,
129
- href: `/${i}/projects/${P(e)}`
131
+ href: `/${i}/projects/${L(e)}`
130
132
  })),
131
133
  {
132
134
  label: m.name,
133
- icon: m.icon || m.color ? /* @__PURE__ */ Y(te, {
135
+ icon: m.icon || m.color ? /* @__PURE__ */ Y(v, {
134
136
  icon: m.icon ?? "",
135
137
  color: m.color ?? "",
136
138
  name: m.name
137
- }) : /* @__PURE__ */ Y(ne, { className: "size-4 text-muted-foreground" })
139
+ }) : /* @__PURE__ */ Y(ee, { className: "size-4 text-muted-foreground" })
138
140
  }
139
141
  ],
140
142
  titleActions: /* @__PURE__ */ X(J, { children: [
141
- /* @__PURE__ */ Y(_, {
143
+ /* @__PURE__ */ Y(y, {
142
144
  workspace: i,
143
145
  kind: "project",
144
146
  target: m.id
145
147
  }),
146
- /* @__PURE__ */ Y(v, {
148
+ /* @__PURE__ */ Y(b, {
147
149
  workspace: i,
148
150
  project: m.id
149
151
  }),
150
- /* @__PURE__ */ Y(Ee, {
152
+ /* @__PURE__ */ Y(Oe, {
151
153
  items: z,
152
154
  label: f("moreActionsFor", { name: m.name }),
153
155
  visible: !0
154
156
  })
155
157
  ] }),
156
- actions: F.isPending && /* @__PURE__ */ Y("span", {
158
+ actions: I.isPending && /* @__PURE__ */ Y("span", {
157
159
  className: "text-xs text-muted-foreground",
158
160
  children: f("saving")
159
161
  })
@@ -161,58 +163,58 @@ function Oe() {
161
163
  /* @__PURE__ */ Y("nav", {
162
164
  "aria-label": u("projectSections"),
163
165
  className: "flex shrink-0 gap-1 border-b border-border px-4 py-2 md:px-5",
164
- children: t.map((e) => /* @__PURE__ */ X(I, {
166
+ children: t.map((e) => /* @__PURE__ */ X(R, {
165
167
  to: "/$workspace/projects/$projectId",
166
168
  params: {
167
169
  workspace: i,
168
170
  projectId: s
169
171
  },
170
172
  search: e === "overview" ? {} : { tab: e },
171
- "aria-current": B === e ? "page" : void 0,
173
+ "aria-current": V === e ? "page" : void 0,
172
174
  activeOptions: { exact: !0 },
173
175
  className: "h-7 rounded-full px-3 text-xs leading-7 text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=page]:bg-muted aria-[current=page]:text-foreground",
174
- children: [u(`projectTabs.${e}`), e === "issues" && V.length > 0 && /* @__PURE__ */ Y("span", {
176
+ children: [u(`projectTabs.${e}`), e === "issues" && H.length > 0 && /* @__PURE__ */ Y("span", {
175
177
  className: "ml-1 tabular-nums",
176
- children: V.length
178
+ children: H.length
177
179
  })]
178
180
  }, e))
179
181
  }),
180
182
  /* @__PURE__ */ X("div", {
181
183
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto xl:flex-row xl:overflow-hidden",
182
184
  children: [/* @__PURE__ */ X("div", {
183
- className: B === "issues" ? "w-full min-w-0 pb-16 xl:flex-1 xl:overflow-y-auto" : "w-full min-w-0 px-4 pt-6 pb-16 md:px-8 md:pt-8 xl:flex-1 xl:overflow-y-auto",
185
+ className: V === "issues" ? "w-full min-w-0 pb-16 xl:flex-1 xl:overflow-y-auto" : "w-full min-w-0 px-4 pt-6 pb-16 md:px-8 md:pt-8 xl:flex-1 xl:overflow-y-auto",
184
186
  children: [
185
- B === "overview" && /* @__PURE__ */ X(J, { children: [
187
+ V === "overview" && /* @__PURE__ */ X(J, { children: [
186
188
  /* @__PURE__ */ X("div", {
187
189
  className: "flex items-center gap-3",
188
- children: [/* @__PURE__ */ Y(y, {
190
+ children: [/* @__PURE__ */ Y(x, {
189
191
  workspace: i,
190
192
  icon: m.icon ?? "",
191
193
  name: m.name,
192
- onChange: (e) => F.mutateAsync({
194
+ onChange: (e) => I.mutateAsync({
193
195
  icon: e,
194
196
  color: ""
195
197
  }),
196
- disabled: !x,
198
+ disabled: !C,
197
199
  size: 40
198
- }), /* @__PURE__ */ Y(ke, {
200
+ }), /* @__PURE__ */ Y(je, {
199
201
  project: m,
200
- canWrite: x,
201
- onSave: (e) => F.mutate({ name: e })
202
+ canWrite: C,
203
+ onSave: (e) => I.mutate({ name: e })
202
204
  })]
203
205
  }),
204
- /* @__PURE__ */ Y(Ae, {
206
+ /* @__PURE__ */ Y(Me, {
205
207
  project: m,
206
- canWrite: x,
207
- onSave: (e) => F.mutate({ summary: e })
208
+ canWrite: C,
209
+ onSave: (e) => I.mutate({ summary: e })
208
210
  }),
209
- /* @__PURE__ */ Y(je, {
211
+ /* @__PURE__ */ Y(Ne, {
210
212
  workspace: i,
211
213
  project: m,
212
- canWrite: x,
213
- update: (e) => F.mutate(e)
214
+ canWrite: C,
215
+ update: (e) => I.mutate(e)
214
216
  }),
215
- /* @__PURE__ */ Y(Ne, {
217
+ /* @__PURE__ */ Y(Fe, {
216
218
  workspace: i,
217
219
  project: m
218
220
  }),
@@ -221,27 +223,27 @@ function Oe() {
221
223
  children: /* @__PURE__ */ Y(g, {
222
224
  workspace: i,
223
225
  project: m,
224
- editable: x,
226
+ editable: C,
225
227
  onChange: (e) => {
226
- C.setQueryData(l(i, s).queryKey, c(e)), C.invalidateQueries({ queryKey: d(i).queryKey });
228
+ T.setQueryData(l(i, s).queryKey, c(e)), T.invalidateQueries({ queryKey: d(i).queryKey });
227
229
  }
228
230
  })
229
231
  }),
230
- F.isError && /* @__PURE__ */ Y(U, {
232
+ I.isError && /* @__PURE__ */ Y(ve, {
231
233
  size: "md",
232
234
  className: "mt-2",
233
- children: p(F.error)
235
+ children: p(I.error)
234
236
  }),
235
237
  /* @__PURE__ */ X("section", {
236
238
  className: "mt-6",
237
239
  "aria-label": u("progressTitle"),
238
- children: [/* @__PURE__ */ Y(k, { progress: ce }), M.length > 0 && /* @__PURE__ */ X("div", {
240
+ children: [/* @__PURE__ */ Y(ae, { progress: N }), M.length > 0 && /* @__PURE__ */ X("div", {
239
241
  className: "mt-2 flex items-center gap-2 text-xs text-muted-foreground",
240
- children: [/* @__PURE__ */ Y(xe, {
242
+ children: [/* @__PURE__ */ Y(Se, {
241
243
  "aria-label": u("onlyOwnIssues"),
242
244
  size: "sm",
243
- checked: O,
244
- onCheckedChange: (e) => w({
245
+ checked: A,
246
+ onCheckedChange: (e) => E({
245
247
  to: "/$workspace/projects/$projectId",
246
248
  params: {
247
249
  workspace: i,
@@ -259,19 +261,21 @@ function Oe() {
259
261
  })]
260
262
  })]
261
263
  }),
262
- /* @__PURE__ */ Y(Fe, {
264
+ /* @__PURE__ */ Y(Ie, {
263
265
  workspace: i,
264
- projects: M
266
+ project: m,
267
+ projects: M,
268
+ canAdd: C && !m.template && fe(j, m.id) < 5
265
269
  }),
266
- V.length > 0 && /* @__PURE__ */ Y("section", {
270
+ H.length > 0 && /* @__PURE__ */ Y("section", {
267
271
  className: "mt-8 xl:hidden",
268
272
  "aria-label": u("issueBreakdown.label"),
269
- children: /* @__PURE__ */ Y(b, {
273
+ children: /* @__PURE__ */ Y(S, {
270
274
  workspace: i,
271
- issues: V,
272
- tabs: De,
273
- tab: N,
274
- onTabChange: fe
275
+ issues: H,
276
+ tabs: ke,
277
+ tab: P,
278
+ onTabChange: F
275
279
  })
276
280
  }),
277
281
  /* @__PURE__ */ X("section", {
@@ -283,59 +287,59 @@ function Oe() {
283
287
  size: "fill",
284
288
  padding: "sm",
285
289
  className: "mt-2 min-h-16",
286
- children: /* @__PURE__ */ Y(ee, {
290
+ children: /* @__PURE__ */ Y(_, {
287
291
  value: m.description,
288
- editable: x,
292
+ editable: C,
289
293
  placeholder: u("addDescription"),
290
294
  label: f("description"),
291
- onBlur: (e) => e !== m.description && F.mutate({ description: e }),
295
+ onBlur: (e) => e !== m.description && I.mutate({ description: e }),
292
296
  className: "min-h-12"
293
297
  }, m.updatedAt)
294
298
  })]
295
299
  }),
296
- /* @__PURE__ */ Y(Ie, {
300
+ /* @__PURE__ */ Y(Le, {
297
301
  workspace: i,
298
302
  project: m,
299
- canWrite: x
303
+ canWrite: C
300
304
  }),
301
- /* @__PURE__ */ Y(ze, {
305
+ /* @__PURE__ */ Y(Be, {
302
306
  workspace: i,
303
307
  projectId: m.id
304
308
  })
305
309
  ] }),
306
- B === "updates" && /* @__PURE__ */ Y(Re, {
310
+ V === "updates" && /* @__PURE__ */ Y(ze, {
307
311
  workspace: i,
308
312
  project: m,
309
- canWrite: x
313
+ canWrite: C
310
314
  }),
311
- B === "issues" && /* @__PURE__ */ Y(Le, {
315
+ V === "issues" && /* @__PURE__ */ Y(Re, {
312
316
  workspace: i,
313
317
  project: m,
314
- canWrite: x
318
+ canWrite: C
315
319
  })
316
320
  ]
317
- }), B !== "updates" && V.length > 0 && /* @__PURE__ */ Y("aside", {
321
+ }), V !== "updates" && H.length > 0 && /* @__PURE__ */ Y("aside", {
318
322
  "aria-label": u("issueBreakdown.label"),
319
323
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-6 xl:block",
320
- children: /* @__PURE__ */ Y(b, {
324
+ children: /* @__PURE__ */ Y(S, {
321
325
  workspace: i,
322
- issues: V,
323
- tabs: De,
324
- tab: N,
325
- onTabChange: fe
326
+ issues: H,
327
+ tabs: ke,
328
+ tab: P,
329
+ onTabChange: F
326
330
  })
327
331
  })]
328
332
  }),
329
- re,
330
- ie && /* @__PURE__ */ Y(oe, {
333
+ te,
334
+ ne && /* @__PURE__ */ Y(oe, {
331
335
  workspace: i,
332
336
  project: m,
333
- onClose: () => D(!1)
337
+ onClose: () => k(!1)
334
338
  })
335
339
  ]
336
340
  });
337
341
  }
338
- function ke({ project: e, canWrite: t, onSave: n }) {
342
+ function je({ project: e, canWrite: t, onSave: n }) {
339
343
  let r = q("planning"), [i, a] = K(e.name), [o, s] = K(e.name);
340
344
  return o !== e.name && (s(e.name), a(e.name)), t ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("h1", {
341
345
  className: "sr-only",
@@ -352,7 +356,7 @@ function ke({ project: e, canWrite: t, onSave: n }) {
352
356
  children: e.name
353
357
  });
354
358
  }
355
- function Ae({ project: e, canWrite: t, onSave: n }) {
359
+ function Me({ project: e, canWrite: t, onSave: n }) {
356
360
  let r = q("planning"), [i, a] = K(e.summary ?? ""), [o, s] = K(e.summary ?? "");
357
361
  return o !== (e.summary ?? "") && (s(e.summary ?? ""), a(e.summary ?? "")), t ? /* @__PURE__ */ Y("input", {
358
362
  value: i,
@@ -368,10 +372,10 @@ function Ae({ project: e, canWrite: t, onSave: n }) {
368
372
  children: e.summary
369
373
  }) : null;
370
374
  }
371
- function je({ workspace: e, project: t, canWrite: n, update: r }) {
372
- let i = q("planning"), a = L(), { members: o, person: s } = N(e), { data: c = [] } = Q(f(e)), l = ae(), [u, d] = K(null), p = t.lead ? s(t.lead) : void 0, m = (e, t, i) => {
375
+ function Ne({ workspace: e, project: t, canWrite: n, update: r }) {
376
+ let i = q("planning"), a = z(), { members: o, person: s } = I(e), { data: c = [] } = Q(f(e)), l = re(), [u, d] = K(null), p = t.lead ? s(t.lead) : void 0, m = (e, t, i) => {
373
377
  let o = /* @__PURE__ */ X(J, { children: [
374
- /* @__PURE__ */ Y(w, { className: "size-3.5 text-muted-foreground" }),
378
+ /* @__PURE__ */ Y(E, { className: "size-3.5 text-muted-foreground" }),
375
379
  /* @__PURE__ */ Y("span", {
376
380
  className: "text-muted-foreground",
377
381
  children: e
@@ -384,7 +388,7 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
384
388
  "aria-label": e,
385
389
  trigger: /* @__PURE__ */ Y("button", {
386
390
  type: "button",
387
- className: W({ size: "sm" }),
391
+ className: G({ size: "sm" }),
388
392
  children: o
389
393
  })
390
394
  }) : /* @__PURE__ */ Y("span", {
@@ -395,23 +399,23 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
395
399
  return /* @__PURE__ */ X("div", {
396
400
  className: "mt-3 flex flex-wrap items-center gap-1.5",
397
401
  children: [
398
- /* @__PURE__ */ Y(be, {
402
+ /* @__PURE__ */ Y(xe, {
399
403
  "aria-label": i("statusLabel"),
400
404
  value: t.status,
401
405
  disabled: !n,
402
406
  onValueChange: (e) => e && r({ status: e }),
403
- items: fe.map((e) => ({
407
+ items: de.map((e) => ({
404
408
  value: e,
405
409
  label: i(`status.${e}`),
406
- icon: /* @__PURE__ */ Y(A, { status: e })
410
+ icon: /* @__PURE__ */ Y(M, { status: e })
407
411
  })),
408
412
  trigger: /* @__PURE__ */ X("button", {
409
413
  type: "button",
410
- className: W({ size: "sm" }),
411
- children: [/* @__PURE__ */ Y(A, { status: t.status }), i(`status.${t.status}`)]
414
+ className: G({ size: "sm" }),
415
+ children: [/* @__PURE__ */ Y(M, { status: t.status }), i(`status.${t.status}`)]
412
416
  })
413
417
  }),
414
- /* @__PURE__ */ Y(H, {
418
+ /* @__PURE__ */ Y(W, {
415
419
  "aria-label": i("lead"),
416
420
  value: t.lead ?? "",
417
421
  disabled: !n,
@@ -422,7 +426,7 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
422
426
  }, ...o.map((e) => ({
423
427
  value: e.user.username,
424
428
  label: e.user.name,
425
- icon: /* @__PURE__ */ Y(z, {
429
+ icon: /* @__PURE__ */ Y(V, {
426
430
  name: e.user.name,
427
431
  src: e.user.avatarUrl,
428
432
  size: "xs",
@@ -431,8 +435,8 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
431
435
  }))],
432
436
  trigger: /* @__PURE__ */ Y("button", {
433
437
  type: "button",
434
- className: W({ size: "sm" }),
435
- children: p ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(z, {
438
+ className: G({ size: "sm" }),
439
+ children: p ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(V, {
436
440
  name: p.name,
437
441
  src: p.avatarUrl,
438
442
  size: "xs",
@@ -443,7 +447,7 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
443
447
  })
444
448
  })
445
449
  }),
446
- /* @__PURE__ */ Y(be, {
450
+ /* @__PURE__ */ Y(xe, {
447
451
  "aria-label": i("priority"),
448
452
  value: String(t.priority),
449
453
  disabled: !n,
@@ -451,17 +455,17 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
451
455
  items: l.map((e, t) => ({
452
456
  value: String(t),
453
457
  label: e,
454
- icon: /* @__PURE__ */ Y(E, { priority: t })
458
+ icon: /* @__PURE__ */ Y(O, { priority: t })
455
459
  })),
456
460
  trigger: /* @__PURE__ */ X("button", {
457
461
  type: "button",
458
- className: W({ size: "sm" }),
459
- children: [/* @__PURE__ */ Y(E, { priority: t.priority }), t.priority ? l[t.priority] : i("noPriority")]
462
+ className: G({ size: "sm" }),
463
+ children: [/* @__PURE__ */ Y(O, { priority: t.priority }), t.priority ? l[t.priority] : i("noPriority")]
460
464
  })
461
465
  }),
462
466
  m(i("startDate"), t.startDate, "startDate"),
463
467
  m(i("targetDate"), t.targetDate, "targetDate"),
464
- /* @__PURE__ */ Y(H, {
468
+ /* @__PURE__ */ Y(W, {
465
469
  "aria-label": i("members"),
466
470
  open: u === "members",
467
471
  onOpenChange: (e) => d(e ? "members" : null),
@@ -470,7 +474,7 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
470
474
  items: o.map((e) => ({
471
475
  value: e.user.username,
472
476
  label: e.user.name,
473
- icon: /* @__PURE__ */ Y(z, {
477
+ icon: /* @__PURE__ */ Y(V, {
474
478
  name: e.user.name,
475
479
  src: e.user.avatarUrl,
476
480
  size: "xs",
@@ -483,26 +487,26 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
483
487
  trigger: /* @__PURE__ */ X("button", {
484
488
  type: "button",
485
489
  disabled: !n,
486
- className: W({ size: "sm" }),
487
- children: [t.members.length > 0 ? /* @__PURE__ */ Y(B, {
490
+ className: G({ size: "sm" }),
491
+ children: [t.members.length > 0 ? /* @__PURE__ */ Y(H, {
488
492
  size: "xs",
489
493
  max: 4,
490
494
  showOverflow: !1,
491
495
  children: t.members.map((e) => {
492
496
  let t = s(e);
493
- return /* @__PURE__ */ Y(z, {
497
+ return /* @__PURE__ */ Y(V, {
494
498
  name: t.name,
495
499
  src: t.avatarUrl,
496
500
  decorative: !0
497
501
  }, e);
498
502
  })
499
- }) : /* @__PURE__ */ Y(D, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
503
+ }) : /* @__PURE__ */ Y(k, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
500
504
  className: t.members.length ? "" : "text-muted-foreground",
501
505
  children: t.members.length ? i("memberCount", { count: t.members.length }) : i("members")
502
506
  })]
503
507
  })
504
508
  }),
505
- /* @__PURE__ */ Y(H, {
509
+ /* @__PURE__ */ Y(W, {
506
510
  "aria-label": i("teams"),
507
511
  open: u === "teams",
508
512
  onOpenChange: (e) => d(e ? "teams" : null),
@@ -512,7 +516,7 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
512
516
  value: e.id,
513
517
  label: e.name,
514
518
  hint: e.key,
515
- icon: /* @__PURE__ */ Y(te, {
519
+ icon: /* @__PURE__ */ Y(v, {
516
520
  icon: e.icon,
517
521
  color: e.color,
518
522
  name: e.name
@@ -524,20 +528,21 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
524
528
  trigger: /* @__PURE__ */ X("button", {
525
529
  type: "button",
526
530
  disabled: !n,
527
- className: W({ size: "sm" }),
528
- children: [/* @__PURE__ */ Y(D, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
531
+ className: G({ size: "sm" }),
532
+ children: [/* @__PURE__ */ Y(k, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
529
533
  className: t.teamIds.length ? "" : "text-muted-foreground",
530
534
  children: t.teamIds.length ? c.filter((e) => t.teamIds.includes(e.id)).map((e) => e.key).join(", ") : i("teams")
531
535
  })]
532
536
  })
533
537
  }),
534
- /* @__PURE__ */ Y(Pe, {
538
+ /* @__PURE__ */ Y(ie, {
535
539
  workspace: e,
536
- project: t,
537
- canWrite: n,
540
+ projectId: t.id,
541
+ value: t.parentId ?? "",
542
+ disabled: !n,
538
543
  onChange: (e) => r({ parentId: e })
539
544
  }),
540
- /* @__PURE__ */ Y(Me, {
545
+ /* @__PURE__ */ Y(Pe, {
541
546
  workspace: e,
542
547
  project: t,
543
548
  canWrite: n,
@@ -546,11 +551,11 @@ function je({ workspace: e, project: t, canWrite: n, update: r }) {
546
551
  ]
547
552
  });
548
553
  }
549
- function Me({ workspace: e, project: t, canWrite: n, onChange: r }) {
554
+ function Pe({ workspace: e, project: t, canWrite: n, onChange: r }) {
550
555
  let i = q("planning"), { data: a = [] } = Q(d(e)), o = /* @__PURE__ */ new Set(), s = (e) => {
551
556
  for (let t of a) t.blockedBy.includes(e) && !o.has(t.id) && (o.add(t.id), s(t.id));
552
557
  };
553
- return s(t.id), /* @__PURE__ */ Y(H, {
558
+ return s(t.id), /* @__PURE__ */ Y(W, {
554
559
  multiple: !0,
555
560
  disabled: !n,
556
561
  items: a.filter((e) => e.id !== t.id && !o.has(e.id) && !e.template).map((e) => ({
@@ -564,22 +569,22 @@ function Me({ workspace: e, project: t, canWrite: n, onChange: r }) {
564
569
  trigger: /* @__PURE__ */ X("button", {
565
570
  type: "button",
566
571
  disabled: !n,
567
- className: W({ size: "sm" }),
568
- children: [/* @__PURE__ */ Y(T, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
572
+ className: G({ size: "sm" }),
573
+ children: [/* @__PURE__ */ Y(D, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
569
574
  className: t.blockedBy.length ? "" : "text-muted-foreground",
570
575
  children: t.blockedBy.length ? i("waitsOnCount", { count: t.blockedBy.length }) : i("waitsOn")
571
576
  })]
572
577
  })
573
578
  });
574
579
  }
575
- function Ne({ workspace: e, project: t }) {
576
- let n = q("planning"), r = L(), { data: i = [] } = Q(d(e)), a = (e) => i.filter((t) => e.includes(t.id)), o = a(t.blockedBy), s = a(t.blocks);
580
+ function Fe({ workspace: e, project: t }) {
581
+ let n = q("planning"), r = z(), { data: i = [] } = Q(d(e)), a = (e) => i.filter((t) => e.includes(t.id)), o = a(t.blockedBy), s = a(t.blocks);
577
582
  if (o.length === 0 && s.length === 0) return null;
578
- let c = t.targetDate ? o.filter((e) => e.targetDate && e.targetDate > (t.targetDate ?? "")) : [], l = (t) => /* @__PURE__ */ Y(I, {
583
+ let c = t.targetDate ? o.filter((e) => e.targetDate && e.targetDate > (t.targetDate ?? "")) : [], l = (t) => /* @__PURE__ */ Y(R, {
579
584
  to: "/$workspace/projects/$projectId",
580
585
  params: {
581
586
  workspace: e,
582
- projectId: P(t)
587
+ projectId: L(t)
583
588
  },
584
589
  className: "font-medium hover:underline",
585
590
  children: t.name
@@ -609,147 +614,141 @@ function Ne({ workspace: e, project: t }) {
609
614
  ]
610
615
  });
611
616
  }
612
- function Pe({ workspace: e, project: t, canWrite: n, onChange: r }) {
613
- let i = q("planning"), { data: a = [] } = Q(d(e)), o = new Set(F(a, t.id).map((e) => e.id)), s = a.find((e) => e.id === t.parentId);
614
- return /* @__PURE__ */ Y(H, {
615
- disabled: !n,
616
- items: [{
617
- value: "",
618
- label: i("noParentProject")
619
- }, ...a.filter((e) => e.id !== t.id && !o.has(e.id) && !e.template).map((e) => ({
620
- value: e.id,
621
- label: e.name
622
- }))],
623
- value: t.parentId ?? "",
624
- onValueChange: (e) => r(e ?? ""),
625
- placeholder: i("parentProject"),
626
- "aria-label": i("parentProject"),
627
- trigger: /* @__PURE__ */ X("button", {
628
- type: "button",
629
- disabled: !n,
630
- className: W({ size: "sm" }),
631
- children: [/* @__PURE__ */ Y(ne, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
632
- className: s ? "" : "text-muted-foreground",
633
- children: s ? i("underProject", { name: s.name }) : i("parentProject")
634
- })]
635
- })
636
- });
637
- }
638
- function Fe({ workspace: e, projects: t }) {
639
- let n = q("planning"), r = L(), { person: i } = N(e);
640
- return t.length === 0 ? null : /* @__PURE__ */ X("section", {
617
+ function Ie({ workspace: e, project: t, projects: n, canAdd: r }) {
618
+ let i = q("planning"), a = z(), { person: o } = I(e), [s, c] = K(!1);
619
+ return /* @__PURE__ */ X("section", {
641
620
  className: "mt-8",
642
- children: [/* @__PURE__ */ Y("h2", {
643
- className: "text-base font-semibold",
644
- children: n("subProjects")
645
- }), /* @__PURE__ */ Y("ul", {
646
- className: "mt-2 divide-y divide-border rounded-lg border border-border",
647
- children: t.map((t) => {
648
- let a = j(t), o = t.lead ? i(t.lead) : void 0;
649
- return /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ X(I, {
650
- to: "/$workspace/projects/$projectId",
651
- params: {
652
- workspace: e,
653
- projectId: P(t)
654
- },
655
- className: "flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2.5 text-sm hover:bg-muted/60",
656
- children: [
657
- /* @__PURE__ */ Y(A, { status: t.status }),
658
- /* @__PURE__ */ Y("span", {
659
- className: "min-w-0 flex-1 truncate font-medium",
660
- children: t.name
661
- }),
662
- /* @__PURE__ */ X("span", {
663
- className: "flex items-center gap-1.5 text-xs text-muted-foreground",
664
- children: [/* @__PURE__ */ Y(O, { state: a }), n(`health.${a}`)]
665
- }),
666
- o && /* @__PURE__ */ Y(z, {
667
- name: o.name,
668
- src: o.avatarUrl,
669
- size: "xs"
670
- }),
671
- /* @__PURE__ */ Y("span", {
672
- className: "w-20 text-xs text-muted-foreground tabular-nums",
673
- children: t.targetDate ? r.day(t.targetDate) : ""
674
- }),
675
- /* @__PURE__ */ Y("span", {
676
- className: "w-28",
677
- children: /* @__PURE__ */ Y(k, {
678
- progress: t.treeProgress,
679
- compact: !0
621
+ children: [
622
+ /* @__PURE__ */ X("div", {
623
+ className: "flex items-center gap-2",
624
+ children: [/* @__PURE__ */ Y("h2", {
625
+ className: "text-base font-semibold",
626
+ children: i("subProjects")
627
+ }), r && /* @__PURE__ */ X(U, {
628
+ type: "button",
629
+ size: "sm",
630
+ onClick: () => c(!0),
631
+ className: "ml-auto",
632
+ children: [/* @__PURE__ */ Y(w, { className: "size-3.5" }), i("newSubProject")]
633
+ })]
634
+ }),
635
+ /* @__PURE__ */ X("ul", {
636
+ className: "mt-2 divide-y divide-border rounded-lg border border-border",
637
+ children: [n.length === 0 && /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ Y(_e, {
638
+ variant: "bare",
639
+ title: i("noSubProjects")
640
+ }) }), n.map((t) => {
641
+ let n = N(t), r = t.lead ? o(t.lead) : void 0;
642
+ return /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ X(R, {
643
+ to: "/$workspace/projects/$projectId",
644
+ params: {
645
+ workspace: e,
646
+ projectId: L(t)
647
+ },
648
+ className: "flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2.5 text-sm hover:bg-muted/60",
649
+ children: [
650
+ /* @__PURE__ */ Y(M, { status: t.status }),
651
+ /* @__PURE__ */ Y("span", {
652
+ className: "min-w-0 flex-1 truncate font-medium",
653
+ children: t.name
654
+ }),
655
+ /* @__PURE__ */ X("span", {
656
+ className: "flex items-center gap-1.5 text-xs text-muted-foreground",
657
+ children: [/* @__PURE__ */ Y(j, { state: n }), i(`health.${n}`)]
658
+ }),
659
+ r && /* @__PURE__ */ Y(V, {
660
+ name: r.name,
661
+ src: r.avatarUrl,
662
+ size: "xs"
663
+ }),
664
+ /* @__PURE__ */ Y("span", {
665
+ className: "w-20 text-xs text-muted-foreground tabular-nums",
666
+ children: t.targetDate ? a.day(t.targetDate) : ""
667
+ }),
668
+ /* @__PURE__ */ Y("span", {
669
+ className: "w-28",
670
+ children: /* @__PURE__ */ Y(ae, {
671
+ progress: t.treeProgress,
672
+ compact: !0
673
+ })
680
674
  })
681
- })
682
- ]
683
- }) }, t.id);
675
+ ]
676
+ }) }, t.id);
677
+ })]
678
+ }),
679
+ s && /* @__PURE__ */ Y(A, {
680
+ workspace: e,
681
+ parentId: t.id,
682
+ onClose: () => c(!1)
684
683
  })
685
- })]
684
+ ]
686
685
  });
687
686
  }
688
- function Ie({ workspace: e, project: t, canWrite: a }) {
689
- let o = q("planning"), s = q("common"), c = we(), l = L(), u = $(), d = Se(), [f, p] = K(!1), [m, h] = K(""), [g, ee] = K(""), [te, _] = K(null), v = {
687
+ function Le({ workspace: e, project: t, canWrite: a }) {
688
+ let o = q("planning"), s = q("common"), c = Ee(), l = z(), u = $(), d = we(), [f, p] = K(!1), [m, h] = K(""), [g, _] = K(""), [v, y] = K(null), b = {
690
689
  workspace: e,
691
690
  projectId: t.id
692
- }, y = () => {
691
+ }, x = () => {
693
692
  u.invalidateQueries({ queryKey: [
694
693
  "workspace",
695
694
  e,
696
695
  "projects"
697
696
  ] }), i(u, e);
698
- }, b = Z({
697
+ }, S = Z({
699
698
  mutationFn: async () => r(await n.POST("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones", {
700
- params: { path: v },
699
+ params: { path: b },
701
700
  body: {
702
701
  name: m,
703
702
  ...g && { targetDate: g }
704
703
  }
705
704
  })),
706
705
  onSuccess: () => {
707
- h(""), ee(""), p(!1);
706
+ h(""), _(""), p(!1);
708
707
  },
709
- onSettled: y
710
- }), x = Z({
708
+ onSettled: x
709
+ }), C = Z({
711
710
  mutationFn: async ({ id: e, ...t }) => r(await n.PATCH("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones/{milestoneId}", {
712
711
  params: { path: {
713
- ...v,
712
+ ...b,
714
713
  milestoneId: e
715
714
  } },
716
715
  body: t
717
716
  })),
718
- onSettled: y
719
- }), C = Z({
717
+ onSettled: x
718
+ }), T = Z({
720
719
  mutationFn: async (e) => r(await n.DELETE("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones/{milestoneId}", { params: { path: {
721
- ...v,
720
+ ...b,
722
721
  milestoneId: e
723
722
  } } })),
724
- onSettled: y
725
- }), w = t.milestones, T = (e, t) => a ? [
723
+ onSettled: x
724
+ }), E = t.milestones, D = (e, t) => a ? [
726
725
  {
727
726
  label: o("rename"),
728
- onClick: () => _(e.id)
727
+ onClick: () => y(e.id)
729
728
  },
730
729
  {
731
730
  label: o("moveUp"),
732
731
  disabled: t === 0,
733
- onClick: () => x.mutate({
732
+ onClick: () => C.mutate({
734
733
  id: e.id,
735
734
  position: t - 1
736
735
  })
737
736
  },
738
737
  {
739
738
  label: o("moveDown"),
740
- disabled: t === w.length - 1,
741
- onClick: () => x.mutate({
739
+ disabled: t === E.length - 1,
740
+ onClick: () => C.mutate({
742
741
  id: e.id,
743
742
  position: t + 1
744
743
  })
745
744
  },
746
- G,
745
+ Ce,
747
746
  {
748
747
  label: s("delete"),
749
748
  destructive: !0,
750
- onClick: () => C.mutate(e.id)
749
+ onClick: () => T.mutate(e.id)
751
750
  }
752
- ] : [le(s("copyName"), e.name)], E = b.error ?? x.error ?? C.error;
751
+ ] : [ce(s("copyName"), e.name)], O = S.error ?? C.error ?? T.error;
753
752
  return /* @__PURE__ */ X("section", {
754
753
  className: "mt-10",
755
754
  children: [
@@ -758,12 +757,12 @@ function Ie({ workspace: e, project: t, canWrite: a }) {
758
757
  children: [/* @__PURE__ */ Y("h2", {
759
758
  className: "text-base font-semibold",
760
759
  children: o("milestones")
761
- }), a && !f && /* @__PURE__ */ X(V, {
760
+ }), a && !f && /* @__PURE__ */ X(U, {
762
761
  type: "button",
763
762
  size: "sm",
764
763
  onClick: () => p(!0),
765
764
  className: "ml-auto",
766
- children: [/* @__PURE__ */ Y(S, { className: "size-3.5" }), o("addMilestone")]
765
+ children: [/* @__PURE__ */ Y(w, { className: "size-3.5" }), o("addMilestone")]
767
766
  })]
768
767
  }),
769
768
  /* @__PURE__ */ X(he, {
@@ -774,31 +773,31 @@ function Ie({ workspace: e, project: t, canWrite: a }) {
774
773
  render: /* @__PURE__ */ Y("ul", {}),
775
774
  className: "mt-3",
776
775
  children: [
777
- w.map((n, r) => /* @__PURE__ */ X("li", {
778
- onContextMenu: (e) => d(e, T(n, r)),
776
+ E.map((n, r) => /* @__PURE__ */ X("li", {
777
+ onContextMenu: (e) => d(e, D(n, r)),
779
778
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 py-2 pr-2 pl-3 md:flex-nowrap",
780
779
  children: [
781
- te === n.id ? /* @__PURE__ */ Y(ve, {
780
+ v === n.id ? /* @__PURE__ */ Y(ye, {
782
781
  autoFocus: !0,
783
782
  defaultValue: n.name,
784
783
  "aria-label": o("milestoneName"),
785
784
  onBlur: (e) => {
786
785
  let t = e.target.value.trim();
787
- t && t !== n.name && x.mutate({
786
+ t && t !== n.name && C.mutate({
788
787
  id: n.id,
789
788
  name: t
790
- }), _(null);
789
+ }), y(null);
791
790
  },
792
791
  onKeyDown: (e) => {
793
- e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && _(null);
792
+ e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && y(null);
794
793
  },
795
794
  size: "sm",
796
795
  className: "min-w-0 flex-1"
797
- }) : /* @__PURE__ */ Y(I, {
796
+ }) : /* @__PURE__ */ Y(R, {
798
797
  to: "/$workspace/projects/$projectId/milestones/$milestoneId",
799
798
  params: {
800
799
  workspace: e,
801
- projectId: P(t),
800
+ projectId: L(t),
802
801
  milestoneId: n.id
803
802
  },
804
803
  className: "min-w-0 flex-1 basis-full truncate rounded-sm text-sm font-medium hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary md:basis-auto",
@@ -810,28 +809,28 @@ function Ie({ workspace: e, project: t, canWrite: a }) {
810
809
  }),
811
810
  /* @__PURE__ */ Y("span", {
812
811
  className: "w-44 shrink-0",
813
- children: /* @__PURE__ */ Y(k, {
812
+ children: /* @__PURE__ */ Y(ae, {
814
813
  progress: n.progress,
815
814
  compact: !0
816
815
  })
817
816
  }),
818
- /* @__PURE__ */ Y(Ee, {
819
- items: () => T(n, r),
817
+ /* @__PURE__ */ Y(Oe, {
818
+ items: () => D(n, r),
820
819
  label: s("moreActionsFor", { name: n.name })
821
820
  })
822
821
  ]
823
822
  }, n.id)),
824
- w.length === 0 && !f && /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ Y(_e, {
823
+ E.length === 0 && !f && /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ Y(_e, {
825
824
  variant: "bare",
826
825
  title: o("noMilestones")
827
826
  }) }),
828
827
  f && /* @__PURE__ */ Y("li", { children: /* @__PURE__ */ X("form", {
829
828
  className: "flex flex-wrap items-center gap-2 px-3 py-2",
830
829
  onSubmit: (e) => {
831
- e.preventDefault(), m.trim() && b.mutate();
830
+ e.preventDefault(), m.trim() && S.mutate();
832
831
  },
833
832
  children: [
834
- /* @__PURE__ */ Y(ve, {
833
+ /* @__PURE__ */ Y(ye, {
835
834
  autoFocus: !0,
836
835
  value: m,
837
836
  onChange: (e) => h(e.target.value),
@@ -841,18 +840,18 @@ function Ie({ workspace: e, project: t, canWrite: a }) {
841
840
  }),
842
841
  /* @__PURE__ */ Y(ge, {
843
842
  value: g,
844
- onValueChange: ee,
843
+ onValueChange: _,
845
844
  "aria-label": o("targetDate"),
846
845
  className: "w-auto"
847
846
  }),
848
- /* @__PURE__ */ Y(V, {
847
+ /* @__PURE__ */ Y(U, {
849
848
  type: "submit",
850
849
  variant: "primary",
851
850
  disabled: !m.trim(),
852
- loading: b.isPending,
851
+ loading: S.isPending,
853
852
  children: o("addMilestone")
854
853
  }),
855
- /* @__PURE__ */ Y(V, {
854
+ /* @__PURE__ */ Y(U, {
856
855
  type: "button",
857
856
  variant: "ghost",
858
857
  onClick: () => p(!1),
@@ -862,16 +861,16 @@ function Ie({ workspace: e, project: t, canWrite: a }) {
862
861
  }) })
863
862
  ]
864
863
  }),
865
- E && /* @__PURE__ */ Y(U, {
864
+ O && /* @__PURE__ */ Y(ve, {
866
865
  size: "md",
867
866
  className: "mt-2",
868
- children: c(E)
867
+ children: c(O)
869
868
  })
870
869
  ]
871
870
  });
872
871
  }
873
- function Le({ workspace: t, project: o, canWrite: s }) {
874
- let c = q("planning"), l = we(), u = $(), d = !!R.useSearch().own, { data: f } = Te(a(t, e(o.id, d))), p = ce(t, (e) => e.project?.id !== o.id), m = f.issues, h = Z({
872
+ function Re({ workspace: t, project: o, canWrite: s }) {
873
+ let c = q("planning"), l = Ee(), u = $(), d = !!B.useSearch().own, { data: f } = De(a(t, e(o.id, d))), p = F(t, (e) => e.project?.id !== o.id), m = f.issues, h = Z({
875
874
  mutationFn: async (e) => r(await n.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
876
875
  params: { path: {
877
876
  workspace: t,
@@ -886,21 +885,21 @@ function Le({ workspace: t, project: o, canWrite: s }) {
886
885
  children: [
887
886
  s && /* @__PURE__ */ Y("div", {
888
887
  className: "flex min-h-11 items-center justify-end border-b border-border px-4 py-2 md:px-5",
889
- children: /* @__PURE__ */ Y(H, {
888
+ children: /* @__PURE__ */ Y(W, {
890
889
  "aria-label": c("addIssues"),
891
890
  align: "end",
892
891
  ...p,
893
892
  value: null,
894
893
  onValueChange: (e) => e !== null && h.mutate(e),
895
894
  placeholder: c("findIssue"),
896
- trigger: /* @__PURE__ */ X(V, {
895
+ trigger: /* @__PURE__ */ X(U, {
897
896
  type: "button",
898
897
  size: "sm",
899
- children: [/* @__PURE__ */ Y(S, { className: "size-3.5" }), c("addIssues")]
898
+ children: [/* @__PURE__ */ Y(w, { className: "size-3.5" }), c("addIssues")]
900
899
  })
901
900
  })
902
901
  }),
903
- h.isError && /* @__PURE__ */ Y(U, {
902
+ h.isError && /* @__PURE__ */ Y(ve, {
904
903
  size: "md",
905
904
  className: "px-4 pt-2 md:px-5",
906
905
  children: l(h.error)
@@ -908,14 +907,14 @@ function Le({ workspace: t, project: o, canWrite: s }) {
908
907
  m.length === 0 ? /* @__PURE__ */ Y(_e, {
909
908
  title: c("noIssuesInProject"),
910
909
  className: "mt-6"
911
- }) : /* @__PURE__ */ Y(x, {
910
+ }) : /* @__PURE__ */ Y(C, {
912
911
  workspace: t,
913
912
  issues: m
914
913
  })
915
914
  ]
916
915
  });
917
916
  }
918
- function Re({ workspace: e, project: t, canWrite: i }) {
917
+ function ze({ workspace: e, project: t, canWrite: i }) {
919
918
  let a = q("planning"), o = $(), { data: s = [] } = Q(u(e, t.id)), c = Z({
920
919
  mutationFn: async ({ health: i, body: a }) => r(await n.POST("/api/v1/workspaces/{workspace}/projects/{projectId}/updates", {
921
920
  params: { path: {
@@ -944,9 +943,9 @@ function Re({ workspace: e, project: t, canWrite: i }) {
944
943
  "projects"
945
944
  ] })
946
945
  });
947
- return /* @__PURE__ */ Y(M, {
946
+ return /* @__PURE__ */ Y(P, {
948
947
  workspace: e,
949
- state: j(t),
948
+ state: N(t),
950
949
  health: t.health,
951
950
  updates: s,
952
951
  canWrite: i,
@@ -955,8 +954,8 @@ function Re({ workspace: e, project: t, canWrite: i }) {
955
954
  remove: l
956
955
  });
957
956
  }
958
- function ze({ workspace: e, projectId: t }) {
959
- let n = q("planning.activity"), r = q("planning"), i = q("planning.health"), a = L(), o = ae(), { data: c = [] } = Q(s(e, t)), { actorName: l, person: u } = N(e);
957
+ function Be({ workspace: e, projectId: t }) {
958
+ let n = q("planning.activity"), r = q("planning"), i = q("planning.health"), a = z(), o = re(), { data: c = [] } = Q(s(e, t)), { actorName: l, person: u } = I(e);
960
959
  if (c.length === 0) return null;
961
960
  let d = (e) => {
962
961
  let t = {
@@ -1011,40 +1010,40 @@ function ze({ workspace: e, projectId: t }) {
1011
1010
  }];
1012
1011
  let f = [], p = (e) => e ? a.day(String(e)) : "";
1013
1012
  return d.name && f.push({
1014
- icon: /* @__PURE__ */ Y(ie, {}),
1013
+ icon: /* @__PURE__ */ Y(ne, {}),
1015
1014
  text: n.rich("renamed", {
1016
1015
  ...t,
1017
1016
  from: String(d.name.from)
1018
1017
  })
1019
1018
  }), d.status && f.push({
1020
- icon: /* @__PURE__ */ Y(A, { status: d.status.to }),
1019
+ icon: /* @__PURE__ */ Y(M, { status: d.status.to }),
1021
1020
  text: n.rich("status", {
1022
1021
  ...t,
1023
1022
  status: r(`status.${d.status.to}`)
1024
1023
  })
1025
1024
  }), d.priority && f.push({
1026
- icon: /* @__PURE__ */ Y(E, { priority: Number(d.priority.to) }),
1025
+ icon: /* @__PURE__ */ Y(O, { priority: Number(d.priority.to) }),
1027
1026
  text: n.rich("priority", {
1028
1027
  ...t,
1029
1028
  priority: o[Number(d.priority.to)] ?? ""
1030
1029
  })
1031
1030
  }), d.lead && f.push(d.lead.to ? {
1032
- icon: /* @__PURE__ */ Y(C, {}),
1031
+ icon: /* @__PURE__ */ Y(T, {}),
1033
1032
  text: n.rich("lead", {
1034
1033
  ...t,
1035
1034
  lead: u(String(d.lead.to)).name
1036
1035
  })
1037
1036
  } : {
1038
- icon: /* @__PURE__ */ Y(re, {}),
1037
+ icon: /* @__PURE__ */ Y(te, {}),
1039
1038
  text: n.rich("leadRemoved", t)
1040
1039
  }), d.startDate && f.push({
1041
- icon: /* @__PURE__ */ Y(w, {}),
1040
+ icon: /* @__PURE__ */ Y(E, {}),
1042
1041
  text: d.startDate.to ? n.rich("startDate", {
1043
1042
  ...t,
1044
1043
  date: p(d.startDate.to)
1045
1044
  }) : n.rich("startDateRemoved", t)
1046
1045
  }), d.targetDate && f.push({
1047
- icon: /* @__PURE__ */ Y(w, {}),
1046
+ icon: /* @__PURE__ */ Y(E, {}),
1048
1047
  text: d.targetDate.to ? n.rich("targetDate", {
1049
1048
  ...t,
1050
1049
  date: p(d.targetDate.to)
@@ -1072,7 +1071,7 @@ function ze({ workspace: e, projectId: t }) {
1072
1071
  })]
1073
1072
  });
1074
1073
  }
1075
- function Be(e, t) {
1074
+ function Ve(e, t) {
1076
1075
  let n = [], r = /* @__PURE__ */ new Set([t.id]), i = t.parentId;
1077
1076
  for (; i && !r.has(i);) {
1078
1077
  let t = e.find((e) => e.id === i);
@@ -1081,4 +1080,4 @@ function Be(e, t) {
1081
1080
  }
1082
1081
  return n;
1083
1082
  }
1084
- export { Oe as component };
1083
+ export { Ae as component };