@peasant-labs/fairtrade 0.0.37 → 0.0.39

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,5 +1,5 @@
1
- import { At as e, Ot as t, Tt as n, ht as r, lt as i, pt as a, ut as o } from "./GraphLegend-7PmEpBZQ.js";
2
- import { At as s, Et as c, Nt as l, Ot as u, _t as d, cn as f, dn as p, fn as m, ft as h, gt as g, jt as _, kt as v, lr as y, nr as b, or as x, pt as S, qn as C, sr as w, un as T, ut as E, wr as D } from "./ui-DoMWMsXK.js";
1
+ import { At as e, Ot as t, Tt as n, ht as r, lt as i, pt as a, ut as o } from "./GraphLegend-DwLFq2JU.js";
2
+ import { $n as s, Ar as c, At as l, Et as u, Nt as d, Ot as f, _n as p, _t as m, cr as h, fr as g, ft as _, gn as v, gt as y, hr as b, jt as x, kt as S, mn as C, pr as w, pt as T, ut as E, vn as D } from "./ui-CBsfaQMA.js";
3
3
  import { useEffect as O, useId as k, useMemo as A, useRef as j, useState as M } from "react";
4
4
  import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
5
5
  import { ArrowRight as I, Check as L, ChevronDown as R, ChevronRight as z, ClipboardCheck as B, Compass as V, Copy as H, ExternalLink as U, Eye as W, EyeOff as G, FileText as ee, FolderGit2 as K, GitBranch as q, GitPullRequest as J, Hash as te, KeyRound as Y, LayoutGrid as ne, List as re, Lock as ie, LogOut as ae, MoreHorizontal as X, Plus as oe, Search as se, SearchX as ce, Settings as Z, ShieldAlert as Q, SlidersHorizontal as le, TriangleAlert as ue, Upload as de, User as fe, UserPlus as pe, Users as $, X as me } from "lucide-react";
@@ -331,20 +331,20 @@ function Ne({ collective: e, href: t, onOpen: n }) {
331
331
  children: r
332
332
  });
333
333
  }
334
- function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript: a, onOpenProfile: o, onOpenCollective: s, transcriptHref: c, profileHref: u, collectiveHref: d }) {
335
- let f = ke(e), p = f.transcripts.transcripts, [m, h] = M(""), [g, v] = M(""), [y, b] = M("recent"), [x, S] = M("all"), [C, w] = M(() => /* @__PURE__ */ new Set()), [T, D] = M("grid"), [k, N] = M(() => Ae(f.transcripts.page)), [I, L] = M(null), [R, z] = M("browse"), B = j(!0), H = j(null);
334
+ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript: a, onOpenProfile: o, onOpenCollective: s, transcriptHref: c, profileHref: l, collectiveHref: u }) {
335
+ let f = ke(e), p = f.transcripts.transcripts, [m, h] = M(""), [g, _] = M(""), [v, y] = M("recent"), [b, S] = M("all"), [C, w] = M(() => /* @__PURE__ */ new Set()), [T, D] = M("grid"), [k, N] = M(() => Ae(f.transcripts.page)), [I, L] = M(null), [R, z] = M("browse"), B = j(!0), H = j(null);
336
336
  O(() => {
337
337
  if (B.current) {
338
- B.current = !1, v(m);
338
+ B.current = !1, _(m);
339
339
  return;
340
340
  }
341
- let e = setTimeout(() => v(m), 250);
341
+ let e = setTimeout(() => _(m), 250);
342
342
  return () => clearTimeout(e);
343
343
  }, [B, m]), O(() => {
344
344
  let e = JSON.stringify([
345
345
  g,
346
- y,
347
- x,
346
+ v,
347
+ b,
348
348
  [...C].sort()
349
349
  ]);
350
350
  if (H.current === null || H.current === e) {
@@ -354,22 +354,22 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
354
354
  H.current = e, N(1);
355
355
  }, [
356
356
  g,
357
- y,
358
- x,
357
+ v,
358
+ b,
359
359
  C
360
360
  ]), O(() => {
361
361
  i?.({
362
362
  query: g,
363
- provider: x,
363
+ provider: b,
364
364
  topics: [...C],
365
- order: y,
365
+ order: v,
366
366
  page: k
367
367
  });
368
368
  }, [
369
- y,
369
+ v,
370
370
  i,
371
371
  k,
372
- x,
372
+ b,
373
373
  g,
374
374
  C
375
375
  ]);
@@ -407,7 +407,7 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
407
407
  }
408
408
  U ? (L(U.id), z("profile")) : p[0] && (L(p[0].id), z("profile"));
409
409
  }, se = () => {
410
- h(""), v(""), b("recent"), S("all"), w(/* @__PURE__ */ new Set()), N(1);
410
+ h(""), _(""), y("recent"), S("all"), w(/* @__PURE__ */ new Set()), N(1);
411
411
  }, Z = A(() => W ? [...De(G, (e) => e.projectName || "untitled project").entries()].map(([e, t]) => ({
412
412
  project: e,
413
413
  items: t
@@ -583,7 +583,7 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
583
583
  })]
584
584
  })]
585
585
  }),
586
- /* @__PURE__ */ P(_, { tiles: [
586
+ /* @__PURE__ */ P(x, { tiles: [
587
587
  {
588
588
  key: "transcripts",
589
589
  label: "transcripts",
@@ -659,7 +659,7 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
659
659
  })]
660
660
  })]
661
661
  }),
662
- /* @__PURE__ */ P(_, { tiles: [
662
+ /* @__PURE__ */ P(x, { tiles: [
663
663
  {
664
664
  key: "transcripts",
665
665
  label: "transcripts",
@@ -756,11 +756,11 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
756
756
  })]
757
757
  }), /* @__PURE__ */ F("div", {
758
758
  className: "cex-explore-body",
759
- children: [/* @__PURE__ */ P(l, {
760
- order: y,
761
- onOrder: (e) => b(e),
759
+ children: [/* @__PURE__ */ P(d, {
760
+ order: v,
761
+ onOrder: (e) => y(e),
762
762
  providers: K,
763
- activeProviders: x === "all" ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([x]),
763
+ activeProviders: b === "all" ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([b]),
764
764
  onProvider: (e) => S((t) => t === e ? "all" : e),
765
765
  topics: f.popularTags.map((e) => ({
766
766
  tag: e.name,
@@ -797,7 +797,7 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
797
797
  className: "cex-coll-grid",
798
798
  children: q.map((e) => /* @__PURE__ */ P(Ne, {
799
799
  collective: e,
800
- href: d?.(e),
800
+ href: u?.(e),
801
801
  onOpen: s
802
802
  }, e.id))
803
803
  })]
@@ -845,7 +845,7 @@ function Pe({ data: e, className: n = "", onFiltersChange: i, onOpenTranscript:
845
845
  ]
846
846
  })]
847
847
  }),
848
- J.length === 0 ? g.trim() || x !== "all" || te ? /* @__PURE__ */ F("div", {
848
+ J.length === 0 ? g.trim() || b !== "all" || te ? /* @__PURE__ */ F("div", {
849
849
  className: "empty cex-empty",
850
850
  children: [
851
851
  /* @__PURE__ */ P("div", {
@@ -1521,7 +1521,7 @@ function We() {
1521
1521
  })]
1522
1522
  })
1523
1523
  ]
1524
- }), /* @__PURE__ */ P(m, {
1524
+ }), /* @__PURE__ */ P(D, {
1525
1525
  open: i,
1526
1526
  title: /* @__PURE__ */ F(N, { children: [
1527
1527
  "make ",
@@ -1643,7 +1643,7 @@ function Xe(e, t, n) {
1643
1643
  }, e));
1644
1644
  }
1645
1645
  function Ze({ data: e = {}, actions: t = {} } = {}) {
1646
- let { collectives: n = [], linkedOrgs: r = [], title: i = "collectives", deck: a, crumb: o, caption: s = "collectives", createLabel: c = "new collective", createBusy: l = !1, whoCanPublish: u = Ge, whoCanRead: d = Ke } = e, { onCreateCollective: f, onOpenCollective: m, onSearchCollectives: h } = t, [g, _] = M(!1), [v, b] = M(""), [x, S] = M(""), [w, T] = M(u[0]?.value ?? ""), [E, O] = M(d[0]?.value ?? ""), [A, j] = M(""), [N, I] = M(""), L = k(), R = [
1646
+ let { collectives: n = [], linkedOrgs: r = [], title: i = "collectives", deck: a, crumb: o, caption: l = "collectives", createLabel: u = "new collective", createBusy: d = !1, whoCanPublish: f = Ge, whoCanRead: m = Ke } = e, { onCreateCollective: h, onOpenCollective: g, onSearchCollectives: _ } = t, [v, y] = M(!1), [x, S] = M(""), [C, w] = M(""), [T, E] = M(f[0]?.value ?? ""), [D, O] = M(m[0]?.value ?? ""), [A, j] = M(""), [N, I] = M(""), L = k(), R = [
1647
1647
  {
1648
1648
  key: "name",
1649
1649
  label: "name",
@@ -1652,7 +1652,7 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1652
1652
  children: [/* @__PURE__ */ P("button", {
1653
1653
  type: "button",
1654
1654
  className: "cmg-table-link",
1655
- onClick: () => m?.(t.id),
1655
+ onClick: () => g?.(t.id),
1656
1656
  children: t.name
1657
1657
  }), t.desc ? /* @__PURE__ */ P("span", {
1658
1658
  className: "cmg-cell-desc",
@@ -1704,7 +1704,7 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1704
1704
  children: [
1705
1705
  o ? /* @__PURE__ */ P("div", {
1706
1706
  className: "cmg-crumb",
1707
- children: /* @__PURE__ */ P(y, { items: [{ label: o }] })
1707
+ children: /* @__PURE__ */ P(b, { items: [{ label: o }] })
1708
1708
  }) : null,
1709
1709
  /* @__PURE__ */ F("header", {
1710
1710
  className: "iu-page-head",
@@ -1715,16 +1715,16 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1715
1715
  children: i
1716
1716
  }), /* @__PURE__ */ F("button", {
1717
1717
  type: "button",
1718
- className: "btn btn-sm " + (g ? "btn-secondary" : "btn-primary"),
1719
- "aria-expanded": g,
1720
- onClick: () => _((e) => !e),
1718
+ className: "btn btn-sm " + (v ? "btn-secondary" : "btn-primary"),
1719
+ "aria-expanded": v,
1720
+ onClick: () => y((e) => !e),
1721
1721
  children: [
1722
1722
  /* @__PURE__ */ P(oe, {
1723
1723
  size: 14,
1724
1724
  "aria-hidden": "true"
1725
1725
  }),
1726
1726
  " ",
1727
- g ? "close" : c
1727
+ v ? "close" : u
1728
1728
  ]
1729
1729
  })]
1730
1730
  }), a ? /* @__PURE__ */ P("p", {
@@ -1732,7 +1732,7 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1732
1732
  children: a
1733
1733
  }) : null]
1734
1734
  }),
1735
- g && /* @__PURE__ */ F("section", {
1735
+ v && /* @__PURE__ */ F("section", {
1736
1736
  className: "cmg-form card",
1737
1737
  "aria-labelledby": `${L}-form`,
1738
1738
  children: [
@@ -1752,8 +1752,8 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1752
1752
  }), /* @__PURE__ */ P("input", {
1753
1753
  className: "input",
1754
1754
  type: "text",
1755
- value: v,
1756
- onChange: (e) => b(e.target.value)
1755
+ value: x,
1756
+ onChange: (e) => S(e.target.value)
1757
1757
  })]
1758
1758
  }),
1759
1759
  /* @__PURE__ */ F("label", {
@@ -1764,8 +1764,8 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1764
1764
  }), /* @__PURE__ */ P("textarea", {
1765
1765
  className: "input",
1766
1766
  rows: 2,
1767
- value: x,
1768
- onChange: (e) => S(e.target.value)
1767
+ value: C,
1768
+ onChange: (e) => w(e.target.value)
1769
1769
  })]
1770
1770
  }),
1771
1771
  /* @__PURE__ */ P("div", {
@@ -1774,9 +1774,9 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1774
1774
  variant: "select",
1775
1775
  label: "who can publish",
1776
1776
  name: "who-can-publish",
1777
- value: w,
1778
- onChange: T,
1779
- options: u.map((e) => ({
1777
+ value: T,
1778
+ onChange: E,
1779
+ options: f.map((e) => ({
1780
1780
  ...e,
1781
1781
  rationale: e.help
1782
1782
  }))
@@ -1788,9 +1788,9 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1788
1788
  variant: "select",
1789
1789
  label: "who can read",
1790
1790
  name: "who-can-read",
1791
- value: E,
1791
+ value: D,
1792
1792
  onChange: O,
1793
- options: d
1793
+ options: m
1794
1794
  })
1795
1795
  }),
1796
1796
  /* @__PURE__ */ F("label", {
@@ -1821,28 +1821,28 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1821
1821
  children: [/* @__PURE__ */ P("button", {
1822
1822
  type: "button",
1823
1823
  className: "btn btn-sm btn-primary",
1824
- disabled: !v.trim() || l,
1824
+ disabled: !x.trim() || d,
1825
1825
  "aria-describedby": L,
1826
- onClick: () => f?.({
1827
- name: v,
1828
- purpose: x,
1829
- mode: w,
1830
- access: E,
1826
+ onClick: () => h?.({
1827
+ name: x,
1828
+ purpose: C,
1829
+ mode: T,
1830
+ access: D,
1831
1831
  org: A
1832
1832
  }),
1833
- children: l ? "creating" : "create collective"
1833
+ children: d ? "creating" : "create collective"
1834
1834
  }), /* @__PURE__ */ P("span", {
1835
1835
  id: L,
1836
1836
  className: "cmg-form-hint mono",
1837
- children: u.find((e) => e.value === w)?.help
1837
+ children: f.find((e) => e.value === T)?.help
1838
1838
  })]
1839
1839
  })
1840
1840
  ]
1841
1841
  }),
1842
1842
  /* @__PURE__ */ F("div", {
1843
1843
  className: "cmg-section",
1844
- children: [/* @__PURE__ */ P(C, {
1845
- caption: `${s} ${n.length}`,
1844
+ children: [/* @__PURE__ */ P(s, {
1845
+ caption: `${l} ${n.length}`,
1846
1846
  columns: R,
1847
1847
  rows: n,
1848
1848
  rowKey: (e) => e.id
@@ -1851,7 +1851,7 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1851
1851
  children: "in a curated collective, each transcript you publish waits for the owner to approve it."
1852
1852
  }) : null]
1853
1853
  }),
1854
- h && /* @__PURE__ */ F("section", {
1854
+ _ && /* @__PURE__ */ F("section", {
1855
1855
  className: "cmg-section",
1856
1856
  "aria-labelledby": `${L}-find`,
1857
1857
  children: [/* @__PURE__ */ P("h3", {
@@ -1862,9 +1862,9 @@ function Ze({ data: e = {}, actions: t = {} } = {}) {
1862
1862
  className: "cmg-find",
1863
1863
  role: "search",
1864
1864
  onSubmit: (e) => {
1865
- e.preventDefault(), h(N);
1865
+ e.preventDefault(), _(N);
1866
1866
  },
1867
- children: [/* @__PURE__ */ P(D, {
1867
+ children: [/* @__PURE__ */ P(c, {
1868
1868
  label: "collective or github org",
1869
1869
  type: "search",
1870
1870
  iconLeft: se,
@@ -1902,7 +1902,7 @@ function $e(e = {}) {
1902
1902
  };
1903
1903
  }
1904
1904
  function et({ data: e = {}, actions: t = {} } = {}) {
1905
- let { owners: n = [], linkedRepos: r = [], hrefFor: i } = e, o = $e(e.collective), { onSettings: s, onContribute: l, onReview: d, onOpenTranscript: f, onOpenPullRequest: p, onLinkRepos: m, onShowMore: g } = t, [_, v] = M(!1), b = k(), x = o.transcriptCount ?? o.transcripts.length, S = [
1905
+ let { owners: n = [], linkedRepos: r = [], hrefFor: i } = e, o = $e(e.collective), { onSettings: c, onContribute: l, onReview: d, onOpenTranscript: p, onOpenPullRequest: m, onLinkRepos: h, onShowMore: g } = t, [v, y] = M(!1), x = k(), S = o.transcriptCount ?? o.transcripts.length, C = [
1906
1906
  {
1907
1907
  key: "title",
1908
1908
  label: "title",
@@ -1917,7 +1917,7 @@ function et({ data: e = {}, actions: t = {} } = {}) {
1917
1917
  children: [/* @__PURE__ */ P(Ye, {
1918
1918
  className: "iu-session-title",
1919
1919
  href: i?.("transcript", t.id),
1920
- onOpen: f ? () => f(t.id) : void 0,
1920
+ onOpen: p ? () => p(t.id) : void 0,
1921
1921
  children: t.title
1922
1922
  }), /* @__PURE__ */ F("span", {
1923
1923
  className: "iu-session-sub",
@@ -1946,8 +1946,8 @@ function et({ data: e = {}, actions: t = {} } = {}) {
1946
1946
  label: "pull requests",
1947
1947
  render: (e, t) => t.pullRequests?.length ? /* @__PURE__ */ F("span", {
1948
1948
  className: "cmg-prs",
1949
- children: [/* @__PURE__ */ P(c, {
1950
- items: Xe(t.pullRequests, p, i),
1949
+ children: [/* @__PURE__ */ P(u, {
1950
+ items: Xe(t.pullRequests, m, i),
1951
1951
  label: "pull requests",
1952
1952
  noun: ["pull request", "pull requests"]
1953
1953
  }), t.repo && /* @__PURE__ */ P("span", {
@@ -1985,7 +1985,7 @@ function et({ data: e = {}, actions: t = {} } = {}) {
1985
1985
  children: [
1986
1986
  /* @__PURE__ */ P("div", {
1987
1987
  className: "cmg-crumb-content",
1988
- children: /* @__PURE__ */ P(y, { items: [{
1988
+ children: /* @__PURE__ */ P(b, { items: [{
1989
1989
  label: "collectives",
1990
1990
  href: i?.("collectives")
1991
1991
  }, { label: o.name }] })
@@ -1996,14 +1996,14 @@ function et({ data: e = {}, actions: t = {} } = {}) {
1996
1996
  className: "iu-page-titlerow",
1997
1997
  children: [/* @__PURE__ */ P("h2", {
1998
1998
  className: "iu-page-title iu-page-title-content",
1999
- id: b,
1999
+ id: x,
2000
2000
  children: o.name
2001
2001
  }), /* @__PURE__ */ F("span", {
2002
2002
  className: "cmg-actions",
2003
- children: [o.role === "owner" && s && /* @__PURE__ */ F("button", {
2003
+ children: [o.role === "owner" && c && /* @__PURE__ */ F("button", {
2004
2004
  type: "button",
2005
2005
  className: "btn btn-secondary btn-sm",
2006
- onClick: () => s(),
2006
+ onClick: () => c(),
2007
2007
  children: [/* @__PURE__ */ P(Z, {
2008
2008
  size: 14,
2009
2009
  "aria-hidden": "true"
@@ -2043,7 +2043,7 @@ function et({ data: e = {}, actions: t = {} } = {}) {
2043
2043
  })]
2044
2044
  }, e.key))
2045
2045
  }),
2046
- /* @__PURE__ */ P(u, {
2046
+ /* @__PURE__ */ P(f, {
2047
2047
  items: o.stats,
2048
2048
  label: `${o.name} in numbers`
2049
2049
  }),
@@ -2051,9 +2051,9 @@ function et({ data: e = {}, actions: t = {} } = {}) {
2051
2051
  className: "cmg-home",
2052
2052
  children: [/* @__PURE__ */ F("div", {
2053
2053
  className: "cmg-home-main",
2054
- children: [/* @__PURE__ */ P(C, {
2055
- caption: `transcripts ${x}`,
2056
- columns: S,
2054
+ children: [/* @__PURE__ */ P(s, {
2055
+ caption: `transcripts ${S}`,
2056
+ columns: C,
2057
2057
  rows: o.transcripts,
2058
2058
  rowKey: (e) => e.id
2059
2059
  }), /* @__PURE__ */ F("div", {
@@ -2069,10 +2069,10 @@ function et({ data: e = {}, actions: t = {} } = {}) {
2069
2069
  " of ",
2070
2070
  /* @__PURE__ */ P("span", {
2071
2071
  className: "tnum",
2072
- children: x
2072
+ children: S
2073
2073
  })
2074
2074
  ]
2075
- }), x > o.transcripts.length && g && /* @__PURE__ */ P("button", {
2075
+ }), S > o.transcripts.length && g && /* @__PURE__ */ P("button", {
2076
2076
  type: "button",
2077
2077
  className: "btn btn-secondary btn-sm",
2078
2078
  onClick: () => g(),
@@ -2109,10 +2109,10 @@ function et({ data: e = {}, actions: t = {} } = {}) {
2109
2109
  }),
2110
2110
  " repos linked"
2111
2111
  ] }) : null,
2112
- o.role === "owner" && m && /* @__PURE__ */ P("button", {
2112
+ o.role === "owner" && h && /* @__PURE__ */ P("button", {
2113
2113
  type: "button",
2114
2114
  className: "btn btn-ghost btn-sm",
2115
- onClick: () => v(!0),
2115
+ onClick: () => y(!0),
2116
2116
  children: "manage"
2117
2117
  })
2118
2118
  ]
@@ -2143,15 +2143,15 @@ function et({ data: e = {}, actions: t = {} } = {}) {
2143
2143
  })]
2144
2144
  })
2145
2145
  ]
2146
- }), m && /* @__PURE__ */ P(h, {
2147
- open: _,
2148
- onClose: () => v(!1),
2146
+ }), h && /* @__PURE__ */ P(_, {
2147
+ open: v,
2148
+ onClose: () => y(!1),
2149
2149
  owners: n,
2150
2150
  initialSelected: r,
2151
2151
  title: `link repositories from ${o.org?.login ?? "github"}`,
2152
2152
  description: `pull requests in linked repos show the transcripts published to ${o.name}.`,
2153
2153
  onSave: (e) => {
2154
- m(e), v(!1);
2154
+ h(e), y(!1);
2155
2155
  }
2156
2156
  })] });
2157
2157
  }
@@ -2182,27 +2182,27 @@ var at = {
2182
2182
  "danger zone": ue
2183
2183
  };
2184
2184
  function ot({ data: e = {}, actions: t = {} } = {}) {
2185
- let { owners: n = [], linkedRepos: r = [], showOnPullRequests: i = !1, whoCanPublish: a = Ge, whoCanRead: o = Ke, memberLeavesChoices: s = tt, hrefFor: c } = e, l = $e(e.collective), u = (e) => (n) => t.onCommit ? t.onCommit(e, n) : Promise.resolve(), [f, p] = M(!1), [m, _] = M(""), v = !!(t.onTransferOwnership || t.onDelete), x = [
2185
+ let { owners: n = [], linkedRepos: r = [], showOnPullRequests: i = !1, whoCanPublish: a = Ge, whoCanRead: o = Ke, memberLeavesChoices: s = tt, hrefFor: l } = e, u = $e(e.collective), d = (e) => (n) => t.onCommit ? t.onCommit(e, n) : Promise.resolve(), [f, p] = M(!1), [g, v] = M(""), x = !!(t.onTransferOwnership || t.onDelete), S = [
2186
2186
  "general",
2187
2187
  "access",
2188
2188
  "members",
2189
2189
  "github orgs",
2190
2190
  "pull requests",
2191
- ...v ? ["danger zone"] : []
2191
+ ...x ? ["danger zone"] : []
2192
2192
  ], C = (e) => `cmg-settings-${e.replace(/ /g, "-")}`;
2193
2193
  return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F("div", {
2194
2194
  className: "iu-page cmg-settings",
2195
2195
  children: [
2196
2196
  /* @__PURE__ */ P("div", {
2197
2197
  className: "cmg-crumb-content",
2198
- children: /* @__PURE__ */ P(y, { items: [
2198
+ children: /* @__PURE__ */ P(b, { items: [
2199
2199
  {
2200
2200
  label: "collectives",
2201
- href: c?.("collectives")
2201
+ href: l?.("collectives")
2202
2202
  },
2203
2203
  {
2204
- label: l.name,
2205
- href: c?.("collective", l.id)
2204
+ label: u.name,
2205
+ href: l?.("collective", u.id)
2206
2206
  },
2207
2207
  { label: "settings" }
2208
2208
  ] })
@@ -2213,87 +2213,87 @@ function ot({ data: e = {}, actions: t = {} } = {}) {
2213
2213
  className: "iu-page-title",
2214
2214
  children: [/* @__PURE__ */ P("span", {
2215
2215
  className: "iu-page-title-content",
2216
- children: l.name
2216
+ children: u.name
2217
2217
  }), ", settings"]
2218
2218
  })
2219
2219
  }),
2220
- /* @__PURE__ */ F(S, {
2221
- sections: x.map((e) => ({
2220
+ /* @__PURE__ */ F(T, {
2221
+ sections: S.map((e) => ({
2222
2222
  id: C(e),
2223
2223
  label: e,
2224
2224
  href: `#${C(e)}`,
2225
2225
  icon: at[e]
2226
2226
  })),
2227
- currentId: C(x[0]),
2227
+ currentId: C(S[0]),
2228
2228
  spy: !0,
2229
2229
  children: [
2230
- /* @__PURE__ */ F(g, {
2230
+ /* @__PURE__ */ F(y, {
2231
2231
  label: "general",
2232
2232
  defaultOpen: !0,
2233
2233
  id: C("general"),
2234
- children: [/* @__PURE__ */ P(d, {
2234
+ children: [/* @__PURE__ */ P(m, {
2235
2235
  label: "name",
2236
2236
  control: "text",
2237
- value: l.name,
2238
- onCommit: u("name")
2239
- }), /* @__PURE__ */ P(d, {
2237
+ value: u.name,
2238
+ onCommit: d("name")
2239
+ }), /* @__PURE__ */ P(m, {
2240
2240
  label: "purpose",
2241
2241
  control: "text",
2242
- value: l.purpose ?? "",
2243
- onCommit: u("purpose")
2242
+ value: u.purpose ?? "",
2243
+ onCommit: d("purpose")
2244
2244
  })]
2245
2245
  }),
2246
- /* @__PURE__ */ F(g, {
2246
+ /* @__PURE__ */ F(y, {
2247
2247
  label: "access",
2248
2248
  defaultOpen: !0,
2249
2249
  id: C("access"),
2250
- children: [/* @__PURE__ */ P(d, {
2250
+ children: [/* @__PURE__ */ P(m, {
2251
2251
  label: "who can publish",
2252
2252
  help: ((e) => e.filter((e) => e.help).map((e) => `${e.label}: ${e.help}`).join(" "))(a),
2253
2253
  control: "select",
2254
- value: rt(l.mode, a),
2255
- options: nt(l.mode, a),
2256
- onCommit: u("mode")
2257
- }), /* @__PURE__ */ P(d, {
2254
+ value: rt(u.mode, a),
2255
+ options: nt(u.mode, a),
2256
+ onCommit: d("mode")
2257
+ }), /* @__PURE__ */ P(m, {
2258
2258
  label: "who can read",
2259
2259
  help: "members read and publish. contributors publish, and read only if who can read allows it.",
2260
2260
  control: "select",
2261
- value: rt(l.access, o),
2262
- options: nt(l.access, o),
2263
- onCommit: u("access")
2261
+ value: rt(u.access, o),
2262
+ options: nt(u.access, o),
2263
+ onCommit: d("access")
2264
2264
  })]
2265
2265
  }),
2266
- /* @__PURE__ */ F(g, {
2266
+ /* @__PURE__ */ F(y, {
2267
2267
  label: "members",
2268
2268
  defaultOpen: !0,
2269
- count: l.memberCount ?? null,
2269
+ count: u.memberCount ?? null,
2270
2270
  noun: ["member", "members"],
2271
2271
  id: C("members"),
2272
2272
  children: [
2273
2273
  t.onInvite && /* @__PURE__ */ F("form", {
2274
2274
  className: "srow cmg-invite",
2275
2275
  onSubmit: (e) => {
2276
- e.preventDefault(), t.onInvite(m), _("");
2276
+ e.preventDefault(), t.onInvite(g), v("");
2277
2277
  },
2278
- children: [/* @__PURE__ */ P(D, {
2278
+ children: [/* @__PURE__ */ P(c, {
2279
2279
  label: "invite by github username",
2280
- value: m,
2281
- onChange: (e) => _(e.target.value),
2280
+ value: g,
2281
+ onChange: (e) => v(e.target.value),
2282
2282
  placeholder: "github username"
2283
2283
  }), /* @__PURE__ */ P("button", {
2284
2284
  type: "submit",
2285
2285
  className: "btn btn-secondary btn-sm",
2286
- disabled: !m.trim(),
2286
+ disabled: !g.trim(),
2287
2287
  children: "invite"
2288
2288
  })]
2289
2289
  }),
2290
2290
  /* @__PURE__ */ P("ul", {
2291
2291
  className: "cmg-member-list",
2292
2292
  "aria-label": "members",
2293
- children: l.members.map((e) => /* @__PURE__ */ F("li", {
2293
+ children: u.members.map((e) => /* @__PURE__ */ F("li", {
2294
2294
  className: "cmg-member",
2295
2295
  children: [
2296
- /* @__PURE__ */ P(b, {
2296
+ /* @__PURE__ */ P(h, {
2297
2297
  name: e.name ?? e.handle,
2298
2298
  size: "sm"
2299
2299
  }),
@@ -2339,20 +2339,20 @@ function ot({ data: e = {}, actions: t = {} } = {}) {
2339
2339
  ]
2340
2340
  }, e.handle))
2341
2341
  }),
2342
- /* @__PURE__ */ P(d, {
2342
+ /* @__PURE__ */ P(m, {
2343
2343
  label: "when a member leaves",
2344
2344
  help: "what happens to the transcripts they published here.",
2345
2345
  control: "select",
2346
- value: rt(l.memberLeaves, s),
2347
- options: nt(l.memberLeaves, s),
2348
- onCommit: u("memberLeaves")
2346
+ value: rt(u.memberLeaves, s),
2347
+ options: nt(u.memberLeaves, s),
2348
+ onCommit: d("memberLeaves")
2349
2349
  })
2350
2350
  ]
2351
2351
  }),
2352
- /* @__PURE__ */ P(g, {
2352
+ /* @__PURE__ */ P(y, {
2353
2353
  label: "github orgs",
2354
2354
  defaultOpen: !0,
2355
- count: l.org === void 0 ? null : +!!l.org,
2355
+ count: u.org === void 0 ? null : +!!u.org,
2356
2356
  noun: ["org", "orgs"],
2357
2357
  id: C("github orgs"),
2358
2358
  children: /* @__PURE__ */ F("div", {
@@ -2361,18 +2361,18 @@ function ot({ data: e = {}, actions: t = {} } = {}) {
2361
2361
  className: "srow-text-col",
2362
2362
  children: [/* @__PURE__ */ P("span", {
2363
2363
  className: "srow-label",
2364
- children: l.org ? l.org.login : l.org === null ? "no org linked" : "github org"
2364
+ children: u.org ? u.org.login : u.org === null ? "no org linked" : "github org"
2365
2365
  }), /* @__PURE__ */ F("span", {
2366
2366
  className: "srow-help",
2367
- children: [typeof l.org?.total == "number" ? /* @__PURE__ */ F(N, { children: [
2367
+ children: [typeof u.org?.total == "number" ? /* @__PURE__ */ F(N, { children: [
2368
2368
  /* @__PURE__ */ P("span", {
2369
2369
  className: "tnum",
2370
- children: l.org.linked ?? 0
2370
+ children: u.org.linked ?? 0
2371
2371
  }),
2372
2372
  " of ",
2373
2373
  /* @__PURE__ */ P("span", {
2374
2374
  className: "tnum",
2375
- children: l.org.total
2375
+ children: u.org.total
2376
2376
  }),
2377
2377
  " repos linked. "
2378
2378
  ] }) : null, "a collective links one github org today."]
@@ -2385,20 +2385,20 @@ function ot({ data: e = {}, actions: t = {} } = {}) {
2385
2385
  })]
2386
2386
  })
2387
2387
  }),
2388
- /* @__PURE__ */ P(g, {
2388
+ /* @__PURE__ */ P(y, {
2389
2389
  label: "pull requests",
2390
2390
  defaultOpen: !0,
2391
2391
  count: 1,
2392
2392
  id: C("pull requests"),
2393
- children: /* @__PURE__ */ P(d, {
2393
+ children: /* @__PURE__ */ P(m, {
2394
2394
  label: "show transcripts on pull requests",
2395
2395
  help: "adds a peasant / prompts comment and check on pull requests in this collective's repos, listing which commits have transcripts. it never blocks merging.",
2396
2396
  control: "switch",
2397
2397
  value: i,
2398
- onCommit: u("showOnPullRequests")
2398
+ onCommit: d("showOnPullRequests")
2399
2399
  })
2400
2400
  }),
2401
- v && /* @__PURE__ */ F(g, {
2401
+ x && /* @__PURE__ */ F(y, {
2402
2402
  label: "danger zone",
2403
2403
  defaultOpen: !0,
2404
2404
  count: null,
@@ -2420,13 +2420,13 @@ function ot({ data: e = {}, actions: t = {} } = {}) {
2420
2420
  className: "srow-help",
2421
2421
  children: [
2422
2422
  "delete ",
2423
- l.name,
2423
+ u.name,
2424
2424
  " for ",
2425
- typeof l.memberCount == "number" ? /* @__PURE__ */ F(N, { children: [
2425
+ typeof u.memberCount == "number" ? /* @__PURE__ */ F(N, { children: [
2426
2426
  "all ",
2427
2427
  /* @__PURE__ */ P("span", {
2428
2428
  className: "tnum",
2429
- children: l.memberCount
2429
+ children: u.memberCount
2430
2430
  }),
2431
2431
  " members"
2432
2432
  ] }) : "all its members",
@@ -2443,12 +2443,12 @@ function ot({ data: e = {}, actions: t = {} } = {}) {
2443
2443
  ]
2444
2444
  })
2445
2445
  ]
2446
- }), t.onLinkRepos && /* @__PURE__ */ P(h, {
2446
+ }), t.onLinkRepos && /* @__PURE__ */ P(_, {
2447
2447
  open: f,
2448
2448
  onClose: () => p(!1),
2449
2449
  owners: n,
2450
2450
  initialSelected: r,
2451
- title: `link repositories from ${l.org?.login ?? "github"}`,
2451
+ title: `link repositories from ${u.org?.login ?? "github"}`,
2452
2452
  onSave: (e) => {
2453
2453
  t.onLinkRepos(e), p(!1);
2454
2454
  }
@@ -2500,8 +2500,8 @@ function dt(e) {
2500
2500
  }).format(t).toLowerCase();
2501
2501
  }
2502
2502
  function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2503
- let { collective: r = st, providerShare: i = [], pendingReview: a = [], members: o = [], redactions: c = [], browseRows: l = [], roleOptions: u = [], initialRole: d = "", initialShowRedaction: p = !1, initialBrowseGated: m = !1, stats: h = ct } = e || lt, { onRoleChange: g, onJoin: y, onLeave: b, onSettings: S, onContribute: C, onToggleBrowse: w } = t || {}, [E, D] = M(d || r.role || ""), [O, k] = M(!!p), [j, N] = M(!!m), I = E || r.role || "guest", L = I === "owner", R = I === "guest", B = n && u.length > 0, V = A(() => B ? u : [], [B, u]), H = (e) => {
2504
- D(e), g?.(e);
2503
+ let { collective: r = st, providerShare: i = [], pendingReview: a = [], members: o = [], redactions: s = [], browseRows: c = [], roleOptions: u = [], initialRole: d = "", initialShowRedaction: f = !1, initialBrowseGated: p = !1, stats: m = ct } = e || lt, { onRoleChange: h, onJoin: _, onLeave: y, onSettings: b, onContribute: w, onToggleBrowse: T } = t || {}, [E, D] = M(d || r.role || ""), [O, k] = M(!!f), [j, N] = M(!!p), I = E || r.role || "guest", L = I === "owner", R = I === "guest", B = n && u.length > 0, V = A(() => B ? u : [], [B, u]), H = (e) => {
2504
+ D(e), h?.(e);
2505
2505
  };
2506
2506
  return /* @__PURE__ */ P("div", {
2507
2507
  className: "cmg-root",
@@ -2580,34 +2580,34 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2580
2580
  R ? /* @__PURE__ */ F("button", {
2581
2581
  type: "button",
2582
2582
  className: "btn btn-sm btn-primary",
2583
- onClick: () => y?.(),
2583
+ onClick: () => _?.(),
2584
2584
  children: [/* @__PURE__ */ P(pe, {
2585
2585
  size: 14,
2586
2586
  "aria-hidden": "true"
2587
2587
  }), " join as contributor"]
2588
2588
  }) : null,
2589
- (I === "member" || I === "contributor") && C ? /* @__PURE__ */ F("button", {
2589
+ (I === "member" || I === "contributor") && w ? /* @__PURE__ */ F("button", {
2590
2590
  type: "button",
2591
2591
  className: "btn btn-sm btn-primary",
2592
- onClick: () => C?.(),
2592
+ onClick: () => w?.(),
2593
2593
  children: [/* @__PURE__ */ P(Q, {
2594
2594
  size: 14,
2595
2595
  "aria-hidden": "true"
2596
2596
  }), " contribute"]
2597
2597
  }) : null,
2598
- (I === "member" || I === "contributor") && b ? /* @__PURE__ */ F("button", {
2598
+ (I === "member" || I === "contributor") && y ? /* @__PURE__ */ F("button", {
2599
2599
  type: "button",
2600
2600
  className: "btn btn-sm btn-danger",
2601
- onClick: () => b?.(),
2601
+ onClick: () => y?.(),
2602
2602
  children: [/* @__PURE__ */ P(ae, {
2603
2603
  size: 14,
2604
2604
  "aria-hidden": "true"
2605
2605
  }), " leave"]
2606
2606
  }) : null,
2607
- L && S ? /* @__PURE__ */ F("button", {
2607
+ L && b ? /* @__PURE__ */ F("button", {
2608
2608
  type: "button",
2609
2609
  className: "btn btn-sm btn-secondary",
2610
- onClick: () => S?.(),
2610
+ onClick: () => b?.(),
2611
2611
  children: [/* @__PURE__ */ P(Z, {
2612
2612
  size: 14,
2613
2613
  "aria-hidden": "true"
@@ -2620,40 +2620,40 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2620
2620
  /* @__PURE__ */ F("div", {
2621
2621
  className: "cmg-tiles",
2622
2622
  children: [
2623
- /* @__PURE__ */ P(v, {
2623
+ /* @__PURE__ */ P(S, {
2624
2624
  label: "contributions",
2625
2625
  value: r.acceptanceMode || "open",
2626
2626
  tone: "teal"
2627
2627
  }),
2628
- /* @__PURE__ */ P(v, {
2628
+ /* @__PURE__ */ P(S, {
2629
2629
  label: "access",
2630
2630
  value: r.dataAccess || "members only",
2631
2631
  tone: "amber"
2632
2632
  }),
2633
- /* @__PURE__ */ P(v, {
2633
+ /* @__PURE__ */ P(S, {
2634
2634
  label: "your role",
2635
2635
  value: I
2636
2636
  })
2637
2637
  ]
2638
2638
  }),
2639
- /* @__PURE__ */ P(_, { tiles: [
2639
+ /* @__PURE__ */ P(x, { tiles: [
2640
2640
  {
2641
2641
  key: "transcripts",
2642
2642
  label: "transcripts",
2643
- value: h.transcripts,
2644
- sub: `across ${h.projects}`
2643
+ value: m.transcripts,
2644
+ sub: `across ${m.projects}`
2645
2645
  },
2646
2646
  {
2647
2647
  key: "tokens",
2648
2648
  label: "tokens",
2649
- value: h.tokens,
2650
- sub: h.turns
2649
+ value: m.tokens,
2650
+ sub: m.turns
2651
2651
  },
2652
2652
  {
2653
2653
  key: "contributors",
2654
2654
  label: "contributors",
2655
- value: h.contributors,
2656
- sub: h.hours
2655
+ value: m.contributors,
2656
+ sub: m.hours
2657
2657
  }
2658
2658
  ] }),
2659
2659
  /* @__PURE__ */ F("div", {
@@ -2668,7 +2668,7 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2668
2668
  id: "cmg-share-h",
2669
2669
  className: "cmg-sub",
2670
2670
  children: "provider share"
2671
- }), /* @__PURE__ */ P(s, {
2671
+ }), /* @__PURE__ */ P(l, {
2672
2672
  label: "provider share",
2673
2673
  total: 100,
2674
2674
  data: i.map((e) => ({
@@ -2682,7 +2682,7 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2682
2682
  overflow: "auto",
2683
2683
  maxWidth: "100%"
2684
2684
  },
2685
- children: /* @__PURE__ */ P(T, {
2685
+ children: /* @__PURE__ */ P(v, {
2686
2686
  title: "pending review",
2687
2687
  emptyLabel: "no shares awaiting review.",
2688
2688
  items: a.map((e) => ({
@@ -2693,7 +2693,7 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2693
2693
  }))
2694
2694
  })
2695
2695
  }) : null,
2696
- c.length > 0 ? /* @__PURE__ */ F("section", {
2696
+ s.length > 0 ? /* @__PURE__ */ F("section", {
2697
2697
  className: "card cmg-redact-sec",
2698
2698
  "aria-labelledby": "cmg-redact-h",
2699
2699
  children: [/* @__PURE__ */ F("div", {
@@ -2717,14 +2717,14 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2717
2717
  })]
2718
2718
  }), O ? /* @__PURE__ */ P("div", {
2719
2719
  className: "cmg-redact-list",
2720
- children: c.map((e) => /* @__PURE__ */ F("article", {
2720
+ children: s.map((e) => /* @__PURE__ */ F("article", {
2721
2721
  className: "cmg-redact",
2722
2722
  children: [
2723
2723
  /* @__PURE__ */ F("div", {
2724
2724
  className: "cmg-redact-head",
2725
2725
  children: [/* @__PURE__ */ P("span", {
2726
2726
  className: "cmg-redact-badges",
2727
- children: /* @__PURE__ */ P(x, { children: String(e.catLabel || e.cat || "item").toLowerCase() })
2727
+ children: /* @__PURE__ */ P(g, { children: String(e.catLabel || e.cat || "item").toLowerCase() })
2728
2728
  }), /* @__PURE__ */ P("span", {
2729
2729
  className: "cmg-redact-file mono",
2730
2730
  children: e.file || "unknown"
@@ -2761,7 +2761,7 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2761
2761
  onClick: () => {
2762
2762
  N((e) => {
2763
2763
  let t = !e;
2764
- return w?.(t), t;
2764
+ return T?.(t), t;
2765
2765
  });
2766
2766
  },
2767
2767
  children: [P(j ? ie : W, {
@@ -2784,14 +2784,14 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2784
2784
  R ? /* @__PURE__ */ F("button", {
2785
2785
  type: "button",
2786
2786
  className: "btn btn-sm btn-primary",
2787
- onClick: () => y?.(),
2787
+ onClick: () => _?.(),
2788
2788
  children: [/* @__PURE__ */ P(pe, {
2789
2789
  size: 14,
2790
2790
  "aria-hidden": "true"
2791
2791
  }), " join as contributor"]
2792
2792
  }) : null
2793
2793
  ]
2794
- }) : l.length > 0 ? /* @__PURE__ */ F("table", {
2794
+ }) : c.length > 0 ? /* @__PURE__ */ F("table", {
2795
2795
  className: "dtable cmg-dtable",
2796
2796
  children: [/* @__PURE__ */ P("thead", { children: /* @__PURE__ */ F("tr", { children: [
2797
2797
  /* @__PURE__ */ P("th", {
@@ -2820,7 +2820,7 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2820
2820
  scope: "col",
2821
2821
  children: "date"
2822
2822
  })
2823
- ] }) }), /* @__PURE__ */ P("tbody", { children: l.map((e) => /* @__PURE__ */ F("tr", { children: [
2823
+ ] }) }), /* @__PURE__ */ P("tbody", { children: c.map((e) => /* @__PURE__ */ F("tr", { children: [
2824
2824
  /* @__PURE__ */ P("td", { children: e.title || "untitled transcript" }),
2825
2825
  /* @__PURE__ */ P("td", {
2826
2826
  className: "mono",
@@ -2871,7 +2871,7 @@ function ft({ data: e = lt, actions: t = {}, demoRoleSwitcher: n = !1 } = {}) {
2871
2871
  overflow: "auto",
2872
2872
  maxWidth: "100%"
2873
2873
  },
2874
- children: /* @__PURE__ */ P(f, {
2874
+ children: /* @__PURE__ */ P(C, {
2875
2875
  title: "members",
2876
2876
  roles: ["member", "contributor"],
2877
2877
  members: o.map((e) => ({