@knkcs/contenthub-ui 0.2.0 → 0.3.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.
@@ -1,123 +1,123 @@
1
- import { S as e, h as t, y as n } from "./heads-Brd2Gtjm.js";
2
- import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
3
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
4
- import { Button as d, EmptyState as f } from "@knkcs/anker/atoms";
5
- import { DataTable as p, DateCell as m, Modal as h, Toolbar as g, TreeViewBranchControl as _, TreeViewBranchIndicator as v, TreeViewBranchText as y, TreeViewItem as b, TreeViewItemText as x, TreeViewLabel as S, TreeViewNode as ee, TreeViewRoot as C, TreeViewTree as w, TruncatedTextCell as T, createTreeCollection as E } from "@knkcs/anker/components";
6
- import { Alert as D, HStack as te, NativeSelect as O, Spinner as ne, Stack as k, Text as A } from "@knkcs/anker/primitives";
7
- import { IndexPageTemplate as j, SubNavLayout as M } from "@knkcs/anker/templates";
8
- import { keepPreviousData as re, useInfiniteQuery as ie, useQuery as N, useQueryClient as ae } from "@tanstack/react-query";
9
- import { ChevronRight as P, FileText as oe, Lock as F, Plus as se } from "lucide-react";
1
+ import { C as e, S as t, h as n, y as r } from "./heads-dBmqNcOB.js";
2
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
3
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
4
+ import { Button as f, EmptyState as p } from "@knkcs/anker/atoms";
5
+ import { DataTable as m, DateCell as h, Modal as g, Toolbar as _, TreeViewBranchControl as v, TreeViewBranchIndicator as y, TreeViewBranchText as b, TreeViewItem as x, TreeViewItemText as S, TreeViewLabel as ee, TreeViewNode as C, TreeViewRoot as w, TreeViewTree as T, TruncatedTextCell as te, createTreeCollection as E } from "@knkcs/anker/components";
6
+ import { Alert as D, HStack as O, NativeSelect as k, Spinner as A, Stack as j, Text as M } from "@knkcs/anker/primitives";
7
+ import { IndexPageTemplate as ne, SubNavLayout as N } from "@knkcs/anker/templates";
8
+ import { keepPreviousData as re, useInfiniteQuery as ie, useQuery as P, useQueryClient as ae } from "@tanstack/react-query";
9
+ import { ChevronRight as F, FileText as oe, Lock as se, Plus as ce } from "lucide-react";
10
10
  import { useTranslation as I } from "react-i18next";
11
- import { zodResolver as ce } from "@hookform/resolvers/zod";
12
- import { BaseSelectField as L, InputField as R, LookupSelectField as le } from "@knkcs/anker/forms";
13
- import { FormProvider as z, useForm as B, useWatch as V } from "react-hook-form";
14
- import { z as H } from "zod";
11
+ import { zodResolver as L } from "@hookform/resolvers/zod";
12
+ import { BaseSelectField as R, InputField as z, LookupSelectField as B } from "@knkcs/anker/forms";
13
+ import { FormProvider as V, useForm as le, useWatch as H } from "react-hook-form";
14
+ import { z as U } from "zod";
15
15
  import { useHostIdentity as ue } from "@knkcs/anker/host";
16
16
  import { useSearchParams as de } from "react-router";
17
17
  //#region src/common/query-keys.ts
18
- var U = {
18
+ var W = {
19
19
  all: ["contenthub"],
20
- blockReasons: () => [...U.all, "block-reasons"],
21
- changeSets: () => [...U.all, "change-sets"],
22
- changeSetLists: () => [...U.changeSets(), "list"],
23
- changeSetList: (e) => [...U.changeSetLists(), e],
24
- openChangeSets: () => [...U.changeSetLists(), "open-picker"],
20
+ blockReasons: () => [...W.all, "block-reasons"],
21
+ changeSets: () => [...W.all, "change-sets"],
22
+ changeSetLists: () => [...W.changeSets(), "list"],
23
+ changeSetList: (e) => [...W.changeSetLists(), e],
24
+ openChangeSets: () => [...W.changeSetLists(), "open-picker"],
25
25
  changeSet: (e) => [
26
- ...U.changeSets(),
26
+ ...W.changeSets(),
27
27
  "detail",
28
28
  e
29
29
  ],
30
30
  publishReadiness: (e) => [
31
- ...U.changeSets(),
31
+ ...W.changeSets(),
32
32
  "readiness",
33
33
  e
34
34
  ],
35
- publishReadinessAt: (e, t) => [...U.publishReadiness(e), t],
35
+ publishReadinessAt: (e, t) => [...W.publishReadiness(e), t],
36
36
  checkStandings: (e) => [
37
- ...U.changeSets(),
37
+ ...W.changeSets(),
38
38
  "checks",
39
39
  e
40
40
  ],
41
- changeSetStatuses: () => [...U.all, "change-set-statuses"],
42
- requiredChecks: () => [...U.all, "required-checks"],
41
+ changeSetStatuses: () => [...W.all, "change-set-statuses"],
42
+ requiredChecks: () => [...W.all, "required-checks"],
43
43
  requiredCheckRecorders: (e) => [
44
- ...U.requiredChecks(),
44
+ ...W.requiredChecks(),
45
45
  "recorders",
46
46
  e
47
47
  ],
48
- collections: () => [...U.all, "collections"],
48
+ collections: () => [...W.all, "collections"],
49
49
  collectionGrants: (e) => [
50
- ...U.collections(),
50
+ ...W.collections(),
51
51
  "grants",
52
52
  e
53
53
  ],
54
- contents: () => [...U.all, "contents"],
55
- contentLists: () => [...U.contents(), "list"],
56
- contentList: (e) => [...U.contentLists(), e],
54
+ contents: () => [...W.all, "contents"],
55
+ contentLists: () => [...W.contents(), "list"],
56
+ contentList: (e) => [...W.contentLists(), e],
57
57
  content: (e) => [
58
- ...U.contents(),
58
+ ...W.contents(),
59
59
  "detail",
60
60
  e
61
61
  ],
62
62
  contentRead: (e, t) => [
63
- ...U.content(e),
63
+ ...W.content(e),
64
64
  "read",
65
65
  t
66
66
  ],
67
- contentTimeline: (e) => [...U.content(e), "timeline"],
67
+ contentTimeline: (e) => [...W.content(e), "timeline"],
68
68
  contentRevisions: (e, t) => [
69
- ...U.content(e),
69
+ ...W.content(e),
70
70
  "revisions",
71
71
  t
72
72
  ],
73
73
  contentCompare: (e, t, n) => [
74
- ...U.content(e),
74
+ ...W.content(e),
75
75
  "compare",
76
76
  t,
77
77
  n
78
78
  ],
79
79
  contentReferences: (e, t) => [
80
- ...U.content(e),
80
+ ...W.content(e),
81
81
  "references",
82
82
  t
83
83
  ],
84
- contentReferrers: (e) => [...U.content(e), "referrers"],
84
+ contentReferrers: (e) => [...W.content(e), "referrers"],
85
85
  contentOutdatedPins: (e, t) => [
86
- ...U.content(e),
86
+ ...W.content(e),
87
87
  "outdated-pins",
88
88
  t
89
89
  ],
90
- contentChangeSets: (e) => [...U.content(e), "change-sets"],
90
+ contentChangeSets: (e) => [...W.content(e), "change-sets"],
91
91
  chainPreview: (e, t, ...n) => [
92
- ...U.content(e),
92
+ ...W.content(e),
93
93
  "preview",
94
94
  t,
95
95
  ...n
96
96
  ],
97
97
  previewInForce: (e, t, n) => [
98
- ...U.content(e),
98
+ ...W.content(e),
99
99
  "preview-in-force",
100
100
  t,
101
101
  n
102
102
  ],
103
103
  pendingMerge: (e) => [
104
- ...U.all,
104
+ ...W.all,
105
105
  "pending-merge",
106
106
  e
107
107
  ],
108
- blueprints: () => [...U.all, "blueprints"],
108
+ blueprints: () => [...W.all, "blueprints"],
109
109
  blueprintNames: (e) => [
110
- ...U.blueprints(),
110
+ ...W.blueprints(),
111
111
  "names",
112
112
  e
113
113
  ],
114
- blueprintFilterOptions: () => [...U.blueprints(), "filter-options"],
114
+ blueprintFilterOptions: () => [...W.blueprints(), "filter-options"],
115
115
  blueprintReleases: (e) => [
116
- ...U.blueprints(),
116
+ ...W.blueprints(),
117
117
  "releases",
118
118
  e
119
119
  ]
120
- }, W = {
120
+ }, G = {
121
121
  common: { cancel: "Abbrechen" },
122
122
  settings: {
123
123
  section: "Einstellungen",
@@ -838,7 +838,7 @@ var U = {
838
838
  confirm: "Archivieren"
839
839
  }
840
840
  }
841
- }, G = {
841
+ }, fe = {
842
842
  common: { cancel: "Cancel" },
843
843
  settings: {
844
844
  section: "Settings",
@@ -1794,43 +1794,37 @@ var U = {
1794
1794
  }
1795
1795
  }
1796
1796
  }, K = "contenthub-ui", q = {
1797
- en: { [K]: G },
1798
- de: { [K]: W }
1799
- }, J = {
1797
+ en: { [K]: fe },
1798
+ de: { [K]: G }
1799
+ }, pe = {
1800
1800
  namespace: K,
1801
1801
  resources: q
1802
1802
  };
1803
1803
  //#endregion
1804
1804
  //#region src/common/blueprint-source.ts
1805
- function fe(e) {
1806
- let t = /* @__PURE__ */ new Map();
1805
+ function me(t) {
1807
1806
  return {
1808
- async searchBlueprints(n) {
1809
- let r = await e.searchBlueprints(n);
1810
- for (let e of r.blueprints) t.set(e.id, e);
1811
- return r;
1812
- },
1813
- async getBlueprints(e) {
1814
- return e.flatMap((e) => {
1815
- let n = t.get(e);
1816
- return n ? [{ ...n }] : [];
1817
- });
1807
+ searchBlueprints: (e) => t.searchBlueprints(e),
1808
+ async getBlueprints(n) {
1809
+ let r = [...new Set(n.filter((e) => e !== ""))], i = [];
1810
+ for (let t = 0; t < r.length; t += e) i.push(r.slice(t, t + e));
1811
+ return (await Promise.all(i.map((e) => t.getBlueprints(e)))).flat();
1818
1812
  },
1819
- listReleases: (t) => e.listBlueprintReleases(t)
1813
+ listReleases: (e) => t.listBlueprintReleases(e)
1820
1814
  };
1821
1815
  }
1822
- function pe(e, t) {
1823
- return a(() => t ?? fe(e), [e, t]);
1816
+ function he(e, t) {
1817
+ return o(() => t ?? me(e), [e, t]);
1824
1818
  }
1825
1819
  //#endregion
1826
1820
  //#region src/common/use-open-change-sets.ts
1827
- var me = 200;
1828
- function he(e, t = !0) {
1829
- return N({
1830
- queryKey: U.openChangeSets(),
1821
+ var J = 200;
1822
+ function ge(e, t = !0) {
1823
+ return P({
1824
+ queryKey: W.openChangeSets(),
1831
1825
  queryFn: () => e.listChangeSets({
1832
1826
  state: "open",
1833
- pageSize: me
1827
+ pageSize: J
1834
1828
  }),
1835
1829
  enabled: t
1836
1830
  });
@@ -1838,20 +1832,20 @@ function he(e, t = !0) {
1838
1832
  //#endregion
1839
1833
  //#region src/screens/collection-tree.tsx
1840
1834
  var Y = "__all__";
1841
- function ge(e, t) {
1835
+ function _e(e, t) {
1842
1836
  let n = new Map(t.map((e) => [e.id, e])), r = [], i = /* @__PURE__ */ new Set(), a = n.get(e);
1843
1837
  for (; a && !i.has(a.id);) i.add(a.id), r.unshift(a), a = n.get(a.parentId);
1844
1838
  return r;
1845
1839
  }
1846
1840
  function X() {
1847
1841
  let { t: e } = I(K);
1848
- return /* @__PURE__ */ l(F, {
1842
+ return /* @__PURE__ */ u(se, {
1849
1843
  size: 12,
1850
1844
  "aria-label": e("library.restricted")
1851
1845
  });
1852
1846
  }
1853
- function _e({ collections: e, activeId: t, onSelect: n }) {
1854
- let { t: r } = I(K), i = a(() => new Map(e.map((e) => [e.id, e])), [e]), o = a(() => {
1847
+ function ve({ collections: e, activeId: t, onSelect: n }) {
1848
+ let { t: r } = I(K), i = o(() => new Map(e.map((e) => [e.id, e])), [e]), a = o(() => {
1855
1849
  let t = /* @__PURE__ */ new Map();
1856
1850
  for (let n of e) {
1857
1851
  let e = n.parentId !== "" && i.has(n.parentId) ? n.parentId : "", r = t.get(e) ?? [];
@@ -1888,24 +1882,24 @@ function _e({ collections: e, activeId: t, onSelect: n }) {
1888
1882
  e,
1889
1883
  i,
1890
1884
  r
1891
- ]), [c] = s(() => ge(t, e).slice(0, -1).map((e) => e.id));
1892
- return /* @__PURE__ */ u(C, {
1893
- collection: o,
1885
+ ]), [s] = c(() => _e(t, e).slice(0, -1).map((e) => e.id));
1886
+ return /* @__PURE__ */ d(w, {
1887
+ collection: a,
1894
1888
  size: "sm",
1895
1889
  selectedValue: [t === "" ? Y : t],
1896
- defaultExpandedValue: c,
1890
+ defaultExpandedValue: s,
1897
1891
  onSelectionChange: (e) => {
1898
1892
  let t = e.selectedValue[0];
1899
1893
  t !== void 0 && n(t === Y ? "" : t);
1900
1894
  },
1901
- children: [/* @__PURE__ */ l(S, {
1895
+ children: [/* @__PURE__ */ u(ee, {
1902
1896
  srOnly: !0,
1903
1897
  children: r("library.collections")
1904
- }), /* @__PURE__ */ l(w, { children: /* @__PURE__ */ l(ee, { render: ({ node: e, nodeState: t }) => t.isBranch ? /* @__PURE__ */ u(_, { children: [
1905
- /* @__PURE__ */ l(v, { children: /* @__PURE__ */ l(P, { size: 14 }) }),
1906
- /* @__PURE__ */ l(y, { children: e.name }),
1907
- e.restricted ? /* @__PURE__ */ l(X, {}) : null
1908
- ] }) : /* @__PURE__ */ u(b, { children: [/* @__PURE__ */ l(x, { children: e.name }), e.restricted ? /* @__PURE__ */ l(X, {}) : null] }) }) })]
1898
+ }), /* @__PURE__ */ u(T, { children: /* @__PURE__ */ u(C, { render: ({ node: e, nodeState: t }) => t.isBranch ? /* @__PURE__ */ d(v, { children: [
1899
+ /* @__PURE__ */ u(y, { children: /* @__PURE__ */ u(F, { size: 14 }) }),
1900
+ /* @__PURE__ */ u(b, { children: e.name }),
1901
+ e.restricted ? /* @__PURE__ */ u(X, {}) : null
1902
+ ] }) : /* @__PURE__ */ d(x, { children: [/* @__PURE__ */ u(S, { children: e.name }), e.restricted ? /* @__PURE__ */ u(X, {}) : null] }) }) })]
1909
1903
  });
1910
1904
  }
1911
1905
  //#endregion
@@ -1914,94 +1908,94 @@ var Z = {
1914
1908
  name: "",
1915
1909
  sourceDate: "",
1916
1910
  sourceReference: ""
1917
- }, ve = "contenthub-create-change-set", Q = /^[^\u0000-\u001f\u007f]*$/;
1918
- function ye({ open: t, onClose: n, onSubmit: r }) {
1919
- let { t: o } = I(K), c = a(() => H.object({
1920
- name: H.string().trim().min(1, o("changeSets.form.nameRequired")).max(200, o("changeSets.form.tooLong", { max: 200 })).regex(Q, o("changeSets.form.oneLine")),
1921
- sourceDate: H.string().trim(),
1922
- sourceReference: H.string().trim().max(500, o("changeSets.form.tooLong", { max: 500 })).regex(Q, o("changeSets.form.oneLine"))
1911
+ }, ye = "contenthub-create-change-set", Q = /^[^\u0000-\u001f\u007f]*$/;
1912
+ function be({ open: e, onClose: n, onSubmit: r }) {
1913
+ let { t: i } = I(K), s = o(() => U.object({
1914
+ name: U.string().trim().min(1, i("changeSets.form.nameRequired")).max(200, i("changeSets.form.tooLong", { max: 200 })).regex(Q, i("changeSets.form.oneLine")),
1915
+ sourceDate: U.string().trim(),
1916
+ sourceReference: U.string().trim().max(500, i("changeSets.form.tooLong", { max: 500 })).regex(Q, i("changeSets.form.oneLine"))
1923
1917
  }).superRefine((e, t) => {
1924
1918
  e.sourceReference !== "" && e.sourceDate === "" && t.addIssue({
1925
1919
  code: "custom",
1926
1920
  path: ["sourceDate"],
1927
- message: o("changeSets.form.sourceDateRequired")
1921
+ message: i("changeSets.form.sourceDateRequired")
1928
1922
  }), e.sourceDate !== "" && e.sourceReference === "" && t.addIssue({
1929
1923
  code: "custom",
1930
1924
  path: ["sourceReference"],
1931
- message: o("changeSets.form.sourceReferenceRequired")
1925
+ message: i("changeSets.form.sourceReferenceRequired")
1932
1926
  });
1933
- }), [o]), f = B({
1934
- resolver: ce(c),
1927
+ }), [i]), l = le({
1928
+ resolver: L(s),
1935
1929
  defaultValues: Z
1936
- }), [p, m] = s(null), g = f.formState.isSubmitting;
1937
- i(() => {
1938
- t && (f.reset(Z), m(null));
1939
- }, [t, f]);
1940
- let _ = f.handleSubmit(async (t) => {
1930
+ }), [p, m] = c(null), h = l.formState.isSubmitting;
1931
+ a(() => {
1932
+ e && (l.reset(Z), m(null));
1933
+ }, [e, l]);
1934
+ let _ = l.handleSubmit(async (e) => {
1941
1935
  m(null);
1942
1936
  try {
1943
1937
  await r({
1944
- name: t.name,
1945
- source: t.sourceDate === "" ? void 0 : {
1946
- date: t.sourceDate,
1947
- reference: t.sourceReference
1938
+ name: e.name,
1939
+ source: e.sourceDate === "" ? void 0 : {
1940
+ date: e.sourceDate,
1941
+ reference: e.sourceReference
1948
1942
  }
1949
1943
  });
1950
- } catch (t) {
1951
- m(t instanceof e ? t.message : o("changeSets.form.failed"));
1944
+ } catch (e) {
1945
+ m(e instanceof t ? e.message : i("changeSets.form.failed"));
1952
1946
  }
1953
1947
  });
1954
- return /* @__PURE__ */ l(h, {
1955
- open: t,
1948
+ return /* @__PURE__ */ u(g, {
1949
+ open: e,
1956
1950
  onClose: n,
1957
1951
  lazyMount: !0,
1958
1952
  unmountOnExit: !0,
1959
1953
  size: "md",
1960
- header: o("changeSets.form.createTitle"),
1961
- footer: /* @__PURE__ */ u(te, {
1954
+ header: i("changeSets.form.createTitle"),
1955
+ footer: /* @__PURE__ */ d(O, {
1962
1956
  gap: "2",
1963
- children: [/* @__PURE__ */ l(d, {
1957
+ children: [/* @__PURE__ */ u(f, {
1964
1958
  size: "sm",
1965
1959
  variant: "ghost",
1966
1960
  onClick: n,
1967
- children: o("common.cancel")
1968
- }), /* @__PURE__ */ l(d, {
1961
+ children: i("common.cancel")
1962
+ }), /* @__PURE__ */ u(f, {
1969
1963
  type: "submit",
1970
- form: ve,
1964
+ form: ye,
1971
1965
  size: "sm",
1972
1966
  variant: "solid",
1973
- loading: g,
1974
- children: o("changeSets.form.createSubmit")
1967
+ loading: h,
1968
+ children: i("changeSets.form.createSubmit")
1975
1969
  })]
1976
1970
  }),
1977
- children: /* @__PURE__ */ l(z, {
1978
- ...f,
1979
- children: /* @__PURE__ */ l("form", {
1980
- id: ve,
1971
+ children: /* @__PURE__ */ u(V, {
1972
+ ...l,
1973
+ children: /* @__PURE__ */ u("form", {
1974
+ id: ye,
1981
1975
  onSubmit: (e) => {
1982
1976
  e.preventDefault(), _();
1983
1977
  },
1984
- children: /* @__PURE__ */ u(k, {
1978
+ children: /* @__PURE__ */ d(j, {
1985
1979
  gap: "4",
1986
1980
  children: [
1987
- /* @__PURE__ */ l(R, {
1981
+ /* @__PURE__ */ u(z, {
1988
1982
  name: "name",
1989
- label: o("changeSets.form.name"),
1990
- helperText: o("changeSets.form.nameHelp"),
1983
+ label: i("changeSets.form.name"),
1984
+ helperText: i("changeSets.form.nameHelp"),
1991
1985
  required: !0
1992
1986
  }),
1993
- /* @__PURE__ */ l(R, {
1987
+ /* @__PURE__ */ u(z, {
1994
1988
  name: "sourceDate",
1995
1989
  type: "date",
1996
- label: o("changeSets.form.sourceDate"),
1997
- helperText: o("changeSets.form.sourceDateHelp")
1990
+ label: i("changeSets.form.sourceDate"),
1991
+ helperText: i("changeSets.form.sourceDateHelp")
1998
1992
  }),
1999
- /* @__PURE__ */ l(R, {
1993
+ /* @__PURE__ */ u(z, {
2000
1994
  name: "sourceReference",
2001
- label: o("changeSets.form.sourceReference"),
2002
- helperText: o("changeSets.form.sourceReferenceHelp")
1995
+ label: i("changeSets.form.sourceReference"),
1996
+ helperText: i("changeSets.form.sourceReferenceHelp")
2003
1997
  }),
2004
- p ? /* @__PURE__ */ l(D, {
1998
+ p ? /* @__PURE__ */ u(D, {
2005
1999
  status: "error",
2006
2000
  title: p
2007
2001
  }) : null
@@ -2013,8 +2007,8 @@ function ye({ open: t, onClose: n, onSubmit: r }) {
2013
2007
  }
2014
2008
  //#endregion
2015
2009
  //#region src/screens/change-set-choice.tsx
2016
- var be = "@new";
2017
- function xe(e, t, n = !1) {
2010
+ var xe = "@new";
2011
+ function Se(e, t, n = !1) {
2018
2012
  if (!t.changeSetId) return {
2019
2013
  path: "changeSetId",
2020
2014
  message: e("library.create.changeSetRequired")
@@ -2032,37 +2026,37 @@ function xe(e, t, n = !1) {
2032
2026
  message: e("changeSets.form.oneLine")
2033
2027
  };
2034
2028
  }
2035
- function Se({ client: e, open: t, helperText: n, nameHelperText: r, nameOptional: i = !1 }) {
2036
- let { t: o } = I(K), s = he(e, t), d = a(() => [{
2037
- id: be,
2038
- label: o("library.create.newChangeSet")
2029
+ function Ce({ client: e, open: t, helperText: n, nameHelperText: r, nameOptional: i = !1 }) {
2030
+ let { t: a } = I(K), s = ge(e, t), c = o(() => [{
2031
+ id: xe,
2032
+ label: a("library.create.newChangeSet")
2039
2033
  }, ...(s.data?.changeSets ?? []).map((e) => ({
2040
2034
  id: e.id,
2041
2035
  label: e.name
2042
- }))], [s.data, o]), f = V({ name: "changeSetId" });
2043
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(L, {
2036
+ }))], [s.data, a]), f = H({ name: "changeSetId" });
2037
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(R, {
2044
2038
  name: "changeSetId",
2045
- label: o("library.create.changeSet"),
2039
+ label: a("library.create.changeSet"),
2046
2040
  helperText: n,
2047
- options: d,
2041
+ options: c,
2048
2042
  isClearable: !1,
2049
2043
  required: !0
2050
- }), f === "@new" ? /* @__PURE__ */ l(R, {
2044
+ }), f === "@new" ? /* @__PURE__ */ u(z, {
2051
2045
  name: "changeSetName",
2052
- label: o("library.create.changeSetName"),
2053
- helperText: r ?? o("changeSets.form.nameHelp"),
2046
+ label: a("library.create.changeSetName"),
2047
+ helperText: r ?? a("changeSets.form.nameHelp"),
2054
2048
  required: !i
2055
2049
  }) : null] });
2056
2050
  }
2057
2051
  //#endregion
2058
2052
  //#region src/screens/create-content-modal.tsx
2059
- var Ce = "contenthub-create-content", $ = (e) => !e.refusals?.length, we = (e) => e.path ? `${e.code} (${e.path})` : e.code;
2060
- function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeSetId: g, onCreated: _ }) {
2061
- let { t: v } = I(K), y = ae(), b = a(() => H.object({
2062
- blueprintId: H.string().nullable().refine((e) => !!e, v("library.create.blueprintRequired")),
2063
- releaseId: H.string().nullable().refine((e) => !!e, v("library.create.releaseRequired")),
2064
- changeSetId: H.string().nullable().refine((e) => !!e, v("library.create.changeSetRequired")),
2065
- changeSetName: H.string().trim()
2053
+ var we = "contenthub-create-content", $ = (e) => !e.refusals?.length, Te = (e) => e.path ? `${e.code} (${e.path})` : e.code;
2054
+ function Ee({ open: e, onClose: l, client: p, blueprintSource: m, initialChangeSetId: h, onCreated: _ }) {
2055
+ let { t: v } = I(K), y = ae(), b = o(() => U.object({
2056
+ blueprintId: U.string().nullable().refine((e) => !!e, v("library.create.blueprintRequired")),
2057
+ releaseId: U.string().nullable().refine((e) => !!e, v("library.create.releaseRequired")),
2058
+ changeSetId: U.string().nullable().refine((e) => !!e, v("library.create.changeSetRequired")),
2059
+ changeSetName: U.string().trim()
2066
2060
  }).superRefine((e, t) => {
2067
2061
  if (e.changeSetId !== "@new") return;
2068
2062
  let n = (e) => t.addIssue({
@@ -2071,46 +2065,46 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
2071
2065
  message: e
2072
2066
  });
2073
2067
  e.changeSetName === "" ? n(v("changeSets.form.nameRequired")) : [...e.changeSetName].length > 200 ? n(v("changeSets.form.tooLong", { max: 200 })) : Q.test(e.changeSetName) || n(v("changeSets.form.oneLine"));
2074
- }), [v]), x = a(() => ({
2068
+ }), [v]), x = o(() => ({
2075
2069
  blueprintId: null,
2076
2070
  releaseId: null,
2077
- changeSetId: g || "@new",
2071
+ changeSetId: h || "@new",
2078
2072
  changeSetName: ""
2079
- }), [g]), S = B({
2080
- resolver: ce(b),
2073
+ }), [h]), S = le({
2074
+ resolver: L(b),
2081
2075
  defaultValues: x
2082
- }), [ee, C] = s(null), w = S.formState.isSubmitting, T = V({
2076
+ }), [ee, C] = c(null), w = S.formState.isSubmitting, T = H({
2083
2077
  control: S.control,
2084
2078
  name: "blueprintId"
2085
- }), E = V({
2079
+ }), te = H({
2086
2080
  control: S.control,
2087
2081
  name: "changeSetId"
2088
2082
  });
2089
- i(() => {
2090
- c && (S.reset(x), C(null));
2083
+ a(() => {
2084
+ e && (S.reset(x), C(null));
2091
2085
  }, [
2092
- c,
2086
+ e,
2093
2087
  S,
2094
2088
  x
2095
2089
  ]);
2096
- let O = he(p, c), ne = a(() => [{
2097
- id: be,
2090
+ let E = ge(p, e), k = o(() => [{
2091
+ id: xe,
2098
2092
  label: v("library.create.newChangeSet")
2099
- }, ...(O.data?.changeSets ?? []).map((e) => ({
2093
+ }, ...(E.data?.changeSets ?? []).map((e) => ({
2100
2094
  id: e.id,
2101
2095
  label: e.name
2102
- }))], [O.data, v]), j = N({
2103
- queryKey: U.blueprintReleases(T ?? ""),
2096
+ }))], [E.data, v]), A = P({
2097
+ queryKey: W.blueprintReleases(T ?? ""),
2104
2098
  queryFn: () => m.listReleases(T),
2105
- enabled: c && !!T
2106
- }), M = a(() => (j.data ?? []).map((e) => ({
2099
+ enabled: e && !!T
2100
+ }), ne = o(() => (A.data ?? []).map((e) => ({
2107
2101
  id: e.id,
2108
2102
  label: $(e) ? e.name : v("library.create.refusedRelease", { name: e.name }),
2109
2103
  data: { refused: !$(e) }
2110
- })), [j.data, v]), re = a(() => (j.data ?? []).filter((e) => !$(e)), [j.data]), ie = o(T);
2111
- i(() => {
2112
- ie.current !== T && (ie.current = T, S.setValue("releaseId", null));
2113
- let e = S.getValues("releaseId"), t = j.data;
2104
+ })), [A.data, v]), N = o(() => (A.data ?? []).filter((e) => !$(e)), [A.data]), re = s(T);
2105
+ a(() => {
2106
+ re.current !== T && (re.current = T, S.setValue("releaseId", null));
2107
+ let e = S.getValues("releaseId"), t = A.data;
2114
2108
  if (!T) {
2115
2109
  e !== null && S.setValue("releaseId", null);
2116
2110
  return;
@@ -2118,10 +2112,10 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
2118
2112
  t && !t.some((t) => t.id === e && $(t)) && S.setValue("releaseId", t.find($)?.id ?? null);
2119
2113
  }, [
2120
2114
  T,
2121
- j.data,
2115
+ A.data,
2122
2116
  S
2123
2117
  ]);
2124
- let P = !!T && j.isSuccess && j.data.length === 0, oe = !!T && j.isSuccess && j.data.length > 0 && !j.data.some($), F = r(async ({ query: e, cursor: t, signal: n }) => {
2118
+ let ie = !!T && A.isSuccess && A.data.length === 0, F = !!T && A.isSuccess && A.data.length > 0 && !A.data.some($), oe = i(async ({ query: e, cursor: t, signal: n }) => {
2125
2119
  let r = await m.searchBlueprints({
2126
2120
  query: e,
2127
2121
  pageToken: t ?? void 0,
@@ -2134,13 +2128,13 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
2134
2128
  })),
2135
2129
  nextCursor: r.nextPageToken || null
2136
2130
  };
2137
- }, [m]), se = r(async ({ ids: e }) => {
2131
+ }, [m]), se = i(async ({ ids: e }) => {
2138
2132
  let t = await m.getBlueprints(e);
2139
2133
  return e.map((e) => ({
2140
2134
  id: e,
2141
2135
  label: t.find((t) => t.id === e)?.name ?? e
2142
2136
  }));
2143
- }, [m]), ue = S.handleSubmit(async (e) => {
2137
+ }, [m]), ce = S.handleSubmit(async (e) => {
2144
2138
  C(null);
2145
2139
  let t = e.changeSetId, n = !1;
2146
2140
  try {
@@ -2152,112 +2146,112 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
2152
2146
  changeSetId: t,
2153
2147
  blueprintReleaseId: e.releaseId
2154
2148
  });
2155
- y.invalidateQueries({ queryKey: U.contents() }), _(r);
2149
+ y.invalidateQueries({ queryKey: W.contents() }), _(r);
2156
2150
  } catch (e) {
2157
- if (C(de(e)), !n) return;
2151
+ if (C(ue(e)), !n) return;
2158
2152
  }
2159
- y.invalidateQueries({ queryKey: U.changeSets() });
2153
+ y.invalidateQueries({ queryKey: W.changeSets() });
2160
2154
  });
2161
- function de(r) {
2162
- if (r instanceof n) {
2163
- let e = r.reasons.map(we).join(", ");
2164
- return v("library.create.refused", { reasons: e });
2155
+ function ue(e) {
2156
+ if (e instanceof r) {
2157
+ let t = e.reasons.map(Te).join(", ");
2158
+ return v("library.create.refused", { reasons: t });
2165
2159
  }
2166
- return r instanceof t ? v("library.create.changeSetClosed") : r instanceof e ? r.message : v("library.create.failed");
2160
+ return e instanceof n ? v("library.create.changeSetClosed") : e instanceof t ? e.message : v("library.create.failed");
2167
2161
  }
2168
- return /* @__PURE__ */ l(h, {
2169
- open: c,
2170
- onClose: f,
2162
+ return /* @__PURE__ */ u(g, {
2163
+ open: e,
2164
+ onClose: l,
2171
2165
  lazyMount: !0,
2172
2166
  unmountOnExit: !0,
2173
2167
  size: "md",
2174
2168
  header: v("library.create.title"),
2175
- footer: /* @__PURE__ */ u(te, {
2169
+ footer: /* @__PURE__ */ d(O, {
2176
2170
  gap: "2",
2177
- children: [/* @__PURE__ */ l(d, {
2171
+ children: [/* @__PURE__ */ u(f, {
2178
2172
  size: "sm",
2179
2173
  variant: "ghost",
2180
- onClick: f,
2174
+ onClick: l,
2181
2175
  children: v("common.cancel")
2182
- }), /* @__PURE__ */ l(d, {
2176
+ }), /* @__PURE__ */ u(f, {
2183
2177
  type: "submit",
2184
- form: Ce,
2178
+ form: we,
2185
2179
  size: "sm",
2186
2180
  variant: "solid",
2187
2181
  loading: w,
2188
- disabled: P || oe || j.isError,
2182
+ disabled: ie || F || A.isError,
2189
2183
  children: v("library.create.submit")
2190
2184
  })]
2191
2185
  }),
2192
- children: /* @__PURE__ */ l(z, {
2186
+ children: /* @__PURE__ */ u(V, {
2193
2187
  ...S,
2194
- children: /* @__PURE__ */ l("form", {
2195
- id: Ce,
2188
+ children: /* @__PURE__ */ u("form", {
2189
+ id: we,
2196
2190
  onSubmit: (e) => {
2197
- e.preventDefault(), ue();
2191
+ e.preventDefault(), ce();
2198
2192
  },
2199
- children: /* @__PURE__ */ u(k, {
2193
+ children: /* @__PURE__ */ d(j, {
2200
2194
  gap: "4",
2201
2195
  children: [
2202
- /* @__PURE__ */ l(le, {
2196
+ /* @__PURE__ */ u(B, {
2203
2197
  name: "blueprintId",
2204
2198
  label: v("library.create.blueprint"),
2205
2199
  helperText: v("library.create.blueprintHelp"),
2206
- search: F,
2200
+ search: oe,
2207
2201
  resolve: se,
2208
2202
  placeholder: v("library.create.pickBlueprint"),
2209
2203
  required: !0
2210
2204
  }),
2211
- T ? /* @__PURE__ */ l(L, {
2205
+ T ? /* @__PURE__ */ u(R, {
2212
2206
  name: "releaseId",
2213
2207
  label: v("library.create.release"),
2214
2208
  helperText: v("library.create.releaseHelp"),
2215
- options: M,
2209
+ options: ne,
2216
2210
  isClearable: !1,
2217
2211
  required: !0,
2218
2212
  selectProps: { isOptionDisabled: (e) => e.data?.refused === !0 }
2219
2213
  }) : null,
2220
- P ? /* @__PURE__ */ l(D, {
2214
+ ie ? /* @__PURE__ */ u(D, {
2221
2215
  status: "warning",
2222
2216
  title: v("library.create.noRelease")
2223
2217
  }) : null,
2224
- oe ? /* @__PURE__ */ l(D, {
2218
+ F ? /* @__PURE__ */ u(D, {
2225
2219
  status: "warning",
2226
2220
  title: v("library.create.noUsableRelease")
2227
2221
  }) : null,
2228
- j.isError ? /* @__PURE__ */ l(D, {
2222
+ A.isError ? /* @__PURE__ */ u(D, {
2229
2223
  status: "error",
2230
2224
  title: v("library.create.releasesFailed")
2231
2225
  }) : null,
2232
- re.length > 0 ? /* @__PURE__ */ l(D, {
2226
+ N.length > 0 ? /* @__PURE__ */ u(D, {
2233
2227
  status: "info",
2234
2228
  title: v("library.create.refusedReleases"),
2235
- children: /* @__PURE__ */ l(k, {
2229
+ children: /* @__PURE__ */ u(j, {
2236
2230
  gap: "1",
2237
- children: re.map((e) => /* @__PURE__ */ l(A, {
2231
+ children: N.map((e) => /* @__PURE__ */ u(M, {
2238
2232
  textStyle: "sm",
2239
2233
  children: v("library.create.refusedReleaseReasons", {
2240
2234
  name: e.name,
2241
- reasons: (e.refusals ?? []).map(we).join(", ")
2235
+ reasons: (e.refusals ?? []).map(Te).join(", ")
2242
2236
  })
2243
2237
  }, e.id))
2244
2238
  })
2245
2239
  }) : null,
2246
- /* @__PURE__ */ l(L, {
2240
+ /* @__PURE__ */ u(R, {
2247
2241
  name: "changeSetId",
2248
2242
  label: v("library.create.changeSet"),
2249
2243
  helperText: v("library.create.changeSetHelp"),
2250
- options: ne,
2244
+ options: k,
2251
2245
  isClearable: !1,
2252
2246
  required: !0
2253
2247
  }),
2254
- E === "@new" ? /* @__PURE__ */ l(R, {
2248
+ te === "@new" ? /* @__PURE__ */ u(z, {
2255
2249
  name: "changeSetName",
2256
2250
  label: v("library.create.changeSetName"),
2257
2251
  helperText: v("changeSets.form.nameHelp"),
2258
2252
  required: !0
2259
2253
  }) : null,
2260
- ee ? /* @__PURE__ */ l(D, {
2254
+ ee ? /* @__PURE__ */ u(D, {
2261
2255
  status: "error",
2262
2256
  title: ee
2263
2257
  }) : null
@@ -2269,66 +2263,66 @@ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeS
2269
2263
  }
2270
2264
  //#endregion
2271
2265
  //#region src/screens/content-library.tsx
2272
- var Ee = [
2266
+ var De = [
2273
2267
  "main",
2274
2268
  "in_force",
2275
2269
  "change_set"
2276
- ], De = 50, Oe = 300, ke = 5, Ae = "@me", je = "collection";
2277
- function Me(e) {
2270
+ ], Oe = 50, ke = 300, Ae = 5, je = "@me", Me = "collection";
2271
+ function Ne(e) {
2278
2272
  return Object.values(e).filter((e) => typeof e == "string" && e.trim() !== "" && e.length <= 200).slice(0, 2).join(" ");
2279
2273
  }
2280
- function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }) {
2281
- let { t: h } = I(K), _ = pe(t, n), [v, y] = de(), b = v.get("collection") ?? "", [x, S] = s("main"), [ee, C] = s(""), [w, E] = s(""), [ae, P] = s(""), [F, ce] = s(""), [L, R] = s(""), [le, z] = s(!1), { userId: B, members: V } = ue();
2282
- i(() => {
2283
- let e = setTimeout(() => P(w), Oe);
2274
+ function Pe({ client: e, blueprintSource: n, onOpenContent: r, onOpenBranch: s }) {
2275
+ let { t: l } = I(K), g = he(e, n), [v, y] = de(), b = v.get("collection") ?? "", [x, S] = c("main"), [ee, C] = c(""), [w, T] = c(""), [E, ae] = c(""), [F, se] = c(""), [L, R] = c(""), [z, B] = c(!1), { userId: V, members: le } = ue();
2276
+ a(() => {
2277
+ let e = setTimeout(() => ae(w), ke);
2284
2278
  return () => clearTimeout(e);
2285
2279
  }, [w]);
2286
- let H = r((e) => y((t) => {
2280
+ let H = i((e) => y((t) => {
2287
2281
  let n = new URLSearchParams(t);
2288
- return e ? n.set(je, e) : n.delete(je), n;
2289
- }), [y]), W = N({
2290
- queryKey: U.collections(),
2291
- queryFn: () => t.listCollections()
2292
- }), G = he(t), q = r((e) => G.data?.changeSets.find((t) => t.id === e)?.name ?? e, [G.data]), J = ee || G.data?.changeSets[0]?.id || "", fe = a(() => x === "change_set" ? J ? {
2282
+ return e ? n.set(Me, e) : n.delete(Me), n;
2283
+ }), [y]), U = P({
2284
+ queryKey: W.collections(),
2285
+ queryFn: () => e.listCollections()
2286
+ }), G = ge(e), fe = i((e) => G.data?.changeSets.find((t) => t.id === e)?.name ?? e, [G.data]), q = ee || G.data?.changeSets[0]?.id || "", pe = o(() => x === "change_set" ? q ? {
2293
2287
  kind: "change_set",
2294
- changeSetId: J
2295
- } : void 0 : { kind: x }, [x, J]), me = a(() => ({
2296
- view: fe,
2288
+ changeSetId: q
2289
+ } : void 0 : { kind: x }, [x, q]), me = o(() => ({
2290
+ view: pe,
2297
2291
  collectionId: b || void 0,
2298
- search: x === "in_force" ? void 0 : ae.trim() || void 0,
2292
+ search: x === "in_force" ? void 0 : E.trim() || void 0,
2299
2293
  blueprintIds: F ? [F] : void 0,
2300
- assigneeId: L === Ae ? B : L || void 0
2294
+ assigneeId: L === je ? V : L || void 0
2301
2295
  }), [
2302
- fe,
2296
+ pe,
2303
2297
  b,
2304
2298
  x,
2305
- ae,
2299
+ E,
2306
2300
  F,
2307
2301
  L,
2308
- B
2309
- ]), Y = ie({
2310
- queryKey: U.contentList(me),
2311
- queryFn: ({ pageParam: e }) => t.listContents({
2302
+ V
2303
+ ]), J = ie({
2304
+ queryKey: W.contentList(me),
2305
+ queryFn: ({ pageParam: t }) => e.listContents({
2312
2306
  ...me,
2313
- pageSize: De,
2314
- pageToken: e
2307
+ pageSize: Oe,
2308
+ pageToken: t
2315
2309
  }),
2316
2310
  initialPageParam: "",
2317
2311
  getNextPageParam: (e) => e.nextPageToken || void 0,
2318
- enabled: fe !== void 0,
2312
+ enabled: pe !== void 0,
2319
2313
  placeholderData: re
2320
- }), X = a(() => Y.data?.pages.flatMap((e) => e.contents) ?? [], [Y.data]), Z = a(() => [...new Set(X.map((e) => e.blueprintId))].sort(), [X]), ve = N({
2321
- queryKey: U.blueprintNames(Z),
2322
- queryFn: () => _.getBlueprints(Z),
2323
- enabled: Z.length > 0,
2314
+ }), Y = o(() => J.data?.pages.flatMap((e) => e.contents) ?? [], [J.data]), X = o(() => [...new Set(Y.map((e) => e.blueprintId))].sort(), [Y]), Z = P({
2315
+ queryKey: W.blueprintNames(X),
2316
+ queryFn: () => g.getBlueprints(X),
2317
+ enabled: X.length > 0,
2324
2318
  placeholderData: re,
2325
2319
  staleTime: 6e4
2326
- }), Q = r((e) => ve.data?.find((t) => t.id === e)?.name ?? e, [ve.data]), ye = N({
2327
- queryKey: U.blueprintFilterOptions(),
2320
+ }), ye = i((e) => Z.data?.find((t) => t.id === e)?.name ?? e, [Z.data]), Q = P({
2321
+ queryKey: W.blueprintFilterOptions(),
2328
2322
  queryFn: async () => {
2329
2323
  let e = [], t = "";
2330
- for (let n = 0; n < ke; n++) {
2331
- let n = await _.searchBlueprints({
2324
+ for (let n = 0; n < Ae; n++) {
2325
+ let n = await g.searchBlueprints({
2332
2326
  query: "",
2333
2327
  pageToken: t
2334
2328
  });
@@ -2337,13 +2331,22 @@ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }
2337
2331
  return e;
2338
2332
  },
2339
2333
  staleTime: 6e4
2340
- }), be = a(() => [
2334
+ }), be = o(() => /* @__PURE__ */ new Map(), [g]), xe = o(() => {
2335
+ for (let e of Z.data ?? []) be.set(e.id, e);
2336
+ let e = new Map(be);
2337
+ for (let t of Q.data ?? []) e.set(t.id, t);
2338
+ return [...e.values()].sort((e, t) => e.name.localeCompare(t.name));
2339
+ }, [
2340
+ be,
2341
+ Q.data,
2342
+ Z.data
2343
+ ]), Se = o(() => [
2341
2344
  {
2342
2345
  id: "content",
2343
- header: h("library.columns.content"),
2346
+ header: l("library.columns.content"),
2344
2347
  cell: ({ row: e }) => {
2345
- let t = Me(e.original.data);
2346
- return /* @__PURE__ */ l(T, {
2348
+ let t = Ne(e.original.data);
2349
+ return /* @__PURE__ */ u(te, {
2347
2350
  value: t || e.original.id,
2348
2351
  subText: t ? e.original.id : void 0
2349
2352
  });
@@ -2351,178 +2354,178 @@ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }
2351
2354
  },
2352
2355
  {
2353
2356
  id: "blueprint",
2354
- header: h("library.columns.blueprint"),
2355
- cell: ({ row: e }) => /* @__PURE__ */ l(T, { value: Q(e.original.blueprintId) })
2357
+ header: l("library.columns.blueprint"),
2358
+ cell: ({ row: e }) => /* @__PURE__ */ u(te, { value: ye(e.original.blueprintId) })
2356
2359
  },
2357
2360
  {
2358
2361
  id: "readOn",
2359
- header: h("library.columns.readOn"),
2362
+ header: l("library.columns.readOn"),
2360
2363
  cell: ({ row: e }) => {
2361
- let t = e.original, n = t.changeSetId ? q(t.changeSetId) : t.releaseId ? h("library.readOn.release") : h("library.readOn.main");
2362
- return /* @__PURE__ */ l(T, { value: n });
2364
+ let t = e.original, n = t.changeSetId ? fe(t.changeSetId) : t.releaseId ? l("library.readOn.release") : l("library.readOn.main");
2365
+ return /* @__PURE__ */ u(te, { value: n });
2363
2366
  }
2364
2367
  },
2365
2368
  {
2366
2369
  id: "revised",
2367
- header: h("library.columns.revised"),
2368
- cell: ({ row: e }) => /* @__PURE__ */ l(m, { value: e.original.revisionCreateTime })
2370
+ header: l("library.columns.revised"),
2371
+ cell: ({ row: e }) => /* @__PURE__ */ u(h, { value: e.original.revisionCreateTime })
2369
2372
  }
2370
2373
  ], [
2371
- h,
2372
- Q,
2373
- q
2374
- ]), xe = /* @__PURE__ */ u(d, {
2374
+ l,
2375
+ ye,
2376
+ fe
2377
+ ]), Ce = /* @__PURE__ */ d(f, {
2375
2378
  size: "sm",
2376
2379
  variant: "solid",
2377
- onClick: () => z(!0),
2378
- children: [/* @__PURE__ */ l(se, { size: 16 }), h("library.create.button")]
2379
- }), Se = Y.error instanceof e ? Y.error.message : h("library.loadError"), Ce = b ? ge(b, W.data ?? []).map((e) => e.name).join(" / ") || b : h("library.allContent");
2380
- return /* @__PURE__ */ u(j, {
2381
- title: h("library.title"),
2382
- breadcrumbs: [{ label: h("library.title") }],
2383
- actions: xe,
2384
- toolbar: /* @__PURE__ */ u(g, { children: [
2385
- x === "in_force" ? /* @__PURE__ */ l(A, {
2380
+ onClick: () => B(!0),
2381
+ children: [/* @__PURE__ */ u(ce, { size: 16 }), l("library.create.button")]
2382
+ }), we = J.error instanceof t ? J.error.message : l("library.loadError"), $ = b ? _e(b, U.data ?? []).map((e) => e.name).join(" / ") || b : l("library.allContent");
2383
+ return /* @__PURE__ */ d(ne, {
2384
+ title: l("library.title"),
2385
+ breadcrumbs: [{ label: l("library.title") }],
2386
+ actions: Ce,
2387
+ toolbar: /* @__PURE__ */ d(_, { children: [
2388
+ x === "in_force" ? /* @__PURE__ */ u(M, {
2386
2389
  fontSize: "sm",
2387
2390
  color: "muted",
2388
- children: h("library.filter.searchInForce")
2389
- }) : /* @__PURE__ */ l(g.Search, {
2390
- placeholder: h("library.filter.searchPlaceholder"),
2391
+ children: l("library.filter.searchInForce")
2392
+ }) : /* @__PURE__ */ u(_.Search, {
2393
+ placeholder: l("library.filter.searchPlaceholder"),
2391
2394
  value: w,
2392
- onChange: (e) => E([...e].slice(0, 200).join(""))
2395
+ onChange: (e) => T([...e].slice(0, 200).join(""))
2393
2396
  }),
2394
- /* @__PURE__ */ u(g.Filters, { children: [
2395
- /* @__PURE__ */ l(O, {
2397
+ /* @__PURE__ */ d(_.Filters, { children: [
2398
+ /* @__PURE__ */ u(k, {
2396
2399
  size: "sm",
2397
- "aria-label": h("library.filter.view"),
2400
+ "aria-label": l("library.filter.view"),
2398
2401
  value: x,
2399
2402
  onChange: (e) => {
2400
2403
  let t = e.target.value;
2401
- t === "in_force" && (E(""), P("")), S(t);
2404
+ t === "in_force" && (T(""), ae("")), S(t);
2402
2405
  },
2403
- children: Ee.map((e) => /* @__PURE__ */ l("option", {
2406
+ children: De.map((e) => /* @__PURE__ */ u("option", {
2404
2407
  value: e,
2405
- children: h(`library.view.${e}`)
2408
+ children: l(`library.view.${e}`)
2406
2409
  }, e))
2407
2410
  }),
2408
- x === "change_set" ? /* @__PURE__ */ u(O, {
2411
+ x === "change_set" ? /* @__PURE__ */ d(k, {
2409
2412
  size: "sm",
2410
- "aria-label": h("library.filter.changeSet"),
2411
- value: J,
2413
+ "aria-label": l("library.filter.changeSet"),
2414
+ value: q,
2412
2415
  onChange: (e) => C(e.target.value),
2413
- children: [G.data?.changeSets.length ? null : /* @__PURE__ */ l("option", {
2416
+ children: [G.data?.changeSets.length ? null : /* @__PURE__ */ u("option", {
2414
2417
  value: "",
2415
- children: h("library.filter.noOpenChangeSet")
2416
- }), (G.data?.changeSets ?? []).map((e) => /* @__PURE__ */ l("option", {
2418
+ children: l("library.filter.noOpenChangeSet")
2419
+ }), (G.data?.changeSets ?? []).map((e) => /* @__PURE__ */ u("option", {
2417
2420
  value: e.id,
2418
2421
  children: e.name
2419
2422
  }, e.id))]
2420
2423
  }) : null,
2421
- /* @__PURE__ */ u(O, {
2424
+ /* @__PURE__ */ d(k, {
2422
2425
  size: "sm",
2423
- "aria-label": h("library.filter.blueprint"),
2426
+ "aria-label": l("library.filter.blueprint"),
2424
2427
  value: F,
2425
- onChange: (e) => ce(e.target.value),
2426
- children: [/* @__PURE__ */ l("option", {
2428
+ onChange: (e) => se(e.target.value),
2429
+ children: [/* @__PURE__ */ u("option", {
2427
2430
  value: "",
2428
- children: h("library.filter.anyBlueprint")
2429
- }), (ye.data ?? []).map((e) => /* @__PURE__ */ l("option", {
2431
+ children: l("library.filter.anyBlueprint")
2432
+ }), xe.map((e) => /* @__PURE__ */ u("option", {
2430
2433
  value: e.id,
2431
2434
  children: e.name
2432
2435
  }, e.id))]
2433
2436
  }),
2434
- /* @__PURE__ */ u(O, {
2437
+ /* @__PURE__ */ d(k, {
2435
2438
  size: "sm",
2436
- "aria-label": h("library.filter.assignee"),
2439
+ "aria-label": l("library.filter.assignee"),
2437
2440
  value: L,
2438
2441
  onChange: (e) => R(e.target.value),
2439
2442
  children: [
2440
- /* @__PURE__ */ l("option", {
2443
+ /* @__PURE__ */ u("option", {
2441
2444
  value: "",
2442
- children: h("library.filter.anyone")
2445
+ children: l("library.filter.anyone")
2443
2446
  }),
2444
- /* @__PURE__ */ l("option", {
2445
- value: Ae,
2446
- children: h("library.filter.me")
2447
+ /* @__PURE__ */ u("option", {
2448
+ value: je,
2449
+ children: l("library.filter.me")
2447
2450
  }),
2448
- V.list().filter((e) => e.userId !== B).map((e) => /* @__PURE__ */ l("option", {
2451
+ le.list().filter((e) => e.userId !== V).map((e) => /* @__PURE__ */ u("option", {
2449
2452
  value: e.userId,
2450
2453
  children: e.displayName
2451
2454
  }, e.userId))
2452
2455
  ]
2453
2456
  })
2454
2457
  ] }),
2455
- /* @__PURE__ */ l(g.Right, { children: Y.isError ? null : /* @__PURE__ */ u(g.Count, { children: [h("library.count", { count: X.length }), Y.hasNextPage ? "+" : ""] }) })
2458
+ /* @__PURE__ */ u(_.Right, { children: J.isError ? null : /* @__PURE__ */ d(_.Count, { children: [l("library.count", { count: Y.length }), J.hasNextPage ? "+" : ""] }) })
2456
2459
  ] }),
2457
- children: [/* @__PURE__ */ u(M, {
2460
+ children: [/* @__PURE__ */ d(N, {
2458
2461
  storageKey: "contenthub-library-subnav",
2459
- children: [/* @__PURE__ */ l(M.Nav, {
2460
- "aria-label": h("library.collections"),
2461
- children: W.isSuccess ? /* @__PURE__ */ l(_e, {
2462
- collections: W.data,
2462
+ children: [/* @__PURE__ */ u(N.Nav, {
2463
+ "aria-label": l("library.collections"),
2464
+ children: U.isSuccess ? /* @__PURE__ */ u(ve, {
2465
+ collections: U.data,
2463
2466
  activeId: b,
2464
2467
  onSelect: H
2465
- }) : W.isError ? /* @__PURE__ */ l(A, {
2468
+ }) : U.isError ? /* @__PURE__ */ u(M, {
2466
2469
  fontSize: "sm",
2467
2470
  color: "muted",
2468
2471
  px: "3",
2469
2472
  py: "2",
2470
- children: h("library.collectionsError")
2471
- }) : /* @__PURE__ */ l(te, {
2473
+ children: l("library.collectionsError")
2474
+ }) : /* @__PURE__ */ u(O, {
2472
2475
  justify: "center",
2473
2476
  py: "4",
2474
- children: /* @__PURE__ */ l(ne, { size: "sm" })
2477
+ children: /* @__PURE__ */ u(A, { size: "sm" })
2475
2478
  })
2476
- }), /* @__PURE__ */ u(M.Detail, { children: [/* @__PURE__ */ l(M.Toolbar, { children: /* @__PURE__ */ l(A, {
2479
+ }), /* @__PURE__ */ d(N.Detail, { children: [/* @__PURE__ */ u(N.Toolbar, { children: /* @__PURE__ */ u(M, {
2477
2480
  fontSize: "sm",
2478
2481
  fontWeight: "medium",
2479
- children: Ce
2480
- }) }), /* @__PURE__ */ u(k, {
2482
+ children: $
2483
+ }) }), /* @__PURE__ */ d(j, {
2481
2484
  gap: "3",
2482
2485
  children: [
2483
- Y.isError ? /* @__PURE__ */ l(D, {
2486
+ J.isError ? /* @__PURE__ */ u(D, {
2484
2487
  status: "error",
2485
- title: Se,
2488
+ title: we,
2486
2489
  mx: "8",
2487
2490
  mt: "4"
2488
2491
  }) : null,
2489
- /* @__PURE__ */ l(p, {
2490
- columns: be,
2491
- data: X,
2492
- loading: Y.isLoading,
2492
+ /* @__PURE__ */ u(m, {
2493
+ columns: Se,
2494
+ data: Y,
2495
+ loading: J.isLoading,
2493
2496
  getRowId: (e) => `${e.id}/${e.branchId}/${e.releaseId}`,
2494
- onRowClick: (e) => o({
2497
+ onRowClick: (e) => r({
2495
2498
  contentId: e.id,
2496
2499
  changeSetId: e.changeSetId || void 0
2497
2500
  }),
2498
2501
  variant: "hoverable",
2499
- emptyState: /* @__PURE__ */ l(f, {
2500
- icon: /* @__PURE__ */ l(oe, { size: 32 }),
2501
- header: h("library.empty"),
2502
- description: h("library.emptyHint")
2502
+ emptyState: /* @__PURE__ */ u(p, {
2503
+ icon: /* @__PURE__ */ u(oe, { size: 32 }),
2504
+ header: l("library.empty"),
2505
+ description: l("library.emptyHint")
2503
2506
  })
2504
2507
  }),
2505
- Y.hasNextPage ? /* @__PURE__ */ l(te, {
2508
+ J.hasNextPage ? /* @__PURE__ */ u(O, {
2506
2509
  justify: "center",
2507
2510
  pb: "4",
2508
- children: /* @__PURE__ */ l(d, {
2511
+ children: /* @__PURE__ */ u(f, {
2509
2512
  size: "sm",
2510
2513
  variant: "outline",
2511
- loading: Y.isFetchingNextPage,
2512
- onClick: () => void Y.fetchNextPage(),
2513
- children: h("library.more")
2514
+ loading: J.isFetchingNextPage,
2515
+ onClick: () => void J.fetchNextPage(),
2516
+ children: l("library.more")
2514
2517
  })
2515
2518
  }) : null
2516
2519
  ]
2517
2520
  })] })]
2518
- }), /* @__PURE__ */ l(Te, {
2519
- open: le,
2520
- onClose: () => z(!1),
2521
- client: t,
2522
- blueprintSource: _,
2523
- initialChangeSetId: x === "change_set" ? J : void 0,
2521
+ }), /* @__PURE__ */ u(Ee, {
2522
+ open: z,
2523
+ onClose: () => B(!1),
2524
+ client: e,
2525
+ blueprintSource: g,
2526
+ initialChangeSetId: x === "change_set" ? q : void 0,
2524
2527
  onCreated: (e) => {
2525
- z(!1), c({
2528
+ B(!1), s({
2526
2529
  changeSetId: e.changeSetId,
2527
2530
  contentId: e.id,
2528
2531
  branchId: e.branchId
@@ -2531,8 +2534,8 @@ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }
2531
2534
  })]
2532
2535
  });
2533
2536
  }
2534
- Ne.displayName = "ContentLibrary";
2537
+ Pe.displayName = "ContentLibrary";
2535
2538
  //#endregion
2536
- export { be as a, ge as c, K as d, J as f, Se as i, he as l, U as m, Ne as n, xe as o, q as p, Me as r, ye as s, je as t, pe as u };
2539
+ export { xe as a, _e as c, K as d, pe as f, Ce as i, ge as l, W as m, Pe as n, Se as o, q as p, Ne as r, be as s, Me as t, he as u };
2537
2540
 
2538
- //# sourceMappingURL=content-library-B6Y9Bxph.js.map
2541
+ //# sourceMappingURL=content-library-v0mjVD4J.js.map